spray-toolbar.cpp revision 694d8555c0639ca02269603e99b46c0ff49b1753
/**
* @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 "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/dialog/panel-dialog.h"
#include "ui/icon-names.h"
// 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") );
} else {
}
} else {
}
} else {
}
}
}
{
dynamic_cast<Inkscape::UI::Dialog::PanelDialogBase *>(desktop->_dlg_mgr->getDialog("CloneTiler"))) {
try {
return &clone_tiler;
}
return 0;
}
{
}
{
}
{
}
{
if(mode != 3){
sp_spray_erase_sensitivize(tbl, true);
} else {
sp_spray_erase_sensitivize(tbl, false);
}
}
{
}
{
}
{
}
{
}
{
}
{
if(active == true){
}
}
{
}
{
}
{
if(active == true){
ct->show_page_trace();
}
}
}
{
}
{
}
{
}
{
}
{
}
{
{
/* 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 */
{
GtkListStore* model = gtk_list_store_new( 4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING );
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
0, _("Delete sprayed items"),
1, _("Delete sprayed items from selection"),
-1 );
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 color from the drawing. You can use clonetiler trace dialog for advanced effects. In clone mode original fill or stroke colors must be unset."),
_("Pick color from the drawing. You can use clonetiler trace dialog for advanced effects. In clone mode original fill or stroke colors must be unset."),
INKSCAPE_ICON("color-picker"),
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/spray/picker", false) );
}
/* Pick from center */
{
_("Pick from center instead average area."),
_("Pick from center instead average area."),
INKSCAPE_ICON("snap-bounding-box-center"),
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/spray/pick_center", true) );
}
/* Inverse Value Size */
{
_("Inverted pick value, retaining color in advanced trace mode"),
_("Inverted pick value, retaining color in advanced trace mode"),
INKSCAPE_ICON("object-tweak-shrink"),
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/spray/pick_inverse_value", false) );
g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(sp_toggle_pick_inverse_value), holder) ;
}
/* Pick Fill */
{
_("Apply picked color to fill"),
_("Apply picked color to fill"),
INKSCAPE_ICON("paint-solid"),
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/spray/pick_fill", false) );
}
/* Pick Stroke */
{
_("Apply picked color to stroke"),
_("Apply picked color to stroke"),
INKSCAPE_ICON("no-marker"),
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/spray/pick_stroke", false) );
}
/* Pick No Overlap */
{
_("No overlap between colors"),
_("No overlap between colors"),
INKSCAPE_ICON("symbol-bigger"),
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/spray/pick_no_overlap", false) );
}
/* Over Transparent */
{
_("Apply over transparent areas"),
_("Apply over transparent areas"),
INKSCAPE_ICON("object-hidden"),
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/spray/over_transparent", true) );
}
/* Over No Transparent */
{
_("Apply over no transparent areas"),
_("Apply over no transparent areas"),
INKSCAPE_ICON("object-visible"),
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/spray/over_no_transparent", true) );
g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(sp_toggle_over_no_transparent), holder) ;
}
/* Overlap */
{
_("Prevent overlapping objects"),
_("Prevent overlapping objects"),
INKSCAPE_ICON("distribute-randomize"),
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/spray/no_overlap", false) );
}
/* Offset */
{
gchar const* labels[] = {_("(minimum offset)"), 0, 0, 0, _("(default)"), 0, 0, _("(maximum offset)")};
_("Offset %"), _("Offset %:"),
_("Increase to segregate objects more (value in percent)"),
0, 1000, 1, 4,
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 :