Code

M build.xml
[inkscape.git] / src / verbs.cpp
1 #define __SP_VERBS_C__
2 /**
3  * \file verbs.cpp
4  *
5  * \brief Actions for inkscape
6  *
7  * This file implements routines necessary to deal with verbs.  A verb
8  * is a numeric identifier used to retrieve standard SPActions for particular
9  * views.
10  */
12 /*
13  * Authors:
14  *   Lauris Kaplinski <lauris@kaplinski.com>
15  *   Ted Gould <ted@gould.cx>
16  *   MenTaLguY <mental@rydia.net>
17  *   David Turner <novalis@gnu.org>
18  *   bulia byak <buliabyak@users.sf.net>
19  *
20  * Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl>
21  * Copyright (C) (date unspecified) Authors
22  * This code is in public domain.
23  */
26 #ifdef HAVE_CONFIG_H
27 # include "config.h"
28 #endif
30 #include <cstring>
31 #include <string>
32 #include <gtk/gtkstock.h>
34 #include "helper/action.h"
36 #include <gtkmm/messagedialog.h>
37 #include <gtkmm/filechooserdialog.h>
38 #include <gtkmm/stock.h>
40 #include "dialogs/text-edit.h"
41 #include "dialogs/xml-tree.h"
42 #include "dialogs/item-properties.h"
43 #include "dialogs/find.h"
44 #include "dialogs/layer-properties.h"
45 #include "dialogs/clonetiler.h"
46 #include "dialogs/iconpreview.h"
47 #include "dialogs/extensions.h"
48 #include "dialogs/swatches.h"
49 #include "dialogs/layers-panel.h"
50 #include "dialogs/input.h"
52 #ifdef WITH_INKBOARD
53 #include "jabber_whiteboard/session-manager.h"
54 #endif
56 #include "extension/effect.h"
58 #include "tools-switch.h"
59 #include "inkscape-private.h"
60 #include "file.h"
61 #include "help.h"
62 #include "document.h"
63 #include "desktop.h"
64 #include "message-stack.h"
65 #include "desktop-handles.h"
66 #include "selection-chemistry.h"
67 #include "path-chemistry.h"
68 #include "text-chemistry.h"
69 #include "ui/dialog/dialog-manager.h"
70 #include "ui/dialog/inkscape-preferences.h"
71 #include "interface.h"
72 #include "prefs-utils.h"
73 #include "splivarot.h"
74 #include "sp-namedview.h"
75 #include "sp-flowtext.h"
76 #include "layer-fns.h"
77 #include "node-context.h"
78 #include "select-context.h"
79 #include "seltrans.h"
80 #include "gradient-context.h"
81 #include "shape-editor.h"
82 #include "draw-context.h"
83 #include "gradient-drag.h"
86 /**
87  * \brief Return the name without underscores and ellipsis, for use in dialog
88  * titles, etc. Allocated memory must be freed by caller.
89  */
90 gchar *
91 sp_action_get_title(SPAction const *action)
92 {
93     char const *src = action->name;
94     gchar *ret = g_new(gchar, strlen(src) + 1);
95     unsigned ri = 0;
97     for (unsigned si = 0 ; ; si++)  {
98         int const c = src[si];
99         if ( c != '_' && c != '.' ) {
100             ret[ri] = c;
101             ri++;
102             if (c == '\0') {
103                 return ret;
104             }
105         }
106     }
108 } // end of sp_action_get_title()
110 namespace Inkscape {
112 /** \brief A class to encompass all of the verbs which deal with
113            file operations. */
114 class FileVerb : public Verb {
115 private:
116     static void perform(SPAction *action, void *mydata, void *otherdata);
117     static SPActionEventVector vector;
118 protected:
119     virtual SPAction *make_action(Inkscape::UI::View::View *view);
120 public:
121     /** \brief Use the Verb initializer with the same parameters. */
122     FileVerb(unsigned int const code,
123              gchar const *id,
124              gchar const *name,
125              gchar const *tip,
126              gchar const *image) :
127         Verb(code, id, name, tip, image)
128     { }
129 }; /* FileVerb class */
131 /** \brief A class to encompass all of the verbs which deal with
132            edit operations. */
133 class EditVerb : public Verb {
134 private:
135     static void perform(SPAction *action, void *mydata, void *otherdata);
136     static SPActionEventVector vector;
137 protected:
138     virtual SPAction *make_action(Inkscape::UI::View::View *view);
139 public:
140     /** \brief Use the Verb initializer with the same parameters. */
141     EditVerb(unsigned int const code,
142              gchar const *id,
143              gchar const *name,
144              gchar const *tip,
145              gchar const *image) :
146         Verb(code, id, name, tip, image)
147     { }
148 }; /* EditVerb class */
150 /** \brief A class to encompass all of the verbs which deal with
151            selection operations. */
152 class SelectionVerb : public Verb {
153 private:
154     static void perform(SPAction *action, void *mydata, void *otherdata);
155     static SPActionEventVector vector;
156 protected:
157     virtual SPAction *make_action(Inkscape::UI::View::View *view);
158 public:
159     /** \brief Use the Verb initializer with the same parameters. */
160     SelectionVerb(unsigned int const code,
161                   gchar const *id,
162                   gchar const *name,
163                   gchar const *tip,
164                   gchar const *image) :
165         Verb(code, id, name, tip, image)
166     { }
167 }; /* SelectionVerb class */
169 /** \brief A class to encompass all of the verbs which deal with
170            layer operations. */
171 class LayerVerb : public Verb {
172 private:
173     static void perform(SPAction *action, void *mydata, void *otherdata);
174     static SPActionEventVector vector;
175 protected:
176     virtual SPAction *make_action(Inkscape::UI::View::View *view);
177 public:
178     /** \brief Use the Verb initializer with the same parameters. */
179     LayerVerb(unsigned int const code,
180               gchar const *id,
181               gchar const *name,
182               gchar const *tip,
183               gchar const *image) :
184         Verb(code, id, name, tip, image)
185     { }
186 }; /* LayerVerb class */
188 /** \brief A class to encompass all of the verbs which deal with
189            operations related to objects. */
190 class ObjectVerb : public Verb {
191 private:
192     static void perform(SPAction *action, void *mydata, void *otherdata);
193     static SPActionEventVector vector;
194 protected:
195     virtual SPAction *make_action(Inkscape::UI::View::View *view);
196 public:
197     /** \brief Use the Verb initializer with the same parameters. */
198     ObjectVerb(unsigned int const code,
199                gchar const *id,
200                gchar const *name,
201                gchar const *tip,
202                gchar const *image) :
203         Verb(code, id, name, tip, image)
204     { }
205 }; /* ObjectVerb class */
207 /** \brief A class to encompass all of the verbs which deal with
208            operations relative to context. */
209 class ContextVerb : public Verb {
210 private:
211     static void perform(SPAction *action, void *mydata, void *otherdata);
212     static SPActionEventVector vector;
213 protected:
214     virtual SPAction *make_action(Inkscape::UI::View::View *view);
215 public:
216     /** \brief Use the Verb initializer with the same parameters. */
217     ContextVerb(unsigned int const code,
218                 gchar const *id,
219                 gchar const *name,
220                 gchar const *tip,
221                 gchar const *image) :
222         Verb(code, id, name, tip, image)
223     { }
224 }; /* ContextVerb class */
226 /** \brief A class to encompass all of the verbs which deal with
227            zoom operations. */
228 class ZoomVerb : public Verb {
229 private:
230     static void perform(SPAction *action, void *mydata, void *otherdata);
231     static SPActionEventVector vector;
232 protected:
233     virtual SPAction *make_action(Inkscape::UI::View::View *view);
234 public:
235     /** \brief Use the Verb initializer with the same parameters. */
236     ZoomVerb(unsigned int const code,
237              gchar const *id,
238              gchar const *name,
239              gchar const *tip,
240              gchar const *image) :
241         Verb(code, id, name, tip, image)
242     { }
243 }; /* ZoomVerb class */
246 /** \brief A class to encompass all of the verbs which deal with
247            dialog operations. */
248 class DialogVerb : public Verb {
249 private:
250     static void perform(SPAction *action, void *mydata, void *otherdata);
251     static SPActionEventVector vector;
252 protected:
253     virtual SPAction *make_action(Inkscape::UI::View::View *view);
254 public:
255     /** \brief Use the Verb initializer with the same parameters. */
256     DialogVerb(unsigned int const code,
257                gchar const *id,
258                gchar const *name,
259                gchar const *tip,
260                gchar const *image) :
261         Verb(code, id, name, tip, image)
262     { }
263 }; /* DialogVerb class */
265 /** \brief A class to encompass all of the verbs which deal with
266            help operations. */
267 class HelpVerb : public Verb {
268 private:
269     static void perform(SPAction *action, void *mydata, void *otherdata);
270     static SPActionEventVector vector;
271 protected:
272     virtual SPAction *make_action(Inkscape::UI::View::View *view);
273 public:
274     /** \brief Use the Verb initializer with the same parameters. */
275     HelpVerb(unsigned int const code,
276              gchar const *id,
277              gchar const *name,
278              gchar const *tip,
279              gchar const *image) :
280         Verb(code, id, name, tip, image)
281     { }
282 }; /* HelpVerb class */
284 /** \brief A class to encompass all of the verbs which deal with
285            tutorial operations. */
286 class TutorialVerb : public Verb {
287 private:
288     static void perform(SPAction *action, void *mydata, void *otherdata);
289     static SPActionEventVector vector;
290 protected:
291     virtual SPAction *make_action(Inkscape::UI::View::View *view);
292 public:
293     /** \brief Use the Verb initializer with the same parameters. */
294     TutorialVerb(unsigned int const code,
295                  gchar const *id,
296                  gchar const *name,
297                  gchar const *tip,
298                  gchar const *image) :
299         Verb(code, id, name, tip, image)
300     { }
301 }; /* TutorialVerb class */
303 /** \brief A class to encompass all of the verbs which deal with
304            text operations. */
305 class TextVerb : public Verb {
306 private:
307     static void perform(SPAction *action, void *mydata, void *otherdata);
308     static SPActionEventVector vector;
309 protected:
310     virtual SPAction *make_action(Inkscape::UI::View::View *view);
311 public:
312     /** \brief Use the Verb initializer with the same parameters. */
313     TextVerb(unsigned int const code,
314               gchar const *id,
315               gchar const *name,
316               gchar const *tip,
317               gchar const *image) :
318         Verb(code, id, name, tip, image)
319     { }
320 }; //TextVerb : public Verb
322 Verb::VerbTable Verb::_verbs;
323 Verb::VerbIDTable Verb::_verb_ids;
325 /** \brief  Create a verb without a code.
327     This function calls the other constructor for all of the parameters,
328     but generates the code.  It is important to READ THE OTHER DOCUMENTATION
329     it has important details in it.  To generate the code a static is
330     used which starts at the last static value: \c SP_VERB_LAST.  For
331     each call it is incremented.  The list of allocated verbs is kept
332     in the \c _verbs hashtable which is indexed by the \c code.
333 */
334 Verb::Verb(gchar const *id, gchar const *name, gchar const *tip, gchar const *image) :
335     _actions(NULL), _id(id), _name(name), _tip(tip), _image(image)
337     static int count = SP_VERB_LAST;
339     count++;
340     _code = count;
341     _verbs.insert(VerbTable::value_type(count, this));
342     _verb_ids.insert(VerbIDTable::value_type(_id, this));
344     return;
347 /** \brief  Destroy a verb.
349       The only allocated variable is the _actions variable.  If it has
350     been allocated it is deleted.
351 */
352 Verb::~Verb(void)
354     /// \todo all the actions need to be cleaned up first.
355     if (_actions != NULL) {
356         delete _actions;
357     }
359     return;
362 /** \brief  Verbs are no good without actions.  This is a place holder
363             for a function that every subclass should write.  Most
364             can be written using \c make_action_helper.
365     \param  view  Which view the action should be created for.
366     \return NULL to represent error (this function shouldn't ever be called)
367 */
368 SPAction *
369 Verb::make_action(Inkscape::UI::View::View */*view*/)
371     //std::cout << "make_action" << std::endl;
372     return NULL;
375 /** \brief  Create an action for a \c FileVerb
376     \param  view  Which view the action should be created for
377     \return The built action.
379     Calls \c make_action_helper with the \c vector.
380 */
381 SPAction *
382 FileVerb::make_action(Inkscape::UI::View::View *view)
384     //std::cout << "fileverb: make_action: " << &vector << std::endl;
385     return make_action_helper(view, &vector);
388 /** \brief  Create an action for a \c EditVerb
389     \param  view  Which view the action should be created for
390     \return The built action.
392     Calls \c make_action_helper with the \c vector.
393 */
394 SPAction *
395 EditVerb::make_action(Inkscape::UI::View::View *view)
397     //std::cout << "editverb: make_action: " << &vector << std::endl;
398     return make_action_helper(view, &vector);
401 /** \brief  Create an action for a \c SelectionVerb
402     \param  view  Which view the action should be created for
403     \return The built action.
405     Calls \c make_action_helper with the \c vector.
406 */
407 SPAction *
408 SelectionVerb::make_action(Inkscape::UI::View::View *view)
410     return make_action_helper(view, &vector);
413 /** \brief  Create an action for a \c LayerVerb
414     \param  view  Which view the action should be created for
415     \return The built action.
417     Calls \c make_action_helper with the \c vector.
418 */
419 SPAction *
420 LayerVerb::make_action(Inkscape::UI::View::View *view)
422     return make_action_helper(view, &vector);
425 /** \brief  Create an action for a \c ObjectVerb
426     \param  view  Which view the action should be created for
427     \return The built action.
429     Calls \c make_action_helper with the \c vector.
430 */
431 SPAction *
432 ObjectVerb::make_action(Inkscape::UI::View::View *view)
434     return make_action_helper(view, &vector);
437 /** \brief  Create an action for a \c ContextVerb
438     \param  view  Which view the action should be created for
439     \return The built action.
441     Calls \c make_action_helper with the \c vector.
442 */
443 SPAction *
444 ContextVerb::make_action(Inkscape::UI::View::View *view)
446     return make_action_helper(view, &vector);
449 /** \brief  Create an action for a \c ZoomVerb
450     \param  view  Which view the action should be created for
451     \return The built action.
453     Calls \c make_action_helper with the \c vector.
454 */
455 SPAction *
456 ZoomVerb::make_action(Inkscape::UI::View::View *view)
458     return make_action_helper(view, &vector);
461 /** \brief  Create an action for a \c DialogVerb
462     \param  view  Which view the action should be created for
463     \return The built action.
465     Calls \c make_action_helper with the \c vector.
466 */
467 SPAction *
468 DialogVerb::make_action(Inkscape::UI::View::View *view)
470     return make_action_helper(view, &vector);
473 /** \brief  Create an action for a \c HelpVerb
474     \param  view  Which view the action should be created for
475     \return The built action.
477     Calls \c make_action_helper with the \c vector.
478 */
479 SPAction *
480 HelpVerb::make_action(Inkscape::UI::View::View *view)
482     return make_action_helper(view, &vector);
485 /** \brief  Create an action for a \c TutorialVerb
486     \param  view  Which view the action should be created for
487     \return The built action.
489     Calls \c make_action_helper with the \c vector.
490 */
491 SPAction *
492 TutorialVerb::make_action(Inkscape::UI::View::View *view)
494     return make_action_helper(view, &vector);
497 /** \brief  Create an action for a \c TextVerb
498     \param  view  Which view the action should be created for
499     \return The built action.
501     Calls \c make_action_helper with the \c vector.
502 */
503 SPAction *
504 TextVerb::make_action(Inkscape::UI::View::View *view)
506     return make_action_helper(view, &vector);
509 /** \brief A quick little convience function to make building actions
510            a little bit easier.
511     \param  view    Which view the action should be created for.
512     \param  vector  The function vector for the verb.
513     \return The created action.
515     This function does a couple of things.  The most obvious is that
516     it allocates and creates the action.  When it does this it
517     translates the \c _name and \c _tip variables.  This allows them
518     to be staticly allocated easily, and get translated in the end.  Then,
519     if the action gets crated, a listener is added to the action with
520     the vector that is passed in.
521 */
522 SPAction *
523 Verb::make_action_helper(Inkscape::UI::View::View *view, SPActionEventVector *vector, void *in_pntr)
525     SPAction *action;
527     //std::cout << "Adding action: " << _code << std::endl;
528     action = sp_action_new(view, _id, _(_name),
529                            _(_tip), _image, this);
531     if (action != NULL) {
532         if (in_pntr == NULL) {
533             nr_active_object_add_listener(
534                 (NRActiveObject *) action,
535                 (NRObjectEventVector *) vector,
536                 sizeof(SPActionEventVector),
537                 reinterpret_cast<void *>(_code)
538             );
539         } else {
540             nr_active_object_add_listener(
541                 (NRActiveObject *) action,
542                 (NRObjectEventVector *) vector,
543                 sizeof(SPActionEventVector),
544                 in_pntr
545             );
546         }
547     }
549     return action;
552 /** \brief  A function to get an action if it exists, or otherwise to
553             build it.
554     \param  view  The view which this action would relate to
555     \return The action, or NULL if there is an error.
557     This function will get the action for a given view for this verb.  It
558     will create the verb if it can't be found in the ActionTable.  Also,
559     if the \c ActionTable has not been created, it gets created by this
560     function.
562     If the action is created, it's sensitivity must be determined.  The
563     default for a new action is that it is sensitive.  If the value in
564     \c _default_sensitive is \c false, then the sensitivity must be
565     removed.  Also, if the view being created is based on the same
566     document as a view already created, the sensitivity should be the
567     same as views on that document.  A view with the same document is
568     looked for, and the sensitivity is matched.  Unfortunately, this is
569     currently a linear search.
570 */
571 SPAction *
572 Verb::get_action(Inkscape::UI::View::View *view)
574     SPAction *action = NULL;
576     if ( _actions == NULL ) {
577         _actions = new ActionTable;
578     }
579     ActionTable::iterator action_found = _actions->find(view);
581     if (action_found != _actions->end()) {
582         action = action_found->second;
583     } else {
584         action = this->make_action(view);
586         // if (action == NULL) printf("Hmm, NULL in %s\n", _name);
587         if (action == NULL) printf("Hmm, NULL in %s\n", _name);
588         if (!_default_sensitive) {
589             sp_action_set_sensitive(action, 0);
590         } else {
591             for (ActionTable::iterator cur_action = _actions->begin();
592                  cur_action != _actions->end() && view != NULL;
593                  cur_action++) {
594                 if (cur_action->first != NULL && cur_action->first->doc() == view->doc()) {
595                     sp_action_set_sensitive(action, cur_action->second->sensitive);
596                     break;
597                 }
598             }
599         }
601         _actions->insert(ActionTable::value_type(view, action));
602     }
604     return action;
607 void
608 Verb::sensitive(SPDocument *in_doc, bool in_sensitive)
610     // printf("Setting sensitivity of \"%s\" to %d\n", _name, in_sensitive);
611     if (_actions != NULL) {
612         for (ActionTable::iterator cur_action = _actions->begin();
613              cur_action != _actions->end();
614              cur_action++) {
615             if (in_doc == NULL || (cur_action->first != NULL && cur_action->first->doc() == in_doc)) {
616                 sp_action_set_sensitive(cur_action->second, in_sensitive ? 1 : 0);
617             }
618         }
619     }
621     if (in_doc == NULL) {
622         _default_sensitive = in_sensitive;
623     }
625     return;
628 /** \brief Accessor to get the tooltip for verb as localised string */ 
629 gchar const *
630 Verb::get_tip (void) 
632         return _(_tip); 
635 void
636 Verb::name(SPDocument *in_doc, Glib::ustring in_name)
638     if (_actions != NULL) {
639         for (ActionTable::iterator cur_action = _actions->begin();
640              cur_action != _actions->end();
641              cur_action++) {
642             if (in_doc == NULL || (cur_action->first != NULL && cur_action->first->doc() == in_doc)) {
643                 sp_action_set_name(cur_action->second, in_name);
644             }
645         }
646     }
649 /** \brief  A function to remove the action associated with a view.
650     \param  view  Which view's actions should be removed.
651     \return None
653     This function looks for the action in \c _actions.  If it is
654     found then it is unreferenced and the entry in the action
655     table is erased.
656 */
657 void
658 Verb::delete_view(Inkscape::UI::View::View *view)
660     if (_actions == NULL) return;
661     if (_actions->empty()) return;
663 #if 0
664     static int count = 0;
665     std::cout << count++ << std::endl;
666 #endif
668     ActionTable::iterator action_found = _actions->find(view);
670     if (action_found != _actions->end()) {
671         SPAction *action = action_found->second;
672         nr_object_unref(NR_OBJECT(action));
673         _actions->erase(action_found);
674     }
676     return;
679 /** \brief  A function to delete a view from all verbs
680     \param  view  Which view's actions should be removed.
681     \return None
683     This function first looks through _base_verbs and deteles
684     the view from all of those views.  If \c _verbs is not empty
685     then all of the entries in that table have all of the views
686     deleted also.
687 */
688 void
689 Verb::delete_all_view(Inkscape::UI::View::View *view)
691     for (int i = 0; i <= SP_VERB_LAST; i++) {
692         if (_base_verbs[i])
693           _base_verbs[i]->delete_view(view);
694     }
696     if (!_verbs.empty()) {
697         for (VerbTable::iterator thisverb = _verbs.begin();
698              thisverb != _verbs.end(); thisverb++) {
699             Inkscape::Verb *verbpntr = thisverb->second;
700             // std::cout << "Delete In Verb: " << verbpntr->_name << std::endl;
701             verbpntr->delete_view(view);
702         }
703     }
705     return;
708 /** \brief  A function to turn a \c code into a Verb for dynamically
709             created Verbs.
710     \param  code  What code is being looked for
711     \return The found Verb of NULL if none is found.
713     This function basically just looks through the \c _verbs hash
714     table.  STL does all the work.
715 */
716 Verb *
717 Verb::get_search(unsigned int code)
719     Verb *verb = NULL;
720     VerbTable::iterator verb_found = _verbs.find(code);
722     if (verb_found != _verbs.end()) {
723         verb = verb_found->second;
724     }
726     return verb;
729 /** \brief  Find a Verb using it's ID
730     \param  id  Which id to search for
732     This function uses the \c _verb_ids has table to find the
733     verb by it's id.  Should be much faster than previous
734     implementations.
735 */
736 Verb *
737 Verb::getbyid(gchar const *id)
739     Verb *verb = NULL;
740     VerbIDTable::iterator verb_found = _verb_ids.find(id);
742     if (verb_found != _verb_ids.end()) {
743         verb = verb_found->second;
744     }
746     if (verb == NULL)
747         printf("Unable to find: %s\n", id);
749     return verb;
752 /** \brief  Decode the verb code and take appropriate action */
753 void
754 FileVerb::perform(SPAction *action, void *data, void */*pdata*/)
756 #if 0
757     /* These aren't used, but are here to remind people not to use
758        the CURRENT_DOCUMENT macros unless they really have to. */
759     Inkscape::UI::View::View *current_view = sp_action_get_view(action);
760     SPDocument *current_document = current_view->doc();
761 #endif
763     SPDesktop *desktop = dynamic_cast<SPDesktop*>(sp_action_get_view(action));
764     g_assert(desktop != NULL);
765     Gtk::Window *parent = desktop->getToplevel();
766     g_assert(parent != NULL);
768     switch ((long) data) {
769         case SP_VERB_FILE_NEW:
770             sp_file_new_default();
771             break;
772         case SP_VERB_FILE_OPEN:
773             sp_file_open_dialog(*parent, NULL, NULL);
774             break;
775         case SP_VERB_FILE_REVERT:
776             sp_file_revert_dialog();
777             break;
778         case SP_VERB_FILE_SAVE:
779             sp_file_save(*parent, NULL, NULL);
780             break;
781         case SP_VERB_FILE_SAVE_AS:
782             sp_file_save_as(*parent, NULL, NULL);
783             break;
784         case SP_VERB_FILE_SAVE_A_COPY:
785             sp_file_save_a_copy(*parent, NULL, NULL);
786             break;
787         case SP_VERB_FILE_PRINT:
788             sp_file_print(*parent);
789             break;
790         case SP_VERB_FILE_VACUUM:
791             sp_file_vacuum();
792             break;
793         case SP_VERB_FILE_PRINT_PREVIEW:
794             sp_file_print_preview(NULL, NULL);
795             break;
796         case SP_VERB_FILE_IMPORT:
797             sp_file_import(*parent);
798             break;
799         case SP_VERB_FILE_EXPORT:
800             sp_file_export_dialog(NULL);
801             break;
802         case SP_VERB_FILE_IMPORT_FROM_OCAL:
803             sp_file_import_from_ocal(*parent);
804             break;
805         case SP_VERB_FILE_EXPORT_TO_OCAL:
806             sp_file_export_to_ocal(*parent);
807             break;
808         case SP_VERB_FILE_NEXT_DESKTOP:
809             inkscape_switch_desktops_next();
810             break;
811         case SP_VERB_FILE_PREV_DESKTOP:
812             inkscape_switch_desktops_prev();
813             break;
814         case SP_VERB_FILE_CLOSE_VIEW:
815             sp_ui_close_view(NULL);
816             break;
817         case SP_VERB_FILE_QUIT:
818             sp_file_exit();
819             break;
820         default:
821             break;
822     }
825 } // end of sp_verb_action_file_perform()
827 /** \brief  Decode the verb code and take appropriate action */
828 void
829 EditVerb::perform(SPAction *action, void *data, void */*pdata*/)
831     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
832     if (!dt)
833         return;
834     SPEventContext *ec = dt->event_context;
836     switch (reinterpret_cast<std::size_t>(data)) {
837         case SP_VERB_EDIT_UNDO:
838             sp_undo(dt, sp_desktop_document(dt));
839             break;
840         case SP_VERB_EDIT_REDO:
841             sp_redo(dt, sp_desktop_document(dt));
842             break;
843         case SP_VERB_EDIT_CUT:
844             sp_selection_cut();
845             break;
846         case SP_VERB_EDIT_COPY:
847             sp_selection_copy();
848             break;
849         case SP_VERB_EDIT_PASTE:
850             sp_selection_paste(false);
851             break;
852         case SP_VERB_EDIT_PASTE_STYLE:
853             sp_selection_paste_style();
854             break;
855         case SP_VERB_EDIT_PASTE_SIZE:
856             sp_selection_paste_size(true, true);
857             break;
858         case SP_VERB_EDIT_PASTE_SIZE_X:
859             sp_selection_paste_size(true, false);
860             break;
861         case SP_VERB_EDIT_PASTE_SIZE_Y:
862             sp_selection_paste_size(false, true);
863             break;
864         case SP_VERB_EDIT_PASTE_SIZE_SEPARATELY:
865             sp_selection_paste_size_separately(true, true);
866             break;
867         case SP_VERB_EDIT_PASTE_SIZE_SEPARATELY_X:
868             sp_selection_paste_size_separately(true, false);
869             break;
870         case SP_VERB_EDIT_PASTE_SIZE_SEPARATELY_Y:
871             sp_selection_paste_size_separately(false, true);
872             break;
873         case SP_VERB_EDIT_PASTE_IN_PLACE:
874             sp_selection_paste(true);
875             break;
876         case SP_VERB_EDIT_PASTE_LIVEPATHEFFECT:
877             sp_selection_paste_livepatheffect();
878             break;
879         case SP_VERB_EDIT_DELETE:
880             sp_selection_delete();
881             break;
882         case SP_VERB_EDIT_DUPLICATE:
883             sp_selection_duplicate();
884             break;
885         case SP_VERB_EDIT_CLONE:
886             sp_selection_clone();
887             break;
888         case SP_VERB_EDIT_UNLINK_CLONE:
889             sp_selection_unlink();
890             break;
891         case SP_VERB_EDIT_CLONE_SELECT_ORIGINAL:
892             sp_select_clone_original();
893             break;
894         case SP_VERB_EDIT_SELECTION_2_MARKER:
895             sp_selection_to_marker();
896             break;
897         case SP_VERB_EDIT_SELECTION_2_GUIDES:
898             sp_selection_to_guides();
899             break;
900         case SP_VERB_EDIT_TILE:
901             sp_selection_tile();
902             break;
903         case SP_VERB_EDIT_UNTILE:
904             sp_selection_untile();
905             break;
906         case SP_VERB_EDIT_CLEAR_ALL:
907             sp_edit_clear_all();
908             break;
909         case SP_VERB_EDIT_SELECT_ALL:
910             if (tools_isactive(dt, TOOLS_NODES)) {
911                 SP_NODE_CONTEXT(ec)->shape_editor->select_all_from_subpath(false);
912             } else {
913                 sp_edit_select_all();
914             }
915             break;
916         case SP_VERB_EDIT_INVERT:
917             if (tools_isactive(dt, TOOLS_NODES)) {
918                 SP_NODE_CONTEXT(ec)->shape_editor->select_all_from_subpath(true);
919             } else {
920                 sp_edit_invert();
921             }
922             break;
923         case SP_VERB_EDIT_SELECT_ALL_IN_ALL_LAYERS:
924             if (tools_isactive(dt, TOOLS_NODES)) {
925                 SP_NODE_CONTEXT(ec)->shape_editor->select_all(false);
926             } else {
927                 sp_edit_select_all_in_all_layers();
928             }
929             break;
930         case SP_VERB_EDIT_INVERT_IN_ALL_LAYERS:
931             if (tools_isactive(dt, TOOLS_NODES)) {
932                 SP_NODE_CONTEXT(ec)->shape_editor->select_all(true);
933             } else {
934                 sp_edit_invert_in_all_layers();
935             }
936             break;
938         case SP_VERB_EDIT_SELECT_NEXT:
939             if (tools_isactive(dt, TOOLS_NODES)) {
940                 SP_NODE_CONTEXT(ec)->shape_editor->select_next();
941             } else if (tools_isactive(dt, TOOLS_GRADIENT)
942                        && ec->_grdrag->isNonEmpty()) {
943                 sp_gradient_context_select_next (ec);
944             } else {
945                 sp_selection_item_next();
946             }
947             break;
948         case SP_VERB_EDIT_SELECT_PREV:
949             if (tools_isactive(dt, TOOLS_NODES)) {
950                 SP_NODE_CONTEXT(ec)->shape_editor->select_prev();
951             } else if (tools_isactive(dt, TOOLS_GRADIENT)
952                        && ec->_grdrag->isNonEmpty()) {
953                 sp_gradient_context_select_prev (ec);
954             } else {
955                 sp_selection_item_prev();
956             }
957             break;
959         case SP_VERB_EDIT_DESELECT:
960             if (tools_isactive(dt, TOOLS_NODES)) {
961                 SP_NODE_CONTEXT(ec)->shape_editor->deselect();
962             } else {
963                 sp_desktop_selection(dt)->clear();
964             }
965             break;
967         case SP_VERB_EDIT_NEXT_PATHEFFECT_PARAMETER:
968             sp_selection_next_patheffect_param(dt);
969             break;
970         default:
971             break;
972     }
974 } // end of sp_verb_action_edit_perform()
976 /** \brief  Decode the verb code and take appropriate action */
977 void
978 SelectionVerb::perform(SPAction *action, void *data, void */*pdata*/)
980     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
982     if (!dt)
983         return;
985     g_assert(dt->_dlg_mgr != NULL);
987     switch (reinterpret_cast<std::size_t>(data)) {
988         case SP_VERB_SELECTION_TO_FRONT:
989             sp_selection_raise_to_top();
990             break;
991         case SP_VERB_SELECTION_TO_BACK:
992             sp_selection_lower_to_bottom();
993             break;
994         case SP_VERB_SELECTION_RAISE:
995             sp_selection_raise();
996             break;
997         case SP_VERB_SELECTION_LOWER:
998             sp_selection_lower();
999             break;
1000         case SP_VERB_SELECTION_GROUP:
1001             sp_selection_group();
1002             break;
1003         case SP_VERB_SELECTION_UNGROUP:
1004             sp_selection_ungroup();
1005             break;
1007         case SP_VERB_SELECTION_TEXTTOPATH:
1008             text_put_on_path();
1009             break;
1010         case SP_VERB_SELECTION_TEXTFROMPATH:
1011             text_remove_from_path();
1012             break;
1013         case SP_VERB_SELECTION_REMOVE_KERNS:
1014             text_remove_all_kerns();
1015             break;
1017         case SP_VERB_SELECTION_UNION:
1018             sp_selected_path_union();
1019             break;
1020         case SP_VERB_SELECTION_INTERSECT:
1021             sp_selected_path_intersect();
1022             break;
1023         case SP_VERB_SELECTION_DIFF:
1024             sp_selected_path_diff();
1025             break;
1026         case SP_VERB_SELECTION_SYMDIFF:
1027             sp_selected_path_symdiff();
1028             break;
1030         case SP_VERB_SELECTION_CUT:
1031             sp_selected_path_cut();
1032             break;
1033         case SP_VERB_SELECTION_SLICE:
1034             sp_selected_path_slice();
1035             break;
1037         case SP_VERB_SELECTION_OFFSET:
1038             sp_selected_path_offset();
1039             break;
1040         case SP_VERB_SELECTION_OFFSET_SCREEN:
1041             sp_selected_path_offset_screen(1);
1042             break;
1043         case SP_VERB_SELECTION_OFFSET_SCREEN_10:
1044             sp_selected_path_offset_screen(10);
1045             break;
1046         case SP_VERB_SELECTION_INSET:
1047             sp_selected_path_inset();
1048             break;
1049         case SP_VERB_SELECTION_INSET_SCREEN:
1050             sp_selected_path_inset_screen(1);
1051             break;
1052         case SP_VERB_SELECTION_INSET_SCREEN_10:
1053             sp_selected_path_inset_screen(10);
1054             break;
1055         case SP_VERB_SELECTION_DYNAMIC_OFFSET:
1056             sp_selected_path_create_offset_object_zero();
1057             tools_switch_current(TOOLS_NODES);
1058             break;
1059         case SP_VERB_SELECTION_LINKED_OFFSET:
1060             sp_selected_path_create_updating_offset_object_zero();
1061             tools_switch_current(TOOLS_NODES);
1062             break;
1064         case SP_VERB_SELECTION_OUTLINE:
1065             sp_selected_path_outline();
1066             break;
1067         case SP_VERB_SELECTION_SIMPLIFY:
1068             sp_selected_path_simplify();
1069             break;
1070         case SP_VERB_SELECTION_REVERSE:
1071             sp_selected_path_reverse();
1072             break;
1073         case SP_VERB_SELECTION_TRACE:
1074             inkscape_dialogs_unhide();
1075             dt->_dlg_mgr->showDialog("Trace");
1076             break;
1077         case SP_VERB_SELECTION_CREATE_BITMAP:
1078             sp_selection_create_bitmap_copy();
1079             break;
1081         case SP_VERB_SELECTION_COMBINE:
1082             sp_selected_path_combine();
1083             break;
1084         case SP_VERB_SELECTION_BREAK_APART:
1085             sp_selected_path_break_apart();
1086             break;
1087         case SP_VERB_SELECTION_GRIDTILE:
1088             inkscape_dialogs_unhide();
1089             dt->_dlg_mgr->showDialog("TileDialog");
1090             break;
1091         default:
1092             break;
1093     }
1095 } // end of sp_verb_action_selection_perform()
1097 /** \brief  Decode the verb code and take appropriate action */
1098 void
1099 LayerVerb::perform(SPAction *action, void *data, void */*pdata*/)
1101     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1102     unsigned int verb = reinterpret_cast<std::size_t>(data);
1104     if ( !dt || !dt->currentLayer() ) {
1105         return;
1106     }
1108     switch (verb) {
1109         case SP_VERB_LAYER_NEW: {
1110             Inkscape::UI::Dialogs::LayerPropertiesDialog::showCreate(dt, dt->currentLayer());
1111             break;
1112         }
1113         case SP_VERB_LAYER_RENAME: {
1114             Inkscape::UI::Dialogs::LayerPropertiesDialog::showRename(dt, dt->currentLayer());
1115             break;
1116         }
1117         case SP_VERB_LAYER_NEXT: {
1118             SPObject *next=Inkscape::next_layer(dt->currentRoot(), dt->currentLayer());
1119             if (next) {
1120                 dt->setCurrentLayer(next);
1121                 sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_NEXT,
1122                                  _("Switch to next layer"));
1123                 dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Switched to next layer."));
1124             } else {
1125                 dt->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Cannot go past last layer."));
1126             }
1127             break;
1128         }
1129         case SP_VERB_LAYER_PREV: {
1130             SPObject *prev=Inkscape::previous_layer(dt->currentRoot(), dt->currentLayer());
1131             if (prev) {
1132                 dt->setCurrentLayer(prev);
1133                 sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_PREV,
1134                                  _("Switch to previous layer"));
1135                 dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Switched to previous layer."));
1136             } else {
1137                 dt->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Cannot go before first layer."));
1138             }
1139             break;
1140         }
1141         case SP_VERB_LAYER_MOVE_TO_NEXT: {
1142             sp_selection_to_next_layer();
1143             break;
1144         }
1145         case SP_VERB_LAYER_MOVE_TO_PREV: {
1146             sp_selection_to_prev_layer();
1147             break;
1148         }
1149         case SP_VERB_LAYER_TO_TOP:
1150         case SP_VERB_LAYER_TO_BOTTOM:
1151         case SP_VERB_LAYER_RAISE:
1152         case SP_VERB_LAYER_LOWER: {
1153             if ( dt->currentLayer() == dt->currentRoot() ) {
1154                 dt->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No current layer."));
1155                 return;
1156             }
1158             SPItem *layer=SP_ITEM(dt->currentLayer());
1159             g_return_if_fail(layer != NULL);
1161             SPObject *old_pos=SP_OBJECT_NEXT(layer);
1163             switch (verb) {
1164                 case SP_VERB_LAYER_TO_TOP:
1165                     layer->raiseToTop();
1166                     break;
1167                 case SP_VERB_LAYER_TO_BOTTOM:
1168                     layer->lowerToBottom();
1169                     break;
1170                 case SP_VERB_LAYER_RAISE:
1171                     layer->raiseOne();
1172                     break;
1173                 case SP_VERB_LAYER_LOWER:
1174                     layer->lowerOne();
1175                     break;
1176             }
1178             if ( SP_OBJECT_NEXT(layer) != old_pos ) {
1179                 char const *message = NULL;
1180                 Glib::ustring description = "";
1181                 switch (verb) {
1182                     case SP_VERB_LAYER_TO_TOP:
1183                         message = g_strdup_printf(_("Raised layer <b>%s</b>."), layer->defaultLabel());
1184                         description = _("Layer to top");
1185                         break;
1186                     case SP_VERB_LAYER_RAISE:
1187                         message = g_strdup_printf(_("Raised layer <b>%s</b>."), layer->defaultLabel());
1188                         description = _("Raise layer");
1189                         break;
1190                     case SP_VERB_LAYER_TO_BOTTOM:
1191                         message = g_strdup_printf(_("Lowered layer <b>%s</b>."), layer->defaultLabel());
1192                         description = _("Layer to bottom");
1193                         break;
1194                     case SP_VERB_LAYER_LOWER:
1195                         message = g_strdup_printf(_("Lowered layer <b>%s</b>."), layer->defaultLabel());
1196                         description = _("Lower layer");
1197                         break;
1198                 };
1199                 sp_document_done(sp_desktop_document(dt), verb, description);
1200                 if (message) {
1201                     dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, message);
1202                     g_free((void *) message);
1203                 }
1204             } else {
1205                 dt->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Cannot move layer any further."));
1206             }
1208             break;
1209         }
1210         case SP_VERB_LAYER_DELETE: {
1211             if ( dt->currentLayer() != dt->currentRoot() ) {
1212                 sp_desktop_selection(dt)->clear();
1213                 SPObject *old_layer=dt->currentLayer();
1215                 sp_object_ref(old_layer, NULL);
1216                 SPObject *survivor=Inkscape::next_layer(dt->currentRoot(), old_layer);
1217                 if (!survivor) {
1218                     survivor = Inkscape::previous_layer(dt->currentRoot(), old_layer);
1219                 }
1221                 /* Deleting the old layer before switching layers is a hack to trigger the
1222                  * listeners of the deletion event (as happens when old_layer is deleted using the
1223                  * xml editor).  See
1224                  * http://sourceforge.net/tracker/index.php?func=detail&aid=1339397&group_id=93438&atid=604306
1225                  */
1226                 old_layer->deleteObject();
1227                 sp_object_unref(old_layer, NULL);
1228                 if (survivor) {
1229                     dt->setCurrentLayer(survivor);
1230                 }
1232                 sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_DELETE,
1233                                  _("Delete layer"));
1235                 // TRANSLATORS: this means "The layer has been deleted."
1236                 dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Deleted layer."));
1237             } else {
1238                 dt->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No current layer."));
1239             }
1240             break;
1241         }
1242     }
1244     return;
1245 } // end of sp_verb_action_layer_perform()
1247 /** \brief  Decode the verb code and take appropriate action */
1248 void
1249 ObjectVerb::perform( SPAction *action, void *data, void */*pdata*/ )
1251     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1252     if (!dt)
1253         return;
1255     SPEventContext *ec = dt->event_context;
1257     Inkscape::Selection *sel = sp_desktop_selection(dt);
1259     if (sel->isEmpty())
1260         return;
1262     NR::Maybe<NR::Rect> bbox = sel->bounds();
1263     if (!bbox) {
1264         return;
1265     }
1266     // If the rotation center of the selection is visible, choose it as reference point
1267     // for horizontal and vertical flips. Otherwise, take the center of the bounding box.
1268     NR::Point center;
1269     if (tools_isactive(dt, TOOLS_SELECT) && sel->center() && SP_SELECT_CONTEXT(ec)->_seltrans->centerIsVisible())
1270         center = *sel->center();
1271     else
1272         center = bbox->midpoint();
1274     switch (reinterpret_cast<std::size_t>(data)) {
1275         case SP_VERB_OBJECT_ROTATE_90_CW:
1276             sp_selection_rotate_90_cw();
1277             break;
1278         case SP_VERB_OBJECT_ROTATE_90_CCW:
1279             sp_selection_rotate_90_ccw();
1280             break;
1281         case SP_VERB_OBJECT_FLATTEN:
1282             sp_selection_remove_transform();
1283             break;
1284         case SP_VERB_OBJECT_TO_CURVE:
1285             sp_selected_path_to_curves();
1286             break;
1287         case SP_VERB_OBJECT_FLOW_TEXT:
1288             text_flow_into_shape();
1289             break;
1290         case SP_VERB_OBJECT_UNFLOW_TEXT:
1291             text_unflow();
1292             break;
1293         case SP_VERB_OBJECT_FLOWTEXT_TO_TEXT:
1294             flowtext_to_text();
1295             break;
1296         case SP_VERB_OBJECT_FLIP_HORIZONTAL:
1297             // When working with the node tool ...
1298             if (tools_isactive(dt, TOOLS_NODES)) {
1299                 Inkscape::NodePath::Node *active_node = Inkscape::NodePath::Path::active_node;
1301                 // ... and one of the nodes is currently mouseovered ...
1302                 if (active_node) {
1304                     // ... flip the selected nodes about that node
1305                     SP_NODE_CONTEXT(ec)->shape_editor->flip(NR::X, active_node->pos);
1306                 } else {
1308                     // ... or else about the center of their bounding box.
1309                     SP_NODE_CONTEXT(ec)->shape_editor->flip(NR::X);
1310                 }
1312             // When working with the selector tool, flip the selection about its rotation center
1313             // (if it is visible) or about the center of the bounding box.
1314             } else {
1315                 sp_selection_scale_relative(sel, center, NR::scale(-1.0, 1.0));
1316             }
1317             sp_document_done(sp_desktop_document(dt), SP_VERB_OBJECT_FLIP_HORIZONTAL,
1318                              _("Flip horizontally"));
1319             break;
1320         case SP_VERB_OBJECT_FLIP_VERTICAL:
1321             // The behaviour is analogous to flipping horizontally
1322             if (tools_isactive(dt, TOOLS_NODES)) {
1323                 Inkscape::NodePath::Node *active_node = Inkscape::NodePath::Path::active_node;
1324                 if (active_node) {
1325                     SP_NODE_CONTEXT(ec)->shape_editor->flip(NR::Y, active_node->pos);
1326                 } else {
1327                     SP_NODE_CONTEXT(ec)->shape_editor->flip(NR::Y);
1328                 }
1329             } else {
1330                 sp_selection_scale_relative(sel, center, NR::scale(1.0, -1.0));
1331             }
1332             sp_document_done(sp_desktop_document(dt), SP_VERB_OBJECT_FLIP_VERTICAL,
1333                              _("Flip vertically"));
1334             break;
1335         case SP_VERB_OBJECT_SET_MASK:
1336             sp_selection_set_mask(false, false);
1337             break;
1338         case SP_VERB_OBJECT_EDIT_MASK:
1339             sp_selection_edit_clip_or_mask(dt, false);
1340             break;
1341         case SP_VERB_OBJECT_UNSET_MASK:
1342             sp_selection_unset_mask(false);
1343             break;
1344         case SP_VERB_OBJECT_SET_CLIPPATH:
1345             sp_selection_set_mask(true, false);
1346             break;
1347         case SP_VERB_OBJECT_EDIT_CLIPPATH:
1348             sp_selection_edit_clip_or_mask(dt, true);
1349             break;
1350         case SP_VERB_OBJECT_UNSET_CLIPPATH:
1351             sp_selection_unset_mask(true);
1352             break;
1353         default:
1354             break;
1355     }
1357 } // end of sp_verb_action_object_perform()
1359 /** \brief  Decode the verb code and take appropriate action */
1360 void
1361 ContextVerb::perform(SPAction *action, void *data, void */*pdata*/)
1363     SPDesktop *dt;
1364     sp_verb_t verb;
1365     int vidx;
1367     dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1369     if (!dt)
1370         return;
1372     verb = (sp_verb_t)GPOINTER_TO_INT((gpointer)data);
1374     /** \todo !!! hopefully this can go away soon and actions can look after
1375      * themselves
1376      */
1377     for (vidx = SP_VERB_CONTEXT_SELECT; vidx <= SP_VERB_CONTEXT_PAINTBUCKET_PREFS; vidx++)
1378     {
1379         SPAction *tool_action= get((sp_verb_t)vidx)->get_action(dt);
1380         if (tool_action) {
1381             sp_action_set_active(tool_action, vidx == (int)verb);
1382         }
1383     }
1385     switch (verb) {
1386         case SP_VERB_CONTEXT_SELECT:
1387             tools_switch_current(TOOLS_SELECT);
1388             break;
1389         case SP_VERB_CONTEXT_NODE:
1390             tools_switch_current(TOOLS_NODES);
1391             break;
1392         case SP_VERB_CONTEXT_TWEAK:
1393             tools_switch_current(TOOLS_TWEAK);
1394             break;
1395         case SP_VERB_CONTEXT_RECT:
1396             tools_switch_current(TOOLS_SHAPES_RECT);
1397             break;
1398         case SP_VERB_CONTEXT_3DBOX:
1399             tools_switch_current(TOOLS_SHAPES_3DBOX);
1400             break;
1401         case SP_VERB_CONTEXT_ARC:
1402             tools_switch_current(TOOLS_SHAPES_ARC);
1403             break;
1404         case SP_VERB_CONTEXT_STAR:
1405             tools_switch_current(TOOLS_SHAPES_STAR);
1406             break;
1407         case SP_VERB_CONTEXT_SPIRAL:
1408             tools_switch_current(TOOLS_SHAPES_SPIRAL);
1409             break;
1410         case SP_VERB_CONTEXT_PENCIL:
1411             tools_switch_current(TOOLS_FREEHAND_PENCIL);
1412             break;
1413         case SP_VERB_CONTEXT_PEN:
1414             tools_switch_current(TOOLS_FREEHAND_PEN);
1415             break;
1416         case SP_VERB_CONTEXT_CALLIGRAPHIC:
1417             tools_switch_current(TOOLS_CALLIGRAPHIC);
1418             break;
1419         case SP_VERB_CONTEXT_TEXT:
1420             tools_switch_current(TOOLS_TEXT);
1421             break;
1422         case SP_VERB_CONTEXT_GRADIENT:
1423             tools_switch_current(TOOLS_GRADIENT);
1424             break;
1425         case SP_VERB_CONTEXT_ZOOM:
1426             tools_switch_current(TOOLS_ZOOM);
1427             break;
1428         case SP_VERB_CONTEXT_DROPPER:
1429             tools_switch_current(TOOLS_DROPPER);
1430             break;
1431         case SP_VERB_CONTEXT_CONNECTOR:
1432             tools_switch_current (TOOLS_CONNECTOR);
1433             break;
1434         case SP_VERB_CONTEXT_PAINTBUCKET:
1435             tools_switch_current(TOOLS_PAINTBUCKET);
1436             break;
1438         case SP_VERB_CONTEXT_SELECT_PREFS:
1439             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_SELECTOR);
1440             dt->_dlg_mgr->showDialog("InkscapePreferences");
1441             break;
1442         case SP_VERB_CONTEXT_NODE_PREFS:
1443             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_NODE);
1444             dt->_dlg_mgr->showDialog("InkscapePreferences");
1445             break;
1446         case SP_VERB_CONTEXT_TWEAK_PREFS:
1447             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_TWEAK);
1448             dt->_dlg_mgr->showDialog("InkscapePreferences");
1449             break;
1450         case SP_VERB_CONTEXT_RECT_PREFS:
1451             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_SHAPES_RECT);
1452             dt->_dlg_mgr->showDialog("InkscapePreferences");
1453             break;
1454         case SP_VERB_CONTEXT_3DBOX_PREFS:
1455             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_SHAPES_3DBOX);
1456             dt->_dlg_mgr->showDialog("InkscapePreferences");
1457             break;
1458         case SP_VERB_CONTEXT_ARC_PREFS:
1459             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_SHAPES_ELLIPSE);
1460             dt->_dlg_mgr->showDialog("InkscapePreferences");
1461             break;
1462         case SP_VERB_CONTEXT_STAR_PREFS:
1463             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_SHAPES_STAR);
1464             dt->_dlg_mgr->showDialog("InkscapePreferences");
1465             break;
1466         case SP_VERB_CONTEXT_SPIRAL_PREFS:
1467             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_SHAPES_SPIRAL);
1468             dt->_dlg_mgr->showDialog("InkscapePreferences");
1469             break;
1470         case SP_VERB_CONTEXT_PENCIL_PREFS:
1471             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_PENCIL);
1472             dt->_dlg_mgr->showDialog("InkscapePreferences");
1473             break;
1474         case SP_VERB_CONTEXT_PEN_PREFS:
1475             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_PEN);
1476             dt->_dlg_mgr->showDialog("InkscapePreferences");
1477             break;
1478         case SP_VERB_CONTEXT_CALLIGRAPHIC_PREFS:
1479             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_CALLIGRAPHY);
1480             dt->_dlg_mgr->showDialog("InkscapePreferences");
1481             break;
1482         case SP_VERB_CONTEXT_TEXT_PREFS:
1483             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_TEXT);
1484             dt->_dlg_mgr->showDialog("InkscapePreferences");
1485             break;
1486         case SP_VERB_CONTEXT_GRADIENT_PREFS:
1487             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_GRADIENT);
1488             dt->_dlg_mgr->showDialog("InkscapePreferences");
1489             break;
1490         case SP_VERB_CONTEXT_ZOOM_PREFS:
1491             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_ZOOM);
1492             dt->_dlg_mgr->showDialog("InkscapePreferences");
1493             break;
1494         case SP_VERB_CONTEXT_DROPPER_PREFS:
1495             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_DROPPER);
1496             dt->_dlg_mgr->showDialog("InkscapePreferences");
1497             break;
1498         case SP_VERB_CONTEXT_CONNECTOR_PREFS:
1499             prefs_set_int_attribute ("dialogs.preferences", "page", PREFS_PAGE_TOOLS_CONNECTOR);
1500             dt->_dlg_mgr->showDialog("InkscapePreferences");
1501             break;
1502         case SP_VERB_CONTEXT_PAINTBUCKET_PREFS:
1503             prefs_set_int_attribute ("dialogs.preferences", "page", PREFS_PAGE_TOOLS_PAINTBUCKET);
1504             dt->_dlg_mgr->showDialog("InkscapePreferences");
1505             break;
1507         default:
1508             break;
1509     }
1511 } // end of sp_verb_action_ctx_perform()
1513 /** \brief  Decode the verb code and take appropriate action */
1514 void
1515 TextVerb::perform(SPAction *action, void */*data*/, void */*pdata*/)
1517     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1518     if (!dt)
1519         return;
1521     SPDocument *doc = sp_desktop_document(dt);
1522     (void)doc;
1523     Inkscape::XML::Node *repr = SP_OBJECT_REPR(dt->namedview);
1524     (void)repr;
1527 /** \brief  Decode the verb code and take appropriate action */
1528 void
1529 ZoomVerb::perform(SPAction *action, void *data, void */*pdata*/)
1531     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1532     if (!dt)
1533         return;
1534     SPEventContext *ec = dt->event_context;
1536     SPDocument *doc = sp_desktop_document(dt);
1538     Inkscape::XML::Node *repr = SP_OBJECT_REPR(dt->namedview);
1540     gdouble zoom_inc =
1541         prefs_get_double_attribute_limited( "options.zoomincrement",
1542                                             "value", 1.414213562, 1.01, 10 );
1544     switch (GPOINTER_TO_INT(data)) {
1545         case SP_VERB_ZOOM_IN:
1546         {
1547             gint mul = 1 + gobble_key_events(
1548                  GDK_KP_Add, 0); // with any mask
1549             // While drawing with the pen/pencil tool, zoom towards the end of the unfinished path
1550             if (tools_isactive(dt, TOOLS_FREEHAND_PENCIL) || tools_isactive(dt, TOOLS_FREEHAND_PEN)) {
1551                 SPCurve *rc = SP_DRAW_CONTEXT(ec)->red_curve;
1552                 if (sp_curve_last_bpath(rc)) {
1553                     NR::Point const zoom_to (sp_curve_last_point(rc));
1554                     dt->zoom_relative_keep_point(zoom_to, mul*zoom_inc);
1555                     break;
1556                 }
1557             }
1559             NR::Rect const d = dt->get_display_area();
1560             dt->zoom_relative( d.midpoint()[NR::X], d.midpoint()[NR::Y], mul*zoom_inc);
1561             break;
1562         }
1563         case SP_VERB_ZOOM_OUT:
1564         {
1565             gint mul = 1 + gobble_key_events(
1566                  GDK_KP_Subtract, 0); // with any mask
1567             // While drawing with the pen/pencil tool, zoom away from the end of the unfinished path
1568             if (tools_isactive(dt, TOOLS_FREEHAND_PENCIL) || tools_isactive(dt, TOOLS_FREEHAND_PEN)) {
1569                 SPCurve *rc = SP_DRAW_CONTEXT(ec)->red_curve;
1570                 if (sp_curve_last_bpath(rc)) {
1571                     NR::Point const zoom_to (sp_curve_last_point(rc));
1572                     dt->zoom_relative_keep_point(zoom_to, 1 / (mul*zoom_inc));
1573                     break;
1574                 }
1575             }
1577             NR::Rect const d = dt->get_display_area();
1578             dt->zoom_relative( d.midpoint()[NR::X], d.midpoint()[NR::Y], 1 / (mul*zoom_inc) );
1579             break;
1580         }
1581         case SP_VERB_ZOOM_1_1:
1582         {
1583             NR::Rect const d = dt->get_display_area();
1584             dt->zoom_absolute( d.midpoint()[NR::X], d.midpoint()[NR::Y], 1.0 );
1585             break;
1586         }
1587         case SP_VERB_ZOOM_1_2:
1588         {
1589             NR::Rect const d = dt->get_display_area();
1590             dt->zoom_absolute( d.midpoint()[NR::X], d.midpoint()[NR::Y], 0.5);
1591             break;
1592         }
1593         case SP_VERB_ZOOM_2_1:
1594         {
1595             NR::Rect const d = dt->get_display_area();
1596             dt->zoom_absolute( d.midpoint()[NR::X], d.midpoint()[NR::Y], 2.0 );
1597             break;
1598         }
1599         case SP_VERB_ZOOM_PAGE:
1600             dt->zoom_page();
1601             break;
1602         case SP_VERB_ZOOM_PAGE_WIDTH:
1603             dt->zoom_page_width();
1604             break;
1605         case SP_VERB_ZOOM_DRAWING:
1606             dt->zoom_drawing();
1607             break;
1608         case SP_VERB_ZOOM_SELECTION:
1609             dt->zoom_selection();
1610             break;
1611         case SP_VERB_ZOOM_NEXT:
1612             dt->next_zoom();
1613             break;
1614         case SP_VERB_ZOOM_PREV:
1615             dt->prev_zoom();
1616             break;
1617         case SP_VERB_TOGGLE_RULERS:
1618             dt->toggleRulers();
1619             break;
1620         case SP_VERB_TOGGLE_SCROLLBARS:
1621             dt->toggleScrollbars();
1622             break;
1623         case SP_VERB_TOGGLE_GUIDES:
1624             sp_namedview_toggle_guides(doc, repr);
1625             break;
1626         case SP_VERB_TOGGLE_SNAPPING:
1627             dt->toggleSnapping();
1628             break;        
1629         case SP_VERB_TOGGLE_GRID:
1630             dt->toggleGrids();
1631             break;
1632 #ifdef HAVE_GTK_WINDOW_FULLSCREEN
1633         case SP_VERB_FULLSCREEN:
1634             dt->fullscreen();
1635             break;
1636 #endif /* HAVE_GTK_WINDOW_FULLSCREEN */
1637         case SP_VERB_VIEW_NEW:
1638             sp_ui_new_view();
1639             break;
1640         case SP_VERB_VIEW_NEW_PREVIEW:
1641             sp_ui_new_view_preview();
1642             break;
1643         case SP_VERB_VIEW_MODE_NORMAL:
1644             dt->setDisplayModeNormal();
1645             break;
1646         case SP_VERB_VIEW_MODE_OUTLINE:
1647             dt->setDisplayModeOutline();
1648             break;
1649         case SP_VERB_VIEW_MODE_TOGGLE:
1650             dt->displayModeToggle();
1651             break;
1652         case SP_VERB_VIEW_CMS_TOGGLE:
1653             dt->toggleColorProfAdjust();
1654             break;
1655         case SP_VERB_VIEW_ICON_PREVIEW:
1656             inkscape_dialogs_unhide();
1657             dt->_dlg_mgr->showDialog("IconPreviewPanel");
1658             break;
1659         default:
1660             break;
1661     }
1663     dt->updateNow();
1665 } // end of sp_verb_action_zoom_perform()
1667 /** \brief  Decode the verb code and take appropriate action */
1668 void
1669 DialogVerb::perform(SPAction *action, void *data, void */*pdata*/)
1671     if (reinterpret_cast<std::size_t>(data) != SP_VERB_DIALOG_TOGGLE) {
1672         // unhide all when opening a new dialog
1673         inkscape_dialogs_unhide();
1674     }
1676     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1677     g_assert(dt->_dlg_mgr != NULL);
1679     switch (reinterpret_cast<std::size_t>(data)) {
1680         case SP_VERB_DIALOG_DISPLAY:
1681             //sp_display_dialog();
1682             dt->_dlg_mgr->showDialog("InkscapePreferences");
1683             break;
1684         case SP_VERB_DIALOG_METADATA:
1685             // sp_desktop_dialog();
1686             dt->_dlg_mgr->showDialog("DocumentMetadata");
1687             break;
1688         case SP_VERB_DIALOG_NAMEDVIEW:
1689             // sp_desktop_dialog();
1690             dt->_dlg_mgr->showDialog("DocumentProperties");
1691             break;
1692         case SP_VERB_DIALOG_FILL_STROKE:
1693             dt->_dlg_mgr->showDialog("FillAndStroke");
1694             break;
1695         case SP_VERB_DIALOG_SWATCHES:
1696             dt->_dlg_mgr->showDialog("Swatches");
1697             break;
1698         case SP_VERB_DIALOG_TRANSFORM:
1699             dt->_dlg_mgr->showDialog("Transformation");
1700             break;
1701         case SP_VERB_DIALOG_ALIGN_DISTRIBUTE:
1702             dt->_dlg_mgr->showDialog("AlignAndDistribute");
1703             break;
1704         case SP_VERB_DIALOG_TEXT:
1705             sp_text_edit_dialog();
1706             break;
1707         case SP_VERB_DIALOG_XML_EDITOR:
1708             sp_xml_tree_dialog();
1709             break;
1710         case SP_VERB_DIALOG_FIND:
1711             sp_find_dialog();
1712 //              Please test the new find dialog if you have time:
1713 //            dt->_dlg_mgr->showDialog("Find");
1714             break;
1715         case SP_VERB_DIALOG_DEBUG:
1716             dt->_dlg_mgr->showDialog("Messages");
1717             break;
1718         case SP_VERB_DIALOG_SCRIPT:
1719             dt->_dlg_mgr->showDialog("Script");
1720             break;
1721         case SP_VERB_DIALOG_UNDO_HISTORY:
1722             dt->_dlg_mgr->showDialog("UndoHistory");
1723             break;
1724         case SP_VERB_DIALOG_TOGGLE:
1725             inkscape_dialogs_toggle();
1726             break;
1727         case SP_VERB_DIALOG_CLONETILER:
1728             clonetiler_dialog();
1729             break;
1730         case SP_VERB_DIALOG_ITEM:
1731             sp_item_dialog();
1732             break;
1733 #ifdef WITH_INKBOARD
1734         case SP_VERB_XMPP_CLIENT:
1735         {
1736             Inkscape::Whiteboard::SessionManager::showClient();
1737             break;
1738         }
1739 #endif
1740         case SP_VERB_DIALOG_INPUT:
1741             sp_input_dialog();
1742             break;
1743         case SP_VERB_DIALOG_EXTENSIONEDITOR:
1744             dt->_dlg_mgr->showDialog("ExtensionEditor");
1745             break;
1746         case SP_VERB_DIALOG_LAYERS:
1747             dt->_dlg_mgr->showDialog("LayersPanel");
1748             break;
1749         case SP_VERB_DIALOG_LIVE_PATH_EFFECT:
1750             dt->_dlg_mgr->showDialog("LivePathEffect");
1751             break;
1752         case SP_VERB_DIALOG_FILTER_EFFECTS:
1753             dt->_dlg_mgr->showDialog("FilterEffectsDialog");
1754             break;
1755         default:
1756             break;
1757     }
1758 } // end of sp_verb_action_dialog_perform()
1760 /** \brief  Decode the verb code and take appropriate action */
1761 void
1762 HelpVerb::perform(SPAction *action, void *data, void */*pdata*/)
1764     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1765     g_assert(dt->_dlg_mgr != NULL);
1767     switch (reinterpret_cast<std::size_t>(data)) {
1768         case SP_VERB_HELP_ABOUT:
1769             sp_help_about();
1770             break;
1771         case SP_VERB_HELP_ABOUT_EXTENSIONS: {
1772             // Inkscape::UI::Dialogs::ExtensionsPanel *panel = new Inkscape::UI::Dialogs::ExtensionsPanel();
1773             // panel->set_full(true);
1774             // show_panel( *panel, "dialogs.aboutextensions", SP_VERB_HELP_ABOUT_EXTENSIONS );
1775             break;
1776         }
1778         /*
1779         case SP_VERB_SHOW_LICENSE:
1780             // TRANSLATORS: See "tutorial-basic.svg" comment.
1781             sp_help_open_tutorial(NULL, (gpointer) _("gpl-2.svg"));
1782             break;
1783         */
1785         case SP_VERB_HELP_MEMORY:
1786             inkscape_dialogs_unhide();
1787             dt->_dlg_mgr->showDialog("Memory");
1788             break;
1789         default:
1790             break;
1791     }
1792 } // end of sp_verb_action_help_perform()
1794 /** \brief  Decode the verb code and take appropriate action */
1795 void
1796 TutorialVerb::perform(SPAction */*action*/, void *data, void */*pdata*/)
1798     switch (reinterpret_cast<std::size_t>(data)) {
1799         case SP_VERB_TUTORIAL_BASIC:
1800             /* TRANSLATORS: If you have translated the tutorial-basic.svg file to your language,
1801                then translate this string as "tutorial-basic.LANG.svg" (where LANG is your language
1802                code); otherwise leave as "tutorial-basic.svg". */
1803             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-basic.svg"));
1804             break;
1805         case SP_VERB_TUTORIAL_SHAPES:
1806             // TRANSLATORS: See "tutorial-basic.svg" comment.
1807             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-shapes.svg"));
1808             break;
1809         case SP_VERB_TUTORIAL_ADVANCED:
1810             // TRANSLATORS: See "tutorial-basic.svg" comment.
1811             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-advanced.svg"));
1812             break;
1813         case SP_VERB_TUTORIAL_TRACING:
1814             // TRANSLATORS: See "tutorial-basic.svg" comment.
1815             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-tracing.svg"));
1816             break;
1817         case SP_VERB_TUTORIAL_CALLIGRAPHY:
1818             // TRANSLATORS: See "tutorial-basic.svg" comment.
1819             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-calligraphy.svg"));
1820             break;
1821         case SP_VERB_TUTORIAL_DESIGN:
1822             // TRANSLATORS: See "tutorial-basic.svg" comment.
1823             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-elements.svg"));
1824             break;
1825         case SP_VERB_TUTORIAL_TIPS:
1826             // TRANSLATORS: See "tutorial-basic.svg" comment.
1827             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-tips.svg"));
1828             break;
1829         default:
1830             break;
1831     }
1832 } // end of sp_verb_action_tutorial_perform()
1835 /**
1836  * Action vector to define functions called if a staticly defined file verb
1837  * is called.
1838  */
1839 SPActionEventVector FileVerb::vector =
1840             {{NULL},FileVerb::perform, NULL, NULL, NULL, NULL};
1841 /**
1842  * Action vector to define functions called if a staticly defined edit verb is
1843  * called.
1844  */
1845 SPActionEventVector EditVerb::vector =
1846             {{NULL},EditVerb::perform, NULL, NULL, NULL, NULL};
1848 /**
1849  * Action vector to define functions called if a staticly defined selection
1850  * verb is called
1851  */
1852 SPActionEventVector SelectionVerb::vector =
1853             {{NULL},SelectionVerb::perform, NULL, NULL, NULL, NULL};
1855 /**
1856  * Action vector to define functions called if a staticly defined layer
1857  * verb is called
1858  */
1859 SPActionEventVector LayerVerb::vector =
1860             {{NULL}, LayerVerb::perform, NULL, NULL, NULL, NULL};
1862 /**
1863  * Action vector to define functions called if a staticly defined object
1864  * editing verb is called
1865  */
1866 SPActionEventVector ObjectVerb::vector =
1867             {{NULL},ObjectVerb::perform, NULL, NULL, NULL, NULL};
1869 /**
1870  * Action vector to define functions called if a staticly defined context
1871  * verb is called
1872  */
1873 SPActionEventVector ContextVerb::vector =
1874             {{NULL},ContextVerb::perform, NULL, NULL, NULL, NULL};
1876 /**
1877  * Action vector to define functions called if a staticly defined zoom verb
1878  * is called
1879  */
1880 SPActionEventVector ZoomVerb::vector =
1881             {{NULL},ZoomVerb::perform, NULL, NULL, NULL, NULL};
1884 /**
1885  * Action vector to define functions called if a staticly defined dialog verb
1886  * is called
1887  */
1888 SPActionEventVector DialogVerb::vector =
1889             {{NULL},DialogVerb::perform, NULL, NULL, NULL, NULL};
1891 /**
1892  * Action vector to define functions called if a staticly defined help verb
1893  * is called
1894  */
1895 SPActionEventVector HelpVerb::vector =
1896             {{NULL},HelpVerb::perform, NULL, NULL, NULL, NULL};
1898 /**
1899  * Action vector to define functions called if a staticly defined tutorial verb
1900  * is called
1901  */
1902 SPActionEventVector TutorialVerb::vector =
1903             {{NULL},TutorialVerb::perform, NULL, NULL, NULL, NULL};
1905 /**
1906  * Action vector to define functions called if a staticly defined tutorial verb
1907  * is called
1908  */
1909 SPActionEventVector TextVerb::vector =
1910             {{NULL},TextVerb::perform, NULL, NULL, NULL, NULL};
1913 /* *********** Effect Last ********** */
1915 /** \brief A class to represent the last effect issued */
1916 class EffectLastVerb : public Verb {
1917 private:
1918     static void perform(SPAction *action, void *mydata, void *otherdata);
1919     static SPActionEventVector vector;
1920 protected:
1921     virtual SPAction *make_action(Inkscape::UI::View::View *view);
1922 public:
1923     /** \brief Use the Verb initializer with the same parameters. */
1924     EffectLastVerb(unsigned int const code,
1925                    gchar const *id,
1926                    gchar const *name,
1927                    gchar const *tip,
1928                    gchar const *image) :
1929         Verb(code, id, name, tip, image)
1930     {
1931         set_default_sensitive(false);
1932     }
1933 }; /* EffectLastVerb class */
1935 /**
1936  * The vector to attach in the last effect verb.
1937  */
1938 SPActionEventVector EffectLastVerb::vector =
1939             {{NULL},EffectLastVerb::perform, NULL, NULL, NULL, NULL};
1941 /** \brief  Create an action for a \c EffectLastVerb
1942     \param  view  Which view the action should be created for
1943     \return The built action.
1945     Calls \c make_action_helper with the \c vector.
1946 */
1947 SPAction *
1948 EffectLastVerb::make_action(Inkscape::UI::View::View *view)
1950     return make_action_helper(view, &vector);
1953 /** \brief  Decode the verb code and take appropriate action */
1954 void
1955 EffectLastVerb::perform(SPAction *action, void *data, void */*pdata*/)
1957     /* These aren't used, but are here to remind people not to use
1958        the CURRENT_DOCUMENT macros unless they really have to. */
1959     Inkscape::UI::View::View *current_view = sp_action_get_view(action);
1960     // SPDocument *current_document = SP_VIEW_DOCUMENT(current_view);
1961     Inkscape::Extension::Effect *effect = Inkscape::Extension::Effect::get_last_effect();
1963     if (effect == NULL) return;
1964     if (current_view == NULL) return;
1966     switch ((long) data) {
1967         case SP_VERB_EFFECT_LAST_PREF:
1968             if (!effect->prefs(current_view))
1969                 return;
1970             /* Note: fall through */
1971         case SP_VERB_EFFECT_LAST:
1972             effect->effect(current_view);
1973             break;
1974         default:
1975             return;
1976     }
1978     return;
1980 /* *********** End Effect Last ********** */
1982 /* *********** Fit Canvas ********** */
1984 /** \brief A class to represent the canvas fitting verbs */
1985 class FitCanvasVerb : public Verb {
1986 private:
1987     static void perform(SPAction *action, void *mydata, void *otherdata);
1988     static SPActionEventVector vector;
1989 protected:
1990     virtual SPAction *make_action(Inkscape::UI::View::View *view);
1991 public:
1992     /** \brief Use the Verb initializer with the same parameters. */
1993     FitCanvasVerb(unsigned int const code,
1994                    gchar const *id,
1995                    gchar const *name,
1996                    gchar const *tip,
1997                    gchar const *image) :
1998         Verb(code, id, name, tip, image)
1999     {
2000         set_default_sensitive(false);
2001     }
2002 }; /* FitCanvasVerb class */
2004 /**
2005  * The vector to attach in the fit canvas verb.
2006  */
2007 SPActionEventVector FitCanvasVerb::vector =
2008             {{NULL},FitCanvasVerb::perform, NULL, NULL, NULL, NULL};
2010 /** \brief  Create an action for a \c FitCanvasVerb
2011     \param  view  Which view the action should be created for
2012     \return The built action.
2014     Calls \c make_action_helper with the \c vector.
2015 */
2016 SPAction *
2017 FitCanvasVerb::make_action(Inkscape::UI::View::View *view)
2019     SPAction *action = make_action_helper(view, &vector);
2020     return action;
2023 /** \brief  Decode the verb code and take appropriate action */
2024 void
2025 FitCanvasVerb::perform(SPAction *action, void *data, void */*pdata*/)
2027     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
2028     if (!dt) return;
2029     SPDocument *doc = sp_desktop_document(dt);
2030     if (!doc) return;
2032     switch ((long) data) {
2033         case SP_VERB_FIT_CANVAS_TO_SELECTION:
2034             fit_canvas_to_selection(dt);
2035             break;
2036         case SP_VERB_FIT_CANVAS_TO_DRAWING:
2037             fit_canvas_to_drawing(doc);
2038             break;
2039         case SP_VERB_FIT_CANVAS_TO_SELECTION_OR_DRAWING:
2040             fit_canvas_to_selection_or_drawing(dt);
2041             break;
2042         default:
2043             return;
2044     }
2046     return;
2048 /* *********** End Fit Canvas ********** */
2051 /* *********** Lock'N'Hide ********** */
2053 /** \brief A class to represent the object unlocking and unhiding verbs */
2054 class LockAndHideVerb : public Verb {
2055 private:
2056     static void perform(SPAction *action, void *mydata, void *otherdata);
2057     static SPActionEventVector vector;
2058 protected:
2059     virtual SPAction *make_action(Inkscape::UI::View::View *view);
2060 public:
2061     /** \brief Use the Verb initializer with the same parameters. */
2062     LockAndHideVerb(unsigned int const code,
2063                    gchar const *id,
2064                    gchar const *name,
2065                    gchar const *tip,
2066                    gchar const *image) :
2067         Verb(code, id, name, tip, image)
2068     {
2069         set_default_sensitive(true);
2070     }
2071 }; /* LockAndHideVerb class */
2073 /**
2074  * The vector to attach in the lock'n'hide verb.
2075  */
2076 SPActionEventVector LockAndHideVerb::vector =
2077             {{NULL},LockAndHideVerb::perform, NULL, NULL, NULL, NULL};
2079 /** \brief  Create an action for a \c LockAndHideVerb
2080     \param  view  Which view the action should be created for
2081     \return The built action.
2083     Calls \c make_action_helper with the \c vector.
2084 */
2085 SPAction *
2086 LockAndHideVerb::make_action(Inkscape::UI::View::View *view)
2088     SPAction *action = make_action_helper(view, &vector);
2089     return action;
2092 /** \brief  Decode the verb code and take appropriate action */
2093 void
2094 LockAndHideVerb::perform(SPAction *action, void *data, void */*pdata*/)
2096     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
2097     if (!dt) return;
2098     SPDocument *doc = sp_desktop_document(dt);
2099     if (!doc) return;
2101     switch ((long) data) {
2102         case SP_VERB_UNLOCK_ALL:
2103             unlock_all(dt);
2104             sp_document_done(doc, SP_VERB_UNLOCK_ALL, _("Unlock all objects in the current layer"));
2105             break;
2106         case SP_VERB_UNLOCK_ALL_IN_ALL_LAYERS:
2107             unlock_all_in_all_layers(dt);
2108             sp_document_done(doc, SP_VERB_UNLOCK_ALL_IN_ALL_LAYERS, _("Unlock all objects in all layers"));
2109             break;
2110         case SP_VERB_UNHIDE_ALL:
2111             unhide_all(dt);
2112             sp_document_done(doc, SP_VERB_UNHIDE_ALL, _("Unhide all objects in the current layer"));
2113             break;
2114         case SP_VERB_UNHIDE_ALL_IN_ALL_LAYERS:
2115             unhide_all_in_all_layers(dt);
2116             sp_document_done(doc, SP_VERB_UNHIDE_ALL_IN_ALL_LAYERS, _("Unhide all objects in all layers"));
2117             break;
2118         default:
2119             return;
2120     }
2122     return;
2124 /* *********** End Lock'N'Hide ********** */
2127 /* these must be in the same order as the SP_VERB_* enum in "verbs.h" */
2128 Verb *Verb::_base_verbs[] = {
2129     /* Header */
2130     new Verb(SP_VERB_INVALID, NULL, NULL, NULL, NULL),
2131     new Verb(SP_VERB_NONE, "None", N_("None"), N_("Does nothing"), NULL),
2133     /* File */
2134     new FileVerb(SP_VERB_FILE_NEW, "FileNew", N_("Default"), N_("Create new document from the default template"),
2135                  GTK_STOCK_NEW ),
2136     new FileVerb(SP_VERB_FILE_OPEN, "FileOpen", N_("_Open..."),
2137                  N_("Open an existing document"), GTK_STOCK_OPEN ),
2138     new FileVerb(SP_VERB_FILE_REVERT, "FileRevert", N_("Re_vert"),
2139                  N_("Revert to the last saved version of document (changes will be lost)"), GTK_STOCK_REVERT_TO_SAVED ),
2140     new FileVerb(SP_VERB_FILE_SAVE, "FileSave", N_("_Save"), N_("Save document"),
2141                  GTK_STOCK_SAVE ),
2142     new FileVerb(SP_VERB_FILE_SAVE_AS, "FileSaveAs", N_("Save _As..."),
2143                  N_("Save document under a new name"), GTK_STOCK_SAVE_AS ),
2144     new FileVerb(SP_VERB_FILE_SAVE_A_COPY, "FileSaveACopy", N_("Save a Cop_y..."),
2145                  N_("Save a copy of the document under a new name"), NULL ),
2146     new FileVerb(SP_VERB_FILE_PRINT, "FilePrint", N_("_Print..."), N_("Print document"),
2147                  GTK_STOCK_PRINT ),
2148     // TRANSLATORS: "Vacuum Defs" means "Clean up defs" (so as to remove unused definitions)
2149     new FileVerb(SP_VERB_FILE_VACUUM, "FileVacuum", N_("Vac_uum Defs"), N_("Remove unused definitions (such as gradients or clipping paths) from the &lt;defs&gt; of the document"),
2150                  "file_vacuum" ),
2151     new FileVerb(SP_VERB_FILE_PRINT_PREVIEW, "FilePrintPreview", N_("Print Previe_w"),
2152                  N_("Preview document printout"), GTK_STOCK_PRINT_PREVIEW ),
2153     new FileVerb(SP_VERB_FILE_IMPORT, "FileImport", N_("_Import..."),
2154                  N_("Import a bitmap or SVG image into this document"), "file_import"),
2155     new FileVerb(SP_VERB_FILE_EXPORT, "FileExport", N_("_Export Bitmap..."),
2156                  N_("Export this document or a selection as a bitmap image"), "file_export"),
2157     new FileVerb(SP_VERB_FILE_IMPORT_FROM_OCAL, "FileImportFromOCAL", N_("Import From Open Clip Art Library"), N_("Import a document from Open Clip Art Library"), "ocal_import"),
2158     new FileVerb(SP_VERB_FILE_EXPORT_TO_OCAL, "FileExportToOCAL", N_("Export To Open Clip Art Library"), N_("Export this document to Open Clip Art Library"), "ocal_export"),
2159     new FileVerb(SP_VERB_FILE_NEXT_DESKTOP, "NextWindow", N_("N_ext Window"),
2160                  N_("Switch to the next document window"), "window_next"),
2161     new FileVerb(SP_VERB_FILE_PREV_DESKTOP, "PrevWindow", N_("P_revious Window"),
2162                  N_("Switch to the previous document window"), "window_previous"),
2163     new FileVerb(SP_VERB_FILE_CLOSE_VIEW, "FileClose", N_("_Close"),
2164                  N_("Close this document window"), GTK_STOCK_CLOSE),
2165     new FileVerb(SP_VERB_FILE_QUIT, "FileQuit", N_("_Quit"), N_("Quit Inkscape"), GTK_STOCK_QUIT),
2167     /* Edit */
2168     new EditVerb(SP_VERB_EDIT_UNDO, "EditUndo", N_("_Undo"), N_("Undo last action"),
2169                  GTK_STOCK_UNDO),
2170     new EditVerb(SP_VERB_EDIT_REDO, "EditRedo", N_("_Redo"),
2171                  N_("Do again the last undone action"), GTK_STOCK_REDO),
2172     new EditVerb(SP_VERB_EDIT_CUT, "EditCut", N_("Cu_t"),
2173                  N_("Cut selection to clipboard"), GTK_STOCK_CUT),
2174     new EditVerb(SP_VERB_EDIT_COPY, "EditCopy", N_("_Copy"),
2175                  N_("Copy selection to clipboard"), GTK_STOCK_COPY),
2176     new EditVerb(SP_VERB_EDIT_PASTE, "EditPaste", N_("_Paste"),
2177                  N_("Paste objects from clipboard to mouse point, or paste text"), GTK_STOCK_PASTE),
2178     new EditVerb(SP_VERB_EDIT_PASTE_STYLE, "EditPasteStyle", N_("Paste _Style"),
2179                  N_("Apply the style of the copied object to selection"), "selection_paste_style"),
2180     new EditVerb(SP_VERB_EDIT_PASTE_SIZE, "EditPasteSize", N_("Paste Si_ze"),
2181                  N_("Scale selection to match the size of the copied object"), NULL),
2182     new EditVerb(SP_VERB_EDIT_PASTE_SIZE_X, "EditPasteWidth", N_("Paste _Width"),
2183                  N_("Scale selection horizontally to match the width of the copied object"), NULL),
2184     new EditVerb(SP_VERB_EDIT_PASTE_SIZE_Y, "EditPasteHeight", N_("Paste _Height"),
2185                  N_("Scale selection vertically to match the height of the copied object"), NULL),
2186     new EditVerb(SP_VERB_EDIT_PASTE_SIZE_SEPARATELY, "EditPasteSizeSeparately", N_("Paste Size Separately"),
2187                  N_("Scale each selected object to match the size of the copied object"), NULL),
2188     new EditVerb(SP_VERB_EDIT_PASTE_SIZE_SEPARATELY_X, "EditPasteWidthSeparately", N_("Paste Width Separately"),
2189                  N_("Scale each selected object horizontally to match the width of the copied object"), NULL),
2190     new EditVerb(SP_VERB_EDIT_PASTE_SIZE_SEPARATELY_Y, "EditPasteHeightSeparately", N_("Paste Height Separately"),
2191                  N_("Scale each selected object vertically to match the height of the copied object"), NULL),
2192     new EditVerb(SP_VERB_EDIT_PASTE_IN_PLACE, "EditPasteInPlace", N_("Paste _In Place"),
2193                  N_("Paste objects from clipboard to the original location"), "selection_paste_in_place"),
2194     new EditVerb(SP_VERB_EDIT_PASTE_LIVEPATHEFFECT, "EditPasteLivePathEffect", N_("Paste Path _Effect"),
2195                  N_("Apply the path effect of the copied object to selection"), NULL),
2196     new EditVerb(SP_VERB_EDIT_DELETE, "EditDelete", N_("_Delete"),
2197                  N_("Delete selection"), GTK_STOCK_DELETE),
2198     new EditVerb(SP_VERB_EDIT_DUPLICATE, "EditDuplicate", N_("Duplic_ate"),
2199                  N_("Duplicate selected objects"), "edit_duplicate"),
2200     new EditVerb(SP_VERB_EDIT_CLONE, "EditClone", N_("Create Clo_ne"),
2201                  N_("Create a clone (a copy linked to the original) of selected object"), "edit_clone"),
2202     new EditVerb(SP_VERB_EDIT_UNLINK_CLONE, "EditUnlinkClone", N_("Unlin_k Clone"),
2203                  N_("Cut the selected clone's link to its original, turning it into a standalone object"), "edit_unlink_clone"),
2204     new EditVerb(SP_VERB_EDIT_CLONE_SELECT_ORIGINAL, "EditCloneSelectOriginal", N_("Select _Original"),
2205                  N_("Select the object to which the selected clone is linked"), "edit_select_original"),
2206     // TRANSLATORS: Convert selection to a line marker
2207     new EditVerb(SP_VERB_EDIT_SELECTION_2_MARKER, "ObjectsToMarker", N_("Objects to _Marker"),
2208                  N_("Convert selection to a line marker"), NULL),
2209     // TRANSLATORS: Convert selection to a collection of guidelines
2210     new EditVerb(SP_VERB_EDIT_SELECTION_2_GUIDES, "ObjectsToGuides", N_("Objects to Gu_ides"),
2211                  N_("Convert selected objects to a collection of guidelines aligned with their edges"), NULL),
2212     // TRANSLATORS: Convert selection to a rectangle with tiled pattern fill
2213     new EditVerb(SP_VERB_EDIT_TILE, "ObjectsToPattern", N_("Objects to Patter_n"),
2214                  N_("Convert selection to a rectangle with tiled pattern fill"), NULL),
2215     // TRANSLATORS: Extract objects from a tiled pattern fill
2216     new EditVerb(SP_VERB_EDIT_UNTILE, "ObjectsFromPattern", N_("Pattern to _Objects"),
2217                  N_("Extract objects from a tiled pattern fill"), NULL),
2218     new EditVerb(SP_VERB_EDIT_CLEAR_ALL, "EditClearAll", N_("Clea_r All"),
2219                  N_("Delete all objects from document"), NULL),
2220     new EditVerb(SP_VERB_EDIT_SELECT_ALL, "EditSelectAll", N_("Select Al_l"),
2221                  N_("Select all objects or all nodes"), "selection_select_all"),
2222     new EditVerb(SP_VERB_EDIT_SELECT_ALL_IN_ALL_LAYERS, "EditSelectAllInAllLayers", N_("Select All in All La_yers"),
2223                  N_("Select all objects in all visible and unlocked layers"), "selection_select_all_in_all_layers"),
2224     new EditVerb(SP_VERB_EDIT_INVERT, "EditInvert", N_("In_vert Selection"),
2225                  N_("Invert selection (unselect what is selected and select everything else)"), "selection_invert"),
2226     new EditVerb(SP_VERB_EDIT_INVERT_IN_ALL_LAYERS, "EditInvertInAllLayers", N_("Invert in All Layers"),
2227                  N_("Invert selection in all visible and unlocked layers"), NULL),
2228     new EditVerb(SP_VERB_EDIT_SELECT_NEXT, "EditSelectNext", N_("Select Next"),
2229                  N_("Select next object or node"), NULL),
2230     new EditVerb(SP_VERB_EDIT_SELECT_PREV, "EditSelectPrev", N_("Select Previous"),
2231                  N_("Select previous object or node"), NULL),
2232     new EditVerb(SP_VERB_EDIT_DESELECT, "EditDeselect", N_("D_eselect"),
2233                  N_("Deselect any selected objects or nodes"), "selection_deselect"),
2234     new EditVerb(SP_VERB_EDIT_NEXT_PATHEFFECT_PARAMETER, "EditNextPathEffectParameter", N_("Next Path Effect Parameter"),
2235                  N_("Show next Path Effect parameter for editing"), "edit_next_parameter"),
2237     /* Selection */
2238     new SelectionVerb(SP_VERB_SELECTION_TO_FRONT, "SelectionToFront", N_("Raise to _Top"),
2239                       N_("Raise selection to top"), "selection_top"),
2240     new SelectionVerb(SP_VERB_SELECTION_TO_BACK, "SelectionToBack", N_("Lower to _Bottom"),
2241                       N_("Lower selection to bottom"), "selection_bot"),
2242     new SelectionVerb(SP_VERB_SELECTION_RAISE, "SelectionRaise", N_("_Raise"),
2243                       N_("Raise selection one step"), "selection_up"),
2244     new SelectionVerb(SP_VERB_SELECTION_LOWER, "SelectionLower", N_("_Lower"),
2245                       N_("Lower selection one step"), "selection_down"),
2246     new SelectionVerb(SP_VERB_SELECTION_GROUP, "SelectionGroup", N_("_Group"),
2247                       N_("Group selected objects"), "selection_group"),
2248     new SelectionVerb(SP_VERB_SELECTION_UNGROUP, "SelectionUnGroup", N_("_Ungroup"),
2249                       N_("Ungroup selected groups"), "selection_ungroup"),
2251     new SelectionVerb(SP_VERB_SELECTION_TEXTTOPATH, "SelectionTextToPath", N_("_Put on Path"),
2252                       N_("Put text on path"), "put_on_path"),
2253     new SelectionVerb(SP_VERB_SELECTION_TEXTFROMPATH, "SelectionTextFromPath", N_("_Remove from Path"),
2254                       N_("Remove text from path"), "remove_from_path"),
2255     new SelectionVerb(SP_VERB_SELECTION_REMOVE_KERNS, "SelectionTextRemoveKerns", N_("Remove Manual _Kerns"),
2256                       // TRANSLATORS: "glyph": An image used in the visual representation of characters;
2257                       //  roughly speaking, how a character looks. A font is a set of glyphs.
2258                       N_("Remove all manual kerns and glyph rotations from a text object"), "remove_manual_kerns"),
2260     new SelectionVerb(SP_VERB_SELECTION_UNION, "SelectionUnion", N_("_Union"),
2261                       N_("Create union of selected paths"), "union"),
2262     new SelectionVerb(SP_VERB_SELECTION_INTERSECT, "SelectionIntersect", N_("_Intersection"),
2263                       N_("Create intersection of selected paths"), "intersection"),
2264     new SelectionVerb(SP_VERB_SELECTION_DIFF, "SelectionDiff", N_("_Difference"),
2265                       N_("Create difference of selected paths (bottom minus top)"), "difference"),
2266     new SelectionVerb(SP_VERB_SELECTION_SYMDIFF, "SelectionSymDiff", N_("E_xclusion"),
2267                       N_("Create exclusive OR of selected paths (those parts that belong to only one path)"), "exclusion"),
2268     new SelectionVerb(SP_VERB_SELECTION_CUT, "SelectionDivide", N_("Di_vision"),
2269                       N_("Cut the bottom path into pieces"), "division"),
2270     // TRANSLATORS: "to cut a path" is not the same as "to break a path apart" - see the
2271     // Advanced tutorial for more info
2272     new SelectionVerb(SP_VERB_SELECTION_SLICE, "SelectionCutPath", N_("Cut _Path"),
2273                       N_("Cut the bottom path's stroke into pieces, removing fill"), "cut_path"),
2274     // TRANSLATORS: "outset": expand a shape by offsetting the object's path,
2275     // i.e. by displacing it perpendicular to the path in each point.
2276     // See also the Advanced Tutorial for explanation.
2277     new SelectionVerb(SP_VERB_SELECTION_OFFSET, "SelectionOffset", N_("Outs_et"),
2278                       N_("Outset selected paths"), "outset_path"),
2279     new SelectionVerb(SP_VERB_SELECTION_OFFSET_SCREEN, "SelectionOffsetScreen",
2280                       N_("O_utset Path by 1 px"),
2281                       N_("Outset selected paths by 1 px"), NULL),
2282     new SelectionVerb(SP_VERB_SELECTION_OFFSET_SCREEN_10, "SelectionOffsetScreen10",
2283                       N_("O_utset Path by 10 px"),
2284                       N_("Outset selected paths by 10 px"), NULL),
2285     // TRANSLATORS: "inset": contract a shape by offsetting the object's path,
2286     // i.e. by displacing it perpendicular to the path in each point.
2287     // See also the Advanced Tutorial for explanation.
2288     new SelectionVerb(SP_VERB_SELECTION_INSET, "SelectionInset", N_("I_nset"),
2289                       N_("Inset selected paths"), "inset_path"),
2290     new SelectionVerb(SP_VERB_SELECTION_INSET_SCREEN, "SelectionInsetScreen",
2291                       N_("I_nset Path by 1 px"),
2292                       N_("Inset selected paths by 1 px"), NULL),
2293     new SelectionVerb(SP_VERB_SELECTION_INSET_SCREEN_10, "SelectionInsetScreen10",
2294                       N_("I_nset Path by 10 px"),
2295                       N_("Inset selected paths by 10 px"), NULL),
2296     new SelectionVerb(SP_VERB_SELECTION_DYNAMIC_OFFSET, "SelectionDynOffset",
2297                       N_("D_ynamic Offset"), N_("Create a dynamic offset object"), "dynamic_offset"),
2298     new SelectionVerb(SP_VERB_SELECTION_LINKED_OFFSET, "SelectionLinkedOffset",
2299                       N_("_Linked Offset"),
2300                       N_("Create a dynamic offset object linked to the original path"),
2301                       "linked_offset"),
2302     new SelectionVerb(SP_VERB_SELECTION_OUTLINE, "StrokeToPath", N_("_Stroke to Path"),
2303                       N_("Convert selected object's stroke to paths"), "stroke_tocurve"),
2304     new SelectionVerb(SP_VERB_SELECTION_SIMPLIFY, "SelectionSimplify", N_("Si_mplify"),
2305                       N_("Simplify selected paths (remove extra nodes)"), "simplify"),
2306     new SelectionVerb(SP_VERB_SELECTION_REVERSE, "SelectionReverse", N_("_Reverse"),
2307                       N_("Reverse the direction of selected paths (useful for flipping markers)"), "selection_reverse"),
2308     // TRANSLATORS: "to trace" means "to convert a bitmap to vector graphics" (to vectorize)
2309     new SelectionVerb(SP_VERB_SELECTION_TRACE, "SelectionTrace", N_("_Trace Bitmap..."),
2310                       N_("Create one or more paths from a bitmap by tracing it"), "selection_trace"),
2311     new SelectionVerb(SP_VERB_SELECTION_CREATE_BITMAP, "SelectionCreateBitmap", N_("_Make a Bitmap Copy"),
2312                       N_("Export selection to a bitmap and insert it into document"), "selection_bitmap" ),
2313     new SelectionVerb(SP_VERB_SELECTION_COMBINE, "SelectionCombine", N_("_Combine"),
2314                       N_("Combine several paths into one"), "selection_combine"),
2315     // TRANSLATORS: "to cut a path" is not the same as "to break a path apart" - see the
2316     // Advanced tutorial for more info
2317     new SelectionVerb(SP_VERB_SELECTION_BREAK_APART, "SelectionBreakApart", N_("Break _Apart"),
2318                       N_("Break selected paths into subpaths"), "selection_break"),
2319     new SelectionVerb(SP_VERB_SELECTION_GRIDTILE, "DialogGridArrange", N_("Rows and Columns..."),
2320                       N_("Arrange selected objects in a table"), "grid_arrange"),
2321     /* Layer */
2322     new LayerVerb(SP_VERB_LAYER_NEW, "LayerNew", N_("_Add Layer..."),
2323                   N_("Create a new layer"), "new_layer"),
2324     new LayerVerb(SP_VERB_LAYER_RENAME, "LayerRename", N_("Re_name Layer..."),
2325                   N_("Rename the current layer"), "rename_layer"),
2326     new LayerVerb(SP_VERB_LAYER_NEXT, "LayerNext", N_("Switch to Layer Abov_e"),
2327                   N_("Switch to the layer above the current"), "switch_to_layer_above"),
2328     new LayerVerb(SP_VERB_LAYER_PREV, "LayerPrev", N_("Switch to Layer Belo_w"),
2329                   N_("Switch to the layer below the current"), "switch_to_layer_below"),
2330     new LayerVerb(SP_VERB_LAYER_MOVE_TO_NEXT, "LayerMoveToNext", N_("Move Selection to Layer Abo_ve"),
2331                   N_("Move selection to the layer above the current"), "move_selection_above"),
2332     new LayerVerb(SP_VERB_LAYER_MOVE_TO_PREV, "LayerMoveToPrev", N_("Move Selection to Layer Bel_ow"),
2333                   N_("Move selection to the layer below the current"), "move_selection_below"),
2334     new LayerVerb(SP_VERB_LAYER_TO_TOP, "LayerToTop", N_("Layer to _Top"),
2335                   N_("Raise the current layer to the top"), "layer_to_top"),
2336     new LayerVerb(SP_VERB_LAYER_TO_BOTTOM, "LayerToBottom", N_("Layer to _Bottom"),
2337                   N_("Lower the current layer to the bottom"), "layer_to_bottom"),
2338     new LayerVerb(SP_VERB_LAYER_RAISE, "LayerRaise", N_("_Raise Layer"),
2339                   N_("Raise the current layer"), "raise_layer"),
2340     new LayerVerb(SP_VERB_LAYER_LOWER, "LayerLower", N_("_Lower Layer"),
2341                   N_("Lower the current layer"), "lower_layer"),
2342     new LayerVerb(SP_VERB_LAYER_DELETE, "LayerDelete", N_("_Delete Current Layer"),
2343                   N_("Delete the current layer"), "delete_layer"),
2345     /* Object */
2346     new ObjectVerb(SP_VERB_OBJECT_ROTATE_90_CW, "ObjectRotate90", N_("Rotate _90&#176; CW"),
2347                    // This is shared between tooltips and statusbar, so they
2348                    // must use UTF-8, not HTML entities for special characters.
2349                    N_("Rotate selection 90\xc2\xb0 clockwise"), "object_rotate_90_CW"),
2350     new ObjectVerb(SP_VERB_OBJECT_ROTATE_90_CCW, "ObjectRotate90CCW", N_("Rotate 9_0&#176; CCW"),
2351                    // This is shared between tooltips and statusbar, so they
2352                    // must use UTF-8, not HTML entities for special characters.
2353                    N_("Rotate selection 90\xc2\xb0 counter-clockwise"), "object_rotate_90_CCW"),
2354     new ObjectVerb(SP_VERB_OBJECT_FLATTEN, "ObjectRemoveTransform", N_("Remove _Transformations"),
2355                    N_("Remove transformations from object"), "object_reset"),
2356     new ObjectVerb(SP_VERB_OBJECT_TO_CURVE, "ObjectToPath", N_("_Object to Path"),
2357                    N_("Convert selected object to path"), "object_tocurve"),
2358     new ObjectVerb(SP_VERB_OBJECT_FLOW_TEXT, "ObjectFlowText", N_("_Flow into Frame"),
2359                    N_("Put text into a frame (path or shape), creating a flowed text linked to the frame object"), "flow_into_frame"),
2360     new ObjectVerb(SP_VERB_OBJECT_UNFLOW_TEXT, "ObjectUnFlowText", N_("_Unflow"),
2361                    N_("Remove text from frame (creates a single-line text object)"), "unflow"),
2362     new ObjectVerb(SP_VERB_OBJECT_FLOWTEXT_TO_TEXT, "ObjectFlowtextToText", N_("_Convert to Text"),
2363                    N_("Convert flowed text to regular text object (preserves appearance)"), "convert_to_text"),
2364     new ObjectVerb(SP_VERB_OBJECT_FLIP_HORIZONTAL, "ObjectFlipHorizontally",
2365                    N_("Flip _Horizontal"), N_("Flip selected objects horizontally"),
2366                    "object_flip_hor"),
2367     new ObjectVerb(SP_VERB_OBJECT_FLIP_VERTICAL, "ObjectFlipVertically",
2368                    N_("Flip _Vertical"), N_("Flip selected objects vertically"),
2369                    "object_flip_ver"),
2370     new ObjectVerb(SP_VERB_OBJECT_SET_MASK, "ObjectSetMask", N_("_Set"),
2371                  N_("Apply mask to selection (using the topmost object as mask)"), NULL),
2372     new ObjectVerb(SP_VERB_OBJECT_EDIT_MASK, "ObjectEditMask", N_("_Edit"),
2373                  N_("Edit mask"), NULL),
2374     new ObjectVerb(SP_VERB_OBJECT_UNSET_MASK, "ObjectUnSetMask", N_("_Release"),
2375                  N_("Remove mask from selection"), NULL),
2376     new ObjectVerb(SP_VERB_OBJECT_SET_CLIPPATH, "ObjectSetClipPath", N_("_Set"),
2377                  N_("Apply clipping path to selection (using the topmost object as clipping path)"), NULL),
2378     new ObjectVerb(SP_VERB_OBJECT_EDIT_CLIPPATH, "ObjectEditClipPath", N_("_Edit"),
2379                  N_("Edit clipping path"), NULL),
2380     new ObjectVerb(SP_VERB_OBJECT_UNSET_CLIPPATH, "ObjectUnSetClipPath", N_("_Release"),
2381                  N_("Remove clipping path from selection"), NULL),
2383     /* Tools */
2384     new ContextVerb(SP_VERB_CONTEXT_SELECT, "ToolSelector", N_("Select"),
2385                     N_("Select and transform objects"), "draw_select"),
2386     new ContextVerb(SP_VERB_CONTEXT_NODE, "ToolNode", N_("Node Edit"),
2387                     N_("Edit paths by nodes"), "draw_node"),
2388     new ContextVerb(SP_VERB_CONTEXT_TWEAK, "ToolTweak", N_("Tweak"),
2389                     N_("Tweak objects by sculpting or painting"), "draw_tweak"),
2390     new ContextVerb(SP_VERB_CONTEXT_RECT, "ToolRect", N_("Rectangle"),
2391                     N_("Create rectangles and squares"), "draw_rect"),
2392     new ContextVerb(SP_VERB_CONTEXT_3DBOX, "Tool3DBox", N_("3D Box"),
2393                     N_("Create 3D boxes"), "draw_3dbox"),
2394     new ContextVerb(SP_VERB_CONTEXT_ARC, "ToolArc", N_("Ellipse"),
2395                     N_("Create circles, ellipses, and arcs"), "draw_arc"),
2396     new ContextVerb(SP_VERB_CONTEXT_STAR, "ToolStar", N_("Star"),
2397                     N_("Create stars and polygons"), "draw_star"),
2398     new ContextVerb(SP_VERB_CONTEXT_SPIRAL, "ToolSpiral", N_("Spiral"),
2399                     N_("Create spirals"), "draw_spiral"),
2400     new ContextVerb(SP_VERB_CONTEXT_PENCIL, "ToolPencil", N_("Pencil"),
2401                     N_("Draw freehand lines"), "draw_freehand"),
2402     new ContextVerb(SP_VERB_CONTEXT_PEN, "ToolPen", N_("Pen"),
2403                     N_("Draw Bezier curves and straight lines"), "draw_pen"),
2404     new ContextVerb(SP_VERB_CONTEXT_CALLIGRAPHIC, "ToolCalligraphic", N_("Calligraphy"),
2405                     N_("Draw calligraphic or brush strokes"), "draw_calligraphic"),
2406     new ContextVerb(SP_VERB_CONTEXT_TEXT, "ToolText", N_("Text"),
2407                     N_("Create and edit text objects"), "draw_text"),
2408     new ContextVerb(SP_VERB_CONTEXT_GRADIENT, "ToolGradient", N_("Gradient"),
2409                     N_("Create and edit gradients"), "draw_gradient"),
2410     new ContextVerb(SP_VERB_CONTEXT_ZOOM, "ToolZoom", N_("Zoom"),
2411                     N_("Zoom in or out"), "draw_zoom"),
2412     new ContextVerb(SP_VERB_CONTEXT_DROPPER, "ToolDropper", N_("Dropper"),
2413                     N_("Pick colors from image"), "draw_dropper"),
2414     new ContextVerb(SP_VERB_CONTEXT_CONNECTOR, "ToolConnector", N_("Connector"),
2415                     N_("Create diagram connectors"), "draw_connector"),
2416     new ContextVerb(SP_VERB_CONTEXT_PAINTBUCKET, "ToolPaintBucket", N_("Paint Bucket"),
2417                     N_("Fill bounded areas"), "draw_paintbucket"),
2419     /* Tool prefs */
2420     new ContextVerb(SP_VERB_CONTEXT_SELECT_PREFS, "SelectPrefs", N_("Selector Preferences"),
2421                     N_("Open Preferences for the Selector tool"), NULL),
2422     new ContextVerb(SP_VERB_CONTEXT_NODE_PREFS, "NodePrefs", N_("Node Tool Preferences"),
2423                     N_("Open Preferences for the Node tool"), NULL),
2424     new ContextVerb(SP_VERB_CONTEXT_TWEAK_PREFS, "TweakPrefs", N_("Tweak Tool Preferences"),
2425                     N_("Open Preferences for the Tweak tool"), NULL),
2426     new ContextVerb(SP_VERB_CONTEXT_RECT_PREFS, "RectPrefs", N_("Rectangle Preferences"),
2427                     N_("Open Preferences for the Rectangle tool"), NULL),
2428     new ContextVerb(SP_VERB_CONTEXT_3DBOX_PREFS, "3DBoxPrefs", N_("3D Box Preferences"),
2429                     N_("Open Preferences for the 3D Box tool"), NULL),
2430     new ContextVerb(SP_VERB_CONTEXT_ARC_PREFS, "ArcPrefs", N_("Ellipse Preferences"),
2431                     N_("Open Preferences for the Ellipse tool"), NULL),
2432     new ContextVerb(SP_VERB_CONTEXT_STAR_PREFS, "StarPrefs", N_("Star Preferences"),
2433                     N_("Open Preferences for the Star tool"), NULL),
2434     new ContextVerb(SP_VERB_CONTEXT_SPIRAL_PREFS, "SpiralPrefs", N_("Spiral Preferences"),
2435                     N_("Open Preferences for the Spiral tool"), NULL),
2436     new ContextVerb(SP_VERB_CONTEXT_PENCIL_PREFS, "PencilPrefs", N_("Pencil Preferences"),
2437                     N_("Open Preferences for the Pencil tool"), NULL),
2438     new ContextVerb(SP_VERB_CONTEXT_PEN_PREFS, "PenPrefs", N_("Pen Preferences"),
2439                     N_("Open Preferences for the Pen tool"), NULL),
2440     new ContextVerb(SP_VERB_CONTEXT_CALLIGRAPHIC_PREFS, "CalligraphicPrefs", N_("Calligraphic Preferences"),
2441                     N_("Open Preferences for the Calligraphy tool"), NULL),
2442     new ContextVerb(SP_VERB_CONTEXT_TEXT_PREFS, "TextPrefs", N_("Text Preferences"),
2443                     N_("Open Preferences for the Text tool"), NULL),
2444     new ContextVerb(SP_VERB_CONTEXT_GRADIENT_PREFS, "GradientPrefs", N_("Gradient Preferences"),
2445                     N_("Open Preferences for the Gradient tool"), NULL),
2446     new ContextVerb(SP_VERB_CONTEXT_ZOOM_PREFS, "ZoomPrefs", N_("Zoom Preferences"),
2447                     N_("Open Preferences for the Zoom tool"), NULL),
2448     new ContextVerb(SP_VERB_CONTEXT_DROPPER_PREFS, "DropperPrefs", N_("Dropper Preferences"),
2449                     N_("Open Preferences for the Dropper tool"), NULL),
2450     new ContextVerb(SP_VERB_CONTEXT_CONNECTOR_PREFS, "ConnectorPrefs", N_("Connector Preferences"),
2451                     N_("Open Preferences for the Connector tool"), NULL),
2452     new ContextVerb(SP_VERB_CONTEXT_PAINTBUCKET_PREFS, "PaintBucketPrefs", N_("Paint Bucket Preferences"),
2453                     N_("Open Preferences for the Paint Bucket tool"), NULL),
2455     /* Zoom/View */
2456     new ZoomVerb(SP_VERB_ZOOM_IN, "ZoomIn", N_("Zoom In"), N_("Zoom in"), "zoom_in"),
2457     new ZoomVerb(SP_VERB_ZOOM_OUT, "ZoomOut", N_("Zoom Out"), N_("Zoom out"), "zoom_out"),
2458     new ZoomVerb(SP_VERB_TOGGLE_RULERS, "ToggleRulers", N_("_Rulers"), N_("Show or hide the canvas rulers"), "rulers"),
2459     new ZoomVerb(SP_VERB_TOGGLE_SCROLLBARS, "ToggleScrollbars", N_("Scroll_bars"), N_("Show or hide the canvas scrollbars"), "scrollbars"),
2460     new ZoomVerb(SP_VERB_TOGGLE_GRID, "ToggleGrid", N_("_Grid"), N_("Show or hide the grid"), "grid"),
2461     new ZoomVerb(SP_VERB_TOGGLE_GUIDES, "ToggleGuides", N_("G_uides"), N_("Show or hide guides (drag from a ruler to create a guide)"), "guides"),
2462     new ZoomVerb(SP_VERB_TOGGLE_SNAPPING, "ToggleSnapping", N_("Snap"), N_("Toggle snapping on or off"), NULL),
2463     new ZoomVerb(SP_VERB_ZOOM_NEXT, "ZoomNext", N_("Nex_t Zoom"), N_("Next zoom (from the history of zooms)"),
2464                  "zoom_next"),
2465     new ZoomVerb(SP_VERB_ZOOM_PREV, "ZoomPrev", N_("Pre_vious Zoom"), N_("Previous zoom (from the history of zooms)"),
2466                  "zoom_previous"),
2467     new ZoomVerb(SP_VERB_ZOOM_1_1, "Zoom1:0", N_("Zoom 1:_1"), N_("Zoom to 1:1"),
2468                  "zoom_1_to_1"),
2469     new ZoomVerb(SP_VERB_ZOOM_1_2, "Zoom1:2", N_("Zoom 1:_2"), N_("Zoom to 1:2"),
2470                  "zoom_1_to_2"),
2471     new ZoomVerb(SP_VERB_ZOOM_2_1, "Zoom2:1", N_("_Zoom 2:1"), N_("Zoom to 2:1"),
2472                  "zoom_2_to_1"),
2473 #ifdef HAVE_GTK_WINDOW_FULLSCREEN
2474     new ZoomVerb(SP_VERB_FULLSCREEN, "FullScreen", N_("_Fullscreen"), N_("Stretch this document window to full screen"),
2475                  "fullscreen"),
2476 #endif /* HAVE_GTK_WINDOW_FULLSCREEN */
2477     new ZoomVerb(SP_VERB_VIEW_NEW, "ViewNew", N_("Duplic_ate Window"), N_("Open a new window with the same document"),
2478                  "view_new"),
2479     new ZoomVerb(SP_VERB_VIEW_NEW_PREVIEW, "ViewNewPreview", N_("_New View Preview"),
2480                  N_("New View Preview"), NULL/*"view_new_preview"*/),
2482     new ZoomVerb(SP_VERB_VIEW_MODE_NORMAL, "ViewModeNormal", N_("_Normal"),
2483                  N_("Switch to normal display mode"), NULL),
2484     new ZoomVerb(SP_VERB_VIEW_MODE_OUTLINE, "ViewModeOutline", N_("_Outline"),
2485                  N_("Switch to outline (wireframe) display mode"), NULL),
2486     new ZoomVerb(SP_VERB_VIEW_MODE_TOGGLE, "ViewModeToggle", N_("_Toggle"),
2487                  N_("Toggle between normal and outline display modes"), NULL),
2489     new ZoomVerb(SP_VERB_VIEW_CMS_TOGGLE, "ViewCmsToggle", N_("Color-managed view"),
2490                  N_("Toggle color-managed display for this document window"), "color_management"),
2492     new ZoomVerb(SP_VERB_VIEW_ICON_PREVIEW, "ViewIconPreview", N_("Ico_n Preview..."),
2493                  N_("Open a window to preview objects at different icon resolutions"), "view_icon_preview"),
2494     new ZoomVerb(SP_VERB_ZOOM_PAGE, "ZoomPage", N_("_Page"),
2495                  N_("Zoom to fit page in window"), "zoom_page"),
2496     new ZoomVerb(SP_VERB_ZOOM_PAGE_WIDTH, "ZoomPageWidth", N_("Page _Width"),
2497                  N_("Zoom to fit page width in window"), "zoom_pagewidth"),
2498     new ZoomVerb(SP_VERB_ZOOM_DRAWING, "ZoomDrawing", N_("_Drawing"),
2499                  N_("Zoom to fit drawing in window"), "zoom_draw"),
2500     new ZoomVerb(SP_VERB_ZOOM_SELECTION, "ZoomSelection", N_("_Selection"),
2501                  N_("Zoom to fit selection in window"), "zoom_select"),
2503     /* Dialogs */
2504     new DialogVerb(SP_VERB_DIALOG_DISPLAY, "DialogPreferences", N_("In_kscape Preferences..."),
2505                    N_("Edit global Inkscape preferences"), GTK_STOCK_PREFERENCES ),
2506     new DialogVerb(SP_VERB_DIALOG_NAMEDVIEW, "DialogDocumentProperties", N_("_Document Properties..."),
2507                    N_("Edit properties of this document (to be saved with the document)"), GTK_STOCK_PROPERTIES ),
2508     new DialogVerb(SP_VERB_DIALOG_METADATA, "DialogMetadata", N_("Document _Metadata..."),
2509                    N_("Edit document metadata (to be saved with the document)"), "document_metadata" ),
2510     new DialogVerb(SP_VERB_DIALOG_FILL_STROKE, "DialogFillStroke", N_("_Fill and Stroke..."),
2511                    N_("Edit objects' colors, gradients, stroke width, arrowheads, dash patterns..."), "fill_and_stroke"),
2512     // TRANSLATORS: "Swatches" means: color samples
2513     new DialogVerb(SP_VERB_DIALOG_SWATCHES, "DialogSwatches", N_("S_watches..."),
2514                    N_("Select colors from a swatches palette"), GTK_STOCK_SELECT_COLOR),
2515     new DialogVerb(SP_VERB_DIALOG_TRANSFORM, "DialogTransform", N_("Transfor_m..."),
2516                    N_("Precisely control objects' transformations"), "object_trans"),
2517     new DialogVerb(SP_VERB_DIALOG_ALIGN_DISTRIBUTE, "DialogAlignDistribute", N_("_Align and Distribute..."),
2518                    N_("Align and distribute objects"), "object_align"),
2519     new DialogVerb(SP_VERB_DIALOG_UNDO_HISTORY, "DialogUndoHistory", N_("Undo _History..."),
2520                    N_("Undo History"), "edit_undo_history"),
2521     new DialogVerb(SP_VERB_DIALOG_TEXT, "DialogText", N_("_Text and Font..."),
2522                    N_("View and select font family, font size and other text properties"), "object_font"),
2523     new DialogVerb(SP_VERB_DIALOG_XML_EDITOR, "DialogXMLEditor", N_("_XML Editor..."),
2524                    N_("View and edit the XML tree of the document"), "xml_editor"),
2525     new DialogVerb(SP_VERB_DIALOG_FIND, "DialogFind", N_("_Find..."),
2526                    N_("Find objects in document"), GTK_STOCK_FIND ),
2527     new DialogVerb(SP_VERB_DIALOG_DEBUG, "DialogDebug", N_("_Messages..."),
2528                    N_("View debug messages"), "messages"),
2529     new DialogVerb(SP_VERB_DIALOG_SCRIPT, "DialogScript", N_("S_cripts..."),
2530                    N_("Run scripts"), "scripts"),
2531     new DialogVerb(SP_VERB_DIALOG_TOGGLE, "DialogsToggle", N_("Show/Hide D_ialogs"),
2532                    N_("Show or hide all open dialogs"), "dialog_toggle"),
2533     new DialogVerb(SP_VERB_DIALOG_CLONETILER, "DialogClonetiler", N_("Create Tiled Clones..."),
2534                    N_("Create multiple clones of selected object, arranging them into a pattern or scattering"), "edit_create_tiled_clones"),
2535     new DialogVerb(SP_VERB_DIALOG_ITEM, "DialogObjectProperties", N_("_Object Properties..."),
2536                    N_("Edit the ID, locked and visible status, and other object properties"), "dialog_item_properties"),
2537 #ifdef WITH_INKBOARD
2538     new DialogVerb(SP_VERB_XMPP_CLIENT, "DialogXmppClient",
2539                    N_("_Instant Messaging..."), N_("Jabber Instant Messaging Client"), NULL),
2540 #endif
2541     new DialogVerb(SP_VERB_DIALOG_INPUT, "DialogInput", N_("_Input Devices..."),
2542                    N_("Configure extended input devices, such as a graphics tablet"), "input_devices"),
2543     new DialogVerb(SP_VERB_DIALOG_EXTENSIONEDITOR, "org.inkscape.dialogs.extensioneditor", N_("_Extensions..."),
2544                    N_("Query information about extensions"), NULL),
2545     new DialogVerb(SP_VERB_DIALOG_LAYERS, "DialogLayers", N_("Layer_s..."),
2546                    N_("View Layers"), "layers"),
2547     new DialogVerb(SP_VERB_DIALOG_LIVE_PATH_EFFECT, "DialogLivePathEffect", N_("Path Effects..."),
2548                    N_("Manage path effects"), NULL),
2549     new DialogVerb(SP_VERB_DIALOG_FILTER_EFFECTS, "DialogFilterEffects", N_("Filter Effects..."),
2550                    N_("Manage SVG filter effects"), NULL),
2552     /* Help */
2553     new HelpVerb(SP_VERB_HELP_ABOUT_EXTENSIONS, "HelpAboutExtensions", N_("About E_xtensions"),
2554                  N_("Information on Inkscape extensions"), NULL),
2555     new HelpVerb(SP_VERB_HELP_MEMORY, "HelpAboutMemory", N_("About _Memory"),
2556                  N_("Memory usage information"), "about_memory"),
2557     new HelpVerb(SP_VERB_HELP_ABOUT, "HelpAbout", N_("_About Inkscape"),
2558                  N_("Inkscape version, authors, license"), /*"help_about"*/"inkscape_options"),
2559     //new HelpVerb(SP_VERB_SHOW_LICENSE, "ShowLicense", N_("_License"),
2560     //           N_("Distribution terms"), /*"show_license"*/"inkscape_options"),
2562     /* Tutorials */
2563     new TutorialVerb(SP_VERB_TUTORIAL_BASIC, "TutorialsBasic", N_("Inkscape: _Basic"),
2564                      N_("Getting started with Inkscape"), NULL/*"tutorial_basic"*/),
2565     new TutorialVerb(SP_VERB_TUTORIAL_SHAPES, "TutorialsShapes", N_("Inkscape: _Shapes"),
2566                      N_("Using shape tools to create and edit shapes"), NULL),
2567     new TutorialVerb(SP_VERB_TUTORIAL_ADVANCED, "TutorialsAdvanced", N_("Inkscape: _Advanced"),
2568                      N_("Advanced Inkscape topics"), NULL/*"tutorial_advanced"*/),
2569     // TRANSLATORS: "to trace" means "to convert a bitmap to vector graphics" (to vectorize)
2570     new TutorialVerb(SP_VERB_TUTORIAL_TRACING, "TutorialsTracing", N_("Inkscape: T_racing"),
2571                      N_("Using bitmap tracing"), NULL/*"tutorial_tracing"*/),
2572     new TutorialVerb(SP_VERB_TUTORIAL_CALLIGRAPHY, "TutorialsCalligraphy", N_("Inkscape: _Calligraphy"),
2573                      N_("Using the Calligraphy pen tool"), NULL),
2574     new TutorialVerb(SP_VERB_TUTORIAL_DESIGN, "TutorialsDesign", N_("_Elements of Design"),
2575                      N_("Principles of design in the tutorial form"), NULL/*"tutorial_design"*/),
2576     new TutorialVerb(SP_VERB_TUTORIAL_TIPS, "TutorialsTips", N_("_Tips and Tricks"),
2577                      N_("Miscellaneous tips and tricks"), NULL/*"tutorial_tips"*/),
2579     /* Effect */
2580     new EffectLastVerb(SP_VERB_EFFECT_LAST, "EffectLast", N_("Previous Effect"),
2581                        N_("Repeat the last effect with the same settings"), NULL),
2582     new EffectLastVerb(SP_VERB_EFFECT_LAST_PREF, "EffectLastPref", N_("Previous Effect Settings..."),
2583                        N_("Repeat the last effect with new settings"), NULL),
2585     /* Fit Page */
2586     new FitCanvasVerb(SP_VERB_FIT_CANVAS_TO_SELECTION, "FitCanvasToSelection", N_("Fit Page to Selection"),
2587                        N_("Fit the page to the current selection"), NULL),
2588     new FitCanvasVerb(SP_VERB_FIT_CANVAS_TO_DRAWING, "FitCanvasToDrawing", N_("Fit Page to Drawing"),
2589                        N_("Fit the page to the drawing"), NULL),
2590     new FitCanvasVerb(SP_VERB_FIT_CANVAS_TO_SELECTION_OR_DRAWING, "FitCanvasToSelectionOrDrawing", N_("Fit Page to Selection or Drawing"),
2591                        N_("Fit the page to the current selection or the drawing if there is no selection"), NULL),
2592     /* LockAndHide */
2593     new LockAndHideVerb(SP_VERB_UNLOCK_ALL, "UnlockAll", N_("Unlock All"),
2594                        N_("Unlock all objects in the current layer"), NULL),
2595     new LockAndHideVerb(SP_VERB_UNLOCK_ALL_IN_ALL_LAYERS, "UnlockAllInAllLayers", N_("Unlock All in All Layers"),
2596                        N_("Unlock all objects in all layers"), NULL),
2597     new LockAndHideVerb(SP_VERB_UNHIDE_ALL, "UnhideAll", N_("Unhide All"),
2598                        N_("Unhide all objects in the current layer"), NULL),
2599     new LockAndHideVerb(SP_VERB_UNHIDE_ALL_IN_ALL_LAYERS, "UnhideAllInAllLayers", N_("Unhide All in All Layers"),
2600                        N_("Unhide all objects in all layers"), NULL),
2601     /* Footer */
2602     new Verb(SP_VERB_LAST, " '\"invalid id", NULL, NULL, NULL)
2603 };
2606 void
2607 Verb::list (void) {
2608     // Go through the dynamic verb table
2609     for (VerbTable::iterator iter = _verbs.begin(); iter != _verbs.end(); iter++) {
2610         Verb * verb = iter->second;
2611         if (verb->get_code() == SP_VERB_INVALID ||
2612                 verb->get_code() == SP_VERB_NONE ||
2613                 verb->get_code() == SP_VERB_LAST) {
2614             continue;
2615         }
2617         printf("%s: %s\n", verb->get_id(), verb->get_tip()? verb->get_tip() : verb->get_name());
2618     }
2620     return;
2621 };
2623 }  /* namespace Inkscape */
2625 /*
2626   Local Variables:
2627   mode:c++
2628   c-file-style:"stroustrup"
2629   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
2630   indent-tabs-mode:nil
2631   fill-column:99
2632   End:
2633 */
2634 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :