configure.ac, app: make libmypaint a hard dependency

and move the MyPaint brush tool out of the playground.
This commit is contained in:
Michael Natterer 2015-12-21 21:39:48 +01:00
parent df05612d2a
commit d01ba07ed6
16 changed files with 37 additions and 134 deletions

View File

@ -26,8 +26,6 @@
#include "actions-types.h"
#include "config/gimpguiconfig.h" /* playground */
#include "core/gimp.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
@ -187,7 +185,6 @@ static const GimpEnumActionEntry tools_airbrush_flow_actions[] =
NULL }
};
#ifdef HAVE_LIBMYPAINT
static const GimpEnumActionEntry tools_mybrush_radius_actions[] =
{
{ "tools-mybrush-radius-set", GIMP_STOCK_TOOL_MYPAINT_BRUSH,
@ -195,7 +192,6 @@ static const GimpEnumActionEntry tools_mybrush_radius_actions[] =
GIMP_ACTION_SELECT_SET, TRUE,
NULL }
};
#endif
static const GimpEnumActionEntry tools_foreground_select_brush_size_actions[] =
{
@ -509,13 +505,10 @@ tools_actions_setup (GimpActionGroup *group)
G_N_ELEMENTS (tools_airbrush_flow_actions),
G_CALLBACK (tools_airbrush_flow_cmd_callback));
#ifdef HAVE_LIBMYPAINT
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));
#endif
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

@ -294,7 +294,6 @@ tools_airbrush_flow_cmd_callback (GtkAction *action,
}
}
#ifdef HAVE_LIBMYPAINT
void
tools_mybrush_radius_cmd_callback (GtkAction *action,
gint value,
@ -315,7 +314,6 @@ tools_mybrush_radius_cmd_callback (GtkAction *action,
0.1, 0.1, 0.5, 1.0, FALSE);
}
}
#endif
void
tools_fg_select_brush_size_cmd_callback (GtkAction *action,

View File

@ -54,11 +54,9 @@ void tools_airbrush_flow_cmd_callback (GtkAction *action,
gint value,
gpointer data);
#ifdef HAVE_LIBMYPAINT
void tools_mybrush_radius_cmd_callback (GtkAction *action,
gint value,
gpointer data);
#endif
void tools_fg_select_brush_size_cmd_callback (GtkAction *action,
gint value,

View File

@ -85,7 +85,6 @@ enum
PROP_PLAYGROUND_NPD_TOOL,
PROP_PLAYGROUND_HANDLE_TRANSFORM_TOOL,
PROP_PLAYGROUND_MYBRUSH_TOOL,
PROP_PLAYGROUND_SEAMLESS_CLONE_TOOL,
PROP_HIDE_DOCKS,
@ -304,13 +303,6 @@ 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);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class,
PROP_PLAYGROUND_SEAMLESS_CLONE_TOOL,
"playground-seamless-clone-tool",
@ -539,9 +531,6 @@ 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_PLAYGROUND_SEAMLESS_CLONE_TOOL:
gui_config->playground_seamless_clone_tool = g_value_get_boolean (value);
break;
@ -692,9 +681,6 @@ 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_PLAYGROUND_SEAMLESS_CLONE_TOOL:
g_value_set_boolean (value, gui_config->playground_seamless_clone_tool);
break;

View File

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

View File

@ -21,9 +21,7 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gegl.h>
#ifdef HAVE_LIBMYPAINT
#include <mypaint-brush.h>
#endif
#include "core-types.h"
@ -243,8 +241,6 @@ gimp_mybrush_get_standard (GimpContext *context)
static void
gimp_mybrush_load_json (GimpMybrush *brush)
{
#ifdef HAVE_LIBMYPAINT
GFile *file = gimp_data_get_file (GIMP_DATA (brush));
MyPaintBrush *mypaint_brush = mypaint_brush_new ();
@ -284,8 +280,6 @@ gimp_mybrush_load_json (GimpMybrush *brush)
mypaint_brush_unref (mypaint_brush);
#endif
brush->priv->json_loaded = TRUE;
}

View File

@ -1313,7 +1313,6 @@ prefs_dialog_new (Gimp *gimp,
GObject *object;
GimpCoreConfig *core_config;
GimpDisplayConfig *display_config;
GimpGuiConfig *gui_config;
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (GIMP_IS_CONFIG (config), NULL);
@ -1321,7 +1320,6 @@ prefs_dialog_new (Gimp *gimp,
object = G_OBJECT (config);
core_config = GIMP_CORE_CONFIG (config);
display_config = GIMP_DISPLAY_CONFIG (config);
gui_config = GIMP_GUI_CONFIG (config);
dialog = gimp_dialog_new (_("Preferences"), "gimp-preferences",
NULL, 0,
@ -1600,12 +1598,6 @@ prefs_dialog_new (Gimp *gimp,
button = prefs_check_button_add (object, "playground-handle-transform-tool",
_("_Handle Transform tool"),
GTK_BOX (vbox2));
#ifdef HAVE_LIBMYPAINT
button = prefs_check_button_add (object, "playground-mybrush-tool",
_("_MyPaint Brush tool"),
GTK_BOX (vbox2));
#endif
button = prefs_check_button_add (object, "playground-seamless-clone-tool",
_("_Seamless Clone tool"),
GTK_BOX (vbox2));
@ -2755,12 +2747,10 @@ prefs_dialog_new (Gimp *gimp,
GIMP_HELP_PREFS_FOLDERS_TOOL_PRESETS,
N_("Select Tool Preset Folders"),
"tool-preset-path", "tool-preset-path-writable" },
#ifdef HAVE_LIBMYPAINT
{ N_("MyPaint Brushes"), N_("MyPaint Brush Folders"), "folders-mypaint-brushes",
GIMP_HELP_PREFS_FOLDERS_MYPAINT_BRUSHES,
N_("Select MyPaint Brush Folders"),
"mypaint-brush-path", "mypaint-brush-path-writable" },
#endif
{ N_("Plug-Ins"), N_("Plug-In Folders"), "folders-plug-ins",
GIMP_HELP_PREFS_FOLDERS_PLUG_INS,
N_("Select Plug-In Folders"),
@ -2796,14 +2786,6 @@ prefs_dialog_new (Gimp *gimp,
GtkWidget *editor;
gchar *icon_name;
#ifdef HAVE_LIBMYPAINT
if (! gui_config->playground_mybrush_tool &&
! strcmp (paths[i].path_property_name, "mypaint-brush-path"))
{
continue;
}
#endif
icon_name = g_strconcat ("gimp-prefs-", paths[i].icon, NULL);
vbox = gimp_prefs_box_add_page (GIMP_PREFS_BOX (prefs_box),
icon_name,

View File

@ -65,9 +65,7 @@ gimp_paint_init (Gimp *gimp)
gimp_perspective_clone_register,
gimp_heal_register,
gimp_clone_register,
#ifdef HAVE_LIBMYPAINT
gimp_mybrush_core_register,
#endif
gimp_ink_register,
gimp_airbrush_register,
gimp_eraser_register,

View File

@ -17,8 +17,6 @@
#include "config.h"
#ifdef HAVE_LIBMYPAINT
#include <string.h>
#include <cairo.h>
@ -38,8 +36,6 @@
#include "gegl/gimp-gegl-utils.h"
#include "config/gimpguiconfig.h" /* playground */
#include "core/gimp.h"
#include "core/gimp-palettes.h"
#include "core/gimpdrawable.h"
@ -95,13 +91,12 @@ void
gimp_mybrush_core_register (Gimp *gimp,
GimpPaintRegisterCallback callback)
{
if (GIMP_GUI_CONFIG (gimp->config)->playground_mybrush_tool)
(* callback) (gimp,
GIMP_TYPE_MYBRUSH_CORE,
GIMP_TYPE_MYBRUSH_OPTIONS,
"gimp-mybrush",
_("Mybrush"),
"gimp-tool-mypaint-brush");
(* callback) (gimp,
GIMP_TYPE_MYBRUSH_CORE,
GIMP_TYPE_MYBRUSH_OPTIONS,
"gimp-mybrush",
_("Mybrush"),
"gimp-tool-mypaint-brush");
}
static void
@ -305,5 +300,3 @@ gimp_mybrush_core_motion (GimpPaintCore *paint_core,
gimp_drawable_update (drawable, rect.x, rect.y, rect.width, rect.height);
}
}
#endif

View File

@ -15,15 +15,18 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#ifdef HAVE_LIBMYPAINT
#include <gegl.h>
#include "gimpmybrushsurface.h"
#include <mypaint-surface.h>
#include <math.h>
#include "paint-types.h"
#include "libgimpmath/gimpmath.h"
#include "gimpmybrushsurface.h"
struct _GimpMybrushSurface
{
@ -455,5 +458,3 @@ gimp_mypaint_surface_new (GeglBuffer *buffer,
return surface;
}
#endif

View File

@ -15,13 +15,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_LIBMYPAINT
#ifndef __GIMP_MYBRUSH_SURFACE_H__
#define __GIMP_MYBRUSH_SURFACE_H__
#include "paint-types.h"
#include "core/gimpobject.h"
typedef struct _GimpMybrushSurface GimpMybrushSurface;
@ -31,5 +27,3 @@ gimp_mypaint_surface_new (GeglBuffer *buffer,
#endif /* __GIMP_MYBRUSH_SURFACE_H__ */
#endif

View File

@ -145,9 +145,7 @@ gimp_tools_init (Gimp *gimp)
gimp_perspective_clone_tool_register,
gimp_heal_tool_register,
gimp_clone_tool_register,
#ifdef HAVE_LIBMYPAINT
gimp_mybrush_tool_register,
#endif
gimp_ink_tool_register,
gimp_airbrush_tool_register,
gimp_eraser_tool_register,
@ -550,12 +548,10 @@ gimp_tools_register (GType tool_type,
{
paint_core_name = "gimp-ink";
}
#ifdef HAVE_LIBMYPAINT
else if (tool_type == GIMP_TYPE_MYBRUSH_TOOL)
{
paint_core_name = "gimp-mybrush";
}
#endif
else
{
paint_core_name = "gimp-paintbrush";

View File

@ -25,8 +25,6 @@
#include "tools-types.h"
#include "config/gimpguiconfig.h" /* playground */
#include "paint/gimpmybrushoptions.h"
#include "core/gimp.h"
@ -59,25 +57,21 @@ void
gimp_mybrush_tool_register (GimpToolRegisterCallback callback,
gpointer 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_PROP_MASK_FOREGROUND |
GIMP_CONTEXT_PROP_MASK_BACKGROUND |
GIMP_CONTEXT_PROP_MASK_OPACITY |
GIMP_CONTEXT_PROP_MASK_PAINT_MODE |
GIMP_CONTEXT_PROP_MASK_MYBRUSH,
"gimp-mybrush-tool",
_("MyPaint Brush"),
_("MyPaint Brush Tool: Use MyPaint brushes in GIMP"),
N_("M_yPaint Brush"), "Y",
NULL, GIMP_HELP_TOOL_MYPAINT_BRUSH,
GIMP_STOCK_TOOL_MYPAINT_BRUSH,
data);
(* callback) (GIMP_TYPE_MYBRUSH_TOOL,
GIMP_TYPE_MYBRUSH_OPTIONS,
gimp_mybrush_options_gui,
GIMP_CONTEXT_PROP_MASK_FOREGROUND |
GIMP_CONTEXT_PROP_MASK_BACKGROUND |
GIMP_CONTEXT_PROP_MASK_OPACITY |
GIMP_CONTEXT_PROP_MASK_PAINT_MODE |
GIMP_CONTEXT_PROP_MASK_MYBRUSH,
"gimp-mybrush-tool",
_("MyPaint Brush"),
_("MyPaint Brush Tool: Use MyPaint brushes in GIMP"),
N_("M_yPaint Brush"), "Y",
NULL, GIMP_HELP_TOOL_MYPAINT_BRUSH,
GIMP_STOCK_TOOL_MYPAINT_BRUSH,
data);
}
static void

View File

@ -41,9 +41,7 @@
#include "gimperasertool.h"
#include "gimphealtool.h"
#include "gimpinktool.h"
#ifdef HAVE_LIBMYPAINT
#include "gimpmybrushtool.h"
#endif
#include "gimppaintoptions-gui.h"
#include "gimppenciltool.h"
#include "gimpperspectiveclonetool.h"
@ -118,9 +116,7 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
tool_type == GIMP_TYPE_CONVOLVE_TOOL ||
tool_type == GIMP_TYPE_DODGE_BURN_TOOL ||
tool_type == GIMP_TYPE_HEAL_TOOL ||
#ifdef HAVE_LIBMYPAINT
tool_type == GIMP_TYPE_MYBRUSH_TOOL ||
#endif
tool_type == GIMP_TYPE_SMUDGE_TOOL)
{
gtk_widget_set_sensitive (menu, FALSE);
@ -135,11 +131,8 @@ gimp_paint_options_gui (GimpToolOptions *tool_options)
gtk_widget_show (scale);
/* temp debug foo */
if (g_type_is_a (tool_type, GIMP_TYPE_PAINT_TOOL)
#ifdef HAVE_LIBMYPAINT
&& tool_type != GIMP_TYPE_MYBRUSH_TOOL
#endif
)
if (g_type_is_a (tool_type, GIMP_TYPE_PAINT_TOOL) &&
tool_type != GIMP_TYPE_MYBRUSH_TOOL)
{
GtkWidget *button;

View File

@ -1475,25 +1475,12 @@ AC_SUBST(FILE_EXR)
AM_CONDITIONAL(HAVE_OPENEXR, test "x$have_openexr" = xyes)
######################
# Check for libmypaint
######################
AC_ARG_WITH(libmypaint, [ --without-libmypaint build without libmypaint support])
have_libmypaint=no
if test "x$with_libmypaint" != xno; then
PKG_CHECK_MODULES(LIBMYPAINTGEGL,
libmypaint-gegl >= libmypaint_required_version,
AC_DEFINE(HAVE_LIBMYPAINT, 1, [Define to 1 if libmypaint-gegl is available])
have_libmypaint=yes,
[have_libmypaint="no (libmypaint-gegl not found)"])
fi
AC_SUBST(LIBMYPAINTGEGL_CFLAGS)
AC_SUBST(LIBMYPAINTGEGL_LIBS)
AM_CONDITIONAL(HAVE_LIBMYPAINT, test "x$have_libmypaint" = xyes)
PKG_CHECK_MODULES(LIBMYPAINTGEGL, libmypaint-gegl >= libmypaint_required_version)
##################
@ -2448,7 +2435,6 @@ Extra Binaries:
Optional Features:
Language selection: $have_iso_codes
MyPaint brushes: $have_libmypaint
Optional Plug-Ins:
Ascii Art: $have_libaa

View File

@ -592,9 +592,7 @@
<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" />