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