app: move the MyPaint brush into the playground.

This commit is contained in:
Jehan 2015-03-22 22:36:00 +01:00 committed by Michael Natterer
parent 89ef9ca5b7
commit 5460c414db
8 changed files with 62 additions and 24 deletions

View File

@ -26,6 +26,8 @@
#include "actions-types.h"
#include "config/gimpguiconfig.h" /* playground */
#include "core/gimp.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
@ -505,10 +507,11 @@ tools_actions_setup (GimpActionGroup *group)
G_N_ELEMENTS (tools_airbrush_flow_actions),
G_CALLBACK (tools_airbrush_flow_cmd_callback));
gimp_action_group_add_enum_actions (group, NULL,
tools_mybrush_radius_actions,
G_N_ELEMENTS (tools_mybrush_radius_actions),
G_CALLBACK (tools_mybrush_radius_cmd_callback));
if (GIMP_GUI_CONFIG (group->gimp->config)->playground_mybrush_tool)
gimp_action_group_add_enum_actions (group, NULL,
tools_mybrush_radius_actions,
G_N_ELEMENTS (tools_mybrush_radius_actions),
G_CALLBACK (tools_mybrush_radius_cmd_callback));
gimp_action_group_add_enum_actions (group, NULL,
tools_foreground_select_brush_size_actions,

View File

@ -82,6 +82,7 @@ enum
PROP_PLAYGROUND_NPD_TOOL,
PROP_PLAYGROUND_HANDLE_TRANSFORM_TOOL,
PROP_PLAYGROUND_MYBRUSH_TOOL,
PROP_HIDE_DOCKS,
PROP_SINGLE_WINDOW_MODE,
@ -288,6 +289,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_MYBRUSH_TOOL,
"playground-mybrush-tool",
PLAYGROUND_MYBRUSH_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",
@ -499,6 +507,9 @@ gimp_gui_config_set_property (GObject *object,
case PROP_PLAYGROUND_HANDLE_TRANSFORM_TOOL:
gui_config->playground_handle_transform_tool = g_value_get_boolean (value);
break;
case PROP_PLAYGROUND_MYBRUSH_TOOL:
gui_config->playground_mybrush_tool = g_value_get_boolean (value);
break;
case PROP_HIDE_DOCKS:
gui_config->hide_docks = g_value_get_boolean (value);
@ -640,6 +651,9 @@ gimp_gui_config_get_property (GObject *object,
case PROP_PLAYGROUND_HANDLE_TRANSFORM_TOOL:
g_value_set_boolean (value, gui_config->playground_handle_transform_tool);
break;
case PROP_PLAYGROUND_MYBRUSH_TOOL:
g_value_set_boolean (value, gui_config->playground_mybrush_tool);
break;
case PROP_HIDE_DOCKS:
g_value_set_boolean (value, gui_config->hide_docks);

View File

@ -76,6 +76,7 @@ struct _GimpGuiConfig
/* experimental playground */
gboolean playground_npd_tool;
gboolean playground_handle_transform_tool;
gboolean playground_mybrush_tool;
/* saved in sessionrc */
gboolean hide_docks;

View File

@ -380,6 +380,9 @@ _("Enable the N-Point Deformation tool.")
#define PLAYGROUND_HANDLE_TRANSFORM_TOOL_BLURB \
_("Enable the Handle Transform tool.")
#define PLAYGROUND_MYBRUSH_TOOL_BLURB \
_("Enable the MyPaint Brush tool.")
#define SPACE_BAR_ACTION_BLURB \
_("What to do when the space bar is pressed in the image window.")

View File

@ -1475,6 +1475,9 @@ prefs_dialog_new (Gimp *gimp,
button = prefs_check_button_add (object, "playground-handle-transform-tool",
_("_Handle Transform tool"),
GTK_BOX (vbox2));
button = prefs_check_button_add (object, "playground-mybrush-tool",
_("_MyPaint Brush tool"),
GTK_BOX (vbox2));
}

View File

@ -34,6 +34,9 @@
#include "gegl/gimp-gegl-utils.h"
#include "config/gimpguiconfig.h" /* playground */
#include "core/gimp.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "core/gimpimage-undo.h"
@ -76,12 +79,13 @@ void
gimp_mybrush_register (Gimp *gimp,
GimpPaintRegisterCallback callback)
{
(* callback) (gimp,
GIMP_TYPE_MYBRUSH,
GIMP_TYPE_MYBRUSH_OPTIONS,
"gimp-mybrush",
_("Mybrush"),
"gimp-tool-mybrush");
if (GIMP_GUI_CONFIG (gimp->config)->playground_mybrush_tool)
(* callback) (gimp,
GIMP_TYPE_MYBRUSH,
GIMP_TYPE_MYBRUSH_OPTIONS,
"gimp-mybrush",
_("Mybrush"),
"gimp-tool-mybrush");
}
static void

View File

@ -25,8 +25,12 @@
#include "tools-types.h"
#include "config/gimpguiconfig.h" /* playground */
#include "paint/gimpmybrushoptions.h"
#include "core/gimp.h"
#include "widgets/gimphelp-ids.h"
#include "gimpmybrushoptions-gui.h"
@ -55,20 +59,24 @@ void
gimp_mybrush_tool_register (GimpToolRegisterCallback callback,
gpointer data)
{
(* callback) (GIMP_TYPE_MYBRUSH_TOOL,
GIMP_TYPE_MYBRUSH_OPTIONS,
gimp_mybrush_options_gui,
GIMP_CONTEXT_FOREGROUND_MASK |
GIMP_CONTEXT_BACKGROUND_MASK |
GIMP_CONTEXT_OPACITY_MASK |
GIMP_CONTEXT_PAINT_MODE_MASK,
"gimp-mybrush-tool",
_("MyPaint Brush"),
_("MyPaint Brush Tool: Use MyPaint brushes in GIMP"),
N_("M_yPaint Brush"), "Y",
NULL, GIMP_HELP_TOOL_MYBRUSH,
GIMP_STOCK_TOOL_MYBRUSH,
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_mybrush_tool)
(* callback) (GIMP_TYPE_MYBRUSH_TOOL,
GIMP_TYPE_MYBRUSH_OPTIONS,
gimp_mybrush_options_gui,
GIMP_CONTEXT_FOREGROUND_MASK |
GIMP_CONTEXT_BACKGROUND_MASK |
GIMP_CONTEXT_OPACITY_MASK |
GIMP_CONTEXT_PAINT_MODE_MASK,
"gimp-mybrush-tool",
_("MyPaint Brush"),
_("MyPaint Brush Tool: Use MyPaint brushes in GIMP"),
N_("M_yPaint Brush"), "Y",
NULL, GIMP_HELP_TOOL_MYBRUSH,
GIMP_STOCK_TOOL_MYBRUSH,
data);
}
static void

View File

@ -584,7 +584,9 @@
<menuitem action="tools-eraser" />
<menuitem action="tools-airbrush" />
<menuitem action="tools-ink" />
<!-- Enable when the tool leaves the playground
<menuitem action="tools-mybrush" />
-->
<menuitem action="tools-clone" />
<menuitem action="tools-heal" />
<menuitem action="tools-perspective-clone" />