[gimp] app: s/GdkRectangle/cairo_rectangle_int_t/ in all GimpCanvasItems



commit fde934ac5859ee13d4304e6df9059183bad6f92e
Author: Michael Natterer <mitch gimp org>
Date:   Sun Apr 10 18:15:16 2011 +0200

    app: s/GdkRectangle/cairo_rectangle_int_t/ in all GimpCanvasItems

 app/display/gimpcanvasarc.c              |    8 ++++----
 app/display/gimpcanvasboundary.c         |    4 ++--
 app/display/gimpcanvascorner.c           |    8 ++++----
 app/display/gimpcanvascursor.c           |    4 ++--
 app/display/gimpcanvasgrid.c             |   12 ++++++------
 app/display/gimpcanvasguide.c            |    8 ++++----
 app/display/gimpcanvashandle.c           |    4 ++--
 app/display/gimpcanvasline.c             |    8 ++++----
 app/display/gimpcanvaspassepartout.c     |   15 ++++++++-------
 app/display/gimpcanvaspath.c             |    8 ++++----
 app/display/gimpcanvaspen.c              |    6 +++---
 app/display/gimpcanvaspolygon.c          |    4 ++--
 app/display/gimpcanvasprogress.c         |    8 ++++----
 app/display/gimpcanvasrectangle.c        |   14 +++++++-------
 app/display/gimpcanvassamplepoint.c      |    8 ++++----
 app/display/gimpcanvastextcursor.c       |    4 ++--
 app/display/gimpcanvastransformpreview.c |   10 +++++-----
 17 files changed, 67 insertions(+), 66 deletions(-)
---
diff --git a/app/display/gimpcanvasarc.c b/app/display/gimpcanvasarc.c
index 4689fc4..bdf4d80 100644
--- a/app/display/gimpcanvasarc.c
+++ b/app/display/gimpcanvasarc.c
@@ -292,9 +292,9 @@ static cairo_region_t *
 gimp_canvas_arc_get_extents (GimpCanvasItem   *item,
                              GimpDisplayShell *shell)
 {
-  GdkRectangle rectangle;
-  gdouble      center_x, center_y;
-  gdouble      radius_x, radius_y;
+  cairo_rectangle_int_t rectangle;
+  gdouble               center_x, center_y;
+  gdouble               radius_x, radius_y;
 
   gimp_canvas_arc_transform (item, shell,
                              &center_x, &center_y,
@@ -305,7 +305,7 @@ gimp_canvas_arc_get_extents (GimpCanvasItem   *item,
   rectangle.width  = ceil (center_x + radius_x + 1.5) - rectangle.x;
   rectangle.height = ceil (center_y + radius_y + 1.5) - rectangle.y;
 
-  return cairo_region_create_rectangle ((cairo_rectangle_int_t *) &rectangle);
+  return cairo_region_create_rectangle (&rectangle);
 }
 
 GimpCanvasItem *
diff --git a/app/display/gimpcanvasboundary.c b/app/display/gimpcanvasboundary.c
index e76a989..7520cf8 100644
--- a/app/display/gimpcanvasboundary.c
+++ b/app/display/gimpcanvasboundary.c
@@ -306,7 +306,7 @@ gimp_canvas_boundary_get_extents (GimpCanvasItem   *item,
                                   GimpDisplayShell *shell)
 {
   GimpCanvasBoundaryPrivate *private = GET_PRIVATE (item);
-  GdkRectangle               rectangle;
+  cairo_rectangle_int_t      rectangle;
   GimpSegment               *segs;
   gint                       x1, y1, x2, y2;
   gint                       i;
@@ -340,7 +340,7 @@ gimp_canvas_boundary_get_extents (GimpCanvasItem   *item,
   rectangle.width  = x2 - x1 + 4;
   rectangle.height = y2 - y1 + 4;
 
-  return cairo_region_create_rectangle ((cairo_rectangle_int_t *) &rectangle);
+  return cairo_region_create_rectangle (&rectangle);
 }
 
 GimpCanvasItem *
diff --git a/app/display/gimpcanvascorner.c b/app/display/gimpcanvascorner.c
index c1df3f7..687d779 100644
--- a/app/display/gimpcanvascorner.c
+++ b/app/display/gimpcanvascorner.c
@@ -412,9 +412,9 @@ static cairo_region_t *
 gimp_canvas_corner_get_extents (GimpCanvasItem   *item,
                                 GimpDisplayShell *shell)
 {
-  GdkRectangle rectangle;
-  gdouble      x, y;
-  gdouble      w, h;
+  cairo_rectangle_int_t rectangle;
+  gdouble               x, y;
+  gdouble               w, h;
 
   gimp_canvas_corner_transform (item, shell, &x, &y, &w, &h);
 
@@ -423,7 +423,7 @@ gimp_canvas_corner_get_extents (GimpCanvasItem   *item,
   rectangle.width  = ceil (w + 3.0);
   rectangle.height = ceil (h + 3.0);
 
-  return cairo_region_create_rectangle ((cairo_rectangle_int_t *) &rectangle);
+  return cairo_region_create_rectangle (&rectangle);
 }
 
 GimpCanvasItem *
diff --git a/app/display/gimpcanvascursor.c b/app/display/gimpcanvascursor.c
index 81089b6..577f5c2 100644
--- a/app/display/gimpcanvascursor.c
+++ b/app/display/gimpcanvascursor.c
@@ -188,7 +188,7 @@ gimp_canvas_cursor_get_extents (GimpCanvasItem   *item,
                                 GimpDisplayShell *shell)
 {
   GimpCanvasCursorPrivate *private = GET_PRIVATE (item);
-  GdkRectangle             rectangle;
+  cairo_rectangle_int_t    rectangle;
   gdouble                  x, y;
 
   x = floor (private->x) + 0.5;
@@ -199,7 +199,7 @@ gimp_canvas_cursor_get_extents (GimpCanvasItem   *item,
   rectangle.width  = ceil (x + GIMP_CURSOR_SIZE + 1.5) - rectangle.x;
   rectangle.height = ceil (y + GIMP_CURSOR_SIZE + 1.5) - rectangle.y;
 
-  return cairo_region_create_rectangle ((cairo_rectangle_int_t *) &rectangle);
+  return cairo_region_create_rectangle (&rectangle);
 }
 
 GimpCanvasItem *
diff --git a/app/display/gimpcanvasgrid.c b/app/display/gimpcanvasgrid.c
index 3efa4c1..fbd6126 100644
--- a/app/display/gimpcanvasgrid.c
+++ b/app/display/gimpcanvasgrid.c
@@ -344,11 +344,11 @@ static cairo_region_t *
 gimp_canvas_grid_get_extents (GimpCanvasItem   *item,
                               GimpDisplayShell *shell)
 {
-  GimpImage    *image = gimp_display_get_image (shell->display);
-  GdkRectangle  rectangle;
-  gdouble       x1, y1;
-  gdouble       x2, y2;
-  gint          w, h;
+  GimpImage             *image = gimp_display_get_image (shell->display);
+  cairo_rectangle_int_t  rectangle;
+  gdouble                x1, y1;
+  gdouble                x2, y2;
+  gint                   w, h;
 
   if (! image)
     return NULL;
@@ -364,7 +364,7 @@ gimp_canvas_grid_get_extents (GimpCanvasItem   *item,
   rectangle.width  = ceil (x2) - rectangle.x;
   rectangle.height = ceil (y2) - rectangle.y;
 
-  return cairo_region_create_rectangle ((cairo_rectangle_int_t *) &rectangle);
+  return cairo_region_create_rectangle (&rectangle);
 }
 
 static void
diff --git a/app/display/gimpcanvasguide.c b/app/display/gimpcanvasguide.c
index 42980e4..e47bef5 100644
--- a/app/display/gimpcanvasguide.c
+++ b/app/display/gimpcanvasguide.c
@@ -230,9 +230,9 @@ static cairo_region_t *
 gimp_canvas_guide_get_extents (GimpCanvasItem   *item,
                                GimpDisplayShell *shell)
 {
-  GdkRectangle rectangle;
-  gdouble      x1, y1;
-  gdouble      x2, y2;
+  cairo_rectangle_int_t rectangle;
+  gdouble               x1, y1;
+  gdouble               x2, y2;
 
   gimp_canvas_guide_transform (item, shell, &x1, &y1, &x2, &y2);
 
@@ -241,7 +241,7 @@ gimp_canvas_guide_get_extents (GimpCanvasItem   *item,
   rectangle.width  = ABS (x2 - x1) + 3.0;
   rectangle.height = ABS (y2 - y1) + 3.0;
 
-  return cairo_region_create_rectangle ((cairo_rectangle_int_t *) &rectangle);
+  return cairo_region_create_rectangle (&rectangle);
 }
 
 static void
diff --git a/app/display/gimpcanvashandle.c b/app/display/gimpcanvashandle.c
index 4f51016..45ad673 100644
--- a/app/display/gimpcanvashandle.c
+++ b/app/display/gimpcanvashandle.c
@@ -354,7 +354,7 @@ gimp_canvas_handle_get_extents (GimpCanvasItem   *item,
                                 GimpDisplayShell *shell)
 {
   GimpCanvasHandlePrivate *private = GET_PRIVATE (item);
-  GdkRectangle             rectangle;
+  cairo_rectangle_int_t    rectangle;
   gdouble                  x, y;
 
   gimp_canvas_handle_transform (item, shell, &x, &y);
@@ -382,7 +382,7 @@ gimp_canvas_handle_get_extents (GimpCanvasItem   *item,
       break;
     }
 
-  return cairo_region_create_rectangle ((cairo_rectangle_int_t *) &rectangle);
+  return cairo_region_create_rectangle (&rectangle);
 }
 
 static gboolean
diff --git a/app/display/gimpcanvasline.c b/app/display/gimpcanvasline.c
index fe90c5c..1aee4fe 100644
--- a/app/display/gimpcanvasline.c
+++ b/app/display/gimpcanvasline.c
@@ -226,9 +226,9 @@ static cairo_region_t *
 gimp_canvas_line_get_extents (GimpCanvasItem   *item,
                               GimpDisplayShell *shell)
 {
-  GdkRectangle rectangle;
-  gdouble      x1, y1;
-  gdouble      x2, y2;
+  cairo_rectangle_int_t rectangle;
+  gdouble               x1, y1;
+  gdouble               x2, y2;
 
   gimp_canvas_line_transform (item, shell, &x1, &y1, &x2, &y2);
 
@@ -247,7 +247,7 @@ gimp_canvas_line_get_extents (GimpCanvasItem   *item,
       rectangle.height = ceil (ABS (y2 - y1) + 5.0);
     }
 
-  return cairo_region_create_rectangle ((cairo_rectangle_int_t *) &rectangle);
+  return cairo_region_create_rectangle (&rectangle);
 }
 
 GimpCanvasItem *
diff --git a/app/display/gimpcanvaspassepartout.c b/app/display/gimpcanvaspassepartout.c
index d4a8ffb..7bb653d 100644
--- a/app/display/gimpcanvaspassepartout.c
+++ b/app/display/gimpcanvaspassepartout.c
@@ -83,16 +83,17 @@ static cairo_region_t *
 gimp_canvas_passe_partout_get_extents (GimpCanvasItem   *item,
                                        GimpDisplayShell *shell)
 {
-  cairo_region_t *inner;
-  cairo_region_t *outer;
-  GdkRectangle    rect = { 0, 0, 0, 0 };
+  cairo_rectangle_int_t  rectangle;
+  cairo_region_t        *inner;
+  cairo_region_t        *outer;
 
-  rect.x = - shell->offset_x;
-  rect.y = - shell->offset_y;
+  rectangle.x = - shell->offset_x;
+  rectangle.y = - shell->offset_y;
   gimp_display_shell_draw_get_scaled_image_size (shell,
-                                                 &rect.width, &rect.height);
+                                                 &rectangle.width,
+                                                 &rectangle.height);
 
-  outer = cairo_region_create_rectangle ((cairo_rectangle_int_t *) &rect);
+  outer = cairo_region_create_rectangle (&rectangle);
 
   inner = GIMP_CANVAS_ITEM_CLASS (parent_class)->get_extents (item, shell);
 
diff --git a/app/display/gimpcanvaspath.c b/app/display/gimpcanvaspath.c
index 293405d..cd5ab83 100644
--- a/app/display/gimpcanvaspath.c
+++ b/app/display/gimpcanvaspath.c
@@ -254,9 +254,9 @@ gimp_canvas_path_get_extents (GimpCanvasItem   *item,
 
   if (private->path && gtk_widget_get_realized (shell->canvas))
     {
-      cairo_t      *cr;
-      GdkRectangle  rectangle;
-      gdouble       x1, y1, x2, y2;
+      cairo_t               *cr;
+      cairo_rectangle_int_t  rectangle;
+      gdouble                x1, y1, x2, y2;
 
       cr = gdk_cairo_create (gtk_widget_get_window (shell->canvas));
 
@@ -287,7 +287,7 @@ gimp_canvas_path_get_extents (GimpCanvasItem   *item,
           rectangle.height = ceil (y2 + 1.5) - rectangle.y;
         }
 
-      return cairo_region_create_rectangle ((cairo_rectangle_int_t *) &rectangle);
+      return cairo_region_create_rectangle (&rectangle);
     }
 
   return NULL;
diff --git a/app/display/gimpcanvaspen.c b/app/display/gimpcanvaspen.c
index a9f508a..8ce318e 100644
--- a/app/display/gimpcanvaspen.c
+++ b/app/display/gimpcanvaspen.c
@@ -170,16 +170,16 @@ gimp_canvas_pen_get_extents (GimpCanvasItem   *item,
 
   if (region)
     {
-      GdkRectangle rectangle;
+      cairo_rectangle_int_t rectangle;
 
-      cairo_region_get_extents (region, (cairo_rectangle_int_t *) &rectangle);
+      cairo_region_get_extents (region, &rectangle);
 
       rectangle.x      -= ceil (private->width / 2.0);
       rectangle.y      -= ceil (private->width / 2.0);
       rectangle.width  += private->width + 1;
       rectangle.height += private->width + 1;
 
-      cairo_region_union_rectangle (region, (cairo_rectangle_int_t *) &rectangle);
+      cairo_region_union_rectangle (region, &rectangle);
     }
 
   return region;
diff --git a/app/display/gimpcanvaspolygon.c b/app/display/gimpcanvaspolygon.c
index 5493b43..4165637 100644
--- a/app/display/gimpcanvaspolygon.c
+++ b/app/display/gimpcanvaspolygon.c
@@ -251,7 +251,7 @@ gimp_canvas_polygon_get_extents (GimpCanvasItem   *item,
                                  GimpDisplayShell *shell)
 {
   GimpCanvasPolygonPrivate *private = GET_PRIVATE (item);
-  GdkRectangle              rectangle;
+  cairo_rectangle_int_t     rectangle;
   GimpVector2              *points;
   gint                      x1, y1, x2, y2;
   gint                      i;
@@ -285,7 +285,7 @@ gimp_canvas_polygon_get_extents (GimpCanvasItem   *item,
   rectangle.width  = x2 - x1;
   rectangle.height = y2 - y1;
 
-  return cairo_region_create_rectangle ((cairo_rectangle_int_t *) &rectangle);
+  return cairo_region_create_rectangle (&rectangle);
 }
 
 GimpCanvasItem *
diff --git a/app/display/gimpcanvasprogress.c b/app/display/gimpcanvasprogress.c
index bdc8b87..7315852 100644
--- a/app/display/gimpcanvasprogress.c
+++ b/app/display/gimpcanvasprogress.c
@@ -310,9 +310,9 @@ static cairo_region_t *
 gimp_canvas_progress_get_extents (GimpCanvasItem   *item,
                                   GimpDisplayShell *shell)
 {
-  GdkRectangle rectangle;
-  gdouble      x, y;
-  gint         width, height;
+  cairo_rectangle_int_t rectangle;
+  gdouble               x, y;
+  gint                  width, height;
 
   gimp_canvas_progress_transform (item, shell, &x, &y, &width, &height);
 
@@ -322,7 +322,7 @@ gimp_canvas_progress_get_extents (GimpCanvasItem   *item,
   rectangle.width  = width  + 2;
   rectangle.height = height + 2;
 
-  return cairo_region_create_rectangle ((cairo_rectangle_int_t *) &rectangle);
+  return cairo_region_create_rectangle (&rectangle);
 }
 
 static GimpProgress *
diff --git a/app/display/gimpcanvasrectangle.c b/app/display/gimpcanvasrectangle.c
index 6381101..ce0a4b1 100644
--- a/app/display/gimpcanvasrectangle.c
+++ b/app/display/gimpcanvasrectangle.c
@@ -270,7 +270,7 @@ gimp_canvas_rectangle_get_extents (GimpCanvasItem   *item,
                                    GimpDisplayShell *shell)
 {
   GimpCanvasRectanglePrivate *private = GET_PRIVATE (item);
-  GdkRectangle                rectangle;
+  cairo_rectangle_int_t       rectangle;
   gdouble                     x, y;
   gdouble                     w, h;
 
@@ -283,7 +283,7 @@ gimp_canvas_rectangle_get_extents (GimpCanvasItem   *item,
       rectangle.width  = ceil (w + 2.0);
       rectangle.height = ceil (h + 2.0);
 
-      return cairo_region_create_rectangle ((cairo_rectangle_int_t *) &rectangle);
+      return cairo_region_create_rectangle (&rectangle);
     }
   else if (w > 64 && h > 64)
     {
@@ -295,12 +295,12 @@ gimp_canvas_rectangle_get_extents (GimpCanvasItem   *item,
       rectangle.width  = 3.0;
       rectangle.height = ceil (h + 3.0);
 
-      region = cairo_region_create_rectangle ((cairo_rectangle_int_t *) &rectangle);
+      region = cairo_region_create_rectangle (&rectangle);
 
       /* right */
       rectangle.x      = floor (x + w - 1.5);
 
-      cairo_region_union_rectangle (region, (cairo_rectangle_int_t *) &rectangle);
+      cairo_region_union_rectangle (region, &rectangle);
 
       /* top */
       rectangle.x      = floor (x - 1.5);
@@ -308,12 +308,12 @@ gimp_canvas_rectangle_get_extents (GimpCanvasItem   *item,
       rectangle.width  = ceil (w + 3.0);
       rectangle.height = 3.0;
 
-      cairo_region_union_rectangle (region, (cairo_rectangle_int_t *) &rectangle);
+      cairo_region_union_rectangle (region, &rectangle);
 
       /* bottom */
       rectangle.y      = floor (y + h - 1.5);
 
-      cairo_region_union_rectangle (region, (cairo_rectangle_int_t *) &rectangle);
+      cairo_region_union_rectangle (region, &rectangle);
 
       return region;
     }
@@ -324,7 +324,7 @@ gimp_canvas_rectangle_get_extents (GimpCanvasItem   *item,
       rectangle.width  = ceil (w + 3.0);
       rectangle.height = ceil (h + 3.0);
 
-      return cairo_region_create_rectangle ((cairo_rectangle_int_t *) &rectangle);
+      return cairo_region_create_rectangle (&rectangle);
     }
 }
 
diff --git a/app/display/gimpcanvassamplepoint.c b/app/display/gimpcanvassamplepoint.c
index e795823..15de64b 100644
--- a/app/display/gimpcanvassamplepoint.c
+++ b/app/display/gimpcanvassamplepoint.c
@@ -261,9 +261,9 @@ static cairo_region_t *
 gimp_canvas_sample_point_get_extents (GimpCanvasItem   *item,
                                       GimpDisplayShell *shell)
 {
-  GdkRectangle rectangle;
-  gdouble      x, y;
-  gint         x1, x2, y1, y2;
+  cairo_rectangle_int_t rectangle;
+  gdouble               x, y;
+  gint                  x1, x2, y1, y2;
 
   gimp_canvas_sample_point_transform (item, shell, &x, &y);
 
@@ -281,7 +281,7 @@ gimp_canvas_sample_point_get_extents (GimpCanvasItem   *item,
   rectangle.width  += 5;
   rectangle.height += 5;
 
-  return cairo_region_create_rectangle ((cairo_rectangle_int_t *) &rectangle);
+  return cairo_region_create_rectangle (&rectangle);
 }
 
 static void
diff --git a/app/display/gimpcanvastextcursor.c b/app/display/gimpcanvastextcursor.c
index 440dfd5..a5b1ca0 100644
--- a/app/display/gimpcanvastextcursor.c
+++ b/app/display/gimpcanvastextcursor.c
@@ -273,7 +273,7 @@ gimp_canvas_text_cursor_get_extents (GimpCanvasItem   *item,
                                      GimpDisplayShell *shell)
 {
   GimpCanvasTextCursorPrivate *private = GET_PRIVATE (item);
-  GdkRectangle                 rectangle;
+  cairo_rectangle_int_t        rectangle;
   gdouble                      x, y;
   gdouble                      w, h;
 
@@ -294,7 +294,7 @@ gimp_canvas_text_cursor_get_extents (GimpCanvasItem   *item,
       rectangle.height = ceil (h + 3.0);
     }
 
-  return cairo_region_create_rectangle ((cairo_rectangle_int_t *) &rectangle);
+  return cairo_region_create_rectangle (&rectangle);
 }
 
 GimpCanvasItem *
diff --git a/app/display/gimpcanvastransformpreview.c b/app/display/gimpcanvastransformpreview.c
index e5e9428..0ddd0d4 100644
--- a/app/display/gimpcanvastransformpreview.c
+++ b/app/display/gimpcanvastransformpreview.c
@@ -346,9 +346,9 @@ gimp_canvas_transform_preview_get_property (GObject    *object,
 }
 
 static gboolean
-gimp_canvas_transform_preview_transform (GimpCanvasItem   *item,
-                                         GimpDisplayShell *shell,
-                                         GdkRectangle     *extents)
+gimp_canvas_transform_preview_transform (GimpCanvasItem        *item,
+                                         GimpDisplayShell      *shell,
+                                         cairo_rectangle_int_t *extents)
 {
   GimpCanvasTransformPreviewPrivate *private = GET_PRIVATE (item);
   gdouble                            tx1, ty1;
@@ -569,10 +569,10 @@ static cairo_region_t *
 gimp_canvas_transform_preview_get_extents (GimpCanvasItem   *item,
                                            GimpDisplayShell *shell)
 {
-  GdkRectangle rectangle;
+  cairo_rectangle_int_t rectangle;
 
   if (gimp_canvas_transform_preview_transform (item, shell, &rectangle))
-    return cairo_region_create_rectangle ((cairo_rectangle_int_t *) &rectangle);
+    return cairo_region_create_rectangle (&rectangle);
 
   return NULL;
 }



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