Code

forced redraw of canvas upon completion of zooming or upon starting rubber band selec...
[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                 Glib::ustring description = "";
1151                 switch (verb) {
1152                     case SP_VERB_LAYER_TO_TOP:
1153                         message = g_strdup_printf(_("Raised layer <b>%s</b>."), layer->defaultLabel());
1154                         description = _("Layer to Top");
1155                         break;
1156                     case SP_VERB_LAYER_RAISE:
1157                         message = g_strdup_printf(_("Raised layer <b>%s</b>."), layer->defaultLabel());
1158                         description = _("Raise Layer");
1159                         break;
1160                     case SP_VERB_LAYER_TO_BOTTOM:
1161                         message = g_strdup_printf(_("Lowered layer <b>%s</b>."), layer->defaultLabel());
1162                         description = _("Layer to Bottom");
1163                         break;
1164                     case SP_VERB_LAYER_LOWER:
1165                         message = g_strdup_printf(_("Lowered layer <b>%s</b>."), layer->defaultLabel());
1166                         description = _("Lower Layer");
1167                         break;
1168                 };
1169                 sp_document_done(sp_desktop_document(dt), verb, description);
1170                 if (message) {
1171                     dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, message);
1172                     g_free((void *) message);
1173                 }
1174             } else {
1175                 dt->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Cannot move layer any further."));
1176             }
1178             break;
1179         }
1180         case SP_VERB_LAYER_DELETE: {
1181             if ( dt->currentLayer() != dt->currentRoot() ) {
1182                 sp_desktop_selection(dt)->clear();
1183                 SPObject *old_layer=dt->currentLayer();
1185                 sp_object_ref(old_layer, NULL);
1186                 SPObject *survivor=Inkscape::next_layer(dt->currentRoot(), old_layer);
1187                 if (!survivor) {
1188                     survivor = Inkscape::previous_layer(dt->currentRoot(), old_layer);
1189                 }
1191                 /* Deleting the old layer before switching layers is a hack to trigger the
1192                  * listeners of the deletion event (as happens when old_layer is deleted using the
1193                  * xml editor).  See
1194                  * http://sourceforge.net/tracker/index.php?func=detail&aid=1339397&group_id=93438&atid=604306
1195                  */
1196                 old_layer->deleteObject();
1197                 sp_object_unref(old_layer, NULL);
1198                 if (survivor) {
1199                     dt->setCurrentLayer(survivor);
1200                 }
1202                 sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_DELETE, 
1203                                  _("Delete layer"));
1205                 // TRANSLATORS: this means "The layer has been deleted."
1206                 dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Deleted layer."));
1207             } else {
1208                 dt->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No current layer."));
1209             }
1210             break;
1211         }
1212     }
1214     return;
1215 } // end of sp_verb_action_layer_perform()
1217 /** \brief  Decode the verb code and take appropriate action */
1218 void
1219 ObjectVerb::perform( SPAction *action, void *data, void *pdata )
1221     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1222     if (!dt)
1223         return;
1225     SPEventContext *ec = dt->event_context;
1227     Inkscape::Selection *sel = sp_desktop_selection(dt);
1229     if (sel->isEmpty())
1230         return;
1232     NR::Point const center(sel->bounds().midpoint());
1234     switch (reinterpret_cast<std::size_t>(data)) {
1235         case SP_VERB_OBJECT_ROTATE_90_CW:
1236             sp_selection_rotate_90_cw();
1237             break;
1238         case SP_VERB_OBJECT_ROTATE_90_CCW:
1239             sp_selection_rotate_90_ccw();
1240             break;
1241         case SP_VERB_OBJECT_FLATTEN:
1242             sp_selection_remove_transform();
1243             break;
1244         case SP_VERB_OBJECT_TO_CURVE:
1245             sp_selected_path_to_curves();
1246             break;
1247         case SP_VERB_OBJECT_FLOW_TEXT:
1248             text_flow_into_shape();
1249             break;
1250         case SP_VERB_OBJECT_UNFLOW_TEXT:
1251             text_unflow();
1252             break;
1253         case SP_VERB_OBJECT_FLOWTEXT_TO_TEXT:
1254             SPFlowtext::convert_to_text();
1255             break;
1256         case SP_VERB_OBJECT_FLIP_HORIZONTAL:
1257             if (tools_isactive(dt, TOOLS_NODES)) {
1258                 sp_nodepath_flip(SP_NODE_CONTEXT(ec)->nodepath, NR::X);
1259             } else {
1260                 sp_selection_scale_relative(sel, center, NR::scale(-1.0, 1.0));
1261             }
1262             sp_document_done(sp_desktop_document(dt), SP_VERB_OBJECT_FLIP_HORIZONTAL,
1263                              _("Flip horizontally"));
1264             break;
1265         case SP_VERB_OBJECT_FLIP_VERTICAL:
1266             if (tools_isactive(dt, TOOLS_NODES)) {
1267                 sp_nodepath_flip(SP_NODE_CONTEXT(ec)->nodepath, NR::Y);
1268             } else {
1269                 sp_selection_scale_relative(sel, center, NR::scale(1.0, -1.0));
1270             }
1271             sp_document_done(sp_desktop_document(dt), SP_VERB_OBJECT_FLIP_VERTICAL,
1272                              _("Flip vertically"));
1273             break;
1274         case SP_VERB_OBJECT_SET_MASK:
1275             sp_selection_set_mask(false, false);
1276             break;
1277         case SP_VERB_OBJECT_UNSET_MASK:
1278             sp_selection_unset_mask(false);
1279             break;
1280         case SP_VERB_OBJECT_SET_CLIPPATH:
1281             sp_selection_set_mask(true, false);
1282             break;
1283         case SP_VERB_OBJECT_UNSET_CLIPPATH:
1284             sp_selection_unset_mask(true);
1285             break;
1286         default:
1287             break;
1288     }
1290 } // end of sp_verb_action_object_perform()
1292 /** \brief  Decode the verb code and take appropriate action */
1293 void
1294 ContextVerb::perform(SPAction *action, void *data, void *pdata)
1296     SPDesktop *dt;
1297     sp_verb_t verb;
1298     int vidx;
1300     dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1302     if (!dt)
1303         return;
1305     verb = (sp_verb_t)GPOINTER_TO_INT((gpointer)data);
1307     /** \todo !!! hopefully this can go away soon and actions can look after
1308      * themselves
1309      */
1310     for (vidx = SP_VERB_CONTEXT_SELECT; vidx <= SP_VERB_CONTEXT_DROPPER_PREFS; vidx++)
1311     {
1312         SPAction *tool_action= get((sp_verb_t)vidx)->get_action(dt);
1313         if (tool_action) {
1314             sp_action_set_active(tool_action, vidx == (int)verb);
1315         }
1316     }
1318     switch (verb) {
1319         case SP_VERB_CONTEXT_SELECT:
1320             tools_switch_current(TOOLS_SELECT);
1321             break;
1322         case SP_VERB_CONTEXT_NODE:
1323             tools_switch_current(TOOLS_NODES);
1324             break;
1325         case SP_VERB_CONTEXT_RECT:
1326             tools_switch_current(TOOLS_SHAPES_RECT);
1327             break;
1328         case SP_VERB_CONTEXT_ARC:
1329             tools_switch_current(TOOLS_SHAPES_ARC);
1330             break;
1331         case SP_VERB_CONTEXT_STAR:
1332             tools_switch_current(TOOLS_SHAPES_STAR);
1333             break;
1334         case SP_VERB_CONTEXT_SPIRAL:
1335             tools_switch_current(TOOLS_SHAPES_SPIRAL);
1336             break;
1337         case SP_VERB_CONTEXT_PENCIL:
1338             tools_switch_current(TOOLS_FREEHAND_PENCIL);
1339             break;
1340         case SP_VERB_CONTEXT_PEN:
1341             tools_switch_current(TOOLS_FREEHAND_PEN);
1342             break;
1343         case SP_VERB_CONTEXT_CALLIGRAPHIC:
1344             tools_switch_current(TOOLS_CALLIGRAPHIC);
1345             break;
1346         case SP_VERB_CONTEXT_TEXT:
1347             tools_switch_current(TOOLS_TEXT);
1348             break;
1349         case SP_VERB_CONTEXT_GRADIENT:
1350             tools_switch_current(TOOLS_GRADIENT);
1351             break;
1352         case SP_VERB_CONTEXT_ZOOM:
1353             tools_switch_current(TOOLS_ZOOM);
1354             break;
1355         case SP_VERB_CONTEXT_DROPPER:
1356             tools_switch_current(TOOLS_DROPPER);
1357             break;
1358         case SP_VERB_CONTEXT_CONNECTOR:
1359             tools_switch_current (TOOLS_CONNECTOR);
1360             break;
1362         case SP_VERB_CONTEXT_SELECT_PREFS:
1363             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_SELECTOR);
1364             dt->_dlg_mgr->showDialog("InkscapePreferences");
1365             break;
1366         case SP_VERB_CONTEXT_NODE_PREFS:
1367             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_NODE);
1368             dt->_dlg_mgr->showDialog("InkscapePreferences");
1369             break;
1370         case SP_VERB_CONTEXT_RECT_PREFS:
1371             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_SHAPES_RECT);
1372             dt->_dlg_mgr->showDialog("InkscapePreferences");
1373             break;
1374         case SP_VERB_CONTEXT_ARC_PREFS:
1375             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_SHAPES_ELLIPSE);
1376             dt->_dlg_mgr->showDialog("InkscapePreferences");
1377             break;
1378         case SP_VERB_CONTEXT_STAR_PREFS:
1379             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_SHAPES_STAR);
1380             dt->_dlg_mgr->showDialog("InkscapePreferences");
1381             break;
1382         case SP_VERB_CONTEXT_SPIRAL_PREFS:
1383             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_SHAPES_SPIRAL);
1384             dt->_dlg_mgr->showDialog("InkscapePreferences");
1385             break;
1386         case SP_VERB_CONTEXT_PENCIL_PREFS:
1387             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_PENCIL);
1388             dt->_dlg_mgr->showDialog("InkscapePreferences");
1389             break;
1390         case SP_VERB_CONTEXT_PEN_PREFS:
1391             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_PEN);
1392             dt->_dlg_mgr->showDialog("InkscapePreferences");
1393             break;
1394         case SP_VERB_CONTEXT_CALLIGRAPHIC_PREFS:
1395             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_CALLIGRAPHY);
1396             dt->_dlg_mgr->showDialog("InkscapePreferences");
1397             break;
1398         case SP_VERB_CONTEXT_TEXT_PREFS:
1399             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_TEXT);
1400             dt->_dlg_mgr->showDialog("InkscapePreferences");
1401             break;
1402         case SP_VERB_CONTEXT_GRADIENT_PREFS:
1403             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_GRADIENT);
1404             dt->_dlg_mgr->showDialog("InkscapePreferences");
1405             break;
1406         case SP_VERB_CONTEXT_ZOOM_PREFS:
1407             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_ZOOM);
1408             dt->_dlg_mgr->showDialog("InkscapePreferences");
1409             break;
1410         case SP_VERB_CONTEXT_DROPPER_PREFS:
1411             prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_DROPPER);
1412             dt->_dlg_mgr->showDialog("InkscapePreferences");
1413             break;
1414         case SP_VERB_CONTEXT_CONNECTOR_PREFS:
1415             prefs_set_int_attribute ("dialogs.preferences", "page", PREFS_PAGE_TOOLS_CONNECTOR);
1416             dt->_dlg_mgr->showDialog("InkscapePreferences");
1417             break;
1419         default:
1420             break;
1421     }
1423 } // end of sp_verb_action_ctx_perform()
1425 /** \brief  Decode the verb code and take appropriate action */
1426 void
1427 TextVerb::perform(SPAction *action, void *data, void *pdata)
1429     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1430     if (!dt)
1431         return;
1433     SPDocument *doc = sp_desktop_document(dt);
1434     (void)doc;
1435     Inkscape::XML::Node *repr = SP_OBJECT_REPR(dt->namedview);
1436     (void)repr;
1438  
1439 /** \brief  Decode the verb code and take appropriate action */
1440 void
1441 ZoomVerb::perform(SPAction *action, void *data, void *pdata)
1443     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1444     if (!dt)
1445         return;
1447     SPDocument *doc = sp_desktop_document(dt);
1449     Inkscape::XML::Node *repr = SP_OBJECT_REPR(dt->namedview);
1451     gdouble zoom_inc =
1452         prefs_get_double_attribute_limited( "options.zoomincrement",
1453                                             "value", 1.414213562, 1.01, 10 );
1455     switch (GPOINTER_TO_INT(data)) {
1456         case SP_VERB_ZOOM_IN:
1457         {
1458             NR::Rect const d = dt->get_display_area();
1459             dt->zoom_relative( d.midpoint()[NR::X], d.midpoint()[NR::Y], zoom_inc);
1460             break;
1461         }
1462         case SP_VERB_ZOOM_OUT:
1463         {
1464             NR::Rect const d = dt->get_display_area();
1465             dt->zoom_relative( d.midpoint()[NR::X], d.midpoint()[NR::Y], 1 / zoom_inc );
1466             break;
1467         }
1468         case SP_VERB_ZOOM_1_1:
1469         {
1470             NR::Rect const d = dt->get_display_area();
1471             dt->zoom_absolute( d.midpoint()[NR::X], d.midpoint()[NR::Y], 1.0 );
1472             break;
1473         }
1474         case SP_VERB_ZOOM_1_2:
1475         {
1476             NR::Rect const d = dt->get_display_area();
1477             dt->zoom_absolute( d.midpoint()[NR::X], d.midpoint()[NR::Y], 0.5);
1478             break;
1479         }
1480         case SP_VERB_ZOOM_2_1:
1481         {
1482             NR::Rect const d = dt->get_display_area();
1483             dt->zoom_absolute( d.midpoint()[NR::X], d.midpoint()[NR::Y], 2.0 );
1484             break;
1485         }
1486         case SP_VERB_ZOOM_PAGE:
1487             dt->zoom_page();
1488             break;
1489         case SP_VERB_ZOOM_PAGE_WIDTH:
1490             dt->zoom_page_width();
1491             break;
1492         case SP_VERB_ZOOM_DRAWING:
1493             dt->zoom_drawing();
1494             break;
1495         case SP_VERB_ZOOM_SELECTION:
1496             dt->zoom_selection();
1497             break;
1498         case SP_VERB_ZOOM_NEXT:
1499             dt->next_zoom();
1500             break;
1501         case SP_VERB_ZOOM_PREV:
1502             dt->prev_zoom();
1503             break;
1504         case SP_VERB_TOGGLE_RULERS:
1505             dt->toggleRulers();
1506             break;
1507         case SP_VERB_TOGGLE_SCROLLBARS:
1508             dt->toggleScrollbars();
1509             break;
1510         case SP_VERB_TOGGLE_GUIDES:
1511             sp_namedview_toggle_guides(doc, repr);
1512             break;
1513         case SP_VERB_TOGGLE_GRID:
1514             sp_namedview_toggle_grid(doc, repr);
1515             break;
1516 #ifdef HAVE_GTK_WINDOW_FULLSCREEN
1517         case SP_VERB_FULLSCREEN:
1518             dt->fullscreen();
1519             break;
1520 #endif /* HAVE_GTK_WINDOW_FULLSCREEN */
1521         case SP_VERB_VIEW_NEW:
1522             sp_ui_new_view();
1523             break;
1524         case SP_VERB_VIEW_NEW_PREVIEW:
1525             sp_ui_new_view_preview();
1526             break;
1527         case SP_VERB_VIEW_MODE_NORMAL:
1528             dt->setDisplayModeNormal();
1529             break;
1530         case SP_VERB_VIEW_MODE_OUTLINE:
1531             dt->setDisplayModeOutline();
1532             break;
1533         case SP_VERB_VIEW_ICON_PREVIEW:
1534             show_panel( Inkscape::UI::Dialogs::IconPreviewPanel::getInstance(), "dialogs.iconpreview", SP_VERB_VIEW_ICON_PREVIEW );
1535             break;
1536         default:
1537             break;
1538     }
1539     
1540     dt->updateNow();
1542 } // end of sp_verb_action_zoom_perform()
1544 /** \brief  Decode the verb code and take appropriate action */
1545 void
1546 DialogVerb::perform(SPAction *action, void *data, void *pdata)
1548     if (reinterpret_cast<std::size_t>(data) != SP_VERB_DIALOG_TOGGLE) {
1549         // unhide all when opening a new dialog
1550         inkscape_dialogs_unhide();
1551     }
1553     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1554     g_assert(dt->_dlg_mgr != NULL);
1556     switch (reinterpret_cast<std::size_t>(data)) {
1557         case SP_VERB_DIALOG_DISPLAY:
1558             //sp_display_dialog();
1559             dt->_dlg_mgr->showDialog("InkscapePreferences");
1560             break;
1561         case SP_VERB_DIALOG_METADATA:
1562             // sp_desktop_dialog();
1563             dt->_dlg_mgr->showDialog("DocumentMetadata");
1564             break;
1565         case SP_VERB_DIALOG_NAMEDVIEW:
1566             // sp_desktop_dialog();
1567             dt->_dlg_mgr->showDialog("DocumentProperties");
1568             break;
1569         case SP_VERB_DIALOG_FILL_STROKE:
1570             sp_object_properties_dialog();
1571             break;
1572         case SP_VERB_DIALOG_SWATCHES:
1573             show_panel( Inkscape::UI::Dialogs::SwatchesPanel::getInstance(), "dialogs.swatches", SP_VERB_DIALOG_SWATCHES);
1574             break;
1575         case SP_VERB_DIALOG_TRANSFORM:
1576             dt->_dlg_mgr->showDialog("Transformation");
1577             break;
1578         case SP_VERB_DIALOG_ALIGN_DISTRIBUTE:
1579             dt->_dlg_mgr->showDialog("AlignAndDistribute");
1580             break;
1581         case SP_VERB_DIALOG_TEXT:
1582             sp_text_edit_dialog();
1583             break;
1584         case SP_VERB_DIALOG_XML_EDITOR:
1585             sp_xml_tree_dialog();
1586             break;
1587         case SP_VERB_DIALOG_FIND:
1588             sp_find_dialog();
1589             break;
1590         case SP_VERB_DIALOG_DEBUG:
1591             dt->_dlg_mgr->showDialog("Messages");
1592             break;
1593         case SP_VERB_DIALOG_SCRIPT:
1594             dt->_dlg_mgr->showDialog("Script");
1595             break;
1596         case SP_VERB_DIALOG_UNDO_HISTORY:
1597             dt->_dlg_mgr->showDialog("UndoHistory");
1598             break;
1599         case SP_VERB_DIALOG_TOGGLE:
1600             inkscape_dialogs_toggle();
1601             break;
1602         case SP_VERB_DIALOG_CLONETILER:
1603             clonetiler_dialog();
1604             break;
1605         case SP_VERB_DIALOG_ITEM:
1606             sp_item_dialog();
1607             break;
1608 #ifdef WITH_INKBOARD
1609         case SP_VERB_XMPP_CLIENT:
1610                 {
1611             Inkscape::Whiteboard::SessionManager::showClient();
1612                         break;
1613                 }
1614 #endif
1615         case SP_VERB_DIALOG_INPUT:
1616             sp_input_dialog();
1617             break;
1618         case SP_VERB_DIALOG_EXTENSIONEDITOR:
1619             dt->_dlg_mgr->showDialog("ExtensionEditor");
1620             break;
1621         case SP_VERB_DIALOG_LAYERS:
1622             show_panel( Inkscape::UI::Dialogs::LayersPanel::getInstance(), "dialogs.layers", SP_VERB_DIALOG_LAYERS );
1623             break;
1624         default:
1625             break;
1626     }
1627 } // end of sp_verb_action_dialog_perform()
1629 /** \brief  Decode the verb code and take appropriate action */
1630 void
1631 HelpVerb::perform(SPAction *action, void *data, void *pdata)
1633     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1634     g_assert(dt->_dlg_mgr != NULL);
1636     switch (reinterpret_cast<std::size_t>(data)) {
1637         case SP_VERB_HELP_KEYS:
1638             /* TRANSLATORS: If you have translated the keys.svg file to your language, then
1639                translate this string as "keys.LANG.svg" (where LANG is your language code);
1640                otherwise leave as "keys.svg". */
1641             sp_help_open_screen(_("keys.svg"));
1642             break;
1643         case SP_VERB_HELP_ABOUT:
1644             sp_help_about();
1645             break;
1646         case SP_VERB_HELP_ABOUT_EXTENSIONS: {
1647             Inkscape::UI::Dialogs::ExtensionsPanel *panel = new Inkscape::UI::Dialogs::ExtensionsPanel();
1648             panel->set_full(true);
1649             show_panel( *panel, "dialogs.aboutextensions", SP_VERB_HELP_ABOUT_EXTENSIONS );
1650             break;
1651         }
1653         /*
1654         case SP_VERB_SHOW_LICENSE:
1655             // TRANSLATORS: See "tutorial-basic.svg" comment.
1656             sp_help_open_tutorial(NULL, (gpointer) _("gpl-2.svg"));
1657             break;
1658         */
1660         case SP_VERB_HELP_MEMORY:
1661             dt->_dlg_mgr->showDialog("Memory");
1662             break;
1663         default:
1664             break;
1665     }
1666 } // end of sp_verb_action_help_perform()
1668 /** \brief  Decode the verb code and take appropriate action */
1669 void
1670 TutorialVerb::perform(SPAction *action, void *data, void *pdata)
1672     switch (reinterpret_cast<std::size_t>(data)) {
1673         case SP_VERB_TUTORIAL_BASIC:
1674             /* TRANSLATORS: If you have translated the tutorial-basic.svg file to your language,
1675                then translate this string as "tutorial-basic.LANG.svg" (where LANG is your language
1676                code); otherwise leave as "tutorial-basic.svg". */
1677             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-basic.svg"));
1678             break;
1679         case SP_VERB_TUTORIAL_SHAPES:
1680             // TRANSLATORS: See "tutorial-basic.svg" comment.
1681             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-shapes.svg"));
1682             break;
1683         case SP_VERB_TUTORIAL_ADVANCED:
1684             // TRANSLATORS: See "tutorial-basic.svg" comment.
1685             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-advanced.svg"));
1686             break;
1687         case SP_VERB_TUTORIAL_TRACING:
1688             // TRANSLATORS: See "tutorial-basic.svg" comment.
1689             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-tracing.svg"));
1690             break;
1691         case SP_VERB_TUTORIAL_CALLIGRAPHY:
1692             // TRANSLATORS: See "tutorial-basic.svg" comment.
1693             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-calligraphy.svg"));
1694             break;
1695         case SP_VERB_TUTORIAL_DESIGN:
1696             // TRANSLATORS: See "tutorial-basic.svg" comment.
1697             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-elements.svg"));
1698             break;
1699         case SP_VERB_TUTORIAL_TIPS:
1700             // TRANSLATORS: See "tutorial-basic.svg" comment.
1701             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-tips.svg"));
1702             break;
1703         default:
1704             break;
1705     }
1706 } // end of sp_verb_action_tutorial_perform()
1709 /**
1710  * Action vector to define functions called if a staticly defined file verb
1711  * is called.
1712  */
1713 SPActionEventVector FileVerb::vector =
1714             {{NULL},FileVerb::perform, NULL, NULL, NULL, NULL};
1715 /**
1716  * Action vector to define functions called if a staticly defined edit verb is
1717  * called.
1718  */
1719 SPActionEventVector EditVerb::vector =
1720             {{NULL},EditVerb::perform, NULL, NULL, NULL, NULL};
1722 /**
1723  * Action vector to define functions called if a staticly defined selection
1724  * verb is called
1725  */
1726 SPActionEventVector SelectionVerb::vector =
1727             {{NULL},SelectionVerb::perform, NULL, NULL, NULL, NULL};
1729 /**
1730  * Action vector to define functions called if a staticly defined layer
1731  * verb is called
1732  */
1733 SPActionEventVector LayerVerb::vector =
1734             {{NULL}, LayerVerb::perform, NULL, NULL, NULL, NULL};
1736 /**
1737  * Action vector to define functions called if a staticly defined object
1738  * editing verb is called
1739  */
1740 SPActionEventVector ObjectVerb::vector =
1741             {{NULL},ObjectVerb::perform, NULL, NULL, NULL, NULL};
1743 /**
1744  * Action vector to define functions called if a staticly defined context
1745  * verb is called
1746  */
1747 SPActionEventVector ContextVerb::vector =
1748             {{NULL},ContextVerb::perform, NULL, NULL, NULL, NULL};
1750 /**
1751  * Action vector to define functions called if a staticly defined zoom verb
1752  * is called
1753  */
1754 SPActionEventVector ZoomVerb::vector =
1755             {{NULL},ZoomVerb::perform, NULL, NULL, NULL, NULL};
1758 /**
1759  * Action vector to define functions called if a staticly defined dialog verb
1760  * is called
1761  */
1762 SPActionEventVector DialogVerb::vector =
1763             {{NULL},DialogVerb::perform, NULL, NULL, NULL, NULL};
1765 /**
1766  * Action vector to define functions called if a staticly defined help verb
1767  * is called
1768  */
1769 SPActionEventVector HelpVerb::vector =
1770             {{NULL},HelpVerb::perform, NULL, NULL, NULL, NULL};
1772 /**
1773  * Action vector to define functions called if a staticly defined tutorial verb
1774  * is called
1775  */
1776 SPActionEventVector TutorialVerb::vector =
1777             {{NULL},TutorialVerb::perform, NULL, NULL, NULL, NULL};
1779 /**
1780  * Action vector to define functions called if a staticly defined tutorial verb
1781  * is called
1782  */
1783 SPActionEventVector TextVerb::vector =
1784             {{NULL},TextVerb::perform, NULL, NULL, NULL, NULL};
1787 /* *********** Effect Last ********** */
1789 /** \brief A class to represent the last effect issued */
1790 class EffectLastVerb : public Verb {
1791 private:
1792     static void perform(SPAction *action, void *mydata, void *otherdata);
1793     static SPActionEventVector vector;
1794 protected:
1795     virtual SPAction *make_action(Inkscape::UI::View::View *view);
1796 public:
1797     /** \brief Use the Verb initializer with the same parameters. */
1798     EffectLastVerb(unsigned int const code,
1799                    gchar const *id,
1800                    gchar const *name,
1801                    gchar const *tip,
1802                    gchar const *image) :
1803         Verb(code, id, name, tip, image)
1804     {
1805         set_default_sensitive(false);
1806     }
1807 }; /* EffectLastVerb class */
1809 /**
1810  * The vector to attach in the last effect verb.
1811  */
1812 SPActionEventVector EffectLastVerb::vector =
1813             {{NULL},EffectLastVerb::perform, NULL, NULL, NULL, NULL};
1815 /** \brief  Create an action for a \c EffectLastVerb
1816     \param  view  Which view the action should be created for
1817     \return The built action.
1819     Calls \c make_action_helper with the \c vector.
1820 */
1821 SPAction *
1822 EffectLastVerb::make_action(Inkscape::UI::View::View *view)
1824     return make_action_helper(view, &vector);
1827 /** \brief  Decode the verb code and take appropriate action */
1828 void
1829 EffectLastVerb::perform(SPAction *action, void *data, void *pdata)
1831     /* These aren't used, but are here to remind people not to use
1832        the CURRENT_DOCUMENT macros unless they really have to. */
1833     Inkscape::UI::View::View *current_view = sp_action_get_view(action);
1834     // SPDocument *current_document = SP_VIEW_DOCUMENT(current_view);
1835     Inkscape::Extension::Effect *effect = Inkscape::Extension::Effect::get_last_effect();
1837     if (effect == NULL) return;
1838     if (current_view == NULL) return;
1840     switch ((long) data) {
1841         case SP_VERB_EFFECT_LAST_PREF:
1842             if (!effect->prefs(current_view))
1843                 return;
1844             /* Note: fall through */
1845         case SP_VERB_EFFECT_LAST:
1846             effect->effect(current_view);
1847             break;
1848         default:
1849             return;
1850     }
1852     return;
1854 /* *********** End Effect Last ********** */
1856 /* *********** Fit Canvas ********** */
1858 /** \brief A class to represent the canvas fitting verbs */
1859 class FitCanvasVerb : public Verb {
1860 private:
1861     static void perform(SPAction *action, void *mydata, void *otherdata);
1862     static SPActionEventVector vector;
1863 protected:
1864     virtual SPAction *make_action(Inkscape::UI::View::View *view);
1865 public:
1866     /** \brief Use the Verb initializer with the same parameters. */
1867     FitCanvasVerb(unsigned int const code,
1868                    gchar const *id,
1869                    gchar const *name,
1870                    gchar const *tip,
1871                    gchar const *image) :
1872         Verb(code, id, name, tip, image)
1873     {
1874         set_default_sensitive(false);
1875     }
1876 }; /* FitCanvasVerb class */
1878 /**
1879  * The vector to attach in the fit canvas verb.
1880  */
1881 SPActionEventVector FitCanvasVerb::vector =
1882             {{NULL},FitCanvasVerb::perform, NULL, NULL, NULL, NULL};
1884 /** \brief  Create an action for a \c FitCanvasVerb
1885     \param  view  Which view the action should be created for
1886     \return The built action.
1888     Calls \c make_action_helper with the \c vector.
1889 */
1890 SPAction *
1891 FitCanvasVerb::make_action(Inkscape::UI::View::View *view)
1893     SPAction *action = make_action_helper(view, &vector);
1894     return action;
1897 /** \brief  Decode the verb code and take appropriate action */
1898 void
1899 FitCanvasVerb::perform(SPAction *action, void *data, void *pdata)
1901     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1902     if (!dt) return;
1903     SPDocument *doc = sp_desktop_document(dt);
1904     if (!doc) return;
1905     
1906     switch ((long) data) {
1907         case SP_VERB_FIT_CANVAS_TO_SELECTION:
1908             fit_canvas_to_selection(dt);
1909             break;
1910         case SP_VERB_FIT_CANVAS_TO_DRAWING:
1911             fit_canvas_to_drawing(doc);
1912             break;
1913         case SP_VERB_FIT_CANVAS_TO_SELECTION_OR_DRAWING:
1914             fit_canvas_to_selection_or_drawing(dt);
1915             break;
1916         default:
1917             return;
1918     }
1920     return;
1922 /* *********** End Fit Canvas ********** */
1929 /* these must be in the same order as the SP_VERB_* enum in "verbs.h" */
1930 Verb *Verb::_base_verbs[] = {
1931     /* Header */
1932     new Verb(SP_VERB_INVALID, NULL, NULL, NULL, NULL),
1933     new Verb(SP_VERB_NONE, "None", N_("None"), N_("Does nothing"), NULL),
1935     /* File */
1936     new FileVerb(SP_VERB_FILE_NEW, "FileNew", N_("Default"), N_("Create new document from the default template"),
1937                  GTK_STOCK_NEW ),
1938     new FileVerb(SP_VERB_FILE_OPEN, "FileOpen", N_("_Open..."),
1939                  N_("Open an existing document"), GTK_STOCK_OPEN ),
1940     new FileVerb(SP_VERB_FILE_REVERT, "FileRevert", N_("Re_vert"),
1941                  N_("Revert to the last saved version of document (changes will be lost)"), GTK_STOCK_REVERT_TO_SAVED ),
1942     new FileVerb(SP_VERB_FILE_SAVE, "FileSave", N_("_Save"), N_("Save document"),
1943                  GTK_STOCK_SAVE ),
1944     new FileVerb(SP_VERB_FILE_SAVE_AS, "FileSaveAs", N_("Save _As..."),
1945                  N_("Save document under a new name"), GTK_STOCK_SAVE_AS ),
1946     new FileVerb(SP_VERB_FILE_PRINT, "FilePrint", N_("_Print..."), N_("Print document"),
1947                  GTK_STOCK_PRINT ),
1948     // TRANSLATORS: "Vacuum Defs" means "Clean up defs" (so as to remove unused definitions)
1949     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"),
1950                  "file_vacuum" ),
1951     new FileVerb(SP_VERB_FILE_PRINT_DIRECT, "FilePrintDirect", N_("Print _Direct"),
1952                  N_("Print directly without prompting to a file or pipe"), NULL ),
1953     new FileVerb(SP_VERB_FILE_PRINT_PREVIEW, "FilePrintPreview", N_("Print Previe_w"),
1954                  N_("Preview document printout"), GTK_STOCK_PRINT_PREVIEW ),
1955     new FileVerb(SP_VERB_FILE_IMPORT, "FileImport", N_("_Import..."),
1956                  N_("Import a bitmap or SVG image into this document"), "file_import"),
1957     new FileVerb(SP_VERB_FILE_EXPORT, "FileExport", N_("_Export Bitmap..."),
1958                  N_("Export this document or a selection as a bitmap image"), "file_export"),
1959     new FileVerb(SP_VERB_FILE_NEXT_DESKTOP, "NextWindow", N_("N_ext Window"),
1960                  N_("Switch to the next document window"), "window_next"),
1961     new FileVerb(SP_VERB_FILE_PREV_DESKTOP, "PrevWindow", N_("P_revious Window"),
1962                  N_("Switch to the previous document window"), "window_previous"),
1963     new FileVerb(SP_VERB_FILE_CLOSE_VIEW, "FileClose", N_("_Close"),
1964                  N_("Close this document window"), GTK_STOCK_CLOSE),
1965     new FileVerb(SP_VERB_FILE_QUIT, "FileQuit", N_("_Quit"), N_("Quit Inkscape"), GTK_STOCK_QUIT),
1967     /* Edit */
1968     new EditVerb(SP_VERB_EDIT_UNDO, "EditUndo", N_("_Undo"), N_("Undo last action"),
1969                  GTK_STOCK_UNDO),
1970     new EditVerb(SP_VERB_EDIT_REDO, "EditRedo", N_("_Redo"),
1971                  N_("Do again the last undone action"), GTK_STOCK_REDO),
1972     new EditVerb(SP_VERB_EDIT_CUT, "EditCut", N_("Cu_t"),
1973                  N_("Cut selection to clipboard"), GTK_STOCK_CUT),
1974     new EditVerb(SP_VERB_EDIT_COPY, "EditCopy", N_("_Copy"),
1975                  N_("Copy selection to clipboard"), GTK_STOCK_COPY),
1976     new EditVerb(SP_VERB_EDIT_PASTE, "EditPaste", N_("_Paste"),
1977                  N_("Paste objects from clipboard to mouse point, or paste text"), GTK_STOCK_PASTE),
1978     new EditVerb(SP_VERB_EDIT_PASTE_STYLE, "EditPasteStyle", N_("Paste _Style"),
1979                  N_("Apply the style of the copied object to selection"), "selection_paste_style"),
1980     new EditVerb(SP_VERB_EDIT_PASTE_SIZE, "EditPasteSize", N_("Paste Si_ze"),
1981                  N_("Scale selection to match the size of the copied object"), NULL),
1982     new EditVerb(SP_VERB_EDIT_PASTE_SIZE_X, "EditPasteWidth", N_("Paste _Width"),
1983                  N_("Scale selection horizontally to match the width of the copied object"), NULL),
1984     new EditVerb(SP_VERB_EDIT_PASTE_SIZE_Y, "EditPasteHeight", N_("Paste _Height"),
1985                  N_("Scale selection vertically to match the height of the copied object"), NULL),
1986     new EditVerb(SP_VERB_EDIT_PASTE_SIZE_SEPARATELY, "EditPasteSizeSeparately", N_("Paste Size Separately"),
1987                  N_("Scale each selected object to match the size of the copied object"), NULL),
1988     new EditVerb(SP_VERB_EDIT_PASTE_SIZE_SEPARATELY_X, "EditPasteWidthSeparately", N_("Paste Width Separately"),
1989                  N_("Scale each selected object horizontally to match the width of the copied object"), NULL),
1990     new EditVerb(SP_VERB_EDIT_PASTE_SIZE_SEPARATELY_Y, "EditPasteHeightSeparately", N_("Paste Height Separately"),
1991                  N_("Scale each selected object vertically to match the height of the copied object"), NULL),
1992     new EditVerb(SP_VERB_EDIT_PASTE_IN_PLACE, "EditPasteInPlace", N_("Paste _In Place"),
1993                  N_("Paste objects from clipboard to the original location"), "selection_paste_in_place"),
1994     new EditVerb(SP_VERB_EDIT_DELETE, "EditDelete", N_("_Delete"),
1995                  N_("Delete selection"), GTK_STOCK_DELETE),
1996     new EditVerb(SP_VERB_EDIT_DUPLICATE, "EditDuplicate", N_("Duplic_ate"),
1997                  N_("Duplicate selected objects"), "edit_duplicate"),
1998     new EditVerb(SP_VERB_EDIT_CLONE, "EditClone", N_("Create Clo_ne"),
1999                  N_("Create a clone (a copy linked to the original) of selected object"), "edit_clone"),
2000     new EditVerb(SP_VERB_EDIT_UNLINK_CLONE, "EditUnlinkClone", N_("Unlin_k Clone"),
2001                  N_("Cut the selected clone's link to its original, turning it into a standalone object"), "edit_unlink_clone"),
2002     new EditVerb(SP_VERB_EDIT_CLONE_ORIGINAL, "EditCloneOriginal", N_("Select _Original"),
2003                  N_("Select the object to which the selected clone is linked"), NULL),
2004     // TRANSLATORS: Convert selection to a rectangle with tiled pattern fill
2005     new EditVerb(SP_VERB_EDIT_TILE, "ObjectsToPattern", N_("Objects to Patter_n"),
2006                  N_("Convert selection to a rectangle with tiled pattern fill"), NULL),
2007     // TRANSLATORS: Extract objects from a tiled pattern fill
2008     new EditVerb(SP_VERB_EDIT_UNTILE, "ObjectsFromPattern", N_("Pattern to _Objects"),
2009                  N_("Extract objects from a tiled pattern fill"), NULL),
2010     new EditVerb(SP_VERB_EDIT_CLEAR_ALL, "EditClearAll", N_("Clea_r All"),
2011                  N_("Delete all objects from document"), NULL),
2012     new EditVerb(SP_VERB_EDIT_SELECT_ALL, "EditSelectAll", N_("Select Al_l"),
2013                  N_("Select all objects or all nodes"), "selection_select_all"),
2014     new EditVerb(SP_VERB_EDIT_SELECT_ALL_IN_ALL_LAYERS, "EditSelectAllInAllLayers", N_("Select All in All La_yers"),
2015                  N_("Select all objects in all visible and unlocked layers"), NULL),
2016     new EditVerb(SP_VERB_EDIT_INVERT, "EditInvert", N_("In_vert Selection"),
2017                  N_("Invert selection (unselect what is selected and select everything else)"), NULL),
2018     new EditVerb(SP_VERB_EDIT_INVERT_IN_ALL_LAYERS, "EditInvertInAllLayers", N_("Invert in All Layers"),
2019                  N_("Invert selection in all visible and unlocked layers"), NULL),
2020     new EditVerb(SP_VERB_EDIT_DESELECT, "EditDeselect", N_("D_eselect"),
2021                  N_("Deselect any selected objects or nodes"), NULL),
2023     /* Selection */
2024     new SelectionVerb(SP_VERB_SELECTION_TO_FRONT, "SelectionToFront", N_("Raise to _Top"),
2025                       N_("Raise selection to top"), "selection_top"),
2026     new SelectionVerb(SP_VERB_SELECTION_TO_BACK, "SelectionToBack", N_("Lower to _Bottom"),
2027                       N_("Lower selection to bottom"), "selection_bot"),
2028     new SelectionVerb(SP_VERB_SELECTION_RAISE, "SelectionRaise", N_("_Raise"),
2029                       N_("Raise selection one step"), "selection_up"),
2030     new SelectionVerb(SP_VERB_SELECTION_LOWER, "SelectionLower", N_("_Lower"),
2031                       N_("Lower selection one step"), "selection_down"),
2032     new SelectionVerb(SP_VERB_SELECTION_GROUP, "SelectionGroup", N_("_Group"),
2033                       N_("Group selected objects"), "selection_group"),
2034     new SelectionVerb(SP_VERB_SELECTION_UNGROUP, "SelectionUnGroup", N_("_Ungroup"),
2035                       N_("Ungroup selected groups"), "selection_ungroup"),
2037     new SelectionVerb(SP_VERB_SELECTION_TEXTTOPATH, "SelectionTextToPath", N_("_Put on Path"),
2038                       N_("Put text on path"), NULL),
2039     new SelectionVerb(SP_VERB_SELECTION_TEXTFROMPATH, "SelectionTextFromPath", N_("_Remove from Path"),
2040                       N_("Remove text from path"), NULL),
2041     new SelectionVerb(SP_VERB_SELECTION_REMOVE_KERNS, "SelectionTextRemoveKerns", N_("Remove Manual _Kerns"),
2042                       // TRANSLATORS: "glyph": An image used in the visual representation of characters;
2043                       //  roughly speaking, how a character looks. A font is a set of glyphs.
2044                       N_("Remove all manual kerns and glyph rotations from a text object"), NULL),
2046     new SelectionVerb(SP_VERB_SELECTION_UNION, "SelectionUnion", N_("_Union"),
2047                       N_("Create union of selected paths"), "union"),
2048     new SelectionVerb(SP_VERB_SELECTION_INTERSECT, "SelectionIntersect", N_("_Intersection"),
2049                       N_("Create intersection of selected paths"), "intersection"),
2050     new SelectionVerb(SP_VERB_SELECTION_DIFF, "SelectionDiff", N_("_Difference"),
2051                       N_("Create difference of selected paths (bottom minus top)"), "difference"),
2052     new SelectionVerb(SP_VERB_SELECTION_SYMDIFF, "SelectionSymDiff", N_("E_xclusion"),
2053                       N_("Create exclusive OR of selected paths (those parts that belong to only one path)"), "exclusion"),
2054     new SelectionVerb(SP_VERB_SELECTION_CUT, "SelectionDivide", N_("Di_vision"),
2055                       N_("Cut the bottom path into pieces"), "division"),
2056     // TRANSLATORS: "to cut a path" is not the same as "to break a path apart" - see the
2057     // Advanced tutorial for more info
2058     new SelectionVerb(SP_VERB_SELECTION_SLICE, "SelectionCutPath", N_("Cut _Path"),
2059                       N_("Cut the bottom path's stroke into pieces, removing fill"), "cut_path"),
2060     // TRANSLATORS: "outset": expand a shape by offsetting the object's path,
2061     // i.e. by displacing it perpendicular to the path in each point.
2062     // See also the Advanced Tutorial for explanation.
2063     new SelectionVerb(SP_VERB_SELECTION_OFFSET, "SelectionOffset", N_("Outs_et"),
2064                       N_("Outset selected paths"), "outset_path"),
2065     new SelectionVerb(SP_VERB_SELECTION_OFFSET_SCREEN, "SelectionOffsetScreen",
2066                       N_("O_utset Path by 1 px"),
2067                       N_("Outset selected paths by 1 px"), NULL),
2068     new SelectionVerb(SP_VERB_SELECTION_OFFSET_SCREEN_10, "SelectionOffsetScreen10",
2069                       N_("O_utset Path by 10 px"),
2070                       N_("Outset selected paths by 10 px"), NULL),
2071     // TRANSLATORS: "inset": contract a shape by offsetting the object's path,
2072     // i.e. by displacing it perpendicular to the path in each point.
2073     // See also the Advanced Tutorial for explanation.
2074     new SelectionVerb(SP_VERB_SELECTION_INSET, "SelectionInset", N_("I_nset"),
2075                       N_("Inset selected paths"), "inset_path"),
2076     new SelectionVerb(SP_VERB_SELECTION_INSET_SCREEN, "SelectionInsetScreen",
2077                       N_("I_nset Path by 1 px"),
2078                       N_("Inset selected paths by 1 px"), NULL),
2079     new SelectionVerb(SP_VERB_SELECTION_INSET_SCREEN_10, "SelectionInsetScreen10",
2080                       N_("I_nset Path by 10 px"),
2081                       N_("Inset selected paths by 10 px"), NULL),
2082     new SelectionVerb(SP_VERB_SELECTION_DYNAMIC_OFFSET, "SelectionDynOffset",
2083                       N_("D_ynamic Offset"), N_("Create a dynamic offset object"), "dynamic_offset"),
2084     new SelectionVerb(SP_VERB_SELECTION_LINKED_OFFSET, "SelectionLinkedOffset",
2085                       N_("_Linked Offset"),
2086                       N_("Create a dynamic offset object linked to the original path"),
2087                       "linked_offset"),
2088     new SelectionVerb(SP_VERB_SELECTION_OUTLINE, "StrokeToPath", N_("_Stroke to Path"),
2089                       N_("Convert selected object's stroke to paths"), "stroke_tocurve"),
2090     new SelectionVerb(SP_VERB_SELECTION_SIMPLIFY, "SelectionSimplify", N_("Si_mplify"),
2091                       N_("Simplify selected paths (remove extra nodes)"), "simplify"),
2092     new SelectionVerb(SP_VERB_SELECTION_REVERSE, "SelectionReverse", N_("_Reverse"),
2093                       N_("Reverse the direction of selected paths (useful for flipping markers)"), "selection_reverse"),
2094     // TRANSLATORS: "to trace" means "to convert a bitmap to vector graphics" (to vectorize)
2095     new SelectionVerb(SP_VERB_SELECTION_TRACE, "SelectionTrace", N_("_Trace Bitmap..."),
2096                       N_("Create one or more paths from a bitmap by tracing it"), "selection_trace"),
2097     new SelectionVerb(SP_VERB_SELECTION_CREATE_BITMAP, "SelectionCreateBitmap", N_("_Make a Bitmap Copy"),
2098                       N_("Export selection to a bitmap and insert it into document"), "selection_bitmap" ),
2099     new SelectionVerb(SP_VERB_SELECTION_COMBINE, "SelectionCombine", N_("_Combine"),
2100                       N_("Combine several paths into one"), "selection_combine"),
2101     // TRANSLATORS: "to cut a path" is not the same as "to break a path apart" - see the
2102     // Advanced tutorial for more info
2103     new SelectionVerb(SP_VERB_SELECTION_BREAK_APART, "SelectionBreakApart", N_("Break _Apart"),
2104                       N_("Break selected paths into subpaths"), "selection_break"),
2105     new SelectionVerb(SP_VERB_SELECTION_GRIDTILE, "DialogGridArrange", N_("Gri_d Arrange..."),
2106                       N_("Arrange selected objects in a grid pattern"), "grid_arrange"),
2107     /* Layer */
2108     new LayerVerb(SP_VERB_LAYER_NEW, "LayerNew", N_("_Add Layer..."),
2109                   N_("Create a new layer"), "new_layer"),
2110     new LayerVerb(SP_VERB_LAYER_RENAME, "LayerRename", N_("Re_name Layer..."),
2111                   N_("Rename the current layer"), "rename_layer"),
2112     new LayerVerb(SP_VERB_LAYER_NEXT, "LayerNext", N_("Switch to Layer Abov_e"),
2113                   N_("Switch to the layer above the current"), "switch_to_layer_above"),
2114     new LayerVerb(SP_VERB_LAYER_PREV, "LayerPrev", N_("Switch to Layer Belo_w"),
2115                   N_("Switch to the layer below the current"), "switch_to_layer_below"),
2116     new LayerVerb(SP_VERB_LAYER_MOVE_TO_NEXT, "LayerMoveToNext", N_("Move Selection to Layer Abo_ve"),
2117                   N_("Move selection to the layer above the current"), "move_selection_above"),
2118     new LayerVerb(SP_VERB_LAYER_MOVE_TO_PREV, "LayerMoveToPrev", N_("Move Selection to Layer Bel_ow"),
2119                   N_("Move selection to the layer below the current"), "move_selection_below"),
2120     new LayerVerb(SP_VERB_LAYER_TO_TOP, "LayerToTop", N_("Layer to _Top"),
2121                   N_("Raise the current layer to the top"), "layer_to_top"),
2122     new LayerVerb(SP_VERB_LAYER_TO_BOTTOM, "LayerToBottom", N_("Layer to _Bottom"),
2123                   N_("Lower the current layer to the bottom"), "layer_to_bottom"),
2124     new LayerVerb(SP_VERB_LAYER_RAISE, "LayerRaise", N_("_Raise Layer"),
2125                   N_("Raise the current layer"), "raise_layer"),
2126     new LayerVerb(SP_VERB_LAYER_LOWER, "LayerLower", N_("_Lower Layer"),
2127                   N_("Lower the current layer"), "lower_layer"),
2128     new LayerVerb(SP_VERB_LAYER_DELETE, "LayerDelete", N_("_Delete Current Layer"),
2129                   N_("Delete the current layer"), "delete_layer"),
2131     /* Object */
2132     new ObjectVerb(SP_VERB_OBJECT_ROTATE_90_CW, "ObjectRotate90", N_("Rotate _90&#176; CW"),
2133                    N_("Rotate selection 90&#176; clockwise"), "object_rotate_90_CW"),
2134     new ObjectVerb(SP_VERB_OBJECT_ROTATE_90_CCW, "ObjectRotate90CCW", N_("Rotate 9_0&#176; CCW"),
2135                    N_("Rotate selection 90&#176; counter-clockwise"), "object_rotate_90_CCW"),
2136     new ObjectVerb(SP_VERB_OBJECT_FLATTEN, "ObjectRemoveTransform", N_("Remove _Transformations"),
2137                    N_("Remove transformations from object"), "object_reset"),
2138     new ObjectVerb(SP_VERB_OBJECT_TO_CURVE, "ObjectToPath", N_("_Object to Path"),
2139                    N_("Convert selected object to path"), "object_tocurve"),
2140     new ObjectVerb(SP_VERB_OBJECT_FLOW_TEXT, "ObjectFlowText", N_("_Flow into Frame"),
2141                    N_("Put text into a frame (path or shape), creating a flowed text linked to the frame object"), NULL),
2142     new ObjectVerb(SP_VERB_OBJECT_UNFLOW_TEXT, "ObjectUnFlowText", N_("_Unflow"),
2143                    N_("Remove text from frame (creates a single-line text object)"), NULL),
2144     new ObjectVerb(SP_VERB_OBJECT_FLOWTEXT_TO_TEXT, "ObjectFlowtextToText", N_("_Convert to Text"),
2145                    N_("Convert flowed text to regular text object (preserves appearance)"), NULL),
2146     new ObjectVerb(SP_VERB_OBJECT_FLIP_HORIZONTAL, "ObjectFlipHorizontally",
2147                    N_("Flip _Horizontal"), N_("Flip selected objects horizontally"),
2148                    "object_flip_hor"),
2149     new ObjectVerb(SP_VERB_OBJECT_FLIP_VERTICAL, "ObjectFlipVertically",
2150                    N_("Flip _Vertical"), N_("Flip selected objects vertically"),
2151                    "object_flip_ver"),
2152     new ObjectVerb(SP_VERB_OBJECT_SET_MASK, "ObjectSetMask", N_("_Set"),
2153                  N_("Apply mask to selection (using the topmost object as mask)"), NULL),
2154     new ObjectVerb(SP_VERB_OBJECT_UNSET_MASK, "ObjectUnSetMask", N_("_Release"),
2155                  N_("Remove mask from selection"), NULL),
2156     new ObjectVerb(SP_VERB_OBJECT_SET_CLIPPATH, "ObjectSetClipPath", N_("_Set"),
2157                  N_("Apply clipping path to selection (using the topmost object as clipping path)"), NULL),
2158     new ObjectVerb(SP_VERB_OBJECT_UNSET_CLIPPATH, "ObjectUnSetClipPath", N_("_Release"),
2159                  N_("Remove clipping path from selection"), NULL),
2161     /* Tools */
2162     new ContextVerb(SP_VERB_CONTEXT_SELECT, "ToolSelector", N_("Select"),
2163                     N_("Select and transform objects"), "draw_select"),
2164     new ContextVerb(SP_VERB_CONTEXT_NODE, "ToolNode", N_("Node Edit"),
2165                     N_("Edit path nodes or control handles"), "draw_node"),
2166     new ContextVerb(SP_VERB_CONTEXT_RECT, "ToolRect", N_("Rectangle"),
2167                     N_("Create rectangles and squares"), "draw_rect"),
2168     new ContextVerb(SP_VERB_CONTEXT_ARC, "ToolArc", N_("Ellipse"),
2169                     N_("Create circles, ellipses, and arcs"), "draw_arc"),
2170     new ContextVerb(SP_VERB_CONTEXT_STAR, "ToolStar", N_("Star"),
2171                     N_("Create stars and polygons"), "draw_star"),
2172     new ContextVerb(SP_VERB_CONTEXT_SPIRAL, "ToolSpiral", N_("Spiral"),
2173                     N_("Create spirals"), "draw_spiral"),
2174     new ContextVerb(SP_VERB_CONTEXT_PENCIL, "ToolPencil", N_("Pencil"),
2175                     N_("Draw freehand lines"), "draw_freehand"),
2176     new ContextVerb(SP_VERB_CONTEXT_PEN, "ToolPen", N_("Pen"),
2177                     N_("Draw Bezier curves and straight lines"), "draw_pen"),
2178     new ContextVerb(SP_VERB_CONTEXT_CALLIGRAPHIC, "ToolCalligrphic", N_("Calligraphy"),
2179                     N_("Draw calligraphic lines"), "draw_calligraphic"),
2180     new ContextVerb(SP_VERB_CONTEXT_TEXT, "ToolText", N_("Text"),
2181                     N_("Create and edit text objects"), "draw_text"),
2182     new ContextVerb(SP_VERB_CONTEXT_GRADIENT, "ToolGradient", N_("Gradient"),
2183                     N_("Create and edit gradients"), "draw_gradient"),
2184     new ContextVerb(SP_VERB_CONTEXT_ZOOM, "ToolZoom", N_("Zoom"),
2185                     N_("Zoom in or out"), "draw_zoom"),
2186     new ContextVerb(SP_VERB_CONTEXT_DROPPER, "ToolDropper", N_("Dropper"),
2187                     N_("Pick averaged colors from image"), "draw_dropper"),
2188     new ContextVerb(SP_VERB_CONTEXT_CONNECTOR, "ToolConnector", N_("Connector"),
2189                     N_("Create connectors"), "draw_connector"),
2191     /* Tool prefs */
2192     new ContextVerb(SP_VERB_CONTEXT_SELECT_PREFS, "SelectPrefs", N_("Selector Preferences"),
2193                     N_("Open Preferences for the Selector tool"), NULL),
2194     new ContextVerb(SP_VERB_CONTEXT_NODE_PREFS, "NodePrefs", N_("Node Tool Preferences"),
2195                     N_("Open Preferences for the Node tool"), NULL),
2196     new ContextVerb(SP_VERB_CONTEXT_RECT_PREFS, "RectPrefs", N_("Rectangle Preferences"),
2197                     N_("Open Preferences for the Rectangle tool"), NULL),
2198     new ContextVerb(SP_VERB_CONTEXT_ARC_PREFS, "ArcPrefs", N_("Ellipse Preferences"),
2199                     N_("Open Preferences for the Ellipse tool"), NULL),
2200     new ContextVerb(SP_VERB_CONTEXT_STAR_PREFS, "StarPrefs", N_("Star Preferences"),
2201                     N_("Open Preferences for the Star tool"), NULL),
2202     new ContextVerb(SP_VERB_CONTEXT_SPIRAL_PREFS, "SpiralPrefs", N_("Spiral Preferences"),
2203                     N_("Open Preferences for the Spiral tool"), NULL),
2204     new ContextVerb(SP_VERB_CONTEXT_PENCIL_PREFS, "PencilPrefs", N_("Pencil Preferences"),
2205                     N_("Open Preferences for the Pencil tool"), NULL),
2206     new ContextVerb(SP_VERB_CONTEXT_PEN_PREFS, "PenPrefs", N_("Pen Preferences"),
2207                     N_("Open Preferences for the Pen tool"), NULL),
2208     new ContextVerb(SP_VERB_CONTEXT_CALLIGRAPHIC_PREFS, "CalligraphicPrefs", N_("Calligraphic Preferences"),
2209                     N_("Open Preferences for the Calligraphy tool"), NULL),
2210     new ContextVerb(SP_VERB_CONTEXT_TEXT_PREFS, "TextPrefs", N_("Text Preferences"),
2211                     N_("Open Preferences for the Text tool"), NULL),
2212     new ContextVerb(SP_VERB_CONTEXT_GRADIENT_PREFS, "GradientPrefs", N_("Gradient Preferences"),
2213                     N_("Open Preferences for the Gradient tool"), NULL),
2214     new ContextVerb(SP_VERB_CONTEXT_ZOOM_PREFS, "ZoomPrefs", N_("Zoom Preferences"),
2215                     N_("Open Preferences for the Zoom tool"), NULL),
2216     new ContextVerb(SP_VERB_CONTEXT_DROPPER_PREFS, "DropperPrefs", N_("Dropper Preferences"),
2217                     N_("Open Preferences for the Dropper tool"), NULL),
2218     new ContextVerb(SP_VERB_CONTEXT_CONNECTOR_PREFS, "ConnectorPrefs", N_("Connector Preferences"),
2219                     N_("Open Preferences for the Connector tool"), NULL),
2221     /* Zoom/View */
2222     new ZoomVerb(SP_VERB_ZOOM_IN, "ZoomIn", N_("Zoom In"), N_("Zoom in"), "zoom_in"),
2223     new ZoomVerb(SP_VERB_ZOOM_OUT, "ZoomOut", N_("Zoom Out"), N_("Zoom out"), "zoom_out"),
2224     new ZoomVerb(SP_VERB_TOGGLE_RULERS, "ToggleRulers", N_("_Rulers"), N_("Show or hide the canvas rulers"), "rulers"),
2225     new ZoomVerb(SP_VERB_TOGGLE_SCROLLBARS, "ToggleScrollbars", N_("Scroll_bars"), N_("Show or hide the canvas scrollbars"), "scrollbars"),
2226     new ZoomVerb(SP_VERB_TOGGLE_GRID, "ToggleGrid", N_("_Grid"), N_("Show or hide the grid"), "grid"),
2227     new ZoomVerb(SP_VERB_TOGGLE_GUIDES, "ToggleGuides", N_("G_uides"), N_("Show or hide guides (drag from a ruler to create a guide)"), "guides"),
2228     new ZoomVerb(SP_VERB_ZOOM_NEXT, "ZoomNext", N_("Nex_t Zoom"), N_("Next zoom (from the history of zooms)"),
2229                  "zoom_next"),
2230     new ZoomVerb(SP_VERB_ZOOM_PREV, "ZoomPrev", N_("Pre_vious Zoom"), N_("Previous zoom (from the history of zooms)"),
2231                  "zoom_previous"),
2232     new ZoomVerb(SP_VERB_ZOOM_1_1, "Zoom1:0", N_("Zoom 1:_1"), N_("Zoom to 1:1"),
2233                  "zoom_1_to_1"),
2234     new ZoomVerb(SP_VERB_ZOOM_1_2, "Zoom1:2", N_("Zoom 1:_2"), N_("Zoom to 1:2"),
2235                  "zoom_1_to_2"),
2236     new ZoomVerb(SP_VERB_ZOOM_2_1, "Zoom2:1", N_("_Zoom 2:1"), N_("Zoom to 2:1"),
2237                  "zoom_2_to_1"),
2238 #ifdef HAVE_GTK_WINDOW_FULLSCREEN
2239     new ZoomVerb(SP_VERB_FULLSCREEN, "FullScreen", N_("_Fullscreen"), N_("Stretch this document window to full screen"),
2240                  "fullscreen"),
2241 #endif /* HAVE_GTK_WINDOW_FULLSCREEN */
2242     new ZoomVerb(SP_VERB_VIEW_NEW, "ViewNew", N_("Duplic_ate Window"), N_("Open a new window with the same document"),
2243                  "view_new"),
2244     new ZoomVerb(SP_VERB_VIEW_NEW_PREVIEW, "ViewNewPreview", N_("_New View Preview"),
2245                  N_("New View Preview"), NULL/*"view_new_preview"*/),
2247     new ZoomVerb(SP_VERB_VIEW_MODE_NORMAL, "ViewModeNormal", N_("_Normal"),
2248                  N_("Switch to normal display mode"), NULL),
2249     new ZoomVerb(SP_VERB_VIEW_MODE_OUTLINE, "ViewModeOutline", N_("_Outline"),
2250                  N_("Switch to outline (wireframe) display mode"), NULL),
2252     new ZoomVerb(SP_VERB_VIEW_ICON_PREVIEW, "ViewIconPreview", N_("Ico_n Preview"),
2253                  N_("Open a window to preview objects at different icon resolutions"), NULL/*"view_icon_preview"*/),
2254     new ZoomVerb(SP_VERB_ZOOM_PAGE, "ZoomPage", N_("_Page"),
2255                  N_("Zoom to fit page in window"), "zoom_page"),
2256     new ZoomVerb(SP_VERB_ZOOM_PAGE_WIDTH, "ZoomPageWidth", N_("Page _Width"),
2257                  N_("Zoom to fit page width in window"), "zoom_pagewidth"),
2258     new ZoomVerb(SP_VERB_ZOOM_DRAWING, "ZoomDrawing", N_("_Drawing"),
2259                  N_("Zoom to fit drawing in window"), "zoom_draw"),
2260     new ZoomVerb(SP_VERB_ZOOM_SELECTION, "ZoomSelection", N_("_Selection"),
2261                  N_("Zoom to fit selection in window"), "zoom_select"),
2263     /* Dialogs */
2264     new DialogVerb(SP_VERB_DIALOG_DISPLAY, "DialogPreferences", N_("In_kscape Preferences..."),
2265                    N_("Edit global Inkscape preferences"), GTK_STOCK_PREFERENCES ),
2266     new DialogVerb(SP_VERB_DIALOG_NAMEDVIEW, "DialogDocumentProperties", N_("_Document Properties..."),
2267                    N_("Edit properties of this document (to be saved with the document)"), GTK_STOCK_PROPERTIES ),
2268     new DialogVerb(SP_VERB_DIALOG_METADATA, "DialogMetadata", N_("Document _Metadata..."),
2269                    N_("Edit document metadata (to be saved with the document)"), NULL ),
2270     new DialogVerb(SP_VERB_DIALOG_FILL_STROKE, "DialogFillStroke", N_("_Fill and Stroke..."),
2271                    N_("Edit objects' style, such as color or stroke width"), "fill_and_stroke"),
2272     // TRANSLATORS: "Swatches" means: color samples
2273     new DialogVerb(SP_VERB_DIALOG_SWATCHES, "DialogSwatches", N_("S_watches..."),
2274                    N_("Select colors from a swatches palette"), GTK_STOCK_SELECT_COLOR),
2275     new DialogVerb(SP_VERB_DIALOG_TRANSFORM, "DialogTransform", N_("Transfor_m..."),
2276                    N_("Precisely control objects' transformations"), "object_trans"),
2277     new DialogVerb(SP_VERB_DIALOG_ALIGN_DISTRIBUTE, "DialogAlignDistribute", N_("_Align and Distribute..."),
2278                    N_("Align and distribute objects"), "object_align"),
2279     new DialogVerb(SP_VERB_DIALOG_UNDO_HISTORY, "DialogUndoHistory", N_("Undo _History..."),
2280                    N_("Undo History"), "edit_undo_history"),
2281     new DialogVerb(SP_VERB_DIALOG_TEXT, "DialogText", N_("_Text and Font..."),
2282                    N_("View and select font family, font size and other text properties"), "object_font"),
2283     new DialogVerb(SP_VERB_DIALOG_XML_EDITOR, "DialogXMLEditor", N_("_XML Editor..."),
2284                    N_("View and edit the XML tree of the document"), "xml_editor"),
2285     new DialogVerb(SP_VERB_DIALOG_FIND, "DialogFind", N_("_Find..."),
2286                    N_("Find objects in document"), GTK_STOCK_FIND ),
2287     new DialogVerb(SP_VERB_DIALOG_DEBUG, "DialogDebug", N_("_Messages..."),
2288                    N_("View debug messages"), NULL),
2289     new DialogVerb(SP_VERB_DIALOG_SCRIPT, "DialogScript", N_("S_cripts..."),
2290                    N_("Run scripts"), NULL),
2291     new DialogVerb(SP_VERB_DIALOG_TOGGLE, "DialogsToggle", N_("Show/Hide D_ialogs"),
2292                    N_("Show or hide all open dialogs"), "dialog_toggle"),
2293     // TRANSLATORS: "Tile Clones" means: "Create tiled clones"
2294     new DialogVerb(SP_VERB_DIALOG_CLONETILER, "DialogClonetiler", N_("Create Tiled Clones..."),
2295                    N_("Create multiple clones of selected object, arranging them into a pattern or scattering"), NULL),
2296     new DialogVerb(SP_VERB_DIALOG_ITEM, "DialogObjectProperties", N_("_Object Properties..."),
2297                    N_("Edit the ID, locked and visible status, and other object properties"), "dialog_item_properties"),
2298 #ifdef WITH_INKBOARD
2299     new DialogVerb(SP_VERB_XMPP_CLIENT, "DialogXmppClient",
2300                    N_("_Instant Messaging..."), N_("Jabber Instant Messaging Client"), NULL),
2301 #endif
2302     new DialogVerb(SP_VERB_DIALOG_INPUT, "DialogInput", N_("_Input Devices..."),
2303                    N_("Configure extended input devices, such as a graphics tablet"), NULL),
2304     new DialogVerb(SP_VERB_DIALOG_EXTENSIONEDITOR, "org.inkscape.dialogs.extensioneditor", N_("_Extensions..."),
2305                    N_("Query information about extensions"), NULL),
2306     new DialogVerb(SP_VERB_DIALOG_LAYERS, "DialogLayers", N_("Layer_s..."),
2307                    N_("View Layers"), NULL),
2309     /* Help */
2310     new HelpVerb(SP_VERB_HELP_KEYS, "HelpKeys", N_("_Keys and Mouse"),
2311                  N_("Keys and mouse shortcuts reference"), "help_keys"),
2312     new HelpVerb(SP_VERB_HELP_ABOUT_EXTENSIONS, "HelpAboutExtensions", N_("About E_xtensions"),
2313                  N_("Information on Inkscape extensions"), NULL),
2314     new HelpVerb(SP_VERB_HELP_MEMORY, "HelpAboutMemory", N_("About _Memory"),
2315                  N_("Memory usage information"), NULL),
2316     new HelpVerb(SP_VERB_HELP_ABOUT, "HelpAbout", N_("_About Inkscape"),
2317                  N_("Inkscape version, authors, license"), /*"help_about"*/"inkscape_options"),
2318     //new HelpVerb(SP_VERB_SHOW_LICENSE, "ShowLicense", N_("_License"),
2319     //           N_("Distribution terms"), /*"show_license"*/"inkscape_options"),
2321     /* Tutorials */
2322     new TutorialVerb(SP_VERB_TUTORIAL_BASIC, "TutorialsBasic", N_("Inkscape: _Basic"),
2323                      N_("Getting started with Inkscape"), NULL/*"tutorial_basic"*/),
2324     new TutorialVerb(SP_VERB_TUTORIAL_SHAPES, "TutorialsShapes", N_("Inkscape: _Shapes"),
2325                      N_("Using shape tools to create and edit shapes"), NULL),
2326     new TutorialVerb(SP_VERB_TUTORIAL_ADVANCED, "TutorialsAdvanced", N_("Inkscape: _Advanced"),
2327                      N_("Advanced Inkscape topics"), NULL/*"tutorial_advanced"*/),
2328     // TRANSLATORS: "to trace" means "to convert a bitmap to vector graphics" (to vectorize)
2329     new TutorialVerb(SP_VERB_TUTORIAL_TRACING, "TutorialsTracing", N_("Inkscape: T_racing"),
2330                      N_("Using bitmap tracing"), NULL/*"tutorial_tracing"*/),
2331     new TutorialVerb(SP_VERB_TUTORIAL_CALLIGRAPHY, "TutorialsCalligraphy", N_("Inkscape: _Calligraphy"),
2332                      N_("Using the Calligraphy pen tool"), NULL),
2333     new TutorialVerb(SP_VERB_TUTORIAL_DESIGN, "TutorialsDesign", N_("_Elements of Design"),
2334                      N_("Principles of design in the tutorial form"), NULL/*"tutorial_design"*/),
2335     new TutorialVerb(SP_VERB_TUTORIAL_TIPS, "TutorialsTips", N_("_Tips and Tricks"),
2336                      N_("Miscellaneous tips and tricks"), NULL/*"tutorial_tips"*/),
2338     /* Effect */
2339     new EffectLastVerb(SP_VERB_EFFECT_LAST, "EffectLast", N_("Previous Effect"),
2340                        N_("Repeat the last effect with the same settings"), NULL),
2341     new EffectLastVerb(SP_VERB_EFFECT_LAST_PREF, "EffectLastPref", N_("Previous Effect Settings..."),
2342                        N_("Repeat the last effect with new settings"), NULL),
2344     /* Fit Page */
2345     new FitCanvasVerb(SP_VERB_FIT_CANVAS_TO_SELECTION, "FitCanvasToSelection", N_("Fit Page to Selection"),
2346                        N_("Fit the page to the current selection"), NULL),
2347     new FitCanvasVerb(SP_VERB_FIT_CANVAS_TO_DRAWING, "FitCanvasToDrawing", N_("Fit Page to Drawing"),
2348                        N_("Fit the page to the drawing"), NULL),
2349     new FitCanvasVerb(SP_VERB_FIT_CANVAS_TO_SELECTION_OR_DRAWING, "FitCanvasToSelectionOrDrawing", N_("Fit Page to Selection or Drawing"),
2350                        N_("Fit the page to the current selection or the drawing if there is no selection"), NULL),
2351     /* Footer */
2352     new Verb(SP_VERB_LAST, " '\"invalid id", NULL, NULL, NULL)
2353 };
2356 }  /* namespace Inkscape */
2358 /*
2359   Local Variables:
2360   mode:c++
2361   c-file-style:"stroustrup"
2362   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
2363   indent-tabs-mode:nil
2364   fill-column:99
2365   End:
2366 */
2367 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :