summaryrefslogtreecommitdiffstats
path: root/src/ui/tools
diff options
context:
space:
mode:
authorjabiertxof <jabiertxof@debian.marker.es>2015-04-29 14:33:09 +0000
committerjabiertxof <jabiertxof@debian.marker.es>2015-04-29 14:33:09 +0000
commitcd2a40d327c536e12dd113a0c8c2fe5038affe48 (patch)
tree7e8c12e63848a90246f591067244f6891fd70336 /src/ui/tools
parentFis fix a bug finded in my presentation in the HackFest (diff)
parentIncrease precision (long thin paths had a ton of width variance), fix logic e... (diff)
downloadinkscape-cd2a40d327c536e12dd113a0c8c2fe5038affe48.tar.gz
inkscape-cd2a40d327c536e12dd113a0c8c2fe5038affe48.zip
update to trunk
(bzr r12588.1.44)
Diffstat (limited to 'src/ui/tools')
-rw-r--r--src/ui/tools/flood-tool.cpp54
-rw-r--r--src/ui/tools/flood-tool.h6
-rw-r--r--src/ui/tools/tool-base.cpp4
3 files changed, 25 insertions, 39 deletions
diff --git a/src/ui/tools/flood-tool.cpp b/src/ui/tools/flood-tool.cpp
index bb8782dfa..ffd41d97d 100644
--- a/src/ui/tools/flood-tool.cpp
+++ b/src/ui/tools/flood-tool.cpp
@@ -84,6 +84,28 @@ const std::string& FloodTool::getPrefsPath() {
const std::string FloodTool::prefsPath = "/tools/paintbucket";
+// TODO: Replace by C++11 initialization
+// Must match PaintBucketChannels enum
+Glib::ustring ch_init[8] = {
+ _("Visible Colors"),
+ _("Red"),
+ _("Green"),
+ _("Blue"),
+ _("Hue"),
+ _("Saturation"),
+ _("Lightness"),
+ _("Alpha"),
+};
+const std::vector<Glib::ustring> FloodTool::channel_list( ch_init, ch_init+8 );
+
+Glib::ustring gap_init[4] = {
+ C_("Flood autogap", "None"),
+ C_("Flood autogap", "Small"),
+ C_("Flood autogap", "Medium"),
+ C_("Flood autogap", "Large")
+};
+const std::vector<Glib::ustring> FloodTool::gap_list( gap_init, gap_init+4 );
+
FloodTool::FloodTool()
: ToolBase(cursor_paintbucket_xpm, 11, 30)
, item(NULL)
@@ -174,38 +196,6 @@ inline unsigned char * get_trace_pixel(guchar *trace_px, int x, int y, int width
}
/**
- * Generate the list of trace channel selection entries.
- */
-GList * flood_channels_dropdown_items_list() {
- GList *glist = NULL;
-
- glist = g_list_append (glist, _("Visible Colors"));
- glist = g_list_append (glist, _("Red"));
- glist = g_list_append (glist, _("Green"));
- glist = g_list_append (glist, _("Blue"));
- glist = g_list_append (glist, _("Hue"));
- glist = g_list_append (glist, _("Saturation"));
- glist = g_list_append (glist, _("Lightness"));
- glist = g_list_append (glist, _("Alpha"));
-
- return glist;
-}
-
-/**
- * Generate the list of autogap selection entries.
- */
-GList * flood_autogap_dropdown_items_list() {
- GList *glist = NULL;
-
- glist = g_list_append (glist, (void*) C_("Flood autogap", "None"));
- glist = g_list_append (glist, (void*) C_("Flood autogap", "Small"));
- glist = g_list_append (glist, (void*) C_("Flood autogap", "Medium"));
- glist = g_list_append (glist, (void*) C_("Flood autogap", "Large"));
-
- return glist;
-}
-
-/**
* Compare a pixel in a pixel buffer with another pixel to determine if a point should be included in the fill operation.
* @param check The pixel in the pixel buffer to check.
* @param orig The original selected pixel to use as the fill target color.
diff --git a/src/ui/tools/flood-tool.h b/src/ui/tools/flood-tool.h
index 5104a42e9..100875f22 100644
--- a/src/ui/tools/flood-tool.h
+++ b/src/ui/tools/flood-tool.h
@@ -13,6 +13,7 @@
#include <sigc++/connection.h>
#include "ui/tools/tool-base.h"
+#include <vector>
#define SP_FLOOD_CONTEXT(obj) (dynamic_cast<Inkscape::UI::Tools::FloodTool*>((Inkscape::UI::Tools::ToolBase*)obj))
#define SP_IS_FLOOD_CONTEXT(obj) (dynamic_cast<const Inkscape::UI::Tools::FloodTool*>((const Inkscape::UI::Tools::ToolBase*)obj) != NULL)
@@ -39,15 +40,14 @@ public:
virtual const std::string& getPrefsPath();
static void set_channels(gint channels);
+ static const std::vector<Glib::ustring> channel_list;
+ static const std::vector<Glib::ustring> gap_list;
private:
void selection_changed(Inkscape::Selection* selection);
void finishItem();
};
-GList* flood_channels_dropdown_items_list (void);
-GList* flood_autogap_dropdown_items_list (void);
-
enum PaintBucketChannels {
FLOOD_CHANNELS_RGB,
FLOOD_CHANNELS_R,
diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp
index a07f2fb86..2eb6d24d9 100644
--- a/src/ui/tools/tool-base.cpp
+++ b/src/ui/tools/tool-base.cpp
@@ -20,10 +20,6 @@
#include "widgets/desktop-widget.h"
-#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
-#include <glibmm/threads.h>
-#endif
-
#include "shortcuts.h"
#include "file.h"
#include "ui/tools/tool-base.h"