star-toolbar.cpp revision c652591f8105502bfed1dcd3d7207681932a7515
/**
* @file
* Star aux toolbar
*/
/* 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>
* Maximilian Albert <maximilian.albert@gmail.com>
* Tavmjong Bah <tavmjong@free.fr>
* Abhishek Sharma
* Kris De Gussem <Kris.DeGussem@gmail.com>
*
* Copyright (C) 2004 David Turner
* Copyright (C) 2003 MenTaLguY
* Copyright (C) 1999-2011 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 "star-toolbar.h"
#include "desktop.h"
#include "document-undo.h"
#include "widgets/ege-adjustment-action.h"
#include "widgets/ege-output-action.h"
#include "widgets/ege-select-one-action.h"
#include "widgets/ink-action.h"
#include "selection.h"
#include "sp-star.h"
#include "toolbox.h"
#include "ui/icon-names.h"
#include "ui/tools/star-tool.h"
#include "ui/uxmanager.h"
#include "verbs.h"
#include "widgets/../preferences.h"
#include "xml/node-event-vector.h"
using Inkscape::DocumentUndo;
//########################
//## 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;
if (SP_IS_STAR(item)) {
double arg1 = 0.5;
item->updateRepr();
modmade = true;
}
}
if (modmade) {
_("Star: Change number of corners"));
}
}
{
}
}
// quit if run by the attr_changed listener
return;
}
// in turn, prevent listener from responding
bool modmade = false;
if (SP_IS_STAR(item)) {
} else {
}
item->updateRepr();
modmade = true;
}
}
if (modmade) {
_("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 ) {
}
if (SP_IS_STAR(item)) {
item->updateRepr();
modmade = true;
}
}
if (modmade) {
}
}
{
}
// quit if run by the attr_changed listener
return;
}
// in turn, prevent listener from responding
bool modmade = false;
if (SP_IS_STAR(item)) {
item->updateRepr();
modmade = true;
}
}
if (modmade) {
_("Star: Change rounding"));
}
}
{
}
// quit if run by the attr_changed listener
return;
}
// in turn, prevent listener from responding
bool modmade = false;
if (SP_IS_STAR(item)) {
item->updateRepr();
modmade = true;
}
}
if (modmade) {
_("Star: Change randomization"));
}
}
{
// quit if run by the _changed callbacks
return;
}
// in turn, prevent callbacks from responding
GtkAdjustment *adj = 0;
double randomized = 0.0;
double rounded = 0.0;
EgeSelectOneAction* flat_action = EGE_SELECT_ONE_ACTION( g_object_get_data( G_OBJECT(tbl), "flat_action" ) );
} else {
}
} else {
}
int sides = 0;
}
}
{
NULL, /* child_added */
NULL, /* child_removed */
NULL, /* content_changed */
NULL /* order_changed */
};
/**
* \param selection Should not be NULL.
*/
static void
{
int n_selected = 0;
if (SP_IS_STAR(item)) {
n_selected++;
}
}
if (n_selected == 0) {
} else if (n_selected == 1) {
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( dataKludge, "flat_action" ) );
}
static void star_toolbox_watch_ec(SPDesktop* dt, Inkscape::UI::Tools::ToolBase* ec, GObject* holder);
{
{
}
{
EgeAdjustmentAction* eact = 0;
/* Flatsided checkbox */
{
0, _("Polygon"),
1, _("Regular polygon (with one handle) instead of a star"),
-1 );
0, _("Star"),
1, _("Star instead of a regular polygon (with one handle)"),
-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[] = {_("triangle/tri-star"), _("square/quad-star"), _("pentagon/five-pointed star"), _("hexagon/six-pointed star"), 0, 0, 0, 0, 0};
_("Corners"), _("Corners:"), _("Number of corners of a polygon or star"),
3, 1024, 1, 5,
1.0, 0 );
}
/* Spoke ratio */
{
gchar const* labels[] = {_("thin-ray star"), 0, _("pentagram"), _("hexagram"), _("heptagram"), _("octagram"), _("regular polygon")};
_("Spoke ratio"), _("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"),
"/tools/shapes/star/proportion", 0.5,
0.01, 1.0, 0.01, 0.1,
}
if ( !isFlatSided ) {
} else {
}
/* Roundedness */
{
gchar const* labels[] = {_("stretched"), _("twisted"), _("slightly pinched"), _("NOT rounded"), _("slightly rounded"), _("visibly rounded"), _("well rounded"), _("amply rounded"), 0, _("stretched"), _("blown up")};
_("Rounded"), _("Rounded:"), _("How much rounded are the corners (0 for sharp)"),
-10.0, 10.0, 0.01, 0.1,
}
/* Randomization */
{
gchar const* labels[] = {_("NOT randomized"), _("slightly irregular"), _("visibly randomized"), _("strongly randomized"), _("blown up")};
_("Randomized"), _("Randomized:"), _("Scatter randomly the corners and angles"),
"/tools/shapes/star/randomized", 0.0,
-10.0, 10.0, 0.001, 0.01,
}
}
{
/* Reset */
{
_("Defaults"),
_("Reset shape parameters to defaults (use Inkscape Preferences > Tools to change defaults)"),
INKSCAPE_ICON("edit-clear"),
}
}
}
static void star_toolbox_watch_ec(SPDesktop* desktop, Inkscape::UI::Tools::ToolBase* ec, GObject* holder)
{
changed = desktop->getSelection()->connectChanged(sigc::bind(sigc::ptr_fun(sp_star_toolbox_selection_changed), holder));
} else {
if (changed)
}
}
/*
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 :