[gnumeric] Fixed some introspection warnings.



commit cfda91b8f8a007959604d2940d8ad51f4f043524
Author: Jean Brefort <jean brefort normalesup org>
Date:   Sun Aug 12 21:01:43 2012 +0200

    Fixed some introspection warnings.

 plugins/applix/applix-read.c         |    2 +-
 plugins/excel/excel-xml-read.c       |    2 +-
 plugins/excel/ms-excel-read.c        |   20 +-
 plugins/excel/xlsx-read.c            |    4 +-
 plugins/html/html_read.c             |    2 +-
 plugins/lotus-123/lotus.c            |    4 +-
 plugins/openoffice/openoffice-read.c |   10 +-
 plugins/psiconv/psiconv-read.c       |    2 +-
 plugins/qpro/qpro-read.c             |    2 +-
 src/Makefile.am                      |   15 +-
 src/application.c                    |   45 +++-
 src/cell-draw.c                      |   14 +-
 src/cell.c                           |    8 +-
 src/clipboard.c                      |   10 +-
 src/colrow.c                         |   32 ++-
 src/colrow.h                         |    1 +
 src/command-context-stderr.c         |    4 +
 src/commands.c                       |   37 ++--
 src/complete-sheet.c                 |   10 +
 src/complete.c                       |    6 +
 src/dependent.c                      |    6 +-
 src/dialogs/dialog-cell-format.c     |    8 +-
 src/dialogs/dialog-delete-cells.c    |    2 +-
 src/dialogs/dialog-fill-series.c     |    8 +-
 src/dialogs/dialog-hyperlink.c       |    2 +-
 src/dialogs/dialog-insert-cells.c    |    2 +-
 src/dialogs/dialog-scenarios.c       |   16 +-
 src/dialogs/dialog-sheet-order.c     |    4 +-
 src/expr-impl.h                      |    1 +
 src/expr-name.c                      |    2 +-
 src/expr-name.h                      |    4 +-
 src/expr.c                           |   49 ++++
 src/expr.h                           |    3 +
 src/format-template.c                |    4 +-
 src/func.c                           |   25 ++-
 src/func.h                           |    7 +-
 src/gnm-data-cache-source.h          |    2 +
 src/gnm-pane.c                       |   52 ++--
 src/gnm-sheet-slicer-combo.h         |    2 +
 src/gnm-sheet-slicer.c               |   10 +-
 src/gnm-sheet-slicer.h               |    2 +
 src/gnumeric-conf.c                  |    4 +-
 src/gnumeric.h                       |    6 +-
 src/go-data-cache-field-impl.h       |    2 +
 src/go-data-cache-field.h            |    2 +
 src/go-data-cache-impl.h             |    2 +
 src/go-data-cache-source.h           |    2 +
 src/go-data-cache.h                  |    2 +
 src/go-data-slicer-field-impl.h      |    2 +
 src/go-data-slicer-field.h           |    2 +
 src/go-data-slicer-impl.h            |    2 +
 src/go-data-slicer.h                 |    2 +
 src/go-val.h                         |    2 +
 src/goffice-data.h                   |    2 +
 src/graph.h                          |    2 +-
 src/gui-clipboard.c                  |    2 +-
 src/gui-util.c                       |    8 +-
 src/gui-util.h                       |    4 +-
 src/hlink.c                          |   15 +-
 src/item-bar.c                       |    6 +
 src/mstyle.c                         |   21 ++-
 src/mstyle.h                         |    3 +-
 src/parse-util.c                     |   28 ++-
 src/parse-util.h                     |    1 +
 src/print-info.c                     |   17 ++-
 src/print-info.h                     |    1 +
 src/ranges.c                         |   31 ++-
 src/ranges.h                         |    1 +
 src/selection.c                      |    2 +-
 src/sheet-control-gui.c              |    2 +-
 src/sheet-filter.c                   |   26 ++
 src/sheet-filter.h                   |    2 +
 src/sheet-merge.c                    |   50 ++--
 src/sheet-object-component.c         |   11 +-
 src/sheet-object-graph.c             |   28 ++-
 src/sheet-object-impl.h              |    8 +-
 src/sheet-object-widget.c            |   22 ++-
 src/sheet-object.c                   |  142 +++++++----
 src/sheet-object.h                   |   20 --
 src/sheet-style.c                    |   77 ++++--
 src/sheet.c                          |  444 ++++++++++++++++++++++------------
 src/sheet.h                          |   15 +-
 src/stf-export.c                     |    7 +
 src/style-border.c                   |    4 +-
 src/style-color.c                    |   54 +++--
 src/style-color.h                    |   15 +-
 src/style.h                          |    6 -
 src/tools/gnm-solver.c               |    2 +-
 src/tools/scenarios.c                |   13 +
 src/value-sheet.c                    |   26 +-
 src/value.c                          |   62 +++---
 src/wbc-gtk-actions.c                |    2 +-
 src/wbc-gtk-edit.c                   |    6 +
 src/wbc-gtk.c                        |   18 +-
 src/wbc-gtk.h                        |    2 +-
 src/widgets/gnumeric-expr-entry.c    |   45 +++--
 src/workbook.c                       |   80 ++++++-
 src/workbook.h                       |    1 +
 src/xml-sax-read.c                   |    4 +-
 src/xml-sax.h                        |    2 +-
 100 files changed, 1221 insertions(+), 590 deletions(-)
---
diff --git a/plugins/applix/applix-read.c b/plugins/applix/applix-read.c
index 8427a29..1d5d76a 100644
--- a/plugins/applix/applix-read.c
+++ b/plugins/applix/applix-read.c
@@ -397,7 +397,7 @@ applix_read_colormap (ApplixReadState *state)
 
 			/* Store the result */
 			g_ptr_array_add	(state->colors,
-					 style_color_new_rgb8 (r, g, b));
+					 gnm_color_new_rgb8 (r, g, b));
 #if 0
 			printf ("'%s' %ld %ld %ld %ld\n", buffer, numbers[1],
 				numbers[2], numbers[3], numbers[4]);
diff --git a/plugins/excel/excel-xml-read.c b/plugins/excel/excel-xml-read.c
index 05274b9..38a273c 100644
--- a/plugins/excel/excel-xml-read.c
+++ b/plugins/excel/excel-xml-read.c
@@ -230,7 +230,7 @@ parse_color (GsfXMLIn *xin, xmlChar const *str, char const *name)
 	g_return_val_if_fail (str != NULL, NULL);
 
 	if (3 == sscanf (str, "#%2x%2x%2x", &r, &g, &b))
-		return style_color_new_rgb8 (r, g, b);
+		return gnm_color_new_rgb8 (r, g, b);
 
 	xl_xml_warning (xin, "Invalid attribute '%s', expected color, received '%s'",
 			name, str);
diff --git a/plugins/excel/ms-excel-read.c b/plugins/excel/ms-excel-read.c
index 17d0209..b190c2a 100644
--- a/plugins/excel/ms-excel-read.c
+++ b/plugins/excel/ms-excel-read.c
@@ -1856,14 +1856,14 @@ excel_palette_get (GnmXLImporter *importer, gint idx)
 		return style_color_white ();
 
 	case 80 : /* tooltip background */
-		return style_color_new_gdk (&gs_yellow);
-
-	case 2 : return style_color_new_rgb8 (0xff,    0,    0); /* red */
-	case 3 : return style_color_new_rgb8 (   0, 0xff,    0); /* green */
-	case 4 : return style_color_new_rgb8 (   0,    0, 0xff); /* blue */
-	case 5 : return style_color_new_rgb8 (0xff, 0xff,    0); /* yellow */
-	case 6 : return style_color_new_rgb8 (0xff,    0, 0xff); /* magenta */
-	case 7 : return style_color_new_rgb8 (   0, 0xff, 0xff); /* cyan */
+		return gnm_color_new_gdk (&gs_yellow);
+
+	case 2 : return gnm_color_new_rgb8 (0xff,    0,    0); /* red */
+	case 3 : return gnm_color_new_rgb8 (   0, 0xff,    0); /* green */
+	case 4 : return gnm_color_new_rgb8 (   0,    0, 0xff); /* blue */
+	case 5 : return gnm_color_new_rgb8 (0xff, 0xff,    0); /* yellow */
+	case 6 : return gnm_color_new_rgb8 (0xff,    0, 0xff); /* magenta */
+	case 7 : return gnm_color_new_rgb8 (   0, 0xff, 0xff); /* cyan */
 	default :
 		break;
 	}
@@ -1877,7 +1877,7 @@ excel_palette_get (GnmXLImporter *importer, gint idx)
 
 	if (pal->gnm_colors[idx] == NULL) {
 		pal->gnm_colors[idx] =
-			style_color_new_rgb8 (pal->red[idx],
+			gnm_color_new_rgb8 (pal->red[idx],
 					      pal->green[idx],
 					      pal->blue[idx]);
 		g_return_val_if_fail (pal->gnm_colors[idx],
@@ -5097,7 +5097,7 @@ excel_read_WINDOW2 (BiffQuery *q, ExcelReadSheet *esheet, WorkbookView *wb_view)
 			r = (guint8) biff_pat_col;
 			g = (guint8) (biff_pat_col >> 8);
 			b = (guint8) (biff_pat_col >> 16);
-			pattern_color = style_color_new_rgb8 (r, g, b);
+			pattern_color = gnm_color_new_rgb8 (r, g, b);
 		}
 		d (2, g_printerr ("auto pattern color "
 				  "0x%08x\n",
diff --git a/plugins/excel/xlsx-read.c b/plugins/excel/xlsx-read.c
index 2d0bac2..dfc1397 100644
--- a/plugins/excel/xlsx-read.c
+++ b/plugins/excel/xlsx-read.c
@@ -1143,7 +1143,7 @@ elem_color (GsfXMLIn *xin, xmlChar const **attrs, gboolean allow_alpha)
 	c = apply_tint (c, tint);
 	if (!allow_alpha)
 		c |= 0xFF;
-	return style_color_new_go (c);
+	return gnm_color_new_go (c);
 }
 
 static GnmStyle *
@@ -2358,7 +2358,7 @@ xlsx_CT_SheetView_begin (GsfXMLIn *xin, xmlChar const **attrs)
 
 	if (!defaultGridColor && grid_color_index >= 0)
 		sheet_style_set_auto_pattern_color (state->sheet,
-			style_color_new_go (indexed_color (state, grid_color_index)));
+			gnm_color_new_go (indexed_color (state, grid_color_index)));
 	if (tabSelected)
 		wb_view_sheet_focus (state->wb_view, state->sheet);
 }
diff --git a/plugins/html/html_read.c b/plugins/html/html_read.c
index 9472889..3f7b921 100644
--- a/plugins/html/html_read.c
+++ b/plugins/html/html_read.c
@@ -244,7 +244,7 @@ html_read_row (htmlNodePtr cur, htmlDocPtr doc, GnmHtmlTableCtxt *tc)
 				gnm_style_set_font_uline (
 					mstyle, UNDERLINE_SINGLE);
 				gnm_style_set_font_color (mstyle,
-					style_color_new_name ("blue"));
+					gnm_color_new_name ("blue"));
 				g_free (url);
 				xmlBufferFree (h_buf);
 			}
diff --git a/plugins/lotus-123/lotus.c b/plugins/lotus-123/lotus.c
index 2c46787..15b8d95 100644
--- a/plugins/lotus-123/lotus.c
+++ b/plugins/lotus-123/lotus.c
@@ -526,7 +526,7 @@ static GnmColor *
 lotus_color (guint i)
 {
 	if (i < G_N_ELEMENTS (lotus_color_table))
-		return style_color_new_rgb8 (lotus_color_table[i][0],
+		return gnm_color_new_rgb8 (lotus_color_table[i][0],
 					     lotus_color_table[i][1],
 					     lotus_color_table[i][2]);
 	switch (i) {
@@ -2496,7 +2496,7 @@ works_color (guint i)
 {
 	if (i == 0) return style_color_auto_font();
 	if (i < G_N_ELEMENTS (works_color_table))
-		return style_color_new_rgb8 (works_color_table[i][0],
+		return gnm_color_new_rgb8 (works_color_table[i][0],
 					     works_color_table[i][1],
 					     works_color_table[i][2]);
 	return NULL;
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index a903dd0..3abc099 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -703,7 +703,7 @@ oo_parse_color (GsfXMLIn *xin, xmlChar const *str, char const *name)
 	g_return_val_if_fail (str != NULL, NULL);
 
 	if (3 == sscanf (CXML2C (str), "#%2x%2x%2x", &r, &g, &b))
-		return style_color_new_rgb8 (r, g, b);
+		return gnm_color_new_rgb8 (r, g, b);
 
 	if (0 == strcmp (CXML2C (str), "transparent"))
 		return style_color_ref (magic_transparent);
@@ -2230,7 +2230,7 @@ oo_table_start (GsfXMLIn *xin, xmlChar const **attrs)
 				      NULL);
 			if (style->tab_color_set) {
 				GnmColor *color
-					= style_color_new_go (style->tab_color);
+					= gnm_color_new_go (style->tab_color);
 				g_object_set
 					(state->pos.sheet,
 					 "tab-background",
@@ -2240,7 +2240,7 @@ oo_table_start (GsfXMLIn *xin, xmlChar const **attrs)
 			}
 			if (style->tab_text_color_set){
 				GnmColor *color
-					= style_color_new_go
+					= gnm_color_new_go
 					(style->tab_text_color);
 				g_object_set
 					(state->pos.sheet,
@@ -4051,7 +4051,7 @@ oo_cell_content_link (GsfXMLIn *xin, xmlChar const **attrs)
 		style = gnm_style_new ();
 		gnm_style_set_hlink (style, hlink);
 		gnm_style_set_font_uline (style, UNDERLINE_SINGLE);
-		gnm_style_set_font_color (style, style_color_new_name ("blue"));
+		gnm_style_set_font_color (style, gnm_color_new_name ("blue"));
 		sheet_style_apply_pos (state->pos.sheet,
 				       state->pos.eval.col, state->pos.eval.row,
 				       style);
@@ -9823,7 +9823,7 @@ odf_apply_ooo_table_config (char const *key, GValue *val, OOParseState *state)
 			if (item != NULL && G_VALUE_HOLDS(item, G_TYPE_INT)) {
 				GOColor color = g_value_get_int (item);
 				color = color << 8;
-				sheet->tab_color = style_color_new_go (color);
+				sheet->tab_color = gnm_color_new_go (color);
 			}
 			item = g_hash_table_lookup (hash, "CursorPositionX");
 			if (item != NULL && G_VALUE_HOLDS(item, G_TYPE_INT)) {
diff --git a/plugins/psiconv/psiconv-read.c b/plugins/psiconv/psiconv-read.c
index b1fd792..30cfae6 100644
--- a/plugins/psiconv/psiconv-read.c
+++ b/plugins/psiconv/psiconv-read.c
@@ -179,7 +179,7 @@ set_format(GnmStyle *style, const psiconv_sheet_numberformat psi_numberformat)
 static GnmColor *
 get_color(const psiconv_color color)
 {
-	return style_color_new_rgb8 (color->red, color->green, color->blue);
+	return gnm_color_new_rgb8 (color->red, color->green, color->blue);
 }
 
 static void
diff --git a/plugins/qpro/qpro-read.c b/plugins/qpro/qpro-read.c
index 84db919..4e21229 100644
--- a/plugins/qpro/qpro-read.c
+++ b/plugins/qpro/qpro-read.c
@@ -849,7 +849,7 @@ qpro_read_sheet (QProReadState *state)
 
 		case QPRO_PAGE_TAB_COLOR :
 			if (validate (QPRO_PAGE_TAB_COLOR, 4)) {
-				GnmColor *bc = style_color_new_rgb8 (
+				GnmColor *bc = gnm_color_new_rgb8 (
 					data[0], data[1], data[2]);
 				g_object_set (sheet,
 					      "tab-background", bc,
diff --git a/src/Makefile.am b/src/Makefile.am
index 2b2d710..cf9d63c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,7 +4,9 @@
 -include $(INTROSPECTION_MAKEFILE)
 INTROSPECTION_GIRS =
 INTROSPECTION_SCANNER_ARGS = \
-	-v --accept-unprefixed
+	-v --warn-all --accept-unprefixed \
+	--identifier-prefix="Gnm"  --identifier-prefix="Gnumeric" \
+	-DGOFFICE_NAMESPACE_DISABLE
 INTROSPECTION_COMPILER_ARGS = \
 	--includedir=$(srcdir) \
     --includedir=.
@@ -497,10 +499,17 @@ if HAVE_INTROSPECTION
 INTROSPECTION_GIRS += Gnm- GNUMERIC_API_VER@.gir
 
 Gnm- GNUMERIC_API_VER@.gir: $(INTROSPECTION_SCANNER) libspreadsheet.la Makefile
-Gnm_ GNUMERIC_API_VER_@_gir_INCLUDES = GObject-2.0 Gio-2.0 libxml2-2.0 GOffice- GOFFICE_API_VER@
+Gnm_ GNUMERIC_API_VER_@_gir_INCLUDES = GObject-2.0 Gio-2.0 libxml2-2.0 \
+									   Gsf-1 GOffice- GOFFICE_API_VER@
 Gnm_ GNUMERIC_API_VER_@_gir_CFLAGS = $(AM_CPPFLAGS)
 Gnm_ GNUMERIC_API_VER_@_gir_LIBS = libspreadsheet.la
-Gnm_ GNUMERIC_API_VER_@_gir_FILES = $(libspreadsheet_la_SOURCES) $(libspreadsheet_include_HEADERS)
+Gnm_ GNUMERIC_API_VER_@_gir_FILES = \
+	$(libspreadsheet_la_SOURCES) \
+	$(libspreadsheet_include_HEADERS) \
+	tools/scenarios.c \
+	tools/scenarios.h \
+	widgets/gnumeric-expr-entry.c \
+	widgets/gnumeric-expr-entry.h
 
 
 girdir = $(GIRDIR)
diff --git a/src/application.c b/src/application.c
index b2ff9a2..d9a9a08 100644
--- a/src/application.c
+++ b/src/application.c
@@ -98,8 +98,8 @@ gnm_app_get_app (void)
 }
 
 /**
- * gnm_app_workbook_list_add :
- * @wb :
+ * gnm_app_workbook_list_add:
+ * @wb:
  *
  * Add @wb to the application's list of workbooks.
  **/
@@ -118,8 +118,8 @@ gnm_app_workbook_list_add (Workbook *wb)
 }
 
 /**
- * gnm_app_workbook_list_remove :
- * @wb :
+ * gnm_app_workbook_list_remove:
+ * @wb:
  *
  * Remove @wb from the application's list of workbooks.
  **/
@@ -201,11 +201,11 @@ gnm_app_clipboard_unant (void)
 /**
  * gnm_app_clipboard_cut_copy:
  *
- * @wbc   : the workbook control that requested the operation.
+ * @wbc: the workbook control that requested the operation.
  * @is_cut: is this a cut or a copy.
- * @sheet : The source sheet for the copy.
- * @area  : A single rectangular range to be copied.
- * @animate_cursor : Do we want ot add an animated cursor around things.
+ * @sv: The source sheet for the copy.
+ * @area: A single rectangular range to be copied.
+ * @animate_range: Do we want ot add an animated cursor around things.
  *
  * When Cutting we
  *   Clear and free the contents of the clipboard and save the sheet and area
@@ -253,11 +253,11 @@ gnm_app_clipboard_cut_copy (WorkbookControl *wbc, gboolean is_cut,
 	}
 }
 
-/** gnm_app_clipboard_cut_copy_obj :
- * @wbc : #WorkbookControl
- * @is_cut :
- * @sv : #SheetView
- * @objects : a list of #SheetObject which is freed
+/** gnm_app_clipboard_cut_copy_obj:
+ * @wbc: #WorkbookControl
+ * @is_cut:
+ * @sv: #SheetView
+ * @objects: a list of #SheetObject which is freed
  *
  * Different than copying/cutting a region, this can actually cuts an object
  **/
@@ -887,6 +887,16 @@ gnm_action_free (GnmAction *action)
 	}
 }
 
+/**
+ * gnm_app_add_extra_ui:
+ * @group_name: action group name.
+ * @actions: (element-type GnmAction): list of actions.
+ * @layout: the xml string describing the menus and toolbars.
+ * @domain: localization domain.
+ * @user_data: user data
+ *
+ * Returns: (transfer full): the newly allocated #GnmAppExtraUI.
+ **/
 GnmAppExtraUI *
 gnm_app_add_extra_ui (char const *group_name,
 		      GSList *actions,
@@ -913,6 +923,13 @@ gnm_app_remove_extra_ui (GnmAppExtraUI *extra_ui)
 	g_free (extra_ui);
 }
 
+/**
+ * gnm_app_foreach_extra_ui:
+ * @func: (scope call): #GFunc
+ * @data: user data.
+ *
+ * Applies @func to each #GnmAppExtraUI.
+ **/
 void
 gnm_app_foreach_extra_ui (GFunc func, gpointer data)
 {
@@ -932,7 +949,7 @@ cb_flag_windows_changed (void)
 }
 
 /**
- * _gnm_app_flag_windows_changed :
+ * _gnm_app_flag_windows_changed:
  *
  * An internal utility routine to flag a regeneration of the window lists
  **/
diff --git a/src/cell-draw.c b/src/cell-draw.c
index d41db50..410e7fd 100644
--- a/src/cell-draw.c
+++ b/src/cell-draw.c
@@ -370,13 +370,13 @@ cell_draw_v_extension_markers (cairo_t *cr,
 
 /**
  * cell_draw:
- * @cell : #GnmCell const
- * @cr   : #cairo_t
- * @x1 :
- * @y1 :
- * @width : including margins and leading grid line
- * @height : including margins and leading grid line
- * @h_center :
+ * @cell: #GnmCell const
+ * @cr: #cairo_t
+ * @x1:
+ * @y1:
+ * @width: including margins and leading grid line
+ * @height: including margins and leading grid line
+ * @h_center:
  * @show_extension_markers:
  **/
 void
diff --git a/src/cell.c b/src/cell.c
index ed4b277..c00983a 100644
--- a/src/cell.c
+++ b/src/cell.c
@@ -266,10 +266,10 @@ gnm_cell_set_expr (GnmCell *cell, GnmExprTop const *texpr)
 /**
  * gnm_cell_set_array_formula:
  * @sheet:   The sheet to set the expr in.
- * @col_a:   The left column in the destination region.
- * @row_a:   The top row in the destination region.
- * @col_b:   The right column in the destination region.
- * @row_b:   The bottom row in the destination region.
+ * @cola:   The left column in the destination region.
+ * @rowa:   The top row in the destination region.
+ * @colb:   The right column in the destination region.
+ * @rowb:   The bottom row in the destination region.
  * @texpr:   an expression (the inner expression, not a corner or element)
  *
  * Uses cell_set_expr_internal to store the expr as an
diff --git a/src/clipboard.c b/src/clipboard.c
index b5511a7..e68ae17 100644
--- a/src/clipboard.c
+++ b/src/clipboard.c
@@ -358,9 +358,9 @@ range_flip_v (GnmRange *range, Sheet const *sheet, int const *data)
 
 /**
  * clipboard_paste_region:
- * @cr : The GnmCellRegion to paste.
- * @pt : Where to paste the values.
- * @cc : The context for error handling.
+ * @cr: The GnmCellRegion to paste.
+ * @pt: Where to paste the values.
+ * @cc: The context for error handling.
  *
  * Pastes the supplied GnmCellRegion (@cr) into the supplied
  * GnmPasteTarget (@pt).  This operation is not undoable.  It does not auto grow
@@ -708,8 +708,8 @@ clipboard_copy_range_undo (Sheet *sheet, GnmRange const *r)
 
 /**
  * clipboard_copy_obj:
- * @sheet : #Sheet
- * @objects : #GSList
+ * @sheet: #Sheet
+ * @objects: #GSList
  *
  * Returns a cell region with copies of objects in list.  Caller is responsible
  *	for cellregion_unref-ing the result.
diff --git a/src/colrow.c b/src/colrow.c
index 4bb617e..06e9fe1 100644
--- a/src/colrow.c
+++ b/src/colrow.c
@@ -36,6 +36,28 @@
 #include "rendered-value.h"
 #include <goffice/goffice.h>
 
+/* Making ColRowInfo a boxed type to make introspection happy. using no-op
+ * functions for copy and free, and  crossing fingers.
+ */
+static ColRowInfo *
+col_row_info_copy (ColRowInfo *cri)
+{
+	return cri;
+}
+
+GType
+col_row_info_get_type (void)
+{
+	static GType t = 0;
+
+	if (t == 0) {
+		t = g_boxed_type_register_static ("ColRowInfo",
+			 (GBoxedCopyFunc)col_row_info_copy,
+			 (GBoxedFreeFunc)col_row_info_copy);
+	}
+	return t;
+}
+
 double
 colrow_compute_pixel_scale (Sheet const *sheet, gboolean horizontal)
 {
@@ -1043,11 +1065,11 @@ colrow_find_outline_bound (Sheet const *sheet, gboolean is_cols,
 
 /**
  * colrow_set_visibility:
- * @sheet	: the sheet
- * @is_cols	: Are we dealing with rows or columns.
- * @visible	: Make things visible or invisible.
- * @first	: The index of the first row/col (inclusive)
- * @last	: The index of the last row/col (inclusive)
+ * @sheet: the sheet
+ * @is_cols: Are we dealing with rows or columns.
+ * @visible: Make things visible or invisible.
+ * @first: The index of the first row/col (inclusive)
+ * @last: The index of the last row/col (inclusive)
  *
  * Change the visibility of the selected range of contiguous cols/rows.
  * NOTE : only changes the collapsed state for the LAST+1 element.
diff --git a/src/colrow.h b/src/colrow.h
index e6a0c3f..bdb04de 100644
--- a/src/colrow.h
+++ b/src/colrow.h
@@ -24,6 +24,7 @@ struct _ColRowInfo {
 
 	gpointer spans;	/* Only used for rows */
 };
+GType col_row_info_get_type (void);
 
 struct _ColRowCollection {
 	int         max_used;
diff --git a/src/command-context-stderr.c b/src/command-context-stderr.c
index 6dcfc8d..e7c71ae 100644
--- a/src/command-context-stderr.c
+++ b/src/command-context-stderr.c
@@ -24,6 +24,10 @@ typedef GObjectClass CmdContextStderrClass;
 #define COMMAND_CONTEXT_STDERR_CLASS(k) \
 	(G_TYPE_CHECK_CLASS_CAST ((k), CMD_CONTEXT_STDERR_TYPE, CmdContextStderrClass))
 
+/**
+ * cmd_context_stderr_new:
+ * Returns: (transfer full): the newly allocated #GOCmdContext.
+ **/
 GOCmdContext *
 cmd_context_stderr_new (void)
 {
diff --git a/src/commands.c b/src/commands.c
index 60f7625..55e0c50 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -359,12 +359,12 @@ update_after_action (Sheet *sheet, WorkbookControl *wbc)
 
 
 /**
- * command_undo : Undo the last command executed.
- * @wbc : The workbook control which issued the request.
+ * command_undo:
+ * @wbc: The workbook control which issued the request.
  *        Any user level errors generated by undoing will be reported
  *        here.
  *
- * @wb : The workbook whose commands to undo.
+ * Undo the last command executed.
  **/
 void
 command_undo (WorkbookControl *wbc)
@@ -417,7 +417,7 @@ command_undo (WorkbookControl *wbc)
 
 /**
  * command_redo : Redo the last command that was undone.
- * @wbc : The workbook control which issued the request.
+ * @wbc: The workbook control which issued the request.
  *        Any user level errors generated by redoing will be reported
  *        here.
  **/
@@ -472,7 +472,7 @@ command_redo (WorkbookControl *wbc)
 /**
  * command_repeat : Repeat the last command (if possible)
  *
- * @wbc : The workbook control which issued the request.
+ * @wbc: The workbook control which issued the request.
  *        Any user level errors generated by redoing will be reported
  *        here.
  **/
@@ -531,12 +531,13 @@ command_setup_combos (WorkbookControl *wbc)
 	wb_control_undo_redo_labels (wbc, undo_label, redo_label);
 }
 
-/*
+/**
+ * command_list_release:
+ * @cmds: (element-type GObject): the set of commands to free.
+ *
  * command_list_release : utility routine to free the resources associated
  *    with a list of commands.
  *
- * @cmd_list : The set of commands to free.
- *
  * NOTE : remember to NULL the list when you are done.
  */
 void
@@ -675,8 +676,8 @@ command_register_undo (WorkbookControl *wbc, GObject *obj)
  * gnm_command_push_undo : An internal utility to tack a new command
  *    onto the undo list.
  *
- * @wbc : The workbook control that issued the command.
- * @cmd : The new command to add.
+ * @wbc: The workbook control that issued the command.
+ * @obj: The new command to add.
  *
  * returns : TRUE if there was an error.
  */
@@ -3690,7 +3691,7 @@ cmd_autoformat_finalize (GObject *cmd)
 
 /**
  * cmd_selection_autoformat:
- * @context: the context.
+ * @wbc: the context.
  * @ft: The format template that was applied
  *
  * Return value: TRUE if there was a problem
@@ -3834,7 +3835,9 @@ cmd_unmerge_cells_finalize (GObject *cmd)
 
 /**
  * cmd_unmerge_cells:
- * @context: the context.
+ * @wbc: the context.
+ * @sheet: #Sheet
+ * @selection: (element-type GnmRange): selection.
  *
  * Return value: TRUE if there was a problem
  **/
@@ -3998,9 +4001,12 @@ cmd_merge_cells_finalize (GObject *cmd)
 
 /**
  * cmd_merge_cells:
- * @context: the context.
+ * @wbc: the context.
+ * @sheet: #Sheet
+ * @selection: (element-type GnmRange): selection.
+ * @center:
  *
- * Return value: TRUE if there was a problem
+ * Return value: %TRUE if there was a problem
  **/
 gboolean
 cmd_merge_cells (WorkbookControl *wbc, Sheet *sheet, GSList const *selection,
@@ -7285,10 +7291,9 @@ cb_cmd_hyperlink_find_cells (GnmCellIter const *iter, gpointer user)
 /**
  * cmd_selection_hyperlink:
  * @wbc: the workbook control.
- * @sheet: the sheet
  * @style: style to apply to the selection
  * @opt_translated_name: An optional name to use in place of 'Hyperlink Cells'
- * @OPT_CONTENT: optional content for otherwise empty cells.
+ * @opt_content: optional content for otherwise empty cells.
  *
  * If borders is non NULL, then the GnmBorder references are passed,
  * the GnmStyle reference is also passed.
diff --git a/src/complete-sheet.c b/src/complete-sheet.c
index 07fda6d..af8d1ce 100644
--- a/src/complete-sheet.c
+++ b/src/complete-sheet.c
@@ -118,6 +118,16 @@ complete_sheet_class_init (GObjectClass *object_class)
 	auto_complete_class->search_iteration = complete_sheet_search_iteration;
 }
 
+/**
+ * complete_sheet_new:
+ * @sheet: #Sheet
+ * @col: column
+ * @row: row
+ * @notify: (scope async): #CompleteMatchNotifyFn
+ * @notify_closure: user data
+ *
+ * Returns: (transfer full): the new #Complete.
+ **/
 Complete *
 complete_sheet_new (Sheet *sheet, int col, int row, CompleteMatchNotifyFn notify, void *notify_closure)
 {
diff --git a/src/complete.c b/src/complete.c
index 4de4d05..180925f 100644
--- a/src/complete.c
+++ b/src/complete.c
@@ -30,6 +30,12 @@
 #define PARENT_TYPE (G_TYPE_OBJECT)
 #define ACC(o) (COMPLETE_CLASS (G_OBJECT_GET_CLASS (o)))
 
+/**
+ * complete_construct:
+ * @complete: #Complete
+ * @notify: (scope async): #CompleteMatchNotifyFn
+ * @notify_closure: user data
+ **/
 void
 complete_construct (Complete *complete,
 		    CompleteMatchNotifyFn notify,
diff --git a/src/dependent.c b/src/dependent.c
index f23dd28..c8c7571 100644
--- a/src/dependent.c
+++ b/src/dependent.c
@@ -1345,7 +1345,7 @@ dependent_clear_dynamic_deps (GnmDependent *dep)
 
 /**
  * dependent_link:
- * @dep : the dependent that changed
+ * @dep: the dependent that changed
  *
  * Adds the dependent to the workbook wide list of dependents.
  */
@@ -1381,7 +1381,7 @@ dependent_link (GnmDependent *dep)
 
 /**
  * dependent_unlink:
- * @dep : the dependent that changed
+ * @dep: the dependent that changed
  *
  * Removes the dependent from its container's set of dependents and always
  * removes the linkages to what it depends on.
@@ -2018,7 +2018,7 @@ names_referencing_sheet (Sheet *sheet)
 
 /**
  * dependents_relocate:
- * @rinfo : the descriptor record for what is being moved where.
+ * @info: the descriptor record for what is being moved where.
  *
  * Fixes references to or from a region that is going to be moved.
  * Returns a list of the locations and expressions that were changed outside of
diff --git a/src/dialogs/dialog-cell-format.c b/src/dialogs/dialog-cell-format.c
index 1b7a17c..1a82385 100644
--- a/src/dialogs/dialog-cell-format.c
+++ b/src/dialogs/dialog-cell-format.c
@@ -753,7 +753,7 @@ cb_font_preview_color (G_GNUC_UNUSED GOComboColor *combo,
 
 	col = is_default
 		? style_color_auto_font ()
-		: style_color_new_go (c);
+		: gnm_color_new_go (c);
 	font_selector_set_color (state->font.selector, col);
 }
 
@@ -949,7 +949,7 @@ cb_back_preview_color (G_GNUC_UNUSED GOComboColor *combo,
 		sc = style_color_auto_back ();
 		gnm_style_set_pattern (state->back.style, 0);
 	} else {
-		sc = style_color_new_go (c);
+		sc = gnm_color_new_go (c);
 		gnm_style_set_pattern (state->back.style, state->back.pattern.cur_index);
 	}
 
@@ -966,7 +966,7 @@ cb_pattern_preview_color (G_GNUC_UNUSED GOComboColor *combo,
 {
 	GnmColor *col = is_default
 		? sheet_style_get_auto_pattern_color (state->sheet)
-		: style_color_new_go (c);
+		: gnm_color_new_go (c);
 
 	gnm_style_set_pattern_color (state->back.style, col);
 
@@ -1094,7 +1094,7 @@ border_get_mstyle (FormatState const *state, GnmStyleBorderLocation const loc)
 		guint8 const g = (guint8) (edge->rgba >> 16);
 		guint8 const b = (guint8) (edge->rgba >>  8);
 		guint8 const a = (guint8) (edge->rgba >>  0);
-		color = style_color_new_rgba8 (r, g, b, a);
+		color = gnm_color_new_rgba8 (r, g, b, a);
 	}
 	return gnm_style_border_fetch
 		(state->border.edge[loc].pattern_index, color,
diff --git a/src/dialogs/dialog-delete-cells.c b/src/dialogs/dialog-delete-cells.c
index 2947bc6..90be5eb 100644
--- a/src/dialogs/dialog-delete-cells.c
+++ b/src/dialogs/dialog-delete-cells.c
@@ -69,7 +69,7 @@ cb_delete_cell_ok_clicked (DeleteCellState *state)
 	radio_0 = go_gtk_builder_get_widget (state->gui, "radio_0");
 	g_return_if_fail (radio_0 != NULL);
 
-	i = gtk_radio_group_get_selected
+	i = gnm_gtk_radio_group_get_selected
 	  (gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_0)));
 
 	cols = state->sel->end.col - state->sel->start.col + 1;
diff --git a/src/dialogs/dialog-fill-series.c b/src/dialogs/dialog-fill-series.c
index 656c558..4468875 100644
--- a/src/dialogs/dialog-fill-series.c
+++ b/src/dialogs/dialog-fill-series.c
@@ -97,17 +97,17 @@ cb_fill_series_ok_clicked (G_GNUC_UNUSED GtkWidget *button,
 
 	/* Read the `Series in' radio buttons. */
 	radio = go_gtk_builder_get_widget (state->base.gui, "series_in_rows");
-	fs->series_in_rows = ! gtk_radio_group_get_selected
+	fs->series_in_rows = ! gnm_gtk_radio_group_get_selected
 	        (gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio)));
 
 	/* Read the `Type' radio buttons. */
 	radio = go_gtk_builder_get_widget (state->base.gui, "type_linear");
-	fs->type = gtk_radio_group_get_selected
+	fs->type = gnm_gtk_radio_group_get_selected
 	        (gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio)));
 
 	/* Read the `Date unit' radio buttons. */
 	radio = go_gtk_builder_get_widget (state->base.gui, "unit_day");
-	fs->date_unit = gtk_radio_group_get_selected
+	fs->date_unit = gnm_gtk_radio_group_get_selected
 	        (gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio)));
 
 	fs->is_step_set = ! entry_to_float (GTK_ENTRY (state->step_entry),
@@ -133,7 +133,7 @@ cb_type_button_clicked (G_GNUC_UNUSED GtkWidget *button,
 
 	/* Read the `Type' radio buttons. */
 	radio = go_gtk_builder_get_widget (state->base.gui, "type_linear");
-	type = gtk_radio_group_get_selected (gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio)));
+	type = gnm_gtk_radio_group_get_selected (gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio)));
 
 	if (type == FillSeriesTypeDate)
 		gtk_widget_set_sensitive (state->date_steps_type, TRUE);
diff --git a/src/dialogs/dialog-hyperlink.c b/src/dialogs/dialog-hyperlink.c
index 5823e8a..8611ca0 100644
--- a/src/dialogs/dialog-hyperlink.c
+++ b/src/dialogs/dialog-hyperlink.c
@@ -393,7 +393,7 @@ dhl_cb_ok (G_GNUC_UNUSED GtkWidget *button, HyperlinkState *state)
 		style = gnm_style_new ();
 		gnm_style_set_hlink (style, g_object_ref (state->link));
 		gnm_style_set_font_uline (style, UNDERLINE_SINGLE);
-		gnm_style_set_font_color (style, style_color_new_name ("blue"));
+		gnm_style_set_font_color (style, gnm_color_new_name ("blue"));
 
 		if (state->is_new) {
 			cmdname = _("Add Hyperlink");
diff --git a/src/dialogs/dialog-insert-cells.c b/src/dialogs/dialog-insert-cells.c
index 667fe80..898d646 100644
--- a/src/dialogs/dialog-insert-cells.c
+++ b/src/dialogs/dialog-insert-cells.c
@@ -70,7 +70,7 @@ cb_insert_cell_ok_clicked (G_GNUC_UNUSED GtkWidget *button,
 	radio_0 = go_gtk_builder_get_widget (state->gui, "radio_0");
 	g_return_if_fail (radio_0 != NULL);
 
-	i = gtk_radio_group_get_selected
+	i = gnm_gtk_radio_group_get_selected
 	  (gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_0)));
 
 	cols = state->sel->end.col - state->sel->start.col + 1;
diff --git a/src/dialogs/dialog-scenarios.c b/src/dialogs/dialog-scenarios.c
index c5dbff0..0a95629 100644
--- a/src/dialogs/dialog-scenarios.c
+++ b/src/dialogs/dialog-scenarios.c
@@ -132,8 +132,8 @@ summary_cb (int col, int row, GnmValue *v, summary_cb_t *p)
 		/* Set the colors. */
 		dao_set_colors (&p->dao, 2 + p->col, 3 + *index,
 				2 + p->col, 3 + *index,
-				style_color_new_go (GO_COLOR_BLACK),
-				style_color_new_gdk (&gs_light_gray));
+				gnm_color_new_go (GO_COLOR_BLACK),
+				gnm_color_new_gdk (&gs_light_gray));
 
 	} else {
 		/* New cell. */
@@ -155,8 +155,8 @@ summary_cb (int col, int row, GnmValue *v, summary_cb_t *p)
 		/* Set the colors. */
 		dao_set_colors (&p->dao, 2 + p->col, 3 + p->row,
 				2 + p->col, 3 + p->row,
-				style_color_new_go (GO_COLOR_BLACK),
-				style_color_new_gdk (&gs_light_gray));
+				gnm_color_new_go (GO_COLOR_BLACK),
+				gnm_color_new_gdk (&gs_light_gray));
 
 		/* Insert row number into the hash table. */
 		r  = g_new (int, 1);
@@ -227,11 +227,11 @@ scenario_summary (WorkbookControl *wbc,
 	dao_set_cell (&cb.dao, 0, 0, _("Scenario Summary"));
 
 	dao_set_colors (&cb.dao, 0, 0, cb.col + 1, 1,
-			style_color_new_go (GO_COLOR_WHITE),
-			style_color_new_gdk (&gs_dark_gray));
+			gnm_color_new_go (GO_COLOR_WHITE),
+			gnm_color_new_gdk (&gs_dark_gray));
 	dao_set_colors (&cb.dao, 0, 2, 0, 2 + cb.row,
-			style_color_new_go (GO_COLOR_BLACK),
-			style_color_new_gdk (&gs_light_gray));
+			gnm_color_new_go (GO_COLOR_BLACK),
+			gnm_color_new_gdk (&gs_light_gray));
 
 	dao_set_align (&cb.dao, 1, 1, cb.col + 1, 1, GNM_HALIGN_RIGHT,
 		       GNM_VALIGN_BOTTOM);
diff --git a/src/dialogs/dialog-sheet-order.c b/src/dialogs/dialog-sheet-order.c
index f369a44..7e2aeb4 100644
--- a/src/dialogs/dialog-sheet-order.c
+++ b/src/dialogs/dialog-sheet-order.c
@@ -313,7 +313,7 @@ cb_color_changed_fore (G_GNUC_UNUSED GOComboColor *go_combo_color,
 	selected_rows = gtk_tree_selection_get_selected_rows (selection, NULL);
 
 	p_gdk_color = (color == 0) ? NULL : go_color_to_gdk_rgba (color, &gdk_color);
-	gnm_color = (color == 0) ? NULL : style_color_new_gdk (&gdk_color);
+	gnm_color = (color == 0) ? NULL : gnm_color_new_gdk (&gdk_color);
 
 	old_state = workbook_sheet_state_new (wb);
 
@@ -365,7 +365,7 @@ cb_color_changed_back (G_GNUC_UNUSED GOComboColor *go_combo_color,
 	selected_rows = gtk_tree_selection_get_selected_rows (selection, NULL);
 
 	p_gdk_color = (color == 0) ? NULL : go_color_to_gdk_rgba (color, &gdk_color);
-	gnm_color = (color == 0) ? NULL : style_color_new_gdk (&gdk_color);
+	gnm_color = (color == 0) ? NULL : gnm_color_new_gdk (&gdk_color);
 
 	old_state = workbook_sheet_state_new (wb);
 
diff --git a/src/expr-impl.h b/src/expr-impl.h
index 5485bdf..57dec38 100644
--- a/src/expr-impl.h
+++ b/src/expr-impl.h
@@ -88,6 +88,7 @@ struct _GnmExprSharer {
 	GHashTable *exprs;
 
 	int nodes_in, nodes_stored, nodes_killed;
+	unsigned ref_count;
 };
 
 
diff --git a/src/expr-name.c b/src/expr-name.c
index db287ba..bf0100e 100644
--- a/src/expr-name.c
+++ b/src/expr-name.c
@@ -824,7 +824,7 @@ expr_name_downgrade_to_placeholder (GnmNamedExpr *nexpr)
  */
 /**
  * expr_name_set_pos:
- * @nexpr : the named expression
+ * @nexpr: the named expression
  * @pp: the new position
  *
  * Returns a translated error string which the caller must free if something
diff --git a/src/expr-name.h b/src/expr-name.h
index 6c36f7d..dd025c9 100644
--- a/src/expr-name.h
+++ b/src/expr-name.h
@@ -47,7 +47,7 @@ void expr_name_set_is_placeholder (GnmNamedExpr *ne, gboolean is_placeholder);
 
 char    *expr_name_as_string  (GnmNamedExpr const *ne, GnmParsePos const *pp,
 			       GnmConventions const *fmt);
-char    *expr_name_set_pos    (GnmNamedExpr *ne, GnmParsePos const *pp);
+char    *expr_name_set_pos    (GnmNamedExpr *nexpr, GnmParsePos const *pp);
 void	 expr_name_set_expr   (GnmNamedExpr *ne, GnmExprTop const *texpr);
 void	 expr_name_add_dep    (GnmNamedExpr *ne, GnmDependent *dep);
 void	 expr_name_remove_dep (GnmNamedExpr *ne, GnmDependent *dep);
@@ -60,7 +60,7 @@ gboolean expr_name_check_for_loop (char const *name, GnmExprTop const *texpr);
 
 char const *sheet_names_check	      (Sheet const *sheet, GnmRange const *r);
 
-GOUndo *expr_name_set_expr_undo_new (GnmNamedExpr *ne);
+GOUndo *expr_name_set_expr_undo_new (GnmNamedExpr *nexpr);
 
 /******************************************************************************/
 
diff --git a/src/expr.c b/src/expr.c
index 9cd0076..83325fd 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -532,6 +532,19 @@ gnm_expr_free (GnmExpr const *expr)
 	}
 }
 
+GType
+gnm_expr_get_type (void)
+{
+	static GType t = 0;
+
+	if (t == 0) {
+		t = g_boxed_type_register_static ("GnmExpr",
+			 (GBoxedCopyFunc)gnm_expr_copy,
+			 (GBoxedFreeFunc)gnm_expr_free);
+	}
+	return t;
+}
+
 /**
  * gnm_expr_equal : Returns TRUE if the supplied expressions are exactly the
  *   same.  No eval position is used to see if they are effectively the same.
@@ -2814,16 +2827,39 @@ gnm_expr_sharer_new (void)
 		 (GEqualFunc)gnm_expr_top_equal,
 		 (GDestroyNotify)gnm_expr_top_unref,
 		 NULL);
+	es->ref_count = 1;
 	return es;
 }
 
 void
 gnm_expr_sharer_destroy (GnmExprSharer *es)
 {
+	if (!es || es->ref_count-- > 1)
+		return;
 	g_hash_table_destroy (es->exprs);
 	g_free (es);
 }
 
+static GnmExprSharer *
+gnm_expr_sharer_ref (GnmExprSharer *es)
+{
+	es->ref_count++;
+	return es;
+}
+
+GType
+gnm_expr_sharer_get_type (void)
+{
+	static GType t = 0;
+
+	if (t == 0) {
+		t = g_boxed_type_register_static ("GnmExprSharer",
+			 (GBoxedCopyFunc)gnm_expr_sharer_ref,
+			 (GBoxedFreeFunc)gnm_expr_sharer_destroy);
+	}
+	return t;
+}
+
 GnmExprTop const *
 gnm_expr_sharer_share (GnmExprSharer *es, GnmExprTop const *texpr)
 {
@@ -2907,6 +2943,19 @@ gnm_expr_top_unref (GnmExprTop const *texpr)
 	}
 }
 
+GType
+gnm_expr_top_get_type (void)
+{
+	static GType t = 0;
+
+	if (t == 0) {
+		t = g_boxed_type_register_static ("GnmExprTop",
+			 (GBoxedCopyFunc)gnm_expr_top_ref,
+			 (GBoxedFreeFunc)gnm_expr_top_unref);
+	}
+	return t;
+}
+
 gboolean
 gnm_expr_top_is_shared (GnmExprTop const *texpr)
 {
diff --git a/src/expr.h b/src/expr.h
index 8ca0edf..e73f3b1 100644
--- a/src/expr.h
+++ b/src/expr.h
@@ -48,6 +48,7 @@ typedef enum {
 	case GNM_EXPR_OP_EXP: case GNM_EXPR_OP_CAT
 #define GNM_EXPR_OP_ANY_UNARY GNM_EXPR_OP_PAREN: case GNM_EXPR_OP_UNARY_NEG: case GNM_EXPR_OP_UNARY_PLUS: case GNM_EXPR_OP_PERCENTAGE
 
+GType          gnm_expr_get_type        (void);
 GnmExpr const *gnm_expr_new_constant	(GnmValue *v);
 GnmExpr const *gnm_expr_new_unary	(GnmExprOp op, GnmExpr const *e);
 GnmExpr const *gnm_expr_new_binary	(GnmExpr const *l, GnmExprOp op,
@@ -128,6 +129,7 @@ GnmExprTop const *gnm_expr_top_new_constant	(GnmValue *v);
 GnmExprTop const *gnm_expr_top_new_array_corner (int cols, int rows, GnmExpr const *expr);
 GnmExprTop const *gnm_expr_top_new_array_elem	(int x, int y);
 
+GType		gnm_expr_top_get_type (void);
 void		gnm_expr_top_ref		(GnmExprTop const *texpr);
 void		gnm_expr_top_unref		(GnmExprTop const *texpr);
 gboolean	gnm_expr_top_equal		(GnmExprTop const *te1, GnmExprTop const *te2);
@@ -191,6 +193,7 @@ void	  gnm_expr_top_as_gstring (GnmExprTop const *texpr,
 
 /*****************************************************************************/
 
+GType             gnm_expr_sharer_get_type (void);
 GnmExprSharer *   gnm_expr_sharer_new  (void);
 void              gnm_expr_sharer_destroy (GnmExprSharer *es);
 GnmExprTop const *gnm_expr_sharer_share (GnmExprSharer *es, GnmExprTop const *texpr);
diff --git a/src/format-template.c b/src/format-template.c
index 94aaf07..0bc7714 100644
--- a/src/format-template.c
+++ b/src/format-template.c
@@ -555,8 +555,8 @@ format_template_new_from_file (char const *filename, GOCmdContext *cc)
 
 /**
  * format_template_compare_name:
- * @ft_a: First GnmFormatTemplate
- * @ft_b: Second GnmFormatTemplate
+ * @a: First GnmFormatTemplate
+ * @b: Second GnmFormatTemplate
  *
  **/
 gint
diff --git a/src/func.c b/src/func.c
index 5dc4b95..6078038 100644
--- a/src/func.c
+++ b/src/func.c
@@ -980,14 +980,15 @@ gnm_func_free (GnmFunc *func)
 	g_free (func);
 }
 
-void
+GnmFunc *
 gnm_func_ref (GnmFunc *func)
 {
-	g_return_if_fail (func != NULL);
+	g_return_val_if_fail (func != NULL, NULL);
 
 	func->usage_count++;
 	if (func->usage_count == 1 && func->usage_notify != NULL)
 		func->usage_notify (func, 1);
+	return func;
 }
 
 void
@@ -1001,6 +1002,19 @@ gnm_func_unref (GnmFunc *func)
 		func->usage_notify (func, 0);
 }
 
+GType
+gnm_func_get_type (void)
+{
+	static GType t = 0;
+
+	if (t == 0) {
+		t = g_boxed_type_register_static ("GnmFunc",
+			 (GBoxedCopyFunc)gnm_func_ref,
+			 (GBoxedFreeFunc)gnm_func_unref);
+	}
+	return t;
+}
+
 /**
  */
 GnmFunc *
@@ -1273,7 +1287,7 @@ gnm_func_get_description (GnmFunc const *fn_def)
 
 /**
  * function_def_count_args:
- * @func: pointer to function definition
+ * @fn_def: pointer to function definition
  * @min: pointer to min. args
  * @max: pointer to max. args
  *
@@ -1926,10 +1940,11 @@ function_iterate_do_value (GnmEvalPos const  *ep,
 /**
  * function_iterate_argument_values
  *
- * @fp:               The position in a workbook at which to evaluate
+ * @ep:               The position in a workbook at which to evaluate
  * @callback:         The routine to be invoked for every value computed
  * @callback_closure: Closure for the callback.
- * @expr_node_list:   a GnmExprList of ExprTrees (what a Gnumeric function would get).
+ * @argc:
+ * @argv:
  * @strict:           If TRUE, the function is considered "strict".  This means
  *                   that if an error value occurs as an argument, the iteration
  *                   will stop and that error will be returned.  If FALSE, an
diff --git a/src/func.h b/src/func.h
index 57582a6..dd7a3e5 100644
--- a/src/func.h
+++ b/src/func.h
@@ -219,8 +219,9 @@ struct _GnmFuncEvalInfo {
 	GnmExprFunction const *func_call;
 };
 
+GType       gnm_func_get_type        (void);
 void	    gnm_func_free	     (GnmFunc *func);
-void	    gnm_func_ref	     (GnmFunc *func);
+GnmFunc	   *gnm_func_ref	     (GnmFunc *func);
 void	    gnm_func_unref	     (GnmFunc *func);
 void        gnm_func_load_if_stub    (GnmFunc *func);
 void	    gnm_func_load_stub	     (GnmFunc *fn_def);
@@ -273,8 +274,8 @@ GnmValue *function_def_call_with_values (GnmEvalPos const *ep, GnmFunc const *fn
 typedef GnmValue * (*FunctionIterateCB) (GnmEvalPos const *ep, GnmValue const *value,
 					 gpointer user_data);
 GnmValue *function_iterate_argument_values (GnmEvalPos const *ep,
-					    FunctionIterateCB cb,
-					    gpointer user_data,
+					    FunctionIterateCB callback,
+					    gpointer callback_closure,
 					    int argc,
 					    GnmExprConstPtr const *argv,
 					    gboolean strict,
diff --git a/src/gnm-data-cache-source.h b/src/gnm-data-cache-source.h
index 73dc5c9..7f7e308 100644
--- a/src/gnm-data-cache-source.h
+++ b/src/gnm-data-cache-source.h
@@ -38,8 +38,10 @@ GType gnm_data_cache_source_get_type (void);
 
 typedef struct _GnmDataCacheSource GnmDataCacheSource;
 
+#ifndef GOFFICE_NAMESPACE_DISABLE
 GODataCacheSource *gnm_data_cache_source_new (Sheet *src_sheet,
 					      GnmRange const *src_range, char const *src_name);
+#endif
 
 Sheet		*gnm_data_cache_source_get_sheet (GnmDataCacheSource const *src);
 void		 gnm_data_cache_source_set_sheet (GnmDataCacheSource *src, Sheet *sheet);
diff --git a/src/gnm-pane.c b/src/gnm-pane.c
index 7e4fa35..2777ad2 100644
--- a/src/gnm-pane.c
+++ b/src/gnm-pane.c
@@ -1205,9 +1205,9 @@ gnm_pane_new (SheetControlGUI *scg,
 
 /**
  * gnm_pane_find_col:
- * @pane :
- * @x : In canvas coords
- * @col_origin : optionally return the canvas coord of the col
+ * @pane:
+ * @x: In canvas coords
+ * @col_origin: optionally return the canvas coord of the col
  *
  * Returns the column containing canvas coord @x
  **/
@@ -1255,9 +1255,9 @@ gnm_pane_find_col (GnmPane const *pane, gint64 x, gint64 *col_origin)
 
 /**
  * gnm_pane_find_row:
- * @pane :
- * @y : In canvas coords
- * @row_origin : optionally return the canvas coord of the row
+ * @pane:
+ * @y: In canvas coords
+ * @row_origin: optionally return the canvas coord of the row
  *
  * Returns the column containing canvas coord @y
  **/
@@ -1672,12 +1672,12 @@ cb_pane_sliding (GnmPane *pane)
 }
 
 /**
- * gnm_pane_handle_motion :
- * @pane	 : The GnmPane managing the scroll
- * @canvas	 : The Canvas the event comes from
- * @slide_flags	 :
- * @slide_handler: The handler when sliding
- * @user_data	 : closure data
+ * gnm_pane_handle_motion:
+ * @pane: The GnmPane managing the scroll
+ * @canvas: The Canvas the event comes from
+ * @slide_flags:
+ * @handler: The handler when sliding
+ * @user_data: closure data
  *
  * Handle a motion event from a @canvas and scroll the @pane
  * depending on how far outside the bounds of @pane the @event is.
@@ -2080,9 +2080,9 @@ gnm_pane_size_guide_stop (GnmPane *pane)
 
 /**
  * gnm_pane_size_guide_motion
- * @pane : #GnmPane
- * @vert : TRUE for a vertical guide, FALSE for horizontal
- * @guide_pos : in unscaled sheet pixel coords
+ * @p: #GnmPane
+ * @vert: TRUE for a vertical guide, FALSE for horizontal
+ * @guide_pos: in unscaled sheet pixel coords
  *
  * Moves the guide line to @guide_pos.
  * NOTE : gnm_pane_size_guide_start must be called before any calls to
@@ -2953,9 +2953,9 @@ gnm_pane_object_unselect (GnmPane *pane, SheetObject *so)
 }
 
 /**
- * gnm_pane_object_update_bbox :
- * @pane : #GnmPane
- * @so : #SheetObject
+ * gnm_pane_object_update_bbox:
+ * @pane: #GnmPane
+ * @so: #SheetObject
  *
  * Updates the position and potentially creates control points
  * for manipulating the size/position of @so.
@@ -3013,10 +3013,10 @@ cb_bounds_changed (SheetObject *so, GocItem *sov)
 }
 
 /**
- * gnm_pane_object_register :
- * @so : A sheet object
- * @view   : A canvas item acting as a view for @so
- * @selectable : Add handlers for selecting and editing the object
+ * gnm_pane_object_register:
+ * @so: A sheet object
+ * @view: A canvas item acting as a view for @so
+ * @selectable: Add handlers for selecting and editing the object
  *
  * Setup some standard callbacks for manipulating a view of a sheet object.
  **/
@@ -3029,11 +3029,11 @@ gnm_pane_object_register (SheetObject *so, GocItem *view, gboolean selectable)
 }
 
 /**
- * gnm_pane_object_widget_register :
+ * gnm_pane_object_widget_register:
  *
- * @so : A sheet object
- * @widget : The widget for the sheet object view
- * @view   : A canvas item acting as a view for @so
+ * @so: A sheet object
+ * @widget: The widget for the sheet object view
+ * @view: A canvas item acting as a view for @so
  *
  * Setup some standard callbacks for manipulating widgets as views of sheet
  * objects.
diff --git a/src/gnm-sheet-slicer-combo.h b/src/gnm-sheet-slicer-combo.h
index 3e013b8..932c150 100644
--- a/src/gnm-sheet-slicer-combo.h
+++ b/src/gnm-sheet-slicer-combo.h
@@ -9,7 +9,9 @@ G_BEGIN_DECLS
 
 typedef struct {
 	GnmCellCombo	parent;
+#ifndef GOFFICE_NAMESPACE_DISABLE
 	GODataSlicerField *dsf;
+#endif
 } GnmSheetSlicerCombo;
 
 #define GNM_SHEET_SLICER_COMBO_TYPE     (gnm_sheet_slicer_combo_get_type ())
diff --git a/src/gnm-sheet-slicer.c b/src/gnm-sheet-slicer.c
index 8bb12d8..cbbe0db 100644
--- a/src/gnm-sheet-slicer.c
+++ b/src/gnm-sheet-slicer.c
@@ -299,11 +299,11 @@ gnm_sheet_slicer_field_header_at_pos (GnmSheetSlicer const *gss,
 /************************************************************/
 
 /**
- * gnm_sheet_slicers_at_pos :
- * @sheet : #Sheet
- * @pos : #GnmCellPos
+ * gnm_sheet_slicers_at_pos:
+ * @sheet: #Sheet
+ * @pos: #GnmCellPos
  *
- * Returns: %NULL or the #GnmSheetSlicer in @sheet that overlaps with @pos.
+ * Returns: (transfer none): %NULL or the #GnmSheetSlicer in @sheet that overlaps with @pos.
  **/
 GnmSheetSlicer *
 gnm_sheet_slicers_at_pos (Sheet const *sheet, GnmCellPos const *pos)
@@ -358,7 +358,7 @@ gnm_sheet_slicer_test_sort (GnmSheetSlicer *gss)
 
 /**
  * gnm_sheet_slicer_regenerate:
- * @gss : #GnmSheetSlicer
+ * @gss: #GnmSheetSlicer
  *
  * Do some work!
  * See what we need to do then think about when portions belong in the GODataSlicer base.
diff --git a/src/gnm-sheet-slicer.h b/src/gnm-sheet-slicer.h
index a35a038..ae21e1e 100644
--- a/src/gnm-sheet-slicer.h
+++ b/src/gnm-sheet-slicer.h
@@ -49,7 +49,9 @@ GnmSheetSlicerLayout
 		 gnm_sheet_slicer_get_layout     (GnmSheetSlicer const *src);
 void		 gnm_sheet_slicer_set_layout     (GnmSheetSlicer *gss, GnmSheetSlicerLayout l);
 
+#ifndef GOFFICE_NAMESPACE_DISABLE
 GODataSlicerField *gnm_sheet_slicer_field_header_at_pos (GnmSheetSlicer const *gss, GnmCellPos const *pos);
+#endif
 
 void		   gnm_sheet_slicer_regenerate	 (GnmSheetSlicer *gss);
 
diff --git a/src/gnumeric-conf.c b/src/gnumeric-conf.c
index 51a621b..bfaa3ef 100644
--- a/src/gnumeric-conf.c
+++ b/src/gnumeric-conf.c
@@ -1211,7 +1211,9 @@ static struct cb_watch_bool watch_core_gui_editing_autocomplete = {
 gboolean
 gnm_conf_get_core_gui_editing_autocomplete (void)
 {
-	if (!watch_core_gui_editing_autocomplete.handler)
+	/* testing for node_pool since this is called from
+	 workbook_view_class_init(), fixes criticals during intospÃction build */
+	if (node_pool && !watch_core_gui_editing_autocomplete.handler)
 		watch_bool (&watch_core_gui_editing_autocomplete);
 	return watch_core_gui_editing_autocomplete.var;
 }
diff --git a/src/gnumeric.h b/src/gnumeric.h
index 86b4c46..df6b0e5 100644
--- a/src/gnumeric.h
+++ b/src/gnumeric.h
@@ -46,10 +46,10 @@ typedef struct _SheetControl		SheetControl;
 
 typedef struct _SheetObject		SheetObject;
 typedef struct _SheetObjectAnchor	SheetObjectAnchor;
-typedef struct _SheetObjectView		 SheetObjectView;
+typedef struct _SheetObjectView		SheetObjectView;
 typedef struct _SheetObjectViewContainer SheetObjectViewContainer;
-typedef struct _SheetObjectImageableIface SheetObjectImageableIface;
-typedef struct _SheetObjectExportableIface SheetObjectExportableIface;
+typedef struct _SheetObjectImageable    SheetObjectImageable;
+typedef struct _SheetObjectExportable   SheetObjectExportable;
 
 typedef struct _GnmDepContainer		GnmDepContainer;
 typedef struct _GnmDependent		GnmDependent;
diff --git a/src/go-data-cache-field-impl.h b/src/go-data-cache-field-impl.h
index 285a3df..4247fb8 100644
--- a/src/go-data-cache-field-impl.h
+++ b/src/go-data-cache-field-impl.h
@@ -27,6 +27,7 @@
 #include <go-val.h>
 
 G_BEGIN_DECLS
+#ifndef GOFFICE_NAMESPACE_DISABLE
 
 struct _GODataCacheField {
 	GObject		base;
@@ -45,6 +46,7 @@ typedef struct {
 	GObjectClass base;
 } GODataCacheFieldClass;
 
+#endif
 G_END_DECLS
 
 #endif /* GO_DATA_CACHE_FIELD_IMPL_H */
diff --git a/src/go-data-cache-field.h b/src/go-data-cache-field.h
index 33116a1..9b94b99 100644
--- a/src/go-data-cache-field.h
+++ b/src/go-data-cache-field.h
@@ -30,6 +30,7 @@
 #include <gnumeric.h>
 
 G_BEGIN_DECLS
+#ifndef GOFFICE_NAMESPACE_DISABLE
 
 #define GO_DATA_CACHE_FIELD_TYPE  (go_data_cache_field_get_type ())
 #define GO_DATA_CACHE_FIELD(o)	  (G_TYPE_CHECK_INSTANCE_CAST ((o), GO_DATA_CACHE_FIELD_TYPE, GODataCacheField))
@@ -56,6 +57,7 @@ gboolean 	  go_data_cache_field_is_base (GODataCacheField const *field);
 GODataCacheFieldType
 		  go_data_cache_field_ref_type (GODataCacheField const *field);
 
+#endif
 G_END_DECLS
 
 #endif /* GO_DATA_CACHE_FIELD_H */
diff --git a/src/go-data-cache-impl.h b/src/go-data-cache-impl.h
index 63f53f3..48a4c52 100644
--- a/src/go-data-cache-impl.h
+++ b/src/go-data-cache-impl.h
@@ -26,6 +26,7 @@
 #include <glib-object.h>
 
 G_BEGIN_DECLS
+#ifndef GOFFICE_NAMESPACE_DISABLE
 
 struct _GODataCache {
 	GObject		base;
@@ -52,6 +53,7 @@ typedef struct {
 /* utility macro */
 #define go_data_cache_records_index(c, i)	((c)->records + ((c)->record_size * (i)))
 
+#endif
 G_END_DECLS
 
 #endif /* GO_DATA_CACHE_IMPL_H */
diff --git a/src/go-data-cache-source.h b/src/go-data-cache-source.h
index c57277d..231d644 100644
--- a/src/go-data-cache-source.h
+++ b/src/go-data-cache-source.h
@@ -27,6 +27,7 @@
 #include <glib-object.h>
 
 G_BEGIN_DECLS
+#ifndef GOFFICE_NAMESPACE_DISABLE
 
 typedef struct {
 	GTypeInterface		   base;
@@ -48,6 +49,7 @@ GType go_data_cache_source_get_type (void);
 GODataCache *	go_data_cache_source_allocate	  (GODataCacheSource const *src);
 gboolean	go_data_cache_source_needs_update (GODataCacheSource const *src);
 
+#endif
 G_END_DECLS
 
 #endif /* GO_DATA_CACHE_SOURCE_H */
diff --git a/src/go-data-cache.h b/src/go-data-cache.h
index 3601c38..be0a852 100644
--- a/src/go-data-cache.h
+++ b/src/go-data-cache.h
@@ -28,6 +28,7 @@
 #include <glib-object.h>
 
 G_BEGIN_DECLS
+#ifndef GOFFICE_NAMESPACE_DISABLE
 
 #define GO_DATA_CACHE_TYPE	(go_data_cache_get_type ())
 #define GO_DATA_CACHE(o)	(G_TYPE_CHECK_INSTANCE_CAST ((o), GO_DATA_CACHE_TYPE, GODataCache))
@@ -65,6 +66,7 @@ void go_data_cache_dump (GODataCache *dc,
 			 GArray const *permutation);
 void go_data_cache_dump_value (GOVal const *v);
 
+#endif
 G_END_DECLS
 
 #endif /* GO_DATA_CACHE_H */
diff --git a/src/go-data-slicer-field-impl.h b/src/go-data-slicer-field-impl.h
index a60389a..5bf3f88 100644
--- a/src/go-data-slicer-field-impl.h
+++ b/src/go-data-slicer-field-impl.h
@@ -26,6 +26,7 @@
 #include <glib-object.h>
 
 G_BEGIN_DECLS
+#ifndef GOFFICE_NAMESPACE_DISABLE
 
 struct _GODataSlicerField {
 	GObject		base;
@@ -43,6 +44,7 @@ typedef struct {
 	GObjectClass base;
 } GODataSlicerFieldClass;
 
+#endif
 G_END_DECLS
 
 #endif /* GO_DATA_SLICER_FIELD_IMPL_H */
diff --git a/src/go-data-slicer-field.h b/src/go-data-slicer-field.h
index 3be9b7f..bbfb648 100644
--- a/src/go-data-slicer-field.h
+++ b/src/go-data-slicer-field.h
@@ -27,6 +27,7 @@
 #include <glib-object.h>
 
 G_BEGIN_DECLS
+#ifndef GOFFICE_NAMESPACE_DISABLE
 
 #define GO_DATA_SLICER_FIELD_TYPE	(go_data_slicer_field_get_type ())
 #define GO_DATA_SLICER_FIELD(o)		(G_TYPE_CHECK_INSTANCE_CAST ((o), GO_DATA_SLICER_FIELD_TYPE, GODataSlicerField))
@@ -42,6 +43,7 @@ void	  	  go_data_slicer_field_set_field_type_pos (GODataSlicerField *dsf,
 							   GODataSlicerFieldType field_type,
 							   int pos);
 
+#endif
 G_END_DECLS
 
 #endif /* GO_DATA_SLICER_FIELD_H */
diff --git a/src/go-data-slicer-impl.h b/src/go-data-slicer-impl.h
index 514fbc0..caf043b 100644
--- a/src/go-data-slicer-impl.h
+++ b/src/go-data-slicer-impl.h
@@ -27,6 +27,7 @@
 #include <glib-object.h>
 
 G_BEGIN_DECLS
+#ifndef GOFFICE_NAMESPACE_DISABLE
 
 struct _GODataSlicer {
 	GObject		base;
@@ -40,6 +41,7 @@ typedef struct {
 	GObjectClass base;
 } GODataSlicerClass;
 
+#endif
 G_END_DECLS
 
 #endif /* GO_DATA_SLICER_IMPL_H */
diff --git a/src/go-data-slicer.h b/src/go-data-slicer.h
index 379a250..28e8d4f 100644
--- a/src/go-data-slicer.h
+++ b/src/go-data-slicer.h
@@ -26,6 +26,7 @@
 #include <glib-object.h>
 
 G_BEGIN_DECLS
+#ifndef GOFFICE_NAMESPACE_DISABLE
 
 #define GO_DATA_SLICER_TYPE	(go_data_slicer_get_type ())
 #define GO_DATA_SLICER(o)	(G_TYPE_CHECK_INSTANCE_CAST ((o), GO_DATA_SLICER_TYPE, GODataSlicer))
@@ -40,6 +41,7 @@ void		   go_data_slicer_add_field   (GODataSlicer *ds, GODataSlicerField *field)
 GODataSlicerField *go_data_slicer_get_field   (GODataSlicer const *ds, unsigned int field_index);
 unsigned int	   go_data_slicer_num_fields  (GODataSlicer const *ds);
 
+#endif
 G_END_DECLS
 
 #endif /* GO_DATA_SLICER_H */
diff --git a/src/go-val.h b/src/go-val.h
index d478632..5d9779c 100644
--- a/src/go-val.h
+++ b/src/go-val.h
@@ -27,6 +27,7 @@
 #include "gnm-format.h"	/* remove after move to goffice */
 
 G_BEGIN_DECLS
+#ifndef GOFFICE_NAMESPACE_DISABLE
 
 typedef GnmValue	GOVal;
 #define GO_VAL_TYPE	gnm_value_get_type()
@@ -88,6 +89,7 @@ void	go_val_bucketer_init	 (GOValBucketer *bucketer);
 GError *go_val_bucketer_validate (GOValBucketer *bucketer);
 int	go_val_bucketer_apply	 (GOValBucketer const *bucketer, GOVal const *v);
 
+#endif
 G_END_DECLS
 
 #endif /* GO_VAL_H */
diff --git a/src/goffice-data.h b/src/goffice-data.h
index ca1849b..0f0790c 100644
--- a/src/goffice-data.h
+++ b/src/goffice-data.h
@@ -4,6 +4,7 @@
 #include <glib-object.h>
 
 G_BEGIN_DECLS
+#ifndef GOFFICE_NAMESPACE_DISABLE
 
 /* DOES NOT BELONG HERE */
 typedef struct _GODataCache		GODataCache;
@@ -38,6 +39,7 @@ typedef enum {
 	GO_AGGREGATE_BY_VAR,
 	GO_AGGREGATE_BY_VARP
 } GOAggregateBy;
+#endif
 G_END_DECLS
 
 #endif /* GOFFICE_DUMMY_DATA_H */
diff --git a/src/graph.h b/src/graph.h
index 1aa7d36..07ae9fb 100644
--- a/src/graph.h
+++ b/src/graph.h
@@ -45,7 +45,7 @@ typedef struct {
 	gboolean share_x, new_sheet;
 	GObject *obj;
 	GogDataAllocator *dalloc;
-} GraphDataClosure;
+} GnmGraphDataClosure;
 
 G_END_DECLS
 
diff --git a/src/gui-clipboard.c b/src/gui-clipboard.c
index 0a18c7a..b9e2ff0 100644
--- a/src/gui-clipboard.c
+++ b/src/gui-clipboard.c
@@ -484,7 +484,7 @@ table_content_received (GtkClipboard *clipboard, GtkSelectionData *sel,
 		/* The data is the gnumeric specific XML interchange format */
 		GOIOContext *io_context =
 			go_io_context_new (GO_CMD_CONTEXT (wbcg));
-		content = xml_cellregion_read
+		content = gnm_xml_cellregion_read
 			(wbc, io_context,
 			 pt->sheet,
 			 (const char *)gtk_selection_data_get_data (sel), gtk_selection_data_get_length (sel));
diff --git a/src/gui-util.c b/src/gui-util.c
index fec4b6a..ca05658 100644
--- a/src/gui-util.c
+++ b/src/gui-util.c
@@ -391,8 +391,14 @@ gnumeric_editable_enters (GtkWindow *window, GtkWidget *w)
 		G_CALLBACK (cb_activate_default), window);
 }
 
+/**
+ * gnm_gtk_radio_group_get_selected:
+ * @radio_group: (element-type GtkRadioButton): list of radio buttons.
+ *
+ * Returns: the index of the selected radio button starting from list end.
+ **/
 int
-gtk_radio_group_get_selected (GSList *radio_group)
+gnm_gtk_radio_group_get_selected (GSList *radio_group)
 {
 	GSList *l;
 	int i, c;
diff --git a/src/gui-util.h b/src/gui-util.h
index 032b418..6697fda 100644
--- a/src/gui-util.h
+++ b/src/gui-util.h
@@ -25,10 +25,10 @@ void       gnumeric_keyed_dialog (WBCGtk *wbcg,
 				  char const *key);
 gpointer   gnumeric_dialog_raise_if_exists (WBCGtk *wbcg,
 					    char const *key);
-void       gnumeric_editable_enters	(GtkWindow *window, GtkWidget *w);
+void       gnumeric_editable_enters	(GtkWindow *window, GtkWidget *editable);
 
 /* Utility routine as Gtk does not have any decent routine to do this */
-int gtk_radio_group_get_selected (GSList *radio_group);
+int gnm_gtk_radio_group_get_selected (GSList *radio_group);
 /* Utility routine as libglade does not have any decent routine to do this */
 int gnm_gui_group_value (gpointer gui, char const * const group[]);
 
diff --git a/src/hlink.c b/src/hlink.c
index 550fb67..1e323eb 100644
--- a/src/hlink.c
+++ b/src/hlink.c
@@ -50,11 +50,11 @@
  * The type names are used in the xml persistence DO NOT CHANGE THEM
  **/
 /**
- * gnm_hlink_activate :
- * @link :
- * @wbcg : the wbcg that activated the link
+ * gnm_hlink_activate:
+ * @link:
+ * @wbcg: the wbcg that activated the link
  *
- * Return TRUE if the link successfully activated.
+ * Returns: TRUE if the link successfully activated.
  **/
 gboolean
 gnm_hlink_activate (GnmHLink *lnk, WBCGtk *wbcg)
@@ -64,6 +64,13 @@ gnm_hlink_activate (GnmHLink *lnk, WBCGtk *wbcg)
 	return GET_CLASS (lnk)->Activate (lnk, wbcg);
 }
 
+/**
+ * sheet_hlink_find:
+ * @sheet: #Sheet
+ * @pos: #GcmCellPos
+ *
+ * Returns: (transfer none): the found #GnmHLink.
+ **/
 GnmHLink *
 sheet_hlink_find (Sheet const *sheet, GnmCellPos const *pos)
 {
diff --git a/src/item-bar.c b/src/item-bar.c
index b780ef2..78b8625 100644
--- a/src/item-bar.c
+++ b/src/item-bar.c
@@ -178,6 +178,12 @@ item_bar_calc_size (ItemBar *ib)
 		(ib->is_col_header ? ib->cell_height : ib->cell_width);
 }
 
+/**
+ * item_bar_normal_font:
+ * @ib: #ItemBar
+ * 
+ * Returns: (transfer none): the bar normal font.
+ **/
 PangoFont *
 item_bar_normal_font (ItemBar const *ib)
 {
diff --git a/src/mstyle.c b/src/mstyle.c
index 8c50477..5c4b96b 100644
--- a/src/mstyle.c
+++ b/src/mstyle.c
@@ -737,6 +737,19 @@ gnm_style_unref (GnmStyle const *style)
 	}
 }
 
+GType
+gnm_style_get_type (void)
+{
+	static GType t = 0;
+
+	if (t == 0) {
+		t = g_boxed_type_register_static ("GnmStyle",
+			 (GBoxedCopyFunc)gnm_style_ref,
+			 (GBoxedFreeFunc)gnm_style_unref);
+	}
+	return t;
+}
+
 /**
  * Replace auto pattern color in style with sheet's auto pattern color.
  * make_copy tells if we are allowed to modify the style in place or we must
@@ -1656,6 +1669,12 @@ gnm_style_set_hlink (GnmStyle *style, GnmHLink *link)
 	style->hlink = link;
 }
 
+/**
+ * gnm_style_get_hlink:
+ * @style: #GnmStyle
+ *
+ * Returns: (transfer none): the associated #GnmHLink.
+ **/
 GnmHLink *
 gnm_style_get_hlink (GnmStyle const *style)
 {
@@ -1879,7 +1898,7 @@ gnm_style_set_from_pango_attribute (GnmStyle *style, PangoAttribute const *attr)
 			((PangoAttrInt *)attr)->value >= PANGO_WEIGHT_BOLD);
 		break;
 	case PANGO_ATTR_FOREGROUND :
-		gnm_style_set_font_color (style, style_color_new_pango (
+		gnm_style_set_font_color (style, gnm_color_new_pango (
 			&((PangoAttrColor *)attr)->color));
 		break;
 	case PANGO_ATTR_UNDERLINE :
diff --git a/src/mstyle.h b/src/mstyle.h
index a271a51..db1de9e 100644
--- a/src/mstyle.h
+++ b/src/mstyle.h
@@ -60,12 +60,13 @@ typedef enum {
 	MSTYLE_ELEMENT_MAX
 } GnmStyleElement;
 
+GType       gnm_style_get_type      (void);
 GnmStyle   *gnm_style_new           (void);
 GnmStyle   *gnm_style_new_default   (void);
 GnmStyle   *gnm_style_new_merged    (GnmStyle const *base, GnmStyle const *overlay);
 GnmStyle   *gnm_style_dup	    (GnmStyle const *src);
 void        gnm_style_merge	    (GnmStyle *base, GnmStyle const *overlay);
-void        gnm_style_merge_element (GnmStyle *base, GnmStyle const *overlay,
+void        gnm_style_merge_element (GnmStyle *dst, GnmStyle const *src,
 				     GnmStyleElement elem);
 void        gnm_style_ref           (GnmStyle const *style);
 void        gnm_style_unref         (GnmStyle const *style);
diff --git a/src/parse-util.c b/src/parse-util.c
index ed228ab..3d155d2 100644
--- a/src/parse-util.c
+++ b/src/parse-util.c
@@ -639,9 +639,10 @@ cell_name (GnmCell const *cell)
 }
 
 /**
- * cellpos_parse
- * @cell_name:   a string representation of a cell name.
- * @pos:         result
+ * cellpos_parse:
+ * @cell_str:   a string representation of a cell name.
+ * @ss:          #GnmSheetSize
+ * @res:         result
  * @strict:      if this is TRUE, then parsing stops at possible errors,
  *               otherwise an attempt is made to return cell names with
  *               trailing garbage.
@@ -721,9 +722,9 @@ gnm_expr_char_start_p (char const * c)
  * parse_text_value_or_expr : Utility routine to parse a string and convert it
  *     into an expression or value.
  *
- * @pos : If the string looks like an expression parse it at this location.
+ * @pos: If the string looks like an expression parse it at this location.
  * @text: The text to be parsed.
- * @val : Returns a GnmValue* if the text was a value, otherwise NULL.
+ * @val: Returns a GnmValue* if the text was a value, otherwise NULL.
  * @texpr: Returns a GnmExprTop* if the text was an expression, otherwise NULL.
  *
  * If there is a parse failure for an expression an error GnmValue with the syntax
@@ -1456,6 +1457,19 @@ gnm_conventions_ref (GnmConventions *c)
 	return c;
 }
 
+GType
+gnm_conventions_get_type (void)
+{
+	static GType t = 0;
+
+	if (t == 0) {
+		t = g_boxed_type_register_static ("GnmConventions",
+			 (GBoxedCopyFunc)gnm_conventions_ref,
+			 (GBoxedFreeFunc)gnm_conventions_unref);
+	}
+	return t;
+}
+
 /* ------------------------------------------------------------------------- */
 
 GnmConventions const *gnm_conventions_default;
@@ -1489,8 +1503,8 @@ parse_util_shutdown (void)
 /* ------------------------------------------------------------------------- */
 /**
  * gnm_expr_conv_quote:
- * @convs : #GnmConventions
- * @str   : string to quote
+ * @conv: #GnmConventions
+ * @str: string to quote
  *
  * Quotes @str according to the convention @convs if necessary.
  * or returns a literal copy of @str if no quoting was needed.
diff --git a/src/parse-util.h b/src/parse-util.h
index 08b913a..8154dd0 100644
--- a/src/parse-util.h
+++ b/src/parse-util.h
@@ -200,6 +200,7 @@ struct _GnmConventions {
 					       char const *name);
 	} output;
 };
+GType           gnm_conventions_get_type (void);
 GnmConventions *gnm_conventions_new	 (void);
 GnmConventions *gnm_conventions_new_full (unsigned size);
 
diff --git a/src/print-info.c b/src/print-info.c
index 3b91a6d..c507685 100644
--- a/src/print-info.c
+++ b/src/print-info.c
@@ -190,6 +190,19 @@ print_info_free (PrintInformation *pi)
 	g_free (pi);
 }
 
+GType
+print_information_get_type (void)
+{
+	static GType t = 0;
+
+	if (t == 0) {
+		t = g_boxed_type_register_static ("PrintInformation",
+			 (GBoxedCopyFunc)print_info_dup,
+			 (GBoxedFreeFunc)print_info_free);
+	}
+	return t;
+}
+
 static void
 load_formats (void)
 {
@@ -686,8 +699,8 @@ render_opcode (GString *target, char /* non-const */ *opcode,
           &Y              Subscript on/off (BIFF5-BIFF8)
      &"<fontname>"        Set new font <fontname>
 &"<fontname>,<fontstyle>" Set new font with specified style <fontstyle>. The style <fontstyle> is in most cases
-                          one of âRegularâ, âBoldâ, âItalicâ, or âBold Italicâ. But this setting is dependent on the
-                          used font, it may differ (localised style names, or âStandardâ, âObliqueâ, ...). (BIFF5-
+                          one of "Regular", "Bold", "Italic", or "Bold Italic". But this setting is dependent on the
+                          used font, it may differ (localised style names, or "Standard", "Oblique", ...). (BIFF5-
                           BIFF8)
      &<fontheight>        Set font height in points (<fontheight> is a decimal value). If this command is followed
                           by a plain number to be printed in the header, it will be separated from the font height
diff --git a/src/print-info.h b/src/print-info.h
index eddb9e3..a24a26f 100644
--- a/src/print-info.h
+++ b/src/print-info.h
@@ -128,6 +128,7 @@ typedef struct {
 	GnmCellPos top_repeating;
 } HFRenderInfo;
 
+GType             print_information_get_type (void);
 PrintInformation *print_info_new         (gboolean load_defaults);
 PrintInformation *print_info_load_defaults (PrintInformation *pi);
 PrintInformation *print_info_dup	 (PrintInformation const *pi);
diff --git a/src/ranges.c b/src/ranges.c
index f94aa04..40af748 100644
--- a/src/ranges.c
+++ b/src/ranges.c
@@ -424,9 +424,9 @@ range_split_ranges (GnmRange const *hard, GnmRange const *soft)
 
 /**
  * gnm_range_dup:
- * @a: Source range to copy
+ * @r: Source range to copy
  *
- * Copies the @a range.
+ * Copies the @r range.
  *
  * Return value: A copy of the GnmRange.
  **/
@@ -498,7 +498,7 @@ range_intersection (GnmRange *r, GnmRange const *a, GnmRange const *b)
 
 /**
  * range_normalize:
- * @a: a range
+ * @r: a range
  *
  * Ensures that start <= end for rows and cols.
  **/
@@ -636,7 +636,7 @@ range_height (GnmRange const *r)
 /**
  * range_translate:
  * @range:
- * @sheet : the sheet in which @range lives
+ * @sheet: the sheet in which @range lives
  * @col_offset:
  * @row_offset:
  *
@@ -707,7 +707,7 @@ range_is_sane (GnmRange const *range)
 /**
  * range_transpose:
  * @range: The range.
- * @sheet : the sheet in which @range lives
+ * @sheet: the sheet in which @range lives
  * @boundary: The box to transpose inside
  *
  *   Effectively mirrors the ranges in 'boundary' around a
@@ -830,6 +830,18 @@ gnm_sheet_range_free (GnmSheetRange *gr)
 	g_free (gr);
 }
 
+GType
+gnm_sheet_range_get_type (void)
+{
+	static GType t = 0;
+
+	if (t == 0)
+		t = g_boxed_type_register_static ("GnmSheetRange",
+			 (GBoxedCopyFunc)gnm_sheet_range_dup,
+			 (GBoxedFreeFunc)gnm_sheet_range_free);
+	return t;
+}
+
 gboolean
 gnm_sheet_range_equal (const GnmSheetRange *a,
 		       const GnmSheetRange *b)
@@ -954,7 +966,7 @@ range_list_name_try (GString *names, char const *sheet, GSList const *ranges)
 /**
  * undo_range_list_name:
  * @sheet:
- * @ranges : GSList containing GnmRange *'s
+ * @ranges: GSList containing GnmRange *'s
  *
  * Returns the range list name depending on the preference setting.
  * (The result will be something like: "A1:C3, D4:E5"). The string will be
@@ -1003,12 +1015,13 @@ undo_range_list_name (Sheet const *sheet, GSList const *ranges)
 /**
  * global_range_list_parse:
  * @sheet: Sheet where the range specification is relatively parsed to
- * @str  : a range or list of ranges to parse (ex: "A1", "A1:B1,C2,Sheet2!D2:D4")
+ * @str: a range or list of ranges to parse (ex: "A1", "A1:B1,C2,Sheet2!D2:D4")
  *
  * Parses a list of ranges, relative to the @sheet and returns a list with the
  * results.
  *
- * Returns a GSList containing Values of type VALUE_CELLRANGE, or NULL on failure
+ * Returns: (element-type GnmValue) (transfer full): a GSList containing
+ * Values of type VALUE_CELLRANGE, or NULL on failure
  **/
 GSList *
 global_range_list_parse (Sheet *sheet, char const *str)
@@ -1072,7 +1085,7 @@ global_range_list_foreach (GSList *gr_list, GnmEvalPos const *ep,
 
 /**
  * global_range_contained:
- * @sheet : The calling context #Sheet for references with sheet==NULL
+ * @sheet: The calling context #Sheet for references with sheet==NULL
  * @a:
  * @b:
  *
diff --git a/src/ranges.h b/src/ranges.h
index e581f8a..bb47e35 100644
--- a/src/ranges.h
+++ b/src/ranges.h
@@ -104,6 +104,7 @@ void        range_dump		(GnmRange const *r, char const *suffix);
 GSList     *range_split_ranges    (GnmRange const *hard, GnmRange const *soft);
 GSList     *range_fragment        (GnmRange const *a, GnmRange const *b);
 
+GType	       gnm_sheet_range_get_type   (void); /* GBoxedType */
 GnmSheetRange *gnm_sheet_range_new	  (Sheet *sheet, GnmRange const *r);
 void           gnm_sheet_range_free       (GnmSheetRange *r);
 gboolean       gnm_sheet_range_from_value (GnmSheetRange *r, GnmValue const *v);
diff --git a/src/selection.c b/src/selection.c
index 377a9cf..ddbf9cf 100644
--- a/src/selection.c
+++ b/src/selection.c
@@ -1487,7 +1487,7 @@ sv_selection_to_plot (SheetView *sv, GogPlot *go_plot)
 	GogPlotDesc const *desc;
 	GogSeries *series;
 	GogGraph *graph = gog_object_get_graph (GOG_OBJECT (go_plot));
-	GraphDataClosure *data = g_object_get_data (G_OBJECT (graph), "data-closure");
+	GnmGraphDataClosure *data = g_object_get_data (G_OBJECT (graph), "data-closure");
 	gboolean is_string_vec, first_series = TRUE, first_value_dim = TRUE;
 	unsigned i, count, cur_dim = 0, num_series = 1;
 	gboolean has_header = FALSE, as_cols;
diff --git a/src/sheet-control-gui.c b/src/sheet-control-gui.c
index 3951fa1..cb652f2 100644
--- a/src/sheet-control-gui.c
+++ b/src/sheet-control-gui.c
@@ -3842,7 +3842,7 @@ scg_drag_receive_cellregion (SheetControlGUI *scg, double x, double y,
 	GOIOContext *io_context =
 		go_io_context_new (GO_CMD_CONTEXT (scg->wbcg));
 
-	content = xml_cellregion_read (scg_wbc (scg), io_context,
+	content = gnm_xml_cellregion_read (scg_wbc (scg), io_context,
 				       scg_sheet (scg), data, len);
 	g_object_unref (io_context);
 	if (content != NULL) {
diff --git a/src/sheet-filter.c b/src/sheet-filter.c
index fccceda..f3d6c78 100644
--- a/src/sheet-filter.c
+++ b/src/sheet-filter.c
@@ -125,6 +125,19 @@ gnm_filter_condition_free (GnmFilterCondition *cond)
 	g_free (cond);
 }
 
+GType
+gnm_filter_condition_get_type (void)
+{
+	static GType t = 0;
+
+	if (t == 0) {
+		t = g_boxed_type_register_static ("GnmFilterCondition",
+			 (GBoxedCopyFunc)gnm_filter_condition_dup,
+			 (GBoxedFreeFunc)gnm_filter_condition_free);
+	}
+	return t;
+}
+
 /*****************************************************************************/
 
 typedef struct  {
@@ -710,6 +723,19 @@ gnm_filter_unref (GnmFilter *filter)
 	g_free (filter);
 }
 
+GType
+gnm_filter_get_type (void)
+{
+	static GType t = 0;
+
+	if (t == 0) {
+		t = g_boxed_type_register_static ("GnmFilter",
+			 (GBoxedCopyFunc)gnm_filter_ref,
+			 (GBoxedFreeFunc)gnm_filter_unref);
+	}
+	return t;
+}
+
 void
 gnm_filter_remove (GnmFilter *filter)
 {
diff --git a/src/sheet-filter.h b/src/sheet-filter.h
index 8ce8aa1..199b09a 100644
--- a/src/sheet-filter.h
+++ b/src/sheet-filter.h
@@ -65,6 +65,7 @@ struct _GnmFilter {
 	gboolean   is_active;
 };
 
+GType               gnm_filter_condition_get_type   (void);
 GnmFilterCondition *gnm_filter_condition_dup        (GnmFilterCondition const *src);
 void                gnm_filter_condition_free       (GnmFilterCondition *cond);
 GnmFilterCondition *gnm_filter_condition_new_single (GnmFilterOp op, GnmValue *v);
@@ -76,6 +77,7 @@ GnmFilterCondition *gnm_filter_condition_new_bucket (gboolean top,
 						     gboolean rel_range,
 						     double n);
 
+GType                     gnm_filter_get_type       (void);
 GnmFilter		 *gnm_filter_new	    (Sheet *sheet, GnmRange const *r);
 GnmFilter		 *gnm_filter_dup	    (GnmFilter const *src,
 						     Sheet *sheet);
diff --git a/src/sheet-merge.c b/src/sheet-merge.c
index 52a3808..59b9583 100644
--- a/src/sheet-merge.c
+++ b/src/sheet-merge.c
@@ -47,13 +47,13 @@ range_row_cmp (GnmRange const *a, GnmRange const *b)
 }
 
 /**
- * gnm_sheet_merge_add :
+ * gnm_sheet_merge_add:
  *
- * @sheet : the sheet which will contain the region
- * @src : The region to merge
- * @clear : should the non-corner content of the region be cleared and the
+ * @sheet: the sheet which will contain the region
+ * @src: The region to merge
+ * @clear: should the non-corner content of the region be cleared and the
  *          style from the corner applied.
- * @cc : the calling context
+ * @cc: the calling context
  *
  * Add a range to the list of merge targets.  Checks for array spliting returns
  * %TRUE if there was an error.  Queues a respan.  Only queus a redraw if @clear
@@ -151,11 +151,11 @@ gnm_sheet_merge_add (Sheet *sheet, GnmRange const *r, gboolean clear,
 }
 
 /**
- * gnm_sheet_merge_remove :
+ * gnm_sheet_merge_remove:
  *
- * @sheet : the sheet which will contain the region
- * @range : The region
- * @cc    : the calling context
+ * @sheet: the sheet which will contain the region
+ * @range: The region
+ * @cc: the calling context
  *
  * Remove a merged range.
  * Queues a redraw.
@@ -196,9 +196,10 @@ gnm_sheet_merge_remove (Sheet *sheet, GnmRange const *r, GOCmdContext *cc)
 }
 
 /**
- * gnm_sheet_merge_get_overlap :
+ * gnm_sheet_merge_get_overlap:
  *
- * Returns a list of the merged regions that overlap the target region.
+ * Returns: (element-type GnmRange) (transfer container): a list of the merged
+ * regions that overlap the target region.
  * The list is ordered from top to bottom and RIGHT TO LEFT (by start coord).
  * Caller is responsible for freeing the list, but not the content.
  */
@@ -221,7 +222,7 @@ gnm_sheet_merge_get_overlap (Sheet const *sheet, GnmRange const *range)
 }
 
 /**
- * gnm_sheet_merge_contains_pos :
+ * gnm_sheet_merge_contains_pos:
  *
  * If the GnmCellPos is contained in a merged region return the range.
  * The GnmRange should NOT be freed.
@@ -243,11 +244,11 @@ gnm_sheet_merge_contains_pos (Sheet const *sheet, GnmCellPos const *pos)
 }
 
 /**
- * gnm_sheet_merge_get_adjacent
- * @sheet : The sheet to look in.
- * @pos : the cell to test for adjacent regions.
- * @left : the return for a region on the left
- * @right : the return for a region on the right
+ * gnm_sheet_merge_get_adjacent:
+ * @sheet: The sheet to look in.
+ * @pos: the cell to test for adjacent regions.
+ * @left: the return for a region on the left
+ * @right: the return for a region on the right
  *
  * Returns the nearest regions to either side of @pos.
  */
@@ -280,10 +281,10 @@ gnm_sheet_merge_get_adjacent (Sheet const *sheet, GnmCellPos const *pos,
 }
 
 /**
- * gnm_sheet_merge_is_corner :
+ * gnm_sheet_merge_is_corner:
  *
- * @sheet :
- * @pos : cellpos if top left corner
+ * @sheet:
+ * @pos: cellpos if top left corner
  *
  * Returns a GnmRange pointer if the @pos is the topleft of a merged region.
  * The pointer should NOT be freed by the caller.
@@ -298,9 +299,8 @@ gnm_sheet_merge_is_corner (Sheet const *sheet, GnmCellPos const *pos)
 }
 
 /**
- * gnm_sheet_merge_relocate :
- *
- * @rinfo : Descriptor of what is moving.
+ * gnm_sheet_merge_relocate:
+ * @rinfo: Descriptor of what is moving.
  *
  * Shifts merged regions that need to move.
  */
@@ -358,8 +358,8 @@ gnm_sheet_merge_relocate (GnmExprRelocateInfo const *ri)
 
 /**
  * gnm_sheet_merge_find_container
- * @sheet : sheet
- * @r     : the range to test
+ * @sheet: sheet
+ * @r: the range to test
  */
 void
 gnm_sheet_merge_find_container (Sheet const *sheet, GnmRange *target)
diff --git a/src/sheet-object-component.c b/src/sheet-object-component.c
index 36dda44..867bf6d 100644
--- a/src/sheet-object-component.c
+++ b/src/sheet-object-component.c
@@ -448,7 +448,10 @@ GSF_CLASS_FULL (SheetObjectComponent, sheet_object_component,
 		GSF_INTERFACE (soc_exportable_init, SHEET_OBJECT_EXPORTABLE_TYPE));
 
 /**
- * sheet_object_component_new :
+ * sheet_object_component_new:
+ * @component: #GOComponent
+ *
+ * Returns: (transfer full): the newly allocated #SheetObject.
  **/
 SheetObject *
 sheet_object_component_new (GOComponent *component)
@@ -458,6 +461,12 @@ sheet_object_component_new (GOComponent *component)
 	return SHEET_OBJECT (soc);
 }
 
+/**
+ * sheet_object_component_get_component:
+ * @soc: #SheetObject
+ *
+ * Returns: (transfer none): the embedded #GOComponent or %NULL on error.
+ **/
 GOComponent*
 sheet_object_component_get_component (SheetObject *soc)
 {
diff --git a/src/sheet-object-graph.c b/src/sheet-object-graph.c
index 41a3d23..b94ee0f 100644
--- a/src/sheet-object-graph.c
+++ b/src/sheet-object-graph.c
@@ -609,10 +609,11 @@ GSF_CLASS_FULL (SheetObjectGraph, sheet_object_graph,
 		GSF_INTERFACE (sog_exportable_init, SHEET_OBJECT_EXPORTABLE_TYPE))
 
 /**
- * sheet_object_graph_new :
- * @graph : #GogGraph
+ * sheet_object_graph_new:
+ * @graph: #GogGraph
  *
  * Adds a reference to @graph and creates a gnumeric sheet object wrapper
+ * Returns: (transfer full): the newly allocated #SheetObject.
  **/
 SheetObject *
 sheet_object_graph_new (GogGraph *graph)
@@ -622,6 +623,13 @@ sheet_object_graph_new (GogGraph *graph)
 	return SHEET_OBJECT (sog);
 }
 
+/**
+ * sheet_object_graph_get_gog:
+ * @soc: #SheetObject
+ *
+ * Returns: (transfer none): the embedded #GogGraph or %NULL on error.
+ **/
+
 GogGraph *
 sheet_object_graph_get_gog (SheetObject *sog)
 {
@@ -631,9 +639,9 @@ sheet_object_graph_get_gog (SheetObject *sog)
 }
 
 /**
- * sheet_object_graph_set_gog :
- * @so : #SheetObjectGraph
- * @graph : #GogGraph
+ * sheet_object_graph_set_gog:
+ * @so: #SheetObjectGraph
+ * @graph: #GogGraph
  *
  * If @graph is non NULL add a reference to it, otherwise create a new graph.
  * Assign the graph to its SheetObjectGraph wrapper and initialize the
@@ -685,7 +693,7 @@ cb_graph_guru_done (WBCGtk *wbcg)
 }
 
 static void
-cb_graph_data_closure_done (GraphDataClosure *data)
+cb_graph_data_closure_done (GnmGraphDataClosure *data)
 {
 	if (data->obj)
 		g_object_set_data (data->obj,"data-closure", NULL);
@@ -693,7 +701,7 @@ cb_graph_data_closure_done (GraphDataClosure *data)
 }
 
 static void
-cb_selection_mode_changed (GtkComboBox *box, GraphDataClosure *data)
+cb_selection_mode_changed (GtkComboBox *box, GnmGraphDataClosure *data)
 {
 	GogObject *graph = (GogObject *) g_object_get_data (data->obj, "graph");
 	data->colrowmode = gtk_combo_box_get_active (box);
@@ -708,7 +716,7 @@ cb_selection_mode_changed (GtkComboBox *box, GraphDataClosure *data)
 }
 
 static void
-cb_shared_mode_changed (GtkToggleButton *btn, GraphDataClosure *data)
+cb_shared_mode_changed (GtkToggleButton *btn, GnmGraphDataClosure *data)
 {
 	GogObject *graph = (GogObject *) g_object_get_data (data->obj, "graph");
 	data->share_x = gtk_toggle_button_get_active (btn);
@@ -723,7 +731,7 @@ cb_shared_mode_changed (GtkToggleButton *btn, GraphDataClosure *data)
 }
 
 static void
-cb_sheet_target_changed (GtkToggleButton *btn, GraphDataClosure *data)
+cb_sheet_target_changed (GtkToggleButton *btn, GnmGraphDataClosure *data)
 {
 	data->new_sheet = gtk_toggle_button_get_active (btn);
 }
@@ -735,7 +743,7 @@ sheet_object_graph_guru (WBCGtk *wbcg, GogGraph *graph,
 	GtkWidget *dialog = gog_guru (graph, GOG_DATA_ALLOCATOR (wbcg),
 		GO_CMD_CONTEXT (wbcg), closure);
 	if (!graph) {
-		GraphDataClosure *data = (GraphDataClosure *) g_new0 (GraphDataClosure, 1);
+		GnmGraphDataClosure *data = (GnmGraphDataClosure *) g_new0 (GnmGraphDataClosure, 1);
 		GtkWidget *custom = gtk_table_new (2, 3, FALSE), *w;
 		GObject *object;
 
diff --git a/src/sheet-object-impl.h b/src/sheet-object-impl.h
index 924d1c7..2d91bc2 100644
--- a/src/sheet-object-impl.h
+++ b/src/sheet-object-impl.h
@@ -155,7 +155,7 @@ void so_vc_coords_to_anchor (SheetObjectViewContainer *sovc,
 
 /***************************************************************************/
 
-struct _SheetObjectImageableIface {
+typedef struct {
 	GTypeInterface base;
 
 	GtkTargetList *(*get_target_list) (SheetObject const *so);
@@ -164,11 +164,11 @@ struct _SheetObjectImageableIface {
 					   double resolution,
 					   GsfOutput *output,
 					   GError **err);
-};
+} SheetObjectImageableIface;
 
 /***************************************************************************/
 
-struct _SheetObjectExportableIface {
+typedef struct {
 	GTypeInterface base;
 
 	GtkTargetList *(*get_target_list) (SheetObject const *so);
@@ -176,7 +176,7 @@ struct _SheetObjectExportableIface {
 					   char const *format,
 					   GsfOutput *output, GError **err,
 					   GnmConventions const *convs);
-};
+} SheetObjectExportableIface;
 
 G_END_DECLS
 
diff --git a/src/sheet-object-widget.c b/src/sheet-object-widget.c
index ed83b5b..edf57e6 100644
--- a/src/sheet-object-widget.c
+++ b/src/sheet-object-widget.c
@@ -1070,6 +1070,7 @@ SOW_MAKE_TYPE (button, Button,
 
 #define GNM_SOW_ADJUSTMENT_TYPE   (sheet_widget_adjustment_get_type())
 #define GNM_SOW_ADJUSTMENT(obj)	(G_TYPE_CHECK_INSTANCE_CAST ((obj), GNM_SOW_ADJUSTMENT_TYPE, SheetWidgetAdjustment))
+#define GNM_IS_SOW_ADJUSTMENT(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GNM_SOW_ADJUSTMENT_TYPE))
 #define DEP_TO_ADJUSTMENT(d_ptr)	(SheetWidgetAdjustment *)(((char *)d_ptr) - G_STRUCT_OFFSET(SheetWidgetAdjustment, dep))
 #define GNM_SOW_ADJUSTMENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNM_SOW_ADJUSTMENT_TYPE, SheetWidgetAdjustmentClass))
 #define SWA_CLASS(so)		     (GNM_SOW_ADJUSTMENT_CLASS (G_OBJECT_GET_CLASS(so)))
@@ -1107,15 +1108,23 @@ sheet_widget_adjustment_set_value (SheetWidgetAdjustment *swa, double new_val)
 	swa->being_updated = FALSE;
 }
 
+/**
+ * sheet_widget_adjustment_get_adjustment:
+ * @so: #SheetObject
+ *
+ * Returns: (transfer none): the associated #GtkAdjustment.
+ **/
 GtkAdjustment *
 sheet_widget_adjustment_get_adjustment (SheetObject *so)
 {
+	g_return_val_if_fail (GNM_IS_SOW_ADJUSTMENT (so), NULL);
 	return (GNM_SOW_ADJUSTMENT (so)->adjustment);
 }
 
 gboolean
 sheet_widget_adjustment_get_horizontal (SheetObject *so)
 {
+	g_return_val_if_fail (GNM_IS_SOW_ADJUSTMENT (so), TRUE);
 	return (GNM_SOW_ADJUSTMENT (so)->horizontal);
 }
 
@@ -3241,13 +3250,22 @@ sheet_widget_list_base_set_result_type (SheetObject *so, gboolean as_index)
 
 }
 
-/* Note: allocates a new adjustment.  */
+/**
+ * sheet_widget_list_base_get_adjustment:
+ * @so: #SheetObject
+ *
+ * Note: allocates a new adjustment.
+ * Returns: (transfer full): the newly created #GtkAdjustment.
+ **/
 GtkAdjustment *
 sheet_widget_list_base_get_adjustment (SheetObject *so)
 {
 	SheetWidgetListBase *swl = GNM_SOW_LIST_BASE (so);
+	GtkAdjustment *adj;
+
+	g_return_val_if_fail (swl, NULL);
 
-	GtkAdjustment *adj = (GtkAdjustment*)gtk_adjustment_new
+	adj = (GtkAdjustment*)gtk_adjustment_new
 		(swl->selection,
 		 1,
 		 1 + gtk_tree_model_iter_n_children (swl->model, NULL),
diff --git a/src/sheet-object.c b/src/sheet-object.c
index 859424b..914bf83 100644
--- a/src/sheet-object.c
+++ b/src/sheet-object.c
@@ -239,9 +239,9 @@ sheet_object_populate_menu_real (SheetObject *so, GPtrArray *actions)
 }
 
 /**
- * sheet_object_populate_menu :
- * @so : #SheetObject
- * @actions : #GPtrArray
+ * sheet_object_populate_menu:
+ * @so: #SheetObject
+ * @actions: #GPtrArray
  *
  * Get a list of the actions that can be performed on @so
  **/
@@ -254,8 +254,8 @@ sheet_object_populate_menu (SheetObject *so, GPtrArray *actions)
 }
 
 /**
- * sheet_objects_max_extent :
- * @sheet :
+ * sheet_objects_max_extent:
+ * @sheet:
  *
  * Utility routine to calculate the maximum extent of objects in this sheet.
  */
@@ -408,6 +408,13 @@ GSF_CLASS (SheetObject, sheet_object,
 	   sheet_object_class_init, sheet_object_init,
 	   G_TYPE_OBJECT)
 
+/**
+ * sheet_object_get_view:
+ * @so: #SheetObject
+ * @container: #SheetObjectViewContainer
+ *
+ * Returns: (transfer none): the found #SheetObjectView or %NULL.
+ **/
 SheetObjectView *
 sheet_object_get_view (SheetObject const *so, SheetObjectViewContainer *container)
 {
@@ -425,14 +432,14 @@ sheet_object_get_view (SheetObject const *so, SheetObjectViewContainer *containe
 }
 
 /**
- * sheet_object_update_bounds :
+ * sheet_object_update_bounds:
  *
- * @so  : The sheet object
- * @pos : An optional position marking the top left of the region
+ * @so: The sheet object
+ * @p: An optional position marking the top left of the region
  *        needing relocation (default == A1)
  *
  * update the bounds of an object that intersects the region whose top left
- * is @pos.  This is used when an objects position is anchored to cols/rows
+ * is @p.  This is used when an objects position is anchored to cols/rows
  * and they change position.
  **/
 void
@@ -469,9 +476,11 @@ sheet_object_update_bounds (SheetObject *so, GnmCellPos const *pos)
 }
 
 /**
- * sheet_object_get_sheet :
+ * sheet_object_get_sheet:
+ * @so: #SheetObject
  *
  * A small utility to help keep the implementation of SheetObjects modular.
+ * Returns: (transfer none): the #Sheet owning the object.
  **/
 Sheet *
 sheet_object_get_sheet (SheetObject const *so)
@@ -491,9 +500,9 @@ cb_create_views (SheetObject *so)
 }
 
 /**
- * sheet_object_set_sheet :
- * @so :
- * @sheet :
+ * sheet_object_set_sheet:
+ * @so:
+ * @sheet:
  *
  * Adds a reference to the object.
  *
@@ -532,8 +541,8 @@ sheet_object_set_sheet (SheetObject *so, Sheet *sheet)
 }
 
 /**
- * sheet_object_clear_sheet :
- * @so : #SheetObject
+ * sheet_object_clear_sheet:
+ * @so: #SheetObject
  *
  * Removes @so from its container, unrealizes all views, disconects the
  * associated data and unrefs the object
@@ -624,9 +633,14 @@ sheet_object_invalidate_sheet (SheetObject *so, Sheet const *sheet)
 				  (gpointer)sheet);
 }
 
-/*
+/**
+ * sheet_object_foreach_dep:
+ * @so: #SheetObject
+ * @func: (scope call): #SheetObjectForeachDepFunc
+ * @user: user data
+ *
  * Loops over each dependent contained in a sheet object and call the handler.
- */
+ **/
 void
 sheet_object_foreach_dep (SheetObject *so,
 			  SheetObjectForeachDepFunc func,
@@ -638,11 +652,12 @@ sheet_object_foreach_dep (SheetObject *so,
 
 /**
  * sheet_object_new_view:
- * @so :
- * @sc :
- * @key :
+ * @so:
+ * @sc:
+ * @key:
  *
  * Asks @so to create a view for the (@sc,@key) pair.
+ * Returns: (transfer none): the new #SheetObjectView.
  **/
 SheetObjectView *
 sheet_object_new_view (SheetObject *so, SheetObjectViewContainer *container)
@@ -673,7 +688,7 @@ sheet_object_new_view (SheetObject *so, SheetObjectViewContainer *container)
 }
 
 /**
- * sheet_object_draw_cairo :
+ * sheet_object_draw_cairo:
  *
  * Draw a sheet object using cairo.
  *
@@ -744,6 +759,12 @@ sheet_object_get_range (SheetObject const *so)
 	return &so->anchor.cell_bound;
 }
 
+/**
+ * sheet_object_get_anchor:
+ * @so: #SheetObject
+ *
+ * Returns: (transfer none): the #SheetObjectAnchor for @so.
+ **/
 SheetObjectAnchor const *
 sheet_object_get_anchor (SheetObject const *so)
 {
@@ -779,10 +800,10 @@ cell_offset_calc_pt (Sheet const *sheet, int i, gboolean is_col, double offset)
 }
 
 /**
- * sheet_object_default_size
- * @so : The sheet object
- * @w : a ptr into which to store the default_width.
- * @h : a ptr into which to store the default_height.
+ * sheet_object_default_size:
+ * @so: The sheet object
+ * @w: a ptr into which to store the default_width.
+ * @h: a ptr into which to store the default_height.
  *
  * Measurements are in pts.
  **/
@@ -797,10 +818,10 @@ sheet_object_default_size (SheetObject *so, double *w, double *h)
 }
 
 /**
- * sheet_object_position_pts_get :
+ * sheet_object_position_pts_get:
  *
- * @so : The sheet object
- * @coords : array of 4 doubles
+ * @so: The sheet object
+ * @coords: array of 4 doubles
  *
  * Calculate the position of the object @so in pts from the logical position in
  * the object.
@@ -879,12 +900,12 @@ clear_sheet (SheetObject *so, GOUndo **pundo)
 
 
 /**
- * sheet_objects_relocate :
+ * sheet_objects_relocate:
  *
- * @rinfo : details on what should be moved.
- * @update : Should we do the bound_update now, or leave it for later.
+ * @rinfo: details on what should be moved.
+ * @update: Should we do the bound_update now, or leave it for later.
  *		if FALSE honour the move_with_cells flag.
- * @undo : if non-NULL add dropped objects to ::objects
+ * @pundo: if non-NULL add dropped objects to ::objects
  *
  * Uses the relocation info and the anchors to decide whether or not, and how
  * to relocate objects when the grid moves (eg ins/del col/row).
@@ -957,13 +978,14 @@ sheet_objects_relocate (GnmExprRelocateInfo const *rinfo, gboolean update,
 }
 
 /**
- * sheet_objects_get :
+ * sheet_objects_get:
  *
- * @sheet : the sheet.
- * @r     : an optional range to look in
- * @t     : The type of object to lookup
+ * @sheet: the sheet.
+ * @r: an optional range to look in
+ * @t: The type of object to lookup
  *
- * Returns a list of which the caller must free (just the list not the content).
+ * Returns: (element-type SheetObject) (transfer container): a list of which
+ * the caller must free (just the list not the content).
  * Containing all objects of exactly the specified type (inheritence does not count)
  * that are completely contained by @r.
  **/
@@ -988,10 +1010,10 @@ sheet_objects_get (Sheet const *sheet, GnmRange const *r, GType t)
 }
 
 /**
- * sheet_objects_clear :
+ * sheet_objects_clear:
  *
- * @sheet : the sheet.
- * @r     : an optional range to look in
+ * @sheet: the sheet.
+ * @r: an optional range to look in
  *
  * removes the objects in the region.
  **/
@@ -1019,7 +1041,7 @@ sheet_objects_clear (Sheet const *sheet, GnmRange const *r, GType t,
  * sheet_object_dup:
  * @so: a #SheetObject to duplicate
  *
- * Returns : A copy of @so that is not attached to a sheet.
+ * Returns: (transfer full): A copy of @so that is not attached to a sheet.
  *    Caller is responsible for the reference.
  **/
 SheetObject *
@@ -1134,11 +1156,11 @@ sheet_object_rubber_band_directly (G_GNUC_UNUSED SheetObject const *so)
 }
 
 /**
- * sheet_object_anchor_init :
- * @anchor : #SheetObjectAnchor
- * @r : #GnmRange
- * @offsets : double[4]
- * @direction : #GODrawingAnchorDir
+ * sheet_object_anchor_init:
+ * @anchor: #SheetObjectAnchor
+ * @cell_bound: #GnmRange
+ * @offsets: double[4]
+ * @direction: #GODrawingAnchorDir
  *
  * A utility routine to initialize an anchor.  Useful in case we change fields
  * in the future and want to ensure that everything is initialized.
@@ -1170,8 +1192,8 @@ sheet_object_anchor_init (SheetObjectAnchor *anchor,
 /*****************************************************************************/
 
 /**
- * sheet_object_get_stacking :
- * @so : #SheetObject
+ * sheet_object_get_stacking:
+ * @so: #SheetObject
  *
  * Returns @so's position in the stack of sheet objects.
  **/
@@ -1295,6 +1317,15 @@ cb_ptr_array_free (GPtrArray *actions)
 	g_ptr_array_free (actions, TRUE);
 }
 
+/**
+ * sheet_object_build_menu:
+ * @view: #SheetObjectView
+ * @actions: (element-type SheetObjectAction): array of actions.
+ * @i: index of first action to add in the array.
+ *
+ * Builds the contextual menu for @view.
+ * Returns: (transfer full): the newly constructed #GtkMenu.
+ **/
 GtkWidget *
 sheet_object_build_menu (SheetObjectView *view,
 			 GPtrArray const *actions, unsigned *i)
@@ -1515,6 +1546,13 @@ sheet_object_write_object (SheetObject const *so, char const *format,
 	gnm_pop_C_locale (locale);
 }
 
+/**
+ * sheet_object_move_do:
+ * @objects: (element-type SheetObject):
+ * @objects_created:
+ *
+ * Returns: (transfer full): the newly allocated #GOUndo.
+ **/
 GOUndo *
 sheet_object_move_undo (GSList *objects, gboolean objects_created)
 {
@@ -1548,6 +1586,14 @@ sheet_object_move_undo (GSList *objects, gboolean objects_created)
 	return undo;
 }
 
+/**
+ * sheet_object_move_do:
+ * @objects: (element-type SheetObject):
+ * @anchors: (element-type SheetObjectAnchor):
+ * @objects_created:
+ *
+ * Returns: (transfer full): the newly allocated #GOUndo.
+ **/
 GOUndo *
 sheet_object_move_do (GSList *objects, GSList *anchors,
 		      gboolean objects_created)
diff --git a/src/sheet-object.h b/src/sheet-object.h
index fe6e160..10acbd9 100644
--- a/src/sheet-object.h
+++ b/src/sheet-object.h
@@ -9,26 +9,6 @@
 
 G_BEGIN_DECLS
 
-/***********************************************************
- * Move to goffice during 1.7 */
-
-typedef enum {
-	GOD_ANCHOR_DIR_UNKNOWN    = 0xFF,
-	GOD_ANCHOR_DIR_UP_LEFT    = 0x00,
-	GOD_ANCHOR_DIR_UP_RIGHT   = 0x01,
-	GOD_ANCHOR_DIR_DOWN_LEFT  = 0x10,
-	GOD_ANCHOR_DIR_DOWN_RIGHT = 0x11,
-
-	GOD_ANCHOR_DIR_NONE_MASK  = 0x00,
-	GOD_ANCHOR_DIR_H_MASK	  = 0x01,
-	GOD_ANCHOR_DIR_RIGHT	  = 0x01,
-	GOD_ANCHOR_DIR_V_MASK	  = 0x10,
-	GOD_ANCHOR_DIR_DOWN	  = 0x10
-} GODrawingAnchorDir;
-typedef struct _GODrawingAnchor {
-	int			pos_pts [4];	/* position in points */
-	GODrawingAnchorDir	direction;
-} GODrawingAnchor;
 /***********************************************************/
 
 typedef enum {
diff --git a/src/sheet-style.c b/src/sheet-style.c
index a97c820..5a2f848 100644
--- a/src/sheet-style.c
+++ b/src/sheet-style.c
@@ -183,11 +183,13 @@ sheet_style_unlink (Sheet *sheet, GnmStyle *st)
 /**
  * sheet_style_find :
  *
- * @sheet : the sheet
- * @s     : a style
+ * @sheet: (transfer full): the sheet
+ * @s: a style
  *
  * Looks up a style from the sheets collection.  Linking if necessary.
  * ABSORBS the reference and adds a link.
+ *
+ * Returns: (transfer full): the new style.
  */
 GnmStyle *
 sheet_style_find (Sheet const *sheet, GnmStyle *s)
@@ -656,7 +658,7 @@ sheet_style_init_size (Sheet *sheet, int cols, int rows)
 	 * 'none' by default.  Then displays that as white. */
 	if (sheet->sheet_type == GNM_SHEET_OBJECT) {
 		gnm_style_set_back_color (default_style,
-			style_color_new_rgb8 (0x50, 0x50, 0x50));
+			gnm_color_new_rgb8 (0x50, 0x50, 0x50));
 		gnm_style_set_pattern (default_style, 1);
 	}
 #endif
@@ -2385,13 +2387,15 @@ cb_hash_to_list (G_GNUC_UNUSED gpointer key, gpointer	value, gpointer	user_data)
 }
 
 /**
- * sheet_style_get_range :
+ * sheet_style_get_range:
  *
- * @sheet :
- * @range :
+ * @sheet:
+ * @range:
  *
  * Get a list of rectangles and their associated styles
  * Caller is responsible for freeing.
+ *
+ * Returns: (element-type GnmStyleRange) (transfer full):
  */
 GnmStyleList *
 sheet_style_get_range (Sheet const *sheet, GnmRange const *r)
@@ -2444,11 +2448,11 @@ style_conditions_equal (GnmStyle const *a, GnmStyle const *b)
 
 /**
  * sheet_style_collect_conditions:
- * @sheet :
- * @range :
+ * @sheet:
+ * @range:
  *
- * Returns a list of areas with conditionals, Caller is responsible for
- * freeing.
+ * Returns: (transfer full): a list of areas with conditionals, Caller is
+ * responsible for freeing.
  **/
 GnmStyleList *
 sheet_style_collect_conditions (Sheet const *sheet, GnmRange const *r)
@@ -2494,11 +2498,12 @@ style_hlink_equal (GnmStyle const *a, GnmStyle const *b)
 }
 
 /**
- * sheet_style_collect_hlinks :
- * @sheet :
- * @range :
+ * sheet_style_collect_hlinks:
+ * @sheet:
+ * @range:
  *
- * Returns a list of areas with hyperlinks, Caller is responsible for freeing.
+ * Returns: (transfer full): a list of areas with hyperlinks, Caller is
+ * responsible for freeing.
  **/
 GnmStyleList *
 sheet_style_collect_hlinks (Sheet const *sheet, GnmRange const *r)
@@ -2548,11 +2553,12 @@ style_validation_equal (GnmStyle const *a, GnmStyle const *b)
 }
 
 /**
- * sheet_style_collect_validations :
- * @sheet :
- * @range :
+ * sheet_style_collect_validations:
+ * @sheet:
+ * @range:
  *
- * Returns a list of areas with validation, Caller is responsible for freeing.
+ * Returns: (transfer full): a list of areas with validation, Caller is
+ * responsible for freeing.
  **/
 GnmStyleList *
 sheet_style_collect_validations (Sheet const *sheet, GnmRange const *r)
@@ -2582,11 +2588,12 @@ sheet_style_collect_validations (Sheet const *sheet, GnmRange const *r)
 }
 
 /**
- * sheet_style_set_list
- * @sheet     : #Sheet
- * @corner    : The top-left corner (in LTR mode)
- * @transpose : should the styles be transposed
- * @list      : #GnmStyleList
+ * sheet_style_set_list:
+ * @sheet: #Sheet
+ * @corner: The top-left corner (in LTR mode)
+ * @l: #GnmStyleList
+ * @range_modify: (scope call):
+ * @data:Âuser data
  *
  * Overwrites the styles of the ranges given by @corner with the content of
  * @list. Optionally transposing the ranges
@@ -2673,12 +2680,14 @@ cb_find_link (GnmStyle *style,
 }
 
 /**
- * sheet_style_region_contains_link :
- * @sheet :
- * @r :
+ * sheet_style_region_contains_link:
+ * @sheet:
+ * @r:
  *
  * Utility routine that checks to see if a region contains at least 1 hyper link
  * and returns the 1st one it finds.
+ *
+ * Returns: (transfer none): the found #GmHLink if any.
  **/
 GnmHLink *
 sheet_style_region_contains_link (Sheet const *sheet, GnmRange const *r)
@@ -2694,6 +2703,14 @@ sheet_style_region_contains_link (Sheet const *sheet, GnmRange const *r)
 	return res;
 }
 
+/**
+ * sheet_style_foreach:
+ * @sheet: #Sheet
+ * @func: (scope call): callback
+ * @user_data: user data.
+ *
+ * Executes @func for each style in the sheet.
+ **/
 void
 sheet_style_foreach (Sheet const *sheet, GHFunc func, gpointer user_data)
 {
@@ -2730,6 +2747,14 @@ cb_hash_to_cb (G_GNUC_UNUSED gpointer key, gpointer value, gpointer user_data)
 
 }
 
+/**
+ * sheet_style_range_foreach:
+ * @sheet: #Sheet
+ * @func: (scope call): callback.
+ * @user_data: user data
+ * @optimize:
+ *
+ **/
 void
 sheet_style_range_foreach (Sheet const *sheet, GHFunc func, gpointer user_data, gboolean optimize)
 {
diff --git a/src/sheet.c b/src/sheet.c
index 759f209..206018e 100644
--- a/src/sheet.c
+++ b/src/sheet.c
@@ -73,6 +73,27 @@
 #include <stdlib.h>
 #include <string.h>
 
+static GnmSheetSize *
+gnm_sheet_size_copy (GnmSheetSize *size)
+{
+	GnmSheetSize *res = g_new (GnmSheetSize, 1);
+	*res = *size;
+	return res;
+}
+
+GType
+gnm_sheet_size_get_type (void)
+{
+	static GType t = 0;
+
+	if (t == 0) {
+		t = g_boxed_type_register_static ("GnmSheetSize",
+			 (GBoxedCopyFunc)gnm_sheet_size_copy,
+			 (GBoxedFreeFunc)g_free);
+	}
+	return t;
+}
+
 enum {
 	DETACHED_FROM_WORKBOOK,
 	LAST_SIGNAL
@@ -1290,6 +1311,16 @@ gnm_sheet_resize_main (Sheet *sheet, int cols, int rows,
 	}
 }
 
+/**
+ * gnm_sheet_resize:
+ * @sheet: #Sheet
+ * @cols: the new columns number.
+ * @rows: the new rows number.
+ * @cc: #GOCmdContext.
+ * @perr: will be %TRUE on error.
+ *
+ * Returns: (transfer full): the newly allocated #GOUndo.
+ **/
 GOUndo *
 gnm_sheet_resize (Sheet *sheet, int cols, int rows,
 		  GOCmdContext *cc, gboolean *perr)
@@ -1331,15 +1362,16 @@ gnm_sheet_resize (Sheet *sheet, int cols, int rows,
 
 
 /**
- * sheet_new_with_type :
- * @wb      : #Workbook
- * @name    : An unquoted name
- * @type    : @GnmSheetType
- * @columns : The number of columns for the sheet
- * @rows    : The number of rows for the sheet
+ * sheet_new_with_type:
+ * @wb: #Workbook
+ * @name: An unquoted name
+ * @type: @GnmSheetType
+ * @columns: The number of columns for the sheet
+ * @rows: The number of rows for the sheet
  *
  * Create a new Sheet of type @type, and associate it with @wb.
  * The type cannot be changed later.
+ * Returns: (transfer full): the newly allocated sheet.
  **/
 Sheet *
 sheet_new_with_type (Workbook *wb, char const *name, GnmSheetType type,
@@ -1367,14 +1399,15 @@ sheet_new_with_type (Workbook *wb, char const *name, GnmSheetType type,
 }
 
 /**
- * sheet_new :
- * @wb    : #Workbook
- * @name  : The name for the sheet (unquoted).
- * @columns : The requested columns number.
- * @rows    : The requested rows number.
+ * sheet_new:
+ * @wb: #Workbook
+ * @name: The name for the sheet (unquoted).
+ * @columns: The requested columns number.
+ * @rows: The requested rows number.
  *
  * Create a new Sheet of type SHEET_DATA, and associate it with @wb.
  * The type can not be changed later
+ * Returns: (transfer full): the newly allocated sheet.
  **/
 Sheet *
 sheet_new (Workbook *wb, char const *name, int columns, int rows)
@@ -1565,10 +1598,10 @@ sheet_cell_calc_span (GnmCell *cell, GnmSpanCalcFlags flags)
 }
 
 /**
- * sheet_apply_style :
+ * sheet_apply_style:
  * @sheet: the sheet in which can be found
  * @range: the range to which should be applied
- * @style: the style
+ * @mstyle: the style
  *
  * A mid level routine that applies the supplied partial style @style to the
  * target @range and performs the necessary respanning and redrawing.
@@ -1595,6 +1628,13 @@ sheet_apply_style_cb (GnmSheetRange *sr,
 	sheet_flag_style_update_range (sr->sheet, &sr->range);
 }
 
+/**
+ * sheet_apply_style_undo:
+ * @sr: #GnmSheetRange
+ * @style: #GnmStyle
+ *
+ * Returns: (transfer full): the new #GOUndo.
+ **/
 GOUndo *
 sheet_apply_style_undo (GnmSheetRange *sr,
 			GnmStyle      *style)
@@ -1701,12 +1741,12 @@ sheet_reposition_objects (Sheet const *sheet, GnmCellPos const *pos)
 
 /**
  * sheet_flag_status_update_cell:
+ * @cell: The cell that has changed.
+ *
  *    flag the sheet as requiring an update to the status display
  *    if the supplied cell location is the edit cursor, or part of the
  *    selected region.
  *
- * @cell : The cell that has changed.
- *
  * Will cause the format toolbar, the edit area, and the auto expressions to be
  * updated if appropriate.
  **/
@@ -1719,13 +1759,13 @@ sheet_flag_status_update_cell (GnmCell const *cell)
 
 /**
  * sheet_flag_status_update_range:
+ * @sheet:
+ * @range: If NULL then force an update.
+ *
  *    flag the sheet as requiring an update to the status display
  *    if the supplied cell location contains the edit cursor, or intersects of
  *    the selected region.
  *
- * @sheet :
- * @range : If NULL then force an update.
- *
  * Will cause the format toolbar, the edit area, and the auto expressions to be
  * updated if appropriate.
  **/
@@ -1737,9 +1777,9 @@ sheet_flag_status_update_range (Sheet const *sheet, GnmRange const *range)
 }
 
 /**
- * sheet_flag_style_update_range :
- * @sheet : The sheet being changed
- * @range : the range that is changing.
+ * sheet_flag_style_update_range:
+ * @sheet: The sheet being changed
+ * @range: the range that is changing.
  *
  * Flag format changes that will require updating the format indicators.
  **/
@@ -1752,7 +1792,7 @@ sheet_flag_style_update_range (Sheet const *sheet, GnmRange const *range)
 
 /**
  * sheet_flag_recompute_spans:
- * @sheet :
+ * @sheet:
  *
  * Flag the sheet as requiring a full span recomputation the next time
  * sheet_update is called.
@@ -1789,7 +1829,8 @@ sheet_colrow_fit_gutter (Sheet const *sheet, gboolean is_cols)
 }
 
 /**
- * sheet_update_only_grid :
+ * sheet_update_only_grid:
+ * @sheet: #Sheet
  *
  * Should be called after a logical command has finished processing
  * to request redraws for any pending events
@@ -1899,7 +1940,7 @@ sheet_update_only_grid (Sheet const *sheet)
 
 /**
  * sheet_update:
- * @sheet : #Sheet
+ * @sheet: #Sheet
  *
  * Should be called after a logical command has finished processing to request
  * redraws for any pending events, and to update the various status regions
@@ -1963,9 +2004,9 @@ sheet_cell_fetch (Sheet *sheet, int col, int row)
 
 /**
  * sheet_colrow_can_group:
- * @sheet : #Sheet
- * @r : A #GnmRange
- * @is_cols : boolean
+ * @sheet: #Sheet
+ * @r: A #GnmRange
+ * @is_cols: boolean
  *
  * Returns TRUE if the cols/rows in @r.start -> @r.end can be grouped, return
  * FALSE otherwise. You can invert the result if you need to find out if a
@@ -2043,11 +2084,10 @@ sheet_colrow_group_ungroup (Sheet *sheet, GnmRange const *r,
 }
 
 /**
- * sheet_colrow_gutter :
- *
- * @sheet :
- * @is_cols :
- * @max_outline :
+ * sheet_colrow_gutter:
+ * @sheet:
+ * @is_cols:
+ * @max_outline:
  *
  * Set the maximum outline levels for cols or rows.
  */
@@ -2321,7 +2361,7 @@ cb_max_cell_width (GnmCellIter const *iter, struct cb_fit *data)
  * This routine computes the ideal size for the column to make the contents all
  * cells in the column visible.
  *
- * Return : Maximum size in pixels INCLUDING margins and grid lines
+ * Returns: Maximum size in pixels INCLUDING margins and grid lines
  *          or 0 if there are no cells.
  **/
 int
@@ -2405,7 +2445,7 @@ cb_max_cell_height (GnmCellIter const *iter, struct cb_fit *data)
  * This routine computes the ideal size for the row to make all data fit
  * properly.
  *
- * Return : Maximum size in pixels INCLUDING margins and grid lines
+ * Returns: Maximum size in pixels INCLUDING margins and grid lines
  *          or 0 if there are no cells.
  **/
 int
@@ -2544,7 +2584,9 @@ cb_clear_non_corner (GnmCellIter const *iter, GnmRange const *merged)
 }
 
 /**
- * sheet_range_set_expr_cb :
+ * sheet_range_set_expr_cb:
+ * @sr: #GnmSheetRange
+ * @texpr: #GnmExprTop
  *
  *
  * Does NOT check for array division.
@@ -2604,11 +2646,10 @@ sheet_range_set_expr_undo (GnmSheetRange *sr, GnmExprTop const  *texpr)
 
 
 /**
- * sheet_range_set_text :
- *
- * @pos : The position from which to parse an expression.
- * @r  :  The range to fill
- * @str : The text to be parsed and assigned.
+ * sheet_range_set_text:
+ * @pos: The position from which to parse an expression.
+ * @r:  The range to fill
+ * @str: The text to be parsed and assigned.
  *
  * Does NOT check for array division.
  * Does NOT redraw
@@ -2758,8 +2799,8 @@ sheet_cell_get_value (Sheet *sheet, int const col, int const row)
 
 /**
  * sheet_cell_set_text:
- * @cell A cell.
- * @text, the text to set.
+ * @cell: A cell.
+ * @str: the text to set.
  * @markup: (allow-none): an optional PangoAttrList.
  *
  * Marks the sheet as dirty
@@ -2848,9 +2889,13 @@ sheet_cell_set_expr (GnmCell *cell, GnmExprTop const *texpr)
 	sheet_flag_status_update_cell (cell);
 }
 
-/*
- * sheet_cell_set_value : Stores (WITHOUT COPYING) the supplied value.  It marks the
- *          sheet as dirty.
+/**
+ * sheet_cell_set_value:
+ * @cell: #GnmCell
+ * @v: #GnmValue
+ *
+ * Stores (WITHOUT COPYING) the supplied value.  It marks the
+ * sheet as dirty.
  *
  * The value is rendered, spans are calculated, and the rendered string
  * is stored as if that is what the user had entered.  It queues a redraw
@@ -3008,14 +3053,14 @@ sheet_row_is_hidden (Sheet const *sheet, int row)
 }
 
 
-/*
- * sheet_find_boundary_horizontal
+/**
+ * sheet_find_boundary_horizontal:
  * @sheet:  The Sheet
- * @start_col	: The column from which to begin searching.
- * @move_row	: The row in which to search for the edge of the range.
- * @base_row	: The height of the area being moved.
- * @n:      units to extend the selection vertically
- * @jump_to_boundaries : Jump to range boundaries.
+ * @col: The column from which to begin searching.
+ * @move_row: The row in which to search for the edge of the range.
+ * @base_row: The height of the area being moved.
+ * @count:      units to extend the selection vertically
+ * @jump_to_boundaries: Jump to range boundaries.
  *
  * Calculate the column index for the column which is @n units
  * from @start_col doing bounds checking.  If @jump_to_boundaries is
@@ -3026,7 +3071,8 @@ sheet_row_is_hidden (Sheet const *sheet, int row)
  * of cells with content.  If you are at the end of a range it will find the
  * start of the next.  Make sure that is the sort of behavior you want before
  * calling this.
- */
+ * Returns: the column inex.
+ **/
 int
 sheet_find_boundary_horizontal (Sheet *sheet, int start_col, int move_row,
 				int base_row, int count,
@@ -3108,14 +3154,14 @@ sheet_find_boundary_horizontal (Sheet *sheet, int start_col, int move_row,
 	return MIN (new_col, max_col);
 }
 
-/*
- * sheet_find_boundary_vertical
+/**
+ * sheet_find_boundary_vertical:
  * @sheet:  The Sheet *
- * @move_col	: The col in which to search for the edge of the range.
- * @start_row	: The row from which to begin searching.
- * @base_col	: The width of the area being moved.
- * @n:      units to extend the selection vertically
- * @jump_to_boundaries : Jump to range boundaries.
+ * @move_col: The col in which to search for the edge of the range.
+ * @row: The row from which to begin searching.
+ * @base_col: The width of the area being moved.
+ * @count:      units to extend the selection vertically
+ * @jump_to_boundaries: Jump to range boundaries.
  *
  * Calculate the row index for the row which is @n units
  * from @start_row doing bounds checking.  If @jump_to_boundaries is
@@ -3126,7 +3172,8 @@ sheet_find_boundary_horizontal (Sheet *sheet, int start_col, int move_row,
  * of cells with content.  If you are at the end of a range it will find the
  * start of the next.  Make sure that is the sort of behavior you want before
  * calling this.
- */
+ * Returns: the row index.
+ **/
 int
 sheet_find_boundary_vertical (Sheet *sheet, int move_col, int start_row,
 			      int base_col, int count,
@@ -3276,18 +3323,18 @@ cb_check_array_vertical (GnmColRowIter const *iter, ArrayCheckData *data)
 }
 
 /**
- * sheet_range_splits_array :
- * @sheet : The sheet.
- * @r     : The range to check
+ * sheet_range_splits_array:
+ * @sheet: The sheet.
+ * @r: The range to check
  * @ignore: an optionally NULL range in which it is ok to have an array.
- * @cc   : an optional place to report an error.
- * @cmd   : an optional cmd name used with @cc.
+ * @cc: an optional place to report an error.
+ * @cmd: an optional cmd name used with @cc.
  *
  * Check the outer edges of range @sheet! r to ensure that if an array is
  * within it then the entire array is within the range.  @ignore is useful when
  * src & dest ranges may overlap.
  *
- * returns TRUE if an array would be split.
+ * Returns: TRUE if an array would be split.
  **/
 gboolean
 sheet_range_splits_array (Sheet const *sheet,
@@ -3349,15 +3396,16 @@ sheet_range_splits_array (Sheet const *sheet,
 }
 
 /**
- * sheet_range_splits_region :
+ * sheet_range_splits_region:
  * @sheet: the sheet.
- * @r : The range whose boundaries are checked
- * @ignore : An optional range in which it is ok to have arrays and merges
- * @cc : The context that issued the command
- * @cmd : The translated command name.
+ * @r: The range whose boundaries are checked
+ * @ignore: An optional range in which it is ok to have arrays and merges
+ * @cc: The context that issued the command
+ * @cmd: The translated command name.
  *
  * A utility to see whether moving the range @r will split any arrays
  * or merged regions.
+ * Returns: whether any arrays or merged regions will be splitted.
  */
 gboolean
 sheet_range_splits_region (Sheet const *sheet,
@@ -3397,12 +3445,13 @@ sheet_range_splits_region (Sheet const *sheet,
 /**
  * sheet_ranges_split_region:
  * @sheet: the sheet.
- * @ranges : A list of ranges to check.
- * @cc : The context that issued the command
- * @cmd : The translated command name.
+ * @ranges: (element-type GnmRange): A list of ranges to check.
+ * @cc: The context that issued the command
+ * @cmd: The translated command name.
  *
- * A utility to see whether moving the any of the ranges @ranges will split any
+ * A utility to see whether moving any of the ranges @ranges will split any
  * arrays or merged regions.
+ * Returns: whether any arrays or merged regions will be splitted.
  */
 gboolean
 sheet_ranges_split_region (Sheet const * sheet, GSList const *ranges,
@@ -3426,15 +3475,16 @@ cb_cell_is_array (GnmCellIter const *iter, G_GNUC_UNUSED gpointer user)
 }
 
 /**
- * sheet_range_contains_region :
- *
- * @sheet : The sheet
- * @r     : the range to check.
- * @cc   : an optional place to report errors.
- * @cmd   :
+ * sheet_range_contains_region:
+ * @sheet: The sheet
+ * @r: the range to check.
+ * @cc: an optional place to report errors.
+ * @cmd:
  *
  * Check to see if the target region @sheet! r contains any merged regions or
  * arrays.  Report an error to the @cc if it is supplied.
+ * Returns: %TRUE if the target region @sheet! r contains any merged regions or
+ * arrays.
  **/
 gboolean
 sheet_range_contains_region (Sheet const *sheet, GnmRange const *r,
@@ -3468,9 +3518,11 @@ sheet_range_contains_region (Sheet const *sheet, GnmRange const *r,
 /***************************************************************************/
 
 /**
- * sheet_colrow_get_default :
- * @sheet :
- * @is_cols :
+ * sheet_colrow_get_default:
+ * @sheet:
+ * @is_cols:
+ *
+ * Returns: (transfer none): the default #ColRowInfo.
  */
 ColRowInfo const *
 sheet_colrow_get_default (Sheet const *sheet, gboolean is_cols)
@@ -3539,7 +3591,8 @@ sheet_colrow_optimize (Sheet *sheet)
 /**
  * sheet_col_get:
  *
- * Returns an allocated column:  either an existing one, or NULL
+ * Returns: (transfer none): an allocated column:  either an existing one,
+ * or NULL
  */
 ColRowInfo *
 sheet_col_get (Sheet const *sheet, int pos)
@@ -3667,12 +3720,20 @@ cell_ordering (gconstpointer a_, gconstpointer b_)
 
 /**
  * sheet_foreach_cell_in_range:
+ * @sheet: #Sheet
+ * @flags:
+ * @start_col:
+ * @start_row:
+ * @end_col:
+ * @end_row:
+ * @callback: (scope call): #CellFiletrFunc
+ * @closure: user data.
  *
  * For each existing cell in the range specified, invoke the
  * callback routine.  If the only_existing flag is passed, then
  * callbacks are only invoked for existing cells.
  *
- * Returns the value returned by the callback, which can be :
+ * Returns: (transfer none): the value returned by the callback, which can be :
  *    non-NULL on error, or VALUE_TERMINATE if some invoked routine requested
  *    to stop (by returning non-NULL).
  *
@@ -3852,10 +3913,10 @@ sheet_foreach_cell_in_range (Sheet *sheet, CellIterFlags flags,
 }
 
 /**
- * sheet_cell_foreach :
- * @sheet : #Sheet
- * @callback :
- * @data :
+ * sheet_cell_foreach:
+ * @sheet: #Sheet
+ * @callback: (scope call):
+ * @data:
  *
  * Call @callback with an argument of @data for each cell in the sheet
  **/
@@ -3868,8 +3929,8 @@ sheet_cell_foreach (Sheet const *sheet, GHFunc callback, gpointer data)
 }
 
 /**
- * sheet_cells_count :
- * @sheet : #Sheet
+ * sheet_cells_coun :
+ * @sheet: #Sheet
  *
  * Returns the number of cells with content in the current workbook.
  **/
@@ -3891,11 +3952,12 @@ cb_sheet_cells_collect (G_GNUC_UNUSED gpointer unused,
 /**
  * sheet_cells:
  *
- * @sheet     : The sheet to find cells in.
- * @comments  : If true, include cells with only comments also.
+ * @sheet: The sheet to find cells in.
+ * @comments: If true, include cells with only comments also.
  *
  * Collects a GPtrArray of GnmEvalPos pointers for all cells in a sheet.
  * No particular order should be assumed.
+ * Returns: (element-type GnmEvalPos) (transfer full): the newly created array
  **/
 GPtrArray *
 sheet_cells (Sheet *sheet, gboolean comments)
@@ -3941,10 +4003,7 @@ cb_fail_if_exist (GnmCellIter const *iter, G_GNUC_UNUSED gpointer user)
 /**
  * sheet_is_region_empty:
  * @sheet: sheet to check
- * @start_col: starting column
- * @start_row: starting row
- * @end_col:   end column
- * @end_row:   end row
+ * @r: region to check
  *
  * Returns TRUE if the specified region of the @sheet does not
  * contain any cells
@@ -4078,10 +4137,10 @@ gnm_sheet_cell_shutdown (void)
 /****************************************************************************/
 
 /**
- * sheet_cell_create :
- * @sheet : #Sheet
- * @col   :
- * @row   :
+ * sheet_cell_create:
+ * @sheet: #Sheet
+ * @col:
+ * @row:
  *
  * Creates a new cell and adds it to the sheet hash.
  **/
@@ -4107,7 +4166,9 @@ sheet_cell_create (Sheet *sheet, int col, int row)
 }
 
 /**
- * sheet_cell_remove_from_hash :
+ * sheet_cell_remove_from_hash:
+ * @sheet:
+ * @cell:
  *
  * Removes a cell from the sheet hash, clears any spans, and unlinks it from
  * the dependent collection.
@@ -4123,9 +4184,14 @@ sheet_cell_remove_from_hash (Sheet *sheet, GnmCell *cell)
 }
 
 /**
- * sheet_cell_destroy : Remove the cell from the web of dependencies of a
+ * sheet_cell_destroy:
+ * @sheet:
+ * @cell:
+ * @queue_recalc:
+ *
+ * Remove the cell from the web of dependencies of a
  *        sheet.  Do NOT redraw.
- */
+ **/
 static void
 sheet_cell_destroy (Sheet *sheet, GnmCell *cell, gboolean queue_recalc)
 {
@@ -4145,10 +4211,16 @@ sheet_cell_destroy (Sheet *sheet, GnmCell *cell, gboolean queue_recalc)
 }
 
 /**
- * sheet_cell_remove : Remove the cell from the web of dependencies of a
+ * sheet_cell_remove:
+ * @sheet:
+ * @cell:
+ * @redraw:
+ * @queue_recalc:
+ *
+ * Remove the cell from the web of dependencies of a
  *        sheet.  Do NOT free the cell, optionally redraw it, optionally
  *        queue it for recalc.
- */
+ **/
 void
 sheet_cell_remove (Sheet *sheet, GnmCell *cell,
 		   gboolean redraw, gboolean queue_recalc)
@@ -4176,6 +4248,9 @@ cb_free_cell (GnmCellIter const *iter, G_GNUC_UNUSED gpointer user)
 
 /**
  * sheet_col_destroy:
+ * @sheet:
+ * @col:
+ * @free_cells:
  *
  * Destroys a ColRowInfo from the Sheet with all of its cells
  */
@@ -4444,11 +4519,16 @@ cb_empty_cell (GnmCellIter const *iter, gpointer user)
 
 /**
  * sheet_clear_region:
+ * @sheet:
+ * @start_col:
+ * @start_row:
+ * @end_col:
+ * @end_row:
+ * @clear_flags: If this is TRUE then styles are erased.
+ * @cc:
  *
  * Clears are region of cells
  *
- * @clear_flags : If this is TRUE then styles are erased.
- *
  * We assemble a list of cells to destroy, since we will be making changes
  * to the structure being manipulated by the sheet_foreach_cell_in_range routine
  */
@@ -4531,6 +4611,14 @@ sheet_clear_region_cb (GnmSheetRange *sr, int *flags)
 			  *flags | CLEAR_NOCHECKARRAY, NULL);
 }
 
+
+/**
+ * sheet_clear_region_undo:
+ * @sr: #GnmSheetRange
+ * @clear_flags: flags.
+ *
+ * Returns: (transfer full): the new #GOUndo.
+ **/
 GOUndo *sheet_clear_region_undo (GnmSheetRange *sr, int clear_flags)
 {
 	int *flags = g_new(int, 1);
@@ -4812,11 +4900,11 @@ schedule_reapply_filters (Sheet *sheet, GOUndo **pundo)
 
 /**
  * sheet_insert_cols:
- * @sheet  : #Sheet
- * @col    : At which position we want to insert
- * @count  : The number of columns to be inserted
- * @pundo  : undo closure, optionally NULL; caller releases result
- * @cc     :
+ * @sheet: #Sheet
+ * @col: At which position we want to insert
+ * @count: The number of columns to be inserted
+ * @pundo: undo closure, optionally NULL; caller releases result
+ * @cc:
  **/
 gboolean
 sheet_insert_cols (Sheet *sheet, int col, int count,
@@ -4887,11 +4975,11 @@ sheet_insert_cols (Sheet *sheet, int col, int count,
 
 /*
  * sheet_delete_cols
- * @sheet   The sheet
- * @col     At which position we want to start deleting columns
- * @count   The number of columns to be deleted
- * @pundo  : undo closure, optionally NULL; caller releases result
- * @cc : The command context
+ * @sheet: The sheet
+ * @col:     At which position we want to start deleting columns
+ * @count:   The number of columns to be deleted
+ * @pundo: undo closure, optionally NULL; caller releases result
+ * @cc: The command context
  */
 gboolean
 sheet_delete_cols (Sheet *sheet, int col, int count,
@@ -4984,11 +5072,11 @@ sheet_delete_cols (Sheet *sheet, int col, int count,
 
 /**
  * sheet_insert_rows:
- * @sheet  : The sheet
- * @row    : At which position we want to insert
- * @count  : The number of rows to be inserted
- * @pundo  : undo closure, optionally NULL; caller releases result
- * @cc : The command context
+ * @sheet: The sheet
+ * @row: At which position we want to insert
+ * @count: The number of rows to be inserted
+ * @pundo: undo closure, optionally NULL; caller releases result
+ * @cc: The command context
  */
 gboolean
 sheet_insert_rows (Sheet *sheet, int row, int count,
@@ -5059,11 +5147,11 @@ sheet_insert_rows (Sheet *sheet, int row, int count,
 
 /*
  * sheet_delete_rows
- * @sheet  : The sheet
- * @row    : At which position we want to start deleting rows
- * @count  : The number of rows to be deleted
- * @pundo  : undo closure, optionally NULL; caller releases result
- * @cc : The command context
+ * @sheet: The sheet
+ * @row: At which position we want to start deleting rows
+ * @count: The number of rows to be deleted
+ * @pundo: undo closure, optionally NULL; caller releases result
+ * @cc: The command context
  */
 gboolean
 sheet_delete_rows (Sheet *sheet, int row, int count,
@@ -5155,10 +5243,10 @@ sheet_delete_rows (Sheet *sheet, int row, int count,
 }
 
 /**
- * sheet_move_range :
- * @cc :
- * @rinfo :
- * @pundo : optionally NULL, caller releases result
+ * sheet_move_range:
+ * @cc:
+ * @rinfo:
+ * @pundo: optionally NULL, caller releases result
  *
  * Move a range as specified in @rinfo report warnings to @cc.
  * if @pundo is non NULL, invalidate references to the
@@ -5859,10 +5947,11 @@ sheet_dup_filters (Sheet const *src, Sheet *dst)
 }
 
 /**
- * sheet_dup :
- * @src : #Sheet
+ * sheet_dup:
+ * @source_sheet: #Sheet
  *
  * Create a new Sheet and return it.
+ * Returns: (transfer full): the newly allocated #Sheet.
  **/
 Sheet *
 sheet_dup (Sheet const *src)
@@ -5932,9 +6021,9 @@ sheet_dup (Sheet const *src)
 }
 
 /**
- * sheet_set_outline_direction :
- * @sheet   : the sheet
- * @is_cols : use cols or rows
+ * sheet_set_outline_direction:
+ * @sheet: the sheet
+ * @is_cols: use cols or rows
  *
  * When changing the placement of outline collapse markers the flags
  * need to be recomputed.
@@ -5951,11 +6040,12 @@ sheet_set_outline_direction (Sheet *sheet, gboolean is_cols)
 }
 
 /**
- * sheet_get_view :
- * @sheet :
- * @wbv   :
+ * sheet_get_view:
+ * @sheet:
+ * @wbv:
  *
  * Find the SheetView corresponding to the supplied @wbv.
+ * Returns: (transfer none): the view.
  */
 SheetView *
 sheet_get_view (Sheet const *sheet, WorkbookView const *wbv)
@@ -5981,9 +6071,9 @@ cb_queue_respan (GnmColRowIter const *iter, void *user_data)
 
 /**
  * sheet_queue_respan *
- * @sheet :
- * @start_row :
- * @end_row :
+ * @sheet:
+ * @start_row:
+ * @end_row:
  *
  * queues a span generation for the selected rows.
  * the caller is responsible for queuing a redraw
@@ -6004,13 +6094,14 @@ sheet_cell_queue_respan (GnmCell *cell)
 
 
 /**
- * sheet_get_comment :
- * @sheet : #Sheet const *
- * @pos   : #GnmCellPos const *
+ * sheet_get_comment:
+ * @sheet: #Sheet const *
+ * @pos: #GnmCellPos const *
  *
  * If there is a cell comment at @pos in @sheet return it.
  *
  * Caller does get a reference to the object if it exists.
+ * Returns: (transfer full): the comment or %NULL.
  **/
 GnmComment *
 sheet_get_comment (Sheet const *sheet, GnmCellPos const *pos)
@@ -6094,7 +6185,7 @@ sheet_range_trim (Sheet const *sheet, GnmRange *r,
  * header row from the top and if false it looks for a header col from the
  * left
  *
- * Returns : TRUE if @src seems to have a heading
+ * Returns: TRUE if @src seems to have a heading
  **/
 gboolean
 sheet_range_has_heading (Sheet const *sheet, GnmRange const *src,
@@ -6148,6 +6239,14 @@ sheet_range_has_heading (Sheet const *sheet, GnmRange const *src,
 	return FALSE;
 }
 
+/**
+ * gnm_sheet_foreach_name:
+ * @sheet: #Sheet
+ * @func: (scope call): #GHFunc
+ * @data: user data.
+ *
+ * Executes @func for each name in @sheet.
+ **/
 void
 gnm_sheet_foreach_name (Sheet const *sheet, GHFunc func, gpointer data)
 {
@@ -6157,6 +6256,12 @@ gnm_sheet_foreach_name (Sheet const *sheet, GHFunc func, gpointer data)
 		gnm_named_expr_collection_foreach (sheet->names, func, data);
 }
 
+/**
+ * gnm_sheet_get_size:
+ * @sheet: #Sheet
+ *
+ * Returns: (transfer none): the sheet size.
+ **/
 GnmSheetSize const *
 gnm_sheet_get_size (Sheet const *sheet)
 {
@@ -6176,6 +6281,14 @@ gnm_sheet_get_size (Sheet const *sheet)
 	return &sheet->size;
 }
 
+/**
+ * gnm_sheet_get_size2:
+ * @sheet: #Sheet, might be %NULL
+ * @wb: #Workbook, must be non %NULL if @sheet is %NULL
+ *
+ * Returns: (transfer none): the sheet size if @sheet is non %NULL, or the
+ * default sheet size for @wb.
+ **/
 GnmSheetSize const *
 gnm_sheet_get_size2 (Sheet const *sheet, Workbook const *wb)
 {
@@ -6197,6 +6310,13 @@ gnm_sheet_set_solver_params (Sheet *sheet, GnmSolverParameters *param)
 
 /* ------------------------------------------------------------------------- */
 
+/**
+ * gnm_sheet_scenario_new:
+ * @sheet: Â#Sheet
+ * @name: the new scenario name.
+ *
+ * Returns: (transfer full): the newly created #GnmScenario.
+ **/
 GnmScenario *
 gnm_sheet_scenario_new (Sheet *sheet, const char *name)
 {
@@ -6246,6 +6366,13 @@ gnm_sheet_scenario_new (Sheet *sheet, const char *name)
 	return sc;
 }
 
+/**
+ * gnm_sheet_scenario_find:
+ * @sheet: Â#Sheet
+ * @name: the scenario name.
+ *
+ * Returns: (transfer none): the newly created #GnmScenario.
+ **/
 GnmScenario *
 gnm_sheet_scenario_find (Sheet *sheet, const char *name)
 {
@@ -6263,6 +6390,12 @@ gnm_sheet_scenario_find (Sheet *sheet, const char *name)
 	return NULL;
 }
 
+/**
+ * gnm_sheet_scenario_add:
+ * @sheet: Â#Sheet
+ * @sc: (transfer full): #GnmScenario
+ *
+ **/
 void
 gnm_sheet_scenario_add (Sheet *sheet, GnmScenario *sc)
 {
@@ -6285,6 +6418,12 @@ gnm_sheet_scenario_remove (Sheet *sheet, GnmScenario *sc)
 
 /* ------------------------------------------------------------------------- */
 
+/**
+ * gnm_sheet_get_sort_setups:
+ * @sheet: #Sheet
+ *
+ * Returns: (transfer none): the sort setups for @sheet.
+ **/
 GHashTable *
 gnm_sheet_get_sort_setups (Sheet *sheet)
 {
@@ -6307,6 +6446,13 @@ gnm_sheet_add_sort_setup (Sheet *sheet, char *key, gpointer setup)
 	g_hash_table_insert (hash, key, setup);
 }
 
+/**
+ * gnm_sheet_find_sort_setup:
+ * @sheet: #Sheet
+ * @key:
+ *
+ * Returns: (transfer none): the found sort setup or %NULL.
+ **/
 gconstpointer
 gnm_sheet_find_sort_setup (Sheet *sheet, char const *key)
 {
diff --git a/src/sheet.h b/src/sheet.h
index c06198c..af0b8d2 100644
--- a/src/sheet.h
+++ b/src/sheet.h
@@ -16,6 +16,7 @@ GNM_VAR_DECL Sheet *invalid_sheet;
 struct _GnmSheetSize {
 	int max_cols, max_rows;
 };
+GType gnm_sheet_size_get_type (void);
 
 typedef struct _SheetPrivate SheetPrivate;
 GType gnm_sheet_type_get_type (void);
@@ -297,13 +298,13 @@ void     sheet_redraw_region    (Sheet const *sheet,
 				 int start_col, int start_row,
 				 int end_col,   int end_row);
 
-void	 sheet_flag_status_update_cell	(GnmCell const *c);
-void	 sheet_flag_status_update_range	(Sheet const *s, GnmRange const *r);
-void     sheet_flag_style_update_range	(Sheet const *s, GnmRange const *r);
-void	 sheet_flag_recompute_spans	(Sheet const *s);
-void	 sheet_update_only_grid		(Sheet const *s);
-void     sheet_update                   (Sheet const *s);
-void	 sheet_scrollbar_config		(Sheet const *s);
+void	 sheet_flag_status_update_cell	(GnmCell const *cell);
+void	 sheet_flag_status_update_range	(Sheet const *sheet, GnmRange const *range);
+void     sheet_flag_style_update_range	(Sheet const *sheet, GnmRange const *range);
+void	 sheet_flag_recompute_spans	(Sheet const *sheet);
+void	 sheet_update_only_grid		(Sheet const *sheet);
+void     sheet_update                   (Sheet const *sheet);
+void	 sheet_scrollbar_config		(Sheet const *sheet);
 
 void     sheet_mark_dirty	(Sheet *sheet);
 GnmRange    sheet_get_extent	(Sheet const *sheet,
diff --git a/src/stf-export.c b/src/stf-export.c
index 892278f..0616d00 100644
--- a/src/stf-export.c
+++ b/src/stf-export.c
@@ -127,6 +127,13 @@ gnm_stf_export_options_sheet_list_add (GnmStfExport *stfe, Sheet *sheet)
 }
 
 
+/**
+ * gnm_stf_export_options_sheet_list_get:
+ * @stfe: #GnmStfExport
+ *
+ * Returns: (element-type Sheet) (transfer none): the list of #Sheet instances
+ * added to @stfe using gnm_stf_export_options_sheet_list_add().
+ **/
 GSList *
 gnm_stf_export_options_sheet_list_get (const GnmStfExport *stfe)
 {
diff --git a/src/style-border.c b/src/style-border.c
index 77fedb5..89b03ed 100644
--- a/src/style-border.c
+++ b/src/style-border.c
@@ -113,7 +113,7 @@ style_border_equal (gconstpointer v1, gconstpointer v2)
 
 	/*
 	 * ->color is a pointer, but the comparison is safe because
-	 * all colours are cached, see style_color_new_go.
+	 * all colours are cached, see gnm_color_new_go.
 	 */
 	return	(k1->color == k2->color) &&
 		(k1->line_type == k2->line_type);
@@ -128,7 +128,7 @@ style_border_hash (gconstpointer v)
 	 * HACK ALERT!
 	 *
 	 * ->color is a pointer, but the comparison is safe because
-	 * all colours are cached, see style_color_new_go.
+	 * all colours are cached, see gnm_color_new_go.
 	 *
 	 */
 	return (GPOINTER_TO_UINT(b->color) ^ b->line_type);
diff --git a/src/style-color.c b/src/style-color.c
index 6f9ff23..9a7fdf0 100644
--- a/src/style-color.c
+++ b/src/style-color.c
@@ -26,15 +26,15 @@ static GnmColor *sc_white;
 static GnmColor *sc_grid;
 
 GnmColor *
-style_color_new_name (char const *name)
+gnm_color_new_name (char const *name)
 {
 	GdkRGBA c;
 	gdk_rgba_parse (&c, name);
-	return style_color_new_gdk (&c);
+	return gnm_color_new_gdk (&c);
 }
 
 static GnmColor *
-style_color_new_uninterned (GOColor c, gboolean is_auto)
+gnm_color_new_uninterned (GOColor c, gboolean is_auto)
 {
 	GnmColor *sc = g_new (GnmColor, 1);
 
@@ -46,19 +46,19 @@ style_color_new_uninterned (GOColor c, gboolean is_auto)
 }
 
 GnmColor *
-style_color_new_rgba16 (guint16 red, guint16 green, guint16 blue, guint16 alpha)
+gnm_color_new_rgba16 (guint16 red, guint16 green, guint16 blue, guint16 alpha)
 {
-	return style_color_new_rgba8 (red >> 8, green >> 8, blue >> 8, alpha >> 8);
+	return gnm_color_new_rgba8 (red >> 8, green >> 8, blue >> 8, alpha >> 8);
 }
 
 GnmColor *
-style_color_new_pango (PangoColor const *c)
+gnm_color_new_pango (PangoColor const *c)
 {
-	return style_color_new_rgba16 (c->red, c->green, c->blue, 0xffff);
+	return gnm_color_new_rgba16 (c->red, c->green, c->blue, 0xffff);
 }
 
 GnmColor *
-style_color_new_gdk (GdkRGBA const *c)
+gnm_color_new_gdk (GdkRGBA const *c)
 {
 	/*
 	 * The important property here is that a color #rrggbb
@@ -72,23 +72,23 @@ style_color_new_gdk (GdkRGBA const *c)
 	guint8 b8 = CLAMP (c->blue * 256, 0, 255);
 	guint8 a8 = CLAMP (c->alpha * 256, 0, 255);
 
-	return style_color_new_rgba8 (r8, g8, b8, a8);
+	return gnm_color_new_rgba8 (r8, g8, b8, a8);
 }
 
 GnmColor *
-style_color_new_rgba8 (guint8 red, guint8 green, guint8 blue, guint8 alpha)
+gnm_color_new_rgba8 (guint8 red, guint8 green, guint8 blue, guint8 alpha)
 {
-	return style_color_new_go (GO_COLOR_FROM_RGBA (red, green, blue, alpha));
+	return gnm_color_new_go (GO_COLOR_FROM_RGBA (red, green, blue, alpha));
 }
 
 GnmColor *
-style_color_new_rgb8 (guint8 red, guint8 green, guint8 blue)
+gnm_color_new_rgb8 (guint8 red, guint8 green, guint8 blue)
 {
-	return style_color_new_rgba8 (red, green, blue, 0xff);
+	return gnm_color_new_rgba8 (red, green, blue, 0xff);
 }
 
 GnmColor *
-style_color_new_go (GOColor c)
+gnm_color_new_go (GOColor c)
 {
 	GnmColor *sc;
 	GnmColor key;
@@ -98,7 +98,7 @@ style_color_new_go (GOColor c)
 
 	sc = g_hash_table_lookup (style_color_hash, &key);
 	if (!sc) {
-		sc = style_color_new_uninterned (c, FALSE);
+		sc = gnm_color_new_uninterned (c, FALSE);
 		g_hash_table_insert (style_color_hash, sc, sc);
 	} else
 		sc->ref_count++;
@@ -110,7 +110,7 @@ GnmColor *
 style_color_black (void)
 {
 	if (!sc_black)
-		sc_black = style_color_new_rgb8 (0, 0, 0);
+		sc_black = gnm_color_new_rgb8 (0, 0, 0);
 	return style_color_ref (sc_black);
 }
 
@@ -118,7 +118,7 @@ GnmColor *
 style_color_white (void)
 {
 	if (!sc_white)
-		sc_white = style_color_new_rgb8 (0xff, 0xff, 0xff);
+		sc_white = gnm_color_new_rgb8 (0xff, 0xff, 0xff);
 	return style_color_ref (sc_white);
 }
 
@@ -126,7 +126,7 @@ GnmColor *
 style_color_grid (void)
 {
 	if (!sc_grid)
-		sc_grid = style_color_new_rgb8 (0xc7, 0xc7, 0xc7);
+		sc_grid = gnm_color_new_rgb8 (0xc7, 0xc7, 0xc7);
 	return style_color_ref (sc_grid);
 }
 
@@ -143,7 +143,7 @@ style_color_auto_font (void)
 	static GnmColor *color = NULL;
 
 	if (!color)
-		color = style_color_new_uninterned (GO_COLOR_BLACK, TRUE);
+		color = gnm_color_new_uninterned (GO_COLOR_BLACK, TRUE);
 	return style_color_ref (color);
 }
 
@@ -156,7 +156,7 @@ style_color_auto_back (void)
 	static GnmColor *color = NULL;
 
 	if (!color)
-		color = style_color_new_uninterned (GO_COLOR_WHITE, TRUE);
+		color = gnm_color_new_uninterned (GO_COLOR_WHITE, TRUE);
 	return style_color_ref (color);
 }
 
@@ -169,7 +169,7 @@ style_color_auto_pattern (void)
 	static GnmColor *color = NULL;
 
 	if (!color)
-		color = style_color_new_uninterned (GO_COLOR_BLACK, TRUE);
+		color = gnm_color_new_uninterned (GO_COLOR_BLACK, TRUE);
 	return style_color_ref (color);
 }
 
@@ -198,6 +198,18 @@ style_color_unref (GnmColor *sc)
 	g_free (sc);
 }
 
+GType
+gnm_color_get_type (void)
+{
+	static GType t = 0;
+
+	if (t == 0)
+		t = g_boxed_type_register_static ("GnmColor",
+			 (GBoxedCopyFunc)style_color_ref,
+			 (GBoxedFreeFunc)style_color_unref);
+	return t;
+}
+
 gint
 style_color_equal (GnmColor const *k1, GnmColor const *k2)
 {
diff --git a/src/style-color.h b/src/style-color.h
index e5f4970..5d66fe1 100644
--- a/src/style-color.h
+++ b/src/style-color.h
@@ -26,13 +26,14 @@ GNM_VAR_DECL GdkRGBA gs_black;
 GNM_VAR_DECL GdkRGBA gs_lavender;
 GNM_VAR_DECL GdkRGBA gs_yellow;
 
-GnmColor *style_color_new_go    (GOColor c);
-GnmColor *style_color_new_name  (char const *name);
-GnmColor *style_color_new_rgba16(guint16 red, guint16 green, guint16 blue, guint16 alpha);
-GnmColor *style_color_new_rgb8  (guint8 red, guint8 green, guint8 blue);
-GnmColor *style_color_new_rgba8 (guint8 red, guint8 green, guint8 blue, guint8 alpha);
-GnmColor *style_color_new_pango (PangoColor const *c);
-GnmColor *style_color_new_gdk   (GdkRGBA const *c);
+GType     gnm_color_get_type    (void); 
+GnmColor *gnm_color_new_go    (GOColor c);
+GnmColor *gnm_color_new_name  (char const *name);
+GnmColor *gnm_color_new_rgba16(guint16 red, guint16 green, guint16 blue, guint16 alpha);
+GnmColor *gnm_color_new_rgb8  (guint8 red, guint8 green, guint8 blue);
+GnmColor *gnm_color_new_rgba8 (guint8 red, guint8 green, guint8 blue, guint8 alpha);
+GnmColor *gnm_color_new_pango (PangoColor const *c);
+GnmColor *gnm_color_new_gdk   (GdkRGBA const *c);
 GnmColor *style_color_auto_font (void);
 GnmColor *style_color_auto_back (void);
 GnmColor *style_color_auto_pattern (void);
diff --git a/src/style.h b/src/style.h
index 2a2dd3f..0bbc571 100644
--- a/src/style.h
+++ b/src/style.h
@@ -41,12 +41,6 @@ typedef enum {
 } GnmUnderline;
 
 typedef enum {
-	GO_FONT_SCRIPT_SUB	= -1,
-	GO_FONT_SCRIPT_STANDARD =  0,
-	GO_FONT_SCRIPT_SUPER	=  1
-} GOFontScript;
-
-typedef enum {
 	GNM_TEXT_DIR_RTL	= -1,
 	GNM_TEXT_DIR_CONTEXT	=  0,
 	GNM_TEXT_DIR_LTR	=  1
diff --git a/src/tools/gnm-solver.c b/src/tools/gnm-solver.c
index b2afc96..1f39f84 100644
--- a/src/tools/gnm-solver.c
+++ b/src/tools/gnm-solver.c
@@ -1402,7 +1402,7 @@ gnm_solver_get_limits (GnmSolver *solver, gnm_float **pmin, gnm_float **pmax)
   do {								\
 	  int c = (col_);					\
 	  dao_set_colors (dao, c, R, c, R,			\
-			  style_color_new_rgb8 (255, 0, 0),	\
+			  gnm_color_new_rgb8 (255, 0, 0),	\
 			  NULL);				\
   } while (0)
 
diff --git a/src/tools/scenarios.c b/src/tools/scenarios.c
index 101bc10..0725ead 100644
--- a/src/tools/scenarios.c
+++ b/src/tools/scenarios.c
@@ -146,6 +146,13 @@ gnm_scenario_new (char const *name, Sheet *sheet)
 	return sc;
 }
 
+/**
+ * gnm_scenario_dup:
+ * @src: #GnmScenario
+ * @new_sheet: #Sheet
+ *
+ * Returns: (transfer full): the duplicated scenario.
+ **/
 GnmScenario *
 gnm_scenario_dup (GnmScenario *src, Sheet *new_sheet)
 {
@@ -217,6 +224,12 @@ gnm_scenario_add_area (GnmScenario *sc, const GnmSheetRange *sr)
 				    g_slist_reverse (data.items));
 }
 
+/**
+ * gnm_scenario_apply:
+ * @sc: #GnmScenario
+ *
+ * Returns: (transfer full): the newly allocated #GOUndo.
+ **/
 GOUndo *
 gnm_scenario_apply (GnmScenario *sc)
 {
diff --git a/src/value-sheet.c b/src/value-sheet.c
index 4283d17..9ddfaba 100644
--- a/src/value-sheet.c
+++ b/src/value-sheet.c
@@ -132,10 +132,10 @@ value_area_get_height (GnmValue const *v, GnmEvalPos const *ep)
 
 /**
  * value_area_fetch_x_y:
- * @v : const #GnmValue *
- * @x : column
- * @y : row
- * @ep : const #GnmEvalPos *
+ * @v: const #GnmValue *
+ * @x: column
+ * @y: row
+ * @ep: const #GnmEvalPos *
  *
  * An internal routine to get a cell from an array or range.
  * Ensures that elements of CELLRANGE are evaluated
@@ -154,10 +154,10 @@ value_area_fetch_x_y (GnmValue const *v, int x, int y, GnmEvalPos const *ep)
 
 /**
  * value_area_get_x_y:
- * @v : const #GnmValue *
- * @x : column
- * @y : row
- * @ep : const #GnmEvalPos *
+ * @v: const #GnmValue *
+ * @x: column
+ * @y: row
+ * @ep: const #GnmEvalPos *
  *
  * An internal routine to get a cell from an array or range.
  * Ensures that elements of CELLRANGE are evaluated
@@ -262,11 +262,11 @@ cb_wrapper_foreach_cell_in_area (GnmCellIter const *iter, WrapperClosure *wrap)
 
 /**
  * value_area_foreach:
- * @v : const #GnmValue
- * @ep : const #GnmEvalPos
- * @flags : #CellIterFlags
- * @func  : #GnmValueIterFunc
- * @user_data :
+ * @v: const #GnmValue
+ * @ep: const #GnmEvalPos
+ * @flags: #CellIterFlags
+ * @func: #GnmValueIterFunc
+ * @user_data:
  *
  * For each existing element in an array or range , invoke the
  * callback routine.
diff --git a/src/value.c b/src/value.c
index ca64f2a..9f1cca3 100644
--- a/src/value.c
+++ b/src/value.c
@@ -190,9 +190,9 @@ value_error_name (GnmStdError err, gboolean translated)
 }
 
 /**
- * value_error_set_pos :
- * @err :
- * @pos :
+ * value_error_set_pos:
+ * @err:
+ * @pos:
  *
  * Change the position of a ValueError.
  */
@@ -263,7 +263,7 @@ value_new_cellrange_unsafe (GnmCellRef const *a, GnmCellRef const *b)
 }
 
 /**
- * value_new_cellrange : Create a new range reference.
+ * value_new_cellrange: Create a new range reference.
  *
  * Attempt to do a sanity check for inverted ranges.
  * NOTE : This is no longer necessary and will be removed.
@@ -341,7 +341,7 @@ value_new_cellrange_r (Sheet *sheet, GnmRange const *r)
 }
 
 /**
- * value_new_cellrange_str :
+ * value_new_cellrange_str:
  * @sheet: the sheet where the cell range is evaluated. This really only needed if
  *         the range given does not include a sheet specification.
  * @str: a range specification (ex: "A1", "A1:C3", "Sheet1!A1:C3", "R1C1").
@@ -365,7 +365,7 @@ value_new_cellrange_str (Sheet *sheet, char const *str)
 }
 
 /**
- * value_new_cellrange_parsepos_str :
+ * value_new_cellrange_parsepos_str:
  * @pp:  if a relative range is specified, then it will be interpreted relative
  *       to this position (affects only A1-style relative references).
  * @str: a range specification (ex: "A1", "A1:C3", "Sheet1!A1:C3", "R1C1").
@@ -595,10 +595,10 @@ value_release (GnmValue *value)
 }
 
 /**
- * value_dup :
- * @src : #GnmValue
+ * value_dup:
+ * @v: #GnmValue
  *
- * Returns a copy of @src.  @src == NULL will return NULL
+ * Returns a copy of @v.  @v == NULL will return NULL
  **/
 GnmValue *
 value_dup (GnmValue const *src)
@@ -665,9 +665,9 @@ value_compare_real (GnmValue const *a, GnmValue const *b,
 
 
 /**
- * value_cmp :
- * @ptr_a :
- * @ptr_b :
+ * value_cmp:
+ * @ptr_a:
+ * @ptr_b:
  *
  * qsort style comparison function.
  **/
@@ -849,9 +849,9 @@ value_get_as_checked_bool (GnmValue const *v)
 
 /**
  * value_get_as_gstring:
- * @v : #GnmValue
- * @target : #GString
- * @conv : #GnmConventions
+ * @v: #GnmValue
+ * @target: #GString
+ * @conv: #GnmConventions
  *
  * A simple value formatter to convert @v into a string stored in @target
  * according to @conv.  See format_value_gstring for something more elaborate
@@ -959,8 +959,8 @@ value_get_as_gstring (GnmValue const *v, GString *target,
 
 
 /**
- * value_get_as_string :
- * @v :
+ * value_get_as_string:
+ * @v:
  *
  * simplistic value rendering
  *
@@ -1091,9 +1091,9 @@ value_get_rangeref (GnmValue const *v)
 
 
 /**
- * value_coerce_to_number :
- * @v :
- * @valid :
+ * value_coerce_to_number:
+ * @v:
+ * @valid:
  *
  * If the value can be used as a number return that number
  * otherwise free it at return an appropriate error
@@ -1162,10 +1162,10 @@ compare_float_float (GnmValue const *va, GnmValue const *vb)
 }
 
 /**
- * value_diff :
+ * value_diff:
  *
- * @a : value a
- * @b : value b
+ * @a: value a
+ * @b: value b
  *
  * IGNORES format.
  *
@@ -1270,11 +1270,11 @@ gnm_string_cmp_ignorecase (gconstpointer gstr_a, gconstpointer gstr_b)
 
 
 /**
- * value_compare :
+ * value_compare:
  *
- * @a : value a
- * @b : value b
- * @case_sensitive : are string comparisons case sensitive.
+ * @a: value a
+ * @b: value b
+ * @case_sensitive: are string comparisons case sensitive.
  *
  * IGNORES format.
  */
@@ -1653,11 +1653,11 @@ free_criterias (GSList *criterias)
 }
 
 /**
- * parse_criteria :
- * @crit_val : #GnmValue
- * @date_conv : #GODateConventions
+ * parse_criteria:
+ * @crit_val: #GnmValue
+ * @date_conv: #GODateConventions
  *
- * Returns GnmCriteria which caller must free.
+ * Returns: (transfer full): GnmCriteria which caller must free.
  *
  * ">=value"
  * "<=value"
diff --git a/src/wbc-gtk-actions.c b/src/wbc-gtk-actions.c
index 1ceadde..f2de33c 100644
--- a/src/wbc-gtk-actions.c
+++ b/src/wbc-gtk-actions.c
@@ -1356,7 +1356,7 @@ static GNM_ACTION_DEF (cb_sort_descending) { sort_by_rows (wbcg, TRUE); }
 static void
 cb_add_graph (GogGraph *graph, gpointer wbcg)
 {
-	GraphDataClosure *data = (GraphDataClosure *) g_object_get_data (G_OBJECT (graph), "data-closure");
+	GnmGraphDataClosure *data = (GnmGraphDataClosure *) g_object_get_data (G_OBJECT (graph), "data-closure");
 	if (data) {
 		if (data->new_sheet) {
 			WorkbookControl *wbc = WORKBOOK_CONTROL (wbcg);
diff --git a/src/wbc-gtk-edit.c b/src/wbc-gtk-edit.c
index db03913..cfd3d1a 100644
--- a/src/wbc-gtk-edit.c
+++ b/src/wbc-gtk-edit.c
@@ -1232,6 +1232,12 @@ wbc_gtk_detach_guru (WBCGtk *wbcg)
 	wb_control_menu_state_update (wbc, MS_GURU_MENU_ITEMS);
 }
 
+/**
+ * wbc_gtk_get_guru:
+ * @wbcg: #WBCGtk
+ *
+ * Returns: (transfer none): the guru attached to the workbook view.
+ **/
 GtkWidget *
 wbc_gtk_get_guru (WBCGtk const *wbcg)
 {
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index 73dbd1d..df893af 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -3255,7 +3255,7 @@ cb_fore_color_changed (GOActionComboColor *a, WBCGtk *wbcg)
 	mstyle = gnm_style_new ();
 	gnm_style_set_font_color (mstyle, is_default
 		? style_color_auto_font ()
-		: style_color_new_go (c));
+		: gnm_color_new_go (c));
 	cmd_selection_format (wbc, mstyle, NULL, _("Set Foreground Color"));
 }
 
@@ -3309,7 +3309,7 @@ cb_back_color_changed (GOActionComboColor *a, WBCGtk *wbcg)
 		    gnm_style_get_pattern (mstyle) < 1)
 			gnm_style_set_pattern (mstyle, 1);
 
-		gnm_style_set_back_color (mstyle, style_color_new_go (c));
+		gnm_style_set_back_color (mstyle, gnm_color_new_go (c));
 	} else
 		gnm_style_set_pattern (mstyle, 0);	/* Set background to NONE */
 	cmd_selection_format (wbc, mstyle, NULL, _("Set Background Color"));
@@ -4447,14 +4447,20 @@ wbc_gtk_setup_icons (void)
 	if (!done) {
 		unsigned int ui = 0;
 		GtkIconFactory *factory = gtk_icon_factory_new ();
+		GObject *app = gnm_app_get_app ();
+		/* adding a test because this is called from  wbc_gtk_class_init()
+		during introspection with no proper initialization.*/
+		if (!app)
+			return;
 		for (ui = 0; ui < G_N_ELEMENTS (entry) ; ui++)
 			add_icon (factory,
 				  entry[ui].scalable_data,
 				  entry[ui].sized_data,
 				  entry[ui].stock_id);
 		gtk_icon_factory_add_default (factory);
-		g_object_set_data_full (gnm_app_get_app (),
-					"icon-factory", factory,
+		/* adding a test because this is called from  wbc_gtk_class_init()
+		during introspection with no proper initialization.*/
+		g_object_set_data_full (app, "icon-factory", factory,
 					(GDestroyNotify)gtk_icon_factory_remove_default);
 		g_object_unref (G_OBJECT (factory));
 		done = TRUE;
@@ -5833,8 +5839,8 @@ wbcg_get_n_scg (WBCGtk const *wbcg)
 
 /**
  * wbcg_get_nth_scg
- * @wbcg : #WBCGtk
- * @i :
+ * @wbcg: #WBCGtk
+ * @i:
  *
  * Returns the scg associated with the @i-th tab in @wbcg's notebook.
  * NOTE : @i != scg->sv->sheet->index_in_wb
diff --git a/src/wbc-gtk.h b/src/wbc-gtk.h
index e443ec7..d4a9de7 100644
--- a/src/wbc-gtk.h
+++ b/src/wbc-gtk.h
@@ -24,7 +24,7 @@ WBCGtk *wbc_gtk_new (WorkbookView *optional_view,
 GtkWindow	*wbcg_toplevel	  (WBCGtk *wbcg);
 void	         wbcg_set_transient (WBCGtk *wbcg,
 				     GtkWindow *window);
-SheetControlGUI *wbcg_get_nth_scg (WBCGtk *wbcg, int page);
+SheetControlGUI *wbcg_get_nth_scg (WBCGtk *wbcg, int i);
 SheetControlGUI *wbcg_cur_scg	  (WBCGtk *wbcg);
 Sheet		*wbcg_cur_sheet	  (WBCGtk *wbcg);
 Sheet		*wbcg_focus_cur_scg (WBCGtk *wbcg);
diff --git a/src/widgets/gnumeric-expr-entry.c b/src/widgets/gnumeric-expr-entry.c
index 16f3b66..2aeff4a 100644
--- a/src/widgets/gnumeric-expr-entry.c
+++ b/src/widgets/gnumeric-expr-entry.c
@@ -2214,8 +2214,8 @@ gee_reset_update_timer (GnmExprEntry *gee, gboolean user_requested)
 
 /**
  * gnm_expr_entry_signal_update:
- * @gee :
- * @user_requested : is the update requested by the user (eg activation)
+ * @gee:
+ * @user_requested: is the update requested by the user (eg activation)
  *
  * Higher level operations know when they are logically complete and can notify
  * GnmExprEntry clients.  For example, button-up after a drag selection
@@ -2254,8 +2254,8 @@ gnm_expr_entry_set_update_policy (GnmExprEntry *gee,
 
 /**
  * gnm_expr_entry_new:
- * @wbcg : #WBCGtk non-NULL
- * @with_icon : append a rollup icon to the end of the entry
+ * @wbcg: #WBCGtk non-NULL
+ * @with_icon: append a rollup icon to the end of the entry
  *
  * Creates a new #GnmExprEntry, which is an entry widget with support
  * for range selections.
@@ -2369,6 +2369,12 @@ gnm_expr_entry_set_scg (GnmExprEntry *gee, SheetControlGUI *scg)
 			    gee, gee->sheet->name_unquoted);
 }
 
+/**
+ * gnm_expr_entry_get_scg:
+ * @gee:
+ *
+ * Returns: (transfer none): the associated #SheetControlGUI.
+ **/
 SheetControlGUI *
 gnm_expr_entry_get_scg (GnmExprEntry *gee)
 {
@@ -2376,9 +2382,9 @@ gnm_expr_entry_get_scg (GnmExprEntry *gee)
 }
 
 /**
- * gnm_expr_entry_load_from_text :
- * @gee :
- * @txt :
+ * gnm_expr_entry_load_from_text:
+ * @gee:
+ * @txt:
  */
 void
 gnm_expr_entry_load_from_text (GnmExprEntry *gee, char const *txt)
@@ -2434,7 +2440,7 @@ gnm_expr_entry_load_from_dep (GnmExprEntry *gee, GnmDependent const *dep)
  * gnm_expr_entry_load_from_expr
  * @gee: a #GnmExprEntry
  * @texpr: An expression
- * @pp  : The parse position
+ * @pp: The parse position
  *
  * Sets the text of the entry, and removes saved information about earlier
  * range selections.
@@ -2467,7 +2473,6 @@ gnm_expr_entry_load_from_expr (GnmExprEntry *gee,
  * @gee: a #GnmExprEntry
  * @r:          a #GnmRange
  * @sheet:      a #sheet
- * @pos:        position
  *
  * Returns: true if displayed range is different from input range. false
  * otherwise.
@@ -2593,11 +2598,11 @@ gnm_expr_entry_can_rangesel (GnmExprEntry *gee)
 }
 
 /**
- * gnm_expr_entry_parse :
- * @gee : the entry
- * @pp : a parse position
- * @start_sel : start range selection when things change.
- * @flags :
+ * gnm_expr_entry_parse:
+ * @gee: the entry
+ * @pp: a parse position
+ * @start_sel: start range selection when things change.
+ * @flags:
  *
  * Attempts to parse the content of the entry line honouring
  * the flags.
@@ -2688,7 +2693,7 @@ gnm_expr_entry_parse (GnmExprEntry *gee, GnmParsePos const *pp,
 
 /**
  * gnm_expr_entry_get_text
- * @gee :
+ * @gee:
  *
  * A small convenience routine.  Think long and hard before using this.
  * There are lots of parse routines that serve the common case.
@@ -2703,7 +2708,7 @@ gnm_expr_entry_get_text	(GnmExprEntry const *gee)
 }
 
 /**
- * gnm_expr_entry_parse_as_value :
+ * gnm_expr_entry_parse_as_value:
  *
  * @gee: GnmExprEntry
  * @sheet: the sheet where the cell range is evaluated.
@@ -2749,7 +2754,7 @@ gnm_expr_entry_parse_as_value (GnmExprEntry *gee, Sheet *sheet)
  * @sheet: the sheet where the cell range is evaluated. This really only needed if
  *         the range given does not include a sheet specification.
  *
- * Returns a (GSList *)
+ * Returns: (element-type GnmValue) (transfer full): a (GSList *)
  *	or NULL on failure.
  */
 GSList *
@@ -2761,6 +2766,12 @@ gnm_expr_entry_parse_as_list (GnmExprEntry *gee, Sheet *sheet)
 		gtk_entry_get_text (gnm_expr_entry_get_entry (gee)));
 }
 
+/**
+ * gnm_expr_entry_get_entry:
+ * @gee: #GnmExprEntry
+ *
+ * Returns: (transfer none): the associated #GtkEntry.
+ **/
 GtkEntry *
 gnm_expr_entry_get_entry (GnmExprEntry *gee)
 {
diff --git a/src/workbook.c b/src/workbook.c
index 54e4296..3703653 100644
--- a/src/workbook.c
+++ b/src/workbook.c
@@ -446,6 +446,12 @@ workbook_set_saveinfo (Workbook *wb, GOFileFormatLevel level, GOFileSaver *fs)
 	return TRUE;
 }
 
+/**
+ * workbook_get_file_saver:
+ * @wb: #Workbook
+ *
+ * Returns: (transfer none): the saver for the Workbook.
+ **/
 GOFileSaver *
 workbook_get_file_saver (Workbook *wb)
 {
@@ -454,6 +460,12 @@ workbook_get_file_saver (Workbook *wb)
 	return wb->file_saver;
 }
 
+/**
+ * workbook_get_file_exporter:
+ * @wb: #Workbook
+ *
+ * Returns: (transfer none): the exporter for the Workbook.
+ **/
 GOFileSaver *
 workbook_get_file_exporter (Workbook *wb)
 {
@@ -462,6 +474,12 @@ workbook_get_file_exporter (Workbook *wb)
 	return wb->file_exporter;
 }
 
+/**
+ * workbook_get_last_export_uri:
+ * @wb: #Workbook
+ *
+ * Returns: (transfer none): the URI for export.
+ **/
 gchar const *
 workbook_get_last_export_uri (Workbook *wb)
 {
@@ -494,7 +512,7 @@ workbook_set_last_export_uri (Workbook *wb, gchar *uri)
  * @pos: The position the range is relative to.
  * @cell_range: A value containing a range;
  * @only_existing: if TRUE only existing cells are sent to the handler.
- * @handler: The operator to apply to each cell.
+ * @handler: (scope call): The operator to apply to each cell.
  * @closure: User data.
  *
  * The supplied value must be a cellrange.
@@ -559,6 +577,8 @@ workbook_foreach_cell_in_range (GnmEvalPos const *pos,
  *
  * Collects a GPtrArray of GnmEvalPos pointers for all cells in a workbook.
  * No particular order should be assumed.
+ *
+ * Returns: (transfer container): the cells array
  */
 GPtrArray *
 workbook_cells (Workbook *wb, gboolean comments, GnmSheetVisibility vis)
@@ -621,6 +641,15 @@ workbook_optimize_style (Workbook *wb)
 	});
 }
 
+/**
+ * workbook_foreach_name:
+ *
+ * @wb: #Workbook
+ * @globals_only: whether to apply only to global names.
+ * @func: (scope call): The operator to apply to each cell.
+ * @data: User data.
+ *
+ **/
 void
 workbook_foreach_name (Workbook const *wb, gboolean globals_only,
 		       GHFunc func, gpointer data)
@@ -724,8 +753,12 @@ workbook_detach_view (WorkbookView *wbv)
 /*****************************************************************************/
 
 /**
- * workbook_sheets: Get an ordered list of the sheets in the workbook
- *                  The caller is required to free the list.
+ * workbook_sheets:
+ * @wb: #Workbook
+ *
+ * Get an ordered list of the sheets in the workbook
+ * The caller is required to free the list.
+ * Returns: (element-type Sheet) (transfer container): the sheets list.
  */
 GSList *
 workbook_sheets (Workbook const *wb)
@@ -1164,13 +1197,13 @@ workbook_sheet_get_free_name (Workbook *wb,
 /**
  * workbook_sheet_rename:
  * @wb:          workbook to look for
- * @sheet_indices:   list of sheet indices (ignore -1)
- * @new_names:   list of new names
+ * @sheet_indices: (element-type void):  list of sheet indices (ignore -1)
+ * @new_names: (element-type char):  list of new names
  *
  * Adjusts the names of the sheets. We assume that everything is
  * valid. If in doubt call workbook_sheet_reorder_check first.
  *
- * Returns FALSE when it was successful
+ * Returns: FALSE when it was successful
  **/
 gboolean
 workbook_sheet_rename (Workbook *wb,
@@ -1211,7 +1244,7 @@ workbook_sheet_rename (Workbook *wb,
  * @is_undo: undo vs redo
  * @key: command
  *
- * returns the 1 based index of the @key command, or 0 if it is not found
+ * Returns: the 1 based index of the @key command, or 0 if it is not found
  **/
 unsigned
 workbook_find_command (Workbook *wb, gboolean is_undo, gpointer cmd)
@@ -1232,7 +1265,7 @@ workbook_find_command (Workbook *wb, gboolean is_undo, gpointer cmd)
 /**
  * workbook_sheet_reorder:
  * @wb:          workbook to look for
- * @new_order:   list of sheets
+ * @new_order: (element-type Sheet):  list of sheets
  *
  * Adjusts the order of the sheets.
  *
@@ -1300,6 +1333,12 @@ workbook_set_1904 (Workbook *wb, gboolean base1904)
 	workbook_set_date_conv (wb, date_conv);
 }
 
+/**
+ * workbook_get_sheet_size:
+ * @wb: #Workbook
+ *
+ * Returns: (transfer none): the current sheet size for @wb.
+ **/
 GnmSheetSize const *
 workbook_get_sheet_size (Workbook const *wb)
 {
@@ -1325,6 +1364,7 @@ struct _WorkbookSheetState {
 	GSList *properties;
 	int n_sheets;
 	WorkbookSheetStateSheet *sheets;
+	unsigned ref_count;
 };
 
 
@@ -1342,6 +1382,7 @@ workbook_sheet_state_new (const Workbook *wb)
 		wsss->sheet = g_object_ref (workbook_sheet_by_index (wb, i));
 		wsss->properties = go_object_properties_collect (G_OBJECT (wsss->sheet));
 	}
+	wss->ref_count = 1; 
 	return wss;
 }
 
@@ -1350,6 +1391,9 @@ workbook_sheet_state_free (WorkbookSheetState *wss)
 {
 	int i;
 
+	if (!wss || wss->ref_count-- > 1)
+		return;
+
 	go_object_properties_free (wss->properties);
 
 	for (i = 0; i < wss->n_sheets; i++) {
@@ -1361,6 +1405,26 @@ workbook_sheet_state_free (WorkbookSheetState *wss)
 	g_free (wss);
 }
 
+static WorkbookSheetState *
+workbook_sheet_state_ref (WorkbookSheetState *wss)
+{
+	wss->ref_count++;
+	return wss;
+}
+
+GType
+workbook_sheet_state_get_type (void)
+{
+	static GType t = 0;
+
+	if (t == 0) {
+		t = g_boxed_type_register_static ("WorkbookSheetState",
+			 (GBoxedCopyFunc)workbook_sheet_state_ref,
+			 (GBoxedFreeFunc)workbook_sheet_state_free);
+	}
+	return t;
+}
+
 void
 workbook_sheet_state_restore (Workbook *wb, const WorkbookSheetState *wss)
 {
diff --git a/src/workbook.h b/src/workbook.h
index b781a7f..c1ae9df 100644
--- a/src/workbook.h
+++ b/src/workbook.h
@@ -87,6 +87,7 @@ GnmSheetSize const *workbook_get_sheet_size (Workbook const *wb);
 void workbook_attach_view (WorkbookView *wbv);
 void workbook_detach_view (WorkbookView *wbv);
 
+GType workbook_sheet_state_get_type (void);
 WorkbookSheetState *workbook_sheet_state_new (Workbook const *wb);
 void workbook_sheet_state_free (WorkbookSheetState *wss);
 void workbook_sheet_state_restore (Workbook *wb, WorkbookSheetState const *wss);
diff --git a/src/xml-sax-read.c b/src/xml-sax-read.c
index 18ef9b6..d647835 100644
--- a/src/xml-sax-read.c
+++ b/src/xml-sax-read.c
@@ -267,7 +267,7 @@ xml_sax_attr_color (xmlChar const * const *attrs, char const *name, GnmColor **r
 			   name, attrs[1]);
 		return FALSE;
 	}
-	*res = style_color_new_rgba16 (red, green, blue, alpha);
+	*res = gnm_color_new_rgba16 (red, green, blue, alpha);
 	return TRUE;
 }
 
@@ -3472,7 +3472,7 @@ gnm_xml_file_open (G_GNUC_UNUSED GOFileOpener const *fo, GOIOContext *io_context
 /* ------------------------------------------------------------------------- */
 
 GnmCellRegion *
-xml_cellregion_read (WorkbookControl *wbc, GOIOContext *io_context,
+gnm_xml_cellregion_read (WorkbookControl *wbc, GOIOContext *io_context,
 		     Sheet *sheet,
 		     const char *buffer, int length)
 {
diff --git a/src/xml-sax.h b/src/xml-sax.h
index 51aecaa..737b459 100644
--- a/src/xml-sax.h
+++ b/src/xml-sax.h
@@ -23,7 +23,7 @@ Sheet	    *gnm_xml_in_cur_sheet (GsfXMLIn const *xin);
 
 GsfOutputMemory *gnm_cellregion_to_xml (GnmCellRegion const *cr);
 
-GnmCellRegion *xml_cellregion_read (WorkbookControl *wbc,
+GnmCellRegion *gnm_xml_cellregion_read (WorkbookControl *wbc,
 				    GOIOContext *io_context,
 				    Sheet *sheet,
 				    const char *buffer, int length);



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