Commit 52179007 authored by Jehan's avatar Jehan Committed by Michael Natterer

configure/app: libmypaint becomes an optional dependency.

parent 5460c414
......@@ -187,6 +187,7 @@ 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_MYBRUSH,
......@@ -194,6 +195,7 @@ static const GimpEnumActionEntry tools_mybrush_radius_actions[] =
GIMP_ACTION_SELECT_SET, TRUE,
NULL }
};
#endif
static const GimpEnumActionEntry tools_foreground_select_brush_size_actions[] =
{
......@@ -507,11 +509,13 @@ 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_foreground_select_brush_size_actions,
......
......@@ -294,6 +294,7 @@ tools_airbrush_flow_cmd_callback (GtkAction *action,
}
}
#ifdef HAVE_LIBMYPAINT
void
tools_mybrush_radius_cmd_callback (GtkAction *action,
gint value,
......@@ -314,6 +315,7 @@ 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,
......
......@@ -54,9 +54,11 @@ 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,
......
......@@ -1475,9 +1475,11 @@ 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
}
......
......@@ -65,7 +65,9 @@ gimp_paint_init (Gimp *gimp)
gimp_perspective_clone_register,
gimp_heal_register,
gimp_clone_register,
#ifdef HAVE_LIBMYPAINT
gimp_mybrush_register,
#endif
gimp_ink_register,
gimp_airbrush_register,
gimp_eraser_register,
......
......@@ -17,6 +17,8 @@
#include "config.h"
#ifdef HAVE_LIBMYPAINT
#include <string.h>
#include <cairo.h>
......@@ -249,3 +251,5 @@ gimp_mybrush_motion (GimpPaintCore *paint_core,
gimp_drawable_update (drawable, rect.x, rect.y, rect.width, rect.height);
}
}
#endif
......@@ -15,6 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_LIBMYPAINT
#ifndef __GIMP_MYBRUSH_H__
#define __GIMP_MYBRUSH_H__
......@@ -53,3 +55,5 @@ GType gimp_mybrush_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_MYBRUSH_H__ */
#endif
......@@ -17,6 +17,8 @@
#include "config.h"
#ifdef HAVE_LIBMYPAINT
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gegl.h>
......@@ -134,3 +136,5 @@ gimp_mybrush_options_get_property (GObject *object,
break;
}
}
#endif
......@@ -15,6 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_LIBMYPAINT
#ifndef __GIMP_MYBRUSH_OPTIONS_H__
#define __GIMP_MYBRUSH_OPTIONS_H__
......@@ -51,3 +53,5 @@ GType gimp_mybrush_options_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_MYBRUSH_OPTIONS_H__ */
#endif
......@@ -145,7 +145,9 @@ 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,
......@@ -548,10 +550,12 @@ 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";
......
......@@ -17,6 +17,8 @@
#include "config.h"
#ifdef HAVE_LIBMYPAINT
#include <gegl.h>
#include <gtk/gtk.h>
......@@ -164,3 +166,5 @@ gimp_mybrush_options_gui (GimpToolOptions *tool_options)
return vbox;
}
#endif
......@@ -15,6 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_LIBMYPAINT
#ifndef __GIMP_MYBRUSH_OPTIONS_GUI_H__
#define __GIMP_MYBRUSH_OPTIONS_GUI_H__
......@@ -23,3 +25,5 @@ GtkWidget * gimp_mybrush_options_gui (GimpToolOptions *tool_options);
#endif /* __GIMP_MYBRUSH_OPTIONS_GUI_H__ */
#endif
......@@ -17,6 +17,8 @@
#include "config.h"
#ifdef HAVE_LIBMYPAINT
#include <gegl.h>
#include <gtk/gtk.h>
......@@ -130,3 +132,5 @@ gimp_mybrush_tool_get_outline (GimpPaintTool *paint_tool,
return NULL;
}
#endif
......@@ -15,6 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_LIBMYPAINT
#ifndef __GIMP_MYBRUSH_TOOL_H__
#define __GIMP_MYBRUSH_TOOL_H__
......@@ -53,3 +55,5 @@ GType gimp_mybrush_tool_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_MYBRUSH_TOOL_H__ */
#endif
......@@ -41,7 +41,9 @@
#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"
......@@ -116,7 +118,9 @@ 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);
......@@ -131,8 +135,11 @@ 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) &&
tool_type != GIMP_TYPE_MYBRUSH_TOOL)
if (g_type_is_a (tool_type, GIMP_TYPE_PAINT_TOOL)
#ifdef HAVE_LIBMYPAINT
&& tool_type != GIMP_TYPE_MYBRUSH_TOOL
#endif
)
{
GtkWidget *button;
......
......@@ -727,8 +727,6 @@ PKG_CHECK_MODULES(HARFBUZZ, harfbuzz >= harfbuzz_required_version)
PKG_CHECK_MODULES(GEXIV2, gexiv2 >= gexiv2_required_version)
PKG_CHECK_MODULES(LIBMYPAINTGEGL, libmypaint-gegl >= libmypaint_required_version)
##########################################
# Check for some special functions we need
##########################################
......@@ -1454,6 +1452,26 @@ 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)
##################
# Check for webkit
......@@ -2404,6 +2422,7 @@ Extra Binaries:
Optional Features:
Language selection: $have_iso_codes
MyPaint brushes: $have_libmypaint
Optional Plug-Ins:
Ascii Art: $have_libaa
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment