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