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 }
658 void
659 Verb::name(SPDocument *in_doc, Glib::ustring in_name)
660 {
661 if (_actions != NULL) {
662 for (ActionTable::iterator cur_action = _actions->begin();
663 cur_action != _actions->end();
664 cur_action++) {
665 if (in_doc == NULL || (cur_action->first != NULL && cur_action->first->doc() == in_doc)) {
666 sp_action_set_name(cur_action->second, in_name);
667 }
668 }
669 }
670 }
672 /** \brief A function to remove the action associated with a view.
673 \param view Which view's actions should be removed.
674 \return None
676 This function looks for the action in \c _actions. If it is
677 found then it is unreferenced and the entry in the action
678 table is erased.
679 */
680 void
681 Verb::delete_view(Inkscape::UI::View::View *view)
682 {
683 if (_actions == NULL) return;
684 if (_actions->empty()) return;
686 #if 0
687 static int count = 0;
688 std::cout << count++ << std::endl;
689 #endif
691 ActionTable::iterator action_found = _actions->find(view);
693 if (action_found != _actions->end()) {
694 SPAction *action = action_found->second;
695 nr_object_unref(NR_OBJECT(action));
696 _actions->erase(action_found);
697 }
699 return;
700 }
702 /** \brief A function to delete a view from all verbs
703 \param view Which view's actions should be removed.
704 \return None
706 This function first looks through _base_verbs and deteles
707 the view from all of those views. If \c _verbs is not empty
708 then all of the entries in that table have all of the views
709 deleted also.
710 */
711 void
712 Verb::delete_all_view(Inkscape::UI::View::View *view)
713 {
714 for (int i = 0; i <= SP_VERB_LAST; i++) {
715 if (_base_verbs[i])
716 _base_verbs[i]->delete_view(view);
717 }
719 if (!_verbs.empty()) {
720 for (VerbTable::iterator thisverb = _verbs.begin();
721 thisverb != _verbs.end(); thisverb++) {
722 Inkscape::Verb *verbpntr = thisverb->second;
723 // std::cout << "Delete In Verb: " << verbpntr->_name << std::endl;
724 verbpntr->delete_view(view);
725 }
726 }
728 return;
729 }
731 /** \brief A function to turn a \c code into a Verb for dynamically
732 created Verbs.
733 \param code What code is being looked for
734 \return The found Verb of NULL if none is found.
736 This function basically just looks through the \c _verbs hash
737 table. STL does all the work.
738 */
739 Verb *
740 Verb::get_search(unsigned int code)
741 {
742 Verb *verb = NULL;
743 VerbTable::iterator verb_found = _verbs.find(code);
745 if (verb_found != _verbs.end()) {
746 verb = verb_found->second;
747 }
749 return verb;
750 }
752 /** \brief Find a Verb using it's ID
753 \param id Which id to search for
755 This function uses the \c _verb_ids has table to find the
756 verb by it's id. Should be much faster than previous
757 implementations.
758 */
759 Verb *
760 Verb::getbyid(gchar const *id)
761 {
762 Verb *verb = NULL;
763 VerbIDTable::iterator verb_found = _verb_ids.find(id);
765 if (verb_found != _verb_ids.end()) {
766 verb = verb_found->second;
767 }
769 if (verb == NULL)
770 printf("Unable to find: %s\n", id);
772 return verb;
773 }
775 /** \brief Decode the verb code and take appropriate action */
776 void
777 FileVerb::perform(SPAction *action, void *data, void *pdata)
778 {
779 #if 0
780 /* These aren't used, but are here to remind people not to use
781 the CURRENT_DOCUMENT macros unless they really have to. */
782 Inkscape::UI::View::View *current_view = sp_action_get_view(action);
783 SPDocument *current_document = current_view->doc();
784 #endif
785 switch ((long) data) {
786 case SP_VERB_FILE_NEW:
787 sp_file_new_default();
788 break;
789 case SP_VERB_FILE_OPEN:
790 sp_file_open_dialog(NULL, NULL);
791 break;
792 case SP_VERB_FILE_REVERT:
793 sp_file_revert_dialog();
794 break;
795 case SP_VERB_FILE_SAVE:
796 sp_file_save(NULL, NULL);
797 break;
798 case SP_VERB_FILE_SAVE_AS:
799 sp_file_save_as(NULL, NULL);
800 break;
801 case SP_VERB_FILE_PRINT:
802 sp_file_print();
803 break;
804 case SP_VERB_FILE_VACUUM:
805 sp_file_vacuum();
806 break;
807 case SP_VERB_FILE_PRINT_DIRECT:
808 sp_file_print_direct();
809 break;
810 case SP_VERB_FILE_PRINT_PREVIEW:
811 sp_file_print_preview(NULL, NULL);
812 break;
813 case SP_VERB_FILE_IMPORT:
814 sp_file_import(NULL);
815 break;
816 case SP_VERB_FILE_EXPORT:
817 sp_file_export_dialog(NULL);
818 break;
819 case SP_VERB_FILE_NEXT_DESKTOP:
820 inkscape_switch_desktops_next();
821 break;
822 case SP_VERB_FILE_PREV_DESKTOP:
823 inkscape_switch_desktops_prev();
824 break;
825 case SP_VERB_FILE_CLOSE_VIEW:
826 sp_ui_close_view(NULL);
827 break;
828 case SP_VERB_FILE_QUIT:
829 sp_file_exit();
830 break;
831 default:
832 break;
833 }
835 } // end of sp_verb_action_file_perform()
837 /** \brief Decode the verb code and take appropriate action */
838 void
839 EditVerb::perform(SPAction *action, void *data, void *pdata)
840 {
841 SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
842 if (!dt)
843 return;
845 SPEventContext *ec = dt->event_context;
847 switch (reinterpret_cast<std::size_t>(data)) {
848 case SP_VERB_EDIT_UNDO:
849 sp_undo(dt, sp_desktop_document(dt));
850 break;
851 case SP_VERB_EDIT_REDO:
852 sp_redo(dt, sp_desktop_document(dt));
853 break;
854 case SP_VERB_EDIT_CUT:
855 sp_selection_cut();
856 break;
857 case SP_VERB_EDIT_COPY:
858 sp_selection_copy();
859 break;
860 case SP_VERB_EDIT_PASTE:
861 sp_selection_paste(false);
862 break;
863 case SP_VERB_EDIT_PASTE_STYLE:
864 sp_selection_paste_style();
865 break;
866 case SP_VERB_EDIT_PASTE_SIZE:
867 sp_selection_paste_size(true, true);
868 break;
869 case SP_VERB_EDIT_PASTE_SIZE_X:
870 sp_selection_paste_size(true, false);
871 break;
872 case SP_VERB_EDIT_PASTE_SIZE_Y:
873 sp_selection_paste_size(false, true);
874 break;
875 case SP_VERB_EDIT_PASTE_SIZE_SEPARATELY:
876 sp_selection_paste_size_separately(true, true);
877 break;
878 case SP_VERB_EDIT_PASTE_SIZE_SEPARATELY_X:
879 sp_selection_paste_size_separately(true, false);
880 break;
881 case SP_VERB_EDIT_PASTE_SIZE_SEPARATELY_Y:
882 sp_selection_paste_size_separately(false, true);
883 break;
884 case SP_VERB_EDIT_PASTE_IN_PLACE:
885 sp_selection_paste(true);
886 break;
887 case SP_VERB_EDIT_DELETE:
888 sp_selection_delete();
889 break;
890 case SP_VERB_EDIT_DUPLICATE:
891 sp_selection_duplicate();
892 break;
893 case SP_VERB_EDIT_CLONE:
894 sp_selection_clone();
895 break;
896 case SP_VERB_EDIT_UNLINK_CLONE:
897 sp_selection_unlink();
898 break;
899 case SP_VERB_EDIT_CLONE_ORIGINAL:
900 sp_select_clone_original();
901 break;
902 case SP_VERB_EDIT_TILE:
903 sp_selection_tile();
904 break;
905 case SP_VERB_EDIT_UNTILE:
906 sp_selection_untile();
907 break;
908 case SP_VERB_EDIT_CLEAR_ALL:
909 sp_edit_clear_all();
910 break;
911 case SP_VERB_EDIT_SELECT_ALL:
912 if (tools_isactive(dt, TOOLS_NODES)) {
913 sp_nodepath_select_all_from_subpath(SP_NODE_CONTEXT(ec)->nodepath, false);
914 } else {
915 sp_edit_select_all();
916 }
917 break;
918 case SP_VERB_EDIT_INVERT:
919 if (tools_isactive(dt, TOOLS_NODES)) {
920 sp_nodepath_select_all_from_subpath(SP_NODE_CONTEXT(ec)->nodepath, true);
921 } else {
922 sp_edit_invert();
923 }
924 break;
925 case SP_VERB_EDIT_SELECT_ALL_IN_ALL_LAYERS:
926 if (tools_isactive(dt, TOOLS_NODES)) {
927 sp_nodepath_select_all(SP_NODE_CONTEXT(ec)->nodepath, false);
928 } else {
929 sp_edit_select_all_in_all_layers();
930 }
931 break;
932 case SP_VERB_EDIT_INVERT_IN_ALL_LAYERS:
933 if (tools_isactive(dt, TOOLS_NODES)) {
934 sp_nodepath_select_all(SP_NODE_CONTEXT(ec)->nodepath, true);
935 } else {
936 sp_edit_invert_in_all_layers();
937 }
938 break;
939 case SP_VERB_EDIT_DESELECT:
940 if (tools_isactive(dt, TOOLS_NODES)) {
941 sp_nodepath_deselect(SP_NODE_CONTEXT(ec)->nodepath);
942 } else {
943 sp_desktop_selection(dt)->clear();
944 }
945 break;
946 default:
947 break;
948 }
950 } // end of sp_verb_action_edit_perform()
952 /** \brief Decode the verb code and take appropriate action */
953 void
954 SelectionVerb::perform(SPAction *action, void *data, void *pdata)
955 {
956 SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
958 if (!dt)
959 return;
961 switch (reinterpret_cast<std::size_t>(data)) {
962 case SP_VERB_SELECTION_TO_FRONT:
963 sp_selection_raise_to_top();
964 break;
965 case SP_VERB_SELECTION_TO_BACK:
966 sp_selection_lower_to_bottom();
967 break;
968 case SP_VERB_SELECTION_RAISE:
969 sp_selection_raise();
970 break;
971 case SP_VERB_SELECTION_LOWER:
972 sp_selection_lower();
973 break;
974 case SP_VERB_SELECTION_GROUP:
975 sp_selection_group();
976 break;
977 case SP_VERB_SELECTION_UNGROUP:
978 sp_selection_ungroup();
979 break;
981 case SP_VERB_SELECTION_TEXTTOPATH:
982 text_put_on_path();
983 break;
984 case SP_VERB_SELECTION_TEXTFROMPATH:
985 text_remove_from_path();
986 break;
987 case SP_VERB_SELECTION_REMOVE_KERNS:
988 text_remove_all_kerns();
989 break;
991 case SP_VERB_SELECTION_UNION:
992 sp_selected_path_union();
993 break;
994 case SP_VERB_SELECTION_INTERSECT:
995 sp_selected_path_intersect();
996 break;
997 case SP_VERB_SELECTION_DIFF:
998 sp_selected_path_diff();
999 break;
1000 case SP_VERB_SELECTION_SYMDIFF:
1001 sp_selected_path_symdiff();
1002 break;
1004 case SP_VERB_SELECTION_CUT:
1005 sp_selected_path_cut();
1006 break;
1007 case SP_VERB_SELECTION_SLICE:
1008 sp_selected_path_slice();
1009 break;
1011 case SP_VERB_SELECTION_OFFSET:
1012 sp_selected_path_offset();
1013 break;
1014 case SP_VERB_SELECTION_OFFSET_SCREEN:
1015 sp_selected_path_offset_screen(1);
1016 break;
1017 case SP_VERB_SELECTION_OFFSET_SCREEN_10:
1018 sp_selected_path_offset_screen(10);
1019 break;
1020 case SP_VERB_SELECTION_INSET:
1021 sp_selected_path_inset();
1022 break;
1023 case SP_VERB_SELECTION_INSET_SCREEN:
1024 sp_selected_path_inset_screen(1);
1025 break;
1026 case SP_VERB_SELECTION_INSET_SCREEN_10:
1027 sp_selected_path_inset_screen(10);
1028 break;
1029 case SP_VERB_SELECTION_DYNAMIC_OFFSET:
1030 sp_selected_path_create_offset_object_zero();
1031 break;
1032 case SP_VERB_SELECTION_LINKED_OFFSET:
1033 sp_selected_path_create_updating_offset_object_zero();
1034 break;
1036 case SP_VERB_SELECTION_OUTLINE:
1037 sp_selected_path_outline();
1038 break;
1039 case SP_VERB_SELECTION_SIMPLIFY:
1040 sp_selected_path_simplify();
1041 break;
1042 case SP_VERB_SELECTION_REVERSE:
1043 sp_selected_path_reverse();
1044 break;
1045 case SP_VERB_SELECTION_TRACE:
1046 dt->_dlg_mgr->showDialog("Trace");
1047 break;
1048 case SP_VERB_SELECTION_CREATE_BITMAP:
1049 sp_selection_create_bitmap_copy();
1050 break;
1052 case SP_VERB_SELECTION_COMBINE:
1053 sp_selected_path_combine();
1054 break;
1055 case SP_VERB_SELECTION_BREAK_APART:
1056 sp_selected_path_break_apart();
1057 break;
1058 case SP_VERB_SELECTION_GRIDTILE:
1059 dt->_dlg_mgr->showDialog("TileDialog");
1060 break;
1061 default:
1062 break;
1063 }
1065 } // end of sp_verb_action_selection_perform()
1067 /** \brief Decode the verb code and take appropriate action */
1068 void
1069 LayerVerb::perform(SPAction *action, void *data, void *pdata)
1070 {
1071 SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1072 unsigned int verb = reinterpret_cast<std::size_t>(data);
1074 if ( !dt || !dt->currentLayer() ) {
1075 return;
1076 }
1078 switch (verb) {
1079 case SP_VERB_LAYER_NEW: {
1080 Inkscape::UI::Dialogs::LayerPropertiesDialog::showCreate(dt, dt->currentLayer());
1081 break;
1082 }
1083 case SP_VERB_LAYER_RENAME: {
1084 Inkscape::UI::Dialogs::LayerPropertiesDialog::showRename(dt, dt->currentLayer());
1085 break;
1086 }
1087 case SP_VERB_LAYER_NEXT: {
1088 SPObject *next=Inkscape::next_layer(dt->currentRoot(), dt->currentLayer());
1089 if (next) {
1090 dt->setCurrentLayer(next);
1091 sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_NEXT,
1092 /* TODO: annotate */ "verbs.cpp:1077");
1093 dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Moved to next layer."));
1094 } else {
1095 dt->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Cannot move past last layer."));
1096 }
1097 break;
1098 }
1099 case SP_VERB_LAYER_PREV: {
1100 SPObject *prev=Inkscape::previous_layer(dt->currentRoot(), dt->currentLayer());
1101 if (prev) {
1102 dt->setCurrentLayer(prev);
1103 sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_PREV,
1104 /* TODO: annotate */ "verbs.cpp:1089");
1105 dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Moved to previous layer."));
1106 } else {
1107 dt->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Cannot move past first layer."));
1108 }
1109 break;
1110 }
1111 case SP_VERB_LAYER_MOVE_TO_NEXT: {
1112 sp_selection_to_next_layer();
1113 break;
1114 }
1115 case SP_VERB_LAYER_MOVE_TO_PREV: {
1116 sp_selection_to_prev_layer();
1117 break;
1118 }
1119 case SP_VERB_LAYER_TO_TOP:
1120 case SP_VERB_LAYER_TO_BOTTOM:
1121 case SP_VERB_LAYER_RAISE:
1122 case SP_VERB_LAYER_LOWER: {
1123 if ( dt->currentLayer() == dt->currentRoot() ) {
1124 dt->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No current layer."));
1125 return;
1126 }
1128 SPItem *layer=SP_ITEM(dt->currentLayer());
1129 g_return_if_fail(layer != NULL);
1131 SPObject *old_pos=SP_OBJECT_NEXT(layer);
1133 switch (verb) {
1134 case SP_VERB_LAYER_TO_TOP:
1135 layer->raiseToTop();
1136 break;
1137 case SP_VERB_LAYER_TO_BOTTOM:
1138 layer->lowerToBottom();
1139 break;
1140 case SP_VERB_LAYER_RAISE:
1141 layer->raiseOne();
1142 break;
1143 case SP_VERB_LAYER_LOWER:
1144 layer->lowerOne();
1145 break;
1146 }
1148 if ( SP_OBJECT_NEXT(layer) != old_pos ) {
1149 char const *message = NULL;
1150 Glib::ustring description = "";
1151 switch (verb) {
1152 case SP_VERB_LAYER_TO_TOP:
1153 message = g_strdup_printf(_("Raised layer <b>%s</b>."), layer->defaultLabel());
1154 description = _("Layer to Top");
1155 break;
1156 case SP_VERB_LAYER_RAISE:
1157 message = g_strdup_printf(_("Raised layer <b>%s</b>."), layer->defaultLabel());
1158 description = _("Raise Layer");
1159 break;
1160 case SP_VERB_LAYER_TO_BOTTOM:
1161 message = g_strdup_printf(_("Lowered layer <b>%s</b>."), layer->defaultLabel());
1162 description = _("Layer to Bottom");
1163 break;
1164 case SP_VERB_LAYER_LOWER:
1165 message = g_strdup_printf(_("Lowered layer <b>%s</b>."), layer->defaultLabel());
1166 description = _("Lower Layer");
1167 break;
1168 };
1169 sp_document_done(sp_desktop_document(dt), verb, description);
1170 if (message) {
1171 dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, message);
1172 g_free((void *) message);
1173 }
1174 } else {
1175 dt->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Cannot move layer any further."));
1176 }
1178 break;
1179 }
1180 case SP_VERB_LAYER_DELETE: {
1181 if ( dt->currentLayer() != dt->currentRoot() ) {
1182 sp_desktop_selection(dt)->clear();
1183 SPObject *old_layer=dt->currentLayer();
1185 sp_object_ref(old_layer, NULL);
1186 SPObject *survivor=Inkscape::next_layer(dt->currentRoot(), old_layer);
1187 if (!survivor) {
1188 survivor = Inkscape::previous_layer(dt->currentRoot(), old_layer);
1189 }
1191 /* Deleting the old layer before switching layers is a hack to trigger the
1192 * listeners of the deletion event (as happens when old_layer is deleted using the
1193 * xml editor). See
1194 * http://sourceforge.net/tracker/index.php?func=detail&aid=1339397&group_id=93438&atid=604306
1195 */
1196 old_layer->deleteObject();
1197 sp_object_unref(old_layer, NULL);
1198 if (survivor) {
1199 dt->setCurrentLayer(survivor);
1200 }
1202 sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_DELETE,
1203 _("Delete layer"));
1205 // TRANSLATORS: this means "The layer has been deleted."
1206 dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Deleted layer."));
1207 } else {
1208 dt->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No current layer."));
1209 }
1210 break;
1211 }
1212 }
1214 return;
1215 } // end of sp_verb_action_layer_perform()
1217 /** \brief Decode the verb code and take appropriate action */
1218 void
1219 ObjectVerb::perform( SPAction *action, void *data, void *pdata )
1220 {
1221 SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1222 if (!dt)
1223 return;
1225 SPEventContext *ec = dt->event_context;
1227 Inkscape::Selection *sel = sp_desktop_selection(dt);
1229 if (sel->isEmpty())
1230 return;
1232 NR::Point const center(sel->bounds().midpoint());
1234 switch (reinterpret_cast<std::size_t>(data)) {
1235 case SP_VERB_OBJECT_ROTATE_90_CW:
1236 sp_selection_rotate_90_cw();
1237 break;
1238 case SP_VERB_OBJECT_ROTATE_90_CCW:
1239 sp_selection_rotate_90_ccw();
1240 break;
1241 case SP_VERB_OBJECT_FLATTEN:
1242 sp_selection_remove_transform();
1243 break;
1244 case SP_VERB_OBJECT_TO_CURVE:
1245 sp_selected_path_to_curves();
1246 break;
1247 case SP_VERB_OBJECT_FLOW_TEXT:
1248 text_flow_into_shape();
1249 break;
1250 case SP_VERB_OBJECT_UNFLOW_TEXT:
1251 text_unflow();
1252 break;
1253 case SP_VERB_OBJECT_FLOWTEXT_TO_TEXT:
1254 SPFlowtext::convert_to_text();
1255 break;
1256 case SP_VERB_OBJECT_FLIP_HORIZONTAL:
1257 if (tools_isactive(dt, TOOLS_NODES)) {
1258 sp_nodepath_flip(SP_NODE_CONTEXT(ec)->nodepath, NR::X);
1259 } else {
1260 sp_selection_scale_relative(sel, center, NR::scale(-1.0, 1.0));
1261 }
1262 sp_document_done(sp_desktop_document(dt), SP_VERB_OBJECT_FLIP_HORIZONTAL,
1263 _("Flip horizontally"));
1264 break;
1265 case SP_VERB_OBJECT_FLIP_VERTICAL:
1266 if (tools_isactive(dt, TOOLS_NODES)) {
1267 sp_nodepath_flip(SP_NODE_CONTEXT(ec)->nodepath, NR::Y);
1268 } else {
1269 sp_selection_scale_relative(sel, center, NR::scale(1.0, -1.0));
1270 }
1271 sp_document_done(sp_desktop_document(dt), SP_VERB_OBJECT_FLIP_VERTICAL,
1272 _("Flip vertically"));
1273 break;
1274 case SP_VERB_OBJECT_SET_MASK:
1275 sp_selection_set_mask(false, false);
1276 break;
1277 case SP_VERB_OBJECT_UNSET_MASK:
1278 sp_selection_unset_mask(false);
1279 break;
1280 case SP_VERB_OBJECT_SET_CLIPPATH:
1281 sp_selection_set_mask(true, false);
1282 break;
1283 case SP_VERB_OBJECT_UNSET_CLIPPATH:
1284 sp_selection_unset_mask(true);
1285 break;
1286 default:
1287 break;
1288 }
1290 } // end of sp_verb_action_object_perform()
1292 /** \brief Decode the verb code and take appropriate action */
1293 void
1294 ContextVerb::perform(SPAction *action, void *data, void *pdata)
1295 {
1296 SPDesktop *dt;
1297 sp_verb_t verb;
1298 int vidx;
1300 dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1302 if (!dt)
1303 return;
1305 verb = (sp_verb_t)GPOINTER_TO_INT((gpointer)data);
1307 /** \todo !!! hopefully this can go away soon and actions can look after
1308 * themselves
1309 */
1310 for (vidx = SP_VERB_CONTEXT_SELECT; vidx <= SP_VERB_CONTEXT_DROPPER_PREFS; vidx++)
1311 {
1312 SPAction *tool_action= get((sp_verb_t)vidx)->get_action(dt);
1313 if (tool_action) {
1314 sp_action_set_active(tool_action, vidx == (int)verb);
1315 }
1316 }
1318 switch (verb) {
1319 case SP_VERB_CONTEXT_SELECT:
1320 tools_switch_current(TOOLS_SELECT);
1321 break;
1322 case SP_VERB_CONTEXT_NODE:
1323 tools_switch_current(TOOLS_NODES);
1324 break;
1325 case SP_VERB_CONTEXT_RECT:
1326 tools_switch_current(TOOLS_SHAPES_RECT);
1327 break;
1328 case SP_VERB_CONTEXT_ARC:
1329 tools_switch_current(TOOLS_SHAPES_ARC);
1330 break;
1331 case SP_VERB_CONTEXT_STAR:
1332 tools_switch_current(TOOLS_SHAPES_STAR);
1333 break;
1334 case SP_VERB_CONTEXT_SPIRAL:
1335 tools_switch_current(TOOLS_SHAPES_SPIRAL);
1336 break;
1337 case SP_VERB_CONTEXT_PENCIL:
1338 tools_switch_current(TOOLS_FREEHAND_PENCIL);
1339 break;
1340 case SP_VERB_CONTEXT_PEN:
1341 tools_switch_current(TOOLS_FREEHAND_PEN);
1342 break;
1343 case SP_VERB_CONTEXT_CALLIGRAPHIC:
1344 tools_switch_current(TOOLS_CALLIGRAPHIC);
1345 break;
1346 case SP_VERB_CONTEXT_TEXT:
1347 tools_switch_current(TOOLS_TEXT);
1348 break;
1349 case SP_VERB_CONTEXT_GRADIENT:
1350 tools_switch_current(TOOLS_GRADIENT);
1351 break;
1352 case SP_VERB_CONTEXT_ZOOM:
1353 tools_switch_current(TOOLS_ZOOM);
1354 break;
1355 case SP_VERB_CONTEXT_DROPPER:
1356 tools_switch_current(TOOLS_DROPPER);
1357 break;
1358 case SP_VERB_CONTEXT_CONNECTOR:
1359 tools_switch_current (TOOLS_CONNECTOR);
1360 break;
1362 case SP_VERB_CONTEXT_SELECT_PREFS:
1363 prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_SELECTOR);
1364 dt->_dlg_mgr->showDialog("InkscapePreferences");
1365 break;
1366 case SP_VERB_CONTEXT_NODE_PREFS:
1367 prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_NODE);
1368 dt->_dlg_mgr->showDialog("InkscapePreferences");
1369 break;
1370 case SP_VERB_CONTEXT_RECT_PREFS:
1371 prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_SHAPES_RECT);
1372 dt->_dlg_mgr->showDialog("InkscapePreferences");
1373 break;
1374 case SP_VERB_CONTEXT_ARC_PREFS:
1375 prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_SHAPES_ELLIPSE);
1376 dt->_dlg_mgr->showDialog("InkscapePreferences");
1377 break;
1378 case SP_VERB_CONTEXT_STAR_PREFS:
1379 prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_SHAPES_STAR);
1380 dt->_dlg_mgr->showDialog("InkscapePreferences");
1381 break;
1382 case SP_VERB_CONTEXT_SPIRAL_PREFS:
1383 prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_SHAPES_SPIRAL);
1384 dt->_dlg_mgr->showDialog("InkscapePreferences");
1385 break;
1386 case SP_VERB_CONTEXT_PENCIL_PREFS:
1387 prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_PENCIL);
1388 dt->_dlg_mgr->showDialog("InkscapePreferences");
1389 break;
1390 case SP_VERB_CONTEXT_PEN_PREFS:
1391 prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_PEN);
1392 dt->_dlg_mgr->showDialog("InkscapePreferences");
1393 break;
1394 case SP_VERB_CONTEXT_CALLIGRAPHIC_PREFS:
1395 prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_CALLIGRAPHY);
1396 dt->_dlg_mgr->showDialog("InkscapePreferences");
1397 break;
1398 case SP_VERB_CONTEXT_TEXT_PREFS:
1399 prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_TEXT);
1400 dt->_dlg_mgr->showDialog("InkscapePreferences");
1401 break;
1402 case SP_VERB_CONTEXT_GRADIENT_PREFS:
1403 prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_GRADIENT);
1404 dt->_dlg_mgr->showDialog("InkscapePreferences");
1405 break;
1406 case SP_VERB_CONTEXT_ZOOM_PREFS:
1407 prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_ZOOM);
1408 dt->_dlg_mgr->showDialog("InkscapePreferences");
1409 break;
1410 case SP_VERB_CONTEXT_DROPPER_PREFS:
1411 prefs_set_int_attribute("dialogs.preferences", "page", PREFS_PAGE_TOOLS_DROPPER);
1412 dt->_dlg_mgr->showDialog("InkscapePreferences");
1413 break;
1414 case SP_VERB_CONTEXT_CONNECTOR_PREFS:
1415 prefs_set_int_attribute ("dialogs.preferences", "page", PREFS_PAGE_TOOLS_CONNECTOR);
1416 dt->_dlg_mgr->showDialog("InkscapePreferences");
1417 break;
1419 default:
1420 break;
1421 }
1423 } // end of sp_verb_action_ctx_perform()
1425 /** \brief Decode the verb code and take appropriate action */
1426 void
1427 TextVerb::perform(SPAction *action, void *data, void *pdata)
1428 {
1429 SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1430 if (!dt)
1431 return;
1433 SPDocument *doc = sp_desktop_document(dt);
1434 (void)doc;
1435 Inkscape::XML::Node *repr = SP_OBJECT_REPR(dt->namedview);
1436 (void)repr;
1437 }
1439 /** \brief Decode the verb code and take appropriate action */
1440 void
1441 ZoomVerb::perform(SPAction *action, void *data, void *pdata)
1442 {
1443 SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1444 if (!dt)
1445 return;
1447 SPDocument *doc = sp_desktop_document(dt);
1449 Inkscape::XML::Node *repr = SP_OBJECT_REPR(dt->namedview);
1451 gdouble zoom_inc =
1452 prefs_get_double_attribute_limited( "options.zoomincrement",
1453 "value", 1.414213562, 1.01, 10 );
1455 switch (GPOINTER_TO_INT(data)) {
1456 case SP_VERB_ZOOM_IN:
1457 {
1458 NR::Rect const d = dt->get_display_area();
1459 dt->zoom_relative( d.midpoint()[NR::X], d.midpoint()[NR::Y], zoom_inc);
1460 break;
1461 }
1462 case SP_VERB_ZOOM_OUT:
1463 {
1464 NR::Rect const d = dt->get_display_area();
1465 dt->zoom_relative( d.midpoint()[NR::X], d.midpoint()[NR::Y], 1 / zoom_inc );
1466 break;
1467 }
1468 case SP_VERB_ZOOM_1_1:
1469 {
1470 NR::Rect const d = dt->get_display_area();
1471 dt->zoom_absolute( d.midpoint()[NR::X], d.midpoint()[NR::Y], 1.0 );
1472 break;
1473 }
1474 case SP_VERB_ZOOM_1_2:
1475 {
1476 NR::Rect const d = dt->get_display_area();
1477 dt->zoom_absolute( d.midpoint()[NR::X], d.midpoint()[NR::Y], 0.5);
1478 break;
1479 }
1480 case SP_VERB_ZOOM_2_1:
1481 {
1482 NR::Rect const d = dt->get_display_area();
1483 dt->zoom_absolute( d.midpoint()[NR::X], d.midpoint()[NR::Y], 2.0 );
1484 break;
1485 }
1486 case SP_VERB_ZOOM_PAGE:
1487 dt->zoom_page();
1488 break;
1489 case SP_VERB_ZOOM_PAGE_WIDTH:
1490 dt->zoom_page_width();
1491 break;
1492 case SP_VERB_ZOOM_DRAWING:
1493 dt->zoom_drawing();
1494 break;
1495 case SP_VERB_ZOOM_SELECTION:
1496 dt->zoom_selection();
1497 break;
1498 case SP_VERB_ZOOM_NEXT:
1499 dt->next_zoom();
1500 break;
1501 case SP_VERB_ZOOM_PREV:
1502 dt->prev_zoom();
1503 break;
1504 case SP_VERB_TOGGLE_RULERS:
1505 dt->toggleRulers();
1506 break;
1507 case SP_VERB_TOGGLE_SCROLLBARS:
1508 dt->toggleScrollbars();
1509 break;
1510 case SP_VERB_TOGGLE_GUIDES:
1511 sp_namedview_toggle_guides(doc, repr);
1512 break;
1513 case SP_VERB_TOGGLE_GRID:
1514 sp_namedview_toggle_grid(doc, repr);
1515 break;
1516 #ifdef HAVE_GTK_WINDOW_FULLSCREEN
1517 case SP_VERB_FULLSCREEN:
1518 dt->fullscreen();
1519 break;
1520 #endif /* HAVE_GTK_WINDOW_FULLSCREEN */
1521 case SP_VERB_VIEW_NEW:
1522 sp_ui_new_view();
1523 break;
1524 case SP_VERB_VIEW_NEW_PREVIEW:
1525 sp_ui_new_view_preview();
1526 break;
1527 case SP_VERB_VIEW_MODE_NORMAL:
1528 dt->setDisplayModeNormal();
1529 break;
1530 case SP_VERB_VIEW_MODE_OUTLINE:
1531 dt->setDisplayModeOutline();
1532 break;
1533 case SP_VERB_VIEW_ICON_PREVIEW:
1534 show_panel( Inkscape::UI::Dialogs::IconPreviewPanel::getInstance(), "dialogs.iconpreview", SP_VERB_VIEW_ICON_PREVIEW );
1535 break;
1536 default:
1537 break;
1538 }
1540 } // end of sp_verb_action_zoom_perform()
1542 /** \brief Decode the verb code and take appropriate action */
1543 void
1544 DialogVerb::perform(SPAction *action, void *data, void *pdata)
1545 {
1546 if (reinterpret_cast<std::size_t>(data) != SP_VERB_DIALOG_TOGGLE) {
1547 // unhide all when opening a new dialog
1548 inkscape_dialogs_unhide();
1549 }
1551 SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1552 g_assert(dt->_dlg_mgr != NULL);
1554 switch (reinterpret_cast<std::size_t>(data)) {
1555 case SP_VERB_DIALOG_DISPLAY:
1556 //sp_display_dialog();
1557 dt->_dlg_mgr->showDialog("InkscapePreferences");
1558 break;
1559 case SP_VERB_DIALOG_METADATA:
1560 // sp_desktop_dialog();
1561 dt->_dlg_mgr->showDialog("DocumentMetadata");
1562 break;
1563 case SP_VERB_DIALOG_NAMEDVIEW:
1564 // sp_desktop_dialog();
1565 dt->_dlg_mgr->showDialog("DocumentProperties");
1566 break;
1567 case SP_VERB_DIALOG_FILL_STROKE:
1568 sp_object_properties_dialog();
1569 break;
1570 case SP_VERB_DIALOG_SWATCHES:
1571 show_panel( Inkscape::UI::Dialogs::SwatchesPanel::getInstance(), "dialogs.swatches", SP_VERB_DIALOG_SWATCHES);
1572 break;
1573 case SP_VERB_DIALOG_TRANSFORM:
1574 dt->_dlg_mgr->showDialog("Transformation");
1575 break;
1576 case SP_VERB_DIALOG_ALIGN_DISTRIBUTE:
1577 dt->_dlg_mgr->showDialog("AlignAndDistribute");
1578 break;
1579 case SP_VERB_DIALOG_TEXT:
1580 sp_text_edit_dialog();
1581 break;
1582 case SP_VERB_DIALOG_XML_EDITOR:
1583 sp_xml_tree_dialog();
1584 break;
1585 case SP_VERB_DIALOG_FIND:
1586 sp_find_dialog();
1587 break;
1588 case SP_VERB_DIALOG_DEBUG:
1589 dt->_dlg_mgr->showDialog("Messages");
1590 break;
1591 case SP_VERB_DIALOG_SCRIPT:
1592 dt->_dlg_mgr->showDialog("Script");
1593 break;
1594 case SP_VERB_DIALOG_UNDO_HISTORY:
1595 dt->_dlg_mgr->showDialog("UndoHistory");
1596 break;
1597 case SP_VERB_DIALOG_TOGGLE:
1598 inkscape_dialogs_toggle();
1599 break;
1600 case SP_VERB_DIALOG_CLONETILER:
1601 clonetiler_dialog();
1602 break;
1603 case SP_VERB_DIALOG_ITEM:
1604 sp_item_dialog();
1605 break;
1606 #ifdef WITH_INKBOARD
1607 case SP_VERB_XMPP_CLIENT:
1608 {
1609 Inkscape::Whiteboard::SessionManager::showClient();
1610 break;
1611 }
1612 #endif
1613 case SP_VERB_DIALOG_INPUT:
1614 sp_input_dialog();
1615 break;
1616 case SP_VERB_DIALOG_EXTENSIONEDITOR:
1617 dt->_dlg_mgr->showDialog("ExtensionEditor");
1618 break;
1619 case SP_VERB_DIALOG_LAYERS:
1620 show_panel( Inkscape::UI::Dialogs::LayersPanel::getInstance(), "dialogs.layers", SP_VERB_DIALOG_LAYERS );
1621 break;
1622 default:
1623 break;
1624 }
1625 } // end of sp_verb_action_dialog_perform()
1627 /** \brief Decode the verb code and take appropriate action */
1628 void
1629 HelpVerb::perform(SPAction *action, void *data, void *pdata)
1630 {
1631 SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1632 g_assert(dt->_dlg_mgr != NULL);
1634 switch (reinterpret_cast<std::size_t>(data)) {
1635 case SP_VERB_HELP_KEYS:
1636 /* TRANSLATORS: If you have translated the keys.svg file to your language, then
1637 translate this string as "keys.LANG.svg" (where LANG is your language code);
1638 otherwise leave as "keys.svg". */
1639 sp_help_open_screen(_("keys.svg"));
1640 break;
1641 case SP_VERB_HELP_ABOUT:
1642 sp_help_about();
1643 break;
1644 case SP_VERB_HELP_ABOUT_EXTENSIONS: {
1645 Inkscape::UI::Dialogs::ExtensionsPanel *panel = new Inkscape::UI::Dialogs::ExtensionsPanel();
1646 panel->set_full(true);
1647 show_panel( *panel, "dialogs.aboutextensions", SP_VERB_HELP_ABOUT_EXTENSIONS );
1648 break;
1649 }
1651 /*
1652 case SP_VERB_SHOW_LICENSE:
1653 // TRANSLATORS: See "tutorial-basic.svg" comment.
1654 sp_help_open_tutorial(NULL, (gpointer) _("gpl-2.svg"));
1655 break;
1656 */
1658 case SP_VERB_HELP_MEMORY:
1659 dt->_dlg_mgr->showDialog("Memory");
1660 break;
1661 default:
1662 break;
1663 }
1664 } // end of sp_verb_action_help_perform()
1666 /** \brief Decode the verb code and take appropriate action */
1667 void
1668 TutorialVerb::perform(SPAction *action, void *data, void *pdata)
1669 {
1670 switch (reinterpret_cast<std::size_t>(data)) {
1671 case SP_VERB_TUTORIAL_BASIC:
1672 /* TRANSLATORS: If you have translated the tutorial-basic.svg file to your language,
1673 then translate this string as "tutorial-basic.LANG.svg" (where LANG is your language
1674 code); otherwise leave as "tutorial-basic.svg". */
1675 sp_help_open_tutorial(NULL, (gpointer)_("tutorial-basic.svg"));
1676 break;
1677 case SP_VERB_TUTORIAL_SHAPES:
1678 // TRANSLATORS: See "tutorial-basic.svg" comment.
1679 sp_help_open_tutorial(NULL, (gpointer)_("tutorial-shapes.svg"));
1680 break;
1681 case SP_VERB_TUTORIAL_ADVANCED:
1682 // TRANSLATORS: See "tutorial-basic.svg" comment.
1683 sp_help_open_tutorial(NULL, (gpointer)_("tutorial-advanced.svg"));
1684 break;
1685 case SP_VERB_TUTORIAL_TRACING:
1686 // TRANSLATORS: See "tutorial-basic.svg" comment.
1687 sp_help_open_tutorial(NULL, (gpointer)_("tutorial-tracing.svg"));
1688 break;
1689 case SP_VERB_TUTORIAL_CALLIGRAPHY:
1690 // TRANSLATORS: See "tutorial-basic.svg" comment.
1691 sp_help_open_tutorial(NULL, (gpointer)_("tutorial-calligraphy.svg"));
1692 break;
1693 case SP_VERB_TUTORIAL_DESIGN:
1694 // TRANSLATORS: See "tutorial-basic.svg" comment.
1695 sp_help_open_tutorial(NULL, (gpointer)_("tutorial-elements.svg"));
1696 break;
1697 case SP_VERB_TUTORIAL_TIPS:
1698 // TRANSLATORS: See "tutorial-basic.svg" comment.
1699 sp_help_open_tutorial(NULL, (gpointer)_("tutorial-tips.svg"));
1700 break;
1701 default:
1702 break;
1703 }
1704 } // end of sp_verb_action_tutorial_perform()
1707 /**
1708 * Action vector to define functions called if a staticly defined file verb
1709 * is called.
1710 */
1711 SPActionEventVector FileVerb::vector =
1712 {{NULL},FileVerb::perform, NULL, NULL, NULL, NULL};
1713 /**
1714 * Action vector to define functions called if a staticly defined edit verb is
1715 * called.
1716 */
1717 SPActionEventVector EditVerb::vector =
1718 {{NULL},EditVerb::perform, NULL, NULL, NULL, NULL};
1720 /**
1721 * Action vector to define functions called if a staticly defined selection
1722 * verb is called
1723 */
1724 SPActionEventVector SelectionVerb::vector =
1725 {{NULL},SelectionVerb::perform, NULL, NULL, NULL, NULL};
1727 /**
1728 * Action vector to define functions called if a staticly defined layer
1729 * verb is called
1730 */
1731 SPActionEventVector LayerVerb::vector =
1732 {{NULL}, LayerVerb::perform, NULL, NULL, NULL, NULL};
1734 /**
1735 * Action vector to define functions called if a staticly defined object
1736 * editing verb is called
1737 */
1738 SPActionEventVector ObjectVerb::vector =
1739 {{NULL},ObjectVerb::perform, NULL, NULL, NULL, NULL};
1741 /**
1742 * Action vector to define functions called if a staticly defined context
1743 * verb is called
1744 */
1745 SPActionEventVector ContextVerb::vector =
1746 {{NULL},ContextVerb::perform, NULL, NULL, NULL, NULL};
1748 /**
1749 * Action vector to define functions called if a staticly defined zoom verb
1750 * is called
1751 */
1752 SPActionEventVector ZoomVerb::vector =
1753 {{NULL},ZoomVerb::perform, NULL, NULL, NULL, NULL};
1756 /**
1757 * Action vector to define functions called if a staticly defined dialog verb
1758 * is called
1759 */
1760 SPActionEventVector DialogVerb::vector =
1761 {{NULL},DialogVerb::perform, NULL, NULL, NULL, NULL};
1763 /**
1764 * Action vector to define functions called if a staticly defined help verb
1765 * is called
1766 */
1767 SPActionEventVector HelpVerb::vector =
1768 {{NULL},HelpVerb::perform, NULL, NULL, NULL, NULL};
1770 /**
1771 * Action vector to define functions called if a staticly defined tutorial verb
1772 * is called
1773 */
1774 SPActionEventVector TutorialVerb::vector =
1775 {{NULL},TutorialVerb::perform, NULL, NULL, NULL, NULL};
1777 /**
1778 * Action vector to define functions called if a staticly defined tutorial verb
1779 * is called
1780 */
1781 SPActionEventVector TextVerb::vector =
1782 {{NULL},TextVerb::perform, NULL, NULL, NULL, NULL};
1785 /* *********** Effect Last ********** */
1787 /** \brief A class to represent the last effect issued */
1788 class EffectLastVerb : public Verb {
1789 private:
1790 static void perform(SPAction *action, void *mydata, void *otherdata);
1791 static SPActionEventVector vector;
1792 protected:
1793 virtual SPAction *make_action(Inkscape::UI::View::View *view);
1794 public:
1795 /** \brief Use the Verb initializer with the same parameters. */
1796 EffectLastVerb(unsigned int const code,
1797 gchar const *id,
1798 gchar const *name,
1799 gchar const *tip,
1800 gchar const *image) :
1801 Verb(code, id, name, tip, image)
1802 {
1803 set_default_sensitive(false);
1804 }
1805 }; /* EffectLastVerb class */
1807 /**
1808 * The vector to attach in the last effect verb.
1809 */
1810 SPActionEventVector EffectLastVerb::vector =
1811 {{NULL},EffectLastVerb::perform, NULL, NULL, NULL, NULL};
1813 /** \brief Create an action for a \c EffectLastVerb
1814 \param view Which view the action should be created for
1815 \return The built action.
1817 Calls \c make_action_helper with the \c vector.
1818 */
1819 SPAction *
1820 EffectLastVerb::make_action(Inkscape::UI::View::View *view)
1821 {
1822 return make_action_helper(view, &vector);
1823 }
1825 /** \brief Decode the verb code and take appropriate action */
1826 void
1827 EffectLastVerb::perform(SPAction *action, void *data, void *pdata)
1828 {
1829 /* These aren't used, but are here to remind people not to use
1830 the CURRENT_DOCUMENT macros unless they really have to. */
1831 Inkscape::UI::View::View *current_view = sp_action_get_view(action);
1832 // SPDocument *current_document = SP_VIEW_DOCUMENT(current_view);
1833 Inkscape::Extension::Effect *effect = Inkscape::Extension::Effect::get_last_effect();
1835 if (effect == NULL) return;
1836 if (current_view == NULL) return;
1838 switch ((long) data) {
1839 case SP_VERB_EFFECT_LAST_PREF:
1840 if (!effect->prefs(current_view))
1841 return;
1842 /* Note: fall through */
1843 case SP_VERB_EFFECT_LAST:
1844 effect->effect(current_view);
1845 break;
1846 default:
1847 return;
1848 }
1850 return;
1851 }
1852 /* *********** End Effect Last ********** */
1854 /* *********** Fit Canvas ********** */
1856 /** \brief A class to represent the canvas fitting verbs */
1857 class FitCanvasVerb : public Verb {
1858 private:
1859 static void perform(SPAction *action, void *mydata, void *otherdata);
1860 static SPActionEventVector vector;
1861 protected:
1862 virtual SPAction *make_action(Inkscape::UI::View::View *view);
1863 public:
1864 /** \brief Use the Verb initializer with the same parameters. */
1865 FitCanvasVerb(unsigned int const code,
1866 gchar const *id,
1867 gchar const *name,
1868 gchar const *tip,
1869 gchar const *image) :
1870 Verb(code, id, name, tip, image)
1871 {
1872 set_default_sensitive(false);
1873 }
1874 }; /* FitCanvasVerb class */
1876 /**
1877 * The vector to attach in the fit canvas verb.
1878 */
1879 SPActionEventVector FitCanvasVerb::vector =
1880 {{NULL},FitCanvasVerb::perform, NULL, NULL, NULL, NULL};
1882 /** \brief Create an action for a \c FitCanvasVerb
1883 \param view Which view the action should be created for
1884 \return The built action.
1886 Calls \c make_action_helper with the \c vector.
1887 */
1888 SPAction *
1889 FitCanvasVerb::make_action(Inkscape::UI::View::View *view)
1890 {
1891 SPAction *action = make_action_helper(view, &vector);
1892 return action;
1893 }
1895 /** \brief Decode the verb code and take appropriate action */
1896 void
1897 FitCanvasVerb::perform(SPAction *action, void *data, void *pdata)
1898 {
1899 SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
1900 if (!dt) return;
1901 SPDocument *doc = sp_desktop_document(dt);
1902 if (!doc) return;
1904 switch ((long) data) {
1905 case SP_VERB_FIT_CANVAS_TO_SELECTION:
1906 fit_canvas_to_selection(dt);
1907 break;
1908 case SP_VERB_FIT_CANVAS_TO_DRAWING:
1909 fit_canvas_to_drawing(doc);
1910 break;
1911 case SP_VERB_FIT_CANVAS_TO_SELECTION_OR_DRAWING:
1912 fit_canvas_to_selection_or_drawing(dt);
1913 break;
1914 default:
1915 return;
1916 }
1918 return;
1919 }
1920 /* *********** End Fit Canvas ********** */
1927 /* these must be in the same order as the SP_VERB_* enum in "verbs.h" */
1928 Verb *Verb::_base_verbs[] = {
1929 /* Header */
1930 new Verb(SP_VERB_INVALID, NULL, NULL, NULL, NULL),
1931 new Verb(SP_VERB_NONE, "None", N_("None"), N_("Does nothing"), NULL),
1933 /* File */
1934 new FileVerb(SP_VERB_FILE_NEW, "FileNew", N_("Default"), N_("Create new document from the default template"),
1935 GTK_STOCK_NEW ),
1936 new FileVerb(SP_VERB_FILE_OPEN, "FileOpen", N_("_Open..."),
1937 N_("Open an existing document"), GTK_STOCK_OPEN ),
1938 new FileVerb(SP_VERB_FILE_REVERT, "FileRevert", N_("Re_vert"),
1939 N_("Revert to the last saved version of document (changes will be lost)"), GTK_STOCK_REVERT_TO_SAVED ),
1940 new FileVerb(SP_VERB_FILE_SAVE, "FileSave", N_("_Save"), N_("Save document"),
1941 GTK_STOCK_SAVE ),
1942 new FileVerb(SP_VERB_FILE_SAVE_AS, "FileSaveAs", N_("Save _As..."),
1943 N_("Save document under a new name"), GTK_STOCK_SAVE_AS ),
1944 new FileVerb(SP_VERB_FILE_PRINT, "FilePrint", N_("_Print..."), N_("Print document"),
1945 GTK_STOCK_PRINT ),
1946 // TRANSLATORS: "Vacuum Defs" means "Clean up defs" (so as to remove unused definitions)
1947 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"),
1948 "file_vacuum" ),
1949 new FileVerb(SP_VERB_FILE_PRINT_DIRECT, "FilePrintDirect", N_("Print _Direct"),
1950 N_("Print directly without prompting to a file or pipe"), NULL ),
1951 new FileVerb(SP_VERB_FILE_PRINT_PREVIEW, "FilePrintPreview", N_("Print Previe_w"),
1952 N_("Preview document printout"), GTK_STOCK_PRINT_PREVIEW ),
1953 new FileVerb(SP_VERB_FILE_IMPORT, "FileImport", N_("_Import..."),
1954 N_("Import a bitmap or SVG image into this document"), "file_import"),
1955 new FileVerb(SP_VERB_FILE_EXPORT, "FileExport", N_("_Export Bitmap..."),
1956 N_("Export this document or a selection as a bitmap image"), "file_export"),
1957 new FileVerb(SP_VERB_FILE_NEXT_DESKTOP, "NextWindow", N_("N_ext Window"),
1958 N_("Switch to the next document window"), "window_next"),
1959 new FileVerb(SP_VERB_FILE_PREV_DESKTOP, "PrevWindow", N_("P_revious Window"),
1960 N_("Switch to the previous document window"), "window_previous"),
1961 new FileVerb(SP_VERB_FILE_CLOSE_VIEW, "FileClose", N_("_Close"),
1962 N_("Close this document window"), GTK_STOCK_CLOSE),
1963 new FileVerb(SP_VERB_FILE_QUIT, "FileQuit", N_("_Quit"), N_("Quit Inkscape"), GTK_STOCK_QUIT),
1965 /* Edit */
1966 new EditVerb(SP_VERB_EDIT_UNDO, "EditUndo", N_("_Undo"), N_("Undo last action"),
1967 GTK_STOCK_UNDO),
1968 new EditVerb(SP_VERB_EDIT_REDO, "EditRedo", N_("_Redo"),
1969 N_("Do again the last undone action"), GTK_STOCK_REDO),
1970 new EditVerb(SP_VERB_EDIT_CUT, "EditCut", N_("Cu_t"),
1971 N_("Cut selection to clipboard"), GTK_STOCK_CUT),
1972 new EditVerb(SP_VERB_EDIT_COPY, "EditCopy", N_("_Copy"),
1973 N_("Copy selection to clipboard"), GTK_STOCK_COPY),
1974 new EditVerb(SP_VERB_EDIT_PASTE, "EditPaste", N_("_Paste"),
1975 N_("Paste objects from clipboard to mouse point, or paste text"), GTK_STOCK_PASTE),
1976 new EditVerb(SP_VERB_EDIT_PASTE_STYLE, "EditPasteStyle", N_("Paste _Style"),
1977 N_("Apply the style of the copied object to selection"), "selection_paste_style"),
1978 new EditVerb(SP_VERB_EDIT_PASTE_SIZE, "EditPasteSize", N_("Paste Si_ze"),
1979 N_("Scale selection to match the size of the copied object"), NULL),
1980 new EditVerb(SP_VERB_EDIT_PASTE_SIZE_X, "EditPasteWidth", N_("Paste _Width"),
1981 N_("Scale selection horizontally to match the width of the copied object"), NULL),
1982 new EditVerb(SP_VERB_EDIT_PASTE_SIZE_Y, "EditPasteHeight", N_("Paste _Height"),
1983 N_("Scale selection vertically to match the height of the copied object"), NULL),
1984 new EditVerb(SP_VERB_EDIT_PASTE_SIZE_SEPARATELY, "EditPasteSizeSeparately", N_("Paste Size Separately"),
1985 N_("Scale each selected object to match the size of the copied object"), NULL),
1986 new EditVerb(SP_VERB_EDIT_PASTE_SIZE_SEPARATELY_X, "EditPasteWidthSeparately", N_("Paste Width Separately"),
1987 N_("Scale each selected object horizontally to match the width of the copied object"), NULL),
1988 new EditVerb(SP_VERB_EDIT_PASTE_SIZE_SEPARATELY_Y, "EditPasteHeightSeparately", N_("Paste Height Separately"),
1989 N_("Scale each selected object vertically to match the height of the copied object"), NULL),
1990 new EditVerb(SP_VERB_EDIT_PASTE_IN_PLACE, "EditPasteInPlace", N_("Paste _In Place"),
1991 N_("Paste objects from clipboard to the original location"), "selection_paste_in_place"),
1992 new EditVerb(SP_VERB_EDIT_DELETE, "EditDelete", N_("_Delete"),
1993 N_("Delete selection"), GTK_STOCK_DELETE),
1994 new EditVerb(SP_VERB_EDIT_DUPLICATE, "EditDuplicate", N_("Duplic_ate"),
1995 N_("Duplicate selected objects"), "edit_duplicate"),
1996 new EditVerb(SP_VERB_EDIT_CLONE, "EditClone", N_("Create Clo_ne"),
1997 N_("Create a clone (a copy linked to the original) of selected object"), "edit_clone"),
1998 new EditVerb(SP_VERB_EDIT_UNLINK_CLONE, "EditUnlinkClone", N_("Unlin_k Clone"),
1999 N_("Cut the selected clone's link to its original, turning it into a standalone object"), "edit_unlink_clone"),
2000 new EditVerb(SP_VERB_EDIT_CLONE_ORIGINAL, "EditCloneOriginal", N_("Select _Original"),
2001 N_("Select the object to which the selected clone is linked"), NULL),
2002 // TRANSLATORS: Convert selection to a rectangle with tiled pattern fill
2003 new EditVerb(SP_VERB_EDIT_TILE, "ObjectsToPattern", N_("Objects to Patter_n"),
2004 N_("Convert selection to a rectangle with tiled pattern fill"), NULL),
2005 // TRANSLATORS: Extract objects from a tiled pattern fill
2006 new EditVerb(SP_VERB_EDIT_UNTILE, "ObjectsFromPattern", N_("Pattern to _Objects"),
2007 N_("Extract objects from a tiled pattern fill"), NULL),
2008 new EditVerb(SP_VERB_EDIT_CLEAR_ALL, "EditClearAll", N_("Clea_r All"),
2009 N_("Delete all objects from document"), NULL),
2010 new EditVerb(SP_VERB_EDIT_SELECT_ALL, "EditSelectAll", N_("Select Al_l"),
2011 N_("Select all objects or all nodes"), "selection_select_all"),
2012 new EditVerb(SP_VERB_EDIT_SELECT_ALL_IN_ALL_LAYERS, "EditSelectAllInAllLayers", N_("Select All in All La_yers"),
2013 N_("Select all objects in all visible and unlocked layers"), NULL),
2014 new EditVerb(SP_VERB_EDIT_INVERT, "EditInvert", N_("In_vert Selection"),
2015 N_("Invert selection (unselect what is selected and select everything else)"), NULL),
2016 new EditVerb(SP_VERB_EDIT_INVERT_IN_ALL_LAYERS, "EditInvertInAllLayers", N_("Invert in All Layers"),
2017 N_("Invert selection in all visible and unlocked layers"), NULL),
2018 new EditVerb(SP_VERB_EDIT_DESELECT, "EditDeselect", N_("D_eselect"),
2019 N_("Deselect any selected objects or nodes"), NULL),
2021 /* Selection */
2022 new SelectionVerb(SP_VERB_SELECTION_TO_FRONT, "SelectionToFront", N_("Raise to _Top"),
2023 N_("Raise selection to top"), "selection_top"),
2024 new SelectionVerb(SP_VERB_SELECTION_TO_BACK, "SelectionToBack", N_("Lower to _Bottom"),
2025 N_("Lower selection to bottom"), "selection_bot"),
2026 new SelectionVerb(SP_VERB_SELECTION_RAISE, "SelectionRaise", N_("_Raise"),
2027 N_("Raise selection one step"), "selection_up"),
2028 new SelectionVerb(SP_VERB_SELECTION_LOWER, "SelectionLower", N_("_Lower"),
2029 N_("Lower selection one step"), "selection_down"),
2030 new SelectionVerb(SP_VERB_SELECTION_GROUP, "SelectionGroup", N_("_Group"),
2031 N_("Group selected objects"), "selection_group"),
2032 new SelectionVerb(SP_VERB_SELECTION_UNGROUP, "SelectionUnGroup", N_("_Ungroup"),
2033 N_("Ungroup selected groups"), "selection_ungroup"),
2035 new SelectionVerb(SP_VERB_SELECTION_TEXTTOPATH, "SelectionTextToPath", N_("_Put on Path"),
2036 N_("Put text on path"), NULL),
2037 new SelectionVerb(SP_VERB_SELECTION_TEXTFROMPATH, "SelectionTextFromPath", N_("_Remove from Path"),
2038 N_("Remove text from path"), NULL),
2039 new SelectionVerb(SP_VERB_SELECTION_REMOVE_KERNS, "SelectionTextRemoveKerns", N_("Remove Manual _Kerns"),
2040 // TRANSLATORS: "glyph": An image used in the visual representation of characters;
2041 // roughly speaking, how a character looks. A font is a set of glyphs.
2042 N_("Remove all manual kerns and glyph rotations from a text object"), NULL),
2044 new SelectionVerb(SP_VERB_SELECTION_UNION, "SelectionUnion", N_("_Union"),
2045 N_("Create union of selected paths"), "union"),
2046 new SelectionVerb(SP_VERB_SELECTION_INTERSECT, "SelectionIntersect", N_("_Intersection"),
2047 N_("Create intersection of selected paths"), "intersection"),
2048 new SelectionVerb(SP_VERB_SELECTION_DIFF, "SelectionDiff", N_("_Difference"),
2049 N_("Create difference of selected paths (bottom minus top)"), "difference"),
2050 new SelectionVerb(SP_VERB_SELECTION_SYMDIFF, "SelectionSymDiff", N_("E_xclusion"),
2051 N_("Create exclusive OR of selected paths (those parts that belong to only one path)"), "exclusion"),
2052 new SelectionVerb(SP_VERB_SELECTION_CUT, "SelectionDivide", N_("Di_vision"),
2053 N_("Cut the bottom path into pieces"), "division"),
2054 // TRANSLATORS: "to cut a path" is not the same as "to break a path apart" - see the
2055 // Advanced tutorial for more info
2056 new SelectionVerb(SP_VERB_SELECTION_SLICE, "SelectionCutPath", N_("Cut _Path"),
2057 N_("Cut the bottom path's stroke into pieces, removing fill"), "cut_path"),
2058 // TRANSLATORS: "outset": expand a shape by offsetting the object's path,
2059 // i.e. by displacing it perpendicular to the path in each point.
2060 // See also the Advanced Tutorial for explanation.
2061 new SelectionVerb(SP_VERB_SELECTION_OFFSET, "SelectionOffset", N_("Outs_et"),
2062 N_("Outset selected paths"), "outset_path"),
2063 new SelectionVerb(SP_VERB_SELECTION_OFFSET_SCREEN, "SelectionOffsetScreen",
2064 N_("O_utset Path by 1 px"),
2065 N_("Outset selected paths by 1 px"), NULL),
2066 new SelectionVerb(SP_VERB_SELECTION_OFFSET_SCREEN_10, "SelectionOffsetScreen10",
2067 N_("O_utset Path by 10 px"),
2068 N_("Outset selected paths by 10 px"), NULL),
2069 // TRANSLATORS: "inset": contract a shape by offsetting the object's path,
2070 // i.e. by displacing it perpendicular to the path in each point.
2071 // See also the Advanced Tutorial for explanation.
2072 new SelectionVerb(SP_VERB_SELECTION_INSET, "SelectionInset", N_("I_nset"),
2073 N_("Inset selected paths"), "inset_path"),
2074 new SelectionVerb(SP_VERB_SELECTION_INSET_SCREEN, "SelectionInsetScreen",
2075 N_("I_nset Path by 1 px"),
2076 N_("Inset selected paths by 1 px"), NULL),
2077 new SelectionVerb(SP_VERB_SELECTION_INSET_SCREEN_10, "SelectionInsetScreen10",
2078 N_("I_nset Path by 10 px"),
2079 N_("Inset selected paths by 10 px"), NULL),
2080 new SelectionVerb(SP_VERB_SELECTION_DYNAMIC_OFFSET, "SelectionDynOffset",
2081 N_("D_ynamic Offset"), N_("Create a dynamic offset object"), "dynamic_offset"),
2082 new SelectionVerb(SP_VERB_SELECTION_LINKED_OFFSET, "SelectionLinkedOffset",
2083 N_("_Linked Offset"),
2084 N_("Create a dynamic offset object linked to the original path"),
2085 "linked_offset"),
2086 new SelectionVerb(SP_VERB_SELECTION_OUTLINE, "StrokeToPath", N_("_Stroke to Path"),
2087 N_("Convert selected object's stroke to paths"), "stroke_tocurve"),
2088 new SelectionVerb(SP_VERB_SELECTION_SIMPLIFY, "SelectionSimplify", N_("Si_mplify"),
2089 N_("Simplify selected paths (remove extra nodes)"), "simplify"),
2090 new SelectionVerb(SP_VERB_SELECTION_REVERSE, "SelectionReverse", N_("_Reverse"),
2091 N_("Reverse the direction of selected paths (useful for flipping markers)"), "selection_reverse"),
2092 // TRANSLATORS: "to trace" means "to convert a bitmap to vector graphics" (to vectorize)
2093 new SelectionVerb(SP_VERB_SELECTION_TRACE, "SelectionTrace", N_("_Trace Bitmap..."),
2094 N_("Create one or more paths from a bitmap by tracing it"), "selection_trace"),
2095 new SelectionVerb(SP_VERB_SELECTION_CREATE_BITMAP, "SelectionCreateBitmap", N_("_Make a Bitmap Copy"),
2096 N_("Export selection to a bitmap and insert it into document"), "selection_bitmap" ),
2097 new SelectionVerb(SP_VERB_SELECTION_COMBINE, "SelectionCombine", N_("_Combine"),
2098 N_("Combine several paths into one"), "selection_combine"),
2099 // TRANSLATORS: "to cut a path" is not the same as "to break a path apart" - see the
2100 // Advanced tutorial for more info
2101 new SelectionVerb(SP_VERB_SELECTION_BREAK_APART, "SelectionBreakApart", N_("Break _Apart"),
2102 N_("Break selected paths into subpaths"), "selection_break"),
2103 new SelectionVerb(SP_VERB_SELECTION_GRIDTILE, "DialogGridArrange", N_("Gri_d Arrange..."),
2104 N_("Arrange selected objects in a grid pattern"), "grid_arrange"),
2105 /* Layer */
2106 new LayerVerb(SP_VERB_LAYER_NEW, "LayerNew", N_("_Add Layer..."),
2107 N_("Create a new layer"), "new_layer"),
2108 new LayerVerb(SP_VERB_LAYER_RENAME, "LayerRename", N_("Re_name Layer..."),
2109 N_("Rename the current layer"), "rename_layer"),
2110 new LayerVerb(SP_VERB_LAYER_NEXT, "LayerNext", N_("Switch to Layer Abov_e"),
2111 N_("Switch to the layer above the current"), "switch_to_layer_above"),
2112 new LayerVerb(SP_VERB_LAYER_PREV, "LayerPrev", N_("Switch to Layer Belo_w"),
2113 N_("Switch to the layer below the current"), "switch_to_layer_below"),
2114 new LayerVerb(SP_VERB_LAYER_MOVE_TO_NEXT, "LayerMoveToNext", N_("Move Selection to Layer Abo_ve"),
2115 N_("Move selection to the layer above the current"), "move_selection_above"),
2116 new LayerVerb(SP_VERB_LAYER_MOVE_TO_PREV, "LayerMoveToPrev", N_("Move Selection to Layer Bel_ow"),
2117 N_("Move selection to the layer below the current"), "move_selection_below"),
2118 new LayerVerb(SP_VERB_LAYER_TO_TOP, "LayerToTop", N_("Layer to _Top"),
2119 N_("Raise the current layer to the top"), "layer_to_top"),
2120 new LayerVerb(SP_VERB_LAYER_TO_BOTTOM, "LayerToBottom", N_("Layer to _Bottom"),
2121 N_("Lower the current layer to the bottom"), "layer_to_bottom"),
2122 new LayerVerb(SP_VERB_LAYER_RAISE, "LayerRaise", N_("_Raise Layer"),
2123 N_("Raise the current layer"), "raise_layer"),
2124 new LayerVerb(SP_VERB_LAYER_LOWER, "LayerLower", N_("_Lower Layer"),
2125 N_("Lower the current layer"), "lower_layer"),
2126 new LayerVerb(SP_VERB_LAYER_DELETE, "LayerDelete", N_("_Delete Current Layer"),
2127 N_("Delete the current layer"), "delete_layer"),
2129 /* Object */
2130 new ObjectVerb(SP_VERB_OBJECT_ROTATE_90_CW, "ObjectRotate90", N_("Rotate _90° CW"),
2131 N_("Rotate selection 90° clockwise"), "object_rotate_90_CW"),
2132 new ObjectVerb(SP_VERB_OBJECT_ROTATE_90_CCW, "ObjectRotate90CCW", N_("Rotate 9_0° CCW"),
2133 N_("Rotate selection 90° counter-clockwise"), "object_rotate_90_CCW"),
2134 new ObjectVerb(SP_VERB_OBJECT_FLATTEN, "ObjectRemoveTransform", N_("Remove _Transformations"),
2135 N_("Remove transformations from object"), "object_reset"),
2136 new ObjectVerb(SP_VERB_OBJECT_TO_CURVE, "ObjectToPath", N_("_Object to Path"),
2137 N_("Convert selected object to path"), "object_tocurve"),
2138 new ObjectVerb(SP_VERB_OBJECT_FLOW_TEXT, "ObjectFlowText", N_("_Flow into Frame"),
2139 N_("Put text into a frame (path or shape), creating a flowed text linked to the frame object"), NULL),
2140 new ObjectVerb(SP_VERB_OBJECT_UNFLOW_TEXT, "ObjectUnFlowText", N_("_Unflow"),
2141 N_("Remove text from frame (creates a single-line text object)"), NULL),
2142 new ObjectVerb(SP_VERB_OBJECT_FLOWTEXT_TO_TEXT, "ObjectFlowtextToText", N_("_Convert to Text"),
2143 N_("Convert flowed text to regular text object (preserves appearance)"), NULL),
2144 new ObjectVerb(SP_VERB_OBJECT_FLIP_HORIZONTAL, "ObjectFlipHorizontally",
2145 N_("Flip _Horizontal"), N_("Flip selected objects horizontally"),
2146 "object_flip_hor"),
2147 new ObjectVerb(SP_VERB_OBJECT_FLIP_VERTICAL, "ObjectFlipVertically",
2148 N_("Flip _Vertical"), N_("Flip selected objects vertically"),
2149 "object_flip_ver"),
2150 new ObjectVerb(SP_VERB_OBJECT_SET_MASK, "ObjectSetMask", N_("_Set"),
2151 N_("Apply mask to selection (using the topmost object as mask)"), NULL),
2152 new ObjectVerb(SP_VERB_OBJECT_UNSET_MASK, "ObjectUnSetMask", N_("_Release"),
2153 N_("Remove mask from selection"), NULL),
2154 new ObjectVerb(SP_VERB_OBJECT_SET_CLIPPATH, "ObjectSetClipPath", N_("_Set"),
2155 N_("Apply clipping path to selection (using the topmost object as clipping path)"), NULL),
2156 new ObjectVerb(SP_VERB_OBJECT_UNSET_CLIPPATH, "ObjectUnSetClipPath", N_("_Release"),
2157 N_("Remove clipping path from selection"), NULL),
2159 /* Tools */
2160 new ContextVerb(SP_VERB_CONTEXT_SELECT, "ToolSelector", N_("Select"),
2161 N_("Select and transform objects"), "draw_select"),
2162 new ContextVerb(SP_VERB_CONTEXT_NODE, "ToolNode", N_("Node Edit"),
2163 N_("Edit path nodes or control handles"), "draw_node"),
2164 new ContextVerb(SP_VERB_CONTEXT_RECT, "ToolRect", N_("Rectangle"),
2165 N_("Create rectangles and squares"), "draw_rect"),
2166 new ContextVerb(SP_VERB_CONTEXT_ARC, "ToolArc", N_("Ellipse"),
2167 N_("Create circles, ellipses, and arcs"), "draw_arc"),
2168 new ContextVerb(SP_VERB_CONTEXT_STAR, "ToolStar", N_("Star"),
2169 N_("Create stars and polygons"), "draw_star"),
2170 new ContextVerb(SP_VERB_CONTEXT_SPIRAL, "ToolSpiral", N_("Spiral"),
2171 N_("Create spirals"), "draw_spiral"),
2172 new ContextVerb(SP_VERB_CONTEXT_PENCIL, "ToolPencil", N_("Pencil"),
2173 N_("Draw freehand lines"), "draw_freehand"),
2174 new ContextVerb(SP_VERB_CONTEXT_PEN, "ToolPen", N_("Pen"),
2175 N_("Draw Bezier curves and straight lines"), "draw_pen"),
2176 new ContextVerb(SP_VERB_CONTEXT_CALLIGRAPHIC, "ToolCalligrphic", N_("Calligraphy"),
2177 N_("Draw calligraphic lines"), "draw_calligraphic"),
2178 new ContextVerb(SP_VERB_CONTEXT_TEXT, "ToolText", N_("Text"),
2179 N_("Create and edit text objects"), "draw_text"),
2180 new ContextVerb(SP_VERB_CONTEXT_GRADIENT, "ToolGradient", N_("Gradient"),
2181 N_("Create and edit gradients"), "draw_gradient"),
2182 new ContextVerb(SP_VERB_CONTEXT_ZOOM, "ToolZoom", N_("Zoom"),
2183 N_("Zoom in or out"), "draw_zoom"),
2184 new ContextVerb(SP_VERB_CONTEXT_DROPPER, "ToolDropper", N_("Dropper"),
2185 N_("Pick averaged colors from image"), "draw_dropper"),
2186 new ContextVerb(SP_VERB_CONTEXT_CONNECTOR, "ToolConnector", N_("Connector"),
2187 N_("Create connectors"), "draw_connector"),
2189 /* Tool prefs */
2190 new ContextVerb(SP_VERB_CONTEXT_SELECT_PREFS, "SelectPrefs", N_("Selector Preferences"),
2191 N_("Open Preferences for the Selector tool"), NULL),
2192 new ContextVerb(SP_VERB_CONTEXT_NODE_PREFS, "NodePrefs", N_("Node Tool Preferences"),
2193 N_("Open Preferences for the Node tool"), NULL),
2194 new ContextVerb(SP_VERB_CONTEXT_RECT_PREFS, "RectPrefs", N_("Rectangle Preferences"),
2195 N_("Open Preferences for the Rectangle tool"), NULL),
2196 new ContextVerb(SP_VERB_CONTEXT_ARC_PREFS, "ArcPrefs", N_("Ellipse Preferences"),
2197 N_("Open Preferences for the Ellipse tool"), NULL),
2198 new ContextVerb(SP_VERB_CONTEXT_STAR_PREFS, "StarPrefs", N_("Star Preferences"),
2199 N_("Open Preferences for the Star tool"), NULL),
2200 new ContextVerb(SP_VERB_CONTEXT_SPIRAL_PREFS, "SpiralPrefs", N_("Spiral Preferences"),
2201 N_("Open Preferences for the Spiral tool"), NULL),
2202 new ContextVerb(SP_VERB_CONTEXT_PENCIL_PREFS, "PencilPrefs", N_("Pencil Preferences"),
2203 N_("Open Preferences for the Pencil tool"), NULL),
2204 new ContextVerb(SP_VERB_CONTEXT_PEN_PREFS, "PenPrefs", N_("Pen Preferences"),
2205 N_("Open Preferences for the Pen tool"), NULL),
2206 new ContextVerb(SP_VERB_CONTEXT_CALLIGRAPHIC_PREFS, "CalligraphicPrefs", N_("Calligraphic Preferences"),
2207 N_("Open Preferences for the Calligraphy tool"), NULL),
2208 new ContextVerb(SP_VERB_CONTEXT_TEXT_PREFS, "TextPrefs", N_("Text Preferences"),
2209 N_("Open Preferences for the Text tool"), NULL),
2210 new ContextVerb(SP_VERB_CONTEXT_GRADIENT_PREFS, "GradientPrefs", N_("Gradient Preferences"),
2211 N_("Open Preferences for the Gradient tool"), NULL),
2212 new ContextVerb(SP_VERB_CONTEXT_ZOOM_PREFS, "ZoomPrefs", N_("Zoom Preferences"),
2213 N_("Open Preferences for the Zoom tool"), NULL),
2214 new ContextVerb(SP_VERB_CONTEXT_DROPPER_PREFS, "DropperPrefs", N_("Dropper Preferences"),
2215 N_("Open Preferences for the Dropper tool"), NULL),
2216 new ContextVerb(SP_VERB_CONTEXT_CONNECTOR_PREFS, "ConnectorPrefs", N_("Connector Preferences"),
2217 N_("Open Preferences for the Connector tool"), NULL),
2219 /* Zoom/View */
2220 new ZoomVerb(SP_VERB_ZOOM_IN, "ZoomIn", N_("Zoom In"), N_("Zoom in"), "zoom_in"),
2221 new ZoomVerb(SP_VERB_ZOOM_OUT, "ZoomOut", N_("Zoom Out"), N_("Zoom out"), "zoom_out"),
2222 new ZoomVerb(SP_VERB_TOGGLE_RULERS, "ToggleRulers", N_("_Rulers"), N_("Show or hide the canvas rulers"), "rulers"),
2223 new ZoomVerb(SP_VERB_TOGGLE_SCROLLBARS, "ToggleScrollbars", N_("Scroll_bars"), N_("Show or hide the canvas scrollbars"), "scrollbars"),
2224 new ZoomVerb(SP_VERB_TOGGLE_GRID, "ToggleGrid", N_("_Grid"), N_("Show or hide the grid"), "grid"),
2225 new ZoomVerb(SP_VERB_TOGGLE_GUIDES, "ToggleGuides", N_("G_uides"), N_("Show or hide guides (drag from a ruler to create a guide)"), "guides"),
2226 new ZoomVerb(SP_VERB_ZOOM_NEXT, "ZoomNext", N_("Nex_t Zoom"), N_("Next zoom (from the history of zooms)"),
2227 "zoom_next"),
2228 new ZoomVerb(SP_VERB_ZOOM_PREV, "ZoomPrev", N_("Pre_vious Zoom"), N_("Previous zoom (from the history of zooms)"),
2229 "zoom_previous"),
2230 new ZoomVerb(SP_VERB_ZOOM_1_1, "Zoom1:0", N_("Zoom 1:_1"), N_("Zoom to 1:1"),
2231 "zoom_1_to_1"),
2232 new ZoomVerb(SP_VERB_ZOOM_1_2, "Zoom1:2", N_("Zoom 1:_2"), N_("Zoom to 1:2"),
2233 "zoom_1_to_2"),
2234 new ZoomVerb(SP_VERB_ZOOM_2_1, "Zoom2:1", N_("_Zoom 2:1"), N_("Zoom to 2:1"),
2235 "zoom_2_to_1"),
2236 #ifdef HAVE_GTK_WINDOW_FULLSCREEN
2237 new ZoomVerb(SP_VERB_FULLSCREEN, "FullScreen", N_("_Fullscreen"), N_("Stretch this document window to full screen"),
2238 "fullscreen"),
2239 #endif /* HAVE_GTK_WINDOW_FULLSCREEN */
2240 new ZoomVerb(SP_VERB_VIEW_NEW, "ViewNew", N_("Duplic_ate Window"), N_("Open a new window with the same document"),
2241 "view_new"),
2242 new ZoomVerb(SP_VERB_VIEW_NEW_PREVIEW, "ViewNewPreview", N_("_New View Preview"),
2243 N_("New View Preview"), NULL/*"view_new_preview"*/),
2245 new ZoomVerb(SP_VERB_VIEW_MODE_NORMAL, "ViewModeNormal", N_("_Normal"),
2246 N_("Switch to normal display mode"), NULL),
2247 new ZoomVerb(SP_VERB_VIEW_MODE_OUTLINE, "ViewModeOutline", N_("_Outline"),
2248 N_("Switch to outline (wireframe) display mode"), NULL),
2250 new ZoomVerb(SP_VERB_VIEW_ICON_PREVIEW, "ViewIconPreview", N_("Ico_n Preview"),
2251 N_("Open a window to preview objects at different icon resolutions"), NULL/*"view_icon_preview"*/),
2252 new ZoomVerb(SP_VERB_ZOOM_PAGE, "ZoomPage", N_("_Page"),
2253 N_("Zoom to fit page in window"), "zoom_page"),
2254 new ZoomVerb(SP_VERB_ZOOM_PAGE_WIDTH, "ZoomPageWidth", N_("Page _Width"),
2255 N_("Zoom to fit page width in window"), "zoom_pagewidth"),
2256 new ZoomVerb(SP_VERB_ZOOM_DRAWING, "ZoomDrawing", N_("_Drawing"),
2257 N_("Zoom to fit drawing in window"), "zoom_draw"),
2258 new ZoomVerb(SP_VERB_ZOOM_SELECTION, "ZoomSelection", N_("_Selection"),
2259 N_("Zoom to fit selection in window"), "zoom_select"),
2261 /* Dialogs */
2262 new DialogVerb(SP_VERB_DIALOG_DISPLAY, "DialogPreferences", N_("In_kscape Preferences..."),
2263 N_("Edit global Inkscape preferences"), GTK_STOCK_PREFERENCES ),
2264 new DialogVerb(SP_VERB_DIALOG_NAMEDVIEW, "DialogDocumentProperties", N_("_Document Properties..."),
2265 N_("Edit properties of this document (to be saved with the document)"), GTK_STOCK_PROPERTIES ),
2266 new DialogVerb(SP_VERB_DIALOG_METADATA, "DialogMetadata", N_("Document _Metadata..."),
2267 N_("Edit document metadata (to be saved with the document)"), NULL ),
2268 new DialogVerb(SP_VERB_DIALOG_FILL_STROKE, "DialogFillStroke", N_("_Fill and Stroke..."),
2269 N_("Edit objects' style, such as color or stroke width"), "fill_and_stroke"),
2270 // TRANSLATORS: "Swatches" means: color samples
2271 new DialogVerb(SP_VERB_DIALOG_SWATCHES, "DialogSwatches", N_("S_watches..."),
2272 N_("Select colors from a swatches palette"), GTK_STOCK_SELECT_COLOR),
2273 new DialogVerb(SP_VERB_DIALOG_TRANSFORM, "DialogTransform", N_("Transfor_m..."),
2274 N_("Precisely control objects' transformations"), "object_trans"),
2275 new DialogVerb(SP_VERB_DIALOG_ALIGN_DISTRIBUTE, "DialogAlignDistribute", N_("_Align and Distribute..."),
2276 N_("Align and distribute objects"), "object_align"),
2277 new DialogVerb(SP_VERB_DIALOG_UNDO_HISTORY, "DialogUndoHistory", N_("Undo _History..."),
2278 N_("Undo History"), "edit_undo_history"),
2279 new DialogVerb(SP_VERB_DIALOG_TEXT, "DialogText", N_("_Text and Font..."),
2280 N_("View and select font family, font size and other text properties"), "object_font"),
2281 new DialogVerb(SP_VERB_DIALOG_XML_EDITOR, "DialogXMLEditor", N_("_XML Editor..."),
2282 N_("View and edit the XML tree of the document"), "xml_editor"),
2283 new DialogVerb(SP_VERB_DIALOG_FIND, "DialogFind", N_("_Find..."),
2284 N_("Find objects in document"), GTK_STOCK_FIND ),
2285 new DialogVerb(SP_VERB_DIALOG_DEBUG, "DialogDebug", N_("_Messages..."),
2286 N_("View debug messages"), NULL),
2287 new DialogVerb(SP_VERB_DIALOG_SCRIPT, "DialogScript", N_("S_cripts..."),
2288 N_("Run scripts"), NULL),
2289 new DialogVerb(SP_VERB_DIALOG_TOGGLE, "DialogsToggle", N_("Show/Hide D_ialogs"),
2290 N_("Show or hide all open dialogs"), "dialog_toggle"),
2291 // TRANSLATORS: "Tile Clones" means: "Create tiled clones"
2292 new DialogVerb(SP_VERB_DIALOG_CLONETILER, "DialogClonetiler", N_("Create Tiled Clones..."),
2293 N_("Create multiple clones of selected object, arranging them into a pattern or scattering"), NULL),
2294 new DialogVerb(SP_VERB_DIALOG_ITEM, "DialogObjectProperties", N_("_Object Properties..."),
2295 N_("Edit the ID, locked and visible status, and other object properties"), "dialog_item_properties"),
2296 #ifdef WITH_INKBOARD
2297 new DialogVerb(SP_VERB_XMPP_CLIENT, "DialogXmppClient",
2298 N_("_Instant Messaging..."), N_("Jabber Instant Messaging Client"), NULL),
2299 #endif
2300 new DialogVerb(SP_VERB_DIALOG_INPUT, "DialogInput", N_("_Input Devices..."),
2301 N_("Configure extended input devices, such as a graphics tablet"), NULL),
2302 new DialogVerb(SP_VERB_DIALOG_EXTENSIONEDITOR, "org.inkscape.dialogs.extensioneditor", N_("_Extensions..."),
2303 N_("Query information about extensions"), NULL),
2304 new DialogVerb(SP_VERB_DIALOG_LAYERS, "DialogLayers", N_("Layer_s..."),
2305 N_("View Layers"), NULL),
2307 /* Help */
2308 new HelpVerb(SP_VERB_HELP_KEYS, "HelpKeys", N_("_Keys and Mouse"),
2309 N_("Keys and mouse shortcuts reference"), "help_keys"),
2310 new HelpVerb(SP_VERB_HELP_ABOUT_EXTENSIONS, "HelpAboutExtensions", N_("About E_xtensions"),
2311 N_("Information on Inkscape extensions"), NULL),
2312 new HelpVerb(SP_VERB_HELP_MEMORY, "HelpAboutMemory", N_("About _Memory"),
2313 N_("Memory usage information"), NULL),
2314 new HelpVerb(SP_VERB_HELP_ABOUT, "HelpAbout", N_("_About Inkscape"),
2315 N_("Inkscape version, authors, license"), /*"help_about"*/"inkscape_options"),
2316 //new HelpVerb(SP_VERB_SHOW_LICENSE, "ShowLicense", N_("_License"),
2317 // N_("Distribution terms"), /*"show_license"*/"inkscape_options"),
2319 /* Tutorials */
2320 new TutorialVerb(SP_VERB_TUTORIAL_BASIC, "TutorialsBasic", N_("Inkscape: _Basic"),
2321 N_("Getting started with Inkscape"), NULL/*"tutorial_basic"*/),
2322 new TutorialVerb(SP_VERB_TUTORIAL_SHAPES, "TutorialsShapes", N_("Inkscape: _Shapes"),
2323 N_("Using shape tools to create and edit shapes"), NULL),
2324 new TutorialVerb(SP_VERB_TUTORIAL_ADVANCED, "TutorialsAdvanced", N_("Inkscape: _Advanced"),
2325 N_("Advanced Inkscape topics"), NULL/*"tutorial_advanced"*/),
2326 // TRANSLATORS: "to trace" means "to convert a bitmap to vector graphics" (to vectorize)
2327 new TutorialVerb(SP_VERB_TUTORIAL_TRACING, "TutorialsTracing", N_("Inkscape: T_racing"),
2328 N_("Using bitmap tracing"), NULL/*"tutorial_tracing"*/),
2329 new TutorialVerb(SP_VERB_TUTORIAL_CALLIGRAPHY, "TutorialsCalligraphy", N_("Inkscape: _Calligraphy"),
2330 N_("Using the Calligraphy pen tool"), NULL),
2331 new TutorialVerb(SP_VERB_TUTORIAL_DESIGN, "TutorialsDesign", N_("_Elements of Design"),
2332 N_("Principles of design in the tutorial form"), NULL/*"tutorial_design"*/),
2333 new TutorialVerb(SP_VERB_TUTORIAL_TIPS, "TutorialsTips", N_("_Tips and Tricks"),
2334 N_("Miscellaneous tips and tricks"), NULL/*"tutorial_tips"*/),
2336 /* Effect */
2337 new EffectLastVerb(SP_VERB_EFFECT_LAST, "EffectLast", N_("Previous Effect"),
2338 N_("Repeat the last effect with the same settings"), NULL),
2339 new EffectLastVerb(SP_VERB_EFFECT_LAST_PREF, "EffectLastPref", N_("Previous Effect Settings..."),
2340 N_("Repeat the last effect with new settings"), NULL),
2342 /* Fit Page */
2343 new FitCanvasVerb(SP_VERB_FIT_CANVAS_TO_SELECTION, "FitCanvasToSelection", N_("Fit Page to Selection"),
2344 N_("Fit the page to the current selection"), NULL),
2345 new FitCanvasVerb(SP_VERB_FIT_CANVAS_TO_DRAWING, "FitCanvasToDrawing", N_("Fit Page to Drawing"),
2346 N_("Fit the page to the drawing"), NULL),
2347 new FitCanvasVerb(SP_VERB_FIT_CANVAS_TO_SELECTION_OR_DRAWING, "FitCanvasToSelectionOrDrawing", N_("Fit Page to Selection or Drawing"),
2348 N_("Fit the page to the current selection or the drawing if there is no selection"), NULL),
2349 /* Footer */
2350 new Verb(SP_VERB_LAST, " '\"invalid id", NULL, NULL, NULL)
2351 };
2354 } /* namespace Inkscape */
2356 /*
2357 Local Variables:
2358 mode:c++
2359 c-file-style:"stroustrup"
2360 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
2361 indent-tabs-mode:nil
2362 fill-column:99
2363 End:
2364 */
2365 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :