verbs.cpp revision 23f5c868ef859f55e8e9be34afe046fc520b689d
0N/A#define __SP_VERBS_C__
0N/A#ifdef HAVE_CONFIG_H
4378N/A#include "bind/javabind.h"
4378N/A#include "desktop-handles.h"
0N/A#include "dialogs/clonetiler.h"
0N/A#include "dialogs/item-properties.h"
0N/A#include "dialogs/spellcheck.h"
0N/A#include "dialogs/text-edit.h"
1657N/A#include "dialogs/xml-tree.h"
1657N/A#include "document.h"
1657N/A#include "draw-context.h"
0N/A#include "gradient-drag.h"
0N/A#include "inkscape-private.h"
0N/A#include "interface.h"
0N/A#include "layer-fns.h"
0N/A#include "layer-manager.h"
0N/A#include "message-stack.h"
0N/A#include "path-chemistry.h"
0N/A#include "preferences.h"
0N/A#include "select-context.h"
0N/A#include "selection-chemistry.h"
0N/A#include "seltrans.h"
0N/A#include "shape-editor.h"
0N/A#include "shortcuts.h"
0N/A#include "sp-flowtext.h"
0N/A#include "sp-guide.h"
0N/A#include "splivarot.h"
0N/A#include "sp-namedview.h"
0N/A#include "text-chemistry.h"
0N/A#include "tools-switch.h"
#include "ui/dialog/dialog-manager.h"
#include "ui/dialog/document-properties.h"
#include "ui/dialog/extensions.h"
#include "ui/dialog/icon-preview.h"
#include "ui/dialog/inkscape-preferences.h"
#include "ui/dialog/layer-properties.h"
#include "ui/dialog/swatches.h"
#include "ui/icon-names.h"
#include "ui/tool/node-tool.h"
//#include "jabber_whiteboard/session-manager.h"
gchar *
unsigned ri = 0;
ri++;
return ret;
namespace Inkscape {
_actions(0),
_full_tip(0),
_shortcut(0),
_code(0),
_default_sensitive(false)
count++;
delete _actions;
if (_full_tip) {
_full_tip = 0;
SPAction *
return NULL;
SPAction *
SPAction *
SPAction *
SPAction *
SPAction *
SPAction *
SPAction *
SPAction *
SPAction *
SPAction *
SPAction *
SPAction *
Verb::make_action_helper(Inkscape::UI::View::View *view, SPActionEventVector *vector, void *in_pntr)
sizeof(SPActionEventVector),
reinterpret_cast<void *>(_code)
sizeof(SPActionEventVector),
return action;
SPAction *
if (!_default_sensitive) {
cur_action++) {
return action;
cur_action++) {
if (_tip) {
if (_full_tip) {
_full_tip = 0;
if (shortcutString) {
shortcutString = 0;
return result;
cur_action++) {
static int count = 0;
for (int i = 0; i <= SP_VERB_LAST; i++) {
if (_base_verbs[i])
Verb *
return verb;
Verb *
return verb;
case SP_VERB_FILE_NEW:
case SP_VERB_FILE_OPEN:
case SP_VERB_FILE_REVERT:
case SP_VERB_FILE_SAVE:
case SP_VERB_FILE_SAVE_AS:
case SP_VERB_FILE_SAVE_A_COPY:
case SP_VERB_FILE_PRINT:
case SP_VERB_FILE_VACUUM:
case SP_VERB_FILE_IMPORT:
case SP_VERB_FILE_EXPORT:
case SP_VERB_FILE_CLOSE_VIEW:
case SP_VERB_FILE_QUIT:
sp_file_exit();
if (!dt)
case SP_VERB_EDIT_UNDO:
case SP_VERB_EDIT_REDO:
case SP_VERB_EDIT_CUT:
case SP_VERB_EDIT_COPY:
case SP_VERB_EDIT_PASTE:
case SP_VERB_EDIT_PASTE_STYLE:
case SP_VERB_EDIT_PASTE_SIZE:
case SP_VERB_EDIT_DELETE:
case SP_VERB_EDIT_DUPLICATE:
case SP_VERB_EDIT_CLONE:
case SP_VERB_EDIT_TILE:
case SP_VERB_EDIT_UNTILE:
case SP_VERB_EDIT_CLEAR_ALL:
case SP_VERB_EDIT_SELECT_ALL:
case SP_VERB_EDIT_INVERT:
case SP_VERB_EDIT_SELECT_NEXT:
case SP_VERB_EDIT_SELECT_PREV:
case SP_VERB_EDIT_DESELECT:
if (!dt)
case SP_VERB_SELECTION_RAISE:
case SP_VERB_SELECTION_LOWER:
case SP_VERB_SELECTION_GROUP:
case SP_VERB_SELECTION_UNION:
case SP_VERB_SELECTION_DIFF:
case SP_VERB_SELECTION_CUT:
case SP_VERB_SELECTION_SLICE:
case SP_VERB_SELECTION_OFFSET:
case SP_VERB_SELECTION_INSET:
case SP_VERB_SELECTION_TRACE:
switch (verb) {
case SP_VERB_LAYER_NEW: {
case SP_VERB_LAYER_RENAME: {
case SP_VERB_LAYER_NEXT: {
if (next) {
case SP_VERB_LAYER_PREV: {
if (prev) {
case SP_VERB_LAYER_MOVE_TO_NEXT: {
case SP_VERB_LAYER_MOVE_TO_PREV: {
case SP_VERB_LAYER_TO_TOP:
case SP_VERB_LAYER_TO_BOTTOM:
case SP_VERB_LAYER_RAISE:
case SP_VERB_LAYER_LOWER: {
switch (verb) {
case SP_VERB_LAYER_TO_TOP:
case SP_VERB_LAYER_TO_BOTTOM:
case SP_VERB_LAYER_RAISE:
case SP_VERB_LAYER_LOWER:
switch (verb) {
case SP_VERB_LAYER_TO_TOP:
case SP_VERB_LAYER_RAISE:
case SP_VERB_LAYER_TO_BOTTOM:
case SP_VERB_LAYER_LOWER:
if (message) {
case SP_VERB_LAYER_DUPLICATE: {
if (new_layer) {
case SP_VERB_LAYER_DELETE: {
if (!survivor) {
if (survivor) {
case SP_VERB_LAYER_SOLO: {
sp_document_maybe_done(sp_desktop_document(dt), "layer:solo", SP_VERB_LAYER_SOLO, _("Toggle layer solo"));
if (!dt)
if (!bbox) {
if (tools_isactive(dt, TOOLS_SELECT) && sel->center() && SP_SELECT_CONTEXT(ec)->_seltrans->centerIsVisible())
case SP_VERB_OBJECT_FLATTEN:
case SP_VERB_OBJECT_TO_CURVE:
case SP_VERB_OBJECT_FLOW_TEXT:
text_unflow();
case SP_VERB_OBJECT_SET_MASK:
case SP_VERB_OBJECT_EDIT_MASK:
int vidx;
if (!dt)
if (tool_action) {
switch (verb) {
case SP_VERB_CONTEXT_SELECT:
case SP_VERB_CONTEXT_NODE:
case SP_VERB_CONTEXT_TWEAK:
case SP_VERB_CONTEXT_SPRAY:
case SP_VERB_CONTEXT_RECT:
case SP_VERB_CONTEXT_3DBOX:
case SP_VERB_CONTEXT_ARC:
case SP_VERB_CONTEXT_STAR:
case SP_VERB_CONTEXT_SPIRAL:
case SP_VERB_CONTEXT_PENCIL:
case SP_VERB_CONTEXT_PEN:
case SP_VERB_CONTEXT_TEXT:
case SP_VERB_CONTEXT_GRADIENT:
case SP_VERB_CONTEXT_ZOOM:
case SP_VERB_CONTEXT_DROPPER:
case SP_VERB_CONTEXT_ERASER:
case SP_VERB_CONTEXT_LPETOOL:
if (!dt)
(void)doc;
(void)repr;
if (!dt)
case SP_VERB_ZOOM_IN:
case SP_VERB_ZOOM_OUT:
case SP_VERB_ZOOM_1_1:
case SP_VERB_ZOOM_1_2:
case SP_VERB_ZOOM_2_1:
case SP_VERB_ZOOM_PAGE:
case SP_VERB_ZOOM_PAGE_WIDTH:
case SP_VERB_ZOOM_DRAWING:
case SP_VERB_ZOOM_SELECTION:
case SP_VERB_ZOOM_NEXT:
case SP_VERB_ZOOM_PREV:
case SP_VERB_TOGGLE_RULERS:
case SP_VERB_TOGGLE_GUIDES:
case SP_VERB_TOGGLE_SNAPPING:
case SP_VERB_TOGGLE_GRID:
#ifdef HAVE_GTK_WINDOW_FULLSCREEN
case SP_VERB_FULLSCREEN:
case SP_VERB_FOCUSTOGGLE:
case SP_VERB_VIEW_NEW:
case SP_VERB_VIEW_NEW_PREVIEW:
case SP_VERB_VIEW_MODE_NORMAL:
case SP_VERB_VIEW_MODE_TOGGLE:
case SP_VERB_VIEW_CMS_TOGGLE:
case SP_VERB_DIALOG_DISPLAY:
case SP_VERB_DIALOG_METADATA:
case SP_VERB_DIALOG_NAMEDVIEW:
case SP_VERB_DIALOG_GLYPHS:
case SP_VERB_DIALOG_SWATCHES:
case SP_VERB_DIALOG_TRANSFORM:
case SP_VERB_DIALOG_TEXT:
case SP_VERB_DIALOG_FIND:
case SP_VERB_DIALOG_DEBUG:
case SP_VERB_DIALOG_SCRIPT:
case SP_VERB_DIALOG_TOGGLE:
case SP_VERB_DIALOG_ITEM:
case SP_VERB_DIALOG_INPUT:
case SP_VERB_DIALOG_LAYERS:
case SP_VERB_DIALOG_SVG_FONTS:
case SP_VERB_HELP_ABOUT:
case SP_VERB_HELP_ABOUT_EXTENSIONS: {
// TRANSLATORS: See "tutorial-basic.svg" comment.
sp_help_open_tutorial(NULL, (gpointer) _("gpl-2.svg"));
case SP_VERB_HELP_MEMORY:
case SP_VERB_TUTORIAL_BASIC:
/* TRANSLATORS: If you have translated the tutorial-basic.en.svgz file to your language,
then translate this string as "tutorial-basic.LANG.svgz" (where LANG is your language
code); otherwise leave as "tutorial-basic.svg". */
case SP_VERB_TUTORIAL_SHAPES:
// TRANSLATORS: See "tutorial-basic.svg" comment.
// TRANSLATORS: See "tutorial-basic.svg" comment.
case SP_VERB_TUTORIAL_TRACING:
// TRANSLATORS: See "tutorial-basic.svg" comment.
// TRANSLATORS: See "tutorial-basic.svg" comment.
// TRANSLATORS: See "tutorial-basic.svg" comment.
case SP_VERB_TUTORIAL_DESIGN:
// TRANSLATORS: See "tutorial-basic.svg" comment.
case SP_VERB_TUTORIAL_TIPS:
// TRANSLATORS: See "tutorial-basic.svg" comment.
set_default_sensitive(false);
SPAction *
case SP_VERB_EFFECT_LAST_PREF:
case SP_VERB_EFFECT_LAST:
set_default_sensitive(false);
SPAction *
return action;
if (!dt) return;
if (!doc) return;
set_default_sensitive(true);
SPAction *
return action;
if (!dt) return;
if (!doc) return;
case SP_VERB_UNLOCK_ALL:
case SP_VERB_UNHIDE_ALL:
/* these must be in the same order as the SP_VERB_* enum in "verbs.h" */
new FileVerb(SP_VERB_FILE_NEW, "FileNew", N_("Default"), N_("Create new document from the default template"),
N_("Revert to the last saved version of document (changes will be lost)"), GTK_STOCK_REVERT_TO_SAVED ),
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"),
new FileVerb(SP_VERB_FILE_IMPORT_FROM_OCAL, "FileImportFromOCAL", N_("Import From Open Clip Art Library"), N_("Import a document from Open Clip Art Library"), INKSCAPE_ICON_DOCUMENT_IMPORT_OCAL),
// new FileVerb(SP_VERB_FILE_EXPORT_TO_OCAL, "FileExportToOCAL", N_("Export To Open Clip Art Library"), N_("Export this document to Open Clip Art Library"), INKSCAPE_ICON_DOCUMENT_EXPORT_OCAL),
new EditVerb(SP_VERB_EDIT_PASTE_SIZE_SEPARATELY, "EditPasteSizeSeparately", N_("Paste Size Separately"),
new EditVerb(SP_VERB_EDIT_PASTE_SIZE_SEPARATELY_X, "EditPasteWidthSeparately", N_("Paste Width Separately"),
new EditVerb(SP_VERB_EDIT_PASTE_SIZE_SEPARATELY_Y, "EditPasteHeightSeparately", N_("Paste Height Separately"),
N_("Cut the selected clones' links to the originals, turning them into standalone objects"), INKSCAPE_ICON_EDIT_CLONE_UNLINK),
new EditVerb(SP_VERB_EDIT_SELECT_ALL_IN_ALL_LAYERS, "EditSelectAllInAllLayers", N_("Select All in All La_yers"),
N_("Invert selection (unselect what is selected and select everything else)"), INKSCAPE_ICON_EDIT_SELECT_INVERT),
new EditVerb(SP_VERB_EDIT_INVERT_IN_ALL_LAYERS, "EditInvertInAllLayers", N_("Invert in All Layers"),
new EditVerb(SP_VERB_EDIT_NEXT_PATHEFFECT_PARAMETER, "EditNextPathEffectParameter", N_("Next path effect parameter"),
new SelectionVerb(SP_VERB_SELECTION_REMOVE_KERNS, "SelectionTextRemoveKerns", N_("Remove Manual _Kerns"),
N_("Create exclusive OR of selected paths (those parts that belong to only one path)"), INKSCAPE_ICON_PATH_EXCLUSION),
N_("Reverse the direction of selected paths (useful for flipping markers)"), INKSCAPE_ICON_PATH_REVERSE),
new SelectionVerb(SP_VERB_SELECTION_CREATE_BITMAP, "SelectionCreateBitmap", N_("_Make a Bitmap Copy"),
N_("Export selection to a bitmap and insert it into document"), INKSCAPE_ICON_SELECTION_MAKE_BITMAP_COPY ),
N_("Put text into a frame (path or shape), creating a flowed text linked to the frame object"), "text-flow-into-frame"),
N_("Convert flowed text to regular text object (preserves appearance)"), INKSCAPE_ICON_TEXT_CONVERT_TO_REGULAR),
new ContextVerb(SP_VERB_CONTEXT_CALLIGRAPHIC_PREFS, "CalligraphicPrefs", N_("Calligraphic Preferences"),
new ContextVerb(SP_VERB_CONTEXT_PAINTBUCKET_PREFS, "PaintBucketPrefs", N_("Paint Bucket Preferences"),
new ZoomVerb(SP_VERB_TOGGLE_RULERS, "ToggleRulers", N_("_Rulers"), N_("Show or hide the canvas rulers"), NULL),
new ZoomVerb(SP_VERB_TOGGLE_SCROLLBARS, "ToggleScrollbars", N_("Scroll_bars"), N_("Show or hide the canvas scrollbars"), NULL),
new ZoomVerb(SP_VERB_TOGGLE_GRID, "ToggleGrid", N_("_Grid"), N_("Show or hide the grid"), INKSCAPE_ICON_SHOW_GRID),
new ZoomVerb(SP_VERB_TOGGLE_GUIDES, "ToggleGuides", N_("G_uides"), N_("Show or hide guides (drag from a ruler to create a guide)"), INKSCAPE_ICON_SHOW_GUIDES),
new ZoomVerb(SP_VERB_TOGGLE_SNAPPING, "ToggleSnapGlobal", N_("Snap"), N_("Enable snapping"), INKSCAPE_ICON_SNAP),
new ZoomVerb(SP_VERB_ZOOM_NEXT, "ZoomNext", N_("Nex_t Zoom"), N_("Next zoom (from the history of zooms)"),
new ZoomVerb(SP_VERB_ZOOM_PREV, "ZoomPrev", N_("Pre_vious Zoom"), N_("Previous zoom (from the history of zooms)"),
#ifdef HAVE_GTK_WINDOW_FULLSCREEN
new ZoomVerb(SP_VERB_FULLSCREEN, "FullScreen", N_("_Fullscreen"), N_("Stretch this document window to full screen"),
new ZoomVerb(SP_VERB_FOCUSTOGGLE, "FocusToggle", N_("Toggle _Focus Mode"), N_("Remove excess toolbars to focus on drawing"),
NULL),
new ZoomVerb(SP_VERB_VIEW_NEW, "ViewNew", N_("Duplic_ate Window"), N_("Open a new window with the same document"),
// new ZoomVerb(SP_VERB_VIEW_MODE_PRINT_COLORS_PREVIEW, "ViewModePrintColorsPreview", N_("_Print Colors Preview"),
N_("Open a window to preview objects at different icon resolutions"), INKSCAPE_ICON_DIALOG_ICON_PREVIEW),
N_("Edit objects' colors, gradients, arrowheads, and other fill and stroke properties..."), INKSCAPE_ICON_DIALOG_FILL_AND_STROKE),
new DialogVerb(SP_VERB_DIALOG_ALIGN_DISTRIBUTE, "DialogAlignDistribute", N_("_Align and Distribute..."),
N_("View and select font family, font size and other text properties"), INKSCAPE_ICON_DIALOG_TEXT_AND_FONT),
N_("Create multiple clones of selected object, arranging them into a pattern or scattering"), INKSCAPE_ICON_DIALOG_TILE_CLONES),
N_("Edit the ID, locked and visible status, and other object properties"), INKSCAPE_ICON_DIALOG_OBJECT_PROPERTIES),
N_("Configure extended input devices, such as a graphics tablet"), INKSCAPE_ICON_DIALOG_INPUT_DEVICES),
new DialogVerb(SP_VERB_DIALOG_EXTENSIONEDITOR, "org.inkscape.dialogs.extensioneditor", N_("_Extensions..."),
new DialogVerb(SP_VERB_DIALOG_LIVE_PATH_EFFECT, "DialogLivePathEffect", N_("Path Effect Editor..."),
new DialogVerb(SP_VERB_DIALOG_PRINT_COLORS_PREVIEW, "DialogPrintColorsPreview", N_("Print Colors..."),
new TutorialVerb(SP_VERB_TUTORIAL_CALLIGRAPHY, "TutorialsCalligraphy", N_("Inkscape: _Calligraphy"),
new TutorialVerb(SP_VERB_TUTORIAL_INTERPOLATE, "TutorialsInterpolate", N_("Inkscape: _Interpolate"),
new EffectLastVerb(SP_VERB_EFFECT_LAST_PREF, "EffectLastPref", N_("Previous Extension Settings..."),
new FitCanvasVerb(SP_VERB_FIT_CANVAS_TO_SELECTION, "FitCanvasToSelection", N_("Fit Page to Selection"),
new FitCanvasVerb(SP_VERB_FIT_CANVAS_TO_SELECTION_OR_DRAWING, "FitCanvasToSelectionOrDrawing", N_("Fit Page to Selection or Drawing"),
new LockAndHideVerb(SP_VERB_UNLOCK_ALL_IN_ALL_LAYERS, "UnlockAllInAllLayers", N_("Unlock All in All Layers"),
new LockAndHideVerb(SP_VERB_UNHIDE_ALL_IN_ALL_LAYERS, "UnhideAllInAllLayers", N_("Unhide All in All Layers"),