Code

switch from invokeBbox to getBounds (need to fix problems with empty
[inkscape.git] / src / extension / effect.h
index d93dc5567a8ebe18f8ac93cfd6fcf7f9eebd7992..b6fc80aa5c00ff63fdcaaf53ec62c1e00a505615 100644 (file)
@@ -30,18 +30,34 @@ typedef View View;
 
 namespace Extension {
 
+/** \brief  Effects are extensions that take a document and do something
+            to it in place.  This class adds the extra functions required
+            to make extensions effects.
+*/
 class Effect : public Extension {
+    /** \brief  This is the last effect that was used.  This is used in
+                a menu item to rapidly recall the same effect. */
     static Effect * _last_effect;
+    /** \brief  The location of the effects menu on the menu structure
+                XML file.  This is saved so it only has to be discovered
+                once. */
     static Inkscape::XML::Node * _effects_list;
     bool find_effects_list (Inkscape::XML::Node * menustruct);
     void merge_menu (Inkscape::XML::Node * base, Inkscape::XML::Node * start, Inkscape::XML::Node * patern, Inkscape::XML::Node * mergee);
 
+    /** \brief  This is the verb type that is used for all effect's verbs.
+                It provides convience functions and maintains a pointer
+                back to the effect that created it.  */
     class EffectVerb : public Inkscape::Verb {
         private:
             static void perform (SPAction * action, void * mydata, void * otherdata);
+            /** \brief  Function to call for specific actions */
             static SPActionEventVector vector;
 
+            /** \brief  The effect that this verb represents. */
             Effect * _effect;
+            /** \brief  Whether or not to show preferences on display */
+            bool _showPrefs;
         protected:
             virtual SPAction * make_action (Inkscape::UI::View::View * view);
         public:
@@ -50,13 +66,24 @@ class Effect : public Extension {
                        gchar const * name,
                        gchar const * tip,
                        gchar const * image,
-                       Effect *      effect) :
-                    Verb(id, _(name), _(tip), image), _effect(effect) {
+                       Effect *      effect,
+                       bool          showPrefs) :
+                    Verb(id, _(name), _(tip), image), _effect(effect), _showPrefs(showPrefs) {
                 /* No clue why, but this is required */
                 this->set_default_sensitive(true);
             }
     };
+
+    /** \brief  ID used for the verb without preferences */
+    Glib::ustring _id_noprefs;
+    /** \brief  Name used for the verb without preferences */
+    Glib::ustring _name_noprefs;
+
+    /** \brief  The verb representing this effect. */
     EffectVerb _verb;
+    /** \brief  The verb representing this effect.  Without preferences. */
+    EffectVerb _verb_nopref;
+    /** \brief  Menu node created for this effect */
     Inkscape::XML::Node * _menu_node;
 public:
                  Effect  (Inkscape::XML::Node * in_repr,
@@ -75,6 +102,10 @@ public:
     static void      place_menus (void);
     void             place_menu (Inkscape::XML::Node * menus);
 
+    Gtk::VBox *    get_info_widget(void);
+
+    bool no_doc; // if true, the effect does not process SVG document at all, so no need to save, read, and watch for errors
+
 private:
     static gchar *   remove_ (gchar * instr);
 };