Code

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