1 /*
2 * Authors:
3 * Ted Gould <ted@gould.cx>
4 *
5 * Copyright (C) 2002-2004 Authors
6 *
7 * Released under GNU GPL, read the file 'COPYING' for more information
8 */
11 #ifndef INKSCAPE_EXTENSION_EFFECT_H__
12 #define INKSCAPE_EXTENSION_EFFECT_H__
14 #include <config.h>
16 #include <glibmm/i18n.h>
17 #include <gtk/gtkdialog.h>
18 #include "verbs.h"
20 #include "extension.h"
22 struct SPDocument;
24 namespace Inkscape {
25 namespace UI {
26 namespace View {
27 typedef View View;
28 };
29 };
31 namespace Extension {
33 class Effect : public Extension {
34 static Effect * _last_effect;
35 static Inkscape::XML::Node * _effects_list;
36 bool find_effects_list (Inkscape::XML::Node * menustruct);
37 void merge_menu (Inkscape::XML::Node * base, Inkscape::XML::Node * patern, Inkscape::XML::Node * mergee);
39 class EffectVerb : public Inkscape::Verb {
40 private:
41 static void perform (SPAction * action, void * mydata, void * otherdata);
42 static SPActionEventVector vector;
44 Effect * _effect;
45 protected:
46 virtual SPAction * make_action (Inkscape::UI::View::View * view);
47 public:
48 /** \brief Use the Verb initializer with the same parameters. */
49 EffectVerb(gchar const * id,
50 gchar const * name,
51 gchar const * tip,
52 gchar const * image,
53 Effect * effect) :
54 Verb(id, _(name), _(tip), image), _effect(effect) {
55 /* No clue why, but this is required */
56 this->set_default_sensitive(true);
57 }
58 };
59 EffectVerb _verb;
60 Inkscape::XML::Node * _menu_node;
61 public:
62 Effect (Inkscape::XML::Node * in_repr,
63 Implementation::Implementation * in_imp);
64 virtual ~Effect (void);
65 virtual bool check (void);
66 bool prefs (Inkscape::UI::View::View * doc);
67 void effect (Inkscape::UI::View::View * doc);
68 Inkscape::Verb * get_verb (void) { return &_verb; };
70 static Effect * get_last_effect (void) { return _last_effect; };
71 static void set_last_effect (Effect * in_effect);
73 static void place_menus (void);
74 void place_menu (Inkscape::XML::Node * menus);
76 private:
77 static gchar * remove_ (gchar * instr);
78 };
80 } } /* namespace Inkscape, Extension */
81 #endif /* INKSCAPE_EXTENSION_EFFECT_H__ */
83 /*
84 Local Variables:
85 mode:c++
86 c-file-style:"stroustrup"
87 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
88 indent-tabs-mode:nil
89 fill-column:99
90 End:
91 */
92 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :