[gimp] app: add GimpSegment as replacement for GdkSegment



commit dc398572388f41a5806a0e535a7e681572223f9f
Author: Michael Natterer <mitch gimp org>
Date:   Fri Oct 15 12:37:36 2010 +0200

    app: add GimpSegment as replacement for GdkSegment

 app/display/gimpcanvasboundary.c         |   10 +++++-----
 app/display/gimpdisplayshell-draw.c      |    2 +-
 app/display/gimpdisplayshell-draw.h      |    2 +-
 app/display/gimpdisplayshell-selection.c |   14 +++++++-------
 app/display/gimpdisplayshell-transform.c |    2 +-
 app/display/gimpdisplayshell-transform.h |    2 +-
 app/widgets/gimpcairo.c                  |    6 +++---
 app/widgets/gimpcairo.h                  |    2 +-
 app/widgets/widgets-types.h              |   13 +++++++++++++
 9 files changed, 33 insertions(+), 20 deletions(-)
---
diff --git a/app/display/gimpcanvasboundary.c b/app/display/gimpcanvasboundary.c
index 8177040..84223aa 100644
--- a/app/display/gimpcanvasboundary.c
+++ b/app/display/gimpcanvasboundary.c
@@ -221,7 +221,7 @@ gimp_canvas_boundary_get_property (GObject    *object,
 static void
 gimp_canvas_boundary_transform (GimpCanvasItem   *item,
                                 GimpDisplayShell *shell,
-                                GdkSegment       *segs)
+                                GimpSegment      *segs)
 {
   GimpCanvasBoundaryPrivate *private = GET_PRIVATE (item);
   gint                       i;
@@ -288,9 +288,9 @@ gimp_canvas_boundary_draw (GimpCanvasItem   *item,
                            cairo_t          *cr)
 {
   GimpCanvasBoundaryPrivate *private = GET_PRIVATE (item);
-  GdkSegment                *segs;
+  GimpSegment               *segs;
 
-  segs = g_new0 (GdkSegment, private->n_segs);
+  segs = g_new0 (GimpSegment, private->n_segs);
 
   gimp_canvas_boundary_transform (item, shell, segs);
 
@@ -307,11 +307,11 @@ gimp_canvas_boundary_get_extents (GimpCanvasItem   *item,
 {
   GimpCanvasBoundaryPrivate *private = GET_PRIVATE (item);
   GdkRectangle               rectangle;
-  GdkSegment                *segs;
+  GimpSegment               *segs;
   gint                       x1, y1, x2, y2;
   gint                       i;
 
-  segs = g_new0 (GdkSegment, private->n_segs);
+  segs = g_new0 (GimpSegment, private->n_segs);
 
   gimp_canvas_boundary_transform (item, shell, segs);
 
diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c
index 1c74c8b..26444f3 100644
--- a/app/display/gimpdisplayshell-draw.c
+++ b/app/display/gimpdisplayshell-draw.c
@@ -118,7 +118,7 @@ gimp_display_shell_draw_get_scaled_image_size_for_scale (GimpDisplayShell *shell
 void
 gimp_display_shell_draw_selection_out (GimpDisplayShell *shell,
                                        cairo_t          *cr,
-                                       GdkSegment       *segs,
+                                       GimpSegment      *segs,
                                        gint              n_segs)
 {
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
diff --git a/app/display/gimpdisplayshell-draw.h b/app/display/gimpdisplayshell-draw.h
index 00599a2..25160e8 100644
--- a/app/display/gimpdisplayshell-draw.h
+++ b/app/display/gimpdisplayshell-draw.h
@@ -30,7 +30,7 @@ void   gimp_display_shell_draw_get_scaled_image_size_for_scale
 
 void   gimp_display_shell_draw_selection_out         (GimpDisplayShell   *shell,
                                                       cairo_t            *cr,
-                                                      GdkSegment         *segs,
+                                                      GimpSegment        *segs,
                                                       gint                n_segs);
 void   gimp_display_shell_draw_selection_in          (GimpDisplayShell   *shell,
                                                       cairo_t            *cr,
diff --git a/app/display/gimpdisplayshell-selection.c b/app/display/gimpdisplayshell-selection.c
index 055f447..57c87e5 100644
--- a/app/display/gimpdisplayshell-selection.c
+++ b/app/display/gimpdisplayshell-selection.c
@@ -45,10 +45,10 @@ struct _Selection
 {
   GimpDisplayShell *shell;            /*  shell that owns the selection     */
 
-  GdkSegment       *segs_in;          /*  gdk segments of area boundary     */
+  GimpSegment      *segs_in;          /*  gdk segments of area boundary     */
   gint              n_segs_in;        /*  number of segments in segs_in     */
 
-  GdkSegment       *segs_out;         /*  gdk segments of area boundary     */
+  GimpSegment      *segs_out;         /*  gdk segments of area boundary     */
   gint              n_segs_out;       /*  number of segments in segs_out    */
 
   guint             index;            /*  index of current stipple pattern  */
@@ -72,7 +72,7 @@ static void      selection_render_mask    (Selection      *selection);
 
 static void      selection_transform_segs (Selection      *selection,
                                            const BoundSeg *src_segs,
-                                           GdkSegment     *dest_segs,
+                                           GimpSegment    *dest_segs,
                                            gint            n_segs);
 static void      selection_generate_segs  (Selection      *selection);
 static void      selection_free_segs      (Selection      *selection);
@@ -303,7 +303,7 @@ selection_render_mask (Selection *selection)
 static void
 selection_transform_segs (Selection      *selection,
                           const BoundSeg *src_segs,
-                          GdkSegment     *dest_segs,
+                          GimpSegment    *dest_segs,
                           gint            n_segs)
 {
   const gint xclamp = selection->shell->disp_width + 1;
@@ -352,7 +352,7 @@ selection_generate_segs (Selection *selection)
   const BoundSeg *segs_out;
 
   /*  Ask the image for the boundary of its selected region...
-   *  Then transform that information into a new buffer of GdkSegments
+   *  Then transform that information into a new buffer of GimpSegments
    */
   gimp_channel_boundary (gimp_image_get_mask (image),
                          &segs_in, &segs_out,
@@ -361,7 +361,7 @@ selection_generate_segs (Selection *selection)
 
   if (selection->n_segs_in)
     {
-      selection->segs_in = g_new (GdkSegment, selection->n_segs_in);
+      selection->segs_in = g_new (GimpSegment, selection->n_segs_in);
       selection_transform_segs (selection, segs_in,
                                 selection->segs_in, selection->n_segs_in);
 
@@ -375,7 +375,7 @@ selection_generate_segs (Selection *selection)
   /*  Possible secondary boundary representation  */
   if (selection->n_segs_out)
     {
-      selection->segs_out = g_new (GdkSegment, selection->n_segs_out);
+      selection->segs_out = g_new (GimpSegment, selection->n_segs_out);
       selection_transform_segs (selection, segs_out,
                                 selection->segs_out, selection->n_segs_out);
     }
diff --git a/app/display/gimpdisplayshell-transform.c b/app/display/gimpdisplayshell-transform.c
index 408de97..1707811 100644
--- a/app/display/gimpdisplayshell-transform.c
+++ b/app/display/gimpdisplayshell-transform.c
@@ -236,7 +236,7 @@ gimp_display_shell_untransform_xy_f (const GimpDisplayShell *shell,
 void
 gimp_display_shell_transform_segments (const GimpDisplayShell *shell,
                                        const BoundSeg         *src_segs,
-                                       GdkSegment             *dest_segs,
+                                       GimpSegment            *dest_segs,
                                        gint                    n_segs,
                                        gdouble                 offset_x,
                                        gdouble                 offset_y)
diff --git a/app/display/gimpdisplayshell-transform.h b/app/display/gimpdisplayshell-transform.h
index e082cf4..b266531 100644
--- a/app/display/gimpdisplayshell-transform.h
+++ b/app/display/gimpdisplayshell-transform.h
@@ -51,7 +51,7 @@ void  gimp_display_shell_untransform_xy_f       (const GimpDisplayShell *shell,
 
 void  gimp_display_shell_transform_segments     (const GimpDisplayShell *shell,
                                                  const BoundSeg         *src_segs,
-                                                 GdkSegment             *dest_segs,
+                                                 GimpSegment            *dest_segs,
                                                  gint                    n_segs,
                                                  gdouble                 offset_x,
                                                  gdouble                 offset_y);
diff --git a/app/widgets/gimpcairo.c b/app/widgets/gimpcairo.c
index c19e57b..17a8e9f 100644
--- a/app/widgets/gimpcairo.c
+++ b/app/widgets/gimpcairo.c
@@ -112,9 +112,9 @@ gimp_cairo_add_arc (cairo_t *cr,
 }
 
 void
-gimp_cairo_add_segments (cairo_t    *cr,
-                         GdkSegment *segs,
-                         gint        n_segs)
+gimp_cairo_add_segments (cairo_t     *cr,
+                         GimpSegment *segs,
+                         gint         n_segs)
 {
   gint i;
 
diff --git a/app/widgets/gimpcairo.h b/app/widgets/gimpcairo.h
index 9328d95..f7080a2 100644
--- a/app/widgets/gimpcairo.h
+++ b/app/widgets/gimpcairo.h
@@ -36,7 +36,7 @@ void              gimp_cairo_add_arc                (cairo_t       *cr,
                                                      gdouble        start_angle,
                                                      gdouble        slice_angle);
 void              gimp_cairo_add_segments           (cairo_t       *cr,
-                                                     GdkSegment    *segs,
+                                                     GimpSegment   *segs,
                                                      gint           n_segs);
 
 void              gimp_cairo_draw_toolbox_wilber    (GtkWidget     *widget,
diff --git a/app/widgets/widgets-types.h b/app/widgets/widgets-types.h
index d2c6c5b..3479c5b 100644
--- a/app/widgets/widgets-types.h
+++ b/app/widgets/widgets-types.h
@@ -272,4 +272,17 @@ typedef gboolean (* GimpPanedBoxDroppedFunc)      (GtkWidget         *source,
                                                    gpointer           data);
 
 
+/*  temp hack as replacement for GdkSegment  */
+
+typedef struct _GimpSegment GimpSegment;
+
+struct _GimpSegment
+{
+  gint x1;
+  gint y1;
+  gint x2;
+  gint y2;
+};
+
+
 #endif /* __WIDGETS_TYPES_H__ */



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