Code

allow an effect to be hidden from the effects menu
authorbuliabyak <buliabyak@users.sourceforge.net>
Mon, 9 Oct 2006 23:16:46 +0000 (23:16 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Mon, 9 Oct 2006 23:16:46 +0000 (23:16 +0000)
src/extension/effect.cpp

index 71ddf3e247216509297ae421e9d49dfdfba3dc55..168688f0ef75b2e46b3897d4522b6d6b7034bcd1 100644 (file)
@@ -32,6 +32,8 @@ Effect::Effect (Inkscape::XML::Node * in_repr, Implementation::Implementation *
     if (!strcmp(this->get_id(), "org.inkscape.filter.dropshadow"))
         return;
 
+    bool hidden = false;
+
     if (repr != NULL) {
         Inkscape::XML::Node * child_repr;
 
@@ -41,6 +43,9 @@ Effect::Effect (Inkscape::XML::Node * in_repr, Implementation::Implementation *
                     if (!strcmp(child_repr->name(), "effects-menu")) {
                         // printf("Found local effects menu in %s\n", this->get_name());
                         local_effects_menu = sp_repr_children(child_repr);
+                        if (child_repr->attribute("hidden") && !strcmp(child_repr->attribute("hidden"), "yes")) {
+                            hidden = true;
+                        }
                     }
                     if (!strcmp(child_repr->name(), "menu-name") ||
                             !strcmp(child_repr->name(), "_menu-name")) {
@@ -65,7 +70,8 @@ Effect::Effect (Inkscape::XML::Node * in_repr, Implementation::Implementation *
         _menu_node = sp_repr_new("verb");
         _menu_node->setAttribute("verb-id", this->get_id(), false);
 
-        merge_menu(_effects_list->parent(), _effects_list, local_effects_menu, _menu_node);
+        if (!hidden)
+            merge_menu(_effects_list->parent(), _effects_list, local_effects_menu, _menu_node);
     }
 
     return;