summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2009-12-21 16:37:12 +0000
committerTed Gould <ted@gould.cx>2009-12-21 16:37:12 +0000
commit752a8f90d3442cdaa4689ba6de4b911ca4fda514 (patch)
tree5e0739ec9bd2ac9cbdd2a2343859f89e02dae181 /src/ui
parentMerging in from trunk (diff)
parentUpdating the READMEs to better handle OSX. (diff)
downloadinkscape-752a8f90d3442cdaa4689ba6de4b911ca4fda514.tar.gz
inkscape-752a8f90d3442cdaa4689ba6de4b911ca4fda514.zip
Updating to current trunk
(bzr r8254.1.38)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/dialog/Makefile_insert4
-rw-r--r--src/ui/dialog/align-and-distribute.cpp2
-rw-r--r--src/ui/dialog/dialog-manager.cpp9
-rw-r--r--src/ui/dialog/document-properties.cpp3
-rw-r--r--src/ui/dialog/filter-effects-dialog.cpp2
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp22
-rw-r--r--src/ui/dialog/inkscape-preferences.h4
-rw-r--r--src/ui/dialog/print-colors-preview-dialog.cpp100
-rw-r--r--src/ui/dialog/print-colors-preview-dialog.h48
-rw-r--r--src/ui/dialog/print.cpp14
-rw-r--r--src/ui/dialog/spray-option.cpp397
-rw-r--r--src/ui/dialog/spray-option.h145
-rw-r--r--src/ui/dialog/svg-fonts-dialog.cpp2
-rw-r--r--src/ui/dialog/svg-fonts-dialog.h2
-rw-r--r--src/ui/dialog/swatches.cpp2
-rw-r--r--src/ui/icon-names.h18
-rw-r--r--src/ui/view/edit-widget.cpp6
-rw-r--r--src/ui/view/edit-widget.h1
-rw-r--r--src/ui/widget/page-sizer.cpp20
-rw-r--r--src/ui/widget/spin-slider.cpp2
20 files changed, 785 insertions, 18 deletions
diff --git a/src/ui/dialog/Makefile_insert b/src/ui/dialog/Makefile_insert
index 565a24ecc..fac5bad80 100644
--- a/src/ui/dialog/Makefile_insert
+++ b/src/ui/dialog/Makefile_insert
@@ -71,8 +71,12 @@ ink_common_sources += \
ui/dialog/panel-dialog.h \
ui/dialog/print.cpp \
ui/dialog/print.h \
+ ui/dialog/print-colors-preview-dialog.cpp \
+ ui/dialog/print-colors-preview-dialog.h \
ui/dialog/scriptdialog.cpp \
ui/dialog/scriptdialog.h \
+ ui/dialog/spray-option.cpp \
+ ui/dialog/spray-option.h \
ui/dialog/svg-fonts-dialog.cpp \
ui/dialog/svg-fonts-dialog.h \
ui/dialog/swatches.cpp \
diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp
index a54f83758..024d4b2f1 100644
--- a/src/ui/dialog/align-and-distribute.cpp
+++ b/src/ui/dialog/align-and-distribute.cpp
@@ -807,7 +807,7 @@ AlignAndDistribute::AlignAndDistribute()
_("Align left edges"),
0, 1);
addAlignButton(INKSCAPE_ICON_ALIGN_HORIZONTAL_CENTER,
- _("Center objects horizontally"),
+ _("Center on vertical axis"),
0, 2);
addAlignButton(INKSCAPE_ICON_ALIGN_HORIZONTAL_RIGHT,
_("Align right sides"),
diff --git a/src/ui/dialog/dialog-manager.cpp b/src/ui/dialog/dialog-manager.cpp
index d1b818d23..2116d46c3 100644
--- a/src/ui/dialog/dialog-manager.cpp
+++ b/src/ui/dialog/dialog-manager.cpp
@@ -40,6 +40,8 @@
#include "ui/dialog/icon-preview.h"
#include "ui/dialog/floating-behavior.h"
#include "ui/dialog/dock-behavior.h"
+#include "ui/dialog/spray-option.h"
+#include "ui/dialog/print-colors-preview-dialog.h"
#include "preferences.h"
#ifdef ENABLE_SVG_FONTS
@@ -88,7 +90,6 @@ DialogManager::DialogManager() {
int dialogs_type = prefs->getIntLimited("/options/dialogtype/value", DOCK, 0, 1);
if (dialogs_type == FLOATING) {
-
registerFactory("AlignAndDistribute", &create<AlignAndDistribute, FloatingBehavior>);
registerFactory("DocumentMetadata", &create<DocumentMetadata, FloatingBehavior>);
registerFactory("DocumentProperties", &create<DocumentProperties, FloatingBehavior>);
@@ -102,6 +103,7 @@ DialogManager::DialogManager() {
registerFactory("LivePathEffect", &create<LivePathEffectEditor, FloatingBehavior>);
registerFactory("Memory", &create<Memory, FloatingBehavior>);
registerFactory("Messages", &create<Messages, FloatingBehavior>);
+ registerFactory("PrintColorsPreviewDialog", &create<PrintColorsPreviewDialog, FloatingBehavior>);
registerFactory("Script", &create<ScriptDialog, FloatingBehavior>);
#ifdef ENABLE_SVG_FONTS
registerFactory("SvgFontsDialog", &create<SvgFontsDialog, FloatingBehavior>);
@@ -111,7 +113,8 @@ DialogManager::DialogManager() {
registerFactory("Trace", &create<TraceDialog, FloatingBehavior>);
registerFactory("Transformation", &create<Transformation, FloatingBehavior>);
registerFactory("UndoHistory", &create<UndoHistory, FloatingBehavior>);
- registerFactory("InputDevices", &create<InputDialog, FloatingBehavior>);
+ registerFactory("InputDevices", &create<InputDialog, FloatingBehavior>);
+ registerFactory("SprayOptionClass", &create<SprayOptionClass, FloatingBehavior>);
} else {
@@ -128,6 +131,7 @@ DialogManager::DialogManager() {
registerFactory("LivePathEffect", &create<LivePathEffectEditor, DockBehavior>);
registerFactory("Memory", &create<Memory, DockBehavior>);
registerFactory("Messages", &create<Messages, DockBehavior>);
+ registerFactory("PrintColorsPreviewDialog", &create<PrintColorsPreviewDialog, DockBehavior>);
registerFactory("Script", &create<ScriptDialog, DockBehavior>);
#ifdef ENABLE_SVG_FONTS
registerFactory("SvgFontsDialog", &create<SvgFontsDialog, DockBehavior>);
@@ -138,6 +142,7 @@ DialogManager::DialogManager() {
registerFactory("Transformation", &create<Transformation, DockBehavior>);
registerFactory("UndoHistory", &create<UndoHistory, DockBehavior>);
registerFactory("InputDevices", &create<InputDialog, DockBehavior>);
+ registerFactory("SprayOptionClass", &create<SprayOptionClass, DockBehavior>);
}
}
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp
index 7e31b874a..982fb3415 100644
--- a/src/ui/dialog/document-properties.cpp
+++ b/src/ui/dialog/document-properties.cpp
@@ -414,7 +414,8 @@ static void sanitizeName( Glib::ustring& str )
}
}
-void DocumentProperties::linkSelectedProfile()
+void
+DocumentProperties::linkSelectedProfile()
{
//store this profile in the SVG document (create <color-profile> element in the XML)
// TODO remove use of 'active' desktop
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp
index c7f505046..1345ffe55 100644
--- a/src/ui/dialog/filter-effects-dialog.cpp
+++ b/src/ui/dialog/filter-effects-dialog.cpp
@@ -4,7 +4,7 @@
/* Authors:
* Nicholas Bishop <nicholasbishop@gmail.org>
* Rodrigo Kumpera <kumpera@gmail.com>
- * Felipe C. da S. Sanches <felipe.sanches@gmail.com>
+ * Felipe C. da S. Sanches <juca@members.fsf.org>
*
* Copyright (C) 2007 Authors
*
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index c7dc789ca..90516063c 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -449,6 +449,12 @@ void InkscapePreferences::initPageTools()
AddSelcueCheckbox(_page_tweak, "/tools/tweak", true);
AddGradientCheckbox(_page_tweak, "/tools/tweak", false);
+ //Spray
+ this->AddPage(_page_spray, _("Spray"), iter_tools, PREFS_PAGE_TOOLS_SPRAY);
+ this->AddNewObjectsStyle(_page_spray, "/tools/spray", _("Paint objects with:"));
+ AddSelcueCheckbox(_page_spray, "/tools/spray", true);
+ AddGradientCheckbox(_page_spray, "/tools/spray", false);
+
//Zoom
this->AddPage(_page_zoom, _("Zoom"), iter_tools, PREFS_PAGE_TOOLS_ZOOM);
AddSelcueCheckbox(_page_zoom, "/tools/zoom", true);
@@ -470,15 +476,15 @@ void InkscapePreferences::initPageTools()
this->AddNewObjectsStyle(_page_3dbox, "/tools/shapes/3dbox");
this->AddConvertGuidesCheckbox(_page_3dbox, "/tools/shapes/3dbox", true);
- //ellipse
+ //Ellipse
this->AddPage(_page_ellipse, _("Ellipse"), iter_shapes, PREFS_PAGE_TOOLS_SHAPES_ELLIPSE);
this->AddNewObjectsStyle(_page_ellipse, "/tools/shapes/arc");
- //star
+ //Star
this->AddPage(_page_star, _("Star"), iter_shapes, PREFS_PAGE_TOOLS_SHAPES_STAR);
this->AddNewObjectsStyle(_page_star, "/tools/shapes/star");
- //spiral
+ //Spiral
this->AddPage(_page_spiral, _("Spiral"), iter_shapes, PREFS_PAGE_TOOLS_SHAPES_SPIRAL);
this->AddNewObjectsStyle(_page_spiral, "/tools/shapes/spiral");
@@ -522,6 +528,11 @@ void InkscapePreferences::initPageTools()
this->AddPage(_page_text, _("Text"), iter_tools, PREFS_PAGE_TOOLS_TEXT);
this->AddSelcueCheckbox(_page_text, "/tools/text", true);
this->AddGradientCheckbox(_page_text, "/tools/text", true);
+ {
+ PrefCheckButton* cb = Gtk::manage( new PrefCheckButton);
+ cb->init ( _("Show font samples in the drop-down list"), "/tools/text/show_sample_in_list", 1);
+ _page_text.add_line( false, "", *cb, "", _("Show font samples alongside font names in the drop-down list in Text bar"));
+ }
this->AddNewObjectsStyle(_page_text, "/tools/text");
//Gradient
@@ -730,6 +741,11 @@ void InkscapePreferences::initPageFilters()
_page_filters.add_line(true, "", _show_filters_info_box, "",
_("Show icons and descriptions for the filter primitives available at the filter effects dialog."));
+ /* threaded blur */ //related comments/widgets/functions should be renamed and option should be moved elsewhere when inkscape is fully multi-threaded
+ _filter_multi_threaded.init("/options/threading/numthreads", 1.0, 8.0, 1.0, 2.0, 4.0, true, false);
+ _page_filters.add_line( false, _("Number of Threads:"), _filter_multi_threaded, _("(requires restart)"),
+ _("Configure number of processors/threads to use with rendering of gaussian blur."), false);
+
this->AddPage(_page_filters, _("Filters"), PREFS_PAGE_FILTERS);
}
diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h
index 364b0eb1d..16e62df59 100644
--- a/src/ui/dialog/inkscape-preferences.h
+++ b/src/ui/dialog/inkscape-preferences.h
@@ -43,6 +43,7 @@ enum {
PREFS_PAGE_TOOLS_SELECTOR,
PREFS_PAGE_TOOLS_NODE,
PREFS_PAGE_TOOLS_TWEAK,
+ PREFS_PAGE_TOOLS_SPRAY,
PREFS_PAGE_TOOLS_ZOOM,
PREFS_PAGE_TOOLS_SHAPES,
PREFS_PAGE_TOOLS_SHAPES_RECT,
@@ -118,7 +119,7 @@ protected:
_page_clones, _page_mask, _page_transforms, _page_filters, _page_select,
_page_importexport, _page_cms, _page_grids, _page_svgoutput, _page_misc,
_page_ui, _page_save, _page_bitmaps, _page_spellcheck;
- DialogPage _page_selector, _page_node, _page_tweak, _page_zoom, _page_shapes, _page_pencil, _page_pen,
+ DialogPage _page_selector, _page_node, _page_tweak, _page_spray, _page_zoom, _page_shapes, _page_pencil, _page_pen,
_page_calligraphy, _page_text, _page_gradient, _page_connector, _page_dropper, _page_lpetool;
DialogPage _page_rectangle, _page_3dbox, _page_ellipse, _page_star, _page_spiral, _page_paintbucket, _page_eraser;
@@ -170,6 +171,7 @@ protected:
PrefRadioButton _blur_quality_best, _blur_quality_better, _blur_quality_normal, _blur_quality_worse, _blur_quality_worst;
PrefRadioButton _filter_quality_best, _filter_quality_better, _filter_quality_normal, _filter_quality_worse, _filter_quality_worst;
PrefCheckButton _show_filters_info_box;
+ PrefSpinButton _filter_multi_threaded;
PrefCheckButton _trans_scale_stroke, _trans_scale_corner, _trans_gradient,_trans_pattern;
PrefRadioButton _trans_optimized, _trans_preserved;
diff --git a/src/ui/dialog/print-colors-preview-dialog.cpp b/src/ui/dialog/print-colors-preview-dialog.cpp
new file mode 100644
index 000000000..f4d83c271
--- /dev/null
+++ b/src/ui/dialog/print-colors-preview-dialog.cpp
@@ -0,0 +1,100 @@
+/** @file
+ * @brief Print Colors Preview dialog - implementation
+ */
+/* Authors:
+ * Felipe C. da S. Sanches <juca@members.fsf.org>
+ *
+ * Copyright (C) 2009 Authors
+ * Released under GNU GPLv2 (or later). Read the file 'COPYING' for more information.
+ */
+
+#include "desktop.h"
+#include "print-colors-preview-dialog.h"
+#include "preferences.h"
+#include <glibmm/i18n.h>
+
+namespace Inkscape {
+namespace UI {
+namespace Dialog {
+
+//Yes, I know we shouldn't hardcode CMYK. This class needs to be refactored
+// in order to accomodate spot colors and color components defined using
+// ICC colors. --Juca
+
+void PrintColorsPreviewDialog::toggle_cyan(){
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ prefs->setBool("/options/printcolorspreview/cyan", cyan->get_active());
+
+ SPDesktop *desktop = getDesktop();
+ desktop->setDisplayModePrintColorsPreview();
+}
+
+void PrintColorsPreviewDialog::toggle_magenta(){
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ prefs->setBool("/options/printcolorspreview/magenta", magenta->get_active());
+
+ SPDesktop *desktop = getDesktop();
+ desktop->setDisplayModePrintColorsPreview();
+}
+
+void PrintColorsPreviewDialog::toggle_yellow(){
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ prefs->setBool("/options/printcolorspreview/yellow", yellow->get_active());
+
+ SPDesktop *desktop = getDesktop();
+ desktop->setDisplayModePrintColorsPreview();
+}
+
+void PrintColorsPreviewDialog::toggle_black(){
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ prefs->setBool("/options/printcolorspreview/black", black->get_active());
+
+ SPDesktop *desktop = getDesktop();
+ desktop->setDisplayModePrintColorsPreview();
+}
+
+PrintColorsPreviewDialog::PrintColorsPreviewDialog()
+ : UI::Widget::Panel("", "/dialogs/printcolorspreview", SP_VERB_DIALOG_PRINT_COLORS_PREVIEW)
+{
+ Gtk::VBox* vbox = Gtk::manage(new Gtk::VBox());
+
+ cyan = new Gtk::ToggleButton(_("Cyan"));
+ vbox->pack_start( *cyan, false, false );
+// tips.set_tip((*cyan), _("Render cyan separation"));
+ cyan->signal_clicked().connect( sigc::mem_fun(*this, &PrintColorsPreviewDialog::toggle_cyan) );
+
+ magenta = new Gtk::ToggleButton(_("Magenta"));
+ vbox->pack_start( *magenta, false, false );
+// tips.set_tip((*magenta), _("Render magenta separation"));
+ magenta->signal_clicked().connect( sigc::mem_fun(*this, &PrintColorsPreviewDialog::toggle_magenta) );
+
+ yellow = new Gtk::ToggleButton(_("Yellow"));
+ vbox->pack_start( *yellow, false, false );
+// tips.set_tip((*yellow), _("Render yellow separation"));
+ yellow->signal_clicked().connect( sigc::mem_fun(*this, &PrintColorsPreviewDialog::toggle_yellow) );
+
+ black = new Gtk::ToggleButton(_("Black"));
+ vbox->pack_start( *black, false, false );
+// tips.set_tip((*black), _("Render black separation"));
+ black->signal_clicked().connect( sigc::mem_fun(*this, &PrintColorsPreviewDialog::toggle_black) );
+
+ gint val;
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ val = prefs->getBool("/options/printcolorspreview/cyan");
+ cyan->set_active( val != 0 );
+ val = prefs->getBool("/options/printcolorspreview/magenta");
+ magenta->set_active( val != 0 );
+ val = prefs->getBool("/options/printcolorspreview/yellow");
+ yellow->set_active( val != 0 );
+ val = prefs->getBool("/options/printcolorspreview/black");
+ black->set_active( val != 0 );
+
+ _getContents()->add(*vbox);
+ _getContents()->show_all();
+}
+
+PrintColorsPreviewDialog::~PrintColorsPreviewDialog(){}
+
+} // namespace Dialog
+} // namespace UI
+} // namespace Inkscape
diff --git a/src/ui/dialog/print-colors-preview-dialog.h b/src/ui/dialog/print-colors-preview-dialog.h
new file mode 100644
index 000000000..246908556
--- /dev/null
+++ b/src/ui/dialog/print-colors-preview-dialog.h
@@ -0,0 +1,48 @@
+/** @file
+ * @brief Print Colors Preview dialog
+ */
+/* Authors:
+ * Felipe Corrêa da Silva Sanches <juca@members.fsf.org>
+ *
+ * Copyright (C) 2009 Authors
+ * Released under GNU GPLv2 (or later). Read the file 'COPYING' for more information.
+ */
+
+#ifndef INKSCAPE_UI_DIALOG_PRINT_COLORS_PREVIEW_H
+#define INKSCAPE_UI_DIALOG_PRINT_COLORS_PREVIEW_H
+
+#include "ui/widget/panel.h"
+#include "verbs.h"
+
+#include <gtkmm.h>
+#include <gtkmm/box.h>
+
+namespace Inkscape {
+namespace UI {
+namespace Dialog {
+
+class PrintColorsPreviewDialog : public UI::Widget::Panel {
+public:
+ PrintColorsPreviewDialog();
+ ~PrintColorsPreviewDialog();
+
+ static PrintColorsPreviewDialog &getInstance()
+ { return *new PrintColorsPreviewDialog(); }
+
+private:
+ void toggle_cyan();
+ void toggle_magenta();
+ void toggle_yellow();
+ void toggle_black();
+
+ Gtk::ToggleButton* cyan;
+ Gtk::ToggleButton* magenta;
+ Gtk::ToggleButton* yellow;
+ Gtk::ToggleButton* black;
+};
+
+} // namespace Dialog
+} // namespace UI
+} // namespace Inkscape
+
+#endif //#ifndef INKSCAPE_UI_PRINT_COLORS_PREVIEW_H
diff --git a/src/ui/dialog/print.cpp b/src/ui/dialog/print.cpp
index f9db265d6..60cab06a2 100644
--- a/src/ui/dialog/print.cpp
+++ b/src/ui/dialog/print.cpp
@@ -31,11 +31,15 @@
-static void
-draw_page (GtkPrintOperation *operation,
- GtkPrintContext *context,
- gint /*page_nr*/,
- gpointer user_data)
+static void draw_page(
+#ifdef WIN32
+ GtkPrintOperation *operation,
+#else
+ GtkPrintOperation *,
+#endif
+ GtkPrintContext *context,
+ gint /*page_nr*/,
+ gpointer user_data)
{
struct workaround_gtkmm *junk = (struct workaround_gtkmm*)user_data;
//printf("%s %d\n",__FUNCTION__, page_nr);
diff --git a/src/ui/dialog/spray-option.cpp b/src/ui/dialog/spray-option.cpp
new file mode 100644
index 000000000..a9e037381
--- /dev/null
+++ b/src/ui/dialog/spray-option.cpp
@@ -0,0 +1,397 @@
+/*Julien LERAY (julien.leray@ecl2010.ec-lyon.fr), interface for the spray tool*/
+
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <gtkmm/spinbutton.h>
+
+#include "desktop-handles.h"
+#include "unclump.h"
+#include "document.h"
+#include "enums.h"
+#include "graphlayout/graphlayout.h"
+#include "inkscape.h"
+#include "macros.h"
+#include "node-context.h"
+#include "preferences.h"
+#include "removeoverlap/removeoverlap.h"
+#include "selection.h"
+#include "shape-editor.h"
+#include "sp-flowtext.h"
+#include "sp-item-transform.h"
+#include "sp-text.h"
+#include "text-editing.h"
+#include "tools-switch.h"
+#include "ui/icon-names.h"
+#include "util/glib-list-iterators.h"
+#include "verbs.h"
+#include "widgets/icon.h"
+
+#include "spray-option.h"
+
+namespace Inkscape {
+namespace UI {
+namespace Dialog {
+
+
+//Classes qui permettent de créer les environnements Gaussienne, Witdh...
+
+
+
+class Action {
+public:
+ Action(const Glib::ustring &id,
+ const Glib::ustring &/*tiptext*/,
+ guint /*row*/,
+ guint /*column*/,
+ Gtk::Table &parent,
+ Gtk::Tooltips &/*tooltips*/,
+ SprayOptionClass &dialog):
+ _dialog(dialog),
+ _id(id),
+ _parent(parent) {}
+
+ virtual ~Action(){}
+ virtual void on_button_click(){}
+ SprayOptionClass &_dialog;
+
+private :
+
+ Glib::ustring _id;
+ Gtk::Table &_parent;
+};
+
+class ActionE : public Action {
+private:
+ Gtk::Label _Label;
+ Gtk::SpinButton _Gap;
+ guint _min, _max;
+ Glib::ustring _pref_path;
+
+public:
+ ActionE(const Glib::ustring &id,
+ const Glib::ustring &tiptext,
+ guint row, guint column,
+ SprayOptionClass &dialog,
+ guint min, guint max,
+ Glib::ustring const &pref_path ):
+ Action(id, tiptext, row, column,
+ dialog._Table(), dialog.tooltips(), dialog),
+ _min(min),
+ _max(max),
+ _pref_path(pref_path)
+ {
+ dialog._Table().set_col_spacings(3);
+
+ double increm = ((double)_max - (double)_min)/10;
+ double val_ini = ((double)_max + (double)_min)/2;
+ _Gap.set_digits(1);
+ _Gap.set_size_request(60, -1);
+ _Gap.set_increments(increm , 0);
+ _Gap.set_range(_min, _max);
+ _Gap.set_value(val_ini);
+ dialog.tooltips().set_tip(_Gap,
+ tiptext);
+ _Gap.signal_changed().connect(sigc::mem_fun(*this, &ActionE::on_button_click)); //rajout douteux
+ _Label.set_label(id);
+
+ dialog._Table().attach(_Label, column, column+1, row, row+1, Gtk::FILL, Gtk::FILL);
+ dialog._Table().attach(_Gap, column+1, column+2, row, row+1, Gtk::EXPAND, Gtk::EXPAND);
+ }
+
+ virtual void on_button_click(){
+ if (!_dialog.getDesktop()) return;
+
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+
+ prefs->setDouble(_pref_path, SP_VERB_CONTEXT_SPRAY);
+
+ double const Gap = _Gap.get_value();
+
+
+ prefs->setDouble(_pref_path, Gap);
+
+ sp_document_done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_CONTEXT_SPRAY,
+ _("Remove overlaps"));
+ }
+
+
+};
+
+class ActionF : public Action {
+private:
+ Gtk::Label _Label;
+ Gtk::Label _Label1;
+ Gtk::Label _Label2;
+ Gtk::SpinButton _Gap1;
+ Gtk::SpinButton _Gap2;
+ Glib::ustring _pref1_path;
+ Glib::ustring _pref2_path;
+
+public:
+ ActionF(const Glib::ustring &id,
+ const Glib::ustring &tiptext,
+ guint row, guint column,
+ SprayOptionClass &dialog,
+ Glib::ustring const &pref1_path,
+ Glib::ustring const &pref2_path ):
+ Action(id, tiptext, row, column,
+ dialog._Table(), dialog.tooltips(), dialog),
+ _pref1_path(pref1_path),
+ _pref2_path(pref2_path)
+ {
+ dialog.F_Table().set_col_spacings(3);
+
+ _Label.set_label(id);
+
+ _Gap1.set_digits(1);
+ _Gap1.set_size_request(60, -1);
+ _Gap1.set_increments(0.1, 0);
+ _Gap1.set_range(0, 10);
+ _Gap1.set_value(1);
+ dialog.tooltips().set_tip(_Gap1,
+ _("Minimum"));
+
+ _Label1.set_label(Q_("Min"));
+
+ _Gap2.set_digits(1);
+ _Gap2.set_size_request(60, -1);
+ _Gap2.set_increments(0.1, 0);
+ _Gap2.set_range(0, 10);
+ _Gap2.set_value(1);
+ dialog.tooltips().set_tip(_Gap2,
+ _("Maximum"));
+
+ _Label2.set_label(_("Max:"));
+
+ _Gap1.signal_changed().connect(sigc::mem_fun(*this, &ActionF::on_button_click));
+ _Gap2.signal_changed().connect(sigc::mem_fun(*this, &ActionF::on_button_click));
+
+ dialog.F_Table().attach(_Label, column, column+1, row, row+1, Gtk::FILL, Gtk::FILL);
+ dialog.F_Table().attach(_Label1, column+1, column+2, row, row+1, Gtk::FILL, Gtk::FILL);
+ dialog.F_Table().attach(_Gap1, column+2, column+3, row, row+1, Gtk::EXPAND, Gtk::EXPAND);
+ dialog.F_Table().attach(_Label2, column+3, column+4, row, row+1, Gtk::FILL, Gtk::FILL);
+ dialog.F_Table().attach(_Gap2, column+4, column+5, row, row+1, Gtk::EXPAND, Gtk::EXPAND);
+
+ }
+
+ virtual void on_button_click(){
+ if (!_dialog.getDesktop()) return;
+
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+
+ prefs->setDouble(_pref1_path, SP_VERB_CONTEXT_SPRAY);
+ prefs->setDouble(_pref2_path, SP_VERB_CONTEXT_SPRAY);
+
+ double const Gap1 = _Gap1.get_value();
+ double const Gap2 = _Gap2.get_value();
+
+ prefs->setDouble(_pref1_path, Gap1);
+ prefs->setDouble(_pref2_path, Gap2);
+
+ sp_document_done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_CONTEXT_SPRAY,
+ _("Remove overlaps"));
+ }
+
+
+};
+
+
+
+void SprayOptionClass::combo_action() {
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ cout<<"combo.get_active_row_number = "<<_combo.get_active_row_number()<<endl;
+
+ int const distrib = _combo.get_active_row_number();
+
+ prefs->setInt("/tools/spray/distribution", distrib);
+
+
+ sp_document_done(sp_desktop_document(this->getDesktop()), SP_VERB_CONTEXT_SPRAY,
+ _("Remove overlaps"));
+
+}
+
+
+
+
+void SprayOptionClass::action() {
+ for (list<Action *>::iterator it = _actionList.begin(); it != _actionList.end(); ++it) {
+ (*it)->on_button_click();
+ }
+ combo_action();
+}
+
+
+
+
+
+
+void on_selection_changed(Inkscape::Application */*inkscape*/, Inkscape::Selection */*selection*/, SprayOptionClass *daad)
+{
+ daad->randomize_bbox = Geom::OptRect();
+}
+
+/////////////////////////////////////////////////////////
+//Construction de l'interface
+/////////////////////////////////////////////////////////
+
+
+SprayOptionClass::SprayOptionClass()
+ : UI::Widget::Panel ("", "/dialogs/spray", SP_VERB_DIALOG_SPRAY_OPTION),
+ _actionList(),
+ _distributionFrame(Q_("sprayOptions|Distribution")),
+ _Frame(Q_("sprayOptions|Cursor Options")),
+ _FFrame(Q_("sprayOptions|Random Options")),
+ _distributionTable(),
+ _gaussianTable(1, 5, false),
+ _ETable(3,2,false),
+ _FTable(2,5,false),
+ _anchorBox(),
+ _unifBox(),
+ _gaussianBox(),
+ _HBox(),
+ _FHBox(),
+ _BoutonBox(),
+ _distributionBox(),
+ _VBox(),
+ _FVBox(),
+ _ActionBox(),
+ _anchorLabel(Q_("sprayOptions|Distribution:")),
+ _unifLabel(Q_("sprayOptions|Uniform")),
+ _gaussLabel(Q_("sprayOptions|Gaussian")),
+ _Label(),
+ _FLabel(),
+ _unif(),
+ _gauss(),
+ _combo(),
+ _tooltips()
+{
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+
+ //ComboBoxText
+
+ _combo.append_text(Q_("sprayOptions|Uniform"));
+ _combo.append_text(Q_("sprayOptions|Gaussian"));
+
+ _combo.set_active(prefs->getInt("/tools/spray/distribution", 1));
+ _combo.signal_changed().connect(sigc::mem_fun(*this, &SprayOptionClass::combo_action));
+
+ _anchorBox.pack_start(_anchorLabel);
+ _anchorBox.pack_start(_combo);
+
+ _gaussianBox.pack_start(_anchorBox);
+
+
+ _distributionBox.pack_start(_gaussianBox);
+ _distributionFrame.add(_distributionBox);
+
+
+ //Hbox Random
+ addFButton(Q_("sprayOptions|Scale:") ,_("Apply a scale factor"), 0, 0, "/tools/spray/scale_min","/tools/spray/scale_max");
+ addFButton(Q_("sprayOptions|Rotation:") ,_("Apply rotation"), 1, 0, "/tools/spray/rot_min","/tools/spray/rot_max");
+ _FHBox.pack_start(_FLabel);
+ _FHBox.pack_start(_FTable);
+
+ //Implementation dans la Vbox Cursor
+ _FVBox.pack_start(_FHBox);
+ _FFrame.add(_FVBox);
+
+ //Hbox Cursor
+ addEButton(Q_("sprayOptions|Ratio:") ,_("Eccentricity of the ellipse"), 0, 0, 0, 1,"/tools/spray/ratio");
+ addEButton(Q_("sprayOptions|Angle:") ,_("Angle of the ellipse"), 1, 0, 0, 5,"/tools/spray/tilt");
+ addEButton(Q_("sprayOptions|Width:") ,_("Size of the ellipse"), 2, 0, 0, 1,"/tools/spray/width");
+ _HBox.pack_start(_Label);
+ _HBox.pack_start(_ETable);
+
+ //Implementation dans la Vbox Cursor
+ _VBox.pack_start(_HBox);
+ _Frame.add(_VBox);
+
+ Gtk::Box *contents = _getContents();
+ contents->set_spacing(4);
+
+
+
+
+
+
+ // Crée dans l'ordre suivant les différentes Frames (cadres de réglages)
+
+ contents->pack_start(_distributionFrame, true, true);
+ contents->pack_start(_FFrame, true, true);
+ contents->pack_start(_Frame, true, true);
+
+
+
+ // Connect to the global selection change, to invalidate cached randomize_bbox
+ g_signal_connect (G_OBJECT (INKSCAPE), "change_selection", G_CALLBACK (on_selection_changed), this);
+ randomize_bbox = Geom::OptRect();
+
+ show_all_children();
+
+
+
+}
+
+SprayOptionClass::~SprayOptionClass()
+{
+ sp_signal_disconnect_by_data (G_OBJECT (INKSCAPE), this);
+
+ for (std::list<Action *>::iterator it = _actionList.begin();
+ it != _actionList.end();
+ it ++)
+ delete *it;
+}
+
+
+
+
+
+
+
+//Fonctions qui lient la demande d'ajout d'une interface graphique à l'action correspondante
+
+void SprayOptionClass::addEButton(const Glib::ustring &id,
+ const Glib::ustring &tiptext,
+ guint row, guint column,
+ guint min, guint max,
+ Glib::ustring const &pref_path)
+{
+ _actionList.push_back( new ActionE(id, tiptext,row, column,*this,min ,max, pref_path ));
+}
+
+void SprayOptionClass::addFButton(const Glib::ustring &id,
+ const Glib::ustring &tiptext,
+ guint row, guint column,
+ Glib::ustring const &pref1_path,
+ Glib::ustring const &pref2_path)
+{
+ _actionList.push_back( new ActionF(id, tiptext,row, column,*this,pref1_path, pref2_path ));
+}
+
+
+
+
+
+SprayOptionClass &SprayOptionClass::get_SprayOptionClass()
+{
+ return *this;
+}
+
+} // namespace Dialog
+} // namespace UI
+} // namespace Inkscape
+
+/*
+ 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 :
diff --git a/src/ui/dialog/spray-option.h b/src/ui/dialog/spray-option.h
new file mode 100644
index 000000000..42090a120
--- /dev/null
+++ b/src/ui/dialog/spray-option.h
@@ -0,0 +1,145 @@
+
+/*Julien LERAY (julien.leray@ecl2010.ec-lyon.fr), interface for the spray tool*/
+
+#ifndef INKSCAPE_UI_DIALOG_SPRAY_OPTION_H
+#define INKSCAPE_UI_DIALOG_SPRAY_OPTION_H
+
+#include <gtkmm/notebook.h>
+#include <glibmm/i18n.h>
+
+#include <list>
+#include <gtkmm/frame.h>
+#include <gtkmm/tooltips.h>
+#include <gtkmm/comboboxtext.h>
+#include <gtkmm/table.h>
+#include <gtkmm/buttonbox.h>
+#include <gtkmm/label.h>
+#include "libnr/nr-dim2.h"
+#include "libnr/nr-rect.h"
+
+
+#include "ui/widget/panel.h"
+#include "ui/widget/notebook-page.h"
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <gtkmm/spinbutton.h>
+#include "desktop-handles.h"
+#include "unclump.h"
+#include "document.h"
+#include "enums.h"
+#include "graphlayout/graphlayout.h"
+#include "inkscape.h"
+#include "macros.h"
+#include "node-context.h"
+#include "preferences.h"
+#include "removeoverlap/removeoverlap.h"
+#include "selection.h"
+#include "shape-editor.h"
+#include "sp-flowtext.h"
+#include "sp-item-transform.h"
+#include "sp-text.h"
+#include "text-editing.h"
+#include "tools-switch.h"
+#include "ui/icon-names.h"
+#include "util/glib-list-iterators.h"
+#include "verbs.h"
+#include "widgets/icon.h"
+
+#include "spray-context.h"
+#include "verbs.h"
+
+#include <iostream>
+using namespace std;
+
+using namespace Inkscape::UI::Widget;
+
+class SPItem;
+
+
+namespace Inkscape {
+namespace UI {
+namespace Dialog {
+
+class Action;
+
+class SprayOptionClass : public Widget::Panel {
+
+private:
+
+ SprayOptionClass(SprayOptionClass const &d);
+ SprayOptionClass& operator=(SprayOptionClass const &d);
+
+public:
+ SprayOptionClass();
+ virtual ~SprayOptionClass();
+ void test() { cout<<"appel de test !!"<<endl; }
+ static SprayOptionClass &getInstance() { return *new SprayOptionClass(); }
+
+
+ Gtk::Table &_Table(){return _ETable;}
+ Gtk::Table &F_Table(){return _FTable;}
+ Gtk::Tooltips &tooltips(){return _tooltips;}
+ void action();
+ void combo_action();
+ Geom::OptRect randomize_bbox;
+
+ SprayOptionClass &get_SprayOptionClass();
+
+protected:
+
+ void addGaussianButton(guint row, guint col);
+ void addEButton(const Glib::ustring &id, const Glib::ustring &tiptext, guint row, guint column,
+ guint min, guint max, const Glib::ustring &pref_path);
+ void addFButton(const Glib::ustring &id, const Glib::ustring &tiptext, guint row, guint column,
+ const Glib::ustring &pref1_path, const Glib::ustring &pref2_path);
+
+ std::list<Action *> _actionList;
+ Gtk::Frame _distributionFrame;
+ Gtk::Frame _Frame;
+ Gtk::Frame _FFrame;
+ Gtk::Table _distributionTable;
+ Gtk::Table _gaussianTable;
+ Gtk::Table _ETable;
+ Gtk::Table _FTable;
+ Gtk::HBox _anchorBox;
+ Gtk::HBox _unifBox;
+ Gtk::HBox _gaussianBox;
+ Gtk::HBox _HBox;
+ Gtk::HBox _FHBox;
+ Gtk::HBox _BoutonBox;
+ Gtk::VBox _distributionBox;
+ Gtk::VBox _VBox;
+ Gtk::VBox _FVBox;
+ Gtk::VBox _ActionBox;
+ Gtk::Label _anchorLabel;
+ Gtk::Label _unifLabel;
+ Gtk::Label _gaussLabel;
+ Gtk::Label _Label;
+ Gtk::Label _FLabel;
+ Gtk::CheckButton _unif;
+ Gtk::CheckButton _gauss;
+ Gtk::ComboBoxText _combo;
+ Gtk::Tooltips _tooltips;
+};
+
+
+} // namespace Dialog
+} // namespace UI
+} // namespace Inkscape
+
+#endif // INKSCAPE_UI_DIALOG_ALIGN_AND_DISTRIBUTE_H
+
+/*
+ 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 :
+
diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp
index 5f86196b1..cb22e029b 100644
--- a/src/ui/dialog/svg-fonts-dialog.cpp
+++ b/src/ui/dialog/svg-fonts-dialog.cpp
@@ -2,7 +2,7 @@
* @brief SVG Fonts dialog - implementation
*/
/* Authors:
- * Felipe C. da S. Sanches <felipe.sanches@gmail.com>
+ * Felipe C. da S. Sanches <juca@members.fsf.org>
*
* Copyright (C) 2008 Authors
* Released under GNU GPLv2 (or later). Read the file 'COPYING' for more information.
diff --git a/src/ui/dialog/svg-fonts-dialog.h b/src/ui/dialog/svg-fonts-dialog.h
index e6042ed42..e819187a1 100644
--- a/src/ui/dialog/svg-fonts-dialog.h
+++ b/src/ui/dialog/svg-fonts-dialog.h
@@ -2,7 +2,7 @@
* @brief SVG Fonts dialog
*/
/* Authors:
- * Felipe Corrêa da Silva Sanches <felipe.sanches@gmail.com>
+ * Felipe Corrêa da Silva Sanches <juca@members.fsf.org>
*
* Copyright (C) 2008 Authors
* Released under GNU GPLv2 (or later). Read the file 'COPYING' for more information.
diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp
index 1f708e3de..450d4202d 100644
--- a/src/ui/dialog/swatches.cpp
+++ b/src/ui/dialog/swatches.cpp
@@ -47,7 +47,7 @@
#include "display/nr-plain-stuff.h"
#include "sp-gradient-reference.h"
-//#define USE_DOCUMENT_PALETTE 1
+#define USE_DOCUMENT_PALETTE 1
namespace Inkscape {
namespace UI {
diff --git a/src/ui/icon-names.h b/src/ui/icon-names.h
index f9a6f2a7d..76e76ea34 100644
--- a/src/ui/icon-names.h
+++ b/src/ui/icon-names.h
@@ -56,10 +56,18 @@
"color-picker"
#define INKSCAPE_ICON_COLOR_REMOVE \
"color-remove"
+#define INKSCAPE_ICON_CONNECTOR_EDIT \
+ "connector-edit"
#define INKSCAPE_ICON_CONNECTOR_AVOID \
"connector-avoid"
#define INKSCAPE_ICON_CONNECTOR_IGNORE \
"connector-ignore"
+#define INKSCAPE_ICON_CONNECTOR_ORTHOGONAL \
+ "connector-orthogonal"
+#define INKSCAPE_ICON_CONNECTOR_NEW_CONNPOINT \
+ "connector-new-connpoint"
+#define INKSCAPE_ICON_CONNECTOR_REMOVE_CONNPOINT \
+ "connector-remove-connpoint"
#define INKSCAPE_ICON_DIALOG_ALIGN_AND_DISTRIBUTE \
"dialog-align-and-distribute"
#define INKSCAPE_ICON_DIALOG_FILL_AND_STROKE \
@@ -456,6 +464,14 @@
"snap-nodes-smooth"
#define INKSCAPE_ICON_SNAP_PAGE \
"snap-page"
+#define INKSCAPE_ICON_SPRAY_COPY_MODE \
+ "spray-copy-mode"
+#define INKSCAPE_ICON_SPRAY_CLONE_MODE \
+ "spray-clone-mode"
+#define INKSCAPE_ICON_SPRAY_UNION_MODE \
+ "spray-union-mode"
+#define INKSCAPE_ICON_DIALOG_SPRAY_OPTIONS \
+ "dialog-spray-options"
#define INKSCAPE_ICON_STROKE_CAP_BUTT \
"stroke-cap-butt"
#define INKSCAPE_ICON_STROKE_CAP_ROUND \
@@ -488,6 +504,8 @@
"tool-pointer"
#define INKSCAPE_ICON_TOOL_TWEAK \
"tool-tweak"
+#define INKSCAPE_ICON_TOOL_SPRAY \
+ "tool-spray"
#define INKSCAPE_ICON_TRANSFORM_AFFECT_GRADIENT \
"transform-affect-gradient"
#define INKSCAPE_ICON_TRANSFORM_AFFECT_PATTERN \
diff --git a/src/ui/view/edit-widget.cpp b/src/ui/view/edit-widget.cpp
index 770a9bf87..d34b18771 100644
--- a/src/ui/view/edit-widget.cpp
+++ b/src/ui/view/edit-widget.cpp
@@ -228,6 +228,12 @@ EditWidget::onDialogAlignAndDistribute()
}
void
+EditWidget::onDialogSprayOptionClass()
+{
+ _dlg_mgr.showDialog("SprayOptionClass");
+}
+
+void
EditWidget::onDialogDocumentProperties()
{
// manage (Inkscape::UI::Dialog::DocumentPreferences::create());
diff --git a/src/ui/view/edit-widget.h b/src/ui/view/edit-widget.h
index 2bb708305..452641e80 100644
--- a/src/ui/view/edit-widget.h
+++ b/src/ui/view/edit-widget.h
@@ -70,6 +70,7 @@ public:
void onDialogAbout();
void onDialogAlignAndDistribute();
+ void onDialogSprayOptionClass();
void onDialogInkscapePreferences();
void onDialogDialog();
void onDialogDocumentProperties();
diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp
index 02688a55e..68f26792a 100644
--- a/src/ui/widget/page-sizer.cpp
+++ b/src/ui/widget/page-sizer.cpp
@@ -188,6 +188,26 @@ static PaperSizeRec const inkscape_papers[] = {
{ "Business Card (US)", 2, 3.5, SP_UNIT_IN },
{ "Business Card (Europe)", 55, 85, SP_UNIT_MM },
{ "Business Card (Aus/NZ)", 55, 90, SP_UNIT_MM },
+
+ // Start Arch Series List
+
+
+ { "Arch A", 9, 12, SP_UNIT_IN }, // 229 x 305 mm
+ { "Arch B", 12, 18, SP_UNIT_IN }, // 305 x 457 mm
+ { "Arch C", 18, 24, SP_UNIT_IN }, // 457 x 610 mm
+ { "Arch D", 24, 36, SP_UNIT_IN }, // 610 x 914 mm
+ { "Arch E", 36, 48, SP_UNIT_IN }, // 914 x 1219 mm
+ { "Arch E1", 30, 42, SP_UNIT_IN }, // 762 x 1067 mm
+
+ /*
+ * The above list of Arch sizes were taken from the following site:
+ * http://en.wikipedia.org/wiki/Paper_size
+ * Further detail can be found at http://www.ansi.org
+ * Sizes are assumed to be arbitrary rounding to MM unless shown to be otherwise
+ * No conflicting information was found regarding sizes in MM
+ * September 2009 - DAK
+ */
+
{ NULL, 0, 0, SP_UNIT_PX },
};
diff --git a/src/ui/widget/spin-slider.cpp b/src/ui/widget/spin-slider.cpp
index b610c1ee6..e3e73a51f 100644
--- a/src/ui/widget/spin-slider.cpp
+++ b/src/ui/widget/spin-slider.cpp
@@ -3,7 +3,7 @@
*
* Author:
* Nicholas Bishop <nicholasbishop@gmail.com>
- * Felipe C. da S. Sanches <felipe.sanches@gmail.com>
+ * Felipe C. da S. Sanches <juca@members.fsf.org>
*
* Copyright (C) 2007 Author
*