verbs.cpp revision 2f8a505c173a704ab6fb25538bb3c1afe5ce9e4e
#define __SP_VERBS_C__
/**
* \file verbs.cpp
*
* \brief Actions for inkscape
*
* This file implements routines necessary to deal with verbs. A verb
* is a numeric identifier used to retrieve standard SPActions for particular
* views.
*/
/*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* Ted Gould <ted@gould.cx>
* MenTaLguY <mental@rydia.net>
* David Turner <novalis@gnu.org>
* bulia byak <buliabyak@users.sf.net>
*
* Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl>
* Copyright (C) (date unspecified) Authors
* This code is in public domain.
*/
#include <gtk/gtkstock.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <gtkmm/messagedialog.h>
#include <gtkmm/filechooserdialog.h>
#include "dialogs/text-edit.h"
#include "dialogs/xml-tree.h"
#include "dialogs/object-properties.h"
#include "dialogs/item-properties.h"
#include "dialogs/layer-properties.h"
#include "dialogs/clonetiler.h"
#include "dialogs/iconpreview.h"
#include "dialogs/extensions.h"
#include "dialogs/swatches.h"
#include "dialogs/layers-panel.h"
#ifdef WITH_INKBOARD
#include "jabber_whiteboard/session-manager.h"
#endif
#include "tools-switch.h"
#include "inkscape-private.h"
#include "file.h"
#include "help.h"
#include "document.h"
#include "desktop.h"
#include "message-stack.h"
#include "desktop-handles.h"
#include "selection-chemistry.h"
#include "path-chemistry.h"
#include "text-chemistry.h"
#include "ui/dialog/dialog-manager.h"
#include "ui/dialog/inkscape-preferences.h"
#include "interface.h"
#include "prefs-utils.h"
#include "splivarot.h"
#include "sp-namedview.h"
#include "sp-flowtext.h"
#include "layer-fns.h"
#include "node-context.h"
#include "gradient-context.h"
#include "shape-editor.h"
/**
* \brief Return the name without underscores and ellipsis, for use in dialog
* titles, etc. Allocated memory must be freed by caller.
*/
gchar *
{
unsigned ri = 0;
if ( c != '_' && c != '.' ) {
ri++;
if (c == '\0') {
return ret;
}
}
}
} // end of sp_action_get_title()
namespace Inkscape {
/// \todo !!!FIXME:: kill this, use DialogManager instead!!!
{
public:
/*
virtual Glib::ustring getName() const {return "foo";}
virtual Glib::ustring getDesc() const {return "bar";}
*/
};
/** \brief Utility function to get a panel displayed. */
static void show_panel( Inkscape::UI::Widget::Panel &panel, char const *prefs_path, int const verb_num )
{
//g_message("Creating new dialog to hold it");
dia->show_all_children();
dia->read_geometry();
} else {
if ( dia ) {
//g_message("Found an existing dialog");
} else {
g_message("Failed to find an existing dialog");
}
}
}
/** \brief A class to encompass all of the verbs which deal with
file operations. */
private:
static SPActionEventVector vector;
protected:
public:
/** \brief Use the Verb initializer with the same parameters. */
{ }
}; /* FileVerb class */
/** \brief A class to encompass all of the verbs which deal with
edit operations. */
private:
static SPActionEventVector vector;
protected:
public:
/** \brief Use the Verb initializer with the same parameters. */
{ }
}; /* EditVerb class */
/** \brief A class to encompass all of the verbs which deal with
selection operations. */
class SelectionVerb : public Verb {
private:
static SPActionEventVector vector;
protected:
public:
/** \brief Use the Verb initializer with the same parameters. */
SelectionVerb(unsigned int const code,
{ }
}; /* SelectionVerb class */
/** \brief A class to encompass all of the verbs which deal with
layer operations. */
private:
static SPActionEventVector vector;
protected:
public:
/** \brief Use the Verb initializer with the same parameters. */
{ }
}; /* LayerVerb class */
/** \brief A class to encompass all of the verbs which deal with
operations related to objects. */
class ObjectVerb : public Verb {
private:
static SPActionEventVector vector;
protected:
public:
/** \brief Use the Verb initializer with the same parameters. */
ObjectVerb(unsigned int const code,
{ }
}; /* ObjectVerb class */
/** \brief A class to encompass all of the verbs which deal with
operations relative to context. */
class ContextVerb : public Verb {
private:
static SPActionEventVector vector;
protected:
public:
/** \brief Use the Verb initializer with the same parameters. */
ContextVerb(unsigned int const code,
{ }
}; /* ContextVerb class */
/** \brief A class to encompass all of the verbs which deal with
zoom operations. */
private:
static SPActionEventVector vector;
protected:
public:
/** \brief Use the Verb initializer with the same parameters. */
{ }
}; /* ZoomVerb class */
/** \brief A class to encompass all of the verbs which deal with
dialog operations. */
class DialogVerb : public Verb {
private:
static SPActionEventVector vector;
protected:
public:
/** \brief Use the Verb initializer with the same parameters. */
DialogVerb(unsigned int const code,
{ }
}; /* DialogVerb class */
/** \brief A class to encompass all of the verbs which deal with
help operations. */
private:
static SPActionEventVector vector;
protected:
public:
/** \brief Use the Verb initializer with the same parameters. */
{ }
}; /* HelpVerb class */
/** \brief A class to encompass all of the verbs which deal with
tutorial operations. */
class TutorialVerb : public Verb {
private:
static SPActionEventVector vector;
protected:
public:
/** \brief Use the Verb initializer with the same parameters. */
TutorialVerb(unsigned int const code,
{ }
}; /* TutorialVerb class */
/** \brief A class to encompass all of the verbs which deal with
text operations. */
private:
static SPActionEventVector vector;
protected:
public:
/** \brief Use the Verb initializer with the same parameters. */
{ }
}; //TextVerb : public Verb
/** \brief Create a verb without a code.
This function calls the other constructor for all of the parameters,
but generates the code. It is important to READ THE OTHER DOCUMENTATION
it has important details in it. To generate the code a static is
used which starts at the last static value: \c SP_VERB_LAST. For
each call it is incremented. The list of allocated verbs is kept
in the \c _verbs hashtable which is indexed by the \c code.
*/
{
static int count = SP_VERB_LAST;
count++;
return;
}
/** \brief Destroy a verb.
The only allocated variable is the _actions variable. If it has
been allocated it is deleted.
*/
{
/// \todo all the actions need to be cleaned up first.
delete _actions;
}
return;
}
/** \brief Verbs are no good without actions. This is a place holder
for a function that every subclass should write. Most
can be written using \c make_action_helper.
\param view Which view the action should be created for.
\return NULL to represent error (this function shouldn't ever be called)
*/
SPAction *
{
//std::cout << "make_action" << std::endl;
return NULL;
}
/** \brief Create an action for a \c FileVerb
\param view Which view the action should be created for
\return The built action.
Calls \c make_action_helper with the \c vector.
*/
SPAction *
{
//std::cout << "fileverb: make_action: " << &vector << std::endl;
}
/** \brief Create an action for a \c EditVerb
\param view Which view the action should be created for
\return The built action.
Calls \c make_action_helper with the \c vector.
*/
SPAction *
{
//std::cout << "editverb: make_action: " << &vector << std::endl;
}
/** \brief Create an action for a \c SelectionVerb
\param view Which view the action should be created for
\return The built action.
Calls \c make_action_helper with the \c vector.
*/
SPAction *
{
}
/** \brief Create an action for a \c LayerVerb
\param view Which view the action should be created for
\return The built action.
Calls \c make_action_helper with the \c vector.
*/
SPAction *
{
}
/** \brief Create an action for a \c ObjectVerb
\param view Which view the action should be created for
\return The built action.
Calls \c make_action_helper with the \c vector.
*/
SPAction *
{
}
/** \brief Create an action for a \c ContextVerb
\param view Which view the action should be created for
\return The built action.
Calls \c make_action_helper with the \c vector.
*/
SPAction *
{
}
/** \brief Create an action for a \c ZoomVerb
\param view Which view the action should be created for
\return The built action.
Calls \c make_action_helper with the \c vector.
*/
SPAction *
{
}
/** \brief Create an action for a \c DialogVerb
\param view Which view the action should be created for
\return The built action.
Calls \c make_action_helper with the \c vector.
*/
SPAction *
{
}
/** \brief Create an action for a \c HelpVerb
\param view Which view the action should be created for
\return The built action.
Calls \c make_action_helper with the \c vector.
*/
SPAction *
{
}
/** \brief Create an action for a \c TutorialVerb
\param view Which view the action should be created for
\return The built action.
Calls \c make_action_helper with the \c vector.
*/
SPAction *
{
}
/** \brief Create an action for a \c TextVerb
\param view Which view the action should be created for
\return The built action.
Calls \c make_action_helper with the \c vector.
*/
SPAction *
{
}
/** \brief A quick little convience function to make building actions
a little bit easier.
\param view Which view the action should be created for.
\param vector The function vector for the verb.
\return The created action.
This function does a couple of things. The most obvious is that
it allocates and creates the action. When it does this it
translates the \c _name and \c _tip variables. This allows them
to be staticly allocated easily, and get translated in the end. Then,
if the action gets crated, a listener is added to the action with
the vector that is passed in.
*/
SPAction *
Verb::make_action_helper(Inkscape::UI::View::View *view, SPActionEventVector *vector, void *in_pntr)
{
//std::cout << "Adding action: " << _code << std::endl;
(NRActiveObject *) action,
sizeof(SPActionEventVector),
reinterpret_cast<void *>(_code)
);
} else {
(NRActiveObject *) action,
sizeof(SPActionEventVector),
);
}
}
return action;
}
/** \brief A function to get an action if it exists, or otherwise to
build it.
\param view The view which this action would relate to
\return The action, or NULL if there is an error.
This function will get the action for a given view for this verb. It
will create the verb if it can't be found in the ActionTable. Also,
if the \c ActionTable has not been created, it gets created by this
function.
If the action is created, it's sensitivity must be determined. The
default for a new action is that it is sensitive. If the value in
\c _default_sensitive is \c false, then the sensitivity must be
removed. Also, if the view being created is based on the same
document as a view already created, the sensitivity should be the
same as views on that document. A view with the same document is
looked for, and the sensitivity is matched. Unfortunately, this is
currently a linear search.
*/
SPAction *
{
_actions = new ActionTable;
}
} else {
// if (action == NULL) printf("Hmm, NULL in %s\n", _name);
if (!_default_sensitive) {
} else {
cur_action++) {
break;
}
}
}
}
return action;
}
void
{
// printf("Setting sensitivity of \"%s\" to %d\n", _name, in_sensitive);
cur_action++) {
}
}
}
}
return;
}
void
{
cur_action++) {
}
}
}
}
/** \brief A function to remove the action associated with a view.
\param view Which view's actions should be removed.
\return None
This function looks for the action in \c _actions. If it is
found then it is unreferenced and the entry in the action
table is erased.
*/
void
{
#if 0
static int count = 0;
#endif
}
return;
}
/** \brief A function to delete a view from all verbs
\param view Which view's actions should be removed.
\return None
This function first looks through _base_verbs and deteles
the view from all of those views. If \c _verbs is not empty
then all of the entries in that table have all of the views
deleted also.
*/
void
{
for (int i = 0; i <= SP_VERB_LAST; i++) {
if (_base_verbs[i])
}
// std::cout << "Delete In Verb: " << verbpntr->_name << std::endl;
}
}
return;
}
/** \brief A function to turn a \c code into a Verb for dynamically
created Verbs.
\param code What code is being looked for
\return The found Verb of NULL if none is found.
This function basically just looks through the \c _verbs hash
table. STL does all the work.
*/
Verb *
{
}
return verb;
}
/** \brief Find a Verb using it's ID
\param id Which id to search for
This function uses the \c _verb_ids has table to find the
verb by it's id. Should be much faster than previous
implementations.
*/
Verb *
{
}
return verb;
}
/** \brief Decode the verb code and take appropriate action */
void
{
#if 0
/* These aren't used, but are here to remind people not to use
the CURRENT_DOCUMENT macros unless they really have to. */
#endif
switch ((long) data) {
case SP_VERB_FILE_NEW:
break;
case SP_VERB_FILE_OPEN:
break;
case SP_VERB_FILE_REVERT:
break;
case SP_VERB_FILE_SAVE:
break;
case SP_VERB_FILE_SAVE_AS:
break;
case SP_VERB_FILE_SAVE_A_COPY:
break;
case SP_VERB_FILE_PRINT:
break;
case SP_VERB_FILE_VACUUM:
break;
break;
break;
case SP_VERB_FILE_IMPORT:
break;
case SP_VERB_FILE_EXPORT:
break;
break;
break;
case SP_VERB_FILE_CLOSE_VIEW:
break;
case SP_VERB_FILE_QUIT:
sp_file_exit();
break;
default:
break;
}
} // end of sp_verb_action_file_perform()
/** \brief Decode the verb code and take appropriate action */
void
{
if (!dt)
return;
case SP_VERB_EDIT_UNDO:
break;
case SP_VERB_EDIT_REDO:
break;
case SP_VERB_EDIT_CUT:
break;
case SP_VERB_EDIT_COPY:
break;
case SP_VERB_EDIT_PASTE:
sp_selection_paste(false);
break;
case SP_VERB_EDIT_PASTE_STYLE:
break;
case SP_VERB_EDIT_PASTE_SIZE:
sp_selection_paste_size(true, true);
break;
sp_selection_paste_size(true, false);
break;
sp_selection_paste_size(false, true);
break;
sp_selection_paste_size_separately(true, true);
break;
sp_selection_paste_size_separately(true, false);
break;
sp_selection_paste_size_separately(false, true);
break;
sp_selection_paste(true);
break;
case SP_VERB_EDIT_DELETE:
break;
case SP_VERB_EDIT_DUPLICATE:
break;
case SP_VERB_EDIT_CLONE:
break;
break;
break;
case SP_VERB_EDIT_TILE:
break;
case SP_VERB_EDIT_UNTILE:
break;
case SP_VERB_EDIT_CLEAR_ALL:
break;
case SP_VERB_EDIT_SELECT_ALL:
} else {
}
break;
case SP_VERB_EDIT_INVERT:
} else {
}
break;
} else {
}
break;
} else {
}
break;
case SP_VERB_EDIT_SELECT_NEXT:
} else {
}
break;
case SP_VERB_EDIT_SELECT_PREV:
} else {
}
break;
case SP_VERB_EDIT_DESELECT:
} else {
}
break;
default:
break;
}
} // end of sp_verb_action_edit_perform()
/** \brief Decode the verb code and take appropriate action */
void
{
if (!dt)
return;
break;
break;
case SP_VERB_SELECTION_RAISE:
break;
case SP_VERB_SELECTION_LOWER:
break;
case SP_VERB_SELECTION_GROUP:
break;
break;
break;
break;
break;
case SP_VERB_SELECTION_UNION:
break;
break;
case SP_VERB_SELECTION_DIFF:
break;
break;
case SP_VERB_SELECTION_CUT:
break;
case SP_VERB_SELECTION_SLICE:
break;
case SP_VERB_SELECTION_OFFSET:
break;
break;
break;
case SP_VERB_SELECTION_INSET:
break;
break;
break;
break;
break;
break;
break;
break;
case SP_VERB_SELECTION_TRACE:
break;
break;
break;
break;
break;
default:
break;
}
} // end of sp_verb_action_selection_perform()
/** \brief Decode the verb code and take appropriate action */
void
{
return;
}
switch (verb) {
case SP_VERB_LAYER_NEW: {
break;
}
case SP_VERB_LAYER_RENAME: {
break;
}
case SP_VERB_LAYER_NEXT: {
if (next) {
_("Move to next layer"));
} else {
}
break;
}
case SP_VERB_LAYER_PREV: {
if (prev) {
_("Move to previous layer"));
} else {
}
break;
}
case SP_VERB_LAYER_MOVE_TO_NEXT: {
break;
}
case SP_VERB_LAYER_MOVE_TO_PREV: {
break;
}
case SP_VERB_LAYER_TO_TOP:
case SP_VERB_LAYER_TO_BOTTOM:
case SP_VERB_LAYER_RAISE:
case SP_VERB_LAYER_LOWER: {
return;
}
switch (verb) {
case SP_VERB_LAYER_TO_TOP:
layer->raiseToTop();
break;
case SP_VERB_LAYER_TO_BOTTOM:
layer->lowerToBottom();
break;
case SP_VERB_LAYER_RAISE:
break;
case SP_VERB_LAYER_LOWER:
break;
}
switch (verb) {
case SP_VERB_LAYER_TO_TOP:
description = _("Layer to top");
break;
case SP_VERB_LAYER_RAISE:
description = _("Raise layer");
break;
case SP_VERB_LAYER_TO_BOTTOM:
description = _("Layer to bottom");
break;
case SP_VERB_LAYER_LOWER:
description = _("Lower layer");
break;
};
if (message) {
}
} else {
}
break;
}
case SP_VERB_LAYER_DELETE: {
if (!survivor) {
}
/* Deleting the old layer before switching layers is a hack to trigger the
* listeners of the deletion event (as happens when old_layer is deleted using the
* xml editor). See
*/
if (survivor) {
}
_("Delete layer"));
// TRANSLATORS: this means "The layer has been deleted."
} else {
}
break;
}
}
return;
} // end of sp_verb_action_layer_perform()
/** \brief Decode the verb code and take appropriate action */
void
{
if (!dt)
return;
return;
break;
break;
case SP_VERB_OBJECT_FLATTEN:
break;
case SP_VERB_OBJECT_TO_CURVE:
break;
case SP_VERB_OBJECT_FLOW_TEXT:
break;
text_unflow();
break;
break;
} else {
}
_("Flip horizontally"));
break;
} else {
}
_("Flip vertically"));
break;
case SP_VERB_OBJECT_SET_MASK:
sp_selection_set_mask(false, false);
break;
sp_selection_unset_mask(false);
break;
sp_selection_set_mask(true, false);
break;
sp_selection_unset_mask(true);
break;
default:
break;
}
} // end of sp_verb_action_object_perform()
/** \brief Decode the verb code and take appropriate action */
void
{
int vidx;
if (!dt)
return;
/** \todo !!! hopefully this can go away soon and actions can look after
* themselves
*/
{
if (tool_action) {
}
}
switch (verb) {
case SP_VERB_CONTEXT_SELECT:
break;
case SP_VERB_CONTEXT_NODE:
break;
case SP_VERB_CONTEXT_RECT:
break;
case SP_VERB_CONTEXT_ARC:
break;
case SP_VERB_CONTEXT_STAR:
break;
case SP_VERB_CONTEXT_SPIRAL:
break;
case SP_VERB_CONTEXT_PENCIL:
break;
case SP_VERB_CONTEXT_PEN:
break;
break;
case SP_VERB_CONTEXT_TEXT:
break;
case SP_VERB_CONTEXT_GRADIENT:
break;
case SP_VERB_CONTEXT_ZOOM:
break;
case SP_VERB_CONTEXT_DROPPER:
break;
break;
break;
break;
break;
break;
break;
break;
break;
break;
break;
break;
break;
break;
break;
break;
default:
break;
}
} // end of sp_verb_action_ctx_perform()
/** \brief Decode the verb code and take appropriate action */
void
{
if (!dt)
return;
(void)doc;
(void)repr;
}
/** \brief Decode the verb code and take appropriate action */
void
{
if (!dt)
return;
prefs_get_double_attribute_limited( "options.zoomincrement",
"value", 1.414213562, 1.01, 10 );
switch (GPOINTER_TO_INT(data)) {
case SP_VERB_ZOOM_IN:
{
break;
}
case SP_VERB_ZOOM_OUT:
{
break;
}
case SP_VERB_ZOOM_1_1:
{
break;
}
case SP_VERB_ZOOM_1_2:
{
break;
}
case SP_VERB_ZOOM_2_1:
{
break;
}
case SP_VERB_ZOOM_PAGE:
break;
case SP_VERB_ZOOM_PAGE_WIDTH:
dt->zoom_page_width();
break;
case SP_VERB_ZOOM_DRAWING:
dt->zoom_drawing();
break;
case SP_VERB_ZOOM_SELECTION:
dt->zoom_selection();
break;
case SP_VERB_ZOOM_NEXT:
break;
case SP_VERB_ZOOM_PREV:
break;
case SP_VERB_TOGGLE_RULERS:
dt->toggleRulers();
break;
dt->toggleScrollbars();
break;
case SP_VERB_TOGGLE_GUIDES:
break;
case SP_VERB_TOGGLE_GRID:
break;
#ifdef HAVE_GTK_WINDOW_FULLSCREEN
case SP_VERB_FULLSCREEN:
dt->fullscreen();
break;
#endif /* HAVE_GTK_WINDOW_FULLSCREEN */
case SP_VERB_VIEW_NEW:
break;
case SP_VERB_VIEW_NEW_PREVIEW:
break;
case SP_VERB_VIEW_MODE_NORMAL:
break;
break;
case SP_VERB_VIEW_MODE_TOGGLE:
dt->displayModeToggle();
break;
show_panel( Inkscape::UI::Dialogs::IconPreviewPanel::getInstance(), "dialogs.iconpreview", SP_VERB_VIEW_ICON_PREVIEW );
break;
default:
break;
}
} // end of sp_verb_action_zoom_perform()
/** \brief Decode the verb code and take appropriate action */
void
{
// unhide all when opening a new dialog
}
case SP_VERB_DIALOG_DISPLAY:
//sp_display_dialog();
break;
case SP_VERB_DIALOG_METADATA:
// sp_desktop_dialog();
break;
case SP_VERB_DIALOG_NAMEDVIEW:
// sp_desktop_dialog();
break;
break;
case SP_VERB_DIALOG_SWATCHES:
show_panel( Inkscape::UI::Dialogs::SwatchesPanel::getInstance(), "dialogs.swatches", SP_VERB_DIALOG_SWATCHES);
break;
case SP_VERB_DIALOG_TRANSFORM:
break;
break;
case SP_VERB_DIALOG_TEXT:
break;
break;
case SP_VERB_DIALOG_FIND:
// Please test the new find dialog if you have time:
// dt->_dlg_mgr->showDialog("Find");
break;
case SP_VERB_DIALOG_DEBUG:
break;
case SP_VERB_DIALOG_SCRIPT:
break;
break;
case SP_VERB_DIALOG_TOGGLE:
break;
break;
case SP_VERB_DIALOG_ITEM:
break;
#ifdef WITH_INKBOARD
case SP_VERB_XMPP_CLIENT:
{
break;
}
#endif
case SP_VERB_DIALOG_INPUT:
break;
break;
case SP_VERB_DIALOG_LAYERS:
show_panel( Inkscape::UI::Dialogs::LayersPanel::getInstance(), "dialogs.layers", SP_VERB_DIALOG_LAYERS );
break;
default:
break;
}
} // end of sp_verb_action_dialog_perform()
/** \brief Decode the verb code and take appropriate action */
void
{
case SP_VERB_HELP_KEYS:
/* TRANSLATORS: If you have translated the keys.svg file to your language, then
translate this string as "keys.LANG.svg" (where LANG is your language code);
otherwise leave as "keys.svg". */
sp_help_open_screen(_("keys.svg"));
break;
case SP_VERB_HELP_ABOUT:
break;
case SP_VERB_HELP_ABOUT_EXTENSIONS: {
break;
}
/*
case SP_VERB_SHOW_LICENSE:
// TRANSLATORS: See "tutorial-basic.svg" comment.
sp_help_open_tutorial(NULL, (gpointer) _("gpl-2.svg"));
break;
*/
case SP_VERB_HELP_MEMORY:
break;
default:
break;
}
} // end of sp_verb_action_help_perform()
/** \brief Decode the verb code and take appropriate action */
void
{
case SP_VERB_TUTORIAL_BASIC:
/* TRANSLATORS: If you have translated the tutorial-basic.svg file to your language,
then translate this string as "tutorial-basic.LANG.svg" (where LANG is your language
code); otherwise leave as "tutorial-basic.svg". */
break;
case SP_VERB_TUTORIAL_SHAPES:
// TRANSLATORS: See "tutorial-basic.svg" comment.
break;
// TRANSLATORS: See "tutorial-basic.svg" comment.
break;
case SP_VERB_TUTORIAL_TRACING:
// TRANSLATORS: See "tutorial-basic.svg" comment.
break;
// TRANSLATORS: See "tutorial-basic.svg" comment.
break;
case SP_VERB_TUTORIAL_DESIGN:
// TRANSLATORS: See "tutorial-basic.svg" comment.
break;
case SP_VERB_TUTORIAL_TIPS:
// TRANSLATORS: See "tutorial-basic.svg" comment.
break;
default:
break;
}
} // end of sp_verb_action_tutorial_perform()
/**
* Action vector to define functions called if a staticly defined file verb
* is called.
*/
/**
* Action vector to define functions called if a staticly defined edit verb is
* called.
*/
/**
* Action vector to define functions called if a staticly defined selection
* verb is called
*/
/**
* Action vector to define functions called if a staticly defined layer
* verb is called
*/
/**
* Action vector to define functions called if a staticly defined object
* editing verb is called
*/
/**
* Action vector to define functions called if a staticly defined context
* verb is called
*/
/**
* Action vector to define functions called if a staticly defined zoom verb
* is called
*/
/**
* Action vector to define functions called if a staticly defined dialog verb
* is called
*/
/**
* Action vector to define functions called if a staticly defined help verb
* is called
*/
/**
* Action vector to define functions called if a staticly defined tutorial verb
* is called
*/
/**
* Action vector to define functions called if a staticly defined tutorial verb
* is called
*/
/* *********** Effect Last ********** */
/** \brief A class to represent the last effect issued */
class EffectLastVerb : public Verb {
private:
static SPActionEventVector vector;
protected:
public:
/** \brief Use the Verb initializer with the same parameters. */
EffectLastVerb(unsigned int const code,
{
set_default_sensitive(false);
}
}; /* EffectLastVerb class */
/**
* The vector to attach in the last effect verb.
*/
/** \brief Create an action for a \c EffectLastVerb
\param view Which view the action should be created for
\return The built action.
Calls \c make_action_helper with the \c vector.
*/
SPAction *
{
}
/** \brief Decode the verb code and take appropriate action */
void
{
/* These aren't used, but are here to remind people not to use
the CURRENT_DOCUMENT macros unless they really have to. */
// SPDocument *current_document = SP_VIEW_DOCUMENT(current_view);
if (current_view == NULL) return;
switch ((long) data) {
case SP_VERB_EFFECT_LAST_PREF:
return;
/* Note: fall through */
case SP_VERB_EFFECT_LAST:
break;
default:
return;
}
return;
}
/* *********** End Effect Last ********** */
/* *********** Fit Canvas ********** */
/** \brief A class to represent the canvas fitting verbs */
class FitCanvasVerb : public Verb {
private:
static SPActionEventVector vector;
protected:
public:
/** \brief Use the Verb initializer with the same parameters. */
FitCanvasVerb(unsigned int const code,
{
set_default_sensitive(false);
}
}; /* FitCanvasVerb class */
/**
* The vector to attach in the fit canvas verb.
*/
/** \brief Create an action for a \c FitCanvasVerb
\param view Which view the action should be created for
\return The built action.
Calls \c make_action_helper with the \c vector.
*/
SPAction *
{
return action;
}
/** \brief Decode the verb code and take appropriate action */
void
{
if (!dt) return;
if (!doc) return;
switch ((long) data) {
break;
break;
break;
default:
return;
}
return;
}
/* *********** End Fit Canvas ********** */
/* these must be in the same order as the SP_VERB_* enum in "verbs.h" */
/* Header */
/* File */
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 ),
// TRANSLATORS: "Vacuum Defs" means "Clean up defs" (so as to remove unused definitions)
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"),
"file_vacuum" ),
/* Edit */
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 clone's link to its original, turning it into a standalone object"), "edit_unlink_clone"),
// TRANSLATORS: Convert selection to a rectangle with tiled pattern fill
// TRANSLATORS: Extract objects from a tiled pattern fill
new EditVerb(SP_VERB_EDIT_SELECT_ALL_IN_ALL_LAYERS, "EditSelectAllInAllLayers", N_("Select All in All La_yers"),
new EditVerb(SP_VERB_EDIT_INVERT_IN_ALL_LAYERS, "EditInvertInAllLayers", N_("Invert in All Layers"),
/* Selection */
new SelectionVerb(SP_VERB_SELECTION_REMOVE_KERNS, "SelectionTextRemoveKerns", N_("Remove Manual _Kerns"),
// TRANSLATORS: "glyph": An image used in the visual representation of characters;
// roughly speaking, how a character looks. A font is a set of glyphs.
N_("Create exclusive OR of selected paths (those parts that belong to only one path)"), "exclusion"),
// TRANSLATORS: "to cut a path" is not the same as "to break a path apart" - see the
// Advanced tutorial for more info
// TRANSLATORS: "outset": expand a shape by offsetting the object's path,
// i.e. by displacing it perpendicular to the path in each point.
// See also the Advanced Tutorial for explanation.
N_("O_utset Path by 1 px"),
N_("O_utset Path by 10 px"),
// TRANSLATORS: "inset": contract a shape by offsetting the object's path,
// i.e. by displacing it perpendicular to the path in each point.
// See also the Advanced Tutorial for explanation.
N_("I_nset Path by 1 px"),
N_("I_nset Path by 10 px"),
N_("_Linked Offset"),
N_("Create a dynamic offset object linked to the original path"),
"linked_offset"),
// TRANSLATORS: "to trace" means "to convert a bitmap to vector graphics" (to vectorize)
new SelectionVerb(SP_VERB_SELECTION_CREATE_BITMAP, "SelectionCreateBitmap", N_("_Make a Bitmap Copy"),
// TRANSLATORS: "to cut a path" is not the same as "to break a path apart" - see the
// Advanced tutorial for more info
/* Layer */
/* Object */
N_("Put text into a frame (path or shape), creating a flowed text linked to the frame object"), "flow_into_frame"),
"object_flip_hor"),
"object_flip_ver"),
/* Tools */
/* Tool prefs */
new ContextVerb(SP_VERB_CONTEXT_CALLIGRAPHIC_PREFS, "CalligraphicPrefs", N_("Calligraphic Preferences"),
new ZoomVerb(SP_VERB_TOGGLE_RULERS, "ToggleRulers", N_("_Rulers"), N_("Show or hide the canvas rulers"), "rulers"),
new ZoomVerb(SP_VERB_TOGGLE_SCROLLBARS, "ToggleScrollbars", N_("Scroll_bars"), N_("Show or hide the canvas scrollbars"), "scrollbars"),
new ZoomVerb(SP_VERB_TOGGLE_GUIDES, "ToggleGuides", N_("G_uides"), N_("Show or hide guides (drag from a ruler to create a guide)"), "guides"),
new ZoomVerb(SP_VERB_ZOOM_NEXT, "ZoomNext", N_("Nex_t Zoom"), N_("Next zoom (from the history of zooms)"),
"zoom_next"),
new ZoomVerb(SP_VERB_ZOOM_PREV, "ZoomPrev", N_("Pre_vious Zoom"), N_("Previous zoom (from the history of zooms)"),
"zoom_previous"),
"zoom_1_to_1"),
"zoom_1_to_2"),
"zoom_2_to_1"),
#ifdef HAVE_GTK_WINDOW_FULLSCREEN
new ZoomVerb(SP_VERB_FULLSCREEN, "FullScreen", N_("_Fullscreen"), N_("Stretch this document window to full screen"),
"fullscreen"),
#endif /* HAVE_GTK_WINDOW_FULLSCREEN */
new ZoomVerb(SP_VERB_VIEW_NEW, "ViewNew", N_("Duplic_ate Window"), N_("Open a new window with the same document"),
"view_new"),
/* Dialogs */
N_("Edit objects' colors, gradients, stroke width, arrowheads, dash patterns..."), "fill_and_stroke"),
// TRANSLATORS: "Swatches" means: color samples
new DialogVerb(SP_VERB_DIALOG_ALIGN_DISTRIBUTE, "DialogAlignDistribute", N_("_Align and Distribute..."),
N_("Create multiple clones of selected object, arranging them into a pattern or scattering"), "edit_create_tiled_clones"),
N_("Edit the ID, locked and visible status, and other object properties"), "dialog_item_properties"),
#ifdef WITH_INKBOARD
#endif
new DialogVerb(SP_VERB_DIALOG_EXTENSIONEDITOR, "org.inkscape.dialogs.extensioneditor", N_("_Extensions..."),
/* Help */
//new HelpVerb(SP_VERB_SHOW_LICENSE, "ShowLicense", N_("_License"),
// N_("Distribution terms"), /*"show_license"*/"inkscape_options"),
/* Tutorials */
// TRANSLATORS: "to trace" means "to convert a bitmap to vector graphics" (to vectorize)
new TutorialVerb(SP_VERB_TUTORIAL_CALLIGRAPHY, "TutorialsCalligraphy", N_("Inkscape: _Calligraphy"),
/* Effect */
/* Fit Page */
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"),
/* Footer */
};
} /* namespace Inkscape */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :