app: move the N-Point Deformation tool to the playground

It has to be enabled via Prefs -> Playground. The menu entry is always
disabled until it leaves the playground, for reasons worth fixing.
This commit is contained in:
Michael Natterer
2015-03-03 20:26:58 +01:00
parent 825d4ab185
commit b27c5b0985
6 changed files with 48 additions and 19 deletions

View File

@ -80,6 +80,8 @@ enum
PROP_DOCK_WINDOW_HINT,
PROP_CURSOR_HANDEDNESS,
PROP_PLAYGROUND_NPD_TOOL,
PROP_HIDE_DOCKS,
PROP_SINGLE_WINDOW_MODE,
PROP_TABS_POSITION,
@ -272,6 +274,13 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
GIMP_HANDEDNESS_RIGHT,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_PLAYGROUND_NPD_TOOL,
"playground-npd-tool",
PLAYGROUND_NPD_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",
NULL,
@ -476,6 +485,10 @@ gimp_gui_config_set_property (GObject *object,
gui_config->cursor_handedness = g_value_get_enum (value);
break;
case PROP_PLAYGROUND_NPD_TOOL:
gui_config->playground_npd_tool = g_value_get_boolean (value);
break;
case PROP_HIDE_DOCKS:
gui_config->hide_docks = g_value_get_boolean (value);
break;
@ -610,6 +623,10 @@ gimp_gui_config_get_property (GObject *object,
g_value_set_enum (value, gui_config->cursor_handedness);
break;
case PROP_PLAYGROUND_NPD_TOOL:
g_value_set_boolean (value, gui_config->playground_npd_tool);
break;
case PROP_HIDE_DOCKS:
g_value_set_boolean (value, gui_config->hide_docks);
break;

View File

@ -63,7 +63,7 @@ struct _GimpGuiConfig
gchar *help_locales;
GimpHelpBrowserType help_browser;
/* Action Search preferences. */
/* action search preferences */
gboolean search_show_unavailable;
gint action_history_size;
@ -73,6 +73,9 @@ struct _GimpGuiConfig
GimpWindowHint dock_window_hint;
GimpHandedness cursor_handedness;
/* experimental playground */
gboolean playground_npd_tool;
/* saved in sessionrc */
gboolean hide_docks;
gboolean single_window_mode;

View File

@ -374,6 +374,9 @@ _("Use GIMP in a single-window mode.")
#define HIDE_DOCKS_BLURB \
_("Hide docks and other windows, leaving only image windows.")
#define PLAYGROUND_NPD_TOOL_BLURB \
_("Enable the N-Point Deformation tool.")
#define SPACE_BAR_ACTION_BLURB \
_("What to do when the space bar is pressed in the image window.")

View File

@ -1456,8 +1456,6 @@ prefs_dialog_new (Gimp *gimp,
/****************/
if (gimp->show_playground)
{
GtkWidget *label;
pixbuf = prefs_get_pixbufs (dialog, "playground", &small_pixbuf);
vbox = gimp_prefs_box_add_page (GIMP_PREFS_BOX (prefs_box),
_("Experimental Playground"),
@ -1471,9 +1469,9 @@ prefs_dialog_new (Gimp *gimp,
vbox2 = prefs_frame_new (_("Insane Options"),
GTK_CONTAINER (vbox), TRUE);
label = gtk_label_new ("Fuck Yeah!");
gtk_box_pack_start (GTK_BOX (vbox2), label, TRUE, TRUE, 0);
gtk_widget_show (label);
button = prefs_check_button_add (object, "playground-npd-tool",
_("_N-Point Deformation tool"),
GTK_BOX (vbox2));
}

View File

@ -31,6 +31,8 @@
#include "tools-types.h"
#include "config/gimpguiconfig.h" /* playground */
#include "gegl/gimp-gegl-utils.h"
#include "gegl/gimp-gegl-apply-operation.h"
@ -144,18 +146,22 @@ void
gimp_n_point_deformation_tool_register (GimpToolRegisterCallback callback,
gpointer data)
{
(* callback) (GIMP_TYPE_N_POINT_DEFORMATION_TOOL,
GIMP_TYPE_N_POINT_DEFORMATION_OPTIONS,
gimp_n_point_deformation_options_gui,
0,
"gimp-n-point-deformation-tool",
_("N-Point Deformation"),
_("N-Point Deformation Tool: Rubber-like deformation of "
"image using points"),
N_("_N-Point Deformation"), "<shift>N",
NULL, GIMP_HELP_TOOL_N_POINT_DEFORMATION,
GIMP_STOCK_TOOL_N_POINT_DEFORMATION,
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_npd_tool)
(* callback) (GIMP_TYPE_N_POINT_DEFORMATION_TOOL,
GIMP_TYPE_N_POINT_DEFORMATION_OPTIONS,
gimp_n_point_deformation_options_gui,
0,
"gimp-n-point-deformation-tool",
_("N-Point Deformation"),
_("N-Point Deformation Tool: Rubber-like deformation of "
"image using points"),
N_("_N-Point Deformation"), "<shift>N",
NULL, GIMP_HELP_TOOL_N_POINT_DEFORMATION,
GIMP_STOCK_TOOL_N_POINT_DEFORMATION,
data);
}
static void

View File

@ -605,7 +605,9 @@
<menuitem action="tools-flip" />
<menuitem action="tools-cage" />
<menuitem action="tools-warp" />
<menuitem action="tools-n-point-deformation" />
<!-- Enable when the tool leaves the playground
<menuitem action="tools-n-point-deformation" />
-->
</menu>
<menu action="tools-color-menu" name="Color Tools">
<menuitem action="tools-color-balance" />