Code

r10950@tres: ted | 2006-02-16 08:36:49 -0800
[inkscape.git] / src / extension / effect.h
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 * start, 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     /** \brief  Accessor function for a pointer to the verb */
69     Inkscape::Verb * get_verb (void) { return &_verb; };
71     /** \brief  Static function to get the last effect used */
72     static Effect *  get_last_effect (void) { return _last_effect; };
73     static void      set_last_effect (Effect * in_effect);
75     static void      place_menus (void);
76     void             place_menu (Inkscape::XML::Node * menus);
78 private:
79     static gchar *   remove_ (gchar * instr);
80 };
82 } }  /* namespace Inkscape, Extension */
83 #endif /* INKSCAPE_EXTENSION_EFFECT_H__ */
85 /*
86   Local Variables:
87   mode:c++
88   c-file-style:"stroustrup"
89   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
90   indent-tabs-mode:nil
91   fill-column:99
92   End:
93 */
94 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :