From 00aad904a14fd1ca6e6cf61a44b87f70e52bab2d Mon Sep 17 00:00:00 2001 From: William Skaggs Date: Sun, 21 May 2006 17:52:23 +0000 Subject: [PATCH] Bill Skaggs * app/tools/gimpaligntool.c: get rid of "dispose" method, use tool-control-halt to shut things down instead. --- ChangeLog | 5 ++++ app/tools/gimpaligntool.c | 51 ++++++++++++++++++++++++++++++--------- 2 files changed, 44 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index dd7b50ee9e..4edae69312 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-05-21 Bill Skaggs + + * app/tools/gimpaligntool.c: get rid of "dispose" method, use + tool-control-halt to shut things down instead. + 2006-05-21 Michael Natterer One of the following changes fixes a crash on exit when there is a diff --git a/app/tools/gimpaligntool.c b/app/tools/gimpaligntool.c index 409f4fd629..fc6484871f 100644 --- a/app/tools/gimpaligntool.c +++ b/app/tools/gimpaligntool.c @@ -47,11 +47,13 @@ static GObject * gimp_align_tool_constructor (GType type, guint n_params, GObjectConstructParam *params); -static void gimp_align_tool_dispose (GObject *object); static gboolean gimp_align_tool_initialize (GimpTool *tool, GimpDisplay *display); static void gimp_align_tool_finalize (GObject *object); +static void gimp_align_tool_control (GimpTool *tool, + GimpToolAction action, + GimpDisplay *display); static void gimp_align_tool_button_press (GimpTool *tool, GimpCoords *coords, guint32 time, @@ -121,9 +123,9 @@ gimp_align_tool_class_init (GimpAlignToolClass *klass) object_class->finalize = gimp_align_tool_finalize; object_class->constructor = gimp_align_tool_constructor; - object_class->dispose = gimp_align_tool_dispose; tool_class->initialize = gimp_align_tool_initialize; + tool_class->control = gimp_align_tool_control; tool_class->button_press = gimp_align_tool_button_press; tool_class->button_release = gimp_align_tool_button_release; tool_class->motion = gimp_align_tool_motion; @@ -181,16 +183,6 @@ gimp_align_tool_constructor (GType type, return object; } -static void -gimp_align_tool_dispose (GObject *object) -{ - GimpAlignTool *align_tool = GIMP_ALIGN_TOOL (object); - - clear_selected_items (align_tool); - - G_OBJECT_CLASS (parent_class)->dispose (object); -} - static void gimp_align_tool_finalize (GObject *object) { @@ -223,6 +215,33 @@ gimp_align_tool_initialize (GimpTool *tool, return TRUE; } +static void +gimp_align_tool_control (GimpTool *tool, + GimpToolAction action, + GimpDisplay *display) +{ + GimpAlignTool *align_tool = GIMP_ALIGN_TOOL (tool); + + switch (action) + { + case PAUSE: + break; + + case RESUME: + break; + + case HALT: + clear_selected_items (align_tool); + gimp_tool_pop_status (tool, display); + break; + + default: + break; + } + + GIMP_TOOL_CLASS (parent_class)->control (tool, action, display); +} + static void gimp_align_tool_button_press (GimpTool *tool, GimpCoords *coords, @@ -770,6 +789,11 @@ clear_selected (GimpItem *item, static void clear_selected_items (GimpAlignTool *align_tool) { + GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (align_tool); + + if (gimp_draw_tool_is_active (draw_tool)) + gimp_draw_tool_pause (draw_tool); + while (align_tool->selected_items) { GimpItem *item = g_list_first (align_tool->selected_items)->data; @@ -781,6 +805,9 @@ clear_selected_items (GimpAlignTool *align_tool) align_tool->selected_items = g_list_remove (align_tool->selected_items, item); } + + if (gimp_draw_tool_is_active (draw_tool)) + gimp_draw_tool_resume (draw_tool); } static GimpLayer *