Code

#include "config.h" too
[inkscape.git] / src / verbs.h
index d715466e7c7016e39cd63b0c614377eacf916264..5d364c53bdf6823bcf310b3e3ad812f7cf0cfa8c 100644 (file)
@@ -196,17 +196,18 @@ enum {
     SP_VERB_DIALOG_CLONETILER,
     SP_VERB_DIALOG_ITEM,
 #ifdef WITH_INKBOARD
-       SP_VERB_DIALOG_WHITEBOARD_CONNECT,
-       SP_VERB_DIALOG_WHITEBOARD_SHAREWITHUSER,
-       SP_VERB_DIALOG_WHITEBOARD_SHAREWITHCHAT,
-       SP_VERB_DIALOG_WHITEBOARD_DUMPXMLTRACKER,
-       SP_VERB_DIALOG_WHITEBOARD_OPENSESSIONFILE,
-       SP_VERB_DIALOG_WHITEBOARD_SESSIONPLAYBACK,
-       SP_VERB_DIALOG_WHITEBOARD_DISCONNECT_FROM_SESSION,
-       SP_VERB_DIALOG_WHITEBOARD_DISCONNECT_FROM_SERVER,
+    SP_VERB_DIALOG_WHITEBOARD_CONNECT,
+    SP_VERB_DIALOG_WHITEBOARD_SHAREWITHUSER,
+    SP_VERB_DIALOG_WHITEBOARD_SHAREWITHCHAT,
+    SP_VERB_DIALOG_WHITEBOARD_DUMPXMLTRACKER,
+    SP_VERB_DIALOG_WHITEBOARD_OPENSESSIONFILE,
+    SP_VERB_DIALOG_WHITEBOARD_SESSIONPLAYBACK,
+    SP_VERB_DIALOG_WHITEBOARD_DISCONNECT_FROM_SESSION,
+    SP_VERB_DIALOG_WHITEBOARD_DISCONNECT_FROM_SERVER,
 #endif
     SP_VERB_DIALOG_INPUT,
     SP_VERB_DIALOG_EXTENSIONEDITOR,
+    SP_VERB_DIALOG_LAYERS,
     /* Help */
     SP_VERB_HELP_KEYS,
     SP_VERB_HELP_ABOUT_EXTENSIONS,
@@ -256,8 +257,13 @@ private:
         to find the different verbs in the hash map. */
     struct ltstr {
         bool operator()(const char* s1, const char* s2) const {
-            if (s1 == NULL || s2 == NULL) return true;
-            return strcmp(s1, s2) < 0;
+            if ( (s1 == NULL) && (s2 != NULL) ) {
+                return true;
+            } else if (s1 == NULL || s2 == NULL) {
+                return false;
+            } else {
+                return strcmp(s1, s2) < 0;
+            }
         }
     };
     /** \brief An easy to use definition of the table of verbs by ID. */
@@ -378,6 +384,18 @@ public:
     void delete_view (Inkscape::UI::View::View * view);
 
     void sensitive (SPDocument * in_doc = NULL, bool in_sensitive = true);
+
+// Yes, multiple public, protected and private sections are bad. We'll clean that up later
+protected:
+    /** \brief Returns the size of the internal base verb array.
+        \return The size in elements of the internal base array.
+
+        This is an inline function intended for testing. This should normally not be used.
+        For testing, a subclass that returns this value can be created to verify that the
+        length matches the enum values, etc.
+    */
+    static int _getBaseListSize() {return G_N_ELEMENTS(_base_verbs);}
+
 }; /* Verb class */