toolbox.cpp revision a911b3f05d6e86c9296c3e18d8cc9326752aa694
#define __SP_MAINTOOLBOX_C__
/** \file
* Controls bars for some of Inkscape's tools
* (for some tools, they are in their own files)
*/
/*
*
* Authors:
* MenTaLguY <mental@rydia.net>
* Lauris Kaplinski <lauris@kaplinski.com>
* bulia byak <buliabyak@users.sf.net>
* Frank Felfe <innerspace@iname.com>
* John Cliff <simarilius@yahoo.com>
* David Turner <novalis@gnu.org>
* Josh Andler <scislac@scislac.com>
*
* Copyright (C) 2004 David Turner
* Copyright (C) 2003 MenTaLguY
* Copyright (C) 1999-2005 authors
* Copyright (C) 2001-2002 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "widgets/widget-sizes.h"
#include "widgets/spw-utilities.h"
#include "widgets/spinbutton-events.h"
#include "ui/widget/style-swatch.h"
#include "prefs-utils.h"
#include "verbs.h"
#include "sp-namedview.h"
#include "desktop.h"
#include "desktop-handles.h"
#include "nodepath.h"
#include "xml/node-event-vector.h"
#include "helper/unit-menu.h"
#include "inkscape.h"
#include "conn-avoid-ref.h"
#include "select-toolbar.h"
#include "gradient-toolbar.h"
#include "connector-context.h"
#include "sp-rect.h"
#include "sp-star.h"
#include "sp-spiral.h"
#include "sp-ellipse.h"
#include "selection.h"
#include "document-private.h"
#include "mod360.h"
#include "toolbox.h"
typedef void (*UpdateFunction)(SPDesktop *desktop, SPEventContext *eventcontext, GtkWidget *toolbox);
static struct {
} const tools[] = {
{ "SPDynaDrawContext", "dyna_draw_tool", SP_VERB_CONTEXT_CALLIGRAPHIC, SP_VERB_CONTEXT_CALLIGRAPHIC_PREFS },
{ "SPConnectorContext","connector_tool", SP_VERB_CONTEXT_CONNECTOR, SP_VERB_CONTEXT_CONNECTOR_PREFS },
};
static struct {
} const aux_toolboxes[] = {
};
static void toolbox_set_desktop(GtkWidget *toolbox, SPDesktop *desktop, SetupFunction setup_func, UpdateFunction update_func, sigc::connection*);
static void update_tool_toolbox(SPDesktop *desktop, SPEventContext *eventcontext, GtkWidget *toolbox);
static void update_aux_toolbox(SPDesktop *desktop, SPEventContext *eventcontext, GtkWidget *toolbox);
static void update_commands_toolbox(SPDesktop *desktop, SPEventContext *eventcontext, GtkWidget *toolbox);
/* Global text entry widgets necessary for update */
/* GtkWidget *dropper_rgb_entry,
*dropper_opacity_entry ; */
// should be made a private member once this is converted to class
connection->disconnect();
delete connection;
}
static GtkWidget *
sp_toolbox_button_new(GtkWidget *t, Inkscape::IconSize size, gchar const *pxname, GtkSignalFunc handler,
{
gtk_widget_show(b);
return b;
}
sp_toolbox_button_new_from_verb_with_doubleclick(GtkWidget *t, Inkscape::IconSize size, SPButtonType type,
{
if (doubleclick_verb)
else
/* fixme: Handle sensitive/unsensitive */
/* fixme: Implement sp_button_new_from_action */
gtk_widget_show(b);
return b;
}
GtkWidget *sp_toolbox_button_new_from_verb(GtkWidget *t, Inkscape::IconSize size, SPButtonType type, Inkscape::Verb *verb,
{
}
GtkWidget * sp_toolbox_button_normal_new_from_verb(GtkWidget *t, Inkscape::IconSize size, Inkscape::Verb *verb,
{
}
{
return hb;
}
static void
{
}
static void
{
}
{
return hb;
}
//####################################
//# Commands Bar
//####################################
{
return hb;
}
//####################################
//# node editing callbacks
//####################################
void
sp_node_path_edit_add(void)
{
}
void
sp_node_path_edit_delete(void)
{
}
void
{
}
void
sp_node_path_edit_break(void)
{
}
void
sp_node_path_edit_join(void)
{
}
void
{
}
void
sp_node_path_edit_toline(void)
{
}
void
{
}
void
sp_node_path_edit_cusp(void)
{
}
void
sp_node_path_edit_smooth(void)
{
}
void
{
}
//################################
//## Node Editing Toolbox ##
//################################
static GtkWidget *
{
GTK_SIGNAL_FUNC(sp_node_path_edit_join_segment), tt, _("Join selected endnodes with a new segment"));
GTK_SIGNAL_FUNC(sp_node_path_edit_delete_segment), tt, _("Split path between two non-endpoint nodes"));
sp_toolbox_button_normal_new_from_verb(tb, Inkscape::ICON_SIZE_SMALL_TOOLBAR, Inkscape::Verb::get(SP_VERB_OBJECT_TO_CURVE), view, tt);
sp_toolbox_button_normal_new_from_verb(tb, Inkscape::ICON_SIZE_SMALL_TOOLBAR, Inkscape::Verb::get(SP_VERB_SELECTION_OUTLINE), view, tt);
return tb;
} // end of sp_node_toolbox_new()
//########################
//## Zoom Toolbox ##
//########################
static GtkWidget *
{
sp_toolbox_button_new_from_verb(tb, Inkscape::ICON_SIZE_SMALL_TOOLBAR, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_ZOOM_IN), view, tt);
sp_toolbox_button_new_from_verb(tb, Inkscape::ICON_SIZE_SMALL_TOOLBAR, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_ZOOM_OUT), view, tt);
sp_toolbox_button_new_from_verb(tb, Inkscape::ICON_SIZE_SMALL_TOOLBAR, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_ZOOM_SELECTION), view, tt);
sp_toolbox_button_new_from_verb(tb, Inkscape::ICON_SIZE_SMALL_TOOLBAR, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_ZOOM_DRAWING), view, tt);
sp_toolbox_button_new_from_verb(tb, Inkscape::ICON_SIZE_SMALL_TOOLBAR, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_ZOOM_PAGE), view, tt);
sp_toolbox_button_new_from_verb(tb, Inkscape::ICON_SIZE_SMALL_TOOLBAR, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_ZOOM_PAGE_WIDTH), view, tt);
sp_toolbox_button_new_from_verb(tb, Inkscape::ICON_SIZE_SMALL_TOOLBAR, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_ZOOM_PREV), view, tt);
sp_toolbox_button_new_from_verb(tb, Inkscape::ICON_SIZE_SMALL_TOOLBAR, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_ZOOM_NEXT), view, tt);
sp_toolbox_button_new_from_verb(tb, Inkscape::ICON_SIZE_SMALL_TOOLBAR, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_ZOOM_1_1), view, tt);
sp_toolbox_button_new_from_verb(tb, Inkscape::ICON_SIZE_SMALL_TOOLBAR, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_ZOOM_1_2), view, tt);
sp_toolbox_button_new_from_verb(tb, Inkscape::ICON_SIZE_SMALL_TOOLBAR, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_ZOOM_2_1), view, tt);
return tb;
} // end of sp_zoom_toolbox_new()
void
{
toolbox_set_desktop(gtk_bin_get_child(GTK_BIN(toolbox)), desktop, setup_tool_toolbox, update_tool_toolbox, static_cast<sigc::connection*>(g_object_get_data(G_OBJECT(toolbox), "event_context_connection")));
}
void
{
toolbox_set_desktop(gtk_bin_get_child(GTK_BIN(toolbox)), desktop, setup_aux_toolbox, update_aux_toolbox, static_cast<sigc::connection*>(g_object_get_data(G_OBJECT(toolbox), "event_context_connection")));
}
void
{
toolbox_set_desktop(gtk_bin_get_child(GTK_BIN(toolbox)), desktop, setup_commands_toolbox, update_commands_toolbox, static_cast<sigc::connection*>(g_object_get_data(G_OBJECT(toolbox), "event_context_connection")));
}
static void
toolbox_set_desktop(GtkWidget *toolbox, SPDesktop *desktop, SetupFunction setup_func, UpdateFunction update_func, sigc::connection *conn)
{
if (old_desktop) {
}
}
if (desktop) {
} else {
}
} // end of toolbox_set_desktop()
static void
{
Inkscape::IconSize toolboxSize = shrinkLeft ? Inkscape::ICON_SIZE_SMALL_TOOLBAR : Inkscape::ICON_SIZE_LARGE_TOOLBAR;
tooltips );
}
}
static void
{
: NULL );
}
}
static void
{
for (int i = 0 ; aux_toolboxes[i].type_name ; i++ ) {
else
}
}
static void
{
: NULL );
for (int i = 0 ; aux_toolboxes[i].type_name ; i++ ) {
GtkWidget *sub_toolbox = GTK_WIDGET(g_object_get_data(G_OBJECT(toolbox), aux_toolboxes[i].data_name));
} else {
}
}
}
static void
{
Inkscape::IconSize toolboxSize = shrinkTop ? Inkscape::ICON_SIZE_SMALL_TOOLBAR : Inkscape::ICON_SIZE_LARGE_TOOLBAR;
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_FILE_NEW), view, tt);
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_FILE_OPEN), view, tt);
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_FILE_SAVE), view, tt);
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_FILE_PRINT), view, tt);
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_FILE_IMPORT), view, tt);
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_FILE_EXPORT), view, tt);
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_EDIT_UNDO), view, tt);
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_EDIT_REDO), view, tt);
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_EDIT_COPY), view, tt);
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_EDIT_CUT), view, tt);
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_EDIT_PASTE), view, tt);
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_ZOOM_SELECTION), view, tt);
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_ZOOM_DRAWING), view, tt);
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_ZOOM_PAGE), view, tt);
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_EDIT_DUPLICATE), view, tt);
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_EDIT_CLONE), view, tt);
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_EDIT_UNLINK_CLONE), view, tt);
sp_toolbox_button_normal_new_from_verb(tb, toolboxSize, Inkscape::Verb::get(SP_VERB_SELECTION_GROUP), view, tt);
sp_toolbox_button_normal_new_from_verb(tb, toolboxSize, Inkscape::Verb::get(SP_VERB_SELECTION_UNGROUP), view, tt);
// disabled until we have icons for them:
//find
//sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_EDIT_TILE), view, tt);
//sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_EDIT_UNTILE), view, tt);
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_DIALOG_FILL_STROKE), view, tt);
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_DIALOG_TEXT), view, tt);
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_DIALOG_XML_EDITOR), view, tt);
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_DIALOG_ALIGN_DISTRIBUTE), view, tt);
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_DIALOG_DISPLAY), view, tt);
sp_toolbox_button_new_from_verb(tb, toolboxSize, SP_BUTTON_TYPE_NORMAL, Inkscape::Verb::get(SP_VERB_DIALOG_NAMEDVIEW), view, tt);
}
static void
{
}
{
if (!shown_toolbox) {
return;
}
// need to show the spacer, or the padding will be off
}
void
{
}
static GtkWidget *
{
return tbl;
}
// helper UI functions
{
gtk_widget_show(l);
if (us)
if (altx)
return hb;
}
#define MODE_LABEL_WIDTH 70
//########################
//## Star ##
//########################
static void
{
// do not remember prefs if this call is initiated by an undo change, because undoing object
// creation sets bogus values to its attributes before it is deleted
}
// quit if run by the attr_changed listener
return;
}
// in turn, prevent listener from responding
bool modmade = false;
modmade = true;
}
}
}
static void
{
}
// quit if run by the attr_changed listener
return;
}
// in turn, prevent listener from responding
bool modmade = false;
} else {
}
modmade = true;
}
}
}
static void
{
} else {
}
}
// quit if run by the attr_changed listener
return;
}
// in turn, prevent listener from responding
bool modmade = false;
modmade = true;
}
}
} else {
modmade = true;
}
}
}
}
static void
{
}
// quit if run by the attr_changed listener
return;
}
// in turn, prevent listener from responding
bool modmade = false;
modmade = true;
}
}
}
static void
{
}
// quit if run by the attr_changed listener
return;
}
// in turn, prevent listener from responding
bool modmade = false;
modmade = true;
}
}
}
{
// quit if run by the _changed callbacks
return;
}
// in turn, prevent callbacks from responding
} else {
}
} else {
}
}
}
{
NULL, /* child_added */
NULL, /* child_removed */
NULL, /* content_changed */
NULL /* order_changed */
};
/**
* \param selection Should not be NULL.
*/
static void
{
int n_selected = 0;
{
n_selected++;
}
}
if (n_selected == 0) {
} else if (n_selected == 1) {
if (oldrepr) { // remove old listener
oldrepr = 0;
}
if (repr) {
}
} else {
// FIXME: implement averaging of all parameters for multiple selected stars
//gtk_label_set_markup(GTK_LABEL(l), _("<b>Average:</b>"));
}
}
static void
{
// FIXME: in this and all other _default functions, set some flag telling the value_changed
// callbacks to lump all the changes for all selected objects in one undo step
// fixme: make settable in prefs!
gdouble randomized = 0;
}
void
{
}
static GtkWidget *
{
/* Flatsided checkbox */
{
else
g_signal_connect(G_OBJECT(fscb), "toggled", GTK_SIGNAL_FUNC(sp_stb_sides_flat_state_changed ), tbl);
}
/* Magnitude */
{
3, 1024, 1, 1,
sp_stb_magnitude_value_changed, 1, 0);
}
/* Spoke ratio */
{
// TRANSLATORS: Tip radius of a star is the distance from the center to the farthest handle.
// Base radius is the same for the closest handle.
_("Base radius to tip radius ratio"),
0.01, 1.0, 0.01, 0.1,
else
}
/* Roundedness */
{
GtkWidget *hb = sp_tb_spinbutton(_("Rounded:"), _("How much rounded are the corners (0 for sharp)"),
-100.0, 100.0, 0.01, 0.1,
}
/* Randomization */
{
-10.0, 10.0, 0.001, 0.01,
}
/* Reset */
{
gtk_tooltips_set_tip(tt, b, _("Reset shape parameters to defaults (use Inkscape Preferences > Tools to change defaults)"), NULL);
gtk_widget_show(b);
}
sp_desktop_selection(desktop)->connectChanged(sigc::bind(sigc::ptr_fun(sp_star_toolbox_selection_changed), (GtkObject *)tbl))
);
return tbl;
}
//########################
//## Rect ##
//########################
static void
{
if (adj1->value == 0 && adj2->value == 0 && gtk_object_get_data(GTK_OBJECT(tbl), "single")) { // only for a single selected rect (for now)
} else {
}
}
static void
{
prefs_set_double_attribute("tools.shapes.rect", value_name, sp_units_get_pixels(adj->value, *unit));
}
// quit if run by the attr_changed listener
return;
}
// in turn, prevent listener from responding
bool modmade = false;
} else {
}
modmade = true;
}
}
if (modmade) {
}
// defocus spinbuttons by moving focus to the canvas, unless "stay" is on
}
static void
{
}
static void
{
}
static void
{
}
static void
{
}
static void
{
// this is necessary if the previous value was 0, but we still need to run the callback to change all selected objects
}
{
// quit if run by the _changed callbacks
return;
}
// in turn, prevent callbacks from responding
if (SP_IS_RECT(item)) {
{
}
{
}
{
}
{
}
}
}
NULL, /* child_added */
NULL, /* child_removed */
NULL, /* content_changed */
NULL /* order_changed */
};
/**
* \param selection should not be NULL.
*/
static void
{
int n_selected = 0;
n_selected++;
}
}
if (n_selected == 0) {
} else if (n_selected == 1) {
if (oldrepr) { // remove old listener
oldrepr = 0;
}
if (repr) {
}
} else {
// FIXME: implement averaging of all parameters for multiple selected
//gtk_label_set_markup(GTK_LABEL(l), _("<b>Average:</b>"));
}
}
static GtkWidget *
{
/* W */
{
"tools.shapes.rect", "width", 0,
}
/* H */
{
"tools.shapes.rect", "height", 0,
}
/* rx */
{
"tools.shapes.rect", "rx", 0,
}
/* ry */
{
"tools.shapes.rect", "ry", 0,
}
// add the units menu
/* Reset */
{
gtk_widget_show(b);
}
sp_desktop_selection(desktop)->connectChanged(sigc::bind(sigc::ptr_fun(sp_rect_toolbox_selection_changed), (GtkObject *)tbl))
);
return tbl;
}
//########################
//## Spiral ##
//########################
static void
{
}
// quit if run by the attr_changed listener
return;
}
// in turn, prevent listener from responding
bool modmade = false;
{
modmade = true;
}
}
if (modmade) {
}
}
static void
{
}
static void
{
}
static void
{
}
static void
{
// fixme: make settable
}
{
// quit if run by the _changed callbacks
return;
}
// in turn, prevent callbacks from responding
}
NULL, /* child_added */
NULL, /* child_removed */
NULL, /* content_changed */
NULL /* order_changed */
};
static void
{
int n_selected = 0;
{
n_selected++;
}
}
if (n_selected == 0) {
} else if (n_selected == 1) {
if (oldrepr) { // remove old listener
oldrepr = 0;
}
if (repr) {
}
} else {
// FIXME: implement averaging of all parameters for multiple selected
//gtk_label_set_markup(GTK_LABEL(l), _("<b>Average:</b>"));
}
}
static GtkWidget *
{
/* Revolution */
{
0.01, 1024.0, 0.1, 1.0,
}
/* Expansion */
{
GtkWidget *hb = sp_tb_spinbutton(_("Divergence:"), _("How much denser/sparser are outer revolutions; 1 = uniform"),
0.0, 1000.0, 0.01, 1.0,
}
/* T0 */
{
GtkWidget *hb = sp_tb_spinbutton(_("Inner radius:"), _("Radius of the innermost revolution (relative to the spiral size)"),
0.0, 0.999, 0.01, 1.0,
}
/* Reset */
{
gtk_tooltips_set_tip(tt, b, _("Reset shape parameters to defaults (use Inkscape Preferences > Tools to change defaults)"), NULL);
gtk_widget_show(b);
}
sp_desktop_selection(desktop)->connectChanged(sigc::bind(sigc::ptr_fun(sp_spiral_toolbox_selection_changed), (GtkObject *)tbl))
);
return tbl;
}
//########################
//########################
static GtkWidget *
{
return tbl;
}
static GtkWidget *
{
return tbl;
}
//########################
//## Calligraphy ##
//########################
static void
{
}
static void
{
}
static void
{
}
static void
{
}
static void
{
}
static void
{
}
static void
{
}
static void
{
prefs_set_int_attribute ("tools.calligraphic", "usepressure", gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)) ? 1 : 0);
}
static void
{
prefs_set_int_attribute ("tools.calligraphic", "usetilt", gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)) ? 1 : 0);
gtk_widget_set_sensitive(GTK_WIDGET(calligraphy_angle), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)));
}
{
// FIXME: make defaults settable via Inkscape Options
struct KeyValue {
char const *key;
double value;
} const key_values[] = {
{"mass", 0.02},
{"drag", 1.0},
{"angle", 30.0},
{"width", 15},
{"thinning", 0.1},
{"tremor", 0.0},
{"flatness", 0.9}
};
for (unsigned i = 0; i < G_N_ELEMENTS(key_values); ++i) {
}
}
static GtkWidget *
{
// interval
/* Width */
{
GtkWidget *hb = sp_tb_spinbutton(_("Width:"), _("The width of the calligraphic pen (relative to the visible canvas area)"),
1, 100, 1.0, 10.0,
}
/* Thinning */
{
GtkWidget *hb = sp_tb_spinbutton(_("Thinning:"), _("How much velocity thins the stroke (> 0 makes fast strokes thinner, < 0 makes them broader, 0 makes width independent of velocity)"),
-1.0, 1.0, 0.01, 0.1,
}
// interval
/* Angle */
{
calligraphy_angle = sp_tb_spinbutton(_("Angle:"), _("The angle of the pen's nib (in degrees; 0 = horizontal; has no effect if fixation = 0)"),
-90.0, 90.0, 1.0, 10.0,
sp_ddc_angle_value_changed, 1, 0);
}
/* Fixation */
{
GtkWidget *hb = sp_tb_spinbutton(_("Fixation:"), _("How fixed is the pen angle (0 = always perpendicular to stroke direction, 1 = fixed)"),
0.0, 1.0, 0.01, 0.1,
}
// interval
/* Tremor */
{
0.0, 1.0, 0.01, 0.1,
}
/* Mass */
{
0.0, 1.0, 0.01, 0.1,
}
/* Drag */
{
// TRANSLATORS: "drag" means "resistance" here
GtkWidget *hb = sp_tb_spinbutton(_("Drag:"), _("How much resistance affects the movement of the pen"),
0.0, 1.0, 0.01, 0.1,
}
// interval
/* Use Pressure button */
{
NULL,
"use_pressure",
_("Use the pressure of the input device to alter the width of the pen"),
tt);
g_signal_connect_after (G_OBJECT (button), "clicked", G_CALLBACK (sp_ddc_pressure_state_changed), NULL);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), prefs_get_int_attribute ("tools.calligraphic", "usepressure", 1));
}
/* Use Tilt button */
{
NULL,
"use_tilt",
_("Use the tilt of the input device to alter the angle of the pen's nib"),
tt);
g_signal_connect_after (G_OBJECT (button), "clicked", G_CALLBACK (sp_ddc_tilt_state_changed), calligraphy_angle);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), prefs_get_int_attribute ("tools.calligraphic", "usetilt", 1));
gtk_widget_set_sensitive(GTK_WIDGET(calligraphy_angle), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)));
}
/* Reset */
{
gtk_tooltips_set_tip(tt, b, _("Reset shape parameters to defaults (use Inkscape Preferences > Tools to change defaults)"), NULL);
gtk_widget_show(b);
}
return tbl;
}
//########################
//## Circle / Arc ##
//########################
static void
{
if (gtk_object_get_data(GTK_OBJECT(tbl), "single")) { // only for a single selected ellipse (for now)
}
} else {
}
}
static void
sp_arctb_startend_value_changed(GtkAdjustment *adj, GtkWidget *tbl, gchar const *value_name, gchar const *other_name)
{
}
// quit if run by the attr_changed listener
return;
}
// in turn, prevent listener from responding
bool modmade = false;
{
else
modmade = true;
}
}
if (modmade) {
}
// defocus spinbuttons by moving focus to the canvas, unless "stay" is on
}
static void
{
}
static void
{
}
static void
{
} else {
}
}
// quit if run by the attr_changed listener
return;
}
// in turn, prevent listener from responding
bool modmade = false;
{
modmade = true;
}
}
} else {
{
modmade = true;
}
}
}
if (modmade) {
}
}
{
}
{
// quit if run by the _changed callbacks
return;
}
// in turn, prevent callbacks from responding
if (openstr) {
} else {
}
}
NULL, /* child_added */
NULL, /* child_removed */
NULL, /* content_changed */
NULL /* order_changed */
};
static void
{
int n_selected = 0;
{
n_selected++;
}
}
if (n_selected == 0) {
} else if (n_selected == 1) {
if (oldrepr) { // remove old listener
oldrepr = 0;
}
if (repr) {
}
} else {
// FIXME: implement averaging of all parameters for multiple selected
//gtk_label_set_markup(GTK_LABEL(l), _("<b>Average:</b>"));
}
}
static GtkWidget *
{
/* Start */
{
GtkWidget *hb = sp_tb_spinbutton(_("Start:"), _("The angle (in degrees) from the horizontal to the arc's start point"),
-360.0, 360.0, 1.0, 10.0,
}
/* End */
{
GtkWidget *hb = sp_tb_spinbutton(_("End:"), _("The angle (in degrees) from the horizontal to the arc's end point"),
-360.0, 360.0, 1.0, 10.0,
}
/* Segments / Pie checkbox */
{
gtk_tooltips_set_tip(tt, fscb, _("Switch between arc (unclosed shape) and segment (closed shape with two radii)"), NULL);
else
}
/* Make Whole */
{
gtk_widget_show(b);
}
// sensitivize make whole and open checkbox
{
}
sp_desktop_selection(desktop)->connectChanged(sigc::bind(sigc::ptr_fun(sp_arc_toolbox_selection_changed), (GtkObject *)tbl))
);
return tbl;
}
// toggle button callbacks and updaters
//########################
//## Dropper ##
//########################
// 0 and 1 are backwards here because of pref
}
/**
* Copy the current saved desktop color to the clipboard as full hex + alpha
* color representation. This is useful for passing values between various
* input boxes, or directly to xml.
*/
/* static void
sp_dropper_copy( GtkWidget *widget, GtkObject *obj)
{
GtkWidget *tbl = GTK_WIDGET(obj);
SPDesktop *desktop =
(SPDesktop *) gtk_object_get_data(GTK_OBJECT(tbl), "desktop");
sp_dropper_c32_color_copy( sp_desktop_get_color(desktop, true) );
}*/
/**
* Copies currently saved desktop color to the clipboard as a hex value. This
* is useful for editing webpages and needing a value quickly for web
* colors.
*
* TODO: When the toggle of the dropper is set to not mix color against
* page background, this still just gets the color of the page and
* doesn't get the actual mixed against background which is needed
* for the hex value ppl. want for web pages, etc.
*/
/* static void
sp_dropper_copy_as_hex ( GtkWidget *widget, GtkObject *obj)
{
GtkWidget *tbl = GTK_WIDGET(obj);
SPDesktop *desktop =
(SPDesktop *) gtk_object_get_data(GTK_OBJECT(tbl), "desktop");
sp_dropper_c32_color_copy_hex( sp_desktop_get_color(desktop, true) );
}*/
/**
* Sets the input boxes with the changed color and opacity. This is used as a
* callback for style changing.
*/
/* static bool
sp_style_changed (const SPCSSAttr *css, gpointer data)
{
// GrDrag *drag = (GrDrag *) data;
// set fill of text entry box
if (css->attribute("fill"))
gtk_entry_set_text((GtkEntry *)dropper_rgb_entry,
css->attribute("fill"));
// set opacity of text entry box
if (css->attribute("fill-opacity"))
gtk_entry_set_text((GtkEntry *)dropper_opacity_entry,
css->attribute("fill-opacity"));
// set fill of text entry box
if (css->attribute("stroke"))
gtk_entry_set_text((GtkEntry *)dropper_rgb_entry,
css->attribute("stroke"));
// set opacity of text entry box
if (css->attribute("stroke-opacity"))
gtk_entry_set_text((GtkEntry *)dropper_opacity_entry,
css->attribute("stroke-opacity"));
return false;
}
*/
/**
* Dropper auxiliary toolbar construction and setup.
*
* TODO: Would like to add swatch of current color.
* TODO: Add queue of last 5 or so colors selected with new swatches so that
* can drag and drop places. Will provide a nice mixing palette.
*/
static GtkWidget *
{
// sp_toolbox_add_label(tbl, _("<b>New:</b>"));
/* RGB Input Field */
/* {
GtkWidget *hb = gtk_hbox_new(FALSE, 1);
GtkWidget *dropper_rgba_label = gtk_label_new ("Color:");
gtk_widget_show (dropper_rgba_label);
gtk_container_add(GTK_CONTAINER(hb), dropper_rgba_label);
dropper_rgb_entry = gtk_entry_new ();
sp_dialog_defocus_on_enter (dropper_rgb_entry);
gtk_entry_set_max_length (GTK_ENTRY (dropper_rgb_entry), 7);
gtk_entry_set_width_chars (GTK_ENTRY (dropper_rgb_entry), 7);
gtk_tooltips_set_tip(tt, dropper_rgb_entry,
_("Hexidecimal representation of last selected "
"color"),
NULL);
gtk_widget_show (dropper_rgb_entry);
gtk_container_add(GTK_CONTAINER(hb), dropper_rgb_entry);
gtk_box_pack_start(GTK_BOX(tbl), hb, FALSE, FALSE,
AUX_BETWEEN_BUTTON_GROUPS);
} */
/* Opacity Input Field */
/* {
GtkWidget *hb = gtk_hbox_new(FALSE, 1);
GtkWidget *dropper_opacity_label = gtk_label_new ( _("Opacity:") );
gtk_widget_show (dropper_opacity_label);
gtk_container_add(GTK_CONTAINER(hb), dropper_opacity_label);
dropper_opacity_entry = gtk_entry_new ();
sp_dialog_defocus_on_enter (dropper_opacity_entry);
gtk_entry_set_max_length (GTK_ENTRY (dropper_opacity_entry), 11);
gtk_entry_set_width_chars (GTK_ENTRY (dropper_opacity_entry), 11);
gtk_tooltips_set_tip(tt, dropper_opacity_entry,
_("Opacity of last selected color"),
NULL);
gtk_widget_show (dropper_opacity_entry);
gtk_container_add(GTK_CONTAINER(hb), dropper_opacity_entry);
gtk_box_pack_start(GTK_BOX(tbl), hb, FALSE, FALSE,
AUX_BETWEEN_BUTTON_GROUPS);
} */
/* Copy to Clipboard */
/* {
GtkWidget *hb = gtk_hbox_new(FALSE, 1);
GtkWidget *b = gtk_button_new_with_label(_("Copy as RGBA"));
gtk_tooltips_set_tip(tt, b, _("Copy last saved color as hexidecimal "
"RGB + Alpha (RGBA) to "
"clipboard"),
NULL);
gtk_widget_show(b);
gtk_container_add(GTK_CONTAINER(hb), b);
gtk_signal_connect(GTK_OBJECT(b), "clicked",
GTK_SIGNAL_FUNC(sp_dropper_copy), tbl);
gtk_box_pack_start(GTK_BOX(tbl), hb, FALSE, FALSE,
AUX_BETWEEN_BUTTON_GROUPS);
} */
/* Copy to Clipboard as HEX */
/* {
GtkWidget *hb = gtk_hbox_new(FALSE, 1);
GtkWidget *b = gtk_button_new_with_label(_("Copy as HEX"));
gtk_tooltips_set_tip(tt, b, _("Copy last saved color as "
"hexidecimal RGB without alpha "
"to clipboard"), NULL);
gtk_widget_show(b);
gtk_container_add(GTK_CONTAINER(hb), b);
gtk_signal_connect(GTK_OBJECT(b), "clicked",
GTK_SIGNAL_FUNC(sp_dropper_copy_as_hex), tbl);
gtk_box_pack_start(GTK_BOX(tbl), hb, FALSE, FALSE,
AUX_BETWEEN_BUTTON_GROUPS);
} */
// aux_toolbox_space(tbl, AUX_BETWEEN_BUTTON_GROUPS);
{
NULL,
"pick_color",
_("When pressed, picks visible color "
"without alpha and when not pressed, "
"picks color including its "
"alpha"),
tt);
!prefs_get_int_attribute ("tools.dropper",
"pick", 0));
}
// where new gtkmm stuff should go
/*
sigc::connection *connection = new sigc::connection(
desktop->connectSetStyle(
sigc::bind(sigc::ptr_fun(sp_style_changed),
desktop)) );
g_signal_connect(G_OBJECT(tbl), "destroy", G_CALLBACK(delete_connection),
connection); */
return tbl;
}
//########################
//## Text Toolbox ##
//########################
/*
static void
sp_text_letter_changed(GtkAdjustment *adj, GtkWidget *tbl)
{
//Call back for letter sizing spinbutton
}
static void
sp_text_line_changed(GtkAdjustment *adj, GtkWidget *tbl)
{
//Call back for line height spinbutton
}
static void
sp_text_horiz_kern_changed(GtkAdjustment *adj, GtkWidget *tbl)
{
//Call back for horizontal kerning spinbutton
}
static void
sp_text_vert_kern_changed(GtkAdjustment *adj, GtkWidget *tbl)
{
//Call back for vertical kerning spinbutton
}
static void
sp_text_letter_rotation_changed(GtkAdjustment *adj, GtkWidget *tbl)
{
//Call back for letter rotation spinbutton
}*/
static GtkWidget *
{
/* GtkWidget *us = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(tbl), "units");
GtkTooltips *tt = gtk_tooltips_new();
GtkWidget *group;
//Font Family
{
GtkWidget *c = gtk_combo_new ();
gtk_combo_set_value_in_list ((GtkCombo *) c, FALSE, FALSE);
gtk_combo_set_use_arrows ((GtkCombo *) c, TRUE);
gtk_combo_set_use_arrows_always ((GtkCombo *) c, TRUE);
gtk_widget_set_size_request (c, 144, -1);
aux_toolbox_space(tbl, 1);
gtk_box_pack_start (GTK_BOX (tbl), c, FALSE, FALSE, 0);
}
//Font Style
{
GtkWidget *c = gtk_combo_new ();
gtk_combo_set_value_in_list ((GtkCombo *) c, FALSE, FALSE);
gtk_combo_set_use_arrows ((GtkCombo *) c, TRUE);
gtk_combo_set_use_arrows_always ((GtkCombo *) c, TRUE);
gtk_widget_set_size_request (c, 88, -1);
aux_toolbox_space(tbl, 1);
gtk_box_pack_start (GTK_BOX (tbl), c, FALSE, FALSE, 0);
}
//Font Size
{
GtkWidget *c = gtk_combo_new ();
gtk_combo_set_value_in_list ((GtkCombo *) c, FALSE, FALSE);
gtk_combo_set_use_arrows ((GtkCombo *) c, TRUE);
gtk_combo_set_use_arrows_always ((GtkCombo *) c, TRUE);
gtk_widget_set_size_request (c, 64, -1);
aux_toolbox_space(tbl, 1);
gtk_box_pack_start (GTK_BOX (tbl), c, FALSE, FALSE, 0);
}
aux_toolbox_space(tbl, AUX_BETWEEN_BUTTON_GROUPS);
//Bold
{
GtkWidget *px = gtk_image_new_from_stock(GTK_STOCK_BOLD, Inkscape::ICON_SIZE_SMALL_TOOLBAR);
GtkWidget *button = gtk_toggle_button_new ();
gtk_container_add (GTK_CONTAINER (button), px);
gtk_widget_show(button);
gtk_tooltips_set_tip (tt, button, _("Bold"), NULL);
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
gtk_widget_set_sensitive(button, TRUE);
gtk_box_pack_start (GTK_BOX (tbl), button, FALSE, FALSE, 0);
}
//Italic
{
GtkWidget *px = gtk_image_new_from_stock(GTK_STOCK_ITALIC, Inkscape::ICON_SIZE_SMALL_TOOLBAR);
GtkWidget *button = gtk_toggle_button_new ();
gtk_container_add (GTK_CONTAINER (button), px);
gtk_widget_show(button);
gtk_tooltips_set_tip (tt, button, _("Italics"), NULL);
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
gtk_widget_set_sensitive(button, TRUE);
gtk_box_pack_start (GTK_BOX (tbl), button, FALSE, FALSE, 0);
}
//Underline
{
GtkWidget *px = gtk_image_new_from_stock(GTK_STOCK_UNDERLINE, Inkscape::ICON_SIZE_SMALL_TOOLBAR);
GtkWidget *button = gtk_toggle_button_new ();
gtk_container_add (GTK_CONTAINER (button), px);
gtk_widget_show(button);
gtk_tooltips_set_tip (tt, button, _("Underline"), NULL);
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
gtk_widget_set_sensitive(button, FALSE);
gtk_box_pack_start (GTK_BOX (tbl), button, FALSE, FALSE, 0);
}
aux_toolbox_space(tbl, AUX_BETWEEN_BUTTON_GROUPS);
// align left
{
GtkWidget *px = gtk_image_new_from_stock (GTK_STOCK_JUSTIFY_LEFT, Inkscape::ICON_SIZE_SMALL_TOOLBAR);
GtkWidget *b = group = gtk_radio_button_new (NULL);
gtk_container_add (GTK_CONTAINER (b), px);
gtk_tooltips_set_tip (tt, b, _("Align lines left"), NULL);
gtk_button_set_relief (GTK_BUTTON (b), GTK_RELIEF_NONE);
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (b), FALSE );
gtk_box_pack_start (GTK_BOX (tbl), b, FALSE, FALSE, 0);
}
// align center
{
GtkWidget *px = gtk_image_new_from_stock (GTK_STOCK_JUSTIFY_CENTER, Inkscape::ICON_SIZE_SMALL_TOOLBAR);
GtkWidget *b = gtk_radio_button_new (gtk_radio_button_group (GTK_RADIO_BUTTON (group)));
gtk_container_add (GTK_CONTAINER (b), px);
// TRANSLATORS: `Center' here is a verb.
gtk_tooltips_set_tip (tt, b, _("Center lines"), NULL);
gtk_button_set_relief (GTK_BUTTON (b), GTK_RELIEF_NONE);
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (b), FALSE );
gtk_box_pack_start (GTK_BOX (tbl), b, FALSE, FALSE, 0);
}
// align right
{
GtkWidget *px = gtk_image_new_from_stock (GTK_STOCK_JUSTIFY_RIGHT, Inkscape::ICON_SIZE_SMALL_TOOLBAR);
GtkWidget *b = gtk_radio_button_new (gtk_radio_button_group (GTK_RADIO_BUTTON (group)));
gtk_container_add (GTK_CONTAINER (b), px);
gtk_tooltips_set_tip (tt, b, _("Align lines right"), NULL);
gtk_button_set_relief (GTK_BUTTON (b), GTK_RELIEF_NONE);
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (b), FALSE );
gtk_box_pack_start (GTK_BOX (tbl), b, FALSE, FALSE, 0);
}
// full justification
{
GtkWidget *px = gtk_image_new_from_stock (GTK_STOCK_JUSTIFY_FILL, Inkscape::ICON_SIZE_SMALL_TOOLBAR);
GtkWidget *b = gtk_radio_button_new (gtk_radio_button_group (GTK_RADIO_BUTTON (group)));
gtk_container_add (GTK_CONTAINER (b), px);
gtk_tooltips_set_tip (tt, b, _("Full justification"), NULL);
gtk_button_set_relief (GTK_BUTTON (b), GTK_RELIEF_NONE);
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (b), FALSE );
gtk_box_pack_start (GTK_BOX (tbl), b, FALSE, FALSE, 0);
}
aux_toolbox_space(tbl, AUX_BETWEEN_BUTTON_GROUPS);
// horizontal
{
GtkWidget *px= sp_icon_new(Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_STOCK_WRITING_MODE_LR);
GtkWidget *b = group = gtk_radio_button_new (NULL);
gtk_container_add (GTK_CONTAINER (b), px);
gtk_tooltips_set_tip (tt, b, _("Horizontal text"), NULL);
gtk_button_set_relief (GTK_BUTTON (b), GTK_RELIEF_NONE);
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (b), FALSE );
gtk_box_pack_start (GTK_BOX (tbl), b, FALSE, FALSE, 0);
}
// vertical
{
GtkWidget *px = sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_STOCK_WRITING_MODE_TB);
GtkWidget *b = gtk_radio_button_new (gtk_radio_button_group (GTK_RADIO_BUTTON (group)));
gtk_container_add (GTK_CONTAINER (b), px);
gtk_tooltips_set_tip (tt, b, _("Vertical text"), NULL);
gtk_button_set_relief (GTK_BUTTON (b), GTK_RELIEF_NONE);
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (b), FALSE );
gtk_box_pack_start (GTK_BOX (tbl), b, FALSE, FALSE, 0);
}
aux_toolbox_space(tbl, AUX_BETWEEN_BUTTON_GROUPS);
// letter spacing
{
{
GtkWidget *image = sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_STOCK_TEXT_LETTER_SPACING);
GtkWidget *hb = gtk_hbox_new(FALSE, 1);
gtk_container_add (GTK_CONTAINER (hb), image);
gtk_widget_show(image);
gtk_box_pack_start (GTK_BOX (tbl), hb, FALSE, FALSE, 0);
}
{
GtkWidget *hb = sp_tb_spinbutton(_(""), _("Spacing between letters"),
"tools.text", "letter_spacing", 0.0,
us, tbl, FALSE, NULL,
-1000.0, 1000.0, 0.1, 0.1,
sp_text_letter_changed, 0.1, 1);
gtk_widget_set_size_request (hb, 45, 6);
gtk_box_pack_start(GTK_BOX(tbl), hb, FALSE, FALSE, 6);
}
}
// line spacing
{
{
GtkWidget *image = sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_STOCK_TEXT_LINE_SPACING);
GtkWidget *hb = gtk_hbox_new(FALSE, 1);
gtk_container_add (GTK_CONTAINER (hb), image);
gtk_widget_show(image);
gtk_box_pack_start (GTK_BOX (tbl), hb, FALSE, FALSE, 0);
}
{
GtkWidget *hb = sp_tb_spinbutton(_(""), _("Spacing between lines"),
"tools.text", "line_spacing", 0,
us, tbl, FALSE, NULL,
-1000.0, 1000.0, 0.1, 0.1,
sp_text_line_changed, 0.1, 1);
gtk_widget_set_size_request (hb, 45, 0);
gtk_box_pack_start(GTK_BOX(tbl), hb, FALSE, FALSE, 3);
}
}
{
GtkWidget *us = sp_unit_selector_new(SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE);
sp_unit_selector_setsize(us, AUX_OPTION_MENU_WIDTH, AUX_OPTION_MENU_HEIGHT);
sp_unit_selector_set_unit(SP_UNIT_SELECTOR(us), desktop->namedview->doc_units);
aux_toolbox_space(tbl, AUX_BETWEEN_BUTTON_GROUPS);
// horizontal kerning
{
{
GtkWidget *image = sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_STOCK_TEXT_HORZ_KERN);
GtkWidget *hb = gtk_hbox_new(FALSE, 1);
gtk_container_add (GTK_CONTAINER (hb), image);
gtk_widget_show(image);
gtk_box_pack_start (GTK_BOX (tbl), hb, FALSE, FALSE, 0);
}
{
GtkWidget *hb = sp_tb_spinbutton(_(""), _("Horizontal kerning"),
"tools.text", "horizontal_kerning", 0,
us, tbl, FALSE, NULL,
-100.00, 100.00, 0.01, 0.1,
sp_text_horiz_kern_changed);
gtk_widget_set_size_request (hb, 45, 0);
gtk_box_pack_start(GTK_BOX(tbl), hb, FALSE, FALSE, 6);
}
}
// vertical kerning
{
{
GtkWidget *image = sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_STOCK_TEXT_VERT_KERN);
GtkWidget *hb = gtk_hbox_new(FALSE, 1);
gtk_container_add (GTK_CONTAINER (hb), image);
gtk_widget_show(image);
gtk_box_pack_start (GTK_BOX (tbl), hb, FALSE, FALSE, 0);
}
{
GtkWidget *hb = sp_tb_spinbutton(_(""), _("Vertical kerning"),
"tools.text", "vertical_kerning", 0,
us, tbl, FALSE, NULL,
-100.00, 100.00, 0.01, 0.1,
sp_text_vert_kern_changed);
gtk_widget_set_size_request (hb, 45, 0);
gtk_box_pack_start(GTK_BOX(tbl), hb, FALSE, FALSE, 5);
}
}
// add the units menu
gtk_widget_show(us);
gtk_box_pack_start(GTK_BOX(tbl), us, FALSE, FALSE, 1);
gtk_object_set_data(GTK_OBJECT(tbl), "units", us);
}
// letter rotation
aux_toolbox_space(tbl, AUX_BETWEEN_BUTTON_GROUPS);
{
{
GtkWidget *image = sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_STOCK_TEXT_ROTATION);
GtkWidget *hb = gtk_hbox_new(FALSE, 1);
gtk_container_add (GTK_CONTAINER (hb), image);
gtk_widget_show(image);
gtk_box_pack_start (GTK_BOX (tbl), hb, FALSE, FALSE, 0);
}
{
GtkWidget *hb = sp_tb_spinbutton(_(""), _("Letter rotation"),
"tools.text", "letter_rotation", 0,
us, tbl, FALSE, NULL,
-180.0, 180.0, 0.1, 0.1,
sp_text_letter_rotation_changed, 0.1, 1);
gtk_widget_set_size_request (hb, 45, 0);
gtk_box_pack_start(GTK_BOX(tbl), hb, FALSE, FALSE, 6);
}
// rotation degree label
{
GtkWidget *label = gtk_widget_new (GTK_TYPE_LABEL, "label", "\302\260", "xalign", 0.0, NULL);
gtk_box_pack_start(GTK_BOX(tbl), label, FALSE, FALSE, 0);
}
}
// Remove Manual Kerns
{
GtkWidget *px = sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_STOCK_TEXT_REMOVE_KERNS);
GtkWidget *button = gtk_button_new ();
gtk_container_add (GTK_CONTAINER (button), px);
gtk_widget_show(button);
gtk_tooltips_set_tip (tt, button, _("Remove manual kerns"), NULL);
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
gtk_widget_set_sensitive(button, TRUE);
gtk_box_pack_start (GTK_BOX (tbl), button, FALSE, FALSE, AUX_BETWEEN_BUTTON_GROUPS);
}
*/
return tbl;
} // end of sp_text_toolbox_new()
//#########################
//## Connector Toolbox ##
//#########################
static void sp_connector_path_set_avoid(void)
{
cc_selection_set_avoid(true);
}
static void sp_connector_path_set_ignore(void)
{
cc_selection_set_avoid(false);
}
{
// quit if run by the _changed callbacks
return;
}
"desktop");
{
return;
}
// in turn, prevent callbacks from responding
avoid_item_move(&m, item);
}
if (items) {
}
}
{
return;
}
return;
}
}
NULL, /* child_added */
NULL, /* child_removed */
NULL, /* content_changed */
NULL /* order_changed */
};
static GtkWidget *
{
tt, _("Make connectors avoid selected objects"));
tt, _("Make connectors ignore selected objects"));
// interval
// Spacing spinbox
{
_("The amount of space left around objects by auto-routing connectors"),
"inkscape:connector-spacing", 0, 100, 1.0, 10.0,
connector_spacing_changed, 1, 0);
}
// Code to watch for changes to the connector-spacing attribute in
// the XML.
if (oldrepr) { // remove old listener
}
if (repr) {
}
return tbl;
} // end of sp_connector_toolbox_new()
/*
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 :