[gimp] app: move the seamless clone tool to the playground
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: move the seamless clone tool to the playground
- Date: Sun, 14 Jun 2015 11:03:29 +0000 (UTC)
commit 6487d0a26ad4c963c85b9c7c5b9ffda0f035722b
Author: Michael Natterer <mitch gimp org>
Date: Sun Jun 14 13:02:31 2015 +0200
app: move the seamless clone tool to the playground
It's not release material unless somebody comes and fixes its bugs,
and its speed.
app/config/gimpguiconfig.c | 14 ++++++++++++++
app/config/gimpguiconfig.h | 1 +
app/config/gimprc-blurbs.h | 3 +++
app/dialogs/preferences-dialog.c | 4 ++++
app/tools/gimpseamlessclonetool.c | 28 +++++++++++++++++-----------
5 files changed, 39 insertions(+), 11 deletions(-)
---
diff --git a/app/config/gimpguiconfig.c b/app/config/gimpguiconfig.c
index 4233402..833cb0f 100644
--- a/app/config/gimpguiconfig.c
+++ b/app/config/gimpguiconfig.c
@@ -83,6 +83,7 @@ enum
PROP_PLAYGROUND_NPD_TOOL,
PROP_PLAYGROUND_HANDLE_TRANSFORM_TOOL,
PROP_PLAYGROUND_MYBRUSH_TOOL,
+ PROP_PLAYGROUND_SEAMLESS_CLONE_TOOL,
PROP_HIDE_DOCKS,
PROP_SINGLE_WINDOW_MODE,
@@ -296,6 +297,13 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
FALSE,
GIMP_PARAM_STATIC_STRINGS |
GIMP_CONFIG_PARAM_RESTART);
+ GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class,
+ PROP_PLAYGROUND_SEAMLESS_CLONE_TOOL,
+ "playground-seamless-clone-tool",
+ PLAYGROUND_SEAMLESS_CLONE_TOOL_BLURB,
+ FALSE,
+ GIMP_PARAM_STATIC_STRINGS |
+ GIMP_CONFIG_PARAM_RESTART);
g_object_class_install_property (object_class, PROP_HIDE_DOCKS,
g_param_spec_boolean ("hide-docks",
@@ -510,6 +518,9 @@ gimp_gui_config_set_property (GObject *object,
case PROP_PLAYGROUND_MYBRUSH_TOOL:
gui_config->playground_mybrush_tool = g_value_get_boolean (value);
break;
+ case PROP_PLAYGROUND_SEAMLESS_CLONE_TOOL:
+ gui_config->playground_seamless_clone_tool = g_value_get_boolean (value);
+ break;
case PROP_HIDE_DOCKS:
gui_config->hide_docks = g_value_get_boolean (value);
@@ -654,6 +665,9 @@ gimp_gui_config_get_property (GObject *object,
case PROP_PLAYGROUND_MYBRUSH_TOOL:
g_value_set_boolean (value, gui_config->playground_mybrush_tool);
break;
+ case PROP_PLAYGROUND_SEAMLESS_CLONE_TOOL:
+ g_value_set_boolean (value, gui_config->playground_seamless_clone_tool);
+ break;
case PROP_HIDE_DOCKS:
g_value_set_boolean (value, gui_config->hide_docks);
diff --git a/app/config/gimpguiconfig.h b/app/config/gimpguiconfig.h
index 105aaa8..2452f3e 100644
--- a/app/config/gimpguiconfig.h
+++ b/app/config/gimpguiconfig.h
@@ -77,6 +77,7 @@ struct _GimpGuiConfig
gboolean playground_npd_tool;
gboolean playground_handle_transform_tool;
gboolean playground_mybrush_tool;
+ gboolean playground_seamless_clone_tool;
/* saved in sessionrc */
gboolean hide_docks;
diff --git a/app/config/gimprc-blurbs.h b/app/config/gimprc-blurbs.h
index 3e2dae5..70e216a 100644
--- a/app/config/gimprc-blurbs.h
+++ b/app/config/gimprc-blurbs.h
@@ -391,6 +391,9 @@ _("Enable the Handle Transform tool.")
#define PLAYGROUND_MYBRUSH_TOOL_BLURB \
_("Enable the MyPaint Brush tool.")
+#define PLAYGROUND_SEAMLESS_CLONE_TOOL_BLURB \
+_("Enable the Seamless Clone tool.")
+
#define SPACE_BAR_ACTION_BLURB \
_("What to do when the space bar is pressed in the image window.")
diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c
index d3d0d72..69c4ce3 100644
--- a/app/dialogs/preferences-dialog.c
+++ b/app/dialogs/preferences-dialog.c
@@ -1529,6 +1529,10 @@ prefs_dialog_new (Gimp *gimp,
_("_MyPaint Brush tool"),
GTK_BOX (vbox2));
#endif
+
+ button = prefs_check_button_add (object, "playground-seamless-clone-tool",
+ _("_Seamless Clone tool"),
+ GTK_BOX (vbox2));
}
diff --git a/app/tools/gimpseamlessclonetool.c b/app/tools/gimpseamlessclonetool.c
index c1c9daa..a601d51 100644
--- a/app/tools/gimpseamlessclonetool.c
+++ b/app/tools/gimpseamlessclonetool.c
@@ -29,6 +29,8 @@
#include "tools-types.h"
+#include "config/gimpguiconfig.h" /* playground */
+
#include "core/gimp.h"
#include "core/gimpbuffer.h"
#include "core/gimpimage.h"
@@ -176,17 +178,21 @@ void
gimp_seamless_clone_tool_register (GimpToolRegisterCallback callback,
gpointer data)
{
- (* callback) (GIMP_TYPE_SEAMLESS_CLONE_TOOL,
- GIMP_TYPE_SEAMLESS_CLONE_OPTIONS,
- gimp_seamless_clone_options_gui,
- 0,
- "gimp-seamless-clone-tool",
- _("Seamless Clone"),
- _("Seamless Clone: Seamlessly paste one image into another"),
- N_("_Seamless Clone"), "<shift>L",
- NULL, GIMP_HELP_TOOL_SEAMLESS_CLONE,
- GIMP_STOCK_TOOL_SEAMLESS_CLONE,
- data);
+ /* we should not know that "data" is a Gimp*, but what the heck this
+ * is experimental playground stuff
+ */
+ if (GIMP_GUI_CONFIG (GIMP (data)->config)->playground_seamless_clone_tool)
+ (* callback) (GIMP_TYPE_SEAMLESS_CLONE_TOOL,
+ GIMP_TYPE_SEAMLESS_CLONE_OPTIONS,
+ gimp_seamless_clone_options_gui,
+ 0,
+ "gimp-seamless-clone-tool",
+ _("Seamless Clone"),
+ _("Seamless Clone: Seamlessly paste one image into another"),
+ N_("_Seamless Clone"), "<shift>L",
+ NULL, GIMP_HELP_TOOL_SEAMLESS_CLONE,
+ GIMP_STOCK_TOOL_SEAMLESS_CLONE,
+ data);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]