Commit c049f82e authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

made "tool-info" a G_PARAM_CONSTRUCT_ONLY property.

2003-08-30  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimptool.c: made "tool-info" a G_PARAM_CONSTRUCT_ONLY
	property.

	* app/tools/tool_manager.c (tool_manager_tool_changed): pass it to
	g_object_new() instead of setting it after tool creation.

	* app/tools/gimppainttool.[ch]
	* app/tools/gimptransformtool.[ch]: removed ugly
	"gboolean notify_connected" hacks and connect to the signals in
	GObject::constructor().

	* app/tools/gimppainttool.c (gimp_paint_tool_contstructor): create
	paint_tool->core here from tool->tool_info->paint_info->paint_type.

	* app/tools/gimpairbrushtool.c
	* app/tools/gimpclonetool.c
	* app/tools/gimpconvolvetool.c
	* app/tools/gimpdodgeburntool.c
	* app/tools/gimperasertool.c
	* app/tools/gimppaintbrushtool.c
	* app/tools/gimppenciltool.c
	* app/tools/gimpsmudgetool.c: changed accordingly. Removed lots of
	useless class_init functions. Converted tabs to spaces. Cleanup.
parent 2da93d69
2003-08-30 Michael Natterer <mitch@gimp.org>
* app/tools/gimptool.c: made "tool-info" a G_PARAM_CONSTRUCT_ONLY
property.
* app/tools/tool_manager.c (tool_manager_tool_changed): pass it to
g_object_new() instead of setting it after tool creation.
* app/tools/gimppainttool.[ch]
* app/tools/gimptransformtool.[ch]: removed ugly
"gboolean notify_connected" hacks and connect to the signals in
GObject::constructor().
* app/tools/gimppainttool.c (gimp_paint_tool_contstructor): create
paint_tool->core here from tool->tool_info->paint_info->paint_type.
* app/tools/gimpairbrushtool.c
* app/tools/gimpclonetool.c
* app/tools/gimpconvolvetool.c
* app/tools/gimpdodgeburntool.c
* app/tools/gimperasertool.c
* app/tools/gimppaintbrushtool.c
* app/tools/gimppenciltool.c
* app/tools/gimpsmudgetool.c: changed accordingly. Removed lots of
useless class_init functions. Converted tabs to spaces. Cleanup.
2003-08-30 Michael Natterer <mitch@gimp.org>
* app/core/gimpchannel.[ch] (gimp_channel_boundary)
......@@ -26,7 +26,6 @@
#include "core/gimptoolinfo.h"
#include "paint/gimpairbrush.h"
#include "paint/gimpairbrushoptions.h"
#include "widgets/gimphelp-ids.h"
......@@ -39,13 +38,8 @@
#include "gimp-intl.h"
static void gimp_airbrush_tool_class_init (GimpAirbrushToolClass *klass);
static void gimp_airbrush_tool_init (GimpAirbrushTool *airbrush);
static GtkWidget * gimp_airbrush_options_gui (GimpToolOptions *tool_options);
static GimpPaintbrushToolClass *parent_class = NULL;
static void gimp_airbrush_tool_init (GimpAirbrushTool *airbrush);
static GtkWidget * gimp_airbrush_options_gui (GimpToolOptions *tool_options);
/* functions */
......@@ -77,14 +71,14 @@ gimp_airbrush_tool_get_type (void)
static const GTypeInfo tool_info =
{
sizeof (GimpAirbrushToolClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_airbrush_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpAirbrushTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_airbrush_tool_init,
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
NULL, /* class_init */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpAirbrushTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_airbrush_tool_init,
};
tool_type = g_type_register_static (GIMP_TYPE_PAINTBRUSH_TOOL,
......@@ -95,16 +89,6 @@ gimp_airbrush_tool_get_type (void)
return tool_type;
}
static void
gimp_airbrush_tool_class_init (GimpAirbrushToolClass *klass)
{
GObjectClass *object_class;
object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
}
static void
gimp_airbrush_tool_init (GimpAirbrushTool *airbrush)
{
......@@ -117,7 +101,6 @@ gimp_airbrush_tool_init (GimpAirbrushTool *airbrush)
gimp_tool_control_set_tool_cursor (tool->control, GIMP_AIRBRUSH_TOOL_CURSOR);
paint_tool->pick_colors = TRUE;
paint_tool->core = g_object_new (GIMP_TYPE_AIRBRUSH, NULL);
}
......
......@@ -39,6 +39,7 @@
#include "core/gimpbrush.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "core/gimppaintinfo.h"
#include "core/gimptoolinfo.h"
#include "paint/gimppaintcore.h"
......@@ -66,6 +67,9 @@
static void gimp_paint_tool_class_init (GimpPaintToolClass *klass);
static void gimp_paint_tool_init (GimpPaintTool *paint_tool);
static GObject * gimp_paint_tool_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_paint_tool_finalize (GObject *object);
static void gimp_paint_tool_control (GimpTool *tool,
......@@ -161,6 +165,7 @@ gimp_paint_tool_class_init (GimpPaintToolClass *klass)
parent_class = g_type_class_peek_parent (klass);
object_class->constructor = gimp_paint_tool_constructor;
object_class->finalize = gimp_paint_tool_finalize;
tool_class->control = gimp_paint_tool_control;
......@@ -184,16 +189,44 @@ gimp_paint_tool_init (GimpPaintTool *paint_tool)
gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_EXACT);
paint_tool->pick_colors = FALSE;
paint_tool->draw_line = FALSE;
paint_tool->pick_colors = FALSE;
paint_tool->draw_line = FALSE;
paint_tool->notify_connected = FALSE;
paint_tool->draw_brush = TRUE;
paint_tool->draw_brush = TRUE;
paint_tool->brush_x = 0.0;
paint_tool->brush_y = 0.0;
paint_tool->brush_x = 0.0;
paint_tool->brush_y = 0.0;
paint_tool->core = NULL;
}
static GObject *
gimp_paint_tool_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
{
GObject *object;
GimpTool *tool;
GimpPaintTool *paint_tool;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
tool = GIMP_TOOL (object);
paint_tool = GIMP_PAINT_TOOL (object);
g_assert (GIMP_IS_TOOL_INFO (tool->tool_info));
paint_tool->draw_brush =
GIMP_DISPLAY_CONFIG (tool->tool_info->gimp->config)->show_brush_outline;
paint_tool->core = NULL;
g_signal_connect_object (tool->tool_info->gimp->config,
"notify::show-brush-outline",
G_CALLBACK (gimp_paint_tool_notify_brush),
paint_tool, 0);
paint_tool->core = g_object_new (tool->tool_info->paint_info->paint_type,
NULL);
return object;
}
static void
......@@ -570,19 +603,6 @@ gimp_paint_tool_oper_update (GimpTool *tool,
return;
}
if (! paint_tool->notify_connected)
{
paint_tool->draw_brush =
GIMP_DISPLAY_CONFIG (tool->tool_info->gimp->config)->show_brush_outline;
g_signal_connect_object (tool->tool_info->gimp->config,
"notify::show-brush-outline",
G_CALLBACK (gimp_paint_tool_notify_brush),
paint_tool, 0);
paint_tool->notify_connected = TRUE;
}
core = paint_tool->core;
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
......
......@@ -40,9 +40,7 @@ struct _GimpPaintTool
gboolean pick_colors; /* pick color if ctrl is pressed */
gboolean draw_line;
gboolean notify_connected;
gboolean draw_brush;
gdouble brush_x;
gdouble brush_y;
......
......@@ -51,6 +51,9 @@
static void gimp_clone_tool_class_init (GimpCloneToolClass *klass);
static void gimp_clone_tool_init (GimpCloneTool *tool);
static GObject * gimp_clone_tool_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_clone_tool_button_press (GimpTool *tool,
GimpCoords *coords,
guint32 time,
......@@ -114,18 +117,18 @@ gimp_clone_tool_get_type (void)
static const GTypeInfo tool_info =
{
sizeof (GimpCloneToolClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_clone_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpCloneTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_clone_tool_init,
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_clone_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpCloneTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_clone_tool_init,
};
tool_type = g_type_register_static (GIMP_TYPE_PAINT_TOOL,
"GimpCloneTool",
"GimpCloneTool",
&tool_info, 0);
}
......@@ -137,14 +140,18 @@ gimp_clone_tool_get_type (void)
static void
gimp_clone_tool_class_init (GimpCloneToolClass *klass)
{
GObjectClass *object_class;
GimpToolClass *tool_class;
GimpDrawToolClass *draw_tool_class;
object_class = G_OBJECT_CLASS (klass);
tool_class = GIMP_TOOL_CLASS (klass);
draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->constructor = gimp_clone_tool_constructor;
tool_class->button_press = gimp_clone_tool_button_press;
tool_class->motion = gimp_clone_tool_motion;
tool_class->cursor_update = gimp_clone_tool_cursor_update;
......@@ -157,22 +164,35 @@ gimp_clone_tool_init (GimpCloneTool *clone)
{
GimpTool *tool;
GimpPaintTool *paint_tool;
GimpClone *clone_core;
tool = GIMP_TOOL (clone);
paint_tool = GIMP_PAINT_TOOL (clone);
gimp_tool_control_set_tool_cursor (tool->control, GIMP_CLONE_TOOL_CURSOR);
}
static GObject *
gimp_clone_tool_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
{
GObject *object;
GimpPaintTool *paint_tool;
GimpClone *clone_core;
clone_core = g_object_new (GIMP_TYPE_CLONE, NULL);
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
paint_tool = GIMP_PAINT_TOOL (object);
clone_core = GIMP_CLONE (paint_tool->core);
clone_core->init_callback = gimp_clone_init_callback;
clone_core->finish_callback = gimp_clone_finish_callback;
clone_core->pretrace_callback = gimp_clone_pretrace_callback;
clone_core->posttrace_callback = gimp_clone_posttrace_callback;
clone_core->callback_data = clone;
clone_core->callback_data = object;
paint_tool->core = GIMP_PAINT_CORE (clone_core);
return object;
}
static void
......@@ -187,18 +207,11 @@ gimp_clone_tool_button_press (GimpTool *tool,
paint_tool = GIMP_PAINT_TOOL (tool);
if (state & GDK_CONTROL_MASK)
{
GIMP_CLONE (paint_tool->core)->set_source = TRUE;
}
GIMP_CLONE (paint_tool->core)->set_source = TRUE;
else
{
GIMP_CLONE (paint_tool->core)->set_source = FALSE;
}
GIMP_CLONE (paint_tool->core)->set_source = FALSE;
GIMP_TOOL_CLASS (parent_class)->button_press (tool,
coords,
time,
state,
GIMP_TOOL_CLASS (parent_class)->button_press (tool, coords, time, state,
gdisp);
}
......@@ -214,19 +227,11 @@ gimp_clone_tool_motion (GimpTool *tool,
paint_tool = GIMP_PAINT_TOOL (tool);
if (state & GDK_CONTROL_MASK)
{
GIMP_CLONE (paint_tool->core)->set_source = TRUE;
}
GIMP_CLONE (paint_tool->core)->set_source = TRUE;
else
{
GIMP_CLONE (paint_tool->core)->set_source = FALSE;
}
GIMP_CLONE (paint_tool->core)->set_source = FALSE;
GIMP_TOOL_CLASS (parent_class)->motion (tool,
coords,
time,
state,
gdisp);
GIMP_TOOL_CLASS (parent_class)->motion (tool, coords, time, state, gdisp);
}
void
......@@ -311,45 +316,29 @@ static void
gimp_clone_init_callback (GimpClone *clone,
gpointer data)
{
GimpCloneTool *clone_tool;
clone_tool = GIMP_CLONE_TOOL (data);
gimp_draw_tool_start (GIMP_DRAW_TOOL (clone_tool),
GIMP_TOOL (clone_tool)->gdisp);
gimp_draw_tool_start (GIMP_DRAW_TOOL (data),
GIMP_TOOL (data)->gdisp);
}
static void
gimp_clone_finish_callback (GimpClone *clone,
gpointer data)
{
GimpCloneTool *clone_tool;
clone_tool = GIMP_CLONE_TOOL (data);
gimp_draw_tool_stop (GIMP_DRAW_TOOL (clone_tool));
gimp_draw_tool_stop (GIMP_DRAW_TOOL (data));
}
static void
gimp_clone_pretrace_callback (GimpClone *clone,
gpointer data)
{
GimpCloneTool *clone_tool;
clone_tool = GIMP_CLONE_TOOL (data);
gimp_draw_tool_pause (GIMP_DRAW_TOOL (clone_tool));
gimp_draw_tool_pause (GIMP_DRAW_TOOL (data));
}
static void
gimp_clone_posttrace_callback (GimpClone *clone,
gpointer data)
{
GimpCloneTool *clone_tool;
clone_tool = GIMP_CLONE_TOOL (data);
gimp_draw_tool_resume (GIMP_DRAW_TOOL (clone_tool));
gimp_draw_tool_resume (GIMP_DRAW_TOOL (data));
}
......
......@@ -37,7 +37,6 @@
#include "core/gimpimage.h"
#include "core/gimptoolinfo.h"
#include "paint/gimpconvolve.h"
#include "paint/gimpconvolveoptions.h"
#include "widgets/gimphelp-ids.h"
......@@ -51,11 +50,11 @@
#include "gimp-intl.h"
#define FIELD_COLS 4
#define FIELD_COLS 4
#define MIN_BLUR 64 /* (8/9 original pixel) */
#define MAX_BLUR 0.25 /* (1/33 original pixel) */
#define MIN_SHARPEN -512
#define MAX_SHARPEN -64
#define MAX_BLUR 0.25 /* (1/33 original pixel) */
#define MIN_SHARPEN -512
#define MAX_SHARPEN -64
static void gimp_convolve_tool_class_init (GimpConvolveToolClass *klass);
......@@ -106,18 +105,18 @@ gimp_convolve_tool_get_type (void)
static const GTypeInfo tool_info =
{
sizeof (GimpConvolveToolClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_convolve_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpConvolveTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_convolve_tool_init,
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_convolve_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpConvolveTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_convolve_tool_init,
};
tool_type = g_type_register_static (GIMP_TYPE_PAINT_TOOL,
"GimpConvolveTool",
"GimpConvolveTool",
&tool_info, 0);
}
......@@ -154,9 +153,6 @@ gimp_convolve_tool_init (GimpConvolveTool *convolve)
GIMP_BLUR_TOOL_CURSOR);
gimp_tool_control_set_toggle_cursor_modifier (tool->control,
GIMP_CURSOR_MODIFIER_MINUS);
paint_tool->core = g_object_new (GIMP_TYPE_CONVOLVE, NULL);
}
static void
......
......@@ -26,7 +26,6 @@
#include "core/gimptoolinfo.h"
#include "paint/gimpdodgeburn.h"
#include "paint/gimpdodgeburnoptions.h"
#include "widgets/gimphelp-ids.h"
......@@ -86,18 +85,18 @@ gimp_dodgeburn_tool_get_type (void)
static const GTypeInfo tool_info =
{
sizeof (GimpDodgeBurnToolClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_dodgeburn_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpDodgeBurnTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_dodgeburn_tool_init,
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_dodgeburn_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpDodgeBurnTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_dodgeburn_tool_init,
};
tool_type = g_type_register_static (GIMP_TYPE_PAINT_TOOL,
"GimpDodgeBurnTool",
"GimpDodgeBurnTool",
&tool_info, 0);
}
......@@ -130,8 +129,6 @@ gimp_dodgeburn_tool_init (GimpDodgeBurnTool *dodgeburn)
GIMP_DODGE_TOOL_CURSOR);
gimp_tool_control_set_toggle_tool_cursor (tool->control,
GIMP_BURN_TOOL_CURSOR);
paint_tool->core = g_object_new (GIMP_TYPE_DODGE_BURN, NULL);
}
static void
......@@ -163,8 +160,7 @@ gimp_dodgeburn_tool_modifier_key (GimpTool *tool,
}
}
GIMP_TOOL_CLASS (parent_class)->modifier_key (tool,
key, press, state, gdisp);
GIMP_TOOL_CLASS (parent_class)->modifier_key (tool, key, press, state, gdisp);
}
static void
......@@ -177,7 +173,6 @@ gimp_dodgeburn_tool_cursor_update (GimpTool *tool,
options = GIMP_DODGE_BURN_OPTIONS (tool->tool_info->tool_options);
gimp_tool_control_set_toggle (tool->control, (options->type == GIMP_BURN));
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, gdisp);
......
......@@ -26,7 +26,6 @@
#include "core/gimptoolinfo.h"
#include "paint/gimperaser.h"
#include "paint/gimperaseroptions.h"
#include "widgets/gimphelp-ids.h"
......@@ -86,18 +85,18 @@ gimp_eraser_tool_get_type (void)
static const GTypeInfo tool_info =
{
sizeof (GimpEraserToolClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_eraser_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpEraserTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_eraser_tool_init,
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_eraser_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpEraserTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_eraser_tool_init,
};
tool_type = g_type_register_static (GIMP_TYPE_PAINT_TOOL,
"GimpEraserTool",
"GimpEraserTool",
&tool_info, 0);
}
......@@ -132,8 +131,6 @@ gimp_eraser_tool_init (GimpEraserTool *eraser)
GIMP_ERASER_TOOL_CURSOR);
gimp_tool_control_set_toggle_cursor_modifier (tool->control,
GIMP_CURSOR_MODIFIER_MINUS);
paint_tool->core = g_object_new (GIMP_TYPE_ERASER, NULL);
}
static void
......
......@@ -24,7 +24,6 @@
#include "tools-types.h"
#include "paint/gimppaintbrush.h"
#include "paint/gimppaintoptions.h"
#include "widgets/gimphelp-ids.h"
......@@ -36,11 +35,7 @@
#include "gimp-intl.h"
static void gimp_paintbrush_tool_class_init (GimpPaintbrushToolClass *klass);
static void gimp_paintbrush_tool_init (GimpPaintbrushTool *tool);
static GimpPaintToolClass *parent_class = NULL;
static void gimp_paintbrush_tool_init (GimpPaintbrushTool *tool);
/* public functions */
......@@ -73,18 +68,18 @@ gimp_paintbrush_tool_get_type (void)
static const GTypeInfo tool_info =
{
sizeof (GimpPaintbrushToolClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_paintbrush_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpPaintbrushTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_paintbrush_tool_init,
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
NULL, /* class_init */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpPaintbrushTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_paintbrush_tool_init,
};
tool_type = g_type_register_static (GIMP_TYPE_PAINT_TOOL,
"GimpPaintbrushTool",
"GimpPaintbrushTool",
&tool_info, 0);
}
......@@ -94,16 +89,6 @@ gimp_paintbrush_tool_get_type (void)
/* private functions */
static void
gimp_paintbrush_tool_class_init (GimpPaintbrushToolClass *klass)
{
GimpPaintToolClass *paint_tool_class;
paint_tool_class = GIMP_PAINT_TOOL_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
}
static void
gimp_paintbrush_tool_init (GimpPaintbrushTool *paintbrush)
{
......@@ -117,5 +102,4 @@ gimp_paintbrush_tool_init (GimpPaintbrushTool *paintbrush)
GIMP_PAINTBRUSH_TOOL_CURSOR);
paint_tool->pick_colors = TRUE;
paint_tool->core = g_object_new (GIMP_TYPE_PAINTBRUSH, NULL);
}
......@@ -39,6 +39,7 @@
#include "core/gimpbrush.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "core/gimppaintinfo.h"
#include "core/gimptoolinfo.h"
#include "paint/gimppaintcore.h"
......@@ -66,6 +67,9 @@
static void gimp_paint_tool_class_init (GimpPaintToolClass *klass);
static void gimp_paint_tool_init (GimpPaintTool *paint_tool);
static GObject * gimp_paint_tool_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_paint_tool_finalize (GObject *object);
static void gimp_paint_tool_control (GimpTool *tool,
......@@ -161,6 +165,7 @@ gimp_paint_tool_class_init (GimpPaintToolClass *klass)
parent_class = g_type_class_peek_parent (klass);
object_class->constructor = gimp_paint_tool_constructor;
object_class->finalize = gimp_paint_tool_finalize;
tool_class->control = gimp_paint_tool_control;
......@@ -184,16 +189,44 @@ gimp_paint_tool_init (GimpPaintTool *paint_tool)
gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_EXACT);
paint_tool->pick_colors = FALSE;
paint_tool->draw_line = FALSE;
paint_tool->pick_colors = FALSE;
paint_tool->draw_line = FALSE;
paint_tool->notify_connected = FALSE;
paint_tool->draw_brush = TRUE;
paint_tool->draw_brush = TRUE;
paint_tool->brush_x = 0.0;
paint_tool->brush_y = 0.0;
paint_tool->brush_x = 0.0;
paint_tool->brush_y = 0.0;
paint_tool->core = NULL;
}
static GObject *
gimp_paint_tool_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
{
GObject *object;
GimpTool *tool;
GimpPaintTool *paint_tool;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
tool = GIMP_TOOL (object);
paint_tool = GIMP_PAINT_TOOL (object);
g_assert (GIMP_IS_TOOL_INFO (tool->tool_info));
paint_tool->draw_brush =
GIMP_DISPLAY_CONFIG (tool->tool_info->gimp->config)->show_brush_outline;
paint_tool->core = NULL;
g_signal_connect_object (tool->tool_info->gimp->config,
"notify::show-brush-outline",
G_CALLBACK (gimp_paint_tool_notify_brush),
paint_tool, 0);
paint_tool->core = g_object_new (tool->tool_info->paint_info->paint_type,
NULL);
return object;
}
static void
......@@ -570,19 +603,6 @@ gimp_paint_tool_oper_update (GimpTool *tool,
return;
}
if (! paint_tool->notify_connected)
{
paint_tool->draw_brush =
GIMP_DISPLAY_CONFIG (tool->tool_info->gimp->config)->show_brush_outline;
g_signal_connect_object (tool->tool_info->gimp->config,
"notify::show-brush-outline",
G_CALLBACK (gimp_paint_tool_notify_brush),
paint_tool, 0);
paint_tool->notify_connected = TRUE;
}
core = paint_tool->core;
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
......
......@@ -40,9 +40,7 @@ struct _GimpPaintTool
gboolean pick_colors; /* pick color if ctrl is pressed */
gboolean draw_line;
gboolean notify_connected;
gboolean draw_brush;
gdouble brush_x;
gdouble brush_y;
......
......@@ -24,7 +24,6 @@
#include "tools-types.h"
#include "paint/gimppencil.h"
#include "paint/gimppenciloptions.h"
<