[goffice] Made GoViewClass abstract.



commit 8a08ac540a336ecf2da0aa3ed9ec9ec5f8a3df87
Author: Jean Brefort <jean brefort normalesup org>
Date:   Sat Aug 4 17:07:17 2012 +0200

    Made GoViewClass abstract.

 goffice/app/go-view.c                        |    2 +-
 goffice/graph/gog-axis-line.c                |    6 +++
 goffice/graph/gog-axis.c                     |   50 ++++++++++++++++++--
 goffice/graph/gog-axis.h                     |    1 +
 goffice/graph/gog-chart-map-3d.c             |   31 +++++++++++--
 goffice/graph/gog-chart-map-3d.h             |    1 +
 goffice/graph/gog-chart-map.c                |   29 +++++++++++-
 goffice/graph/gog-chart-map.h                |    3 +-
 goffice/graph/gog-chart.c                    |   22 ++++++++-
 goffice/graph/gog-data-allocator.c           |    2 +-
 goffice/graph/gog-error-bar.c                |   16 +++++++
 goffice/graph/gog-graph.c                    |    2 +-
 goffice/graph/gog-guru.c                     |    4 +-
 goffice/graph/gog-object.c                   |   63 +++++++++++++++++++-------
 goffice/graph/gog-object.h                   |    1 +
 goffice/graph/gog-series.c                   |    8 +++
 goffice/gtk/go-calendar-button.c             |    2 +-
 goffice/gtk/go-combo-pixmaps.c               |    2 +-
 goffice/gtk/go-format-sel.c                  |    4 +-
 goffice/utils/go-string.c                    |   19 +++++++-
 plugins/plot_surface/gog-xyz-surface-prefs.c |    2 +-
 21 files changed, 226 insertions(+), 44 deletions(-)
---
diff --git a/goffice/app/go-view.c b/goffice/app/go-view.c
index 53ba008..eaae143 100644
--- a/goffice/app/go-view.c
+++ b/goffice/app/go-view.c
@@ -25,6 +25,6 @@
 
 typedef GObjectClass GoViewClass;
 
-GSF_CLASS (GoView, go_view,
+GSF_CLASS_ABSTRACT (GoView, go_view,
 	   NULL, NULL,
 	   G_TYPE_OBJECT)
diff --git a/goffice/graph/gog-axis-line.c b/goffice/graph/gog-axis-line.c
index a901d1a..ad97006 100644
--- a/goffice/graph/gog-axis-line.c
+++ b/goffice/graph/gog-axis-line.c
@@ -271,6 +271,12 @@ gog_axis_base_get_crossed_axis_type (GogAxisBase *axis_base)
 	return crossed_type;
 }
 
+/**
+ * gog_axis_base_get_crossed_axis:
+ * @axis_base: #GogAxisBase
+ *
+ * Returns: (transfer none): returns the crossing axis in a 2D chart if set.
+ **/
 GogAxis *
 gog_axis_base_get_crossed_axis (GogAxisBase *axis_base)
 {
diff --git a/goffice/graph/gog-axis.c b/goffice/graph/gog-axis.c
index 69d9273..b01a341 100644
--- a/goffice/graph/gog-axis.c
+++ b/goffice/graph/gog-axis.c
@@ -154,6 +154,14 @@ gog_axis_get_date_conv (GogAxis const *axis)
 	return axis->date_conv;
 }
 
+/**
+ * gog_axis_get_effective_format:
+ * @axis: #GogAxis
+ *
+ * Returns: (transfer none): the #GOFormat used for the axis labels. Differs
+ * from gog_axis_get_format in that it never returns a general format
+ * (see #go_format_is_general).
+ **/
 GOFormat *
 gog_axis_get_effective_format (GogAxis const *axis)
 {
@@ -217,6 +225,7 @@ struct _GogAxisMap {
 	GogAxisMapDesc	const *desc;
 	gpointer	 data;
 	gboolean	 is_valid;	/* Default to FALSE if desc::init == NULL */
+	unsigned     ref_count;
 };
 
 struct _GogAxisMapDesc {
@@ -1574,7 +1583,7 @@ gog_axis_map_is_valid (GogAxisMap *map)
  * gog_axis_map_to_view in order to translates data coordinates
  * into canvas space.
  *
- * Returns: a newly allocated #GogAxisMap.
+ * Returns: (transfer full): a newly allocated #GogAxisMap.
  **/
 GogAxisMap *
 gog_axis_map_new (GogAxis *axis, double offset, double length)
@@ -1590,6 +1599,7 @@ gog_axis_map_new (GogAxis *axis, double offset, double length)
 	map->axis = axis;
 	map->data = NULL;
 	map->is_valid = FALSE;
+	map->ref_count = 1;
 
 	if (axis->type != GOG_AXIS_CIRCULAR) {
 		offset += axis->span_start * length;
@@ -1891,6 +1901,8 @@ gog_axis_map_free (GogAxisMap *map)
 {
 	g_return_if_fail (map != NULL);
 
+	if (map->ref_count-- > 1)
+		return;
 	if (map->desc->destroy != NULL)
 		map->desc->destroy (map);
 
@@ -1899,6 +1911,25 @@ gog_axis_map_free (GogAxisMap *map)
 	g_free (map);
 }
 
+static GogAxisMap *
+gog_axis_map_ref (GogAxisMap *map)
+{
+	map->ref_count++;
+	return map;
+}
+
+GType
+gog_axis_map_get_type (void)
+{
+	static GType t = 0;
+
+	if (t == 0)
+		t = g_boxed_type_register_static ("GogAxisMap",
+			 (GBoxedCopyFunc) gog_axis_map_ref,
+			 (GBoxedFreeFunc) gog_axis_map_free);
+	return t;
+}
+
 static void
 gog_axis_auto_bound (GogAxis *axis)
 {
@@ -2094,7 +2125,8 @@ gog_axis_set_format (GogAxis *axis, GOFormat *fmt)
  * gog_axis_get_format:
  * @axis: #GogAxis
  *
- * Returns: the format assigned to @axis but does not add a reference.
+ * Returns: (transfer none): the format assigned to @axis but does not add
+ * a reference.
  **/
 GOFormat *
 gog_axis_get_format (GogAxis const *axis)
@@ -3068,7 +3100,7 @@ gog_axis_get_ticks (GogAxis *axis, GogAxisTick **ticks)
  * @axis: a #GogAxis
  * @plot_that_labeled_axis: a #GogPlot
  *
- * return value: the possibly NULL #GOData used as a label for this axis
+ * Returns: (transfer none): the possibly NULL #GOData used as a label for this axis
  * along with the plot that it was associated with
  **/
 GOData *
@@ -3148,6 +3180,13 @@ gog_axis_clear_contributors (GogAxis *axis)
 	g_slist_free (list);
 }
 
+/**
+ * gog_axis_contributors:
+ * @axis: #GogAxis
+ *
+ * Returns: (element-type GogObject*) (transfer none): the list of the axis
+ * contributors
+ **/
 GSList const *
 gog_axis_contributors (GogAxis *axis)
 {
@@ -3169,11 +3208,12 @@ gog_axis_bound_changed (GogAxis *axis, GogObject *contrib)
 	gog_object_request_update (GOG_OBJECT (axis));
 }
 
-/* gog_axis_get_grid_line:
+/**
+ * gog_axis_get_grid_line:
  * @axis: #GogAxis
  * @major: whether to retrieve major or minor grid line.
  *
- * Returns: a pointer to GridLine object associated to given axis, NULL
+ * Returns: (transfer none): a pointer to GridLine object associated to given axis, NULL
  * if it doesn't exists.
  **/
 GogGridLine *
diff --git a/goffice/graph/gog-axis.h b/goffice/graph/gog-axis.h
index 2857dc8..35526a3 100644
--- a/goffice/graph/gog-axis.h
+++ b/goffice/graph/gog-axis.h
@@ -50,6 +50,7 @@ typedef struct {
 
 typedef struct _GogAxisMap GogAxisMap;
 
+GType		  gog_axis_map_get_type (void);
 GogAxisMap*   gog_axis_map_new	 	  (GogAxis *axis, double offset, double length);
 double	      gog_axis_map 		  (GogAxisMap *map, double value);
 double	      gog_axis_map_to_view	  (GogAxisMap *map, double value);
diff --git a/goffice/graph/gog-chart-map-3d.c b/goffice/graph/gog-chart-map-3d.c
index bc62351..c5ae36b 100644
--- a/goffice/graph/gog-chart-map-3d.c
+++ b/goffice/graph/gog-chart-map-3d.c
@@ -29,6 +29,7 @@ struct _GogChartMap3D {
 	GogAxisMap		*axis_map[3];
 	gboolean		 is_valid;
 	GOMatrix3x3		 mat;
+	unsigned ref_count;
 
 	void 	 (*map_3D_to_view) 	(GogChartMap3D *map, double x, double y, double z, double *u, double *v, double *w);
 };
@@ -63,18 +64,17 @@ xyz_map_3D_to_view (GogChartMap3D *map, double x, double y, double z, double *u,
 }
 
 /**
- * gog_chart_3d_map_new:
+ * gog_chart_map_3d_new:
  * @chart: a #GogChart with 3D support
  * @area: area allocated to chart
  * @axis0: 1st dimension axis
  * @axis1: 2nd dimension axis
  * @axis2: 3rd dimension axis
- * @fill_area: does chart fill allocated area
  *
  * Creates a new #GogChartMap3D, used for conversion from data space
  * to canvas space.
  *
- * returns: a new #GogChartMap3D object.
+ * returns: (transfer full): a new #GogChartMap3D object.
  **/
 
 GogChartMap3D*
@@ -94,6 +94,7 @@ gog_chart_map_3d_new (GogChart *chart, GogViewAllocation const *area,
 	map->area = *area;
 	map->data = NULL;
 	map->is_valid = FALSE;
+	map->ref_count = 1;
 	box = GOG_3D_BOX (gog_object_get_child_by_name (GOG_OBJECT (chart), "3D-Box"));
 
 	axis_set = gog_chart_get_axis_set (chart);
@@ -149,9 +150,8 @@ gog_chart_map_3d_to_view (GogChartMap3D *map, double x, double y, double z, doub
  *
  * Valid values are in range [0..2].
  *
- * returns: a #GogAxisMap.
+ * returns: (transfer none): a #GogAxisMap.
  **/
-
 GogAxisMap *
 gog_chart_map_3d_get_axis_map (GogChartMap3D *map, unsigned int i)
 {
@@ -192,6 +192,8 @@ gog_chart_map_3d_free (GogChartMap3D *map)
 
 	g_return_if_fail (map != NULL);
 
+	if (map->ref_count-- > 1)
+		return;
 	for (i = 0; i < 3; i++)
 		if (map->axis_map[i] != NULL)
 			gog_axis_map_free (map->axis_map[i]);
@@ -200,3 +202,22 @@ gog_chart_map_3d_free (GogChartMap3D *map)
 	g_object_unref (map->chart);
 	g_free (map);
 }
+
+static GogChartMap3D *
+gog_chart_map_3d_ref (GogChartMap3D *map)
+{
+	map->ref_count++;
+	return map;
+}
+
+GType
+gog_chart_map_3d_get_type (void)
+{
+	static GType t = 0;
+
+	if (t == 0)
+		t = g_boxed_type_register_static ("GogChartMap3D",
+			 (GBoxedCopyFunc) gog_chart_map_3d_ref,
+			 (GBoxedFreeFunc) gog_chart_map_3d_free);
+	return t;
+}
diff --git a/goffice/graph/gog-chart-map-3d.h b/goffice/graph/gog-chart-map-3d.h
index 83f50f0..78c13c7 100644
--- a/goffice/graph/gog-chart-map-3d.h
+++ b/goffice/graph/gog-chart-map-3d.h
@@ -28,6 +28,7 @@ G_BEGIN_DECLS
 
 typedef struct _GogChartMap3D GogChartMap3D;
 
+GType		 gog_chart_map_3d_get_type (void);
 GogChartMap3D 	*gog_chart_map_3d_new 		(GogChart *chart, GogViewAllocation const *area,
 						 GogAxis *axis0, GogAxis *axis1, GogAxis *axis2);
 void 		 gog_chart_map_3d_to_view	(GogChartMap3D *map, double x, double y, double z, double *u, double *v, double *w);
diff --git a/goffice/graph/gog-chart-map.c b/goffice/graph/gog-chart-map.c
index e15999b..c4b3384 100644
--- a/goffice/graph/gog-chart-map.c
+++ b/goffice/graph/gog-chart-map.c
@@ -28,6 +28,7 @@ struct _GogChartMap {
 	gpointer	 	 data;
 	GogAxisMap		*axis_map[3];
 	gboolean		 is_valid;
+	unsigned		ref_count;
 
 	void 	 (*map_2D_to_view) 	(GogChartMap *map, double x, double y, double *u, double *v);
 	void 	 (*map_view_to_2D) 	(GogChartMap *map, double x, double y, double *u, double *v);
@@ -835,7 +836,7 @@ polar_make_close_path (GogChartMap *map, double const *x, double const *y,
  *
  * Convenience function for retrieving data related to polar plot layout.
  *
- * returns: a #GogChartMapPolarData struct.
+ * returns: (transfer none): a #GogChartMapPolarData struct.
  **/
 
 GogChartMapPolarData *
@@ -856,7 +857,7 @@ gog_chart_map_get_polar_parms (GogChartMap *map)
  * Creates a new #GogChartMap, used for conversion from data space
  * to canvas space.
  *
- * returns: a new #GogChartMap object.
+ * returns: (transfer full): a new #GogChartMap object.
  **/
 
 GogChartMap *
@@ -880,6 +881,7 @@ gog_chart_map_new (GogChart *chart, GogViewAllocation const *area,
 	map->data = NULL;
 	map->is_valid = FALSE;
 	map->axis_map[0] = map->axis_map[1] = map->axis_map[2] = NULL;
+	map->ref_count = 1;
 
 	switch (axis_set & GOG_AXIS_SET_FUNDAMENTAL) {
 		case GOG_AXIS_SET_X:
@@ -1034,7 +1036,7 @@ gog_chart_map_view_to_2D (GogChartMap *map, double x, double y, double *u, doubl
  *
  * Valid values are in range [0..2].
  *
- * returns: a #GogAxisMap.
+ * returns: (transfer none): a #GogAxisMap.
  **/
 
 GogAxisMap *
@@ -1080,6 +1082,8 @@ gog_chart_map_free (GogChartMap *map)
 
 	g_return_if_fail (map != NULL);
 
+	if (map->ref_count-- > 1)
+		return;
 	for (i = 0; i < 3; i++)
 		if (map->axis_map[i] != NULL)
 			gog_axis_map_free (map->axis_map[i]);
@@ -1089,6 +1093,25 @@ gog_chart_map_free (GogChartMap *map)
 	g_free (map);
 }
 
+static GogChartMap *
+gog_chart_map_ref (GogChartMap *map)
+{
+	map->ref_count++;
+	return map;
+}
+
+GType
+gog_chart_map_get_type (void)
+{
+	static GType t = 0;
+
+	if (t == 0)
+		t = g_boxed_type_register_static ("GogChartMap",
+			 (GBoxedCopyFunc) gog_chart_map_ref,
+			 (GBoxedFreeFunc) gog_chart_map_free);
+	return t;
+}
+
 /**
  * gog_chart_map_make_path:
  * @map: a #GogChartMap
diff --git a/goffice/graph/gog-chart-map.h b/goffice/graph/gog-chart-map.h
index daa12aa..21295d5 100644
--- a/goffice/graph/gog-chart-map.h
+++ b/goffice/graph/gog-chart-map.h
@@ -34,7 +34,8 @@ typedef struct {
 
 typedef struct _GogChartMap GogChartMap;
 
-GogChartMap 	*gog_chart_map_new 		(GogChart *chart, GogViewAllocation const *area,
+GType		 gog_chart_map_get_type (void);
+GogChartMap *gog_chart_map_new 		(GogChart *chart, GogViewAllocation const *area,
 						 GogAxis *axis0, GogAxis *axis1, GogAxis *axis2,
 						 gboolean fill_area);
 void 		 gog_chart_map_2D_to_view	(GogChartMap *map, double x, double y, double *u, double *v);
diff --git a/goffice/graph/gog-chart.c b/goffice/graph/gog-chart.c
index ee23c6e..a85ea03 100644
--- a/goffice/graph/gog-chart.c
+++ b/goffice/graph/gog-chart.c
@@ -887,6 +887,15 @@ gog_chart_request_cardinality_update (GogChart *chart)
 	}
 }
 
+/**
+ * gog_chart_foreach_elem:
+ * @chart: #GogChart
+ * @only_visible: whether to only apply to visible children
+ * @handler: (scope call): callback
+ * @data: user data
+ *
+ * Applies @handler to children
+ **/
 void
 gog_chart_foreach_elem (GogChart *chart, gboolean only_visible,
 			GogEnumFunc handler, gpointer data)
@@ -900,6 +909,14 @@ gog_chart_foreach_elem (GogChart *chart, gboolean only_visible,
 		gog_plot_foreach_elem (ptr->data, only_visible, handler, data);
 }
 
+
+/**
+ * gog_chart_get_plots:
+ * @chart: #GogChart
+ *
+ * Returns: (element-type GogPlot*) (transfer none): the list of the plots
+ * in @chart.
+ **/
 GSList *
 gog_chart_get_plots (GogChart const *chart)
 {
@@ -997,7 +1014,8 @@ gog_chart_axis_set_assign (GogChart *chart, GogAxisSet axis_set)
  * @chart: #GogChart
  * @target: #GogAxisType
  *
- * Returns: a list which the caller must free of all axis of type @target
+ * Returns: (element-type GogAxis*) (transfer container): a list which the
+ * caller must free of all axis of type @target
  * associated with @chart.
  **/
 GSList *
@@ -1030,7 +1048,7 @@ gog_chart_get_axes (GogChart const *chart, GogAxisType target)
  * gog_chart_get_grid:
  * @chart: #GogChart
  *
- * Returns: the grid associated with @chart if one exists
+ * Returns: (transfer none): the grid associated with @chart if one exists
  * otherwise NULL.
  **/
 GogGrid  *
diff --git a/goffice/graph/gog-data-allocator.c b/goffice/graph/gog-data-allocator.c
index 53be463..3da3311 100644
--- a/goffice/graph/gog-data-allocator.c
+++ b/goffice/graph/gog-data-allocator.c
@@ -65,7 +65,7 @@ gog_data_allocator_allocate (GogDataAllocator *dalloc, GogPlot *plot)
  * @dim_i:
  * @data_type:
  *
- * returns: a #GtkWidget.
+ * returns: (transfer full): a #GtkWidget.
  **/
 
 GogDataEditor *
diff --git a/goffice/graph/gog-error-bar.c b/goffice/graph/gog-error-bar.c
index e5fe64e..07ae690 100644
--- a/goffice/graph/gog-error-bar.c
+++ b/goffice/graph/gog-error-bar.c
@@ -204,6 +204,16 @@ cb_type_changed (GtkWidget *w, GogErrorBarEditor *editor)
 	gog_object_request_update (GOG_OBJECT (editor->series));
 }
 
+/**
+ * gog_error_bar_prefs:
+ * @series: #GogSeries
+ * @property: the name of the @series property correspondig to the #GogErrorBar.
+ * @direction: #GogErrorBarDirection
+ * @dalloc: #GogDataAllocator
+ * @cc: #GOCmdContext
+ *
+ * Returns: (transfer full): the error bar properties #GtkWidget
+ **/
 gpointer
 gog_error_bar_prefs (GogSeries *series,
 		     char const *property,
@@ -562,6 +572,12 @@ gog_error_bar_get_minmax (const GogErrorBar *bar, double *min, double *max)
 	}
 }
 
+/**
+ * gog_error_bar_dup:
+ * @bar: #GogErrorBar
+ *
+ * Returns: (transfer full): the duplicated error bar.
+ **/
 GogErrorBar  *
 gog_error_bar_dup		(GogErrorBar const *bar)
 {
diff --git a/goffice/graph/gog-graph.c b/goffice/graph/gog-graph.c
index 8257ae9..df08229 100644
--- a/goffice/graph/gog-graph.c
+++ b/goffice/graph/gog-graph.c
@@ -1135,7 +1135,7 @@ gog_graph_view_set_selection (GogGraphView *gview, GogObject *gobj)
  *
  * Builds a list of supported formats for image export.
  *
- * returns: (element-type GOImageFormat) (transfer container): a #GSList
+ * returns: (element-type GOImageFormat*) (transfer container): a #GSList
  * of #GOImageFormat.
  **/
 
diff --git a/goffice/graph/gog-guru.c b/goffice/graph/gog-guru.c
index 885a888..b65dd3d 100644
--- a/goffice/graph/gog-guru.c
+++ b/goffice/graph/gog-guru.c
@@ -1280,7 +1280,7 @@ graph_guru_init (GraphGuruState *s)
  * up the relationship between goffice and gnumeric to decide which parts of
  * the help live where.
  *
- * Returns: #GtkWidget associated with the gurus help button.
+ * Returns: (transfer none): #GtkWidget associated with the gurus help button.
  **/
 GtkWidget *
 gog_guru_get_help_button (GtkWidget *guru)
@@ -1300,7 +1300,7 @@ gog_guru_get_help_button (GtkWidget *guru)
  * 	: drop the @toplevel window argument and have the callers handle
  * 	  widget_show and set_transient
  *
- * Returns: the dialog, and shows new graph guru.
+ * Returns: (transfer full): the dialog, and shows new graph guru.
  **/
 GtkWidget *
 gog_guru (GogGraph *graph, GogDataAllocator *dalloc,
diff --git a/goffice/graph/gog-object.c b/goffice/graph/gog-object.c
index 78b6d46..11edcd3 100644
--- a/goffice/graph/gog-object.c
+++ b/goffice/graph/gog-object.c
@@ -27,6 +27,29 @@
 #include <string.h>
 #include <stdlib.h>
 
+static GogObjectRole*
+gog_object_role_ref (GogObjectRole* role)
+{
+	return role;
+}
+
+static void
+gog_object_role_unref (G_GNUC_UNUSED GogObjectRole *role)
+{
+}
+
+GType
+gog_object_role_get_type (void)
+{
+	static GType t = 0;
+
+	if (t == 0)
+		t = g_boxed_type_register_static ("GogObjectRole",
+			 (GBoxedCopyFunc) gog_object_role_ref,
+			 (GBoxedFreeFunc) gog_object_role_unref);
+	return t;
+}
+
 /**
  * SECTION: gog-object
  * @short_description: The base class for graph objects.
@@ -936,11 +959,11 @@ dataset_dup (GogDataset const *src, GogDataset *dst)
  * gog_object_dup:
  * @src: #GogObject
  * @new_parent: #GogObject the parent tree for the object (can be NULL)
- * @datadup: a function to duplicate the data (a default one is used if NULL)
+ * @datadup: (scope call): a function to duplicate the data (a default one is used if NULL)
  *
  * Create a deep copy of @obj using @new_parent as its parent.
  *
- * Returns: FIXME
+ * Returns: (transfer full): the duplicated object
  **/
 GogObject *
 gog_object_dup (GogObject const *src, GogObject *new_parent, GogDataDuplicator datadup)
@@ -996,7 +1019,7 @@ gog_object_dup (GogObject const *src, GogObject *new_parent, GogDataDuplicator d
  * gog_object_get_parent:
  * @obj: a #GogObject
  *
- * Returns: @obj's parent, potentially %NULL if it has not been added to a
+ * Returns: (transfer none): @obj's parent, potentially %NULL if it has not been added to a
  * 	heirarchy yet.  does not change ref-count in any way.
  **/
 GogObject *
@@ -1007,11 +1030,11 @@ gog_object_get_parent (GogObject const *obj)
 }
 
 /**
- * gog_object_get_parent_typed :
+ * gog_object_get_parent_typed:
  * @obj: a #GogObject
  * @t: a #GType
  *
- * Returns: @obj's parent of type @type, potentially %NULL if it has not been
+ * Returns: (transfer none): @obj's parent of type @type, potentially %NULL if it has not been
  * added to a hierarchy yet or none of the parents are of type @type.
  **/
 GogObject *
@@ -1029,7 +1052,7 @@ gog_object_get_parent_typed (GogObject const *obj, GType t)
  * gog_object_get_graph:
  * @obj: const * #GogObject
  *
- * Returns: the parent graph.
+ * Returns: (transfer none): the parent graph.
  **/
 GogGraph *
 gog_object_get_graph (GogObject const *obj)
@@ -1042,6 +1065,12 @@ gog_object_get_graph (GogObject const *obj)
 	return NULL;
 }
 
+/**
+ * gog_object_get_theme:
+ * @obj: const * #GogObject
+ *
+ * Returns: (transfer none): the parent graph theme.
+ **/
 GogTheme *
 gog_object_get_theme (GogObject const *obj)
 {
@@ -1100,8 +1129,8 @@ gog_object_set_name (GogObject *obj, char *name, GError **err)
  * @obj: a #GogObject
  * @filter: an optional #GogObjectRole to use as a filter
  *
- * Returns: A list of @obj's Children.  Caller must free the list, but not the
- * 		children.
+ * Returns: (element-type GogObject*) (transfer container): list of @obj's
+ * Children.  Caller must free the list, but not the children.
  **/
 GSList *
 gog_object_get_children (GogObject const *obj, GogObjectRole const *filter)
@@ -1126,7 +1155,7 @@ gog_object_get_children (GogObject const *obj, GogObjectRole const *filter)
  *
  * A convenience routine to find a unique child with @role.
  *
- * Returns: %NULL and spews an error if there is more than one.
+ * Returns: (transfer none): %NULL and spews an error if there is more than one.
  **/
 GogObject *
 gog_object_get_child_by_role (GogObject const *obj, GogObjectRole const *role)
@@ -1148,7 +1177,7 @@ gog_object_get_child_by_role (GogObject const *obj, GogObjectRole const *role)
  *
  * A convenience routine to find a unique child with role == @name
  *
- * Returns: %NULL and spews an error if there is more than one.
+ * Returns: (transfer none): %NULL and spews an error if there is more than one.
  **/
 GogObject *
 gog_object_get_child_by_name (GogObject const *obj, char const *name)
@@ -1229,8 +1258,8 @@ gog_role_cmp_full (GogObjectRole const *a, GogObjectRole const *b)
  * gog_object_possible_additions:
  * @parent: a #GogObject
  *
- * Returns: a list of GogObjectRoles that could be added.
- * 	The resulting list needs to be freed
+ * Returns: (element-type GogObjectRole*) (transfer container): a list
+ * of GogObjectRoles that could be added. The resulting list needs to be freed
  **/
 GSList *
 gog_object_possible_additions (GogObject const *parent)
@@ -1306,7 +1335,7 @@ gog_object_can_reorder (GogObject const *obj, gboolean *inc_ok, gboolean *dec_ok
  * @inc:
  * @goto_max:
  *
- * Returns: the object just before @obj in the new ordering.
+ * Returns: (transfer none): the object just before @obj in the new ordering.
  **/
 GogObject *
 gog_object_reorder (GogObject const *obj, gboolean inc, gboolean goto_max)
@@ -1367,7 +1396,7 @@ gog_object_reorder (GogObject const *obj, gboolean inc, gboolean goto_max)
  * Builds an object property editor, by calling GogObject::populate_editor
  * virtual functions.
  *
- * Returns: a #GtkNotebook widget
+ * Returns: (transfer full): a #GtkNotebook widget
  **/
 gpointer
 gog_object_get_editor (GogObject *obj, GogDataAllocator *dalloc,
@@ -1405,7 +1434,7 @@ gog_object_get_editor (GogObject *obj, GogDataAllocator *dalloc,
  *
  * Creates a new #GogView associated to @obj, and sets its parent to @parent.
  *
- * return value: a new #GogView
+ * Returns: (transfer full): a new #GogView
  **/
 GogView *
 gog_object_new_view (GogObject const *obj, GogView *parent)
@@ -1598,7 +1627,7 @@ gog_object_set_parent (GogObject *child, GogObject *parent,
  * @child: #GogObject
  *
  * Absorb a ref to @child if it is non-NULL.
- * Returns: @child or a newly created object with @role.  Callers do _not_ own
+ * Returns: (transfer none): @child or a newly created object with @role.  Callers do _not_ own
  * 	the reference.
  **/
 GogObject *
@@ -1650,7 +1679,7 @@ gog_object_add_by_role (GogObject *parent, GogObjectRole const *role, GogObject
  * @role:
  * @child: optionally null #GogObject
  *
- * Returns: a newly created child of @parent in @role.  If @child is provided,
+ * Returns: (transfer none):  a newly created child of @parent in @role.  If @child is provided,
  * it is assumed to be an unaffiliated object that will be assigned in @role.
  * On failure return NULL.
  **/
diff --git a/goffice/graph/gog-object.h b/goffice/graph/gog-object.h
index 961b450..6875a6f 100644
--- a/goffice/graph/gog-object.h
+++ b/goffice/graph/gog-object.h
@@ -59,6 +59,7 @@ struct _GogObjectRole {
 		gpointer	p;
 	} user;
 };
+GType gog_object_role_get_type (void);
 
 struct _GogObject {
 	GObject		 base;
diff --git a/goffice/graph/gog-series.c b/goffice/graph/gog-series.c
index 5b4f97a..dd51a39 100644
--- a/goffice/graph/gog-series.c
+++ b/goffice/graph/gog-series.c
@@ -1109,6 +1109,14 @@ gog_series_get_valid_element_index (GogSeries const *series, int old_index, int
 	return old_index;
 }
 
+/**
+ * gog_series_get_element:
+ * series: #GogSeries
+ * index: the element index
+ *
+ * Returns: (transfer none): the #GogSeriesElement corresponding to @index if
+ * any
+ **/
 GogSeriesElement *
 gog_series_get_element (GogSeries const *series, int index)
 {
diff --git a/goffice/gtk/go-calendar-button.c b/goffice/gtk/go-calendar-button.c
index 62b19f4..2a8623e 100644
--- a/goffice/gtk/go-calendar-button.c
+++ b/goffice/gtk/go-calendar-button.c
@@ -89,7 +89,7 @@ go_calendar_button_new (void)
 /**
  * go_calendar_button_get_calendar:
  * @calb: #GOCalendarButton
- * 
+ *
  * Returns: (transfer none): the embedded calendar.
  **/
 GtkCalendar *
diff --git a/goffice/gtk/go-combo-pixmaps.c b/goffice/gtk/go-combo-pixmaps.c
index ab8fab4..7002703 100644
--- a/goffice/gtk/go-combo-pixmaps.c
+++ b/goffice/gtk/go-combo-pixmaps.c
@@ -288,7 +288,7 @@ go_combo_pixmaps_get_selected (GOComboPixmaps const *combo, int *index)
 /**
  * go_combo_pixmaps_get_preview:
  * @combo: #GOComboPixmaps
- * 
+ *
  * Returns: (transfer none): the preview button.
  **/
 GtkWidget *
diff --git a/goffice/gtk/go-format-sel.c b/goffice/gtk/go-format-sel.c
index b17727f..277fd8c 100644
--- a/goffice/gtk/go-format-sel.c
+++ b/goffice/gtk/go-format-sel.c
@@ -1839,7 +1839,7 @@ go_format_sel_set_dateconv (GOFormatSel *gfs,
 /**
  * go_format_sel_get_fmt:
  * @gfs: #GOFormatSel
- * 
+ *
  * Returns: (transfer none): the #GOFormat.
  **/
 GOFormat const *
@@ -1852,7 +1852,7 @@ go_format_sel_get_fmt (GOFormatSel *gfs)
 /**
  * go_format_sel_get_dateconv:
  * @gfs: #GOFormatSel
- * 
+ *
  * Returns: (transfer none): the #GODateConventions.
  **/
 GODateConventions const *
diff --git a/goffice/utils/go-string.c b/goffice/utils/go-string.c
index 58ff6a6..d147a4a 100644
--- a/goffice/utils/go-string.c
+++ b/goffice/utils/go-string.c
@@ -25,6 +25,12 @@
 #include <gsf/gsf-utils.h>
 #include <string.h>
 
+/**
+ * GOString:
+ * @str: the embeded UTF-8 string
+ *
+ * GOString is a structure containing a string.
+ **/
 typedef struct {
 	GOString	base;
 	guint32		hash;
@@ -583,6 +589,13 @@ _go_string_dump (void)
 	g_slist_free (strs);
 }
 
+/**
+ * go_string_foreach_base:
+ * @callback: (scope call): callback
+ * @data: user data
+ *
+ * Iterates through the strings data base and apply @callback to each.
+ **/
 void
 go_string_foreach_base (GHFunc callback, gpointer data)
 {
@@ -646,7 +659,11 @@ go_string_get_markup (GOString const *gstr)
 }
 
 /**
- * go_string_get_phonetic
+ * go_string_get_phonetic: (skip)
+ * @gstr: #GOString.
+ *
+ * Warning: Not implemented, always returns NULL.
+ * Returns: (transfer none): the phonetic data.
  **/
 GOStringPhonetic *
 go_string_get_phonetic (GOString const *gstr)
diff --git a/plugins/plot_surface/gog-xyz-surface-prefs.c b/plugins/plot_surface/gog-xyz-surface-prefs.c
index b711141..15d0768 100644
--- a/plugins/plot_surface/gog-xyz-surface-prefs.c
+++ b/plugins/plot_surface/gog-xyz-surface-prefs.c
@@ -83,7 +83,7 @@ cb_missing_as_changed (GtkComboBoxText *box, XYZSurfPrefsState *state)
 	g_object_set (state->plot,
 	              "missing-as", gtk_combo_box_text_get_active_text (box),
 	              NULL);
-		
+
 }
 
 GtkWidget *



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