[gimp] app: move the handle transform tool to the playground



commit 4dcd48fff2f7e022c2cb9836f8d63c5673b0c552
Author: Michael Natterer <mitch gimp org>
Date:   Sun Mar 8 17:21:11 2015 +0100

    app: move the handle transform tool to the playground

 app/config/gimpguiconfig.c          |   14 ++++++++++++++
 app/config/gimpguiconfig.h          |    1 +
 app/config/gimprc-blurbs.h          |    3 +++
 app/dialogs/preferences-dialog.c    |    3 +++
 app/tools/gimphandletransformtool.c |   32 ++++++++++++++++++++------------
 menus/image-menu.xml.in             |    4 +++-
 6 files changed, 44 insertions(+), 13 deletions(-)
---
diff --git a/app/config/gimpguiconfig.c b/app/config/gimpguiconfig.c
index 770a694..7bd3012 100644
--- a/app/config/gimpguiconfig.c
+++ b/app/config/gimpguiconfig.c
@@ -81,6 +81,7 @@ enum
   PROP_CURSOR_HANDEDNESS,
 
   PROP_PLAYGROUND_NPD_TOOL,
+  PROP_PLAYGROUND_HANDLE_TRANSFORM_TOOL,
 
   PROP_HIDE_DOCKS,
   PROP_SINGLE_WINDOW_MODE,
@@ -280,6 +281,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_HANDLE_TRANSFORM_TOOL,
+                                    "playground-handle-transform-tool",
+                                    PLAYGROUND_HANDLE_TRANSFORM_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",
@@ -488,6 +496,9 @@ gimp_gui_config_set_property (GObject      *object,
     case PROP_PLAYGROUND_NPD_TOOL:
       gui_config->playground_npd_tool = g_value_get_boolean (value);
       break;
+    case PROP_PLAYGROUND_HANDLE_TRANSFORM_TOOL:
+      gui_config->playground_handle_transform_tool = g_value_get_boolean (value);
+      break;
 
     case PROP_HIDE_DOCKS:
       gui_config->hide_docks = g_value_get_boolean (value);
@@ -626,6 +637,9 @@ gimp_gui_config_get_property (GObject    *object,
     case PROP_PLAYGROUND_NPD_TOOL:
       g_value_set_boolean (value, gui_config->playground_npd_tool);
       break;
+    case PROP_PLAYGROUND_HANDLE_TRANSFORM_TOOL:
+      g_value_set_boolean (value, gui_config->playground_handle_transform_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 03c2981..878f700 100644
--- a/app/config/gimpguiconfig.h
+++ b/app/config/gimpguiconfig.h
@@ -75,6 +75,7 @@ struct _GimpGuiConfig
 
   /* experimental playground */
   gboolean             playground_npd_tool;
+  gboolean             playground_handle_transform_tool;
 
   /* saved in sessionrc */
   gboolean             hide_docks;
diff --git a/app/config/gimprc-blurbs.h b/app/config/gimprc-blurbs.h
index 810dca4..89383d0 100644
--- a/app/config/gimprc-blurbs.h
+++ b/app/config/gimprc-blurbs.h
@@ -377,6 +377,9 @@ _("Hide docks and other windows, leaving only image windows.")
 #define PLAYGROUND_NPD_TOOL_BLURB \
 _("Enable the N-Point Deformation tool.")
 
+#define PLAYGROUND_HANDLE_TRANSFORM_TOOL_BLURB \
+_("Enable the Handle Transform 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 7310b2b..e6169fa 100644
--- a/app/dialogs/preferences-dialog.c
+++ b/app/dialogs/preferences-dialog.c
@@ -1472,6 +1472,9 @@ prefs_dialog_new (Gimp       *gimp,
       button = prefs_check_button_add (object, "playground-npd-tool",
                                        _("_N-Point Deformation tool"),
                                        GTK_BOX (vbox2));
+      button = prefs_check_button_add (object, "playground-handle-transform-tool",
+                                       _("_Handle Transform tool"),
+                                       GTK_BOX (vbox2));
     }
 
 
diff --git a/app/tools/gimphandletransformtool.c b/app/tools/gimphandletransformtool.c
index c191d47..1e90968 100644
--- a/app/tools/gimphandletransformtool.c
+++ b/app/tools/gimphandletransformtool.c
@@ -27,6 +27,10 @@
 
 #include "tools-types.h"
 
+#include "config/gimpguiconfig.h" /* playground */
+
+#include "core/gimp.h" /* playground */
+
 #include "widgets/gimphelp-ids.h"
 #include "widgets/gimpwidgets-utils.h"
 
@@ -148,18 +152,22 @@ void
 gimp_handle_transform_tool_register (GimpToolRegisterCallback  callback,
                                      gpointer                  data)
 {
-  (* callback) (GIMP_TYPE_HANDLE_TRANSFORM_TOOL,
-                GIMP_TYPE_HANDLE_TRANSFORM_OPTIONS,
-                gimp_handle_transform_options_gui,
-                GIMP_CONTEXT_BACKGROUND_MASK,
-                "gimp-handle-transform-tool",
-                _("Handle Transform"),
-                _("Handle Transform Tool: "
-                  "Deform the layer, selection or path with handles"),
-                N_("_Handle Transform"), "<ctrl><shift>H",
-                NULL, GIMP_HELP_TOOL_HANDLE_TRANSFORM,
-                GIMP_STOCK_TOOL_HANDLE_TRANSFORM,
-                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_handle_transform_tool)
+    (* callback) (GIMP_TYPE_HANDLE_TRANSFORM_TOOL,
+                  GIMP_TYPE_HANDLE_TRANSFORM_OPTIONS,
+                  gimp_handle_transform_options_gui,
+                  GIMP_CONTEXT_BACKGROUND_MASK,
+                  "gimp-handle-transform-tool",
+                  _("Handle Transform"),
+                  _("Handle Transform Tool: "
+                    "Deform the layer, selection or path with handles"),
+                  N_("_Handle Transform"), "<ctrl><shift>H",
+                  NULL, GIMP_HELP_TOOL_HANDLE_TRANSFORM,
+                  GIMP_STOCK_TOOL_HANDLE_TRANSFORM,
+                  data);
 }
 
 static void
diff --git a/menus/image-menu.xml.in b/menus/image-menu.xml.in
index a1025b3..313c575 100644
--- a/menus/image-menu.xml.in
+++ b/menus/image-menu.xml.in
@@ -602,7 +602,9 @@
         <menuitem action="tools-shear" />
         <menuitem action="tools-perspective" />
         <menuitem action="tools-unified-transform" />
-        <menuitem action="tools-handle-transform" />
+       <!-- Enable when the tool leaves the playground
+             <menuitem action="tools-handle-transform" />
+       -->
         <menuitem action="tools-flip" />
         <menuitem action="tools-cage" />
         <menuitem action="tools-warp" />


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]