Commit 071ede91 authored by Michael Natterer's avatar Michael Natterer 😴

app: first draft of GimpMybrushTool, which uses MyPaint brushes

parent 7c37b846
......@@ -165,6 +165,7 @@ gimpconsoleldadd = \
file/libappfile.a \
text/libapptext.a \
paint/libapppaint.a \
paint/libmypaint.a \
operations/libappoperations.a \
gegl/libappgegl.a \
config/libappconfig.a \
......@@ -187,6 +188,7 @@ gimpconsoleldadd = \
$(GEXIV2_LIBS) \
$(LCMS_LIBS) \
$(Z_LIBS) \
$(JSON_C_LIBS) \
$(INTLLIBS) \
$(RT_LIBS) \
$(libm)
......
## Process this file with automake to produce Makefile.in
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"Gimp-Paint\" \
-I$(top_builddir) \
-I$(top_srcdir) \
-I$(top_builddir)/app \
-I$(top_srcdir)/app \
$(CAIRO_CFLAGS) \
$(GEGL_CFLAGS) \
$(GDK_PIXBUF_CFLAGS) \
-DG_LOG_DOMAIN=\"Gimp-Paint\" \
-I$(top_builddir) \
-I$(top_srcdir) \
-I$(top_builddir)/app \
-I$(top_srcdir)/app \
-I$(top_srcdir)/app/paint/libmypaint \
-std=c99 \
-DHAVE_JSON_C=1 \
$(JSON_C_CFLAGS) \
$(CAIRO_CFLAGS) \
$(GEGL_CFLAGS) \
$(GDK_PIXBUF_CFLAGS) \
-I$(includedir)
noinst_LIBRARIES = libapppaint.a
noinst_LIBRARIES = libmypaint.a libapppaint.a
libmypaint_a_SOURCES = \
libmypaint/mapping.c \
libmypaint/mapping.h \
libmypaint/helpers.c \
libmypaint/helpers.h \
libmypaint/brushmodes.c \
libmypaint/brushmodes.h \
libmypaint/fifo.c \
libmypaint/fifo.h \
libmypaint/operationqueue.c \
libmypaint/operationqueue.h \
libmypaint/rng-double.c \
libmypaint/rng-double.h \
libmypaint/utils.c \
libmypaint/utils.h \
libmypaint/tilemap.c \
libmypaint/tilemap.h \
libmypaint/mypaint.c \
libmypaint/mypaint.h \
libmypaint/mypaint-brush.c \
libmypaint/mypaint-brush.h \
libmypaint/mypaint-brush-settings.c \
libmypaint/mypaint-brush-settings.h \
libmypaint/mypaint-fixed-tiled-surface.c \
libmypaint/mypaint-fixed-tiled-surface.h \
libmypaint/mypaint-surface.c \
libmypaint/mypaint-surface.h \
libmypaint/mypaint-tiled-surface.c \
libmypaint/mypaint-tiled-surface.h \
libmypaint/mypaint-rectangle.c \
libmypaint/mypaint-rectangle.h \
libmypaint/gegl/mypaint-gegl-surface.c \
libmypaint/gegl/mypaint-gegl-surface.h
libapppaint_a_sources = \
paint-enums.h \
......@@ -51,6 +89,10 @@ libapppaint_a_sources = \
gimpinkoptions.h \
gimpinkundo.c \
gimpinkundo.h \
gimpmybrush.c \
gimpmybrush.h \
gimpmybrushoptions.c \
gimpmybrushoptions.h \
gimppaintcore.c \
gimppaintcore.h \
gimppaintcore-loops.c \
......
......@@ -34,6 +34,7 @@
#include "gimperaser.h"
#include "gimpheal.h"
#include "gimpink.h"
#include "gimpmybrush.h"
#include "gimppaintoptions.h"
#include "gimppaintbrush.h"
#include "gimppencil.h"
......@@ -64,6 +65,7 @@ gimp_paint_init (Gimp *gimp)
gimp_perspective_clone_register,
gimp_heal_register,
gimp_clone_register,
gimp_mybrush_register,
gimp_ink_register,
gimp_airbrush_register,
gimp_eraser_register,
......
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <string.h>
#include <cairo.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gegl.h>
#include "libmypaint/mypaint-brush.h"
#include "libmypaint/mypaint-tiled-surface.h"
#include "libmypaint/gegl/mypaint-gegl-surface.h"
#include "libgimpmath/gimpmath.h"
#include "libgimpcolor/gimpcolor.h"
#include "paint-types.h"
#include "gegl/gimp-gegl-utils.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "core/gimpimage-undo.h"
#include "core/gimptempbuf.h"
#include "gimpmybrushoptions.h"
#include "gimpmybrush.h"
#include "gimp-intl.h"
struct _GimpMybrushPrivate
{
MyPaintGeglTiledSurface *surface;
MyPaintBrush *brush;
};
/* local function prototypes */
static void gimp_mybrush_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
const GimpCoords *coords,
GimpPaintState paint_state,
guint32 time);
static void gimp_mybrush_motion (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
const GimpCoords *coords,
guint32 time);
G_DEFINE_TYPE (GimpMybrush, gimp_mybrush, GIMP_TYPE_PAINT_CORE)
#define parent_class gimp_mybrush_parent_class
void
gimp_mybrush_register (Gimp *gimp,
GimpPaintRegisterCallback callback)
{
(* callback) (gimp,
GIMP_TYPE_MYBRUSH,
GIMP_TYPE_MYBRUSH_OPTIONS,
"gimp-mybrush",
_("Mybrush"),
"gimp-tool-mybrush");
}
static void
gimp_mybrush_class_init (GimpMybrushClass *klass)
{
GimpPaintCoreClass *paint_core_class = GIMP_PAINT_CORE_CLASS (klass);
paint_core_class->paint = gimp_mybrush_paint;
g_type_class_add_private (klass, sizeof (GimpMybrushPrivate));
}
static void
gimp_mybrush_init (GimpMybrush *mybrush)
{
mybrush->private = G_TYPE_INSTANCE_GET_PRIVATE (mybrush,
GIMP_TYPE_MYBRUSH,
GimpMybrushPrivate);
}
static void
gimp_mybrush_paint (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
const GimpCoords *coords,
GimpPaintState paint_state,
guint32 time)
{
GimpMybrush *mybrush = GIMP_MYBRUSH (paint_core);
GimpMybrushOptions *options = GIMP_MYBRUSH_OPTIONS (paint_options);
switch (paint_state)
{
case GIMP_PAINT_STATE_INIT:
mybrush->private->surface = mypaint_gegl_tiled_surface_new ();
mypaint_gegl_tiled_surface_set_buffer (mybrush->private->surface,
gimp_drawable_get_buffer (drawable));
mybrush->private->brush = mypaint_brush_new ();
mypaint_brush_from_defaults (mybrush->private->brush);
if (options->mybrush)
{
gchar *string;
gsize length;
if (g_file_get_contents (options->mybrush,
&string, &length, NULL))
{
if (! mypaint_brush_from_string (mybrush->private->brush, string))
g_printerr ("Failed to deserialize MyPaint brush\n");
g_free (string);
}
}
mypaint_brush_new_stroke (mybrush->private->brush);
break;
case GIMP_PAINT_STATE_MOTION:
gimp_mybrush_motion (paint_core, drawable, paint_options, coords, time);
break;
case GIMP_PAINT_STATE_FINISH:
mypaint_surface_unref ((MyPaintSurface *) mybrush->private->surface);
mybrush->private->surface = NULL;
mypaint_brush_unref (mybrush->private->brush);
mybrush->private->brush = NULL;
break;
}
}
static void
gimp_mybrush_motion (GimpPaintCore *paint_core,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
const GimpCoords *coords,
guint32 time)
{
GimpMybrush *mybrush = GIMP_MYBRUSH (paint_core);
GimpMybrushOptions *options = GIMP_MYBRUSH_OPTIONS (paint_options);
GimpContext *context = GIMP_CONTEXT (paint_options);
GimpComponentMask active_mask;
GimpRGB fg;
GimpHSV hsv;
MyPaintRectangle rect;
active_mask = gimp_drawable_get_active_mask (drawable);
mypaint_brush_set_base_value (mybrush->private->brush,
MYPAINT_BRUSH_SETTING_LOCK_ALPHA,
(active_mask & GIMP_COMPONENT_ALPHA) ?
FALSE : TRUE);
gimp_context_get_foreground (context, &fg);
gimp_rgb_to_hsv (&fg, &hsv);
mypaint_brush_set_base_value (mybrush->private->brush,
MYPAINT_BRUSH_SETTING_COLOR_H,
hsv.h);
mypaint_brush_set_base_value (mybrush->private->brush,
MYPAINT_BRUSH_SETTING_COLOR_S,
hsv.s);
mypaint_brush_set_base_value (mybrush->private->brush,
MYPAINT_BRUSH_SETTING_COLOR_V,
hsv.v);
mypaint_brush_set_base_value (mybrush->private->brush,
MYPAINT_BRUSH_SETTING_OPAQUE,
gimp_context_get_opacity (context));
mypaint_brush_set_base_value (mybrush->private->brush,
MYPAINT_BRUSH_SETTING_RADIUS_LOGARITHMIC,
options->radius);
mypaint_brush_set_base_value (mybrush->private->brush,
MYPAINT_BRUSH_SETTING_HARDNESS,
options->hardness);
mypaint_surface_begin_atomic ((MyPaintSurface *) mybrush->private->surface);
mypaint_brush_stroke_to (mybrush->private->brush,
(MyPaintSurface *) mybrush->private->surface,
coords->x,
coords->y,
coords->pressure,
coords->xtilt,
coords->ytilt,
1);
mypaint_surface_end_atomic ((MyPaintSurface *) mybrush->private->surface,
&rect);
g_printerr ("painted rect: %d %d %d %d\n",
rect.x, rect.y, rect.width, rect.height);
paint_core->x1 = MIN (paint_core->x1, rect.x);
paint_core->y1 = MIN (paint_core->y1, rect.y);
paint_core->x2 = MAX (paint_core->x2, rect.x + rect.width);
paint_core->y2 = MAX (paint_core->y2, rect.y + rect.height);
gimp_drawable_update (drawable, rect.x, rect.y, rect.width, rect.height);
}
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_MYBRUSH_H__
#define __GIMP_MYBRUSH_H__
#include "gimppaintcore.h"
#define GIMP_TYPE_MYBRUSH (gimp_mybrush_get_type ())
#define GIMP_MYBRUSH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_MYBRUSH, GimpMybrush))
#define GIMP_MYBRUSH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_MYBRUSH, GimpMybrushClass))
#define GIMP_IS_MYBRUSH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_MYBRUSH))
#define GIMP_IS_MYBRUSH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_MYBRUSH))
#define GIMP_MYBRUSH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_MYBRUSH, GimpMybrushClass))
typedef struct _GimpMybrushPrivate GimpMybrushPrivate;
typedef struct _GimpMybrushClass GimpMybrushClass;
struct _GimpMybrush
{
GimpPaintCore parent_instance;
GimpMybrushPrivate *private;
};
struct _GimpMybrushClass
{
GimpPaintCoreClass parent_class;
};
void gimp_mybrush_register (Gimp *gimp,
GimpPaintRegisterCallback callback);
GType gimp_mybrush_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_MYBRUSH_H__ */
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gegl.h>
#include "libgimpconfig/gimpconfig.h"
#include "paint-types.h"
#include "core/gimp.h"
#include "core/gimpdrawable.h"
#include "core/gimppaintinfo.h"
#include "gimpmybrushoptions.h"
#include "gimp-intl.h"
enum
{
PROP_0,
PROP_RADIUS,
PROP_HARDNESS,
PROP_MYBRUSH
};
static void gimp_mybrush_options_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_mybrush_options_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
G_DEFINE_TYPE (GimpMybrushOptions, gimp_mybrush_options, GIMP_TYPE_PAINT_OPTIONS)
static void
gimp_mybrush_options_class_init (GimpMybrushOptionsClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->set_property = gimp_mybrush_options_set_property;
object_class->get_property = gimp_mybrush_options_get_property;
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_RADIUS,
"radius", _("Radius"),
-2.0, 6.0, 1.0,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_HARDNESS,
"hardness", NULL,
0.0, 1.0, 1.0,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_MYBRUSH,
"mybrush", NULL,
NULL,
GIMP_PARAM_STATIC_STRINGS);
}
static void
gimp_mybrush_options_init (GimpMybrushOptions *options)
{
}
static void
gimp_mybrush_options_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
GimpMybrushOptions *options = GIMP_MYBRUSH_OPTIONS (object);
switch (property_id)
{
case PROP_RADIUS:
options->radius = g_value_get_double (value);
break;
case PROP_HARDNESS:
options->hardness = g_value_get_double (value);
break;
case PROP_MYBRUSH:
g_free (options->mybrush);
options->mybrush = g_value_dup_string (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
gimp_mybrush_options_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
GimpMybrushOptions *options = GIMP_MYBRUSH_OPTIONS (object);
switch (property_id)
{
case PROP_RADIUS:
g_value_set_double (value, options->radius);
break;
case PROP_HARDNESS:
g_value_set_double (value, options->hardness);
break;
case PROP_MYBRUSH:
g_value_set_string (value, options->mybrush);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_MYBRUSH_OPTIONS_H__
#define __GIMP_MYBRUSH_OPTIONS_H__
#include "gimppaintoptions.h"
#define GIMP_TYPE_MYBRUSH_OPTIONS (gimp_mybrush_options_get_type ())
#define GIMP_MYBRUSH_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_MYBRUSH_OPTIONS, GimpMybrushOptions))
#define GIMP_MYBRUSH_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_MYBRUSH_OPTIONS, GimpMybrushOptionsClass))
#define GIMP_IS_MYBRUSH_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_MYBRUSH_OPTIONS))
#define GIMP_IS_MYBRUSH_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_MYBRUSH_OPTIONS))
#define GIMP_MYBRUSH_OPTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_MYBRUSH_OPTIONS, GimpMybrushOptionsClass))
typedef struct _GimpMybrushOptionsClass GimpMybrushOptionsClass;
struct _GimpMybrushOptions
{
GimpPaintOptions parent_instance;
gdouble radius;
gdouble hardness;
gchar *mybrush;
};
struct _GimpMybrushOptionsClass
{
GimpPaintOptionsClass parent_instance;
};
GType gimp_mybrush_options_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_MYBRUSH_OPTIONS_H__ */
......@@ -36,6 +36,7 @@ typedef struct _GimpDodgeBurn GimpDodgeBurn;
typedef struct _GimpEraser GimpEraser;
typedef struct _GimpHeal GimpHeal;
typedef struct _GimpInk GimpInk;
typedef struct _GimpMybrush GimpMybrush;
typedef struct _GimpPaintbrush GimpPaintbrush;
typedef struct _GimpPencil GimpPencil;
typedef struct _GimpPerspectiveClone GimpPerspectiveClone;
......@@ -53,6 +54,7 @@ typedef struct _GimpConvolveOptions GimpConvolveOptions;
typedef struct _GimpDodgeBurnOptions GimpDodgeBurnOptions;
typedef struct _GimpEraserOptions GimpEraserOptions;
typedef struct _GimpInkOptions GimpInkOptions;
typedef struct _GimpMybrushOptions GimpMybrushOptions;
typedef struct _GimpPencilOptions GimpPencilOptions;
typedef struct _GimpPerspectiveCloneOptions GimpPerspectiveCloneOptions;
typedef struct _GimpSmudgeOptions GimpSmudgeOptions;
......
......@@ -136,6 +136,10 @@ libapptools_a_sources = \
gimpmoveoptions.h \
gimpmovetool.c \
gimpmovetool.h \
gimpmybrushoptions-gui.c \
gimpmybrushoptions-gui.h \
gimpmybrushtool.c \
gimpmybrushtool.h \
gimpnpointdeformationoptions.c \
gimpnpointdeformationoptions.h \
gimpnpointdeformationtool.c \
......
......@@ -71,6 +71,7 @@
#include "gimpmagnifytool.h"
#include "gimpmeasuretool.h"
#include "gimpmovetool.h"
#include "gimpmybrushtool.h"
#include "gimpnpointdeformationtool.h"
#include "gimppaintbrushtool.h"
#include "gimppenciltool.h"
......@@ -144,6 +145,7 @@ gimp_tools_init (Gimp *gimp)
gimp_perspective_clone_tool_register,
gimp_heal_tool_register,
gimp_clone_tool_register,
gimp_mybrush_tool_register,
gimp_ink_tool_register,
gimp_airbrush_tool_register,
gimp_eraser_tool_register,
......@@ -546,6 +548,10 @@ gimp_tools_register (GType tool_type,
{
paint_core_name = "gimp-ink";
}
else if (tool_type == GIMP_TYPE_MYBRUSH_TOOL)
{
paint_core_name = "gimp-mybrush";
}
else
{
paint_core_name = "gimp-paintbrush";
......
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "tools-types.h"
#include "paint/gimpmybrushoptions.h"
#include "widgets/gimppropwidgets.h"
#include "gimpmybrushoptions-gui.h"
#include "gimppaintoptions-gui.h"
#include "gimp-intl.h"
static void
gimp_mybrush_options_load_brush (const GimpDatafileData *file_data,
gpointer user_data)
{
if (gimp_datafiles_check_extension (file_data->basename, ".myb"))
{
GtkListStore *store = user_data;
GtkTreeIter iter = { 0, };
GdkPixbuf *pixbuf = NULL;
gchar *filename;
gchar *basename;
gchar *preview_filename;
filename = g_strdup (file_data->filename);
g_object_weak_ref (G_OBJECT (store), (GWeakNotify) g_free, filename);
basename = g_strndup (filename, strlen (filename) - 4);
preview_filename = g_strconcat (basename, "_prev.png", NULL);
g_free (basename);
pixbuf = gdk_pixbuf_new_from_file (preview_filename, NULL);
g_free (preview_filename);
if (pixbuf)
{
GdkPixbuf *scaled;
gint width = gdk_pixbuf_get_width (pixbuf);
gint height = gdk_pixbuf_get_height (pixbuf);
gdouble factor = 48.0 / height;
scaled = gdk_pixbuf_scale_simple (pixbuf,
width * factor,
height * factor,
GDK_INTERP_NEAREST);
g_object_unref (pixbuf);
pixbuf = scaled;
}
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
GIMP_INT_STORE_LABEL, file_data->basename,
GIMP_INT_STORE_PIXBUF, pixbuf,
GIMP_INT_STORE_USER_DATA, filename,
-1);
if (pixbuf)
g_object_unref (pixbuf);
}
}
static void
gimp_mybrush_options_load_recursive (const GimpDatafileData *file_data,
gpointer user_data)
{
gimp_datafiles_read_directories (file_data->filename,
G_FILE_TEST_IS_REGULAR,
gimp_mybrush_options_load_brush,
user_data);
}
static void
gimp_mybrush_options_brush_changed (GtkComboBox *combo,
GObject *config)
{
GtkTreeIter iter;
if (gtk_combo_box_get_active_iter (combo, &iter))
{
GtkTreeModel *model = gtk_combo_box_get_model (combo);
const gchar *brush;
gtk_tree_model_get (model, &iter,
GIMP_INT_STORE_USER_DATA, &brush,
-1);