[dia] bezier: style + docs updates



commit 4f8cf00fed1b9352db2382ffdf60e4fe9ddfaf9e
Author: Zander Brown <zbrown gnome org>
Date:   Tue Jul 21 01:36:06 2020 +0100

    bezier: style + docs updates

 lib/bezier_conn.c | 827 ++++++++++++++++++++++++++++++++----------------------
 lib/beziershape.c | 512 +++++++++++++++++++--------------
 2 files changed, 799 insertions(+), 540 deletions(-)
---
diff --git a/lib/bezier_conn.c b/lib/bezier_conn.c
index fd8e35e9..9584e635 100644
--- a/lib/bezier_conn.c
+++ b/lib/bezier_conn.c
@@ -67,33 +67,35 @@ struct CornerChange {
   BezCornerType old_type, new_type;
 };
 
-static ObjectChange *
-bezierconn_create_point_change (BezierConn *bezier,
-                               enum change_type type,
-                               BezPoint *point,
-                               BezCornerType corner_type,
-                               int segment,
-                               Handle *handle1,
-                               ConnectionPoint *connected_to1,
-                               Handle *handle2,
-                               ConnectionPoint *connected_to2,
-                               Handle *handle3,
-                               ConnectionPoint *connected_to3);
-static ObjectChange *
-bezierconn_create_corner_change(BezierConn *bezier,
-                               Handle *handle,
-                               Point *point_left,
-                               Point *point_right,
-                               BezCornerType old_corner_type,
-                               BezCornerType new_corner_type);
-
-/*!
- * \brief Set up a handle for any part of a bezier
- * @param handle A handle to set up.
- * @param id Handle id (HANDLE_BEZMAJOR or HANDLE_RIGHTCTRL or HANDLE_LEFTCTRL)
+
+static ObjectChange *bezierconn_create_point_change  (BezierConn       *bezier,
+                                                      enum change_type  type,
+                                                      BezPoint         *point,
+                                                      BezCornerType     corner_type,
+                                                      int               segment,
+                                                      Handle           *handle1,
+                                                      ConnectionPoint  *connected_to1,
+                                                      Handle           *handle2,
+                                                      ConnectionPoint  *connected_to2,
+                                                      Handle           *handle3,
+                                                      ConnectionPoint  *connected_to3);
+static ObjectChange *bezierconn_create_corner_change (BezierConn       *bezier,
+                                                      Handle           *handle,
+                                                      Point            *point_left,
+                                                      Point            *point_right,
+                                                      BezCornerType     old_corner_type,
+                                                      BezCornerType     new_corner_type);
+
+
+/**
+ * setup_handle:
+ * @handle: A handle to set up.
+ * @id: Handle id (%HANDLE_BEZMAJOR or %HANDLE_RIGHTCTRL or %HANDLE_LEFTCTRL)
+ *
+ * Set up a handle for any part of a bezier
  */
 static void
-setup_handle(Handle *handle, HandleId id)
+setup_handle (Handle *handle, HandleId id)
 {
   handle->id = id;
   handle->type = HANDLE_MINOR_CONTROL;
@@ -102,11 +104,18 @@ setup_handle(Handle *handle, HandleId id)
   handle->connected_to = NULL;
 }
 
-/** Get the number in the array of handles that a given handle has.
- * @param bezier A bezier object with handles set up.
- * @param handle A handle object.
- * @returns The index in bezier->object.handles of the handle object, or -1 if
+
+/**
+ * get_handle_nr:
+ * @bezier: A bezier object with handles set up.
+ * @handle: A handle object.
+ *
+ * Get the number in the array of handles that a given handle has.
+ *
+ * Returns: The index in bezier->object.handles of the handle object, or -1 if
  *          `handle' is not in the array.
+ *
+ * Since: dawn-of-time
  */
 static int
 get_handle_nr (BezierConn *bezier, Handle *handle)
@@ -360,6 +369,8 @@ bezierconn_closest_handle (BezierConn *bezier,
  *
  * Returns: The major (middle) handle of the bezier control that has the
  *          handle closest to point.
+ *
+ * Since: dawn-of-time
  */
 Handle *
 bezierconn_closest_major_handle (BezierConn *bezier, Point *point)
@@ -370,70 +381,93 @@ bezierconn_closest_major_handle (BezierConn *bezier, Point *point)
                                                                  closest))];
 }
 
-/*!
- * \brief Return the distance from a bezier to a point.
- * @param bezier A bezier object.
- * @param point A point to compare with.
- * @param line_width The line width of the bezier line.
- * @return The shortest distance from the point to any part of the bezier.
- * \memberof _BezierConn
+
+/**
+ * bezierconn_distance_from:
+ * @bezier: A bezier object.
+ * @point: A point to compare with.
+ * @line_width: The line width of the bezier line.
+ *
+ * Return the distance from a bezier to a point.
+ *
+ * Returns: The shortest distance from the point to any part of the bezier.
+ *
+ * Since: dawn-of-time
  */
-real
-bezierconn_distance_from (BezierConn *bezier, Point *point, real line_width)
+double
+bezierconn_distance_from (BezierConn *bezier, Point *point, double line_width)
 {
-  return distance_bez_line_point(bezier->bezier.points, bezier->bezier.num_points,
-                                line_width, point);
+  return distance_bez_line_point (bezier->bezier.points,
+                                  bezier->bezier.num_points,
+                                  line_width,
+                                  point);
 }
 
-/** Add a trio of handles to a bezier.
- * @param bezier The bezierconn having handles added.
- * @param pos Where in the list of segments to add the handle
- * @param point The bezier point to add.  This should already be initialized
- *              with sensible positions.
- * @param corner_type What kind of corner this bezpoint should be.
- * @param handle1 The handle that will be put on the bezier line.
- * @param handle2 The handle that will be put before handle1
- * @param handle3 The handle that will be put after handle1
+
+/**
+ * add_handles:
+ * @bezier: The bezierconn having handles added.
+ * @pos: Where in the list of segments to add the handle
+ * @point: The bezier point to add. This should already be initialized
+ *          with sensible positions.
+ * @corner_type: What kind of corner this bezpoint should be.
+ * @handle1: The handle that will be put on the bezier line.
+ * @handle2: The handle that will be put before handle1
+ * @handle3: The handle that will be put after handle1
+ *
+ * Add a trio of handles to a bezier.
+ *
+ * Since: dawn-of-time
  */
 static void
-add_handles (BezierConn *bezier,
-            int pos, BezPoint *point,
-            BezCornerType corner_type,
-            Handle *handle1, Handle *handle2, Handle *handle3)
+add_handles (BezierConn    *bezier,
+             int            pos,
+             BezPoint      *point,
+             BezCornerType  corner_type,
+             Handle        *handle1,
+             Handle        *handle2,
+             Handle        *handle3)
 {
   int i, next;
   DiaObject *obj = &bezier->object;
 
-  g_assert(pos > 0);
+  g_return_if_fail (pos > 0);
 
   bezier->bezier.num_points++;
   next = pos + 1;
-  bezier->bezier.points = g_realloc(bezier->bezier.points, bezier->bezier.num_points*sizeof(BezPoint));
-  bezier->bezier.corner_types = g_realloc(bezier->bezier.corner_types,
-                                  bezier->bezier.num_points * sizeof(BezCornerType));
+  bezier->bezier.points = g_realloc (bezier->bezier.points,
+                                     bezier->bezier.num_points * sizeof (BezPoint));
+  bezier->bezier.corner_types = g_realloc (bezier->bezier.corner_types,
+                                           bezier->bezier.num_points * sizeof (BezCornerType));
 
   for (i = bezier->bezier.num_points - 1; i > pos; i--) {
-    bezier->bezier.points[i] = bezier->bezier.points[i-1];
-    bezier->bezier.corner_types[i] = bezier->bezier.corner_types[i-1];
+    bezier->bezier.points[i] = bezier->bezier.points[i - 1];
+    bezier->bezier.corner_types[i] = bezier->bezier.corner_types[i - 1];
   }
   bezier->bezier.points[pos] = *point;
   bezier->bezier.points[pos].p1 = bezier->bezier.points[next].p1;
   bezier->bezier.points[next].p1 = point->p1;
   bezier->bezier.corner_types[pos] = corner_type;
-  object_add_handle_at(obj, handle1, 3*pos-2);
-  object_add_handle_at(obj, handle2, 3*pos-1);
-  object_add_handle_at(obj, handle3, 3*pos);
+  object_add_handle_at (obj, handle1, 3 * pos - 2);
+  object_add_handle_at (obj, handle2, 3 * pos - 1);
+  object_add_handle_at (obj, handle3, 3 * pos);
 
-  if (pos==bezier->bezier.num_points-1) {
-    obj->handles[obj->num_handles-4]->type = HANDLE_MINOR_CONTROL;
-    obj->handles[obj->num_handles-4]->id = HANDLE_BEZMAJOR;
+  if (pos==bezier->bezier.num_points - 1) {
+    obj->handles[obj->num_handles - 4]->type = HANDLE_MINOR_CONTROL;
+    obj->handles[obj->num_handles - 4]->id = HANDLE_BEZMAJOR;
   }
 }
 
-/** Remove a trio of handles from a bezierconn.
- * @param bezier The bezierconn to remove handles from.
- * @param pos The position in the bezierpoint array to remove handles and
- *            bezpoint at.
+
+/**
+ * remove_handles:
+ * @bezier: The bezierconn to remove handles from.
+ * @pos: The position in the bezierpoint array to remove handles and
+ *       bezpoint at.
+ *
+ * Remove a trio of handles from a bezierconn.
+ *
+ * Since: dawn-of-time
  */
 static void
 remove_handles (BezierConn *bezier, int pos)
@@ -443,47 +477,55 @@ remove_handles (BezierConn *bezier, int pos)
   Handle *old_handle1, *old_handle2, *old_handle3;
   Point tmppoint;
 
-  g_assert(pos > 0);
+  g_return_if_fail (pos > 0);
 
-  obj = (DiaObject *)bezier;
+  obj = (DiaObject *) bezier;
 
-  if (pos==obj->num_handles-1) {
-    obj->handles[obj->num_handles-4]->type = HANDLE_MAJOR_CONTROL;
-    obj->handles[obj->num_handles-4]->id = HANDLE_MOVE_ENDPOINT;
+  if (pos==obj->num_handles - 1) {
+    obj->handles[obj->num_handles - 4]->type = HANDLE_MAJOR_CONTROL;
+    obj->handles[obj->num_handles - 4]->id = HANDLE_MOVE_ENDPOINT;
   }
 
   /* delete the points */
   bezier->bezier.num_points--;
   tmppoint = bezier->bezier.points[pos].p1;
   for (i = pos; i < bezier->bezier.num_points; i++) {
-    bezier->bezier.points[i] = bezier->bezier.points[i+1];
-    bezier->bezier.corner_types[i] = bezier->bezier.corner_types[i+1];
+    bezier->bezier.points[i] = bezier->bezier.points[i + 1];
+    bezier->bezier.corner_types[i] = bezier->bezier.corner_types[i + 1];
   }
   bezier->bezier.points[pos].p1 = tmppoint;
-  bezier->bezier.points = g_realloc(bezier->bezier.points, bezier->bezier.num_points*sizeof(BezPoint));
-  bezier->bezier.corner_types = g_realloc(bezier->bezier.corner_types,
-                               bezier->bezier.num_points * sizeof(BezCornerType));
-
-  old_handle1 = obj->handles[3*pos-2];
-  old_handle2 = obj->handles[3*pos-1];
-  old_handle3 = obj->handles[3*pos];
-  object_remove_handle(&bezier->object, old_handle1);
-  object_remove_handle(&bezier->object, old_handle2);
-  object_remove_handle(&bezier->object, old_handle3);
+  bezier->bezier.points = g_realloc (bezier->bezier.points,
+                                     bezier->bezier.num_points * sizeof (BezPoint));
+  bezier->bezier.corner_types = g_realloc (bezier->bezier.corner_types,
+                                           bezier->bezier.num_points * sizeof (BezCornerType));
+
+  old_handle1 = obj->handles[3 * pos - 2];
+  old_handle2 = obj->handles[3 * pos - 1];
+  old_handle3 = obj->handles[3 * pos];
+  object_remove_handle (&bezier->object, old_handle1);
+  object_remove_handle (&bezier->object, old_handle2);
+  object_remove_handle (&bezier->object, old_handle3);
 }
 
 
-/** Add a point by splitting segment into two, putting the new point at
- * 'point' or, if NULL, in the middle.  This function will attempt to come
+/**
+ * bezierconn_add_segment:
+ * @bezier: The bezierconn to add the segment to.
+ * @segment: Which segment to split.
+ * @point: Where to put the new corner, or %NULL if undetermined.
+ *
+ * Add a point by splitting segment into two, putting the new point at
+ * 'point' or, if NULL, in the middle. This function will attempt to come
  * up with reasonable placements for the control points.
- * @param bezier The bezierconn to add the segment to.
- * @param segment Which segment to split.
- * @param point Where to put the new corner, or NULL if undetermined.
- * @returns An ObjectChange object with undo information for the split.
+ *
+ * Returns: An #ObjectChange object with undo information for the split.
+ *
+ * Since: dawn-of-time
  */
 ObjectChange *
 bezierconn_add_segment (BezierConn *bezier,
-                       int segment, Point *point)
+                        int         segment,
+                        Point      *point)
 {
   BezPoint realpoint;
   BezCornerType corner_type = BEZ_CORNER_SYMMETRIC;
@@ -491,51 +533,69 @@ bezierconn_add_segment (BezierConn *bezier,
   Point startpoint;
   Point other;
 
-  if (segment == 0)
+  if (segment == 0) {
     startpoint = bezier->bezier.points[0].p1;
-  else
+  } else {
     startpoint = bezier->bezier.points[segment].p3;
-  other = bezier->bezier.points[segment+1].p3;
+  }
+  other = bezier->bezier.points[segment + 1].p3;
 
   if (point == NULL) {
-    realpoint.p1.x = (startpoint.x + other.x)/6;
-    realpoint.p1.y = (startpoint.y + other.y)/6;
-    realpoint.p2.x = (startpoint.x + other.x)/3;
-    realpoint.p2.y = (startpoint.y + other.y)/3;
-    realpoint.p3.x = (startpoint.x + other.x)/2;
-    realpoint.p3.y = (startpoint.y + other.y)/2;
+    realpoint.p1.x = (startpoint.x + other.x) / 6;
+    realpoint.p1.y = (startpoint.y + other.y) / 6;
+    realpoint.p2.x = (startpoint.x + other.x) / 3;
+    realpoint.p2.y = (startpoint.y + other.y) / 3;
+    realpoint.p3.x = (startpoint.x + other.x) / 2;
+    realpoint.p3.y = (startpoint.y + other.y) / 2;
   } else {
-    realpoint.p2.x = point->x+(startpoint.x-other.x)/6;
-    realpoint.p2.y = point->y+(startpoint.y-other.y)/6;
+    realpoint.p2.x = point->x + (startpoint.x - other.x) / 6;
+    realpoint.p2.y = point->y + (startpoint.y - other.y) / 6;
 
     realpoint.p3 = *point;
     /* this really goes into the next segment ... */
-    realpoint.p1.x = point->x-(startpoint.x-other.x)/6;
-    realpoint.p1.y = point->y-(startpoint.y-other.y)/6;
+    realpoint.p1.x = point->x - (startpoint.x - other.x) / 6;
+    realpoint.p1.y = point->y - (startpoint.y - other.y) / 6;
   }
   realpoint.type = BEZ_CURVE_TO;
 
-  new_handle1 = g_new0(Handle,1);
-  new_handle2 = g_new0(Handle,1);
-  new_handle3 = g_new0(Handle,1);
-  setup_handle(new_handle1, HANDLE_RIGHTCTRL);
-  setup_handle(new_handle2, HANDLE_LEFTCTRL);
-  setup_handle(new_handle3, HANDLE_BEZMAJOR);
-  add_handles(bezier, segment+1, &realpoint, corner_type,
-             new_handle1, new_handle2, new_handle3);
-  return bezierconn_create_point_change(bezier, TYPE_ADD_POINT,
-                                       &realpoint, corner_type, segment+1,
-                                       new_handle1, NULL,
-                                       new_handle2, NULL,
-                                       new_handle3, NULL);
+  new_handle1 = g_new0 (Handle, 1);
+  new_handle2 = g_new0 (Handle, 1);
+  new_handle3 = g_new0 (Handle, 1);
+  setup_handle (new_handle1, HANDLE_RIGHTCTRL);
+  setup_handle (new_handle2, HANDLE_LEFTCTRL);
+  setup_handle (new_handle3, HANDLE_BEZMAJOR);
+  add_handles (bezier,
+               segment + 1,
+               &realpoint,
+               corner_type,
+               new_handle1,
+               new_handle2,
+               new_handle3);
+
+  return bezierconn_create_point_change (bezier,
+                                         TYPE_ADD_POINT,
+                                         &realpoint,
+                                         corner_type,
+                                         segment + 1,
+                                         new_handle1,
+                                         NULL,
+                                         new_handle2,
+                                         NULL,
+                                         new_handle3,
+                                         NULL);
 }
 
-/*!
- * \brief Remove a segment from a bezier.
- * @param bezier The bezier to remove a segment from.
- * @param pos The index of the segment to remove.
- * @returns Undo information for the segment removal.
- * \memberof _BezierConn
+
+/**
+ * bezierconn_remove_segment:
+ * @bezier The bezier to remove a segment from.
+ * @pos The index of the segment to remove.
+ *
+ * Remove a segment from a bezier.
+ *
+ * Returns: Undo information for the segment removal.
+ *
+ * Since: dawn-of-time
  */
 ObjectChange *
 bezierconn_remove_segment (BezierConn *bezier, int pos)
@@ -546,16 +606,17 @@ bezierconn_remove_segment (BezierConn *bezier, int pos)
   BezCornerType old_ctype;
   int next;
 
-  g_assert(pos > 0);
-  g_assert(bezier->bezier.num_points > 2);
+  g_return_val_if_fail (pos > 0, NULL);
+  g_return_val_if_fail (bezier->bezier.num_points > 2, NULL);
 
-  if (pos == bezier->bezier.num_points-1)
+  if (pos == bezier->bezier.num_points-1) {
     pos--;
+  }
   next = pos+1;
 
-  old_handle1 = bezier->object.handles[3*pos-2];
-  old_handle2 = bezier->object.handles[3*pos-1];
-  old_handle3 = bezier->object.handles[3*pos];
+  old_handle1 = bezier->object.handles[3 * pos - 2];
+  old_handle2 = bezier->object.handles[3 * pos - 1];
+  old_handle3 = bezier->object.handles[3 * pos];
   old_point = bezier->bezier.points[pos];
   /* remember the old control point of following bezpoint */
   old_point.p1 = bezier->bezier.points[next].p1;
@@ -565,19 +626,25 @@ bezierconn_remove_segment (BezierConn *bezier, int pos)
   cpt2 = old_handle2->connected_to;
   cpt3 = old_handle3->connected_to;
 
-  object_unconnect((DiaObject *)bezier, old_handle1);
-  object_unconnect((DiaObject *)bezier, old_handle2);
-  object_unconnect((DiaObject *)bezier, old_handle3);
-
-  remove_handles(bezier, pos);
-
-  bezierconn_update_data(bezier);
-
-  return bezierconn_create_point_change(bezier, TYPE_REMOVE_POINT,
-                                       &old_point, old_ctype, pos,
-                                       old_handle1, cpt1,
-                                       old_handle2, cpt2,
-                                       old_handle3, cpt3);
+  object_unconnect ((DiaObject *) bezier, old_handle1);
+  object_unconnect ((DiaObject *) bezier, old_handle2);
+  object_unconnect ((DiaObject *) bezier, old_handle3);
+
+  remove_handles (bezier, pos);
+
+  bezierconn_update_data (bezier);
+
+  return bezierconn_create_point_change (bezier,
+                                         TYPE_REMOVE_POINT,
+                                         &old_point,
+                                         old_ctype,
+                                         pos,
+                                         old_handle1,
+                                         cpt1,
+                                         old_handle2,
+                                         cpt2,
+                                         old_handle3,
+                                         cpt3);
 }
 
 
@@ -713,7 +780,7 @@ bezierconn_set_corner_type (BezierConn    *bezier,
 
   old_type = bezier->bezier.corner_types[comp_nr];
   old_left = bezier->bezier.points[comp_nr].p2;
-  old_right = bezier->bezier.points[comp_nr+1].p1;
+  old_right = bezier->bezier.points[comp_nr + 1].p1;
 
   bezier->bezier.corner_types[comp_nr] = corner_type;
 
@@ -724,8 +791,14 @@ bezierconn_set_corner_type (BezierConn    *bezier,
                                           old_type, corner_type);
 }
 
-/** Update handle array and handle positions after changes.
- * @param bezier A bezierconn to update.
+
+/**
+ * bezierconn_update_data:
+ * @bezier: A bezierconn to update.
+ *
+ * Update handle array and handle positions after changes.
+ *
+ * Since: dawn-of-time
  */
 void
 bezierconn_update_data (BezierConn *bezier)
@@ -734,17 +807,22 @@ bezierconn_update_data (BezierConn *bezier)
   DiaObject *obj = &bezier->object;
 
   /* handle the case of whole points array update (via set_prop) */
-  if (3*bezier->bezier.num_points-2 != obj->num_handles) {
+  if (3*bezier->bezier.num_points - 2 != obj->num_handles) {
     /* also maintain potential connections */
     ConnectionPoint *cps = bezier->object.handles[0]->connected_to;
-    ConnectionPoint *cpe = bezier->object.handles[obj->num_handles-1]->connected_to;
+    ConnectionPoint *cpe =
+          bezier->object.handles[obj->num_handles - 1]->connected_to;
 
     g_assert(0 == obj->num_connections);
 
-    if (cps)
+    if (cps) {
       object_unconnect (&bezier->object, bezier->object.handles[0]);
-    if (cpe)
-      object_unconnect (&bezier->object, bezier->object.handles[obj->num_handles-1]);
+    }
+
+    if (cpe) {
+      object_unconnect (&bezier->object,
+                        bezier->object.handles[obj->num_handles - 1]);
+    }
 
     /* delete the old ones */
     for (i = 0; i < obj->num_handles; i++) {
@@ -752,44 +830,61 @@ bezierconn_update_data (BezierConn *bezier)
     }
     g_clear_pointer (&obj->handles, g_free);
 
-    obj->num_handles = 3*bezier->bezier.num_points-2;
-    obj->handles = g_new(Handle*, obj->num_handles);
+    obj->num_handles = 3 * bezier->bezier.num_points - 2;
+    obj->handles = g_new (Handle *, obj->num_handles);
+
+    new_handles (bezier, bezier->bezier.num_points);
 
-    new_handles(bezier, bezier->bezier.num_points);
     /* we may assign NULL once more here */
-    if (cps)
-      object_connect(&bezier->object, bezier->object.handles[0], cps);
-    if (cpe)
-      object_connect(&bezier->object, bezier->object.handles[obj->num_handles-1], cpe);
+    if (cps) {
+      object_connect (&bezier->object, bezier->object.handles[0], cps);
+    }
+
+    if (cpe) {
+      object_connect (&bezier->object,
+                      bezier->object.handles[obj->num_handles - 1], cpe);
+    }
   }
 
   /* Update handles: */
   bezier->object.handles[0]->pos = bezier->bezier.points[0].p1;
   for (i = 1; i < bezier->bezier.num_points; i++) {
-    bezier->object.handles[3*i-2]->pos = bezier->bezier.points[i].p1;
-    bezier->object.handles[3*i-1]->pos = bezier->bezier.points[i].p2;
-    bezier->object.handles[3*i]->pos   = bezier->bezier.points[i].p3;
+    bezier->object.handles[3 * i - 2]->pos = bezier->bezier.points[i].p1;
+    bezier->object.handles[3 * i - 1]->pos = bezier->bezier.points[i].p2;
+    bezier->object.handles[3 * i]->pos   = bezier->bezier.points[i].p3;
   }
 }
 
-/** Update the boundingbox of the connection.
- * @param bezier A bezier line to update bounding box for.
+
+/**
+ * bezierconn_update_boundingbox:
+ * @bezier: A bezier line to update bounding box for.
+ *
+ * Update the boundingbox of the connection.
+ *
+ * Since: dawn-of-time
  */
 void
 bezierconn_update_boundingbox (BezierConn *bezier)
 {
-  g_assert(bezier != NULL);
+  g_return_if_fail (bezier != NULL);
 
-  polybezier_bbox(&bezier->bezier.points[0],
-                  bezier->bezier.num_points,
-                  &bezier->extra_spacing, FALSE,
-                  &bezier->object.bounding_box);
+  polybezier_bbox (&bezier->bezier.points[0],
+                   bezier->bezier.num_points,
+                   &bezier->extra_spacing, FALSE,
+                   &bezier->object.bounding_box);
 }
 
-/** Create all handles used by a bezier conn.
- * @param bezier A bezierconn object initialized with room for 3*num_points-2
+
+/**
+ * new_handles:
+ * @bezier: A bezierconn object initialized with room for 3*num_points-2
  * handles.
- * @param num_points The number of points of the bezierconn.
+ * @num_points: The number of points of the bezierconn.
+ *
+ * Create all handles used by a bezier conn.
+ *
+ * Since: dawn-of-time
  */
 void
 new_handles (BezierConn *bezier, int num_points)
@@ -799,33 +894,39 @@ new_handles (BezierConn *bezier, int num_points)
 
   obj = &bezier->object;
 
-  obj->handles[0] = g_new0(Handle,1);
+  obj->handles[0] = g_new0 (Handle, 1);
   obj->handles[0]->connect_type = HANDLE_CONNECTABLE;
   obj->handles[0]->connected_to = NULL;
   obj->handles[0]->type = HANDLE_MAJOR_CONTROL;
   obj->handles[0]->id = HANDLE_MOVE_STARTPOINT;
 
   for (i = 1; i < num_points; i++) {
-    obj->handles[3*i-2] = g_new0(Handle,1);
-    obj->handles[3*i-1] = g_new0(Handle,1);
-    obj->handles[3*i] = g_new0(Handle,1);
+    obj->handles[3 * i - 2] = g_new0 (Handle, 1);
+    obj->handles[3 * i - 1] = g_new0 (Handle, 1);
+    obj->handles[3 * i] = g_new0 (Handle, 1);
 
-    setup_handle(obj->handles[3*i-2], HANDLE_RIGHTCTRL);
-    setup_handle(obj->handles[3*i-1], HANDLE_LEFTCTRL);
+    setup_handle (obj->handles[3 * i - 2], HANDLE_RIGHTCTRL);
+    setup_handle (obj->handles[3 * i - 1], HANDLE_LEFTCTRL);
 
-    obj->handles[3*i]->connect_type = HANDLE_CONNECTABLE;
-    obj->handles[3*i]->connected_to = NULL;
-    obj->handles[3*i]->type = HANDLE_MAJOR_CONTROL;
-    obj->handles[3*i]->id = HANDLE_MOVE_ENDPOINT;
+    obj->handles[3 * i]->connect_type = HANDLE_CONNECTABLE;
+    obj->handles[3 * i]->connected_to = NULL;
+    obj->handles[3 * i]->type = HANDLE_MAJOR_CONTROL;
+    obj->handles[3 * i]->id = HANDLE_MOVE_ENDPOINT;
   }
 }
 
-/** Initialize a bezier object with the given amount of points.
+
+/**
+ * bezierconn_init:
+ * @bezier: A newly allocated bezierconn object.
+ * @num_points: The initial number of points on the curve.
+ *
+ * Initialize a bezier object with the given amount of points.
  * The points array of the bezier object might not be previously
  * initialized with appropriate positions.
  * This will set up handles and make all corners symmetric.
- * @param bezier A newly allocated bezierconn object.
- * @param num_points The initial number of points on the curve.
+ *
+ * Since: dawn-of-time
  */
 void
 bezierconn_init (BezierConn *bezier, int num_points)
@@ -835,12 +936,12 @@ bezierconn_init (BezierConn *bezier, int num_points)
 
   obj = &bezier->object;
 
-  object_init(obj, 3*num_points-2, 0);
+  object_init (obj, 3 * num_points - 2, 0);
 
   bezier->bezier.num_points = num_points;
 
-  bezier->bezier.points = g_new(BezPoint, num_points);
-  bezier->bezier.corner_types = g_new(BezCornerType, num_points);
+  bezier->bezier.points = g_new (BezPoint, num_points);
+  bezier->bezier.corner_types = g_new (BezCornerType, num_points);
   bezier->bezier.points[0].type = BEZ_MOVE_TO;
   bezier->bezier.corner_types[0] = BEZ_CORNER_SYMMETRIC;
   for (i = 1; i < num_points; i++) {
@@ -848,16 +949,22 @@ bezierconn_init (BezierConn *bezier, int num_points)
     bezier->bezier.corner_types[i] = BEZ_CORNER_SYMMETRIC;
   }
 
-  new_handles(bezier, num_points);
+  new_handles (bezier, num_points);
 
   /* The points might not be assigned at this point,
    * so don't try to use them */
   /* bezierconn_update_data(bezier); */
 }
 
-/** Copy a bezierconn objects.  This function in turn invokes object_copy.
- * @param from The object to copy from.
- * @param to The object to copy to.
+
+/**
+ * bezierconn_copy:
+ * @from: The object to copy from.
+ * @to: The object to copy to.
+ *
+ * Copy a bezierconn objects. This function in turn invokes object_copy().
+ *
+ * Since: dawn-of-time
  */
 void
 bezierconn_copy (BezierConn *from, BezierConn *to)
@@ -868,27 +975,35 @@ bezierconn_copy (BezierConn *from, BezierConn *to)
   toobj = &to->object;
   fromobj = &from->object;
 
-  object_copy(fromobj, toobj);
+  object_copy (fromobj, toobj);
 
   beziercommon_copy (&from->bezier, &to->bezier);
 
-  to->object.handles[0] = g_new0(Handle,1);
+  to->object.handles[0] = g_new0 (Handle, 1);
   *to->object.handles[0] = *from->object.handles[0];
   for (i = 1; i < to->object.num_handles - 1; i++) {
-    to->object.handles[i] = g_new0(Handle,1);
-    setup_handle(to->object.handles[i], from->object.handles[i]->id);
+    to->object.handles[i] = g_new0 (Handle, 1);
+    setup_handle (to->object.handles[i], from->object.handles[i]->id);
   }
-  to->object.handles[to->object.num_handles-1] = g_new0(Handle,1);
-  *to->object.handles[to->object.num_handles-1] =
-    *from->object.handles[to->object.num_handles-1];
+  to->object.handles[to->object.num_handles - 1] = g_new0 (Handle, 1);
+  *to->object.handles[to->object.num_handles - 1] =
+    *from->object.handles[to->object.num_handles - 1];
 
-  memcpy(&to->extra_spacing,&from->extra_spacing,sizeof(to->extra_spacing));
-  bezierconn_update_data(to);
+  memcpy (&to->extra_spacing, &from->extra_spacing, sizeof (to->extra_spacing));
+  bezierconn_update_data (to);
 }
 
-/** Destroy a bezierconn object.
- * @param bezier An object to destroy.  This function in turn calls object_destroy
- * and frees structures allocated by this bezierconn, but not the object itself
+
+/**
+ * bezierconn_destroy:
+ * @bezier: An object to destroy.
+ *
+ * Destroy a bezierconn object.
+ *
+ * This function in turn calls object_destroy() and frees structures
+ * allocated by this bezierconn, but not the object itself
+ *
+ * Since: dawn-of-time
  */
 void
 bezierconn_destroy (BezierConn *bezier)
@@ -899,11 +1014,12 @@ bezierconn_destroy (BezierConn *bezier)
   /* Need to store these temporary since object.handles is
      freed by object_destroy() */
   nh = bezier->object.num_handles;
-  temp_handles = g_new(Handle *, nh);
-  for (i = 0; i < nh; i++)
+  temp_handles = g_new (Handle *, nh);
+  for (i = 0; i < nh; i++) {
     temp_handles[i] = bezier->object.handles[i];
+  }
 
-  object_destroy(&bezier->object);
+  object_destroy (&bezier->object);
 
   for (i = 0; i < nh; i++) {
     g_clear_pointer (&temp_handles[i], g_free);
@@ -915,47 +1031,61 @@ bezierconn_destroy (BezierConn *bezier)
 }
 
 
-/** Save the data defined by a bezierconn object to XML.
- * @param bezier The object to save.
- * @param obj_node The XML node to save it into
- * @param ctx The context to transport error information.
+/**
+ * bezierconn_save:
+ * @bezier: The object to save.
+ * @obj_node: The XML node to save it into
+ * @ctx: The context to transport error information.
+ *
+ * Save the data defined by a bezierconn object to XML.
+ *
+ * Since: dawn-of-time
  */
 void
 bezierconn_save (BezierConn *bezier,
-                ObjectNode obj_node,
-                DiaContext *ctx)
+                 ObjectNode  obj_node,
+                 DiaContext *ctx)
 {
   int i;
   AttributeNode attr;
 
-  object_save(&bezier->object, obj_node, ctx);
+  object_save (&bezier->object, obj_node, ctx);
 
-  attr = new_attribute(obj_node, "bez_points");
+  attr = new_attribute (obj_node, "bez_points");
 
-  data_add_point(attr, &bezier->bezier.points[0].p1, ctx);
+  data_add_point (attr, &bezier->bezier.points[0].p1, ctx);
   for (i = 1; i < bezier->bezier.num_points; i++) {
-    if (BEZ_MOVE_TO == bezier->bezier.points[i].type)
-      g_warning("only first BezPoint can be a BEZ_MOVE_TO");
-    data_add_point(attr, &bezier->bezier.points[i].p1, ctx);
-    data_add_point(attr, &bezier->bezier.points[i].p2, ctx);
-    data_add_point(attr, &bezier->bezier.points[i].p3, ctx);
+    if (BEZ_MOVE_TO == bezier->bezier.points[i].type) {
+      g_warning ("only first BezPoint can be a BEZ_MOVE_TO");
+    }
+    data_add_point (attr, &bezier->bezier.points[i].p1, ctx);
+    data_add_point (attr, &bezier->bezier.points[i].p2, ctx);
+    data_add_point (attr, &bezier->bezier.points[i].p3, ctx);
   }
 
-  attr = new_attribute(obj_node, "corner_types");
-  for (i = 0; i < bezier->bezier.num_points; i++)
-    data_add_enum(attr, bezier->bezier.corner_types[i], ctx);
+  attr = new_attribute (obj_node, "corner_types");
+  for (i = 0; i < bezier->bezier.num_points; i++) {
+    data_add_enum (attr, bezier->bezier.corner_types[i], ctx);
+  }
 }
 
-/** Load a bezierconn object from XML.
+
+/**
+ * bezierconn_load:
+ * @bezier: A newly allocated bezierconn object to load into.
+ * @obj_node: The XML node to load from.
+ * @ctx: The context in which this function is called
+ *
+ * Load a bezierconn object from XML.
+ *
  * Does object_init() on the bezierconn object.
- * @param bezier A newly allocated bezierconn object to load into.
- * @param obj_node The XML node to load from.
- * @param ctx The context in which this function is called
+ *
+ * Since: dawn-of-time
  */
 void
 bezierconn_load (BezierConn *bezier,
-                ObjectNode obj_node,
-                DiaContext *ctx)
+                 ObjectNode  obj_node,
+                 DiaContext *ctx)
 {
   int i;
   AttributeNode attr;
@@ -963,76 +1093,85 @@ bezierconn_load (BezierConn *bezier,
 
   DiaObject *obj = &bezier->object;
 
-  object_load(obj, obj_node, ctx);
+  object_load (obj, obj_node, ctx);
 
-  attr = object_find_attribute(obj_node, "bez_points");
+  attr = object_find_attribute (obj_node, "bez_points");
 
-  if (attr != NULL)
-    bezier->bezier.num_points = (attribute_num_data(attr) + 2)/3;
-  else
+  if (attr != NULL) {
+    bezier->bezier.num_points = (attribute_num_data (attr) + 2) / 3;
+  } else {
     bezier->bezier.num_points = 0;
+  }
 
-  object_init(obj, 3 * bezier->bezier.num_points - 2, 0);
+  object_init (obj, 3 * bezier->bezier.num_points - 2, 0);
 
-  data = attribute_first_data(attr);
+  data = attribute_first_data (attr);
   if (bezier->bezier.num_points != 0) {
-    bezier->bezier.points = g_new(BezPoint, bezier->bezier.num_points);
+    bezier->bezier.points = g_new (BezPoint, bezier->bezier.num_points);
     bezier->bezier.points[0].type = BEZ_MOVE_TO;
-    data_point(data, &bezier->bezier.points[0].p1, ctx);
-    data = data_next(data);
+    data_point (data, &bezier->bezier.points[0].p1, ctx);
+    data = data_next (data);
 
     for (i = 1; i < bezier->bezier.num_points; i++) {
       bezier->bezier.points[i].type = BEZ_CURVE_TO;
-      data_point(data, &bezier->bezier.points[i].p1, ctx);
-      data = data_next(data);
-      data_point(data, &bezier->bezier.points[i].p2, ctx);
-      data = data_next(data);
-      data_point(data, &bezier->bezier.points[i].p3, ctx);
-      data = data_next(data);
+      data_point (data, &bezier->bezier.points[i].p1, ctx);
+      data = data_next (data);
+      data_point (data, &bezier->bezier.points[i].p2, ctx);
+      data = data_next (data);
+      data_point (data, &bezier->bezier.points[i].p3, ctx);
+      data = data_next (data);
     }
   }
 
-  bezier->bezier.corner_types = g_new(BezCornerType, bezier->bezier.num_points);
-  attr = object_find_attribute(obj_node, "corner_types");
+  bezier->bezier.corner_types = g_new (BezCornerType, bezier->bezier.num_points);
+  attr = object_find_attribute (obj_node, "corner_types");
   /* if corner_types is missing or corrupt */
-  if (!attr || attribute_num_data(attr) != bezier->bezier.num_points) {
-    for (i = 0; i < bezier->bezier.num_points; i++)
+  if (!attr || attribute_num_data (attr) != bezier->bezier.num_points) {
+    for (i = 0; i < bezier->bezier.num_points; i++) {
       bezier->bezier.corner_types[i] = BEZ_CORNER_SYMMETRIC;
+    }
   } else {
-    data = attribute_first_data(attr);
+    data = attribute_first_data (attr);
     for (i = 0; i < bezier->bezier.num_points; i++) {
-      bezier->bezier.corner_types[i] = data_enum(data, ctx);
-      data = data_next(data);
+      bezier->bezier.corner_types[i] = data_enum (data, ctx);
+      data = data_next (data);
     }
   }
 
-  obj->handles[0] = g_new0(Handle,1);
+  obj->handles[0] = g_new0 (Handle,1);
   obj->handles[0]->connect_type = HANDLE_CONNECTABLE;
   obj->handles[0]->connected_to = NULL;
   obj->handles[0]->type = HANDLE_MAJOR_CONTROL;
   obj->handles[0]->id = HANDLE_MOVE_STARTPOINT;
 
   for (i = 1; i < bezier->bezier.num_points; i++) {
-    obj->handles[3*i-2] = g_new0(Handle,1);
-    setup_handle(obj->handles[3*i-2], HANDLE_RIGHTCTRL);
-    obj->handles[3*i-1] = g_new0(Handle,1);
-    setup_handle(obj->handles[3*i-1], HANDLE_LEFTCTRL);
-    obj->handles[3*i]   = g_new0(Handle,1);
-    setup_handle(obj->handles[3*i],   HANDLE_BEZMAJOR);
+    obj->handles[3 * i - 2] = g_new0 (Handle, 1);
+    setup_handle (obj->handles[3 * i - 2], HANDLE_RIGHTCTRL);
+    obj->handles[3 * i - 1] = g_new0 (Handle, 1);
+    setup_handle (obj->handles[3 * i - 1], HANDLE_LEFTCTRL);
+    obj->handles[3 * i]     = g_new0 (Handle, 1);
+    setup_handle (obj->handles[3 * i],   HANDLE_BEZMAJOR);
   }
 
-  obj->handles[obj->num_handles-1]->connect_type = HANDLE_CONNECTABLE;
-  obj->handles[obj->num_handles-1]->connected_to = NULL;
-  obj->handles[obj->num_handles-1]->type = HANDLE_MAJOR_CONTROL;
-  obj->handles[obj->num_handles-1]->id = HANDLE_MOVE_ENDPOINT;
+  obj->handles[obj->num_handles - 1]->connect_type = HANDLE_CONNECTABLE;
+  obj->handles[obj->num_handles - 1]->connected_to = NULL;
+  obj->handles[obj->num_handles - 1]->type = HANDLE_MAJOR_CONTROL;
+  obj->handles[obj->num_handles - 1]->id = HANDLE_MOVE_ENDPOINT;
 
-  bezierconn_update_data(bezier);
+  bezierconn_update_data (bezier);
 }
 
-/*** Undo support ***/
 
-/** Free undo information about adding or removing points.
- * @param change The undo information to free.
+/* Undo support */
+
+
+/**
+ * bezierconn_point_change_free:
+ * @change: The undo information to free.
+ *
+ * Free undo information about adding or removing points.
+ *
+ * Since: dawn-of-time
  */
 static void
 bezierconn_point_change_free (struct PointChange *change)
@@ -1052,6 +1191,8 @@ bezierconn_point_change_free (struct PointChange *change)
  * @obj: The object (must be a BezierConn) to apply the change to.
  *
  * Apply a point addition/removal.
+ *
+ * Since: dawn-of-time
  */
 static void
 bezierconn_point_change_apply (struct PointChange *change, DiaObject *obj)
@@ -1081,6 +1222,8 @@ bezierconn_point_change_apply (struct PointChange *change, DiaObject *obj)
  * @obj: The object (must be a BezierConn) to revert the change of.
  *
  * Revert (unapply) a point addition/removal.
+ *
+ * Since: dawn-of-time
  */
 static void
 bezierconn_point_change_revert (struct PointChange *change, DiaObject *obj)
@@ -1114,33 +1257,42 @@ bezierconn_point_change_revert (struct PointChange *change, DiaObject *obj)
 }
 
 
-/** Create undo information about a point being added or removed.
- * @param bezier The object that the change applies to (ignored)
- * @param type The type of change (either TYPE_ADD_POINT or TYPE_REMOVE_POINT)
- * @param point The point being added or removed.
- * @param corner_type Which type of corner is at the point.
- * @param pos The position of the point.
- * @param handle1 The first (central) handle.
- * @param connected_to1 What the first handle is connected to.
- * @param handle2 The second (left-hand) handle.
- * @param connected_to2 What the second handle is connected to.
- * @param handle3 The third (right-hand) handle.
- * @param connected_to3 What the third handle is connected to.
- * @return Newly created undo information.
+/**
+ * bezierconn_create_point_change:
+ * @bezier: The object that the change applies to (ignored)
+ * @type: The type of change (either TYPE_ADD_POINT or TYPE_REMOVE_POINT)
+ * @point: The point being added or removed.
+ * @corner_type: Which type of corner is at the point.
+ * @pos: The position of the point.
+ * @handle1: The first (central) handle.
+ * @connected_to1: What the first handle is connected to.
+ * @handle2: The second (left-hand) handle.
+ * @connected_to2: What the second handle is connected to.
+ * @handle3: The third (right-hand) handle.
+ * @connected_to3: What the third handle is connected to.
+ *
+ * Create undo information about a point being added or removed.
+ *
+ * Returns: Newly created undo information.
+ *
+ * Since: dawn-of-time
  */
 static ObjectChange *
-bezierconn_create_point_change(BezierConn *bezier,
-                              enum change_type type,
-                              BezPoint *point,
-                              BezCornerType corner_type,
-                              int pos,
-                              Handle *handle1, ConnectionPoint *connected_to1,
-                              Handle *handle2, ConnectionPoint *connected_to2,
-                              Handle *handle3, ConnectionPoint *connected_to3)
+bezierconn_create_point_change (BezierConn       *bezier,
+                                enum change_type  type,
+                                BezPoint         *point,
+                                BezCornerType     corner_type,
+                                int               pos,
+                                Handle           *handle1,
+                                ConnectionPoint  *connected_to1,
+                                Handle           *handle2,
+                                ConnectionPoint  *connected_to2,
+                                Handle           *handle3,
+                                ConnectionPoint  *connected_to3)
 {
   struct PointChange *change;
 
-  change = g_new(struct PointChange, 1);
+  change = g_new (struct PointChange, 1);
 
   change->obj_change.apply = (ObjectChangeApplyFunc) bezierconn_point_change_apply;
   change->obj_change.revert = (ObjectChangeRevertFunc) bezierconn_point_change_revert;
@@ -1161,75 +1313,94 @@ bezierconn_create_point_change(BezierConn *bezier,
   return (ObjectChange *)change;
 }
 
-/** Apply a change of corner type.  This may change the position of the
+
+/**
+ * bezierconn_corner_change_apply:
+ * @change: The undo information to apply.
+ * @obj: The object to apply the undo information too.
+ *
+ * Apply a change of corner type. This may change the position of the
  * control handles by calling bezierconn_straighten_corner.
- * @param change The undo information to apply.
- * @param obj The object to apply the undo information too.
+ *
+ * Since: dawn-of-time
  */
 static void
-bezierconn_corner_change_apply(struct CornerChange *change,
-                              DiaObject *obj)
+bezierconn_corner_change_apply (struct CornerChange *change,
+                                DiaObject           *obj)
 {
-  BezierConn *bezier = (BezierConn *)obj;
-  int handle_nr = get_handle_nr(bezier, change->handle);
-  int comp_nr = get_major_nr(handle_nr);
+  BezierConn *bezier = (BezierConn *) obj;
+  int handle_nr = get_handle_nr (bezier, change->handle);
+  int comp_nr = get_major_nr (handle_nr);
 
-  bezierconn_straighten_corner(bezier, comp_nr);
+  bezierconn_straighten_corner (bezier, comp_nr);
 
   bezier->bezier.corner_types[comp_nr] = change->new_type;
 
   change->applied = 1;
 }
 
-/** Revert (unapply) a change of corner type.  This may move the position
+
+/**
+ * bezierconn_corner_change_revert:
+ * @change: Undo information to apply.
+ * @obj: The bezierconn object to apply the change to.
+ *
+ * Revert (unapply) a change of corner type. This may move the position
  * of the control handles to what they were before applying.
- * @param change Undo information to apply.
- * @param obj The bezierconn object to apply the change to.
+ *
+ * Since: dawn-of-time
  */
 static void
-bezierconn_corner_change_revert(struct CornerChange *change,
-                               DiaObject *obj)
+bezierconn_corner_change_revert (struct CornerChange *change,
+                                 DiaObject           *obj)
 {
-  BezierConn *bezier = (BezierConn *)obj;
-  int handle_nr = get_handle_nr(bezier, change->handle);
-  int comp_nr = get_major_nr(handle_nr);
+  BezierConn *bezier = (BezierConn *) obj;
+  int handle_nr = get_handle_nr (bezier, change->handle);
+  int comp_nr = get_major_nr (handle_nr);
 
   bezier->bezier.points[comp_nr].p2 = change->point_left;
-  bezier->bezier.points[comp_nr+1].p1 = change->point_right;
+  bezier->bezier.points[comp_nr + 1].p1 = change->point_right;
   bezier->bezier.corner_types[comp_nr] = change->old_type;
 
   change->applied = 0;
 }
 
-/** Create new undo information about a changing the type of a corner.
- * Note that the created ObjectChange object has nothing in it that needs
+
+/**
+ * bezierconn_create_corner_change:
+ * @bezier: The bezier object this applies to.
+ * @handle: The handle of the corner being changed.
+ * @point_left: The position of the left control handle.
+ * @point_right: The position of the right control handle.
+ * @old_corner_type: The corner type before applying.
+ * @new_corner_type: The corner type being changed to.
+ *
+ * Create new undo information about a changing the type of a corner.
+ * Note that the created #ObjectChange object has nothing in it that needs
  * freeing.
- * @param bezier The bezier object this applies to.
- * @param handle The handle of the corner being changed.
- * @param point_left The position of the left control handle.
- * @param point_right The position of the right control handle.
- * @param old_corner_type The corner type before applying.
- * @param new_corner_type The corner type being changed to.
- * @returns Newly allocated undo information.
+ *
+ * Returns: Newly allocated undo information.
+ *
+ * Since: dawn-of-time
  */
 static ObjectChange *
-bezierconn_create_corner_change (BezierConn *bezier,
-                                Handle *handle,
-                                Point *point_left,
-                                Point *point_right,
-                                BezCornerType old_corner_type,
-                                BezCornerType new_corner_type)
+bezierconn_create_corner_change (BezierConn    *bezier,
+                                 Handle        *handle,
+                                 Point         *point_left,
+                                 Point         *point_right,
+                                 BezCornerType  old_corner_type,
+                                 BezCornerType  new_corner_type)
 {
   struct CornerChange *change;
 
-  change = g_new(struct CornerChange, 1);
+  change = g_new (struct CornerChange, 1);
 
   change->obj_change.apply =
-       (ObjectChangeApplyFunc) bezierconn_corner_change_apply;
+                (ObjectChangeApplyFunc) bezierconn_corner_change_apply;
   change->obj_change.revert =
-       (ObjectChangeRevertFunc) bezierconn_corner_change_revert;
+                (ObjectChangeRevertFunc) bezierconn_corner_change_revert;
   change->obj_change.free =
-       (ObjectChangeFreeFunc) NULL;
+                (ObjectChangeFreeFunc) NULL;
 
   change->old_type = old_corner_type;
   change->new_type = new_corner_type;
@@ -1239,5 +1410,5 @@ bezierconn_create_corner_change (BezierConn *bezier,
   change->point_left = *point_left;
   change->point_right = *point_right;
 
-  return (ObjectChange *)change;
+  return (ObjectChange *) change;
 }
diff --git a/lib/beziershape.c b/lib/beziershape.c
index 066ef5b2..5ca9872b 100644
--- a/lib/beziershape.c
+++ b/lib/beziershape.c
@@ -70,33 +70,38 @@ struct CornerChange {
   BezCornerType old_type, new_type;
 };
 
-static ObjectChange *
-beziershape_create_point_change(BezierShape *bezier,
-                               enum change_type type,
-                               BezPoint *point,
-                               BezCornerType corner_type,
-                               int segment,
-                               Handle *handle1,
-                               Handle *handle2,
-                               Handle *handle3,
-                               ConnectionPoint *cp1,
-                               ConnectionPoint *cp2);
-static ObjectChange *
-beziershape_create_corner_change(BezierShape *bezier,
-                                Handle *handle,
-                                Point *point_left,
-                                Point *point_right,
-                                BezCornerType old_corner_type,
-                                BezCornerType new_corner_type);
-
-static void new_handles_and_connections(BezierShape *bezier, int num_points);
-
-/** Set up a handle for any part of a bezier
- * @param handle A handle to set up.
- * @param id Handle id (HANDLE_BEZMAJOR or HANDLE_RIGHTCTRL or HANDLE_LEFTCTRL)
+
+static ObjectChange *beziershape_create_point_change (BezierShape      *bezier,
+                                                      enum change_type  type,
+                                                      BezPoint         *point,
+                                                      BezCornerType     corner_type,
+                                                      int               segment,
+                                                      Handle           *handle1,
+                                                      Handle           *handle2,
+                                                      Handle           *handle3,
+                                                      ConnectionPoint  *cp1,
+                                                      ConnectionPoint  *cp2);
+static ObjectChange *beziershape_create_corner_change (BezierShape     *bezier,
+                                                       Handle          *handle,
+                                                       Point           *point_left,
+                                                       Point           *point_right,
+                                                       BezCornerType    old_corner_type,
+                                                       BezCornerType    new_corner_type);
+static void new_handles_and_connections               (BezierShape     *bezier,
+                                                       int              num_points);
+
+
+/**
+ * setup_handle:
+ * @handle: A handle to set up.
+ * @id: Handle id (%HANDLE_BEZMAJOR or %HANDLE_RIGHTCTRL or %HANDLE_LEFTCTRL)
+ *
+ * Set up a handle for any part of a bezier
+ *
+ * Since: dawn-of-time
  */
 static void
-setup_handle(Handle *handle, HandleId id)
+setup_handle (Handle *handle, HandleId id)
 {
   handle->id = id;
   handle->type =
@@ -107,11 +112,16 @@ setup_handle(Handle *handle, HandleId id)
   handle->connected_to = NULL;
 }
 
-/** Get the number in the array of handles that a given handle has.
- * @param bezier A bezier object with handles set up.
- * @param handle A handle object.
- * @returns The index in bezier->object.handles of the handle object, or -1 if
- *          `handle' is not in the array.
+
+/**
+ * get_handle_nr:
+ * @bezier: A bezier object with handles set up.
+ * @handle: A handle object.
+ *
+ * Get the number in the array of handles that a given handle has.
+ *
+ * Returnss: The index in bezier->object.handles of the handle object, or -1
+ *           if `handle' is not in the array.
  */
 static int
 get_handle_nr (BezierShape *bezier, Handle *handle)
@@ -190,7 +200,7 @@ beziershape_move_handle (BezierShape      *bezier,
           bezier->bezier.points[next_nr].p1 = pt;
           break;
         case BEZ_CORNER_SMOOTH: {
-            real len;
+            double len;
 
             pt = bezier->bezier.points[next_nr].p1;
             point_sub (&pt, &bezier->bezier.points[comp_nr].p3);
@@ -225,7 +235,7 @@ beziershape_move_handle (BezierShape      *bezier,
           bezier->bezier.points[prev_nr].p2 = pt;
           break;
         case BEZ_CORNER_SMOOTH: {
-            real len;
+            double len;
 
             pt = bezier->bezier.points[prev_nr].p2;
             point_sub (&pt, &bezier->bezier.points[prev_nr].p3);
@@ -314,11 +324,11 @@ beziershape_closest_handle (BezierShape *bezier,
                            Point *point)
 {
   int i, hn;
-  real dist = G_MAXDOUBLE;
+  double dist = G_MAXDOUBLE;
   Handle *closest = NULL;
 
   for (i = 1, hn = 0; i < bezier->bezier.num_points; i++, hn++) {
-    real new_dist;
+    double new_dist;
 
     new_dist = distance_point_point(point, &bezier->bezier.points[i].p1);
     if (new_dist < dist) {
@@ -354,21 +364,31 @@ beziershape_closest_major_handle (BezierShape *bezier, Point *point)
   return bezier->object.handles[3*pos - 1];
 }
 
-/*!
- * \brief Return the distance from a bezier to a point.
- * @param bezier A bezier object.
- * @param point A point to compare with.
- * @param line_width The line width of the bezier line.
- * @return The shortest distance from the point to any part of the bezier.
- * \memberof _BezierShape
+
+/**
+ * beziershape_distance_from:
+ * @bezier: A bezier object.
+ * @point: A point to compare with.
+ * @line_width: The line width of the bezier line.
+ *
+ * Return the distance from a bezier to a point.
+ *
+ * Returns: The shortest distance from the point to any part of the bezier.
+ *
+ * Since: dawn-of-time
  */
-real
-beziershape_distance_from (BezierShape *bezier, Point *point, real line_width)
+double
+beziershape_distance_from (BezierShape *bezier,
+                           Point       *point,
+                           double       line_width)
 {
-  return distance_bez_shape_point(bezier->bezier.points, bezier->bezier.num_points,
-                                 line_width, point);
+  return distance_bez_shape_point (bezier->bezier.points,
+                                   bezier->bezier.num_points,
+                                   line_width,
+                                   point);
 }
 
+
 static void
 add_handles (BezierShape *bezier,
             int pos, BezPoint *point,
@@ -612,7 +632,7 @@ beziershape_straighten_corner (BezierShape *bezier, int comp_nr)
       break;
     case BEZ_CORNER_SMOOTH: {
         Point pt1, pt2;
-        real len1, len2;
+        double len1, len2;
         pt1 = bezier->bezier.points[comp_nr].p3;
         point_sub (&pt1, &bezier->bezier.points[comp_nr].p2);
         pt2 = bezier->bezier.points[comp_nr].p3;
@@ -831,6 +851,7 @@ beziershape_update_boundingbox (BezierShape *bezier)
                   &bezier->object.bounding_box);
 }
 
+
 static void
 new_handles_and_connections (BezierShape *bezier, int num_points)
 {
@@ -840,45 +861,51 @@ new_handles_and_connections (BezierShape *bezier, int num_points)
   obj = &bezier->object;
 
   for (i = 0; i < num_points-1; i++) {
-    obj->handles[3*i] = g_new0(Handle,1);
-    obj->handles[3*i+1] = g_new0(Handle,1);
-    obj->handles[3*i+2] = g_new0(Handle,1);
-
-    obj->handles[3*i]->connect_type = HANDLE_NONCONNECTABLE;
-    obj->handles[3*i]->connected_to = NULL;
-    obj->handles[3*i]->type = HANDLE_MINOR_CONTROL;
-    obj->handles[3*i]->id = HANDLE_RIGHTCTRL;
-
-    obj->handles[3*i+1]->connect_type = HANDLE_NONCONNECTABLE;
-    obj->handles[3*i+1]->connected_to = NULL;
-    obj->handles[3*i+1]->type = HANDLE_MINOR_CONTROL;
-    obj->handles[3*i+1]->id = HANDLE_LEFTCTRL;
-
-    obj->handles[3*i+2]->connect_type = HANDLE_NONCONNECTABLE;
-    obj->handles[3*i+2]->connected_to = NULL;
-    obj->handles[3*i+2]->type = HANDLE_MAJOR_CONTROL;
-    obj->handles[3*i+2]->id = HANDLE_BEZMAJOR;
-
-    obj->connections[2*i] = g_new0(ConnectionPoint, 1);
-    obj->connections[2*i+1] = g_new0(ConnectionPoint, 1);
-    obj->connections[2*i]->object = obj;
-    obj->connections[2*i+1]->object = obj;
-    obj->connections[2*i]->flags = 0;
-    obj->connections[2*i+1]->flags = 0;
+    obj->handles[3 * i] = g_new0 (Handle, 1);
+    obj->handles[3 * i + 1] = g_new0 (Handle, 1);
+    obj->handles[3 * i + 2] = g_new0 (Handle, 1);
+
+    obj->handles[3 * i]->connect_type = HANDLE_NONCONNECTABLE;
+    obj->handles[3 * i]->connected_to = NULL;
+    obj->handles[3 * i]->type = HANDLE_MINOR_CONTROL;
+    obj->handles[3 * i]->id = HANDLE_RIGHTCTRL;
+
+    obj->handles[3 * i + 1]->connect_type = HANDLE_NONCONNECTABLE;
+    obj->handles[3 * i + 1]->connected_to = NULL;
+    obj->handles[3 * i + 1]->type = HANDLE_MINOR_CONTROL;
+    obj->handles[3 * i + 1]->id = HANDLE_LEFTCTRL;
+
+    obj->handles[3 * i + 2]->connect_type = HANDLE_NONCONNECTABLE;
+    obj->handles[3 * i + 2]->connected_to = NULL;
+    obj->handles[3 * i + 2]->type = HANDLE_MAJOR_CONTROL;
+    obj->handles[3 * i + 2]->id = HANDLE_BEZMAJOR;
+
+    obj->connections[2 * i] = g_new0 (ConnectionPoint, 1);
+    obj->connections[2 * i + 1] = g_new0 (ConnectionPoint, 1);
+    obj->connections[2 * i]->object = obj;
+    obj->connections[2 * i + 1]->object = obj;
+    obj->connections[2 * i]->flags = 0;
+    obj->connections[2 * i + 1]->flags = 0;
   }
 
   /** Main point */
-  obj->connections[obj->num_connections-1] = g_new0(ConnectionPoint, 1);
-  obj->connections[obj->num_connections-1]->object = obj;
-  obj->connections[obj->num_connections-1]->flags = CP_FLAGS_MAIN;
+  obj->connections[obj->num_connections - 1] = g_new0 (ConnectionPoint, 1);
+  obj->connections[obj->num_connections - 1]->object = obj;
+  obj->connections[obj->num_connections - 1]->flags = CP_FLAGS_MAIN;
 }
 
-/** Initialize a bezier object with the given amount of points.
+
+/**
+ * beziershape_init:
+ * @bezier: A newly allocated beziershape object.
+ * @num_points: The initial number of points on the curve.
+ *
+ * Initialize a bezier object with the given amount of points.
  * The points array of the bezier object might not be previously
  * initialized with appropriate positions.
  * This will set up handles and make all corners symmetric.
- * @param bezier A newly allocated beziershape object.
- * @param num_points The initial number of points on the curve.
+ *
+ * Since: dawn-of-time
  */
 void
 beziershape_init (BezierShape *bezier, int num_points)
@@ -888,12 +915,12 @@ beziershape_init (BezierShape *bezier, int num_points)
 
   obj = &bezier->object;
 
-  object_init(obj, 3*(num_points-1), 2*(num_points-1) + 1);
+  object_init (obj, 3 * (num_points - 1), 2 * (num_points - 1) + 1);
 
   bezier->bezier.num_points = num_points;
 
-  bezier->bezier.points = g_new(BezPoint, num_points);
-  bezier->bezier.corner_types = g_new(BezCornerType, num_points);
+  bezier->bezier.points = g_new (BezPoint, num_points);
+  bezier->bezier.corner_types = g_new (BezCornerType, num_points);
   bezier->bezier.points[0].type = BEZ_MOVE_TO;
   bezier->bezier.corner_types[0] = BEZ_CORNER_SYMMETRIC;
   for (i = 1; i < num_points; i++) {
@@ -901,16 +928,22 @@ beziershape_init (BezierShape *bezier, int num_points)
     bezier->bezier.corner_types[i] = BEZ_CORNER_SYMMETRIC;
   }
 
-  new_handles_and_connections(bezier, num_points);
+  new_handles_and_connections (bezier, num_points);
 
   /* The points might not be assigned at this point,
    * so don't try to use them */
   /*  beziershape_update_data(bezier);*/
 }
 
-/** Copy a beziershape objects.  This function in turn invokes object_copy.
- * @param from The object to copy from.
- * @param to The object to copy to.
+
+/**
+ * beziershape_copy:
+ * @from: The object to copy from.
+ * @to: The object to copy to.
+ *
+ * Copy a beziershape objects. This function in turn invokes object_copy().
+ *
+ * Since: dawn-of-time
  */
 void
 beziershape_copy (BezierShape *from, BezierShape *to)
@@ -921,24 +954,28 @@ beziershape_copy (BezierShape *from, BezierShape *to)
   toobj = &to->object;
   fromobj = &from->object;
 
-  object_copy(fromobj, toobj);
+  object_copy (fromobj, toobj);
 
   beziercommon_copy (&from->bezier, &to->bezier);
 
   for (i = 0; i < toobj->num_handles; i++) {
-    toobj->handles[i] = g_new0(Handle,1);
-    setup_handle(toobj->handles[i], fromobj->handles[i]->id);
+    toobj->handles[i] = g_new0 (Handle, 1);
+    setup_handle (toobj->handles[i], fromobj->handles[i]->id);
   }
+
   for (i = 0; i < toobj->num_connections; i++) {
-    toobj->connections[i] = g_new0(ConnectionPoint, 1);
+    toobj->connections[i] = g_new0 (ConnectionPoint, 1);
     toobj->connections[i]->object = &to->object;
     toobj->connections[i]->flags = fromobj->connections[i]->flags;
   }
 
-  memcpy(&to->extra_spacing,&from->extra_spacing,sizeof(to->extra_spacing));
-  beziershape_update_data(to);
+  memcpy (&to->extra_spacing,
+          &from->extra_spacing,
+          sizeof (to->extra_spacing));
+  beziershape_update_data (to);
 }
 
+
 void
 beziershape_destroy (BezierShape *bezier)
 {
@@ -950,8 +987,9 @@ beziershape_destroy (BezierShape *bezier)
      freed by object_destroy() */
   nh = bezier->object.num_handles;
   temp_handles = g_new0 (Handle *, nh);
-  for (i = 0; i < nh; i++)
+  for (i = 0; i < nh; i++) {
     temp_handles[i] = bezier->object.handles[i];
+  }
 
   temp_cps = g_new0 (ConnectionPoint *, bezier->object.num_connections);
   for (i = 0; i < bezier->object.num_connections; i++) {
@@ -975,48 +1013,63 @@ beziershape_destroy (BezierShape *bezier)
 }
 
 
-/** Save the data defined by a beziershape object to XML.
- * @param bezier The object to save.
- * @param obj_node The XML node to save it into
- * @param ctx The context to transport error information.
+/**
+ * beziershape_save:
+ * @bezier: The object to save.
+ * @obj_node: The XML node to save it into
+ * @ctx: The context to transport error information.
+ *
+ * Save the data defined by a beziershape object to XML.
+ *
+ * Since: dawn-of-time
  */
 void
 beziershape_save (BezierShape *bezier,
-                 ObjectNode obj_node,
-                 DiaContext *ctx)
+                  ObjectNode   obj_node,
+                  DiaContext  *ctx)
 {
   int i;
   AttributeNode attr;
 
-  object_save(&bezier->object, obj_node, ctx);
+  object_save (&bezier->object, obj_node, ctx);
 
-  attr = new_attribute(obj_node, "bez_points");
+  attr = new_attribute (obj_node, "bez_points");
 
-  data_add_point(attr, &bezier->bezier.points[0].p1, ctx);
+  data_add_point (attr, &bezier->bezier.points[0].p1, ctx);
   for (i = 1; i < bezier->bezier.num_points; i++) {
-    if (BEZ_MOVE_TO == bezier->bezier.points[i].type)
-      g_warning("only first BezPoint can be a BEZ_MOVE_TO");
-    data_add_point(attr, &bezier->bezier.points[i].p1, ctx);
-    data_add_point(attr, &bezier->bezier.points[i].p2, ctx);
-    if (i < bezier->bezier.num_points - 1)
-      data_add_point(attr, &bezier->bezier.points[i].p3, ctx);
+    if (BEZ_MOVE_TO == bezier->bezier.points[i].type) {
+      g_warning ("only first BezPoint can be a BEZ_MOVE_TO");
+    }
+    data_add_point (attr, &bezier->bezier.points[i].p1, ctx);
+    data_add_point (attr, &bezier->bezier.points[i].p2, ctx);
+    if (i < bezier->bezier.num_points - 1) {
+      data_add_point (attr, &bezier->bezier.points[i].p3, ctx);
+    }
   }
 
-  attr = new_attribute(obj_node, "corner_types");
-  for (i = 0; i < bezier->bezier.num_points; i++)
-    data_add_enum(attr, bezier->bezier.corner_types[i], ctx);
+  attr = new_attribute (obj_node, "corner_types");
+  for (i = 0; i < bezier->bezier.num_points; i++) {
+    data_add_enum (attr, bezier->bezier.corner_types[i], ctx);
+  }
 }
 
-/** Load a beziershape object from XML.
+
+/**
+ * beziershape_load:
+ * @bezier: A newly allocated bezierconn object to load into.
+ * @obj_node: The XML node to load from.
+ * @ctx: The context in which this function is called
+ *
+ * Load a beziershape object from XML.
+ *
  * Does object_init() on the bezierconn object.
- * @param bezier A newly allocated bezierconn object to load into.
- * @param obj_node The XML node to load from.
- * @param ctx The context in which this function is called
+ *
+ * Since: dawn-of-time
  */
 void
 beziershape_load (BezierShape *bezier,
-                 ObjectNode obj_node,
-                 DiaContext *ctx)
+                  ObjectNode   obj_node,
+                  DiaContext  *ctx)
 {
   int i;
   AttributeNode attr;
@@ -1024,82 +1077,93 @@ beziershape_load (BezierShape *bezier,
 
   DiaObject *obj = &bezier->object;
 
-  object_load(obj, obj_node, ctx);
+  object_load (obj, obj_node, ctx);
 
-  attr = object_find_attribute(obj_node, "bez_points");
+  attr = object_find_attribute (obj_node, "bez_points");
 
-  if (attr != NULL)
-    bezier->bezier.num_points = attribute_num_data(attr) / 3 + 1;
-  else
+  if (attr != NULL) {
+    bezier->bezier.num_points = attribute_num_data (attr) / 3 + 1;
+  } else {
     bezier->bezier.num_points = 0;
+  }
 
-  object_init(obj, 3 * (bezier->bezier.num_points - 1),
-             2 * (bezier->bezier.num_points - 1) + 1);
+  object_init (obj,
+               3 * (bezier->bezier.num_points - 1),
+               2 * (bezier->bezier.num_points - 1) + 1);
 
-  data = attribute_first_data(attr);
+  data = attribute_first_data (attr);
   if (bezier->bezier.num_points != 0) {
-    bezier->bezier.points = g_new(BezPoint, bezier->bezier.num_points);
+    bezier->bezier.points = g_new (BezPoint, bezier->bezier.num_points);
     bezier->bezier.points[0].type = BEZ_MOVE_TO;
-    data_point(data, &bezier->bezier.points[0].p1, ctx);
+    data_point (data, &bezier->bezier.points[0].p1, ctx);
     bezier->bezier.points[0].p3 = bezier->bezier.points[0].p1;
-    data = data_next(data);
+    data = data_next (data);
 
     for (i = 1; i < bezier->bezier.num_points; i++) {
       bezier->bezier.points[i].type = BEZ_CURVE_TO;
-      data_point(data, &bezier->bezier.points[i].p1, ctx);
-      data = data_next(data);
-      data_point(data, &bezier->bezier.points[i].p2, ctx);
-      data = data_next(data);
+      data_point (data, &bezier->bezier.points[i].p1, ctx);
+      data = data_next (data);
+      data_point (data, &bezier->bezier.points[i].p2, ctx);
+      data = data_next (data);
       if (i < bezier->bezier.num_points - 1) {
-       data_point(data, &bezier->bezier.points[i].p3, ctx);
-       data = data_next(data);
-      } else
-       bezier->bezier.points[i].p3 = bezier->bezier.points[0].p1;
+        data_point (data, &bezier->bezier.points[i].p3, ctx);
+        data = data_next (data);
+      } else {
+        bezier->bezier.points[i].p3 = bezier->bezier.points[0].p1;
+      }
     }
   }
 
-  bezier->bezier.corner_types = g_new(BezCornerType, bezier->bezier.num_points);
-  attr = object_find_attribute(obj_node, "corner_types");
+  bezier->bezier.corner_types = g_new (BezCornerType,
+                                       bezier->bezier.num_points);
+  attr = object_find_attribute (obj_node, "corner_types");
   /* if corner_types is missing or corrupt */
-  if (!attr || attribute_num_data(attr) != bezier->bezier.num_points) {
+  if (!attr || attribute_num_data (attr) != bezier->bezier.num_points) {
     for (i = 0; i < bezier->bezier.num_points; i++)
       bezier->bezier.corner_types[i] = BEZ_CORNER_SYMMETRIC;
   } else {
-    data = attribute_first_data(attr);
+    data = attribute_first_data (attr);
     for (i = 0; i < bezier->bezier.num_points; i++) {
-      bezier->bezier.corner_types[i] = data_enum(data, ctx);
-      data = data_next(data);
+      bezier->bezier.corner_types[i] = data_enum (data, ctx);
+      data = data_next (data);
     }
   }
 
   for (i = 0; i < bezier->bezier.num_points - 1; i++) {
-    obj->handles[3*i] = g_new0(Handle,1);
-    obj->handles[3*i+1] = g_new0(Handle,1);
-    obj->handles[3*i+2]   = g_new0(Handle,1);
+    obj->handles[3 * i]     = g_new0 (Handle, 1);
+    obj->handles[3 * i + 1] = g_new0 (Handle, 1);
+    obj->handles[3 * i + 2] = g_new0 (Handle, 1);
 
-    setup_handle(obj->handles[3*i], HANDLE_RIGHTCTRL);
-    setup_handle(obj->handles[3*i+1], HANDLE_LEFTCTRL);
-    setup_handle(obj->handles[3*i+2],   HANDLE_BEZMAJOR);
+    setup_handle (obj->handles[3 * i], HANDLE_RIGHTCTRL);
+    setup_handle (obj->handles[3 * i + 1], HANDLE_LEFTCTRL);
+    setup_handle (obj->handles[3 * i + 2], HANDLE_BEZMAJOR);
   }
   for (i = 0; i < obj->num_connections; i++) {
-    obj->connections[i] = g_new0(ConnectionPoint, 1);
+    obj->connections[i] = g_new0 (ConnectionPoint, 1);
     obj->connections[i]->object = obj;
   }
-  obj->connections[obj->num_connections-1]->flags = CP_FLAGS_MAIN;
+  obj->connections[obj->num_connections - 1]->flags = CP_FLAGS_MAIN;
 
-  beziershape_update_data(bezier);
+  beziershape_update_data (bezier);
 }
 
-/*** Undo support ***/
 
-/** Free undo information about adding or removing points.
- * @param change The undo information to free.
+/* Undo support */
+
+
+/**
+ * beziershape_point_change_free:
+ * @change@ The undo information to free.
+ *
+ * Free undo information about adding or removing points.
+ *
+ * Since: dawn-of-time
  */
 static void
 beziershape_point_change_free (struct BezPointChange *change)
 {
-  if ( (change->type==TYPE_ADD_POINT && !change->applied) ||
-       (change->type==TYPE_REMOVE_POINT && change->applied) ){
+  if ( (change->type == TYPE_ADD_POINT && !change->applied) ||
+       (change->type == TYPE_REMOVE_POINT && change->applied) ){
     g_clear_pointer (&change->handle1, g_free);
     g_clear_pointer (&change->handle2, g_free);
     g_clear_pointer (&change->handle3, g_free);
@@ -1170,27 +1234,27 @@ beziershape_point_change_revert (struct BezPointChange *change,
 
 
 static ObjectChange *
-beziershape_create_point_change (BezierShape *bezier,
-                                enum change_type type,
-                                BezPoint *point,
-                                BezCornerType corner_type,
-                                int pos,
-                                Handle *handle1,
-                                Handle *handle2,
-                                Handle *handle3,
-                                ConnectionPoint *cp1,
-                                ConnectionPoint *cp2)
+beziershape_create_point_change (BezierShape      *bezier,
+                                 enum change_type  type,
+                                 BezPoint         *point,
+                                 BezCornerType     corner_type,
+                                 int               pos,
+                                 Handle           *handle1,
+                                 Handle           *handle2,
+                                 Handle           *handle3,
+                                 ConnectionPoint  *cp1,
+                                 ConnectionPoint  *cp2)
 {
   struct BezPointChange *change;
 
-  change = g_new(struct BezPointChange, 1);
+  change = g_new (struct BezPointChange, 1);
 
   change->obj_change.apply =
-    (ObjectChangeApplyFunc)beziershape_point_change_apply;
+        (ObjectChangeApplyFunc) beziershape_point_change_apply;
   change->obj_change.revert =
-    (ObjectChangeRevertFunc)beziershape_point_change_revert;
+        (ObjectChangeRevertFunc) beziershape_point_change_revert;
   change->obj_change.free =
-    (ObjectChangeFreeFunc)beziershape_point_change_free;
+        (ObjectChangeFreeFunc) beziershape_point_change_free;
 
   change->type = type;
   change->applied = 1;
@@ -1203,89 +1267,113 @@ beziershape_create_point_change (BezierShape *bezier,
   change->cp1 = cp1;
   change->cp2 = cp2;
 
-  return (ObjectChange *)change;
+  return (ObjectChange *) change;
 }
 
-/** Apply a change of corner type.  This may change the position of the
- * control handles by calling beziershape_straighten_corner.
- * @param change The undo information to apply.
- * @param obj The object to apply the undo information too.
+
+/**
+ * beziershape_corner_change_apply:
+ * @change: The undo information to apply.
+ * @obj: The object to apply the undo information too.
+ *
+ * Apply a change of corner type. This may change the position of the
+ * control handles by calling beziershape_straighten_corner().
+ *
+ * Since: dawn-of-time
  */
 static void
 beziershape_corner_change_apply (struct CornerChange *change,
-                                DiaObject *obj)
+                                 DiaObject           *obj)
 {
-  BezierShape *bezier = (BezierShape *)obj;
-  int handle_nr = get_handle_nr(bezier, change->handle);
-  int comp_nr = get_major_nr(handle_nr);
+  BezierShape *bezier = (BezierShape *) obj;
+  int handle_nr = get_handle_nr (bezier, change->handle);
+  int comp_nr = get_major_nr (handle_nr);
 
-  beziershape_straighten_corner(bezier, comp_nr);
+  beziershape_straighten_corner (bezier, comp_nr);
 
   bezier->bezier.corner_types[comp_nr] = change->new_type;
-  if (comp_nr == 0)
+  if (comp_nr == 0) {
     bezier->bezier.corner_types[bezier->bezier.num_points-1] = change->new_type;
-  if (comp_nr == bezier->bezier.num_points - 1)
+  }
+  if (comp_nr == bezier->bezier.num_points - 1) {
     bezier->bezier.corner_types[0] = change->new_type;
+  }
 
   change->applied = 1;
 }
 
-/** Revert (unapply) a change of corner type.  This may move the position
+
+/**
+ * beziershape_corner_change_revert:
+ * @change: Undo information to apply.
+ * @obj: The beziershape object to apply the change to.
+ *
+ * Revert (unapply) a change of corner type. This may move the position
  * of the control handles to what they were before applying.
- * @param change Undo information to apply.
- * @param obj The beziershape object to apply the change to.
+ *
+ * Since: dawn-of-time
  */
 static void
 beziershape_corner_change_revert (struct CornerChange *change,
-                                 DiaObject *obj)
+                                  DiaObject           *obj)
 {
   BezierShape *bezier = (BezierShape *)obj;
-  int handle_nr = get_handle_nr(bezier, change->handle);
-  int comp_nr = get_major_nr(handle_nr);
+  int handle_nr = get_handle_nr (bezier, change->handle);
+  int comp_nr = get_major_nr (handle_nr);
 
   bezier->bezier.points[comp_nr].p2 = change->point_left;
-  if (comp_nr == bezier->bezier.num_points - 1)
+  if (comp_nr == bezier->bezier.num_points - 1) {
     bezier->bezier.points[1].p1 = change->point_right;
-  else
-    bezier->bezier.points[comp_nr+1].p1 = change->point_right;
+  } else {
+    bezier->bezier.points[comp_nr + 1].p1 = change->point_right;
+  }
   bezier->bezier.corner_types[comp_nr] = change->old_type;
-  if (comp_nr == 0)
-    bezier->bezier.corner_types[bezier->bezier.num_points-1] = change->new_type;
-  if (comp_nr == bezier->bezier.num_points - 1)
+  if (comp_nr == 0) {
+    bezier->bezier.corner_types[bezier->bezier.num_points - 1] = change->new_type;
+  }
+  if (comp_nr == bezier->bezier.num_points - 1) {
     bezier->bezier.corner_types[0] = change->new_type;
+  }
 
   change->applied = 0;
 }
 
-/** Create new undo information about a changing the type of a corner.
- * Note that the created ObjectChange object has nothing in it that needs
+
+/**
+ * beziershape_create_corner_change:
+ * @bezier: The bezier object this applies to.
+ * @handle: The handle of the corner being changed.
+ * @point_left: The position of the left control handle.
+ * @point_right: The position of the right control handle.
+ * @old_corner_type: The corner type before applying.
+ * @new_corner_type: The corner type being changed to.
+ *
+ * Create new undo information about a changing the type of a corner.
+ * Note that the created #ObjectChange object has nothing in it that needs
  * freeing.
- * @param bezier The bezier object this applies to.
- * @param handle The handle of the corner being changed.
- * @param point_left The position of the left control handle.
- * @param point_right The position of the right control handle.
- * @param old_corner_type The corner type before applying.
- * @param new_corner_type The corner type being changed to.
- * @returns Newly allocated undo information.
+ *
+ * Returns: Newly allocated undo information.
+ *
+ * Since: dawn-of-time
  */
 static ObjectChange *
-beziershape_create_corner_change (BezierShape *bezier,
-                                 Handle *handle,
-                                 Point *point_left,
-                                 Point *point_right,
-                                 BezCornerType old_corner_type,
-                                 BezCornerType new_corner_type)
+beziershape_create_corner_change (BezierShape   *bezier,
+                                  Handle        *handle,
+                                  Point         *point_left,
+                                  Point         *point_right,
+                                  BezCornerType  old_corner_type,
+                                  BezCornerType  new_corner_type)
 {
   struct CornerChange *change;
 
-  change = g_new(struct CornerChange, 1);
+  change = g_new (struct CornerChange, 1);
 
   change->obj_change.apply =
-       (ObjectChangeApplyFunc)beziershape_corner_change_apply;
+          (ObjectChangeApplyFunc) beziershape_corner_change_apply;
   change->obj_change.revert =
-       (ObjectChangeRevertFunc)beziershape_corner_change_revert;
+          (ObjectChangeRevertFunc) beziershape_corner_change_revert;
   change->obj_change.free =
-       (ObjectChangeFreeFunc)NULL;
+          (ObjectChangeFreeFunc) NULL;
 
   change->old_type = old_corner_type;
   change->new_type = new_corner_type;
@@ -1295,5 +1383,5 @@ beziershape_create_corner_change (BezierShape *bezier,
   change->point_left = *point_left;
   change->point_right = *point_right;
 
-  return (ObjectChange *)change;
+  return (ObjectChange *) change;
 }


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