[gimp] app: remove the now obsolete gimp_display_shell_draw_guide()



commit 9d36984d3737b275d5af9715b49a256df9e2ccfa
Author: Michael Natterer <mitch gimp org>
Date:   Thu Sep 30 00:23:06 2010 +0200

    app: remove the now obsolete gimp_display_shell_draw_guide()
    
    and draw the guides in gimp_display_shell_draw_guides().

 app/display/gimpdisplayshell-draw.c |   49 ++++++++++++++--------------------
 app/display/gimpdisplayshell-draw.h |    4 ---
 2 files changed, 20 insertions(+), 33 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c
index bbfb17b..952731d 100644
--- a/app/display/gimpdisplayshell-draw.c
+++ b/app/display/gimpdisplayshell-draw.c
@@ -130,33 +130,6 @@ gimp_display_shell_draw_get_scaled_image_size_for_scale (GimpDisplayShell *shell
 }
 
 void
-gimp_display_shell_draw_guide (GimpDisplayShell   *shell,
-                               cairo_t            *cr,
-                               GimpGuide          *guide,
-                               gboolean            active)
-{
-  GimpCanvasItem *item;
-  gint            position;
-
-  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
-  g_return_if_fail (cr != NULL);
-  g_return_if_fail (GIMP_IS_GUIDE (guide));
-
-  position = gimp_guide_get_position (guide);
-  if (position < 0)
-    return;
-
-  item = gimp_canvas_guide_new (gimp_guide_get_orientation (guide), position);
-
-  g_object_set (item, "guide-style", TRUE, NULL);
-  gimp_canvas_item_set_highlight (item, active);
-
-  gimp_canvas_item_draw (item, shell, cr);
-
-  g_object_unref (item);
-}
-
-void
 gimp_display_shell_draw_guides (GimpDisplayShell *shell,
                                 cairo_t          *cr)
 {
@@ -169,14 +142,32 @@ gimp_display_shell_draw_guides (GimpDisplayShell *shell,
 
   if (image && gimp_display_shell_get_show_guides (shell))
     {
-      GList *list;
+      GimpCanvasItem *item;
+      GList          *list;
+
+      item = gimp_canvas_guide_new (GIMP_ORIENTATION_HORIZONTAL, 0);
+      g_object_set (item, "guide-style", TRUE, NULL);
 
       for (list = gimp_image_get_guides (image);
            list;
            list = g_list_next (list))
         {
-          gimp_display_shell_draw_guide (shell, cr, list->data, FALSE);
+          GimpGuide *guide = list->data;
+          gint       position;
+
+          position = gimp_guide_get_position (guide);
+
+          if (position >= 0)
+            {
+              g_object_set (item,
+                            "orientation", gimp_guide_get_orientation (guide),
+                            "position",    position,
+                            NULL);
+              gimp_canvas_item_draw (item, shell, cr);
+            }
         }
+
+      g_object_unref (item);
     }
 }
 
diff --git a/app/display/gimpdisplayshell-draw.h b/app/display/gimpdisplayshell-draw.h
index 73e71bb..5b5bb9d 100644
--- a/app/display/gimpdisplayshell-draw.h
+++ b/app/display/gimpdisplayshell-draw.h
@@ -27,10 +27,6 @@ void   gimp_display_shell_draw_get_scaled_image_size_for_scale
                                                       gdouble             scale,
                                                       gint               *w,
                                                       gint               *h);
-void   gimp_display_shell_draw_guide                 (GimpDisplayShell   *shell,
-                                                      cairo_t            *cr,
-                                                      GimpGuide          *guide,
-                                                      gboolean            active);
 void   gimp_display_shell_draw_guides                (GimpDisplayShell   *shell,
                                                       cairo_t            *cr);
 void   gimp_display_shell_draw_grid                  (GimpDisplayShell   *shell,



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