Code

Added descriptions to Undo/Redo commands in the menus
[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  * This code is in public domain.
21  */
26 #include <gtk/gtkstock.h>
28 #ifdef HAVE_CONFIG_H
29 # include "config.h"
30 #endif
32 #include "helper/action.h"
34 #include <gtkmm/messagedialog.h>
35 #include <gtkmm/filechooserdialog.h>
36 #include <gtkmm/stock.h>
38 #include "dialogs/text-edit.h"
39 #include "dialogs/xml-tree.h"
40 #include "dialogs/object-properties.h"
41 #include "dialogs/item-properties.h"
42 #include "dialogs/find.h"
43 #include "dialogs/layer-properties.h"
44 #include "dialogs/clonetiler.h"
45 #include "dialogs/iconpreview.h"
46 #include "dialogs/extensions.h"
47 #include "dialogs/swatches.h"
48 #include "dialogs/layers-panel.h"
49 #include "dialogs/input.h"
51 #ifdef WITH_INKBOARD
52 #include "jabber_whiteboard/session-manager.h"
53 #endif
55 #include "extension/effect.h"
57 #include "tools-switch.h"
58 #include "inkscape-private.h"
59 #include "file.h"
60 #include "help.h"
61 #include "document.h"
62 #include "desktop.h"
63 #include "message-stack.h"
64 #include "desktop-handles.h"
65 #include "selection-chemistry.h"
66 #include "path-chemistry.h"
67 #include "text-chemistry.h"
68 #include "ui/dialog/dialog-manager.h"
69 #include "ui/dialog/inkscape-preferences.h"
70 #include "interface.h"
71 #include "prefs-utils.h"
72 #include "splivarot.h"
73 #include "sp-namedview.h"
74 #include "sp-flowtext.h"
75 #include "layer-fns.h"
76 #include "node-context.h"
79 /**
80  * \brief Return the name without underscores and ellipsis, for use in dialog
81  * titles, etc. Allocated memory must be freed by caller.
82  */
83 gchar *
84 sp_action_get_title(SPAction const *action)
85 {
86     char const *src = action->name;
87     gchar *ret = g_new(gchar, strlen(src) + 1);
88     unsigned ri = 0;
90     for (unsigned si = 0 ; ; si++)  {
91         int const c = src[si];
92         if ( c != '_' && c != '.' ) {
93             ret[ri] = c;
94             ri++;
95             if (c == '\0') {
96                 return ret;
97             }
98         }
99     }
101 } // end of sp_action_get_title()
104 namespace Inkscape {
106 /// \todo !!!FIXME:: kill this, use DialogManager instead!!!
108 class PanelDialog : public Inkscape::UI::Dialog::Dialog
110 public:
111     PanelDialog(char const *prefs_path, int const verb_num) : Dialog(prefs_path, verb_num) {}
112 /*
113     virtual Glib::ustring getName() const {return "foo";}
114     virtual Glib::ustring getDesc() const {return "bar";}
115 */
116 };
118 /** \brief Utility function to get a panel displayed. */
119 static void show_panel( Inkscape::UI::Widget::Panel &panel, char const *prefs_path, int const verb_num )
121     Gtk::Container *container = panel.get_toplevel();
122     if ( &panel == container ) { // safe check?
123         //g_message("Creating new dialog to hold it");
124         PanelDialog *dia = new PanelDialog(prefs_path, verb_num);
125         Gtk::VBox *mainVBox = dia->get_vbox();
126         mainVBox->pack_start(panel);
127         dia->show_all_children();
128         dia->present();
129         dia->read_geometry();
130     } else {
131         Gtk::Dialog *dia = dynamic_cast<Gtk::Dialog*>(container);
132         if ( dia ) {
133             //g_message("Found an existing dialog");
134             dia->present();
135         } else {
136             g_message("Failed to find an existing dialog");
137         }
138     }
141 /** \brief A class to encompass all of the verbs which deal with
142            file operations. */
143 class FileVerb : public Verb {
144 private:
145     static void perform(SPAction *action, void *mydata, void *otherdata);
146     static SPActionEventVector vector;
147 protected:
148     virtual SPAction *make_action(Inkscape::UI::View::View *view);
149 public:
150     /** \brief Use the Verb initializer with the same parameters. */
151     FileVerb(unsigned int const code,
152              gchar const *id,
153              gchar const *name,
154              gchar const *tip,
155              gchar const *image) :
156         Verb(code, id, name, tip, image)
157     { }
158 }; /* FileVerb class */
160 /** \brief A class to encompass all of the verbs which deal with
161            edit operations. */
162 class EditVerb : public Verb {
163 private:
164     static void perform(SPAction *action, void *mydata, void *otherdata);
165     static SPActionEventVector vector;
166 protected:
167     virtual SPAction *make_action(Inkscape::UI::View::View *view);
168 public:
169     /** \brief Use the Verb initializer with the same parameters. */
170     EditVerb(unsigned int const code,
171              gchar const *id,
172              gchar const *name,
173              gchar const *tip,
174              gchar const *image) :
175         Verb(code, id, name, tip, image)
176     { }
177 }; /* EditVerb class */
179 /** \brief A class to encompass all of the verbs which deal with
180            selection operations. */
181 class SelectionVerb : public Verb {
182 private:
183     static void perform(SPAction *action, void *mydata, void *otherdata);
184     static SPActionEventVector vector;
185 protected:
186     virtual SPAction *make_action(Inkscape::UI::View::View *view);
187 public:
188     /** \brief Use the Verb initializer with the same parameters. */
189     SelectionVerb(unsigned int const code,
190                   gchar const *id,
191                   gchar const *name,
192                   gchar const *tip,
193                   gchar const *image) :
194         Verb(code, id, name, tip, image)
195     { }
196 }; /* SelectionVerb class */
198 /** \brief A class to encompass all of the verbs which deal with
199            layer operations. */
200 class LayerVerb : public Verb {
201 private:
202     static void perform(SPAction *action, void *mydata, void *otherdata);
203     static SPActionEventVector vector;
204 protected:
205     virtual SPAction *make_action(Inkscape::UI::View::View *view);
206 public:
207     /** \brief Use the Verb initializer with the same parameters. */
208     LayerVerb(unsigned int const code,
209               gchar const *id,
210               gchar const *name,
211               gchar const *tip,
212               gchar const *image) :
213         Verb(code, id, name, tip, image)
214     { }
215 }; /* LayerVerb class */
217 /** \brief A class to encompass all of the verbs which deal with
218            operations related to objects. */
219 class ObjectVerb : public Verb {
220 private:
221     static void perform(SPAction *action, void *mydata, void *otherdata);
222     static SPActionEventVector vector;
223 protected:
224     virtual SPAction *make_action(Inkscape::UI::View::View *view);
225 public:
226     /** \brief Use the Verb initializer with the same parameters. */
227     ObjectVerb(unsigned int const code,
228                gchar const *id,
229                gchar const *name,
230                gchar const *tip,
231                gchar const *image) :
232         Verb(code, id, name, tip, image)
233     { }
234 }; /* ObjectVerb class */
236 /** \brief A class to encompass all of the verbs which deal with
237            operations relative to context. */
238 class ContextVerb : public Verb {
239 private:
240     static void perform(SPAction *action, void *mydata, void *otherdata);
241     static SPActionEventVector vector;
242 protected:
243     virtual SPAction *make_action(Inkscape::UI::View::View *view);
244 public:
245     /** \brief Use the Verb initializer with the same parameters. */
246     ContextVerb(unsigned int const code,
247                 gchar const *id,
248                 gchar const *name,
249                 gchar const *tip,
250                 gchar const *image) :
251         Verb(code, id, name, tip, image)
252     { }
253 }; /* ContextVerb class */
255 /** \brief A class to encompass all of the verbs which deal with
256            zoom operations. */
257 class ZoomVerb : public Verb {
258 private:
259     static void perform(SPAction *action, void *mydata, void *otherdata);
260     static SPActionEventVector vector;
261 protected:
262     virtual SPAction *make_action(Inkscape::UI::View::View *view);
263 public:
264     /** \brief Use the Verb initializer with the same parameters. */
265     ZoomVerb(unsigned int const code,
266              gchar const *id,
267              gchar const *name,
268              gchar const *tip,
269              gchar const *image) :
270         Verb(code, id, name, tip, image)
271     { }
272 }; /* ZoomVerb class */
275 /** \brief A class to encompass all of the verbs which deal with
276            dialog operations. */
277 class DialogVerb : public Verb {
278 private:
279     static void perform(SPAction *action, void *mydata, void *otherdata);
280     static SPActionEventVector vector;
281 protected:
282     virtual SPAction *make_action(Inkscape::UI::View::View *view);
283 public:
284     /** \brief Use the Verb initializer with the same parameters. */
285     DialogVerb(unsigned int const code,
286                gchar const *id,
287                gchar const *name,
288                gchar const *tip,
289                gchar const *image) :
290         Verb(code, id, name, tip, image)
291     { }
292 }; /* DialogVerb class */
294 /** \brief A class to encompass all of the verbs which deal with
295            help operations. */
296 class HelpVerb : public Verb {
297 private:
298     static void perform(SPAction *action, void *mydata, void *otherdata);
299     static SPActionEventVector vector;
300 protected:
301     virtual SPAction *make_action(Inkscape::UI::View::View *view);
302 public:
303     /** \brief Use the Verb initializer with the same parameters. */
304     HelpVerb(unsigned int const code,
305              gchar const *id,
306              gchar const *name,
307              gchar const *tip,
308              gchar const *image) :
309         Verb(code, id, name, tip, image)
310     { }
311 }; /* HelpVerb class */
313 /** \brief A class to encompass all of the verbs which deal with
314            tutorial operations. */
315 class TutorialVerb : public Verb {
316 private:
317     static void perform(SPAction *action, void *mydata, void *otherdata);
318     static SPActionEventVector vector;
319 protected:
320     virtual SPAction *make_action(Inkscape::UI::View::View *view);
321 public:
322     /** \brief Use the Verb initializer with the same parameters. */
323     TutorialVerb(unsigned int const code,
324                  gchar const *id,
325                  gchar const *name,
326                  gchar const *tip,
327                  gchar const *image) :
328         Verb(code, id, name, tip, image)
329     { }
330 }; /* TutorialVerb class */
332 /** \brief A class to encompass all of the verbs which deal with
333            text operations. */
334 class TextVerb : public Verb {
335 private:
336     static void perform(SPAction *action, void *mydata, void *otherdata);
337     static SPActionEventVector vector;
338 protected:
339     virtual SPAction *make_action(Inkscape::UI::View::View *view);
340 public:
341     /** \brief Use the Verb initializer with the same parameters. */
342     TextVerb(unsigned int const code,
343               gchar const *id,
344               gchar const *name,
345               gchar const *tip,
346               gchar const *image) :
347         Verb(code, id, name, tip, image)
348     { }
349 }; //TextVerb : public Verb 
351 Verb::VerbTable Verb::_verbs;
352 Verb::VerbIDTable Verb::_verb_ids;
354 /** \brief  Create a verb without a code.
356     This function calls the other constructor for all of the parameters,
357     but generates the code.  It is important to READ THE OTHER DOCUMENTATION
358     it has important details in it.  To generate the code a static is
359     used which starts at the last static value: \c SP_VERB_LAST.  For
360     each call it is incremented.  The list of allocated verbs is kept
361     in the \c _verbs hashtable which is indexed by the \c code.
362 */
363 Verb::Verb(gchar const *id, gchar const *name, gchar const *tip, gchar const *image) :
364     _actions(NULL), _id(id), _name(name), _tip(tip), _image(image)
366     static int count = SP_VERB_LAST;
368     count++;
369     _code = count;
370     _verbs.insert(VerbTable::value_type(count, this));
371     _verb_ids.insert(VerbIDTable::value_type(_id, this));
373     return;
376 /** \brief  Destroy a verb.
378       The only allocated variable is the _actions variable.  If it has
379     been allocated it is deleted.
380 */
381 Verb::~Verb(void)
383     /// \todo all the actions need to be cleaned up first.
384     if (_actions != NULL) {
385         delete _actions;
386     }
388     return;
391 /** \brief  Verbs are no good without actions.  This is a place holder
392             for a function that every subclass should write.  Most
393             can be written using \c make_action_helper.
394     \param  view  Which view the action should be created for.
395     \return NULL to represent error (this function shouldn't ever be called)
396 */
397 SPAction *
398 Verb::make_action(Inkscape::UI::View::View *view)
400     //std::cout << "make_action" << std::endl;
401     return NULL;
404 /** \brief  Create an action for a \c FileVerb
405     \param  view  Which view the action should be created for
406     \return The built action.
408     Calls \c make_action_helper with the \c vector.
409 */
410 SPAction *
411 FileVerb::make_action(Inkscape::UI::View::View *view)
413     //std::cout << "fileverb: make_action: " << &vector << std::endl;
414     return make_action_helper(view, &vector);
417 /** \brief  Create an action for a \c EditVerb
418     \param  view  Which view the action should be created for
419     \return The built action.
421     Calls \c make_action_helper with the \c vector.
422 */
423 SPAction *
424 EditVerb::make_action(Inkscape::UI::View::View *view)
426     //std::cout << "editverb: make_action: " << &vector << std::endl;
427     return make_action_helper(view, &vector);
430 /** \brief  Create an action for a \c SelectionVerb
431     \param  view  Which view the action should be created for
432     \return The built action.
434     Calls \c make_action_helper with the \c vector.
435 */
436 SPAction *
437 SelectionVerb::make_action(Inkscape::UI::View::View *view)
439     return make_action_helper(view, &vector);
442 /** \brief  Create an action for a \c LayerVerb
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 LayerVerb::make_action(Inkscape::UI::View::View *view)
451     return make_action_helper(view, &vector);
454 /** \brief  Create an action for a \c ObjectVerb
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 ObjectVerb::make_action(Inkscape::UI::View::View *view)
463     return make_action_helper(view, &vector);
466 /** \brief  Create an action for a \c ContextVerb
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 ContextVerb::make_action(Inkscape::UI::View::View *view)
475     return make_action_helper(view, &vector);
478 /** \brief  Create an action for a \c ZoomVerb
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 ZoomVerb::make_action(Inkscape::UI::View::View *view)
487     return make_action_helper(view, &vector);
490 /** \brief  Create an action for a \c DialogVerb
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 DialogVerb::make_action(Inkscape::UI::View::View *view)
499     return make_action_helper(view, &vector);
502 /** \brief  Create an action for a \c HelpVerb
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 HelpVerb::make_action(Inkscape::UI::View::View *view)
511     return make_action_helper(view, &vector);
514 /** \brief  Create an action for a \c TutorialVerb
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 TutorialVerb::make_action(Inkscape::UI::View::View *view)
523     return make_action_helper(view, &vector);
526 /** \brief  Create an action for a \c TextVerb
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 TextVerb::make_action(Inkscape::UI::View::View *view)
535     return make_action_helper(view, &vector);
538 /** \brief A quick little convience function to make building actions
539            a little bit easier.
540     \param  view    Which view the action should be created for.
541     \param  vector  The function vector for the verb.
542     \return The created action.
544     This function does a couple of things.  The most obvious is that
545     it allocates and creates the action.  When it does this it
546     translates the \c _name and \c _tip variables.  This allows them
547     to be staticly allocated easily, and get translated in the end.  Then,
548     if the action gets crated, a listener is added to the action with
549     the vector that is passed in.
550 */
551 SPAction *
552 Verb::make_action_helper(Inkscape::UI::View::View *view, SPActionEventVector *vector, void *in_pntr)
554     SPAction *action;
556     //std::cout << "Adding action: " << _code << std::endl;
557     action = sp_action_new(view, _id, _(_name),
558                            _(_tip), _image, this);
560     if (action != NULL) {
561         if (in_pntr == NULL) {
562             nr_active_object_add_listener(
563                 (NRActiveObject *) action,
564                 (NRObjectEventVector *) vector,
565                 sizeof(SPActionEventVector),
566                 reinterpret_cast<void *>(_code)
567             );
568         } else {
569             nr_active_object_add_listener(
570                 (NRActiveObject *) action,
571                 (NRObjectEventVector *) vector,
572                 sizeof(SPActionEventVector),
573                 in_pntr
574             );
575         }
576     }
578     return action;
581 /** \brief  A function to get an action if it exists, or otherwise to
582             build it.
583     \param  view  The view which this action would relate to
584     \return The action, or NULL if there is an error.
586     This function will get the action for a given view for this verb.  It
587     will create the verb if it can't be found in the ActionTable.  Also,
588     if the \c ActionTable has not been created, it gets created by this
589     function.
591     If the action is created, it's sensitivity must be determined.  The
592     default for a new action is that it is sensitive.  If the value in
593     \c _default_sensitive is \c false, then the sensitivity must be
594     removed.  Also, if the view being created is based on the same
595     document as a view already created, the sensitivity should be the
596     same as views on that document.  A view with the same document is
597     looked for, and the sensitivity is matched.  Unfortunately, this is
598     currently a linear search.
599 */
600 SPAction *
601 Verb::get_action(Inkscape::UI::View::View *view)
603     SPAction *action = NULL;
605     if ( _actions == NULL ) {
606         _actions = new ActionTable;
607     }
608     ActionTable::iterator action_found = _actions->find(view);
610     if (action_found != _actions->end()) {
611         action = action_found->second;
612     } else {
613         action = this->make_action(view);
615         // if (action == NULL) printf("Hmm, NULL in %s\n", _name);
616         if (action == NULL) printf("Hmm, NULL in %s\n", _name);
617         if (!_default_sensitive) {
618             sp_action_set_sensitive(action, 0);
619         } else {
620             for (ActionTable::iterator cur_action = _actions->begin();
621                  cur_action != _actions->end() && view != NULL;
622                  cur_action++) {
623                 if (cur_action->first != NULL && cur_action->first->doc() == view->doc()) {
624                     sp_action_set_sensitive(action, cur_action->second->sensitive);
625                     break;
626                 }
627             }
628         }
630         _actions->insert(ActionTable::value_type(view, action));
631     }
633     return action;
636 void
637 Verb::sensitive(SPDocument *in_doc, bool in_sensitive)
639     // printf("Setting sensitivity of \"%s\" to %d\n", _name, in_sensitive);
640     if (_actions != NULL) {
641         for (ActionTable::iterator cur_action = _actions->begin();
642              cur_action != _actions->end();
643              cur_action++) {
644                         if (in_doc == NULL || (cur_action->first != NULL && cur_action->first->doc() == in_doc)) {
645                 sp_action_set_sensitive(cur_action->second, in_sensitive ? 1 : 0);
646             }
647         }
648     }
650     if (in_doc == NULL) {
651         _default_sensitive = in_sensitive;
652     }
654     return;
658 void
659 Verb::name(SPDocument *in_doc, Glib::ustring in_name)
661     if (_actions != NULL) {
662         for (ActionTable::iterator cur_action = _actions->begin();
663              cur_action != _actions->end();
664              cur_action++) {
665                         if (in_doc == NULL || (cur_action->first != NULL && cur_action->first->doc() == in_doc)) {
666                             sp_action_set_name(cur_action->second, in_name);
667             }
668         }
669     }
672 /** \brief  A function to remove the action associated with a view.
673     \param  view  Which view's actions should be removed.
674     \return None
676     This function looks for the action in \c _actions.  If it is
677     found then it is unreferenced and the entry in the action
678     table is erased.
679 */
680 void
681 Verb::delete_view(Inkscape::UI::View::View *view)
683     if (_actions == NULL) return;
684     if (_actions->empty()) return;
686 #if 0
687     static int count = 0;
688     std::cout << count++ << std::endl;
689 #endif
691     ActionTable::iterator action_found = _actions->find(view);
693     if (action_found != _actions->end()) {
694         SPAction *action = action_found->second;
695         nr_object_unref(NR_OBJECT(action));
696         _actions->erase(action_found);
697     }
699     return;
702 /** \brief  A function to delete a view from all verbs
703     \param  view  Which view's actions should be removed.
704     \return None
706     This function first looks through _base_verbs and deteles
707     the view from all of those views.  If \c _verbs is not empty
708     then all of the entries in that table have all of the views
709     deleted also.
710 */
711 void
712 Verb::delete_all_view(Inkscape::UI::View::View *view)
714     for (int i = 0; i <= SP_VERB_LAST; i++) {
715         if (_base_verbs[i])
716           _base_verbs[i]->delete_view(view);
717     }
719     if (!_verbs.empty()) {
720         for (VerbTable::iterator thisverb = _verbs.begin();
721              thisverb != _verbs.end(); thisverb++) {
722             Inkscape::Verb *verbpntr = thisverb->second;
723             // std::cout << "Delete In Verb: " << verbpntr->_name << std::endl;
724             verbpntr->delete_view(view);
725         }
726     }
728     return;
731 /** \brief  A function to turn a \c code into a Verb for dynamically
732             created Verbs.
733     \param  code  What code is being looked for
734     \return The found Verb of NULL if none is found.
736     This function basically just looks through the \c _verbs hash
737     table.  STL does all the work.
738 */
739 Verb *
740 Verb::get_search(unsigned int code)
742     Verb *verb = NULL;
743     VerbTable::iterator verb_found = _verbs.find(code);
745     if (verb_found != _verbs.end()) {
746         verb = verb_found->second;
747     }
749     return verb;
752 /** \brief  Find a Verb using it's ID
753     \param  id  Which id to search for
755     This function uses the \c _verb_ids has table to find the
756     verb by it's id.  Should be much faster than previous
757     implementations.
758 */
759 Verb *
760 Verb::getbyid(gchar const *id)
762     Verb *verb = NULL;
763     VerbIDTable::iterator verb_found = _verb_ids.find(id);
765     if (verb_found != _verb_ids.end()) {
766         verb = verb_found->second;
767     }
769     if (verb == NULL)
770         printf("Unable to find: %s\n", id);
772     return verb;
775 /** \brief  Decode the verb code and take appropriate action */
776 void
777 FileVerb::perform(SPAction *action, void *data, void *pdata)
779 #if 0
780     /* These aren't used, but are here to remind people not to use
781        the CURRENT_DOCUMENT macros unless they really have to. */
782     Inkscape::UI::View::View *current_view = sp_action_get_view(action);
783     SPDocument *current_document = current_view->doc();
784 #endif
785     switch ((long) data) {
786         case SP_VERB_FILE_NEW:
787             sp_file_new_default();
788             break;
789         case SP_VERB_FILE_OPEN:
790             sp_file_open_dialog(NULL, NULL);
791             break;
792         case SP_VERB_FILE_REVERT:
793             sp_file_revert_dialog();
794             break;
795         case SP_VERB_FILE_SAVE:
796             sp_file_save(NULL, NULL);
797             break;
798         case SP_VERB_FILE_SAVE_AS:
799             sp_file_save_as(NULL, NULL);
800             break;
801         case SP_VERB_FILE_PRINT:
802             sp_file_print();
803             break;
804         case SP_VERB_FILE_VACUUM:
805             sp_file_vacuum();
806             break;
807         case SP_VERB_FILE_PRINT_DIRECT:
808             sp_file_print_direct();
809             break;
810         case SP_VERB_FILE_PRINT_PREVIEW:
811             sp_file_print_preview(NULL, NULL);
812             break;
813         case SP_VERB_FILE_IMPORT:
814             sp_file_import(NULL);
815             break;
816         case SP_VERB_FILE_EXPORT:
817             sp_file_export_dialog(NULL);
818             break;
819         case SP_VERB_FILE_NEXT_DESKTOP:
820             inkscape_switch_desktops_next();
821             break;
822         case SP_VERB_FILE_PREV_DESKTOP:
823             inkscape_switch_desktops_prev();
824             break;
825         case SP_VERB_FILE_CLOSE_VIEW:
826             sp_ui_close_view(NULL);
827             break;
828         case SP_VERB_FILE_QUIT:
829             sp_file_exit();
830             break;
831         default:
832             break;
833     }
835 } // end of sp_verb_action_file_perform()
837 /** \brief  Decode the verb code and take appropriate action */
838 void
839 EditVerb::perform(SPAction *action, void *data, void *pdata)
841     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
842     if (!dt)
843         return;
845     SPEventContext *ec = dt->event_context;
847     switch (reinterpret_cast<std::size_t>(data)) {
848         case SP_VERB_EDIT_UNDO:
849             sp_undo(dt, sp_desktop_document(dt));
850             break;
851         case SP_VERB_EDIT_REDO:
852             sp_redo(dt, sp_desktop_document(dt));
853             break;
854         case SP_VERB_EDIT_CUT:
855             sp_selection_cut();
856             break;
857         case SP_VERB_EDIT_COPY:
858             sp_selection_copy();
859             break;
860         case SP_VERB_EDIT_PASTE:
861             sp_selection_paste(false);
862             break;
863         case SP_VERB_EDIT_PASTE_STYLE:
864             sp_selection_paste_style();
865             break;
866         case SP_VERB_EDIT_PASTE_SIZE:
867             sp_selection_paste_size(true, true);
868             break;
869         case SP_VERB_EDIT_PASTE_SIZE_X:
870             sp_selection_paste_size(true, false);
871             break;
872         case SP_VERB_EDIT_PASTE_SIZE_Y:
873             sp_selection_paste_size(false, true);
874             break;
875         case SP_VERB_EDIT_PASTE_SIZE_SEPARATELY:
876             sp_selection_paste_size_separately(true, true);
877             break;
878         case SP_VERB_EDIT_PASTE_SIZE_SEPARATELY_X:
879             sp_selection_paste_size_separately(true, false);
880             break;
881         case SP_VERB_EDIT_PASTE_SIZE_SEPARATELY_Y:
882             sp_selection_paste_size_separately(false, true);
883             break;
884         case SP_VERB_EDIT_PASTE_IN_PLACE:
885             sp_selection_paste(true);
886             break;
887         case SP_VERB_EDIT_DELETE:
888             sp_selection_delete();
889             break;
890         case SP_VERB_EDIT_DUPLICATE:
891             sp_selection_duplicate();
892             break;
893         case SP_VERB_EDIT_CLONE:
894             sp_selection_clone();
895             break;
896         case SP_VERB_EDIT_UNLINK_CLONE:
897             sp_selection_unlink();
898             break;
899         case SP_VERB_EDIT_CLONE_ORIGINAL:
900             sp_select_clone_original();
901             break;
902         case SP_VERB_EDIT_TILE:
903             sp_selection_tile();
904             break;
905         case SP_VERB_EDIT_UNTILE:
906             sp_selection_untile();
907             break;
908         case SP_VERB_EDIT_CLEAR_ALL:
909             sp_edit_clear_all();
910             break;
911         case SP_VERB_EDIT_SELECT_ALL:
912             if (tools_isactive(dt, TOOLS_NODES)) {
913                 sp_nodepath_select_all_from_subpath(SP_NODE_CONTEXT(ec)->nodepath, false);
914             } else {
915                 sp_edit_select_all();
916             }
917             break;
918         case SP_VERB_EDIT_INVERT:
919             if (tools_isactive(dt, TOOLS_NODES)) {
920                 sp_nodepath_select_all_from_subpath(SP_NODE_CONTEXT(ec)->nodepath, true);
921             } else {
922                 sp_edit_invert();
923             }
924             break;
925         case SP_VERB_EDIT_SELECT_ALL_IN_ALL_LAYERS:
926             if (tools_isactive(dt, TOOLS_NODES)) {
927                 sp_nodepath_select_all(SP_NODE_CONTEXT(ec)->nodepath, false);
928             } else {
929                 sp_edit_select_all_in_all_layers();
930             }
931             break;
932         case SP_VERB_EDIT_INVERT_IN_ALL_LAYERS:
933             if (tools_isactive(dt, TOOLS_NODES)) {
934                 sp_nodepath_select_all(SP_NODE_CONTEXT(ec)->nodepath, true);
935             } else {
936                 sp_edit_invert_in_all_layers();
937             }
938             break;
939         case SP_VERB_EDIT_DESELECT:
940             if (tools_isactive(dt, TOOLS_NODES)) {
941                 sp_nodepath_deselect(SP_NODE_CONTEXT(ec)->nodepath);
942             } else {
943                 sp_desktop_selection(dt)->clear();
944             }
945             break;
946         default:
947             break;
948     }
950 } // end of sp_verb_action_edit_perform()
952 /** \brief  Decode the verb code and take appropriate action */
953 void
954 SelectionVerb::perform(SPAction *action, void *data, void *pdata)
956     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
958     if (!dt)
959         return;
961     switch (reinterpret_cast<std::size_t>(data)) {
962         case SP_VERB_SELECTION_TO_FRONT:
963             sp_selection_raise_to_top();
964             break;
965         case SP_VERB_SELECTION_TO_BACK:
966             sp_selection_lower_to_bottom();
967             break;
968         case SP_VERB_SELECTION_RAISE:
969             sp_selection_raise();
970             break;
971         case SP_VERB_SELECTION_LOWER:
972             sp_selection_lower();
973             break;
974         case SP_VERB_SELECTION_GROUP:
975             sp_selection_group();
976             break;
977         case SP_VERB_SELECTION_UNGROUP:
978             sp_selection_ungroup();
979             break;
981         case SP_VERB_SELECTION_TEXTTOPATH:
982             text_put_on_path();
983             break;
984         case SP_VERB_SELECTION_TEXTFROMPATH:
985             text_remove_from_path();
986             break;
987         case SP_VERB_SELECTION_REMOVE_KERNS:
988             text_remove_all_kerns();
989             break;
991         case SP_VERB_SELECTION_UNION:
992             sp_selected_path_union();
993             break;
994         case SP_VERB_SELECTION_INTERSECT:
995             sp_selected_path_intersect();
996             break;
997         case SP_VERB_SELECTION_DIFF:
998             sp_selected_path_diff();
999             break;
1000         case SP_VERB_SELECTION_SYMDIFF:
1001             sp_selected_path_symdiff();
1002             break;
1004         case SP_VERB_SELECTION_CUT:
1005             sp_selected_path_cut();
1006             break;
1007         case SP_VERB_SELECTION_SLICE:
1008             sp_selected_path_slice();
1009             break;
1011         case SP_VERB_SELECTION_OFFSET:
1012             sp_selected_path_offset();
1013             break;
1014         case SP_VERB_SELECTION_OFFSET_SCREEN:
1015             sp_selected_path_offset_screen(1);
1016             break;
1017         case SP_VERB_SELECTION_OFFSET_SCREEN_10:
1018             sp_selected_path_offset_screen(10);
1019             break;
1020         case SP_VERB_SELECTION_INSET:
1021             sp_selected_path_inset();
1022             break;
1023         case SP_VERB_SELECTION_INSET_SCREEN:
1024             sp_selected_path_inset_screen(1);
1025             break;
1026         case SP_VERB_SELECTION_INSET_SCREEN_10:
1027             sp_selected_path_inset_screen(10);
1028             break;
1029         case SP_VERB_SELECTION_DYNAMIC_OFFSET:
1030             sp_selected_path_create_offset_object_zero();
1031             break;
1032         case SP_VERB_SELECTION_LINKED_OFFSET:
1033             sp_selected_path_create_updating_offset_object_zero();
1034             break;
1036         case SP_VERB_SELECTION_OUTLINE:
1037             sp_selected_path_outline();
1038             break;
1039         case SP_VERB_SELECTION_SIMPLIFY:
1040             sp_selected_path_simplify();
1041             break;
1042         case SP_VERB_SELECTION_REVERSE:
1043             sp_selected_path_reverse();
1044             break;
1045         case SP_VERB_SELECTION_TRACE:
1046             dt->_dlg_mgr->showDialog("Trace");
1047             break;
1048         case SP_VERB_SELECTION_CREATE_BITMAP:
1049             sp_selection_create_bitmap_copy();
1050             break;
1052         case SP_VERB_SELECTION_COMBINE:
1053             sp_selected_path_combine();
1054             break;
1055         case SP_VERB_SELECTION_BREAK_APART:
1056             sp_selected_path_break_apart();
1057             break;
1058         case SP_VERB_SELECTION_GRIDTILE:
1059             dt->_dlg_mgr->showDialog("TileDialog");
1060             break;
1061         default:
1062             break;
1063     }
1065 } // end of sp_verb_action_selection_perform()
1067 /** \brief  Decode the verb code and take appropriate action */
1068 void
1069 LayerVerb::perform(SPAction *action, void *data, void *pdata)
1071     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1072     unsigned int verb = reinterpret_cast<std::size_t>(data);
1074     if ( !dt || !dt->currentLayer() ) {
1075         return;
1076     }
1078     switch (verb) {
1079         case SP_VERB_LAYER_NEW: {
1080             Inkscape::UI::Dialogs::LayerPropertiesDialog::showCreate(dt, dt->currentLayer());
1081             break;
1082         }
1083         case SP_VERB_LAYER_RENAME: {
1084             Inkscape::UI::Dialogs::LayerPropertiesDialog::showRename(dt, dt->currentLayer());
1085             break;
1086         }
1087         case SP_VERB_LAYER_NEXT: {
1088             SPObject *next=Inkscape::next_layer(dt->currentRoot(), dt->currentLayer());
1089             if (next) {
1090                 dt->setCurrentLayer(next);
1091                 sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_NEXT, 
1092                                  /* TODO: annotate */ "verbs.cpp:1077");
1093                 dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Moved to next layer."));
1094             } else {
1095                 dt->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Cannot move past last layer."));
1096             }
1097             break;
1098         }
1099         case SP_VERB_LAYER_PREV: {
1100             SPObject *prev=Inkscape::previous_layer(dt->currentRoot(), dt->currentLayer());
1101             if (prev) {
1102                 dt->setCurrentLayer(prev);
1103                 sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_PREV, 
1104                                  /* TODO: annotate */ "verbs.cpp:1089");
1105                 dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Moved to previous layer."));
1106             } else {
1107                 dt->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Cannot move past first layer."));
1108             }
1109             break;
1110         }
1111         case SP_VERB_LAYER_MOVE_TO_NEXT: {
1112             sp_selection_to_next_layer();
1113             break;
1114         }
1115         case SP_VERB_LAYER_MOVE_TO_PREV: {
1116             sp_selection_to_prev_layer();
1117             break;
1118         }
1119         case SP_VERB_LAYER_TO_TOP:
1120         case SP_VERB_LAYER_TO_BOTTOM:
1121         case SP_VERB_LAYER_RAISE:
1122         case SP_VERB_LAYER_LOWER: {
1123             if ( dt->currentLayer() == dt->currentRoot() ) {
1124                 dt->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No current layer."));
1125                 return;
1126             }
1128             SPItem *layer=SP_ITEM(dt->currentLayer());
1129             g_return_if_fail(layer != NULL);
1131             SPObject *old_pos=SP_OBJECT_NEXT(layer);
1133             switch (verb) {
1134                 case SP_VERB_LAYER_TO_TOP:
1135                     layer->raiseToTop();
1136                     break;
1137                 case SP_VERB_LAYER_TO_BOTTOM:
1138                     layer->lowerToBottom();
1139                     break;
1140                 case SP_VERB_LAYER_RAISE:
1141                     layer->raiseOne();
1142                     break;
1143                 case SP_VERB_LAYER_LOWER:
1144                     layer->lowerOne();
1145                     break;
1146             }
1148             if ( SP_OBJECT_NEXT(layer) != old_pos ) {
1149                 char const *message = NULL;
1150                 switch (verb) {
1151                     case SP_VERB_LAYER_TO_TOP:
1152                     case SP_VERB_LAYER_RAISE:
1153                         message = g_strdup_printf(_("Raised layer <b>%s</b>."), layer->defaultLabel());
1154                         break;
1155                     case SP_VERB_LAYER_TO_BOTTOM:
1156                     case SP_VERB_LAYER_LOWER:
1157                         message = g_strdup_printf(_("Lowered layer <b>%s</b>."), layer->defaultLabel());
1158                         break;
1159                 };
1160                 sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_LOWER, 
1161                                  /* TODO: annotate */ "verbs.cpp:1146");
1162                 if (message) {
1163                     dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, message);
1164                     g_free((void *) message);
1165                 }
1166             } else {
1167                 dt->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Cannot move layer any further."));
1168             }
1170             break;
1171         }
1172         case SP_VERB_LAYER_DELETE: {
1173             if ( dt->currentLayer() != dt->currentRoot() ) {
1174                 sp_desktop_selection(dt)->clear();
1175                 SPObject *old_layer=dt->currentLayer();
1177                 sp_object_ref(old_layer, NULL);
1178                 SPObject *survivor=Inkscape::next_layer(dt->currentRoot(), old_layer);
1179                 if (!survivor) {
1180                     survivor = Inkscape::previous_layer(dt->currentRoot(), old_layer);
1181                 }
1183                 /* Deleting the old layer before switching layers is a hack to trigger the
1184                  * listeners of the deletion event (as happens when old_layer is deleted using the
1185                  * xml editor).  See
1186                  * http://sourceforge.net/tracker/index.php?func=detail&aid=1339397&group_id=93438&atid=604306
1187                  */
1188                 old_layer->deleteObject();
1189                 sp_object_unref(old_layer, NULL);
1190                 if (survivor) {
1191                     dt->setCurrentLayer(survivor);
1192                 }
1194                 sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_DELETE, 
1195                                  /* TODO: annotate */ "verbs.cpp:1180");
1197                 // TRANSLATORS: this means "The layer has been deleted."
1198                 dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Deleted layer."));
1199             } else {
1200                 dt->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No current layer."));
1201             }
1202             break;
1203         }
1204     }
1206     return;
1207 } // end of sp_verb_action_layer_perform()
1209 /** \brief  Decode the verb code and take appropriate action */
1210 void
1211 ObjectVerb::perform( SPAction *action, void *data, void *pdata )
1213     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1214     if (!dt)
1215         return;
1217     SPEventContext *ec = dt->event_context;
1219     Inkscape::Selection *sel = sp_desktop_selection(dt);
1221     if (sel->isEmpty())
1222         return;
1224     NR::Point const center(sel->bounds().midpoint());
1226     switch (reinterpret_cast<std::size_t>(data)) {
1227         case SP_VERB_OBJECT_ROTATE_90_CW:
1228             sp_selection_rotate_90_cw();
1229             break;
1230         case SP_VERB_OBJECT_ROTATE_90_CCW:
1231             sp_selection_rotate_90_ccw();
1232             break;
1233         case SP_VERB_OBJECT_FLATTEN:
1234             sp_selection_remove_transform();
1235             break;
1236         case SP_VERB_OBJECT_TO_CURVE:
1237             sp_selected_path_to_curves();
1238             break;
1239         case SP_VERB_OBJECT_FLOW_TEXT:
1240             text_flow_into_shape();
1241             break;
1242         case SP_VERB_OBJECT_UNFLOW_TEXT:
1243             text_unflow();
1244             break;
1245         case SP_VERB_OBJECT_FLOWTEXT_TO_TEXT:
1246             SPFlowtext::convert_to_text();
1247             break;
1248         case SP_VERB_OBJECT_FLIP_HORIZONTAL:
1249             if (tools_isactive(dt, TOOLS_NODES)) {
1250                 sp_nodepath_flip(SP_NODE_CONTEXT(ec)->nodepath, NR::X);
1251             } else {
1252                 sp_selection_scale_relative(sel, center, NR::scale(-1.0, 1.0));
1253             }
1254             sp_document_done(sp_desktop_document(dt), SP_VERB_OBJECT_FLIP_HORIZONTAL,
1255                              /* TODO: annotate */ "verbs.cpp:1240");
1256             break;
1257         case SP_VERB_OBJECT_FLIP_VERTICAL:
1258             if (tools_isactive(dt, TOOLS_NODES)) {
1259                 sp_nodepath_flip(SP_NODE_CONTEXT(ec)->nodepath, NR::Y);
1260             } else {
1261                 sp_selection_scale_relative(sel, center, NR::scale(1.0, -1.0));
1262             }
1263             sp_document_done(sp_desktop_document(dt), SP_VERB_OBJECT_FLIP_VERTICAL,
1264                              /* TODO: annotate */ "verbs.cpp:1249");
1265             break;
1266         case SP_VERB_OBJECT_SET_MASK:
1267             sp_selection_set_mask(false, false);
1268             break;
1269         case SP_VERB_OBJECT_UNSET_MASK:
1270             sp_selection_unset_mask(false);
1271             break;
1272         case SP_VERB_OBJECT_SET_CLIPPATH:
1273             sp_selection_set_mask(true, false);
1274             break;
1275         case SP_VERB_OBJECT_UNSET_CLIPPATH:
1276             sp_selection_unset_mask(true);
1277             break;
1278         default:
1279             break;
1280     }
1282 } // end of sp_verb_action_object_perform()
1284 /** \brief  Decode the verb code and take appropriate action */
1285 void
1286 ContextVerb::perform(SPAction *action, void *data, void *pdata)
1288     SPDesktop *dt;
1289     sp_verb_t verb;
1290     int vidx;
1292     dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1294     if (!dt)
1295         return;
1297     verb = (sp_verb_t)GPOINTER_TO_INT((gpointer)data);
1299     /** \todo !!! hopefully this can go away soon and actions can look after
1300      * themselves
1301      */
1302     for (vidx = SP_VERB_CONTEXT_SELECT; vidx <= SP_VERB_CONTEXT_DROPPER_PREFS; vidx++)
1303     {
1304         SPAction *tool_action= get((sp_verb_t)vidx)->get_action(dt);
1305         if (tool_action) {
1306             sp_action_set_active(tool_action, vidx == (int)verb);
1307         }
1308     }
1310     switch (verb) {
1311         case SP_VERB_CONTEXT_SELECT:
1312             tools_switch_current(TOOLS_SELECT);
1313             break;
1314         case SP_VERB_CONTEXT_NODE:
1315             tools_switch_current(TOOLS_NODES);
1316             break;
1317         case SP_VERB_CONTEXT_RECT:
1318             tools_switch_current(TOOLS_SHAPES_RECT);
1319             break;
1320         case SP_VERB_CONTEXT_ARC:
1321             tools_switch_current(TOOLS_SHAPES_ARC);
1322             break;
1323         case SP_VERB_CONTEXT_STAR:
1324             tools_switch_current(TOOLS_SHAPES_STAR);
1325             break;
1326         case SP_VERB_CONTEXT_SPIRAL:
1327             tools_switch_current(TOOLS_SHAPES_SPIRAL);
1328             break;
1329         case SP_VERB_CONTEXT_PENCIL:
1330             tools_switch_current(TOOLS_FREEHAND_PENCIL);
1331             break;
1332         case SP_VERB_CONTEXT_PEN:
1333             tools_switch_current(TOOLS_FREEHAND_PEN);
1334             break;
1335         case SP_VERB_CONTEXT_CALLIGRAPHIC:
1336             tools_switch_current(TOOLS_CALLIGRAPHIC);
1337             break;
1338         case SP_VERB_CONTEXT_TEXT:
1339             tools_switch_current(TOOLS_TEXT);
1340             break;
1341         case SP_VERB_CONTEXT_GRADIENT:
1342             tools_switch_current(TOOLS_GRADIENT);
1343             break;
1344         case SP_VERB_CONTEXT_ZOOM:
1345             tools_switch_current(TOOLS_ZOOM);
1346             break;
1347         case SP_VERB_CONTEXT_DROPPER:
1348             tools_switch_current(TOOLS_DROPPER);
1349             break;
1350         case SP_VERB_CONTEXT_CONNECTOR:
1351             tools_switch_current (TOOLS_CONNECTOR);
1352             break;
1354         case SP_VERB_CONTEXT_SELECT_PREFS:
1355             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_SELECTOR);
1356             dt->_dlg_mgr->showDialog("InkscapePreferences");
1357             break;
1358         case SP_VERB_CONTEXT_NODE_PREFS:
1359             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_NODE);
1360             dt->_dlg_mgr->showDialog("InkscapePreferences");
1361             break;
1362         case SP_VERB_CONTEXT_RECT_PREFS:
1363             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_SHAPES_RECT);
1364             dt->_dlg_mgr->showDialog("InkscapePreferences");
1365             break;
1366         case SP_VERB_CONTEXT_ARC_PREFS:
1367             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_SHAPES_ELLIPSE);
1368             dt->_dlg_mgr->showDialog("InkscapePreferences");
1369             break;
1370         case SP_VERB_CONTEXT_STAR_PREFS:
1371             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_SHAPES_STAR);
1372             dt->_dlg_mgr->showDialog("InkscapePreferences");
1373             break;
1374         case SP_VERB_CONTEXT_SPIRAL_PREFS:
1375             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_SHAPES_SPIRAL);
1376             dt->_dlg_mgr->showDialog("InkscapePreferences");
1377             break;
1378         case SP_VERB_CONTEXT_PENCIL_PREFS:
1379             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_PENCIL);
1380             dt->_dlg_mgr->showDialog("InkscapePreferences");
1381             break;
1382         case SP_VERB_CONTEXT_PEN_PREFS:
1383             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_PEN);
1384             dt->_dlg_mgr->showDialog("InkscapePreferences");
1385             break;
1386         case SP_VERB_CONTEXT_CALLIGRAPHIC_PREFS:
1387             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_CALLIGRAPHY);
1388             dt->_dlg_mgr->showDialog("InkscapePreferences");
1389             break;
1390         case SP_VERB_CONTEXT_TEXT_PREFS:
1391             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_TEXT);
1392             dt->_dlg_mgr->showDialog("InkscapePreferences");
1393             break;
1394         case SP_VERB_CONTEXT_GRADIENT_PREFS:
1395             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_GRADIENT);
1396             dt->_dlg_mgr->showDialog("InkscapePreferences");
1397             break;
1398         case SP_VERB_CONTEXT_ZOOM_PREFS:
1399             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_ZOOM);
1400             dt->_dlg_mgr->showDialog("InkscapePreferences");
1401             break;
1402         case SP_VERB_CONTEXT_DROPPER_PREFS:
1403             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_DROPPER);
1404             dt->_dlg_mgr->showDialog("InkscapePreferences");
1405             break;
1406         case SP_VERB_CONTEXT_CONNECTOR_PREFS:
1407             prefs_set_int_attribute ("dialogs.preferences", "page", PREFS_PAGE_TOOLS_CONNECTOR);
1408             dt->_dlg_mgr->showDialog("InkscapePreferences");
1409             break;
1411         default:
1412             break;
1413     }
1415 } // end of sp_verb_action_ctx_perform()
1417 /** \brief  Decode the verb code and take appropriate action */
1418 void
1419 TextVerb::perform(SPAction *action, void *data, void *pdata)
1421     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1422     if (!dt)
1423         return;
1425     SPDocument *doc = sp_desktop_document(dt);
1426     (void)doc;
1427     Inkscape::XML::Node *repr = SP_OBJECT_REPR(dt->namedview);
1428     (void)repr;
1430  
1431 /** \brief  Decode the verb code and take appropriate action */
1432 void
1433 ZoomVerb::perform(SPAction *action, void *data, void *pdata)
1435     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1436     if (!dt)
1437         return;
1439     SPDocument *doc = sp_desktop_document(dt);
1441     Inkscape::XML::Node *repr = SP_OBJECT_REPR(dt->namedview);
1443     gdouble zoom_inc =
1444         prefs_get_double_attribute_limited( "options.zoomincrement",
1445                                             "value", 1.414213562, 1.01, 10 );
1447     switch (GPOINTER_TO_INT(data)) {
1448         case SP_VERB_ZOOM_IN:
1449         {
1450             NR::Rect const d = dt->get_display_area();
1451             dt->zoom_relative( d.midpoint()[NR::X], d.midpoint()[NR::Y], zoom_inc);
1452             break;
1453         }
1454         case SP_VERB_ZOOM_OUT:
1455         {
1456             NR::Rect const d = dt->get_display_area();
1457             dt->zoom_relative( d.midpoint()[NR::X], d.midpoint()[NR::Y], 1 / zoom_inc );
1458             break;
1459         }
1460         case SP_VERB_ZOOM_1_1:
1461         {
1462             NR::Rect const d = dt->get_display_area();
1463             dt->zoom_absolute( d.midpoint()[NR::X], d.midpoint()[NR::Y], 1.0 );
1464             break;
1465         }
1466         case SP_VERB_ZOOM_1_2:
1467         {
1468             NR::Rect const d = dt->get_display_area();
1469             dt->zoom_absolute( d.midpoint()[NR::X], d.midpoint()[NR::Y], 0.5);
1470             break;
1471         }
1472         case SP_VERB_ZOOM_2_1:
1473         {
1474             NR::Rect const d = dt->get_display_area();
1475             dt->zoom_absolute( d.midpoint()[NR::X], d.midpoint()[NR::Y], 2.0 );
1476             break;
1477         }
1478         case SP_VERB_ZOOM_PAGE:
1479             dt->zoom_page();
1480             break;
1481         case SP_VERB_ZOOM_PAGE_WIDTH:
1482             dt->zoom_page_width();
1483             break;
1484         case SP_VERB_ZOOM_DRAWING:
1485             dt->zoom_drawing();
1486             break;
1487         case SP_VERB_ZOOM_SELECTION:
1488             dt->zoom_selection();
1489             break;
1490         case SP_VERB_ZOOM_NEXT:
1491             dt->next_zoom();
1492             break;
1493         case SP_VERB_ZOOM_PREV:
1494             dt->prev_zoom();
1495             break;
1496         case SP_VERB_TOGGLE_RULERS:
1497             dt->toggleRulers();
1498             break;
1499         case SP_VERB_TOGGLE_SCROLLBARS:
1500             dt->toggleScrollbars();
1501             break;
1502         case SP_VERB_TOGGLE_GUIDES:
1503             sp_namedview_toggle_guides(doc, repr);
1504             break;
1505         case SP_VERB_TOGGLE_GRID:
1506             sp_namedview_toggle_grid(doc, repr);
1507             break;
1508 #ifdef HAVE_GTK_WINDOW_FULLSCREEN
1509         case SP_VERB_FULLSCREEN:
1510             dt->fullscreen();
1511             break;
1512 #endif /* HAVE_GTK_WINDOW_FULLSCREEN */
1513         case SP_VERB_VIEW_NEW:
1514             sp_ui_new_view();
1515             break;
1516         case SP_VERB_VIEW_NEW_PREVIEW:
1517             sp_ui_new_view_preview();
1518             break;
1519         case SP_VERB_VIEW_MODE_NORMAL:
1520             dt->setDisplayModeNormal();
1521             break;
1522         case SP_VERB_VIEW_MODE_OUTLINE:
1523             dt->setDisplayModeOutline();
1524             break;
1525         case SP_VERB_VIEW_ICON_PREVIEW:
1526             show_panel( Inkscape::UI::Dialogs::IconPreviewPanel::getInstance(), "dialogs.iconpreview", SP_VERB_VIEW_ICON_PREVIEW );
1527             break;
1528         default:
1529             break;
1530     }
1532 } // end of sp_verb_action_zoom_perform()
1534 /** \brief  Decode the verb code and take appropriate action */
1535 void
1536 DialogVerb::perform(SPAction *action, void *data, void *pdata)
1538     if (reinterpret_cast<std::size_t>(data) != SP_VERB_DIALOG_TOGGLE) {
1539         // unhide all when opening a new dialog
1540         inkscape_dialogs_unhide();
1541     }
1543     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1544     g_assert(dt->_dlg_mgr != NULL);
1546     switch (reinterpret_cast<std::size_t>(data)) {
1547         case SP_VERB_DIALOG_DISPLAY:
1548             //sp_display_dialog();
1549             dt->_dlg_mgr->showDialog("InkscapePreferences");
1550             break;
1551         case SP_VERB_DIALOG_METADATA:
1552             // sp_desktop_dialog();
1553             dt->_dlg_mgr->showDialog("DocumentMetadata");
1554             break;
1555         case SP_VERB_DIALOG_NAMEDVIEW:
1556             // sp_desktop_dialog();
1557             dt->_dlg_mgr->showDialog("DocumentProperties");
1558             break;
1559         case SP_VERB_DIALOG_FILL_STROKE:
1560             sp_object_properties_dialog();
1561             break;
1562         case SP_VERB_DIALOG_SWATCHES:
1563             show_panel( Inkscape::UI::Dialogs::SwatchesPanel::getInstance(), "dialogs.swatches", SP_VERB_DIALOG_SWATCHES);
1564             break;
1565         case SP_VERB_DIALOG_TRANSFORM:
1566             dt->_dlg_mgr->showDialog("Transformation");
1567             break;
1568         case SP_VERB_DIALOG_ALIGN_DISTRIBUTE:
1569             dt->_dlg_mgr->showDialog("AlignAndDistribute");
1570             break;
1571         case SP_VERB_DIALOG_TEXT:
1572             sp_text_edit_dialog();
1573             break;
1574         case SP_VERB_DIALOG_XML_EDITOR:
1575             sp_xml_tree_dialog();
1576             break;
1577         case SP_VERB_DIALOG_FIND:
1578             sp_find_dialog();
1579             break;
1580         case SP_VERB_DIALOG_DEBUG:
1581             dt->_dlg_mgr->showDialog("Messages");
1582             break;
1583         case SP_VERB_DIALOG_SCRIPT:
1584             dt->_dlg_mgr->showDialog("Script");
1585             break;
1586         case SP_VERB_DIALOG_UNDO_HISTORY:
1587             dt->_dlg_mgr->showDialog("UndoHistory");
1588             break;
1589         case SP_VERB_DIALOG_TOGGLE:
1590             inkscape_dialogs_toggle();
1591             break;
1592         case SP_VERB_DIALOG_CLONETILER:
1593             clonetiler_dialog();
1594             break;
1595         case SP_VERB_DIALOG_ITEM:
1596             sp_item_dialog();
1597             break;
1598 #ifdef WITH_INKBOARD
1599         case SP_VERB_XMPP_CLIENT:
1600                 {
1601             Inkscape::Whiteboard::SessionManager::showClient();
1602                         break;
1603                 }
1604 #endif
1605         case SP_VERB_DIALOG_INPUT:
1606             sp_input_dialog();
1607             break;
1608         case SP_VERB_DIALOG_EXTENSIONEDITOR:
1609             dt->_dlg_mgr->showDialog("ExtensionEditor");
1610             break;
1611         case SP_VERB_DIALOG_LAYERS:
1612             show_panel( Inkscape::UI::Dialogs::LayersPanel::getInstance(), "dialogs.layers", SP_VERB_DIALOG_LAYERS );
1613             break;
1614         default:
1615             break;
1616     }
1617 } // end of sp_verb_action_dialog_perform()
1619 /** \brief  Decode the verb code and take appropriate action */
1620 void
1621 HelpVerb::perform(SPAction *action, void *data, void *pdata)
1623     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1624     g_assert(dt->_dlg_mgr != NULL);
1626     switch (reinterpret_cast<std::size_t>(data)) {
1627         case SP_VERB_HELP_KEYS:
1628             /* TRANSLATORS: If you have translated the keys.svg file to your language, then
1629                translate this string as "keys.LANG.svg" (where LANG is your language code);
1630                otherwise leave as "keys.svg". */
1631             sp_help_open_screen(_("keys.svg"));
1632             break;
1633         case SP_VERB_HELP_ABOUT:
1634             sp_help_about();
1635             break;
1636         case SP_VERB_HELP_ABOUT_EXTENSIONS: {
1637             Inkscape::UI::Dialogs::ExtensionsPanel *panel = new Inkscape::UI::Dialogs::ExtensionsPanel();
1638             panel->set_full(true);
1639             show_panel( *panel, "dialogs.aboutextensions", SP_VERB_HELP_ABOUT_EXTENSIONS );
1640             break;
1641         }
1643         /*
1644         case SP_VERB_SHOW_LICENSE:
1645             // TRANSLATORS: See "tutorial-basic.svg" comment.
1646             sp_help_open_tutorial(NULL, (gpointer) _("gpl-2.svg"));
1647             break;
1648         */
1650         case SP_VERB_HELP_MEMORY:
1651             dt->_dlg_mgr->showDialog("Memory");
1652             break;
1653         default:
1654             break;
1655     }
1656 } // end of sp_verb_action_help_perform()
1658 /** \brief  Decode the verb code and take appropriate action */
1659 void
1660 TutorialVerb::perform(SPAction *action, void *data, void *pdata)
1662     switch (reinterpret_cast<std::size_t>(data)) {
1663         case SP_VERB_TUTORIAL_BASIC:
1664             /* TRANSLATORS: If you have translated the tutorial-basic.svg file to your language,
1665                then translate this string as "tutorial-basic.LANG.svg" (where LANG is your language
1666                code); otherwise leave as "tutorial-basic.svg". */
1667             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-basic.svg"));
1668             break;
1669         case SP_VERB_TUTORIAL_SHAPES:
1670             // TRANSLATORS: See "tutorial-basic.svg" comment.
1671             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-shapes.svg"));
1672             break;
1673         case SP_VERB_TUTORIAL_ADVANCED:
1674             // TRANSLATORS: See "tutorial-basic.svg" comment.
1675             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-advanced.svg"));
1676             break;
1677         case SP_VERB_TUTORIAL_TRACING:
1678             // TRANSLATORS: See "tutorial-basic.svg" comment.
1679             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-tracing.svg"));
1680             break;
1681         case SP_VERB_TUTORIAL_CALLIGRAPHY:
1682             // TRANSLATORS: See "tutorial-basic.svg" comment.
1683             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-calligraphy.svg"));
1684             break;
1685         case SP_VERB_TUTORIAL_DESIGN:
1686             // TRANSLATORS: See "tutorial-basic.svg" comment.
1687             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-elements.svg"));
1688             break;
1689         case SP_VERB_TUTORIAL_TIPS:
1690             // TRANSLATORS: See "tutorial-basic.svg" comment.
1691             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-tips.svg"));
1692             break;
1693         default:
1694             break;
1695     }
1696 } // end of sp_verb_action_tutorial_perform()
1699 /**
1700  * Action vector to define functions called if a staticly defined file verb
1701  * is called.
1702  */
1703 SPActionEventVector FileVerb::vector =
1704             {{NULL},FileVerb::perform, NULL, NULL, NULL, NULL};
1705 /**
1706  * Action vector to define functions called if a staticly defined edit verb is
1707  * called.
1708  */
1709 SPActionEventVector EditVerb::vector =
1710             {{NULL},EditVerb::perform, NULL, NULL, NULL, NULL};
1712 /**
1713  * Action vector to define functions called if a staticly defined selection
1714  * verb is called
1715  */
1716 SPActionEventVector SelectionVerb::vector =
1717             {{NULL},SelectionVerb::perform, NULL, NULL, NULL, NULL};
1719 /**
1720  * Action vector to define functions called if a staticly defined layer
1721  * verb is called
1722  */
1723 SPActionEventVector LayerVerb::vector =
1724             {{NULL}, LayerVerb::perform, NULL, NULL, NULL, NULL};
1726 /**
1727  * Action vector to define functions called if a staticly defined object
1728  * editing verb is called
1729  */
1730 SPActionEventVector ObjectVerb::vector =
1731             {{NULL},ObjectVerb::perform, NULL, NULL, NULL, NULL};
1733 /**
1734  * Action vector to define functions called if a staticly defined context
1735  * verb is called
1736  */
1737 SPActionEventVector ContextVerb::vector =
1738             {{NULL},ContextVerb::perform, NULL, NULL, NULL, NULL};
1740 /**
1741  * Action vector to define functions called if a staticly defined zoom verb
1742  * is called
1743  */
1744 SPActionEventVector ZoomVerb::vector =
1745             {{NULL},ZoomVerb::perform, NULL, NULL, NULL, NULL};
1748 /**
1749  * Action vector to define functions called if a staticly defined dialog verb
1750  * is called
1751  */
1752 SPActionEventVector DialogVerb::vector =
1753             {{NULL},DialogVerb::perform, NULL, NULL, NULL, NULL};
1755 /**
1756  * Action vector to define functions called if a staticly defined help verb
1757  * is called
1758  */
1759 SPActionEventVector HelpVerb::vector =
1760             {{NULL},HelpVerb::perform, NULL, NULL, NULL, NULL};
1762 /**
1763  * Action vector to define functions called if a staticly defined tutorial verb
1764  * is called
1765  */
1766 SPActionEventVector TutorialVerb::vector =
1767             {{NULL},TutorialVerb::perform, NULL, NULL, NULL, NULL};
1769 /**
1770  * Action vector to define functions called if a staticly defined tutorial verb
1771  * is called
1772  */
1773 SPActionEventVector TextVerb::vector =
1774             {{NULL},TextVerb::perform, NULL, NULL, NULL, NULL};
1777 /* *********** Effect Last ********** */
1779 /** \brief A class to represent the last effect issued */
1780 class EffectLastVerb : public Verb {
1781 private:
1782     static void perform(SPAction *action, void *mydata, void *otherdata);
1783     static SPActionEventVector vector;
1784 protected:
1785     virtual SPAction *make_action(Inkscape::UI::View::View *view);
1786 public:
1787     /** \brief Use the Verb initializer with the same parameters. */
1788     EffectLastVerb(unsigned int const code,
1789                    gchar const *id,
1790                    gchar const *name,
1791                    gchar const *tip,
1792                    gchar const *image) :
1793         Verb(code, id, name, tip, image)
1794     {
1795         set_default_sensitive(false);
1796     }
1797 }; /* EffectLastVerb class */
1799 /**
1800  * The vector to attach in the last effect verb.
1801  */
1802 SPActionEventVector EffectLastVerb::vector =
1803             {{NULL},EffectLastVerb::perform, NULL, NULL, NULL, NULL};
1805 /** \brief  Create an action for a \c EffectLastVerb
1806     \param  view  Which view the action should be created for
1807     \return The built action.
1809     Calls \c make_action_helper with the \c vector.
1810 */
1811 SPAction *
1812 EffectLastVerb::make_action(Inkscape::UI::View::View *view)
1814     return make_action_helper(view, &vector);
1817 /** \brief  Decode the verb code and take appropriate action */
1818 void
1819 EffectLastVerb::perform(SPAction *action, void *data, void *pdata)
1821     /* These aren't used, but are here to remind people not to use
1822        the CURRENT_DOCUMENT macros unless they really have to. */
1823     Inkscape::UI::View::View *current_view = sp_action_get_view(action);
1824     // SPDocument *current_document = SP_VIEW_DOCUMENT(current_view);
1825     Inkscape::Extension::Effect *effect = Inkscape::Extension::Effect::get_last_effect();
1827     if (effect == NULL) return;
1828     if (current_view == NULL) return;
1830     switch ((long) data) {
1831         case SP_VERB_EFFECT_LAST_PREF:
1832             if (!effect->prefs(current_view))
1833                 return;
1834             /* Note: fall through */
1835         case SP_VERB_EFFECT_LAST:
1836             effect->effect(current_view);
1837             break;
1838         default:
1839             return;
1840     }
1842     return;
1844 /* *********** End Effect Last ********** */
1846 /* *********** Fit Canvas ********** */
1848 /** \brief A class to represent the canvas fitting verbs */
1849 class FitCanvasVerb : public Verb {
1850 private:
1851     static void perform(SPAction *action, void *mydata, void *otherdata);
1852     static SPActionEventVector vector;
1853 protected:
1854     virtual SPAction *make_action(Inkscape::UI::View::View *view);
1855 public:
1856     /** \brief Use the Verb initializer with the same parameters. */
1857     FitCanvasVerb(unsigned int const code,
1858                    gchar const *id,
1859                    gchar const *name,
1860                    gchar const *tip,
1861                    gchar const *image) :
1862         Verb(code, id, name, tip, image)
1863     {
1864         set_default_sensitive(false);
1865     }
1866 }; /* FitCanvasVerb class */
1868 /**
1869  * The vector to attach in the fit canvas verb.
1870  */
1871 SPActionEventVector FitCanvasVerb::vector =
1872             {{NULL},FitCanvasVerb::perform, NULL, NULL, NULL, NULL};
1874 /** \brief  Create an action for a \c FitCanvasVerb
1875     \param  view  Which view the action should be created for
1876     \return The built action.
1878     Calls \c make_action_helper with the \c vector.
1879 */
1880 SPAction *
1881 FitCanvasVerb::make_action(Inkscape::UI::View::View *view)
1883     SPAction *action = make_action_helper(view, &vector);
1884     return action;
1887 /** \brief  Decode the verb code and take appropriate action */
1888 void
1889 FitCanvasVerb::perform(SPAction *action, void *data, void *pdata)
1891     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1892     if (!dt) return;
1893     SPDocument *doc = sp_desktop_document(dt);
1894     if (!doc) return;
1895     
1896     switch ((long) data) {
1897         case SP_VERB_FIT_CANVAS_TO_SELECTION:
1898             fit_canvas_to_selection(dt);
1899             break;
1900         case SP_VERB_FIT_CANVAS_TO_DRAWING:
1901             fit_canvas_to_drawing(doc);
1902             break;
1903         case SP_VERB_FIT_CANVAS_TO_SELECTION_OR_DRAWING:
1904             fit_canvas_to_selection_or_drawing(dt);
1905             break;
1906         default:
1907             return;
1908     }
1910     return;
1912 /* *********** End Fit Canvas ********** */
1919 /* these must be in the same order as the SP_VERB_* enum in "verbs.h" */
1920 Verb *Verb::_base_verbs[] = {
1921     /* Header */
1922     new Verb(SP_VERB_INVALID, NULL, NULL, NULL, NULL),
1923     new Verb(SP_VERB_NONE, "None", N_("None"), N_("Does nothing"), NULL),
1925     /* File */
1926     new FileVerb(SP_VERB_FILE_NEW, "FileNew", N_("Default"), N_("Create new document from the default template"),
1927                  GTK_STOCK_NEW ),
1928     new FileVerb(SP_VERB_FILE_OPEN, "FileOpen", N_("_Open..."),
1929                  N_("Open an existing document"), GTK_STOCK_OPEN ),
1930     new FileVerb(SP_VERB_FILE_REVERT, "FileRevert", N_("Re_vert"),
1931                  N_("Revert to the last saved version of document (changes will be lost)"), GTK_STOCK_REVERT_TO_SAVED ),
1932     new FileVerb(SP_VERB_FILE_SAVE, "FileSave", N_("_Save"), N_("Save document"),
1933                  GTK_STOCK_SAVE ),
1934     new FileVerb(SP_VERB_FILE_SAVE_AS, "FileSaveAs", N_("Save _As..."),
1935                  N_("Save document under a new name"), GTK_STOCK_SAVE_AS ),
1936     new FileVerb(SP_VERB_FILE_PRINT, "FilePrint", N_("_Print..."), N_("Print document"),
1937                  GTK_STOCK_PRINT ),
1938     // TRANSLATORS: "Vacuum Defs" means "Clean up defs" (so as to remove unused definitions)
1939     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"),
1940                  "file_vacuum" ),
1941     new FileVerb(SP_VERB_FILE_PRINT_DIRECT, "FilePrintDirect", N_("Print _Direct"),
1942                  N_("Print directly without prompting to a file or pipe"), NULL ),
1943     new FileVerb(SP_VERB_FILE_PRINT_PREVIEW, "FilePrintPreview", N_("Print Previe_w"),
1944                  N_("Preview document printout"), GTK_STOCK_PRINT_PREVIEW ),
1945     new FileVerb(SP_VERB_FILE_IMPORT, "FileImport", N_("_Import..."),
1946                  N_("Import a bitmap or SVG image into this document"), "file_import"),
1947     new FileVerb(SP_VERB_FILE_EXPORT, "FileExport", N_("_Export Bitmap..."),
1948                  N_("Export this document or a selection as a bitmap image"), "file_export"),
1949     new FileVerb(SP_VERB_FILE_NEXT_DESKTOP, "NextWindow", N_("N_ext Window"),
1950                  N_("Switch to the next document window"), "window_next"),
1951     new FileVerb(SP_VERB_FILE_PREV_DESKTOP, "PrevWindow", N_("P_revious Window"),
1952                  N_("Switch to the previous document window"), "window_previous"),
1953     new FileVerb(SP_VERB_FILE_CLOSE_VIEW, "FileClose", N_("_Close"),
1954                  N_("Close this document window"), GTK_STOCK_CLOSE),
1955     new FileVerb(SP_VERB_FILE_QUIT, "FileQuit", N_("_Quit"), N_("Quit Inkscape"), GTK_STOCK_QUIT),
1957     /* Edit */
1958     new EditVerb(SP_VERB_EDIT_UNDO, "EditUndo", N_("_Undo"), N_("Undo last action"),
1959                  GTK_STOCK_UNDO),
1960     new EditVerb(SP_VERB_EDIT_REDO, "EditRedo", N_("_Redo"),
1961                  N_("Do again the last undone action"), GTK_STOCK_REDO),
1962     new EditVerb(SP_VERB_EDIT_CUT, "EditCut", N_("Cu_t"),
1963                  N_("Cut selection to clipboard"), GTK_STOCK_CUT),
1964     new EditVerb(SP_VERB_EDIT_COPY, "EditCopy", N_("_Copy"),
1965                  N_("Copy selection to clipboard"), GTK_STOCK_COPY),
1966     new EditVerb(SP_VERB_EDIT_PASTE, "EditPaste", N_("_Paste"),
1967                  N_("Paste objects from clipboard to mouse point, or paste text"), GTK_STOCK_PASTE),
1968     new EditVerb(SP_VERB_EDIT_PASTE_STYLE, "EditPasteStyle", N_("Paste _Style"),
1969                  N_("Apply the style of the copied object to selection"), "selection_paste_style"),
1970     new EditVerb(SP_VERB_EDIT_PASTE_SIZE, "EditPasteSize", N_("Paste Si_ze"),
1971                  N_("Scale selection to match the size of the copied object"), NULL),
1972     new EditVerb(SP_VERB_EDIT_PASTE_SIZE_X, "EditPasteWidth", N_("Paste _Width"),
1973                  N_("Scale selection horizontally to match the width of the copied object"), NULL),
1974     new EditVerb(SP_VERB_EDIT_PASTE_SIZE_Y, "EditPasteHeight", N_("Paste _Height"),
1975                  N_("Scale selection vertically to match the height of the copied object"), NULL),
1976     new EditVerb(SP_VERB_EDIT_PASTE_SIZE_SEPARATELY, "EditPasteSizeSeparately", N_("Paste Size Separately"),
1977                  N_("Scale each selected object to match the size of the copied object"), NULL),
1978     new EditVerb(SP_VERB_EDIT_PASTE_SIZE_SEPARATELY_X, "EditPasteWidthSeparately", N_("Paste Width Separately"),
1979                  N_("Scale each selected object horizontally to match the width of the copied object"), NULL),
1980     new EditVerb(SP_VERB_EDIT_PASTE_SIZE_SEPARATELY_Y, "EditPasteHeightSeparately", N_("Paste Height Separately"),
1981                  N_("Scale each selected object vertically to match the height of the copied object"), NULL),
1982     new EditVerb(SP_VERB_EDIT_PASTE_IN_PLACE, "EditPasteInPlace", N_("Paste _In Place"),
1983                  N_("Paste objects from clipboard to the original location"), "selection_paste_in_place"),
1984     new EditVerb(SP_VERB_EDIT_DELETE, "EditDelete", N_("_Delete"),
1985                  N_("Delete selection"), GTK_STOCK_DELETE),
1986     new EditVerb(SP_VERB_EDIT_DUPLICATE, "EditDuplicate", N_("Duplic_ate"),
1987                  N_("Duplicate selected objects"), "edit_duplicate"),
1988     new EditVerb(SP_VERB_EDIT_CLONE, "EditClone", N_("Create Clo_ne"),
1989                  N_("Create a clone (a copy linked to the original) of selected object"), "edit_clone"),
1990     new EditVerb(SP_VERB_EDIT_UNLINK_CLONE, "EditUnlinkClone", N_("Unlin_k Clone"),
1991                  N_("Cut the selected clone's link to its original, turning it into a standalone object"), "edit_unlink_clone"),
1992     new EditVerb(SP_VERB_EDIT_CLONE_ORIGINAL, "EditCloneOriginal", N_("Select _Original"),
1993                  N_("Select the object to which the selected clone is linked"), NULL),
1994     // TRANSLATORS: Convert selection to a rectangle with tiled pattern fill
1995     new EditVerb(SP_VERB_EDIT_TILE, "ObjectsToPattern", N_("Objects to Patter_n"),
1996                  N_("Convert selection to a rectangle with tiled pattern fill"), NULL),
1997     // TRANSLATORS: Extract objects from a tiled pattern fill
1998     new EditVerb(SP_VERB_EDIT_UNTILE, "ObjectsFromPattern", N_("Pattern to _Objects"),
1999                  N_("Extract objects from a tiled pattern fill"), NULL),
2000     new EditVerb(SP_VERB_EDIT_CLEAR_ALL, "EditClearAll", N_("Clea_r All"),
2001                  N_("Delete all objects from document"), NULL),
2002     new EditVerb(SP_VERB_EDIT_SELECT_ALL, "EditSelectAll", N_("Select Al_l"),
2003                  N_("Select all objects or all nodes"), "selection_select_all"),
2004     new EditVerb(SP_VERB_EDIT_SELECT_ALL_IN_ALL_LAYERS, "EditSelectAllInAllLayers", N_("Select All in All La_yers"),
2005                  N_("Select all objects in all visible and unlocked layers"), NULL),
2006     new EditVerb(SP_VERB_EDIT_INVERT, "EditInvert", N_("In_vert Selection"),
2007                  N_("Invert selection (unselect what is selected and select everything else)"), NULL),
2008     new EditVerb(SP_VERB_EDIT_INVERT_IN_ALL_LAYERS, "EditInvertInAllLayers", N_("Invert in All Layers"),
2009                  N_("Invert selection in all visible and unlocked layers"), NULL),
2010     new EditVerb(SP_VERB_EDIT_DESELECT, "EditDeselect", N_("D_eselect"),
2011                  N_("Deselect any selected objects or nodes"), NULL),
2013     /* Selection */
2014     new SelectionVerb(SP_VERB_SELECTION_TO_FRONT, "SelectionToFront", N_("Raise to _Top"),
2015                       N_("Raise selection to top"), "selection_top"),
2016     new SelectionVerb(SP_VERB_SELECTION_TO_BACK, "SelectionToBack", N_("Lower to _Bottom"),
2017                       N_("Lower selection to bottom"), "selection_bot"),
2018     new SelectionVerb(SP_VERB_SELECTION_RAISE, "SelectionRaise", N_("_Raise"),
2019                       N_("Raise selection one step"), "selection_up"),
2020     new SelectionVerb(SP_VERB_SELECTION_LOWER, "SelectionLower", N_("_Lower"),
2021                       N_("Lower selection one step"), "selection_down"),
2022     new SelectionVerb(SP_VERB_SELECTION_GROUP, "SelectionGroup", N_("_Group"),
2023                       N_("Group selected objects"), "selection_group"),
2024     new SelectionVerb(SP_VERB_SELECTION_UNGROUP, "SelectionUnGroup", N_("_Ungroup"),
2025                       N_("Ungroup selected groups"), "selection_ungroup"),
2027     new SelectionVerb(SP_VERB_SELECTION_TEXTTOPATH, "SelectionTextToPath", N_("_Put on Path"),
2028                       N_("Put text on path"), NULL),
2029     new SelectionVerb(SP_VERB_SELECTION_TEXTFROMPATH, "SelectionTextFromPath", N_("_Remove from Path"),
2030                       N_("Remove text from path"), NULL),
2031     new SelectionVerb(SP_VERB_SELECTION_REMOVE_KERNS, "SelectionTextRemoveKerns", N_("Remove Manual _Kerns"),
2032                       // TRANSLATORS: "glyph": An image used in the visual representation of characters;
2033                       //  roughly speaking, how a character looks. A font is a set of glyphs.
2034                       N_("Remove all manual kerns and glyph rotations from a text object"), NULL),
2036     new SelectionVerb(SP_VERB_SELECTION_UNION, "SelectionUnion", N_("_Union"),
2037                       N_("Create union of selected paths"), "union"),
2038     new SelectionVerb(SP_VERB_SELECTION_INTERSECT, "SelectionIntersect", N_("_Intersection"),
2039                       N_("Create intersection of selected paths"), "intersection"),
2040     new SelectionVerb(SP_VERB_SELECTION_DIFF, "SelectionDiff", N_("_Difference"),
2041                       N_("Create difference of selected paths (bottom minus top)"), "difference"),
2042     new SelectionVerb(SP_VERB_SELECTION_SYMDIFF, "SelectionSymDiff", N_("E_xclusion"),
2043                       N_("Create exclusive OR of selected paths (those parts that belong to only one path)"), "exclusion"),
2044     new SelectionVerb(SP_VERB_SELECTION_CUT, "SelectionDivide", N_("Di_vision"),
2045                       N_("Cut the bottom path into pieces"), "division"),
2046     // TRANSLATORS: "to cut a path" is not the same as "to break a path apart" - see the
2047     // Advanced tutorial for more info
2048     new SelectionVerb(SP_VERB_SELECTION_SLICE, "SelectionCutPath", N_("Cut _Path"),
2049                       N_("Cut the bottom path's stroke into pieces, removing fill"), "cut_path"),
2050     // TRANSLATORS: "outset": expand a shape by offsetting the object's path,
2051     // i.e. by displacing it perpendicular to the path in each point.
2052     // See also the Advanced Tutorial for explanation.
2053     new SelectionVerb(SP_VERB_SELECTION_OFFSET, "SelectionOffset", N_("Outs_et"),
2054                       N_("Outset selected paths"), "outset_path"),
2055     new SelectionVerb(SP_VERB_SELECTION_OFFSET_SCREEN, "SelectionOffsetScreen",
2056                       N_("O_utset Path by 1 px"),
2057                       N_("Outset selected paths by 1 px"), NULL),
2058     new SelectionVerb(SP_VERB_SELECTION_OFFSET_SCREEN_10, "SelectionOffsetScreen10",
2059                       N_("O_utset Path by 10 px"),
2060                       N_("Outset selected paths by 10 px"), NULL),
2061     // TRANSLATORS: "inset": contract a shape by offsetting the object's path,
2062     // i.e. by displacing it perpendicular to the path in each point.
2063     // See also the Advanced Tutorial for explanation.
2064     new SelectionVerb(SP_VERB_SELECTION_INSET, "SelectionInset", N_("I_nset"),
2065                       N_("Inset selected paths"), "inset_path"),
2066     new SelectionVerb(SP_VERB_SELECTION_INSET_SCREEN, "SelectionInsetScreen",
2067                       N_("I_nset Path by 1 px"),
2068                       N_("Inset selected paths by 1 px"), NULL),
2069     new SelectionVerb(SP_VERB_SELECTION_INSET_SCREEN_10, "SelectionInsetScreen10",
2070                       N_("I_nset Path by 10 px"),
2071                       N_("Inset selected paths by 10 px"), NULL),
2072     new SelectionVerb(SP_VERB_SELECTION_DYNAMIC_OFFSET, "SelectionDynOffset",
2073                       N_("D_ynamic Offset"), N_("Create a dynamic offset object"), "dynamic_offset"),
2074     new SelectionVerb(SP_VERB_SELECTION_LINKED_OFFSET, "SelectionLinkedOffset",
2075                       N_("_Linked Offset"),
2076                       N_("Create a dynamic offset object linked to the original path"),
2077                       "linked_offset"),
2078     new SelectionVerb(SP_VERB_SELECTION_OUTLINE, "StrokeToPath", N_("_Stroke to Path"),
2079                       N_("Convert selected object's stroke to paths"), "stroke_tocurve"),
2080     new SelectionVerb(SP_VERB_SELECTION_SIMPLIFY, "SelectionSimplify", N_("Si_mplify"),
2081                       N_("Simplify selected paths (remove extra nodes)"), "simplify"),
2082     new SelectionVerb(SP_VERB_SELECTION_REVERSE, "SelectionReverse", N_("_Reverse"),
2083                       N_("Reverse the direction of selected paths (useful for flipping markers)"), "selection_reverse"),
2084     // TRANSLATORS: "to trace" means "to convert a bitmap to vector graphics" (to vectorize)
2085     new SelectionVerb(SP_VERB_SELECTION_TRACE, "SelectionTrace", N_("_Trace Bitmap..."),
2086                       N_("Create one or more paths from a bitmap by tracing it"), "selection_trace"),
2087     new SelectionVerb(SP_VERB_SELECTION_CREATE_BITMAP, "SelectionCreateBitmap", N_("_Make a Bitmap Copy"),
2088                       N_("Export selection to a bitmap and insert it into document"), "selection_bitmap" ),
2089     new SelectionVerb(SP_VERB_SELECTION_COMBINE, "SelectionCombine", N_("_Combine"),
2090                       N_("Combine several paths into one"), "selection_combine"),
2091     // TRANSLATORS: "to cut a path" is not the same as "to break a path apart" - see the
2092     // Advanced tutorial for more info
2093     new SelectionVerb(SP_VERB_SELECTION_BREAK_APART, "SelectionBreakApart", N_("Break _Apart"),
2094                       N_("Break selected paths into subpaths"), "selection_break"),
2095     new SelectionVerb(SP_VERB_SELECTION_GRIDTILE, "DialogGridArrange", N_("Gri_d Arrange..."),
2096                       N_("Arrange selected objects in a grid pattern"), "grid_arrange"),
2097     /* Layer */
2098     new LayerVerb(SP_VERB_LAYER_NEW, "LayerNew", N_("_Add Layer..."),
2099                   N_("Create a new layer"), "new_layer"),
2100     new LayerVerb(SP_VERB_LAYER_RENAME, "LayerRename", N_("Re_name Layer..."),
2101                   N_("Rename the current layer"), "rename_layer"),
2102     new LayerVerb(SP_VERB_LAYER_NEXT, "LayerNext", N_("Switch to Layer Abov_e"),
2103                   N_("Switch to the layer above the current"), "switch_to_layer_above"),
2104     new LayerVerb(SP_VERB_LAYER_PREV, "LayerPrev", N_("Switch to Layer Belo_w"),
2105                   N_("Switch to the layer below the current"), "switch_to_layer_below"),
2106     new LayerVerb(SP_VERB_LAYER_MOVE_TO_NEXT, "LayerMoveToNext", N_("Move Selection to Layer Abo_ve"),
2107                   N_("Move selection to the layer above the current"), "move_selection_above"),
2108     new LayerVerb(SP_VERB_LAYER_MOVE_TO_PREV, "LayerMoveToPrev", N_("Move Selection to Layer Bel_ow"),
2109                   N_("Move selection to the layer below the current"), "move_selection_below"),
2110     new LayerVerb(SP_VERB_LAYER_TO_TOP, "LayerToTop", N_("Layer to _Top"),
2111                   N_("Raise the current layer to the top"), "layer_to_top"),
2112     new LayerVerb(SP_VERB_LAYER_TO_BOTTOM, "LayerToBottom", N_("Layer to _Bottom"),
2113                   N_("Lower the current layer to the bottom"), "layer_to_bottom"),
2114     new LayerVerb(SP_VERB_LAYER_RAISE, "LayerRaise", N_("_Raise Layer"),
2115                   N_("Raise the current layer"), "raise_layer"),
2116     new LayerVerb(SP_VERB_LAYER_LOWER, "LayerLower", N_("_Lower Layer"),
2117                   N_("Lower the current layer"), "lower_layer"),
2118     new LayerVerb(SP_VERB_LAYER_DELETE, "LayerDelete", N_("_Delete Current Layer"),
2119                   N_("Delete the current layer"), "delete_layer"),
2121     /* Object */
2122     new ObjectVerb(SP_VERB_OBJECT_ROTATE_90_CW, "ObjectRotate90", N_("Rotate _90&#176; CW"),
2123                    N_("Rotate selection 90&#176; clockwise"), "object_rotate_90_CW"),
2124     new ObjectVerb(SP_VERB_OBJECT_ROTATE_90_CCW, "ObjectRotate90CCW", N_("Rotate 9_0&#176; CCW"),
2125                    N_("Rotate selection 90&#176; counter-clockwise"), "object_rotate_90_CCW"),
2126     new ObjectVerb(SP_VERB_OBJECT_FLATTEN, "ObjectRemoveTransform", N_("Remove _Transformations"),
2127                    N_("Remove transformations from object"), "object_reset"),
2128     new ObjectVerb(SP_VERB_OBJECT_TO_CURVE, "ObjectToPath", N_("_Object to Path"),
2129                    N_("Convert selected object to path"), "object_tocurve"),
2130     new ObjectVerb(SP_VERB_OBJECT_FLOW_TEXT, "ObjectFlowText", N_("_Flow into Frame"),
2131                    N_("Put text into a frame (path or shape), creating a flowed text linked to the frame object"), NULL),
2132     new ObjectVerb(SP_VERB_OBJECT_UNFLOW_TEXT, "ObjectUnFlowText", N_("_Unflow"),
2133                    N_("Remove text from frame (creates a single-line text object)"), NULL),
2134     new ObjectVerb(SP_VERB_OBJECT_FLOWTEXT_TO_TEXT, "ObjectFlowtextToText", N_("_Convert to Text"),
2135                    N_("Convert flowed text to regular text object (preserves appearance)"), NULL),
2136     new ObjectVerb(SP_VERB_OBJECT_FLIP_HORIZONTAL, "ObjectFlipHorizontally",
2137                    N_("Flip _Horizontal"), N_("Flip selected objects horizontally"),
2138                    "object_flip_hor"),
2139     new ObjectVerb(SP_VERB_OBJECT_FLIP_VERTICAL, "ObjectFlipVertically",
2140                    N_("Flip _Vertical"), N_("Flip selected objects vertically"),
2141                    "object_flip_ver"),
2142     new ObjectVerb(SP_VERB_OBJECT_SET_MASK, "ObjectSetMask", N_("_Set"),
2143                  N_("Apply mask to selection (using the topmost object as mask)"), NULL),
2144     new ObjectVerb(SP_VERB_OBJECT_UNSET_MASK, "ObjectUnSetMask", N_("_Release"),
2145                  N_("Remove mask from selection"), NULL),
2146     new ObjectVerb(SP_VERB_OBJECT_SET_CLIPPATH, "ObjectSetClipPath", N_("_Set"),
2147                  N_("Apply clipping path to selection (using the topmost object as clipping path)"), NULL),
2148     new ObjectVerb(SP_VERB_OBJECT_UNSET_CLIPPATH, "ObjectUnSetClipPath", N_("_Release"),
2149                  N_("Remove clipping path from selection"), NULL),
2151     /* Tools */
2152     new ContextVerb(SP_VERB_CONTEXT_SELECT, "ToolSelector", N_("Select"),
2153                     N_("Select and transform objects"), "draw_select"),
2154     new ContextVerb(SP_VERB_CONTEXT_NODE, "ToolNode", N_("Node Edit"),
2155                     N_("Edit path nodes or control handles"), "draw_node"),
2156     new ContextVerb(SP_VERB_CONTEXT_RECT, "ToolRect", N_("Rectangle"),
2157                     N_("Create rectangles and squares"), "draw_rect"),
2158     new ContextVerb(SP_VERB_CONTEXT_ARC, "ToolArc", N_("Ellipse"),
2159                     N_("Create circles, ellipses, and arcs"), "draw_arc"),
2160     new ContextVerb(SP_VERB_CONTEXT_STAR, "ToolStar", N_("Star"),
2161                     N_("Create stars and polygons"), "draw_star"),
2162     new ContextVerb(SP_VERB_CONTEXT_SPIRAL, "ToolSpiral", N_("Spiral"),
2163                     N_("Create spirals"), "draw_spiral"),
2164     new ContextVerb(SP_VERB_CONTEXT_PENCIL, "ToolPencil", N_("Pencil"),
2165                     N_("Draw freehand lines"), "draw_freehand"),
2166     new ContextVerb(SP_VERB_CONTEXT_PEN, "ToolPen", N_("Pen"),
2167                     N_("Draw Bezier curves and straight lines"), "draw_pen"),
2168     new ContextVerb(SP_VERB_CONTEXT_CALLIGRAPHIC, "ToolCalligrphic", N_("Calligraphy"),
2169                     N_("Draw calligraphic lines"), "draw_calligraphic"),
2170     new ContextVerb(SP_VERB_CONTEXT_TEXT, "ToolText", N_("Text"),
2171                     N_("Create and edit text objects"), "draw_text"),
2172     new ContextVerb(SP_VERB_CONTEXT_GRADIENT, "ToolGradient", N_("Gradient"),
2173                     N_("Create and edit gradients"), "draw_gradient"),
2174     new ContextVerb(SP_VERB_CONTEXT_ZOOM, "ToolZoom", N_("Zoom"),
2175                     N_("Zoom in or out"), "draw_zoom"),
2176     new ContextVerb(SP_VERB_CONTEXT_DROPPER, "ToolDropper", N_("Dropper"),
2177                     N_("Pick averaged colors from image"), "draw_dropper"),
2178     new ContextVerb(SP_VERB_CONTEXT_CONNECTOR, "ToolConnector", N_("Connector"),
2179                     N_("Create connectors"), "draw_connector"),
2181     /* Tool prefs */
2182     new ContextVerb(SP_VERB_CONTEXT_SELECT_PREFS, "SelectPrefs", N_("Selector Preferences"),
2183                     N_("Open Preferences for the Selector tool"), NULL),
2184     new ContextVerb(SP_VERB_CONTEXT_NODE_PREFS, "NodePrefs", N_("Node Tool Preferences"),
2185                     N_("Open Preferences for the Node tool"), NULL),
2186     new ContextVerb(SP_VERB_CONTEXT_RECT_PREFS, "RectPrefs", N_("Rectangle Preferences"),
2187                     N_("Open Preferences for the Rectangle tool"), NULL),
2188     new ContextVerb(SP_VERB_CONTEXT_ARC_PREFS, "ArcPrefs", N_("Ellipse Preferences"),
2189                     N_("Open Preferences for the Ellipse tool"), NULL),
2190     new ContextVerb(SP_VERB_CONTEXT_STAR_PREFS, "StarPrefs", N_("Star Preferences"),
2191                     N_("Open Preferences for the Star tool"), NULL),
2192     new ContextVerb(SP_VERB_CONTEXT_SPIRAL_PREFS, "SpiralPrefs", N_("Spiral Preferences"),
2193                     N_("Open Preferences for the Spiral tool"), NULL),
2194     new ContextVerb(SP_VERB_CONTEXT_PENCIL_PREFS, "PencilPrefs", N_("Pencil Preferences"),
2195                     N_("Open Preferences for the Pencil tool"), NULL),
2196     new ContextVerb(SP_VERB_CONTEXT_PEN_PREFS, "PenPrefs", N_("Pen Preferences"),
2197                     N_("Open Preferences for the Pen tool"), NULL),
2198     new ContextVerb(SP_VERB_CONTEXT_CALLIGRAPHIC_PREFS, "CalligraphicPrefs", N_("Calligraphic Preferences"),
2199                     N_("Open Preferences for the Calligraphy tool"), NULL),
2200     new ContextVerb(SP_VERB_CONTEXT_TEXT_PREFS, "TextPrefs", N_("Text Preferences"),
2201                     N_("Open Preferences for the Text tool"), NULL),
2202     new ContextVerb(SP_VERB_CONTEXT_GRADIENT_PREFS, "GradientPrefs", N_("Gradient Preferences"),
2203                     N_("Open Preferences for the Gradient tool"), NULL),
2204     new ContextVerb(SP_VERB_CONTEXT_ZOOM_PREFS, "ZoomPrefs", N_("Zoom Preferences"),
2205                     N_("Open Preferences for the Zoom tool"), NULL),
2206     new ContextVerb(SP_VERB_CONTEXT_DROPPER_PREFS, "DropperPrefs", N_("Dropper Preferences"),
2207                     N_("Open Preferences for the Dropper tool"), NULL),
2208     new ContextVerb(SP_VERB_CONTEXT_CONNECTOR_PREFS, "ConnectorPrefs", N_("Connector Preferences"),
2209                     N_("Open Preferences for the Connector tool"), NULL),
2211     /* Zoom/View */
2212     new ZoomVerb(SP_VERB_ZOOM_IN, "ZoomIn", N_("Zoom In"), N_("Zoom in"), "zoom_in"),
2213     new ZoomVerb(SP_VERB_ZOOM_OUT, "ZoomOut", N_("Zoom Out"), N_("Zoom out"), "zoom_out"),
2214     new ZoomVerb(SP_VERB_TOGGLE_RULERS, "ToggleRulers", N_("_Rulers"), N_("Show or hide the canvas rulers"), "rulers"),
2215     new ZoomVerb(SP_VERB_TOGGLE_SCROLLBARS, "ToggleScrollbars", N_("Scroll_bars"), N_("Show or hide the canvas scrollbars"), "scrollbars"),
2216     new ZoomVerb(SP_VERB_TOGGLE_GRID, "ToggleGrid", N_("_Grid"), N_("Show or hide the grid"), "grid"),
2217     new ZoomVerb(SP_VERB_TOGGLE_GUIDES, "ToggleGuides", N_("G_uides"), N_("Show or hide guides (drag from a ruler to create a guide)"), "guides"),
2218     new ZoomVerb(SP_VERB_ZOOM_NEXT, "ZoomNext", N_("Nex_t Zoom"), N_("Next zoom (from the history of zooms)"),
2219                  "zoom_next"),
2220     new ZoomVerb(SP_VERB_ZOOM_PREV, "ZoomPrev", N_("Pre_vious Zoom"), N_("Previous zoom (from the history of zooms)"),
2221                  "zoom_previous"),
2222     new ZoomVerb(SP_VERB_ZOOM_1_1, "Zoom1:0", N_("Zoom 1:_1"), N_("Zoom to 1:1"),
2223                  "zoom_1_to_1"),
2224     new ZoomVerb(SP_VERB_ZOOM_1_2, "Zoom1:2", N_("Zoom 1:_2"), N_("Zoom to 1:2"),
2225                  "zoom_1_to_2"),
2226     new ZoomVerb(SP_VERB_ZOOM_2_1, "Zoom2:1", N_("_Zoom 2:1"), N_("Zoom to 2:1"),
2227                  "zoom_2_to_1"),
2228 #ifdef HAVE_GTK_WINDOW_FULLSCREEN
2229     new ZoomVerb(SP_VERB_FULLSCREEN, "FullScreen", N_("_Fullscreen"), N_("Stretch this document window to full screen"),
2230                  "fullscreen"),
2231 #endif /* HAVE_GTK_WINDOW_FULLSCREEN */
2232     new ZoomVerb(SP_VERB_VIEW_NEW, "ViewNew", N_("Duplic_ate Window"), N_("Open a new window with the same document"),
2233                  "view_new"),
2234     new ZoomVerb(SP_VERB_VIEW_NEW_PREVIEW, "ViewNewPreview", N_("_New View Preview"),
2235                  N_("New View Preview"), NULL/*"view_new_preview"*/),
2237     new ZoomVerb(SP_VERB_VIEW_MODE_NORMAL, "ViewModeNormal", N_("_Normal"),
2238                  N_("Switch to normal display mode"), NULL),
2239     new ZoomVerb(SP_VERB_VIEW_MODE_OUTLINE, "ViewModeOutline", N_("_Outline"),
2240                  N_("Switch to outline (wireframe) display mode"), NULL),
2242     new ZoomVerb(SP_VERB_VIEW_ICON_PREVIEW, "ViewIconPreview", N_("Ico_n Preview"),
2243                  N_("Open a window to preview objects at different icon resolutions"), NULL/*"view_icon_preview"*/),
2244     new ZoomVerb(SP_VERB_ZOOM_PAGE, "ZoomPage", N_("_Page"),
2245                  N_("Zoom to fit page in window"), "zoom_page"),
2246     new ZoomVerb(SP_VERB_ZOOM_PAGE_WIDTH, "ZoomPageWidth", N_("Page _Width"),
2247                  N_("Zoom to fit page width in window"), "zoom_pagewidth"),
2248     new ZoomVerb(SP_VERB_ZOOM_DRAWING, "ZoomDrawing", N_("_Drawing"),
2249                  N_("Zoom to fit drawing in window"), "zoom_draw"),
2250     new ZoomVerb(SP_VERB_ZOOM_SELECTION, "ZoomSelection", N_("_Selection"),
2251                  N_("Zoom to fit selection in window"), "zoom_select"),
2253     /* Dialogs */
2254     new DialogVerb(SP_VERB_DIALOG_DISPLAY, "DialogPreferences", N_("In_kscape Preferences..."),
2255                    N_("Edit global Inkscape preferences"), GTK_STOCK_PREFERENCES ),
2256     new DialogVerb(SP_VERB_DIALOG_NAMEDVIEW, "DialogDocumentProperties", N_("_Document Properties..."),
2257                    N_("Edit properties of this document (to be saved with the document)"), GTK_STOCK_PROPERTIES ),
2258     new DialogVerb(SP_VERB_DIALOG_METADATA, "DialogMetadata", N_("Document _Metadata..."),
2259                    N_("Edit document metadata (to be saved with the document)"), NULL ),
2260     new DialogVerb(SP_VERB_DIALOG_FILL_STROKE, "DialogFillStroke", N_("_Fill and Stroke..."),
2261                    N_("Edit objects' style, such as color or stroke width"), "fill_and_stroke"),
2262     // TRANSLATORS: "Swatches" means: color samples
2263     new DialogVerb(SP_VERB_DIALOG_SWATCHES, "DialogSwatches", N_("S_watches..."),
2264                    N_("Select colors from a swatches palette"), GTK_STOCK_SELECT_COLOR),
2265     new DialogVerb(SP_VERB_DIALOG_TRANSFORM, "DialogTransform", N_("Transfor_m..."),
2266                    N_("Precisely control objects' transformations"), "object_trans"),
2267     new DialogVerb(SP_VERB_DIALOG_ALIGN_DISTRIBUTE, "DialogAlignDistribute", N_("_Align and Distribute..."),
2268                    N_("Align and distribute objects"), "object_align"),
2269     new DialogVerb(SP_VERB_DIALOG_UNDO_HISTORY, "DialogUndoHistory", N_("Undo _History..."),
2270                    N_("Undo History"), "edit_undo_history"),
2271     new DialogVerb(SP_VERB_DIALOG_TEXT, "DialogText", N_("_Text and Font..."),
2272                    N_("View and select font family, font size and other text properties"), "object_font"),
2273     new DialogVerb(SP_VERB_DIALOG_XML_EDITOR, "DialogXMLEditor", N_("_XML Editor..."),
2274                    N_("View and edit the XML tree of the document"), "xml_editor"),
2275     new DialogVerb(SP_VERB_DIALOG_FIND, "DialogFind", N_("_Find..."),
2276                    N_("Find objects in document"), GTK_STOCK_FIND ),
2277     new DialogVerb(SP_VERB_DIALOG_DEBUG, "DialogDebug", N_("_Messages..."),
2278                    N_("View debug messages"), NULL),
2279     new DialogVerb(SP_VERB_DIALOG_SCRIPT, "DialogScript", N_("S_cripts..."),
2280                    N_("Run scripts"), NULL),
2281     new DialogVerb(SP_VERB_DIALOG_TOGGLE, "DialogsToggle", N_("Show/Hide D_ialogs"),
2282                    N_("Show or hide all open dialogs"), "dialog_toggle"),
2283     // TRANSLATORS: "Tile Clones" means: "Create tiled clones"
2284     new DialogVerb(SP_VERB_DIALOG_CLONETILER, "DialogClonetiler", N_("Create Tiled Clones..."),
2285                    N_("Create multiple clones of selected object, arranging them into a pattern or scattering"), NULL),
2286     new DialogVerb(SP_VERB_DIALOG_ITEM, "DialogObjectProperties", N_("_Object Properties..."),
2287                    N_("Edit the ID, locked and visible status, and other object properties"), "dialog_item_properties"),
2288 #ifdef WITH_INKBOARD
2289     new DialogVerb(SP_VERB_XMPP_CLIENT, "DialogXmppClient",
2290                    N_("_Instant Messaging..."), N_("Jabber Instant Messaging Client"), NULL),
2291 #endif
2292     new DialogVerb(SP_VERB_DIALOG_INPUT, "DialogInput", N_("_Input Devices..."),
2293                    N_("Configure extended input devices, such as a graphics tablet"), NULL),
2294     new DialogVerb(SP_VERB_DIALOG_EXTENSIONEDITOR, "org.inkscape.dialogs.extensioneditor", N_("_Extensions..."),
2295                    N_("Query information about extensions"), NULL),
2296     new DialogVerb(SP_VERB_DIALOG_LAYERS, "DialogLayers", N_("Layer_s..."),
2297                    N_("View Layers"), NULL),
2299     /* Help */
2300     new HelpVerb(SP_VERB_HELP_KEYS, "HelpKeys", N_("_Keys and Mouse"),
2301                  N_("Keys and mouse shortcuts reference"), "help_keys"),
2302     new HelpVerb(SP_VERB_HELP_ABOUT_EXTENSIONS, "HelpAboutExtensions", N_("About E_xtensions"),
2303                  N_("Information on Inkscape extensions"), NULL),
2304     new HelpVerb(SP_VERB_HELP_MEMORY, "HelpAboutMemory", N_("About _Memory"),
2305                  N_("Memory usage information"), NULL),
2306     new HelpVerb(SP_VERB_HELP_ABOUT, "HelpAbout", N_("_About Inkscape"),
2307                  N_("Inkscape version, authors, license"), /*"help_about"*/"inkscape_options"),
2308     //new HelpVerb(SP_VERB_SHOW_LICENSE, "ShowLicense", N_("_License"),
2309     //           N_("Distribution terms"), /*"show_license"*/"inkscape_options"),
2311     /* Tutorials */
2312     new TutorialVerb(SP_VERB_TUTORIAL_BASIC, "TutorialsBasic", N_("Inkscape: _Basic"),
2313                      N_("Getting started with Inkscape"), NULL/*"tutorial_basic"*/),
2314     new TutorialVerb(SP_VERB_TUTORIAL_SHAPES, "TutorialsShapes", N_("Inkscape: _Shapes"),
2315                      N_("Using shape tools to create and edit shapes"), NULL),
2316     new TutorialVerb(SP_VERB_TUTORIAL_ADVANCED, "TutorialsAdvanced", N_("Inkscape: _Advanced"),
2317                      N_("Advanced Inkscape topics"), NULL/*"tutorial_advanced"*/),
2318     // TRANSLATORS: "to trace" means "to convert a bitmap to vector graphics" (to vectorize)
2319     new TutorialVerb(SP_VERB_TUTORIAL_TRACING, "TutorialsTracing", N_("Inkscape: T_racing"),
2320                      N_("Using bitmap tracing"), NULL/*"tutorial_tracing"*/),
2321     new TutorialVerb(SP_VERB_TUTORIAL_CALLIGRAPHY, "TutorialsCalligraphy", N_("Inkscape: _Calligraphy"),
2322                      N_("Using the Calligraphy pen tool"), NULL),
2323     new TutorialVerb(SP_VERB_TUTORIAL_DESIGN, "TutorialsDesign", N_("_Elements of Design"),
2324                      N_("Principles of design in the tutorial form"), NULL/*"tutorial_design"*/),
2325     new TutorialVerb(SP_VERB_TUTORIAL_TIPS, "TutorialsTips", N_("_Tips and Tricks"),
2326                      N_("Miscellaneous tips and tricks"), NULL/*"tutorial_tips"*/),
2328     /* Effect */
2329     new EffectLastVerb(SP_VERB_EFFECT_LAST, "EffectLast", N_("Previous Effect"),
2330                        N_("Repeat the last effect with the same settings"), NULL),
2331     new EffectLastVerb(SP_VERB_EFFECT_LAST_PREF, "EffectLastPref", N_("Previous Effect Settings..."),
2332                        N_("Repeat the last effect with new settings"), NULL),
2334     /* Fit Page */
2335     new FitCanvasVerb(SP_VERB_FIT_CANVAS_TO_SELECTION, "FitCanvasToSelection", N_("Fit Page to Selection"),
2336                        N_("Fit the page to the current selection"), NULL),
2337     new FitCanvasVerb(SP_VERB_FIT_CANVAS_TO_DRAWING, "FitCanvasToDrawing", N_("Fit Page to Drawing"),
2338                        N_("Fit the page to the drawing"), NULL),
2339     new FitCanvasVerb(SP_VERB_FIT_CANVAS_TO_SELECTION_OR_DRAWING, "FitCanvasToSelectionOrDrawing", N_("Fit Page to Selection or Drawing"),
2340                        N_("Fit the page to the current selection or the drawing if there is no selection"), NULL),
2341     /* Footer */
2342     new Verb(SP_VERB_LAST, " '\"invalid id", NULL, NULL, NULL)
2343 };
2346 }  /* namespace Inkscape */
2348 /*
2349   Local Variables:
2350   mode:c++
2351   c-file-style:"stroustrup"
2352   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
2353   indent-tabs-mode:nil
2354   fill-column:99
2355   End:
2356 */
2357 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :