[dia] geometry: move rectangle struct into the Dia namespace



commit 53ce42dc8e15e0d527c608128d67b2398de27ee8
Author: Zander Brown <zbrown gnome org>
Date:   Sat Sep 21 18:59:20 2019 +0100

    geometry: move rectangle struct into the Dia namespace

 app/connectionpoint_ops.c                 |   2 +-
 app/diagram.c                             |  19 +++--
 app/diagram.h                             |  10 +--
 app/disp_callbacks.c                      |   4 +-
 app/display.c                             |  73 ++++++++--------
 app/display.h                             |  28 +++----
 app/grid.c                                |  10 +--
 app/grid.h                                |   4 +-
 app/interface.c                           |  12 +--
 app/magnify.c                             |   2 +-
 app/modify_tool.c                         |   2 +-
 app/navigation.c                          |  18 ++--
 bindings/dia-diagramdata.cpp              |  20 ++---
 bindings/dia-diagramdata.h                |  14 ++--
 bindings/dia-object.cpp                   |  40 ++++-----
 bindings/dia-object.h                     |  12 +--
 bindings/dia-properties.cpp               |  78 ++++++++---------
 bindings/dia-properties.h                 |  68 +++++++--------
 bindings/dia-renderer.cpp                 |   2 +-
 bindings/dia-renderer.h                   |  16 ++--
 lib/arrows.c                              |  12 +--
 lib/arrows.h                              |   2 +-
 lib/autoroute.c                           |  48 +++++------
 lib/boundingbox.c                         | 110 ++++++++++++------------
 lib/boundingbox.h                         |  16 ++--
 lib/dia-layer.h                           |  10 +--
 lib/dia_xml.c                             | 134 +++++++++++++++---------------
 lib/dia_xml.h                             |   6 +-
 lib/diagramdata.c                         |  14 ++--
 lib/diagramdata.h                         |   4 +-
 lib/diaimportrenderer.c                   |   4 +-
 lib/diainteractiverenderer.c              |   4 +-
 lib/diainteractiverenderer.h              |   4 +-
 lib/diapathrenderer.c                     |   4 +-
 lib/diarenderer.c                         |  24 +++---
 lib/diarenderer.h                         |  10 +--
 lib/diasvgrenderer.c                      |   2 +-
 lib/diatransform.c                        |  20 ++---
 lib/diatransform.h                        |   2 +-
 lib/diatransformrenderer.c                |   2 +-
 lib/diatypes.h                            |   2 +-
 lib/element.c                             |  44 +++++-----
 lib/font-height.c                         |   2 -
 lib/font.c                                |   2 -
 lib/geometry.c                            |  16 ++--
 lib/geometry.h                            |  28 ++++---
 lib/group.c                               |   8 +-
 lib/layer.c                               |  22 ++---
 lib/object.c                              |  35 ++++----
 lib/object.h                              |  10 +--
 lib/parent.c                              |  18 ++--
 lib/parent.h                              |   6 +-
 lib/path-math.c                           |  22 ++---
 lib/plug-ins.c                            |   2 -
 lib/prop_geomtypes.c                      |   4 +-
 lib/prop_geomtypes.h                      |  11 ++-
 lib/renderer/diacairo-interactive.c       |   8 +-
 lib/renderer/diacairo-print.c             |  10 +--
 lib/renderer/diacairo-renderer.c          |   6 +-
 lib/renderer/diacairo.c                   |   1 -
 lib/standard-path.c                       |   8 +-
 lib/text.c                                |   2 +-
 lib/text.h                                |   2 +-
 objects/AADL/aadl.h                       |   2 +-
 objects/AADL/aadlbus.c                    |   2 +-
 objects/AADL/aadldata.c                   |   4 +-
 objects/AADL/aadlprocess.c                |   2 +-
 objects/Database/compound.c               |   2 +-
 objects/Database/reference.c              |   8 +-
 objects/Database/table.c                  |   2 +-
 objects/ER/entity.c                       |   2 +-
 objects/ER/relationship.c                 |   2 +-
 objects/FS/flow-ortho.c                   |   2 +-
 objects/FS/flow.c                         |   2 +-
 objects/GRAFCET/action.c                  |   2 +-
 objects/GRAFCET/action_text_draw.c        |   2 +-
 objects/GRAFCET/action_text_draw.h        |   8 +-
 objects/GRAFCET/boolequation.c            |  21 +++--
 objects/GRAFCET/boolequation.h            |  12 +--
 objects/GRAFCET/condition.c               |   2 +-
 objects/GRAFCET/step.c                    |   2 +-
 objects/GRAFCET/transition.c              |   2 +-
 objects/GRAFCET/vergent.c                 |   2 +-
 objects/Istar/goal.c                      |   2 +-
 objects/Istar/link.c                      |   2 +-
 objects/Istar/other.c                     |   2 +-
 objects/Jackson/domain.c                  |   2 +-
 objects/Jackson/phenomenon.c              |   2 +-
 objects/Jackson/requirement.c             |   2 +-
 objects/KAOS/goal.c                       |   2 +-
 objects/KAOS/metaandorrel.c               |   2 +-
 objects/KAOS/metabinrel.c                 |   2 +-
 objects/KAOS/other.c                      |   2 +-
 objects/Misc/measure.c                    |   2 +-
 objects/SADT/annotation.c                 |   4 +-
 objects/SADT/box.c                        |   2 +-
 objects/UML/actor.c                       |   2 +-
 objects/UML/association.c                 |   4 +-
 objects/UML/component.c                   |   6 +-
 objects/UML/component_feature.c           |   2 +-
 objects/UML/constraint.c                  |   2 +-
 objects/UML/dependency.c                  |   2 +-
 objects/UML/generalization.c              |   2 +-
 objects/UML/implements.c                  |   2 +-
 objects/UML/large_package.c               |   4 +-
 objects/UML/message.c                     |   2 +-
 objects/UML/realizes.c                    |   2 +-
 objects/UML/small_package.c               |   4 +-
 objects/UML/transition.c                  |   9 +-
 objects/custom/custom_object.c            |  20 ++---
 objects/custom/shape_info.c               |  10 +--
 objects/custom/shape_info.h               |  20 ++---
 objects/flowchart/box.c                   |   2 +-
 objects/flowchart/diamond.c               |   2 +-
 objects/flowchart/parallelogram.c         |   2 +-
 objects/network/basestation.c             |   2 +-
 objects/network/radiocell.c               |   2 +-
 objects/standard/arc.c                    |  10 +--
 objects/standard/bezier.c                 |  12 +--
 objects/standard/beziergon.c              |   6 +-
 objects/standard/box.c                    |   2 +-
 objects/standard/image.c                  |   2 +-
 objects/standard/line.c                   |   4 +-
 objects/standard/polyline.c               |   4 +-
 objects/standard/textobj.c                |  19 +++--
 objects/standard/zigzagline.c             |   4 +-
 plug-ins/cairo/diacairo.c                 |   1 -
 plug-ins/cgm/cgm.c                        |   4 +-
 plug-ins/drs/dia-render-script-renderer.c |   2 +-
 plug-ins/dxf/dxf-export.c                 |   2 +-
 plug-ins/hpgl/hpgl.c                      |   4 +-
 plug-ins/layout/layout.cpp                |  14 ++--
 plug-ins/metapost/render_metapost.c       |   4 +-
 plug-ins/pdf/pdf-import.cpp               |   2 -
 plug-ins/pgf/render_pgf.c                 |   4 +-
 plug-ins/pixbuf/pixbuf.c                  |   2 +-
 plug-ins/postscript/diapsrenderer.c       |   2 +-
 plug-ins/postscript/diapsrenderer.h       |   2 +-
 plug-ins/postscript/paginate_psprint.c    |   9 +-
 plug-ins/pstricks/render_pstricks.c       |   6 +-
 plug-ins/python/pydia-diagram.c           |  43 +++++-----
 plug-ins/python/pydia-geometry.c          |  42 +++++-----
 plug-ins/python/pydia-geometry.h          |   4 +-
 plug-ins/python/pydia-layer.c             |   6 +-
 plug-ins/python/pydia-render.c            |  10 +--
 plug-ins/shape/shape-export.c             |  90 ++++++++++----------
 plug-ins/svg/render_svg.c                 |  20 ++---
 plug-ins/vdx/vdx-export.c                 |   2 +-
 plug-ins/wmf/paginate_gdiprint.cpp        |  16 ++--
 plug-ins/wmf/wmf.cpp                      |   4 +-
 plug-ins/wpg/wpg.c                        |   4 +-
 plug-ins/xfig/xfig-export.c               |   4 +-
 tests/test-boundingbox.c                  |  15 ++--
 tests/test-objects.c                      |  13 ++-
 154 files changed, 884 insertions(+), 859 deletions(-)
---
diff --git a/app/connectionpoint_ops.c b/app/connectionpoint_ops.c
index 186de064..bdffc2ab 100644
--- a/app/connectionpoint_ops.c
+++ b/app/connectionpoint_ops.c
@@ -71,7 +71,7 @@ object_draw_connectionpoints (DiaObject *obj, DDisplay *ddisp)
    * connection points - or some variation thereof ;)
    */
   if (dia_object_get_num_connections (obj) > 1) {
-    const Rectangle *bbox = dia_object_get_bounding_box (obj);
+    const DiaRectangle *bbox = dia_object_get_bounding_box (obj);
     real w = ddisplay_transform_length (ddisp, bbox->right - bbox->left);
     real h = ddisplay_transform_length (ddisp, bbox->bottom - bbox->top);
     int n = dia_object_get_num_connections (obj);
diff --git a/app/diagram.c b/app/diagram.c
index efb0cda5..db272771 100644
--- a/app/diagram.c
+++ b/app/diagram.c
@@ -51,7 +51,7 @@ static GList *open_diagrams = NULL;
 struct _ObjectExtent
 {
   DiaObject *object;
-  Rectangle extent;
+  DiaRectangle extent;
 };
 
 typedef struct _ObjectExtent ObjectExtent;
@@ -525,7 +525,7 @@ diagram_selected_can_parent(Diagram *dia) {
 gboolean
 object_within_parent(DiaObject *obj, DiaObject *p)
 {
-  Rectangle obj_bb = obj->bounding_box;
+  DiaRectangle obj_bb = obj->bounding_box;
   if (!object_flags_set(p, DIA_OBJECT_CAN_PARENT))
     return FALSE;
   if (p == obj)
@@ -869,7 +869,7 @@ diagram_add_update_all(Diagram *dia)
 }
 
 void
-diagram_add_update(Diagram *dia, const Rectangle *update)
+diagram_add_update (Diagram *dia, const DiaRectangle *update)
 {
   GSList *l;
   DDisplay *ddisp;
@@ -884,14 +884,21 @@ diagram_add_update(Diagram *dia, const Rectangle *update)
   }
 }
 
-/** Add an update of the given rectangle, but with an additional
+/**
+ * diagram_add_update_with_border:
+ * @dia: the #Diagram
+ * @update: the area to update
+ * @pixel_border: border around @update:
+ *
+ * Add an update of the given rectangle, but with an additional
  * border around it.  The pixels are added after the rectangle has
  * been converted to pixel coords.
  * Currently used for leaving room for highlighting.
  * */
 void
-diagram_add_update_with_border(Diagram *dia, const Rectangle *update,
-                              int pixel_border)
+diagram_add_update_with_border (Diagram            *dia,
+                                const DiaRectangle *update,
+                                int                 pixel_border)
 {
   GSList *l;
   DDisplay *ddisp;
diff --git a/app/diagram.h b/app/diagram.h
index 1c213cfa..9e679708 100644
--- a/app/diagram.h
+++ b/app/diagram.h
@@ -51,7 +51,7 @@ struct _Diagram {
   Color pagebreak_color; /*!< just to show page breaks */
   DiaGrid     grid;      /*!< the display grid */
 
-  /*! almost completely unused guides (load and save code is there) */  
+  /*! almost completely unused guides (load and save code is there) */
   struct {
     /* sorted arrays of the guides for the diagram */
     real *hguides, *vguides;
@@ -67,10 +67,10 @@ struct _Diagram {
 
 typedef struct _DiagramClass {
   DiagramDataClass parent_class;
-       
+
   /* signals */
   void (* removed)           (Diagram*);
-       
+
 } DiagramClass;
 
 GList *dia_open_diagrams(void); /* Read only! */
@@ -94,8 +94,8 @@ int diagram_is_selected(Diagram *diagram, DiaObject *obj);
 GList *diagram_get_sorted_selected(Diagram *dia);
 /* Removes selected from objects list, NOT selected list: */
 GList *diagram_get_sorted_selected_remove(Diagram *dia);
-void diagram_add_update(Diagram *dia, const Rectangle *update);
-void diagram_add_update_with_border(Diagram *dia, const Rectangle *update,
+void diagram_add_update (Diagram *dia, const DiaRectangle *update);
+void diagram_add_update_with_border (Diagram *dia, const DiaRectangle *update,
                                    int pixel_border);
 void diagram_add_update_all(Diagram *dia);
 void diagram_add_update_pixels(Diagram *dia, Point *point,
diff --git a/app/disp_callbacks.c b/app/disp_callbacks.c
index 752c662f..9b6c11dd 100644
--- a/app/disp_callbacks.c
+++ b/app/disp_callbacks.c
@@ -697,7 +697,7 @@ ddisplay_canvas_events (GtkWidget *canvas,
   guint state = 0;
   Focus *focus;
   DiaObject *obj;
-  Rectangle *visible;
+  DiaRectangle *visible;
   Point middle;
   int return_val;
   int key_handled;
@@ -1140,7 +1140,7 @@ ddisplay_drop_object(DDisplay *ddisp, gint x, gint y, DiaObjectType *otype,
   if (p_obj && object_flags_set(p_obj, DIA_OBJECT_CAN_PARENT))
     /* the tool was dropped inside an object that takes children*/
   {
-    Rectangle p_ext, c_ext;
+    DiaRectangle p_ext, c_ext;
     real parent_height, child_height, parent_width, child_width;
     real vadjust = 0.0, hadjust = 0.0;
     Point new_pos;
diff --git a/app/display.c b/app/display.c
index 5754116e..6d05efde 100644
--- a/app/display.c
+++ b/app/display.c
@@ -220,7 +220,7 @@ DDisplay *
 new_display(Diagram *dia)
 {
   DDisplay *ddisp;
-  Rectangle visible;
+  DiaRectangle visible;
   int preset;
 
   ddisp = g_new0(DDisplay,1);
@@ -264,7 +264,7 @@ new_display(Diagram *dia)
   ddisp->origo.y = 0.0;
   ddisp->zoom_factor = prefs.new_view.zoom/100.0*DDISPLAY_NORMAL_ZOOM;
   if ((ddisp->diagram) && (ddisp->diagram->data)) {
-    Rectangle *extents = &ddisp->diagram->data->extents;
+    DiaRectangle *extents = &ddisp->diagram->data->extents;
 
     visible.left = extents->left;
     visible.top = extents->top;
@@ -288,7 +288,7 @@ ddisplay_transform_coords_double (DDisplay *ddisp,
                                   double   *xi,
                                   double   *yi)
 {
-  Rectangle *visible = &ddisp->visible;
+  DiaRectangle *visible = &ddisp->visible;
   double width = dia_interactive_renderer_get_width_pixels (DIA_INTERACTIVE_RENDERER (ddisp->renderer));
   double height = dia_interactive_renderer_get_height_pixels (DIA_INTERACTIVE_RENDERER (ddisp->renderer));
 
@@ -304,7 +304,7 @@ ddisplay_transform_coords (DDisplay *ddisp,
                            int      *xi,
                            int      *yi)
 {
-  Rectangle *visible = &ddisp->visible;
+  DiaRectangle *visible = &ddisp->visible;
   int width = dia_interactive_renderer_get_width_pixels (DIA_INTERACTIVE_RENDERER (ddisp->renderer));
   int height = dia_interactive_renderer_get_height_pixels (DIA_INTERACTIVE_RENDERER (ddisp->renderer));
 
@@ -336,7 +336,7 @@ ddisplay_untransform_coords (DDisplay *ddisp,
                              coord    *x,
                              coord    *y)
 {
-  Rectangle *visible = &ddisp->visible;
+  DiaRectangle *visible = &ddisp->visible;
   int width = dia_interactive_renderer_get_width_pixels (DIA_INTERACTIVE_RENDERER (ddisp->renderer));
   int height = dia_interactive_renderer_get_height_pixels (DIA_INTERACTIVE_RENDERER (ddisp->renderer));
 
@@ -346,10 +346,12 @@ ddisplay_untransform_coords (DDisplay *ddisp,
 
 
 void
-ddisplay_add_update_pixels(DDisplay *ddisp, Point *point,
-                         int pixel_width, int pixel_height)
+ddisplay_add_update_pixels (DDisplay *ddisp,
+                            Point    *point,
+                            int       pixel_width,
+                            int       pixel_height)
 {
-  Rectangle rect;
+  DiaRectangle rect;
   real size_x, size_y;
 
   size_x = ddisplay_untransform_length(ddisp, pixel_width+1);
@@ -392,10 +394,11 @@ ddisplay_add_update_all(DDisplay *ddisp)
 /** Marks a rectangle for update, with a pixel border around it.
  */
 void
-ddisplay_add_update_with_border(DDisplay *ddisp, const Rectangle *rect,
-                               int pixel_border)
+ddisplay_add_update_with_border (DDisplay           *ddisp,
+                                 const DiaRectangle *rect,
+                                 int                 pixel_border)
 {
-  Rectangle r;
+  DiaRectangle r;
   real size = ddisplay_untransform_length(ddisp, pixel_border+1);
 
   r.left = rect->left-size;
@@ -407,9 +410,9 @@ ddisplay_add_update_with_border(DDisplay *ddisp, const Rectangle *rect,
 }
 
 void
-ddisplay_add_update(DDisplay *ddisp, const Rectangle *rect)
+ddisplay_add_update (DDisplay *ddisp, const DiaRectangle *rect)
 {
-  Rectangle *r;
+  DiaRectangle *r;
   // int width, height;
 
   if (!ddisp->renderer)
@@ -422,12 +425,12 @@ ddisplay_add_update(DDisplay *ddisp, const Rectangle *rect)
 
   /* Temporarily just do a union of all rectangles: */
   if (ddisp->update_areas==NULL) {
-    r = g_new(Rectangle,1);
+    r = g_new(DiaRectangle, 1);
     *r = *rect;
     rectangle_intersection(r, &ddisp->visible);
     ddisp->update_areas = g_slist_prepend(ddisp->update_areas, r);
   } else {
-    r = (Rectangle *) ddisp->update_areas->data;
+    r = (DiaRectangle *) ddisp->update_areas->data;
     rectangle_union(r, rect);
     rectangle_intersection(r, &ddisp->visible);
   }
@@ -474,8 +477,8 @@ ddisplay_obj_render (DiaObject   *obj,
 }
 
 void
-ddisplay_render_pixmap (DDisplay  *ddisp,
-                        Rectangle *update)
+ddisplay_render_pixmap (DDisplay     *ddisp,
+                        DiaRectangle *update)
 {
   GList *list;
   DiaObject *obj;
@@ -542,8 +545,8 @@ ddisplay_render_pixmap (DDisplay  *ddisp,
 void
 ddisplay_update_scrollbars(DDisplay *ddisp)
 {
-  Rectangle *extents = &ddisp->diagram->data->extents;
-  Rectangle *visible = &ddisp->visible;
+  DiaRectangle *extents = &ddisp->diagram->data->extents;
+  DiaRectangle *visible = &ddisp->visible;
   GtkAdjustment *hsbdata, *vsbdata;
 
   hsbdata = ddisp->hsbdata;
@@ -574,8 +577,8 @@ ddisplay_update_scrollbars(DDisplay *ddisp)
 void
 ddisplay_set_origo (DDisplay *ddisp, coord x, coord y)
 {
-  Rectangle *extents = &ddisp->diagram->data->extents;
-  Rectangle *visible = &ddisp->visible;
+  DiaRectangle *extents = &ddisp->diagram->data->extents;
+  DiaRectangle *visible = &ddisp->visible;
   int width, height;
 
   g_return_if_fail (ddisp->renderer != NULL);
@@ -602,9 +605,9 @@ ddisplay_set_origo (DDisplay *ddisp, coord x, coord y)
 }
 
 void
-ddisplay_zoom(DDisplay *ddisp, Point *point, real magnify)
+ddisplay_zoom (DDisplay *ddisp, Point *point, real magnify)
 {
-  Rectangle *visible;
+  DiaRectangle *visible;
   real width, height, old_zoom;
 
   visible = &ddisp->visible;
@@ -641,10 +644,10 @@ ddisplay_zoom(DDisplay *ddisp, Point *point, real magnify)
 /* Zoom around the middle point of the visible area
  */
 void
-ddisplay_zoom_middle(DDisplay *ddisp, real magnify)
+ddisplay_zoom_middle (DDisplay *ddisp, real magnify)
 {
   Point middle;
-  Rectangle *visible;
+  DiaRectangle *visible;
 
   visible = &ddisp->visible;
   middle.x = visible->left*0.5 + visible->right*0.5;
@@ -660,9 +663,9 @@ ddisplay_zoom_middle(DDisplay *ddisp, real magnify)
    from "jumping" around while zooming in and out.
  */
 void
-ddisplay_zoom_centered(DDisplay *ddisp, Point *point, real magnify)
+ddisplay_zoom_centered (DDisplay *ddisp, Point *point, real magnify)
 {
-  Rectangle *visible;
+  DiaRectangle *visible;
   real width, height;
   /* cursor position ratios */
   real rx,ry;
@@ -799,13 +802,13 @@ ddisplay_autoscroll(DDisplay *ddisp, int x, int y)
 
 /** Scroll the display by delta (diagram coords) */
 gboolean
-ddisplay_scroll(DDisplay *ddisp, Point *delta)
+ddisplay_scroll (DDisplay *ddisp, Point *delta)
 {
-  Rectangle *visible = &ddisp->visible;
+  DiaRectangle *visible = &ddisp->visible;
   real width = visible->right - visible->left;
   real height = visible->bottom - visible->top;
 
-  Rectangle extents = ddisp->diagram->data->extents;
+  DiaRectangle extents = ddisp->diagram->data->extents;
   real ex_width = extents.right - extents.left;
   real ex_height = extents.bottom - extents.top;
 
@@ -895,9 +898,9 @@ ddisplay_scroll_center_point(DDisplay *ddisp, Point *p)
 /** Scroll display so that obj is centered.
  * Returns TRUE if anything changed.  */
 gboolean
-ddisplay_scroll_to_object(DDisplay *ddisp, DiaObject *obj)
+ddisplay_scroll_to_object (DDisplay *ddisp, DiaObject *obj)
 {
-  Rectangle r = obj->bounding_box;
+  DiaRectangle r = obj->bounding_box;
 
   Point p;
   p.x = (r.left+r.right)/2;
@@ -912,8 +915,8 @@ ddisplay_scroll_to_object(DDisplay *ddisp, DiaObject *obj)
 gboolean
 ddisplay_present_object(DDisplay *ddisp, DiaObject *obj)
 {
-  const Rectangle *r = dia_object_get_enclosing_box(obj);
-  const Rectangle *v = &ddisp->visible;
+  const DiaRectangle *r = dia_object_get_enclosing_box(obj);
+  const DiaRectangle *v = &ddisp->visible;
 
   display_set_active(ddisp);
   if  (!rectangle_in_rectangle(v, r)) {
@@ -1512,7 +1515,7 @@ ddisplay_show_all (DDisplay *ddisp)
   /* if there is something selected show that instead of all exisiting objects */
   if (dia->data->selected) {
     GList *list = dia->data->selected;
-    Rectangle extents = *dia_object_get_enclosing_box ((DiaObject*)list->data);
+    DiaRectangle extents = *dia_object_get_enclosing_box ((DiaObject*)list->data);
     list = g_list_next(list);
     while (list) {
       DiaObject *obj = (DiaObject *)list->data;
diff --git a/app/display.h b/app/display.h
index 06242df1..5ca96415 100644
--- a/app/display.h
+++ b/app/display.h
@@ -54,24 +54,24 @@ struct _DDisplay {
   GtkWidget      *origin;              /* either decoration or menu button  */
   GtkWidget      *menu_bar;            /* widget for the menu bar           */
   GtkUIManager   *ui_manager;     /* ui manager used to create the menu bar */
-  GtkActionGroup *actions;        
+  GtkActionGroup *actions;
 
   /* menu bar widgets */
   GtkMenuItem *rulers;
 
-  GtkWidget *zoom_status;         
+  GtkWidget *zoom_status;
   GtkWidget *grid_status;
   GtkWidget *mainpoint_status;
   GtkWidget *modified_status;
 
   GtkAccelGroup *accel_group;
-  
+
   GtkAdjustment *hsbdata;         /* horizontal data information       */
   GtkAdjustment *vsbdata;         /* vertical data information         */
 
   Point origo;                    /* The origo (lower left) position   */
   real zoom_factor;               /* zoom, 20.0 means 20 pixel == 1 cm */
-  Rectangle visible;              /* The part visible in this display  */
+  DiaRectangle visible;              /* The part visible in this display  */
 
   Grid grid;                      /* the grid in this display          */
 
@@ -81,7 +81,7 @@ struct _DDisplay {
 
   int aa_renderer;
   DiaRenderer *renderer;
-  
+
   GSList *update_areas;           /* Update areas list                 */
 
   GtkIMContext *im_context;
@@ -89,23 +89,23 @@ struct _DDisplay {
   /* Preedit String */
   gchar *preedit_string;
   PangoAttrList *preedit_attrs;
- 
+
   /* Is there another case?  Like I see embedded-dia modules, do these do something
-   * in addition??? */  
+   * in addition??? */
   gboolean   is_standalone_window;
 
   /* Points to Integrated UI Toolbar */
   GtkToolbar *common_toolbar;
 
   /* Points to widget containing the diagram if not standalone window */
-  GtkWidget *container; 
+  GtkWidget *container;
 
   /* Private field, indicates if rulers are shown for this diagram. */
   gboolean rulers_are_showing;
 
   /* Private field, indicates which text, if any, is being edited */
   Focus *active_focus;
-  
+
   /* Rember the last clicked point per display, but in diagram coordinates */
   Point clicked_position;
 };
@@ -115,7 +115,7 @@ extern GdkCursor *default_cursor;
 DDisplay *new_display(Diagram *dia);
 DDisplay *copy_display(DDisplay *orig_ddisp);
 /* Normal destroy is done through shell widget destroy event. */
-void ddisplay_really_destroy(DDisplay *ddisp); 
+void ddisplay_really_destroy(DDisplay *ddisp);
 void ddisplay_transform_coords_double(DDisplay *ddisp,
                                      coord x, coord y,
                                      double *xi, double *yi);
@@ -130,9 +130,9 @@ real ddisplay_untransform_length(DDisplay *ddisp, real len);
 void ddisplay_add_update_pixels(DDisplay *ddisp, Point *point,
                                       int pixel_width, int pixel_height);
 void ddisplay_add_update_all(DDisplay *ddisp);
-void ddisplay_add_update_with_border(DDisplay *ddisp, const Rectangle *rect,
+void ddisplay_add_update_with_border(DDisplay *ddisp, const DiaRectangle *rect,
                                     int pixel_border);
-void ddisplay_add_update(DDisplay *ddisp, const Rectangle *rect);
+void ddisplay_add_update(DDisplay *ddisp, const DiaRectangle *rect);
 void ddisplay_flush(DDisplay *ddisp);
 void ddisplay_update_scrollbars(DDisplay *ddisp);
 void ddisplay_set_origo(DDisplay *ddisp,
@@ -149,7 +149,7 @@ void ddisplay_resize_canvas(DDisplay *ddisp,
                            int width,
                            int height);
 
-void ddisplay_render_pixmap(DDisplay *ddisp, Rectangle *update);
+void ddisplay_render_pixmap(DDisplay *ddisp, DiaRectangle *update);
 
 DDisplay *ddisplay_active(void);
 Diagram *ddisplay_active_diagram(void);
@@ -167,7 +167,7 @@ Point ddisplay_get_clicked_position(DDisplay *ddisp);
 gboolean display_get_rulers_showing(DDisplay *ddisp);
 void display_rulers_show (DDisplay *ddisp);
 void display_rulers_hide (DDisplay *ddisp);
-void ddisplay_update_rulers (DDisplay *ddisp, const Rectangle *extents, const Rectangle *visible);
+void ddisplay_update_rulers (DDisplay *ddisp, const DiaRectangle *extents, const DiaRectangle *visible);
 
 gboolean ddisplay_scroll(DDisplay *ddisp, Point *delta);
 gboolean ddisplay_autoscroll(DDisplay *ddisp, int x, int y);
diff --git a/app/grid.c b/app/grid.c
index 64375b4d..9bc2c121 100644
--- a/app/grid.c
+++ b/app/grid.c
@@ -81,7 +81,7 @@ grid_step (DDisplay *ddisp, GtkOrientation orientation,
 }
 
 static void
-grid_draw_horizontal_lines(DDisplay *ddisp, Rectangle *update, real length)
+grid_draw_horizontal_lines(DDisplay *ddisp, DiaRectangle *update, real length)
 {
   int x, y;
   real pos;
@@ -132,7 +132,7 @@ grid_draw_horizontal_lines(DDisplay *ddisp, Rectangle *update, real length)
 }
 
 static void
-grid_draw_vertical_lines (DDisplay *ddisp, Rectangle *update, real length)
+grid_draw_vertical_lines (DDisplay *ddisp, DiaRectangle *update, real length)
 {
   int x = 0, y = 0;
   real pos;
@@ -175,7 +175,7 @@ grid_draw_vertical_lines (DDisplay *ddisp, Rectangle *update, real length)
 }
 
 static void
-grid_draw_hex (DDisplay *ddisp, Rectangle *update, real length)
+grid_draw_hex (DDisplay *ddisp, DiaRectangle *update, real length)
 {
   real horiz_pos, vert_pos;
   int to_x, to_y, x, y;
@@ -284,7 +284,7 @@ grid_draw_hex (DDisplay *ddisp, Rectangle *update, real length)
 }
 
 void
-grid_draw(DDisplay *ddisp, Rectangle *update)
+grid_draw (DDisplay *ddisp, DiaRectangle *update)
 {
   Grid *grid = &ddisp->grid;
   DiaRenderer *renderer = ddisp->renderer;
@@ -320,7 +320,7 @@ grid_draw(DDisplay *ddisp, Rectangle *update)
 }
 
 void
-pagebreak_draw (DDisplay *ddisp, Rectangle *update)
+pagebreak_draw (DDisplay *ddisp, DiaRectangle *update)
 {
   DiaRenderer *renderer = ddisp->renderer;
 
diff --git a/app/grid.h b/app/grid.h
index 13a6c712..df835aae 100644
--- a/app/grid.h
+++ b/app/grid.h
@@ -30,8 +30,8 @@ struct _Grid {
 
 #include "display.h"
 
-void grid_draw(DDisplay *ddisp, Rectangle *update);
-void pagebreak_draw(DDisplay *ddisp, Rectangle *update);
+void grid_draw(DDisplay *ddisp, DiaRectangle *update);
+void pagebreak_draw(DDisplay *ddisp, DiaRectangle *update);
 void snap_to_grid(DDisplay *ddisp, coord *x, coord *y);
 
 gboolean grid_step (DDisplay *ddisp, GtkOrientation orientation,
diff --git a/app/interface.c b/app/interface.c
index e328a707..aea97918 100644
--- a/app/interface.c
+++ b/app/interface.c
@@ -400,7 +400,7 @@ canvas_expose_event (GtkWidget      *widget,
                      DDisplay       *ddisp)
 {
   GSList *l;
-  Rectangle *r, totrect;
+  DiaRectangle *r, totrect;
   GtkAllocation alloc;
   cairo_t *ctx;
 
@@ -411,12 +411,12 @@ canvas_expose_event (GtkWidget      *widget,
   /* Only update if update_areas exist */
   l = ddisp->update_areas;
   if (l != NULL) {
-    totrect = *(Rectangle *) l->data;
+    totrect = *(DiaRectangle *) l->data;
 
     dia_interactive_renderer_clip_region_clear (DIA_INTERACTIVE_RENDERER (ddisp->renderer));
 
     while ( l!= NULL) {
-      r = (Rectangle *) l->data;
+      r = (DiaRectangle *) l->data;
 
       rectangle_union (&totrect, r);
       dia_interactive_renderer_clip_region_add_rect (DIA_INTERACTIVE_RENDERER (ddisp->renderer), r);
@@ -885,9 +885,9 @@ create_display_shell(DDisplay *ddisp,
  * @param ddisp The display to hide the rulers on.
  */
 void
-ddisplay_update_rulers (DDisplay        *ddisp,
-                        const Rectangle *extents,
-                       const Rectangle *visible)
+ddisplay_update_rulers (DDisplay           *ddisp,
+                        const DiaRectangle *extents,
+                        const DiaRectangle *visible)
 {
   dia_ruler_set_range  (ddisp->hrule,
                        visible->left,
diff --git a/app/magnify.c b/app/magnify.c
index 0e4d0324..b931fb3a 100644
--- a/app/magnify.c
+++ b/app/magnify.c
@@ -51,7 +51,7 @@ magnify_button_release (MagnifyTool    *tool,
                         GdkEventButton *event,
                         DDisplay       *ddisp)
 {
-  Rectangle *visible;
+  DiaRectangle *visible;
   Point p1, p2, tl;
   real diff;
   int idiff;
diff --git a/app/modify_tool.c b/app/modify_tool.c
index 1b09f470..eacf1c34 100644
--- a/app/modify_tool.c
+++ b/app/modify_tool.c
@@ -669,7 +669,7 @@ modify_motion (ModifyTool     *tool,
 static GList *
 find_selected_objects(DDisplay *ddisp, ModifyTool *tool)
 {
-  Rectangle r;
+  DiaRectangle r;
   r.left = MIN(tool->start_box.x, tool->end_box.x);
   r.right = MAX(tool->start_box.x, tool->end_box.x);
   r.top = MIN(tool->start_box.y, tool->end_box.y);
diff --git a/app/navigation.c b/app/navigation.c
index c9413a9e..51323bb7 100644
--- a/app/navigation.c
+++ b/app/navigation.c
@@ -5,21 +5,21 @@
  *
  * navigation.c : a navigation popup window to browse large diagrams.
  * Copyright (C) 2003 Luc Pionchon
- *  
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- *  
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *  
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *  
+ *
  */
 
 #include <gtk/gtk.h>
@@ -146,7 +146,7 @@ on_button_navigation_popup_pressed (GtkButton * button, gpointer _ddisp)
 
   DiagramData * data;
 
-  Rectangle rect;/*diagram's extents*/
+  DiaRectangle rect;/*diagram's extents*/
   real zoom;/*zoom factor for thumbnail rendering*/
 
   DiaCairoRenderer *renderer;
@@ -169,7 +169,7 @@ on_button_navigation_popup_pressed (GtkButton * button, gpointer _ddisp)
     rect.left   = data->extents.left   - DIAGRAM_OFFSET;
     rect.bottom = data->extents.bottom + DIAGRAM_OFFSET + 1;
     rect.right  = data->extents.right  + DIAGRAM_OFFSET + 1;
-    
+
     zoom = nav->max_size / MAX( (rect.right - rect.left) , (rect.bottom - rect.top) );
 
     nav->width  = MIN( nav->max_size, (rect.right  - rect.left) * zoom);
@@ -199,7 +199,7 @@ on_button_navigation_popup_pressed (GtkButton * button, gpointer _ddisp)
     reset_sc_adj (adj, rect.top, rect.bottom, canvas_height / nav->ddisp->zoom_factor);
     nav->vadj_coef = (adj->upper - adj->page_size - adj->lower) / (nav->height - nav->frame_h);
   }
-  
+
   /*--GUI*/
   /*popup window, and cute frame*/
   popup_window = gtk_window_new (GTK_WINDOW_POPUP);
@@ -318,7 +318,7 @@ on_da_expose_event (GtkWidget * widget, GdkEventExpose * event, gpointer unused)
   cairo_stroke (ctx);
 
   nav->is_first_expose = FALSE;
-  
+
   return FALSE;
 }
 
@@ -382,7 +382,7 @@ on_da_motion_notify_event (GtkWidget * drawing_area, GdkEventMotion * event, gpo
 static gboolean
 on_da_button_release_event (GtkWidget * widget, GdkEventButton * event, gpointer unused)
 {
-  /* Apparently there are circumstances where this is run twice for one popup 
+  /* Apparently there are circumstances where this is run twice for one popup
    * Protected calls to avoid crashing on second pass.
    */
   if (nav->cursor)
diff --git a/bindings/dia-diagramdata.cpp b/bindings/dia-diagramdata.cpp
index a0cf3804..46d16fb4 100644
--- a/bindings/dia-diagramdata.cpp
+++ b/bindings/dia-diagramdata.cpp
@@ -26,7 +26,7 @@
 #include "dia-diagramdata.h"
 
 //! how many contained
-int 
+int
 dia::Objects::len () const
 {
     if (list)
@@ -36,9 +36,9 @@ dia::Objects::len () const
 //! \brief return back a single one
 //! Together with len() getitem() allows list access. The code generator needs some
 //! extra help to not making it an endless list. At least for Python the NULL return
-//! was turned into None objects, we want to have only as much list elements 
+//! was turned into None objects, we want to have only as much list elements
 //! as there are real objects.
-dia::Object* 
+dia::Object*
 dia::Objects::getitem (int n) const
 {
     if (list && n >= 0 && n < g_list_length(*list))
@@ -48,7 +48,7 @@ dia::Objects::getitem (int n) const
 
 //! construct with underlying list of objects
 //! \todo check ownership/lifetime of that list!
-dia::Layer::Layer (::Layer* layer) : self(layer), _found(0) 
+dia::Layer::Layer (::Layer* layer) : self(layer), _found(0)
 {
     assert (self);
     // todo: when we allow to change the name this needs to change
@@ -77,7 +77,7 @@ dia::Layer::update_extents ()
     layer_update_extents(self);
 }
 //! the object next to given point but within maxdist
-dia::Object* 
+dia::Object*
 dia::Layer::find_closest_object (::Point* pos, double maxdist) const
 {
     g_return_val_if_fail (self != NULL, 0);
@@ -87,8 +87,8 @@ dia::Layer::find_closest_object (::Point* pos, double maxdist) const
     return 0;
 }
 //! a list of Object in the given rectangle
-dia::Objects& 
-dia::Layer::find_objects_in_rectangle (::Rectangle* rect) const
+dia::Objects&
+dia::Layer::find_objects_in_rectangle (::DiaRectangle* rect) const
 {
     static GList* list = layer_find_objects_in_rectangle (self, rect);
     if (_found)
@@ -97,7 +97,7 @@ dia::Layer::find_objects_in_rectangle (::Rectangle* rect) const
     return *_found;
 }
  //! objects are kept in an ordered list, this is the index of the given object
-int 
+int
 dia::Layer::object_index (Object* o) const
 {
     g_return_val_if_fail (self != NULL, -1);
@@ -156,13 +156,13 @@ dia::DiagramData::add_layer (const char* name)
     dia::Layer* dl = new dia::Layer (layer);
     return dl;
 }
-void 
+void
 dia::DiagramData::update_extents ()
 {
     g_return_if_fail(self != NULL);
     data_update_extents(self);
     // conceptionally const, i.e. read-only
-    *const_cast< ::Rectangle* >(&extents) = self->extents;
+    *const_cast< ::DiaRectangle* >(&extents) = self->extents;
 }
 dia::Objects&
 dia::DiagramData::get_sorted_selected () const
diff --git a/bindings/dia-diagramdata.h b/bindings/dia-diagramdata.h
index 84b31688..07bedf9a 100644
--- a/bindings/dia-diagramdata.h
+++ b/bindings/dia-diagramdata.h
@@ -9,7 +9,7 @@
 #include "dia-object.h"
 
 //! every wrapping object is in the 'dia' namespace
-//! the C-Objects are only namespaced in the binding 
+//! the C-Objects are only namespaced in the binding
 namespace dia {
 
 class Object;
@@ -29,7 +29,7 @@ public :
 
     //! construct from Object owning objects list
     Objects (GList** o) : list(o) {}
-    
+
     /* array access */
     //! how many contained
     int len () const;
@@ -42,7 +42,7 @@ private :
 /*!
  * \brief Proxy to the Layer object
  *
- * A Layer is the connection between DiagramData and Object. 
+ * A Layer is the connection between DiagramData and Object.
  * DiagramData has Layers and a Layer has Objects.
  */
 class Layer
@@ -52,7 +52,7 @@ public :
     explicit Layer (::Layer* layer);
     //! destroy caches etc.
     ~Layer ();
-    //! the underlying type - only for implementation, not visible in th elanguage binding 
+    //! the underlying type - only for implementation, not visible in th elanguage binding
     ::Layer* Self () const { return self; }
     //! collection of contained Object, read-only!
     const Objects* objects;
@@ -63,7 +63,7 @@ public :
     //! the object next to given point but within maxdist
     Object* find_closest_object (::Point* pos, double maxdist) const;
     //! a list of Object in the given rectangle
-    Objects& find_objects_in_rectangle (::Rectangle* rect) const;
+    Objects& find_objects_in_rectangle (::DiaRectangle* rect) const;
     //! objects are kept in an ordered list, this is the index of the given object
     int object_index (Object* o) const;
 
@@ -102,10 +102,10 @@ class DiagramData
 public :
     //! the size of the diagram, from last DiagramData::update_extents();
 #ifdef SWIG
-    const // this is read only from Python , too. But gcc does not like it that way 
+    const // this is read only from Python , too. But gcc does not like it that way
           // error: uninitialized member 'dia::DiagramData::extents' with 'const' type 'const Rectangle'
 #endif
-    ::Rectangle extents;
+    ::DiaRectangle extents;
     //! trying to be compatible, read-only
     const Layer* active_layer;
     //! the read-only list of layers, \todo typemap it in SWIG
diff --git a/bindings/dia-object.cpp b/bindings/dia-object.cpp
index 83fee17a..03fdc1d2 100644
--- a/bindings/dia-object.cpp
+++ b/bindings/dia-object.cpp
@@ -30,10 +30,10 @@ dia::ObjectType::ObjectType (DiaObjectType* ot) : self(ot), version(ot ? ot->ver
 }
 /*! Factory function to create Object of a given type.
  *
- * \return not only the new Object* but also two 'appropriate' Handle to e.g. connect 
+ * \return not only the new Object* but also two 'appropriate' Handle to e.g. connect
  * to some other Object
  */
-dia::Object* 
+dia::Object*
 dia::ObjectType::create(double x, double y, dia::Handle** h1, dia::Handle** h2) const
 {
     ::_Handle *_h1, *_h2;
@@ -47,10 +47,10 @@ dia::ObjectType::create(double x, double y, dia::Handle** h1, dia::Handle** h2)
     if (h2) *h2 = new dia::Handle (_h2, o->Self());
     return o;
 }
-/*! 
+/*!
  * Allows to load an object from storage. Not sure if this becomes useful for language bindings.
  */
-dia::Object* 
+dia::Object*
 dia::ObjectType::load (ObjectNode node, int version, DiaContext *ctx) const
 {
     assert (self);
@@ -59,7 +59,7 @@ dia::ObjectType::load (ObjectNode node, int version, DiaContext *ctx) const
 /*! Allows to save an Object to ObjectNode file filename.
  * . Not sure if this becomes useful for language bindings.
  */
-void 
+void
 dia::ObjectType::save (Object* o, ObjectNode node, const char* filename) const
 {
     assert (self);
@@ -70,7 +70,7 @@ dia::ObjectType::save (Object* o, ObjectNode node, const char* filename) const
 }
 #if 0
 //! OPTIONAL: opens the defaults dialog
-GtkWidget* 
+GtkWidget*
 dia::ObjectType::get_defaults () const
 {
     assert (self);
@@ -80,7 +80,7 @@ dia::ObjectType::get_defaults () const
 }
 #endif
 //! OPTIONAL: apply changed defaults
-void 
+void
 dia::ObjectType::apply_defaults ()
 {
     assert (self);
@@ -98,20 +98,20 @@ dia::Object::~Object ()
 {
 }
 //! accessor to deliver the objects bounding box
-::_Rectangle*
+::DiaRectangle*
 dia::Object::bbox () const
 {
     return &self->bounding_box;
 }
 //! real destruction
-void 
+void
 dia::Object::destroy ()
 {
     assert (self);
     self->ops->destroy (self);
 }
 //! drawing the object on the renderer
-void 
+void
 dia::Object::draw (Renderer* r) const
 {
     assert (self);
@@ -120,7 +120,7 @@ dia::Object::draw (Renderer* r) const
 #endif
 }
 //! calculate the distance betwenn the object and the point
-double 
+double
 dia::Object::distance_from (Point* p) const
 {
     assert (self);
@@ -140,7 +140,7 @@ dia::Object* dia::Object::copy () const
     return new dia::Object (self->ops->copy (self));
 }
 //! change position of the whole object
-ObjectChange* 
+ObjectChange*
 dia::Object::move (double x, double y)
 {
     assert (self);
@@ -148,7 +148,7 @@ dia::Object::move (double x, double y)
     return self->ops->move (self, &p);
 }
 //! change position of an object handle - this is usually  a resize (Attention: does *not* match the C 
prototype)
-ObjectChange* 
+ObjectChange*
 dia::Object::move_handle (dia::Handle* h, double x, double y, HandleMoveReason reason, ModifierKeys 
modifiers)
 {
     assert (self);
@@ -156,7 +156,7 @@ dia::Object::move_handle (dia::Handle* h, double x, double y, HandleMoveReason r
     return self->ops->move_handle (self, h->Self(), &p, NULL, reason, modifiers);
 }
 //! OPTIONAL: provide a property dialog to change the object proeprties
-GtkWidget* 
+GtkWidget*
 dia::Object::get_properties (bool is_default) const
 {
     assert (self);
@@ -165,7 +165,7 @@ dia::Object::get_properties (bool is_default) const
     return self->ops->get_properties (self, is_default);
 }
 //! OPTIONAL: apply the properties changed in the dialog
-ObjectChange* 
+ObjectChange*
 dia::Object::apply_properties (GtkWidget* w)
 {
     assert (self);
@@ -174,7 +174,7 @@ dia::Object::apply_properties (GtkWidget* w)
     return self->ops->apply_properties_from_dialog (self, w);
 }
 //! OPTIONAL: provide a context menu to change the object states
-DiaMenu* 
+DiaMenu*
 dia::Object::get_object_menu (Point* pos) const
 {
     assert (self);
@@ -182,23 +182,23 @@ dia::Object::get_object_menu (Point* pos) const
        return 0;
     return self->ops->get_object_menu (self, pos);
 }
-    
+
 //! StdProps: descibe properties accessible via standard properties API
-const PropDescription* 
+const PropDescription*
 dia::Object::describe_props () const
 {
     assert (self);
     return self->ops->describe_props (self);
 }
 //! StdProps: return a list of properties describing the object state
-void 
+void
 dia::Object::get_props (GPtrArray *props) const
 {
     assert (self);
     self->ops->get_props (self, props);
 }
 //! StdProps: apply a list of object properties to change the objects state
-void 
+void
 dia::Object::set_props (GPtrArray *props)
 {
     assert (self);
diff --git a/bindings/dia-object.h b/bindings/dia-object.h
index 4415bf76..627c964e 100644
--- a/bindings/dia-object.h
+++ b/bindings/dia-object.h
@@ -18,7 +18,7 @@ class Renderer;
 /*!
  * \brief ObjectType is the factoy to create Object
  *
- * To get on all registered ObjectType use dia::registered_types() to create one specific Object 
+ * To get on all registered ObjectType use dia::registered_types() to create one specific Object
  * factory use dia::get_object_type()
  */
 class ObjectType
@@ -31,7 +31,7 @@ public :
 
     //! \internal construct from underlying type
     ObjectType (::DiaObjectType* ot);
-    //! create a default initialized object 
+    //! create a default initialized object
     Object* create (double x, double y, dia::Handle** h1 = 0, dia::Handle** h2 = 0) const;
     //! load an object from storage
     Object* load (ObjectNode node, int version, DiaContext *ctx) const;
@@ -44,7 +44,7 @@ public :
     //! OPTIONAL: apply changed defaults
     void apply_defaults ();
 private :
-    ::DiaObjectType* self;     
+    ::DiaObjectType* self;
 };
 
 /*!
@@ -66,8 +66,8 @@ public :
     const ObjectType type;
 
     //! direct property access for compatibility and convenience
-    ::_Rectangle* bbox () const;
-    
+    ::DiaRectangle* bbox () const;
+
     //! \internal create an object wrapper - object previously registered from a plug-in
     Object (DiaObject*);
     //! \internal destroying the proxy, not the underlying object
@@ -95,7 +95,7 @@ public :
     ObjectChange* apply_properties (GtkWidget*);
     //! OPTIONAL: provide a context menu to change the object states
     DiaMenu* get_object_menu (Point* pos) const;
-    
+
     //! StdProps: descibe properties accessible via standard properties API
     const PropDescription* describe_props () const;
     //! StdProps: return a list of properties describing the object state
diff --git a/bindings/dia-properties.cpp b/bindings/dia-properties.cpp
index 6cf77b11..cbeb0405 100644
--- a/bindings/dia-properties.cpp
+++ b/bindings/dia-properties.cpp
@@ -32,12 +32,12 @@
 #include "dia-properties.h"
 #include "dia-object.h"
 
-dia::Property< ::Property* >::Property (::Property* p) : self(p) 
+dia::Property< ::Property* >::Property (::Property* p) : self(p)
 {
 }
 
-//! read-only attribute; the name of the property; at least unique within an object, but supposed to be 
unique global 
-const char* 
+//! read-only attribute; the name of the property; at least unique within an object, but supposed to be 
unique global
+const char*
 dia::Property< ::Property* >::get_name () const
 {
     if (self)
@@ -45,7 +45,7 @@ dia::Property< ::Property* >::get_name () const
     return "<null>::name";
 }
 //! read-only attribute giving the data type represented
-const char* 
+const char*
 dia::Property< ::Property* >::get_type () const
 {
     if (self)
@@ -60,12 +60,12 @@ dia::Property< ::Property* >::get_type () const
  *     template<class T> bool Property::get_value<T>(T*);
  * an wrap them into one Property.value for runtime typed languages or ... ?
  */
-bool 
+bool
 dia::Property< ::Property* >::get (int* v) const
 {
     g_return_val_if_fail (self != NULL, false);
     bool ret = true;
-    
+
     if (strcmp (self->descr->type, PROP_TYPE_BOOL) == 0)
        *v = ((BoolProperty *)self)->bool_data;
     else if (strcmp (self->descr->type, PROP_TYPE_INT) == 0)
@@ -78,7 +78,7 @@ dia::Property< ::Property* >::get (int* v) const
     return ret;
 }
 //! getter for double
-bool 
+bool
 dia::Property< ::Property* >::get (double* v) const
 {
     g_return_val_if_fail (self != NULL, false);
@@ -89,7 +89,7 @@ dia::Property< ::Property* >::get (double* v) const
     return false;
 }
 //! getter for string
-bool 
+bool
 dia::Property< ::Property* >::get (const char** v) const
 {
     g_return_val_if_fail (self != NULL, false);
@@ -102,31 +102,31 @@ dia::Property< ::Property* >::get (const char** v) const
     return false;
 }
 //! Now it starts to become ugly: isn't there a better way with SWIG to map one to may types?
-bool 
-dia::Property< ::Property* >::get (::_Point* v) const 
-{ 
+bool
+dia::Property< ::Property* >::get (::_Point* v) const
+{
     g_return_val_if_fail (self != NULL, false);
     if (strcmp (self->descr->type, PROP_TYPE_POINT) == 0) {
        *v = ((PointProperty *)self)->point_data;
        return true;
     }
-    return false; 
+    return false;
 }
 //! almost complete ;)
 bool
-dia::Property< ::Property* >::get (::_Rectangle* v) const 
-{ 
+dia::Property< ::Property* >::get (::DiaRectangle* v) const
+{
     g_return_val_if_fail (self != NULL, false);
     if (strcmp (self->descr->type, PROP_TYPE_RECT) == 0) {
        *v = ((RectProperty *)self)->rect_data;
        return true;
     }
-    return false; 
+    return false;
 }
 //! the final one
 bool
-dia::Property< ::Property* >::get (const std::vector<IProperty*>** v) const 
-{ 
+dia::Property< ::Property* >::get (const std::vector<IProperty*>** v) const
+{
     g_return_val_if_fail (self != NULL, false);
     if (strcmp (self->descr->type, PROP_TYPE_DARRAY) == 0) {
        // remove everything from an earlier call
@@ -148,7 +148,7 @@ dia::Property< ::Property* >::get (const std::vector<IProperty*>** v) const
        *v = &vec;
        return true;
     }
-    return false; 
+    return false;
 }
 
 dia::Property< ::Property* >::~Property ()
@@ -161,22 +161,22 @@ dia::Property< ::Property* >::~Property ()
 /*!
  * If there is still a property conversion missing it needs to be added
  * in four places. In the implementation dia-properties.cpp, in the
- * interface of this class and IProperty: dia-properties.h and finally 
+ * interface of this class and IProperty: dia-properties.h and finally
  * in the .swig file.
  */
 bool
-dia::Property< ::Property* >::get (::_Color* v) const 
-{ 
+dia::Property< ::Property* >::get (::_Color* v) const
+{
     g_return_val_if_fail (self != NULL, false);
     if (strcmp (self->descr->type, PROP_TYPE_COLOUR) == 0) {
        *v = ((ColorProperty *)self)->color_data;
        return true;
     }
-    return false; 
+    return false;
 }
 
 //! if the property is to be shown (in a dialog)
-bool 
+bool
 dia::Property< ::Property* >::visible () const
 {
     g_return_val_if_fail (self != NULL, false);
@@ -191,7 +191,7 @@ dia::Properties::~Properties ()
 }
 
 //! is there a property of this name
-bool 
+bool
 dia::Properties::has_key (const char* name) const
 {
     g_return_val_if_fail (object != NULL, false);
@@ -231,8 +231,8 @@ set_prop (::Property* p, const char* v)
     if (strcmp (p->descr->type, PROP_TYPE_COLOUR) == 0) {
        PangoColor color;
        if (pango_color_parse(&color, v)) {
-            ((ColorProperty*)p)->color_data.red = color.red / 65535.0; 
-            ((ColorProperty*)p)->color_data.green = color.green / 65535.0; 
+            ((ColorProperty*)p)->color_data.red = color.red / 65535.0;
+            ((ColorProperty*)p)->color_data.green = color.green / 65535.0;
             ((ColorProperty*)p)->color_data.blue = color.blue / 65535.0;
             ((ColorProperty*)p)->color_data.alpha = 1.0;
         }
@@ -260,7 +260,7 @@ set_prop (::Property* p, char* v)
 static bool
 set_prop (GPtrArray* to, ::ArrayProperty* kinds, int num, const std::vector<dia::IProperty*>&v)
 {
-    for (int i = 0; i < v.size() && i < num; ++i) { 
+    for (int i = 0; i < v.size() && i < num; ++i) {
         ::Property *ex = (::Property*)g_ptr_array_index(kinds->ex_props, i);
        ::Property* inner = ex->ops->copy(ex);
        dia::IProperty *from = v[i];
@@ -269,7 +269,7 @@ set_prop (GPtrArray* to, ::ArrayProperty* kinds, int num, const std::vector<dia:
        const char* vcs;
        char* vs;
        const std::vector<dia::IProperty*>* vv;
-       
+
        if (!from)
            /* nothing to do, alread initialized */;
        else if (from->get (&vi))
@@ -302,7 +302,7 @@ set_prop (GPtrArray* to, ::ArrayProperty* kinds, int num, const std::vector<dia:
     return true;
 }
 //! add a property of type int
-int 
+int
 dia::Properties::setitem (const char* s, int n)
 {
     g_return_val_if_fail (object != NULL, -1);
@@ -342,7 +342,7 @@ dia::Properties::setitem (const char* s, double n)
     return -1;
 }
 //! add a property of type string
-int 
+int
 dia::Properties::setitem (const char* s, const char* v)
 {
     g_return_val_if_fail (object != NULL, -1);
@@ -364,7 +364,7 @@ dia::Properties::setitem (const char* s, const char* v)
     return -1;
 }
 //! add a property of type double list
-int 
+int
 dia::Properties::setitem (const char* s, const std::vector<double>& v)
 {
     g_return_val_if_fail (object != NULL, -1);
@@ -372,8 +372,8 @@ dia::Properties::setitem (const char* s, const std::vector<double>& v)
     if (p) {
         bool apply = true;
         if (strcmp (p->descr->type, PROP_TYPE_COLOUR) == 0 && v.size() == 4) {
-            ((ColorProperty*)p)->color_data.red   = v[0]; 
-            ((ColorProperty*)p)->color_data.green = v[1]; 
+            ((ColorProperty*)p)->color_data.red   = v[0];
+            ((ColorProperty*)p)->color_data.green = v[1];
             ((ColorProperty*)p)->color_data.blue  = v[2];
             ((ColorProperty*)p)->color_data.alpha = v[3];
        }
@@ -426,7 +426,7 @@ dia::Properties::setitem (const char* s, const std::vector<double>& v)
            g_array_set_size(ptp->bezpointarray_data, i); // worst case
        }
        else
-            printf ("dia::Properties::setitem (%s, std::vector<double>) type or size (%d) mismatch (%s)\n", 
+            printf ("dia::Properties::setitem (%s, std::vector<double>) type or size (%d) mismatch (%s)\n",
                    s, static_cast<int>(v.size()), p->descr->type), apply = false;
        if (apply) {
            GPtrArray *plist = prop_list_from_single (p);
@@ -463,7 +463,7 @@ dia::Properties::setitem (const char* s, const std::vector<dia::IProperty*>& vec
         for (i = 0; i < vec.size(); ++i) {
            // we can only get lists here, every list gives a record and must match in size
            const std::vector<dia::IProperty*>* vv;
-            
+
            if (vec[i]->get (&vv)) {
                if (vv->size() != num_props)
                    g_warning ("dia::Properties::setitem() inner list of wrong size");
@@ -493,12 +493,12 @@ dia::Properties::setitem (const char* s, const std::vector<dia::IProperty*>& vec
  * \code
  *   w = o.elem_height
  * \endcode
- * OTOH this would remove the possibility to do reflection on 
- * the properties, e.g. asking them for type and name. Also it 
+ * OTOH this would remove the possibility to do reflection on
+ * the properties, e.g. asking them for type and name. Also it
  * may produce namespace clashes for more common property names
  * like 'name'.
  */
-dia::IProperty* 
+dia::IProperty*
 dia::Properties::getitem (const char* name) const
 {
     g_return_val_if_fail (object != NULL, 0);
@@ -513,7 +513,7 @@ std::vector<char*>
 dia::Properties::keys () const
 {
     g_return_val_if_fail (object != NULL, _keys);
-    
+
     if (!_keys.empty())
         return _keys;
     if (object->ops->describe_props) {
diff --git a/bindings/dia-properties.h b/bindings/dia-properties.h
index d9f32313..6260fcec 100644
--- a/bindings/dia-properties.h
+++ b/bindings/dia-properties.h
@@ -38,14 +38,14 @@ public :
     //! Now it starts to become ugly: isn't there a better way with SWIG to map one to many types?
     virtual bool get (::_Point* p) const { return false; }
     //! one more ;)
-    virtual bool get (::_Rectangle* p) const { return false; }
+    virtual bool get (::DiaRectangle* p) const { return false; }
     //! and this one ...
     virtual bool get (::_Color* p) const { return false; }
 
     //! we can also handle vector<IProperty*>
     virtual bool get (const std::vector<IProperty*>**) const { return false; }
-    
-    //! read-only attribute; the name of the property; at least unique within an object, but supposed to be 
unique global 
+
+    //! read-only attribute; the name of the property; at least unique within an object, but supposed to be 
unique global
     virtual const char* get_name () const = 0;
     //! read-only attribute giving the data type represented
     virtual const char* get_type () const = 0;
@@ -55,7 +55,7 @@ public :
 /*!
  * \brief To construct any Property type from its underlying type.
  *
- * This class is used to construct a more complex property and put it into a container of 
+ * This class is used to construct a more complex property and put it into a container of
  * properties without having access to the underlying ::Property type.
  */
 template <class T>
@@ -64,12 +64,12 @@ class Property : public IProperty
 public :
     //! construct from underlying data type
     Property<T> (T v) : self(v) {}
-    //! the on get function which returns true, 
+    //! the on get function which returns true,
     //! because the underlying type matches
     virtual bool get (T* p) const { *p = self; return true; }
-    
-    //! read-only attribute; the name of the property; at least unique within an object, 
-    //! but supposed to be unique globally 
+
+    //! read-only attribute; the name of the property; at least unique within an object,
+    //! but supposed to be unique globally
     const char* get_name () const { return "<name>"; }
     //! read-only attribute giving the data type represented
     const char* get_type () const { return "<type>"; }
@@ -79,36 +79,36 @@ private :
     T self;
 };
 
-template<> inline bool Property<int>::get (int* p) const 
-{ 
-  *p = self; return true; 
+template<> inline bool Property<int>::get (int* p) const
+{
+  *p = self; return true;
 }
-template<> inline bool Property<double>::get (double* p) const 
-{ 
-  *p = self; return true; 
+template<> inline bool Property<double>::get (double* p) const
+{
+  *p = self; return true;
 }
-template<> inline Property<const char*>::Property (const char* v) 
-{ 
-  self = v ? g_strdup (v) : g_strdup(""); 
+template<> inline Property<const char*>::Property (const char* v)
+{
+  self = v ? g_strdup (v) : g_strdup("");
 }
-template<> inline bool Property<const char*>::get (const char** p) const 
-{ 
-  *p = self; return true; 
+template<> inline bool Property<const char*>::get (const char** p) const
+{
+  *p = self; return true;
 }
-template<> inline Property<char*>::Property (char* v) 
-{ 
-  self = v ? g_strdup (v) : g_strdup(""); 
+template<> inline Property<char*>::Property (char* v)
+{
+  self = v ? g_strdup (v) : g_strdup("");
 }
-template<> inline bool Property<char*>::get (char** p) const 
-{ 
-  *p = self; return true; 
+template<> inline bool Property<char*>::get (char** p) const
+{
+  *p = self; return true;
 }
 
 /*!
  * \brief specialization for getter; a Property from underlying ::Property
  *
  * The Dia Property System can handle various kinds of properties from simple int
- * over Point and Rectangle up to whole Property lists and trees. This class is 
+ * over Point and Rectangle up to whole Property lists and trees. This class is
  * used to get or read a property from its underlying type.
  */
 template<>
@@ -129,14 +129,14 @@ public :
     //! just one wrapper too much ;)
     virtual bool get (::_Point* p) const;
     //! one more ;)
-    virtual bool get (::_Rectangle* p) const;
+    virtual bool get (::DiaRectangle* p) const;
     //! and this one ...
     virtual bool get (::_Color* p) const;
     //! we can also handle vector<IProperty*>
     virtual bool get (const std::vector<IProperty*>**) const;
 
 
-    //! read-only attribute; the name of the property; at least unique within an object, but supposed to be 
unique global 
+    //! read-only attribute; the name of the property; at least unique within an object, but supposed to be 
unique global
     const char* get_name () const;
     //! read-only attribute giving the data type represented
     const char* get_type () const;
@@ -150,7 +150,7 @@ private :
 /*!
  * \brief a list of properties; can contain list again so in fact it can be a tree
  *
- * Some Object Properties consist of Property lists or even property trees. This is the basic 
+ * Some Object Properties consist of Property lists or even property trees. This is the basic
  * building block for these complex properties. See 'UML - Class'::operations for an example.
  */
 template<>
@@ -168,12 +168,12 @@ public :
                delete *it;
     }
     //! get us self
-    virtual bool get (const std::vector<IProperty*>** p) const 
+    virtual bool get (const std::vector<IProperty*>** p) const
     {
         *p = this;
        return true;
     }
-    //! read-only attribute; the name of the property; at least unique within an object, but supposed to be 
unique global 
+    //! read-only attribute; the name of the property; at least unique within an object, but supposed to be 
unique global
     const char* get_name () const { return ""; }
     //! read-only attribute giving the data type represented
     const char* get_type () const { return "vector<IProperty*>"; }
@@ -199,7 +199,7 @@ public :
     /* accessors like Python dictionary */
     //! is there a property of this name
     bool has_key (const char*) const;
-    
+
     //! add a property of type int
     int setitem (const char*, int);
     //! add a property of type double
@@ -216,7 +216,7 @@ public :
     std::vector<char*> keys () const;
 private :
     ::DiaObject* object; //!< the owner of the properties
-    
+
     std::vector<char*> _keys; //!< lazy created
 };
 
diff --git a/bindings/dia-renderer.cpp b/bindings/dia-renderer.cpp
index aca9708e..29c6d42a 100644
--- a/bindings/dia-renderer.cpp
+++ b/bindings/dia-renderer.cpp
@@ -56,7 +56,7 @@ dia::Renderer::get_text_width (const gchar *text, int length) const
 }
 // called before any rendering takes palce
 void
-dia::Renderer::begin_render (const Rectangle *update)
+dia::Renderer::begin_render (const DiaRectangle *update)
 {
     assert (self);
     dia_renderer_begin_render (self, update);
diff --git a/bindings/dia-renderer.h b/bindings/dia-renderer.h
index bc770903..4deb6912 100644
--- a/bindings/dia-renderer.h
+++ b/bindings/dia-renderer.h
@@ -34,7 +34,7 @@ public :
     //!  return width in pixels, only for interactive renderers
     //! \ingroup InteractiveRenderer
     virtual int get_height_pixels () const;
-    
+
     /// \defgroup RendererRequired Functions to be implemented by every Renderer
     /// Not sure about this ;)
 
@@ -50,7 +50,7 @@ public :
 
     //! called before any rendering takes palce
     //! \ingroup RendererRequired
-    virtual void begin_render (const Rectangle *);
+    virtual void begin_render (const DiaRectangle *);
     //! finished rendering
     //! \ingroup RendererRequired
     virtual void end_render ();
@@ -99,7 +99,7 @@ public :
     //! Draw an image, given its bounding box
     //! \ingroup RendererRequired
     virtual void draw_image (Point *point, double width, double height, Image* image);
-    
+
     /// \defgroup RenderMedium Renderer Should Implemement This
     /// Functions which SHOULD be implemented by specific renderer, but
     /// have a default implementation based on the above functions
@@ -116,9 +116,9 @@ public :
     //! draw a Text.  It holds its own information like position, style, ...
     //! \ingroup RenderMedium
     virtual void draw_text (Text* text);
-    
+
     /// \defgroup RenderHigh Renderer Can Implement This
-    //! Highest level functions, probably only to be implemented by 
+    //! Highest level functions, probably only to be implemented by
     //! special 'high level' renderers which have a concept of arrows or rounded drawings
 
     //! a polyline with round coners
@@ -130,7 +130,7 @@ public :
                                    Color *fill, Color *stroke, real radius);
     //! specialized draw_line() for renderers with an own concept of Arrow
     //! \ingroup RenderHigh
-    virtual void draw_line_with_arrows  (Point *start, Point *end, real line_width, Color *line_color, 
+    virtual void draw_line_with_arrows  (Point *start, Point *end, real line_width, Color *line_color,
                                         Arrow *start_arrow, Arrow *end_arrow);
     //! specialized draw_line() for renderers with an own concept of Arrow
     //! \ingroup RenderHigh
@@ -148,9 +148,9 @@ public :
     //! \ingroup RenderHigh
     virtual void draw_bezier_with_arrows (BezPoint *points, int num_points, real line_width, Color *color,
                                          Arrow *start_arrow, Arrow *end_arrow);
-    
+
 private :
-    DiaRenderer* self;     
+    DiaRenderer* self;
 };
 
 } // namespace dia
diff --git a/lib/arrows.c b/lib/arrows.c
index 4aa324d2..621fabc6 100644
--- a/lib/arrows.c
+++ b/lib/arrows.c
@@ -2276,11 +2276,11 @@ struct ArrowDesc {
  * the arrow bounding box is added to the given rect
  */
 void
-arrow_bbox (const Arrow *self,
-            real         line_width,
-            const Point *to,
-            const Point *from,
-            Rectangle   *rect)
+arrow_bbox (const Arrow  *self,
+            real          line_width,
+            const Point  *to,
+            const Point  *from,
+            DiaRectangle *rect)
 {
   Point poly[6]; /* Attention: nust be the maximum used! */
   PolyBBExtras pextra;
@@ -2378,7 +2378,7 @@ arrow_draw (DiaRenderer *renderer,
   }
   if ((type != ARROW_NONE) && (render_bounding_boxes ()) && DIA_IS_INTERACTIVE_RENDERER (renderer)) {
     Arrow arrow = {type, length, width};
-    Rectangle bbox = {0, };
+    DiaRectangle bbox = {0, };
     Point p1, p2;
     Color col = { 1.0, 0.0, 1.0, 1.0 };
 
diff --git a/lib/arrows.h b/lib/arrows.h
index ffcbecb4..3419d56f 100644
--- a/lib/arrows.h
+++ b/lib/arrows.h
@@ -156,7 +156,7 @@ void          arrow_bbox              (const Arrow *self,
                                        real         line_width,
                                        const Point *to,
                                        const Point *from,
-                                       Rectangle   *rect);
+                                       DiaRectangle *rect);
 void          calculate_arrow_point   (const Arrow *arrow,
                                        const Point *to,
                                        const Point *from,
diff --git a/lib/autoroute.c b/lib/autoroute.c
index ef2fc153..c3e08266 100644
--- a/lib/autoroute.c
+++ b/lib/autoroute.c
@@ -41,12 +41,12 @@
 
 static real calculate_badness(Point *ps, guint num_points);
 
-static real autoroute_layout_parallel(Point *to, 
+static real autoroute_layout_parallel(Point *to,
                                        guint *num_points, Point **points);
 static real autoroute_layout_orthogonal(Point *to,
-                                         int enddir, 
+                                         int enddir,
                                          guint *num_points, Point **points);
-static real autoroute_layout_opposite(Point *to, 
+static real autoroute_layout_opposite(Point *to,
                                        guint *num_points, Point **points);
 static Point autolayout_adjust_for_gap(Point *pos, int dir, ConnectionPoint *cp);
 static void autolayout_adjust_for_arrow(Point *pos, int dir, real adjust);
@@ -59,14 +59,14 @@ static Point *autolayout_unnormalize_points(guint dir,
                                            guint num_points);
 
 static int
-autolayout_calc_intersects (const Rectangle *r1, const Rectangle *r2,
+autolayout_calc_intersects (const DiaRectangle *r1, const DiaRectangle *r2,
                            const Point *points, guint num_points)
 {
   guint i, n = 0;
 
   /* ignoring the first and last line assuming a proper 'outer' algorithm */
   for (i = 1; i < num_points - 2; ++i) {
-    Rectangle rt = { points[i].x, points[i].y, points[i+1].x, points[i+1].y };
+    DiaRectangle rt = { points[i].x, points[i].y, points[i+1].x, points[i+1].y };
     if (r1)
       n += (rectangle_intersects (r1, &rt) ? 1 : 0);
     if (r2)
@@ -95,7 +95,7 @@ autolayout_calc_intersects (const Rectangle *r1, const Rectangle *r2,
  * \callgraph
  */
 gboolean
-autoroute_layout_orthconn(OrthConn *conn, 
+autoroute_layout_orthconn(OrthConn *conn,
                          ConnectionPoint *startconn, ConnectionPoint *endconn)
 {
   real min_badness = MAX_BADNESS;
@@ -151,7 +151,7 @@ autoroute_layout_orthconn(OrthConn *conn,
                                                   &this_num_points,
                                                   &this_layout);
        } else if (normal_enddir == DIR_SOUTH) {
-         this_badness = autoroute_layout_opposite(&otherpoint, 
+         this_badness = autoroute_layout_opposite(&otherpoint,
                                                   &this_num_points,
                                                   &this_layout);
        } else {
@@ -181,9 +181,9 @@ autoroute_layout_orthconn(OrthConn *conn,
            best_layout = unnormalized;
            best_num_points = this_num_points;
             /* revert adjusting start and end point */
-           autolayout_adjust_for_arrow(&best_layout[0], startdir, 
+           autolayout_adjust_for_arrow(&best_layout[0], startdir,
                                        -conn->extra_spacing.start_trans);
-           autolayout_adjust_for_arrow(&best_layout[best_num_points-1], enddir, 
+           autolayout_adjust_for_arrow(&best_layout[best_num_points-1], enddir,
                                        -conn->extra_spacing.end_trans);
            best_intersects = intersects;
          } else {
@@ -191,9 +191,9 @@ autoroute_layout_orthconn(OrthConn *conn,
          }
        }
       }
-    }    
+    }
   }
-  
+
   if (min_badness < MAX_BADNESS) {
     orthconn_set_points(conn, best_num_points, best_layout);
     g_free(best_layout);
@@ -225,7 +225,7 @@ length_badness(real len)
 
 /*!
  * \brief Calculate badness of a point array
- * 
+ *
  * Returns the accumulated badness of a layout.  At the moment, this is
  * calculated as the sum of the badnesses of the segments plus a badness for
  * each bend in the line.
@@ -257,7 +257,7 @@ calculate_badness(Point *ps, guint num_points)
  * @param pos Point of the end of the line.
  * @param dir Which of the four cardinal directions the line goes from pos.
  * @param cp The connectionpoint the line is connected to.
- * @return Where the line should end to be on the correct edge of the 
+ * @return Where the line should end to be on the correct edge of the
  *          object, if cp has autogap on.
  *
  * \ingroup Autorouting
@@ -268,17 +268,17 @@ autolayout_adjust_for_gap(Point *pos, int dir, ConnectionPoint *cp)
   DiaObject *object;
   Point dir_other;
   /* Do absolute gaps here, once it's defined */
-  
+
   if (!cp || !connpoint_is_autogap(cp)) {
     return *pos;
   }
 
   object  = cp->object;
-  
+
   dir_other.x = pos->x;
   dir_other.y = pos->y;
   switch (dir) {
-  case DIR_NORTH: 
+  case DIR_NORTH:
     dir_other.y += 2 * (object->bounding_box.top - pos->y);
     break;
   case DIR_SOUTH:
@@ -290,7 +290,7 @@ autolayout_adjust_for_gap(Point *pos, int dir, ConnectionPoint *cp)
   case DIR_WEST:
     dir_other.x += 2 * (object->bounding_box.left - pos->x);
     break;
-  default: 
+  default:
     g_warning("Impossible direction %d\n", dir);
   }
   return calculate_object_edge(pos, &dir_other, object);
@@ -306,7 +306,7 @@ autolayout_adjust_for_gap(Point *pos, int dir, ConnectionPoint *cp)
  *
  * \ingroup Autorouting
  */
-static void 
+static void
 autolayout_adjust_for_arrow(Point *pos, int dir, real adjust)
 {
   switch (dir) {
@@ -327,7 +327,7 @@ autolayout_adjust_for_arrow(Point *pos, int dir, real adjust)
 
 /*!
  * \brief Parallel layout
- * 
+ *
  * Lay out autorouting where start and end lines are parallel pointing the
  * same direction.  This can either a simple up-right-down layout, or if the
  * to point is too close to origo, it will go up-right-down-left-down.
@@ -413,7 +413,7 @@ autoroute_layout_parallel(Point *to, guint *num_points, Point **points)
  * \ingroup Autorouting
  */
 static real
-autoroute_layout_orthogonal(Point *to, int enddir, 
+autoroute_layout_orthogonal(Point *to, int enddir,
                            guint *num_points, Point **points)
 {
   /* This one doesn't consider enddir yet, not more complex layouts. */
@@ -474,7 +474,7 @@ autoroute_layout_orthogonal(Point *to, int enddir,
   return calculate_badness(ps, *num_points);
 }
 
-/*! 
+/*!
  * \brief Opposite layout
  *
  * Do layout for the case where the end directions are opposite.
@@ -563,7 +563,7 @@ point_rotate_cw(Point *p)
   p->y = tmp;
 }
 
-/*! 
+/*!
  * \brief Rotate a point counterclockwise.
  * @param p The point to rotate.
  * \ingroup Autorouting
@@ -629,8 +629,8 @@ autolayout_normalize_points(guint startdir, guint enddir,
 
 /*!
  * \brief Reverse normalization
- * 
- * Reverses the normalizing process of autolayout_normalize_points by 
+ *
+ * Reverses the normalizing process of autolayout_normalize_points by
  * moving and rotating the points to start at `start' with the start direction
  * `startdir', instead of from origo going north.
  * Returns the new array of points, freeing the old one if necessary.
diff --git a/lib/boundingbox.c b/lib/boundingbox.c
index d10bd21a..4a437122 100644
--- a/lib/boundingbox.c
+++ b/lib/boundingbox.c
@@ -1,5 +1,5 @@
 /* Dia -- an diagram creation/manipulation program
- * Support for computing bounding boxes 
+ * Support for computing bounding boxes
  * Copyright (C) 2001 Cyrille Chepelov
  *
  * This program is free software; you can redistribute it and/or modify
@@ -30,10 +30,10 @@
 
 /** Translates x- or y- part of bezier points to Bernstein polynom coefficients
  * @param p x- or y-part of the four points
- * @param A 
- * @param B 
- * @param C 
- * @param D 
+ * @param A
+ * @param B
+ * @param C
+ * @param D
  * See: Foley et al., Computer Graphics, Bezier Curves or
  * http://en.wikipedia.org/wiki/B%C3%A9zier_curve
  */
@@ -72,7 +72,7 @@ bezier_eval_tangent(const real p[4], real u)
   real A,B,C,D;
   bernstein_develop(p,&A,&B,&C,&D);
   return 3*A*u*u+2*B*u+C;
-}  
+}
 
 /**
  * Calculates the extrma of the given curve in x- or y-direction.
@@ -112,9 +112,9 @@ bicubicbezier_extrema(const real p[4],real u[2])
  * @param extra_trans ???
  */
 static void
-add_arrow_rectangle(Rectangle *rect,
-                    const Point *vertex,
-                    const Point *normed_dir,
+add_arrow_rectangle(DiaRectangle *rect,
+                    const Point  *vertex,
+                    const Point  *normed_dir,
                     real extra_long,real extra_trans)
 {
   Point vl,vt,pt;
@@ -129,7 +129,7 @@ add_arrow_rectangle(Rectangle *rect,
   point_add_scaled(&pt,&vl,-2.0 * extra_long);
   rectangle_add_point(rect,&pt);
   point_add_scaled(&pt,&vt,2.0 * extra_trans);
-  rectangle_add_point(rect,&pt);  
+  rectangle_add_point(rect,&pt);
 }
 
 /** Calculate the boundingbox for a 2D bezier curve segment.
@@ -144,7 +144,7 @@ void
 bicubicbezier2D_bbox(const Point *p0,const Point *p1,
                      const Point *p2,const Point *p3,
                      const PolyBBExtras *extra,
-                     Rectangle *rect)
+                     DiaRectangle *rect)
 {
   real x[4],y[4];
   Point vl,vt,p,tt;
@@ -156,11 +156,11 @@ bicubicbezier2D_bbox(const Point *p0,const Point *p1,
   rect->top = rect->bottom = p0->y;
 
   rectangle_add_point(rect,p3);
-  /* start point */  
+  /* start point */
   point_copy_add_scaled(&vl,p0,p1,-1);
   if (point_len(&vl) == 0)
     point_copy_add_scaled(&vl,p0,p2,-1);
-  point_normalize(&vl); 
+  point_normalize(&vl);
   add_arrow_rectangle(rect,p0,&vl,extra->start_long,MAX(extra->start_trans,
                                                          extra->middle_trans));
 
@@ -168,11 +168,11 @@ bicubicbezier2D_bbox(const Point *p0,const Point *p1,
   point_copy_add_scaled(&vl,p3,p2,-1);
   if (point_len(&vl) == 0)
     point_copy_add_scaled(&vl,p3,p1,-1);
-  point_normalize(&vl); 
+  point_normalize(&vl);
   add_arrow_rectangle(rect,p3,&vl,extra->end_long,MAX(extra->end_trans,
                                                       extra->middle_trans));
 
-  /* middle part */  
+  /* middle part */
   x[0] = p0->x; x[1] = p1->x; x[2] = p2->x; x[3] = p3->x;
   y[0] = p0->y; y[1] = p1->y; y[2] = p2->y; y[3] = p3->y;
 
@@ -198,21 +198,21 @@ bicubicbezier2D_bbox(const Point *p0,const Point *p1,
 /** Calculate the bounding box for a simple line.
  * @param p1 One end of the line.
  * @param p2 The other end of the line.
- * @param extra Extra information 
+ * @param extra Extra information
  * @param rect The box that the line and extra stuff fits inside.
  */
 void
 line_bbox(const Point *p1, const Point *p2,
           const LineBBExtras *extra,
-          Rectangle *rect)
+          DiaRectangle *rect)
 {
   Point vl;
-  
+
   rect->left = rect->right = p1->x;
   rect->top = rect->bottom = p1->y;
 
   rectangle_add_point(rect,p2); /* as a safety, so we don't need to care if it above or below p1 */
-  
+
   point_copy_add_scaled(&vl,p1,p2,-1);
   point_normalize(&vl);
   add_arrow_rectangle(rect,p1,&vl,extra->start_long,extra->start_trans);
@@ -230,9 +230,9 @@ line_bbox(const Point *p1, const Point *p2,
 void
 ellipse_bbox(const Point *centre, real width, real height,
              const ElementBBExtras *extra,
-             Rectangle *rect)
+             DiaRectangle          *rect)
 {
-  Rectangle rin;
+  DiaRectangle rin;
   rin.left = centre->x - width/2;
   rin.right = centre->x + width/2;
   rin.top = centre->y - height/2;
@@ -241,7 +241,7 @@ ellipse_bbox(const Point *centre, real width, real height,
   rectangle_bbox(&rin,extra,rect);
 }
 
-/**  Allocate some scratch space to hold a big enough Bezier. 
+/**  Allocate some scratch space to hold a big enough Bezier.
  * That space is not guaranteed to be preserved upon the next allocation
  * (in fact it's guaranteed it's not).
  * @param numpoints How many points of bezier to allocate space for.
@@ -250,9 +250,9 @@ ellipse_bbox(const Point *centre, real width, real height,
 static BezPoint *
 alloc_polybezier_space(int numpoints)
 {
-  static int alloc_np = 0; 
+  static int alloc_np = 0;
   static BezPoint *alloced = NULL;
-  
+
   if (alloc_np < numpoints) {
     g_free(alloced);
     alloc_np = numpoints;
@@ -278,9 +278,9 @@ free_polybezier_space(BezPoint *points)
  * extra spacing.
  */
 void
-polyline_bbox(const Point *pts, int numpoints, 
+polyline_bbox(const Point *pts, int numpoints,
               const PolyBBExtras *extra, gboolean closed,
-              Rectangle *rect)
+              DiaRectangle       *rect)
 {
   /* It's much easier to re-use the Bezier code... */
   int i;
@@ -296,7 +296,7 @@ polyline_bbox(const Point *pts, int numpoints,
   /* This one will be used only when closed==TRUE... */
   bpts[numpoints].type = BEZ_LINE_TO;
   bpts[numpoints].p1 = pts[0];
-  
+
   polybezier_bbox(bpts,numpoints + (closed?1:0),extra,closed,rect);
   free_polybezier_space(bpts);
 }
@@ -308,14 +308,14 @@ polyline_bbox(const Point *pts, int numpoints,
  * @param closed True if the bezier points form a closed line.
  * @param rect Return value: The enclosing rectangle will be stored here.
  */
-void 
+void
 polybezier_bbox(const BezPoint *pts, int numpoints,
-                const PolyBBExtras *extra, gboolean closed,            
-                Rectangle *rect)
+                const PolyBBExtras *extra, gboolean closed,
+                DiaRectangle       *rect)
 {
   Point vx,vn,vsc,vp;
   int i,prev,next;
-  Rectangle rt;
+  DiaRectangle rt;
   PolyBBExtras bextra,start_bextra,end_bextra,full_bextra;
   LineBBExtras lextra,start_lextra,end_lextra,full_lextra;
   gboolean start,end;
@@ -328,8 +328,8 @@ polybezier_bbox(const BezPoint *pts, int numpoints,
   rect->left = rect->right = pts[0].p1.x;
   rect->top = rect->bottom = pts[0].p1.y;
 
-  /* First, we build derived BBExtras structures, so we have something to feed 
-     the primitives. */ 
+  /* First, we build derived BBExtras structures, so we have something to feed
+     the primitives. */
   if (!closed) {
     start_lextra.start_long = extra->start_long;
     start_lextra.start_trans = MAX(extra->start_trans,extra->middle_trans);
@@ -375,7 +375,7 @@ polybezier_bbox(const BezPoint *pts, int numpoints,
   bextra.start_trans = extra->middle_trans;
   bextra.middle_trans = extra->middle_trans;
   bextra.end_long = 0;
-  bextra.end_trans = extra->middle_trans;        
+  bextra.end_trans = extra->middle_trans;
 
 
   for (i=1;i<numpoints;i++) {
@@ -384,17 +384,17 @@ polybezier_bbox(const BezPoint *pts, int numpoints,
     if (closed && (next == 0)) next=1;
     if (closed && (prev == 0)) prev=numpoints-1;
 
-    /* We have now: 
-       i = index of current vertex. 
-       prev,next: index of previous/next vertices (of the control polygon) 
+    /* We have now:
+       i = index of current vertex.
+       prev,next: index of previous/next vertices (of the control polygon)
 
        We want:
         vp, vx, vn: the previous, current and next vertices;
         start, end: TRUE if we're at an end of poly (then, vp and/or vn are not
         valid, respectively).
 
-       Some values *will* be recomputed a few times across iterations (but stored in 
-       different boxes). Either gprof says it's a real problem, or gcc finally gets 
+       Some values *will* be recomputed a few times across iterations (but stored in
+       different boxes). Either gprof says it's a real problem, or gcc finally gets
        a clue.
     */
 
@@ -432,7 +432,7 @@ polybezier_bbox(const BezPoint *pts, int numpoints,
         point_copy(&vsc,&pts[prev].p3);
         break;
       } /* vsc is the start of the curve. */
-      
+
       break;
     }
     start = (pts[prev].type == BEZ_MOVE_TO);
@@ -440,8 +440,8 @@ polybezier_bbox(const BezPoint *pts, int numpoints,
     point_copy(&vn,&pts[next].p1); /* whichever type pts[next] is. */
 
     /* Now, we know about a few vertices around the one we're dealing with.
-       Depending on the shape of the (previous,current) segment, and whether 
-       it's a middle or end segment, we'll be doing different stuff. */ 
+       Depending on the shape of the (previous,current) segment, and whether
+       it's a middle or end segment, we'll be doing different stuff. */
     if (closed) {
       if (pts[i].type == BEZ_LINE_TO) {
         line_bbox(&vsc,&vx,&full_lextra,&rt);
@@ -450,7 +450,7 @@ polybezier_bbox(const BezPoint *pts, int numpoints,
                              &pts[i].p1,&pts[i].p2,&pts[i].p3,
                              &bextra,
                              &rt);
-      }    
+      }
     } else if (start) {
       if (pts[i].type == BEZ_LINE_TO) {
         if (end) {
@@ -458,7 +458,7 @@ polybezier_bbox(const BezPoint *pts, int numpoints,
         } else {
           line_bbox(&vsc,&vx,&start_lextra,&rt);
         }
-      } else { /* BEZ_MOVE_TO */ 
+      } else { /* BEZ_MOVE_TO */
         if (end) {
           bicubicbezier2D_bbox(&vsc,
                                &pts[i].p1,&pts[i].p2,&pts[i].p3,
@@ -479,7 +479,7 @@ polybezier_bbox(const BezPoint *pts, int numpoints,
                              &pts[i].p1,&pts[i].p2,&pts[i].p3,
                              &end_bextra,
                              &rt);
-      } 
+      }
     } else { /* normal case : middle segment (not closed shape). */
       if (pts[i].type == BEZ_LINE_TO) {
         line_bbox(&vsc,&vx,&lextra,&rt);
@@ -488,12 +488,12 @@ polybezier_bbox(const BezPoint *pts, int numpoints,
                              &pts[i].p1,&pts[i].p2,&pts[i].p3,
                              &bextra,
                              &rt);
-      } 
-    }   
+      }
+    }
     rectangle_union(rect,&rt);
 
-    /* The following code enlarges a little the bounding box (if necessary) to 
-       account with the "pointy corners" X (and PS) add when LINEJOIN_MITER mode is 
+    /* The following code enlarges a little the bounding box (if necessary) to
+       account with the "pointy corners" X (and PS) add when LINEJOIN_MITER mode is
        in force. */
 
     if (!end) { /* only the last segment might not produce overshoot. */
@@ -520,7 +520,7 @@ polybezier_bbox(const BezPoint *pts, int numpoints,
         point_copy_add_scaled(&vovs,&vpx,&vxn,-1);
         point_normalize(&vovs);
         point_copy_add_scaled(&pto,&vx,&vovs,overshoot);
-        
+
         rectangle_add_point(rect,&pto);
       } else {
         /* we don't have a pointy join. */
@@ -532,7 +532,7 @@ polybezier_bbox(const BezPoint *pts, int numpoints,
 
         point_get_perp(&vpxt,&vpx);
         point_get_perp(&vxnt,&vxn);
-        
+
         point_copy_add_scaled(&tmp,&vx,&vpxt,1);
         rectangle_add_point(rect,&tmp);
         point_copy_add_scaled(&tmp,&vx,&vpxt,-1);
@@ -552,10 +552,10 @@ polybezier_bbox(const BezPoint *pts, int numpoints,
  * @param extra Extra information required to find bbox.
  * @param rout Return value: The enclosing bounding box.
  */
-void 
-rectangle_bbox(const Rectangle *rin,
-              const ElementBBExtras *extra,
-              Rectangle *rout)
+void
+rectangle_bbox (const DiaRectangle    *rin,
+                const ElementBBExtras *extra,
+                DiaRectangle          *rout)
 {
   rout->left = rin->left - extra->border_trans;
   rout->top = rin->top - extra->border_trans;
diff --git a/lib/boundingbox.h b/lib/boundingbox.h
index 94d78c6d..984d522c 100644
--- a/lib/boundingbox.h
+++ b/lib/boundingbox.h
@@ -1,5 +1,5 @@
 /* Dia -- an diagram creation/manipulation program
- * Support for computing bounding boxes 
+ * Support for computing bounding boxes
  * Copyright (C) 2001 Cyrille Chepelov
  *
  * This program is free software; you can redistribute it and/or modify
@@ -59,7 +59,7 @@ struct _ElementBBExtras {
 void bicubicbezier2D_bbox(const Point *p0,const Point *p1,
                           const Point *p2,const Point *p3,
                           const PolyBBExtras *extra,
-                          Rectangle *rect);
+                          DiaRectangle       *rect);
 
 /*!
  * \brief Bounding box calculation for a straight line
@@ -68,16 +68,16 @@ void bicubicbezier2D_bbox(const Point *p0,const Point *p1,
  */
 void line_bbox(const Point *p1, const Point *p2,
                const LineBBExtras *extra,
-               Rectangle *rect);
+               DiaRectangle       *rect);
 
 /*!
  * \brief Bounding box calculation for a rectangle
  * The calcualtion includes line width with the right extra
  * \ingroup ObjectBBox
  */
-void rectangle_bbox(const Rectangle *rin,
+void rectangle_bbox(const DiaRectangle    *rin,
                     const ElementBBExtras *extra,
-                    Rectangle *rout);
+                    DiaRectangle          *rout);
 
 /*!
  * \brief Bounding box calculation for an ellipse
@@ -86,7 +86,7 @@ void rectangle_bbox(const Rectangle *rin,
  */
 void ellipse_bbox(const Point *centre, real width, real height,
                   const ElementBBExtras *extra,
-                  Rectangle *rect);
+                  DiaRectangle          *rect);
 /*!
  * \brief Bounding box calculation for a polyline
  * The calcualtion includes line width and arrwos with the right extra
@@ -94,7 +94,7 @@ void ellipse_bbox(const Point *centre, real width, real height,
  */
 void polyline_bbox(const Point *pts, int numpoints,
                    const PolyBBExtras *extra, gboolean closed,
-                   Rectangle *rect);
+                   DiaRectangle       *rect);
 /*!
  * \brief Bounding box calculation for a bezier
  * The calcualtion includes line width and arrwos with the right extra
@@ -102,7 +102,7 @@ void polyline_bbox(const Point *pts, int numpoints,
  */
 void polybezier_bbox(const BezPoint *pts, int numpoints,
                      const PolyBBExtras *extra, gboolean closed,
-                     Rectangle *rect);
+                     DiaRectangle       *rect);
 
 /* helpers for bezier curve calculation */
 void bernstein_develop(const real p[4],real *A,real *B,real *C,real *D);
diff --git a/lib/dia-layer.h b/lib/dia-layer.h
index f5bd8833..079689ba 100644
--- a/lib/dia-layer.h
+++ b/lib/dia-layer.h
@@ -41,7 +41,7 @@ DiaLayer    *dia_layer_new                                 (const char       *na
 DiaLayer    *dia_layer_new_from_layer                      (DiaLayer         *old);
 void         dia_layer_render                              (DiaLayer         *layer,
                                                             DiaRenderer      *renderer,
-                                                            Rectangle        *update,
+                                                            DiaRectangle     *update,
                                                             ObjectRenderer    obj_renderer /* Can be NULL */,
                                                             gpointer          data,
                                                             int               active_layer);
@@ -65,11 +65,11 @@ void         dia_layer_remove_object                       (DiaLayer         *la
 void         dia_layer_remove_objects                      (DiaLayer         *layer,
                                                             GList            *obj_list);
 GList       *dia_layer_find_objects_intersecting_rectangle (DiaLayer         *layer,
-                                                            Rectangle        *rect);
+                                                            DiaRectangle     *rect);
 GList       *dia_layer_find_objects_in_rectangle           (DiaLayer         *layer,
-                                                            Rectangle        *rect);
+                                                            DiaRectangle     *rect);
 GList       *dia_layer_find_objects_containing_rectangle   (DiaLayer         *layer,
-                                                            Rectangle        *rect);
+                                                            DiaRectangle     *rect);
 DiaObject   *dia_layer_find_closest_object                 (DiaLayer         *layer,
                                                             Point            *pos,
                                                             real              maxdist);
@@ -98,6 +98,6 @@ gboolean     dia_layer_is_visible                          (DiaLayer         *se
 void         dia_layer_set_visible                         (DiaLayer         *self,
                                                             gboolean          visible);
 void         dia_layer_get_extents                         (DiaLayer         *self,
-                                                            Rectangle        *rect);
+                                                            DiaRectangle     *rect);
 
 G_END_DECLS
diff --git a/lib/dia_xml.c b/lib/dia_xml.c
index 2425cb9c..bf7cd86b 100644
--- a/lib/dia_xml.c
+++ b/lib/dia_xml.c
@@ -71,7 +71,7 @@ static inline int isnan_f  (float       x) { return x != x; }
 static inline int isnan_d  (double      x) { return x != x; }
 static inline int isnan_ld (long double x) { return x != x; }
 #endif
-          
+
 #ifndef isinf
 # define isinf(x) \
     (sizeof (x) == sizeof (long double) ? isinf_ld (x) \
@@ -96,13 +96,13 @@ static inline int isinf_ld (long double x) { return isnan (x - x); }
 /*!
  * \brief Fallback implementation for not well-formed diagram files
  *
- * If all files produced by dia were good XML files, we wouldn't have to do 
- *  this little gymnastic. Alas, during the libxml1 days, we were outputting 
+ * If all files produced by dia were good XML files, we wouldn't have to do
+ *  this little gymnastic. Alas, during the libxml1 days, we were outputting
  *  files with no encoding specification (which means UTF-8 if we're in an
  *  asciish encoding) and strings encoded in local charset (so, we wrote
- *  broken files). 
+ *  broken files).
  *
- *  The following logic finds if we have a broken file, and attempts to fix 
+ *  The following logic finds if we have a broken file, and attempts to fix
  *  it if it's possible. If the file is correct or is unrecognisable, we pass
  *  it untouched to libxml2.
  * @param filename The name of the file to check.
@@ -125,7 +125,7 @@ xml_file_check_encoding(const gchar *filename, const gchar *default_enc, DiaCont
    * you are loading an incompatible version of zlib*.dll, e.g. one
    * built against a newer version of msvcrt*.dll
    */
-  gzFile zf = gzdopen(fd,"rb");  
+  gzFile zf = gzdopen(fd,"rb");
   gchar *buf;
   gchar *p,*pmax;
   int len;
@@ -134,7 +134,7 @@ xml_file_check_encoding(const gchar *filename, const gchar *default_enc, DiaCont
   gboolean well_formed_utf8;
   int write_ok;
 
-  static char magic_xml[] = 
+  static char magic_xml[] =
   {0x3c,0x3f,0x78,0x6d,0x6c,0x00}; /* "<?xml" in ASCII */
 
   if (!zf) {
@@ -142,7 +142,7 @@ xml_file_check_encoding(const gchar *filename, const gchar *default_enc, DiaCont
     /* XXX perhaps we can just chicken out to libxml ? -- CC */
     return filename;
   }
-  p = buf = g_malloc0(BUFLEN);  
+  p = buf = g_malloc0(BUFLEN);
   len = gzread(zf,buf,BUFLEN);
   pmax = p + len;
 
@@ -205,12 +205,12 @@ xml_file_check_encoding(const gchar *filename, const gchar *default_enc, DiaCont
   } else {
     gzclose(zf); /* poor man's fseek */
     fd = g_open (filename, O_RDONLY, 0);
-    zf = gzdopen(fd,"rb"); 
+    zf = gzdopen(fd,"rb");
     len = gzread(zf,buf,BUFLEN);
   }
 
   if (0 != strcmp(default_enc,"UTF-8")) {
-    dia_context_add_message (ctx, 
+    dia_context_add_message (ctx,
                              _("The file %s has no encoding specification;\n"
                             "assuming it is encoded in %s"),
                             dia_context_get_filename(ctx), default_enc);
@@ -220,7 +220,7 @@ xml_file_check_encoding(const gchar *filename, const gchar *default_enc, DiaCont
     return filename;
   }
 
-  tmp = getenv("TMP"); 
+  tmp = getenv("TMP");
   if (!tmp) tmp = getenv("TEMP");
   if (!tmp) tmp = "/tmp";
 
@@ -266,7 +266,7 @@ xmlDiaParseFile(const char *filename, DiaContext *ctx)
 
   if (   !g_get_charset(&local_charset)
       && local_charset) {
-    /* we're not in an UTF-8 environment. */ 
+    /* we're not in an UTF-8 environment. */
     const gchar *fname = xml_file_check_encoding(filename,local_charset, ctx);
     if (fname != filename) {
       /* We've got a corrected file to parse. */
@@ -288,7 +288,7 @@ xmlDiaParseFile(const char *filename, DiaContext *ctx)
 }
 
 /*!
- * \brief Parse an xml file from a filename given in Dia's/GLib's filename encoding 
+ * \brief Parse an xml file from a filename given in Dia's/GLib's filename encoding
  * @param filename A file to parse. On win32 the filename encoding is utf-8 since GLib 2.6
  * @param error Optional error return form underlying library.
  * @return An XML document.
@@ -307,7 +307,7 @@ xmlDoParseFile(const char *filename, xmlErrorPtr *error)
 }
 
 /*!
- * \brief Parse an xml file from a filename given in Dia's/GLib's filename encoding 
+ * \brief Parse an xml file from a filename given in Dia's/GLib's filename encoding
  *
  * @param filename A file to parse. On win32 the filename encoding is utf-8 since GLib 2.6
  * @param ctx If something goes wrong during parsing ctx will include according messages
@@ -316,12 +316,12 @@ xmlDoParseFile(const char *filename, xmlErrorPtr *error)
  *
  * \ingroup DiagramXmlIo
  */
-xmlDocPtr 
+xmlDocPtr
 diaXmlParseFile(const char *filename, DiaContext *ctx, gboolean try_harder)
 {
   xmlDocPtr doc;
   xmlErrorPtr err;
-  
+
   doc = xmlParseFile(filename);
   if (!doc) {
     err = xmlGetLastError ();
@@ -351,7 +351,7 @@ object_find_attribute(ObjectNode obj_node,
   AttributeNode attr;
   xmlChar *name;
 
-  while (obj_node && xmlIsBlankNode(obj_node)) 
+  while (obj_node && xmlIsBlankNode(obj_node))
     obj_node = obj_node->next;
   if (!obj_node) return NULL;
 
@@ -368,7 +368,7 @@ object_find_attribute(ObjectNode obj_node,
       return attr;
     }
     if (name) xmlFree(name);
-    
+
     attr = attr->next;
   }
   return NULL;
@@ -388,7 +388,7 @@ composite_find_attribute(DataNode composite_node,
   AttributeNode attr;
   xmlChar *name;
 
-  while (composite_node && xmlIsBlankNode(composite_node)) 
+  while (composite_node && xmlIsBlankNode(composite_node))
     composite_node = composite_node->next;
   if (!composite_node) return NULL;
 
@@ -405,7 +405,7 @@ composite_find_attribute(DataNode composite_node,
       return attr;
     }
     if (name) xmlFree(name);
-    
+
     attr = attr->next;
   }
   return NULL;
@@ -458,8 +458,8 @@ attribute_first_data(AttributeNode attribute)
 DataNode
 data_next(DataNode data)
 {
-  
-  if (data) { 
+
+  if (data) {
     data = data->next;
     while (data && xmlIsBlankNode(data)) data = data->next;
   }
@@ -526,7 +526,7 @@ data_int(DataNode data, DiaContext *ctx)
 {
   xmlChar *val;
   int res;
-  
+
   if (data_type(data, ctx)!=DATATYPE_INT) {
     dia_context_add_message (ctx, _("Taking int value of non-int node."));
     return 0;
@@ -535,7 +535,7 @@ data_int(DataNode data, DiaContext *ctx)
   val = xmlGetProp(data, (const xmlChar *)"val");
   res = atoi((char *) val);
   if (val) xmlFree(val);
-  
+
   return res;
 }
 
@@ -552,7 +552,7 @@ data_enum(DataNode data, DiaContext *ctx)
 {
   xmlChar *val;
   int res;
-  
+
   if (data_type(data, ctx)!=DATATYPE_ENUM) {
     dia_context_add_message (ctx, "Taking enum value of non-enum node.");
     return 0;
@@ -561,7 +561,7 @@ data_enum(DataNode data, DiaContext *ctx)
   val = xmlGetProp(data, (const xmlChar *)"val");
   res = atoi((char *) val);
   if (val) xmlFree(val);
-  
+
   return res;
 }
 
@@ -587,7 +587,7 @@ data_real(DataNode data, DiaContext *ctx)
   val = xmlGetProp(data, (const xmlChar *)"val");
   res = g_ascii_strtod((char *) val, NULL);
   if (val) xmlFree(val);
-  
+
   return res;
 }
 
@@ -604,7 +604,7 @@ data_boolean(DataNode data, DiaContext *ctx)
 {
   xmlChar *val;
   int res;
-  
+
   if (data_type(data, ctx)!=DATATYPE_BOOLEAN) {
     dia_context_add_message (ctx, "Taking boolean value of non-boolean node.");
     return 0;
@@ -614,7 +614,7 @@ data_boolean(DataNode data, DiaContext *ctx)
 
   if ((val) && (strcmp((char *) val, "true")==0))
     res =  TRUE;
-  else 
+  else
     res = FALSE;
 
   if (val) xmlFree(val);
@@ -657,7 +657,7 @@ data_color(DataNode data, Color *col, DiaContext *ctx)
 {
   xmlChar *val;
   int r=0, g=0, b=0, a=0;
-  
+
   if (data_type(data, ctx)!=DATATYPE_COLOR) {
     dia_context_add_message (ctx, "Taking color value of non-color node.");
     return;
@@ -680,7 +680,7 @@ data_color(DataNode data, Color *col, DiaContext *ctx)
   }
 
   if (val) xmlFree(val);
-  
+
   col->red = (float)(r/255.0);
   col->green = (float)(g/255.0);
   col->blue = (float)(b/255.0);
@@ -707,14 +707,14 @@ data_point(DataNode data, Point *point, DiaContext *ctx)
     dia_context_add_message (ctx, _("Taking point value of non-point node."));
     return;
   }
-  
+
   val = xmlGetProp(data, (const xmlChar *)"val");
   point->x = g_ascii_strtod((char *)val, &str);
   ax = fabs(point->x);
   if ((ax > 1e9) || ((ax < 1e-9) && (ax != 0.0)) || isnan(ax) || isinf(ax)) {
-    /* there is no provision to keep values larger when saving, 
+    /* there is no provision to keep values larger when saving,
      * so do this 'reduction' silent */
-    if (!(ax < 1e-9)) 
+    if (!(ax < 1e-9))
       g_warning(_("Incorrect x Point value \"%s\" %f; discarding it."),val,point->x);
     point->x = 0.0;
   }
@@ -744,7 +744,7 @@ data_point(DataNode data, Point *point, DiaContext *ctx)
  * @param ctx The context in which this function is called
  * \ingroup DiagramXmlIn
  */
-void 
+void
 data_bezpoint(DataNode data, BezPoint *point, DiaContext *ctx)
 {
   xmlChar *val;
@@ -817,20 +817,20 @@ data_bezpoint(DataNode data, BezPoint *point, DiaContext *ctx)
  * \ingroup DiagramXmlIn
  */
 void
-data_rectangle(DataNode data, Rectangle *rect, DiaContext *ctx)
+data_rectangle(DataNode data, DiaRectangle *rect, DiaContext *ctx)
 {
   xmlChar *val;
   gchar *str;
-  
+
   if (data_type(data, ctx)!=DATATYPE_RECTANGLE) {
     dia_context_add_message (ctx, _("Taking rectangle value of non-rectangle node."));
     return;
   }
-  
+
   val = xmlGetProp(data, (const xmlChar *)"val");
-  
+
   rect->left = g_ascii_strtod((char *)val, &str);
-  
+
   while ((*str != ',') && (*str!=0))
     str++;
 
@@ -839,7 +839,7 @@ data_rectangle(DataNode data, Rectangle *rect, DiaContext *ctx)
     xmlFree(val);
     return;
   }
-    
+
   rect->top = g_ascii_strtod(str+1, &str);
 
   while ((*str != ';') && (*str!=0))
@@ -863,7 +863,7 @@ data_rectangle(DataNode data, Rectangle *rect, DiaContext *ctx)
   }
 
   rect->bottom = g_ascii_strtod(str+1, NULL);
-  
+
   xmlFree(val);
 }
 
@@ -883,7 +883,7 @@ data_string(DataNode data, DiaContext *ctx)
   xmlChar *val;
   gchar *str, *p,*str2;
   int len;
-  
+
   if (data_type(data, ctx)!=DATATYPE_STRING) {
     dia_context_add_message (ctx, _("Taking string value of non-string node."));
     return NULL;
@@ -891,7 +891,7 @@ data_string(DataNode data, DiaContext *ctx)
 
   val = xmlGetProp(data, (const xmlChar *)"val");
   if (val != NULL) { /* Old kind of string. Left for backwards compatibility */
-    str  = g_malloc(4 * (sizeof(char)*(xmlStrlen(val)+1))); /* extra room 
+    str  = g_malloc(4 * (sizeof(char)*(xmlStrlen(val)+1))); /* extra room
                                                             for UTF8 */
     p = str;
     while (*val) {
@@ -927,12 +927,12 @@ data_string(DataNode data, DiaContext *ctx)
 
   if (data->xmlChildrenNode!=NULL) {
     p = (char *)xmlNodeListGetString(data->doc, data->xmlChildrenNode, TRUE);
-    
+
     if (*p!='#')
       dia_context_add_message (ctx, _("Error in file, string not starting with #"));
-    
+
     len = strlen(p)-1; /* Ignore first '#' */
-      
+
     str = g_malloc(len+1);
 
     strncpy(str, p+1, len);
@@ -942,7 +942,7 @@ data_string(DataNode data, DiaContext *ctx)
     xmlFree(p);
     return str;
   }
-    
+
   return NULL;
 }
 
@@ -989,7 +989,7 @@ data_font(DataNode data, DiaContext *ctx)
 {
   xmlChar *family;
   DiaFont *font;
-  
+
   if (data_type(data, ctx)!=DATATYPE_FONT) {
     dia_context_add_message (ctx, _("Taking font value of non-font node."));
     return NULL;
@@ -1066,7 +1066,7 @@ data_add_int(AttributeNode attr, int data, DiaContext *ctx)
   char buffer[20+1]; /* Enought for 64bit int + zero */
 
   g_snprintf(buffer, 20, "%d", data);
-  
+
   data_node = xmlNewChild(attr, NULL, (const xmlChar *)"int", NULL);
   xmlSetProp(data_node, (const xmlChar *)"val", (xmlChar *)buffer);
 }
@@ -1085,7 +1085,7 @@ data_add_enum(AttributeNode attr, int data, DiaContext *ctx)
   char buffer[20+1]; /* Enought for 64bit int + zero */
 
   g_snprintf(buffer, 20, "%d", data);
-  
+
   data_node = xmlNewChild(attr, NULL, (const xmlChar *)"enum", NULL);
   xmlSetProp(data_node, (const xmlChar *)"val", (xmlChar *)buffer);
 }
@@ -1104,7 +1104,7 @@ data_add_real(AttributeNode attr, real data, DiaContext *ctx)
   char buffer[G_ASCII_DTOSTR_BUF_SIZE]; /* Large enought */
 
   g_ascii_dtostr(buffer, G_ASCII_DTOSTR_BUF_SIZE, data);
-  
+
   data_node = xmlNewChild(attr, NULL, (const xmlChar *)"real", NULL);
   xmlSetProp(data_node, (const xmlChar *)"val", (xmlChar *)buffer);
 }
@@ -1184,11 +1184,11 @@ _str_point (const Point *point)
   gchar *buffer;
   gchar px_buf[G_ASCII_DTOSTR_BUF_SIZE];
   gchar py_buf[G_ASCII_DTOSTR_BUF_SIZE];
-  
+
   g_ascii_formatd(px_buf, sizeof(px_buf), "%g", point->x);
   g_ascii_formatd(py_buf, sizeof(py_buf), "%g", point->y);
   buffer = g_strconcat(px_buf, ",", py_buf, NULL);
-  
+
   return buffer;
 }
 
@@ -1204,7 +1204,7 @@ data_add_point(AttributeNode attr, const Point *point, DiaContext *ctx)
 {
   DataNode data_node;
   gchar *buffer = _str_point (point);
-  
+
   data_node = xmlNewChild(attr, NULL, (const xmlChar *)"point", NULL);
   xmlSetProp(data_node, (const xmlChar *)"val", (xmlChar *)buffer);
   g_free(buffer);
@@ -1219,7 +1219,7 @@ data_add_bezpoint(AttributeNode attr, const BezPoint *point, DiaContext *ctx)
 {
   DataNode data_node;
   gchar *buffer;
-  
+
   data_node = xmlNewChild(attr, NULL, (const xmlChar *)"bezpoint", NULL);
   switch (point->type) {
   case BEZ_MOVE_TO :
@@ -1234,7 +1234,7 @@ data_add_bezpoint(AttributeNode attr, const BezPoint *point, DiaContext *ctx)
   default :
     g_assert_not_reached();
   }
-  
+
   buffer = _str_point (&point->p1);
   xmlSetProp(data_node, (const xmlChar *)"p1", (xmlChar *)buffer);
   g_free (buffer);
@@ -1256,7 +1256,7 @@ data_add_bezpoint(AttributeNode attr, const BezPoint *point, DiaContext *ctx)
  * \ingroup DiagramXmlOut
  */
 void
-data_add_rectangle(AttributeNode attr, const Rectangle *rect, DiaContext *ctx)
+data_add_rectangle(AttributeNode attr, const DiaRectangle *rect, DiaContext *ctx)
 {
   DataNode data_node;
   gchar *buffer;
@@ -1271,7 +1271,7 @@ data_add_rectangle(AttributeNode attr, const Rectangle *rect, DiaContext *ctx)
   g_ascii_formatd(rb_buf, sizeof(rb_buf), "%g", rect->bottom);
 
   buffer = g_strconcat(rl_buf, ",", rt_buf, ";", rr_buf, ",", rb_buf, NULL);
-  
+
   data_node = xmlNewChild(attr, NULL, (const xmlChar *)"rectangle", NULL);
   xmlSetProp(data_node, (const xmlChar *)"val", (xmlChar *)buffer);
 
@@ -1294,16 +1294,16 @@ data_add_string(AttributeNode attr, const char *str, DiaContext *ctx)
     if (str==NULL) {
         (void)xmlNewChild(attr, NULL, (const xmlChar *)"string", (const xmlChar *)"##");
         return;
-    } 
+    }
 
     escaped_str = xmlEncodeEntitiesReentrant(attr->doc, (xmlChar *) str);
-    
+
     sharped_str = (xmlChar *) g_strconcat("#", (char *) escaped_str, "#", NULL);
 
     xmlFree(escaped_str);
-    
+
     (void)xmlNewChild(attr, NULL, (const xmlChar *)"string", (xmlChar *) sharped_str);
-  
+
     g_free(sharped_str);
 }
 
@@ -1341,7 +1341,7 @@ data_add_font(AttributeNode attr, const DiaFont *font, DiaContext *ctx)
   data_node = xmlNewChild(attr, NULL, (const xmlChar *)"font", NULL);
   xmlSetProp(data_node, (const xmlChar *)"family", (xmlChar *) dia_font_get_family(font));
   g_snprintf(buffer, 20, "%d", dia_font_get_style(font));
- 
+
   xmlSetProp(data_node, (const xmlChar *)"style", (xmlChar *) buffer);
   /* Legacy support: don't crash older Dia on missing 'name' attribute */
   xmlSetProp(data_node, (const xmlChar *)"name", (xmlChar *) dia_font_get_legacy_name(font));
@@ -1356,13 +1356,13 @@ data_add_font(AttributeNode attr, const DiaFont *font, DiaContext *ctx)
  * \ingroup DiagramXmlOut
  */
 DataNode
-data_add_composite(AttributeNode attr, const char *type, DiaContext *ctx) 
+data_add_composite(AttributeNode attr, const char *type, DiaContext *ctx)
 {
   /* type can be NULL */
   DataNode data_node;
- 
+
   data_node = xmlNewChild(attr, NULL, (const xmlChar *)"composite", NULL);
-  if (type != NULL) 
+  if (type != NULL)
     xmlSetProp(data_node, (const xmlChar *)"type", (xmlChar *)type);
 
   return data_node;
diff --git a/lib/dia_xml.h b/lib/dia_xml.h
index 0205336a..f6f9598b 100644
--- a/lib/dia_xml.h
+++ b/lib/dia_xml.h
@@ -78,7 +78,7 @@ int data_boolean(DataNode data, DiaContext *ctx);
 void data_color(DataNode data, Color *col, DiaContext *ctx);
 void data_point(DataNode data, Point *point, DiaContext *ctx);
 void data_bezpoint(DataNode data, BezPoint *point, DiaContext *ctx);
-void data_rectangle(DataNode data, Rectangle *rect, DiaContext *ctx);
+void data_rectangle(DataNode data, DiaRectangle *rect, DiaContext *ctx);
 char *data_string(DataNode data, DiaContext *ctx);
 char *data_filename(DataNode data, DiaContext *ctx);
 DiaFont *data_font(DataNode data, DiaContext *ctx);
@@ -93,11 +93,11 @@ void data_add_boolean(AttributeNode attr, int data, DiaContext *ctx);
 void data_add_color(AttributeNode attr, const Color *col, DiaContext *ctx);
 void data_add_point(AttributeNode attr, const Point *point, DiaContext *ctx);
 void data_add_bezpoint(AttributeNode attr, const BezPoint *point, DiaContext *ctx);
-void data_add_rectangle(AttributeNode attr, const Rectangle *rect, DiaContext *ctx);
+void data_add_rectangle(AttributeNode attr, const DiaRectangle *rect, DiaContext *ctx);
 void data_add_string(AttributeNode attr, const char *str, DiaContext *ctx);
 void data_add_filename(AttributeNode attr, const char *str, DiaContext *ctx);
 void data_add_font(AttributeNode attr, const DiaFont *font, DiaContext *ctx);
-DataNode data_add_composite(AttributeNode attr, 
+DataNode data_add_composite(AttributeNode attr,
                            const char *type, /* can be NULL */
                            DiaContext *ctx);
 
diff --git a/lib/diagramdata.c b/lib/diagramdata.c
index 1eac2520..5c02c059 100644
--- a/lib/diagramdata.c
+++ b/lib/diagramdata.c
@@ -34,7 +34,7 @@
 #include "diamarshal.h"
 
 
-static const Rectangle invalid_extents = { -1.0,-1.0,-1.0,-1.0 };
+static const DiaRectangle invalid_extents = { -1.0,-1.0,-1.0,-1.0 };
 
 static void diagram_data_class_init (DiagramDataClass *klass);
 static void diagram_data_init (DiagramData *object);
@@ -614,7 +614,7 @@ data_get_layers_extents_union (DiagramData *data)
 {
   guint i;
   gboolean first = TRUE;
-  Rectangle new_extents;
+  DiaRectangle new_extents;
 
   for ( i = 0; i < data->layers->len; i++) {
     DiaLayer *layer = g_ptr_array_index (data->layers, i);
@@ -629,7 +629,7 @@ data_get_layers_extents_union (DiagramData *data)
       dia_layer_get_extents (layer, &new_extents);
       first = rectangle_equals (&new_extents, &invalid_extents);
     } else {
-      Rectangle extents;
+      DiaRectangle extents;
 
       dia_layer_get_extents (layer, &extents);
 
@@ -672,7 +672,7 @@ data_adapt_scaling_to_extents(DiagramData *data)
 static gboolean
 data_compute_extents (DiagramData *data)
 {
-  Rectangle old_extents = data->extents;
+  DiaRectangle old_extents = data->extents;
 
   if (!data_has_visible_layers (data)) {
     if (data->layers->len > 0) {
@@ -826,7 +826,7 @@ data_emit (DiagramData *data,
 void
 data_render (DiagramData    *data,
              DiaRenderer    *renderer,
-             Rectangle      *update,
+             DiaRectangle   *update,
              ObjectRenderer  obj_renderer,
              gpointer        gdata)
 {
@@ -864,7 +864,7 @@ data_render (DiagramData    *data,
 void
 data_render_paginated (DiagramData *data, DiaRenderer *renderer, gpointer user_data)
 {
-  Rectangle *extents;
+  DiaRectangle *extents;
   gdouble width, height;
   gdouble x, y, initx, inity;
   gint xpos, ypos;
@@ -890,7 +890,7 @@ data_render_paginated (DiagramData *data, DiaRenderer *renderer, gpointer user_d
       break;
 
     for (x = initx, xpos = 0; x < extents->right; x += width, xpos++) {
-      Rectangle page_bounds;
+      DiaRectangle page_bounds;
 
       if ((extents->right - x) < 1e-6)
         break;
diff --git a/lib/diagramdata.h b/lib/diagramdata.h
index c9f0e479..ab35f054 100644
--- a/lib/diagramdata.h
+++ b/lib/diagramdata.h
@@ -64,7 +64,7 @@ GType diagram_data_get_type (void) G_GNUC_CONST;
 struct _DiagramData {
   GObject parent_instance; /*!< inheritance in C */
 
-  Rectangle extents;      /*!< The extents of the diagram        */
+  DiaRectangle extents;      /*!< The extents of the diagram        */
 
   Color bg_color;         /*!< The diagrams background color */
 
@@ -139,7 +139,7 @@ void data_foreach_object (DiagramData *data, GFunc func, gpointer user_data);
 typedef void (*ObjectRenderer)(DiaObject *obj, DiaRenderer *renderer,
                               int active_layer,
                               gpointer data);
-void data_render(DiagramData *data, DiaRenderer *renderer, Rectangle *update,
+void data_render(DiagramData *data, DiaRenderer *renderer, DiaRectangle *update,
                 ObjectRenderer obj_renderer /* Can be NULL */,
                 gpointer gdata);
 void data_render_paginated(DiagramData *data, DiaRenderer *renderer, gpointer user_data);
diff --git a/lib/diaimportrenderer.c b/lib/diaimportrenderer.c
index d57613ee..951f8d87 100644
--- a/lib/diaimportrenderer.c
+++ b/lib/diaimportrenderer.c
@@ -30,7 +30,7 @@
 #include "diatransformrenderer.h"
 #include "diapathrenderer.h"
 
-static void begin_render (DiaRenderer *, const Rectangle *update);
+static void begin_render (DiaRenderer *, const DiaRectangle *update);
 static void end_render (DiaRenderer *);
 
 static void set_linewidth (DiaRenderer *renderer, real linewidth);
@@ -212,7 +212,7 @@ dia_import_renderer_init (DiaImportRenderer *self)
 }
 
 static void
-begin_render (DiaRenderer *renderer, const Rectangle *update)
+begin_render (DiaRenderer *renderer, const DiaRectangle *update)
 {
   g_warning ("%s::begin_render not implemented!",
              G_OBJECT_CLASS_NAME (G_OBJECT_GET_CLASS (renderer)));
diff --git a/lib/diainteractiverenderer.c b/lib/diainteractiverenderer.c
index 9c661d42..13aa4f2d 100644
--- a/lib/diainteractiverenderer.c
+++ b/lib/diainteractiverenderer.c
@@ -170,13 +170,13 @@ dia_interactive_renderer_clip_region_clear (DiaInteractiveRenderer *self)
 /**
  * dia_interactive_renderer_clip_region_add_rect:
  * @self: the #DiaInteractiveRenderer
- * @rect: the #Rectangle to add
+ * @rect: the #DiaRectangle to add
  *
  * Since: 0.98
  */
 void
 dia_interactive_renderer_clip_region_add_rect (DiaInteractiveRenderer *self,
-                                               Rectangle              *rect)
+                                               DiaRectangle           *rect)
 {
   DiaInteractiveRendererInterface *irenderer =
     DIA_INTERACTIVE_RENDERER_GET_IFACE (self);
diff --git a/lib/diainteractiverenderer.h b/lib/diainteractiverenderer.h
index c5d8eae9..54035fc6 100644
--- a/lib/diainteractiverenderer.h
+++ b/lib/diainteractiverenderer.h
@@ -64,7 +64,7 @@ struct _DiaInteractiveRendererInterface
                                    int                     height);
   void (*clip_region_clear)       (DiaInteractiveRenderer *self);
   void (*clip_region_add_rect)    (DiaInteractiveRenderer *self,
-                                   Rectangle              *rect);
+                                   DiaRectangle           *rect);
   void (*draw_pixel_line)         (DiaInteractiveRenderer *self,
                                    int                     x1,
                                    int                     y1,
@@ -107,7 +107,7 @@ void dia_interactive_renderer_set_size                (DiaInteractiveRenderer *s
                                                        int                     height);
 void dia_interactive_renderer_clip_region_clear       (DiaInteractiveRenderer *self);
 void dia_interactive_renderer_clip_region_add_rect    (DiaInteractiveRenderer *self,
-                                                       Rectangle              *rect);
+                                                       DiaRectangle           *rect);
 void dia_interactive_renderer_draw_pixel_line         (DiaInteractiveRenderer *self,
                                                        int                     x1,
                                                        int                     y1,
diff --git a/lib/diapathrenderer.c b/lib/diapathrenderer.c
index 3cc9b936..a476939a 100644
--- a/lib/diapathrenderer.c
+++ b/lib/diapathrenderer.c
@@ -183,7 +183,7 @@ _remove_duplicated_path (DiaPathRenderer *self)
  * \memberof _DiaPathRenderer
  */
 static void
-begin_render (DiaRenderer *self, const Rectangle *update)
+begin_render (DiaRenderer *self, const DiaRectangle *update)
 {
 }
 /*!
@@ -612,7 +612,7 @@ draw_text (DiaRenderer *self,
   int n0 = path->len;
 
   if (!text_is_empty (text) && text_to_path (text, path)) {
-    Rectangle bz_bb, tx_bb;
+    DiaRectangle bz_bb, tx_bb;
     PolyBBExtras extra = { 0, };
     real dx, dy, sx, sy;
     guint i;
diff --git a/lib/diarenderer.c b/lib/diarenderer.c
index 144e7d9b..8d82aaab 100644
--- a/lib/diarenderer.c
+++ b/lib/diarenderer.c
@@ -73,7 +73,7 @@ struct _BezierApprox {
   int currpoint;
 };
 
-static void begin_render (DiaRenderer *, const Rectangle *update);
+static void begin_render (DiaRenderer *, const DiaRectangle *update);
 static void end_render (DiaRenderer *);
 
 static void set_linewidth (DiaRenderer *renderer, real linewidth);
@@ -250,10 +250,10 @@ dia_renderer_get_property (GObject    *object,
  * \memberof _DiaRenderer
  */
 static void
-draw_layer (DiaRenderer *renderer,
-            DiaLayer    *layer,
-            gboolean     active,
-            Rectangle   *update)
+draw_layer (DiaRenderer  *renderer,
+            DiaLayer     *layer,
+            gboolean      active,
+            DiaRectangle *update)
 {
   GList *list = dia_layer_get_object_list (layer);
   void (*func) (DiaRenderer*, DiaObject *, DiaMatrix *);
@@ -295,7 +295,7 @@ draw_object (DiaRenderer *renderer,
 #else
     /* visual complaints - not completely correct */
     Point pt[4];
-    Rectangle *bb = &object->bounding_box;
+    DiaRectangle *bb = &object->bounding_box;
     Color red = { 1.0, 0.0, 0.0, 1.0 };
 
     pt[0].x = matrix->xx * bb->left + matrix->xy * bb->top + matrix->x0;
@@ -431,7 +431,7 @@ dia_renderer_class_init (DiaRendererClass *klass)
  * \memberof _DiaRenderer \pure
  */
 static void
-begin_render (DiaRenderer *object, const Rectangle *update)
+begin_render (DiaRenderer *object, const DiaRectangle *update)
 {
   g_warning ("%s::begin_render not implemented!",
              G_OBJECT_CLASS_NAME (G_OBJECT_GET_CLASS (object)));
@@ -691,7 +691,7 @@ draw_rotated_text (DiaRenderer *renderer,
     GArray *path = g_array_new (FALSE, FALSE, sizeof (BezPoint));
     if (!text_is_empty (text) && text_to_path (text, path)) {
       /* Scaling and transformation here */
-      Rectangle bz_bb, tx_bb;
+      DiaRectangle bz_bb, tx_bb;
       PolyBBExtras extra = { 0, };
       real sx, sy;
       guint i;
@@ -751,7 +751,7 @@ draw_rotated_text (DiaRenderer *renderer,
       Point pt = center ? *center : text->position;
       DiaMatrix m = { 1, 0, 0, 1, pt.x, pt.y };
       DiaMatrix t = { 1, 0, 0, 1, -pt.x, -pt.y };
-      Rectangle tb;
+      DiaRectangle tb;
       Point poly[4];
       int i;
 
@@ -2118,7 +2118,7 @@ void
 dia_renderer_draw_layer (DiaRenderer      *self,
                          DiaLayer         *layer,
                          gboolean          active,
-                         Rectangle        *update)
+                         DiaRectangle     *update)
 {
   g_return_if_fail (DIA_IS_RENDERER (self));
 
@@ -2149,8 +2149,8 @@ dia_renderer_get_text_width (DiaRenderer      *self,
 
 
 void
-dia_renderer_begin_render (DiaRenderer      *self,
-                           const Rectangle  *update)
+dia_renderer_begin_render (DiaRenderer        *self,
+                           const DiaRectangle *update)
 {
   g_return_if_fail (DIA_IS_RENDERER (self));
 
diff --git a/lib/diarenderer.h b/lib/diarenderer.h
index ca383015..1db11d90 100644
--- a/lib/diarenderer.h
+++ b/lib/diarenderer.h
@@ -115,11 +115,11 @@ struct _DiaRendererClass
   void     (*draw_layer)                        (DiaRenderer      *renderer,
                                                  DiaLayer         *layer,
                                                  gboolean          active,
-                                                 Rectangle        *update);
+                                                 DiaRectangle     *update);
   void     (*draw_object)                       (DiaRenderer      *renderer,
                                                  DiaObject        *object,
                                                  DiaMatrix        *matrix);
-  real (*get_text_width)                        (DiaRenderer      *renderer,
+  real     (*get_text_width)                    (DiaRenderer      *renderer,
                                                  const gchar      *text,
                                                  int               length);
 
@@ -127,7 +127,7 @@ struct _DiaRendererClass
    * Function which MUST be implemented by any DiaRenderer
    */
   void     (*begin_render)                      (DiaRenderer      *renderer,
-                                                 const Rectangle  *update);
+                                                 const DiaRectangle *update);
   void     (*end_render)                        (DiaRenderer      *renderer);
 
   void     (*set_linewidth)                     (DiaRenderer      *renderer,
@@ -283,7 +283,7 @@ struct _DiaRendererClass
 void     dia_renderer_draw_layer                        (DiaRenderer      *self,
                                                          DiaLayer         *layer,
                                                          gboolean          active,
-                                                         Rectangle        *update);
+                                                         DiaRectangle     *update);
 void     dia_renderer_draw_object                       (DiaRenderer      *self,
                                                          DiaObject        *object,
                                                          DiaMatrix        *matrix);
@@ -291,7 +291,7 @@ real     dia_renderer_get_text_width                    (DiaRenderer      *self,
                                                          const gchar      *text,
                                                          int               length);
 void     dia_renderer_begin_render                      (DiaRenderer      *self,
-                                                         const Rectangle  *update);
+                                                         const DiaRectangle *update);
 void     dia_renderer_end_render                        (DiaRenderer      *self);
 void     dia_renderer_set_linewidth                     (DiaRenderer      *self,
                                                          real              linewidth);
diff --git a/lib/diasvgrenderer.c b/lib/diasvgrenderer.c
index 516ea5e9..a94cf25a 100644
--- a/lib/diasvgrenderer.c
+++ b/lib/diasvgrenderer.c
@@ -62,7 +62,7 @@ draw_text_line(DiaRenderer *self, TextLine *text_line,
  * \memberof _DiaSvgRenderer
  */
 static void
-begin_render(DiaRenderer *self, const Rectangle *update)
+begin_render(DiaRenderer *self, const DiaRectangle *update)
 {
   DiaSvgRenderer *renderer = DIA_SVG_RENDERER (self);
 
diff --git a/lib/diatransform.c b/lib/diatransform.c
index b5c8b5ee..35982290 100644
--- a/lib/diatransform.c
+++ b/lib/diatransform.c
@@ -28,7 +28,7 @@ struct _DiaTransform
 {
   GObject parent_instance;
   /*< private >*/
-  Rectangle *visible; /* pointer to original rectangle for transform_coords */
+  DiaRectangle *visible; /* pointer to original rectangle for transform_coords */
   real      *factor;  /* pointer to original factor for transform_length */
 };
 
@@ -65,7 +65,7 @@ dia_transform_get_type (void)
                                             "DiaTransform",
                                             &object_info, 0);
     }
-  
+
   return object_type;
 }
 
@@ -89,7 +89,7 @@ dia_transform_class_init (DiaTransformClass *klass)
 }
 
 DiaTransform *
-dia_transform_new (Rectangle *rect, real* zoom)
+dia_transform_new (DiaRectangle *rect, real* zoom)
 {
   DiaTransform *t = g_object_new (DIA_TYPE_TRANSFORM, NULL);
   t->visible = rect;
@@ -98,7 +98,7 @@ dia_transform_new (Rectangle *rect, real* zoom)
   return t;
 }
 
-real 
+real
 dia_transform_length (DiaTransform *t, real len)
 {
   g_return_val_if_fail (DIA_IS_TRANSFORM (t), len);
@@ -117,9 +117,9 @@ dia_untransform_length(DiaTransform *t, real len)
   return len / *(t->factor);
 }
 
-void 
-dia_transform_coords (DiaTransform *t, 
-                      coord x, coord y, 
+void
+dia_transform_coords (DiaTransform *t,
+                      coord x, coord y,
                       int *xi, int *yi)
 {
   g_return_if_fail (DIA_IS_TRANSFORM (t));
@@ -129,9 +129,9 @@ dia_transform_coords (DiaTransform *t,
   *yi = ROUND ( (y - t->visible->top) * *(t->factor));
 }
 
-void 
-dia_transform_coords_double (DiaTransform *t, 
-                             coord x, coord y, 
+void
+dia_transform_coords_double (DiaTransform *t,
+                             coord x, coord y,
                              double *xd, double *yd)
 {
   g_return_if_fail (DIA_IS_TRANSFORM (t));
diff --git a/lib/diatransform.h b/lib/diatransform.h
index 4002180c..e6c9f77d 100644
--- a/lib/diatransform.h
+++ b/lib/diatransform.h
@@ -15,7 +15,7 @@ G_BEGIN_DECLS
 
 GType dia_transform_get_type (void) G_GNUC_CONST;
 
-DiaTransform *dia_transform_new (Rectangle *rect, real* zoom);
+DiaTransform *dia_transform_new (DiaRectangle *rect, real* zoom);
 real dia_transform_length (DiaTransform *transform, real len);
 void dia_transform_coords (DiaTransform *transform, coord x, coord y, int *xi, int *yi);
 void dia_transform_coords_double (DiaTransform *transform, coord x, coord y, double *xd, double *yd);
diff --git a/lib/diatransformrenderer.c b/lib/diatransformrenderer.c
index c337999b..65e99b2b 100644
--- a/lib/diatransformrenderer.c
+++ b/lib/diatransformrenderer.c
@@ -97,7 +97,7 @@ dia_path_renderer_finalize (GObject *object)
  * \memberof _DiaTransformRenderer
  */
 static void
-begin_render (DiaRenderer *self, const Rectangle *update)
+begin_render (DiaRenderer *self, const DiaRectangle *update)
 {
 }
 /*!
diff --git a/lib/diatypes.h b/lib/diatypes.h
index 187c79c2..cb01de22 100644
--- a/lib/diatypes.h
+++ b/lib/diatypes.h
@@ -102,7 +102,7 @@ typedef struct _DiaFontClass DiaFontClass;
 
 /* In geometry.h: */
 typedef struct _Point Point;
-typedef struct _Rectangle Rectangle;
+typedef struct _DiaRectangle DiaRectangle;
 typedef struct _IntRectangle IntRectangle;
 typedef struct _BezPoint BezPoint;
 typedef struct _DiaMatrix DiaMatrix;
diff --git a/lib/element.c b/lib/element.c
index 8099e550..057dcbb9 100644
--- a/lib/element.c
+++ b/lib/element.c
@@ -42,8 +42,8 @@ PropNumData width_range = { -G_MAXFLOAT, G_MAXFLOAT, 0.1};
  * @param An object to update bounding box on.
  */
 void
-element_update_boundingbox(Element *elem) {
-  Rectangle bb;
+element_update_boundingbox (Element *elem) {
+  DiaRectangle bb;
   Point *corner;
   ElementBBExtras *extra = &elem->extra_spacing;
 
@@ -54,7 +54,7 @@ element_update_boundingbox(Element *elem) {
   bb.right = corner->x + elem->width;
   bb.top = corner->y;
   bb.bottom = corner->y + elem->height;
-  
+
   rectangle_bbox(&bb,extra,&elem->object.bounding_box);
 }
 
@@ -90,7 +90,7 @@ element_update_connections_rectangle(Element *elem,
   g_assert(elem->object.num_connections >= 9);
   cps[8].pos.x = elem->corner.x + elem->width / 2.0;
   cps[8].pos.y = elem->corner.y + elem->height / 2.0;
-  
+
   cps[0].directions = DIR_NORTH|DIR_WEST;
   cps[1].directions = DIR_NORTH;
   cps[2].directions = DIR_NORTH|DIR_EAST;
@@ -138,7 +138,7 @@ void
 element_update_handles(Element *elem)
 {
   Point *corner = &elem->corner;
-  
+
   elem->resize_handles[0].id = HANDLE_RESIZE_NW;
   elem->resize_handles[0].pos.x = corner->x;
   elem->resize_handles[0].pos.y = corner->y;
@@ -190,12 +190,12 @@ element_move_handle(Element *elem, HandleId id,
 {
   Point p;
   Point *corner;
-  
+
   assert(id>=HANDLE_RESIZE_NW);
   assert(id<=HANDLE_RESIZE_SE);
 
   corner = &elem->corner;
-  
+
   p = *to;
   point_sub(&p, &elem->corner);
 
@@ -217,7 +217,7 @@ element_move_handle(Element *elem, HandleId id,
     }
     break;
   case HANDLE_RESIZE_NE:
-    if (p.x>0.0) 
+    if (p.x>0.0)
       elem->width = p.x;
     if ( to->y < (corner->y+elem->height)) {
       corner->y += p.y;
@@ -231,7 +231,7 @@ element_move_handle(Element *elem, HandleId id,
     }
     break;
   case HANDLE_RESIZE_E:
-    if (p.x>0.0) 
+    if (p.x>0.0)
       elem->width = p.x;
     break;
   case HANDLE_RESIZE_SW:
@@ -247,7 +247,7 @@ element_move_handle(Element *elem, HandleId id,
       elem->height = p.y;
     break;
   case HANDLE_RESIZE_SE:
-    if (p.x>0.0) 
+    if (p.x>0.0)
       elem->width = p.x;
     if (p.y>0.0)
       elem->height = p.y;
@@ -275,22 +275,22 @@ element_move_handle_aspect(Element *elem, HandleId id,
   real new_width, new_height;
   real move_x=0;
   real move_y=0;
-  
+
   assert(id>=HANDLE_RESIZE_NW);
   assert(id<=HANDLE_RESIZE_SE);
 
   corner = &elem->corner;
-  
+
   p = *to;
   point_sub(&p, &elem->corner);
-  
+
   width = elem->width;
   height = elem->height;
 
   new_width = 0.0;
   new_height = 0.0;
-  
-  
+
+
   switch(id) {
   case HANDLE_RESIZE_NW:
     new_width = width - p.x;
@@ -351,10 +351,10 @@ element_move_handle_aspect(Element *elem, HandleId id,
     new_width = 0.0;
     new_height = 0.0;
   }
-  
+
   corner->x -= (new_width - width)*move_x;
   corner->y -= (new_height - height)*move_y;
-  
+
   elem->width  = new_width;
   elem->height = new_height;
 }
@@ -404,11 +404,11 @@ element_copy(Element *from, Element *to)
   toobj = &to->object;
 
   object_copy(fromobj, toobj);
-  
+
   to->corner = from->corner;
   to->width = from->width;
   to->height = from->height;
-  
+
   for (i=0;i<8;i++) {
     to->resize_handles[i] = from->resize_handles[i];
     to->resize_handles[i].connected_to = NULL;
@@ -432,7 +432,7 @@ element_destroy(Element *elem)
  * @param elem
  * @param obj_node
  */
-void 
+void
 element_save(Element *elem, ObjectNode obj_node, DiaContext *ctx)
 {
   object_save(&elem->object, obj_node, ctx);
@@ -445,7 +445,7 @@ element_save(Element *elem, ObjectNode obj_node, DiaContext *ctx)
                 elem->height, ctx);
 }
 
-void 
+void
 element_load(Element *elem, ObjectNode obj_node, DiaContext *ctx)
 {
   AttributeNode attr;
@@ -494,7 +494,7 @@ _element_change_swap (ObjectChange *self,
   tmp = ec->height; ec->height = elem->height; elem->height = tmp;
 }
 ObjectChange *
-element_change_new (const Point *corner, 
+element_change_new (const Point *corner,
                    real width,
                    real height,
                    Element *elem)
diff --git a/lib/font-height.c b/lib/font-height.c
index 5237bbc4..177864ad 100644
--- a/lib/font-height.c
+++ b/lib/font-height.c
@@ -24,10 +24,8 @@
 #include <gdk/gdk.h>
 #ifdef GDK_WINDOWING_WIN32
 /* avoid namespace clashes caused by inclusion of windows.h */
-#define Rectangle Win32Rectangle
 #define WIN32_LEAN_AND_MEAN
 #include <pango/pangowin32.h>
-#undef Rectangle
 #endif
 
 #include "font.h"
diff --git a/lib/font.c b/lib/font.c
index ff93048c..faaabc08 100644
--- a/lib/font.c
+++ b/lib/font.c
@@ -31,10 +31,8 @@
 #include <gtk/gtk.h> /* just for gtk_get_default_language() */
 #ifdef GDK_WINDOWING_WIN32
 /* avoid namespace clashes caused by inclusion of windows.h */
-#define Rectangle Win32Rectangle
 #define WIN32_LEAN_AND_MEAN
 #include <pango/pangowin32.h>
-#undef Rectangle
 #endif
 #include "font.h"
 #include "message.h"
diff --git a/lib/geometry.c b/lib/geometry.c
index 6501c5ed..901217d9 100644
--- a/lib/geometry.c
+++ b/lib/geometry.c
@@ -30,7 +30,7 @@
 #include "units.h"
 
 void
-rectangle_union(Rectangle *r1, const Rectangle *r2)
+rectangle_union (DiaRectangle *r1, const DiaRectangle *r2)
 {
   r1->top = MIN( r1->top, r2->top );
   r1->bottom = MAX( r1->bottom, r2->bottom );
@@ -39,7 +39,7 @@ rectangle_union(Rectangle *r1, const Rectangle *r2)
 }
 
 void
-int_rectangle_union(IntRectangle *r1, const IntRectangle *r2)
+int_rectangle_union (IntRectangle *r1, const IntRectangle *r2)
 {
   r1->top = MIN( r1->top, r2->top );
   r1->bottom = MAX( r1->bottom, r2->bottom );
@@ -48,7 +48,7 @@ int_rectangle_union(IntRectangle *r1, const IntRectangle *r2)
 }
 
 void
-rectangle_intersection(Rectangle *r1, const Rectangle *r2)
+rectangle_intersection (DiaRectangle *r1, const DiaRectangle *r2)
 {
   r1->top = MAX( r1->top, r2->top );
   r1->bottom = MIN( r1->bottom, r2->bottom );
@@ -63,7 +63,7 @@ rectangle_intersection(Rectangle *r1, const Rectangle *r2)
 }
 
 int
-rectangle_intersects(const Rectangle *r1, const Rectangle *r2)
+rectangle_intersects (const DiaRectangle *r1, const DiaRectangle *r2)
 {
   if ( (r1->right < r2->left) ||
        (r1->left > r2->right) ||
@@ -75,7 +75,7 @@ rectangle_intersects(const Rectangle *r1, const Rectangle *r2)
 }
 
 int
-point_in_rectangle(const Rectangle* r, const Point *p)
+point_in_rectangle (const DiaRectangle* r, const Point *p)
 {
   if ( (p->x < r->left) ||
        (p->x > r->right) ||
@@ -87,7 +87,7 @@ point_in_rectangle(const Rectangle* r, const Point *p)
 }
 
 int
-rectangle_in_rectangle(const Rectangle* outer, const Rectangle *inner)
+rectangle_in_rectangle (const DiaRectangle* outer, const DiaRectangle *inner)
 {
   if ( (inner->left < outer->left) ||
        (inner->right > outer->right) ||
@@ -99,7 +99,7 @@ rectangle_in_rectangle(const Rectangle* outer, const Rectangle *inner)
 }
 
 void
-rectangle_add_point(Rectangle *r, const Point *p)
+rectangle_add_point (DiaRectangle *r, const Point *p)
 {
   if (p->x < r->left)
     r->left = p->x;
@@ -120,7 +120,7 @@ rectangle_add_point(Rectangle *r, const Point *p)
  * on the rectangle is returned.
  */
 real
-distance_rectangle_point(const Rectangle *rect, const Point *point)
+distance_rectangle_point (const DiaRectangle *rect, const Point *point)
 {
   real dx = 0.0;
   real dy = 0.0;
diff --git a/lib/geometry.h b/lib/geometry.h
index 1a669e60..8601db90 100644
--- a/lib/geometry.h
+++ b/lib/geometry.h
@@ -84,8 +84,16 @@ struct _Point {
   coord y; /*!< vertical */
 };
 
-/*! \brief A rectangle given by upper left and lower right corner */
-struct _Rectangle {
+/**
+ * DiaRectangle:
+ * @left: top left x co-ord
+ * @top: top left y co-ord
+ * @right: bottom right x co-ord
+ * @button bottom right y co-ord
+ *
+ * A rectangle given by upper left and lower right corner
+ */
+struct _DiaRectangle {
   coord left; /*!< x1 */
   coord top; /*!< y1 */
   coord right; /*!< x2 */
@@ -257,16 +265,16 @@ point_copy_add_scaled(Point *dst, const Point *src,
 
 void point_convex(Point *dst, const Point *src1, const Point *src2, real alpha);
 
-void rectangle_union(Rectangle *r1, const Rectangle *r2);
+void rectangle_union(DiaRectangle *r1, const DiaRectangle *r2);
 void int_rectangle_union(IntRectangle *r1, const IntRectangle *r2);
-void rectangle_intersection(Rectangle *r1, const Rectangle *r2);
-int rectangle_intersects(const Rectangle *r1, const Rectangle *r2);
-int point_in_rectangle(const Rectangle* r, const Point *p);
-int rectangle_in_rectangle(const Rectangle* outer, const Rectangle *inner);
-void rectangle_add_point(Rectangle *r, const Point *p);
+void rectangle_intersection(DiaRectangle *r1, const DiaRectangle *r2);
+int rectangle_intersects(const DiaRectangle *r1, const DiaRectangle *r2);
+int point_in_rectangle(const DiaRectangle* r, const Point *p);
+int rectangle_in_rectangle(const DiaRectangle* outer, const DiaRectangle *inner);
+void rectangle_add_point(DiaRectangle *r, const Point *p);
 
 static inline gboolean
-rectangle_equals(const Rectangle *r1, const Rectangle *r2)
+rectangle_equals (const DiaRectangle *r1, const DiaRectangle *r2)
 {
   return ( (r2->left == r1->left) &&
            (r2->right == r1->right) &&
@@ -290,7 +298,7 @@ distance_point_point_manhattan(const Point *p1, const Point *p2)
   return ABS(dx) + ABS(dy);
 }
 
-real distance_rectangle_point(const Rectangle *rect, const Point *point);
+real distance_rectangle_point(const DiaRectangle *rect, const Point *point);
 real distance_line_point(const Point *line_start, const Point *line_end,
                         real line_width, const Point *point);
 
diff --git a/lib/group.c b/lib/group.c
index 42517f94..9da27927 100644
--- a/lib/group.c
+++ b/lib/group.c
@@ -135,7 +135,7 @@ group_select(Group *group)
 static void
 group_update_handles(Group *group)
 {
-  Rectangle *bb = &group->object.bounding_box;
+  DiaRectangle *bb = &group->object.bounding_box;
 
   group->handles[0].id = HANDLE_RESIZE_NW;
   group->handles[0].pos.x = bb->left;
@@ -217,7 +217,7 @@ group_move_handle(Group *group, Handle *handle, Point *to, ConnectionPoint *cp,
                  HandleMoveReason reason, ModifierKeys modifiers)
 {
   DiaObject *obj = &group->object;
-  Rectangle *bb = &obj->bounding_box;
+  DiaRectangle *bb = &obj->bounding_box;
   /* top and left handles are also changing the objects position */
   Point top_left = { bb->left, bb->top };
   /* before and after width and height */
@@ -472,8 +472,8 @@ group_update_data(Group *group)
 
     if (group->matrix) {
       Point p;
-      Rectangle box;
-      Rectangle *bb = &group->object.bounding_box;
+      DiaRectangle box;
+      DiaRectangle *bb = &group->object.bounding_box;
       DiaMatrix *m = group->matrix;
 
       /* maintain obj->position */
diff --git a/lib/layer.c b/lib/layer.c
index 34a72dde..c5777cae 100644
--- a/lib/layer.c
+++ b/lib/layer.c
@@ -25,12 +25,12 @@
 #include "dynamic_obj.h"
 #include "dia-layer.h"
 
-static const Rectangle invalid_extents = { -1.0,-1.0,-1.0,-1.0 };
+static const DiaRectangle invalid_extents = { -1.0,-1.0,-1.0,-1.0 };
 
 typedef struct _DiaLayerPrivate DiaLayerPrivate;
 struct _DiaLayerPrivate {
   char *name;                  /* The name of the layer */
-  Rectangle extents;           /* The extents of the layer */
+  DiaRectangle extents;           /* The extents of the layer */
 
   GList *objects;              /* List of objects in the layer,
                                   sorted by decreasing z-value,
@@ -277,7 +277,7 @@ render_bounding_boxes (void)
 void
 dia_layer_render (DiaLayer       *layer,
                   DiaRenderer    *renderer,
-                  Rectangle      *update,
+                  DiaRectangle   *update,
                   ObjectRenderer  obj_renderer,
                   gpointer        data,
                   int             active_layer)
@@ -617,8 +617,8 @@ dia_layer_remove_objects (DiaLayer *layer, GList *obj_list)
  * Since: 0.98
  */
 GList *
-dia_layer_find_objects_intersecting_rectangle (DiaLayer  *layer,
-                                               Rectangle *rect)
+dia_layer_find_objects_intersecting_rectangle (DiaLayer     *layer,
+                                               DiaRectangle *rect)
 {
   GList *list;
   GList *selected_list;
@@ -658,7 +658,7 @@ dia_layer_find_objects_intersecting_rectangle (DiaLayer  *layer,
  * Since: 0.98
  */
 GList *
-dia_layer_find_objects_in_rectangle (DiaLayer *layer, Rectangle *rect)
+dia_layer_find_objects_in_rectangle (DiaLayer *layer, DiaRectangle *rect)
 {
   GList *list;
   GList *selected_list;
@@ -695,7 +695,7 @@ dia_layer_find_objects_in_rectangle (DiaLayer *layer, Rectangle *rect)
  * Since: 0.98
  */
 GList *
-dia_layer_find_objects_containing_rectangle (DiaLayer *layer, Rectangle *rect)
+dia_layer_find_objects_containing_rectangle (DiaLayer *layer, DiaRectangle *rect)
 {
   GList *list;
   GList *selected_list;
@@ -858,7 +858,7 @@ dia_layer_update_extents (DiaLayer *layer)
 {
   GList *l;
   DiaObject *obj;
-  Rectangle new_extents;
+  DiaRectangle new_extents;
   DiaLayerPrivate *priv = dia_layer_get_instance_private (layer);
 
   l = priv->objects;
@@ -868,7 +868,7 @@ dia_layer_update_extents (DiaLayer *layer)
     l = g_list_next (l);
 
     while (l!=NULL) {
-      const Rectangle *bbox;
+      const DiaRectangle *bbox;
       obj = (DiaObject *) l->data;
       /* don't consider empty (or broken) objects in the overall extents */
       bbox = &obj->bounding_box;
@@ -1130,8 +1130,8 @@ dia_layer_set_visible (DiaLayer *self,
  * Since: 0.98
  */
 void
-dia_layer_get_extents (DiaLayer  *self,
-                       Rectangle *rect)
+dia_layer_get_extents (DiaLayer     *self,
+                       DiaRectangle *rect)
 {
   DiaLayerPrivate *priv;
 
diff --git a/lib/object.c b/lib/object.c
index 823fb936..3ae92954 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -292,10 +292,9 @@ object_list_move_delta_r (GList *objects, Point *delta, gboolean affected)
     pos = obj->position;
     point_add(&pos, delta);
 
-    if (obj->parent && affected)
-    {
-      Rectangle p_ext;
-      Rectangle c_ext;
+    if (obj->parent && affected) {
+      DiaRectangle p_ext;
+      DiaRectangle c_ext;
       Point new_delta;
 
       parent_handle_extents(obj->parent, &p_ext);
@@ -1096,25 +1095,33 @@ DiaObject *object_copy_using_properties(DiaObject *obj)
   return newobj;
 }
 
-/** Return a box that all 'real' parts of the object is bounded by.
+/**
+ * dia_object_get_bounding_box:
+ * @obj: The object to get the bounding box for.
+ *
+ * Return a box that all 'real' parts of the object is bounded by.
  *  In most cases, this is the same as the enclosing box, but things like
  *  bezier controls would lie outside of this.
- * @param obj The object to get the bounding box for.
- * @return A pointer to a Rectangle object.  This object should *not*
+ *
+ * Returns: A pointer to a #DiaRectangle object.  This object should *not*
  *  be freed after use, as it belongs to the object.
  */
-const Rectangle *
-dia_object_get_bounding_box(const DiaObject *obj) {
+const DiaRectangle *
+dia_object_get_bounding_box (const DiaObject *obj) {
   return &obj->bounding_box;
 }
 
-/** Return a box that encloses all interactively rendered parts of the object.
- * @param obj The object to get the enclosing box for.
- * @return A pointer to a Rectangle object.  This object should *not*
+/**
+ * dia_object_get_enclosing_box:
+ * @obj: The object to get the enclosing box for.
+ *
+ * Return a box that encloses all interactively rendered parts of the object.
+ *
+ * Returns: A pointer to a #DiaRectangle object.  This object should *not*
  *  be freed after use, as it belongs to the object.
  */
-const Rectangle *
-dia_object_get_enclosing_box(const DiaObject *obj)
+const DiaRectangle *
+dia_object_get_enclosing_box (const DiaObject *obj)
 {
   if (!obj->enclosing_box)
     return &obj->bounding_box;
diff --git a/lib/object.h b/lib/object.h
index 803ab362..506f9648 100644
--- a/lib/object.h
+++ b/lib/object.h
@@ -328,7 +328,7 @@ struct _DiaObject {
   DiaObjectType    *type; /*!< pointer to the registered type */
   Point             position; /*!<  often but not necessarily the upper left corner of the object */
   /*!
-   * \brief Rectangle containing the whole object
+   * \brief DiaRectangle containing the whole object
    *
    * The area that contains all parts of the 'real' object, i.e. the parts
    *  that would be printed, exported to pixmaps etc.  This is also used to
@@ -339,7 +339,7 @@ struct _DiaObject {
    *
    * \protected Use dia_object_get_bounding_box()
    */
-  Rectangle         bounding_box;
+  DiaRectangle      bounding_box;
   /*! Number of Handle(s) of this object */
   int               num_handles;
   /*! Array of handles of this object with fixed index */
@@ -368,7 +368,7 @@ struct _DiaObject {
    *  Since handles and CPs are not in the BB, that will be the case for most
    *  objects.
    */
-  Rectangle        *enclosing_box;
+  DiaRectangle     *enclosing_box;
   /*! Metainfo of the object, should not be manipulated directly. Use dia_object_set_meta() */
   GHashTable       *meta;
 };
@@ -484,8 +484,8 @@ DiaObject  *dia_object_default_create (const DiaObjectType *type,
 gboolean         dia_object_defaults_save (const gchar *filename, DiaContext *ctx);
 DiaLayer        *dia_object_get_parent_layer(DiaObject *obj);
 gboolean         dia_object_is_selected (const DiaObject *obj);
-const Rectangle *dia_object_get_bounding_box(const DiaObject *obj);
-const Rectangle *dia_object_get_enclosing_box(const DiaObject *obj);
+const DiaRectangle *dia_object_get_bounding_box(const DiaObject *obj);
+const DiaRectangle *dia_object_get_enclosing_box(const DiaObject *obj);
 DiaObject       *dia_object_get_parent_with_flags(DiaObject *obj, guint flags);
 gboolean         dia_object_is_selectable(DiaObject *obj);
 /* The below is for debugging purposes only. */
diff --git a/lib/parent.c b/lib/parent.c
index d6802a26..daa4f0ae 100644
--- a/lib/parent.c
+++ b/lib/parent.c
@@ -135,10 +135,10 @@ GList *parent_list_affected(GList *obj_list)
   going any further
 
   returns TRUE if resizing was obstructed*/
-gboolean 
+gboolean
 parent_handle_move_out_check(DiaObject *object, Point *to)
 {
-  Rectangle p_ext, c_ext;
+  DiaRectangle p_ext, c_ext;
   Point new_delta;
 
   if (!object->parent)
@@ -165,7 +165,7 @@ gboolean parent_handle_move_in_check(DiaObject *object, Point *to, Point *start_
 {
   GList *list = object->children;
   gboolean once = TRUE;
-  Rectangle common_ext;
+  DiaRectangle common_ext;
   gboolean restricted = FALSE;
 
   if (!object_flags_set(object, DIA_OBJECT_CAN_PARENT) || !list)
@@ -177,7 +177,7 @@ gboolean parent_handle_move_in_check(DiaObject *object, Point *to, Point *start_
       parent_handle_extents(list->data, &common_ext);
       once = FALSE;
     } else {
-      Rectangle c_ext;
+      DiaRectangle c_ext;
       parent_handle_extents (list->data, &c_ext);
       rectangle_union(&common_ext, &c_ext);
     }
@@ -212,7 +212,7 @@ gboolean parent_handle_move_in_check(DiaObject *object, Point *to, Point *start_
       If delta is not present, these are the extents *before* any moves
       If delta is present, delta is considered into the extents's position
       */
-Point parent_move_child_delta(Rectangle *p_ext, Rectangle *c_ext, Point *delta)
+Point parent_move_child_delta (DiaRectangle *p_ext, DiaRectangle *c_ext, Point *delta)
 {
     Point new_delta = {0, 0};
     gboolean free_delta = FALSE;
@@ -242,7 +242,7 @@ Point parent_move_child_delta(Rectangle *p_ext, Rectangle *c_ext, Point *delta)
 
 /* the caller must free the returned rectangle */
 void
-parent_point_extents(Point *point, Rectangle *extents)
+parent_point_extents(Point *point, DiaRectangle *extents)
 {
   extents->left = point->x;
   extents->right = point->x;
@@ -251,12 +251,14 @@ parent_point_extents(Point *point, Rectangle *extents)
 }
 
 /**
+ * parent_handle_extents:
+ *
  * the caller must provide the 'returned' rectangle,
  * which is initialized to the biggest rectangle containing
  * all the objects handles
  */
 void
-parent_handle_extents(DiaObject *obj, Rectangle *extents)
+parent_handle_extents (DiaObject *obj, DiaRectangle *extents)
 {
   int idx;
 
@@ -271,7 +273,7 @@ parent_handle_extents(DiaObject *obj, Rectangle *extents)
   }
 }
 
-/** Apply a function to all children of the given object (recursively, 
+/** Apply a function to all children of the given object (recursively,
  * depth-first).
  * @param obj A parent object.
  * @param function A function that takes a single DiaObject as an argument.
diff --git a/lib/parent.h b/lib/parent.h
index 80ba6a01..b4a3f465 100644
--- a/lib/parent.h
+++ b/lib/parent.h
@@ -24,9 +24,9 @@
 #include "geometry.h"
 
 GList *parent_list_affected(GList *obj_list);
-void parent_handle_extents(DiaObject *obj, Rectangle *extents);
-Point parent_move_child_delta(Rectangle *p_ext, Rectangle *c_text, Point *delta);
-void parent_point_extents(Point *point, Rectangle *extents);
+void parent_handle_extents (DiaObject *obj, DiaRectangle *extents);
+Point parent_move_child_delta (DiaRectangle *p_ext, DiaRectangle *c_text, Point *delta);
+void parent_point_extents (Point *point, DiaRectangle *extents);
 gboolean parent_list_expand(GList *obj_list);
 GList *parent_list_affected_hierarchy(GList *obj_list);
 gboolean parent_handle_move_out_check(DiaObject *object, Point *to);
diff --git a/lib/path-math.c b/lib/path-math.c
index b16736a9..9473cbfd 100644
--- a/lib/path-math.c
+++ b/lib/path-math.c
@@ -30,7 +30,7 @@
  * \brief Take a path and calculate it to non overlapping pieces
  */
 
-typedef struct _BezierSegment BezierSegment; 
+typedef struct _BezierSegment BezierSegment;
 struct _BezierSegment {
   Point p0;
   Point p1;
@@ -39,7 +39,7 @@ struct _BezierSegment {
 };
 
 /*!
- * \brief Split a bezier segment into left and right half 
+ * \brief Split a bezier segment into left and right half
  */
 static void
 bezier_split (const BezierSegment *a,
@@ -173,14 +173,14 @@ static const real EPSILON = 0.0001;
  * is no intersection left.
  */
 static gboolean
-bezier_bezier_intersection (GArray *crossing,
-                           const BezierSegment *a,
-                           const BezierSegment *b,
-                           int depth,
-                           real asplit,
-                           real bsplit)
+bezier_bezier_intersection (GArray              *crossing,
+                            const BezierSegment *a,
+                            const BezierSegment *b,
+                            int                  depth,
+                            real                 asplit,
+                            real                 bsplit)
 {
-  Rectangle abox, bbox;
+  DiaRectangle abox, bbox;
   PolyBBExtras extra = { 0, };
   gboolean small_a, small_b;
 
@@ -696,7 +696,7 @@ _make_path (GArray *one, /*!< array<BezierSegment> from first path */
 
   bp.type = BEZ_MOVE_TO;
   /* start with the first point of segment one */
-  for (i = 0; i < one_splits->len; ++i) { 
+  for (i = 0; i < one_splits->len; ++i) {
     sp = &g_array_index (one_splits, Split, i);
     if (sp->outside == outside)
       break;
@@ -717,7 +717,7 @@ _make_path (GArray *one, /*!< array<BezierSegment> from first path */
        *  The other part might be in _append_segments or even _split_segments
        */
       outside = mode == PATH_INTERSECTION ? FALSE : TRUE;
-      for (i = 0; i < one_splits->len; ++i) { 
+      for (i = 0; i < one_splits->len; ++i) {
        sp = &g_array_index (one_splits, Split, i);
        if (!sp->used && (sp->outside == outside))
          break;
diff --git a/lib/plug-ins.c b/lib/plug-ins.c
index 4efd07c9..7fd554a7 100644
--- a/lib/plug-ins.c
+++ b/lib/plug-ins.c
@@ -45,10 +45,8 @@
 #include "dia_dirs.h"
 
 #ifdef G_OS_WIN32
-#define Rectangle Win32Rectangle
 #define WIN32_LEAN_AND_MEAN
 #include <pango/pangowin32.h>
-#undef Rectangle
 #endif
 
 struct _PluginInfo {
diff --git a/lib/prop_geomtypes.c b/lib/prop_geomtypes.c
index 9a517c68..746aeeb7 100644
--- a/lib/prop_geomtypes.c
+++ b/lib/prop_geomtypes.c
@@ -743,14 +743,14 @@ static void
 rectprop_get_from_offset(RectProperty *prop,
                          void *base, guint offset, guint offset2)
 {
-  prop->rect_data = struct_member(base,offset,Rectangle);
+  prop->rect_data = struct_member (base, offset, DiaRectangle);
 }
 
 static void
 rectprop_set_from_offset(RectProperty *prop,
                          void *base, guint offset, guint offset2)
 {
-  struct_member(base,offset,Rectangle) = prop->rect_data;
+  struct_member (base, offset, DiaRectangle) = prop->rect_data;
 }
 
 static const PropertyOps rectprop_ops = {
diff --git a/lib/prop_geomtypes.h b/lib/prop_geomtypes.h
index 7376474d..8b0a36d8 100644
--- a/lib/prop_geomtypes.h
+++ b/lib/prop_geomtypes.h
@@ -91,13 +91,16 @@ typedef struct {
   GArray *bezpointarray_data;
 } BezPointarrayProperty;
 
-/*!
- * \brief Property for _Rectangle
- * \extends _Property
+/**
+ * RectProperty:
+ * @common: Base #Property
+ * @rect_data: the #DiaRectangle
+ *
+ * Property for #DiaRectangle
  */
 typedef struct {
   Property common;
-  Rectangle rect_data;
+  DiaRectangle rect_data;
 } RectProperty;
 
 /*!
diff --git a/lib/renderer/diacairo-interactive.c b/lib/renderer/diacairo-interactive.c
index f1278395..0efd294f 100644
--- a/lib/renderer/diacairo-interactive.c
+++ b/lib/renderer/diacairo-interactive.c
@@ -36,7 +36,7 @@ struct _DiaCairoInteractiveRenderer {
   DiaCairoRenderer parent_instance;
 
   /*< private >*/
-  Rectangle *visible;
+  DiaRectangle *visible;
   real *zoom_factor;
 
   cairo_surface_t *surface;       /* The surface shown in this display  */
@@ -177,8 +177,8 @@ _gdk_cairo_region (cairo_t              *cr,
 }
 
 static void
-dia_cairo_interactive_renderer_begin_render (DiaRenderer     *self,
-                                             const Rectangle *update)
+dia_cairo_interactive_renderer_begin_render (DiaRenderer        *self,
+                                             const DiaRectangle *update)
 {
   DiaCairoInteractiveRenderer *renderer = DIA_CAIRO_INTERACTIVE_RENDERER (self);
   DiaCairoRenderer *base_renderer = DIA_CAIRO_RENDERER (self);
@@ -376,7 +376,7 @@ dia_cairo_interactive_renderer_clip_region_clear (DiaInteractiveRenderer *object
 
 static void
 dia_cairo_interactive_renderer_clip_region_add_rect (DiaInteractiveRenderer *object,
-                                                     Rectangle              *rect)
+                                                     DiaRectangle           *rect)
 {
   DiaCairoInteractiveRenderer *renderer = DIA_CAIRO_INTERACTIVE_RENDERER (object);
   cairo_rectangle_int_t clip_rect;
diff --git a/lib/renderer/diacairo-print.c b/lib/renderer/diacairo-print.c
index 23a0437b..73402797 100644
--- a/lib/renderer/diacairo-print.c
+++ b/lib/renderer/diacairo-print.c
@@ -93,11 +93,11 @@ begin_print (GtkPrintOperation *operation,
 
 static void
 draw_page (GtkPrintOperation *operation,
-          GtkPrintContext *context,
-          int page_nr,
-          PrintData *print_data)
+           GtkPrintContext   *context,
+           int                page_nr,
+           PrintData         *print_data)
 {
-  Rectangle bounds;
+  DiaRectangle bounds;
   DiagramData *data = print_data->data;
   int x, y;
   /* the effective sizes - dia already applied is_portrait */
@@ -169,7 +169,7 @@ draw_page (GtkPrintOperation *operation,
   }
 
   {
-    Rectangle extents = data->extents;
+    DiaRectangle extents = data->extents;
 
     data->extents = bounds;
     /* render only the region, FIXME: better way than modifying DiagramData ?  */
diff --git a/lib/renderer/diacairo-renderer.c b/lib/renderer/diacairo-renderer.c
index 37e49ce3..edefdf31 100644
--- a/lib/renderer/diacairo-renderer.c
+++ b/lib/renderer/diacairo-renderer.c
@@ -72,7 +72,7 @@ static void ensure_minimum_one_device_unit (DiaCairoRenderer *renderer,
  * render functions
  */
 static void
-dia_cairo_renderer_begin_render (DiaRenderer *self, const Rectangle *update)
+dia_cairo_renderer_begin_render (DiaRenderer *self, const DiaRectangle *update)
 {
   DiaCairoRenderer *renderer = DIA_CAIRO_RENDERER (self);
   real onedu = 0.0;
@@ -266,7 +266,7 @@ _add_color_stop (real ofs, const Color *col, gpointer user_data)
 }
 
 static cairo_pattern_t *
-_pattern_build_for_cairo (DiaPattern *pattern, const Rectangle *ext)
+_pattern_build_for_cairo (DiaPattern *pattern, const DiaRectangle *ext)
 {
   cairo_pattern_t *pat;
   DiaPatternType type;
@@ -329,7 +329,7 @@ _dia_cairo_fill (DiaCairoRenderer *renderer, gboolean preserve)
   } else {
     /* maybe we should cache the cairo-pattern */
     cairo_pattern_t *pat;
-    Rectangle fe;
+    DiaRectangle fe;
 
     /* Using the extents to scale the pattern is probably not correct */
     cairo_fill_extents (renderer->cr,
diff --git a/lib/renderer/diacairo.c b/lib/renderer/diacairo.c
index 1f2d3db1..c3093c83 100644
--- a/lib/renderer/diacairo.c
+++ b/lib/renderer/diacairo.c
@@ -42,7 +42,6 @@
 #ifdef CAIRO_HAS_WIN32_SURFACE
 #include <cairo-win32.h>
 /* avoid namespace collisions */
-#define Rectangle RectangleWin32
 #endif
 #ifdef CAIRO_HAS_SCRIPT_SURFACE
 #include <cairo-script.h>
diff --git a/lib/standard-path.c b/lib/standard-path.c
index 5a9f77ca..44f759aa 100644
--- a/lib/standard-path.c
+++ b/lib/standard-path.c
@@ -322,7 +322,7 @@ stdpath_update_handles(StdPath *stdpath)
 {
   DiaObject *obj = &stdpath->object;
   PolyBBExtras extra = { 0, };
-  Rectangle rect, *bb;
+  DiaRectangle rect, *bb;
 
   g_return_if_fail (obj->handles != NULL);
 
@@ -362,7 +362,7 @@ static void
 stdpath_update_data (StdPath *stdpath)
 {
   DiaObject *obj = &stdpath->object;
-  Rectangle *bb = &obj->bounding_box;
+  DiaRectangle *bb = &obj->bounding_box;
   PolyBBExtras extra = { 0 };
   real lw = stdpath->stroke_or_fill & PDO_STROKE ? stdpath->line_width : 0.0;
 
@@ -1156,8 +1156,8 @@ create_standard_path_from_text (const Text *text)
 
   if (obj) {
     StdPath *path = (StdPath *)obj;
-    Rectangle text_box;
-    const Rectangle *pbb = &path->object.bounding_box;
+    DiaRectangle text_box;
+    const DiaRectangle *pbb = &path->object.bounding_box;
     real sx, sy;
     Point pos;
 
diff --git a/lib/text.c b/lib/text.c
index 6f75d3c3..105f4622 100644
--- a/lib/text.c
+++ b/lib/text.c
@@ -440,7 +440,7 @@ text_set_alignment(Text *text, Alignment align)
 }
 
 void
-text_calc_boundingbox(Text *text, Rectangle *box)
+text_calc_boundingbox(Text *text, DiaRectangle *box)
 {
   calc_width(text);
   calc_ascent_descent(text);
diff --git a/lib/text.h b/lib/text.h
index 9eb71037..6f9f3df8 100644
--- a/lib/text.h
+++ b/lib/text.h
@@ -84,7 +84,7 @@ void text_set_position(Text *text, Point *pos);
 void text_set_color(Text *text, Color *col);
 void text_set_alignment(Text *text, Alignment align);
 real text_distance_from(Text *text, Point *point);
-void text_calc_boundingbox(Text *text, Rectangle *box);
+void text_calc_boundingbox(Text *text, DiaRectangle *box);
 void text_draw(Text *text, DiaRenderer *renderer);
 void text_set_cursor(Text *text, Point *clicked_point,
                     DiaRenderer *interactive_renderer);
diff --git a/objects/AADL/aadl.h b/objects/AADL/aadl.h
index 124dd798..f9d58fe2 100644
--- a/objects/AADL/aadl.h
+++ b/objects/AADL/aadl.h
@@ -194,7 +194,7 @@ void aadlbox_load(ObjectNode obj_node, int version, DiaContext *ctx,
                        Aadlbox *aadlbox);
 
 /* aadldata.c */
-void aadlbox_project_point_on_rectangle(Rectangle *rectangle,
+void aadlbox_project_point_on_rectangle(DiaRectangle *rectangle,
                                        Point *p,real *angle);
  void aadldata_project_point_on_nearest_border(Aadlbox *aadlbox,
                                         Point *p,real *angle);
diff --git a/objects/AADL/aadlbus.c b/objects/AADL/aadlbus.c
index 28d32f8c..22b64eb3 100644
--- a/objects/AADL/aadlbus.c
+++ b/objects/AADL/aadlbus.c
@@ -113,7 +113,7 @@ aadlbus_project_point_on_nearest_border(Aadlbox *aadlbox,Point *p,
   if ( p->x >= x1 + w*AADL_BUS_ARROW_SIZE_FACTOR
        && p->x <= x2 - w*AADL_BUS_ARROW_SIZE_FACTOR)
   {
-    Rectangle rectangle;
+    DiaRectangle rectangle;
 
     rectangle.left = x1 + w*AADL_BUS_ARROW_SIZE_FACTOR;
     rectangle.top  = y1 + h*AADL_BUS_HEIGHT_FACTOR;
diff --git a/objects/AADL/aadldata.c b/objects/AADL/aadldata.c
index fe03f5ea..329102b0 100644
--- a/objects/AADL/aadldata.c
+++ b/objects/AADL/aadldata.c
@@ -66,7 +66,7 @@ aadldata_draw (Aadlbox *aadlbox, DiaRenderer *renderer)
 }
 
 void
-aadlbox_project_point_on_rectangle(Rectangle *rectangle,Point *p,real *angle)
+aadlbox_project_point_on_rectangle(DiaRectangle *rectangle,Point *p,real *angle)
 {
 
   /* top left corner */
@@ -115,7 +115,7 @@ aadlbox_project_point_on_rectangle(Rectangle *rectangle,Point *p,real *angle)
 void
 aadldata_project_point_on_nearest_border(Aadlbox *aadlbox,Point *p,real *angle)
 {
-  Rectangle rectangle;
+  DiaRectangle rectangle;
 
   rectangle.left = aadlbox->element.corner.x;
   rectangle.top  = aadlbox->element.corner.y;
diff --git a/objects/AADL/aadlprocess.c b/objects/AADL/aadlprocess.c
index 069a29d5..85d84ab6 100644
--- a/objects/AADL/aadlprocess.c
+++ b/objects/AADL/aadlprocess.c
@@ -86,7 +86,7 @@ aadlbox_inclined_project_point_on_nearest_border(Aadlbox *aadlbox,Point *p,
         A------------ ++++++                 +----------++++++++
   */
 
-  Rectangle rectangle;
+  DiaRectangle rectangle;
   real w, h, delta_y, delta_x;
 
   w = aadlbox->element.width;
diff --git a/objects/Database/compound.c b/objects/Database/compound.c
index 46d6fd43..e2dc6fea 100644
--- a/objects/Database/compound.c
+++ b/objects/Database/compound.c
@@ -787,7 +787,7 @@ compound_apply_props (Compound * comp, GPtrArray * props, gboolean is_default)
  */
 static void compound_update_object (Compound * comp)
 {
-  Rectangle * bb;
+  DiaRectangle * bb;
   Handle * h;
   gint i;
   gint num_handles = comp->object.num_handles;
diff --git a/objects/Database/reference.c b/objects/Database/reference.c
index 0913442e..5ba1b926 100644
--- a/objects/Database/reference.c
+++ b/objects/Database/reference.c
@@ -49,7 +49,7 @@ static void reference_update_data (TableReference *);
 static DiaObject * reference_load (ObjectNode obj_node, int version,DiaContext *ctx);
 static void update_desc_data (Point *, Alignment *,
                               Point *, Point *, Orientation, real, real);
-static void get_desc_bbox (Rectangle *, gchar *, real, Point *, Alignment,
+static void get_desc_bbox (DiaRectangle *, gchar *, real, Point *, Alignment,
                            DiaFont *, real);
 static ObjectChange * reference_add_segment_cb(DiaObject *, Point *, gpointer);
 static ObjectChange * reference_del_segment_cb(DiaObject *, Point *, gpointer);
@@ -256,7 +256,7 @@ reference_draw (TableReference *ref, DiaRenderer *renderer)
 static real
 reference_distance_from (TableReference * ref, Point *point)
 {
-  Rectangle rect;
+  DiaRectangle rect;
   OrthConn * orth;
   real dist;
 
@@ -342,7 +342,7 @@ static void
 reference_update_data (TableReference * ref)
 {
   OrthConn * orth = &ref->orth;
-  Rectangle rect;
+  DiaRectangle rect;
   PolyBBExtras *extra = &orth->extra_spacing;
 
   orthconn_update_data (orth);
@@ -467,7 +467,7 @@ update_desc_data (Point * desc_pos, Alignment * desc_align,
 }
 
 static void
-get_desc_bbox (Rectangle * r, gchar * string, real string_width,
+get_desc_bbox (DiaRectangle * r, gchar * string, real string_width,
                Point * pos, Alignment align,
                DiaFont * font, real font_height)
 {
diff --git a/objects/Database/table.c b/objects/Database/table.c
index f8b3cee5..818b42d6 100644
--- a/objects/Database/table.c
+++ b/objects/Database/table.c
@@ -780,7 +780,7 @@ table_draw_attributesbox (Table         *table,
 static real
 table_distance_from (Table * table, Point *point)
 {
-  const Rectangle * rect;
+  const DiaRectangle * rect;
   DiaObject * obj;
 
   obj = &table->element.object;
diff --git a/objects/ER/entity.c b/objects/ER/entity.c
index 7bdb024d..3f0ee093 100644
--- a/objects/ER/entity.c
+++ b/objects/ER/entity.c
@@ -183,7 +183,7 @@ static real
 entity_distance_from(Entity *entity, Point *point)
 {
   Element *elem = &entity->element;
-  Rectangle rect;
+  DiaRectangle rect;
 
   rect.left = elem->corner.x - entity->border_width/2;
   rect.right = elem->corner.x + elem->width + entity->border_width/2;
diff --git a/objects/ER/relationship.c b/objects/ER/relationship.c
index d14d524b..861d5bc4 100644
--- a/objects/ER/relationship.c
+++ b/objects/ER/relationship.c
@@ -195,7 +195,7 @@ static real
 relationship_distance_from(Relationship *relationship, Point *point)
 {
   Element *elem = &relationship->element;
-  Rectangle rect;
+  DiaRectangle rect;
 
   rect.left = elem->corner.x - relationship->border_width/2;
   rect.right = elem->corner.x + elem->width + relationship->border_width/2;
diff --git a/objects/FS/flow-ortho.c b/objects/FS/flow-ortho.c
index 00203bdb..1dad63b3 100644
--- a/objects/FS/flow-ortho.c
+++ b/objects/FS/flow-ortho.c
@@ -501,7 +501,7 @@ orthflow_update_data(Orthflow *orthflow)
 {
   OrthConn *orth = &orthflow->orth ;
   DiaObject *obj = &orth->object;
-  Rectangle rect;
+  DiaRectangle rect;
   Color* color = &orthflow_color_signal;
 
   switch (orthflow->type) {
diff --git a/objects/FS/flow.c b/objects/FS/flow.c
index 0f217b20..dae6c3fe 100644
--- a/objects/FS/flow.c
+++ b/objects/FS/flow.c
@@ -462,7 +462,7 @@ flow_update_data(Flow *flow)
 {
   Connection *conn = &flow->connection;
   DiaObject *obj = &conn->object;
-  Rectangle rect;
+  DiaRectangle rect;
   Color* color = NULL;
 
   if (connpoint_is_autogap(flow->connection.endpoint_handles[0].connected_to) ||
diff --git a/objects/GRAFCET/action.c b/objects/GRAFCET/action.c
index 080db107..a33e362f 100644
--- a/objects/GRAFCET/action.c
+++ b/objects/GRAFCET/action.c
@@ -56,7 +56,7 @@ typedef struct _Action {
   real space_width; /* width of a space in the current font
                      Fallacy! space is a very flexible thing in Pango...*/
   real label_width;
-  Rectangle labelbb; /* The bounding box of the label itself */
+  DiaRectangle labelbb; /* The bounding box of the label itself */
   Point labelstart;
 
   ConnPointLine *cps; /* aaahrg ! again one ! */
diff --git a/objects/GRAFCET/action_text_draw.c b/objects/GRAFCET/action_text_draw.c
index d0e557cb..a295f5cd 100644
--- a/objects/GRAFCET/action_text_draw.c
+++ b/objects/GRAFCET/action_text_draw.c
@@ -103,7 +103,7 @@ action_text_draw (Text *text, DiaRenderer *renderer)
 }
 
 void
-action_text_calc_boundingbox(Text *text, Rectangle *box)
+action_text_calc_boundingbox(Text *text, DiaRectangle *box)
 {
   real width;
   int i;
diff --git a/objects/GRAFCET/action_text_draw.h b/objects/GRAFCET/action_text_draw.h
index 846b5a2a..d1f9e0e5 100644
--- a/objects/GRAFCET/action_text_draw.h
+++ b/objects/GRAFCET/action_text_draw.h
@@ -28,8 +28,8 @@
 #include "diarenderer.h"
 #include "text.h"
 
-extern void action_text_draw(Text *text, DiaRenderer *renderer);
-extern void action_text_calc_boundingbox(Text *text, Rectangle *box);
-extern real action_text_spacewidth(Text *text);
- 
+extern void action_text_draw             (Text *text, DiaRenderer  *renderer);
+extern void action_text_calc_boundingbox (Text *text, DiaRectangle *box);
+extern real action_text_spacewidth       (Text *text);
+
 #endif /* __ACTION_TEXT_DRAW_H */
diff --git a/objects/GRAFCET/boolequation.c b/objects/GRAFCET/boolequation.c
index 21689fb9..c2856c5a 100644
--- a/objects/GRAFCET/boolequation.c
+++ b/objects/GRAFCET/boolequation.c
@@ -32,7 +32,7 @@ typedef enum {OP_AND, OP_OR, OP_XOR, OP_RISE, OP_FALL,
               OP_EQUAL,OP_LT,OP_GT} OperatorType;
 
 typedef void (*BlockGetBBFunc)(Block *block, Point *relpos, Boolequation *booleq,
-                              Rectangle *rect);
+                              DiaRectangle *rect);
 typedef void (*BlockDrawFunc)(Block *block,
                              Boolequation *booleq,
                              DiaRenderer *render);
@@ -80,8 +80,10 @@ inline static gboolean isspecial(gunichar c)
 
 /* Text block definition */
 static void
-textblock_get_boundingbox(Block *block, Point *relpos,
-                         Boolequation *booleq, Rectangle *rect)
+textblock_get_boundingbox (Block        *block,
+                           Point        *relpos,
+                           Boolequation *booleq,
+                           DiaRectangle *rect)
 {
   g_assert(block); g_assert(block->type == BLOCK_TEXT);
 
@@ -181,7 +183,7 @@ static const gchar *opstring(OperatorType optype)
 
 static void
 opblock_get_boundingbox(Block *block, Point *relpos,
-                       Boolequation *booleq, Rectangle *rect)
+                       Boolequation *booleq, DiaRectangle *rect)
 {
   const gchar* ops;
   g_assert(block); g_assert(block->type == BLOCK_OPERATOR);
@@ -273,7 +275,7 @@ static Block *opblock_create(const gchar **str)
 /* Overlineblock : */
 static void
 overlineblock_get_boundingbox(Block *block, Point *relpos,
-                             Boolequation *booleq, Rectangle *rect)
+                             Boolequation *booleq, DiaRectangle *rect)
 {
   g_assert(block); g_assert(block->type == BLOCK_OVERLINE);
 
@@ -337,7 +339,7 @@ static Block *overlineblock_create(Block *inside)
 /* Parensblock : */
 static void
 parensblock_get_boundingbox(Block *block, Point *relpos,
-                           Boolequation *booleq, Rectangle *rect)
+                           Boolequation *booleq, DiaRectangle *rect)
 {
   real pheight,pwidth;
   Point temppos;
@@ -409,12 +411,12 @@ static Block *parensblock_create(Block *inside)
 /* Compoundblock : */
 static void
 compoundblock_get_boundingbox(Block *block, Point *relpos,
-                             Boolequation *booleq, Rectangle *rect)
+                             Boolequation *booleq, DiaRectangle *rect)
 {
   GSList *elem;
   Block *inblk;
   Point pos;
-  Rectangle inrect;
+  DiaRectangle inrect;
 
   g_assert(block); g_assert(block->type == BLOCK_COMPOUND);
 
@@ -608,7 +610,8 @@ boolequation_draw(Boolequation *booleq, DiaRenderer *renderer)
   }
 }
 
-void boolequation_calc_boundingbox(Boolequation *booleq, Rectangle *box)
+void
+boolequation_calc_boundingbox(Boolequation *booleq, DiaRectangle *box)
 {
         /*
           booleq->ascent = dia_font_ascent(booleq->font,booleq->fontheight);
diff --git a/objects/GRAFCET/boolequation.h b/objects/GRAFCET/boolequation.h
index 050201d8..61cbfdeb 100644
--- a/objects/GRAFCET/boolequation.h
+++ b/objects/GRAFCET/boolequation.h
@@ -1,7 +1,7 @@
 /* Dia -- an diagram creation/manipulation program
  * Copyright (C) 1998 Alexander Larsson
  *
- * This code renders boolean equations, as needed by the transitions' 
+ * This code renders boolean equations, as needed by the transitions'
  * receptivities and the conditional actions.
  *
  * Copyright (C) 2000 Cyrille Chepelov
@@ -40,7 +40,7 @@ typedef struct {
   Point pos;
 
   const gchar *value;
-  
+
   Block *rootblock;
 
   real width;
@@ -51,8 +51,8 @@ typedef struct {
         */
 } Boolequation;
 
-  
-extern Boolequation *boolequation_create(const gchar *value, DiaFont *font, 
+
+extern Boolequation *boolequation_create(const gchar *value, DiaFont *font,
                                       real fontheight, Color *color);
 extern void boolequation_destroy(Boolequation *rcep);
 extern void boolequation_set_value(Boolequation *rcep, const gchar *value);
@@ -61,6 +61,6 @@ extern void save_boolequation(ObjectNode obj_node, const gchar *attrname,
                             Boolequation *rcep, DiaContext *ctx);
 
 extern void boolequation_draw(Boolequation *rcep, DiaRenderer *renderer);
-extern void boolequation_calc_boundingbox(Boolequation *rcep, Rectangle *box);
- 
+extern void boolequation_calc_boundingbox(Boolequation *rcep, DiaRectangle *box);
+
 #endif /* __BOOLEQUATION_H */
diff --git a/objects/GRAFCET/condition.c b/objects/GRAFCET/condition.c
index 6777de17..3d7e19d9 100644
--- a/objects/GRAFCET/condition.c
+++ b/objects/GRAFCET/condition.c
@@ -59,7 +59,7 @@ typedef struct _Condition {
   Color cond_color;
 
   /* computed values : */
-  Rectangle labelbb;
+  DiaRectangle labelbb;
 } Condition;
 
 static ObjectChange* condition_move_handle(Condition *condition, Handle *handle,
diff --git a/objects/GRAFCET/step.c b/objects/GRAFCET/step.c
index 61c57a42..067d1cbd 100644
--- a/objects/GRAFCET/step.c
+++ b/objects/GRAFCET/step.c
@@ -246,7 +246,7 @@ static real
 step_distance_from(Step *step, Point *point)
 {
   Element *elem = &step->element;
-  Rectangle rect;
+  DiaRectangle rect;
   real dist;
 
   dist = distance_line_point(&step->north.pos,&step->NU1,
diff --git a/objects/GRAFCET/transition.c b/objects/GRAFCET/transition.c
index 0fc9bd1f..919b761c 100644
--- a/objects/GRAFCET/transition.c
+++ b/objects/GRAFCET/transition.c
@@ -68,7 +68,7 @@ typedef struct _Transition {
   Point SD1,SD2,NU1,NU2;
 
   /* computed values : */
-  Rectangle rceptbb; /* The bounding box of the receptivity */
+  DiaRectangle rceptbb; /* The bounding box of the receptivity */
   Point A,B,C,D,Z;
 } Transition;
 
diff --git a/objects/GRAFCET/vergent.c b/objects/GRAFCET/vergent.c
index 0bb24a93..a4c0b0b7 100644
--- a/objects/GRAFCET/vergent.c
+++ b/objects/GRAFCET/vergent.c
@@ -168,7 +168,7 @@ static real
 vergent_distance_from(Vergent *vergent, Point *point)
 {
   Connection *conn = &vergent->connection;
-  Rectangle rectangle;
+  DiaRectangle rectangle;
 
   rectangle.left = conn->endpoints[0].x;
   rectangle.right = conn->endpoints[1].x;
diff --git a/objects/Istar/goal.c b/objects/Istar/goal.c
index 477620ba..eaa319f3 100644
--- a/objects/Istar/goal.c
+++ b/objects/Istar/goal.c
@@ -193,7 +193,7 @@ static real
 goal_distance_from(Goal *goal, Point *point)
 {
   Element *elem = &goal->element;
-  Rectangle rect;
+  DiaRectangle rect;
 
   rect.left = elem->corner.x - GOAL_LINE_WIDTH/2;
   rect.right = elem->corner.x + elem->width + GOAL_LINE_WIDTH/2;
diff --git a/objects/Istar/link.c b/objects/Istar/link.c
index 40129bac..edffbaef 100644
--- a/objects/Istar/link.c
+++ b/objects/Istar/link.c
@@ -606,7 +606,7 @@ link_update_data(Link *link)
 {
   Connection *conn = &link->connection;
   DiaObject *obj = &conn->object;
-  Rectangle rect;
+  DiaRectangle rect;
   Point p1,p2,p3,p4,pa;
 
 /* Too complex to easily decide */
diff --git a/objects/Istar/other.c b/objects/Istar/other.c
index 8ae0fa12..6ddd9929 100644
--- a/objects/Istar/other.c
+++ b/objects/Istar/other.c
@@ -195,7 +195,7 @@ static real
 other_distance_from(Other *other, Point *point)
 {
   Element *elem = &other->element;
-  Rectangle rect;
+  DiaRectangle rect;
 
   rect.left = elem->corner.x - OTHER_LINE_WIDTH/2;
   rect.right = elem->corner.x + elem->width + OTHER_LINE_WIDTH/2;
diff --git a/objects/Jackson/domain.c b/objects/Jackson/domain.c
index 4c2cc305..8cce2ad8 100644
--- a/objects/Jackson/domain.c
+++ b/objects/Jackson/domain.c
@@ -247,7 +247,7 @@ static real
 jackson_box_distance_from(Box *box, Point *point)
 {
   Element *elem = &box->element;
-  Rectangle rect;
+  DiaRectangle rect;
 
   rect.left = elem->corner.x - JACKSON_BOX_LINE_WIDTH/2;
   rect.right = elem->corner.x + elem->width + JACKSON_BOX_LINE_WIDTH/2;
diff --git a/objects/Jackson/phenomenon.c b/objects/Jackson/phenomenon.c
index ceaecc4e..e6426c97 100644
--- a/objects/Jackson/phenomenon.c
+++ b/objects/Jackson/phenomenon.c
@@ -380,7 +380,7 @@ message_update_data(Message *message)
 {
   Connection *conn = &message->connection;
   DiaObject *obj = &conn->object;
-  Rectangle rect;
+  DiaRectangle rect;
 
   if (connpoint_is_autogap(conn->endpoint_handles[0].connected_to) ||
       connpoint_is_autogap(conn->endpoint_handles[1].connected_to)) {
diff --git a/objects/Jackson/requirement.c b/objects/Jackson/requirement.c
index 9cab55df..3d31321c 100644
--- a/objects/Jackson/requirement.c
+++ b/objects/Jackson/requirement.c
@@ -324,7 +324,7 @@ req_update_data(Requirement *req)
 
   /* Boundingbox calculation including the line width */
   {
-    Rectangle bbox;
+    DiaRectangle bbox;
 
     ellipse_bbox (&c, elem->width, elem->height, &elem->extra_spacing, &bbox);
     rectangle_union(&obj->bounding_box, &bbox);
diff --git a/objects/KAOS/goal.c b/objects/KAOS/goal.c
index 838860e7..5926335d 100644
--- a/objects/KAOS/goal.c
+++ b/objects/KAOS/goal.c
@@ -205,7 +205,7 @@ static real
 goal_distance_from(Goal *goal, Point *point)
 {
   Element *elem = &goal->element;
-  Rectangle rect;
+  DiaRectangle rect;
 
   rect.left = elem->corner.x - GOAL_LINE_SIMPLE_WIDTH/2;
   rect.right = elem->corner.x + elem->width + GOAL_LINE_SIMPLE_WIDTH/2;
diff --git a/objects/KAOS/metaandorrel.c b/objects/KAOS/metaandorrel.c
index acc7da10..113ba6a8 100644
--- a/objects/KAOS/metaandorrel.c
+++ b/objects/KAOS/metaandorrel.c
@@ -572,7 +572,7 @@ maor_update_data(Maor *maor)
 {
   Connection *conn = &maor->connection;
   DiaObject *obj = &conn->object;
-  Rectangle rect;
+  DiaRectangle rect;
   Point p1,p2,p3,p4;
 
   if (connpoint_is_autogap(conn->endpoint_handles[0].connected_to) ||
diff --git a/objects/KAOS/metabinrel.c b/objects/KAOS/metabinrel.c
index cadb8706..13d46d77 100644
--- a/objects/KAOS/metabinrel.c
+++ b/objects/KAOS/metabinrel.c
@@ -526,7 +526,7 @@ mbr_update_data(Mbr *mbr)
 {
   Connection *conn = &mbr->connection;
   DiaObject *obj = &conn->object;
-  Rectangle rect;
+  DiaRectangle rect;
   Point p1,p2;
   Point p3,p4;
   gchar *text;
diff --git a/objects/KAOS/other.c b/objects/KAOS/other.c
index 190bb94e..64ca4d3e 100644
--- a/objects/KAOS/other.c
+++ b/objects/KAOS/other.c
@@ -199,7 +199,7 @@ static real
 other_distance_from(Other *other, Point *point)
 {
   Element *elem = &other->element;
-  Rectangle rect;
+  DiaRectangle rect;
 
   rect.left = elem->corner.x - OTHER_LINE_SIMPLE_WIDTH/2;
   rect.right = elem->corner.x + elem->width + OTHER_LINE_SIMPLE_WIDTH/2;
diff --git a/objects/Misc/measure.c b/objects/Misc/measure.c
index 4ed7122d..37d68938 100644
--- a/objects/Misc/measure.c
+++ b/objects/Misc/measure.c
@@ -214,7 +214,7 @@ measure_update_data (Measure *measure)
   real value;
   Point *ends = measure->connection.endpoints;
   LineBBExtras *extra = &conn->extra_spacing;
-  Rectangle bbox;
+  DiaRectangle bbox;
   Arrow arrow = MEASURE_ARROW(measure);
   real ascent, width, theta;
 
diff --git a/objects/SADT/annotation.c b/objects/SADT/annotation.c
index e96abbd1..7ed1ffdd 100644
--- a/objects/SADT/annotation.c
+++ b/objects/SADT/annotation.c
@@ -190,7 +190,7 @@ static real
 annotation_distance_from(Annotation *annotation, Point *point)
 {
   Point *endpoints;
-  Rectangle bbox;
+  DiaRectangle bbox;
   endpoints = &annotation->connection.endpoints[0];
 
   text_calc_boundingbox(annotation->text,&bbox);
@@ -396,7 +396,7 @@ annotation_update_data(Annotation *annotation)
 {
   Connection *conn = &annotation->connection;
   DiaObject *obj = &conn->object;
-  Rectangle textrect;
+  DiaRectangle textrect;
 
   if (connpoint_is_autogap(conn->endpoint_handles[0].connected_to) ||
       connpoint_is_autogap(conn->endpoint_handles[1].connected_to)) {
diff --git a/objects/SADT/box.c b/objects/SADT/box.c
index 7fdeac1c..80580896 100644
--- a/objects/SADT/box.c
+++ b/objects/SADT/box.c
@@ -194,7 +194,7 @@ static real
 sadtbox_distance_from(Box *box, Point *point)
 {
   Element *elem = &box->element;
-  Rectangle rect;
+  DiaRectangle rect;
 
   rect.left = elem->corner.x - SADTBOX_LINE_WIDTH/2;
   rect.right = elem->corner.x + elem->width + SADTBOX_LINE_WIDTH/2;
diff --git a/objects/UML/actor.c b/objects/UML/actor.c
index bb81d3d8..b34cc4c3 100644
--- a/objects/UML/actor.c
+++ b/objects/UML/actor.c
@@ -282,7 +282,7 @@ actor_update_data(Actor *actor)
 {
   Element *elem = &actor->element;
   DiaObject *obj = &elem->object;
-  Rectangle text_box;
+  DiaRectangle text_box;
   Point p;
   real actor_height;
 
diff --git a/objects/UML/association.c b/objects/UML/association.c
index 6ce949ff..ba873f20 100644
--- a/objects/UML/association.c
+++ b/objects/UML/association.c
@@ -601,7 +601,7 @@ association_update_data_end(Association *assoc, int endnum)
   OrthConn *orth = &assoc->orth;
   DiaObject *obj = &orth->object;
   Point *points  = orth->points;
-  Rectangle rect;
+  DiaRectangle rect;
   AssociationEnd *end;
   Orientation dir;
   int n = orth->numpoints - 1, fp, sp;
@@ -688,7 +688,7 @@ association_update_data(Association *assoc)
   PolyBBExtras *extra = &orth->extra_spacing;
   int num_segm, i;
   Point *points;
-  Rectangle rect;
+  DiaRectangle rect;
   Orientation dir;
 
   orthconn_update_data(orth);
diff --git a/objects/UML/component.c b/objects/UML/component.c
index d4a6585f..9d1c08ba 100644
--- a/objects/UML/component.c
+++ b/objects/UML/component.c
@@ -179,9 +179,9 @@ component_distance_from(Component *cmp, Point *point)
   real y = elem->corner.y;
   real cw2 = COMPONENT_CWIDTH/2.0;
   real h2 = elem->height / 2.0;
-  Rectangle r1 = { x + cw2, y, x + elem->width - cw2, y + elem->height };
-  Rectangle r2 = { x, y + h2 - COMPONENT_CHEIGHT * 1.5, x + cw2, y + h2 - COMPONENT_CHEIGHT * 0.5 };
-  Rectangle r3 = { x, y + h2 + COMPONENT_CHEIGHT * 0.5, x + cw2, y + h2 + COMPONENT_CHEIGHT * 1.5 };
+  DiaRectangle r1 = { x + cw2, y, x + elem->width - cw2, y + elem->height };
+  DiaRectangle r2 = { x, y + h2 - COMPONENT_CHEIGHT * 1.5, x + cw2, y + h2 - COMPONENT_CHEIGHT * 0.5 };
+  DiaRectangle r3 = { x, y + h2 + COMPONENT_CHEIGHT * 0.5, x + cw2, y + h2 + COMPONENT_CHEIGHT * 1.5 };
   real d1 = distance_rectangle_point(&r1, point);
   real d2 = distance_rectangle_point(&r2, point);
   real d3 = distance_rectangle_point(&r3, point);
diff --git a/objects/UML/component_feature.c b/objects/UML/component_feature.c
index b50acf50..a4f31de6 100644
--- a/objects/UML/component_feature.c
+++ b/objects/UML/component_feature.c
@@ -437,7 +437,7 @@ compfeat_update_data(Compfeat *compfeat)
   PolyBBExtras *extra = &orth->extra_spacing;
   int n;
   DiaObject *obj = &orth->object;
-  Rectangle rect;
+  DiaRectangle rect;
   Point *points;
 
   points = &orth->points[0];
diff --git a/objects/UML/constraint.c b/objects/UML/constraint.c
index 2d60fd97..4a8838c2 100644
--- a/objects/UML/constraint.c
+++ b/objects/UML/constraint.c
@@ -348,7 +348,7 @@ constraint_update_data(Constraint *constraint)
 {
   Connection *conn = &constraint->connection;
   DiaObject *obj = &conn->object;
-  Rectangle rect;
+  DiaRectangle rect;
   LineBBExtras *extra;
 
   if ((constraint->text) && (constraint->text[0] == '{')) {
diff --git a/objects/UML/dependency.c b/objects/UML/dependency.c
index 1849d409..0745f6f3 100644
--- a/objects/UML/dependency.c
+++ b/objects/UML/dependency.c
@@ -278,7 +278,7 @@ dependency_update_data(Dependency *dep)
   PolyBBExtras *extra = &orth->extra_spacing;
   int num_segm, i;
   Point *points;
-  Rectangle rect;
+  DiaRectangle rect;
 
   orthconn_update_data(orth);
 
diff --git a/objects/UML/generalization.c b/objects/UML/generalization.c
index 62431a54..51f6ccec 100644
--- a/objects/UML/generalization.c
+++ b/objects/UML/generalization.c
@@ -272,7 +272,7 @@ generalization_update_data(Generalization *genlz)
   DiaObject *obj = &orth->object;
   int num_segm, i;
   Point *points;
-  Rectangle rect;
+  DiaRectangle rect;
   PolyBBExtras *extra;
   real descent;
   real ascent;
diff --git a/objects/UML/implements.c b/objects/UML/implements.c
index d0601106..0c85f070 100644
--- a/objects/UML/implements.c
+++ b/objects/UML/implements.c
@@ -368,7 +368,7 @@ implements_update_data(Implements *implements)
   Point delta;
   Point point;
   real len;
-  Rectangle rect;
+  DiaRectangle rect;
 
   implements->text_width = 0.0;
   if (implements->text)
diff --git a/objects/UML/large_package.c b/objects/UML/large_package.c
index 8a63f289..e1c3af3d 100644
--- a/objects/UML/large_package.c
+++ b/objects/UML/large_package.c
@@ -193,8 +193,8 @@ largepackage_distance_from(LargePackage *pkg, Point *point)
   Element *elem = &pkg->element;
   real x = elem->corner.x;
   real y = elem->corner.y;
-  Rectangle r1 = { x, y, x + elem->width, y + elem->height };
-  Rectangle r2 = { x, y - pkg->topheight, x + pkg->topwidth, y };
+  DiaRectangle r1 = { x, y, x + elem->width, y + elem->height };
+  DiaRectangle r2 = { x, y - pkg->topheight, x + pkg->topwidth, y };
   real d1 = distance_rectangle_point(&r1, point);
   real d2 = distance_rectangle_point(&r2, point);
 
diff --git a/objects/UML/message.c b/objects/UML/message.c
index ff61afee..f21ae9ea 100644
--- a/objects/UML/message.c
+++ b/objects/UML/message.c
@@ -433,7 +433,7 @@ message_update_data(Message *message)
 {
   Connection *conn = &message->connection;
   DiaObject *obj = &conn->object;
-  Rectangle rect;
+  DiaRectangle rect;
 
   if (connpoint_is_autogap(conn->endpoint_handles[0].connected_to) ||
       connpoint_is_autogap(conn->endpoint_handles[1].connected_to)) {
diff --git a/objects/UML/realizes.c b/objects/UML/realizes.c
index 0ef45101..e584ee9c 100644
--- a/objects/UML/realizes.c
+++ b/objects/UML/realizes.c
@@ -271,7 +271,7 @@ realizes_update_data(Realizes *realize)
   DiaObject *obj = &orth->object;
   int num_segm, i;
   Point *points;
-  Rectangle rect;
+  DiaRectangle rect;
   PolyBBExtras *extra;
 
   orthconn_update_data(orth);
diff --git a/objects/UML/small_package.c b/objects/UML/small_package.c
index c9ed63bf..b5b3ef49 100644
--- a/objects/UML/small_package.c
+++ b/objects/UML/small_package.c
@@ -181,8 +181,8 @@ smallpackage_distance_from(SmallPackage *pkg, Point *point)
   Element *elem = &pkg->element;
   real x = elem->corner.x;
   real y = elem->corner.y;
-  Rectangle r1 = { x, y, x + elem->width, y + elem->height };
-  Rectangle r2 = { x, y - SMALLPACKAGE_TOPHEIGHT, x + SMALLPACKAGE_TOPWIDTH, y };
+  DiaRectangle r1 = { x, y, x + elem->width, y + elem->height };
+  DiaRectangle r2 = { x, y - SMALLPACKAGE_TOPHEIGHT, x + SMALLPACKAGE_TOPWIDTH, y };
   real d1 = distance_rectangle_point(&r1, point);
   real d2 = distance_rectangle_point(&r2, point);
 
diff --git a/objects/UML/transition.c b/objects/UML/transition.c
index 50a38d83..c9320075 100644
--- a/objects/UML/transition.c
+++ b/objects/UML/transition.c
@@ -513,11 +513,12 @@ static ObjectChange* transition_del_segment_cb(DiaObject *obj,
 
 
 
-static void expand_bbox_for_text(Rectangle* bbox,
-                                 Point* text_pos,
-                                 gchar* text)
+static void
+expand_bbox_for_text (DiaRectangle *bbox,
+                      Point        *text_pos,
+                      gchar        *text)
 {
-  Rectangle text_box;
+  DiaRectangle text_box;
   real text_width;
 
   text_width = dia_font_string_width(text, transition_font,
diff --git a/objects/custom/custom_object.c b/objects/custom/custom_object.c
index bd9461d6..227e3c9e 100644
--- a/objects/custom/custom_object.c
+++ b/objects/custom/custom_object.c
@@ -408,7 +408,7 @@ transform_subshape_coord(Custom *custom, GraphicElementSubShape* subshape,
 {
   real scale, width, height, xoffs, yoffs;
   coord cx, cy;
-  Rectangle orig_bounds, new_bounds;
+  DiaRectangle orig_bounds, new_bounds;
 
   if (subshape->default_scale == 0.0) {
     ShapeInfo *info = custom->info;
@@ -531,7 +531,7 @@ transform_coord(Custom *custom, const Point *p1, Point *out)
 }
 
 static void
-transform_rect(Custom *custom, const Rectangle *r1, Rectangle *out)
+transform_rect(Custom *custom, const DiaRectangle *r1, DiaRectangle *out)
 {
   real coord;
   out->left   = r1->left   * custom->xscale + custom->xoffs;
@@ -556,7 +556,7 @@ custom_distance_from(Custom *custom, Point *point)
 {
   static GArray *arr = NULL, *barr = NULL;
   Point p1, p2;
-  Rectangle rect;
+  DiaRectangle rect;
   gint i;
   GList *tmp;
   real min_dist = G_MAXFLOAT, dist = G_MAXFLOAT;
@@ -1246,7 +1246,7 @@ custom_update_data(Custom *custom, AnchorShape horiz, AnchorShape vert)
       && (custom->text_fitting != TEXTFIT_NEVER)) {
     real text_width, text_height;
     real xscale = 0.0, yscale = 0.0;
-    Rectangle tb;
+    DiaRectangle tb;
 
     text_calc_boundingbox(custom->text, NULL);
     text_width =
@@ -1348,7 +1348,7 @@ custom_update_data(Custom *custom, AnchorShape horiz, AnchorShape vert)
 
   /* reposition the text element to the new text bounding box ... */
   if (info->has_text) {
-    Rectangle tb;
+    DiaRectangle tb;
     transform_rect(custom, &info->text_bounds, &tb);
     switch (custom->text->alignment) {
     case ALIGN_LEFT:
@@ -1389,7 +1389,7 @@ custom_update_data(Custom *custom, AnchorShape horiz, AnchorShape vert)
 
   for (tmp = custom->info->display_list; tmp != NULL; tmp = tmp->next) {
     GraphicElement *el = tmp->data;
-    Rectangle rect;
+    DiaRectangle rect;
     /* Line width handling/behavior for custom objects is special. Instead of
      * directly using the given width some ratio with the shape global custom
      * border_width gets calculated - to allow influencing all line width used
@@ -1474,7 +1474,7 @@ custom_update_data(Custom *custom, AnchorShape horiz, AnchorShape vert)
     }
     case GE_RECT: {
       ElementBBExtras extra;
-      Rectangle rin,trin;
+      DiaRectangle rin,trin;
       rin.left = el->rect.corner1.x;
       rin.top = el->rect.corner1.y;
       rin.right = el->rect.corner2.x;
@@ -1486,7 +1486,7 @@ custom_update_data(Custom *custom, AnchorShape horiz, AnchorShape vert)
       break;
     }
     case GE_IMAGE: {
-      Rectangle bounds;
+      DiaRectangle bounds;
 
       bounds.left = bounds.right = el->image.topleft.x;
       bounds.top = bounds.bottom = el->image.topleft.y;
@@ -1513,7 +1513,7 @@ custom_update_data(Custom *custom, AnchorShape horiz, AnchorShape vert)
 
   /* extend bounding box to include text bounds ... */
   if (info->has_text) {
-    Rectangle tb;
+    DiaRectangle tb;
     text_calc_boundingbox(custom->text, &tb);
     tb.left -= custom->padding;
     tb.top -= custom->padding;
@@ -1533,7 +1533,7 @@ custom_reposition_text(Custom *custom, GraphicElementText *text)
 {
   Element *elem = &custom->element;
   Point p;
-  Rectangle tb;
+  DiaRectangle tb;
 
   transform_rect(custom, &text->text_bounds, &tb);
   switch (text->object->alignment) {
diff --git a/objects/custom/shape_info.c b/objects/custom/shape_info.c
index 33993821..ca7e3eb3 100644
--- a/objects/custom/shape_info.c
+++ b/objects/custom/shape_info.c
@@ -642,12 +642,12 @@ update_bounds(ShapeInfo *info)
     case GE_SHAPE:
 #if 1
       {
-       Rectangle bbox;
-       PolyBBExtras extra = { 0, };
+        DiaRectangle bbox;
+        PolyBBExtras extra = { 0, };
 
-        polybezier_bbox(&el->path.points[0],el->path.npoints,
-                      &extra,el->type == GE_SHAPE,&bbox);
-       rectangle_union(&info->shape_bounds, &bbox);
+        polybezier_bbox (&el->path.points[0],el->path.npoints,
+                         &extra,el->type == GE_SHAPE,&bbox);
+        rectangle_union (&info->shape_bounds, &bbox);
       }
 #else
       for (i = 0; i < el->path.npoints; i++)
diff --git a/objects/custom/shape_info.h b/objects/custom/shape_info.h
index fba702a5..5d18719b 100644
--- a/objects/custom/shape_info.h
+++ b/objects/custom/shape_info.h
@@ -100,7 +100,7 @@ struct _GraphicElementText {
   Point anchor;
   char *string;
   Text *object;
-  Rectangle text_bounds;
+  DiaRectangle text_bounds;
 };
 
 struct _GraphicElementImage {
@@ -117,14 +117,14 @@ struct _GraphicElementImage {
 struct _GraphicElementSubShape {
   SHAPE_INFO_COMMON;
   GList *display_list;
-  
+
   gint h_anchor_method;
   gint v_anchor_method;
-  
+
   real default_scale;
-  
+
   /* subshape bounding box, center, ... */
-  
+
   Point center;
   real half_width;
   real half_height;
@@ -178,18 +178,18 @@ struct _ShapeInfo {
   /*! the filename is info required to load the real data on demand */
   gchar *filename;
   gboolean loaded;
-  
+
   /*! everything below could be put into it's own struct to also spare memory when the shapes are not 
created */
   /* @{ */
   int nconnections;
   Point *connections;
   int main_cp; /*!< the cp that gets connections from the whole object */
   int object_flags; /*!< set of PropFlags e.g. parenting */
-  Rectangle shape_bounds;
+  DiaRectangle shape_bounds;
   gboolean has_text;
   gboolean resize_with_text;
   gint text_align;
-  Rectangle text_bounds;
+  DiaRectangle text_bounds;
 
   ShapeAspectType aspect_type;
   real aspect_min, aspect_max;
@@ -199,11 +199,11 @@ struct _ShapeInfo {
 
 
   GList *display_list;
-  
+
   GList *subshapes;
 
   DiaObjectType *object_type; /* back link so we can find the correct type */
-  
+
   /*MC 11/03 added */
   int n_ext_attr;
   int ext_attr_size;
diff --git a/objects/flowchart/box.c b/objects/flowchart/box.c
index 16a5b0b5..69ac35b9 100644
--- a/objects/flowchart/box.c
+++ b/objects/flowchart/box.c
@@ -215,7 +215,7 @@ static real
 box_distance_from(Box *box, Point *point)
 {
   Element *elem = &box->element;
-  Rectangle rect;
+  DiaRectangle rect;
 
   rect.left = elem->corner.x - box->border_width/2;
   rect.right = elem->corner.x + elem->width + box->border_width/2;
diff --git a/objects/flowchart/diamond.c b/objects/flowchart/diamond.c
index 778f7a89..493a8858 100644
--- a/objects/flowchart/diamond.c
+++ b/objects/flowchart/diamond.c
@@ -212,7 +212,7 @@ static real
 diamond_distance_from(Diamond *diamond, Point *point)
 {
   Element *elem = &diamond->element;
-  Rectangle rect;
+  DiaRectangle rect;
 
   rect.left = elem->corner.x - diamond->border_width/2;
   rect.right = elem->corner.x + elem->width + diamond->border_width/2;
diff --git a/objects/flowchart/parallelogram.c b/objects/flowchart/parallelogram.c
index e8b42e03..3fd77929 100644
--- a/objects/flowchart/parallelogram.c
+++ b/objects/flowchart/parallelogram.c
@@ -218,7 +218,7 @@ static real
 pgram_distance_from(Pgram *pgram, Point *point)
 {
   Element *elem = &pgram->element;
-  Rectangle rect;
+  DiaRectangle rect;
 
   rect.left = elem->corner.x - pgram->border_width/2;
   rect.right = elem->corner.x + elem->width + pgram->border_width/2;
diff --git a/objects/network/basestation.c b/objects/network/basestation.c
index 656434c8..e705a2c2 100644
--- a/objects/network/basestation.c
+++ b/objects/network/basestation.c
@@ -330,7 +330,7 @@ basestation_update_data(Basestation *basestation)
 {
   Element *elem = &basestation->element;
   DiaObject *obj = &elem->object;
-  Rectangle text_box;
+  DiaRectangle text_box;
   Point p;
 
   elem->width = BASESTATION_WIDTH;
diff --git a/objects/network/radiocell.c b/objects/network/radiocell.c
index 82b44ebf..2ceb3db7 100644
--- a/objects/network/radiocell.c
+++ b/objects/network/radiocell.c
@@ -275,7 +275,7 @@ radiocell_update_data(RadioCell *radiocell)
   PolyShape *poly = &radiocell->poly;
   DiaObject *obj = &poly->object;
   ElementBBExtras *extra = &poly->extra_spacing;
-  Rectangle text_box;
+  DiaRectangle text_box;
   Point textpos;
   int i;
   /* not exactly a regular hexagon, but this fits better in the grid */
diff --git a/objects/standard/arc.c b/objects/standard/arc.c
index aed9fd49..29b54a5c 100644
--- a/objects/standard/arc.c
+++ b/objects/standard/arc.c
@@ -700,7 +700,7 @@ arc_create(Point *startpoint,
   Point defaultlen = { 1.0, 1.0 };
 
   arc = g_malloc0(sizeof(Arc));
-  arc->connection.object.enclosing_box = g_new0 (Rectangle, 1);
+  arc->connection.object.enclosing_box = g_new0 (DiaRectangle, 1);
 
   arc->line_width =  attributes_get_default_linewidth();
   arc->curve_distance = 1.0;
@@ -749,7 +749,7 @@ arc_copy(Arc *arc)
   conn = &arc->connection;
 
   newarc = g_malloc0(sizeof(Arc));
-  newarc->connection.object.enclosing_box = g_new0 (Rectangle, 1);
+  newarc->connection.object.enclosing_box = g_new0 (DiaRectangle, 1);
   newconn = &newarc->connection;
   newobj = &newconn->object;
 
@@ -891,7 +891,7 @@ arc_update_data(Arc *arc)
      * currently uses the tangent For big arcs the difference is not huge and the
      * minimum size of small arcs should be limited by the arror length.
      */
-    Rectangle bbox = {0,};
+    DiaRectangle bbox = {0,};
     real tmp;
     Point move_arrow, move_line;
     Point to = arc->connection.endpoints[0];
@@ -913,7 +913,7 @@ arc_update_data(Arc *arc)
     rectangle_union(&obj->bounding_box, &bbox);
   }
   if (arc->end_arrow.type != ARROW_NONE) {
-    Rectangle bbox = {0,};
+    DiaRectangle bbox = {0,};
     real tmp;
     Point move_arrow, move_line;
     Point to = arc->connection.endpoints[1];
@@ -991,7 +991,7 @@ arc_load(ObjectNode obj_node, int version,DiaContext *ctx)
   AttributeNode attr;
 
   arc = g_malloc0(sizeof(Arc));
-  arc->connection.object.enclosing_box = g_new0 (Rectangle, 1);
+  arc->connection.object.enclosing_box = g_new0 (DiaRectangle, 1);
 
   conn = &arc->connection;
   obj = &conn->object;
diff --git a/objects/standard/bezier.c b/objects/standard/bezier.c
index b319b17f..3420fe1b 100644
--- a/objects/standard/bezier.c
+++ b/objects/standard/bezier.c
@@ -442,7 +442,7 @@ bezierline_create(Point *startpoint,
   Point defaultlen = { .3, .3 };
 
   bezierline = g_new0(Bezierline, 1);
-  bezierline->bez.object.enclosing_box = g_new0 (Rectangle, 1);
+  bezierline->bez.object.enclosing_box = g_new0 (DiaRectangle, 1);
   bez = &bezierline->bez;
   obj = &bez->object;
 
@@ -500,7 +500,7 @@ bezierline_copy(Bezierline *bezierline)
   bez = &bezierline->bez;
 
   newbezierline = g_new0(Bezierline, 1);
-  newbezierline->bez.object.enclosing_box = g_new0 (Rectangle, 1);
+  newbezierline->bez.object.enclosing_box = g_new0 (DiaRectangle, 1);
   newbez = &newbezierline->bez;
 
   bezierconn_copy(bez, newbez);
@@ -540,13 +540,13 @@ bezierline_update_data(Bezierline *bezierline)
       bezierline->absolute_start_gap || bezierline->absolute_end_gap ||
       bezierline->start_arrow.type != ARROW_NONE || bezierline->end_arrow.type != ARROW_NONE) {
     Point gap_points[4];
-    Rectangle bbox_union = {bez->bezier.points[0].p1.x, bez->bezier.points[0].p1.y,
+    DiaRectangle bbox_union = {bez->bezier.points[0].p1.x, bez->bezier.points[0].p1.y,
                            bez->bezier.points[0].p1.x, bez->bezier.points[0].p1.y};
     compute_gap_points(bezierline, gap_points);
     exchange_bez_gap_points(bez,gap_points);
     /* further modifying the points data, accounts for corrcet arrow and bezier bounding box */
     if (bezierline->start_arrow.type != ARROW_NONE) {
-      Rectangle bbox;
+      DiaRectangle bbox;
       Point move_arrow, move_line;
       Point to = bez->bezier.points[0].p1, from = bez->bezier.points[1].p1;
 
@@ -557,7 +557,7 @@ bezierline_update_data(Bezierline *bezierline)
       rectangle_union (&bbox_union, &bbox);
     }
     if (bezierline->end_arrow.type != ARROW_NONE) {
-      Rectangle bbox;
+      DiaRectangle bbox;
       Point move_arrow, move_line;
       int num_points = bez->bezier.num_points;
       Point to = bez->bezier.points[num_points-1].p3, from = bez->bezier.points[num_points-1].p2;
@@ -656,7 +656,7 @@ bezierline_load(ObjectNode obj_node, int version, DiaContext *ctx)
   AttributeNode attr;
 
   bezierline = g_new0(Bezierline, 1);
-  bezierline->bez.object.enclosing_box = g_new0 (Rectangle, 1);
+  bezierline->bez.object.enclosing_box = g_new0 (DiaRectangle, 1);
 
   bez = &bezierline->bez;
   obj = &bez->object;
diff --git a/objects/standard/beziergon.c b/objects/standard/beziergon.c
index da4bfdb0..8c5718f1 100644
--- a/objects/standard/beziergon.c
+++ b/objects/standard/beziergon.c
@@ -261,7 +261,7 @@ beziergon_create(Point *startpoint,
   Point defaulty = { 0.0, 1.0 };
 
   beziergon = g_new0(Beziergon, 1);
-  beziergon->bezier.object.enclosing_box = g_new0 (Rectangle, 1);
+  beziergon->bezier.object.enclosing_box = g_new0 (DiaRectangle, 1);
   bez = &beziergon->bezier;
   obj = &bez->object;
 
@@ -326,7 +326,7 @@ beziergon_copy(Beziergon *beziergon)
   bezier = &beziergon->bezier;
 
   newbeziergon = g_malloc0(sizeof(Beziergon));
-  newbeziergon->bezier.object.enclosing_box = g_new0 (Rectangle, 1);
+  newbeziergon->bezier.object.enclosing_box = g_new0 (DiaRectangle, 1);
   newbezier = &newbeziergon->bezier;
 
   beziershape_copy(bezier, newbezier);
@@ -419,7 +419,7 @@ beziergon_load(ObjectNode obj_node, int version, DiaContext *ctx)
   AttributeNode attr;
 
   beziergon = g_malloc0(sizeof(Beziergon));
-  beziergon->bezier.object.enclosing_box = g_new0 (Rectangle, 1);
+  beziergon->bezier.object.enclosing_box = g_new0 (DiaRectangle, 1);
 
   bez = &beziergon->bezier;
   obj = &bez->object;
diff --git a/objects/standard/box.c b/objects/standard/box.c
index 6d2d5982..e8c043ad 100644
--- a/objects/standard/box.c
+++ b/objects/standard/box.c
@@ -225,7 +225,7 @@ box_distance_from(Box *box, Point *point)
   Element *elem = &box->element;
 
   if (box->angle == 0) {
-    Rectangle rect;
+    DiaRectangle rect;
     rect.left = elem->corner.x - box->border_width/2;
     rect.right = elem->corner.x + elem->width + box->border_width/2;
     rect.top = elem->corner.y - box->border_width/2;
diff --git a/objects/standard/image.c b/objects/standard/image.c
index fab612e6..ae297235 100644
--- a/objects/standard/image.c
+++ b/objects/standard/image.c
@@ -304,7 +304,7 @@ static real
 image_distance_from(Image *image, Point *point)
 {
   Element *elem = &image->element;
-  Rectangle rect;
+  DiaRectangle rect;
   real bw = image->draw_border ? image->border_width : 0;
 
   if (image->angle != 0.0) {
diff --git a/objects/standard/line.c b/objects/standard/line.c
index 82cc15a2..d7aa7005 100644
--- a/objects/standard/line.c
+++ b/objects/standard/line.c
@@ -592,7 +592,7 @@ line_update_data(Line *line)
     end = conn->endpoints[1];
   }
   if (line->start_arrow.type != ARROW_NONE) {
-    Rectangle bbox;
+    DiaRectangle bbox;
     Point move_arrow, move_line;
     Point to = start;
     Point from = end;
@@ -606,7 +606,7 @@ line_update_data(Line *line)
     rectangle_union (&obj->bounding_box, &bbox);
   }
   if (line->end_arrow.type != ARROW_NONE) {
-    Rectangle bbox;
+    DiaRectangle bbox;
     Point move_arrow, move_line;
     Point to = end;
     Point from = start;
diff --git a/objects/standard/polyline.c b/objects/standard/polyline.c
index 01c4db95..764d7bbd 100644
--- a/objects/standard/polyline.c
+++ b/objects/standard/polyline.c
@@ -423,7 +423,7 @@ polyline_update_data(Polyline *polyline)
   polyconn_update_boundingbox(poly);
 
   if (polyline->start_arrow.type != ARROW_NONE) {
-    Rectangle bbox;
+    DiaRectangle bbox;
     Point move_arrow, move_line;
     Point to = gap_endpoints[0];
     Point from = poly->points[1];
@@ -437,7 +437,7 @@ polyline_update_data(Polyline *polyline)
     rectangle_union (&obj->bounding_box, &bbox);
   }
   if (polyline->end_arrow.type != ARROW_NONE) {
-    Rectangle bbox;
+    DiaRectangle bbox;
     int n = polyline->poly.numpoints;
     Point move_arrow, move_line;
     Point to = gap_endpoints[1];
diff --git a/objects/standard/textobj.c b/objects/standard/textobj.c
index fc44f0b4..7bcdd17f 100644
--- a/objects/standard/textobj.c
+++ b/objects/standard/textobj.c
@@ -206,7 +206,7 @@ _textobj_get_poly (const Textobj *textobj, Point poly[4])
 {
   Point ul, lr;
   Point pt = textobj->text_handle.pos;
-  Rectangle box;
+  DiaRectangle box;
   DiaMatrix m = { 1, 0, 0, 1, pt.x, pt.y };
   DiaMatrix t = { 1, 0, 0, 1, -pt.x, -pt.y };
   int i;
@@ -288,7 +288,7 @@ textobj_draw(Textobj *textobj, DiaRenderer *renderer)
   assert(renderer != NULL);
 
   if (textobj->show_background) {
-    Rectangle box;
+    DiaRectangle box;
     Point ul, lr;
     text_calc_boundingbox (textobj->text, &box);
     ul.x = box.left - textobj->margin;
@@ -322,9 +322,9 @@ textobj_draw(Textobj *textobj, DiaRenderer *renderer)
 }
 
 static void
-textobj_valign_point(Textobj *textobj, Point* p)
+textobj_valign_point (Textobj *textobj, Point* p)
 {
-  Rectangle *bb  = &(textobj->object.bounding_box);
+  DiaRectangle *bb  = &(textobj->object.bounding_box);
   real offset;
   switch (textobj->vert_align){
   case VALIGN_BOTTOM:
@@ -343,12 +343,13 @@ textobj_valign_point(Textobj *textobj, Point* p)
     break;
   }
 }
+
 static void
-textobj_update_data(Textobj *textobj)
+textobj_update_data (Textobj *textobj)
 {
   Point to2;
   DiaObject *obj = &textobj->object;
-  Rectangle tx_bb;
+  DiaRectangle tx_bb;
 
   text_set_position(textobj->text, &obj->position);
   text_calc_boundingbox(textobj->text, &obj->bounding_box);
@@ -413,7 +414,7 @@ textobj_create(Point *startpoint,
 
   textobj = g_malloc0(sizeof(Textobj));
   obj = &textobj->object;
-  obj->enclosing_box = g_new0 (Rectangle, 1);
+  obj->enclosing_box = g_new0 (DiaRectangle, 1);
 
   obj->type = &textobj_type;
 
@@ -454,7 +455,7 @@ static DiaObject *
 textobj_copy(Textobj *textobj)
 {
   Textobj *copied = (Textobj *)object_copy_using_properties(&textobj->object);
-  copied->object.enclosing_box = g_new (Rectangle, 1);
+  copied->object.enclosing_box = g_new (DiaRectangle, 1);
   *copied->object.enclosing_box = *textobj->object.enclosing_box;
   return &copied->object;
 }
@@ -498,7 +499,7 @@ textobj_load(ObjectNode obj_node, int version, DiaContext *ctx)
 
   textobj = g_malloc0(sizeof(Textobj));
   obj = &textobj->object;
-  obj->enclosing_box = g_new0(Rectangle,1);
+  obj->enclosing_box = g_new0 (DiaRectangle,1);
 
   obj->type = &textobj_type;
   obj->ops = &textobj_ops;
diff --git a/objects/standard/zigzagline.c b/objects/standard/zigzagline.c
index 78651910..e0af6e47 100644
--- a/objects/standard/zigzagline.c
+++ b/objects/standard/zigzagline.c
@@ -325,7 +325,7 @@ zigzagline_update_data(Zigzagline *zigzagline)
   orthconn_update_boundingbox(orth);
 
   if (zigzagline->start_arrow.type != ARROW_NONE) {
-    Rectangle bbox;
+    DiaRectangle bbox;
     Point move_arrow, move_line;
     Point to = orth->points[0];
     Point from = orth->points[1];
@@ -339,7 +339,7 @@ zigzagline_update_data(Zigzagline *zigzagline)
     rectangle_union (&obj->bounding_box, &bbox);
   }
   if (zigzagline->end_arrow.type != ARROW_NONE) {
-    Rectangle bbox;
+    DiaRectangle bbox;
     Point move_arrow, move_line;
     int n = orth->numpoints;
     Point to = orth->points[n-1];
diff --git a/plug-ins/cairo/diacairo.c b/plug-ins/cairo/diacairo.c
index 1564b39a..bef5c3a9 100644
--- a/plug-ins/cairo/diacairo.c
+++ b/plug-ins/cairo/diacairo.c
@@ -42,7 +42,6 @@
 #ifdef CAIRO_HAS_WIN32_SURFACE
 #include <cairo-win32.h>
 /* avoid namespace collisions */
-#define Rectangle RectangleWin32
 #endif
 #ifdef CAIRO_HAS_SCRIPT_SURFACE
 #include <cairo-script.h>
diff --git a/plug-ins/cgm/cgm.c b/plug-ins/cgm/cgm.c
index 0a04b411..db2e482a 100644
--- a/plug-ins/cgm/cgm.c
+++ b/plug-ins/cgm/cgm.c
@@ -555,7 +555,7 @@ TextAttrCGM    *tnew, *told;
 
 
 static void
-begin_render(DiaRenderer *self, const Rectangle *update)
+begin_render(DiaRenderer *self, const DiaRectangle *update)
 {
 }
 
@@ -1083,7 +1083,7 @@ export_cgm(DiagramData *data, DiaContext *ctx,
 {
     CgmRenderer *renderer;
     FILE *file;
-    Rectangle *extent;
+    DiaRectangle *extent;
     gint len;
 
     file = g_fopen(filename, "wb");
diff --git a/plug-ins/drs/dia-render-script-renderer.c b/plug-ins/drs/dia-render-script-renderer.c
index 3462dad2..12286530 100644
--- a/plug-ins/drs/dia-render-script-renderer.c
+++ b/plug-ins/drs/dia-render-script-renderer.c
@@ -231,7 +231,7 @@ draw_object(DiaRenderer *self,
 }
 
 static void
-begin_render(DiaRenderer *self, const Rectangle *update)
+begin_render(DiaRenderer *self, const DiaRectangle *update)
 {
   DrsRenderer *renderer = DRS_RENDERER (self);
   xmlNodePtr node;
diff --git a/plug-ins/dxf/dxf-export.c b/plug-ins/dxf/dxf-export.c
index f09f63aa..523789c3 100644
--- a/plug-ins/dxf/dxf-export.c
+++ b/plug-ins/dxf/dxf-export.c
@@ -231,7 +231,7 @@ init_attributes( DxfRenderer *renderer )
 }
 
 static void
-begin_render(DiaRenderer *self, const Rectangle *update)
+begin_render(DiaRenderer *self, const DiaRectangle *update)
 {
 }
 
diff --git a/plug-ins/hpgl/hpgl.c b/plug-ins/hpgl/hpgl.c
index cfdbd591..36f227f1 100644
--- a/plug-ins/hpgl/hpgl.c
+++ b/plug-ins/hpgl/hpgl.c
@@ -171,7 +171,7 @@ hpgl_scale(HpglRenderer *renderer, real val)
 
 /* render functions */
 static void
-begin_render(DiaRenderer *object, const Rectangle *update)
+begin_render(DiaRenderer *object, const DiaRectangle *update)
 {
     HpglRenderer *renderer = HPGL_RENDERER (object);
     int i;
@@ -721,7 +721,7 @@ export_data(DiagramData *data, DiaContext *ctx,
 {
     HpglRenderer *renderer;
     FILE *file;
-    Rectangle *extent;
+    DiaRectangle *extent;
     real width, height;
 
     file = g_fopen(filename, "w"); /* "wb" for binary! */
diff --git a/plug-ins/layout/layout.cpp b/plug-ins/layout/layout.cpp
index e91b2e76..96c2510e 100644
--- a/plug-ins/layout/layout.cpp
+++ b/plug-ins/layout/layout.cpp
@@ -244,19 +244,19 @@ layout_callback (DiagramData *data,
       /* transfer nodes and edges */
       for (list = nodes; list != NULL; list = g_list_next(list)) {
         DiaObject *o = (DiaObject *)list->data;
-        const Rectangle *bbox = dia_object_get_bounding_box (o);
+        const DiaRectangle *bbox = dia_object_get_bounding_box (o);
         g->AddNode (bbox->left, bbox->top, bbox->right, bbox->bottom);
       }
       for (list = edges; list != NULL; list = g_list_next(list)) {
         DiaObject *o = (DiaObject *)list->data;
-       DiaObject *src = o->handles[0]->connected_to->object;
-       // see above: there is no guarantee ...
-       DiaObject *dst = o->handles[1]->connected_to ?
-         o->handles[1]->connected_to->object : o->handles[o->num_handles-1]->connected_to->object;
+        DiaObject *src = o->handles[0]->connected_to->object;
+        // see above: there is no guarantee ...
+        DiaObject *dst = o->handles[1]->connected_to ?
+          o->handles[1]->connected_to->object : o->handles[o->num_handles-1]->connected_to->object;
 
-       if (_obj_get_bends (o, coords))
+        if (_obj_get_bends (o, coords))
           g->AddEdge (g_list_index (nodes, src), g_list_index (nodes, dst), &coords[0], coords.size());
-       else
+        else
           g->AddEdge (g_list_index (nodes, src), g_list_index (nodes, dst), NULL, 0);
       }
       IGraph::eResult res;
diff --git a/plug-ins/metapost/render_metapost.c b/plug-ins/metapost/render_metapost.c
index 7d211446..ef1f70d9 100644
--- a/plug-ins/metapost/render_metapost.c
+++ b/plug-ins/metapost/render_metapost.c
@@ -195,7 +195,7 @@ set_line_color(MetapostRenderer *renderer,Color *color)
 }
 
 static void
-begin_render(DiaRenderer *self, const Rectangle *update)
+begin_render(DiaRenderer *self, const DiaRectangle *update)
 {
 }
 
@@ -1065,7 +1065,7 @@ export_metapost(DiagramData *data, DiaContext *ctx,
     MetapostRenderer *renderer;
     FILE *file;
     time_t time_now;
-    Rectangle *extent;
+    DiaRectangle *extent;
     const char *name;
     gchar d1_buf[DTOSTR_BUF_SIZE];
     gchar d2_buf[DTOSTR_BUF_SIZE];
diff --git a/plug-ins/pdf/pdf-import.cpp b/plug-ins/pdf/pdf-import.cpp
index 9abb8d10..4399f331 100644
--- a/plug-ins/pdf/pdf-import.cpp
+++ b/plug-ins/pdf/pdf-import.cpp
@@ -21,14 +21,12 @@
 #include "config.h"
 
 // Dia includes before poppler to avoid getting the wrong 'object.h'
-#define Rectangle DiaRectangle
 #include "create.h"
 #include "properties.h"
 #include "attributes.h"
 #include "object.h"
 #include "diagramdata.h"
 #include "pattern.h"
-#undef Rectangle
 
 // namespacing poppler to avoid conflict on Object
 //#undef OBJECT_H /* should be fixed in POPPLER I think */
diff --git a/plug-ins/pgf/render_pgf.c b/plug-ins/pgf/render_pgf.c
index 4c6af9ec..0fdbee37 100644
--- a/plug-ins/pgf/render_pgf.c
+++ b/plug-ins/pgf/render_pgf.c
@@ -78,7 +78,7 @@ TODO:
 #define pgf_itostr(buf,i) \
        g_sprintf(buf,"%d",i)
 
-static void begin_render(DiaRenderer *self, const Rectangle *update);
+static void begin_render(DiaRenderer *self, const DiaRectangle *update);
 static void end_render(DiaRenderer *self);
 static void set_linewidth(DiaRenderer *self, real linewidth);
 static void set_linecaps(DiaRenderer *self, LineCaps mode);
@@ -386,7 +386,7 @@ set_fill_color(PgfRenderer *renderer,Color *color)
 }
 
 static void
-begin_render(DiaRenderer *self, const Rectangle *update)
+begin_render(DiaRenderer *self, const DiaRectangle *update)
 {
 }
 
diff --git a/plug-ins/pixbuf/pixbuf.c b/plug-ins/pixbuf/pixbuf.c
index 329dedf0..aebdc7db 100644
--- a/plug-ins/pixbuf/pixbuf.c
+++ b/plug-ins/pixbuf/pixbuf.c
@@ -44,7 +44,7 @@ export_data(DiagramData *data, DiaContext *ctx,
   int width, height;
   GdkPixbuf* pixbuf = NULL;
   GError* error = NULL;
-  Rectangle rect;
+  DiaRectangle rect;
   real zoom = 1.0;
   cairo_t *cctx;
   const char* format = (const char*)user_data;
diff --git a/plug-ins/postscript/diapsrenderer.c b/plug-ins/postscript/diapsrenderer.c
index 6e0ea9d0..1f629ec8 100644
--- a/plug-ins/postscript/diapsrenderer.c
+++ b/plug-ins/postscript/diapsrenderer.c
@@ -75,7 +75,7 @@ lazy_setcolor(DiaPsRenderer *renderer,
 }
 
 static void
-begin_render(DiaRenderer *self, const Rectangle *update)
+begin_render(DiaRenderer *self, const DiaRectangle *update)
 {
   DiaPsRenderer *renderer = DIA_PS_RENDERER(self);
   time_t time_now;
diff --git a/plug-ins/postscript/diapsrenderer.h b/plug-ins/postscript/diapsrenderer.h
index 4af041b3..6ca0c2d5 100644
--- a/plug-ins/postscript/diapsrenderer.h
+++ b/plug-ins/postscript/diapsrenderer.h
@@ -44,7 +44,7 @@ struct _DiaPsRenderer
   gchar *paper;
   gboolean is_portrait;
   double scale;
-  Rectangle extent;
+  DiaRectangle extent;
 
   DiaContext *ctx;
 
diff --git a/plug-ins/postscript/paginate_psprint.c b/plug-ins/postscript/paginate_psprint.c
index dd917f11..23ae3215 100644
--- a/plug-ins/postscript/paginate_psprint.c
+++ b/plug-ins/postscript/paginate_psprint.c
@@ -64,7 +64,7 @@ count_objs(DiaObject *obj, DiaRenderer *renderer, int active_layer, guint *nobjs
 }
 
 static guint
-print_page(DiagramData *data, DiaRenderer *diarend, Rectangle *bounds)
+print_page (DiagramData *data, DiaRenderer *diarend, DiaRectangle *bounds)
 {
   DiaPsRenderer *rend = DIA_PS_RENDERER(diarend);
   guint nobjs = 0;
@@ -145,7 +145,7 @@ void
 paginate_psprint(DiagramData *dia, FILE *file)
 {
   DiaRenderer *rend;
-  Rectangle *extents;
+  DiaRectangle *extents;
   gfloat width, height;
   gfloat x, y, initx, inity;
   guint nobjs = 0;
@@ -177,11 +177,12 @@ paginate_psprint(DiagramData *dia, FILE *file)
     /* ensure we are not producing pages for epsilon */
     if ((extents->bottom - y) < 1e-6)
       break;
+
     for (x = initx; x < extents->right; x += width) {
-      Rectangle page_bounds;
+      DiaRectangle page_bounds;
 
       if ((extents->right - x) < 1e-6)
-       break;
+        break;
 
       page_bounds.left = x;
       page_bounds.right = x + width;
diff --git a/plug-ins/pstricks/render_pstricks.c b/plug-ins/pstricks/render_pstricks.c
index ec6ac838..9f381311 100644
--- a/plug-ins/pstricks/render_pstricks.c
+++ b/plug-ins/pstricks/render_pstricks.c
@@ -73,7 +73,7 @@ enum {
 };
 
 
-static void begin_render(DiaRenderer *self, const Rectangle *update);
+static void begin_render(DiaRenderer *self, const DiaRectangle *update);
 static void end_render(DiaRenderer *self);
 static void set_linewidth(DiaRenderer *self, real linewidth);
 static void set_linecaps(DiaRenderer *self, LineCaps mode);
@@ -307,7 +307,7 @@ set_fill_color(PstricksRenderer *renderer,Color *color)
 }
 
 static void
-begin_render(DiaRenderer *self, const Rectangle *update)
+begin_render(DiaRenderer *self, const DiaRectangle *update)
 {
 }
 
@@ -921,7 +921,7 @@ export_pstricks(DiagramData *data, DiaContext *ctx,
     PstricksRenderer *renderer;
     FILE *file;
     time_t time_now;
-    Rectangle *extent;
+    DiaRectangle *extent;
     const char *name;
     gchar el_buf[DTOSTR_BUF_SIZE];
     gchar er_buf[DTOSTR_BUF_SIZE];
diff --git a/plug-ins/python/pydia-diagram.c b/plug-ins/python/pydia-diagram.c
index 2fbf9a43..66d58f65 100644
--- a/plug-ins/python/pydia-diagram.c
+++ b/plug-ins/python/pydia-diagram.c
@@ -176,14 +176,15 @@ PyDiaDiagram_GetSortedSelectedRemove(PyDiaDiagram *self, PyObject *args)
 static PyObject *
 PyDiaDiagram_AddUpdate(PyDiaDiagram *self, PyObject *args)
 {
-    Rectangle r;
+  DiaRectangle r;
 
-    if (!PyArg_ParseTuple(args, "dddd:Diagram.add_update", &r.top,
-                         &r.left, &r.bottom, &r.right))
-       return NULL;
-    diagram_add_update(self->dia, &r);
-    Py_INCREF(Py_None);
-    return Py_None;
+  if (!PyArg_ParseTuple (args, "dddd:Diagram.add_update", &r.top,
+      &r.left, &r.bottom, &r.right))
+    return NULL;
+
+  diagram_add_update (self->dia, &r);
+  Py_INCREF (Py_None);
+  return Py_None;
 }
 
 static PyObject *
@@ -278,7 +279,7 @@ PyDiaDiagram_FindClosestConnectionPoint(PyDiaDiagram *self, PyObject *args)
     if (!PyArg_ParseTuple(args, "dd|O!:Diagram.find_closest_connectionpoint",
                          &p.x, &p.y, PyDiaObject_Type, &obj))
        return NULL;
-    dist = diagram_find_closest_connectionpoint(self->dia, &cpoint, &p, 
+    dist = diagram_find_closest_connectionpoint(self->dia, &cpoint, &p,
                                                obj ? obj->object : NULL);
     ret = PyTuple_New(2);
     PyTuple_SetItem(ret, 0, PyFloat_FromDouble(dist));
@@ -340,7 +341,7 @@ PyDiaDiagram_Display(PyDiaDiagram *self, PyObject *args)
     return PyDiaDisplay_New(disp);
 }
 
-/* 
+/*
  *  Callback for "removed" signal, used by the connect_after method,
  *  it's a proxy for the python function, creating the values it needs.
  *  Params are those of the "removed" signal on the Diagram object.
@@ -353,13 +354,13 @@ PyDiaDiagram_CallbackRemoved(Diagram *dia,void *user_data)
     /* Check that we got a function */
     PyObject *diaobj,*res,*arg;
     PyObject *func = user_data;
-    
+
     if (!func || !PyCallable_Check (func)) {
         g_warning ("Callback called without valid callback function.");
         return;
     }
-      
-    /* Create a new PyDiaDiagram object. This really should reuse the object that we connected to. 
+
+    /* Create a new PyDiaDiagram object. This really should reuse the object that we connected to.
      * We'll do that later.
      */
     if (dia)
@@ -368,7 +369,7 @@ PyDiaDiagram_CallbackRemoved(Diagram *dia,void *user_data)
         diaobj = Py_None;
         Py_INCREF (diaobj);
     }
-      
+
     Py_INCREF(func);
 
     /* Call the callback. */
@@ -384,7 +385,7 @@ PyDiaDiagram_CallbackRemoved(Diagram *dia,void *user_data)
 }
 
 
-/* 
+/*
  *  Callback for "selection_changed" signal, used by the connect_after method,
  *  it's a proxy for the python function, creating the values it needs.
  *  Params are those of the "selection_changed" signal on the Diagram object.
@@ -398,13 +399,13 @@ PyDiaDiagram_CallbackSelectionChanged(Diagram *dia,int sel,void *user_data)
     /* Check that we got a function */
     PyObject *dgm,*res,*arg;
     PyObject *func = user_data;
-    
+
     if (!func || !PyCallable_Check (func)) {
         g_warning ("Callback called without valid callback function.");
         return;
     }
-      
-    /* Create a new PyDiaDiagram object. This really should reuse the object that we connected to. 
+
+    /* Create a new PyDiaDiagram object. This really should reuse the object that we connected to.
      * We'll do that later.
      */
     if (dia)
@@ -413,8 +414,8 @@ PyDiaDiagram_CallbackSelectionChanged(Diagram *dia,int sel,void *user_data)
         dgm = Py_None;
         Py_INCREF (dgm);
     }
-    
-      
+
+
     Py_INCREF(func);
 
     /* Call the callback. */
@@ -460,12 +461,12 @@ PyDiaDiagram_ConnectAfter(PyDiaDiagram *self, PyObject *args)
         {
             
g_signal_connect_after(DIA_DIAGRAM(self->dia),"removed",G_CALLBACK(PyDiaDiagram_CallbackRemoved), func);
         }
-        
+
         if (strcmp("selection_changed",signal) == 0)
         {
             
g_signal_connect_after(DIA_DIAGRAM(self->dia),"selection_changed",G_CALLBACK(PyDiaDiagram_CallbackSelectionChanged),
 func);
         }
- 
+
         Py_INCREF(Py_None);
         return Py_None;
     }
diff --git a/plug-ins/python/pydia-geometry.c b/plug-ins/python/pydia-geometry.c
index 7c567db3..be73444b 100644
--- a/plug-ins/python/pydia-geometry.c
+++ b/plug-ins/python/pydia-geometry.c
@@ -24,7 +24,7 @@
 
 #include <structmember.h> /* PyMemberDef */
 
-/* Implements wrappers for Point, Rectangle, IntRectangle, BezPoint */
+/* Implements wrappers for Point, DiaRectangle, IntRectangle, BezPoint */
 
 /*
  * New
@@ -32,16 +32,16 @@
 PyObject* PyDiaPoint_New (Point* pt)
 {
   PyDiaPoint *self;
-  
+
   self = PyObject_NEW(PyDiaPoint, &PyDiaPoint_Type);
   if (!self) return NULL;
-  
+
   self->pt = *pt;
 
   return (PyObject *)self;
 }
 
-PyObject* 
+PyObject*
 PyDiaPointTuple_New (Point* pts, int num)
 {
   PyObject* ret;
@@ -57,8 +57,8 @@ PyDiaPointTuple_New (Point* pts, int num)
 }
 
 /* one of the parameters needs to be NULL, the other is created */
-PyObject* 
-PyDiaRectangle_New (Rectangle* r, IntRectangle* ri)
+PyObject*
+PyDiaRectangle_New (DiaRectangle* r, IntRectangle* ri)
 {
   PyDiaRectangle *self;
 
@@ -94,16 +94,16 @@ PyObject* PyDiaRectangle_New_FromPoints (Point* ul, Point* lr)
 PyObject* PyDiaBezPoint_New (BezPoint* bpn)
 {
   PyDiaBezPoint *self;
-  
+
   self = PyObject_NEW(PyDiaBezPoint, &PyDiaBezPoint_Type);
   if (!self) return NULL;
-  
+
   self->bpn = *bpn;
 
   return (PyObject *)self;
 }
 
-PyObject* 
+PyObject*
 PyDiaBezPointTuple_New (BezPoint* pts, int num)
 {
   PyObject* ret;
@@ -121,10 +121,10 @@ PyDiaBezPointTuple_New (BezPoint* pts, int num)
 PyObject* PyDiaArrow_New (Arrow* arrow)
 {
   PyDiaArrow *self;
-  
+
   self = PyObject_NEW(PyDiaArrow, &PyDiaArrow_Type);
   if (!self) return NULL;
-  
+
   self->arrow = *arrow;
 
   return (PyObject *)self;
@@ -137,14 +137,14 @@ PyDiaMatrix_New (DiaMatrix *matrix)
 
   self = PyObject_NEW(PyDiaMatrix, &PyDiaMatrix_Type);
   if (!self) return NULL;
-  
+
   if (matrix)
     self->matrix = *matrix;
   else {
     /* identity matrix */
     self->matrix.xx = self->matrix.yy = 1.0;
     self->matrix.xy = self->matrix.yx = self->matrix.x0 = self->matrix.y0 = 0.0;
-  } 
+  }
 
   return (PyObject *)self;
 }
@@ -170,7 +170,7 @@ PyDiaPoint_Compare(PyDiaPoint *self,
   if (self->pt.x == other->pt.x && self->pt.x == other->pt.x) return 0;
 #define SQR(pt) (pt.x*pt.y)
   if (SQR(self->pt) > SQR(other->pt)) return -1;
-#undef  SQR 
+#undef  SQR
   return 1;
 #endif
 }
@@ -180,7 +180,7 @@ PyDiaRectangle_Compare(PyDiaRectangle *self,
                             PyDiaRectangle *other)
 {
   /* this is not correct */
-  return memcmp (&self->r, &other->r, sizeof(Rectangle));
+  return memcmp (&self->r, &other->r, sizeof(DiaRectangle));
 }
 
 static int
@@ -308,7 +308,7 @@ static PyObject *
 PyDiaBezPoint_Str(PyDiaBezPoint *self)
 {
     PyObject* py_s;
-#if 0 /* FIXME: this is causing bad crashes with unintialized points. 
+#if 0 /* FIXME: this is causing bad crashes with unintialized points.
        * Probably a glib and a Dia problem ... */
     gchar* s = g_strdup_printf ("((%f,%f),(%f,%f),(%f,%f),%s)",
                                 (float)(self->bpn.p1.x), (float)(self->bpn.p1.y),
@@ -332,7 +332,7 @@ PyDiaArrow_Str(PyDiaArrow *self)
 {
     PyObject* py_s;
     gchar* s = g_strdup_printf ("(%f,%f, %d)",
-                                (float)(self->arrow.width), 
+                                (float)(self->arrow.width),
                                 (float)(self->arrow.length),
                                 (int)(self->arrow.type));
     py_s = PyString_FromString(s);
@@ -356,8 +356,8 @@ PyDiaMatrix_Str(PyDiaMatrix *self)
     return py_s;
 }
 
-/* 
- * sequence interface (query only) 
+/*
+ * sequence interface (query only)
  */
 /* Point */
 static gssize
@@ -393,7 +393,7 @@ point_slice(PyObject *o, gssize i, gssize j)
   if (ret) {
     gssize k;
     for (k = i; k <= j && k < 2; k++)
-      PyTuple_SetItem(ret, k - i, point_item(o, k)); 
+      PyTuple_SetItem(ret, k - i, point_item(o, k));
   }
   return ret;
 }
@@ -445,7 +445,7 @@ rect_slice(PyObject* o, gssize i, gssize j)
   if (ret) {
     int k;
     for (k = i; k <= j && k < 4; k++)
-      PyTuple_SetItem(ret, k - i, rect_item(o, k)); 
+      PyTuple_SetItem(ret, k - i, rect_item(o, k));
   }
   return ret;
 }
diff --git a/plug-ins/python/pydia-geometry.h b/plug-ins/python/pydia-geometry.h
index 59c3110a..abc2273b 100644
--- a/plug-ins/python/pydia-geometry.h
+++ b/plug-ins/python/pydia-geometry.h
@@ -9,14 +9,14 @@ typedef struct {
     PyObject_HEAD
     union {
       IntRectangle ri;
-      Rectangle rf;
+      DiaRectangle rf;
     } r;
     gboolean is_int;
 } PyDiaRectangle;
 
 extern PyTypeObject PyDiaRectangle_Type;
 
-PyObject* PyDiaRectangle_New (Rectangle* r, IntRectangle* ri);
+PyObject* PyDiaRectangle_New (DiaRectangle* r, IntRectangle* ri);
 PyObject* PyDiaRectangle_New_FromPoints (Point* ul, Point* lr);
 
 typedef struct {
diff --git a/plug-ins/python/pydia-layer.c b/plug-ins/python/pydia-layer.c
index 025f0f38..ed43eb8f 100644
--- a/plug-ins/python/pydia-layer.c
+++ b/plug-ins/python/pydia-layer.c
@@ -131,7 +131,7 @@ PyDiaLayer_RemoveObject(PyDiaLayer *self, PyObject *args)
 static PyObject *
 PyDiaLayer_FindObjectsInRectangle (PyDiaLayer *self, PyObject *args)
 {
-  Rectangle rect;
+  DiaRectangle rect;
   GList *list, *tmp;
   PyObject *ret;
 
@@ -209,7 +209,7 @@ PyDiaLayer_Render (PyDiaLayer *self, PyObject *args)
 {
   PyObject* renderer;
   DiaRenderer *wrapper;
-  Rectangle *update = NULL;
+  DiaRectangle *update = NULL;
   gboolean active = FALSE; /* could derive from layer->parent_diagram->active_layer
           * but not sure if it's worth the effort. */
 
@@ -291,7 +291,7 @@ PyDiaLayer_GetAttr(PyDiaLayer *self, gchar *attr)
   else if (!strcmp (attr, "name")) {
     return PyString_FromString (dia_layer_get_name (self->layer));
   } else if (!strcmp (attr, "extents")) {
-    Rectangle extents;
+    DiaRectangle extents;
 
     dia_layer_get_extents (self->layer, &extents);
 
diff --git a/plug-ins/python/pydia-render.c b/plug-ins/python/pydia-render.c
index 3c499452..f4efb7e1 100644
--- a/plug-ins/python/pydia-render.c
+++ b/plug-ins/python/pydia-render.c
@@ -108,7 +108,7 @@ GType dia_py_renderer_get_type (void) G_GNUC_CONST;
  * \memberof _DiaPyRenderer
  */
 static void
-begin_render(DiaRenderer *renderer, const Rectangle *update)
+begin_render(DiaRenderer *renderer, const DiaRectangle *update)
 {
   PyObject *func, *res, *arg, *self = PYDIA_RENDERER (renderer);
 
@@ -397,10 +397,10 @@ is_capable_to (DiaRenderer *renderer, RenderCapability cap)
  * \memberof _DiaPyRenderer
  */
 static void
-draw_layer (DiaRenderer *renderer,
-            DiaLayer    *layer,
-            gboolean     active,
-            Rectangle   *update)
+draw_layer (DiaRenderer  *renderer,
+            DiaLayer     *layer,
+            gboolean      active,
+            DiaRectangle *update)
 {
   PyObject *func, *res, *arg, *self = PYDIA_RENDERER (renderer);
 
diff --git a/plug-ins/shape/shape-export.c b/plug-ins/shape/shape-export.c
index ffd64ceb..ad97d129 100644
--- a/plug-ins/shape/shape-export.c
+++ b/plug-ins/shape/shape-export.c
@@ -5,7 +5,7 @@
  * shape-export.c: shape export filter for dia
  * Copyright (C) 2000 Steffen Macke
  *
- * Major refactoring while porting to use DiaSvgRenderer 
+ * Major refactoring while porting to use DiaSvgRenderer
  * Copyright (C) 2002 Hans Breuer
  *
  * This program is free software; you can redistribute it and/or modify
@@ -97,39 +97,39 @@ static DiaSvgRenderer *new_shape_renderer(DiagramData *data, const char *filenam
 /* DiaSvgRenderer members */
 static void end_render(DiaRenderer *self);
 
-static void draw_line(DiaRenderer *self, 
-                     Point *start, Point *end, 
+static void draw_line(DiaRenderer *self,
+                     Point *start, Point *end,
                      Color *line_colour);
-static void 
+static void
 draw_object(DiaRenderer *self,
             DiaObject   *object,
            DiaMatrix   *matrix);
-static void draw_polyline(DiaRenderer *self, 
-                         Point *points, int num_points, 
+static void draw_polyline(DiaRenderer *self,
+                         Point *points, int num_points,
                          Color *line_colour);
-static void draw_polygon(DiaRenderer *self, 
-                        Point *points, int num_points, 
+static void draw_polygon(DiaRenderer *self,
+                        Point *points, int num_points,
                         Color *fill, Color *stroke);
-static void draw_rect(DiaRenderer *self, 
+static void draw_rect(DiaRenderer *self,
                      Point *ul_corner, Point *lr_corner,
                      Color *fill, Color *stroke);
-static void draw_rounded_rect (DiaRenderer *self, 
+static void draw_rounded_rect (DiaRenderer *self,
                               Point *ul_corner, Point *lr_corner,
                               Color *fill, Color *stroke, real rounding);
-static void draw_ellipse(DiaRenderer *self, 
+static void draw_ellipse(DiaRenderer *self,
                         Point *center,
                         real width, real height,
                         Color *fill, Color *stroke);
 
 /* helper functions */
-static void add_connection_point(ShapeRenderer *renderer, 
-                                 Point *point, gboolean design_connection, 
+static void add_connection_point(ShapeRenderer *renderer,
+                                 Point *point, gboolean design_connection,
                                  gboolean main_point);
 static void add_rectangle_connection_points(ShapeRenderer *renderer,
                                             Point *ul_corner, Point *lr_corner, real r);
 static void add_ellipse_connection_points(ShapeRenderer *renderer,
                                           Point *center,
-                                          real width, real height);      
+                                          real width, real height);
 
 /* Moved to reduce confusion of Doxygen */
 GType shape_renderer_get_type (void) G_GNUC_CONST;
@@ -198,7 +198,7 @@ new_shape_renderer(DiagramData *data, const char *filename)
   xml_node_ptr = xmlNewChild(renderer->root, NULL, (const xmlChar *)"aspectratio",NULL);
   xmlSetProp(xml_node_ptr, (const xmlChar *)"type", (const xmlChar *)"fixed");
   renderer->root = xmlNewChild(renderer->root, renderer->svg_name_space, (const xmlChar *)"svg", NULL);
-    
+
   return renderer;
 }
 
@@ -231,7 +231,7 @@ shape_renderer_get_type (void)
                                             "ShapeRenderer",
                                             &object_info, 0);
     }
-  
+
   return object_type;
 }
 
@@ -272,17 +272,17 @@ shape_renderer_class_init (ShapeRendererClass *klass)
  *
  * \memberof _ShapeRenderer
  */
-static void 
+static void
 draw_object(DiaRenderer *self,
             DiaObject   *object,
            DiaMatrix   *matrix)
 {
   Point center;
   ShapeRenderer *renderer = SHAPE_RENDERER(self);
-  gboolean main_point = (0 == strncmp(MAIN_CONNECTION_POINT_SHAPE, 
+  gboolean main_point = (0 == strncmp(MAIN_CONNECTION_POINT_SHAPE,
                       object->type->name, strlen(MAIN_CONNECTION_POINT_SHAPE)));
 
-  if ((0 == strncmp(CONNECTION_POINT_SHAPE, object->type->name, 
+  if ((0 == strncmp(CONNECTION_POINT_SHAPE, object->type->name,
         strlen(CONNECTION_POINT_SHAPE))) || main_point) {
          /* add user defined connection point */
          center.x = (object->bounding_box.left + object->bounding_box.right)/2;
@@ -305,7 +305,7 @@ end_render(DiaRenderer *self)
 
   g_free(renderer->linestyle);
   renderer->linestyle = NULL;
-  
+
   xmlSetDocCompressMode(renderer->doc, 0);
   xmlDiaSaveFile(renderer->filename, renderer->doc);
   g_free(renderer->filename);
@@ -318,14 +318,14 @@ end_render(DiaRenderer *self)
  * \protected \memberof _ShapeRenderer
  */
 static void
-add_connection_point (ShapeRenderer *renderer, 
-                      Point *point, gboolean design_connection, 
-                      gboolean main) 
+add_connection_point (ShapeRenderer *renderer,
+                      Point *point, gboolean design_connection,
+                      gboolean main)
 {
   xmlNodePtr node;
   xmlChar *propx, *propy;
   gchar bufx[G_ASCII_DTOSTR_BUF_SIZE], bufy[G_ASCII_DTOSTR_BUF_SIZE];
-  
+
   /* Use connection points, drop the auto ones */
   if(design_connection && !renderer->design_connection) {
          renderer->design_connection = design_connection;
@@ -355,14 +355,14 @@ add_connection_point (ShapeRenderer *renderer,
       if(propy) xmlFree(propy);
     }
   }
-  
+
   node = xmlNewChild(renderer->connection_root, NULL, (const xmlChar *)"point", NULL);
   xmlSetProp(node, (const xmlChar *)"x", (xmlChar *) bufx);
   xmlSetProp(node, (const xmlChar *)"y", (xmlChar *) bufy);
   if (main) {
          xmlSetProp(node, (const xmlChar *)"main", (xmlChar *)"yes");
   }
-  
+
 }
 
 /*!
@@ -370,8 +370,8 @@ add_connection_point (ShapeRenderer *renderer,
  * \memberof _ShapeRenderer
  */
 static void
-draw_line(DiaRenderer *self, 
-         Point *start, Point *end, 
+draw_line(DiaRenderer *self,
+         Point *start, Point *end,
          Color *line_colour)
 {
   Point center;
@@ -396,8 +396,8 @@ draw_line(DiaRenderer *self,
  * \memberof _ShapeRenderer
  */
 static void
-draw_polyline(DiaRenderer *self, 
-             Point *points, int num_points, 
+draw_polyline(DiaRenderer *self,
+             Point *points, int num_points,
              Color *line_colour)
 {
   DiaSvgRenderer *renderer = DIA_SVG_RENDERER (self);
@@ -409,8 +409,8 @@ draw_polyline(DiaRenderer *self,
   gchar py_buf[G_ASCII_DTOSTR_BUF_SIZE];
 
   node = xmlNewChild(renderer->root, renderer->svg_name_space, (const xmlChar *)"polyline", NULL);
-  
-  xmlSetProp(node, (const xmlChar *)"style", 
+
+  xmlSetProp(node, (const xmlChar *)"style",
              (xmlChar *) DIA_SVG_RENDERER_GET_CLASS(renderer)->get_draw_style(renderer, NULL, line_colour));
 
   str = g_string_new(NULL);
@@ -437,8 +437,8 @@ draw_polyline(DiaRenderer *self,
  * \memberof _ShapeRenderer
  */
 static void
-draw_polygon(DiaRenderer *self, 
-             Point *points, int num_points, 
+draw_polygon(DiaRenderer *self,
+             Point *points, int num_points,
              Color *fill, Color *stroke)
 {
   DiaSvgRenderer *renderer = DIA_SVG_RENDERER (self);
@@ -477,7 +477,7 @@ draw_polygon(DiaRenderer *self,
  */
 static void
 add_rectangle_connection_points (ShapeRenderer *renderer,
-                                 Point *ul_corner, Point *lr_corner, real r) 
+                                 Point *ul_corner, Point *lr_corner, real r)
 {
   Point pos;
   real width, height;
@@ -524,9 +524,9 @@ add_rectangle_connection_points (ShapeRenderer *renderer,
  * \memberof _ShapeRenderer
  */
 static void
-draw_rect (DiaRenderer *self, 
+draw_rect (DiaRenderer *self,
            Point *ul_corner, Point *lr_corner,
-           Color *fill, Color *stroke) 
+           Color *fill, Color *stroke)
 {
   ShapeRenderer *renderer = SHAPE_RENDERER(self);
 
@@ -543,7 +543,7 @@ draw_rect (DiaRenderer *self,
  * \memberof _ShapeRenderer
  */
 static void
-draw_rounded_rect (DiaRenderer *self, 
+draw_rounded_rect (DiaRenderer *self,
                   Point *ul_corner, Point *lr_corner,
                   Color *fill, Color *stroke, real rounding)
 {
@@ -561,19 +561,19 @@ draw_rounded_rect (DiaRenderer *self,
  *
  * \protected \memberof _ShapeRenderer
  */
-static void 
+static void
 add_ellipse_connection_points (ShapeRenderer *renderer,
-                               Point *center, 
-                               real width, real height) 
+                               Point *center,
+                               real width, real height)
 {
   Point connection;
-  
+
   connection.x = center->x;
   connection.y = center->y + height/2;
   add_connection_point(renderer, &connection, FALSE, FALSE);
   connection.y = center->y - height/2;
   add_connection_point(renderer, &connection, FALSE, FALSE);
-  
+
   connection.y = center->y;
   connection.x = center->x - width/2;
   add_connection_point(renderer, &connection, FALSE, FALSE);
@@ -587,7 +587,7 @@ add_ellipse_connection_points (ShapeRenderer *renderer,
  * \memberof _ShapeRenderer
  */
 static void
-draw_ellipse(DiaRenderer *self, 
+draw_ellipse(DiaRenderer *self,
              Point *center,
              real width, real height,
              Color *fill, Color *stroke)
@@ -613,7 +613,7 @@ export_shape(DiagramData *data, DiaContext *ctx,
     gchar *png_filename = NULL;
     DiaExportFilter *exportfilter;
     gfloat old_scaling;
-    Rectangle *ext = &data->extents;
+    DiaRectangle *ext = &data->extents;
     gfloat scaling_x, scaling_y;
 
     /* create the png preview shown in the toolbox */
diff --git a/plug-ins/svg/render_svg.c b/plug-ins/svg/render_svg.c
index b5396ffd..fa18f685 100644
--- a/plug-ins/svg/render_svg.c
+++ b/plug-ins/svg/render_svg.c
@@ -100,10 +100,10 @@ GType svg_renderer_get_type (void) G_GNUC_CONST;
 
 static DiaSvgRenderer *new_svg_renderer(DiagramData *data, const char *filename);
 
-static void draw_layer (DiaRenderer *self,
-                        DiaLayer    *layer,
-                        gboolean     active,
-                        Rectangle   *update);
+static void draw_layer (DiaRenderer  *self,
+                        DiaLayer     *layer,
+                        gboolean      active,
+                        DiaRectangle *update);
 static void draw_object       (DiaRenderer *renderer,
                                DiaObject   *object,
                               DiaMatrix   *matrix);
@@ -161,7 +161,7 @@ svg_renderer_get_type (void)
 }
 
 static void
-begin_render (DiaRenderer *self, const Rectangle *update)
+begin_render (DiaRenderer *self, const DiaRectangle *update)
 {
   SvgRenderer *renderer = SVG_RENDERER (self);
   g_assert (g_queue_is_empty (renderer->parents));
@@ -247,7 +247,7 @@ new_svg_renderer(DiagramData *data, const char *filename)
 {
   DiaSvgRenderer *renderer;
   gchar buf[512];
-  Rectangle *extent;
+  DiaRectangle *extent;
   xmlDtdPtr dtd;
 
   /* we need access to our base object */
@@ -296,10 +296,10 @@ new_svg_renderer(DiagramData *data, const char *filename)
  * \memberof _SvgRenderer
  */
 static void
-draw_layer (DiaRenderer *self,
-            DiaLayer    *layer,
-            gboolean     active,
-            Rectangle   *update)
+draw_layer (DiaRenderer  *self,
+            DiaLayer     *layer,
+            gboolean      active,
+            DiaRectangle *update)
 {
   DiaSvgRenderer *renderer = DIA_SVG_RENDERER (self);
   SvgRenderer *svg_renderer = SVG_RENDERER (self);
diff --git a/plug-ins/vdx/vdx-export.c b/plug-ins/vdx/vdx-export.c
index d126128d..05c6bf5d 100644
--- a/plug-ins/vdx/vdx-export.c
+++ b/plug-ins/vdx/vdx-export.c
@@ -230,7 +230,7 @@ vdx_renderer_finalize (GObject *object)
  */
 
 static void
-begin_render(DiaRenderer *self, const Rectangle *update)
+begin_render(DiaRenderer *self, const DiaRectangle *update)
 {
     VDXRenderer *renderer = VDX_RENDERER(self);
     Color c;
diff --git a/plug-ins/wmf/paginate_gdiprint.cpp b/plug-ins/wmf/paginate_gdiprint.cpp
index e54fbade..50530401 100644
--- a/plug-ins/wmf/paginate_gdiprint.cpp
+++ b/plug-ins/wmf/paginate_gdiprint.cpp
@@ -8,7 +8,7 @@
  *   paginate_gnomeprint.[ch] -- pagination code for the gnome-print backend
  *   Copyright (C) 1999 James Henstridge
  *
- * the rest is : 
+ * the rest is :
  *   Copyright 2001 Hans Breuer <Hans Breuer Org>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -46,7 +46,7 @@ extern "C" {
 #endif
 
 namespace W32 {
-// can't 
+// can't
 // #define WIN32_LEAN_AND_MEAN
 // because we need stuff like PRINTDLG
 #include <windows.h>
@@ -62,11 +62,11 @@ namespace W32 {
 
 static guint
 print_page(DiagramData *data, DiaExportFilter* pExp, W32::HANDLE hDC,
-           Rectangle *bounds, gint xpos, gint ypos, DiaContext *ctx)
+           DiaRectangle *bounds, gint xpos, gint ypos, DiaContext *ctx)
 {
   guint nobjs = 0;
   DiagramData page_data = *data; /* ugliness! */
-  page_data.extents = *bounds; 
+  page_data.extents = *bounds;
 
   /* transform coordinate system */
   if (data->paper.is_portrait) {
@@ -86,7 +86,7 @@ print_page(DiagramData *data, DiaExportFilter* pExp, W32::HANDLE hDC,
 static void
 paginate_gdiprint(DiagramData *data, DiaExportFilter* pExp, W32::HANDLE hDC, DiaContext *ctx)
 {
-  Rectangle *extents;
+  DiaRectangle *extents;
   gdouble width, height;
   gdouble x, y, initx, inity;
   gint xpos, ypos;
@@ -112,7 +112,7 @@ paginate_gdiprint(DiagramData *data, DiaExportFilter* pExp, W32::HANDLE hDC, Dia
     if ((extents->bottom - y) < 1e-6)
       break;
     for (x = initx, xpos = 0; x < extents->right; x += width, xpos++) {
-      Rectangle page_bounds;
+      DiaRectangle page_bounds;
 
       if ((extents->right - x) < 1e-6)
        break;
@@ -176,7 +176,7 @@ diagram_print_gdi(DiagramData *data, const gchar *filename, DiaContext *ctx)
      * initialized despite of the api documentation ?
      */
     g_print ("Paper size %d, length %d width %d scale %d\n",
-             pDevMode->dmPaperSize, 
+             pDevMode->dmPaperSize,
              pDevMode->dmPaperLength, pDevMode->dmPaperWidth, pDevMode->dmScale);
 
     W32::GlobalUnlock (printDlg.hDevMode);
@@ -195,7 +195,7 @@ diagram_print_gdi(DiagramData *data, const gchar *filename, DiaContext *ctx)
        else if (dwError < CFERR_CHOOSEFONTCODES) emsg = "Printer Selection Error";
        else emsg = "Unexpected Error"; /* Other common dialogs errors */
 
-      message_error("Print Dialog failed with error %d\n%s", 
+      message_error("Print Dialog failed with error %d\n%s",
                     dwError, emsg);
     }
     return;
diff --git a/plug-ins/wmf/wmf.cpp b/plug-ins/wmf/wmf.cpp
index c13f724a..59474e47 100644
--- a/plug-ins/wmf/wmf.cpp
+++ b/plug-ins/wmf/wmf.cpp
@@ -277,7 +277,7 @@ my_log(WmfRenderer* renderer, const char* format, ...)
  * renderer interface implementation
  */
 static void
-begin_render(DiaRenderer *self, const Rectangle *)
+begin_render(DiaRenderer *self, const DiaRectangle *)
 {
     WmfRenderer *renderer = WMF_RENDERER (self);
 
@@ -1372,7 +1372,7 @@ export_data(DiagramData *data, DiaContext *ctx,
     WmfRenderer *renderer;
     W32::HDC  file = NULL;
     W32::HDC refDC;
-    Rectangle *extent;
+    DiaRectangle *extent;
     // gint len;
     double scale;
 
diff --git a/plug-ins/wpg/wpg.c b/plug-ins/wpg/wpg.c
index ff54fde0..cded1a07 100644
--- a/plug-ins/wpg/wpg.c
+++ b/plug-ins/wpg/wpg.c
@@ -267,7 +267,7 @@ WriteFillAttr(WpgRenderer *renderer, Color* colour, gboolean bFill)
  * render functions
  */
 static void
-begin_render(DiaRenderer *self, const Rectangle *update)
+begin_render(DiaRenderer *self, const DiaRectangle *update)
 {
   WpgRenderer *renderer = WPG_RENDERER (self);
 #if 0
@@ -1117,7 +1117,7 @@ export_data(DiagramData *data, DiaContext *ctx,
 {
   WpgRenderer *renderer;
   FILE *file;
-  Rectangle *extent;
+  DiaRectangle *extent;
   real width, height;
 
   file = g_fopen(filename, "wb"); /* "wb" for binary! */
diff --git a/plug-ins/xfig/xfig-export.c b/plug-ins/xfig/xfig-export.c
index f93ac572..36098c0c 100644
--- a/plug-ins/xfig/xfig-export.c
+++ b/plug-ins/xfig/xfig-export.c
@@ -111,7 +111,7 @@ static int hasArrow(Arrow *arrow)
   return (!arrow || ARROW_NONE==arrow->type) ? 0 : 1;
 }
 
-static void begin_render(DiaRenderer *self, const Rectangle *update);
+static void begin_render(DiaRenderer *self, const DiaRectangle *update);
 static void end_render(DiaRenderer *renderer);
 static void set_linewidth(DiaRenderer *self, real linewidth);
 static void set_linecaps(DiaRenderer *self, LineCaps mode);
@@ -545,7 +545,7 @@ figArrow(XfigRenderer *renderer, Arrow *arrow, real line_width)
 }
 
 static void
-begin_render(DiaRenderer *self, const Rectangle *update)
+begin_render(DiaRenderer *self, const DiaRectangle *update)
 {
   XfigRenderer *renderer = XFIG_RENDERER(self);
 
diff --git a/tests/test-boundingbox.c b/tests/test-boundingbox.c
index 084f9e8e..e8331c4a 100644
--- a/tests/test-boundingbox.c
+++ b/tests/test-boundingbox.c
@@ -114,9 +114,9 @@ static BezPoint _bz9[] = { /* heart from assorted shapes */
 #define BEZ(x) sizeof(_bz ##x)/sizeof(BezPoint), _bz ##x
 
 static struct _TestBeziers {
-  int       num;
-  BezPoint *pts;
-  Rectangle box;
+  int          num;
+  BezPoint    *pts;
+  DiaRectangle box;
 } _test_beziers[] = {                   /* left, top, right, bottom */
   { BEZ(1), { 0.0-T, 0.5-T, 2.0+T, 2.0+T } },
   { BEZ(2), {-2.0-T, 0.5-T, 0.0+T, 2.0+T } },
@@ -135,9 +135,9 @@ static void
 _check_one_bezier (gconstpointer p)
 {
   const struct _TestBeziers *test = p;
-  Rectangle rect;
+  DiaRectangle rect;
   PolyBBExtras extra = {0, T*.7, T*.7, T*.7, 0 };
-  
+
   polybezier_bbox (test->pts, test->num, &extra, FALSE, &rect);
   g_assert (rectangle_in_rectangle (&test->box, &rect));
 }
@@ -145,7 +145,7 @@ static void
 _add_bezier_tests (void)
 {
   int i, num = sizeof(_test_beziers)/sizeof(struct _TestBeziers);
-  
+
   for (i = 0; i < num; ++i)
     {
       gchar *testpath = g_strdup_printf ("/Dia/BoundingBox/Bezier%d", i+1);
@@ -157,7 +157,6 @@ _add_bezier_tests (void)
 }
 
 #ifdef G_OS_WIN32
-#define Rectangle win32Rectangle
 #include <windows.h>
 #endif
 
@@ -165,7 +164,7 @@ int
 main (int argc, char** argv)
 {
   int ret;
-  
+
 #ifdef G_OS_WIN32
   /* No dialog if it fails, please. */
   SetErrorMode(SetErrorMode(0) | SEM_NOGPFAULTERRORBOX);
diff --git a/tests/test-objects.c b/tests/test-objects.c
index 6ff4ee04..f243ad80 100644
--- a/tests/test-objects.c
+++ b/tests/test-objects.c
@@ -145,7 +145,7 @@ _test_copy (gconstpointer user_data)
   Handle *h1 = NULL, *h2 = NULL;
   Point from = {0, 0};
   DiaObject *oc, *o = type->ops->create (&from, type->default_user_data, &h1, &h2);
-  Rectangle bbox1, bbox2;
+  DiaRectangle bbox1, bbox2;
   Point to;
   int i;
 
@@ -208,7 +208,7 @@ _test_movement (gconstpointer user_data)
   Handle *h1 = NULL, *h2 = NULL;
   Point from = {5, 5};
   DiaObject *o = type->ops->create (&from, type->default_user_data, &h1, &h2);
-  Rectangle bbox1, bbox2;
+  DiaRectangle bbox1, bbox2;
   Point to = {10, 10};
   ObjectChange *change;
   Point pos;
@@ -390,7 +390,7 @@ _test_move_handle (gconstpointer user_data)
   if (h2)
     {
       Point to = h2->pos;
-      Rectangle bb_org = o->bounding_box;
+      DiaRectangle bb_org = o->bounding_box;
       from = to;
       to.x += 1.0; to.y += 1.0;
       if (cp)
@@ -671,8 +671,8 @@ _test_draw (gconstpointer user_data)
   p = create_standard_path_from_object (o);
   if (p) /* play safe, maybe it can not be converted? */
     {
-      const Rectangle *obb = dia_object_get_bounding_box (o);
-      const Rectangle *pbb = dia_object_get_bounding_box (p);
+      const DiaRectangle *obb = dia_object_get_bounding_box (o);
+      const DiaRectangle *pbb = dia_object_get_bounding_box (p);
       real epsilon = 0.2; /* XXX: smaller value needs longer exception list */
 
       /* Bounding boxes of these objects should be close, if not
@@ -805,7 +805,7 @@ _test_distance_from (gconstpointer user_data)
   Handle *h1 = NULL, *h2 = NULL;
   Point from = {0, 0};
   DiaObject *o = type->ops->create (&from, type->default_user_data, &h1, &h2);
-  const Rectangle *ebox;
+  const DiaRectangle *ebox;
   Point center;
   real width, height;
   Point test;
@@ -1054,7 +1054,6 @@ _ot_item (gpointer key,
 }
 
 #ifdef G_OS_WIN32
-#define Rectangle win32Rectangle
 #include <windows.h>
 #endif
 



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