Mercurial > MadButterfly
comparison inkscape/firefox/inkscape-mb-patch.diff @ 339:63aaf96209cd
* Move location of files so that we can produce XPI file from them.
* Add the produce to compile the inkscape for madbutterfly
* Add makefile to produce inkscape and madbuilder.xpi
author | wycc |
---|---|
date | Sun, 08 Mar 2009 10:05:22 +0800 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
336:995eb2c1a1aa | 339:63aaf96209cd |
---|---|
1 diff -cr inkscape-0.46/share/ui/menus-bars.xml inkscape-0.46-mb/share/ui/menus-bars.xml | |
2 *** inkscape-0.46/share/ui/menus-bars.xml 2008-03-11 12:21:15.000000000 +0800 | |
3 --- inkscape-0.46-mb/share/ui/menus-bars.xml 2009-01-18 12:09:57.000000000 +0800 | |
4 *************** | |
5 *** 22,27 **** | |
6 --- 22,28 ---- | |
7 <menuitem action='InkscapePreferences'/> | |
8 <separator/> | |
9 <menuitem action='Close'/> | |
10 + <menuitem action='EffectMadButterfly'/> | |
11 <menuitem action='Quit'/> | |
12 </menu> | |
13 <menu action='MenuEdit'> | |
14 diff -cr inkscape-0.46/src/dom/io/uristream.cpp inkscape-0.46-mb/src/dom/io/uristream.cpp | |
15 *** inkscape-0.46/src/dom/io/uristream.cpp 2008-03-11 12:19:31.000000000 +0800 | |
16 --- inkscape-0.46-mb/src/dom/io/uristream.cpp 2008-11-04 23:08:25.000000000 +0800 | |
17 *************** | |
18 *** 39,45 **** | |
19 * Released under GNU GPL, read the file 'COPYING' for more information | |
20 */ | |
21 | |
22 ! | |
23 #include "uristream.h" | |
24 | |
25 | |
26 --- 39,45 ---- | |
27 * Released under GNU GPL, read the file 'COPYING' for more information | |
28 */ | |
29 | |
30 ! #include <string.h> | |
31 #include "uristream.h" | |
32 | |
33 | |
34 diff -cr inkscape-0.46/src/extension/effect.cpp inkscape-0.46-mb/src/extension/effect.cpp | |
35 *** inkscape-0.46/src/extension/effect.cpp 2008-03-11 12:20:24.000000000 +0800 | |
36 --- inkscape-0.46-mb/src/extension/effect.cpp 2009-01-18 10:54:48.000000000 +0800 | |
37 *************** | |
38 *** 27,32 **** | |
39 --- 27,35 ---- | |
40 namespace Extension { | |
41 | |
42 Effect * Effect::_last_effect = NULL; | |
43 + #ifdef CONF_MADBUTTERFLY | |
44 + Effect * Effect::MadButterflyEffect = NULL; | |
45 + #endif | |
46 Inkscape::XML::Node * Effect::_effects_list = NULL; | |
47 | |
48 Effect::Effect (Inkscape::XML::Node * in_repr, Implementation::Implementation * in_imp) | |
49 *************** | |
50 *** 44,49 **** | |
51 --- 47,58 ---- | |
52 if (!strcmp(this->get_id(), "org.inkscape.filter.dropshadow")) | |
53 return; | |
54 | |
55 + #ifdef CONF_MADBUTTERFLY | |
56 + if (!strcmp(this->get_id(),"net.sourceforge.madbutterfly.filter.update")) { | |
57 + MadButterflyEffect = this; | |
58 + } | |
59 + #endif | |
60 + | |
61 bool hidden = false; | |
62 | |
63 no_doc = false; | |
64 diff -cr inkscape-0.46/src/extension/effect.h inkscape-0.46-mb/src/extension/effect.h | |
65 *** inkscape-0.46/src/extension/effect.h 2008-03-11 12:20:18.000000000 +0800 | |
66 --- inkscape-0.46-mb/src/extension/effect.h 2009-01-18 09:51:23.000000000 +0800 | |
67 *************** | |
68 *** 40,45 **** | |
69 --- 40,48 ---- | |
70 /** \brief This is the last effect that was used. This is used in | |
71 a menu item to rapidly recall the same effect. */ | |
72 static Effect * _last_effect; | |
73 + #ifdef CONF_MADBUTTERFLY | |
74 + static Effect * MadButterflyEffect; | |
75 + #endif | |
76 /** \brief The location of the effects menu on the menu structure | |
77 XML file. This is saved so it only has to be discovered | |
78 once. */ | |
79 *************** | |
80 *** 120,125 **** | |
81 --- 123,131 ---- | |
82 | |
83 /** \brief Static function to get the last effect used */ | |
84 static Effect * get_last_effect (void) { return _last_effect; }; | |
85 + #ifdef CONF_MADBUTTERFLY | |
86 + static Effect * get_madbutterfly_effect (void) { return MadButterflyEffect; }; | |
87 + #endif | |
88 static void set_last_effect (Effect * in_effect); | |
89 | |
90 static void place_menus (void); | |
91 diff -cr inkscape-0.46/src/extension/init.cpp inkscape-0.46-mb/src/extension/init.cpp | |
92 *** inkscape-0.46/src/extension/init.cpp 2008-03-11 12:20:24.000000000 +0800 | |
93 --- inkscape-0.46-mb/src/extension/init.cpp 2009-01-18 10:16:51.000000000 +0800 | |
94 *************** | |
95 *** 97,103 **** | |
96 #include "internal/bitmap/unsharpmask.h" | |
97 #include "internal/bitmap/wave.h" | |
98 #endif /* WITH_IMAGE_MAGICK */ | |
99 ! | |
100 extern gboolean inkscape_app_use_gui( Inkscape::Application const *app ); | |
101 | |
102 namespace Inkscape { | |
103 --- 97,103 ---- | |
104 #include "internal/bitmap/unsharpmask.h" | |
105 #include "internal/bitmap/wave.h" | |
106 #endif /* WITH_IMAGE_MAGICK */ | |
107 ! #include "effect.h" | |
108 extern gboolean inkscape_app_use_gui( Inkscape::Application const *app ); | |
109 | |
110 namespace Inkscape { | |
111 diff -cr inkscape-0.46/src/inkscape.cpp inkscape-0.46-mb/src/inkscape.cpp | |
112 *** inkscape-0.46/src/inkscape.cpp 2008-03-11 12:20:05.000000000 +0800 | |
113 --- inkscape-0.46-mb/src/inkscape.cpp 2009-01-21 23:48:17.000000000 +0800 | |
114 *************** | |
115 *** 61,66 **** | |
116 --- 61,68 ---- | |
117 #include "prefs-utils.h" | |
118 #include "xml/repr.h" | |
119 #include "io/sys.h" | |
120 + #include "verbs.h" | |
121 + #include "helper/action.h" | |
122 | |
123 #include "extension/init.h" | |
124 | |
125 *************** | |
126 *** 577,582 **** | |
127 --- 579,596 ---- | |
128 } | |
129 | |
130 | |
131 + #ifdef CONF_MADBUTTERFLY | |
132 + void | |
133 + inkscape_int_handler(int signo) | |
134 + { | |
135 + SPDesktop *desk = inkscape_active_desktop(); | |
136 + Inkscape::Verb *v = Inkscape::Verb::get(SP_VERB_EFFECT_MADBUTTERFLY); | |
137 + SPAction *act = v->get_action(desk); | |
138 + if (act) | |
139 + sp_action_perform(act,NULL); | |
140 + signal(SIGINT, inkscape_int_handler); | |
141 + } | |
142 + #endif | |
143 | |
144 void | |
145 inkscape_application_init (const gchar *argv0, gboolean use_gui) | |
146 *************** | |
147 *** 591,596 **** | |
148 --- 605,613 ---- | |
149 #ifndef WIN32 | |
150 bus_handler = signal (SIGBUS, inkscape_crash_handler); | |
151 #endif | |
152 + //#ifdef CONF_MADBUTTERFLY | |
153 + signal(SIGUSR2, inkscape_int_handler); | |
154 + //#endif | |
155 | |
156 inkscape->use_gui = use_gui; | |
157 inkscape->argv0 = g_strdup(argv0); | |
158 diff -cr inkscape-0.46/src/verbs.cpp inkscape-0.46-mb/src/verbs.cpp | |
159 *** inkscape-0.46/src/verbs.cpp 2008-03-11 12:20:07.000000000 +0800 | |
160 --- inkscape-0.46-mb/src/verbs.cpp 2009-01-18 12:04:40.000000000 +0800 | |
161 *************** | |
162 *** 1903,1908 **** | |
163 --- 1903,1974 ---- | |
164 SPActionEventVector TextVerb::vector = | |
165 {{NULL},TextVerb::perform, NULL, NULL, NULL, NULL}; | |
166 | |
167 + #ifdef CONF_MADBUTTERFLY | |
168 + /* *********** Effect MadButterfly ********** */ | |
169 + | |
170 + /** \brief A class to represent the last effect issued */ | |
171 + class EffectMadButterflyVerb : public Verb { | |
172 + private: | |
173 + static void perform(SPAction *action, void *mydata, void *otherdata); | |
174 + static SPActionEventVector vector; | |
175 + protected: | |
176 + virtual SPAction *make_action(Inkscape::UI::View::View *view); | |
177 + public: | |
178 + /** \brief Use the Verb initializer with the same parameters. */ | |
179 + EffectMadButterflyVerb(unsigned int const code, | |
180 + gchar const *id, | |
181 + gchar const *name, | |
182 + gchar const *tip, | |
183 + gchar const *image) : | |
184 + Verb(code, id, name, tip, image) | |
185 + { | |
186 + set_default_sensitive(false); | |
187 + } | |
188 + }; /* EffectMadButterflyVerb class */ | |
189 + | |
190 + /** | |
191 + * The vector to attach in the last effect verb. | |
192 + */ | |
193 + SPActionEventVector EffectMadButterflyVerb::vector = | |
194 + {{NULL},EffectMadButterflyVerb::perform, NULL, NULL, NULL, NULL}; | |
195 + | |
196 + /** \brief Create an action for a \c EffectLastVerb | |
197 + \param view Which view the action should be created for | |
198 + \return The built action. | |
199 + | |
200 + Calls \c make_action_helper with the \c vector. | |
201 + */ | |
202 + SPAction * | |
203 + EffectMadButterflyVerb::make_action(Inkscape::UI::View::View *view) | |
204 + { | |
205 + return make_action_helper(view, &vector); | |
206 + } | |
207 + | |
208 + /** \brief Decode the verb code and take appropriate action */ | |
209 + void | |
210 + EffectMadButterflyVerb::perform(SPAction *action, void *data, void */*pdata*/) | |
211 + { | |
212 + /* These aren't used, but are here to remind people not to use | |
213 + the CURRENT_DOCUMENT macros unless they really have to. */ | |
214 + Inkscape::UI::View::View *current_view = sp_action_get_view(action); | |
215 + // SPDocument *current_document = SP_VIEW_DOCUMENT(current_view); | |
216 + Inkscape::Extension::Effect *effect = Inkscape::Extension::Effect::get_madbutterfly_effect(); | |
217 + | |
218 + if (effect == NULL) return; | |
219 + if (current_view == NULL) return; | |
220 + | |
221 + switch ((long) data) { | |
222 + case SP_VERB_EFFECT_MADBUTTERFLY: | |
223 + effect->effect(current_view); | |
224 + break; | |
225 + default: | |
226 + return; | |
227 + } | |
228 + | |
229 + return; | |
230 + } | |
231 + /* *********** End Effect MadButterfly ********** */ | |
232 + #endif | |
233 | |
234 /* *********** Effect Last ********** */ | |
235 | |
236 *************** | |
237 *** 2570,2575 **** | |
238 --- 2636,2645 ---- | |
239 N_("Repeat the last effect with the same settings"), NULL), | |
240 new EffectLastVerb(SP_VERB_EFFECT_LAST_PREF, "EffectLastPref", N_("Previous Effect Settings..."), | |
241 N_("Repeat the last effect with new settings"), NULL), | |
242 + //#ifdef CONF_MADBUTTERFLY | |
243 + new EffectMadButterflyVerb(SP_VERB_EFFECT_MADBUTTERFLY, "EffectMadButterfly", N_("Effect for MadButterfly"), | |
244 + N_("For MadButterfly integration"), NULL), | |
245 + //#endif | |
246 | |
247 /* Fit Page */ | |
248 new FitCanvasVerb(SP_VERB_FIT_CANVAS_TO_SELECTION, "FitCanvasToSelection", N_("Fit Page to Selection"), | |
249 diff -cr inkscape-0.46/src/verbs.h inkscape-0.46-mb/src/verbs.h | |
250 *** inkscape-0.46/src/verbs.h 2008-03-11 12:20:28.000000000 +0800 | |
251 --- inkscape-0.46-mb/src/verbs.h 2009-01-18 00:37:43.000000000 +0800 | |
252 *************** | |
253 *** 23,29 **** | |
254 #include "helper/helper-forward.h" | |
255 #include "forward.h" | |
256 #include <glibmm/ustring.h> | |
257 ! | |
258 /** \brief This anonymous enum is used to provide a list of the Verbs | |
259 which are defined staticly in the verb files. There may be | |
260 other verbs which are defined dynamically also. */ | |
261 --- 23,29 ---- | |
262 #include "helper/helper-forward.h" | |
263 #include "forward.h" | |
264 #include <glibmm/ustring.h> | |
265 ! #define CONF_MADBUTTERFLY | |
266 /** \brief This anonymous enum is used to provide a list of the Verbs | |
267 which are defined staticly in the verb files. There may be | |
268 other verbs which are defined dynamically also. */ | |
269 *************** | |
270 *** 246,251 **** | |
271 --- 246,252 ---- | |
272 /* Effects */ | |
273 SP_VERB_EFFECT_LAST, | |
274 SP_VERB_EFFECT_LAST_PREF, | |
275 + SP_VERB_EFFECT_MADBUTTERFLY, | |
276 /* Fit Canvas */ | |
277 SP_VERB_FIT_CANVAS_TO_SELECTION, | |
278 SP_VERB_FIT_CANVAS_TO_DRAWING, |