Code

moving trunk for module inkscape
[inkscape.git] / src / verbs.cpp
1 #define __SP_VERBS_C__
2 /**
3  * \file verbs.cpp
4  *
5  * \brief Actions for inkscape
6  *
7  * This file implements routines necessary to deal with verbs.  A verb
8  * is a numeric identifier used to retrieve standard SPActions for particular
9  * views.
10  */
12 /*
13  * Authors:
14  *   Lauris Kaplinski <lauris@kaplinski.com>
15  *   Ted Gould <ted@gould.cx>
16  *   MenTaLguY <mental@rydia.net>
17  *   David Turner <novalis@gnu.org>
18  *   bulia byak <buliabyak@users.sf.net>
19  *
20  * This code is in public domain.
21  */
26 #include <gtk/gtkstock.h>
28 #ifdef HAVE_CONFIG_H
29 # include "config.h"
30 #endif
32 #include "helper/action.h"
34 #include <gtkmm/messagedialog.h>
35 #include <gtkmm/filechooserdialog.h>
36 #include <gtkmm/stock.h>
38 #include "dialogs/text-edit.h"
39 #include "dialogs/xml-tree.h"
40 #include "dialogs/object-properties.h"
41 #include "dialogs/display-settings.h"
42 #include "dialogs/item-properties.h"
43 #include "dialogs/find.h"
44 #include "dialogs/layer-properties.h"
45 #include "dialogs/clonetiler.h"
46 #include "dialogs/iconpreview.h"
47 #include "dialogs/extensions.h"
48 #include "dialogs/swatches.h"
49 #include "dialogs/input.h"
51 #ifdef WITH_INKBOARD
52 #include "ui/dialog/whiteboard-connect.h"
53 #include "ui/dialog/whiteboard-sharewithuser.h"
54 #include "ui/dialog/whiteboard-sharewithchat.h"
55 #include "jabber_whiteboard/session-manager.h"
56 #include "jabber_whiteboard/node-tracker.h"
57 #endif
59 #include "extension/effect.h"
61 #include "tools-switch.h"
62 #include "inkscape-private.h"
63 #include "file.h"
64 #include "help.h"
65 #include "document.h"
66 #include "desktop.h"
67 #include "message-stack.h"
68 #include "desktop-handles.h"
69 #include "selection-chemistry.h"
70 #include "path-chemistry.h"
71 #include "text-chemistry.h"
72 #include "ui/dialog/dialog-manager.h"
73 #include "interface.h"
74 #include "prefs-utils.h"
75 #include "splivarot.h"
76 #include "sp-namedview.h"
77 #include "sp-flowtext.h"
78 #include "layer-fns.h"
79 #include "node-context.h"
82 /**
83  * \brief Return the name without underscores and ellipsis, for use in dialog
84  * titles, etc. Allocated memory must be freed by caller.
85  */
86 gchar *
87 sp_action_get_title(SPAction const *action)
88 {
89     char const *src = action->name;
90     gchar *ret = g_new(gchar, strlen(src) + 1);
91     unsigned ri = 0;
93     for (unsigned si = 0 ; ; si++)  {
94         int const c = src[si];
95         if ( c != '_' && c != '.' ) {
96             ret[ri] = c;
97             ri++;
98             if (c == '\0') {
99                 return ret;
100             }
101         }
102     }
104 } // end of sp_action_get_title()
107 namespace Inkscape {
109 /// \todo !!!FIXME:: kill this, use DialogManager instead!!!
111 class PanelDialog : public Inkscape::UI::Dialog::Dialog
113 public:
114     PanelDialog(char const *prefs_path, int const verb_num) : Dialog(prefs_path, verb_num) {}
115 /*
116     virtual Glib::ustring getName() const {return "foo";}
117     virtual Glib::ustring getDesc() const {return "bar";}
118 */
119 };
121 /** \brief Utility function to get a panel displayed. */
122 static void show_panel( Inkscape::UI::Widget::Panel &panel, char const *prefs_path, int const verb_num )
124     Gtk::Container *container = panel.get_toplevel();
125     if ( &panel == container ) { // safe check?
126         //g_message("Creating new dialog to hold it");
127         PanelDialog *dia = new PanelDialog(prefs_path, verb_num);
128         Gtk::VBox *mainVBox = dia->get_vbox();
129         mainVBox->pack_start(panel);
130         dia->show_all_children();
131         dia->present();
132         dia->read_geometry();
133     } else {
134         Gtk::Dialog *dia = dynamic_cast<Gtk::Dialog*>(container);
135         if ( dia ) {
136             //g_message("Found an existing dialog");
137             dia->present();
138         } else {
139             g_message("Failed to find an existing dialog");
140         }
141     }
144 /** \brief A class to encompass all of the verbs which deal with
145            file operations. */
146 class FileVerb : public Verb {
147 private:
148     static void perform(SPAction *action, void *mydata, void *otherdata);
149     static SPActionEventVector vector;
150 protected:
151     virtual SPAction *make_action(Inkscape::UI::View::View *view);
152 public:
153     /** \brief Use the Verb initializer with the same parameters. */
154     FileVerb(unsigned int const code,
155              gchar const *id,
156              gchar const *name,
157              gchar const *tip,
158              gchar const *image) :
159         Verb(code, id, name, tip, image)
160     { }
161 }; /* FileVerb class */
163 /** \brief A class to encompass all of the verbs which deal with
164            edit operations. */
165 class EditVerb : public Verb {
166 private:
167     static void perform(SPAction *action, void *mydata, void *otherdata);
168     static SPActionEventVector vector;
169 protected:
170     virtual SPAction *make_action(Inkscape::UI::View::View *view);
171 public:
172     /** \brief Use the Verb initializer with the same parameters. */
173     EditVerb(unsigned int const code,
174              gchar const *id,
175              gchar const *name,
176              gchar const *tip,
177              gchar const *image) :
178         Verb(code, id, name, tip, image)
179     { }
180 }; /* EditVerb class */
182 /** \brief A class to encompass all of the verbs which deal with
183            selection operations. */
184 class SelectionVerb : public Verb {
185 private:
186     static void perform(SPAction *action, void *mydata, void *otherdata);
187     static SPActionEventVector vector;
188 protected:
189     virtual SPAction *make_action(Inkscape::UI::View::View *view);
190 public:
191     /** \brief Use the Verb initializer with the same parameters. */
192     SelectionVerb(unsigned int const code,
193                   gchar const *id,
194                   gchar const *name,
195                   gchar const *tip,
196                   gchar const *image) :
197         Verb(code, id, name, tip, image)
198     { }
199 }; /* SelectionVerb class */
201 /** \brief A class to encompass all of the verbs which deal with
202            layer operations. */
203 class LayerVerb : public Verb {
204 private:
205     static void perform(SPAction *action, void *mydata, void *otherdata);
206     static SPActionEventVector vector;
207 protected:
208     virtual SPAction *make_action(Inkscape::UI::View::View *view);
209 public:
210     /** \brief Use the Verb initializer with the same parameters. */
211     LayerVerb(unsigned int const code,
212               gchar const *id,
213               gchar const *name,
214               gchar const *tip,
215               gchar const *image) :
216         Verb(code, id, name, tip, image)
217     { }
218 }; /* LayerVerb class */
220 /** \brief A class to encompass all of the verbs which deal with
221            operations related to objects. */
222 class ObjectVerb : public Verb {
223 private:
224     static void perform(SPAction *action, void *mydata, void *otherdata);
225     static SPActionEventVector vector;
226 protected:
227     virtual SPAction *make_action(Inkscape::UI::View::View *view);
228 public:
229     /** \brief Use the Verb initializer with the same parameters. */
230     ObjectVerb(unsigned int const code,
231                gchar const *id,
232                gchar const *name,
233                gchar const *tip,
234                gchar const *image) :
235         Verb(code, id, name, tip, image)
236     { }
237 }; /* ObjectVerb class */
239 /** \brief A class to encompass all of the verbs which deal with
240            operations relative to context. */
241 class ContextVerb : public Verb {
242 private:
243     static void perform(SPAction *action, void *mydata, void *otherdata);
244     static SPActionEventVector vector;
245 protected:
246     virtual SPAction *make_action(Inkscape::UI::View::View *view);
247 public:
248     /** \brief Use the Verb initializer with the same parameters. */
249     ContextVerb(unsigned int const code,
250                 gchar const *id,
251                 gchar const *name,
252                 gchar const *tip,
253                 gchar const *image) :
254         Verb(code, id, name, tip, image)
255     { }
256 }; /* ContextVerb class */
258 /** \brief A class to encompass all of the verbs which deal with
259            zoom operations. */
260 class ZoomVerb : public Verb {
261 private:
262     static void perform(SPAction *action, void *mydata, void *otherdata);
263     static SPActionEventVector vector;
264 protected:
265     virtual SPAction *make_action(Inkscape::UI::View::View *view);
266 public:
267     /** \brief Use the Verb initializer with the same parameters. */
268     ZoomVerb(unsigned int const code,
269              gchar const *id,
270              gchar const *name,
271              gchar const *tip,
272              gchar const *image) :
273         Verb(code, id, name, tip, image)
274     { }
275 }; /* ZoomVerb class */
278 /** \brief A class to encompass all of the verbs which deal with
279            dialog operations. */
280 class DialogVerb : public Verb {
281 private:
282     static void perform(SPAction *action, void *mydata, void *otherdata);
283     static SPActionEventVector vector;
284 protected:
285     virtual SPAction *make_action(Inkscape::UI::View::View *view);
286 public:
287     /** \brief Use the Verb initializer with the same parameters. */
288     DialogVerb(unsigned int const code,
289                gchar const *id,
290                gchar const *name,
291                gchar const *tip,
292                gchar const *image) :
293         Verb(code, id, name, tip, image)
294     { }
295 }; /* DialogVerb class */
297 /** \brief A class to encompass all of the verbs which deal with
298            help operations. */
299 class HelpVerb : public Verb {
300 private:
301     static void perform(SPAction *action, void *mydata, void *otherdata);
302     static SPActionEventVector vector;
303 protected:
304     virtual SPAction *make_action(Inkscape::UI::View::View *view);
305 public:
306     /** \brief Use the Verb initializer with the same parameters. */
307     HelpVerb(unsigned int const code,
308              gchar const *id,
309              gchar const *name,
310              gchar const *tip,
311              gchar const *image) :
312         Verb(code, id, name, tip, image)
313     { }
314 }; /* HelpVerb class */
316 /** \brief A class to encompass all of the verbs which deal with
317            tutorial operations. */
318 class TutorialVerb : public Verb {
319 private:
320     static void perform(SPAction *action, void *mydata, void *otherdata);
321     static SPActionEventVector vector;
322 protected:
323     virtual SPAction *make_action(Inkscape::UI::View::View *view);
324 public:
325     /** \brief Use the Verb initializer with the same parameters. */
326     TutorialVerb(unsigned int const code,
327                  gchar const *id,
328                  gchar const *name,
329                  gchar const *tip,
330                  gchar const *image) :
331         Verb(code, id, name, tip, image)
332     { }
333 }; /* TutorialVerb class */
336 Verb::VerbTable Verb::_verbs;
337 Verb::VerbIDTable Verb::_verb_ids;
339 /** \brief  Create a verb without a code.
341     This function calls the other constructor for all of the parameters,
342     but generates the code.  It is important to READ THE OTHER DOCUMENTATION
343     it has important details in it.  To generate the code a static is
344     used which starts at the last static value: \c SP_VERB_LAST.  For
345     each call it is incremented.  The list of allocated verbs is kept
346     in the \c _verbs hashtable which is indexed by the \c code.
347 */
348 Verb::Verb(gchar const *id, gchar const *name, gchar const *tip, gchar const *image) :
349     _actions(NULL), _id(id), _name(name), _tip(tip), _image(image)
351     static int count = SP_VERB_LAST;
353     count++;
354     _code = count;
355     _verbs.insert(VerbTable::value_type(count, this));
356     _verb_ids.insert(VerbIDTable::value_type(_id, this));
358     return;
361 /** \brief  Destroy a verb.
363       The only allocated variable is the _actions variable.  If it has
364     been allocated it is deleted.
365 */
366 Verb::~Verb(void)
368     /// \todo all the actions need to be cleaned up first.
369     if (_actions != NULL) {
370         delete _actions;
371     }
373     return;
376 /** \brief  Verbs are no good without actions.  This is a place holder
377             for a function that every subclass should write.  Most
378             can be written using \c make_action_helper.
379     \param  view  Which view the action should be created for.
380     \return NULL to represent error (this function shouldn't ever be called)
381 */
382 SPAction *
383 Verb::make_action(Inkscape::UI::View::View *view)
385     //std::cout << "make_action" << std::endl;
386     return NULL;
389 /** \brief  Create an action for a \c FileVerb
390     \param  view  Which view the action should be created for
391     \return The built action.
393     Calls \c make_action_helper with the \c vector.
394 */
395 SPAction *
396 FileVerb::make_action(Inkscape::UI::View::View *view)
398     //std::cout << "fileverb: make_action: " << &vector << std::endl;
399     return make_action_helper(view, &vector);
402 /** \brief  Create an action for a \c EditVerb
403     \param  view  Which view the action should be created for
404     \return The built action.
406     Calls \c make_action_helper with the \c vector.
407 */
408 SPAction *
409 EditVerb::make_action(Inkscape::UI::View::View *view)
411     //std::cout << "editverb: make_action: " << &vector << std::endl;
412     return make_action_helper(view, &vector);
415 /** \brief  Create an action for a \c SelectionVerb
416     \param  view  Which view the action should be created for
417     \return The built action.
419     Calls \c make_action_helper with the \c vector.
420 */
421 SPAction *
422 SelectionVerb::make_action(Inkscape::UI::View::View *view)
424     return make_action_helper(view, &vector);
427 /** \brief  Create an action for a \c LayerVerb
428     \param  view  Which view the action should be created for
429     \return The built action.
431     Calls \c make_action_helper with the \c vector.
432 */
433 SPAction *
434 LayerVerb::make_action(Inkscape::UI::View::View *view)
436     return make_action_helper(view, &vector);
439 /** \brief  Create an action for a \c ObjectVerb
440     \param  view  Which view the action should be created for
441     \return The built action.
443     Calls \c make_action_helper with the \c vector.
444 */
445 SPAction *
446 ObjectVerb::make_action(Inkscape::UI::View::View *view)
448     return make_action_helper(view, &vector);
451 /** \brief  Create an action for a \c ContextVerb
452     \param  view  Which view the action should be created for
453     \return The built action.
455     Calls \c make_action_helper with the \c vector.
456 */
457 SPAction *
458 ContextVerb::make_action(Inkscape::UI::View::View *view)
460     return make_action_helper(view, &vector);
463 /** \brief  Create an action for a \c ZoomVerb
464     \param  view  Which view the action should be created for
465     \return The built action.
467     Calls \c make_action_helper with the \c vector.
468 */
469 SPAction *
470 ZoomVerb::make_action(Inkscape::UI::View::View *view)
472     return make_action_helper(view, &vector);
475 /** \brief  Create an action for a \c DialogVerb
476     \param  view  Which view the action should be created for
477     \return The built action.
479     Calls \c make_action_helper with the \c vector.
480 */
481 SPAction *
482 DialogVerb::make_action(Inkscape::UI::View::View *view)
484     return make_action_helper(view, &vector);
487 /** \brief  Create an action for a \c HelpVerb
488     \param  view  Which view the action should be created for
489     \return The built action.
491     Calls \c make_action_helper with the \c vector.
492 */
493 SPAction *
494 HelpVerb::make_action(Inkscape::UI::View::View *view)
496     return make_action_helper(view, &vector);
499 /** \brief  Create an action for a \c TutorialVerb
500     \param  view  Which view the action should be created for
501     \return The built action.
503     Calls \c make_action_helper with the \c vector.
504 */
505 SPAction *
506 TutorialVerb::make_action(Inkscape::UI::View::View *view)
508     return make_action_helper(view, &vector);
511 /** \brief A quick little convience function to make building actions
512            a little bit easier.
513     \param  view    Which view the action should be created for.
514     \param  vector  The function vector for the verb.
515     \return The created action.
517     This function does a couple of things.  The most obvious is that
518     it allocates and creates the action.  When it does this it
519     translates the \c _name and \c _tip variables.  This allows them
520     to be staticly allocated easily, and get translated in the end.  Then,
521     if the action gets crated, a listener is added to the action with
522     the vector that is passed in.
523 */
524 SPAction *
525 Verb::make_action_helper(Inkscape::UI::View::View *view, SPActionEventVector *vector, void *in_pntr)
527     SPAction *action;
529     //std::cout << "Adding action: " << _code << std::endl;
530     action = sp_action_new(view, _id, _(_name),
531                            _(_tip), _image, this);
533     if (action != NULL) {
534         if (in_pntr == NULL) {
535             nr_active_object_add_listener(
536                 (NRActiveObject *) action,
537                 (NRObjectEventVector *) vector,
538                 sizeof(SPActionEventVector),
539                 reinterpret_cast<void *>(_code)
540             );
541         } else {
542             nr_active_object_add_listener(
543                 (NRActiveObject *) action,
544                 (NRObjectEventVector *) vector,
545                 sizeof(SPActionEventVector),
546                 in_pntr
547             );
548         }
549     }
551     return action;
554 /** \brief  A function to get an action if it exists, or otherwise to
555             build it.
556     \param  view  The view which this action would relate to
557     \return The action, or NULL if there is an error.
559     This function will get the action for a given view for this verb.  It
560     will create the verb if it can't be found in the ActionTable.  Also,
561     if the \c ActionTable has not been created, it gets created by this
562     function.
564     If the action is created, it's sensitivity must be determined.  The
565     default for a new action is that it is sensitive.  If the value in
566     \c _default_sensitive is \c false, then the sensitivity must be
567     removed.  Also, if the view being created is based on the same
568     document as a view already created, the sensitivity should be the
569     same as views on that document.  A view with the same document is
570     looked for, and the sensitivity is matched.  Unfortunately, this is
571     currently a linear search.
572 */
573 SPAction *
574 Verb::get_action(Inkscape::UI::View::View *view)
576     SPAction *action = NULL;
578     if ( _actions == NULL ) {
579         _actions = new ActionTable;
580     }
581     ActionTable::iterator action_found = _actions->find(view);
583     if (action_found != _actions->end()) {
584         action = action_found->second;
585     } else {
586         action = this->make_action(view);
588         // if (action == NULL) printf("Hmm, NULL in %s\n", _name);
589         if (!_default_sensitive) {
590             sp_action_set_sensitive(action, 0);
591         } else {
592             for (ActionTable::iterator cur_action = _actions->begin();
593                  cur_action != _actions->end() && view != NULL;
594                  cur_action++) {
595                 if (cur_action->first != NULL && cur_action->first->doc() == view->doc()) {
596                     sp_action_set_sensitive(action, cur_action->second->sensitive);
597                     break;
598                 }
599             }
600         }
602         _actions->insert(ActionTable::value_type(view, action));
603     }
605     return action;
608 void
609 Verb::sensitive(SPDocument *in_doc, bool in_sensitive)
611     // printf("Setting sensitivity of \"%s\" to %d\n", _name, in_sensitive);
612     if (_actions != NULL) {
613         for (ActionTable::iterator cur_action = _actions->begin();
614              cur_action != _actions->end();
615              cur_action++) {
616                         if (in_doc == NULL || (cur_action->first != NULL && cur_action->first->doc() == in_doc)) {
617                 sp_action_set_sensitive(cur_action->second, in_sensitive ? 1 : 0);
618             }
619         }
620     }
622     if (in_doc == NULL) {
623         _default_sensitive = in_sensitive;
624     }
626     return;
629 /** \brief  A function to remove the action associated with a view.
630     \param  view  Which view's actions should be removed.
631     \return None
633     This function looks for the action in \c _actions.  If it is
634     found then it is unreferenced and the entry in the action
635     table is erased.
636 */
637 void
638 Verb::delete_view(Inkscape::UI::View::View *view)
640     if (_actions == NULL) return;
641     if (_actions->empty()) return;
643 #if 0
644     static int count = 0;
645     std::cout << count++ << std::endl;
646 #endif
648     ActionTable::iterator action_found = _actions->find(view);
650     if (action_found != _actions->end()) {
651         SPAction *action = action_found->second;
652         nr_object_unref(NR_OBJECT(action));
653         _actions->erase(action_found);
654     }
656     return;
659 /** \brief  A function to delete a view from all verbs
660     \param  view  Which view's actions should be removed.
661     \return None
663     This function first looks through _base_verbs and deteles
664     the view from all of those views.  If \c _verbs is not empty
665     then all of the entries in that table have all of the views
666     deleted also.
667 */
668 void
669 Verb::delete_all_view(Inkscape::UI::View::View *view)
671     for (int i = 0; i <= SP_VERB_LAST; i++) {
672         if (_base_verbs[i])
673           _base_verbs[i]->delete_view(view);
674     }
676     if (!_verbs.empty()) {
677         for (VerbTable::iterator thisverb = _verbs.begin();
678              thisverb != _verbs.end(); thisverb++) {
679             Inkscape::Verb *verbpntr = thisverb->second;
680             // std::cout << "Delete In Verb: " << verbpntr->_name << std::endl;
681             verbpntr->delete_view(view);
682         }
683     }
685     return;
688 /** \brief  A function to turn a \c code into a Verb for dynamically
689             created Verbs.
690     \param  code  What code is being looked for
691     \return The found Verb of NULL if none is found.
693     This function basically just looks through the \c _verbs hash
694     table.  STL does all the work.
695 */
696 Verb *
697 Verb::get_search(unsigned int code)
699     Verb *verb = NULL;
700     VerbTable::iterator verb_found = _verbs.find(code);
702     if (verb_found != _verbs.end()) {
703         verb = verb_found->second;
704     }
706     return verb;
709 /** \brief  Find a Verb using it's ID
710     \param  id  Which id to search for
712     This function uses the \c _verb_ids has table to find the
713     verb by it's id.  Should be much faster than previous
714     implementations.
715 */
716 Verb *
717 Verb::getbyid(gchar const *id)
719     Verb *verb = NULL;
720     VerbIDTable::iterator verb_found = _verb_ids.find(id);
722     if (verb_found != _verb_ids.end()) {
723         verb = verb_found->second;
724     }
726     if (verb == NULL)
727         printf("Unable to find: %s\n", id);
729     return verb;
732 /** \brief  Decode the verb code and take appropriate action */
733 void
734 FileVerb::perform(SPAction *action, void *data, void *pdata)
736 #if 0
737     /* These aren't used, but are here to remind people not to use
738        the CURRENT_DOCUMENT macros unless they really have to. */
739     Inkscape::UI::View::View *current_view = sp_action_get_view(action);
740     SPDocument *current_document = current_view->doc();
741 #endif
742     switch ((long) data) {
743         case SP_VERB_FILE_NEW:
744             sp_file_new_default();
745             break;
746         case SP_VERB_FILE_OPEN:
747             sp_file_open_dialog(NULL, NULL);
748             break;
749         case SP_VERB_FILE_REVERT:
750             sp_file_revert_dialog();
751             break;
752         case SP_VERB_FILE_SAVE:
753             sp_file_save(NULL, NULL);
754             break;
755         case SP_VERB_FILE_SAVE_AS:
756             sp_file_save_as(NULL, NULL);
757             break;
758         case SP_VERB_FILE_PRINT:
759             sp_file_print();
760             break;
761         case SP_VERB_FILE_VACUUM:
762             sp_file_vacuum();
763             break;
764         case SP_VERB_FILE_PRINT_DIRECT:
765             sp_file_print_direct();
766             break;
767         case SP_VERB_FILE_PRINT_PREVIEW:
768             sp_file_print_preview(NULL, NULL);
769             break;
770         case SP_VERB_FILE_IMPORT:
771             sp_file_import(NULL);
772             break;
773         case SP_VERB_FILE_EXPORT:
774             sp_file_export_dialog(NULL);
775             break;
776         case SP_VERB_FILE_NEXT_DESKTOP:
777             inkscape_switch_desktops_next();
778             break;
779         case SP_VERB_FILE_PREV_DESKTOP:
780             inkscape_switch_desktops_prev();
781             break;
782         case SP_VERB_FILE_CLOSE_VIEW:
783             sp_ui_close_view(NULL);
784             break;
785         case SP_VERB_FILE_QUIT:
786             sp_file_exit();
787             break;
788         default:
789             break;
790     }
792 } // end of sp_verb_action_file_perform()
794 /** \brief  Decode the verb code and take appropriate action */
795 void
796 EditVerb::perform(SPAction *action, void *data, void *pdata)
798     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
799     if (!dt)
800         return;
802     SPEventContext *ec = dt->event_context;
804     switch (reinterpret_cast<std::size_t>(data)) {
805         case SP_VERB_EDIT_UNDO:
806             sp_undo(dt, SP_DT_DOCUMENT(dt));
807             break;
808         case SP_VERB_EDIT_REDO:
809             sp_redo(dt, SP_DT_DOCUMENT(dt));
810             break;
811         case SP_VERB_EDIT_CUT:
812             sp_selection_cut();
813             break;
814         case SP_VERB_EDIT_COPY:
815             sp_selection_copy();
816             break;
817         case SP_VERB_EDIT_PASTE:
818             sp_selection_paste(false);
819             break;
820         case SP_VERB_EDIT_PASTE_STYLE:
821             sp_selection_paste_style();
822             break;
823         case SP_VERB_EDIT_PASTE_IN_PLACE:
824             sp_selection_paste(true);
825             break;
826         case SP_VERB_EDIT_DELETE:
827             sp_selection_delete();
828             break;
829         case SP_VERB_EDIT_DUPLICATE:
830             sp_selection_duplicate();
831             break;
832         case SP_VERB_EDIT_CLONE:
833             sp_selection_clone();
834             break;
835         case SP_VERB_EDIT_UNLINK_CLONE:
836             sp_selection_unlink();
837             break;
838         case SP_VERB_EDIT_CLONE_ORIGINAL:
839             sp_select_clone_original();
840             break;
841         case SP_VERB_EDIT_TILE:
842             sp_selection_tile();
843             break;
844         case SP_VERB_EDIT_UNTILE:
845             sp_selection_untile();
846             break;
847         case SP_VERB_EDIT_CLEAR_ALL:
848             sp_edit_clear_all();
849             break;
850         case SP_VERB_EDIT_SELECT_ALL:
851             if (tools_isactive(dt, TOOLS_NODES)) {
852                 sp_nodepath_select_all_from_subpath(SP_NODE_CONTEXT(ec)->nodepath, false);
853             } else {
854                 sp_edit_select_all();
855             }
856             break;
857         case SP_VERB_EDIT_INVERT:
858             if (tools_isactive(dt, TOOLS_NODES)) {
859                 sp_nodepath_select_all_from_subpath(SP_NODE_CONTEXT(ec)->nodepath, true);
860             } else {
861                 sp_edit_invert();
862             }
863             break;
864         case SP_VERB_EDIT_SELECT_ALL_IN_ALL_LAYERS:
865             if (tools_isactive(dt, TOOLS_NODES)) {
866                 sp_nodepath_select_all(SP_NODE_CONTEXT(ec)->nodepath, false);
867             } else {
868                 sp_edit_select_all_in_all_layers();
869             }
870             break;
871         case SP_VERB_EDIT_INVERT_IN_ALL_LAYERS:
872             if (tools_isactive(dt, TOOLS_NODES)) {
873                 sp_nodepath_select_all(SP_NODE_CONTEXT(ec)->nodepath, true);
874             } else {
875                 sp_edit_invert_in_all_layers();
876             }
877             break;
878         case SP_VERB_EDIT_DESELECT:
879             if (tools_isactive(dt, TOOLS_NODES)) {
880                 sp_nodepath_deselect(SP_NODE_CONTEXT(ec)->nodepath);
881             } else {
882                 SP_DT_SELECTION(dt)->clear();
883             }
884             break;
885         default:
886             break;
887     }
889 } // end of sp_verb_action_edit_perform()
891 /** \brief  Decode the verb code and take appropriate action */
892 void
893 SelectionVerb::perform(SPAction *action, void *data, void *pdata)
895     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
897     if (!dt)
898         return;
900     switch (reinterpret_cast<std::size_t>(data)) {
901         case SP_VERB_SELECTION_TO_FRONT:
902             sp_selection_raise_to_top();
903             break;
904         case SP_VERB_SELECTION_TO_BACK:
905             sp_selection_lower_to_bottom();
906             break;
907         case SP_VERB_SELECTION_RAISE:
908             sp_selection_raise();
909             break;
910         case SP_VERB_SELECTION_LOWER:
911             sp_selection_lower();
912             break;
913         case SP_VERB_SELECTION_GROUP:
914             sp_selection_group();
915             break;
916         case SP_VERB_SELECTION_UNGROUP:
917             sp_selection_ungroup();
918             break;
920         case SP_VERB_SELECTION_TEXTTOPATH:
921             text_put_on_path();
922             break;
923         case SP_VERB_SELECTION_TEXTFROMPATH:
924             text_remove_from_path();
925             break;
926         case SP_VERB_SELECTION_REMOVE_KERNS:
927             text_remove_all_kerns();
928             break;
930         case SP_VERB_SELECTION_UNION:
931             sp_selected_path_union();
932             break;
933         case SP_VERB_SELECTION_INTERSECT:
934             sp_selected_path_intersect();
935             break;
936         case SP_VERB_SELECTION_DIFF:
937             sp_selected_path_diff();
938             break;
939         case SP_VERB_SELECTION_SYMDIFF:
940             sp_selected_path_symdiff();
941             break;
943         case SP_VERB_SELECTION_CUT:
944             sp_selected_path_cut();
945             break;
946         case SP_VERB_SELECTION_SLICE:
947             sp_selected_path_slice();
948             break;
950         case SP_VERB_SELECTION_OFFSET:
951             sp_selected_path_offset();
952             break;
953         case SP_VERB_SELECTION_OFFSET_SCREEN:
954             sp_selected_path_offset_screen(1);
955             break;
956         case SP_VERB_SELECTION_OFFSET_SCREEN_10:
957             sp_selected_path_offset_screen(10);
958             break;
959         case SP_VERB_SELECTION_INSET:
960             sp_selected_path_inset();
961             break;
962         case SP_VERB_SELECTION_INSET_SCREEN:
963             sp_selected_path_inset_screen(1);
964             break;
965         case SP_VERB_SELECTION_INSET_SCREEN_10:
966             sp_selected_path_inset_screen(10);
967             break;
968         case SP_VERB_SELECTION_DYNAMIC_OFFSET:
969             sp_selected_path_create_offset_object_zero();
970             break;
971         case SP_VERB_SELECTION_LINKED_OFFSET:
972             sp_selected_path_create_updating_offset_object_zero();
973             break;
975         case SP_VERB_SELECTION_OUTLINE:
976             sp_selected_path_outline();
977             break;
978         case SP_VERB_SELECTION_SIMPLIFY:
979             sp_selected_path_simplify();
980             break;
981         case SP_VERB_SELECTION_REVERSE:
982             sp_selected_path_reverse();
983             break;
984         case SP_VERB_SELECTION_TRACE:
985             dt->_dlg_mgr->showDialog("Trace");
986             break;
987         case SP_VERB_SELECTION_CREATE_BITMAP:
988             sp_selection_create_bitmap_copy();
989             break;
991         case SP_VERB_SELECTION_COMBINE:
992             sp_selected_path_combine();
993             break;
994         case SP_VERB_SELECTION_BREAK_APART:
995             sp_selected_path_break_apart();
996             break;
997         case SP_VERB_SELECTION_GRIDTILE:
998             dt->_dlg_mgr->showDialog("TileDialog");
999             break;
1000         default:
1001             break;
1002     }
1004 } // end of sp_verb_action_selection_perform()
1006 /** \brief  Decode the verb code and take appropriate action */
1007 void
1008 LayerVerb::perform(SPAction *action, void *data, void *pdata)
1010     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1011     unsigned int verb = reinterpret_cast<std::size_t>(data);
1013     if ( !dt || !dt->currentLayer() ) {
1014         return;
1015     }
1017     switch (verb) {
1018         case SP_VERB_LAYER_NEW: {
1019             Inkscape::UI::Dialogs::LayerPropertiesDialog::showCreate(dt, dt->currentLayer());
1020             break;
1021         }
1022         case SP_VERB_LAYER_RENAME: {
1023             Inkscape::UI::Dialogs::LayerPropertiesDialog::showRename(dt, dt->currentLayer());
1024             break;
1025         }
1026         case SP_VERB_LAYER_NEXT: {
1027             SPObject *next=Inkscape::next_layer(dt->currentRoot(), dt->currentLayer());
1028             if (next) {
1029                 dt->setCurrentLayer(next);
1030                 sp_document_done(SP_DT_DOCUMENT(dt));
1031                 dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Moved to next layer."));
1032             } else {
1033                 dt->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Cannot move past last layer."));
1034             }
1035             break;
1036         }
1037         case SP_VERB_LAYER_PREV: {
1038             SPObject *prev=Inkscape::previous_layer(dt->currentRoot(), dt->currentLayer());
1039             if (prev) {
1040                 dt->setCurrentLayer(prev);
1041                 sp_document_done(SP_DT_DOCUMENT(dt));
1042                 dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Moved to previous layer."));
1043             } else {
1044                 dt->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Cannot move past first layer."));
1045             }
1046             break;
1047         }
1048         case SP_VERB_LAYER_MOVE_TO_NEXT: {
1049             sp_selection_to_next_layer();
1050             break;
1051         }
1052         case SP_VERB_LAYER_MOVE_TO_PREV: {
1053             sp_selection_to_prev_layer();
1054             break;
1055         }
1056         case SP_VERB_LAYER_TO_TOP:
1057         case SP_VERB_LAYER_TO_BOTTOM:
1058         case SP_VERB_LAYER_RAISE:
1059         case SP_VERB_LAYER_LOWER: {
1060             if ( dt->currentLayer() == dt->currentRoot() ) {
1061                 dt->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No current layer."));
1062                 return;
1063             }
1065             SPItem *layer=SP_ITEM(dt->currentLayer());
1066             g_return_if_fail(layer != NULL);
1068             SPObject *old_pos=SP_OBJECT_NEXT(layer);
1070             switch (verb) {
1071                 case SP_VERB_LAYER_TO_TOP:
1072                     layer->raiseToTop();
1073                     break;
1074                 case SP_VERB_LAYER_TO_BOTTOM:
1075                     layer->lowerToBottom();
1076                     break;
1077                 case SP_VERB_LAYER_RAISE:
1078                     layer->raiseOne();
1079                     break;
1080                 case SP_VERB_LAYER_LOWER:
1081                     layer->lowerOne();
1082                     break;
1083             }
1085             if ( SP_OBJECT_NEXT(layer) != old_pos ) {
1086                 char const *message = NULL;
1087                 switch (verb) {
1088                     case SP_VERB_LAYER_TO_TOP:
1089                     case SP_VERB_LAYER_RAISE:
1090                         message = g_strdup_printf(_("Raised layer <b>%s</b>."), layer->defaultLabel());
1091                         break;
1092                     case SP_VERB_LAYER_TO_BOTTOM:
1093                     case SP_VERB_LAYER_LOWER:
1094                         message = g_strdup_printf(_("Lowered layer <b>%s</b>."), layer->defaultLabel());
1095                         break;
1096                 };
1097                 sp_document_done(SP_DT_DOCUMENT(dt));
1098                 if (message) {
1099                     dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, message);
1100                     g_free((void *) message);
1101                 }
1102             } else {
1103                 dt->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Cannot move layer any further."));
1104             }
1106             break;
1107         }
1108         case SP_VERB_LAYER_DELETE: {
1109             if ( dt->currentLayer() != dt->currentRoot() ) {
1110                 SP_DT_SELECTION(dt)->clear();
1111                 SPObject *old_layer=dt->currentLayer();
1113                 sp_object_ref(old_layer, NULL);
1114                 SPObject *survivor=Inkscape::next_layer(dt->currentRoot(), old_layer);
1115                 if (!survivor) {
1116                     survivor = Inkscape::previous_layer(dt->currentRoot(), old_layer);
1117                 }
1119                 /* Deleting the old layer before switching layers is a hack to trigger the
1120                  * listeners of the deletion event (as happens when old_layer is deleted using the
1121                  * xml editor).  See
1122                  * http://sourceforge.net/tracker/index.php?func=detail&aid=1339397&group_id=93438&atid=604306
1123                  */
1124                 old_layer->deleteObject();
1125                 sp_object_unref(old_layer, NULL);
1126                 if (survivor) {
1127                     dt->setCurrentLayer(survivor);
1128                 }
1130                 sp_document_done(SP_DT_DOCUMENT(dt));
1132                 // TRANSLATORS: this means "The layer has been deleted."
1133                 dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Deleted layer."));
1134             } else {
1135                 dt->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No current layer."));
1136             }
1137             break;
1138         }
1139     }
1141     return;
1142 } // end of sp_verb_action_layer_perform()
1144 /** \brief  Decode the verb code and take appropriate action */
1145 void
1146 ObjectVerb::perform( SPAction *action, void *data, void *pdata )
1148     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1149     if (!dt)
1150         return;
1152     SPEventContext *ec = dt->event_context;
1154     Inkscape::Selection *sel = SP_DT_SELECTION(dt);
1156     if (sel->isEmpty())
1157         return;
1159     NR::Point const center(sel->bounds().midpoint());
1161     switch (reinterpret_cast<std::size_t>(data)) {
1162         case SP_VERB_OBJECT_ROTATE_90_CW:
1163             sp_selection_rotate_90_cw();
1164             break;
1165         case SP_VERB_OBJECT_ROTATE_90_CCW:
1166             sp_selection_rotate_90_ccw();
1167             break;
1168         case SP_VERB_OBJECT_FLATTEN:
1169             sp_selection_remove_transform();
1170             break;
1171         case SP_VERB_OBJECT_TO_CURVE:
1172             sp_selected_path_to_curves();
1173             break;
1174         case SP_VERB_OBJECT_FLOW_TEXT:
1175             text_flow_into_shape();
1176             break;
1177         case SP_VERB_OBJECT_UNFLOW_TEXT:
1178             text_unflow();
1179             break;
1180         case SP_VERB_OBJECT_FLOWTEXT_TO_TEXT:
1181             SPFlowtext::convert_to_text();
1182             break;
1183         case SP_VERB_OBJECT_FLIP_HORIZONTAL:
1184             if (tools_isactive(dt, TOOLS_NODES)) {
1185                 sp_nodepath_flip(SP_NODE_CONTEXT(ec)->nodepath, NR::X);
1186             } else {
1187                 sp_selection_scale_relative(sel, center, NR::scale(-1.0, 1.0));
1188             }
1189             sp_document_done(SP_DT_DOCUMENT(dt));
1190             break;
1191         case SP_VERB_OBJECT_FLIP_VERTICAL:
1192             if (tools_isactive(dt, TOOLS_NODES)) {
1193                 sp_nodepath_flip(SP_NODE_CONTEXT(ec)->nodepath, NR::Y);
1194             } else {
1195                 sp_selection_scale_relative(sel, center, NR::scale(1.0, -1.0));
1196             }
1197             sp_document_done(SP_DT_DOCUMENT(dt));
1198             break;
1199         default:
1200             break;
1201     }
1203 } // end of sp_verb_action_object_perform()
1205 /** \brief  Decode the verb code and take appropriate action */
1206 void
1207 ContextVerb::perform(SPAction *action, void *data, void *pdata)
1209     SPDesktop *dt;
1210     sp_verb_t verb;
1211     int vidx;
1213     dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1215     if (!dt)
1216         return;
1218     verb = (sp_verb_t)GPOINTER_TO_INT((gpointer)data);
1220     /** \todo !!! hopefully this can go away soon and actions can look after
1221      * themselves
1222      */
1223     for (vidx = SP_VERB_CONTEXT_SELECT; vidx <= SP_VERB_CONTEXT_DROPPER_PREFS; vidx++)
1224     {
1225         SPAction *tool_action= get((sp_verb_t)vidx)->get_action(dt);
1226         if (tool_action) {
1227             sp_action_set_active(tool_action, vidx == (int)verb);
1228         }
1229     }
1231     switch (verb) {
1232         case SP_VERB_CONTEXT_SELECT:
1233             tools_switch_current(TOOLS_SELECT);
1234             break;
1235         case SP_VERB_CONTEXT_NODE:
1236             tools_switch_current(TOOLS_NODES);
1237             break;
1238         case SP_VERB_CONTEXT_RECT:
1239             tools_switch_current(TOOLS_SHAPES_RECT);
1240             break;
1241         case SP_VERB_CONTEXT_ARC:
1242             tools_switch_current(TOOLS_SHAPES_ARC);
1243             break;
1244         case SP_VERB_CONTEXT_STAR:
1245             tools_switch_current(TOOLS_SHAPES_STAR);
1246             break;
1247         case SP_VERB_CONTEXT_SPIRAL:
1248             tools_switch_current(TOOLS_SHAPES_SPIRAL);
1249             break;
1250         case SP_VERB_CONTEXT_PENCIL:
1251             tools_switch_current(TOOLS_FREEHAND_PENCIL);
1252             break;
1253         case SP_VERB_CONTEXT_PEN:
1254             tools_switch_current(TOOLS_FREEHAND_PEN);
1255             break;
1256         case SP_VERB_CONTEXT_CALLIGRAPHIC:
1257             tools_switch_current(TOOLS_CALLIGRAPHIC);
1258             break;
1259         case SP_VERB_CONTEXT_TEXT:
1260             tools_switch_current(TOOLS_TEXT);
1261             break;
1262         case SP_VERB_CONTEXT_GRADIENT:
1263             tools_switch_current(TOOLS_GRADIENT);
1264             break;
1265         case SP_VERB_CONTEXT_ZOOM:
1266             tools_switch_current(TOOLS_ZOOM);
1267             break;
1268         case SP_VERB_CONTEXT_DROPPER:
1269             tools_switch_current(TOOLS_DROPPER);
1270             break;
1271         case SP_VERB_CONTEXT_CONNECTOR:
1272             tools_switch_current (TOOLS_CONNECTOR);
1273             break;
1275         case SP_VERB_CONTEXT_SELECT_PREFS:
1276             prefs_set_int_attribute("dialogs.preferences", "page_top", PREFS_PAGE_TOOLS);
1277             prefs_set_int_attribute("dialogs.preferences", "page_tools", PREFS_PAGE_TOOLS_SELECTOR);
1278             sp_display_dialog();
1279             break;
1280         case SP_VERB_CONTEXT_NODE_PREFS:
1281             prefs_set_int_attribute("dialogs.preferences", "page_top", PREFS_PAGE_TOOLS);
1282             prefs_set_int_attribute("dialogs.preferences", "page_tools", PREFS_PAGE_TOOLS_NODE);
1283             sp_display_dialog();
1284             break;
1285         case SP_VERB_CONTEXT_RECT_PREFS:
1286             prefs_set_int_attribute("dialogs.preferences", "page_top", PREFS_PAGE_TOOLS);
1287             prefs_set_int_attribute("dialogs.preferences", "page_tools", PREFS_PAGE_TOOLS_SHAPES);
1288             prefs_set_int_attribute("dialogs.preferences", "page_shapes", PREFS_PAGE_TOOLS_SHAPES_RECT);
1289             sp_display_dialog();
1290             break;
1291         case SP_VERB_CONTEXT_ARC_PREFS:
1292             prefs_set_int_attribute("dialogs.preferences", "page_top", PREFS_PAGE_TOOLS);
1293             prefs_set_int_attribute("dialogs.preferences", "page_tools", PREFS_PAGE_TOOLS_SHAPES);
1294             prefs_set_int_attribute("dialogs.preferences", "page_shapes", PREFS_PAGE_TOOLS_SHAPES_ELLIPSE);
1295             sp_display_dialog();
1296             break;
1297         case SP_VERB_CONTEXT_STAR_PREFS:
1298             prefs_set_int_attribute("dialogs.preferences", "page_top", PREFS_PAGE_TOOLS);
1299             prefs_set_int_attribute("dialogs.preferences", "page_tools", PREFS_PAGE_TOOLS_SHAPES);
1300             prefs_set_int_attribute("dialogs.preferences", "page_shapes", PREFS_PAGE_TOOLS_SHAPES_STAR);
1301             sp_display_dialog();
1302             break;
1303         case SP_VERB_CONTEXT_SPIRAL_PREFS:
1304             prefs_set_int_attribute("dialogs.preferences", "page_top", PREFS_PAGE_TOOLS);
1305             prefs_set_int_attribute("dialogs.preferences", "page_tools", PREFS_PAGE_TOOLS_SHAPES);
1306             prefs_set_int_attribute("dialogs.preferences", "page_shapes", PREFS_PAGE_TOOLS_SHAPES_SPIRAL);
1307             sp_display_dialog();
1308             break;
1309         case SP_VERB_CONTEXT_PENCIL_PREFS:
1310             prefs_set_int_attribute("dialogs.preferences", "page_top", PREFS_PAGE_TOOLS);
1311             prefs_set_int_attribute("dialogs.preferences", "page_tools", PREFS_PAGE_TOOLS_PENCIL);
1312             sp_display_dialog();
1313             break;
1314         case SP_VERB_CONTEXT_PEN_PREFS:
1315             prefs_set_int_attribute("dialogs.preferences", "page_top", PREFS_PAGE_TOOLS);
1316             prefs_set_int_attribute("dialogs.preferences", "page_tools", PREFS_PAGE_TOOLS_PEN);
1317             sp_display_dialog();
1318             break;
1319         case SP_VERB_CONTEXT_CALLIGRAPHIC_PREFS:
1320             prefs_set_int_attribute("dialogs.preferences", "page_top", PREFS_PAGE_TOOLS);
1321             prefs_set_int_attribute("dialogs.preferences", "page_tools", PREFS_PAGE_TOOLS_CALLIGRAPHY);
1322             sp_display_dialog();
1323             break;
1324         case SP_VERB_CONTEXT_TEXT_PREFS:
1325             prefs_set_int_attribute("dialogs.preferences", "page_top", PREFS_PAGE_TOOLS);
1326             prefs_set_int_attribute("dialogs.preferences", "page_tools", PREFS_PAGE_TOOLS_TEXT);
1327             sp_display_dialog();
1328             break;
1329         case SP_VERB_CONTEXT_GRADIENT_PREFS:
1330             prefs_set_int_attribute("dialogs.preferences", "page_top", PREFS_PAGE_TOOLS);
1331             prefs_set_int_attribute("dialogs.preferences", "page_tools", PREFS_PAGE_TOOLS_GRADIENT);
1332             sp_display_dialog();
1333             break;
1334         case SP_VERB_CONTEXT_ZOOM_PREFS:
1335             prefs_set_int_attribute("dialogs.preferences", "page_top", PREFS_PAGE_TOOLS);
1336             prefs_set_int_attribute("dialogs.preferences", "page_tools", PREFS_PAGE_TOOLS_ZOOM);
1337             sp_display_dialog();
1338             break;
1339         case SP_VERB_CONTEXT_DROPPER_PREFS:
1340             prefs_set_int_attribute("dialogs.preferences", "page_top", PREFS_PAGE_TOOLS);
1341             prefs_set_int_attribute("dialogs.preferences", "page_tools", PREFS_PAGE_TOOLS_DROPPER);
1342             sp_display_dialog();
1343             break;
1344         case SP_VERB_CONTEXT_CONNECTOR_PREFS:
1345             prefs_set_int_attribute ("dialogs.preferences", "page_top", PREFS_PAGE_TOOLS);
1346             prefs_set_int_attribute ("dialogs.preferences", "page_tools", PREFS_PAGE_TOOLS_CONNECTOR);
1347             sp_display_dialog ();
1348             break;
1350         default:
1351             break;
1352     }
1354 } // end of sp_verb_action_ctx_perform()
1356 /** \brief  Decode the verb code and take appropriate action */
1357 void
1358 ZoomVerb::perform(SPAction *action, void *data, void *pdata)
1360     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1361     if (!dt)
1362         return;
1364     SPDocument *doc = SP_DT_DOCUMENT(dt);
1366     Inkscape::XML::Node *repr = SP_OBJECT_REPR(dt->namedview);
1368     gdouble zoom_inc =
1369         prefs_get_double_attribute_limited( "options.zoomincrement",
1370                                             "value", 1.414213562, 1.01, 10 );
1372     switch (GPOINTER_TO_INT(data)) {
1373         case SP_VERB_ZOOM_IN:
1374         {
1375             NR::Rect const d = dt->get_display_area();
1376             dt->zoom_relative( d.midpoint()[NR::X], d.midpoint()[NR::Y], zoom_inc);
1377             break;
1378         }
1379         case SP_VERB_ZOOM_OUT:
1380         {
1381             NR::Rect const d = dt->get_display_area();
1382             dt->zoom_relative( d.midpoint()[NR::X], d.midpoint()[NR::Y], 1 / zoom_inc );
1383             break;
1384         }
1385         case SP_VERB_ZOOM_1_1:
1386         {
1387             NR::Rect const d = dt->get_display_area();
1388             dt->zoom_absolute( d.midpoint()[NR::X], d.midpoint()[NR::Y], 1.0 );
1389             break;
1390         }
1391         case SP_VERB_ZOOM_1_2:
1392         {
1393             NR::Rect const d = dt->get_display_area();
1394             dt->zoom_absolute( d.midpoint()[NR::X], d.midpoint()[NR::Y], 0.5);
1395             break;
1396         }
1397         case SP_VERB_ZOOM_2_1:
1398         {
1399             NR::Rect const d = dt->get_display_area();
1400             dt->zoom_absolute( d.midpoint()[NR::X], d.midpoint()[NR::Y], 2.0 );
1401             break;
1402         }
1403         case SP_VERB_ZOOM_PAGE:
1404             dt->zoom_page();
1405             break;
1406         case SP_VERB_ZOOM_PAGE_WIDTH:
1407             dt->zoom_page_width();
1408             break;
1409         case SP_VERB_ZOOM_DRAWING:
1410             dt->zoom_drawing();
1411             break;
1412         case SP_VERB_ZOOM_SELECTION:
1413             dt->zoom_selection();
1414             break;
1415         case SP_VERB_ZOOM_NEXT:
1416             dt->next_zoom();
1417             break;
1418         case SP_VERB_ZOOM_PREV:
1419             dt->prev_zoom();
1420             break;
1421         case SP_VERB_TOGGLE_RULERS:
1422             dt->toggleRulers();
1423             break;
1424         case SP_VERB_TOGGLE_SCROLLBARS:
1425             dt->toggleScrollbars();
1426             break;
1427         case SP_VERB_TOGGLE_GUIDES:
1428             sp_namedview_toggle_guides(doc, repr);
1429             break;
1430         case SP_VERB_TOGGLE_GRID:
1431             sp_namedview_toggle_grid(doc, repr);
1432             break;
1433 #ifdef HAVE_GTK_WINDOW_FULLSCREEN
1434         case SP_VERB_FULLSCREEN:
1435             dt->fullscreen();
1436             break;
1437 #endif /* HAVE_GTK_WINDOW_FULLSCREEN */
1438         case SP_VERB_VIEW_NEW:
1439             sp_ui_new_view();
1440             break;
1441         case SP_VERB_VIEW_NEW_PREVIEW:
1442             sp_ui_new_view_preview();
1443             break;
1444         case SP_VERB_VIEW_MODE_NORMAL:
1445             dt->setDisplayModeNormal();
1446             break;
1447         case SP_VERB_VIEW_MODE_OUTLINE:
1448             dt->setDisplayModeOutline();
1449             break;
1450         case SP_VERB_VIEW_ICON_PREVIEW:
1451             show_panel( Inkscape::UI::Dialogs::IconPreviewPanel::getInstance(), "dialogs.iconpreview", SP_VERB_VIEW_ICON_PREVIEW );
1452             break;
1453         default:
1454             break;
1455     }
1457 } // end of sp_verb_action_zoom_perform()
1459 /** \brief  Decode the verb code and take appropriate action */
1460 void
1461 DialogVerb::perform(SPAction *action, void *data, void *pdata)
1463     if (reinterpret_cast<std::size_t>(data) != SP_VERB_DIALOG_TOGGLE) {
1464         // unhide all when opening a new dialog
1465         inkscape_dialogs_unhide();
1466     }
1468     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1469     g_assert(dt->_dlg_mgr != NULL);
1471     switch (reinterpret_cast<std::size_t>(data)) {
1472         case SP_VERB_DIALOG_DISPLAY:
1473             //sp_display_dialog();
1474             dt->_dlg_mgr->showDialog("InkscapePreferences");
1475             break;
1476         case SP_VERB_DIALOG_METADATA:
1477             // sp_desktop_dialog();
1478             dt->_dlg_mgr->showDialog("DocumentMetadata");
1479             break;
1480         case SP_VERB_DIALOG_NAMEDVIEW:
1481             // sp_desktop_dialog();
1482             dt->_dlg_mgr->showDialog("DocumentProperties");
1483             break;
1484         case SP_VERB_DIALOG_FILL_STROKE:
1485             sp_object_properties_dialog();
1486             break;
1487         case SP_VERB_DIALOG_SWATCHES:
1488             show_panel( Inkscape::UI::Dialogs::SwatchesPanel::getInstance(), "dialogs.swatches", SP_VERB_DIALOG_SWATCHES);
1489             break;
1490         case SP_VERB_DIALOG_TRANSFORM:
1491             dt->_dlg_mgr->showDialog("Transformation");
1492             break;
1493         case SP_VERB_DIALOG_ALIGN_DISTRIBUTE:
1494             dt->_dlg_mgr->showDialog("AlignAndDistribute");
1495             break;
1496         case SP_VERB_DIALOG_TEXT:
1497             sp_text_edit_dialog();
1498             break;
1499         case SP_VERB_DIALOG_XML_EDITOR:
1500             sp_xml_tree_dialog();
1501             break;
1502         case SP_VERB_DIALOG_FIND:
1503             sp_find_dialog();
1504             break;
1505         case SP_VERB_DIALOG_DEBUG:
1506             dt->_dlg_mgr->showDialog("Messages");
1507             break;
1508         case SP_VERB_DIALOG_SCRIPT:
1509             dt->_dlg_mgr->showDialog("Script");
1510             break;
1511         case SP_VERB_DIALOG_TOGGLE:
1512             inkscape_dialogs_toggle();
1513             break;
1514         case SP_VERB_DIALOG_CLONETILER:
1515             clonetiler_dialog();
1516             break;
1517         case SP_VERB_DIALOG_ITEM:
1518             sp_item_dialog();
1519             break;
1520 #ifdef WITH_INKBOARD
1521         case SP_VERB_DIALOG_WHITEBOARD_CONNECT: {
1522             // We need to ensure that this dialog is associated with the correct SessionManager,
1523             // since the user may have opened a new document (and hence swapped SessionManager
1524             // instances) sometime before this dialog invocation
1525             Inkscape::UI::Dialog::WhiteboardConnectDialogImpl *dlg = dynamic_cast< Inkscape::UI::Dialog::WhiteboardConnectDialogImpl *>(dt->_dlg_mgr->getDialog("WhiteboardConnect"));
1526             dlg->setSessionManager();
1527             dt->_dlg_mgr->showDialog("WhiteboardConnect");
1528             break;
1529         }
1530         case SP_VERB_DIALOG_WHITEBOARD_SHAREWITHUSER: {
1531             //sp_whiteboard_sharewithuser_dialog(NULL);
1532             Inkscape::Whiteboard::SessionManager *sm = SP_ACTIVE_DESKTOP->whiteboard_session_manager();
1533             if (sm->session_data && sm->session_data->status[Inkscape::Whiteboard::LOGGED_IN]) {
1534                 // We need to ensure that this dialog is associated with the correct SessionManager,
1535                 // since the user may have opened a new document (and hence swapped SessionManager
1536                 // instances) sometime before this dialog invocation
1537                 Inkscape::UI::Dialog::WhiteboardShareWithUserDialogImpl *dlg = dynamic_cast< Inkscape::UI::Dialog::WhiteboardShareWithUserDialogImpl *>(dt->_dlg_mgr->getDialog("WhiteboardShareWithUser"));
1538                 dlg->setSessionManager();
1539                 dt->_dlg_mgr->showDialog("WhiteboardShareWithUser");
1540             } else {
1541                 Gtk::MessageDialog dlg(_("You need to connect to a Jabber server before sharing a document with another user."), true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_CLOSE);
1542                 dlg.run();
1543             }
1544             break;
1545         }
1546         case SP_VERB_DIALOG_WHITEBOARD_SHAREWITHCHAT: {
1547             Inkscape::Whiteboard::SessionManager *sm = SP_ACTIVE_DESKTOP->whiteboard_session_manager();
1548             if (sm->session_data && sm->session_data->status[Inkscape::Whiteboard::LOGGED_IN]) {
1549                 // We need to ensure that this dialog is associated with the correct SessionManager,
1550                 // since the user may have opened a new document (and hence swapped SessionManager
1551                 // instances) sometime before this dialog invocation
1552                 Inkscape::UI::Dialog::WhiteboardShareWithChatroomDialogImpl *dlg = dynamic_cast< Inkscape::UI::Dialog::WhiteboardShareWithChatroomDialogImpl *>(dt->_dlg_mgr->getDialog("WhiteboardShareWithChat"));
1553                 dlg->setSessionManager();
1554                 dt->_dlg_mgr->showDialog("WhiteboardShareWithChat");
1555             } else {
1556                 Gtk::MessageDialog dlg(_("You need to connect to a Jabber server before sharing a document with a chatroom."), true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_CLOSE);
1557                 dlg.run();
1558             }
1559             break;
1560         }
1562         case SP_VERB_DIALOG_WHITEBOARD_DUMPXMLTRACKER:
1563             if (SP_ACTIVE_DESKTOP->whiteboard_session_manager()->node_tracker()) {
1564                 SP_ACTIVE_DESKTOP->whiteboard_session_manager()->node_tracker()->dump();
1565             } else {
1566                 g_log(NULL, G_LOG_LEVEL_DEBUG, _("XML node tracker has not been initialized; nothing to dump"));
1567             }
1568             break;
1569         case SP_VERB_DIALOG_WHITEBOARD_OPENSESSIONFILE: {
1570             Gtk::FileChooserDialog sessionfiledlg(_("Open session file"), Gtk::FILE_CHOOSER_ACTION_OPEN);
1571             sessionfiledlg.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
1572             sessionfiledlg.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK);
1574             int result = sessionfiledlg.run();
1575             switch (result) {
1576                 case Gtk::RESPONSE_OK:
1577                 {
1578                     SP_ACTIVE_DESKTOP->whiteboard_session_manager()->clearDocument();
1579                     SP_ACTIVE_DESKTOP->whiteboard_session_manager()->loadSessionFile(sessionfiledlg.get_filename());
1580                     dt->_dlg_mgr->showDialog("SessionPlayer");
1581                     //SP_ACTIVE_DESKTOP->whiteboard_session_manager()->session_player()->start();
1582                     break;
1583                 }
1584                 case Gtk::RESPONSE_CANCEL:
1585                 default:
1586                     break;
1587             }
1588             break;
1589         }
1591                 case SP_VERB_DIALOG_WHITEBOARD_DISCONNECT_FROM_SESSION:
1592                 {
1593             Inkscape::Whiteboard::SessionManager *sm = SP_ACTIVE_DESKTOP->whiteboard_session_manager();
1594             if (sm->session_data && sm->session_data->status[Inkscape::Whiteboard::IN_WHITEBOARD]) {
1595                                 SP_ACTIVE_DESKTOP->whiteboard_session_manager()->disconnectFromDocument();
1596                         }
1597                         break;
1598                 }
1599                 case SP_VERB_DIALOG_WHITEBOARD_DISCONNECT_FROM_SERVER:
1600                 {
1601             Inkscape::Whiteboard::SessionManager *sm = SP_ACTIVE_DESKTOP->whiteboard_session_manager();
1602             if (sm->session_data && sm->session_data->status[Inkscape::Whiteboard::LOGGED_IN]) {
1603                                 SP_ACTIVE_DESKTOP->whiteboard_session_manager()->disconnectFromServer();
1604                         }
1605                         break;
1606                 }
1607 #endif
1608         case SP_VERB_DIALOG_INPUT:
1609             sp_input_dialog();
1610             break;
1611         default:
1612             break;
1613     }
1614 } // end of sp_verb_action_dialog_perform()
1616 /** \brief  Decode the verb code and take appropriate action */
1617 void
1618 HelpVerb::perform(SPAction *action, void *data, void *pdata)
1620     SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1621     g_assert(dt->_dlg_mgr != NULL);
1623     switch (reinterpret_cast<std::size_t>(data)) {
1624         case SP_VERB_HELP_KEYS:
1625             /* TRANSLATORS: If you have translated the keys.svg file to your language, then
1626                translate this string as "keys.LANG.svg" (where LANG is your language code);
1627                otherwise leave as "keys.svg". */
1628             sp_help_open_screen(_("keys.svg"));
1629             break;
1630         case SP_VERB_HELP_ABOUT:
1631             sp_help_about();
1632             break;
1633         case SP_VERB_HELP_ABOUT_EXTENSIONS: {
1634             Inkscape::UI::Dialogs::ExtensionsPanel *panel = new Inkscape::UI::Dialogs::ExtensionsPanel();
1635             panel->set_full(true);
1636             show_panel( *panel, "dialogs.aboutextensions", SP_VERB_HELP_ABOUT_EXTENSIONS );
1637             break;
1638         }
1640         /*
1641         case SP_VERB_SHOW_LICENSE:
1642             // TRANSLATORS: See "tutorial-basic.svg" comment.
1643             sp_help_open_tutorial(NULL, (gpointer) _("gpl-2.svg"));
1644             break;
1645         */
1647         case SP_VERB_HELP_MEMORY:
1648             dt->_dlg_mgr->showDialog("Memory");
1649             break;
1650         default:
1651             break;
1652     }
1653 } // end of sp_verb_action_help_perform()
1655 /** \brief  Decode the verb code and take appropriate action */
1656 void
1657 TutorialVerb::perform(SPAction *action, void *data, void *pdata)
1659     switch (reinterpret_cast<std::size_t>(data)) {
1660         case SP_VERB_TUTORIAL_BASIC:
1661             /* TRANSLATORS: If you have translated the tutorial-basic.svg file to your language,
1662                then translate this string as "tutorial-basic.LANG.svg" (where LANG is your language
1663                code); otherwise leave as "tutorial-basic.svg". */
1664             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-basic.svg"));
1665             break;
1666         case SP_VERB_TUTORIAL_SHAPES:
1667             // TRANSLATORS: See "tutorial-basic.svg" comment.
1668             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-shapes.svg"));
1669             break;
1670         case SP_VERB_TUTORIAL_ADVANCED:
1671             // TRANSLATORS: See "tutorial-basic.svg" comment.
1672             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-advanced.svg"));
1673             break;
1674         case SP_VERB_TUTORIAL_TRACING:
1675             // TRANSLATORS: See "tutorial-basic.svg" comment.
1676             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-tracing.svg"));
1677             break;
1678         case SP_VERB_TUTORIAL_CALLIGRAPHY:
1679             // TRANSLATORS: See "tutorial-basic.svg" comment.
1680             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-calligraphy.svg"));
1681             break;
1682         case SP_VERB_TUTORIAL_DESIGN:
1683             // TRANSLATORS: See "tutorial-basic.svg" comment.
1684             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-elements.svg"));
1685             break;
1686         case SP_VERB_TUTORIAL_TIPS:
1687             // TRANSLATORS: See "tutorial-basic.svg" comment.
1688             sp_help_open_tutorial(NULL, (gpointer)_("tutorial-tips.svg"));
1689             break;
1690         default:
1691             break;
1692     }
1693 } // end of sp_verb_action_tutorial_perform()
1696 /**
1697  * Action vector to define functions called if a staticly defined file verb
1698  * is called.
1699  */
1700 SPActionEventVector FileVerb::vector =
1701             {{NULL},FileVerb::perform, NULL, NULL, NULL};
1702 /**
1703  * Action vector to define functions called if a staticly defined edit verb is
1704  * called.
1705  */
1706 SPActionEventVector EditVerb::vector =
1707             {{NULL},EditVerb::perform, NULL, NULL, NULL};
1709 /**
1710  * Action vector to define functions called if a staticly defined selection
1711  * verb is called
1712  */
1713 SPActionEventVector SelectionVerb::vector =
1714             {{NULL},SelectionVerb::perform, NULL, NULL, NULL};
1716 /**
1717  * Action vector to define functions called if a staticly defined layer
1718  * verb is called
1719  */
1720 SPActionEventVector LayerVerb::vector =
1721             {{NULL}, LayerVerb::perform, NULL, NULL, NULL};
1723 /**
1724  * Action vector to define functions called if a staticly defined object
1725  * editing verb is called
1726  */
1727 SPActionEventVector ObjectVerb::vector =
1728             {{NULL},ObjectVerb::perform, NULL, NULL, NULL};
1730 /**
1731  * Action vector to define functions called if a staticly defined context
1732  * verb is called
1733  */
1734 SPActionEventVector ContextVerb::vector =
1735             {{NULL},ContextVerb::perform, NULL, NULL, NULL};
1737 /**
1738  * Action vector to define functions called if a staticly defined zoom verb
1739  * is called
1740  */
1741 SPActionEventVector ZoomVerb::vector =
1742             {{NULL},ZoomVerb::perform, NULL, NULL, NULL};
1745 /**
1746  * Action vector to define functions called if a staticly defined dialog verb
1747  * is called
1748  */
1749 SPActionEventVector DialogVerb::vector =
1750             {{NULL},DialogVerb::perform, NULL, NULL, NULL};
1752 /**
1753  * Action vector to define functions called if a staticly defined help verb
1754  * is called
1755  */
1756 SPActionEventVector HelpVerb::vector =
1757             {{NULL},HelpVerb::perform, NULL, NULL, NULL};
1760 /* *********** Effect Last ********** */
1761 /**
1762  * Action vector to define functions called if a staticly defined tutorial verb
1763  * is called
1764  */
1765 SPActionEventVector TutorialVerb::vector =
1766             {{NULL},TutorialVerb::perform, NULL, NULL, NULL};
1768 /** \brief A class to represent the last effect issued */
1769 class EffectLastVerb : public Verb {
1770 private:
1771     static void perform(SPAction *action, void *mydata, void *otherdata);
1772     static SPActionEventVector vector;
1773 protected:
1774     virtual SPAction *make_action(Inkscape::UI::View::View *view);
1775 public:
1776     /** \brief Use the Verb initializer with the same parameters. */
1777     EffectLastVerb(unsigned int const code,
1778                    gchar const *id,
1779                    gchar const *name,
1780                    gchar const *tip,
1781                    gchar const *image) :
1782         Verb(code, id, name, tip, image)
1783     {
1784         set_default_sensitive(false);
1785     }
1786 }; /* EffectLastVerb class */
1788 /**
1789  * The vector to attach in the last effect verb.
1790  */
1791 SPActionEventVector EffectLastVerb::vector =
1792             {{NULL},EffectLastVerb::perform, NULL, NULL, NULL};
1794 /** \brief  Create an action for a \c EffectLastVerb
1795     \param  view  Which view the action should be created for
1796     \return The built action.
1798     Calls \c make_action_helper with the \c vector.
1799 */
1800 SPAction *
1801 EffectLastVerb::make_action(Inkscape::UI::View::View *view)
1803     return make_action_helper(view, &vector);
1806 /** \brief  Decode the verb code and take appropriate action */
1807 void
1808 EffectLastVerb::perform(SPAction *action, void *data, void *pdata)
1810     /* These aren't used, but are here to remind people not to use
1811        the CURRENT_DOCUMENT macros unless they really have to. */
1812     Inkscape::UI::View::View *current_view = sp_action_get_view(action);
1813     // SPDocument *current_document = SP_VIEW_DOCUMENT(current_view);
1814     Inkscape::Extension::Effect *effect = Inkscape::Extension::Effect::get_last_effect();
1816     if (effect == NULL) return;
1817     if (current_view == NULL) return;
1819     switch ((long) data) {
1820         case SP_VERB_EFFECT_LAST_PREF:
1821             if (!effect->prefs(current_view))
1822                 return;
1823             /* Note: fall through */
1824         case SP_VERB_EFFECT_LAST:
1825             effect->effect(current_view);
1826             break;
1827         default:
1828             return;
1829     }
1831     return;
1833 /* *********** End Effect Last ********** */
1835 /* these must be in the same order as the SP_VERB_* enum in "verbs.h" */
1836 Verb *Verb::_base_verbs[] = {
1837     /* Header */
1838     new Verb(SP_VERB_INVALID, NULL, NULL, NULL, NULL),
1839     new Verb(SP_VERB_NONE, "None", N_("None"), N_("Does nothing"), NULL),
1841     /* File */
1842     new FileVerb(SP_VERB_FILE_NEW, "FileNew", N_("Default"), N_("Create new document from default template"),
1843                  GTK_STOCK_NEW ),
1844     new FileVerb(SP_VERB_FILE_OPEN, "FileOpen", N_("_Open..."),
1845                  N_("Open existing document"), GTK_STOCK_OPEN ),
1846     new FileVerb(SP_VERB_FILE_REVERT, "FileRevert", N_("Re_vert"),
1847                  N_("Revert to the last saved version of document (changes will be lost)"), GTK_STOCK_REVERT_TO_SAVED ),
1848     new FileVerb(SP_VERB_FILE_SAVE, "FileSave", N_("_Save"), N_("Save document"),
1849                  GTK_STOCK_SAVE ),
1850     new FileVerb(SP_VERB_FILE_SAVE_AS, "FileSaveAs", N_("Save _As..."),
1851                  N_("Save document under new name"), GTK_STOCK_SAVE_AS ),
1852     new FileVerb(SP_VERB_FILE_PRINT, "FilePrint", N_("_Print..."), N_("Print document"),
1853                  GTK_STOCK_PRINT ),
1854     // TRANSLATORS: "Vacuum Defs" means "Clean up defs" (so as to remove unused definitions)
1855     new FileVerb(SP_VERB_FILE_VACUUM, "FileVacuum", N_("Vac_uum Defs"), N_("Remove unused predefined items from the &lt;defs&gt; of the document"),
1856                  "file_vacuum" ),
1857     new FileVerb(SP_VERB_FILE_PRINT_DIRECT, "FilePrintDirect", N_("Print _Direct"),
1858                  N_("Print directly without prompting to a file or pipe"), NULL ),
1859     new FileVerb(SP_VERB_FILE_PRINT_PREVIEW, "FilePrintPreview", N_("Print Previe_w"),
1860                  N_("Preview document printout"), GTK_STOCK_PRINT_PREVIEW ),
1861     new FileVerb(SP_VERB_FILE_IMPORT, "FileImport", N_("_Import..."),
1862                  N_("Import bitmap or SVG image into document"), "file_import"),
1863     new FileVerb(SP_VERB_FILE_EXPORT, "FileExport", N_("_Export Bitmap..."),
1864                  N_("Export document or selection as a bitmap image"), "file_export"),
1865     new FileVerb(SP_VERB_FILE_NEXT_DESKTOP, "FileNextDesktop", N_("N_ext Window"),
1866                  N_("Switch to the next document window"), "window_next"),
1867     new FileVerb(SP_VERB_FILE_PREV_DESKTOP, "FilePrevDesktop", N_("P_revious Window"),
1868                  N_("Switch to the previous document window"), "window_previous"),
1869     new FileVerb(SP_VERB_FILE_CLOSE_VIEW, "FileCloseView", N_("_Close"),
1870                  N_("Close window"), GTK_STOCK_CLOSE),
1871     new FileVerb(SP_VERB_FILE_QUIT, "FileQuit", N_("_Quit"), N_("Quit Inkscape"), GTK_STOCK_QUIT),
1873     /* Edit */
1874     new EditVerb(SP_VERB_EDIT_UNDO, "EditUndo", N_("_Undo"), N_("Undo last action"),
1875                  GTK_STOCK_UNDO),
1876     new EditVerb(SP_VERB_EDIT_REDO, "EditRedo", N_("_Redo"),
1877                  N_("Do again last undone action"), GTK_STOCK_REDO),
1878     new EditVerb(SP_VERB_EDIT_CUT, "EditCut", N_("Cu_t"),
1879                  N_("Cut selection to clipboard"), GTK_STOCK_CUT),
1880     new EditVerb(SP_VERB_EDIT_COPY, "EditCopy", N_("_Copy"),
1881                  N_("Copy selection to clipboard"), GTK_STOCK_COPY),
1882     new EditVerb(SP_VERB_EDIT_PASTE, "EditPaste", N_("_Paste"),
1883                  N_("Paste objects from clipboard to mouse point"), GTK_STOCK_PASTE),
1884     new EditVerb(SP_VERB_EDIT_PASTE_STYLE, "EditPasteStyle", N_("Paste _Style"),
1885                  N_("Apply style of the copied object to selection"), "selection_paste_style"),
1886     new EditVerb(SP_VERB_EDIT_PASTE_IN_PLACE, "EditPasteInPlace", N_("Paste _In Place"),
1887                  N_("Paste objects from clipboard to the original location"), "selection_paste_in_place"),
1888     new EditVerb(SP_VERB_EDIT_DELETE, "EditDelete", N_("_Delete"),
1889                  N_("Delete selection"), GTK_STOCK_DELETE),
1890     new EditVerb(SP_VERB_EDIT_DUPLICATE, "EditDuplicate", N_("Duplic_ate"),
1891                  N_("Duplicate selected objects"), "edit_duplicate"),
1892     new EditVerb(SP_VERB_EDIT_CLONE, "EditClone", N_("Clo_ne"),
1893                  N_("Create a clone of selected object (a copy linked to the original)"), "edit_clone"),
1894     new EditVerb(SP_VERB_EDIT_UNLINK_CLONE, "EditUnlinkClone", N_("Unlin_k Clone"),
1895                  N_("Cut the clone's link to its original"), "edit_unlink_clone"),
1896     new EditVerb(SP_VERB_EDIT_CLONE_ORIGINAL, "EditCloneOriginal", N_("Select _Original"),
1897                  N_("Select the object to which the clone is linked"), NULL),
1898     // TRANSLATORS: Convert selection to a rectangle with tiled pattern fill
1899     new EditVerb(SP_VERB_EDIT_TILE, "EditTile", N_("O_bjects to Pattern"),
1900                  N_("Convert selection to a rectangle with tiled pattern fill"), NULL),
1901     // TRANSLATORS: Extract objects from a tiled pattern fill
1902     new EditVerb(SP_VERB_EDIT_UNTILE, "EditUnTile", N_("Pattern to Ob_jects"),
1903                  N_("Extract objects from a tiled pattern fill"), NULL),
1904     new EditVerb(SP_VERB_EDIT_CLEAR_ALL, "EditClearAll", N_("Clea_r All"),
1905                  N_("Delete all objects from document"), NULL),
1906     new EditVerb(SP_VERB_EDIT_SELECT_ALL, "EditSelectAll", N_("Select Al_l"),
1907                  N_("Select all objects or all nodes"), "selection_select_all"),
1908     new EditVerb(SP_VERB_EDIT_SELECT_ALL_IN_ALL_LAYERS, "EditSelectAllInAllLayers", N_("Select All in All La_yers"),
1909                  N_("Select all objects in all visible and unlocked layers"), NULL),
1910     new EditVerb(SP_VERB_EDIT_INVERT, "EditInvert", N_("In_vert Selection"),
1911                  N_("Invert selection (unselect what is selected and select everything else)"), NULL),
1912     new EditVerb(SP_VERB_EDIT_INVERT_IN_ALL_LAYERS, "EditInvertInAllLayers", N_("Invert in All Layers"),
1913                  N_("Invert selection in all visible and unlocked layers"), NULL),
1914     new EditVerb(SP_VERB_EDIT_DESELECT, "EditDeselect", N_("D_eselect"),
1915                  N_("Deselect any selected objects or nodes"), NULL),
1917     /* Selection */
1918     new SelectionVerb(SP_VERB_SELECTION_TO_FRONT, "SelectionToFront", N_("Raise to _Top"),
1919                       N_("Raise selection to top"), "selection_top"),
1920     new SelectionVerb(SP_VERB_SELECTION_TO_BACK, "SelectionToBack", N_("Lower to _Bottom"),
1921                       N_("Lower selection to bottom"), "selection_bot"),
1922     new SelectionVerb(SP_VERB_SELECTION_RAISE, "SelectionRaise", N_("_Raise"),
1923                       N_("Raise selection one step"), "selection_up"),
1924     new SelectionVerb(SP_VERB_SELECTION_LOWER, "SelectionLower", N_("_Lower"),
1925                       N_("Lower selection one step"), "selection_down"),
1926     new SelectionVerb(SP_VERB_SELECTION_GROUP, "SelectionGroup", N_("_Group"),
1927                       N_("Group selected objects"), "selection_group"),
1928     new SelectionVerb(SP_VERB_SELECTION_UNGROUP, "SelectionUnGroup", N_("_Ungroup"),
1929                       N_("Ungroup selected groups"), "selection_ungroup"),
1931     new SelectionVerb(SP_VERB_SELECTION_TEXTTOPATH, "SelectionTextToPath", N_("_Put on Path"),
1932                       N_("Put text on path"), NULL),
1933     new SelectionVerb(SP_VERB_SELECTION_TEXTFROMPATH, "SelectionTextFromPath", N_("_Remove from Path"),
1934                       N_("Remove text from path"), NULL),
1935     new SelectionVerb(SP_VERB_SELECTION_REMOVE_KERNS, "SelectionTextRemoveKerns", N_("Remove Manual _Kerns"),
1936                       // TRANSLATORS: "glyph": An image used in the visual representation of characters;
1937                       //  roughly speaking, how a character looks. A font is a set of glyphs.
1938                       N_("Remove all manual kerns and glyph rotations from a text object"), NULL),
1940     new SelectionVerb(SP_VERB_SELECTION_UNION, "SelectionUnion", N_("_Union"),
1941                       N_("Union of selected objects"), "union"),
1942     new SelectionVerb(SP_VERB_SELECTION_INTERSECT, "SelectionIntersect", N_("_Intersection"),
1943                       N_("Intersection of selected objects"), "intersection"),
1944     new SelectionVerb(SP_VERB_SELECTION_DIFF, "SelectionDiff", N_("_Difference"),
1945                       N_("Difference of selected objects (bottom minus top)"), "difference"),
1946     new SelectionVerb(SP_VERB_SELECTION_SYMDIFF, "SelectionSymDiff", N_("E_xclusion"),
1947                       N_("Exclusive OR of selected objects"), "exclusion"),
1948     new SelectionVerb(SP_VERB_SELECTION_CUT, "SelectionDivide", N_("Di_vision"),
1949                       N_("Cut the bottom object into pieces"), "division"),
1950     // TRANSLATORS: "to cut a path" is not the same as "to break a path apart" - see the
1951     // Advanced tutorial for more info
1952     new SelectionVerb(SP_VERB_SELECTION_SLICE, "SelectionCutPath", N_("Cut _Path"),
1953                       N_("Cut the bottom object's stroke into pieces, removing fill"), "cut_path"),
1954     // TRANSLATORS: "outset": expand a shape by offsetting the object's path,
1955     // i.e. by displacing it perpendicular to the path in each point.
1956     // See also the Advanced Tutorial for explanation.
1957     new SelectionVerb(SP_VERB_SELECTION_OFFSET, "SelectionOffset", N_("Outs_et"),
1958                       N_("Outset selected paths"), "outset_path"),
1959     new SelectionVerb(SP_VERB_SELECTION_OFFSET_SCREEN, "SelectionOffsetScreen",
1960                       N_("O_utset Path by 1 px"),
1961                       N_("Outset selected paths by 1 px"), NULL),
1962     new SelectionVerb(SP_VERB_SELECTION_OFFSET_SCREEN_10, "SelectionOffsetScreen10",
1963                       N_("O_utset Path by 10 px"),
1964                       N_("Outset selected paths by 10 px"), NULL),
1965     // TRANSLATORS: "inset": contract a shape by offsetting the object's path,
1966     // i.e. by displacing it perpendicular to the path in each point.
1967     // See also the Advanced Tutorial for explanation.
1968     new SelectionVerb(SP_VERB_SELECTION_INSET, "SelectionInset", N_("I_nset"),
1969                       N_("Inset selected paths"), "inset_path"),
1970     new SelectionVerb(SP_VERB_SELECTION_INSET_SCREEN, "SelectionInsetScreen",
1971                       N_("I_nset Path by 1 px"),
1972                       N_("Inset selected paths by 1 px"), NULL),
1973     new SelectionVerb(SP_VERB_SELECTION_INSET_SCREEN_10, "SelectionInsetScreen",
1974                       N_("I_nset Path by 10 px"),
1975                       N_("Inset selected paths by 10 px"), NULL),
1976     new SelectionVerb(SP_VERB_SELECTION_DYNAMIC_OFFSET, "SelectionDynOffset",
1977                       N_("D_ynamic Offset"), N_("Create a dynamic offset object"), "dynamic_offset"),
1978     new SelectionVerb(SP_VERB_SELECTION_LINKED_OFFSET, "SelectionLinkedOffset",
1979                       N_("_Linked Offset"),
1980                       N_("Create a dynamic offset object linked to the original path"),
1981                       "linked_offset"),
1982     new SelectionVerb(SP_VERB_SELECTION_OUTLINE, "SelectionOutline", N_("_Stroke to Path"),
1983                       N_("Convert selected strokes to paths"), "stroke_tocurve"),
1984     new SelectionVerb(SP_VERB_SELECTION_SIMPLIFY, "SelectionSimplify", N_("Si_mplify"),
1985                       N_("Simplify selected paths by removing extra nodes"), "simplify"),
1986     new SelectionVerb(SP_VERB_SELECTION_REVERSE, "SelectionReverse", N_("_Reverse"),
1987                       N_("Reverses the direction of selected paths; useful for flipping markers"), "selection_reverse"),
1988     // TRANSLATORS: "to trace" means "to convert a bitmap to vector graphics" (to vectorize)
1989     new SelectionVerb(SP_VERB_SELECTION_TRACE, "SelectionTrace", N_("_Trace Bitmap"),
1990                       N_("Convert bitmap object to paths"), "selection_trace"),
1991     new SelectionVerb(SP_VERB_SELECTION_CREATE_BITMAP, "SelectionCreateBitmap", N_("_Make a Bitmap Copy"),
1992                       N_("Export selection to a bitmap and insert it into document"), "selection_bitmap" ),
1993     new SelectionVerb(SP_VERB_SELECTION_COMBINE, "SelectionCombine", N_("_Combine"),
1994                       N_("Combine several paths into one"), "selection_combine"),
1995     // TRANSLATORS: "to cut a path" is not the same as "to break a path apart" - see the
1996     // Advanced tutorial for more info
1997     new SelectionVerb(SP_VERB_SELECTION_BREAK_APART, "SelectionBreakApart", N_("Break _Apart"),
1998                       N_("Break selected paths into subpaths"), "selection_break"),
1999     new SelectionVerb(SP_VERB_SELECTION_GRIDTILE, "SelectionGridTile", N_("Gri_d Arrange..."),
2000                       N_("Arrange selection in grid pattern"), "grid_arrange"),
2001     /* Layer */
2002     new LayerVerb(SP_VERB_LAYER_NEW, "LayerNew", N_("_Add Layer..."),
2003                   N_("Create a new layer"), "new_layer"),
2004     new LayerVerb(SP_VERB_LAYER_RENAME, "LayerRename", N_("Re_name Layer..."),
2005                   N_("Rename the current layer"), "rename_layer"),
2006     new LayerVerb(SP_VERB_LAYER_NEXT, "LayerNext", N_("Switch to Layer Abov_e"),
2007                   N_("Switch to the layer above the current"), "switch_to_layer_above"),
2008     new LayerVerb(SP_VERB_LAYER_PREV, "LayerPrev", N_("Switch to Layer Belo_w"),
2009                   N_("Switch to the layer below the current"), "switch_to_layer_below"),
2010     new LayerVerb(SP_VERB_LAYER_MOVE_TO_NEXT, "LayerMoveToNext", N_("Move Selection to Layer Abo_ve"),
2011                   N_("Move selection to the layer above the current"), "move_selection_above"),
2012     new LayerVerb(SP_VERB_LAYER_MOVE_TO_PREV, "LayerMoveToPrev", N_("Move Selection to Layer Bel_ow"),
2013                   N_("Move selection to the layer below the current"), "move_selection_below"),
2014     new LayerVerb(SP_VERB_LAYER_TO_TOP, "LayerToTop", N_("Layer to _Top"),
2015                   N_("Raise the current layer to the top"), "layer_to_top"),
2016     new LayerVerb(SP_VERB_LAYER_TO_BOTTOM, "LayerToBottom", N_("Layer to _Bottom"),
2017                   N_("Lower the current layer to the bottom"), "layer_to_bottom"),
2018     new LayerVerb(SP_VERB_LAYER_RAISE, "LayerRaise", N_("_Raise Layer"),
2019                   N_("Raise the current layer"), "raise_layer"),
2020     new LayerVerb(SP_VERB_LAYER_LOWER, "LayerLower", N_("_Lower Layer"),
2021                   N_("Lower the current layer"), "lower_layer"),
2022     new LayerVerb(SP_VERB_LAYER_DELETE, "LayerDelete", N_("_Delete Current Layer"),
2023                   N_("Delete the current layer"), "delete_layer"),
2025     /* Object */
2026     new ObjectVerb(SP_VERB_OBJECT_ROTATE_90_CW, "ObjectRotate90", N_("Rotate _90&#176; CW"),
2027                    N_("Rotate selection 90&#176; clockwise"), "object_rotate_90_CW"),
2028     new ObjectVerb(SP_VERB_OBJECT_ROTATE_90_CCW, "ObjectRotate90CCW", N_("Rotate 9_0&#176; CCW"),
2029                    N_("Rotate selection 90&#176; counter-clockwise"), "object_rotate_90_CCW"),
2030     new ObjectVerb(SP_VERB_OBJECT_FLATTEN, "ObjectFlatten", N_("Remove _Transformations"),
2031                    N_("Remove transformations from object"), "object_reset"),
2032     new ObjectVerb(SP_VERB_OBJECT_TO_CURVE, "ObjectToCurve", N_("_Object to Path"),
2033                    N_("Convert selected objects to paths"), "object_tocurve"),
2034     new ObjectVerb(SP_VERB_OBJECT_FLOW_TEXT, "ObjectFlowText", N_("_Flow into Frame"),
2035                    N_("Put text into frames"), NULL),
2036     new ObjectVerb(SP_VERB_OBJECT_UNFLOW_TEXT, "ObjectUnFlowText", N_("_Unflow"),
2037                    N_("Remove text from frame (creates a single-line text object)"), NULL),
2038     new ObjectVerb(SP_VERB_OBJECT_FLOWTEXT_TO_TEXT, "ObjectFlowtextToText", N_("_Convert to Text"),
2039                    N_("Convert flowed text to regular text objects (preserves appearance)"), NULL),
2040     new ObjectVerb(SP_VERB_OBJECT_FLIP_HORIZONTAL, "ObjectFlipHorizontally",
2041                    N_("Flip _Horizontal"), N_("Flips selected objects horizontally"),
2042                    "object_flip_hor"),
2043     new ObjectVerb(SP_VERB_OBJECT_FLIP_VERTICAL, "ObjectFlipVertically",
2044                    N_("Flip _Vertical"), N_("Flips selected objects vertically"),
2045                    "object_flip_ver"),
2047     /* Tools */
2048     new ContextVerb(SP_VERB_CONTEXT_SELECT, "DrawSelect", N_("Select"),
2049                     N_("Select and transform objects"), "draw_select"),
2050     new ContextVerb(SP_VERB_CONTEXT_NODE, "DrawNode", N_("Node Edit"),
2051                     N_("Edit path nodes or control handles"), "draw_node"),
2052     new ContextVerb(SP_VERB_CONTEXT_RECT, "DrawRect", N_("Rectangle"),
2053                     N_("Create rectangles and squares"), "draw_rect"),
2054     new ContextVerb(SP_VERB_CONTEXT_ARC, "DrawArc", N_("Ellipse"),
2055                     N_("Create circles, ellipses, and arcs"), "draw_arc"),
2056     new ContextVerb(SP_VERB_CONTEXT_STAR, "DrawStar", N_("Star"),
2057                     N_("Create stars and polygons"), "draw_star"),
2058     new ContextVerb(SP_VERB_CONTEXT_SPIRAL, "DrawSpiral", N_("Spiral"),
2059                     N_("Create spirals"), "draw_spiral"),
2060     new ContextVerb(SP_VERB_CONTEXT_PENCIL, "DrawPencil", N_("Pencil"),
2061                     N_("Draw freehand lines"), "draw_freehand"),
2062     new ContextVerb(SP_VERB_CONTEXT_PEN, "DrawPen", N_("Pen"),
2063                     N_("Draw Bezier curves and straight lines"), "draw_pen"),
2064     new ContextVerb(SP_VERB_CONTEXT_CALLIGRAPHIC, "DrawCalligrphic", N_("Calligraphy"),
2065                     N_("Draw calligraphic lines"), "draw_calligraphic"),
2066     new ContextVerb(SP_VERB_CONTEXT_TEXT, "DrawText", N_("Text"),
2067                     N_("Create and edit text objects"), "draw_text"),
2068     new ContextVerb(SP_VERB_CONTEXT_GRADIENT, "DrawGradient", N_("Gradient"),
2069                     N_("Create and edit gradients"), "draw_gradient"),
2070     new ContextVerb(SP_VERB_CONTEXT_ZOOM, "DrawZoom", N_("Zoom"),
2071                     N_("Zoom in or out"), "draw_zoom"),
2072     new ContextVerb(SP_VERB_CONTEXT_DROPPER, "DrawDropper", N_("Dropper"),
2073                     N_("Pick averaged colors from image"), "draw_dropper"),
2074     new ContextVerb(SP_VERB_CONTEXT_CONNECTOR, "DrawConnector", N_("Connector"),
2075                     N_("Create connectors"), "draw_connector"),
2077     /* Tool prefs */
2078     new ContextVerb(SP_VERB_CONTEXT_SELECT_PREFS, "SelectPrefs", N_("Selector Preferences"),
2079                     N_("Open Preferences for the Selector tool"), NULL),
2080     new ContextVerb(SP_VERB_CONTEXT_NODE_PREFS, "NodePrefs", N_("Node Tool Preferences"),
2081                     N_("Open Preferences for the Node tool"), NULL),
2082     new ContextVerb(SP_VERB_CONTEXT_RECT_PREFS, "RectPrefs", N_("Rectangle Preferences"),
2083                     N_("Open Preferences for the Rectangle tool"), NULL),
2084     new ContextVerb(SP_VERB_CONTEXT_ARC_PREFS, "ArcPrefs", N_("Ellipse Preferences"),
2085                     N_("Open Preferences for the Ellipse tool"), NULL),
2086     new ContextVerb(SP_VERB_CONTEXT_STAR_PREFS, "StarPrefs", N_("Star Preferences"),
2087                     N_("Open Preferences for the Star tool"), NULL),
2088     new ContextVerb(SP_VERB_CONTEXT_SPIRAL_PREFS, "SpiralPrefs", N_("Spiral Preferences"),
2089                     N_("Open Preferences for the Spiral tool"), NULL),
2090     new ContextVerb(SP_VERB_CONTEXT_PENCIL_PREFS, "PencilPrefs", N_("Pencil Preferences"),
2091                     N_("Open Preferences for the Pencil tool"), NULL),
2092     new ContextVerb(SP_VERB_CONTEXT_PEN_PREFS, "PenPrefs", N_("Pen Preferences"),
2093                     N_("Open Preferences for the Pen tool"), NULL),
2094     new ContextVerb(SP_VERB_CONTEXT_CALLIGRAPHIC_PREFS, "CalligraphicPrefs", N_("Calligraphic Preferences"),
2095                     N_("Open Preferences for the Calligraphy tool"), NULL),
2096     new ContextVerb(SP_VERB_CONTEXT_TEXT_PREFS, "TextPrefs", N_("Text Preferences"),
2097                     N_("Open Preferences for the Text tool"), NULL),
2098     new ContextVerb(SP_VERB_CONTEXT_GRADIENT_PREFS, "GradientPrefs", N_("Gradient Preferences"),
2099                     N_("Open Preferences for the Gradient tool"), NULL),
2100     new ContextVerb(SP_VERB_CONTEXT_ZOOM_PREFS, "ZoomPrefs", N_("Zoom Preferences"),
2101                     N_("Open Preferences for the Zoom tool"), NULL),
2102     new ContextVerb(SP_VERB_CONTEXT_DROPPER_PREFS, "DropperPrefs", N_("Dropper Preferences"),
2103                     N_("Open Preferences for the Dropper tool"), NULL),
2104     new ContextVerb(SP_VERB_CONTEXT_CONNECTOR_PREFS, "ConnectorPrefs", N_("Connector Preferences"),
2105                     N_("Open Preferences for the Connector tool"), NULL),
2107     /* Zoom/View */
2108     new ZoomVerb(SP_VERB_ZOOM_IN, "ZoomIn", N_("Zoom In"), N_("Zoom in"), "zoom_in"),
2109     new ZoomVerb(SP_VERB_ZOOM_OUT, "ZoomOut", N_("Zoom Out"), N_("Zoom out"), "zoom_out"),
2110     new ZoomVerb(SP_VERB_TOGGLE_RULERS, "ToggleRulers", N_("_Rulers"), N_("Show or hide the canvas rulers"), "rulers"),
2111     new ZoomVerb(SP_VERB_TOGGLE_SCROLLBARS, "ToggleScrollbars", N_("Scroll_bars"), N_("Show or hide the canvas scrollbars"), "scrollbars"),
2112     new ZoomVerb(SP_VERB_TOGGLE_GRID, "ToggleGrid", N_("_Grid"), N_("Show or hide grid"), "grid"),
2113     new ZoomVerb(SP_VERB_TOGGLE_GUIDES, "ToggleGuides", N_("G_uides"), N_("Show or hide guides"), "guides"),
2114     new ZoomVerb(SP_VERB_ZOOM_NEXT, "ZoomNext", N_("Nex_t Zoom"), N_("Next zoom (from the history of zooms)"),
2115                  "zoom_next"),
2116     new ZoomVerb(SP_VERB_ZOOM_PREV, "ZoomPrev", N_("Pre_vious Zoom"), N_("Previous zoom (from the history of zooms)"),
2117                  "zoom_previous"),
2118     new ZoomVerb(SP_VERB_ZOOM_1_1, "Zoom1:0", N_("Zoom 1:_1"), N_("Zoom to 1:1"),
2119                  "zoom_1_to_1"),
2120     new ZoomVerb(SP_VERB_ZOOM_1_2, "Zoom1:2", N_("Zoom 1:_2"), N_("Zoom to 1:2"),
2121                  "zoom_1_to_2"),
2122     new ZoomVerb(SP_VERB_ZOOM_2_1, "Zoom2:1", N_("_Zoom 2:1"), N_("Zoom to 2:1"),
2123                  "zoom_2_to_1"),
2124 #ifdef HAVE_GTK_WINDOW_FULLSCREEN
2125     new ZoomVerb(SP_VERB_FULLSCREEN, "FullScreen", N_("_Fullscreen"), N_("Stretch this document window to full screen"),
2126                  "fullscreen"),
2127 #endif /* HAVE_GTK_WINDOW_FULLSCREEN */
2128     new ZoomVerb(SP_VERB_VIEW_NEW, "ViewNew", N_("Duplic_ate Window"), N_("Open a new window with the same document"),
2129                  "view_new"),
2130     new ZoomVerb(SP_VERB_VIEW_NEW_PREVIEW, "ViewNewPreview", N_("_New View Preview"),
2131                  N_("New View Preview"), NULL/*"view_new_preview"*/),
2133     new ZoomVerb(SP_VERB_VIEW_MODE_NORMAL, "ViewModeNormal", N_("_Normal"),
2134                  N_("Switch to normal display mode"), NULL),
2135     new ZoomVerb(SP_VERB_VIEW_MODE_OUTLINE, "ViewModeOutline", N_("_Outline"),
2136                  N_("Switch to outline (wireframe) display mode"), NULL),
2138     new ZoomVerb(SP_VERB_VIEW_ICON_PREVIEW, "ViewIconPreview", N_("Ico_n Preview"),
2139                  N_("Open a window to preview items at different icon resolutions"), NULL/*"view_icon_preview"*/),
2140     new ZoomVerb(SP_VERB_ZOOM_PAGE, "ZoomPage", N_("_Page"),
2141                  N_("Zoom to fit page in window"), "zoom_page"),
2142     new ZoomVerb(SP_VERB_ZOOM_PAGE_WIDTH, "ZoomPageWidth", N_("Page _Width"),
2143                  N_("Zoom to fit page width in window"), "zoom_pagewidth"),
2144     new ZoomVerb(SP_VERB_ZOOM_DRAWING, "ZoomDrawing", N_("_Drawing"),
2145                  N_("Zoom to fit drawing in window"), "zoom_draw"),
2146     new ZoomVerb(SP_VERB_ZOOM_SELECTION, "ZoomSelection", N_("_Selection"),
2147                  N_("Zoom to fit selection in window"), "zoom_select"),
2149     /* Dialogs */
2150     new DialogVerb(SP_VERB_DIALOG_DISPLAY, "DialogDisplay", N_("In_kscape Preferences..."),
2151                    N_("Global Inkscape preferences"), GTK_STOCK_PREFERENCES ),
2152     new DialogVerb(SP_VERB_DIALOG_NAMEDVIEW, "DialogNamedview", N_("_Document Properties..."),
2153                    N_("Preferences saved with the document"), GTK_STOCK_PROPERTIES ),
2154     new DialogVerb(SP_VERB_DIALOG_METADATA, "DialogMetadata", N_("_Document Metadata..."),
2155                    N_("Metadata saved with the document"), NULL ),
2156     new DialogVerb(SP_VERB_DIALOG_FILL_STROKE, "DialogFillStroke", N_("_Fill and Stroke..."),
2157                    N_("Fill and Stroke dialog"), "fill_and_stroke"),
2158     // TRANSLATORS: "Swatches" means: color samples
2159     new DialogVerb(SP_VERB_DIALOG_SWATCHES, "DialogSwatches", N_("S_watches..."),
2160                    N_("View color swatches"), GTK_STOCK_SELECT_COLOR),
2161     new DialogVerb(SP_VERB_DIALOG_TRANSFORM, "DialogTransform", N_("Transfor_m..."),
2162                    N_("Transform dialog"), "object_trans"),
2163     new DialogVerb(SP_VERB_DIALOG_ALIGN_DISTRIBUTE, "DialogAlignDistribute", N_("_Align and Distribute..."),
2164                    N_("Align and Distribute dialog"), "object_align"),
2165     new DialogVerb(SP_VERB_DIALOG_TEXT, "Dialogtext", N_("_Text and Font..."),
2166                    N_("Text and Font dialog"), "object_font"),
2167     new DialogVerb(SP_VERB_DIALOG_XML_EDITOR, "DialogXMLEditor", N_("_XML Editor..."),
2168                    N_("XML Editor"), "xml_editor"),
2169     new DialogVerb(SP_VERB_DIALOG_FIND, "DialogFind", N_("_Find..."),
2170                    N_("Find objects in document"), GTK_STOCK_FIND ),
2171     new DialogVerb(SP_VERB_DIALOG_DEBUG, "DialogDebug", N_("_Messages..."),
2172                    N_("View debug messages"), NULL),
2173     new DialogVerb(SP_VERB_DIALOG_SCRIPT, "DialogScript", N_("S_cripts..."),
2174                    N_("Run scripts"), NULL),
2175     new DialogVerb(SP_VERB_DIALOG_TOGGLE, "DialogsToggle", N_("Show/Hide D_ialogs"),
2176                    N_("Show or hide all active dialogs"), "dialog_toggle"),
2177     // TRANSLATORS: "Tile Clones" means: "Create tiled clones"
2178     new DialogVerb(SP_VERB_DIALOG_CLONETILER, "DialogsClonetiler", N_("Tile Clones..."),
2179                    N_("Create and arrange multiple clones of selection"), NULL),
2180     new DialogVerb(SP_VERB_DIALOG_ITEM, "DialogItem", N_("_Object Properties..."),
2181                    N_("Object Properties dialog"), "dialog_item_properties"),
2182 #ifdef WITH_INKBOARD
2183     new DialogVerb(SP_VERB_DIALOG_WHITEBOARD_CONNECT, "DialogWhiteboardConnect",
2184                    N_("_Connect to Jabber server..."), N_("Connect to a Jabber server"), NULL),
2185     new DialogVerb(SP_VERB_DIALOG_WHITEBOARD_SHAREWITHUSER, "DialogWhiteboardShareWithUser",
2186                    N_("Share with _user..."), N_("Establish a whiteboard session with another Jabber user"), NULL),
2187     new DialogVerb(SP_VERB_DIALOG_WHITEBOARD_SHAREWITHCHAT, "DialogWhiteboardShareWithChat",
2188                    N_("Share with _chatroom..."), N_("Join a chatroom to start a new whiteboard session or join one in progress"), NULL),
2189     new DialogVerb(SP_VERB_DIALOG_WHITEBOARD_DUMPXMLTRACKER, "DialogWhiteboardDumpXMLTracker",
2190                    N_("_Dump XML node tracker"), N_("Dump the contents of the XML tracker to the console"), NULL),
2191     new DialogVerb(SP_VERB_DIALOG_WHITEBOARD_OPENSESSIONFILE, "DialogWhiteboardOpenSessionFile",
2192                    N_("_Open session file..."), N_("Open and browse through records of past whiteboard sessions"), NULL),
2193     new DialogVerb(SP_VERB_DIALOG_WHITEBOARD_SESSIONPLAYBACK, "DialogWhiteboardSessionPlayback",
2194                    N_("Session file playback"), "", NULL),
2195     new DialogVerb(SP_VERB_DIALOG_WHITEBOARD_DISCONNECT_FROM_SESSION, "DialogWhiteboardDisconnectSession",
2196                    N_("_Disconnect from session"), "", NULL),
2197     new DialogVerb(SP_VERB_DIALOG_WHITEBOARD_DISCONNECT_FROM_SERVER, "DialogWhiteboardDisconnectServer",
2198                    N_("Disconnect from _server"), "", NULL),
2199 #endif
2200     new DialogVerb(SP_VERB_DIALOG_INPUT, "DialogInput", N_("_Input Devices..."),
2201                    N_("Configure extended input devices"), NULL),
2203     /* Help */
2204     new HelpVerb(SP_VERB_HELP_KEYS, "HelpKeys", N_("_Keys and Mouse"),
2205                  N_("Key and mouse shortcuts reference"), "help_keys"),
2206     new HelpVerb(SP_VERB_HELP_ABOUT_EXTENSIONS, "HelpAboutExtensions", N_("About E_xtensions"),
2207                  N_("About Extensions..."), NULL),
2208     new HelpVerb(SP_VERB_HELP_MEMORY, "HelpAboutMemory", N_("About _Memory"),
2209                  N_("About Memory..."), NULL),
2210     new HelpVerb(SP_VERB_HELP_ABOUT, "HelpAbout", N_("_About Inkscape"),
2211                  N_("About Inkscape"), /*"help_about"*/"inkscape_options"),
2212 //    new HelpVerb(SP_VERB_SHOW_LICENSE, "ShowLicense", N_("Modifying or Redistributing Inkscape"),
2213 //                 N_("Show license to modify and/or redistribute Inkscape: GNU GPL"), NULL),
2215     /* Tutorials */
2216     new TutorialVerb(SP_VERB_TUTORIAL_BASIC, "TutorialsBasic", N_("Inkscape: _Basic"),
2217                      N_("Getting started with Inkscape"), NULL/*"tutorial_basic"*/),
2218     new TutorialVerb(SP_VERB_TUTORIAL_SHAPES, "TutorialsShapes", N_("Inkscape: _Shapes"),
2219                      N_("Using shape tools to create and edit shapes"), NULL),
2220     new TutorialVerb(SP_VERB_TUTORIAL_ADVANCED, "TutorialsAdvanced", N_("Inkscape: _Advanced"),
2221                      N_("Advanced Inkscape topics"), NULL/*"tutorial_advanced"*/),
2222     // TRANSLATORS: "to trace" means "to convert a bitmap to vector graphics" (to vectorize)
2223     new TutorialVerb(SP_VERB_TUTORIAL_TRACING, "TutorialsTracing", N_("Inkscape: T_racing"),
2224                      N_("Using bitmap tracing"), NULL/*"tutorial_tracing"*/),
2225     new TutorialVerb(SP_VERB_TUTORIAL_CALLIGRAPHY, "TutorialsCalligraphy", N_("Inkscape: _Calligraphy"),
2226                      N_("Using the Calligraphy pen tool"), NULL),
2227     new TutorialVerb(SP_VERB_TUTORIAL_DESIGN, "TutorialsDesign", N_("_Elements of Design"),
2228                      N_("Principles of design in the tutorial form"), NULL/*"tutorial_design"*/),
2229     new TutorialVerb(SP_VERB_TUTORIAL_TIPS, "TutorialsTips", N_("_Tips and Tricks"),
2230                      N_("Miscellaneous tips and tricks"), NULL/*"tutorial_tips"*/),
2232     /* Effect */
2233     new EffectLastVerb(SP_VERB_EFFECT_LAST, "EffectLast", N_("Previous Effect"),
2234                        N_("Repeat the last effect with the same settings"), NULL/*"tutorial_tips"*/),
2235     new EffectLastVerb(SP_VERB_EFFECT_LAST_PREF, "EffectLastPref", N_("Previous Effect Settings..."),
2236                        N_("Repeat the last effect with new settings"), NULL/*"tutorial_tips"*/),
2238     /* Footer */
2239     new Verb(SP_VERB_LAST, NULL, NULL, NULL, NULL)
2240 };
2243 }  /* namespace Inkscape */
2245 /*
2246   Local Variables:
2247   mode:c++
2248   c-file-style:"stroustrup"
2249   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
2250   indent-tabs-mode:nil
2251   fill-column:99
2252   End:
2253 */
2254 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :