X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fverbs.h;h=2055ac2eee82ae84e0b4fefbf7f302621c599d28;hb=ff3a165e5809a39bc3a331b5960cf9e41945ad77;hp=2b4c952e9c9c590c11cd129dbad3854f9955da3a;hpb=0f56c2445f84fd726f46e2f6f3d11d062ee42ee1;p=inkscape.git diff --git a/src/verbs.h b/src/verbs.h index 2b4c952e9..2055ac2ee 100644 --- a/src/verbs.h +++ b/src/verbs.h @@ -9,6 +9,9 @@ * Ted Gould * David Yip * + * Copyright (C) 2006 Johan Engelen + * Copyright (C) (date unspecified) Authors + * This code is in public domain if done by Lauris * This code is GPL if done by Ted or David */ @@ -16,6 +19,7 @@ #include "require-config.h" /* HAVE_GTK_WINDOW_FULLSCREEN */ #include "helper/helper-forward.h" #include "forward.h" +#include /** \brief This anonymous enum is used to provide a list of the Verbs which are defined staticly in the verb files. There may be @@ -30,6 +34,7 @@ enum { SP_VERB_FILE_REVERT, /**< Revert this file to its original state. */ SP_VERB_FILE_SAVE, /**< Save the current file with its saved filename */ SP_VERB_FILE_SAVE_AS, /**< Save the current file with a new filename */ + SP_VERB_FILE_SAVE_A_COPY, /**< Save a copy of the current file */ SP_VERB_FILE_PRINT, SP_VERB_FILE_VACUUM, SP_VERB_FILE_PRINT_DIRECT, @@ -187,6 +192,7 @@ enum { SP_VERB_DIALOG_SWATCHES, SP_VERB_DIALOG_TRANSFORM, SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + SP_VERB_DIALOG_UNDO_HISTORY, SP_VERB_DIALOG_TEXT, SP_VERB_DIALOG_XML_EDITOR, SP_VERB_DIALOG_FIND, @@ -196,22 +202,17 @@ 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_XMPP_CLIENT, #endif SP_VERB_DIALOG_INPUT, + SP_VERB_DIALOG_EXTENSIONEDITOR, + SP_VERB_DIALOG_LAYERS, /* Help */ SP_VERB_HELP_KEYS, SP_VERB_HELP_ABOUT_EXTENSIONS, SP_VERB_HELP_MEMORY, SP_VERB_HELP_ABOUT, - SP_VERB_SHOW_LICENSE, + //SP_VERB_SHOW_LICENSE, /* Tutorials */ SP_VERB_TUTORIAL_BASIC, SP_VERB_TUTORIAL_SHAPES, @@ -223,6 +224,10 @@ enum { /* Effects */ SP_VERB_EFFECT_LAST, SP_VERB_EFFECT_LAST_PREF, + /* Fit Canvas */ + SP_VERB_FIT_CANVAS_TO_SELECTION, + SP_VERB_FIT_CANVAS_TO_DRAWING, + SP_VERB_FIT_CANVAS_TO_SELECTION_OR_DRAWING, /* Footer */ SP_VERB_LAST }; @@ -251,8 +256,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. */ @@ -303,6 +313,8 @@ public: gchar const * get_id (void) { return _id; } /** \brief Accessor to get the internal variable. */ gchar const * get_name (void) { return _name; } + /** \brief Accessor to get the internal variable. */ + gchar const * get_image (void) { return _image; } /** \brief Set the name after initialization. */ gchar const * set_name (gchar const * name) { _name = name; return _name; } @@ -373,6 +385,19 @@ public: void delete_view (Inkscape::UI::View::View * view); void sensitive (SPDocument * in_doc = NULL, bool in_sensitive = true); + void name (SPDocument * in_doc = NULL, Glib::ustring in_name = ""); + +// 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 */