spray-toolbar.cpp revision 00a9f91d969b90976bbcb4a6c20ee980430a0216
/**
* @file
* Spray 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>
* Jabiertxo Arraiza <jabier.arraiza@marker.es>
*
* Copyright (C) 2004 David Turner
* Copyright (C) 2003 MenTaLguY
* Copyright (C) 1999-2015 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 "spray-toolbar.h"
#include "desktop.h"
#include "inkscape.h"
#include "document-undo.h"
#include "widgets/ege-adjustment-action.h"
#include "widgets/ege-select-one-action.h"
#include "widgets/ink-action.h"
#include "preferences.h"
#include "toolbox.h"
#include "ui/dialog/clonetiler.h"
#include "ui/dialog/dialog-manager.h"
#include "ui/icon-names.h"
using Inkscape::DocumentUndo;
// Disabled in 0.91 because of Bug #1274831 (crash, spraying an object
// with the mode: spray object in single path)
// Please enable again when working on 1.0
#define ENABLE_SPRAY_MODE_SINGLE_PATH
//########################
//## Spray ##
//########################
{
GtkAdjustment *adj_scale = ege_adjustment_action_get_adjustment( EGE_ADJUSTMENT_ACTION(spray_scale) );
GtkToggleAction *usepressurescale = GTK_TOGGLE_ACTION( g_object_get_data(tbl, "usepressurescale") );
if (gtk_toggle_action_get_active(overlap)) {
} else {
}
} else {
}
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
if(active == true){
}
}
{
if(active == true){
gtk_toggle_action_set_active(picker, false);
}
}
{
if(active == true){
gtk_toggle_action_set_active(visible, false);
}
}
{
{
/* Width */
gchar const* labels[] = {_("(narrow spray)"), 0, 0, 0, _("(default)"), 0, 0, 0, 0, _("(broad spray)")};
_("Width"), _("Width:"), _("The width of the spray area (relative to the visible canvas area)"),
1, 100, 1.0, 10.0,
}
/* Use Pressure Width button */
{
_("Pressure"),
_("Use the pressure of the input device to alter the width of spray area"),
INKSCAPE_ICON("draw-use-pressure"),
}
{
/* Mean */
_("Focus"), _("Focus:"), _("0 to spray a spot; increase to enlarge the ring radius"),
0, 100, 1.0, 10.0,
}
{
/* Standard_deviation */
gchar const* labels[] = {_("(minimum scatter)"), 0, 0, 0, 0, 0, _("(default)"), _("(maximum scatter)")};
C_("Spray tool", "Scatter"), C_("Spray tool", "Scatter:"), _("Increase to scatter sprayed objects"),
"/tools/spray/standard_deviation", 70,
1, 100, 1.0, 10.0,
}
/* Mode */
{
0, _("Spray with copies"),
1, _("Spray copies of the initial selection"),
-1 );
0, _("Spray with clones"),
1, _("Spray clones of the initial selection"),
-1 );
0, _("Spray single path"),
1, _("Spray objects in a single path"),
-1 );
#endif
EgeSelectOneAction* act = ege_select_one_action_new( "SprayModeAction", _("Mode"), (""), NULL, GTK_TREE_MODEL(model) );
}
{ /* Population */
gchar const* labels[] = {_("(low population)"), 0, 0, 0, _("(default)"), 0, _("(high population)")};
_("Amount"), _("Amount:"),
_("Adjusts the number of items sprayed per click"),
"/tools/spray/population", 70,
1, 100, 1.0, 10.0,
}
/* Use Pressure Population button */
{
_("Pressure"),
_("Use the pressure of the input device to alter the amount of sprayed objects"),
INKSCAPE_ICON("draw-use-pressure"),
}
{ /* Rotation */
_("Rotation"), _("Rotation:"),
// xgettext:no-c-format
_("Variation of the rotation of the sprayed objects; 0% for the same rotation than the original object"),
"/tools/spray/rotation_variation", 0,
0, 100, 1.0, 10.0,
}
{ /* Scale */
// xgettext:no-c-format
_("Variation in the scale of the sprayed objects; 0% for the same scale than the original object"),
"/tools/spray/scale_variation", 0,
0, 100, 1.0, 10.0,
}
/* Use Pressure Scale button */
{
_("Pressure"),
_("Use the pressure of the input device to alter the scale of new items"),
INKSCAPE_ICON("draw-use-pressure"),
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/spray/usepressurescale", false) );
}
/* Picker */
{
_("Pick down color. Fill must be unset on original when spraying clones"),
_("Pick down color. Fill must be unset on original when spraying clones"),
INKSCAPE_ICON("color-picker"),
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/spray/picker", false) );
}
/* Visible */
{
_("Apply on non transparent areas"),
_("Apply on non transparent areas"),
INKSCAPE_ICON("object-visible"),
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/spray/visible", false) );
}
/* Overlap */
{
_("Prevent overlapping objects"),
_("Prevent overlapping objects"),
INKSCAPE_ICON("distribute-randomize"),
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/spray/overlap", false) );
//g_object_set_data (context_object, "holder", holder);
//g_object_set_data (context_object, "desktop", desktop);
}
/* Offset */
{
_("Offset precent"), _("Offset percent:"),
_("Increase to segregate objects more (value in percent)"),
0, 10000, 1, 4,
0, 0, 0,
sp_spray_offset_value_changed, NULL, 0 , 0);
}
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :