toolbox.cpp revision 858c935529ba028289015a5c5b93b8fc384e9144
#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>
* Jon A. Cruz <jon@joncruz.org>
*
* Copyright (C) 2004 David Turner
* Copyright (C) 2003 MenTaLguY
* Copyright (C) 1999-2006 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 <gtkmm.h>
#include <iostream>
#include <sstream>
#include "widgets/widget-sizes.h"
#include "widgets/spw-utilities.h"
#include "widgets/spinbutton-events.h"
#include "dialogs/text-edit.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 "sp-text.h"
#include "sp-flowtext.h"
#include "style.h"
#include "selection.h"
#include "document-private.h"
#include "desktop-style.h"
#include "../libnrtype/font-lister.h"
#include "../connection-pool.h"
#include "../prefs-utils.h"
#include "../inkscape-stock.h"
#include "icon.h"
#include "graphlayout/graphlayout.h"
#include "mod360.h"
#include "toolbox.h"
#include "flood-context.h"
#include "ink-action.h"
#include "ege-adjustment-action.h"
#include "ege-output-action.h"
#include "ege-select-one-action.h"
#include "helper/unit-tracker.h"
using Inkscape::UnitTracker;
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 },
{ "SPFloodContext", "paintbucket_tool", SP_VERB_CONTEXT_PAINTBUCKET, SP_VERB_CONTEXT_PAINTBUCKET_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,
{
}
{
if ( targetAction ) {
}
}
{
if ( data ) {
}
}
static SPActionEventVector action_event_vector = {
{NULL},
NULL,
NULL,
NULL,
};
static GtkAction* create_action_for_verb( Inkscape::Verb* verb, Inkscape::UI::View::View* view, Inkscape::IconSize size )
{
InkAction* inky = ink_action_new( verb->get_id(), verb->get_name(), verb->get_tip(), verb->get_image(), size );
SPAction*rebound = dynamic_cast<SPAction *>( nr_object_ref( dynamic_cast<NRObject *>(targetAction) ) );
nr_active_object_add_listener( (NRActiveObject *)rebound, (NRObjectEventVector *)&action_event_vector, sizeof(SPActionEventVector), inky );
return act;
}
{
gint verbsToUse[] = {
// disabled until we have icons for them:
//find
//SP_VERB_EDIT_TILE,
//SP_VERB_EDIT_UNTILE,
};
Inkscape::IconSize toolboxSize = shrinkTop ? Inkscape::ICON_SIZE_SMALL_TOOLBAR : Inkscape::ICON_SIZE_LARGE_TOOLBAR;
GtkActionGroup* mainActions = 0;
}
if ( !mainActions ) {
}
if ( verb ) {
}
}
}
return mainActions;
}
{
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 *
{
"<ui>"
" <toolbar name='NodeToolbar'>"
" <toolitem action='NodeInsertAction' />"
" <toolitem action='NodeDeleteAction' />"
" <separator />"
" <toolitem action='NodeJoinAction' />"
" <toolitem action='NodeJoinSegmentAction' />"
" <toolitem action='NodeDeleteSegmentAction' />"
" <toolitem action='NodeBreakAction' />"
" <separator />"
" <toolitem action='NodeCuspAction' />"
" <toolitem action='NodeSmoothAction' />"
" <toolitem action='NodeSymmetricAction' />"
" <separator />"
" <toolitem action='NodeLineAction' />"
" <toolitem action='NodeCurveAction' />"
" <separator />"
" <toolitem action='ObjectToPath' />"
" <toolitem action='StrokeToPath' />"
" <separator />"
" <toolitem action='NodesShowHandlesAction' />"
" </toolbar>"
"</ui>";
{
_("Insert"),
_("Insert new nodes into selected segments"),
"node_insert",
}
{
_("Delete"),
_("Delete selected nodes"),
"node_delete",
}
{
_("Join"),
_("Join selected endnodes"),
"node_join",
}
{
_("Join Segment"),
_("Join selected endnodes with a new segment"),
"node_join_segment",
g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_node_path_edit_join_segment), 0 );
}
{
_("Delete Segment"),
_("Split path between two non-endpoint nodes"),
"node_delete_segment",
g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_node_path_edit_delete_segment), 0 );
}
{
_("Node Break"),
_("Break path at selected nodes"),
"node_break",
}
{
_("Node Cusp"),
_("Make selected nodes corner"),
"node_cusp",
}
{
_("Node Smooth"),
_("Make selected nodes smooth"),
"node_smooth",
}
{
_("Node Symmetric"),
_("Make selected nodes symmetric"),
"node_symmetric",
}
{
_("Node Line"),
_("Make selected segments lines"),
"node_line",
}
{
_("Node Curve"),
_("Make selected segments curves"),
"node_curve",
}
{
_("Show Handles"),
_("Show the Bezier handles of selected nodes"),
"nodes_show_handles",
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs_get_int_attribute( "tools.nodes", "show_handles", 1 ) );
}
Inkscape::IconSize toolboxSize = shrinkTop ? Inkscape::ICON_SIZE_SMALL_TOOLBAR : Inkscape::ICON_SIZE_LARGE_TOOLBAR;
return toolBar;
} // end of sp_node_toolbox_new()
//########################
//## Zoom Toolbox ##
//########################
static GtkWidget *
{
"<ui>"
" <toolbar name='ZoomToolbar'>"
" <toolitem action='ZoomIn' />"
" <toolitem action='ZoomOut' />"
" <separator />"
" <toolitem action='ZoomSelection' />"
" <toolitem action='ZoomDrawing' />"
" <toolitem action='ZoomPage' />"
" <toolitem action='ZoomPageWidth' />"
" <separator />"
" <toolitem action='ZoomPrev' />"
" <toolitem action='ZoomNext' />"
" <separator />"
" <toolitem action='Zoom1:0' />"
" <toolitem action='Zoom1:2' />"
" <toolitem action='Zoom2:1' />"
" </toolbar>"
"</ui>";
Inkscape::IconSize toolboxSize = shrinkTop ? Inkscape::ICON_SIZE_SMALL_TOOLBAR : Inkscape::ICON_SIZE_LARGE_TOOLBAR;
return toolBar;
} // 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
{
"<ui>"
" <toolbar name='CommandsToolbar'>"
" <toolitem action='FileNew' />"
" <toolitem action='FileOpen' />"
" <toolitem action='FileSave' />"
" <toolitem action='FilePrint' />"
" <separator />"
" <toolitem action='FileImport' />"
" <toolitem action='FileExport' />"
" <separator />"
" <toolitem action='EditUndo' />"
" <toolitem action='EditRedo' />"
" <separator />"
" <toolitem action='EditCopy' />"
" <toolitem action='EditCut' />"
" <toolitem action='EditPaste' />"
" <separator />"
" <toolitem action='ZoomSelection' />"
" <toolitem action='ZoomDrawing' />"
" <toolitem action='ZoomPage' />"
" <separator />"
" <toolitem action='EditDuplicate' />"
" <toolitem action='EditClone' />"
" <toolitem action='EditUnlinkClone' />"
" <separator />"
" <toolitem action='SelectionGroup' />"
" <toolitem action='SelectionUnGroup' />"
" <separator />"
" <toolitem action='DialogFillStroke' />"
" <toolitem action='DialogText' />"
" <toolitem action='DialogXMLEditor' />"
" <toolitem action='DialogAlignDistribute' />"
" <separator />"
" <toolitem action='DialogPreferences' />"
" <toolitem action='DialogDocumentProperties' />"
" </toolbar>"
"</ui>";
Inkscape::IconSize toolboxSize = shrinkTop ? Inkscape::ICON_SIZE_SMALL_TOOLBAR : Inkscape::ICON_SIZE_LARGE_TOOLBAR;
}
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;
}
{
GtkAdjustment* adj = GTK_ADJUSTMENT( gtk_adjustment_new( prefs_get_double_attribute(path, data, def) * factor,
if (us) {
}
EgeAdjustmentAction* act = ege_adjustment_action_new( adj, name, label, tooltip, 0, climb, digits );
}
if ( focusTarget ) {
}
}
if ( dataKludge ) {
}
// Using a cast just to make sure we pass in the right kind of function pointer
g_object_set( G_OBJECT(act), "tool-post", static_cast<EgeWidgetFixup>(sp_set_font_size_smaller), NULL );
return act;
}
#define MODE_LABEL_WIDTH 70
//########################
//## Star ##
//########################
{
// 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;
}
}
_("Star: Change number of corners"));
}
{
}
// quit if run by the attr_changed listener
return;
}
// in turn, prevent listener from responding
bool modmade = false;
} else {
}
modmade = true;
}
}
_("Star: Change spoke ratio"));
}
{
}
// quit if run by the attr_changed listener
return;
}
// in turn, prevent listener from responding
bool modmade = false;
if ( prop_action ) {
}
modmade = true;
}
}
if (modmade) {
}
}
{
}
// quit if run by the attr_changed listener
return;
}
// in turn, prevent listener from responding
bool modmade = false;
modmade = true;
}
}
_("Star: Change rounding"));
}
{
}
// quit if run by the attr_changed listener
return;
}
// in turn, prevent listener from responding
bool modmade = false;
modmade = true;
}
}
_("Star: Change randomization"));
}
{
// quit if run by the _changed callbacks
return;
}
// in turn, prevent callbacks from responding
GtkAdjustment *adj = 0;
EgeSelectOneAction* flat_action = EGE_SELECT_ONE_ACTION( g_object_get_data( G_OBJECT(tbl), "flat_action" ) );
} 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>"));
//gtk_label_set_markup(GTK_LABEL(l), _("<b>Change:</b>"));
}
}
{
// 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
GtkAdjustment *adj = 0;
// fixme: make settable in prefs!
gdouble randomized = 0;
EgeSelectOneAction* flat_action = EGE_SELECT_ONE_ACTION( g_object_get_data( G_OBJECT(dataKludge), "flat_action" ) );
}
void
{
}
static GtkWidget *
{
"<ui>"
" <toolbar name='StarToolbar'>"
" <separator />"
" <toolitem action='StarStateAction' />"
" <separator />"
" <toolitem action='FlatAction' />"
" <separator />"
" <toolitem action='MagnitudeAction' />"
" <toolitem action='SpokeAction' />"
" <toolitem action='RoundednessAction' />"
" <toolitem action='RandomizationAction' />"
" <separator />"
" <toolitem action='ResetAction' />"
" </toolbar>"
"</ui>";
{
}
{
//EgeAdjustmentAction* calligraphy_angle = 0;
EgeAdjustmentAction* eact = 0;
/* Flatsided checkbox */
{
0, _("Polygon"),
1, _("Regular polygon (with one handle) instead of a star"),
2, "star_flat",
-1 );
0, _("Star"),
1, _("Star instead of a regular polygon (with one handle)"),
2, "star_angled",
-1 );
EgeSelectOneAction* act = ege_select_one_action_new( "FlatAction", _(""), _(""), NULL, GTK_TREE_MODEL(model) );
g_signal_connect_after( G_OBJECT(act), "changed", G_CALLBACK(sp_stb_sides_flat_state_changed), holder);
}
/* Magnitude */
//gchar const* labels[] = {_("tri (default)"), _("quad"), _("pent")};
//gdouble values[] = {3, 4, 5};
_("Corners:"), _("Number of corners of a polygon or star"),
3, 1024, 1, 5,
0, 0, 0, // labels, values, G_N_ELEMENTS(labels),
1.0, 0 );
/* Spoke ratio */
//gchar const* labels2[] = {_("(left edge up)"), _("(horizontal)"), _("(default)"), _("(right edge up)")};
//gdouble values2[] = {-90, 0, 30, 90};
_("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,
0, 0, 0, // labels2, values2, G_N_ELEMENTS(labels2),
if ( !isFlatSided ) {
} else {
}
/* Roundedness */
//gchar const* labels3[] = {_("(left edge up)"), _("(horizontal)"), _("(default)"), _("(right edge up)")};
//gdouble values3[] = {-90, 0, 30, 90};
_("Rounded:"), _("How much rounded are the corners (0 for sharp)"),
-100.0, 100.0, 0.01, 0.1,
0, 0, 0, // labels3, values3, G_N_ELEMENTS(labels3),
/* Randomization */
//gchar const* labels4[] = {_("(left edge up)"), _("(horizontal)"), _("(default)"), _("(right edge up)")};
//gdouble values4[] = {-90, 0, 30, 90};
_("Randomized:"), _("Scatter randomly the corners and angles"),
-10.0, 10.0, 0.001, 0.01,
0, 0, 0, // labels4, values4, G_N_ELEMENTS(labels4),
}
{
/* Reset */
{
_("Defaults"),
_("Reset shape parameters to defaults (use Inkscape Preferences > Tools to change defaults)"),
}
}
gtk_table_attach( GTK_TABLE(holder), toolBar, 0, 1, 0, 1, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0 );
Inkscape::UI::Widget::StyleSwatch *swatch = new Inkscape::UI::Widget::StyleSwatch(NULL, _("Style of new stars"));
gtk_table_attach( GTK_TABLE(holder), swatch_, 1, 2, 0, 1, (GtkAttachOptions)(GTK_SHRINK | GTK_FILL), (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), AUX_BETWEEN_BUTTON_GROUPS, 0 );
//sp_set_font_size_smaller (tbl);
sp_desktop_selection(desktop)->connectChanged(sigc::bind(sigc::ptr_fun(sp_star_toolbox_selection_changed), (GtkObject *)holder))
);
return holder;
}
//########################
//## 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
{
UnitTracker* tracker = reinterpret_cast<UnitTracker*>(gtk_object_get_data(GTK_OBJECT(tbl), "tracker"));
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) {
_("Change rectangle"));
}
// defocus spinbuttons by moving focus to the canvas, unless "stay" is on
}
static void
{
}
static void
{
}
static void
{
}
static void
{
}
static void
{
GtkAdjustment *adj = 0;
// 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
UnitTracker* tracker = reinterpret_cast<UnitTracker*>( gtk_object_get_data(GTK_OBJECT(tbl), "tracker") );
{
}
{
}
{
}
{
}
}
}
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 *
{
"<ui>"
" <toolbar name='RectToolbar'>"
" <toolitem action='RectStateAction' />"
" <toolitem action='WidthAction' />"
" <toolitem action='HeightAction' />"
" <toolitem action='RadiusXAction' />"
" <toolitem action='RadiusYAction' />"
" <toolitem action='RectUnitsAction' />"
" <separator />"
" <toolitem action='RectResetAction' />"
" </toolbar>"
"</ui>";
EgeAdjustmentAction* eact = 0;
{
}
//tracker->addUnit( SP_UNIT_PERCENT, 0 );
/* W */
{
_("W:"), _("Width of rectangle"),
"tools.shapes.rect", "width", 0,
0, 0, 0,
}
/* H */
{
_("H:"), _("Height of rectangle"),
"tools.shapes.rect", "height", 0,
0, 0, 0,
}
/* rx */
{
_("Rx:"), _("Horizontal radius of rounded corners"),
"tools.shapes.rect", "rx", 0,
0, 0, 0,
}
/* ry */
{
_("Ry:"), _("Vertical radius of rounded corners"),
"tools.shapes.rect", "ry", 0,
0, 0, 0,
}
// add the units menu
{
}
/* Reset */
{
_("Not rounded"),
_("Make corners sharp"),
"squared_corner",
}
Inkscape::UI::Widget::StyleSwatch *swatch = new Inkscape::UI::Widget::StyleSwatch(NULL, _("Style of new rectangles"));
sp_desktop_selection(desktop)->connectChanged(sigc::bind(sigc::ptr_fun(sp_rect_toolbox_selection_changed), (GtkObject *)holder))
);
return holder;
}
//########################
//## 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) {
_("Change spiral"));
}
}
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);
}
Inkscape::UI::Widget::StyleSwatch *swatch = new Inkscape::UI::Widget::StyleSwatch(NULL, _("Style of new spirals"));
sp_desktop_selection(desktop)->connectChanged(sigc::bind(sigc::ptr_fun(sp_spiral_toolbox_selection_changed), (GtkObject *)tbl))
);
return tbl;
}
//########################
//########################
static GtkWidget *
{
Inkscape::UI::Widget::StyleSwatch *swatch = new Inkscape::UI::Widget::StyleSwatch(NULL, _("Style of new paths created by Pen"));
return tbl;
}
static GtkWidget *
{
Inkscape::UI::Widget::StyleSwatch *swatch = new Inkscape::UI::Widget::StyleSwatch(NULL, _("Style of new paths created by Pencil"));
return tbl;
}
//########################
//## Calligraphy ##
//########################
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
prefs_set_int_attribute( "tools.calligraphic", "usepressure", gtk_toggle_action_get_active( act ) ? 1 : 0);
}
{
prefs_set_int_attribute( "tools.calligraphic", "tracebackground", gtk_toggle_action_get_active( act ) ? 1 : 0);
}
{
prefs_set_int_attribute( "tools.calligraphic", "usetilt", gtk_toggle_action_get_active( act ) ? 1 : 0 );
}
{
// FIXME: make defaults settable via Inkscape Options
struct KeyValue {
char const *key;
double value;
} const key_values[] = {
{"mass", 0.02},
{"wiggle", 0.0},
{"angle", 30.0},
{"width", 15},
{"thinning", 0.1},
{"tremor", 0.0},
{"flatness", 0.9},
{"cap_rounding", 0.0}
};
for (unsigned i = 0; i < G_N_ELEMENTS(key_values); ++i) {
GtkAdjustment* adj = static_cast<GtkAdjustment *>(gtk_object_get_data(GTK_OBJECT(dataKludge), kv.key));
if ( adj ) {
}
}
}
static GtkWidget *
{
"<ui>"
" <toolbar name='CalligraphyToolbar'>"
" <separator />"
" <toolitem name='Width' action='WidthAction' />"
" <toolitem name='Thinning' action='ThinningAction' />"
" <separator />"
" <toolitem name='Angle' action='AngleAction' />"
" <toolitem action='FixationAction' />"
" <toolitem action='CapRoundingAction' />"
" <separator />"
" <toolitem action='TremorAction' />"
" <toolitem action='WiggleAction' />"
" <toolitem action='MassAction' />"
" <separator />"
" <toolitem action='TraceAction' />"
" <toolitem action='PressureAction' />"
" <toolitem action='TiltAction' />"
" <toolitem action='ResetAction' />"
" </toolbar>"
"</ui>";
{
{
/* Width */
gchar const* labels[] = {_("(hairline)"), 0, 0, 0, _("(default)"), 0, 0, 0, 0, _("(broad stroke)")};
_("Width:"), _("The width of the calligraphic pen (relative to the visible canvas area)"),
1, 100, 1.0, 10.0,
}
{
/* Thinning */
gchar const* labels[] = {_("(speed blows up stroke)"), 0, 0, _("(slight widening)"), _("(constant width)"), _("(slight thinning, default)"), 0, 0, _("(speed deflates stroke)")};
_("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,
}
{
/* Angle */
gchar const* labels[] = {_("(left edge up)"), 0, 0, _("(horizontal)"), _("(default)"), 0, _("(right edge up)")};
_("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 */
gchar const* labels[] = {_("(perpendicular to stroke, \"brush\")"), 0, 0, 0, _("(almost fixed, default)"), _("(fixed by Angle, \"pen\")")};
_("Fixation:"), _("Angle behavior (0 = nib always perpendicular to stroke direction, 1 = fixed angle)"),
0.0, 1.0, 0.01, 0.1,
}
{
/* Cap Rounding */
gchar const* labels[] = {_("(blunt caps, default)"), _("(slightly bulging)"), 0, 0, _("(approximately round)"), _("(long protruding caps)")};
// TRANSLATORS: "cap" means "end" (both start and finish) here
_("Caps:"), _("Increase to make caps at the ends of strokes protrude more (0 = no caps, 1 = round caps)"),
0.0, 5.0, 0.01, 0.1,
}
{
/* Tremor */
gchar const* labels[] = {_("(smooth line)"), _("(slight tremor)"), _("(noticeable tremor)"), 0, 0, _("(maximum tremor)")};
_("Tremor:"), _("Increase to make strokes rugged and trembling"),
0.0, 1.0, 0.01, 0.1,
}
{
/* Wiggle */
gchar const* labels[] = {_("(no wiggle)"), _("(slight deviation)"), 0, 0, _("(wild waves and curls)")};
_("Wiggle:"), _("Increase to make the pen waver and wiggle"),
0.0, 1.0, 0.01, 0.1,
}
{
/* Mass */
gchar const* labels[] = {_("(no inertia)"), _("(slight smoothing, default)"), _("(noticeable lagging)"), 0, 0, _("(maximum inertia)")};
_("Mass:"), _("Increase to make the pen drag behind, as if slowed by inertia"),
0.0, 1.0, 0.01, 0.1,
}
/* Trace Background button */
{
_("Trace Background"),
_("Trace the lightness of the background by the width of the pen (white - minimum width, black - maximum width)"),
"trace_background",
g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(sp_ddc_trace_background_changed), NULL);
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs_get_int_attribute( "tools.calligraphic", "tracebackground", 0 ) );
}
/* Use Pressure button */
{
_("Pressure"),
_("Use the pressure of the input device to alter the width of the pen"),
"use_pressure",
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs_get_int_attribute( "tools.calligraphic", "usepressure", 1 ) );
}
/* Use Tilt button */
{
_("Tilt"),
_("Use the tilt of the input device to alter the angle of the pen's nib"),
"use_tilt",
g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(sp_ddc_tilt_state_changed), calligraphy_angle );
gtk_action_set_sensitive( GTK_ACTION(calligraphy_angle), !prefs_get_int_attribute( "tools.calligraphic", "usetilt", 1 ) );
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs_get_int_attribute( "tools.calligraphic", "usetilt", 1 ) );
}
/* Reset */
{
_("Defaults"),
_("Reset shape parameters to defaults (use Inkscape Preferences > Tools to change defaults)"),
}
}
gtk_table_attach( GTK_TABLE(holder), toolBar, 0, 1, 0, 1, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0 );
Inkscape::UI::Widget::StyleSwatch *swatch = new Inkscape::UI::Widget::StyleSwatch(NULL, _("Style of new calligraphic strokes"));
gtk_table_attach( GTK_TABLE(holder), swatch_, 1, 2, 0, 1, (GtkAttachOptions)(GTK_SHRINK | GTK_FILL), (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), AUX_BETWEEN_BUTTON_GROUPS, 0 );
//sp_set_font_size_smaller (tbl);
return holder;
}
//########################
//## 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))
);
Inkscape::UI::Widget::StyleSwatch *swatch = new Inkscape::UI::Widget::StyleSwatch(NULL, _("Style of new ellipses"));
return tbl;
}
// toggle button callbacks and updaters
//########################
//## Dropper ##
//########################
if (set_checkbox) {
} else {
}
}
}
}
/**
* 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);
{
gtk_tooltips_set_tip(tt, button, _("Pick both the color and the alpha (transparency) under cursor; otherwise, pick only the visible color premultiplied by alpha"), NULL);
prefs_get_int_attribute ("tools.dropper",
"pick", 1));
}
{
gtk_tooltips_set_tip(tt, button, _("If alpha was picked, assign it to selection as fill or stroke transparency"), NULL);
prefs_get_int_attribute ("tools.dropper",
"setalpha", 1));
// make sure it's disabled if we're not picking alpha
if (pick_checkbox) {
} else {
}
}
}
// 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
}*/
namespace {
bool visible = false;
void
{
sp_style_new ();
int result_family =
int result_style =
int result_numbers =
// If querying returned nothing, read the style from the text tool prefs (default style for new texts)
if (result_family == QUERY_STYLE_NOTHING || result_style == QUERY_STYLE_NOTHING || result_numbers == QUERY_STYLE_NOTHING)
{
if (repr)
{
}
else
{
return;
}
}
{
if (result_family == QUERY_STYLE_MULTIPLE_DIFFERENT) {
try {
} catch (...) {
return;
}
GtkTreeSelection *tselection = GTK_TREE_SELECTION (g_object_get_data (G_OBJECT(tbl), "family-tree-selection"));
}
//Size
//Anchor
{
}
else
{
{
}
{
}
{
}
}
//Style
{
{
}
}
{
{
}
}
//Orientation
//locking both buttons, changing one affect all group (both)
{
}
else
{
}
}
}
void
{
}
void
{
}
void
{
GtkTreeModel *model = 0;
char *family = 0;
return;
}
{
return;
}
visible = false;
sp_style_new ();
int result_numbers =
// If querying returned nothing, read the style from the text tool prefs (default style for new texts)
if (result_numbers == QUERY_STYLE_NOTHING)
{
sp_text_edit_dialog_default_set_insensitive (); //FIXME: Replace trough a verb
}
else
{
}
_("Text: Change font family"));
}
void
{
try {
GtkTreeSelection *selection = GTK_TREE_SELECTION (g_object_get_data (G_OBJECT(tbl), "family-tree-selection"));
} catch (...) {
{
}
}
}
void
{
switch (prop)
{
case 0:
{
break;
}
case 1:
{
break;
}
case 2:
{
break;
}
case 3:
{
break;
}
}
sp_style_new ();
int result_numbers =
// If querying returned nothing, read the style from the text tool prefs (default style for new texts)
if (result_numbers == QUERY_STYLE_NOTHING)
{
}
_("Text: Change alignment"));
}
void
{
switch (prop)
{
case 0:
{
break;
}
case 1:
{
break;
}
}
sp_style_new ();
int result_numbers =
// If querying returned nothing, read the style from the text tool prefs (default style for new texts)
if (result_numbers == QUERY_STYLE_NOTHING)
{
}
_("Text: Change font style"));
}
void
{
return;
}
switch (prop)
{
case 0:
{
break;
}
case 1:
{
break;
}
}
sp_style_new ();
int result_numbers =
// If querying returned nothing, read the style from the text tool prefs (default style for new texts)
if (result_numbers == QUERY_STYLE_NOTHING)
{
}
_("Text: Change orientation"));
}
{
switch (get_group0_keyval (event)) {
case GDK_Escape: // defocus
return TRUE; // I consumed the event
break;
case GDK_Return: // defocus
case GDK_KP_Enter:
return TRUE; // I consumed the event
break;
}
return FALSE;
}
{
switch (get_group0_keyval (event)) {
case GDK_Escape: // defocus
return TRUE; // I consumed the event
break;
}
return FALSE;
}
{
switch (get_group0_keyval (event)) {
case GDK_Escape: // defocus
gtk_widget_hide (w);
visible = false;
return TRUE; // I consumed the event
break;
}
return FALSE;
}
void
{
#else // GTK_CHECK_VERSION(2,6,0)
#endif // GTK_CHECK_VERSION(2,6,0)
sp_style_new ();
int result_numbers =
// If querying returned nothing, read the style from the text tool prefs (default style for new texts)
if (result_numbers == QUERY_STYLE_NOTHING)
{
}
_("Text: Change font size"));
if (gtk_combo_box_get_active (cbox) > 0) // if this was from drop-down (as opposed to type-in), defocus
}
void
{
int x, y;
if (!visible)
{
visible = true;
}
else
{
visible = false;
}
}
{
return FALSE;
}
{
visible = false;
return TRUE;
}
void
{
char *family,
static const char *sample = _("AaBbCcIiPpQq12369$\342\202\254\302\242?.;/()");
markup << family_escaped << " <span foreground='darkgray' font_family='" << family_escaped << "'>" << sample_escaped << "</span>";
}
if (completion) {
}
}
{
////////////Family
//Window
//Entry
//Button
//Popdown
gtk_tree_view_column_set_cell_data_func (column, cell, GtkTreeCellDataFunc (cell_data_func), NULL, NULL);
#endif // GTK_CHECK_VERSION(2,6,0)
//gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview), TRUE);
g_signal_connect (G_OBJECT (entry), "activate", G_CALLBACK (sp_text_toolbox_family_entry_activate), tbl);
g_signal_connect (G_OBJECT (entry), "focus-in-event", G_CALLBACK (sp_text_toolbox_entry_focus_in), tbl);
g_signal_connect (G_OBJECT (entry), "key-press-event", G_CALLBACK(sp_text_toolbox_family_keypress), tbl);
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (sp_text_toolbox_text_popdown_clicked), tbl);
g_signal_connect (G_OBJECT (window), "focus-out-event", G_CALLBACK (sp_text_toolbox_popdown_focus_out), tbl);
g_signal_connect (G_OBJECT (window), "key-press-event", G_CALLBACK(sp_text_toolbox_family_list_keypress), tbl);
g_signal_connect (G_OBJECT (tselection), "changed", G_CALLBACK (sp_text_toolbox_family_changed), tbl);
GtkWidget *image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_SMALL_TOOLBAR);
gtk_tooltips_set_tip (tooltips, box, _("This font is currently not installed on your system. Inkscape will use the default font instead."), "");
////////////Size
const char *sizes[] = {
"4", "6", "8", "9", "10", "11", "12", "13", "14",
"16", "18", "20", "22", "24", "28",
"32", "36", "40", "48", "56", "64", "72", "144"
};
for (unsigned int n = 0; n < G_N_ELEMENTS (sizes); gtk_combo_box_append_text (GTK_COMBO_BOX(cbox), sizes[n++]));
gtk_signal_connect(GTK_OBJECT(cbox), "key-press-event", GTK_SIGNAL_FUNC(sp_text_toolbox_size_keypress), NULL);
//spacer
////////////Text anchor
// left
gtk_container_add (GTK_CONTAINER (rbutton), gtk_image_new_from_stock (GTK_STOCK_JUSTIFY_LEFT, GTK_ICON_SIZE_SMALL_TOOLBAR));
g_signal_connect (G_OBJECT (rbutton), "toggled", G_CALLBACK (sp_text_toolbox_anchoring_toggled), gpointer(0));
// center
gtk_container_add (GTK_CONTAINER (rbutton), gtk_image_new_from_stock (GTK_STOCK_JUSTIFY_CENTER, GTK_ICON_SIZE_SMALL_TOOLBAR));
g_signal_connect (G_OBJECT (rbutton), "toggled", G_CALLBACK (sp_text_toolbox_anchoring_toggled), gpointer (1));
// right
gtk_container_add (GTK_CONTAINER (rbutton), gtk_image_new_from_stock (GTK_STOCK_JUSTIFY_RIGHT, GTK_ICON_SIZE_SMALL_TOOLBAR));
g_signal_connect (G_OBJECT (rbutton), "toggled", G_CALLBACK (sp_text_toolbox_anchoring_toggled), gpointer(2));
// fill
gtk_container_add (GTK_CONTAINER (rbutton), gtk_image_new_from_stock (GTK_STOCK_JUSTIFY_FILL, GTK_ICON_SIZE_SMALL_TOOLBAR));
g_signal_connect (G_OBJECT (rbutton), "toggled", G_CALLBACK (sp_text_toolbox_anchoring_toggled), gpointer(3));
//spacer
////////////Text style
// bold
rbutton = gtk_toggle_button_new ();
gtk_container_add (GTK_CONTAINER (rbutton), gtk_image_new_from_stock (GTK_STOCK_BOLD, GTK_ICON_SIZE_SMALL_TOOLBAR));
g_signal_connect (G_OBJECT (rbutton), "toggled", G_CALLBACK (sp_text_toolbox_style_toggled), gpointer(0));
// italic
rbutton = gtk_toggle_button_new ();
gtk_container_add (GTK_CONTAINER (rbutton), gtk_image_new_from_stock (GTK_STOCK_ITALIC, GTK_ICON_SIZE_SMALL_TOOLBAR));
g_signal_connect (G_OBJECT (rbutton), "toggled", G_CALLBACK (sp_text_toolbox_style_toggled), gpointer (1));
//spacer
////////////Text orientation
// horizontal
gtk_container_add (GTK_CONTAINER (rbutton), sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_STOCK_WRITING_MODE_LR));
g_signal_connect (G_OBJECT (rbutton), "toggled", G_CALLBACK (sp_text_toolbox_orientation_toggled), gpointer(0));
// vertical
gtk_container_add (GTK_CONTAINER (rbutton), sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_STOCK_WRITING_MODE_TB));
g_signal_connect (G_OBJECT (rbutton), "toggled", G_CALLBACK (sp_text_toolbox_orientation_toggled), gpointer (1));
//watch selection
#if 0
// horizontal
{
}
// vertical
{
}
// letter spacing
{
{
GtkWidget *image = sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_STOCK_TEXT_LETTER_SPACING);
}
{
-1000.0, 1000.0, 0.1, 0.1,
}
}
// line spacing
{
{
GtkWidget *image = sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_STOCK_TEXT_LINE_SPACING);
}
{
"tools.text", "line_spacing", 0,
-1000.0, 1000.0, 0.1, 0.1,
}
}
{
// horizontal kerning
{
{
}
{
"tools.text", "horizontal_kerning", 0,
-100.00, 100.00, 0.01, 0.1,
}
}
// vertical kerning
{
{
}
{
"tools.text", "vertical_kerning", 0,
-100.00, 100.00, 0.01, 0.1,
}
}
// add the units menu
}
// letter rotation
{
{
}
{
"tools.text", "letter_rotation", 0,
-180.0, 180.0, 0.1, 0.1,
}
// rotation degree label
{
}
}
// Remove Manual Kerns
{
}
#endif
return tbl;
} // end of sp_text_toolbox_new()
}//<unnamed> namespace
//#########################
//## 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) {
}
_("Change connector spacing"));
}
static void sp_connector_graph_layout(void)
{
if (!SP_ACTIVE_DESKTOP) return;
// hack for clones, see comment in align-and-distribute.cpp
int saved_compensation = prefs_get_int_attribute("options.clonecompensation", "value", SP_CLONE_COMPENSATION_UNMOVED);
sp_document_done(sp_desktop_document(SP_ACTIVE_DESKTOP), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, _("Arrange connector network"));
}
static void
{
"true");
} else {
"false");
}
}
static void
{
"true");
} else {
"false");
}
}
{
}
{
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);
}
// Graph (connector network) layout
tt, _("Nicely arrange selected connector network"));
// Default connector length spinbox
{
_("Ideal length for connectors when layout is applied"),
"inkscape:connector-length", 10, 1000, 10.0, 100.0,
connector_length_changed, 1, 0);
}
gchar const *tbuttonstate;
// Directed edges toggle button
{
gtk_container_add (GTK_CONTAINER (tbutton), sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, "directed_graph"));
gtk_tooltips_set_tip(tt, tbutton, _("Make connectors with end-markers (arrows) point downwards"), NULL);
g_signal_connect(G_OBJECT(tbutton), "toggled", GTK_SIGNAL_FUNC(sp_directed_graph_layout_toggled), tbl);
}
// Avoid overlaps toggle button
{
gtk_container_add (GTK_CONTAINER (tbutton), sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, "remove_overlaps"));
g_signal_connect(G_OBJECT(tbutton), "toggled", GTK_SIGNAL_FUNC(sp_nooverlaps_graph_layout_toggled), tbl);
}
// 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()
{
}
{
}
{
UnitTracker* tracker = reinterpret_cast<UnitTracker*>(gtk_object_get_data(GTK_OBJECT(tbl), "tracker"));
prefs_set_double_attribute("tools.paintbucket", "offset", (gdouble)sp_units_get_pixels(adj->value, *unit));
}
static GtkWidget *
{
"<ui>"
" <toolbar name='PaintbucketToolbar'>"
" <toolitem action='ChannelsAction' />"
" <separator />"
" <toolitem action='ThresholdAction' />"
" <separator />"
" <toolitem action='OffsetAction' />"
" </toolbar>"
"</ui>";
EgeAdjustmentAction* eact = 0;
{
{
count++;
}
g_list_free( items );
items = 0;
EgeSelectOneAction* act1 = ege_select_one_action_new( "ChannelsAction", _("Fill by:"), _(""), NULL, GTK_TREE_MODEL(model) );
ege_select_one_action_set_active( act1, prefs_get_int_attribute("tools.paintbucket", "channels", 0) );
}
// Spacing spinbox
{
"ThresholdAction",
_("Threshold:"),
_("The maximum allowed difference between the clicked pixel and the neighboring pixels to be counted in the fill"),
"inkscape:paintbucket-threshold", 0, 100.0, 1.0, 10.0,
0, 0, 0,
paintbucket_threshold_changed, 1, 0 );
}
// Create the units menu.
{
}
// Offset spinbox
{
"OffsetAction",
_("The amount to grow (positive) or shrink (negative) the created fill path"),
"inkscape:paintbucket-offset", -1e6, 1e6, 0.1, 0.5,
0, 0, 0,
}
Inkscape::UI::Widget::StyleSwatch *swatch = new Inkscape::UI::Widget::StyleSwatch(NULL, _("Style of Paint Bucket fill objects"));
return holder;
}
/*
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 :