[gimp] app: make tool_manager_select_tool() a private function



commit 40d42d113e517f952b544f26f6d787dc970501e7
Author: Michael Natterer <mitch gimp org>
Date:   Fri Apr 4 16:47:51 2014 +0200

    app: make tool_manager_select_tool() a private function

 app/tools/tool_manager.c |   68 +++++++++++++++++++++++----------------------
 app/tools/tool_manager.h |    3 --
 2 files changed, 35 insertions(+), 36 deletions(-)
---
diff --git a/app/tools/tool_manager.c b/app/tools/tool_manager.c
index 15b72a2..9217dbd 100644
--- a/app/tools/tool_manager.c
+++ b/app/tools/tool_manager.c
@@ -62,6 +62,8 @@ struct _GimpToolManager
 static GimpToolManager * tool_manager_get     (Gimp            *gimp);
 static void              tool_manager_set     (Gimp            *gimp,
                                                GimpToolManager *tool_manager);
+static void   tool_manager_select_tool        (Gimp            *gimp,
+                                               GimpTool        *tool);
 static void   tool_manager_tool_changed       (GimpContext     *user_context,
                                                GimpToolInfo    *tool_info,
                                                GimpToolManager *tool_manager);
@@ -171,39 +173,6 @@ tool_manager_get_active (Gimp *gimp)
 }
 
 void
-tool_manager_select_tool (Gimp     *gimp,
-                          GimpTool *tool)
-{
-  GimpToolManager *tool_manager;
-
-  g_return_if_fail (GIMP_IS_GIMP (gimp));
-  g_return_if_fail (GIMP_IS_TOOL (tool));
-
-  tool_manager = tool_manager_get (gimp);
-
-  /*  reset the previously selected tool, but only if it is not only
-   *  temporarily pushed to the tool stack
-   */
-  if (tool_manager->active_tool &&
-      ! (tool_manager->tool_stack &&
-         tool_manager->active_tool == tool_manager->tool_stack->data))
-    {
-      GimpTool    *active_tool = tool_manager->active_tool;
-      GimpDisplay *display;
-
-      /*  NULL image returns any display (if there is any)  */
-      display = gimp_tool_has_image (active_tool, NULL);
-
-      tool_manager_control_active (gimp, GIMP_TOOL_ACTION_HALT, display);
-      tool_manager_focus_display_active (gimp, NULL);
-
-      g_object_unref (tool_manager->active_tool);
-    }
-
-  tool_manager->active_tool = g_object_ref (tool);
-}
-
-void
 tool_manager_push_tool (Gimp     *gimp,
                         GimpTool *tool)
 {
@@ -635,6 +604,39 @@ tool_manager_set (Gimp            *gimp,
 }
 
 static void
+tool_manager_select_tool (Gimp     *gimp,
+                          GimpTool *tool)
+{
+  GimpToolManager *tool_manager;
+
+  g_return_if_fail (GIMP_IS_GIMP (gimp));
+  g_return_if_fail (GIMP_IS_TOOL (tool));
+
+  tool_manager = tool_manager_get (gimp);
+
+  /*  reset the previously selected tool, but only if it is not only
+   *  temporarily pushed to the tool stack
+   */
+  if (tool_manager->active_tool &&
+      ! (tool_manager->tool_stack &&
+         tool_manager->active_tool == tool_manager->tool_stack->data))
+    {
+      GimpTool    *active_tool = tool_manager->active_tool;
+      GimpDisplay *display;
+
+      /*  NULL image returns any display (if there is any)  */
+      display = gimp_tool_has_image (active_tool, NULL);
+
+      tool_manager_control_active (gimp, GIMP_TOOL_ACTION_HALT, display);
+      tool_manager_focus_display_active (gimp, NULL);
+
+      g_object_unref (tool_manager->active_tool);
+    }
+
+  tool_manager->active_tool = g_object_ref (tool);
+}
+
+static void
 tool_manager_tool_changed (GimpContext     *user_context,
                            GimpToolInfo    *tool_info,
                            GimpToolManager *tool_manager)
diff --git a/app/tools/tool_manager.h b/app/tools/tool_manager.h
index a1b278f..b10fe80 100644
--- a/app/tools/tool_manager.h
+++ b/app/tools/tool_manager.h
@@ -24,9 +24,6 @@ void       tool_manager_exit                       (Gimp             *gimp);
 
 GimpTool * tool_manager_get_active                 (Gimp             *gimp);
 
-void       tool_manager_select_tool                (Gimp             *gimp,
-                                                    GimpTool         *tool);
-
 void       tool_manager_push_tool                  (Gimp             *gimp,
                                                     GimpTool         *tool);
 void       tool_manager_pop_tool                   (Gimp             *gimp);


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