Code

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