tools-switch.cpp revision 3e3e2a49f82b250cb852586703fbc460b3ca20e4
/*
* Utility functions for switching tools (= contexts)
*
* Authors:
* bulia byak <buliabyak@users.sf.net>
* Josh Andler <scislac@users.sf.net>
*
* Copyright (C) 2003-2007 authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <cstring>
#include <string>
#include "inkscape.h"
#include "desktop.h"
#include "desktop-handles.h"
#include "ui/tools/select-tool.h"
#include "ui/tools/node-tool.h"
#include "ui/tools/tweak-tool.h"
#include "ui/tools/spray-tool.h"
#include "sp-path.h"
#include "ui/tools/rect-tool.h"
#include "sp-rect.h"
#include "ui/tools/box3d-tool.h"
#include "box3d.h"
#include "ui/tools/arc-tool.h"
#include "sp-ellipse.h"
#include "ui/tools/tweak-tool.h"
#include "sp-star.h"
#include "ui/tools/spiral-tool.h"
#include "sp-spiral.h"
#include "ui/tools/calligraphic-tool.h"
#include "ui/tools/eraser-tool.h"
#include "ui/tools/pen-tool.h"
#include "ui/tools/pencil-tool.h"
#include "ui/tools/lpe-tool.h"
#include "ui/tools/text-tool.h"
#include "sp-text.h"
#include "sp-flowtext.h"
#include "ui/tools/gradient-tool.h"
#include "ui/tools/mesh-tool.h"
#include "ui/tools/zoom-tool.h"
#include "ui/tools/measure-tool.h"
#include "ui/tools/dropper-tool.h"
#include "ui/tools/connector-tool.h"
#include "ui/tools/flood-tool.h"
#include "sp-offset.h"
#include "message-context.h"
#include "tools-switch.h"
static char const *const tool_names[] = {
NULL,
"/tools/calligraphic",
"/tools/paintbucket",
};
static char const *const tool_msg[] = {
NULL,
N_("<b>Click</b> to Select and Transform objects, <b>Drag</b> to select many objects."),
N_("Modify selected path points (nodes) directly."),
N_("To tweak a path by pushing, select it and drag over it."),
N_("<b>Drag</b>, <b>click</b> or <b>click and scroll</b> to spray the selected objects."),
N_("<b>Drag</b> to create a rectangle. <b>Drag controls</b> to round corners and resize. <b>Click</b> to select."),
N_("<b>Drag</b> to create a 3D box. <b>Drag controls</b> to resize in perspective. <b>Click</b> to select (with <b>Ctrl+Alt</b> for single faces)."),
N_("<b>Drag</b> to create an ellipse. <b>Drag controls</b> to make an arc or segment. <b>Click</b> to select."),
N_("<b>Drag</b> to create a star. <b>Drag controls</b> to edit the star shape. <b>Click</b> to select."),
N_("<b>Drag</b> to create a spiral. <b>Drag controls</b> to edit the spiral shape. <b>Click</b> to select."),
N_("<b>Drag</b> to create a freehand line. <b>Shift</b> appends to selected path, <b>Alt</b> activates sketch mode."),
N_("<b>Click</b> or <b>click and drag</b> to start a path; with <b>Shift</b> to append to selected path. <b>Ctrl+click</b> to create single dots (straight line modes only)."),
N_("<b>Drag</b> to draw a calligraphic stroke; with <b>Ctrl</b> to track a guide path. <b>Arrow keys</b> adjust width (left/right) and angle (up/down)."),
N_("<b>Click</b> to select or create text, <b>drag</b> to create flowed text; then type."),
N_("<b>Drag</b> or <b>double click</b> to create a gradient on selected objects, <b>drag handles</b> to adjust gradients."),
N_("<b>Drag</b> or <b>double click</b> to create a mesh on selected objects, <b>drag handles</b> to adjust meshes."),
N_("<b>Click</b> or <b>drag around an area</b> to zoom in, <b>Shift+click</b> to zoom out."),
N_("<b>Drag</b> to measure the dimensions of objects."),
N_("<b>Click</b> to set fill, <b>Shift+click</b> to set stroke; <b>drag</b> to average color in area; with <b>Alt</b> to pick inverse color; <b>Ctrl+C</b> to copy the color under mouse to clipboard"),
N_("<b>Click and drag</b> between shapes to create a connector."),
N_("<b>Click</b> to paint a bounded area, <b>Shift+click</b> to union the new fill with the current selection, <b>Ctrl+click</b> to change the clicked object's fill and stroke to the current setting."),
N_("<b>Drag</b> to erase."),
N_("Choose a subtool from the toolbar"),
};
static int
tools_prefpath2num(char const *id)
{
int i = 1;
while (tool_names[i]) {
return i;
else i++;
}
g_assert( 0 == TOOLS_INVALID );
return 0; //nothing found
}
int
{
else return FALSE;
}
int
{
}
void
{
if (dt) {
// This event may change the above message
}
/* fixme: This is really ugly hack. We should bind and unbind class methods */
/* First 4 tools use guides, first is undefined but we don't care */
}
{
if (SP_IS_RECT(item)) {
} else if (SP_IS_BOX3D(item)) {
} else if (SP_IS_GENERICELLIPSE(item)) {
} else if (SP_IS_STAR(item)) {
} else if (SP_IS_SPIRAL(item)) {
} else if (SP_IS_PATH(item)) {
}
else {
}
} else if (SP_IS_OFFSET(item)) {
}
}
/*
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:fileencoding=utf-8:textwidth=99 :