Index: src/tools-switch.cpp
===================================================================
--- src/tools-switch.cpp	(revision 21247)
+++ src/tools-switch.cpp	(working copy)
@@ -28,6 +28,7 @@
 #include "select-context.h"
 #include "node-context.h"
 #include "tweak-context.h"
+#include "spray-context.h"
 #include "sp-path.h"
 #include "rect-context.h"
 #include "sp-rect.h"
@@ -62,6 +63,7 @@
     "/tools/select",
     "/tools/nodes",
     "/tools/tweak",
+    "/tools/spray",
     "/tools/shapes/rect",
     "/tools/shapes/3dbox",
     "/tools/shapes/arc",
@@ -135,6 +137,12 @@
             inkscape_eventcontext_set(sp_desktop_event_context(dt));
             dt->tipsMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("To tweak a path by pushing, select it and drag over it."));
             break;
+        case TOOLS_SPRAY:
+            dt->set_event_context(SP_TYPE_SPRAY_CONTEXT, tool_names[num]);
+            dt->activate_guides(true);
+            inkscape_eventcontext_set(sp_desktop_event_context(dt));
+            dt->tipsMessageContext()->set(Inkscape::NORMAL_MESSAGE, _("To spray a path by pushing, select it and drag over it."));
+            break;
         case TOOLS_SHAPES_RECT:
             dt->set_event_context(SP_TYPE_RECT_CONTEXT, tool_names[num]);
             dt->activate_guides(false);
Index: src/preferences-skeleton.h
===================================================================
--- src/preferences-skeleton.h	(revision 21247)
+++ src/preferences-skeleton.h	(working copy)
@@ -109,6 +109,7 @@
 "                  style=\"fill:black;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;font-style:normal;font-weight:normal;font-size:40px;\" selcue=\"1\"/>\n"
 "    <eventcontext id=\"nodes\" selcue=\"1\" gradientdrag=\"1\" highlight_color=\"4278190335\" pathflash_enabled=\"1\" pathflash_unselected=\"0\" pathflash_timeout=\"500\" show_handles=\"1\" show_helperpath=\"0\" sculpting_profile=\"1\" />\n"
 "    <eventcontext id=\"tweak\" selcue=\"0\" gradientdrag=\"0\" show_handles=\"0\" width=\"0.2\" force=\"0.2\" fidelity=\"0.5\" usepressure=\"1\" style=\"fill:red;stroke:none;\" usecurrent=\"0\"/>\n"
+"    <eventcontext id=\"spray\" selcue=\"0\" gradientdrag=\"0\" show_handles=\"0\" width=\"0.2\" force=\"0.2\" fidelity=\"0.5\" usepressure=\"1\" style=\"fill:red;stroke:none;\" usecurrent=\"0\"/>\n"
 "    <eventcontext id=\"gradient\" selcue=\"1\"/>\n"
 "    <eventcontext id=\"zoom\" selcue=\"1\" gradientdrag=\"0\"/>\n"
 "    <eventcontext id=\"dropper\" selcue=\"1\" gradientdrag=\"1\" pick=\"1\" setalpha=\"1\"/>\n"
Index: src/verbs.cpp
===================================================================
--- src/verbs.cpp	(revision 21247)
+++ src/verbs.cpp	(working copy)
@@ -1464,6 +1464,9 @@
         case SP_VERB_CONTEXT_TWEAK:
             tools_switch(dt, TOOLS_TWEAK);
             break;
+        case SP_VERB_CONTEXT_SPRAY:
+            tools_switch(dt, TOOLS_SPRAY);
+            break;
         case SP_VERB_CONTEXT_RECT:
             tools_switch(dt, TOOLS_SHAPES_RECT);
             break;
@@ -1525,6 +1528,10 @@
             prefs->setInt("/dialogs/preferences/page", PREFS_PAGE_TOOLS_TWEAK);
             dt->_dlg_mgr->showDialog("InkscapePreferences");
             break;
+        case SP_VERB_CONTEXT_SPRAY_PREFS:
+            prefs->setInt("/dialogs/preferences/page", PREFS_PAGE_TOOLS_SPRAY);
+            dt->_dlg_mgr->showDialog("InkscapePreferences");
+            break;
         case SP_VERB_CONTEXT_RECT_PREFS:
             prefs->setInt("/dialogs/preferences/page", PREFS_PAGE_TOOLS_SHAPES_RECT);
             dt->_dlg_mgr->showDialog("InkscapePreferences");
@@ -1797,6 +1804,9 @@
         case SP_VERB_DIALOG_ALIGN_DISTRIBUTE:
             dt->_dlg_mgr->showDialog("AlignAndDistribute");
             break;
+        case SP_VERB_DIALOG_SPRAY_OPTION:
+            dt->_dlg_mgr->showDialog("SprayOptionClass");
+            break;
         case SP_VERB_DIALOG_TEXT:
             sp_text_edit_dialog();
             break;
@@ -2503,6 +2513,8 @@
                     N_("Edit paths by nodes"), INKSCAPE_ICON_TOOL_NODE_EDITOR),
     new ContextVerb(SP_VERB_CONTEXT_TWEAK, "ToolTweak", N_("Tweak"),
                     N_("Tweak objects by sculpting or painting"), INKSCAPE_ICON_TOOL_TWEAK),
+    new ContextVerb(SP_VERB_CONTEXT_SPRAY, "ToolSpray", N_("Spray"),
+                    N_("Spray objects by sculpting or painting"), INKSCAPE_ICON_TOOL_SPRAY), 
     new ContextVerb(SP_VERB_CONTEXT_RECT, "ToolRect", N_("Rectangle"),
                     N_("Create rectangles and squares"), INKSCAPE_ICON_DRAW_RECTANGLE),
     new ContextVerb(SP_VERB_CONTEXT_3DBOX, "Tool3DBox", N_("3D Box"),
@@ -2544,6 +2556,8 @@
                     N_("Open Preferences for the Node tool"), NULL),
     new ContextVerb(SP_VERB_CONTEXT_TWEAK_PREFS, "TweakPrefs", N_("Tweak Tool Preferences"),
                     N_("Open Preferences for the Tweak tool"), NULL),
+new ContextVerb(SP_VERB_CONTEXT_SPRAY_PREFS, "SprayPrefs", N_("Spray Tool Preferences"),
+                    N_("Open Preferences for the Spray tool"), NULL),
     new ContextVerb(SP_VERB_CONTEXT_RECT_PREFS, "RectPrefs", N_("Rectangle Preferences"),
                     N_("Open Preferences for the Rectangle tool"), NULL),
     new ContextVerb(SP_VERB_CONTEXT_3DBOX_PREFS, "3DBoxPrefs", N_("3D Box Preferences"),
@@ -2645,6 +2659,8 @@
                    N_("Precisely control objects' transformations"), INKSCAPE_ICON_DIALOG_TRANSFORM),
     new DialogVerb(SP_VERB_DIALOG_ALIGN_DISTRIBUTE, "DialogAlignDistribute", N_("_Align and Distribute..."),
                    N_("Align and distribute objects"), INKSCAPE_ICON_DIALOG_ALIGN_AND_DISTRIBUTE),
+    new DialogVerb(SP_VERB_DIALOG_SPRAY_OPTION, "DialogSprayOption", N_("_Spray options..."),
+                   N_("Some options for the spray"), INKSCAPE_ICON_DIALOG_ALIGN_AND_DISTRIBUTE),
     new DialogVerb(SP_VERB_DIALOG_UNDO_HISTORY, "DialogUndoHistory", N_("Undo _History..."),
                    N_("Undo History"), INKSCAPE_ICON_EDIT_UNDO_HISTORY),
     new DialogVerb(SP_VERB_DIALOG_TEXT, "DialogText", N_("_Text and Font..."),
Index: src/widgets/toolbox.cpp
===================================================================
--- src/widgets/toolbox.cpp	(revision 21247)
+++ src/widgets/toolbox.cpp	(working copy)
@@ -86,6 +86,7 @@
 #include "../svg/css-ostringstream.h"
 #include "../tools-switch.h"
 #include "../tweak-context.h"
+#include "../spray-context.h"
 #include "../ui/dialog/calligraphic-profile-rename.h"
 #include "../ui/icon-names.h"
 #include "../ui/widget/style-swatch.h"
@@ -107,6 +108,7 @@
 
 static void       sp_node_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder);
 static void       sp_tweak_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder);
+static void       sp_spray_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder);
 static void       sp_zoom_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder);
 static void       sp_star_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder);
 static void       sp_arc_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder);
@@ -146,6 +148,7 @@
     { "SPSelectContext",   "select_tool",    SP_VERB_CONTEXT_SELECT,  SP_VERB_CONTEXT_SELECT_PREFS},
     { "SPNodeContext",     "node_tool",      SP_VERB_CONTEXT_NODE, SP_VERB_CONTEXT_NODE_PREFS },
     { "SPTweakContext",    "tweak_tool",     SP_VERB_CONTEXT_TWEAK, SP_VERB_CONTEXT_TWEAK_PREFS },
+   { "SPSprayContext",    "spray_tool",     SP_VERB_CONTEXT_SPRAY, SP_VERB_CONTEXT_SPRAY_PREFS },
     { "SPZoomContext",     "zoom_tool",      SP_VERB_CONTEXT_ZOOM, SP_VERB_CONTEXT_ZOOM_PREFS },
     { "SPRectContext",     "rect_tool",      SP_VERB_CONTEXT_RECT, SP_VERB_CONTEXT_RECT_PREFS },
     { "Box3DContext",      "3dbox_tool",     SP_VERB_CONTEXT_3DBOX, SP_VERB_CONTEXT_3DBOX_PREFS },
@@ -181,6 +184,8 @@
       SP_VERB_INVALID, 0, 0},
     { "SPTweakContext",   "tweak_toolbox",   0, sp_tweak_toolbox_prep,              "TweakToolbar",
       SP_VERB_CONTEXT_TWEAK_PREFS, "/tools/tweak", N_("Color/opacity used for color tweaking")},
+  { "SPSprayContext",   "spray_toolbox",   0, sp_spray_toolbox_prep,              "SprayToolbar",
+      SP_VERB_CONTEXT_SPRAY_PREFS, "/tools/spray", N_("Color/opacity used for color spraying")},
     { "SPZoomContext",   "zoom_toolbox",   0, sp_zoom_toolbox_prep,              "ZoomToolbar",
       SP_VERB_INVALID, 0, 0},
     { "SPStarContext",   "star_toolbox",   0, sp_star_toolbox_prep,              "StarToolbar",
@@ -299,6 +304,21 @@
         "    <toolitem action='TweakDoO' />"
         "  </toolbar>"
 
+  "  <toolbar name='SprayToolbar'>"
+        "    <toolitem action='SprayModeAction' />"
+        "    <separator />"
+        "    <toolitem action='SprayWidthAction' />"
+        "    <separator />"
+        "    <toolitem action='SprayPressureAction' />"
+        "    <separator />"
+        "    <toolitem action='SprayPopulationAction' />"
+        "    <separator />"
+        "    <toolitem action='SprayMeanAction' />"
+        "    <toolitem action='SprayStandard_deviationAction' />"
+        "    <separator />"
+        "    <toolitem action='DialogSprayOption' />"
+        "  </toolbar>"
+
         "  <toolbar name='ZoomToolbar'>"
         "    <toolitem action='ZoomIn' />"
         "    <toolitem action='ZoomOut' />"
@@ -718,6 +738,7 @@
         //SP_VERB_EDIT_TILE,
         //SP_VERB_EDIT_UNTILE,
         SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+        SP_VERB_DIALOG_SPRAY_OPTION,
         SP_VERB_DIALOG_DISPLAY,
         SP_VERB_DIALOG_FILL_STROKE,
         SP_VERB_DIALOG_NAMEDVIEW,
@@ -1627,6 +1648,7 @@
         "    <toolitem action='ToolSelector' />"
         "    <toolitem action='ToolNode' />"
         "    <toolitem action='ToolTweak' />"
+        "    <toolitem action='ToolSpray' />"
         "    <toolitem action='ToolZoom' />"
         "    <toolitem action='ToolRect' />"
         "    <toolitem action='Tool3DBox' />"
 //########################
+//##       Spray        ##
+//########################
+
+static void sp_spray_width_value_changed( GtkAdjustment *adj, GObject */*tbl*/ )
+{
+    Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+    prefs->setDouble( "/tools/spray/width", adj->value * 0.01 );
+}
+
+static void sp_spray_force_value_changed( GtkAdjustment *adj, GObject */*tbl*/ )
+{
+    //Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+    //prefs->setDouble( "/tools/spray/force", adj->value * 0.01 );
+}
+
+static void sp_spray_mean_value_changed( GtkAdjustment *adj, GObject */*tbl*/ )
+{
+    Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+    prefs->setDouble( "/tools/spray/mean", adj->value * 0.01 );
+}
+
+static void sp_spray_standard_deviation_value_changed( GtkAdjustment *adj, GObject */*tbl*/ )
+{
+    Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+    prefs->setDouble( "/tools/spray/standard_deviation", adj->value * 0.01 );
+}
+
+static void sp_spray_pressure_state_changed( GtkToggleAction *act, gpointer /*data*/ )
+{
+    Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+    prefs->setBool("/tools/spray/usepressure", gtk_toggle_action_get_active(act));
+}
+
+static void sp_spray_mode_changed( EgeSelectOneAction *act, GObject *tbl )
+{
+    int mode = ege_select_one_action_get_active( act );
+    Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+    prefs->setInt("/tools/spray/mode", mode);
+}
+
+static void sp_spray_population_value_changed( GtkAdjustment *adj, GObject */*tbl*/ )
+{
+    Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+    prefs->setDouble( "/tools/spray/population", adj->value * 0.01 );
+}
+
+/*static void spray_toggle_doh (GtkToggleAction *act, gpointer ) {
+    Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+    prefs->setBool("/tools/spray/doh", gtk_toggle_action_get_active(act));
+}
+static void spray_toggle_dos (GtkToggleAction *act, gpointer ) {
+    Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+    prefs->setBool("/tools/spray/dos", gtk_toggle_action_get_active(act));
+}
+static void spray_toggle_dol (GtkToggleAction *act, gpointer ) {
+    Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+    prefs->setBool("/tools/spray/dol", gtk_toggle_action_get_active(act));
+}
+static void spray_toggle_doo (GtkToggleAction *act, gpointer ) {
+    Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+    prefs->setBool("/tools/spray/doo", gtk_toggle_action_get_active(act));
+}
+*/
+static void sp_spray_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder)
+{
+    Inkscape::IconSize secondarySize = prefToSize("/toolbox/secondary", 1);
+    Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+
+    {
+        /* Width */
+        gchar const* labels[] = {_("(pinch spray)"), 0, 0, 0, _("(default)"), 0, 0, 0, 0, _("(broad spray)")};
+        gdouble values[] = {1, 3, 5, 10, 15, 20, 30, 50, 75, 100};
+        EgeAdjustmentAction *eact = create_adjustment_action( "SprayWidthAction",
+                                                              _("Width"), _("Width:"), _("The width of the spray area (relative to the visible canvas area)"),
+                                                              "/tools/spray/width", 15,
+                                                              GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "altx-spray",
+                                                              1, 100, 1.0, 0.0,
+                                                              labels, values, G_N_ELEMENTS(labels),
+                                                              sp_spray_width_value_changed,  0.01, 0, 100 );
+        ege_adjustment_action_set_appearance( eact, TOOLBAR_SLIDER_HINT );
+        gtk_action_group_add_action( mainActions, GTK_ACTION(eact) );
+        gtk_action_set_sensitive( GTK_ACTION(eact), TRUE );
+    }
+
+    {
+        /* Mean */
+        gchar const* labels[] = {_("(minimum mean)"), 0, 0, _("(default)"), 0, 0, 0, _("(maximum mean)")};
+        gdouble values[] = {1, 5, 10, 20, 30, 50, 70, 100};
+        EgeAdjustmentAction *eact = create_adjustment_action( "SprayMeanAction",
+                                                              _("Mean"), _("Mean:"), _("The mean of the spray action"),
+                                                              "/tools/spray/mean", 20,
+                                                              GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "spray-mean",
+                                                              1, 100, 1.0, 0.0,
+                                                              labels, values, G_N_ELEMENTS(labels),
+                                                              sp_spray_mean_value_changed,  0.01, 0, 100 );
+        ege_adjustment_action_set_appearance( eact, TOOLBAR_SLIDER_HINT );
+        gtk_action_group_add_action( mainActions, GTK_ACTION(eact) );
+        gtk_action_set_sensitive( GTK_ACTION(eact), TRUE );
+    }
+
+    {
+        /* Standard_deviation */
+        gchar const* labels[] = {_("(minimum standard_deviation)"), 0, 0, _("(default)"), 0, 0, 0, _("(maximum standard_deviation)")};
+        gdouble values[] = {1, 5, 10, 20, 30, 50, 70, 100};
+        EgeAdjustmentAction *eact = create_adjustment_action( "SprayStandard_deviationAction",
+                                                              _("SD"), _("SD:"), _("The standard deviation of the spray action"),
+                                                              "/tools/spray/standard_deviation", 20,
+                                                              GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "spray-standard_deviation",
+                                                              1, 100, 1.0, 0.0,
+                                                              labels, values, G_N_ELEMENTS(labels),
+                                                              sp_spray_standard_deviation_value_changed,  0.01, 0, 100 );
+        ege_adjustment_action_set_appearance( eact, TOOLBAR_SLIDER_HINT );
+        gtk_action_group_add_action( mainActions, GTK_ACTION(eact) );
+        gtk_action_set_sensitive( GTK_ACTION(eact), TRUE );
+    }
+
+    /* Mode */
+    {
+        GtkListStore* model = gtk_list_store_new( 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING );
+
+        GtkTreeIter iter;
+        gtk_list_store_append( model, &iter );
+        gtk_list_store_set( model, &iter,
+                            0, _("Spray with copies"),
+                            1, _("Spray copies of the initial selection"),
+                            2, INKSCAPE_ICON_SPRAY_COPY_MODE,
+                            -1 );
+
+        gtk_list_store_append( model, &iter );
+        gtk_list_store_set( model, &iter,
+                            0, _("Spray with clones"),
+                            1, _("Spray clones of the initial selection"),
+                            2, INKSCAPE_ICON_SPRAY_CLONE_MODE,
+                            -1 );
+
+        gtk_list_store_append( model, &iter );
+        gtk_list_store_set( model, &iter,
+                            0, _("Spray single path"),
+                            1, _("Spray objects in a single path"),
+                            2, INKSCAPE_ICON_SPRAY_UNION_MODE,
+                            -1 );
+
+        EgeSelectOneAction* act = ege_select_one_action_new( "SprayModeAction", _("Mode"), (""), NULL, GTK_TREE_MODEL(model) );
+        g_object_set( act, "short_label", _("Mode:"), NULL );
+        gtk_action_group_add_action( mainActions, GTK_ACTION(act) );
+        g_object_set_data( holder, "mode_action", act );
+
+        ege_select_one_action_set_appearance( act, "full" );
+        ege_select_one_action_set_radio_action_type( act, INK_RADIO_ACTION_TYPE );
+        g_object_set( G_OBJECT(act), "icon-property", "iconId", NULL );
+        ege_select_one_action_set_icon_column( act, 2 );
+        ege_select_one_action_set_icon_size( act, secondarySize );
+        ege_select_one_action_set_tooltip_column( act, 1  );
+
+        gint mode = prefs->getInt("/tools/spray/mode", 0);
+        ege_select_one_action_set_active( act, mode );
+        g_signal_connect_after( G_OBJECT(act), "changed", G_CALLBACK(sp_spray_mode_changed), holder );
+
+        g_object_set_data( G_OBJECT(holder), "spray_tool_mode", act);
+    }
+
+    {   /* Population */
+        gchar const* labels[] = {_("(rough, simplified)"), 0, 0, _("(default)"), 0, 0, _("(fine, but many nodes)")};
+        gdouble values[] = {10, 25, 35, 50, 60, 80, 100};
+        EgeAdjustmentAction *eact = create_adjustment_action( "SprayPopulationAction",
+                                                              _("Population"), _("Population:"),
+                                                              _("This setting adjusts the number of items sprayed"),
+                                                              "/tools/spray/population", 50,
+                                                              GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "spray-population",
+                                                              1, 100, 1.0, 10.0,
+                                                              labels, values, G_N_ELEMENTS(labels),
+                                                              sp_spray_population_value_changed,  0.01, 0, 100 );
+        gtk_action_group_add_action( mainActions, GTK_ACTION(eact) );
+        gtk_action_set_sensitive( GTK_ACTION(eact), TRUE );
+        g_object_set_data( holder, "spray_population", eact );
+    }
+
+    /* Use Pressure button */
+    {
+        InkToggleAction* act = ink_toggle_action_new( "SprayPressureAction",
+                                                      _("Pressure"),
+                                                      _("Use the pressure of the input device to alter the force of spray action"),
+                                                      "use_pressure",
+                                                      Inkscape::ICON_SIZE_DECORATION );
+        gtk_action_group_add_action( mainActions, GTK_ACTION( act ) );
+        g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(sp_spray_pressure_state_changed), NULL);
+        gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/spray/usepressure", true) );
+    }
+
+}
+
+
+//########################
 //##     Calligraphy    ##
 //########################
 static void update_presets_list (GObject *tbl)
Index: src/Makefile_insert
===================================================================
--- src/Makefile_insert	(revision 21247)
+++ src/Makefile_insert	(working copy)
@@ -222,6 +222,7 @@
 	sp-tspan.cpp sp-tspan.h			\
 	sp-use.cpp sp-use.h			\
 	sp-use-reference.cpp sp-use-reference.h	\
+	spray-context.h spray-context.cpp \
 	star-context.cpp star-context.h		\
 	streq.h					\
 	strneq.h				\
Index: src/verbs.h
===================================================================
--- src/verbs.h	(revision 21247)
+++ src/verbs.h	(working copy)
@@ -153,6 +153,7 @@
     SP_VERB_CONTEXT_SELECT,
     SP_VERB_CONTEXT_NODE,
     SP_VERB_CONTEXT_TWEAK,
+    SP_VERB_CONTEXT_SPRAY,
     SP_VERB_CONTEXT_RECT,
     SP_VERB_CONTEXT_3DBOX,
     SP_VERB_CONTEXT_ARC,
@@ -174,6 +175,7 @@
     SP_VERB_CONTEXT_SELECT_PREFS,
     SP_VERB_CONTEXT_NODE_PREFS,
     SP_VERB_CONTEXT_TWEAK_PREFS,
+SP_VERB_CONTEXT_SPRAY_PREFS,
     SP_VERB_CONTEXT_RECT_PREFS,
     SP_VERB_CONTEXT_3DBOX_PREFS,
     SP_VERB_CONTEXT_ARC_PREFS,
@@ -227,6 +229,7 @@
     SP_VERB_DIALOG_SWATCHES,
     SP_VERB_DIALOG_TRANSFORM,
     SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+    SP_VERB_DIALOG_SPRAY_OPTION,
     SP_VERB_DIALOG_UNDO_HISTORY,
     SP_VERB_DIALOG_TEXT,
     SP_VERB_DIALOG_XML_EDITOR,
Index: src/tools-switch.h
===================================================================
--- src/tools-switch.h	(revision 21247)
+++ src/tools-switch.h	(working copy)
@@ -19,6 +19,7 @@
   TOOLS_SELECT,
   TOOLS_NODES,
   TOOLS_TWEAK,
+  TOOLS_SPRAY,
   TOOLS_SHAPES_RECT,
   TOOLS_SHAPES_3DBOX,
   TOOLS_SHAPES_ARC,
Index: src/ui/icon-names.h
===================================================================
--- src/ui/icon-names.h	(revision 21247)
+++ src/ui/icon-names.h	(working copy)
@@ -456,6 +456,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_SPRAY_OPTIONS_PANEL \
+        "spray-options-panel"
 #define INKSCAPE_ICON_STROKE_CAP_BUTT \
     "stroke-cap-butt"
 #define INKSCAPE_ICON_STROKE_CAP_ROUND \
@@ -488,6 +496,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 \
Index: src/ui/dialog/inkscape-preferences.cpp
===================================================================
--- src/ui/dialog/inkscape-preferences.cpp	(revision 21247)
+++ src/ui/dialog/inkscape-preferences.cpp	(working copy)
@@ -445,6 +445,12 @@
     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);
Index: src/ui/dialog/dialog-manager.cpp
===================================================================
--- src/ui/dialog/dialog-manager.cpp	(revision 21247)
+++ src/ui/dialog/dialog-manager.cpp	(working copy)
@@ -19,6 +19,7 @@
 #include "ui/dialog/dialog-manager.h"
 
 #include "ui/dialog/align-and-distribute.h"
+#include "ui/dialog/spray-option.h"
 #include "ui/dialog/document-metadata.h"
 #include "ui/dialog/document-properties.h"
 #include "ui/dialog/extension-editor.h"
@@ -88,7 +89,6 @@
     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>);
@@ -112,6 +112,7 @@
         registerFactory("Transformation",      &create<Transformation,       FloatingBehavior>);
         registerFactory("UndoHistory",         &create<UndoHistory,          FloatingBehavior>);
         registerFactory("InputDevices",        &create<InputDialog,           FloatingBehavior>);
+        registerFactory("SprayOptionClass",    &create<SprayOptionClass,     FloatingBehavior>);
 
     } else {
 
@@ -138,6 +139,7 @@
         registerFactory("Transformation",      &create<Transformation,       DockBehavior>);
         registerFactory("UndoHistory",         &create<UndoHistory,          DockBehavior>);
         registerFactory("InputDevices",        &create<InputDialog,          DockBehavior>);
+        registerFactory("SprayOptionClass",    &create<SprayOptionClass,     DockBehavior>);
 
     }
 }
Index: src/ui/dialog/inkscape-preferences.h
===================================================================
--- src/ui/dialog/inkscape-preferences.h	(revision 21247)
+++ src/ui/dialog/inkscape-preferences.h	(working copy)
@@ -43,6 +43,7 @@
     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 @@
         _page_clones, _page_mask, _page_transforms, _page_filters, _page_select,
         _page_importexport, _page_cms, _page_grids, _page_svgoutput, _page_misc,
         _page_ui, _page_autosave, _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_spray, _page_zoom,  _page_tweak, _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;
 
Index: src/ui/dialog/Makefile_insert
===================================================================
--- src/ui/dialog/Makefile_insert	(revision 21247)
+++ src/ui/dialog/Makefile_insert	(working copy)
@@ -71,8 +71,12 @@
 	ui/dialog/panel-dialog.h		\
 	ui/dialog/print.cpp			\
 	ui/dialog/print.h			\
+	ui/dialog/spray-option.h		\
+	ui/dialog/spray-option.cpp		\
 	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			\
Index: src/ui/view/edit-widget.cpp
===================================================================
--- src/ui/view/edit-widget.cpp	(revision 21247)
+++ src/ui/view/edit-widget.cpp	(working copy)
@@ -228,6 +228,12 @@
 }
 
 void
+EditWidget::onDialogSprayOptionClass()
+{
+    _dlg_mgr.showDialog("SprayOptionClass");
+}
+
+void
 EditWidget::onDialogDocumentProperties()
 {
 //    manage (Inkscape::UI::Dialog::DocumentPreferences::create());
Index: src/ui/view/edit-widget.h
===================================================================
--- src/ui/view/edit-widget.h	(revision 21247)
+++ src/ui/view/edit-widget.h	(working copy)
@@ -70,6 +70,7 @@
 
     void onDialogAbout();
     void onDialogAlignAndDistribute();
+    void onDialogSprayOptionClass();
     void onDialogInkscapePreferences();
     void onDialogDialog();
     void onDialogDocumentProperties();

