verbs.h revision 128bd686fa05ac035a466f70a6a8e61172542782
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering * \brief Frontend to actions
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering * Lauris Kaplinski <lauris@kaplinski.com>
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering * Ted Gould <ted@gould.cx>
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering * David Yip <yipdw@rose-hulman.edu>
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering * Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl>
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering * Copyright (C) (date unspecified) Authors
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering * This code is in public domain if done by Lauris
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering * This code is GPL if done by Ted or David
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering#include "require-config.h" /* HAVE_GTK_WINDOW_FULLSCREEN */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering/** \brief This anonymous enum is used to provide a list of the Verbs
3f6fd1ba65f962702753c4ad284b588e59689a23Lennart Poettering which are defined staticly in the verb files. There may be
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering other verbs which are defined dynamically also. */
25300b5a1fcf54674a69d0f4ab08925be00b0227Lennart Poettering SP_VERB_INVALID, /**< A dummy verb to represent doing something wrong. */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering SP_VERB_NONE, /**< A dummy verb to represent not having a verb. */
3f6fd1ba65f962702753c4ad284b588e59689a23Lennart Poettering SP_VERB_FILE_NEW, /**< A new file in a new window. */
3f6fd1ba65f962702753c4ad284b588e59689a23Lennart Poettering SP_VERB_FILE_REVERT, /**< Revert this file to its original state. */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering SP_VERB_FILE_SAVE, /**< Save the current file with its saved filename */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering SP_VERB_FILE_SAVE_AS, /**< Save the current file with a new filename */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering SP_VERB_FILE_SAVE_A_COPY, /**< Save a copy of the current file */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering SP_VERB_FILE_IMPORT_FROM_OCAL, /**< Import the file from Open Clip Art Library */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering SP_VERB_FILE_EXPORT_TO_OCAL, /**< Export the file to Open Clip Art Library */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering /* Selection */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering /* Tool preferences */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering /* Zooming and desktop settings */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering#endif /* HAVE_GTK_WINDOW_FULLSCREEN */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering //SP_VERB_SHOW_LICENSE,
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering /* Tutorials */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering /* Fit Canvas */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering SP_VERB_FIT_CANVAS_TO_SELECTION_OR_DRAWING,
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering /* LockAndHide */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poetteringgchar *sp_action_get_title (const SPAction *action);
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering/** \brief A class to represent things the user can do. In many ways
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering these are 'action factories' as they are used to create
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering individual actions that are based on a given view.
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering /** \brief An easy to use defition of the table of verbs by code. */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering typedef std::map<unsigned int, Inkscape::Verb *> VerbTable;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering /** \brief A table of all the dynamically created verbs. */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering /** \brief The table of statically created verbs which are mostly
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering 'base verbs'. */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering static Verb * _base_verbs[SP_VERB_LAST + 1];
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering /* Plus one because there is an entry for SP_VERB_LAST */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering /** A string comparison function to be used in the Verb ID lookup
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering to find the different verbs in the hash map. */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering bool operator()(const char* s1, const char* s2) const {
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering /** \brief An easy to use definition of the table of verbs by ID. */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering typedef std::map<gchar const *, Verb *, ltstr> VerbIDTable;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering /** \brief Quick lookup of verbs by ID */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering /** \brief A simple typedef to make using the action table easier. */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering typedef std::map<Inkscape::UI::View::View *, SPAction *> ActionTable;
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering /** \brief A list of all the actions that have been created for this
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering verb. It is referenced by the view that they are created for. */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering /** \brief A unique textual ID for the verb. */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering /** \brief The full name of the verb. (shown on menu entries) */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering /** \brief Tooltip for the verb. */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering /** \brief Name of the image that represents the verb. */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering /** \brief Unique numerical representation of the verb. In most cases
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering it is a value from the anonymous enum at the top of this
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering /** \brief Whether this verb is set to default to sensitive or
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering insensitive when new actions are created. */
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering /** \brief Allows for preliminary setting of the \c _default_sensitive
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering value without effecting existing actions
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering \param in_val New value
587fec427c80b6c34dcf1d7570f891fcb652a7c5Lennart Poettering This function is mostly used at initialization where there are
SPAction * make_action_helper (Inkscape::UI::View::View * view, SPActionEventVector * vector, void * in_pntr = NULL);
_actions(NULL), _id(id), _name(name), _tip(tip), _image(image), _code(code), _default_sensitive(true) {
static void list (void);