[gimp] app; move GimpTransformTool's shutdown code to control(HALT)



commit eb9fefe50563d14999dd466595cddb7e51cc2bdb
Author: Michael Natterer <mitch gimp org>
Date:   Fri Apr 1 13:03:01 2011 +0200

    app; move GimpTransformTool's shutdown code to control(HALT)
    
    and remove gimp_transform_tool_halt(), including all the duplicated
    parent class shutdown code.

 app/tools/gimptransformtool.c |   34 ++++++++++------------------------
 1 files changed, 10 insertions(+), 24 deletions(-)
---
diff --git a/app/tools/gimptransformtool.c b/app/tools/gimptransformtool.c
index 325ee09..0176564 100644
--- a/app/tools/gimptransformtool.c
+++ b/app/tools/gimptransformtool.c
@@ -133,7 +133,6 @@ static TileManager *
 
 static void      gimp_transform_tool_set_function           (GimpTransformTool *tr_tool,
                                                              TransformAction    function);
-static void      gimp_transform_tool_halt                   (GimpTransformTool     *tr_tool);
 static void      gimp_transform_tool_bounds                 (GimpTransformTool     *tr_tool,
                                                              GimpDisplay           *display);
 static void      gimp_transform_tool_dialog                 (GimpTransformTool     *tr_tool);
@@ -314,7 +313,12 @@ gimp_transform_tool_control (GimpTool       *tool,
       break;
 
     case GIMP_TOOL_ACTION_HALT:
-      gimp_transform_tool_halt (tr_tool);
+      tr_tool->function = TRANSFORM_CREATING;
+
+      if (tr_tool->dialog)
+        gimp_dialog_factory_hide_dialog (tr_tool->dialog);
+
+      tool->drawable = NULL;
       break;
     }
 
@@ -1118,14 +1122,14 @@ gimp_transform_tool_transform (GimpTransformTool *tr_tool,
   if (! active_item)
     {
       gimp_tool_message_literal (tool, display, null_message);
-      gimp_transform_tool_halt (tr_tool);
+      gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, display);
       return;
     }
 
   if (gimp_item_is_content_locked (active_item))
     {
       gimp_tool_message_literal (tool, display, locked_message);
-      gimp_transform_tool_halt (tr_tool);
+      gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, display);
       return;
     }
 
@@ -1226,7 +1230,7 @@ gimp_transform_tool_transform (GimpTransformTool *tr_tool,
    */
   gimp_tool_control_set_preserve (tool->control, FALSE);
 
-  gimp_transform_tool_halt (tr_tool);
+  gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, display);
 
   gimp_unset_busy (display->gimp);
 
@@ -1281,24 +1285,6 @@ gimp_transform_tool_transform_bounding_box (GimpTransformTool *tr_tool)
 }
 
 static void
-gimp_transform_tool_halt (GimpTransformTool *tr_tool)
-{
-  GimpTool *tool = GIMP_TOOL (tr_tool);
-
-  if (gimp_draw_tool_is_active (GIMP_DRAW_TOOL (tr_tool)))
-    gimp_draw_tool_stop (GIMP_DRAW_TOOL (tr_tool));
-
-  /*  inactivate the tool  */
-  tr_tool->function = TRANSFORM_CREATING;
-
-  if (tr_tool->dialog)
-    gimp_dialog_factory_hide_dialog (tr_tool->dialog);
-
-  tool->display  = NULL;
-  tool->drawable = NULL;
-}
-
-static void
 gimp_transform_tool_bounds (GimpTransformTool *tr_tool,
                             GimpDisplay       *display)
 {
@@ -1568,7 +1554,7 @@ gimp_transform_tool_response (GtkWidget         *widget,
       break;
 
     default:
-      gimp_transform_tool_halt (tr_tool);
+      gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, tool->display);
       break;
     }
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]