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