Code

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