[dia] general: various gtk-doc fixes



commit 79e2f81f75294019e7c8f0632ea3b3278ddf29d1
Author: Zander Brown <zbrown gnome org>
Date:   Sat Apr 25 16:33:59 2020 +0100

    general: various gtk-doc fixes
    
    Cleanup /** comments not in gtk-doc format, fix multiple declarations
    
    Still far from a clean build, but much improved

 app/app_procs.c                            |  12 +-
 app/app_procs.h                            |  11 +-
 app/autosave.c                             |  11 +-
 app/commands.c                             |  16 +-
 app/confirm.h                              |  14 +
 app/dia-application.c                      |   7 +-
 app/dia-change.h                           |  34 ++
 app/dia-colour-area.h                      |   2 +
 app/dia-guide-dialog.h                     |   1 +
 app/dia-line-width-area.h                  |   2 +
 app/dia-props.h                            |   1 +
 app/dia-win-remote.c                       | 541 ++++++++++++++++-------------
 app/diagram.c                              | 122 +++++--
 app/diagram.h                              |   3 +
 app/diapagelayout.h                        |   7 +
 app/disp_callbacks.c                       |  25 +-
 app/disp_callbacks.h                       |  11 +-
 app/display.c                              | 171 ++++++---
 app/display.h                              |   8 +-
 app/exit_dialog.c                          |   6 +-
 app/exit_dialog.h                          |   6 +
 app/filedlg.c                              | 161 +++++++--
 app/find-and-replace.c                     |  18 +-
 app/grid.c                                 |  11 +-
 app/highlight.c                            |  22 +-
 app/highlight.h                            |   6 +-
 app/interface.c                            | 116 ++++---
 app/interface.h                            |   2 -
 app/layer-editor/dia-layer-editor-dialog.h |   1 +
 app/layer-editor/dia-layer-editor.h        |   1 +
 app/layer-editor/dia-layer-properties.h    |   1 +
 app/load_save.c                            |  31 +-
 app/modify_tool.c                          |   3 +-
 app/navigation.h                           |  21 +-
 app/object_ops.c                           |  27 +-
 app/properties-dialog.c                    |  13 +-
 app/recent_files.c                         |   5 +
 app/select.c                               |  26 +-
 app/textedit.c                             | 231 ++++++++----
 app/textedit_tool.c                        |  18 +-
 app/undo.c                                 |  60 +++-
 docs/dia-app/dia-app-docs.xml              |  10 +-
 docs/dia-app/meson.build                   |   2 +
 docs/dia/dia-docs.xml                      |  12 +-
 tests/meson.build                          |   4 +-
 45 files changed, 1219 insertions(+), 594 deletions(-)
---
diff --git a/app/app_procs.c b/app/app_procs.c
index cc66d71e..75ae5a2e 100644
--- a/app/app_procs.c
+++ b/app/app_procs.c
@@ -288,7 +288,8 @@ handle_show_layers (DiagramData *diagdata,
 
 const char *argv0 = NULL;
 
-/** Convert infname to outfname, using input filter inf and export filter
+/*
+ * Convert infname to outfname, using input filter inf and export filter
  * ef.  If either is null, try to guess them.
  * size might be NULL.
  */
@@ -426,10 +427,11 @@ app_is_interactive (void)
   return dia_is_interactive;
 }
 
-/** Handle loading of diagrams given on command line, including conversions.
- * Returns TRUE if any automatic conversions were performed.
- * Note to future hackers:  'size' is currently the only argument that can be
- * sent to exporters.  If more arguments are desired, please don't just add
+/*
+ * Handle loading of diagrams given on command line, including conversions.
+ * Returns %TRUE if any automatic conversions were performed.
+ * Note to future hackers: 'size' is currently the only argument that can be
+ * sent to exporters. If more arguments are desired, please don't just add
  * even more arguments, but create a more general system.
  */
 static gboolean
diff --git a/app/app_procs.h b/app/app_procs.h
index d1d311c7..a900c723 100644
--- a/app/app_procs.h
+++ b/app/app_procs.h
@@ -21,9 +21,16 @@
 #include <glib.h>
 
 void app_init (int argc, char **argv);
-/** Exit the application, but asking the user for confirmation
+
+/**
+ * app_exit:
+ *
+ * Exit the application, but asking the user for confirmation
  * if there are changed diagrams.
- * Returns TRUE if the application exits.
+ *
+ * Returns: %TRUE if the application exits.
+ *
+ * Since: dawn-of-time
  */
 gboolean app_exit (void);
 
diff --git a/app/autosave.c b/app/autosave.c
index f28e83ff..3a006492 100644
--- a/app/autosave.c
+++ b/app/autosave.c
@@ -42,13 +42,20 @@ autosave_save_diagram(gpointer data)
   diagram_autosave(dia);
 }
 
-/** Makes autosave copies of the diagrams in the appropriate directory
+
+/**
+ * autosave_check_autosave:
+ * @data: unused???
+ *
+ * Makes autosave copies of the diagrams in the appropriate directory
  * This function will be called after a diagram is modified, and will
  * only save documents that are modified and not already autosaved,
  * and only at the next idle period.
+ *
+ * Since: dawn-of-time
  */
 gboolean
-autosave_check_autosave(gpointer data)
+autosave_check_autosave (gpointer data)
 {
   GList *diagrams = dia_open_diagrams();
   Diagram *diagram;
diff --git a/app/commands.c b/app/commands.c
index cac69822..47898d56 100644
--- a/app/commands.c
+++ b/app/commands.c
@@ -41,11 +41,16 @@
 #include "menus.h"
 #include "widgets.h"
 
-/** Functions called on menu selects.
- *  Note that GTK (at least up to 2.12) doesn't disable the keyboard shortcuts
- *  when the menu is made insensitive, so we have to check the constrains again
- *  in the functions.
+/**
+ * SECTION:commands
+ *
+ * Functions called on menu selects.
+ *
+ * Note that GTK (at least up to 2.12) doesn't disable the keyboard shortcuts
+ * when the menu is made insensitive, so we have to check the constrains again
+ * in the functions.
  */
+
 #ifdef G_OS_WIN32
 /*
  * Instead of polluting the Dia namespace with windoze headers, declare the
@@ -464,7 +469,8 @@ static GtkTargetEntry target_entries[] = {
 #endif
 };
 
-/**
+
+/*
  * This gets called by Gtk+ if some other application is asking
  * for the clipboard content.
  */
diff --git a/app/confirm.h b/app/confirm.h
index db12101d..c8b4a0c7 100644
--- a/app/confirm.h
+++ b/app/confirm.h
@@ -1,6 +1,18 @@
+#pragma once
+
 #include <gtk/gtk.h>
 #include "diagram.h"
 
+G_BEGIN_DECLS
+
+/**
+ * ConfirmationKind:
+ * @CONFIRM_PAGES: Confirm number of pages
+ * @CONFIRM_MEMORY: Confirm memory usage
+ * @CONFIRM_PRINT: This is for printing
+ *
+ * Since: dawn-of-time
+ */
 typedef enum {
   CONFIRM_PAGES = (1<<0),
   CONFIRM_MEMORY = (1<<1),
@@ -8,3 +20,5 @@ typedef enum {
 } ConfirmationKind;
 
 gboolean confirm_export_size (Diagram *dia, GtkWindow *parent, guint flags);
+
+G_END_DECLS
diff --git a/app/dia-application.c b/app/dia-application.c
index ff860b09..95993a6a 100644
--- a/app/dia-application.c
+++ b/app/dia-application.c
@@ -24,11 +24,14 @@ enum {
 
   LAST_SIGNAL
 };
-
 static guint signals[LAST_SIGNAL] = { 0, };
 
+
 /**
- * The central place managing global state changes like (dis-)appearance of diagrams
+ * DiaApplication:
+ *
+ * The central place managing global state changes like (dis-)appearance
+ * of diagrams
  */
 struct _DiaApplication
 {
diff --git a/app/dia-change.h b/app/dia-change.h
index 3c8d4c89..3646a1ff 100644
--- a/app/dia-change.h
+++ b/app/dia-change.h
@@ -24,8 +24,10 @@
 
 #include <glib-object.h>
 
+#ifndef __GTK_DOC_IGNORE__
 // TODO: Fix the diagram.h cycle
 typedef struct _Diagram Diagram;
+#endif
 
 G_BEGIN_DECLS
 
@@ -48,6 +50,38 @@ typedef struct _DiaChangeClass DiaChangeClass;
 #define G_VALUE_HOLDS_CHANGE(value)  (G_TYPE_CHECK_VALUE_TYPE ((value), DIA_TYPE_CHANGE))
 
 
+/**
+ * DIA_DEFINE_CHANGE:
+ * @TypeName: CamelCase name of the type
+ * @type_name: python_case name of the type
+ *
+ * G_DEFINE_TYPE() wrapper for implementing #DiaChange types, however unlike
+ * G_DEFINE_TYPE() the _init and _class_init are implemented for you. Instead
+ * you provide apply, revert & free functions
+ *
+ * |[<!-- language="C" -->
+ * DIA_DEFINE_CHANGE (SomeChange, some_change)
+ *
+ * static void
+ * some_change_apply (DiaChange *change,
+ *                    Diagram   *diagram)
+ * {
+ * }
+ *
+ * static void
+ * some_change_revert (DiaChange *change,
+ *                     Diagram   *diagram)
+ * {
+ * }
+ *
+ * static void
+ * some_change_free (DiaChange *change)
+ * {
+ * }
+ * ]|
+ *
+ * Since: 0.98
+ */
 #define DIA_DEFINE_CHANGE(TypeName, type_name)                               \
   G_DEFINE_TYPE (TypeName, type_name, DIA_TYPE_CHANGE)                       \
                                                                              \
diff --git a/app/dia-colour-area.h b/app/dia-colour-area.h
index d83997e7..161f41d5 100644
--- a/app/dia-colour-area.h
+++ b/app/dia-colour-area.h
@@ -22,10 +22,12 @@
 
 #include "color.h"
 
+#ifndef __GTK_DOC_IGNORE__
 #ifndef EVENT_APTR
 #define EVENT_APTR
 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GtkEventBox, g_object_unref)
 #endif
+#endif
 
 #define DIA_TYPE_COLOUR_AREA (dia_colour_area_get_type ())
 G_DECLARE_FINAL_TYPE (DiaColourArea, dia_colour_area, DIA, COLOUR_AREA, GtkEventBox)
diff --git a/app/dia-guide-dialog.h b/app/dia-guide-dialog.h
index d1a9e1d1..7c633b54 100644
--- a/app/dia-guide-dialog.h
+++ b/app/dia-guide-dialog.h
@@ -29,6 +29,7 @@ G_BEGIN_DECLS
 G_DECLARE_DERIVABLE_TYPE (DiaGuideDialog, dia_guide_dialog, DIA, GUIDE_DIALOG, GtkDialog)
 
 struct _DiaGuideDialogClass {
+  /*< private >*/
   GtkDialogClass parent;
 };
 
diff --git a/app/dia-line-width-area.h b/app/dia-line-width-area.h
index 597d8f66..df62db2c 100644
--- a/app/dia-line-width-area.h
+++ b/app/dia-line-width-area.h
@@ -20,10 +20,12 @@
 
 #include <gtk/gtk.h>
 
+#ifndef __GTK_DOC_IGNORE__
 #ifndef EVENT_APTR
 #define EVENT_APTR
 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GtkEventBox, g_object_unref)
 #endif
+#endif
 
 #define DIA_TYPE_LINE_WIDTH_AREA (dia_line_width_area_get_type ())
 G_DECLARE_FINAL_TYPE (DiaLineWidthArea, dia_line_width_area, DIA, LINE_WIDTH_AREA, GtkEventBox)
diff --git a/app/dia-props.h b/app/dia-props.h
index fa3fcb27..51a88236 100644
--- a/app/dia-props.h
+++ b/app/dia-props.h
@@ -31,6 +31,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (GtkDialog, g_object_unref)
 G_DECLARE_DERIVABLE_TYPE (DiaDiagramPropertiesDialog, dia_diagram_properties_dialog, DIA, 
DIAGRAM_PROPERTIES_DIALOG, GtkDialog)
 
 struct _DiaDiagramPropertiesDialogClass {
+  /*< private >*/
   GtkDialogClass parent;
 };
 
diff --git a/app/dia-win-remote.c b/app/dia-win-remote.c
index 74d78034..14098712 100644
--- a/app/dia-win-remote.c
+++ b/app/dia-win-remote.c
@@ -25,7 +25,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-/**
+/*
  * INCLUDES:
  */
 #include <stdio.h>
@@ -37,7 +37,7 @@
 #include <glib.h>
 #include <glib/gprintf.h>
 
-/**
+/*
  * PROTOTYPES:
  */
 int LaunchDia(int nArgs, LPWSTR *szArglist, int start_at);
@@ -48,262 +48,293 @@ char gszDiaExe[_MAX_PATH] = {0};   /* exe name */
 char gszVersion[] = "dia-win-remote 1.1.0";
 BOOL gUseRegVal = FALSE;
 
-int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
-                      LPSTR lpCmdLine, int nCmdShow)
-{
-    HWND hWnd = NULL; /* Dia's window */
-       LPWSTR *szArglist = NULL;
-       int nArgs;
-       int retval;
-       int start_at = 1;
-       char *filename_utf8 = NULL;
-       char *filename_utf8_down = NULL;
-       GError *error = NULL;
-
-    /**
-     * load registry setting if it's available
-     */
-    LoadRegSettings();
-
-    /**
-     * was anything found in the registry?
-     */
-    gUseRegVal = (strlen(gszDiaExe) !=0);
-    if (__argc < 2)
-    {
-        MessageBox(NULL, "Usage: dia-win-remote.exe [diaw.exe|dia.exe] [--integrated] file1 file2 ...",
-                   gszVersion, MB_ICONSTOP);
-        return -1;
-    }
 
-       szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
-       if( NULL == szArglist )
-       {
-               MessageBox(NULL, "CommandLineToArgvW failed\n", gszVersion, MB_ICONSTOP);
-               return -1;
-       }
-
-       /**
-        * Check if first argument is an executable.
-        */
-       filename_utf8 = g_utf16_to_utf8(szArglist[1], -1, NULL, NULL, &error);
-       if(error) {
-               MessageBox(NULL, "Error converting to UTF-8!", gszVersion, MB_ICONEXCLAMATION);
-               g_clear_pointer (&filename_utf8, g_free);
-               LocalFree(szArglist);
-               return -1;
-       }
-       filename_utf8_down = g_utf8_strdown(filename_utf8, -1);
-       g_clear_pointer (&filename_utf8, g_free);
-       if(g_pattern_match_simple("*.exe", filename_utf8_down))
-               start_at = 2;
-       g_clear_pointer (&filename_utf8_down, g_free);
-
-    /**
-     * Can't just look for "Dia" as other languages use
-     * different title text. Lets do this the hard way
-     * and examine all the windows.
-     */
-    EnumWindows(FindDiaWindow, (LPARAM)&hWnd);
-
-    /**
-     * Is Dia running?
-     */
-    if (hWnd != NULL)
-    {
-        retval = DragAndDropDia(hWnd, nArgs, szArglist, start_at);
-    }
-    else
-    {
-               retval = LaunchDia(nArgs, szArglist, start_at);
-    }
-       LocalFree(szArglist);
-       return retval;
+int APIENTRY
+WinMain (HINSTANCE hInstance,
+         HINSTANCE hPrevInstance,
+         LPSTR     lpCmdLine,
+         int       nCmdShow)
+{
+  HWND hWnd = NULL; /* Dia's window */
+  LPWSTR *szArglist = NULL;
+  int nArgs;
+  int retval;
+  int start_at = 1;
+  char *filename_utf8 = NULL;
+  char *filename_utf8_down = NULL;
+  GError *error = NULL;
+
+  /*
+    * load registry setting if it's available
+    */
+  LoadRegSettings ();
+
+  /*
+    * was anything found in the registry?
+    */
+  gUseRegVal = (strlen (gszDiaExe) != 0);
+  if (__argc < 2) {
+    MessageBox (NULL,
+                "Usage: dia-win-remote.exe [diaw.exe|dia.exe] [--integrated] file1 file2 ...",
+                gszVersion,
+                MB_ICONSTOP);
+    return -1;
+  }
+
+  szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
+  if( NULL == szArglist )
+  {
+    MessageBox(NULL, "CommandLineToArgvW failed\n", gszVersion, MB_ICONSTOP);
+    return -1;
+  }
+
+  /*
+   * Check if first argument is an executable.
+   */
+  filename_utf8 = g_utf16_to_utf8 (szArglist[1], -1, NULL, NULL, &error);
+  if (error) {
+    MessageBox (NULL,
+                "Error converting to UTF-8!",
+                gszVersion,
+                MB_ICONEXCLAMATION);
+    g_clear_pointer (&filename_utf8, g_free);
+    LocalFree (szArglist);
+    return -1;
+  }
+
+  filename_utf8_down = g_utf8_strdown (filename_utf8, -1);
+  g_clear_pointer (&filename_utf8, g_free);
+  if (g_pattern_match_simple ("*.exe", filename_utf8_down)) {
+    start_at = 2;
+  }
+  g_clear_pointer (&filename_utf8_down, g_free);
+
+  /*
+   * Can't just look for "Dia" as other languages use
+   * different title text. Lets do this the hard way
+   * and examine all the windows.
+   */
+  EnumWindows (FindDiaWindow, (LPARAM) &hWnd);
+
+  /*
+   * Is Dia running?
+   */
+  if (hWnd != NULL) {
+    retval = DragAndDropDia (hWnd, nArgs, szArglist, start_at);
+  } else {
+    retval = LaunchDia (nArgs, szArglist, start_at);
+  }
+
+  LocalFree (szArglist);
+
+  return retval;
 }
 
+
 /* Find path to Dia in the registry and then launch it with the
    passed command line.*/
-int LaunchDia(int nArgs, LPWSTR *szArglist, int start_at)
+int
+LaunchDia (int nArgs, LPWSTR *szArglist, int start_at)
 {
-    HKEY hRegData;
-    char szAppPath[_MAX_PATH];   /* path to exe */
-       char szDiaKey[255*2]; /* just incase * 2 */
-       char *uri_args = NULL;
-       char *uri_args_cpy = NULL;
-       char *filename_utf8 = NULL;
-       char *filename_uri = NULL;
-    DWORD dwSize;
-    DWORD dwType = 0;
-    DWORD dwDisp;
-    int i, iRetCode=-1;
-       GError *error = NULL;
-
-    /* Read path to Dia */
-    sprintf(szDiaKey, "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\%s",
-            (gUseRegVal) ? gszDiaExe : __argv[1]);
-
-    if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, szDiaKey, 0, KEY_READ, &hRegData) == ERROR_SUCCESS)
-    {
-        dwSize = sizeof(szAppPath);
-        if (RegQueryValueEx(hRegData, "", 0, &dwType,
-                            (PBYTE)szAppPath, (LPDWORD)&dwSize) == ERROR_SUCCESS)
-        {
-            /**
-            * Extract the path from where diaw.exe was launched. Could
-             * use the path in registry, but you never know where in the
-             * string it will be.
-            */
-            char szPath[_MAX_PATH]={0};
-            char *pEnd = strrchr(szAppPath, '\\');
-
-            /* Could we find last slash? */
-            if (pEnd != NULL)
-            {
-                int len = pEnd-szAppPath;
-
-                /* just incase */
-                if (len > 0 && len < _MAX_PATH)
-                {
-                    strncpy(szPath, szAppPath, len);
-                }
-            }
-
-                       /**
-                        * Create commandline with URIs
-                        */
-                       uri_args_cpy = g_strdup("");
-                       for(i = start_at; i<nArgs; i++)
-                       {
-                               if((0 == wcsncmp(szArglist[i], L"--", 2)) && !PathFileExistsW(szArglist[i]))
-                               {
-                                       uri_args = g_strdup_printf("%s %s", uri_args_cpy, __argv[i]);
-                                       g_clear_pointer (&uri_args_cpy, g_free);
-                                       uri_args_cpy = uri_args;
-                               }
-                               else
-                               {
-                                       filename_utf8 = g_utf16_to_utf8(szArglist[i], -1, NULL, NULL, &error);
-                                       if(error) {
-                                               MessageBox(NULL, "Error converting to UTF-8!", gszVersion, 
MB_ICONEXCLAMATION);
-                                               g_clear_pointer (&filename_utf8, g_free);
-                                               g_clear_pointer (&uri_args, g_free);
-                                               g_clear_pointer (&uri_args_cpy, g_free);
-                                               return -1;
-                                       }
-
-                                       filename_uri = g_filename_to_uri(filename_utf8, NULL, &error);
-                                       if(error) {
-                                               MessageBox(NULL, "Error converting to URI!", gszVersion, 
MB_ICONEXCLAMATION);
-                                               g_clear_pointer (&filename_uri, g_free);
-                                               g_clear_pointer (&uri_args, g_free);
-                                               g_clear_pointer (&uri_args_cpy, g_free);
-                                               g_clear_pointer (&filename_utf8, g_free);
-                                               return -1;
-                                       }
-                                       else
-                                       {
-                                               uri_args = g_strdup_printf("%s %s", uri_args_cpy, 
filename_uri);
-                                               g_clear_pointer (&uri_args_cpy, g_free);
-                                               g_clear_pointer (&filename_uri, g_free);
-                                               uri_args_cpy = uri_args;
-                                       }
-                                       g_clear_pointer (&filename_utf8, g_free);
-                               }
-                       }
-            /**
-            * Try launching Dia with the passed params.
-            */
-            if (ShellExecute(NULL, "open", szAppPath,
-                             uri_args, szPath, SW_SHOW) <= (HINSTANCE)32)
-            {
-                MessageBox(NULL, "Failed to launch Dia!", gszVersion, MB_ICONEXCLAMATION);
-            }
-            else
-            {
-                iRetCode = 0;
-            }
-                       g_clear_pointer (&uri_args, g_free);
-                       g_clear_pointer (&uri_args_cpy, g_free);
+  HKEY hRegData;
+  char szAppPath[_MAX_PATH];   /* path to exe */
+  char szDiaKey[255*2]; /* just incase * 2 */
+  char *uri_args = NULL;
+  char *uri_args_cpy = NULL;
+  char *filename_utf8 = NULL;
+  char *filename_uri = NULL;
+  DWORD dwSize;
+  DWORD dwType = 0;
+  DWORD dwDisp;
+  int i, iRetCode = -1;
+  GError *error = NULL;
+
+  /* Read path to Dia */
+  sprintf (szDiaKey, "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\%s",
+           (gUseRegVal) ? gszDiaExe : __argv[1]);
+
+  if (RegOpenKeyEx (HKEY_LOCAL_MACHINE,
+                    szDiaKey,
+                    0,
+                    KEY_READ,
+                    &hRegData) == ERROR_SUCCESS) {
+    dwSize = sizeof(szAppPath);
+    if (RegQueryValueEx (hRegData,
+                         "",
+                         0,
+                         &dwType,
+                         (PBYTE) szAppPath,
+                         (LPDWORD) &dwSize) == ERROR_SUCCESS) {
+      /*
+       * Extract the path from where diaw.exe was launched. Could
+       * use the path in registry, but you never know where in the
+       * string it will be.
+       */
+      char szPath[_MAX_PATH]={0};
+      char *pEnd = strrchr (szAppPath, '\\');
+
+      /* Could we find last slash? */
+      if (pEnd != NULL) {
+        int len = pEnd-szAppPath;
+
+        /* just incase */
+        if (len > 0 && len < _MAX_PATH) {
+          strncpy (szPath, szAppPath, len);
         }
+      }
+
+      /*
+       * Create commandline with URIs
+       */
+      uri_args_cpy = g_strdup ("");
+      for (i = start_at; i < nArgs; i++) {
+        if ((0 == wcsncmp (szArglist[i], L"--", 2)) &&
+            !PathFileExistsW (szArglist[i])) {
+          uri_args = g_strdup_printf ("%s %s", uri_args_cpy, __argv[i]);
+          g_clear_pointer (&uri_args_cpy, g_free);
+          uri_args_cpy = uri_args;
+        } else {
+          filename_utf8 = g_utf16_to_utf8 (szArglist[i],
+                                           -1,
+                                           NULL,
+                                           NULL,
+                                           &error);
+          if (error) {
+            MessageBox (NULL,
+                        "Error converting to UTF-8!",
+                        gszVersion,
+                        MB_ICONEXCLAMATION);
+            g_clear_pointer (&filename_utf8, g_free);
+            g_clear_pointer (&uri_args, g_free);
+            g_clear_pointer (&uri_args_cpy, g_free);
+            return -1;
+          }
+
+          filename_uri = g_filename_to_uri (filename_utf8, NULL, &error);
+          if (error) {
+            MessageBox (NULL,
+                        "Error converting to URI!",
+                        gszVersion,
+                        MB_ICONEXCLAMATION);
+            g_clear_pointer (&filename_uri, g_free);
+            g_clear_pointer (&uri_args, g_free);
+            g_clear_pointer (&uri_args_cpy, g_free);
+            g_clear_pointer (&filename_utf8, g_free);
+            return -1;
+          } else {
+            uri_args = g_strdup_printf ("%s %s", uri_args_cpy, filename_uri);
+            g_clear_pointer (&uri_args_cpy, g_free);
+            g_clear_pointer (&filename_uri, g_free);
+            uri_args_cpy = uri_args;
+          }
+          g_clear_pointer (&filename_utf8, g_free);
+        }
+      }
+
+      /*
+       * Try launching Dia with the passed params.
+       */
+      if (ShellExecute (NULL,
+                        "open",
+                        szAppPath,
+                        uri_args,
+                        szPath,
+                        SW_SHOW) <= (HINSTANCE) 32) {
+        MessageBox (NULL,
+                    "Failed to launch Dia!",
+                    gszVersion,
+                    MB_ICONEXCLAMATION);
+      } else {
+        iRetCode = 0;
+      }
+
+      g_clear_pointer (&uri_args, g_free);
+      g_clear_pointer (&uri_args_cpy, g_free);
     }
-    else
-    {
-        MessageBox(NULL, "Error reading registry!", gszVersion, MB_ICONSTOP);
-    }
+  } else {
+    MessageBox(NULL, "Error reading registry!", gszVersion, MB_ICONSTOP);
+  }
 
-    /* close the key */
-    RegCloseKey(hRegData);
+  /* close the key */
+  RegCloseKey (hRegData);
 
-    return iRetCode;
+  return iRetCode;
 }
 
-/**
+
+/*
  * Dia is running, so we simulate a drag & drop event.
  */
-int DragAndDropDia(HWND hWnd, int nArgs, LPWSTR *szArglist, int start_at)
+int
+DragAndDropDia (HWND hWnd, int nArgs, LPWSTR *szArglist, int start_at)
 {
-    int iNumFiles   = (gUseRegVal) ? __argc-1 : __argc-2;
-    int iCurBytePos = sizeof(DROPFILES);
-    LPDROPFILES pDropFiles;
-    HGLOBAL hGlobal;
-    int i;
-
-    /* May use more memory than is needed... oh well. */
-    hGlobal = GlobalAlloc(GHND | GMEM_SHARE,
-                          sizeof(DROPFILES) +
-                          (_MAX_PATH * iNumFiles) + 1);
-
-    /* memory failure? */
-    if (hGlobal == NULL)
-        return -1;
-
-    /* lock the memory */
-    pDropFiles = (LPDROPFILES)GlobalLock(hGlobal);
-
-    /* set offset where the file list begins */
-    pDropFiles->pFiles = sizeof(DROPFILES);
-
-    /* no wide chars and drop point is in client coordinates */
-    pDropFiles->fWide = TRUE;
-    pDropFiles->pt.x = 50;
-       pDropFiles->pt.y = 150;
-    pDropFiles->fNC = FALSE;
-
-    for(i = start_at; i < nArgs; ++i)
-    {
-               if((0 == wcsncmp(szArglist[i], L"--", 2)) && !PathFileExistsW(szArglist[i]))
-                       continue;
-        wcsncpy((LPWSTR)((LPSTR)(pDropFiles) + iCurBytePos), szArglist[i], _MAX_PATH);
-         /**
-                 * Move the current position beyond the file name copied.
-                * +1 for NULL terminator
-               */
-        iCurBytePos += (wcslen(szArglist[i]) * sizeof(wchar_t)) + sizeof(wchar_t);
+  int iNumFiles   = (gUseRegVal) ? __argc - 1 : __argc - 2;
+  int iCurBytePos = sizeof (DROPFILES);
+  LPDROPFILES pDropFiles;
+  HGLOBAL hGlobal;
+  int i;
+
+  /* May use more memory than is needed... oh well. */
+  hGlobal = GlobalAlloc (GHND | GMEM_SHARE,
+                         sizeof (DROPFILES) +
+                         (_MAX_PATH * iNumFiles) + 1);
+
+  /* memory failure? */
+  if (hGlobal == NULL) {
+    return -1;
+  }
+
+  /* lock the memory */
+  pDropFiles = (LPDROPFILES)GlobalLock(hGlobal);
+
+  /* set offset where the file list begins */
+  pDropFiles->pFiles = sizeof(DROPFILES);
+
+  /* no wide chars and drop point is in client coordinates */
+  pDropFiles->fWide = TRUE;
+  pDropFiles->pt.x = 50;
+  pDropFiles->pt.y = 150;
+  pDropFiles->fNC = FALSE;
+
+  for (i = start_at; i < nArgs; ++i) {
+    if ((0 == wcsncmp (szArglist[i], L"--", 2)) &&
+        !PathFileExistsW (szArglist[i])) {
+      continue;
     }
+    wcsncpy ((LPWSTR) ((LPSTR) (pDropFiles) + iCurBytePos),
+             szArglist[i],
+             _MAX_PATH);
+    /*
+     * Move the current position beyond the file name copied.
+     * +1 for NULL terminator
+     */
+    iCurBytePos += (wcslen (szArglist[i]) * sizeof (wchar_t)) + sizeof (wchar_t);
+  }
 
-    ((LPSTR)(pDropFiles))[iCurBytePos] = 0;
-    GlobalUnlock(hGlobal);
+  ((LPSTR) (pDropFiles))[iCurBytePos] = 0;
+  GlobalUnlock (hGlobal);
 
-    /* Force dia to the foreground */
-    SetForegroundWindow(hWnd);
+  /* Force dia to the foreground */
+  SetForegroundWindow (hWnd);
 
-    /* restore only if minimized */
-    if (IsIconic(hWnd))
-    {
-        ShowWindow(hWnd, SW_RESTORE);
-    }
+  /* restore only if minimized */
+  if (IsIconic (hWnd)) {
+    ShowWindow (hWnd, SW_RESTORE);
+  }
 
-    /* send the file list */
-    PostMessage(hWnd, WM_DROPFILES, (WPARAM)hGlobal, 0);
+  /* send the file list */
+  PostMessage (hWnd, WM_DROPFILES, (WPARAM) hGlobal, 0);
 
-    return 0;
+  return 0;
 }
 
-/**
+
+/*
  * Callback to enumerate all windows searching for
  * Dia as the user could be running under a different language.
  */
-BOOL CALLBACK FindDiaWindow(HWND hWnd, LPARAM lParam)
+BOOL CALLBACK
+FindDiaWindow (HWND hWnd, LPARAM lParam)
 {
     char szTitle[MAX_PATH + 40]; /* should be enough to find diaw.exe */
 
@@ -343,24 +374,32 @@ BOOL CALLBACK FindDiaWindow(HWND hWnd, LPARAM lParam)
     return TRUE;
 }
 
-void LoadRegSettings()
-{
-    HKEY hRegData;
 
-    /** Many users have had problems using older versions and wanting to send
-     * files from a third party application. Having this value in the registry
-     * will allow users to send files without specifying the dia version to run.
-     */
-    if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\GNU\\dia-win-remote",
-                     0, KEY_READ, &hRegData) == ERROR_SUCCESS)
-    {
-        DWORD dwSize = sizeof(gszDiaExe);
-        DWORD dwType = 0;
-        RegQueryValueEx(hRegData, "", 0, &dwType,
-                        (PBYTE)gszDiaExe, (LPDWORD)&dwSize);
-    }
-
-    /* close the key */
-    RegCloseKey(hRegData);
+void
+LoadRegSettings()
+{
+  HKEY hRegData;
+
+  /*
+   * Many users have had problems using older versions and wanting to send
+   * files from a third party application. Having this value in the registry
+   * will allow users to send files without specifying the dia version to run.
+   */
+  if (RegOpenKeyEx (HKEY_LOCAL_MACHINE,
+                    "Software\\GNU\\dia-win-remote",
+                    0,
+                    KEY_READ,
+                    &hRegData) == ERROR_SUCCESS) {
+    DWORD dwSize = sizeof (gszDiaExe);
+    DWORD dwType = 0;
+    RegQueryValueEx (hRegData,
+                     "",
+                     0,
+                     &dwType,
+                     (PBYTE) gszDiaExe,
+                     (LPDWORD) &dwSize);
+  }
+
+  /* close the key */
+  RegCloseKey (hRegData);
 }
-
diff --git a/app/diagram.c b/app/diagram.c
index 86e1bafc..5e0e294a 100644
--- a/app/diagram.c
+++ b/app/diagram.c
@@ -423,55 +423,83 @@ diagram_destroy(Diagram *dia)
   g_clear_object (&dia);
 }
 
-/** Returns true if we consider the diagram modified.
+
+/**
+ * diagram_is_modified:
+ * @dia: the #Diagram
+ *
+ * Returns: %TRUE if we consider the diagram modified.
+ *
+ * Since: dawn-of-time
  */
 gboolean
-diagram_is_modified(Diagram *dia)
+diagram_is_modified (Diagram *dia)
 {
-  return dia->mollified || !undo_is_saved(dia->undo);
+  return dia->mollified || !undo_is_saved (dia->undo);
 }
 
-/** We might just have change the diagrams modified status.
+
+/**
+ * diagram_modified:
+ * @dia: the #Diagram
+ *
+ * We might just have change the diagrams modified status.
+ *
  * This doesn't set the status, but merely updates the display.
+ *
+ * Since: dawn-of-time
  */
 void
-diagram_modified(Diagram *dia)
+diagram_modified (Diagram *dia)
 {
   GSList *displays;
-  gchar *dia_name = diagram_get_name(dia);
-  gchar *extra = g_path_get_dirname (dia->filename);
-  gchar *title = g_strdup_printf ("%s%s (%s)", diagram_is_modified(dia) ? "*" : "", dia_name, extra ? extra 
: " ");
+  char *dia_name = diagram_get_name (dia);
+  char *extra = g_path_get_dirname (dia->filename);
+  char *title = g_strdup_printf ("%s%s (%s)",
+                                 diagram_is_modified (dia) ? "*" : "",
+                                 dia_name,
+                                 extra ? extra : " ");
 
   g_clear_pointer (&dia_name, g_free);
   g_clear_pointer (&extra, g_free);
+
   displays = dia->displays;
   while (displays!=NULL) {
     DDisplay *ddisp = (DDisplay *) displays->data;
 
-    ddisplay_set_title(ddisp, title);
+    ddisplay_set_title (ddisp, title);
 
-    displays = g_slist_next(displays);
+    displays = g_slist_next (displays);
   }
-  if (diagram_is_modified(dia)) {
+
+  if (diagram_is_modified (dia)) {
     dia->autosaved = FALSE;
     dia->is_default = FALSE;
   }
-  /*  diagram_set_modified(dia, TRUE);*/
+
+  /* diagram_set_modified(dia, TRUE); */
   g_clear_pointer (&title, g_free);
 }
 
-/** Set this diagram explicitly modified.  This should not be called
+
+/**
+ * diagram_set_modified:
+ * @dia: the #Diagram
+ * @modified: the new state
+ *
+ * Set this diagram explicitly modified.  This should not be called
  * by things that change the undo stack, as those modifications are
  * noticed through changes in the undo stack.
+ *
+ * Since: dawn-of-time
  */
 void
-diagram_set_modified(Diagram *dia, int modified)
+diagram_set_modified (Diagram *dia, gboolean modified)
 {
-  if (dia->mollified != modified)
-  {
+  if (dia->mollified != modified) {
     dia->mollified = modified;
   }
-  diagram_modified(dia);
+  diagram_modified (dia);
 }
 
 /* ************ Functions that check for menu sensitivity ********* */
@@ -517,8 +545,15 @@ diagram_selected_any_children(Diagram *dia) {
   return FALSE;
 }
 
-/** This is slightly more complex -- must see if any non-parented objects
+
+/**
+ * diagram_selected_can_parent:
+ * @dia: the #Diagram
+ *
+ * This is slightly more complex -- must see if any non-parented objects
  * are within a parenting object.
+ *
+ * Since: dawn-of-time
  */
 static gboolean
 diagram_selected_can_parent(Diagram *dia) {
@@ -836,14 +871,20 @@ diagram_unselect_objects(Diagram *dia, GList *obj_list)
   g_signal_emit_by_name (dia, "selection_changed", g_list_length (dia->data->selected));
 }
 
-/** Make a single object selected.
+
+/**
+ * diagram_select:
+ * @diagram: the #Diagram that the object belongs to (sorta redundant now)
+ * @obj: the object that should be made selected.
+ *
+ * Make a single object selected.
  * Note that an object inside a closed group cannot be made selected, nor
  * can an object in a non-active layer.
- * @param diagram The diagram that the object belongs to (sorta redundant now)
- * @param obj The object that should be made selected.
+ *
+ * Since: dawn-of-time
  */
 void
-diagram_select(Diagram *diagram, DiaObject *obj)
+diagram_select (Diagram *diagram, DiaObject *obj)
 {
   if (dia_object_is_selectable(obj)) {
     data_select(diagram->data, obj);
@@ -1378,11 +1419,19 @@ diagram_get_sorted_selected(Diagram *dia)
   return data_get_sorted_selected(dia->data);
 }
 
-/** Remove the currently selected objects from the diagram's object list.
- * Returns a newly created list of the selected objects, in order.
+
+/**
+ * diagram_get_sorted_selected_remove:
+ * @dia: the #Diagram
+ *
+ * Remove the currently selected objects from the diagram's object list.
+ *
+ * Returns: a newly created list of the selected objects, in order.
+ *
+ * Since: dawn-of-time
  */
 GList *
-diagram_get_sorted_selected_remove(Diagram *dia)
+diagram_get_sorted_selected_remove (Diagram *dia)
 {
   diagram_modified(dia);
 
@@ -1523,17 +1572,28 @@ diagram_place_down_selected (Diagram *dia)
 }
 
 
-/** Returns a string with a 'sensible' (human-readable) name for the
- * diagram.  The string should be freed after use.
+/**
+ * diagram_get_name:
+ * @dia: the #Diagram
+ *
+ * Get the 'sensible' (human-readable) name for the
+ * diagram.
+ *
  * This name may or may not be the same as the filename.
+ *
+ * Returns: A newly allocated string
+ *
+ * Since: dawn-of-time
  */
-gchar *
-diagram_get_name(Diagram *dia)
+char *
+diagram_get_name (Diagram *dia)
 {
-  return g_path_get_basename(dia->filename);
+  return g_path_get_basename (dia->filename);
 }
 
-int diagram_modified_exists(void)
+
+int
+diagram_modified_exists (void)
 {
   GList *list;
   Diagram *dia;
diff --git a/app/diagram.h b/app/diagram.h
index ef981312..1edc26fd 100644
--- a/app/diagram.h
+++ b/app/diagram.h
@@ -63,8 +63,11 @@ struct _Diagram {
 };
 
 typedef struct _DiagramClass {
+  /*< private >*/
   DiagramDataClass parent_class;
 
+  /*< public >*/
+
   /* signals */
   void (* removed)           (Diagram*);
 
diff --git a/app/diapagelayout.h b/app/diapagelayout.h
index 8ae7c21d..aa2de2f5 100644
--- a/app/diapagelayout.h
+++ b/app/diapagelayout.h
@@ -29,6 +29,13 @@ typedef struct _DiaPageLayout DiaPageLayout;
 GType      dia_page_layout_get_type    (void);
 #define DIA_PAGE_LAYOUT(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, dia_page_layout_get_type(), DiaPageLayout)
 
+/**
+ * DiaPageOrientation:
+ * @DIA_PAGE_ORIENT_PORTRAIT: The page is portrait
+ * @DIA_PAGE_ORIENT_LANDSCAPE: The page is landscape
+ *
+ * Since: dawn-of-time
+ */
 typedef enum {
   DIA_PAGE_ORIENT_PORTRAIT,
   DIA_PAGE_ORIENT_LANDSCAPE
diff --git a/app/disp_callbacks.c b/app/disp_callbacks.c
index 000aa9ce..ff273b61 100644
--- a/app/disp_callbacks.c
+++ b/app/disp_callbacks.c
@@ -661,27 +661,31 @@ _scroll_step (DDisplay *ddisp, guint keyval)
     ddisplay_flush(ddisp);
     break;
   default :
-    g_assert_not_reached  ();
+    g_assert_not_reached ();
   }
 }
 
-/** Cleanup/Remove Timeout Handler for Button Press and Hold
+
+/*
+ * Cleanup/Remove Timeout Handler for Button Press and Hold
  */
 static void
-hold_remove_handler(void)
+hold_remove_handler (void)
 {
   if (hold_data.tag != 0) {
-    g_source_remove(hold_data.tag);
+    g_source_remove (hold_data.tag);
     hold_data.tag = 0;
-    gdk_event_free(hold_data.event);
+    gdk_event_free (hold_data.event);
   }
 }
 
-/** Timeout Handler for Button Press and Hold
+
+/*
+ * Timeout Handler for Button Press and Hold
  * If this function is called, then the button must still be down,
  * indicating that the user has pressed and held the button, but not moved
  * the pointer (mouse).
- * Dynamic data is cleaned up in ddisplay_canvas_events
+ * Dynamic data is cleaned up in ddisplay_canvas_events()
  */
 static gboolean
 hold_timeout_handler(gpointer data)
@@ -695,10 +699,15 @@ hold_timeout_handler(gpointer data)
 
 /**
  * ddisplay_canvas_events:
+ * @canvas: the canvas
+ * @event: the #GdkEvent received
+ * @ddisp: the #DDisplay
  *
  * Main input handler for a diagram canvas.
+ *
+ * Since: dawn-of-time
  */
-gint
+int
 ddisplay_canvas_events (GtkWidget *canvas,
                         GdkEvent  *event,
                         DDisplay  *ddisp)
diff --git a/app/disp_callbacks.h b/app/disp_callbacks.h
index 84c5a25a..ab2eb8a7 100644
--- a/app/disp_callbacks.h
+++ b/app/disp_callbacks.h
@@ -27,11 +27,14 @@ gint ddisplay_focus_out_event (GtkWidget *widget, GdkEventFocus *event,
 void ddisplay_realize (GtkWidget *widget, gpointer data);
 void ddisplay_unrealize (GtkWidget *widget, gpointer data);
 
-gint ddisplay_canvas_events (GtkWidget *, GdkEvent *, DDisplay *ddisp);
+int ddisplay_canvas_events (GtkWidget *canvas,
+                            GdkEvent  *event,
+                            DDisplay  *ddisp);
+
 void ddisplay_popup_menu(DDisplay *ddisp, GdkEventButton *event);
-gint ddisplay_hsb_update (GtkAdjustment *adjustment, DDisplay *ddisp);
-gint ddisplay_vsb_update (GtkAdjustment *adjustment, DDisplay *ddisp);
-gint ddisplay_delete (GtkWidget *widget, GdkEvent  *event, gpointer data);
+int ddisplay_hsb_update (GtkAdjustment *adjustment, DDisplay *ddisp);
+int ddisplay_vsb_update (GtkAdjustment *adjustment, DDisplay *ddisp);
+int ddisplay_delete (GtkWidget *widget, GdkEvent  *event, gpointer data);
 void ddisplay_destroy (GtkWidget *widget, gpointer data);
 
 DiaObject *ddisplay_drop_object(DDisplay *ddisp, gint x, gint y, DiaObjectType *otype,
diff --git a/app/display.c b/app/display.c
index 8564fc0e..b82fb5b3 100644
--- a/app/display.c
+++ b/app/display.c
@@ -126,19 +126,24 @@ selection_changed (Diagram *dia, int n, DDisplay *ddisp)
 }
 
 
-/** Initialize the various GTK-level thinks in a display after the internal
- *  data has been set.
- * @param ddisp A display with all non-GTK/GDK items set.
+/**
+ * initialize_display_widgets:
+ * @ddisp: A #DDisplay with all non-GTK/GDK items set.
+ *
+ * Initialize the various GTK-level thinks in a display after the internal
+ * data has been set.
+ *
+ * Since: dawn-of-time
  */
 static void
-initialize_display_widgets(DDisplay *ddisp)
+initialize_display_widgets (DDisplay *ddisp)
 {
   Diagram *dia = ddisp->diagram;
-  gchar *filename;
+  char *filename;
 
   g_return_if_fail (dia && dia->filename);
 
-  ddisp->im_context = gtk_im_multicontext_new();
+  ddisp->im_context = gtk_im_multicontext_new ();
   g_signal_connect (G_OBJECT (ddisp->im_context), "commit",
                     G_CALLBACK (ddisplay_im_context_commit), ddisp);
   ddisp->preedit_string = NULL;
@@ -147,40 +152,49 @@ initialize_display_widgets(DDisplay *ddisp)
                     ddisp);
   ddisp->preedit_attrs = NULL;
 
-  filename = strrchr(dia->filename, G_DIR_SEPARATOR);
+  filename = strrchr (dia->filename, G_DIR_SEPARATOR);
   if (filename==NULL) {
     filename = dia->filename;
   } else {
     filename++;
   }
-  create_display_shell(ddisp, prefs.new_view.width, prefs.new_view.height,
-                      filename, prefs.new_view.use_menu_bar);
+
+  create_display_shell (ddisp,
+                        prefs.new_view.width,
+                        prefs.new_view.height,
+                        filename,
+                        prefs.new_view.use_menu_bar);
 
   ddisplay_update_statusbar (ddisp);
 
-  ddisplay_set_cursor(ddisp, current_cursor);
+  ddisplay_set_cursor (ddisp, current_cursor);
 }
 
-/** Make a copy of an existing display.  The original does not need to have
- *  the various GTK-related fields initialized, and so can just have been read
- *  from a savefile.
- *  Note that size and position are not handled here yet, but taken from prefs.
- * @param A display object with non-GTK/GDK fields initialized (same fields as
- *  new_display initializes before calling initialize_display_widgets()).
- * @returns A newly allocated display, inserted into the diagram list, with
- *  same basic layout as the original.
+
+/**
+ * copy_display:
+ * @orig_ddisp: the #DDisplay to copy
+ *
+ * Make a copy of an existing display. The original does not need to have
+ * the various GTK-related fields initialized, and so can just have been read
+ * from a savefile.
+ *
+ * Returns: A newly allocated #DDisplay, inserted into the diagram list, with
+ *          same basic layout as the original.
+ *
+ * Since: dawn-of-time
  */
 DDisplay *
-copy_display(DDisplay *orig_ddisp)
+copy_display (DDisplay *orig_ddisp)
 {
   DDisplay *ddisp;
   Diagram *dia = orig_ddisp->diagram;
 
-  ddisp = g_new0(DDisplay,1);
+  ddisp = g_new0 (DDisplay,1);
 
   ddisp->diagram = orig_ddisp->diagram;
   /* Every display has its own reference */
-  g_object_ref(dia);
+  g_object_ref (dia);
 
   ddisp->grid = orig_ddisp->grid;
 
@@ -207,9 +221,15 @@ copy_display(DDisplay *orig_ddisp)
 }
 
 
-/** Create a new display for a diagram, using prefs settings.
- * @param dia Otherwise initialize diagram to create a display for.
- * @returns A newly created display.
+/**
+ * new_display:
+ * @dia: #Diagram the #DDisplay is for
+ *
+ * Create a new display for a diagram, using prefs settings.
+ *
+ * Returns: A newly created display.
+ *
+ * Since: dawn-of-time
  */
 DDisplay *
 new_display(Diagram *dia)
@@ -386,16 +406,23 @@ ddisplay_free_update_areas (DDisplay *ddisp)
 }
 
 
-/** Marks the entire visible area for update.
+/**
+ * ddisplay_add_update_all:
+ * @ddisp: the #DDisplay
+ *
+ * Marks the entire visible area for update.
  * Throws out old updates, since everything will be updated anyway.
+ *
+ * Since: dawn-of-time
  */
 void
-ddisplay_add_update_all(DDisplay *ddisp)
+ddisplay_add_update_all (DDisplay *ddisp)
 {
   if (ddisp->update_areas != NULL) {
-    ddisplay_free_update_areas(ddisp);
+    ddisplay_free_update_areas (ddisp);
   }
-  ddisplay_add_update(ddisp, &ddisp->visible);
+
+  ddisplay_add_update (ddisp, &ddisp->visible);
 }
 
 
@@ -1035,11 +1062,14 @@ ddisplay_present_object (DDisplay *ddisp, DiaObject *obj)
 
 
 /**
+ * ddisplay_set_clicked_point:
  * @ddisp: the #DDisplay
  * @x: the x position
  * @y: the y position
  *
  * Remember the last clicked point given in pixel coodinates
+ *
+ * Since: dawn-of-time
  */
 void
 ddisplay_set_clicked_point (DDisplay *ddisp, int x, int y)
@@ -1054,7 +1084,7 @@ ddisplay_set_clicked_point (DDisplay *ddisp, int x, int y)
 
 /**
  * ddisplay_get_clicked_position:
- * @ddisp: the #DDisp
+ * @ddisp: the #DDisplay
  *
  * Get the last clicked point in diagram coordinates
  */
@@ -1417,61 +1447,79 @@ ddisplay_set_cursor(DDisplay *ddisp, GdkCursor *cursor)
     gdk_window_set_cursor(gtk_widget_get_window(ddisp->canvas), cursor);
 }
 
-/** Returns whether the rulers are currently showing on the display.
+
+/**
+ * display_get_rulers_showing:
+ * @ddisp: the #DDisplay
+ *
+ * Returns: whether the rulers are currently showing on the display.
  */
-gboolean display_get_rulers_showing(DDisplay *ddisp) {
+gboolean
+display_get_rulers_showing (DDisplay *ddisp) {
   return ddisp->rulers_are_showing;
 }
 
 
 /**
+ * display_rulers_show:
+ * @ddisp: The #DDisplay to show the rulers on.
+ *
  * Shows the rulers and sets flag ddisp->rulers_are_showing.  This
  * is needed to detect whether a show() has been issued.  There is a
  * delay between the time that gtk_widget_show() is called and the time
  * when GTK_WIDGET_IS_VISIBLE(w) will indicate true.
- * @param ddisp The display to show the rulers on.
+ *
+ * Since: dawn-of-time
  */
-void display_rulers_show (DDisplay *ddisp)
+void
+display_rulers_show (DDisplay *ddisp)
 {
-  if (ddisp)
-  {
+  if (ddisp) {
     GtkWidget *parent = gtk_widget_get_parent (GTK_WIDGET (ddisp->origin));
 
     gtk_widget_show (ddisp->origin);
     gtk_widget_show (ddisp->hrule);
     gtk_widget_show (ddisp->vrule);
 
-    if (gtk_widget_get_visible (parent))
+    if (gtk_widget_get_visible (parent)) {
       gtk_widget_queue_resize (parent);
+    }
 
     ddisp->rulers_are_showing = TRUE;
   }
 }
 
+
 /**
- * Hides the rulers and resets the flag ddisp->rulers_are_showing.  This
- * is needed to detect whether a hide() has been issued.  There is a
+ * display_rulers_hide:
+ * @ddisp: The #DDisplay to hide the rulers on.
+ *
+ * Hides the rulers and resets the flag ddisp->rulers_are_showing. This
+ * is needed to detect whether a hide() has been issued. There is a
  * delay between the time that gtk_widget_hide() is called and the time
  * when GTK_WIDGET_IS_VISIBLE(w) will indicate false.
- * @param ddisp The display to hide the rulers on.
+ *
+ * Since: dawn-of-time
  */
-void display_rulers_hide (DDisplay *ddisp)
+void
+display_rulers_hide (DDisplay *ddisp)
 {
-  if (ddisp)
-  {
+  if (ddisp) {
     GtkWidget *parent = gtk_widget_get_parent (GTK_WIDGET (ddisp->origin));
 
     gtk_widget_hide (ddisp->origin);
     gtk_widget_hide (ddisp->hrule);
     gtk_widget_hide (ddisp->vrule);
 
-    if (gtk_widget_get_visible (parent))
+    if (gtk_widget_get_visible (parent)) {
       gtk_widget_queue_resize (parent);
+    }
 
     ddisp->rulers_are_showing = FALSE;
   }
 }
 
+
 void
 ddisplay_update_statusbar(DDisplay *ddisp)
 {
@@ -1566,15 +1614,21 @@ ddisplay_im_context_preedit_reset(DDisplay *ddisp, Focus *focus)
   g_clear_pointer (&ddisp->preedit_attrs, pango_attr_list_unref);
 }
 
-/** Get the active focus for the given display, or NULL.
+
+/**
+ * ddisplay_active_focus:
+ * @ddisp: #DDisplay to get active focus for. This display need not be the
+ *         currently active display.
+ *
+ * Get the active focus for the given display, or %NULL.
  *
- * @param ddisp Display to get active focus for.  This display need not
- *              be the currently active display.
- * @returns The focus that is active for the given display, or NULL if no
+ * Returns: The focus that is active for the given display, or %NULL if no
  *          focus is active (i.e. no text is being edited).
+ *
+ * Since: dawn-of-time
  */
 Focus *
-ddisplay_active_focus(DDisplay *ddisp)
+ddisplay_active_focus (DDisplay *ddisp)
 {
   /* The functions doing the transition rely on this being slightly
    * out of sync with get_active_focus(). But we would not need the
@@ -1583,21 +1637,26 @@ ddisplay_active_focus(DDisplay *ddisp)
   return ddisp ? ddisp->active_focus : NULL;
 }
 
-/** Set the currently active focus for this display.  This field should be
- *  set to non-null when a text is being edited and to null when no text
- *  is being edited.  Only textedit.c really needs to call this function.
+
+/**
+ * ddisplay_set_active_focus:
+ * @ddisp: The display to set active focus for.
+ * @focus: The focus that should be active for this display. May be %NULL,
+ *         indicating that no text is currently being edited on this display.
  *
- * @param ddisp The display to set active focus for.
- * @param focus The focus that should be active for this display.  May be
- *              NULL, indicating that no text is currently being edited on
- *              this display.
+ * Set the currently active focus for this display. This field should be
+ * set to non-%NULL when a text is being edited and to %NULL when no text
+ * is being edited.  Only textedit.c really needs to call this function.
+ *
+ * Since: dawn-of-time
  */
 void
-ddisplay_set_active_focus(DDisplay *ddisp, Focus *focus)
+ddisplay_set_active_focus (DDisplay *ddisp, Focus *focus)
 {
   ddisp->active_focus = focus;
 }
 
+
 void
 ddisplay_show_all (DDisplay *ddisp)
 {
diff --git a/app/display.h b/app/display.h
index 4c5a5b8c..883dc044 100644
--- a/app/display.h
+++ b/app/display.h
@@ -29,9 +29,11 @@ typedef struct _DDisplay DDisplay;
 
 G_BEGIN_DECLS
 
-/** Defines the pixels per cm, default is 20 pixels = 1 cm */
-/** This is close to, but not quite the same as, the physical display size
- * in most cases */
+/*
+ * Defines the pixels per cm, default is 20 pixels = 1 cm
+ * This is close to, but not quite the same as, the physical display size
+ * in most cases
+ */
 
 #define DDISPLAY_MAX_ZOOM 2000.0
 #define DDISPLAY_NORMAL_ZOOM 20.0
diff --git a/app/exit_dialog.c b/app/exit_dialog.c
index 7e3b6747..a68a6fce 100644
--- a/app/exit_dialog.c
+++ b/app/exit_dialog.c
@@ -89,9 +89,11 @@ clear_item (gpointer data)
 
 
 /**
- * Gets the list of items selected for saving by the user.
+ * get_selected_items:
  * @self: the #DiaExitDialog
  *
+ * Gets the list of items selected for saving by the user.
+ *
  * Returns: The selected items.
  *
  * Since: 0.98
@@ -321,7 +323,7 @@ dia_exit_dialog_new (GtkWindow *parent)
  * dia_exit_dialog_add_item:
  * @self: the #DiaExitDialog
  * @name: User identifiable name of the thing which needs saving.
- * @path: File system path of the thing which needs saving.
+ * @filepath: File system path of the thing which needs saving.
  * @diagram: The unsaved #Diagram
  *
  * Add name and path of a file that needs to be saved
diff --git a/app/exit_dialog.h b/app/exit_dialog.h
index 3307f638..a221374b 100644
--- a/app/exit_dialog.h
+++ b/app/exit_dialog.h
@@ -45,6 +45,12 @@ typedef enum /*< enum,prefix=DIA >*/
 } DiaExitDialogResult;
 
 
+/**
+ * DiaExitDialogItem:
+ * @name: the name of the item, show in the dialogue
+ * @path: the full path of the item, show in the tooltop
+ * @data: the #Diagram itself
+ */
 typedef struct {
   char    *name;
   char    *path;
diff --git a/app/filedlg.c b/app/filedlg.c
index fca3caf0..4f06469c 100644
--- a/app/filedlg.c
+++ b/app/filedlg.c
@@ -63,9 +63,16 @@ toggle_compress_callback(GtkWidget *widget)
     gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
 }
 
+
 /**
+ * ifilter_by_index:
+ * @index: the index of the #DiaImportFilter to get
+ * @filename: filename to guess a filter for
+ *
  * Given an import filter index and optionally a filename for fallback
  * return the import filter to use
+ *
+ * Since: dawn-of-time
  */
 static DiaImportFilter *
 ifilter_by_index (int index, const char* filename)
@@ -82,15 +89,22 @@ ifilter_by_index (int index, const char* filename)
 
 typedef void* (* FilterGuessFunc) (const gchar* filename);
 
+
 /**
+ * matching_extensions_filter:
+ * @fi: the #GtkFileFilterInfo
+ * @data: the filter function
+ *
  * Respond to the file chooser filter facility, that is match
  * the extension of a given filename to the selected filter
+ *
+ * Since: dawn-of-time
  */
 static gboolean
 matching_extensions_filter (const GtkFileFilterInfo* fi,
-                            gpointer               data)
+                            gpointer                 data)
 {
-  FilterGuessFunc guess_func = (FilterGuessFunc)data;
+  FilterGuessFunc guess_func = (FilterGuessFunc) data;
 
   g_assert (guess_func);
 
@@ -103,7 +117,12 @@ matching_extensions_filter (const GtkFileFilterInfo* fi,
   return 0;
 }
 
+
 /**
+ * diagram_removed:
+ * @dia: the #Diagram
+ * @dialog: the dialogue
+ *
  * React on the diagram::removed signal by destroying the dialog
  *
  * This function isn't used cause it conflicts with the pattern introduced:
@@ -178,11 +197,16 @@ import_adapt_extension_callback(GtkWidget *widget)
   }
 }
 
+
 /**
+ * create_open_menu:
+ *
  * Create the combobox menu to select Import Filter options
+ *
+ * Since: dawn-of-time
  */
 static GtkWidget *
-create_open_menu(void)
+create_open_menu (void)
 {
   GtkWidget *menu;
   GList *tmp;
@@ -206,19 +230,27 @@ create_open_menu(void)
   return menu;
 }
 
+
 /**
+ * file_open_response_callback:
+ * @fs: the #GtkFileChooser
+ * @response: the response
+ * @user_data: the user data
+ *
  * Respond to the user finishing the Open Dialog either accept or cancel/destroy
+ *
+ * Since: dawn-of-time
  */
 static void
-file_open_response_callback(GtkWidget *fs,
-                            gint       response,
-                            gpointer   user_data)
+file_open_response_callback (GtkWidget *fs,
+                             int        response,
+                             gpointer   user_data)
 {
   char *filename;
   Diagram *diagram = NULL;
 
   if (response == GTK_RESPONSE_ACCEPT) {
-    gint index = gtk_combo_box_get_active (GTK_COMBO_BOX(user_data));
+    int index = gtk_combo_box_get_active (GTK_COMBO_BOX (user_data));
 
     if (index >= 0) /* remember it */
       persistence_set_integer ("import-filter", index);
@@ -251,13 +283,19 @@ file_open_response_callback(GtkWidget *fs,
   gtk_widget_destroy(opendlg);
 }
 
+
 /**
+ * file_open_callback:
+ * @action: the #GtkAction
+ *
  * Handle menu click File/Open
  *
  * This is either with or without diagram
+ *
+ * Since: dawn-of-time
  */
 void
-file_open_callback(GtkAction *action)
+file_open_callback (GtkAction *action)
 {
   if (!opendlg) {
     DDisplay *ddisp;
@@ -348,8 +386,16 @@ file_open_callback(GtkAction *action)
   gtk_widget_show(opendlg);
 }
 
+
 /**
+ * file_save_as_response_callback:
+ * @fs: the #GtkFileChooser
+ * @response: the response
+ * @user_data: the user data
+ *
  * Respond to a button press (also destroy) in the save as dialog.
+ *
+ * Since: dawn-of-time
  */
 static void
 file_save_as_response_callback(GtkWidget *fs,
@@ -436,29 +482,36 @@ file_save_as_response_callback(GtkWidget *fs,
 
 static GtkWidget *file_save_as_dialog_prepare (Diagram *dia, DDisplay *ddisp);
 
+
 /**
+ * file_save_as_callback:
+ * @action: the #GtkAction
+ *
  * Respond to the File/Save As.. menu
  *
  * We have only one file save dialog at a time. So if the dialog alread exists
  * and the user tries to Save as once more only the diagram refernced will
  * change. Maybe we should also indicate the refernced diagram in the dialog.
+ *
+ * Since: dawn-of-time
  */
 void
-file_save_as_callback(GtkAction *action)
+file_save_as_callback (GtkAction *action)
 {
   DDisplay  *ddisp;
   Diagram   *dia;
   GtkWidget *dlg;
 
-  ddisp = ddisplay_active();
+  ddisp = ddisplay_active ();
   if (!ddisp) return;
   dia = ddisp->diagram;
 
-  dlg = file_save_as_dialog_prepare(dia, ddisp);
+  dlg = file_save_as_dialog_prepare (dia, ddisp);
 
-  gtk_widget_show(dlg);
+  gtk_widget_show (dlg);
 }
 
+
 gboolean
 file_save_as(Diagram *dia, DDisplay *ddisp)
 {
@@ -557,37 +610,56 @@ file_save_as_dialog_prepare (Diagram *dia, DDisplay *ddisp)
   return savedlg;
 }
 
-/**
+
+/*
+ * file_save_callback:
+ * @action: the #GtkAction
+ *
  * Respond to the File/Save menu entry.
  *
  * Delegates to Save As if there is no filename set yet.
+ *
+ * Since: dawn-of-time
  */
 void
-file_save_callback(GtkAction *action)
+file_save_callback (GtkAction *action)
 {
   Diagram *diagram;
 
-  diagram = ddisplay_active_diagram();
+  diagram = ddisplay_active_diagram ();
   if (!diagram) return;
 
   if (diagram->unsaved) {
-    file_save_as_callback(action);
+    file_save_as_callback (action);
   } else {
-    gchar *filename = g_filename_from_utf8(diagram->filename, -1, NULL, NULL, NULL);
+    char *filename = g_filename_from_utf8 (diagram->filename,
+                                           -1,
+                                           NULL,
+                                           NULL,
+                                           NULL);
     DiaContext *ctx = dia_context_new (_("Save"));
-    diagram_update_extents(diagram);
-    if (diagram_save(diagram, filename, ctx))
-      recent_file_history_add(filename);
+
+    diagram_update_extents (diagram);
+    if (diagram_save (diagram, filename, ctx)) {
+      recent_file_history_add (filename);
+    }
+
     g_clear_pointer (&filename, g_free);
+
     dia_context_release (ctx);
   }
 }
 
-/**
+
+/*
+ * efilter_by_index:
+ * @index: filter index
+ * @ext: (out): the extension of the output
+ *
  * Given an export filter index return the export filter to use
  */
 static DiaExportFilter *
-efilter_by_index (int index, const gchar** ext)
+efilter_by_index (int index, const char **ext)
 {
   DiaExportFilter *efilter = NULL;
 
@@ -596,22 +668,31 @@ efilter_by_index (int index, const gchar** ext)
   if (index >= 0) {
     efilter = g_list_nth_data (filter_get_export_filters(), index);
     if (efilter) {
-      if (ext)
+      if (ext) {
         *ext = efilter->extensions[0];
+      }
       return efilter;
-    }
-    else /* getting here means invalid index */
+    } else {
+      /* getting here means invalid index */
       g_warning ("efilter_by_index() index=%d out of range", index);
+    }
   }
 
   return efilter;
 }
 
+
 /**
+ * export_adapt_extension:
+ * @name: the filename
+ * @index: the index of the filter
+ *
  * Adapt the filename to the export filter index
+ *
+ * Since: dawn-of-time
  */
 static void
-export_adapt_extension (const gchar* name, int index)
+export_adapt_extension (const char* name, int index)
 {
   const gchar* ext = NULL;
   DiaExportFilter *efilter = efilter_by_index (index, &ext);
@@ -647,7 +728,10 @@ export_adapt_extension_callback(GtkWidget *widget)
   g_clear_pointer (&name, g_free);
 }
 
+
 /**
+ * create_export_menu:
+ *
  * Create a new "option menu" for the export options
  */
 static GtkWidget *
@@ -675,13 +759,21 @@ create_export_menu (void)
   return menu;
 }
 
+
 /**
+ * file_export_response_callback:
+ * @fs: the #GtkFileChooser
+ * @response: the response
+ * @user_data: the user data
+ *
  * A button hit in the Export Dialog
+ *
+ * Since: dawn-of-time
  */
 static void
-file_export_response_callback(GtkWidget *fs,
-                              gint       response,
-                              gpointer   user_data)
+file_export_response_callback (GtkWidget *fs,
+                               int        response,
+                               gpointer   user_data)
 {
   char *filename;
   Diagram *dia;
@@ -756,16 +848,21 @@ file_export_response_callback(GtkWidget *fs,
 
 
 /**
- * React to <Display>/File/Export
+ * file_export_callback:
+ * @action: the #GtkAction
+ *
+ * React to `<Display>/File/Export`
+ *
+ * Since: dawn-of-time
  */
 void
-file_export_callback(GtkAction *action)
+file_export_callback (GtkAction *action)
 {
   DDisplay *ddisp;
   Diagram *dia;
   gchar *filename = NULL;
 
-  ddisp = ddisplay_active();
+  ddisp = ddisplay_active ();
   if (!ddisp) return;
   dia = ddisp->diagram;
 
diff --git a/app/find-and-replace.c b/app/find-and-replace.c
index fe692c59..9250fa88 100644
--- a/app/find-and-replace.c
+++ b/app/find-and-replace.c
@@ -523,11 +523,17 @@ fnr_dialog_setup_common (GtkWidget *dialog, gboolean is_replace, DDisplay *ddisp
   gtk_widget_show_all (vbox);
 }
 
+
 /**
- * React to <Display>/Edit/Find
+ * edit_find_callback:
+ * @action: the #GtkAction
+ *
+ * React to `<Display>/Edit/Find`
+ *
+ * Since: dawn-of-time
  */
 void
-edit_find_callback(GtkAction *action)
+edit_find_callback (GtkAction *action)
 {
   DDisplay *ddisp;
   GtkWidget *dialog;
@@ -552,8 +558,14 @@ edit_find_callback(GtkAction *action)
   gtk_dialog_run (GTK_DIALOG (dialog));
 }
 
+
 /**
- * React to <Display>/Edit/Replace
+ * edit_replace_callback:
+ * @action: the #GtkAction
+ *
+ * React to `<Display>/Edit/Replace`
+ *
+ * Since: dawn-of-time
  */
 void
 edit_replace_callback(GtkAction *action)
diff --git a/app/grid.c b/app/grid.c
index 36027574..bc8d4bbe 100644
--- a/app/grid.c
+++ b/app/grid.c
@@ -28,11 +28,18 @@
 #include "preferences.h"
 #include "diainteractiverenderer.h"
 
-/** Calculate the width (in cm) of the gap between grid lines in dynamic
+
+/**
+ * calculate_dynamic_grid:
+ * @ddisp: the #DDisplay
+ * @width_x: (out): the grid width x
+ * @width_y: (out): the grid width y
+ *
+ * Calculate the width (in cm) of the gap between grid lines in dynamic
  * grid mode.
  */
 static void
-calculate_dynamic_grid(DDisplay *ddisp, real *width_x, real *width_y)
+calculate_dynamic_grid (DDisplay *ddisp, double *width_x, double *width_y)
 {
   real zoom = ddisplay_untransform_length(ddisp, 1.0);
   real ret, tmp;
diff --git a/app/highlight.c b/app/highlight.c
index e04d31ff..86fba10a 100644
--- a/app/highlight.c
+++ b/app/highlight.c
@@ -56,17 +56,25 @@ highlight_object_off(DiaObject *obj, Diagram *dia)
   data_highlight_remove(dia->data, obj);
 }
 
-/** Resets all highlighting in this layer.  Helper function for
+
+/**
+ * highlight_reset_objects:
+ * @objects: objects to reset
+ * @dia: the #Diagram
+ *
+ * Resets all highlighting in this layer. Helper function for
  * highlight_reset_all
+ *
+ * Since: dawn-of-time
  */
 static void
-highlight_reset_objects(GList *objects, Diagram *dia)
+highlight_reset_objects (GList *objects, Diagram *dia)
 {
-  for (; objects != NULL; objects = g_list_next(objects)) {
-    DiaObject *object = (DiaObject*)objects->data;
-    highlight_object_off(object, dia);
-    if (IS_GROUP(object)) {
-      highlight_reset_objects(group_objects(object), dia);
+  for (; objects != NULL; objects = g_list_next (objects)) {
+    DiaObject *object = DIA_OBJECT (objects->data);
+    highlight_object_off (object, dia);
+    if (IS_GROUP (object)) {
+      highlight_reset_objects (group_objects (object), dia);
     }
   }
 }
diff --git a/app/highlight.h b/app/highlight.h
index 8913de6b..4e82f9b9 100644
--- a/app/highlight.h
+++ b/app/highlight.h
@@ -27,12 +27,14 @@
 /* Each object holds the color it is highlighted with.
  */
 
-/** Set an object to be highlighted with a color border..
+/*
+ * Set an object to be highlighted with a color border..
  * If color is NULL, a standard #FF0000 color (red) is used.
  * The exact method used for highlighting depends on the renderer.
  */
 void highlight_object(DiaObject *obj, DiaHighlightType type, Diagram *dia);
-/** Remove highlighting from an object.
+/*
+ * Remove highlighting from an object.
  */
 void highlight_object_off(DiaObject *obj, Diagram *dia);
 /** Reset a diagram to have no highlighted objects */
diff --git a/app/interface.c b/app/interface.c
index 58461b91..e20ffbd5 100644
--- a/app/interface.c
+++ b/app/interface.c
@@ -146,26 +146,32 @@ dia_dnd_file_drag_data_received (GtkWidget        *widget,
 
 static GtkWidget *toolbox_shell = NULL;
 
-static struct
-{
-    GtkWindow    * main_window;
-    GtkToolbar   * toolbar;
-    GtkNotebook  * diagram_notebook;
-    GtkStatusbar * statusbar;
-    GtkWidget    * layer_view;
+static struct {
+  GtkWindow    *main_window;
+  GtkToolbar   *toolbar;
+  GtkNotebook  *diagram_notebook;
+  GtkStatusbar *statusbar;
+  GtkWidget    *layer_view;
 } ui;
 
+
 /**
- * Used to determine if the current user interface is the integrated interface or
- * the distributed interface.  This cannot presently be determined by the preferences
- * setting because changing that setting at run time does not change the interface.
- * @return Non-zero if the integrated interface is present, else zero.
+ * is_integrated_ui:
+ *
+ * Used to determine if the current user interface is the integrated interface
+ * or the distributed interface.  This cannot presently be determined by the
+ * preferences setting because changing that setting at run time does not
+ * change the interface.
+ *
+ * Returns: %TRUE if the integrated interface is present, else %FALSE.
  */
-int is_integrated_ui (void)
+int
+is_integrated_ui (void)
 {
-  return ui.main_window == NULL? 0 : 1;
+  return ui.main_window == NULL ? FALSE : TRUE;
 }
 
+
 static void
 grid_toggle_snap(GtkWidget *widget, gpointer data)
 {
@@ -368,21 +374,26 @@ display_data_received_callback (GtkWidget *widget,
   gtk_window_present(GTK_WINDOW(ddisp->shell));
 }
 
+
 /**
- * @param button The notebook close button.
- * @param user_data Container widget (e.g. VBox).
+ * close_notebook_page_callback:
+ * @button: The notebook close button.
+ * @user_data: Container widget (e.g. VBox).
+ *
+ * Since: dawn-of-time
  */
 void
 close_notebook_page_callback (GtkButton *button,
                               gpointer   user_data)
 {
-  GtkBox      *page     = user_data;
-  DDisplay    *ddisp    = g_object_get_data (G_OBJECT (page), "DDisplay");
+  GtkBox *page = user_data;
+  DDisplay *ddisp = g_object_get_data (G_OBJECT (page), "DDisplay");
 
   /* When the page widget is destroyed it removes itself from the notebook */
   ddisplay_close (ddisp);
 }
 
+
 static void
 notebook_switch_page (GtkNotebook *notebook,
                       GtkWidget   *page,
@@ -640,12 +651,16 @@ _ddisplay_setup_navigation (DDisplay *ddisp, GtkWidget *table, gboolean top_left
     ddisp->origin = g_object_ref (navigation_button);
 }
 
+
 /**
- * @param ddisp The diagram display object that a window is created for
- * @param title
+ * use_integrated_ui_for_display_shell:
+ * @ddisp: The diagram #DDisplay object that a window is created for
+ * @title: the title
+ *
+ * Since: dawn-of-time
  */
 static void
-use_integrated_ui_for_display_shell(DDisplay *ddisp, char *title)
+use_integrated_ui_for_display_shell (DDisplay *ddisp, char *title)
 {
   GtkWidget *table;
   GtkWidget *label;                /* Text label for the notebook page */
@@ -756,17 +771,23 @@ use_integrated_ui_for_display_shell(DDisplay *ddisp, char *title)
   gtk_widget_grab_focus (ddisp->canvas);
 }
 
+
 /**
- * @param ddisp The diagram display object that a window is created for
- * @param width Diagram widgth
- * @param height Diagram Height
- * @param title Window title
- * @param use_mbar Flag to indicate whether to add a menubar to the window
+ * create_display_shell:
+ * @ddisp: The diagram display object that a window is created for
+ * @width: Diagram widgth
+ * @height: Diagram Height
+ * @title: Window title
+ * @use_mbar: Flag to indicate whether to add a menubar to the window
+ *
+ * Since: dawn-of-time
  */
 void
-create_display_shell(DDisplay *ddisp,
-                    int width, int height,
-                    char *title, int use_mbar)
+create_display_shell (DDisplay *ddisp,
+                      int       width,
+                      int       height,
+                      char     *title,
+                      int       use_mbar)
 {
   GtkWidget *table, *widget;
   GtkWidget *status_hbox;
@@ -962,28 +983,35 @@ create_display_shell(DDisplay *ddisp,
   gtk_widget_grab_focus (ddisp->canvas);
 }
 
+
 /**
+ * ddisplay_update_rulers:
+ * @ddisp: The #DDisplay to hide the rulers on.
+ * @extents: the diagram extents
+ * @visible: the visible area
+ *
  * Adapt the rulers to current field of view
  *
- * @param ddisp The display to hide the rulers on.
+ * Since: dawn-of-time
  */
 void
 ddisplay_update_rulers (DDisplay           *ddisp,
                         const DiaRectangle *extents,
                         const DiaRectangle *visible)
 {
-  dia_ruler_set_range  (ddisp->hrule,
-                       visible->left,
-                       visible->right,
-                       0.0f /* position*/,
-                       MAX(extents->right, visible->right)/* max_size*/);
-  dia_ruler_set_range  (ddisp->vrule,
-                       visible->top,
-                       visible->bottom,
-                       0.0f /*        position*/,
-                       MAX(extents->bottom, visible->bottom)/* max_size*/);
+  dia_ruler_set_range (ddisp->hrule,
+                       visible->left,
+                       visible->right,
+                       0.0f /* position*/,
+                       MAX (extents->right, visible->right)/* max_size*/);
+  dia_ruler_set_range (ddisp->vrule,
+                       visible->top,
+                       visible->bottom,
+                       0.0f /*        position*/,
+                       MAX (extents->bottom, visible->bottom)/* max_size*/);
 }
 
+
 static void
 toolbox_destroy (GtkWidget *widget, gpointer data)
 {
@@ -1062,8 +1090,13 @@ _create_mac_integration (GtkWidget *menubar)
 }
 #endif
 
+
 /**
+ * create_integrated_ui:
+ *
  * Create integrated user interface
+ *
+ * Since: dawn-of-time
  */
 void
 create_integrated_ui (void)
@@ -1177,8 +1210,13 @@ create_integrated_ui (void)
   toolbox_shell = window;
 }
 
+
 /**
+ * create_toolbox:
+ *
  * Create toolbox component for distributed user interface
+ *
+ * Since: dawn-of-time
  */
 void
 create_toolbox (void)
diff --git a/app/interface.h b/app/interface.h
index fe8f2931..9396efc8 100644
--- a/app/interface.h
+++ b/app/interface.h
@@ -55,8 +55,6 @@ extern GtkWidget *modify_tool_button;
 
 void view_zoom_set (double zoom_factor); /* zoom_factor is 10 * percentage */
 
-void fill_sheet_menu(void);
-
 void close_notebook_page_callback (GtkButton *button, gpointer user_data);
 
 double parse_zoom (const char *zoom);
diff --git a/app/layer-editor/dia-layer-editor-dialog.h b/app/layer-editor/dia-layer-editor-dialog.h
index 3832203f..8338bd84 100644
--- a/app/layer-editor/dia-layer-editor-dialog.h
+++ b/app/layer-editor/dia-layer-editor-dialog.h
@@ -30,6 +30,7 @@ G_BEGIN_DECLS
 G_DECLARE_DERIVABLE_TYPE (DiaLayerEditorDialog, dia_layer_editor_dialog, DIA, LAYER_EDITOR_DIALOG, GtkDialog)
 
 struct _DiaLayerEditorDialogClass {
+  /*< private >*/
   GtkDialogClass parent;
 };
 
diff --git a/app/layer-editor/dia-layer-editor.h b/app/layer-editor/dia-layer-editor.h
index fa048a59..1e5624ee 100644
--- a/app/layer-editor/dia-layer-editor.h
+++ b/app/layer-editor/dia-layer-editor.h
@@ -30,6 +30,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (GtkVBox, g_object_unref)
 G_DECLARE_DERIVABLE_TYPE (DiaLayerEditor, dia_layer_editor, DIA, LAYER_EDITOR, GtkVBox)
 
 struct _DiaLayerEditorClass {
+  /*< private >*/
   GtkVBoxClass parent;
 };
 
diff --git a/app/layer-editor/dia-layer-properties.h b/app/layer-editor/dia-layer-properties.h
index 8034aaca..ca80cfef 100644
--- a/app/layer-editor/dia-layer-properties.h
+++ b/app/layer-editor/dia-layer-properties.h
@@ -29,6 +29,7 @@ G_BEGIN_DECLS
 G_DECLARE_DERIVABLE_TYPE (DiaLayerProperties, dia_layer_properties, DIA, LAYER_PROPERTIES, GtkDialog)
 
 struct _DiaLayerPropertiesClass {
+  /*< private >*/
   GtkDialogClass parent;
 };
 
diff --git a/app/load_save.c b/app/load_save.c
index 4ec329db..f9816eac 100644
--- a/app/load_save.c
+++ b/app/load_save.c
@@ -101,6 +101,13 @@ GHFuncUnknownObjects (gpointer key,
 
 
 /**
+ * read_objects:
+ * @objects: node to read from
+ * @objects_hash: object id -> object of read objects
+ * @ctx: the current #DiaContent
+ * @parent: the parent #DiaObject
+ * @unknown_objects_hash: objects with unknown type
+ *
  * Recursive function to read objects from a specific level in the xml.
  *
  * Nowadays there are quite a few of them :
@@ -116,13 +123,15 @@ GHFuncUnknownObjects (gpointer key,
  *   themselves. But to maintain forward compatibility (allow to let older versions
  *   of Dia to see as much as possible) they were added all on the same level and
  *   the parent child relation is reconstructed from additional attributes.
+ *
+ * Since: dawn-of-time
  */
 static GList *
-read_objects(xmlNodePtr objects,
-             GHashTable *objects_hash,
-            DiaContext *ctx,
-            DiaObject *parent,
-            GHashTable *unknown_objects_hash)
+read_objects (xmlNodePtr objects,
+              GHashTable *objects_hash,
+              DiaContext *ctx,
+              DiaObject  *parent,
+              GHashTable *unknown_objects_hash)
 {
   GList *list;
   DiaObjectType *type;
@@ -1331,14 +1340,20 @@ _autosave_in_thread (gpointer data)
   return NULL;
 }
 
-/** Absolutely autosave a diagram.
+
+/**
+ * diagram_autosave:
+ * @dia: the #Diagram
+ *
+ * Absolutely autosave a diagram.
  * Called (in the GUI thread) after a periodic check at the first idleness.
  *
+ * Since: dawn-of-time
  */
 void
-diagram_autosave(Diagram *dia)
+diagram_autosave (Diagram *dia)
 {
-  gchar *save_filename;
+  char *save_filename;
 
   /* Must check if the diagram is still valid, or Death Ensues! */
   GList *diagrams = dia_open_diagrams();
diff --git a/app/modify_tool.c b/app/modify_tool.c
index d018abbf..5d1dfd25 100644
--- a/app/modify_tool.c
+++ b/app/modify_tool.c
@@ -408,7 +408,8 @@ modify_double_click(ModifyTool *tool, GdkEventButton *event,
 
 #define MIN_PIXELS 10
 
-/** Makes sure that objects aren't accidentally moved when double-clicking
+/*
+ * Makes sure that objects aren't accidentally moved when double-clicking
  * for properties.  Objects do not move unless double click time has passed
  * or the move is 'significant'.  Allowing the 'significant' move makes a
  * regular grab-and-move less jerky.
diff --git a/app/navigation.h b/app/navigation.h
index 558744ec..4418d44a 100644
--- a/app/navigation.h
+++ b/app/navigation.h
@@ -1,6 +1,6 @@
 /* Dia -- a diagram creation/manipulation program
  * Copyright (C) 1998 Alexander Larsson
- *  
+ *
  * $Id$
  *
  * navigation.h : a navigation popup window to browse large diagrams.
@@ -10,16 +10,16 @@
  * 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.
- *  
+ *
  */
 
 #ifndef NAVIGATION_H
@@ -29,17 +29,20 @@
 #include "display.h"
 
 /**
- * Returns a button which triggers a popup navigation window.
+ * navigation_popup_new:
+ * @ddisp: the #DDisplay to navigate through.
+ *
+ * A button which triggers a popup navigation window.
  *
  * The popup window is created when the button is "pressed",
  * and destroyed when the button is "released". In the meantime, the
  * popup window grabs the pointer/focus. Moving the mouse adjust the
  * scrollbars of the given #DDisplay accordingly.
  *
- * @ddisp: the #DDisplay to navigate through.
- *
  * Returns: a new #GtkButton.
- **/
-GtkWidget * navigation_popup_new (DDisplay *ddisp);
+ *
+ * Since: dawn-of-time
+ */
+GtkWidget *navigation_popup_new (DDisplay *ddisp);
 
 #endif
diff --git a/app/object_ops.c b/app/object_ops.c
index 3a7489da..897f73fc 100644
--- a/app/object_ops.c
+++ b/app/object_ops.c
@@ -66,20 +66,27 @@ object_add_updates_list(GList *list, Diagram *dia)
   }
 }
 
-/** Find a connectionpoint sufficiently close to the given point.
+
+/**
+ * object_find_connectpoint_display:
+ * @ddisp: The display to search
+ * @pos: A position in the display, typically mouse position
+ * @notthis: If not null, an object to ignore (typically the object
+ *           connecting)
+ * @snap_to_objects: Whether snapping to objects should be in effect
+ *                   in this call (anded to the display-wide setting).
+ *
+ * Find a connectionpoint sufficiently close to the given point.
  *
- * @param ddisp The display to search
- * @param pos A position in the display, typically mouse position
- * @param notthis If not null, an object to ignore (typically the object
- * connecting)
- * @param snap_to_objects Whether snapping to objects should be in effect
- * in this call (anded to the display-wide setting).
+ * Since: dawn-of-time
  */
 ConnectionPoint *
-object_find_connectpoint_display(DDisplay *ddisp, Point *pos,
-                                DiaObject *notthis, gboolean snap_to_objects)
+object_find_connectpoint_display (DDisplay  *ddisp,
+                                  Point     *pos,
+                                  DiaObject *notthis,
+                                  gboolean   snap_to_objects)
 {
-  real distance;
+  double distance;
   ConnectionPoint *connectionpoint;
   GList *avoid = NULL;
   DiaObject *obj_here;
diff --git a/app/properties-dialog.c b/app/properties-dialog.c
index 3efcf7f1..73f0653c 100644
--- a/app/properties-dialog.c
+++ b/app/properties-dialog.c
@@ -173,11 +173,18 @@ properties_respond(GtkWidget *widget,
   return 0;
 }
 
-/** Give focus to the first focusable widget found in `widget'.
- * @param widget Some (possibly composite) widget.
+
+/**
+ * properties_give_focus:
+ * @widget: Some (possibly composite) widget.
+ * @data: user data
+ *
+ * Give focus to the first focusable widget found in `widget'.
+ *
+ * Since: dawn-of-time
  */
 static void
-properties_give_focus(GtkWidget *widget, gpointer data)
+properties_give_focus (GtkWidget *widget, gpointer data)
 {
   if (gtk_widget_get_can_focus(widget)) {
     gtk_widget_grab_focus(widget);
diff --git a/app/recent_files.c b/app/recent_files.c
index e90b3006..a5bb1294 100644
--- a/app/recent_files.c
+++ b/app/recent_files.c
@@ -50,8 +50,13 @@ recent_file_history_clear_menu (void)
   menus_clear_recent ();
 }
 
+
 /**
+ * recent_file_history_make_menu:
+ *
  * Build and insert the recent files menu.
+ *
+ * Since: dawn-of-time
  */
 static void
 recent_file_history_make_menu (void)
diff --git a/app/select.c b/app/select.c
index 0686babd..24b806f7 100644
--- a/app/select.c
+++ b/app/select.c
@@ -103,14 +103,21 @@ select_invert_callback (GtkAction *action)
 
 }
 
-/** Select objects that are directly connected to the currently selected
+
+/**
+ * select_connected_callback:
+ * @action: the #GtkAction
+ *
+ * Select objects that are directly connected to the currently selected
  * objects, but only in the active layer.
+ *
+ * Since: dawn-of-time
  */
 void
-select_connected_callback(GtkAction *action)
+select_connected_callback (GtkAction *action)
 {
   Diagram *dia;
-  DDisplay * ddisp = ddisplay_active();
+  DDisplay * ddisp = ddisplay_active ();
   GList *objects, *tmp;
 
   if (!ddisp || textedit_mode(ddisp)) return;
@@ -197,13 +204,20 @@ select_transitively(Diagram *dia, DiaObject *obj)
   }
 }
 
-/** Select objects that are in any way connected with a currently selected
+
+/**
+ * select_transitive_callback:
+ * @action: the #GtkAction
+ *
+ * Select objects that are in any way connected with a currently selected
  * object, but only in the active layer.
+ *
+ * Since: dawn-of-time
  */
 void
-select_transitive_callback(GtkAction *action)
+select_transitive_callback (GtkAction *action)
 {
-  DDisplay *ddisp = ddisplay_active();
+  DDisplay *ddisp = ddisplay_active ();
   Diagram *dia;
   GList *objects, *tmp;
 
diff --git a/app/textedit.c b/app/textedit.c
index 777548ac..df61af44 100644
--- a/app/textedit.c
+++ b/app/textedit.c
@@ -16,10 +16,12 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-/** This file handles the display part of text edit stuff: Making text
+
+/*
+ * This file handles the display part of text edit stuff: Making text
  * edit start and stop at the right time and highlighting the edits.
  * lib/text.c and lib/focus.c handles internal things like who can have
- * focus and how to enter text.  app/disp_callbacks.c handles the actual
+ * focus and how to enter text. app/disp_callbacks.c handles the actual
  * keystrokes.
  *
  * There's an invariant that all objects in the focus list must be selected.
@@ -27,7 +29,7 @@
  * When starting to edit a particular text, we force entering text edit mode,
  * and when leaving text edit mode, we force stopping editing the text.
  * However, when changing between which texts are edited, we don't leave
- * textedit mode just to enter it again.  However, due to the text edit
+ * textedit mode just to enter it again. However, due to the text edit
  * tool, it is possible to be in text edit mode without editing any
  * particular text.
  */
@@ -42,90 +44,118 @@
 #include "object_ops.h"
 #include "text.h"
 
-static void textedit_end_edit(DDisplay *ddisp, Focus *focus);
+static void textedit_end_edit (DDisplay *ddisp, Focus *focus);
 
-/** Returns TRUE if the given display is currently in text-edit mode. */
+/**
+ * textedit_mode:
+ * @ddisp: the #DDisplay
+ *
+ * Returns: %TRUE if the given display is currently in text-edit mode.
+ */
 gboolean
-textedit_mode(DDisplay *ddisp)
+textedit_mode (DDisplay *ddisp)
 {
-  return ddisplay_active_focus(ddisp) != NULL;
+  return ddisplay_active_focus (ddisp) != NULL;
 }
 
-/** Perform the necessary changes to the display according to whether
- *  or not we are in text edit mode.  While normally called from
- *  textedit_enter and textedit_exit, this is exposed in order to allow
- *  for switching between displays.
 
- * @param ddisp The display to set according to mode.
+/**
+ * textedit_display_change:
+ * @ddisp: The #DDisplay to set according to mode.
+ *
+ * Perform the necessary changes to the display according to whether
+ * or not we are in text edit mode.  While normally called from
+ * textedit_enter and textedit_exit, this is exposed in order to allow
+ * for switching between displays.
  */
 static void
-textedit_display_change(DDisplay *ddisp)
+textedit_display_change (DDisplay *ddisp)
 {
 }
 
-/** Start editing text.  This brings Dia into text-edit mode, which
- * changes some menu items.  We may or may not already be in text-edit mode,
+
+/**
+ * textedit_enter:
+ * @ddisp: The #DDisplay that editing happens in.
+ *
+ * Start editing text. This brings Dia into text-edit mode, which
+ * changes some menu items. We may or may not already be in text-edit mode,
  * but at the return of this function we are known to be in text-edit mode.
- * @param ddisp The display that editing happens in.
  */
 static void
-textedit_enter(DDisplay *ddisp)
+textedit_enter (DDisplay *ddisp)
 {
-  if (textedit_mode(ddisp)) {
+  if (textedit_mode (ddisp)) {
     return;
   }
   /* Set textedit menus */
   /* Set textedit key-event handler */
-  textedit_display_change(ddisp);
+  textedit_display_change (ddisp);
 }
 
-/** Stop editing text.  Whether or not we already are in text-edit mode,
- * this function leaves us in object-edit mode.  This function will call
+
+/**
+ * textedit_exit:
+ * @ddisp: The #DDisplay that editing happens in.
+ *
+ * Stop editing text. Whether or not we already are in text-edit mode,
+ * this function leaves us in object-edit mode. This function will call
  * textedit_end_edit if necessary.
  *
- * @param ddisp The display that editing happens in.
+ * Since: dawn-of-time
  */
 static void
-textedit_exit(DDisplay *ddisp)
+textedit_exit (DDisplay *ddisp)
 {
-  if (!textedit_mode(ddisp)) {
+  if (!textedit_mode (ddisp)) {
     return;
   }
-  if (ddisplay_active_focus(ddisp) != NULL) {
-    textedit_end_edit(ddisp, ddisplay_active_focus(ddisp));
+  if (ddisplay_active_focus (ddisp) != NULL) {
+    textedit_end_edit (ddisp, ddisplay_active_focus (ddisp));
   }
   /* Set object-edit menus */
   /* Set object-edit key-event handler */
-  textedit_display_change(ddisp);
+  textedit_display_change (ddisp);
 }
 
 
-/** Begin editing a particular text focus.  This function will call
+/**
+ * textedit_begin_edit:
+ * @ddisp: The #DDisplay in use
+ * @focus: The text focus to edit
+ *
+ * Begin editing a particular text focus.  This function will call
  * textedit_enter if necessary.  By return from this function, we will
  * be in textedit mode.
- * @param ddisp The display in use
- * @param focus The text focus to edit
+ *
+ * Since: dawn-of-time
  */
 static void
-textedit_begin_edit(DDisplay *ddisp, Focus *focus)
+textedit_begin_edit (DDisplay *ddisp, Focus *focus)
 {
-  g_assert(dia_object_is_selected(focus_get_object(focus)));
-  if (!textedit_mode(ddisp)) {
-    textedit_enter(ddisp);
+  g_return_if_fail (dia_object_is_selected (focus_get_object (focus)));
+  if (!textedit_mode (ddisp)) {
+    textedit_enter (ddisp);
   }
-  ddisplay_set_active_focus(ddisp, focus);
-  highlight_object(focus->obj, DIA_HIGHLIGHT_TEXT_EDIT, ddisp->diagram);
-  object_add_updates(focus->obj, ddisp->diagram);
+  ddisplay_set_active_focus (ddisp, focus);
+  highlight_object (focus->obj, DIA_HIGHLIGHT_TEXT_EDIT, ddisp->diagram);
+  object_add_updates (focus->obj, ddisp->diagram);
 }
 
-/** Stop editing a particular text focus.  This must only be called in
+
+/**
+ * textedit_end_edit:
+ * @ddisp: The #DDisplay in use
+ * @focus: The text focus to stop editing
+ *
+ * Stop editing a particular text focus.  This must only be called in
  * text-edit mode.  This handles the object-specific changes required to
  * edit it.
- * @param ddisp The display in use
- * @param focus The text focus to stop editing
+ *
+ * Since: dawn-of-time
  */
 static void
-textedit_end_edit(DDisplay *ddisp, Focus *focus)
+textedit_end_edit (DDisplay *ddisp, Focus *focus)
 {
   /* During destruction of the diagram the display may already be gone */
   if (!ddisp)
@@ -142,56 +172,89 @@ textedit_end_edit(DDisplay *ddisp, Focus *focus)
   ddisplay_set_active_focus(ddisp, NULL);
 }
 
-/** Move the text edit focus either backwards or forwards. */
+
+/**
+ * textedit_move_focus:
+ * @ddisp: the #DDisplay
+ * @focus: the #Focus
+ * @forwards: move fowards?
+ *
+ * Move the text edit focus either backwards or forwards.
+ *
+ * Since: dawn-of-time
+ */
 Focus *
-textedit_move_focus(DDisplay *ddisp, Focus *focus, gboolean forwards)
+textedit_move_focus (DDisplay *ddisp, Focus *focus, gboolean forwards)
 {
   g_return_val_if_fail (ddisp != NULL, NULL);
+
   if (focus != NULL) {
     textedit_end_edit(ddisp, focus);
   }
+
   if (forwards) {
-    Focus *new_focus = focus_next_on_diagram((DiagramData *) ddisp->diagram);
-    if (new_focus != NULL) give_focus(new_focus);
+    Focus *new_focus = focus_next_on_diagram ((DiagramData *) ddisp->diagram);
+    if (new_focus != NULL) give_focus (new_focus);
   } else {
-    Focus *new_focus = focus_previous_on_diagram((DiagramData *) ddisp->diagram);
-    if (new_focus != NULL) give_focus(new_focus);
+    Focus *new_focus = focus_previous_on_diagram ((DiagramData *) ddisp->diagram);
+    if (new_focus != NULL) give_focus (new_focus);
   }
-  focus = get_active_focus((DiagramData *) ddisp->diagram);
+  focus = get_active_focus ((DiagramData *) ddisp->diagram);
 
   if (focus != NULL) {
-    textedit_begin_edit(ddisp, focus);
+    textedit_begin_edit (ddisp, focus);
   }
-  diagram_flush(ddisp->diagram);
+
+  diagram_flush (ddisp->diagram);
+
   return focus;
 }
 
-/** Call when something recieves an actual focus (not to be confused
- * with doing request_focus(), which merely puts one in the focus list).
+
+/**
+ * textedit_activate_focus:
+ * @ddisp: the #DDisplay
+ * @focus: the #Focus to activate
+ * @clicked: the #Point to click
+ *
+ * Call when something recieves an actual focus (not to be confused with
+ * doing request_focus(), which merely puts one in the focus list).
+ *
+ * Since: dawn-of-time
  */
 void
-textedit_activate_focus(DDisplay *ddisp, Focus *focus, Point *clicked)
+textedit_activate_focus (DDisplay *ddisp, Focus *focus, Point *clicked)
 {
-  Focus *old_focus = get_active_focus((DiagramData *) ddisp->diagram);
+  Focus *old_focus = get_active_focus ((DiagramData *) ddisp->diagram);
+
   if (old_focus != NULL) {
-    textedit_end_edit(ddisp, old_focus);
+    textedit_end_edit (ddisp, old_focus);
   }
+
   if (clicked) {
-      text_set_cursor(focus->text, clicked, ddisp->renderer);
+      text_set_cursor (focus->text, clicked, ddisp->renderer);
   }
-  textedit_begin_edit(ddisp, focus);
-  give_focus(focus);
-  diagram_flush(ddisp->diagram);
+
+  textedit_begin_edit (ddisp, focus);
+  give_focus (focus);
+  diagram_flush (ddisp->diagram);
 }
 
-/** Call when an object is chosen for activation (e.g. due to creation).
+
+/**
+ * textedit_activate_object:
+ * @ddisp: the #DDisplay
+ * @obj: the #DiaObject to activate
+ * @clicked: the #Point where the click happened
+ *
+ * Call when an object is chosen for activation (e.g. due to creation).
  * Calling this function will put us into text-edit mode if there is
  * text to edit, otherwise it will take us out of text-edit mode.
  *
- * Returns true if there is something to text edit.
+ * Returns: %TRUE if there is something to text edit.
  */
 gboolean
-textedit_activate_object(DDisplay *ddisp, DiaObject *obj, Point *clicked)
+textedit_activate_object (DDisplay *ddisp, DiaObject *obj, Point *clicked)
 {
   Focus *new_focus;
 
@@ -214,13 +277,20 @@ textedit_activate_object(DDisplay *ddisp, DiaObject *obj, Point *clicked)
   }
 }
 
-/** Call to activate the first editable selected object.
+
+/**
+ * textedit_activate_first:
+ * @ddisp: the #DDisplay
+ *
+ * Call to activate the first editable selected object.
  * Deactivates the old edit.
  * Calling this function will put us into text-edit mode if there is
  * text to edit, otherwise it will take us out of text-edit mode.
+ *
+ * Since: dawn-of-time
  */
 gboolean
-textedit_activate_first(DDisplay *ddisp)
+textedit_activate_first (DDisplay *ddisp)
 {
   Focus *new_focus = NULL;
   GList *tmp, *selected = diagram_get_sorted_selected(ddisp->diagram);
@@ -247,27 +317,34 @@ textedit_activate_first(DDisplay *ddisp)
   }
 }
 
-/** Call when something causes the text focus to disappear.
+
+/**
+ * textedit_deactivate_focus:
+ *
+ * Call when something causes the text focus to disappear.
  * Does not remove objects from the focus list, but removes the
  * focus highlight and stuff.
  * Calling remove_focus on the active object or remove_focus_all
  * implies deactivating the focus.
  * Calling this takes us out of textedit mode.
+ *
+ * Since: dawn-of-time
  */
 void
-textedit_deactivate_focus(void)
+textedit_deactivate_focus (void)
 {
-  if (ddisplay_active() != NULL) {
-    DiagramData *dia = (DiagramData *) ddisplay_active()->diagram;
-    Focus *focus = get_active_focus(dia);
+  if (ddisplay_active () != NULL) {
+    DiagramData *dia = (DiagramData *) ddisplay_active ()->diagram;
+    Focus *focus = get_active_focus (dia);
     if (focus != NULL) {
-      remove_focus_on_diagram(dia);
+      remove_focus_on_diagram (dia);
     }
     /* This also ends the edit */
-    textedit_exit(ddisplay_active());
+    textedit_exit (ddisplay_active ());
   }
 }
 
+
 /**
  * textedit_remove_focus:
  * @obj: the #DiaObject
@@ -289,13 +366,19 @@ textedit_remove_focus (DiaObject *obj, Diagram *diagram)
   }
 }
 
-/** Call when the entire list of focusable texts gets reset.
+
+/**
+ * textedit_remove_focus_all:
+ * @diagram: the #Diagram
+ *
+ * Call when the entire list of focusable texts gets reset.
+ *
  * Calling this takes us out of textedit mode.
  */
 void
-textedit_remove_focus_all(Diagram *diagram)
+textedit_remove_focus_all (Diagram *diagram)
 {
-  Focus *focus = get_active_focus((DiagramData *) diagram);
+  Focus *focus = get_active_focus ((DiagramData *) diagram);
   if (focus != NULL) {
     /* TODO: make sure the focus is deactivated */
   }
diff --git a/app/textedit_tool.c b/app/textedit_tool.c
index af8af403..da639a5e 100644
--- a/app/textedit_tool.c
+++ b/app/textedit_tool.c
@@ -24,17 +24,27 @@
 #include "cursor.h"
 #include "object_ops.h"
 
-/** The text edit tool.  This tool allows the user to switch to a mode where
+
+/**
+ * click_select_object:
+ * @ddisp: the #DDisplay
+ * @clickedpoint: the #Point clicked
+ * @event: the #GdkEventButton
+ *
+ * The text edit tool.  This tool allows the user to switch to a mode where
  * clicking on an editable text will start text edit mode.  Clicking outside
  * of editable text will revert to selection tool.  Note that clicking this
  * tool doesn't enter text edit mode immediately, just allows it to be entered
  * by clicking an object.
+ *
+ * Since: dawn-of-time
  */
 static DiaObject *
-click_select_object(DDisplay *ddisp, Point *clickedpoint,
-                   GdkEventButton *event)
+click_select_object (DDisplay       *ddisp,
+                     Point          *clickedpoint,
+                     GdkEventButton *event)
 {
-  real click_distance = ddisplay_untransform_length(ddisp, 3.0);
+  double click_distance = ddisplay_untransform_length (ddisp, 3.0);
   Diagram *diagram = ddisp->diagram;
   DiaObject *obj;
 
diff --git a/app/undo.c b/app/undo.c
index 7ea73fa5..10780bb5 100644
--- a/app/undo.c
+++ b/app/undo.c
@@ -258,39 +258,66 @@ undo_clear(UndoStack *stack)
   undo_update_menus(stack);
 }
 
-/** Make updates to menus associated with undo.
- *  Currently just changes sensitivity, but should in the future also
- *  include changing the labels.
+
+/**
+ * undo_update_menus:
+ * @stack: the #UndoStack
+ *
+ * Make updates to menus associated with undo.
+ *
+ * Currently just changes sensitivity, but should in the future also
+ * include changing the labels.
+ *
+ * Since: dawn-of-time
  */
 void
-undo_update_menus(UndoStack *stack)
+undo_update_menus (UndoStack *stack)
 {
-  ddisplay_do_update_menu_sensitivity(ddisplay_active());
+  ddisplay_do_update_menu_sensitivity (ddisplay_active ());
 }
 
-/** Marks the undo stack at the time of a save.
+
+/**
+ * undo_mark_save:
+ * @stack: the #UndoStack
+ *
+ * Marks the undo stack at the time of a save.
  */
 void
-undo_mark_save(UndoStack *stack)
+undo_mark_save (UndoStack *stack)
 {
   stack->last_save = stack->current_change;
 }
 
-/** Returns true if the diagram is undo-wise in the same state as at
- * last save, i.e. the current change is the same as it was at last save.
+
+/**
+ * undo_is_saved:
+ * @stack: the #UndoStack
+ *
+ * Returns: %TRUE if the diagram is undo-wise in the same state as at last
+ *          save, i.e. the current change is the same as it was at last save.
  */
 gboolean
-undo_is_saved(UndoStack *stack)
+undo_is_saved (UndoStack *stack)
 {
   return stack->last_save == stack->current_change;
 }
 
-/** Returns TRUE if there is an undo or redo item available in the stack.
- * If undo is true, returns TRUE if there's something to undo, otherwise
- * returns TRUE if there's something to redo.
+
+/**
+ * undo_available:
+ * @stack: the #UndoStack
+ * @undo: /shrug
+ *
+ * If @undo is %TRUE, returns %TRUE if there's something to undo, otherwise
+ * returns %TRUE if there's something to redo.
+ *
+ * Returns: %TRUE if there is an undo or redo item available in the stack.
+ *
+ * Since: dawn-of-time
  */
 gboolean
-undo_available(UndoStack *stack, gboolean undo)
+undo_available (UndoStack *stack, gboolean undo)
 {
   if (undo) {
     return stack->current_change != NULL;
@@ -1013,7 +1040,10 @@ dia_object_change_change_new (Diagram      *dia,
 
 /******** Group object list: */
 
-/** Grouping and ungrouping are two subtly different changes:  While
+/**
+ * DiaGroupObjectsChange:
+ *
+ * Grouping and ungrouping are two subtly different changes:  While
  * ungrouping preserves the front/back position, grouping cannot do that,
  * since the act of grouping destroys positions for the members of the
  * group, and those positions have to be restored in the undo.
diff --git a/docs/dia-app/dia-app-docs.xml b/docs/dia-app/dia-app-docs.xml
index 3e2d48ee..444f1a1a 100644
--- a/docs/dia-app/dia-app-docs.xml
+++ b/docs/dia-app/dia-app-docs.xml
@@ -42,6 +42,7 @@
     <xi:include href="xml/dia-line-width-area.xml" />
     <xi:include href="xml/diapagelayout.xml" />
     <xi:include href="xml/dia-props.xml" />
+    <xi:include href="xml/app_procs.xml" />
     <xi:include href="xml/disp_callbacks.xml" />
     <xi:include href="xml/display.xml" />
     <xi:include href="xml/dynamic_refresh.xml" />
@@ -56,8 +57,9 @@
     <xi:include href="xml/interface.xml" />
     <chapter id="layer-editor">
         <title>Layer Editor</title>
-        <xi:include href="xml/dia-layer-editor.xml" />
         <xi:include href="xml/dia-layer-widget.xml" />
+        <xi:include href="xml/dia-layer-list.xml" />
+        <xi:include href="xml/dia-layer-editor.xml" />
         <xi:include href="xml/dia-layer-editor-dialog.xml" />
         <xi:include href="xml/dia-layer-properties.xml" />
         <xi:include href="xml/layer_dialog.xml" />
@@ -65,7 +67,6 @@
     <xi:include href="xml/load_save.xml" />
     <xi:include href="xml/menus.xml" />
     <xi:include href="xml/navigation.xml" />
-    <xi:include href="xml/object_index.sgml" />
     <xi:include href="xml/object_ops.xml" />
     <xi:include href="xml/pagesetup.xml" />
     <xi:include href="xml/plugin-manager.xml" />
@@ -114,6 +115,11 @@
     <xi:include href="xml/api-index-0.98.xml"><xi:fallback /></xi:include>
   </index>
 
+  <index id="api-index-dawn-of-time">
+    <title>API from dawn of time</title>
+    <xi:include href="xml/api-index-dawn-of-time.xml"><xi:fallback /></xi:include>
+  </index>
+
   <index id="deprecated-api-index" role="deprecated">
     <title>Index of deprecated API</title>
     <xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
diff --git a/docs/dia-app/meson.build b/docs/dia-app/meson.build
index d51ade52..65b10306 100644
--- a/docs/dia-app/meson.build
+++ b/docs/dia-app/meson.build
@@ -31,6 +31,8 @@ gnome.gtkdoc('dia-app',
                        '--extra-dir=@0@'.format(glib_docpath / 'glib'),
                        '--extra-dir=@0@'.format(glib_docpath / 'gobject'),
                        '--extra-dir=@0@'.format(glib_docpath / 'gio'),
+                       '--extra-dir=@0@'.format(glib_docpath / 'gtk2'),
+                       '--extra-dir=@0@'.format(glib_docpath / 'gdk2'),
                      ],
         install_dir: 'dia-app',
       content_files: content_files,
diff --git a/docs/dia/dia-docs.xml b/docs/dia/dia-docs.xml
index 9b696ed8..412a94c2 100644
--- a/docs/dia/dia-docs.xml
+++ b/docs/dia/dia-docs.xml
@@ -92,7 +92,6 @@
     <xi:include href="xml/dynamic_obj.xml"/>
     <xi:include href="xml/path-math.xml"/>
     <xi:include href="xml/text.xml"/>
-    <xi:include href="xml/diacellrendererproperty.xml"/>
     <xi:include href="xml/pattern.xml"/>
     <xi:include href="xml/diacontext.xml"/>
     <xi:include href="xml/element.xml"/>
@@ -102,7 +101,6 @@
     <xi:include href="xml/filter.xml"/>
     <xi:include href="xml/poly_conn.xml"/>
     <xi:include href="xml/units.xml"/>
-    <xi:include href="xml/diadynamicmenu.xml"/>
     <xi:include href="xml/polyshape.xml"/>
     <xi:include href="xml/utils.xml"/>
     <xi:include href="xml/dia-enums.xml"/>
@@ -116,6 +114,11 @@
     <xi:include href="xml/prop_attr.xml"/>
     <xi:include href="xml/prop_basic.xml"/>
     <xi:include href="xml/diamarshal.xml"/>
+    <xi:include href="xml/paper.xml"/>
+    <xi:include href="xml/dia-simple-list.xml"/>
+    <xi:include href="xml/dia-arrow-cell-renderer.xml"/>
+    <xi:include href="xml/dia-line-cell-renderer.xml"/>
+    <xi:include href="xml/dia-colour-cell-renderer.xml"/>
   </part>
 
   <chapter id="object-tree">
@@ -133,6 +136,11 @@
     <xi:include href="xml/api-index-0.98.xml"><xi:fallback /></xi:include>
   </index>
 
+  <index id="api-index-dawn-of-time">
+    <title>API added before 0.98</title>
+    <xi:include href="xml/api-index-dawn-of-time.xml"><xi:fallback /></xi:include>
+  </index>
+
   <index id="deprecated-api-index" role="deprecated">
     <title>Index of deprecated API</title>
     <xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
diff --git a/tests/meson.build b/tests/meson.build
index c5d5864b..136d6326 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -4,8 +4,8 @@ run_env_dict = {
     'DIA_LIB_PATH'   : [meson.build_root() / 'objects',
                         meson.build_root() / 'plug-ins'],
     'DIA_SHAPE_PATH' : [meson.source_root() / 'shapes'],
-    'DIA_XSLT_PATH'  : [meson.source_root() / 'plug-ins' / 'xslt')],
-    'DIA_PYTHON_PATH': [meson.source_root() / 'plug-ins' / 'python')],
+    'DIA_XSLT_PATH'  : [meson.source_root() / 'plug-ins' / 'xslt'],
+    'DIA_PYTHON_PATH': [meson.source_root() / 'plug-ins' / 'python'],
     'DIA_SHEET_PATH' : [meson.build_root() / 'sheets'],
 }
 


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