[gnumeric] Fixed all introspection warnings.
- From: Jean BrÃfort <jbrefort src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Fixed all introspection warnings.
- Date: Thu, 16 Aug 2012 15:35:20 +0000 (UTC)
commit 0e6eb1d4657884149ebb417ce7766371e236658c
Author: Jean Brefort <jean brefort normalesup org>
Date: Thu Aug 16 17:34:53 2012 +0200
Fixed all introspection warnings.
ChangeLog | 4 +
component/gnumeric.c | 4 +-
plugins/corba/corba-application.c | 2 +-
plugins/fn-lookup/functions.c | 2 +-
plugins/fn-tsa/functions.c | 2 +-
plugins/openoffice/openoffice-read.c | 40 ++++----
plugins/openoffice/openoffice-write.c | 8 +-
src/Makefile.am | 3 +
src/application.c | 96 +++++++++++++++-
src/application.h | 2 +
src/cell.c | 61 +++++++----
src/cellspan.c | 21 ++++
src/cellspan.h | 1 +
src/clipboard.c | 74 +++++++++++-
src/clipboard.h | 7 +-
src/collect.c | 86 ++++++++++++---
src/colrow.c | 86 ++++++++++++--
src/colrow.h | 2 +-
src/commands.c | 58 +++++++++-
src/complex.h | 4 +-
src/consolidate.c | 30 +++++
src/consolidate.h | 4 +
src/dependent.c | 19 +++-
src/dialogs/dialog-analysis-tools.c | 2 +-
src/dialogs/dialog-autofilter.c | 4 +-
src/dialogs/dialog-autoformat.c | 2 +-
src/dialogs/dialog-autosave.c | 2 +-
src/dialogs/dialog-cell-comment.c | 2 +-
src/dialogs/dialog-cell-format-cond.c | 2 +-
src/dialogs/dialog-cell-format.c | 2 +-
src/dialogs/dialog-cell-sort.c | 2 +-
src/dialogs/dialog-col-row.c | 2 +-
src/dialogs/dialog-col-width.c | 2 +-
src/dialogs/dialog-data-slicer.c | 2 +-
src/dialogs/dialog-data-table.c | 2 +-
src/dialogs/dialog-define-names.c | 2 +-
src/dialogs/dialog-delete-cells.c | 2 +-
src/dialogs/dialog-doc-metadata.c | 2 +-
src/dialogs/dialog-formula-guru.c | 2 +-
src/dialogs/dialog-function-select.c | 2 +-
src/dialogs/dialog-goal-seek.c | 2 +-
src/dialogs/dialog-goto-cell.c | 2 +-
src/dialogs/dialog-hyperlink.c | 2 +-
src/dialogs/dialog-insert-cells.c | 2 +-
src/dialogs/dialog-merge.c | 2 +-
src/dialogs/dialog-paste-special.c | 2 +-
src/dialogs/dialog-plugin-manager.c | 2 +-
src/dialogs/dialog-preferences.c | 2 +-
src/dialogs/dialog-printer-setup.c | 6 +-
src/dialogs/dialog-quit.c | 2 +-
src/dialogs/dialog-row-height.c | 2 +-
src/dialogs/dialog-search-replace.c | 4 +-
src/dialogs/dialog-search.c | 2 +-
src/dialogs/dialog-sheet-order.c | 2 +-
src/dialogs/dialog-sheet-resize.c | 2 +-
src/dialogs/dialog-sheetobject-size.c | 2 +-
src/dialogs/dialog-so-list.c | 2 +-
src/dialogs/dialog-solver.c | 2 +-
src/dialogs/dialog-stf-export.c | 2 +-
src/dialogs/dialog-stf.c | 2 +-
src/dialogs/dialog-tabulate.c | 2 +-
src/dialogs/dialog-view.c | 4 +-
src/dialogs/dialog-workbook-attr.c | 2 +-
src/dialogs/dialog-zoom.c | 2 +-
src/expr-name.c | 67 ++++++++++-
src/expr-name.h | 5 +
src/expr.c | 28 ++++-
src/expr.h | 1 +
src/file-autoft.c | 19 +++
src/format-template.c | 27 ++++-
src/format-template.h | 1 +
src/func.c | 48 ++++++++-
src/func.h | 2 +
src/gnm-data-cache-source.c | 7 +
src/gnm-datetime.c | 4 +-
src/gnm-datetime.h | 4 +-
src/gnm-pane.c | 10 ++-
src/gnumeric-conf.c | 176 ++++++++++++++++++++++++++++-
src/gnumeric-conf.h | 33 +++---
src/graph.c | 14 +++
src/gui-clipboard.c | 10 +-
src/gui-file.c | 10 +-
src/gui-util.c | 96 +++++++++++++---
src/gui-util.h | 16 ++--
src/gutils.c | 6 +-
src/io-context-gtk.c | 4 +-
src/item-bar.c | 2 +-
src/libgnumeric.c | 9 +-
src/main-application.c | 2 +-
src/mathfunc.c | 29 +++++-
src/mstyle.c | 27 +++++-
src/parse-util.c | 46 ++++++++-
src/parse-util.h | 2 +
src/position.c | 201 +++++++++++++++++++++++++++++----
src/position.h | 6 +
src/print-info.c | 68 +++++++++++-
src/print-info.h | 6 +-
src/ranges.c | 27 +++--
src/rendered-value.c | 27 ++++-
src/search.c | 18 ++-
src/selection.c | 127 +++++++++++----------
src/sheet-control-gui.c | 72 +++++++++---
src/sheet-control.c | 18 +++
src/sheet-filter.c | 2 +-
src/sheet-merge.c | 6 +-
src/sheet-object-cell-comment.c | 10 ++
src/sheet-object-graph.c | 4 +-
src/sheet-object-impl.h | 4 +-
src/sheet-object-widget.c | 10 +-
src/sheet-object.c | 30 +++++-
src/sheet-object.h | 1 +
src/sheet-style.c | 60 +++++++---
src/sheet-style.h | 1 +
src/sheet-view.c | 42 +++++---
src/sheet.c | 29 ++++-
src/sort.c | 13 ++
src/sort.h | 1 +
src/ssconvert.c | 4 +-
src/ssgrep.c | 2 +-
src/ssindex.c | 2 +-
src/stf-export.c | 17 +++-
src/stf-export.h | 2 +-
src/stf-parse.c | 70 ++++++++++--
src/stf-parse.h | 2 +
src/stf.c | 9 +-
src/style-border.c | 13 ++
src/style-border.h | 1 +
src/style-color.h | 2 +-
src/style-conditions.c | 65 +++++++++--
src/style-conditions.h | 2 +
src/style-font.h | 1 +
src/style.c | 16 +++-
src/symbol.c | 48 ++++++++-
src/symbol.h | 2 +
src/tools/ChangeLog | 6 +
src/tools/dao.c | 33 +++++-
src/tools/scenarios.c | 15 +++-
src/tools/scenarios.h | 3 +-
src/validation.c | 19 +++
src/validation.h | 1 +
src/value-sheet.c | 4 +-
src/value.c | 51 ++++++++-
src/value.h | 2 +
src/wbc-gtk-edit.c | 61 +++++-----
src/wbc-gtk.c | 59 +++++++---
src/widgets/gnm-dao.c | 2 +-
src/widgets/widget-font-selector.c | 2 +-
src/workbook-control.c | 45 +++++++-
src/workbook-control.h | 6 +-
src/workbook-view.c | 64 ++++++++---
src/workbook-view.h | 18 ++--
src/workbook.c | 22 ++--
src/xml-sax-read.c | 23 ++++-
src/xml-sax-write.c | 15 +--
154 files changed, 2357 insertions(+), 548 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9ab80fe..a703684 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-08-16 Jean Brefort <jean brefort normalesup org>
+
+ * all: fixed introspection warnings.
+
2012-08-07 Andreas J. Guelzow <aguelzow pyrshep ca>
* src/gui-file.c (gui_file_save_as): use workbook_get_last_export_uri
diff --git a/component/gnumeric.c b/component/gnumeric.c
index 42b77be..c82f9bc 100644
--- a/component/gnumeric.c
+++ b/component/gnumeric.c
@@ -141,7 +141,7 @@ go_gnm_component_set_data (GOComponent *component)
g_object_unref (gognm->wv);
g_object_unref (gognm->wb);
}
- gognm->wv = wb_view_new_from_input (input, NULL, NULL, io_context, NULL);
+ gognm->wv = workbook_view_new_from_input (input, NULL, NULL, io_context, NULL);
gognm->wb = wb_view_get_workbook (gognm->wv);
gnm_app_workbook_list_remove (gognm->wb);
g_object_unref (io_context);
@@ -230,7 +230,7 @@ go_gnm_component_edit (GOComponent *component)
GsfInput *input = gsf_input_memory_new (component->data, component->length, FALSE);
g_object_set (G_OBJECT (io_context), "exec-main-loop", FALSE, NULL);
- wv = wb_view_new_from_input (input, NULL, NULL, io_context, NULL);
+ wv = workbook_view_new_from_input (input, NULL, NULL, io_context, NULL);
g_object_unref (io_context);
}
set_uifilename ("Gnumeric-embed.xml", actions, G_N_ELEMENTS (actions));
diff --git a/plugins/corba/corba-application.c b/plugins/corba/corba-application.c
index 0b65e1a..3039f39 100644
--- a/plugins/corba/corba-application.c
+++ b/plugins/corba/corba-application.c
@@ -69,7 +69,7 @@ capp_workbook_open (PortableServer_Servant ignore,
} else {
GOCmdContext *cc = cmd_context_stderr_new ();
GOIOContext *io_context = go_io_context_new (cc);
- wbv = wb_view_new_from_uri (file_name, NULL, io_context, NULL);
+ wbv = workbook_view_new_from_uri (file_name, NULL, io_context, NULL);
g_object_unref (G_OBJECT (io_context));
g_object_unref (G_OBJECT (cc));
}
diff --git a/plugins/fn-lookup/functions.c b/plugins/fn-lookup/functions.c
index 27dcdda..4240423 100644
--- a/plugins/fn-lookup/functions.c
+++ b/plugins/fn-lookup/functions.c
@@ -1951,7 +1951,7 @@ GnmFuncDescriptor const lookup_functions[] = {
help_array, NULL, gnumeric_array, NULL, NULL,
GNM_FUNC_RETURNS_NON_SCALAR, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE },
{ "flip", "A|b",
- help_flip, gnumeric_flip, NULL, NULL, NULL,
+ help_flip, gnumeric_flip, NULL, NULL, NULL,
GNM_FUNC_RETURNS_NON_SCALAR, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE },
{NULL}
diff --git a/plugins/fn-tsa/functions.c b/plugins/fn-tsa/functions.c
index 36b20d8..a1b082e 100644
--- a/plugins/fn-tsa/functions.c
+++ b/plugins/fn-tsa/functions.c
@@ -497,7 +497,7 @@ gnumeric_interpolation (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
if (constp) {
vals0 = g_memdup (vals0, sizeof(gnm_float) * n0);
vals1 = g_memdup (vals1, sizeof(gnm_float) * n0);
- constp = FALSE;
+ constp = FALSE;
}
while (switched) {
gnm_float *val;
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 3abc099..4dca388 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -2759,7 +2759,7 @@ odf_adjust_offsets (OOParseState *state, GnmCellPos *pos, double *x, double *y,
odf_adjust_offsets_row (state, &pos->row, y, absolute);
}
-static gint
+static gint
odf_z_idx_compare (gconstpointer a, gconstpointer b)
{
object_offset_t const *za = a, *zb = b;
@@ -2777,7 +2777,7 @@ odf_complete_control_setup (OOParseState *state, object_offset_t const *ob_off)
if (oc == NULL)
return;
-
+
if (oc->linked_cell) {
GnmParsePos pp;
GnmRangeRef ref;
@@ -2914,7 +2914,7 @@ oo_table_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
/* We need to fix the anchors of all offsets, ensure that each object has an "odf-z-index", */
/* and add the objects in the correct order. */
state->chart_list = g_slist_reverse (state->chart_list);
-
+
for (l = state->chart_list; l != NULL; l = l->next) {
object_offset_t *ob_off = l->data;
if (ob_off->z_index < 0) {
@@ -2926,7 +2926,7 @@ oo_table_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
state->chart_list = g_slist_sort (state->chart_list,
odf_z_idx_compare);
-
+
for (l = state->chart_list; l != NULL; l = l->next) {
object_offset_t *ob_off = l->data;
@@ -4482,7 +4482,7 @@ oo_style (GsfXMLIn *xin, xmlChar const **attrs)
oo_warning (xin, _("Duplicate default chart/graphics style encountered."));
g_free (state->default_style.graphics);
}
- state->default_style.graphics = state->chart.cur_graph_style;
+ state->default_style.graphics = state->chart.cur_graph_style;
} else
state->cur_style.requires_disposal = TRUE;
break;
@@ -5599,7 +5599,7 @@ odf_page_layout (GsfXMLIn *xin, xmlChar const **attrs)
name = CXML2C (attrs[1]);
if (name != NULL) {
- state->print.cur_pi = print_info_new (TRUE);
+ state->print.cur_pi = print_information_new (TRUE);
g_hash_table_insert (state->styles.page_layouts, g_strdup (name), state->print.cur_pi);
} else
oo_warning (xin, _("Missing page layout identifier"));
@@ -5633,7 +5633,7 @@ odf_master_page (GsfXMLIn *xin, xmlChar const **attrs)
pi = g_hash_table_lookup (state->styles.page_layouts, pl_name);
if (pi == NULL) {
oo_warning (xin, _("Master page style without page layout encountered!"));
- state->print.cur_pi = print_info_new (TRUE);
+ state->print.cur_pi = print_information_new (TRUE);
} else
state->print.cur_pi = print_info_dup (pi);
print_hf_free (state->print.cur_pi->header);
@@ -9019,10 +9019,10 @@ odf_so_filled (GsfXMLIn *xin, xmlChar const **attrs, gboolean is_oval)
if (style != NULL) {
if (state->default_style.graphics)
- odf_apply_style_props
+ odf_apply_style_props
(xin, state->default_style.graphics->style_props,
style);
-
+
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]),
OO_NS_DRAW, "style-name"))
@@ -9071,7 +9071,7 @@ static void
odf_custom_shape_replace_object (OOParseState *state, SheetObject *so)
{
GObjectClass *klass = G_OBJECT_GET_CLASS (G_OBJECT (so));
-
+
if (NULL != g_object_class_find_property (klass, "text")) {
char *text = NULL;
g_object_get (state->chart.so, "text", &text, NULL);
@@ -9100,26 +9100,26 @@ odf_custom_shape_end (GsfXMLIn *xin, GsfXMLBlob *blob)
OOParseState *state = (OOParseState *)xin->user_state;
if (state->chart.cs_type) {
- if (0 == g_ascii_strcasecmp (state->chart.cs_type, "ellipse") &&
+ if (0 == g_ascii_strcasecmp (state->chart.cs_type, "ellipse") &&
g_str_has_prefix (state->chart.cs_enhanced_path, "U ")) {
/* We have already created an ellipse */
- } else if (0 == g_ascii_strcasecmp (state->chart.cs_type, "rectangle") &&
+ } else if (0 == g_ascii_strcasecmp (state->chart.cs_type, "rectangle") &&
g_str_has_prefix (state->chart.cs_enhanced_path, "M ")) {
/* We have already created an ellipse */
- odf_custom_shape_replace_object
+ odf_custom_shape_replace_object
(state, g_object_new (GNM_SO_FILLED_TYPE,
"is-oval", FALSE, NULL));
- } else if (0 == g_ascii_strcasecmp (state->chart.cs_type, "frame") &&
+ } else if (0 == g_ascii_strcasecmp (state->chart.cs_type, "frame") &&
g_str_has_prefix (state->chart.cs_enhanced_path, "M ")) {
/* We have already created an ellipse */
- odf_custom_shape_replace_object
+ odf_custom_shape_replace_object
(state, g_object_new (GNM_SOW_FRAME_TYPE, NULL));
} else if (0 == g_ascii_strcasecmp (state->chart.cs_type, "round-rectangle") ||
0 == g_ascii_strcasecmp (state->chart.cs_type, "paper") ||
0 == g_ascii_strcasecmp (state->chart.cs_type, "parallelogram") ||
0 == g_ascii_strcasecmp (state->chart.cs_type, "trapezoid")) {
/* We have already created an ellipse */
- odf_custom_shape_replace_object
+ odf_custom_shape_replace_object
(state, g_object_new (GNM_SO_FILLED_TYPE,
"is-oval", FALSE, NULL));
oo_warning (xin , _("An unsupported custom shape of type '%s' was encountered and "
@@ -9127,12 +9127,12 @@ odf_custom_shape_end (GsfXMLIn *xin, GsfXMLBlob *blob)
}else
oo_warning (xin , _("An unsupported custom shape of type '%s' was encountered and "
"converted to an ellipse."), state->chart.cs_type);
- } else
+ } else
oo_warning (xin , _("An unsupported custom shape was encountered and "
"converted to an ellipse."));
od_draw_text_frame_end (xin, blob);
-
+
g_free (state->chart.cs_enhanced_path);
g_free (state->chart.cs_type);
state->chart.cs_enhanced_path = NULL;
@@ -9143,13 +9143,13 @@ static void
odf_custom_shape (GsfXMLIn *xin, xmlChar const **attrs)
{
OOParseState *state = (OOParseState *)xin->user_state;
-
+
/* to avoid spill over */
g_free (state->chart.cs_enhanced_path);
g_free (state->chart.cs_type);
state->chart.cs_enhanced_path = NULL;
state->chart.cs_type = NULL;
-
+
odf_so_filled (xin, attrs, TRUE);
odf_push_text_p (state, FALSE);
}
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index f0d07a3..89ac6b8 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -2855,7 +2855,7 @@ odf_write_frame_size (GnmOOExport *state, SheetObject *so)
sheet = sheet_object_get_sheet (so);
if (sheet) {
int z;
- z = g_slist_length (sheet->sheet_objects)
+ z = g_slist_length (sheet->sheet_objects)
- sheet_object_get_stacking (so);
gsf_xml_out_add_int (state->xml, DRAW "z-index", z);
}
@@ -6872,7 +6872,7 @@ odf_write_gog_style_graphic (GnmOOExport *state, GOStyle const *style)
if (!style->fill.auto_back) {
color = odf_go_color_to_string (style->fill.pattern.back);
gsf_xml_out_add_cstr (state->xml, DRAW "fill-color", color);
- odf_add_percent (state->xml, DRAW "opacity",
+ odf_add_percent (state->xml, DRAW "opacity",
odf_go_color_opacity (style->fill.pattern.back));
}
} else if (style->fill.pattern.pattern == GO_PATTERN_FOREGROUND_SOLID) {
@@ -6880,7 +6880,7 @@ odf_write_gog_style_graphic (GnmOOExport *state, GOStyle const *style)
if (!style->fill.auto_fore) {
color = odf_go_color_to_string (style->fill.pattern.fore);
gsf_xml_out_add_cstr (state->xml, DRAW "fill-color", color);
- odf_add_percent (state->xml, DRAW "opacity",
+ odf_add_percent (state->xml, DRAW "opacity",
odf_go_color_opacity (style->fill.pattern.fore));
}
} else {
@@ -6891,7 +6891,7 @@ odf_write_gog_style_graphic (GnmOOExport *state, GOStyle const *style)
if (!style->fill.auto_back) {
color = odf_go_color_to_string (style->fill.pattern.back);
gsf_xml_out_add_cstr (state->xml, DRAW "fill-color", color);
- odf_add_percent (state->xml, DRAW "opacity",
+ odf_add_percent (state->xml, DRAW "opacity",
odf_go_color_opacity (style->fill.pattern.back));
}
g_free (hatch);
diff --git a/src/Makefile.am b/src/Makefile.am
index cf9d63c..7679ca5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -506,8 +506,11 @@ Gnm_ GNUMERIC_API_VER_@_gir_LIBS = libspreadsheet.la
Gnm_ GNUMERIC_API_VER_@_gir_FILES = \
$(libspreadsheet_la_SOURCES) \
$(libspreadsheet_include_HEADERS) \
+ tools/dao.c \
+ tools/dao.h \
tools/scenarios.c \
tools/scenarios.h \
+ tools/tools.h \
widgets/gnumeric-expr-entry.c \
widgets/gnumeric-expr-entry.h
diff --git a/src/application.c b/src/application.c
index d9a9a08..3012544 100644
--- a/src/application.c
+++ b/src/application.c
@@ -91,6 +91,11 @@ static GnmApp *app;
static Workbook *gnm_app_workbook_get_by_uri (char const *uri);
+/**
+ * gnm_app_get_app:
+ *
+ * Returns: (transfer none): the #GnmApp instance.
+ **/
GObject *
gnm_app_get_app (void)
{
@@ -136,6 +141,11 @@ gnm_app_workbook_list_remove (Workbook *wb)
g_signal_emit (G_OBJECT (app), signals [WORKBOOK_REMOVED], 0, wb);
}
+/**
+ * gnm_app_workbook_list:
+ *
+ * Returns: (element-type Workbook) (transfer none): the workbook list.
+ **/
GList *
gnm_app_workbook_list (void)
{
@@ -253,11 +263,12 @@ gnm_app_clipboard_cut_copy (WorkbookControl *wbc, gboolean is_cut,
}
}
-/** gnm_app_clipboard_cut_copy_obj:
+/**
+ * gnm_app_clipboard_cut_copy_obj:
* @wbc: #WorkbookControl
* @is_cut:
* @sv: #SheetView
- * @objects: a list of #SheetObject which is freed
+ * @objects: (element-type SheetObject): a list of #SheetObject which is freed
*
* Different than copying/cutting a region, this can actually cuts an object
**/
@@ -306,6 +317,11 @@ gnm_app_clipboard_is_cut (void)
return FALSE;
}
+/**
+ * gnm_app_clipboard_sheet_get:
+ *
+ * Returns: (transfer none): the current clipboard #Sheet.
+ **/
Sheet *
gnm_app_clipboard_sheet_get (void)
{
@@ -316,6 +332,11 @@ gnm_app_clipboard_sheet_get (void)
return sv_sheet (app->clipboard_sheet_view);
}
+/**
+ * gnm_app_clipboard_sheet_view_get:
+ *
+ * Returns: (transfer none): the current clipboard #SheetView.
+ **/
SheetView *
gnm_app_clipboard_sheet_view_get (void)
{
@@ -345,6 +366,13 @@ gnm_app_clipboard_area_get (void)
return NULL;
}
+/**
+ * gnm_app_workbook_get_by_name:
+ * @name: the workbook name.
+ * @ref_uri:
+ *
+ * Returns: (transfer none): the #Workbook or %NULL.
+ **/
Workbook *
gnm_app_workbook_get_by_name (char const *name,
char const *ref_uri)
@@ -470,6 +498,14 @@ gnm_app_dpi_to_pixels (void)
}
/* GtkFileFilter */
+/**
+ * gnm_app_create_opener_filter:
+ * @openers: (element-type GOFileOpener): a list of file openers.
+ *
+ * Creates a #GtkFileFilter from the list of file types supported by the
+ * openers in the list.
+ * Returns: (transfer full): the newly allocated #GtkFileFilter.
+ **/
void *
gnm_app_create_opener_filter (GList *openers)
{
@@ -559,7 +595,8 @@ compare_mru (GtkRecentInfo *a, GtkRecentInfo *b)
*
* creating it if necessary.
*
- * Return value: the list, which must be freed along with the strings in it.
+ * Return value: (element-type char) (transfer full): the list, which must be
+ * freed along with the strings in it.
**/
GSList *
gnm_app_history_get_list (int max_elements)
@@ -862,6 +899,16 @@ GSF_CLASS (GnmApp, gnm_app,
/**********************************************************************/
static GSList *extra_uis = NULL;
+/**
+ * gnm_action_new:
+ * @name: action ID.
+ * @label: label.
+ * @icon: icon name.
+ * @always_available: whether the action should always be available.
+ * @handler: (scope async): the handler.
+ *
+ * Returns: (transfer full): the newly allocated #GnmAction.
+ **/
GnmAction *
gnm_action_new (char const *id, char const *label,
char const *icon_name, gboolean always_available,
@@ -887,6 +934,49 @@ gnm_action_free (GnmAction *action)
}
}
+static GnmAction *
+gnm_action_copy (GnmAction const *action)
+{
+ return gnm_action_new (action->id, action->label, action->icon_name,
+ action->always_available, action->handler);
+}
+
+GType
+gnm_action_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmAction",
+ (GBoxedCopyFunc)gnm_action_copy,
+ (GBoxedFreeFunc)gnm_action_free);
+ }
+ return t;
+}
+
+/***************
+ * making GnmAppExtraUI a boxed type for introspection. copy and free don't do
+ anything which might be critical, crossing fingers.*/
+
+static GnmAppExtraUI *
+gnm_app_extra_ui_ref (GnmAppExtraUI *ui)
+{
+ return ui;
+}
+
+GType
+gnm_app_extra_ui_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmAppExtraUI",
+ (GBoxedCopyFunc)gnm_app_extra_ui_ref,
+ (GBoxedFreeFunc)gnm_app_extra_ui_ref);
+ }
+ return t;
+}
+
/**
* gnm_app_add_extra_ui:
* @group_name: action group name.
diff --git a/src/application.h b/src/application.h
index 2b1abfe..b1166bf 100644
--- a/src/application.h
+++ b/src/application.h
@@ -80,11 +80,13 @@ typedef struct {
gpointer user_data;
} GnmAppExtraUI;
+GType gnm_action_get_type (void);
GnmAction *gnm_action_new (char const *name, char const *label,
char const *icon, gboolean always_available,
GnmActionHandler handler);
void gnm_action_free (GnmAction *action);
+GType gnm_app_extra_ui_get_type (void);
GnmAppExtraUI *gnm_app_add_extra_ui (char const *group_name,
GSList *actions, const char *layout,
char const *domain,
diff --git a/src/cell.c b/src/cell.c
index c00983a..3ec16a0 100644
--- a/src/cell.c
+++ b/src/cell.c
@@ -29,7 +29,7 @@
#include <goffice/goffice.h>
/**
- * gnm_cell_cleanout :
+ * gnm_cell_cleanout:
* Empty a cell's
* - value.
* - rendered_value.
@@ -71,7 +71,7 @@ gnm_cell_cleanout (GnmCell *cell)
/****************************************************************************/
/*
- * gnm_cell_set_text : Parses the supplied text for storage as a value or
+ * gnm_cell_set_text: Parses the supplied text for storage as a value or
* expression. It marks the sheet as dirty.
*
* If the text is an expression it IS queued for recalc.
@@ -108,7 +108,7 @@ gnm_cell_set_text (GnmCell *cell, char const *text)
}
/*
- * gnm_cell_assign_value : Stores (WITHOUT COPYING) the supplied value.
+ * gnm_cell_assign_value: Stores (WITHOUT COPYING) the supplied value.
* no changes are made to the expression or entered text. This
* is for use by routines that wish to store values directly such
* as expression calculation or import for array formulas.
@@ -133,7 +133,7 @@ gnm_cell_assign_value (GnmCell *cell, GnmValue *v)
}
/**
- * gnm_cell_set_value : Stores (WITHOUT COPYING) the supplied value. It marks the
+ * gnm_cell_set_value: Stores (WITHOUT COPYING) the supplied value. It marks the
* sheet as dirty.
*
* WARNING : This is an internal routine that does not
@@ -159,7 +159,7 @@ gnm_cell_set_value (GnmCell *cell, GnmValue *v)
}
/*
- * gnm_cell_set_expr_and_value : Stores (WITHOUT COPYING) the supplied value, and
+ * gnm_cell_set_expr_and_value: Stores (WITHOUT COPYING) the supplied value, and
* references the supplied expression and links it into the expression
* list. It marks the sheet as dirty. It is intended for use by import
* routines or operations that do bulk assignment.
@@ -223,7 +223,7 @@ cell_set_expr_internal (GnmCell *cell, GnmExprTop const *texpr)
}
/*
- * gnm_cell_set_expr_unsafe : Stores and references the supplied expression. It
+ * gnm_cell_set_expr_unsafe: Stores and references the supplied expression. It
* marks the sheet as dirty. Intented for use by import routines that
* do bulk assignment. The resulting cell is NOT linked into the
* dependent list. Nor marked for recalc.
@@ -243,7 +243,7 @@ gnm_cell_set_expr_unsafe (GnmCell *cell, GnmExprTop const *texpr)
}
/**
- * gnm_cell_set_expr : Stores and references the supplied expression
+ * gnm_cell_set_expr: Stores and references the supplied expression
* marks the sheet as dirty. Intented for use by import routines that
* do bulk assignment. The resulting cell _is_ linked into the
* dependent list, but NOT marked for recalc.
@@ -344,6 +344,13 @@ gnm_cell_set_array_formula_cb (GnmSheetRange const *sr, GnmExprTop const *texpr
sheet_queue_respan (sr->sheet, sr->range.start.row, sr->range.end.row);
}
+/**
+ * gnm_cell_set_array_formula_undo:
+ * @sr:
+ * @texpr:
+ *
+ * Returns: (transfer full): the newly allocated #GOUndo.
+ **/
GOUndo *
gnm_cell_set_array_formula_undo (GnmSheetRange *sr, GnmExprTop const *texpr)
{
@@ -396,8 +403,8 @@ gnm_cell_set_array (Sheet *sheet,
/***************************************************************************/
/**
- * gnm_cell_is_empty :
- * @cell : #GnmCell
+ * gnm_cell_is_empty:
+ * @cell: #GnmCell
*
* If the cell has not been created, or has VALUE_EMPTY.
**/
@@ -408,8 +415,8 @@ gnm_cell_is_empty (GnmCell const * cell)
}
/**
- * gnm_cell_is_blank :
- * @cell : #GnmCell
+ * gnm_cell_is_blank:
+ * @cell: #GnmCell
*
* If the cell has not been created, has VALUE_EMPTY, or has a VALUE_STRING == ""
**/
@@ -487,8 +494,8 @@ gnm_cell_is_array_corner (GnmCell const *cell)
}
/**
- * gnm_cell_is_array :
- * @cell : #GnmCell const *
+ * gnm_cell_is_array:
+ * @cell: #GnmCell const *
*
* Return TRUE is @cell is part of an array
**/
@@ -501,8 +508,8 @@ gnm_cell_is_array (GnmCell const *cell)
}
/**
- * gnm_cell_is_nonsingleton_array :
- * @cell : #GnmCell const *
+ * gnm_cell_is_nonsingleton_array:
+ * @cell: #GnmCell const *
*
* Return TRUE is @cell is part of an array larger than 1x1
**/
@@ -522,6 +529,12 @@ gnm_cell_is_nonsingleton_array (GnmCell const *cell)
/***************************************************************************/
+/**
+ * gnm_cell_get_rendered_value: (skip)
+ * @cell: #GnmCell
+ *
+ * Returns:
+ **/
GnmRenderedValue *
gnm_cell_get_rendered_value (GnmCell const *cell)
{
@@ -530,6 +543,12 @@ gnm_cell_get_rendered_value (GnmCell const *cell)
return gnm_rvc_query (cell->base.sheet->rendered_values, cell);
}
+/**
+ * gnm_cell_fetch_rendered_value: (skip)
+ * @cell: #GnmCell
+ *
+ * Returns:
+ **/
GnmRenderedValue *
gnm_cell_fetch_rendered_value (GnmCell const *cell,
gboolean allow_variable_width)
@@ -552,9 +571,9 @@ gnm_cell_unrender (GnmCell const *cell)
}
/**
- * gnm_cell_render_value :
+ * gnm_cell_render_value: (skip)
* @cell: The cell whose value needs to be rendered
- * @allow_variable_width : Allow format to depend on column width.
+ * @allow_variable_width: Allow format to depend on column width.
*/
GnmRenderedValue *
gnm_cell_render_value (GnmCell const *cell, gboolean allow_variable_width)
@@ -894,8 +913,8 @@ gnm_cell_get_style (GnmCell const *cell)
}
/**
- * gnm_cell_get_format :
- * @cell :
+ * gnm_cell_get_format:
+ * @cell:
*
* Get the display format. If the assigned format is General,
* the format of the value will be used.
@@ -965,7 +984,9 @@ cb_set_array_value (GnmCellIter const *iter, gpointer user)
}
/**
- * gnm_cell_convert_expr_to_value : drops the expression keeps its value. Then uses the formatted
+ * gnm_cell_convert_expr_to_value:
+ * @cell: #GnmCell
+ * drops the expression keeps its value. Then uses the formatted
* result as if that had been entered.
*
* NOTE : the cell's expression cannot be linked into the expression * list.
diff --git a/src/cellspan.c b/src/cellspan.c
index 94aa9da..9bac0e0 100644
--- a/src/cellspan.c
+++ b/src/cellspan.c
@@ -156,6 +156,27 @@ row_span_get (ColRowInfo const * const ri, int const col)
return g_hash_table_lookup (ri->spans, GINT_TO_POINTER(col));
}
+/* making CellSpanInfo a boxed type. As this objects are constant, no need
+ * to really copy free them. Right? */
+static const CellSpanInfo*
+cell_span_info_copy (CellSpanInfo const *sp)
+{
+ return sp;
+}
+
+GType
+cell_span_info_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("CellSpanInfo",
+ (GBoxedCopyFunc)cell_span_info_copy,
+ (GBoxedFreeFunc)cell_span_info_copy);
+ }
+ return t;
+}
+
/**
* cellspan_is_empty :
*
diff --git a/src/cellspan.h b/src/cellspan.h
index 8a26992..980bd66 100644
--- a/src/cellspan.h
+++ b/src/cellspan.h
@@ -17,6 +17,7 @@ void cell_calc_span (GnmCell const *cell, int *col1, int *col2);
void cell_register_span (GnmCell const *cell, int left, int right);
void cell_unregister_span (GnmCell const *cell);
+GType cell_span_info_get_type (void);
CellSpanInfo const *row_span_get (ColRowInfo const *ri, int col);
void row_destroy_span (ColRowInfo *ri);
void row_calc_spans (ColRowInfo *ri, int row, Sheet const *sheet);
diff --git a/src/clipboard.c b/src/clipboard.c
index e68ae17..52a9f15 100644
--- a/src/clipboard.c
+++ b/src/clipboard.c
@@ -61,6 +61,49 @@ static GOMemChunk *cell_copy_pool;
#define CHUNK_FREE(p,v) g_free ((v))
#endif
+/* creating a boxed type for GnmCellCopy (needed by introspection) */
+static gpointer
+pointer_dup (gpointer *cc)
+{
+ return cc;
+}
+
+GType
+gnm_cell_copy_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmCellCopy",
+ (GBoxedCopyFunc)pointer_dup,
+ (GBoxedFreeFunc)pointer_dup);
+ }
+ return t;
+}
+
+/* creating a boxed type for GnmPasteTarget (needed by introspection) */
+
+static GnmPasteTarget *
+gnm_paste_target_copy (GnmPasteTarget *pt)
+{
+ GnmPasteTarget *res = g_new (GnmPasteTarget, 1);
+ memcpy (res, pt, sizeof (GnmPasteTarget));
+ return res;
+}
+
+GType
+gnm_paste_target_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmPasteTarget",
+ (GBoxedCopyFunc)gnm_paste_target_copy,
+ (GBoxedFreeFunc)g_free);
+ }
+ return t;
+}
+
static gboolean
cell_has_expr_or_number_or_blank (GnmCell const * cell)
{
@@ -647,7 +690,7 @@ clipboard_copy_range (Sheet *sheet, GnmRange const *r)
g_return_val_if_fail (IS_SHEET (sheet), NULL);
g_return_val_if_fail (range_is_sane (r), NULL);
- cr = cellregion_new (sheet);
+ cr = gnm_cell_region_new (sheet);
cr->base = r->start;
cr->cols = range_width (r);
cr->rows = range_height (r);
@@ -693,7 +736,13 @@ cb_clipboard_copy_range_undo (GnmCellRegion *cr, GnmSheetRange *sr,
cc);
}
-
+/**
+ * clipboard_copy_range_undo:
+ * @sheet: #Sheet
+ * @r: #GnmRange
+ *
+ * Returns: (transfer full):
+ **/
GOUndo *
clipboard_copy_range_undo (Sheet *sheet, GnmRange const *r)
{
@@ -709,7 +758,7 @@ clipboard_copy_range_undo (Sheet *sheet, GnmRange const *r)
/**
* clipboard_copy_obj:
* @sheet: #Sheet
- * @objects: #GSList
+ * @objects: (element-type SheetObject): #GSList
*
* Returns a cell region with copies of objects in list. Caller is responsible
* for cellregion_unref-ing the result.
@@ -729,7 +778,7 @@ clipboard_copy_obj (Sheet *sheet, GSList *objects)
g_return_val_if_fail (IS_SHEET (sheet), NULL);
g_return_val_if_fail (objects != NULL, NULL);
- cr = cellregion_new (sheet);
+ cr = gnm_cell_region_new (sheet);
for (ptr = objects ; ptr != NULL ; ptr = ptr->next)
if (NULL != (so = sheet_object_dup (ptr->data))) {
anchor = sheet_object_get_anchor (so);
@@ -770,13 +819,13 @@ paste_target_init (GnmPasteTarget *pt, Sheet *sheet, GnmRange const *r, int flag
}
/**
- * cellregion_new :
+ * gnm_cell_region_new :
* @origin_sheet : optionally NULL.
*
* A convenience routine to create CellRegions and init the flags nicely.
*/
GnmCellRegion *
-cellregion_new (Sheet *origin_sheet)
+gnm_cell_region_new (Sheet *origin_sheet)
{
GnmCellRegion *cr = g_new0 (GnmCellRegion, 1);
cr->origin_sheet = origin_sheet;
@@ -844,6 +893,19 @@ cellregion_unref (GnmCellRegion *cr)
g_free (cr);
}
+GType
+gnm_cell_region_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmCellRegion",
+ (GBoxedCopyFunc)cellregion_ref,
+ (GBoxedFreeFunc)cellregion_unref);
+ }
+ return t;
+}
+
static GnmCellCopy *
cellregion_get_content (GnmCellRegion const *cr, int col, int row)
{
diff --git a/src/clipboard.h b/src/clipboard.h
index 00954da..a026a95 100644
--- a/src/clipboard.h
+++ b/src/clipboard.h
@@ -58,6 +58,8 @@ typedef struct {
GnmExprTop const *texpr;
} GnmCellCopy;
+GType gnm_cell_copy_get_type (void);
+
struct _GnmCellRegion {
Sheet *origin_sheet; /* can be NULL */
const GODateConventions *date_conv; /* can be NULL */
@@ -79,6 +81,8 @@ struct _GnmPasteTarget {
int paste_flags;
};
+GType gnm_paste_target_get_type (void);
+
GnmCellRegion *clipboard_copy_range (Sheet *sheet, GnmRange const *r);
GOUndo *clipboard_copy_range_undo (Sheet *sheet, GnmRange const *r);
GnmCellRegion *clipboard_copy_obj (Sheet *sheet, GSList *objects);
@@ -89,7 +93,8 @@ GnmPasteTarget *paste_target_init (GnmPasteTarget *pt,
Sheet *sheet, GnmRange const *r,
int flags);
-GnmCellRegion *cellregion_new (Sheet *origin_sheet);
+GType gnm_cell_region_get_type (void);
+GnmCellRegion *gnm_cell_region_new (Sheet *origin_sheet);
void cellregion_ref (GnmCellRegion *cr);
void cellregion_unref (GnmCellRegion *cr);
GString *cellregion_to_string (GnmCellRegion const *cr,
diff --git a/src/collect.c b/src/collect.c
index 11a4a98..27862dd 100644
--- a/src/collect.c
+++ b/src/collect.c
@@ -561,7 +561,17 @@ collect_floats_value (GnmValue const *val, GnmEvalPos const *ep,
}
/* ------------------------------------------------------------------------- */
-/* Like collect_floats_value, but keeps info on missing values */
+/**
+ * collect_floats_value_with_info:
+ * @val: #GnmValue
+ * @ep: #GnmEvalPos
+ * @flags: #CollectFlags
+ * @n:
+ * @info: (element-type void):
+ * @error:
+ *
+ * Like collect_floats_value, but keeps info on missing values
+ **/
gnm_float *
collect_floats_value_with_info (GnmValue const *val, GnmEvalPos const *ep,
@@ -584,6 +594,17 @@ collect_floats_value_with_info (GnmValue const *val, GnmEvalPos const *ep,
/* ------------------------------------------------------------------------- */
+/**
+ * float_range_function:
+ * @arcg:
+ * @argv:
+ * @ei:
+ * @func: (scope call):
+ * @flags:
+ * @func_error:
+ *
+ * Returns: (transfer full):
+ **/
GnmValue *
float_range_function (int argc, GnmExprConstPtr const *argv,
GnmFuncEvalInfo *ei,
@@ -612,16 +633,18 @@ float_range_function (int argc, GnmExprConstPtr const *argv,
/* ------------------------------------------------------------------------- */
-/*
- * gnm_slist_sort_merge:
- * @list_1: a sorted list of ints with no duplicates
- * @list_2: another one
+/**
+ * gnm_slist_sort_merge:
+ * @list_1: (element-type void): a sorted list of ints with no duplicates
+ * @list_2: (element-type void): another one
*
- * gnm_slist_sort_merge returns a new sorted list with all elements
- * from both @list_1 and @list_2. Duplicates are destroyed. @list1 and @list2
- * are not anymore valid afterwards since their elements are in the new list
- * or have been destroyed, in case of duplicates.
- */
+ * gnm_slist_sort_merge returns a new sorted list with all elements
+ * from both @list_1 and @list_2. Duplicates are destroyed. @list1 and @list2
+ * are not anymore valid afterwards since their elements are in the new list
+ * or have been destroyed, in case of duplicates.
+ *
+ * Returns: (element-type void) (transfer container): the new list.
+ **/
GSList *
gnm_slist_sort_merge (GSList *l1,
@@ -653,12 +676,12 @@ gnm_slist_sort_merge (GSList *l1,
}
-/*
- * gnm_strip_missing:
- * @data:
- * @missing:
+/**
+ * gnm_strip_missing:
+ * @data:
+ * @missing: (element-type void):
*
- */
+ **/
void
gnm_strip_missing (gnm_float *data, int *n, GSList *missing)
{
@@ -835,6 +858,17 @@ collect_float_pairs (GnmValue const *vx, GnmValue const *vy,
}
}
+/**
+ * float_range_function2d:
+ * @arcg:
+ * @argv:
+ * @ei:
+ * @func: (scope call):
+ * @flags:
+ * @func_error:
+ *
+ * Returns: (transfer full):
+ **/
GnmValue *
float_range_function2d (GnmValue const *val0, GnmValue const *val1,
GnmFuncEvalInfo *ei,
@@ -869,6 +903,17 @@ float_range_function2d (GnmValue const *val0, GnmValue const *val1,
return res;
}
+/**
+ * float_range_function2:
+ * @arcg:
+ * @argv:
+ * @ei:
+ * @func: (scope call):
+ * @flags:
+ * @func_error:
+ *
+ * Returns: (transfer full):
+ **/
GnmValue *
float_range_function2 (GnmValue const *val0, GnmValue const *val1,
GnmFuncEvalInfo *ei,
@@ -961,6 +1006,17 @@ collect_strings (int argc, GnmExprConstPtr const *argv,
return cl.data;
}
+/**
+ * string_range_function:
+ * @argc:
+ * @argv:
+ * @ei:
+ * @func: (scope call):
+ * @flags:
+ * @func_error:
+ *
+ * Returns: (transfer full):
+ **/
GnmValue *
string_range_function (int argc, GnmExprConstPtr const *argv,
GnmFuncEvalInfo *ei,
diff --git a/src/colrow.c b/src/colrow.c
index 06e9fe1..9763249 100644
--- a/src/colrow.c
+++ b/src/colrow.c
@@ -165,7 +165,7 @@ colrow_copy (ColRowInfo *dst, ColRowInfo const *src)
}
ColRowInfo *
-colrow_new (void)
+col_row_info_new (void)
{
return g_slice_new (ColRowInfo);
}
@@ -178,13 +178,13 @@ colrow_free (ColRowInfo *cri)
/**
* colrow_foreach:
- * @sheet the sheet
- * @infos The Row or Column collection.
- * @start start position (inclusive)
- * @end stop column (inclusive)
- * @callback A callback function which should return TRUE to stop
+ * @sheet: the sheet
+ * @infos: The Row or Column collection.
+ * @start: start position (inclusive)
+ * @end : stop column (inclusive)
+ * @callback: (scope call): A callback function which should return TRUE to stop
* the iteration.
- * @user_data A bagage pointer.
+ * @user_data: A bagage pointer.
*
* Iterates through the existing rows or columns within the range supplied.
* Currently only support left -> right iteration. If a callback returns
@@ -247,6 +247,12 @@ colrow_vis_list_length (ColRowVisList *list)
return count;
}
+/**
+ * colrow_state_group_destroy:
+ * @set: (transfer full): the group to destroy.
+ *
+ * Returns: (transfer none): %NULL.
+ **/
ColRowStateGroup *
colrow_state_group_destroy (ColRowStateGroup *group)
{
@@ -306,10 +312,15 @@ colrow_index_list_to_string (ColRowIndexList *list, gboolean is_cols, gboolean *
}
/**
- * colrow_get_index_list :
+ * colrow_get_index_list:
+ * @first:
+ * @last:
+ * @list: (transfer full):
*
* Build an ordered list of pairs doing intelligent merging
* of overlapping regions.
+ *
+ * Returns: (transfer full): @list.
*/
ColRowIndexList *
colrow_get_index_list (int first, int last, ColRowIndexList *list)
@@ -343,6 +354,12 @@ colrow_get_index_list (int first, int last, ColRowIndexList *list)
return list;
}
+/**
+ * colrow_index_list_copy:
+ * @list: #ColRowIndexList
+ *
+ * Returns: (transfer full):
+ **/
ColRowIndexList *
colrow_index_list_copy (ColRowIndexList *list)
{
@@ -371,6 +388,12 @@ colrow_set_single_state (ColRowState *state,
state->visible = info->visible;
}
+/**
+ * colrow_state_list_destroy:
+ * @list: (transfer full): the list to destroy.
+ *
+ * Returns: (transfer none): %NULL.
+ **/
ColRowStateList *
colrow_state_list_destroy (ColRowStateList *list)
{
@@ -378,6 +401,15 @@ colrow_state_list_destroy (ColRowStateList *list)
return NULL;
}
+/**
+ * colrow_get_states:
+ * @sheet: #Sheet
+ * @is_cols: %TRUE if columns.
+ * @first:
+ * @last:
+ *
+ * Returns: (transfer full):
+ **/
ColRowStateList *
colrow_get_states (Sheet *sheet, gboolean is_cols, int first, int last)
{
@@ -457,6 +489,15 @@ cb_clear_variable_width_content (GnmCellIter const *iter,
return NULL;
}
+/**
+ * colrow_get_sizes:
+ * @sheet: #Sheet
+ * @is_cols: %TRUE if columns.
+ * @src:
+ * @new_size:
+ *
+ * Returns: (transfer full):
+ **/
ColRowStateGroup *
colrow_get_sizes (Sheet *sheet, gboolean is_cols,
ColRowIndexList *src, int new_size)
@@ -488,6 +529,17 @@ colrow_get_sizes (Sheet *sheet, gboolean is_cols,
return res;
}
+/**
+ * colrow_set_sizes:
+ * @sheet: #Sheet
+ * @is_cols:
+ * @src:
+ * @new_size:
+ * @from:
+ * @to:
+ *
+ * Returns: (transfer full):
+ **/
ColRowStateGroup *
colrow_set_sizes (Sheet *sheet, gboolean is_cols,
ColRowIndexList *src, int new_size, int from, int to)
@@ -933,6 +985,16 @@ colrow_visibility (Sheet const *sheet, ColRowVisiblity * const dat,
}
}
+/**
+ * colrow_get_outline_toggle:
+ * @sheet: #Sheet
+ * @is_cols:
+ * @visible:
+ * @first:
+ * @last:
+ *
+ * Returns: (transfer full):
+ **/
ColRowVisList *
colrow_get_outline_toggle (Sheet const *sheet, gboolean is_cols, gboolean visible,
int first, int last)
@@ -963,16 +1025,18 @@ cb_colrow_visibility (SheetView *sv, GnmRange const *r, gpointer closure)
}
/**
- * colrow_get_visiblity_toggle :
- * @sheet : The sheet whose selection we are interested in.
+ * colrow_get_visiblity_toggle:
+ * @sv: The sheet view whose selection we are interested in.
* @is_cols: A flag indicating whether this it is a column or a row.
- * @is_visible: Should we unhide or hide the cols/rows.
+ * @visible: Should we unhide or hide the cols/rows.
*
* Searches the selection list and generates a list of index,count
* pairs of row/col ranges that need to be hidden or unhiden.
*
* NOTE : leave sheet non-const until we have a const version of
* sv_selection_apply.
+ *
+ * Returns: (transfer full): the list.
*/
ColRowVisList *
colrow_get_visiblity_toggle (SheetView *sv, gboolean is_cols,
diff --git a/src/colrow.h b/src/colrow.h
index bdb04de..1cedcb3 100644
--- a/src/colrow.h
+++ b/src/colrow.h
@@ -79,7 +79,7 @@ gboolean colrow_is_default (ColRowInfo const *cri);
gboolean colrow_is_empty (ColRowInfo const *cri);
gboolean colrow_equal (ColRowInfo const *a, ColRowInfo const *b);
void colrow_copy (ColRowInfo *dst, ColRowInfo const *src);
-ColRowInfo *colrow_new (void);
+ColRowInfo *col_row_info_new (void);
void colrow_free (ColRowInfo *cri);
typedef struct {
diff --git a/src/commands.c b/src/commands.c
index 55e0c50..a9ec82c 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -233,6 +233,7 @@ cmd_dao_is_locked_effective (data_analysis_output_t *dao,
}
/**
+ * cmd_selection_is_locked_effective: (skip)
* checks whether the selection is effectively locked
*
* static gboolean cmd_selection_is_locked_effective
@@ -4554,6 +4555,13 @@ cmd_zoom_finalize (GObject *cmd)
gnm_command_finalize (cmd);
}
+/**
+ * cmd_zoom:
+ * @wbc: #WorkbookControl
+ * @sheets: (element-type Sheet) (transfer container):
+ * @factor:
+ *
+ **/
gboolean
cmd_zoom (WorkbookControl *wbc, GSList *sheets, double factor)
{
@@ -4663,8 +4671,16 @@ cmd_objects_store_location (SheetObject *so, GArray *location)
g_array_append_val (location, loc);
}
-/* Absorbs the list, adding references to the contents */
-gboolean
+/**
+ * cmd_objects_delete:
+ * @wbc: #WorkbookControl
+ * @objects: (element-type SheetObject) (transfer container): the objects to
+ * delete.
+ * @name:
+ *
+ * Absorbs the list, adding references to the contents.
+ **/
+ gboolean
cmd_objects_delete (WorkbookControl *wbc, GSList *objects,
char const *name)
{
@@ -4691,6 +4707,15 @@ cmd_objects_delete (WorkbookControl *wbc, GSList *objects,
/******************************************************************/
+/**
+ * cmd_objects_move:
+ * @wbc: #WorkbookControl
+ * @objects: (element-type SheetObject) (transfer container): the objects to move.
+ * @anchors: (element-type SheetObjectAnchor) (transfer full): the anchors for the objects.
+ * @objects_created:
+ * @name:
+ *
+ **/
gboolean
cmd_objects_move (WorkbookControl *wbc, GSList *objects, GSList *anchors,
gboolean objects_created, char const *name)
@@ -4996,6 +5021,14 @@ cmd_resize_sheets_finalize (GObject *cmd)
gnm_command_finalize (cmd);
}
+/**
+ * cmd_resize_sheets:
+ * @wbc: #WorkbookControl
+ * @sheets: (element-type Sheet) (transfer container): the sheets to resize.
+ * @cols: new columns number.
+ * @rows: new rows number.
+ *
+ **/
gboolean
cmd_resize_sheets (WorkbookControl *wbc,
GSList *sheets,
@@ -5376,10 +5409,11 @@ cmd_analysis_tool_finalize (GObject *cmd)
gnm_command_finalize (cmd);
}
-/*
+/**
+ * cmd_analysis_tool: (skip)
* Note: this takes ownership of specs and dao if and if only the command
* succeeds.
- */
+ **/
gboolean
cmd_analysis_tool (WorkbookControl *wbc, G_GNUC_UNUSED Sheet *sheet,
data_analysis_output_t *dao, gpointer specs,
@@ -5568,6 +5602,15 @@ cmd_merge_data_finalize (GObject *cmd)
gnm_command_finalize (cmd);
}
+/**
+ * cmd_merge_data:
+ * @wbc: #WorkbookControl
+ * @sheet: #Sheet
+ * @merge_zone: (transfer full): #GnmValue
+ * @merge_fields: (element-type GnmRange) (transfer full):
+ * @merge_data: (element-type GnmRange) (transfer full):
+ *
+ **/
gboolean
cmd_merge_data (WorkbookControl *wbc, Sheet *sheet,
GnmValue *merge_zone, GSList *merge_fields, GSList *merge_data)
@@ -5665,6 +5708,13 @@ cmd_change_summary_finalize (GObject *cmd)
gnm_command_finalize (cmd);
}
+/**
+ * cmd_change_meta_data:
+ * @wbc: #WorkbookControl
+ * @changes: (element-type GsfDocMetaData) (transfer full): the changed metadata.
+ * @removed: (element-type GsfDocMetaData) (transfer full): the removed metadata.
+ *
+ **/
gboolean
cmd_change_meta_data (WorkbookControl *wbc, GSList *changes, GSList *removed)
{
diff --git a/src/complex.h b/src/complex.h
index 767758f..bbed098 100644
--- a/src/complex.h
+++ b/src/complex.h
@@ -9,7 +9,7 @@
G_BEGIN_DECLS
#ifdef GNM_WITH_LONG_DOUBLE
-#define complex_t go_complexl
+#define complex_t GOComplexl
#define complex_init go_complex_initl
#define complex_add go_complex_addl
#define complex_sub go_complex_subl
@@ -31,7 +31,7 @@ G_BEGIN_DECLS
#define complex_to_polar go_complex_to_polarl
#define complex_from_polar go_complex_from_polarl
#else
-#define complex_t go_complex
+#define complex_t GOComplex
#define complex_init go_complex_init
#define complex_add go_complex_add
#define complex_sub go_complex_sub
diff --git a/src/consolidate.c b/src/consolidate.c
index f8353ef..7cbed38 100644
--- a/src/consolidate.c
+++ b/src/consolidate.c
@@ -109,6 +109,7 @@ consolidate_new (void)
cs->fd = NULL;
cs->src = NULL;
cs->mode = CONSOLIDATE_PUT_VALUES;
+ cs->ref_count = 1;
return cs;
}
@@ -120,6 +121,8 @@ consolidate_free (GnmConsolidate *cs, gboolean content_only)
g_return_if_fail (cs != NULL);
+ if (cs->ref_count-- > 1)
+ return;
if (cs->fd) {
gnm_func_unref (cs->fd);
cs->fd = NULL;
@@ -134,6 +137,33 @@ consolidate_free (GnmConsolidate *cs, gboolean content_only)
g_free (cs);
}
+static GnmConsolidate *
+gnm_consolidate_ref (GnmConsolidate *cs)
+{
+ cs->ref_count++;
+}
+
+static GnmConsolidate *
+gnm_consolidate_unref (GnmConsolidate *cs)
+{
+ cs->ref_count--;
+ if (cs->ref_count == 0)
+ consolidate_free (cs, TRUE);
+}
+
+GType
+gnm_consolidate_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmConsolidate",
+ (GBoxedCopyFunc)gnm_consolidate_ref,
+ (GBoxedFreeFunc)gnm_consolidate_unref);
+ }
+ return t;
+}
+
void
consolidate_set_function (GnmConsolidate *cs, GnmFunc *fd)
{
diff --git a/src/consolidate.h b/src/consolidate.h
index c80bc28..0e35b5e 100644
--- a/src/consolidate.h
+++ b/src/consolidate.h
@@ -37,8 +37,12 @@ struct _GnmConsolidate {
GSList *src;
GnmConsolidateMode mode;
+
+ /* <private> */
+ unsigned ref_count; /* boxed type */
};
+GType gnm_consolidate_get_type (void);
GnmConsolidate *consolidate_new (void);
void consolidate_free (GnmConsolidate *cs, gboolean content_only);
diff --git a/src/dependent.c b/src/dependent.c
index c8c7571..b0a1286 100644
--- a/src/dependent.c
+++ b/src/dependent.c
@@ -1693,6 +1693,13 @@ cell_foreach_single_dep (Sheet const *sheet, int col, int row,
(*func) (dep, user););
}
+/**
+ * cell_foreach_dep:
+ * @cell: #GnmCell
+ * @func: (scope call):
+ * @user: user data.
+ *
+ **/
void
cell_foreach_dep (GnmCell const *cell, GnmDepFunc func, gpointer user)
{
@@ -1898,8 +1905,8 @@ dependents_unrelocate (GSList *info)
}
/**
- * dependents_link :
- * @deps : An slist of dependents.
+ * dependents_link:
+ * @deps: (element-type GnmDependent): An slist of dependents.
*
* link a list of dependents. (The list used to get freed, but is not
* freed anymore.)
@@ -2021,7 +2028,7 @@ names_referencing_sheet (Sheet *sheet)
* @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
+ * Returns: (transfer full): a list of the locations and expressions that were changed outside of
* the region.
**/
GOUndo *
@@ -2760,6 +2767,12 @@ dynamic_dep_free (DynamicDep *dyn)
g_free (dyn);
}
+/**
+ * gnm_dep_container_new: (skip)
+ * @sheet: #Sheet
+ *
+ * Returns: (transfer full):
+ **/
GnmDepContainer *
gnm_dep_container_new (Sheet *sheet)
{
diff --git a/src/dialogs/dialog-analysis-tools.c b/src/dialogs/dialog-analysis-tools.c
index 1f8881e..7e50e24 100644
--- a/src/dialogs/dialog-analysis-tools.c
+++ b/src/dialogs/dialog-analysis-tools.c
@@ -389,7 +389,7 @@ dialog_tool_init (GenericToolState *state,
state->help_link = help_file;
state->state_destroy = NULL;
- state->gui = gnm_gtk_builder_new (gui_name, NULL, GO_CMD_CONTEXT (wbcg));
+ state->gui = gnm_gtk_builder_load (gui_name, NULL, GO_CMD_CONTEXT (wbcg));
if (state->gui == NULL)
goto dialog_tool_init_error;
diff --git a/src/dialogs/dialog-autofilter.c b/src/dialogs/dialog-autofilter.c
index af9cda3..407e376 100644
--- a/src/dialogs/dialog-autofilter.c
+++ b/src/dialogs/dialog-autofilter.c
@@ -371,7 +371,7 @@ dialog_auto_filter_expression (WBCGtk *wbcg,
if (gnumeric_dialog_raise_if_exists
(wbcg, DIALOG_KEY_EXPRESSION))
return;
- gui = gnm_gtk_builder_new ("autofilter-expression.ui",
+ gui = gnm_gtk_builder_load ("autofilter-expression.ui",
NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
@@ -471,7 +471,7 @@ dialog_auto_filter (WBCGtk *wbcg,
if (gnumeric_dialog_raise_if_exists (wbcg, DIALOG_KEY))
return;
- gui = gnm_gtk_builder_new ("autofilter-top10.ui",
+ gui = gnm_gtk_builder_load ("autofilter-top10.ui",
NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-autoformat.c b/src/dialogs/dialog-autoformat.c
index 979acbe..48504e8 100644
--- a/src/dialogs/dialog-autoformat.c
+++ b/src/dialogs/dialog-autoformat.c
@@ -567,7 +567,7 @@ dialog_autoformat (WBCGtk *wbcg)
GtkUIManager *ui_manager;
GtkActionGroup *action_group;
- gui = gnm_gtk_builder_new ("autoformat.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("autoformat.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-autosave.c b/src/dialogs/dialog-autosave.c
index 17eedd9..05061a7 100644
--- a/src/dialogs/dialog-autosave.c
+++ b/src/dialogs/dialog-autosave.c
@@ -124,7 +124,7 @@ dialog_autosave (WBCGtk *wbcg)
if (gnumeric_dialog_raise_if_exists (wbcg, AUTOSAVE_KEY))
return;
- gui = gnm_gtk_builder_new ("autosave.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("autosave.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-cell-comment.c b/src/dialogs/dialog-cell-comment.c
index 2b7f866..a8fca4a 100644
--- a/src/dialogs/dialog-cell-comment.c
+++ b/src/dialogs/dialog-cell-comment.c
@@ -108,7 +108,7 @@ dialog_cell_comment (WBCGtk *wbcg, Sheet *sheet, GnmCellPos const *pos)
if (gnumeric_dialog_raise_if_exists (wbcg, COMMENT_DIALOG_KEY))
return;
- gui = gnm_gtk_builder_new ("cell-comment.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("cell-comment.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-cell-format-cond.c b/src/dialogs/dialog-cell-format-cond.c
index aaf32ec..24312f8 100644
--- a/src/dialogs/dialog-cell-format-cond.c
+++ b/src/dialogs/dialog-cell-format-cond.c
@@ -1258,7 +1258,7 @@ dialog_cell_format_cond (WBCGtk *wbcg)
g_return_if_fail (wbcg != NULL);
- gui = gnm_gtk_builder_new ("cell-format-cond.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("cell-format-cond.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-cell-format.c b/src/dialogs/dialog-cell-format.c
index 1a82385..c7d78c8 100644
--- a/src/dialogs/dialog-cell-format.c
+++ b/src/dialogs/dialog-cell-format.c
@@ -2480,7 +2480,7 @@ dialog_cell_format_init (WBCGtk *wbcg)
GnmCell *edit_cell;
FormatState *state;
- gui = gnm_gtk_builder_new ("cell-format.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("cell-format.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return NULL;
diff --git a/src/dialogs/dialog-cell-sort.c b/src/dialogs/dialog-cell-sort.c
index 7867955..1e629e3 100644
--- a/src/dialogs/dialog-cell-sort.c
+++ b/src/dialogs/dialog-cell-sort.c
@@ -1157,7 +1157,7 @@ dialog_cell_sort (WBCGtk *wbcg)
if (gnumeric_dialog_raise_if_exists (wbcg, CELL_SORT_KEY))
return;
- gui = gnm_gtk_builder_new ("cell-sort.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("cell-sort.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-col-row.c b/src/dialogs/dialog-col-row.c
index 078fa32..6aa9991 100644
--- a/src/dialogs/dialog-col-row.c
+++ b/src/dialogs/dialog-col-row.c
@@ -87,7 +87,7 @@ dialog_col_row (WBCGtk *wbcg, char const *operation,
if (gnumeric_dialog_raise_if_exists (wbcg, COL_ROW_DIALOG_KEY))
return;
- gui = gnm_gtk_builder_new ("colrow.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("colrow.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-col-width.c b/src/dialogs/dialog-col-width.c
index 533d49c..cef5650 100644
--- a/src/dialogs/dialog-col-width.c
+++ b/src/dialogs/dialog-col-width.c
@@ -246,7 +246,7 @@ dialog_col_width (WBCGtk *wbcg, gboolean use_default)
if (gnumeric_dialog_raise_if_exists (wbcg, COL_WIDTH_DIALOG_KEY))
return;
- gui = gnm_gtk_builder_new ("col-width.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("col-width.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-data-slicer.c b/src/dialogs/dialog-data-slicer.c
index 0a3aed6..b4aab56 100644
--- a/src/dialogs/dialog-data-slicer.c
+++ b/src/dialogs/dialog-data-slicer.c
@@ -253,7 +253,7 @@ dialog_data_slicer (WBCGtk *wbcg, gboolean create)
if (gnumeric_dialog_raise_if_exists (wbcg, DIALOG_KEY))
return;
- gui = gnm_gtk_builder_new ("data-slicer.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("data-slicer.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (NULL == gui)
return;
diff --git a/src/dialogs/dialog-data-table.c b/src/dialogs/dialog-data-table.c
index ed3fc34..4e98c4e 100644
--- a/src/dialogs/dialog-data-table.c
+++ b/src/dialogs/dialog-data-table.c
@@ -92,7 +92,7 @@ cb_data_table_response (GtkWidget *dialog, gint response_id, GnmDialogDataTable
static gboolean
data_table_init (GnmDialogDataTable *state, WBCGtk *wbcg)
{
- state->gui = gnm_gtk_builder_new ("data-table.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ state->gui = gnm_gtk_builder_load ("data-table.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (state->gui == NULL)
return TRUE;
diff --git a/src/dialogs/dialog-define-names.c b/src/dialogs/dialog-define-names.c
index bb33d5f..d2f5251 100644
--- a/src/dialogs/dialog-define-names.c
+++ b/src/dialogs/dialog-define-names.c
@@ -1060,7 +1060,7 @@ name_guru_init (NameGuruState *state, WBCGtk *wbcg, gboolean is_paste_dialog)
state->is_paste_dialog = is_paste_dialog;
state->has_pasted = FALSE;
- state->gui = gnm_gtk_builder_new ("define-name.ui", NULL,
+ state->gui = gnm_gtk_builder_load ("define-name.ui", NULL,
GO_CMD_CONTEXT (wbcg));
if (state->gui == NULL)
return TRUE;
diff --git a/src/dialogs/dialog-delete-cells.c b/src/dialogs/dialog-delete-cells.c
index 90be5eb..f248571 100644
--- a/src/dialogs/dialog-delete-cells.c
+++ b/src/dialogs/dialog-delete-cells.c
@@ -137,7 +137,7 @@ dialog_delete_cells (WBCGtk *wbcg)
if (gnumeric_dialog_raise_if_exists (wbcg, DELETE_CELL_DIALOG_KEY))
return;
- gui = gnm_gtk_builder_new ("delete-cells.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("delete-cells.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-doc-metadata.c b/src/dialogs/dialog-doc-metadata.c
index 12d74f1..1c23bcb 100644
--- a/src/dialogs/dialog-doc-metadata.c
+++ b/src/dialogs/dialog-doc-metadata.c
@@ -2318,7 +2318,7 @@ dialog_doc_metadata_init (DialogDocMetaData *state,
g_return_val_if_fail (state->metadata != NULL, TRUE);
- state->gui = gnm_gtk_builder_new ("doc-meta-data.ui", NULL,
+ state->gui = gnm_gtk_builder_load ("doc-meta-data.ui", NULL,
GO_CMD_CONTEXT (wbcg));
if (state->gui == NULL)
diff --git a/src/dialogs/dialog-formula-guru.c b/src/dialogs/dialog-formula-guru.c
index 74661ff..55bef59 100644
--- a/src/dialogs/dialog-formula-guru.c
+++ b/src/dialogs/dialog-formula-guru.c
@@ -1038,7 +1038,7 @@ dialog_formula_guru (WBCGtk *wbcg, GnmFunc *fd)
}
/* Get the dialog and check for errors */
- gui = gnm_gtk_builder_new ("formula-guru.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("formula-guru.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-function-select.c b/src/dialogs/dialog-function-select.c
index 3e3dd75..03ea620 100644
--- a/src/dialogs/dialog-function-select.c
+++ b/src/dialogs/dialog-function-select.c
@@ -1373,7 +1373,7 @@ dialog_function_select_full (WBCGtk *wbcg, char const *guru_key,
if (gnumeric_dialog_raise_if_exists (wbcg, key))
return;
- gui = gnm_gtk_builder_new ("function-select.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("function-select.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-goal-seek.c b/src/dialogs/dialog-goal-seek.c
index 4670211..4c1dadc 100644
--- a/src/dialogs/dialog-goal-seek.c
+++ b/src/dialogs/dialog-goal-seek.c
@@ -684,7 +684,7 @@ dialog_goal_seek (WBCGtk *wbcg, Sheet *sheet)
/* Only pop up one copy per workbook */
if (gnumeric_dialog_raise_if_exists (wbcg, GOALSEEK_KEY))
return;
- gui = gnm_gtk_builder_new ("goalseek.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("goalseek.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-goto-cell.c b/src/dialogs/dialog-goto-cell.c
index 66b144f..e362ca1 100644
--- a/src/dialogs/dialog-goto-cell.c
+++ b/src/dialogs/dialog-goto-cell.c
@@ -445,7 +445,7 @@ dialog_goto_cell (WBCGtk *wbcg)
if (gnumeric_dialog_raise_if_exists (wbcg, GOTO_KEY))
return;
- gui = gnm_gtk_builder_new ("goto.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("goto.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-hyperlink.c b/src/dialogs/dialog-hyperlink.c
index 8611ca0..396874a 100644
--- a/src/dialogs/dialog-hyperlink.c
+++ b/src/dialogs/dialog-hyperlink.c
@@ -581,7 +581,7 @@ dialog_hyperlink (WBCGtk *wbcg, SheetControl *sc)
if (gnumeric_dialog_raise_if_exists (wbcg, DIALOG_KEY))
return;
- gui = gnm_gtk_builder_new ("hyperlink.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("hyperlink.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-insert-cells.c b/src/dialogs/dialog-insert-cells.c
index 898d646..ac4e806 100644
--- a/src/dialogs/dialog-insert-cells.c
+++ b/src/dialogs/dialog-insert-cells.c
@@ -139,7 +139,7 @@ dialog_insert_cells (WBCGtk *wbcg)
if (gnumeric_dialog_raise_if_exists (wbcg, INSERT_CELL_DIALOG_KEY))
return;
- gui = gnm_gtk_builder_new ("insert-cells.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("insert-cells.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-merge.c b/src/dialogs/dialog-merge.c
index 22c25ac..82ae937 100644
--- a/src/dialogs/dialog-merge.c
+++ b/src/dialogs/dialog-merge.c
@@ -322,7 +322,7 @@ dialog_merge (WBCGtk *wbcg)
if (gnumeric_dialog_raise_if_exists (wbcg, MERGE_KEY))
return;
- gui = gnm_gtk_builder_new ("merge.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("merge.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-paste-special.c b/src/dialogs/dialog-paste-special.c
index c7414d0..8068cc5 100644
--- a/src/dialogs/dialog-paste-special.c
+++ b/src/dialogs/dialog-paste-special.c
@@ -240,7 +240,7 @@ dialog_paste_special (WBCGtk *wbcg)
if (gnumeric_dialog_raise_if_exists (wbcg, GNM_PASTE_SPECIAL_KEY))
return;
- gui = gnm_gtk_builder_new ("paste-special.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("paste-special.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-plugin-manager.c b/src/dialogs/dialog-plugin-manager.c
index 3e54cc8..750bf42 100644
--- a/src/dialogs/dialog-plugin-manager.c
+++ b/src/dialogs/dialog-plugin-manager.c
@@ -655,7 +655,7 @@ dialog_plugin_manager (WBCGtk *wbcg)
if (gnumeric_dialog_raise_if_exists (wbcg, PLUGIN_MANAGER_DIALOG_KEY))
return;
- gui = gnm_gtk_builder_new ("plugin-manager.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("plugin-manager.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-preferences.c b/src/dialogs/dialog-preferences.c
index 9144318..958eaea 100644
--- a/src/dialogs/dialog-preferences.c
+++ b/src/dialogs/dialog-preferences.c
@@ -1312,7 +1312,7 @@ dialog_preferences (WBCGtk *wbcg, gchar const *page)
return;
}
- gui = gnm_gtk_builder_new ("preferences.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("preferences.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-printer-setup.c b/src/dialogs/dialog-printer-setup.c
index c1e6313..8dc08f9 100644
--- a/src/dialogs/dialog-printer-setup.c
+++ b/src/dialogs/dialog-printer-setup.c
@@ -1722,7 +1722,7 @@ do_hf_customize (gboolean header, PrinterSetupState *state)
return;
}
- gui = gnm_gtk_builder_new ("hf-config.ui", NULL, GO_CMD_CONTEXT (state->wbcg));
+ gui = gnm_gtk_builder_load ("hf-config.ui", NULL, GO_CMD_CONTEXT (state->wbcg));
if (gui == NULL)
return;
@@ -1883,7 +1883,7 @@ do_hf_dt_format_customize (gboolean date, HFCustomizeState *hf_state)
gint result;
char *result_string = NULL;
- gui = gnm_gtk_builder_new ("hf-dt-format.ui", NULL,
+ gui = gnm_gtk_builder_load ("hf-dt-format.ui", NULL,
GO_CMD_CONTEXT (hf_state->printer_setup_state->wbcg));
if (gui == NULL)
return NULL;
@@ -2826,7 +2826,7 @@ printer_setup_state_new (WBCGtk *wbcg, Sheet *sheet)
PrinterSetupState *state;
GtkBuilder *gui;
- gui = gnm_gtk_builder_new ("print.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("print.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return NULL;
diff --git a/src/dialogs/dialog-quit.c b/src/dialogs/dialog-quit.c
index 81f5489..4a7d6bf 100644
--- a/src/dialogs/dialog-quit.c
+++ b/src/dialogs/dialog-quit.c
@@ -249,7 +249,7 @@ show_quit_dialog (GList *dirty, WBCGtk *wbcg)
GObject *age_column;
int quitting_time = g_get_real_time () / 1000000;
- gui = gnm_gtk_builder_new ("quit.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("quit.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return FALSE;
diff --git a/src/dialogs/dialog-row-height.c b/src/dialogs/dialog-row-height.c
index 8f830ac..d79e952 100644
--- a/src/dialogs/dialog-row-height.c
+++ b/src/dialogs/dialog-row-height.c
@@ -255,7 +255,7 @@ dialog_row_height (WBCGtk *wbcg, gboolean use_default)
state->sv = wb_control_cur_sheet_view (WORKBOOK_CONTROL (wbcg));
state->sheet = sv_sheet (state->sv);
state->adjusting = FALSE;
- state->gui = gnm_gtk_builder_new ("row-height.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ state->gui = gnm_gtk_builder_load ("row-height.ui", NULL, GO_CMD_CONTEXT (wbcg));
g_return_if_fail (state->gui != NULL);
state->dialog = go_gtk_builder_get_widget (state->gui, "dialog");
diff --git a/src/dialogs/dialog-search-replace.c b/src/dialogs/dialog-search-replace.c
index f383342..ce04bb6 100644
--- a/src/dialogs/dialog-search-replace.c
+++ b/src/dialogs/dialog-search-replace.c
@@ -245,7 +245,7 @@ dialog_search_replace (WBCGtk *wbcg,
if (gnumeric_dialog_raise_if_exists (wbcg, SEARCH_REPLACE_KEY))
return;
- gui = gnm_gtk_builder_new ("search-replace.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("search-replace.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
@@ -369,7 +369,7 @@ dialog_search_replace_query (WBCGtk *wbcg,
g_return_val_if_fail (wbcg != NULL, 0);
- gui = gnm_gtk_builder_new ("search-replace.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("search-replace.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return 0;
diff --git a/src/dialogs/dialog-search.c b/src/dialogs/dialog-search.c
index cf0c894..e06e1a4 100644
--- a/src/dialogs/dialog-search.c
+++ b/src/dialogs/dialog-search.c
@@ -488,7 +488,7 @@ dialog_search (WBCGtk *wbcg)
return;
#endif
- gui = gnm_gtk_builder_new ("search.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("search.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-sheet-order.c b/src/dialogs/dialog-sheet-order.c
index 7e2aeb4..cd76759 100644
--- a/src/dialogs/dialog-sheet-order.c
+++ b/src/dialogs/dialog-sheet-order.c
@@ -1438,7 +1438,7 @@ dialog_sheet_order (WBCGtk *wbcg)
g_return_if_fail (wbcg != NULL);
- gui = gnm_gtk_builder_new ("sheet-order.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("sheet-order.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-sheet-resize.c b/src/dialogs/dialog-sheet-resize.c
index 4a7eeb0..c95ddcd 100644
--- a/src/dialogs/dialog-sheet-resize.c
+++ b/src/dialogs/dialog-sheet-resize.c
@@ -150,7 +150,7 @@ dialog_sheet_resize (WBCGtk *wbcg)
if (gnumeric_dialog_raise_if_exists (wbcg, RESIZE_DIALOG_KEY))
return;
- gui = gnm_gtk_builder_new ("sheet-resize.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("sheet-resize.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-sheetobject-size.c b/src/dialogs/dialog-sheetobject-size.c
index f374dfc..62dada1 100644
--- a/src/dialogs/dialog-sheetobject-size.c
+++ b/src/dialogs/dialog-sheetobject-size.c
@@ -314,7 +314,7 @@ dialog_so_size (WBCGtk *wbcg, GObject *so)
if (gnumeric_dialog_raise_if_exists (wbcg, SO_SIZE_DIALOG_KEY))
return;
- gui = gnm_gtk_builder_new ("sheetobject-size.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("sheetobject-size.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-so-list.c b/src/dialogs/dialog-so-list.c
index 210f53d..85c5701 100644
--- a/src/dialogs/dialog-so-list.c
+++ b/src/dialogs/dialog-so-list.c
@@ -104,7 +104,7 @@ so_list_init (GnmDialogSOList *state, WBCGtk *wbcg, SheetObject *so)
GnmExprTop const *texpr;
GtkBuilder *gui;
- gui = gnm_gtk_builder_new ("so-list.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("so-list.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return TRUE;
diff --git a/src/dialogs/dialog-solver.c b/src/dialogs/dialog-solver.c
index 3605706..c4ea7a8 100644
--- a/src/dialogs/dialog-solver.c
+++ b/src/dialogs/dialog-solver.c
@@ -978,7 +978,7 @@ dialog_init (SolverState *state)
param = state->sheet->solver_parameters;
- state->gui = gnm_gtk_builder_new ("solver.ui", NULL, GO_CMD_CONTEXT (state->wbcg));
+ state->gui = gnm_gtk_builder_load ("solver.ui", NULL, GO_CMD_CONTEXT (state->wbcg));
if (state->gui == NULL)
return TRUE;
diff --git a/src/dialogs/dialog-stf-export.c b/src/dialogs/dialog-stf-export.c
index 2f4fbae..6da092b 100644
--- a/src/dialogs/dialog-stf-export.c
+++ b/src/dialogs/dialog-stf-export.c
@@ -707,7 +707,7 @@ stf_export_dialog (WBCGtk *wbcg, GnmStfExport *stfe, Workbook *wb)
g_return_val_if_fail (IS_WORKBOOK (wb), TRUE);
g_return_val_if_fail (IS_GNM_STF_EXPORT (stfe), TRUE);
- state.gui = gnm_gtk_builder_new ("dialog-stf-export.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ state.gui = gnm_gtk_builder_load ("dialog-stf-export.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (state.gui == NULL)
return TRUE;
diff --git a/src/dialogs/dialog-stf.c b/src/dialogs/dialog-stf.c
index 93d8375..dc51d11 100644
--- a/src/dialogs/dialog-stf.c
+++ b/src/dialogs/dialog-stf.c
@@ -265,7 +265,7 @@ stf_dialog (WBCGtk *wbcg,
g_return_val_if_fail (source != NULL, NULL);
g_return_val_if_fail (data != NULL, NULL);
- gui = gnm_gtk_builder_new ("dialog-stf.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("dialog-stf.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return NULL;
diff --git a/src/dialogs/dialog-tabulate.c b/src/dialogs/dialog-tabulate.c
index 51c5064..6676f16 100644
--- a/src/dialogs/dialog-tabulate.c
+++ b/src/dialogs/dialog-tabulate.c
@@ -346,7 +346,7 @@ dialog_tabulate (WBCGtk *wbcg, Sheet *sheet)
if (gnumeric_dialog_raise_if_exists (wbcg, TABULATE_KEY))
return;
- gui = gnm_gtk_builder_new ("tabulate.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("tabulate.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-view.c b/src/dialogs/dialog-view.c
index 351139c..a08c96c 100644
--- a/src/dialogs/dialog-view.c
+++ b/src/dialogs/dialog-view.c
@@ -96,7 +96,7 @@ cb_view_ok_clicked (G_GNUC_UNUSED GtkWidget *button,
gtk_widget_destroy (state->dialog);
- new_wbc = wb_control_wrapper_new
+ new_wbc = workbook_control_new_wrapper
(wbc,
shared ? wb_control_view (wbc) : NULL,
wb_control_get_workbook (wbc),
@@ -130,7 +130,7 @@ dialog_new_view (WBCGtk *wbcg)
if (gnumeric_dialog_raise_if_exists (wbcg, VIEW_DIALOG_KEY))
return;
- gui = gnm_gtk_builder_new ("view.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("view.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-workbook-attr.c b/src/dialogs/dialog-workbook-attr.c
index 2c80ad0..87bafcf 100644
--- a/src/dialogs/dialog-workbook-attr.c
+++ b/src/dialogs/dialog-workbook-attr.c
@@ -336,7 +336,7 @@ dialog_workbook_attr (WBCGtk *wbcg)
if (gnumeric_dialog_raise_if_exists (wbcg, WORKBOOK_ATTRIBUTE_KEY))
return;
- gui = gnm_gtk_builder_new ("workbook-attr.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("workbook-attr.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/dialogs/dialog-zoom.c b/src/dialogs/dialog-zoom.c
index dcde7ec..7caad5b 100644
--- a/src/dialogs/dialog-zoom.c
+++ b/src/dialogs/dialog-zoom.c
@@ -175,7 +175,7 @@ dialog_zoom (WBCGtk *wbcg, Sheet *sheet)
if (gnumeric_dialog_raise_if_exists (wbcg, ZOOM_DIALOG_KEY))
return;
- gui = gnm_gtk_builder_new ("dialog-zoom.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("dialog-zoom.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
diff --git a/src/expr-name.c b/src/expr-name.c
index bf0100e..f653a80 100644
--- a/src/expr-name.c
+++ b/src/expr-name.c
@@ -174,6 +174,11 @@ expr_name_relink_deps (GnmNamedExpr *nexpr)
g_slist_free (deps);
}
+/**
+ * gnm_named_expr_collection_new:
+ *
+ * Returns: (transfer full): the newly allocated #GnmNamedExprCollection/
+ **/
GnmNamedExprCollection *
gnm_named_expr_collection_new (void)
{
@@ -183,13 +188,14 @@ gnm_named_expr_collection_new (void)
NULL, (GDestroyNotify) cb_nexpr_remove);
res->placeholders = g_hash_table_new_full (g_str_hash, g_str_equal,
NULL, (GDestroyNotify) cb_nexpr_remove);
+ res->ref_count = 1;
return res;
}
/**
- * gnm_named_expr_collection_free :
- * @names : The collection of names
+ * gnm_named_expr_collection_free:
+ * @names: The collection of names
*
* Frees names defined in the local scope.
* NOTE : THIS DOES NOT INVALIDATE NAMES THAT REFER
@@ -201,13 +207,33 @@ gnm_named_expr_collection_new (void)
void
gnm_named_expr_collection_free (GnmNamedExprCollection *names)
{
- if (names != NULL) {
+ if (names != NULL && names->ref_count-- > 1) {
g_hash_table_destroy (names->names);
g_hash_table_destroy (names->placeholders);
g_free (names);
}
}
+static GnmNamedExprCollection *
+gnm_named_expr_collection_ref (GnmNamedExprCollection *names)
+{
+ names->ref_count++;
+ return names;
+}
+
+GType
+gnm_named_expr_collection_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmNamedExprCollection",
+ (GBoxedCopyFunc)gnm_named_expr_collection_ref,
+ (GBoxedFreeFunc)gnm_named_expr_collection_free);
+ }
+ return t;
+}
+
static void
cb_unlink_all_names (G_GNUC_UNUSED gpointer key,
gpointer value,
@@ -271,6 +297,12 @@ cb_list_names (G_GNUC_UNUSED gpointer key,
GO_SLIST_PREPEND (*pres, value);
}
+/**
+ * gnm_named_expr_collection_list:
+ * @scope: #GnmNamedExprCollection
+ *
+ * Returns: (element-type GnmNamedExpr) (transfer container):
+ **/
GSList *
gnm_named_expr_collection_list (GnmNamedExprCollection const *scope)
{
@@ -357,7 +389,14 @@ gnm_named_expr_collection_check (GnmNamedExprCollection *scope,
return user.res;
}
-/* Iterate over all names, including placeholders. */
+/**
+ * gnm_named_expr_collection_foreach:
+ * @names: #GnmNamedExprCollection
+ * @func: (scope call):
+ * @data: user data.
+ *
+ * Iterate over all names, including placeholders.
+ **/
void
gnm_named_expr_collection_foreach (GnmNamedExprCollection *names,
GHFunc func,
@@ -690,6 +729,19 @@ expr_name_unref (GnmNamedExpr *nexpr)
g_free (nexpr);
}
+GType
+gnm_named_expr_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmNamedExpr",
+ (GBoxedCopyFunc)expr_name_ref,
+ (GBoxedFreeFunc)expr_name_unref);
+ }
+ return t;
+}
+
/**
* expr_name_remove :
* @nexpr :
@@ -1117,7 +1169,12 @@ expr_name_set_expr_ref (GnmNamedExpr *nexpr, GnmExprTop const *texpr)
expr_name_set_expr (nexpr, texpr);
}
-
+/**
+ * expr_name_set_expr_undo_new:
+ * @nexpr: #GnmNamedExpr
+ *
+ * Returns: (transfer full):
+ **/
GOUndo *
expr_name_set_expr_undo_new (GnmNamedExpr *ne)
{
diff --git a/src/expr-name.h b/src/expr-name.h
index dd025c9..8b41c89 100644
--- a/src/expr-name.h
+++ b/src/expr-name.h
@@ -23,6 +23,7 @@ struct _GnmNamedExpr {
gboolean expr_name_validate (const char *name);
+GType gnm_named_expr_get_type (void);
GnmNamedExpr *expr_name_new (char const *name);
GnmNamedExpr *expr_name_lookup (GnmParsePos const *pos, char const *name);
GnmNamedExpr *expr_name_add (GnmParsePos const *pp, char const *name,
@@ -70,8 +71,12 @@ struct _GnmNamedExprCollection {
/* placeholders for references to undefined names */
GHashTable *placeholders;
+
+ /* <private> */
+ unsigned ref_count; /* boxed type */
};
+GType gnm_named_expr_collection_get_type (void);
GnmNamedExprCollection *gnm_named_expr_collection_new (void);
void gnm_named_expr_collection_free (GnmNamedExprCollection *names);
void gnm_named_expr_collection_unlink (GnmNamedExprCollection *names);
diff --git a/src/expr.c b/src/expr.c
index 83325fd..c61cc72 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -545,6 +545,19 @@ gnm_expr_get_type (void)
return t;
}
+GType
+gnm_expr_array_corner_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmExprArrayCorner",
+ (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.
@@ -2981,8 +2994,8 @@ gnm_expr_top_new_array_elem (int x, int y)
* @texpr :
*
* A collect the set of GnmRanges in @expr.
- * Return a list of the unique references Caller is responsible for releasing
- * the list and the content.
+ * Return: (element-type GnmRange) (transfer full): a list of the unique
+ * references Caller is responsible for releasing the list and the content.
**/
GSList *
gnm_expr_top_get_ranges (GnmExprTop const *texpr)
@@ -3160,12 +3173,13 @@ gnm_expr_top_eval (GnmExprTop const *texpr,
}
/**
- * gnm_expr_top_referenced_sheets :
- * @texpr :
+ * gnm_expr_top_referenced_sheets:
+ * @texpr:
*
* Generates a list of the sheets referenced by the supplied expression.
* Caller must free the list. Note, that NULL may occur in the result
* if the expression has a range or cellref without a sheet.
+ * Returns: (element-type Sheet) (transfer container): the created list.
*/
GSList *
gnm_expr_top_referenced_sheets (GnmExprTop const *texpr)
@@ -3246,6 +3260,12 @@ gnm_expr_top_is_rangeref (GnmExprTop const *texpr)
return gnm_expr_is_rangeref (texpr->expr);
}
+/**
+ * gnm_expr_top_new_array_corner:
+ * @expr: #GnmExprTop
+ *
+ * Returns: (transfer none): the #GnmExprArrayCorner or %NULL.
+ **/
GnmExprArrayCorner const *
gnm_expr_top_get_array_corner (GnmExprTop const *texpr)
{
diff --git a/src/expr.h b/src/expr.h
index e73f3b1..6294644 100644
--- a/src/expr.h
+++ b/src/expr.h
@@ -49,6 +49,7 @@ typedef enum {
#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);
+GType gnm_expr_array_corner_get_type (void); /* boxed type */
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,
diff --git a/src/file-autoft.c b/src/file-autoft.c
index 8b4ff0b..fdc2c25 100644
--- a/src/file-autoft.c
+++ b/src/file-autoft.c
@@ -199,6 +199,13 @@ add_dir (GSList **pl, const char *dir, const char *base_dir)
*pl = g_slist_prepend (*pl, dirc);
}
+/**
+ * category_group_list_get:
+ *
+ * Returns: (element-type FormatTemplateCategoryGroup) (transfer full):
+ * the list of #FormatTemplateCategoryGroup which should be freed using
+ * category_group_list_free().
+ **/
GList *
category_group_list_get (void)
{
@@ -251,6 +258,11 @@ category_group_list_get (void)
}
+/**
+ * category_group_list_free:
+ * @category_groups: (element-type FormatTemplateCategoryGroup): the fist to free.
+ *
+ **/
void
category_group_list_free (GList *groups)
{
@@ -266,6 +278,13 @@ category_group_list_free (GList *groups)
g_list_free (groups);
}
+/**
+ * category_group_get_templates_list:
+ * @category_group: #FormatTemplateCategoryGroup
+ * @context: #GOCmdContext
+ *
+ * Returns: (element-type FormatTemplate) (transfer container):
+ **/
GSList *
category_group_get_templates_list (FormatTemplateCategoryGroup *category_group,
GOCmdContext *cc)
diff --git a/src/format-template.c b/src/format-template.c
index 0bc7714..5d19c21 100644
--- a/src/format-template.c
+++ b/src/format-template.c
@@ -298,7 +298,7 @@ format_template_set_description (GnmFormatTemplate *ft, char const *description)
*
* Make a copy of @ft.
*
- * Returns : a copy of @ft
+ * Returns: transfer full): a copy of @ft
**/
GnmFormatTemplate *
format_template_clone (GnmFormatTemplate const *ft)
@@ -331,6 +331,19 @@ format_template_clone (GnmFormatTemplate const *ft)
return clone;
}
+GType
+gnm_format_template_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmFormatTemplate",
+ (GBoxedCopyFunc)format_template_clone,
+ (GBoxedFreeFunc)format_template_free);
+ }
+ return t;
+}
+
#define GNM 100
#define GMR 200
@@ -507,7 +520,7 @@ GSF_XML_IN_NODE (START, TEMPLATE, GMR, "FormatTemplate", GSF_XML_NO_CONTENT, NUL
* Create a new GnmFormatTemplate and load a template file
* into it.
*
- * Return value: a new GnmFormatTemplate (or NULL on error)
+ * Return value: (transfer full): a new GnmFormatTemplate (or NULL on error)
**/
GnmFormatTemplate *
format_template_new_from_file (char const *filename, GOCmdContext *cc)
@@ -1025,10 +1038,10 @@ cb_format_sheet_style (GnmFormatTemplate *ft, GnmRange *r, GnmStyle *mstyle, gpo
}
/**
- * format_template_check_valid :
- * @ft :
- * @regions :
- * @cc : where to report errors
+ * format_template_check_valid:
+ * @ft:
+ * @regions: (element-type GnmRange):
+ * @cc: where to report errors
*
* check to see if the @regions are able to contain the support template @ft.
* Returns TRUE if ok, else FALSE. Will report an error to @cc if it is
@@ -1050,7 +1063,7 @@ format_template_check_valid (GnmFormatTemplate *ft, GSList *regions, GOCmdContex
* format_template_apply_to_sheet_regions:
* @ft: GnmFormatTemplate
* @sheet: the Target sheet
- * @regions: Region list
+ * @regions: (element-type GnmRange): Region list
*
* Apply the template to all selected regions in @sheet.
**/
diff --git a/src/format-template.h b/src/format-template.h
index 33ae100..335fe3f 100644
--- a/src/format-template.h
+++ b/src/format-template.h
@@ -123,6 +123,7 @@ typedef struct {
/*
* Functions for GnmFormatTemplate
*/
+GType gnm_format_template_get_type (void);
void format_template_free (GnmFormatTemplate *ft);
GnmFormatTemplate *format_template_clone (GnmFormatTemplate const *ft);
GnmFormatTemplate *format_template_new_from_file (char const *filename,
diff --git a/src/func.c b/src/func.c
index 6078038..8b6bf34 100644
--- a/src/func.c
+++ b/src/func.c
@@ -776,11 +776,34 @@ gnm_func_group_free (GnmFuncGroup *fn_group)
g_return_if_fail (fn_group != NULL);
g_return_if_fail (fn_group->functions == NULL);
+ if (fn_group->ref_count-- > 1)
+ return;
+
go_string_unref (fn_group->internal_name);
go_string_unref (fn_group->display_name);
g_free (fn_group);
}
+static GnmFuncGroup *
+gnm_func_group_ref (GnmFuncGroup *fn_group)
+{
+ fn_group->ref_count++;
+ return fn_group;
+}
+
+GType
+gnm_func_group_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmFuncGroup",
+ (GBoxedCopyFunc)gnm_func_group_ref,
+ (GBoxedFreeFunc)gnm_func_group_free);
+ }
+ return t;
+}
+
static gint
function_category_compare (gconstpointer a, gconstpointer b)
{
@@ -808,6 +831,7 @@ gnm_func_group_fetch (char const *name, char const *translation)
if (l == NULL) {
cat = g_new (GnmFuncGroup, 1);
cat->internal_name = go_string_new (name);
+ cat->ref_count = 1;
if (translation != NULL) {
cat->display_name = go_string_new (translation);
cat->has_translation = TRUE;
@@ -1028,6 +1052,13 @@ gnm_func_lookup (char const *name, Workbook *scope)
return g_hash_table_lookup (scope->sheet_local_functions, (gpointer)name);
}
+/**
+ * gnm_func_lookup_prefix:
+ * @prefix:
+ * @scope:
+ *
+ * Returns: (element-type GnmFunc*) (transfer full):
+ **/
GSList *
gnm_func_lookup_prefix (char const *prefix, Workbook *scope)
{
@@ -1110,6 +1141,14 @@ unknownFunctionHandler (GnmFuncEvalInfo *ei,
return value_new_error_NAME (ei->pos);
}
+/**
+ * gnm_func_add_stub:
+ * @fn_group:
+ * @name:
+ * @textdomain:
+ * @load_desc: (scope async):
+ * @opt_usage_notify: (scope async):
+ **/
GnmFunc *
gnm_func_add_stub (GnmFuncGroup *fn_group,
const char *name,
@@ -1201,7 +1240,12 @@ gnm_func_lookup_or_add_placeholder (char const *name, Workbook *scope, gboolean
return f;
}
-
+/**
+ * gnm_func_get_user_data:
+ * @func:
+ *
+ * Returns: (transfer none):
+ **/
gpointer
gnm_func_get_user_data (GnmFunc const *func)
{
@@ -1941,7 +1985,7 @@ function_iterate_do_value (GnmEvalPos const *ep,
* function_iterate_argument_values
*
* @ep: The position in a workbook at which to evaluate
- * @callback: The routine to be invoked for every value computed
+ * @callback: (scope call): The routine to be invoked for every value computed
* @callback_closure: Closure for the callback.
* @argc:
* @argv:
diff --git a/src/func.h b/src/func.h
index dd7a3e5..d839f09 100644
--- a/src/func.h
+++ b/src/func.h
@@ -21,8 +21,10 @@ struct _GnmFuncGroup {
GOString *internal_name, *display_name;
gboolean has_translation;
GSList *functions;
+ unsigned ref_count; /* boxed type */
};
+GType gnm_func_group_get_type (void); /* boxed type */
GnmFuncGroup *gnm_func_group_get_nth (gint n);
GnmFuncGroup *gnm_func_group_fetch (char const *name,
char const *translation);
diff --git a/src/gnm-data-cache-source.c b/src/gnm-data-cache-source.c
index 24cfec5..34f2d81 100644
--- a/src/gnm-data-cache-source.c
+++ b/src/gnm-data-cache-source.c
@@ -211,6 +211,13 @@ gnm_data_cache_source_new (Sheet *src_sheet,
return GO_DATA_CACHE_SOURCE (res);
}
+
+/**
+ * gnm_data_cache_source_get_sheet:
+ * @src: #GnmDataCacheSource
+ *
+ * Returns: (transfer none): the #Sheet for @src.
+ **/
Sheet *
gnm_data_cache_source_get_sheet (GnmDataCacheSource const *src)
{
diff --git a/src/gnm-datetime.c b/src/gnm-datetime.c
index 6edb7df..aab13df 100644
--- a/src/gnm-datetime.c
+++ b/src/gnm-datetime.c
@@ -126,7 +126,7 @@ datetime_value_to_g (GDate *res, GnmValue const *v, GODateConventions const *con
* year).
*/
int
-annual_year_basis (GnmValue const *value_date, go_basis_t basis,
+annual_year_basis (GnmValue const *value_date, GOBasisType basis,
GODateConventions const *date_conv)
{
GDate date;
@@ -151,7 +151,7 @@ annual_year_basis (GnmValue const *value_date, go_basis_t basis,
}
gnm_float
-yearfrac (GDate const *from, GDate const *to, go_basis_t basis)
+yearfrac (GDate const *from, GDate const *to, GOBasisType basis)
{
int days;
gnm_float peryear;
diff --git a/src/gnm-datetime.h b/src/gnm-datetime.h
index bdba91f..c504fb3 100644
--- a/src/gnm-datetime.h
+++ b/src/gnm-datetime.h
@@ -17,9 +17,9 @@ int datetime_value_to_seconds (GnmValue const *v, GODateConventions const *
gboolean datetime_value_to_g (GDate *res, GnmValue const *v, GODateConventions const *conv);
int datetime_value_to_serial (GnmValue const *v, GODateConventions const *conv);
-int annual_year_basis (GnmValue const *value_date, go_basis_t basis,
+int annual_year_basis (GnmValue const *value_date, GOBasisType basis,
GODateConventions const *date_conv);
-gnm_float yearfrac (GDate const *from, GDate const *to, go_basis_t basis);
+gnm_float yearfrac (GDate const *from, GDate const *to, GOBasisType basis);
void gnm_date_add_days (GDate *d, int n);
void gnm_date_add_months (GDate *d, int n);
diff --git a/src/gnm-pane.c b/src/gnm-pane.c
index 2777ad2..67eb71a 100644
--- a/src/gnm-pane.c
+++ b/src/gnm-pane.c
@@ -1676,7 +1676,7 @@ cb_pane_sliding (GnmPane *pane)
* @pane: The GnmPane managing the scroll
* @canvas: The Canvas the event comes from
* @slide_flags:
- * @handler: The handler when sliding
+ * @handler: (scope call): The handler when sliding
* @user_data: closure data
*
* Handle a motion event from a @canvas and scroll the @pane
@@ -1919,6 +1919,13 @@ gnm_pane_object_autoscroll (GnmPane *pane, GdkDragContext *context,
cb_pane_sliding (pane);
}
+/**
+ * gnm_pane_object_group:
+ * @pane: #GnmPane
+ *
+ * Returns: (transfer none): the #GocGroup including all #ShetObjectiew
+ * instances in @pane.
+ **/
GocGroup *
gnm_pane_object_group (GnmPane *pane)
{
@@ -3019,6 +3026,7 @@ cb_bounds_changed (SheetObject *so, GocItem *sov)
* @selectable: Add handlers for selecting and editing the object
*
* Setup some standard callbacks for manipulating a view of a sheet object.
+ * Returns: (transfer none): @view set to a #SheetObjectView.
**/
SheetObjectView *
gnm_pane_object_register (SheetObject *so, GocItem *view, gboolean selectable)
diff --git a/src/gnumeric-conf.c b/src/gnumeric-conf.c
index bfaa3ef..7b7a5c6 100644
--- a/src/gnumeric-conf.c
+++ b/src/gnumeric-conf.c
@@ -491,6 +491,11 @@ gnm_conf_shutdown (void)
root = NULL;
}
+/**
+ * gnm_conf_get_page_setup:
+ *
+ * Returns: (transfer full): the default #GtkPageSetup.
+ **/
GtkPageSetup *
gnm_conf_get_page_setup (void)
{
@@ -621,6 +626,11 @@ gnm_conf_set_toolbar_position (const char *name, GtkPositionType x)
#undef TOOLBAR_TANGO
+/**
+ * gnm_conf_get_print_settings:
+ *
+ * Returns: (transfer full): the default #GtkPrintSettings.
+ **/
GtkPrintSettings *
gnm_conf_get_print_settings (void)
{
@@ -715,6 +725,12 @@ static struct cb_watch_string_list watch_autocorrect_first_letter_list = {
"The autocorrect engine does not capitalize the first letter of words following strings in this list.",
};
+
+/**
+ * gnm_conf_get_autocorrect_first_letter_list:
+ *
+ * Returns: (element-type char) (transfer none): the default #GtkPageSetup.
+ **/
GSList *
gnm_conf_get_autocorrect_first_letter_list (void)
{
@@ -723,6 +739,11 @@ gnm_conf_get_autocorrect_first_letter_list (void)
return watch_autocorrect_first_letter_list.var;
}
+/**
+ * gnm_conf_set_autocorrect_first_letter_list:
+ * @l: (element-type char): list of strings.
+ *
+ **/
void
gnm_conf_set_autocorrect_first_letter_list (GSList *x)
{
@@ -772,6 +793,11 @@ static struct cb_watch_string_list watch_autocorrect_init_caps_list = {
"The autocorrect engine does not correct the initial caps for words in this list.",
};
+/**
+ * gnm_conf_get_autocorrect_init_caps_list:
+ *
+ * Returns: (element-type char) (transfer none):
+ **/
GSList *
gnm_conf_get_autocorrect_init_caps_list (void)
{
@@ -780,6 +806,11 @@ gnm_conf_get_autocorrect_init_caps_list (void)
return watch_autocorrect_init_caps_list.var;
}
+/**
+ * gnm_conf_set_autocorrect_init_caps_list:
+ * @l: (element-type char): list of strings.
+ *
+ **/
void
gnm_conf_set_autocorrect_init_caps_list (GSList *x)
{
@@ -858,6 +889,12 @@ static struct cb_watch_string_list watch_autoformat_extra_dirs = {
"This list contains all extra directories containing autoformat templates.",
};
+
+/**
+ * gnm_conf_get_autoformat_extra_dirs:
+ *
+ * Returns: (element-type char) (transfer none):
+ **/
GSList *
gnm_conf_get_autoformat_extra_dirs (void)
{
@@ -866,6 +903,11 @@ gnm_conf_get_autoformat_extra_dirs (void)
return watch_autoformat_extra_dirs.var;
}
+/**
+ * gnm_conf_set_autoformat_extra_dirs:
+ * @l: (element-type char): list of strings.
+ *
+ **/
void
gnm_conf_set_autoformat_extra_dirs (GSList *x)
{
@@ -1092,6 +1134,12 @@ static struct cb_watch_string_list watch_core_file_save_extension_check_disabled
"This list contains the ids of the file savers for which the extension check is disabled.",
};
+
+/**
+ * gnm_conf_get_core_file_save_extension_check_disabled:
+ *
+ * Returns: (element-type char) (transfer none):
+ **/
GSList *
gnm_conf_get_core_file_save_extension_check_disabled (void)
{
@@ -1100,6 +1148,11 @@ gnm_conf_get_core_file_save_extension_check_disabled (void)
return watch_core_file_save_extension_check_disabled.var;
}
+/**
+ * gnm_conf_set_core_file_save_extension_check_disabled:
+ * @l: (element-type char): list of strings.
+ *
+ **/
void
gnm_conf_set_core_file_save_extension_check_disabled (GSList *x)
{
@@ -2166,6 +2219,12 @@ static struct cb_watch_string_list watch_functionselector_recentfunctions = {
"The function selector keeps a list of recently used functions. This is that list.",
};
+
+/**
+ * gnm_conf_get_functionselector_recentfunctions:
+ *
+ * Returns: (element-type char) (transfer none):
+ **/
GSList *
gnm_conf_get_functionselector_recentfunctions (void)
{
@@ -2174,6 +2233,11 @@ gnm_conf_get_functionselector_recentfunctions (void)
return watch_functionselector_recentfunctions.var;
}
+/**
+ * gnm_conf_set_functionselector_recentfunctions:
+ * @l: (element-type char): list of strings.
+ *
+ **/
void
gnm_conf_set_functionselector_recentfunctions (GSList *x)
{
@@ -2301,7 +2365,7 @@ gnm_conf_set_plugins_activate_new (gboolean x)
}
GOConfNode *
-gnm_conf_get_plugins_activate_new_node (void)
+gnm_conf_get_plugins_activate_nEw_node (void)
{
return get_watch_node (&watch_plugins_activate_new);
}
@@ -2312,6 +2376,12 @@ static struct cb_watch_string_list watch_plugins_active = {
"This list contains all plugins that are supposed to be automatically activated.",
};
+
+/**
+ * gnm_conf_get_plugins_active:
+ *
+ * Returns: (element-type char) (transfer none):
+ **/
GSList *
gnm_conf_get_plugins_active (void)
{
@@ -2320,6 +2390,11 @@ gnm_conf_get_plugins_active (void)
return watch_plugins_active.var;
}
+/**
+ * gnm_conf_set_plugins_active:
+ * @l: (element-type char): list of strings.
+ *
+ **/
void
gnm_conf_set_plugins_active (GSList *x)
{
@@ -2340,6 +2415,12 @@ static struct cb_watch_string_list watch_plugins_extra_dirs = {
"This list contains all extra directories containing plugins.",
};
+
+/**
+ * gnm_conf_get_plugins_extra_dirs:
+ *
+ * Returns: (element-type char) (transfer none):
+ **/
GSList *
gnm_conf_get_plugins_extra_dirs (void)
{
@@ -2348,6 +2429,11 @@ gnm_conf_get_plugins_extra_dirs (void)
return watch_plugins_extra_dirs.var;
}
+/**
+ * gnm_conf_set_plugins_extra_dirs:
+ * @l: (element-type char): list of strings.
+ *
+ **/
void
gnm_conf_set_plugins_extra_dirs (GSList *x)
{
@@ -2368,6 +2454,12 @@ static struct cb_watch_string_list watch_plugins_file_states = {
"This list contains all plugin file states.",
};
+
+/**
+ * gnm_conf_get_plugins_file_states:
+ *
+ * Returns: (element-type char) (transfer none):
+ **/
GSList *
gnm_conf_get_plugins_file_states (void)
{
@@ -2376,6 +2468,11 @@ gnm_conf_get_plugins_file_states (void)
return watch_plugins_file_states.var;
}
+/**
+ * gnm_conf_set_plugins_file_states:
+ * @l: (element-type char): list of strings.
+ *
+ **/
void
gnm_conf_set_plugins_file_states (GSList *x)
{
@@ -2396,6 +2493,12 @@ static struct cb_watch_string_list watch_plugins_known = {
"This list contains all known plugins.",
};
+
+/**
+ * gnm_conf_get_plugins_known:
+ *
+ * Returns: (element-type char) (transfer none):
+ **/
GSList *
gnm_conf_get_plugins_known (void)
{
@@ -2404,6 +2507,11 @@ gnm_conf_get_plugins_known (void)
return watch_plugins_known.var;
}
+/**
+ * gnm_conf_set_plugins_known:
+ * @l: (element-type char): list of strings.
+ *
+ **/
void
gnm_conf_set_plugins_known (GSList *x)
{
@@ -2540,6 +2648,12 @@ static struct cb_watch_string_list watch_printsetup_footer = {
"The default page footer for new documents that can be modified using the\n page setup dialog.",
};
+
+/**
+ * gnm_conf_get_printsetup_footer:
+ *
+ * Returns: (element-type char) (transfer none):
+ **/
GSList *
gnm_conf_get_printsetup_footer (void)
{
@@ -2548,6 +2662,11 @@ gnm_conf_get_printsetup_footer (void)
return watch_printsetup_footer.var;
}
+/**
+ * gnm_conf_set_printsetup_footer:
+ * @l: (element-type char): list of strings.
+ *
+ **/
void
gnm_conf_set_printsetup_footer (GSList *x)
{
@@ -2568,6 +2687,12 @@ static struct cb_watch_string_list watch_printsetup_gtk_setting = {
"The configuration of GTKPrintSetting. Do not edit this variable.",
};
+
+/**
+ * gnm_conf_get_printsetup_gtk_setting:
+ *
+ * Returns: (element-type char) (transfer none):
+ **/
GSList *
gnm_conf_get_printsetup_gtk_setting (void)
{
@@ -2576,6 +2701,11 @@ gnm_conf_get_printsetup_gtk_setting (void)
return watch_printsetup_gtk_setting.var;
}
+/**
+ * gnm_conf_set_printsetup_gtk_setting:
+ * @l: (element-type char): list of strings.
+ *
+ **/
void
gnm_conf_set_printsetup_gtk_setting (GSList *x)
{
@@ -2596,6 +2726,12 @@ static struct cb_watch_string_list watch_printsetup_header = {
"The default page header for new documents that can be modified using the\n page setup dialog.",
};
+
+/**
+ * gnm_conf_get_printsetup_header:
+ *
+ * Returns: (element-type char) (transfer none):
+ **/
GSList *
gnm_conf_get_printsetup_header (void)
{
@@ -2604,6 +2740,11 @@ gnm_conf_get_printsetup_header (void)
return watch_printsetup_header.var;
}
+/**
+ * gnm_conf_set_printsetup_header:
+ * @l: (element-type char): list of strings.
+ *
+ **/
void
gnm_conf_set_printsetup_header (GSList *x)
{
@@ -2741,6 +2882,12 @@ static struct cb_watch_string_list watch_printsetup_hf_left = {
"Please use the Print Setup dialog to edit this value.",
};
+
+/**
+ * gnm_conf_get_printsetup_hf_left:
+ *
+ * Returns: (element-type char) (transfer none):
+ **/
GSList *
gnm_conf_get_printsetup_hf_left (void)
{
@@ -2749,6 +2896,11 @@ gnm_conf_get_printsetup_hf_left (void)
return watch_printsetup_hf_left.var;
}
+/**
+ * gnm_conf_set_printsetup_hf_left:
+ * @l: (element-type char): list of strings.
+ *
+ **/
void
gnm_conf_set_printsetup_hf_left (GSList *x)
{
@@ -2769,6 +2921,12 @@ static struct cb_watch_string_list watch_printsetup_hf_middle = {
"Please use the Print Setup dialog to edit this value.",
};
+
+/**
+ * gnm_conf_get_printsetup_hf_middle:
+ *
+ * Returns: (element-type char) (transfer none):
+ **/
GSList *
gnm_conf_get_printsetup_hf_middle (void)
{
@@ -2777,6 +2935,11 @@ gnm_conf_get_printsetup_hf_middle (void)
return watch_printsetup_hf_middle.var;
}
+/**
+ * gnm_conf_set_printsetup_hf_middle:
+ * @l: (element-type char): list of strings.
+ *
+ **/
void
gnm_conf_set_printsetup_hf_middle (GSList *x)
{
@@ -2797,6 +2960,12 @@ static struct cb_watch_string_list watch_printsetup_hf_right = {
"Please use the Print Setup dialog to edit this value.",
};
+
+/**
+ * gnm_conf_get_printsetup_hf_right:
+ *
+ * Returns: (element-type char) (transfer none):
+ **/
GSList *
gnm_conf_get_printsetup_hf_right (void)
{
@@ -2805,6 +2974,11 @@ gnm_conf_get_printsetup_hf_right (void)
return watch_printsetup_hf_right.var;
}
+/**
+ * gnm_conf_set_printsetup_hf_right:
+ * @l: (element-type char): list of strings.
+ *
+ **/
void
gnm_conf_set_printsetup_hf_right (GSList *x)
{
diff --git a/src/gnumeric-conf.h b/src/gnumeric-conf.h
index b6a894f..8e77183 100644
--- a/src/gnumeric-conf.h
+++ b/src/gnumeric-conf.h
@@ -39,7 +39,7 @@ void gnm_conf_set_autocorrect_first_letter (gboolean);
GOConfNode *gnm_conf_get_autocorrect_first_letter_list_node (void);
GSList *gnm_conf_get_autocorrect_first_letter_list (void);
-void gnm_conf_set_autocorrect_first_letter_list (GSList *);
+void gnm_conf_set_autocorrect_first_letter_list (GSList *l);
GOConfNode *gnm_conf_get_autocorrect_init_caps_node (void);
gboolean gnm_conf_get_autocorrect_init_caps (void);
@@ -47,7 +47,7 @@ void gnm_conf_set_autocorrect_init_caps (gboolean);
GOConfNode *gnm_conf_get_autocorrect_init_caps_list_node (void);
GSList *gnm_conf_get_autocorrect_init_caps_list (void);
-void gnm_conf_set_autocorrect_init_caps_list (GSList *);
+void gnm_conf_set_autocorrect_init_caps_list (GSList *l);
GOConfNode *gnm_conf_get_autocorrect_names_of_days_node (void);
gboolean gnm_conf_get_autocorrect_names_of_days (void);
@@ -59,7 +59,7 @@ void gnm_conf_set_autocorrect_replace (gboolean);
GOConfNode *gnm_conf_get_autoformat_extra_dirs_node (void);
GSList *gnm_conf_get_autoformat_extra_dirs (void);
-void gnm_conf_set_autoformat_extra_dirs (GSList *);
+void gnm_conf_set_autoformat_extra_dirs (GSList *l);
GOConfNode *gnm_conf_get_autoformat_sys_dir_node (void);
const char *gnm_conf_get_autoformat_sys_dir (void);
@@ -91,7 +91,7 @@ void gnm_conf_set_core_file_save_def_overwrite (gboolean);
GOConfNode *gnm_conf_get_core_file_save_extension_check_disabled_node (void);
GSList *gnm_conf_get_core_file_save_extension_check_disabled (void);
-void gnm_conf_set_core_file_save_extension_check_disabled (GSList *);
+void gnm_conf_set_core_file_save_extension_check_disabled (GSList *l);
GOConfNode *gnm_conf_get_core_file_save_single_sheet_node (void);
gboolean gnm_conf_get_core_file_save_single_sheet (void);
@@ -239,7 +239,7 @@ void gnm_conf_set_functionselector_num_of_recent (int);
GOConfNode *gnm_conf_get_functionselector_recentfunctions_node (void);
GSList *gnm_conf_get_functionselector_recentfunctions (void);
-void gnm_conf_set_functionselector_recentfunctions (GSList *);
+void gnm_conf_set_functionselector_recentfunctions (GSList *l);
GOConfNode *gnm_conf_get_plugin_glpk_glpsol_path_node (void);
const char *gnm_conf_get_plugin_glpk_glpsol_path (void);
@@ -253,25 +253,26 @@ GOConfNode *gnm_conf_get_plugin_lpsolve_lpsolve_path_node (void);
const char *gnm_conf_get_plugin_lpsolve_lpsolve_path (void);
void gnm_conf_set_plugin_lpsolve_lpsolve_path (const char *);
-GOConfNode *gnm_conf_get_plugins_activate_new_node (void);
+/* capitalized E to make introspection happy */
+GOConfNode *gnm_conf_get_plugins_activate_nEw_node (void);
gboolean gnm_conf_get_plugins_activate_new (void);
void gnm_conf_set_plugins_activate_new (gboolean);
GOConfNode *gnm_conf_get_plugins_active_node (void);
GSList *gnm_conf_get_plugins_active (void);
-void gnm_conf_set_plugins_active (GSList *);
+void gnm_conf_set_plugins_active (GSList *l);
GOConfNode *gnm_conf_get_plugins_extra_dirs_node (void);
GSList *gnm_conf_get_plugins_extra_dirs (void);
-void gnm_conf_set_plugins_extra_dirs (GSList *);
+void gnm_conf_set_plugins_extra_dirs (GSList *l);
GOConfNode *gnm_conf_get_plugins_file_states_node (void);
GSList *gnm_conf_get_plugins_file_states (void);
-void gnm_conf_set_plugins_file_states (GSList *);
+void gnm_conf_set_plugins_file_states (GSList *l);
GOConfNode *gnm_conf_get_plugins_known_node (void);
GSList *gnm_conf_get_plugins_known (void);
-void gnm_conf_set_plugins_known (GSList *);
+void gnm_conf_set_plugins_known (GSList *l);
GOConfNode *gnm_conf_get_printsetup_across_then_down_node (void);
gboolean gnm_conf_get_printsetup_across_then_down (void);
@@ -291,15 +292,15 @@ void gnm_conf_set_printsetup_center_vertically (gboolean);
GOConfNode *gnm_conf_get_printsetup_footer_node (void);
GSList *gnm_conf_get_printsetup_footer (void);
-void gnm_conf_set_printsetup_footer (GSList *);
+void gnm_conf_set_printsetup_footer (GSList *l);
GOConfNode *gnm_conf_get_printsetup_gtk_setting_node (void);
GSList *gnm_conf_get_printsetup_gtk_setting (void);
-void gnm_conf_set_printsetup_gtk_setting (GSList *);
+void gnm_conf_set_printsetup_gtk_setting (GSList *l);
GOConfNode *gnm_conf_get_printsetup_header_node (void);
GSList *gnm_conf_get_printsetup_header (void);
-void gnm_conf_set_printsetup_header (GSList *);
+void gnm_conf_set_printsetup_header (GSList *l);
GOConfNode *gnm_conf_get_printsetup_hf_font_bold_node (void);
gboolean gnm_conf_get_printsetup_hf_font_bold (void);
@@ -319,15 +320,15 @@ void gnm_conf_set_printsetup_hf_font_size (double);
GOConfNode *gnm_conf_get_printsetup_hf_left_node (void);
GSList *gnm_conf_get_printsetup_hf_left (void);
-void gnm_conf_set_printsetup_hf_left (GSList *);
+void gnm_conf_set_printsetup_hf_left (GSList *l);
GOConfNode *gnm_conf_get_printsetup_hf_middle_node (void);
GSList *gnm_conf_get_printsetup_hf_middle (void);
-void gnm_conf_set_printsetup_hf_middle (GSList *);
+void gnm_conf_set_printsetup_hf_middle (GSList *l);
GOConfNode *gnm_conf_get_printsetup_hf_right_node (void);
GSList *gnm_conf_get_printsetup_hf_right (void);
-void gnm_conf_set_printsetup_hf_right (GSList *);
+void gnm_conf_set_printsetup_hf_right (GSList *l);
GOConfNode *gnm_conf_get_printsetup_margin_bottom_node (void);
double gnm_conf_get_printsetup_margin_bottom (void);
diff --git a/src/graph.c b/src/graph.c
index 151905a..4b4975b 100644
--- a/src/graph.c
+++ b/src/graph.c
@@ -277,6 +277,12 @@ gnm_go_data_set_sheet (GOData *dat, Sheet *sheet)
dependent_set_sheet (dep, sheet);
}
+/**
+ * gnm_go_data_get_sheet:
+ * @dat: #GOData
+ *
+ * Returns: (transfer none): the sheet.
+ **/
Sheet *
gnm_go_data_get_sheet (GOData const *dat)
{
@@ -294,6 +300,14 @@ gnm_go_data_get_expr (GOData const *dat)
return dep->texpr;
}
+/**
+ * gnm_go_data_foreach_dep:
+ * @dat: #GOData
+ * @so: #SheetObject
+ * @func: (scope call):
+ * @user: user data.
+ *
+ **/
void
gnm_go_data_foreach_dep (GOData *dat, SheetObject *so,
SheetObjectForeachDepFunc func, gpointer user)
diff --git a/src/gui-clipboard.c b/src/gui-clipboard.c
index b9e2ff0..caeff63 100644
--- a/src/gui-clipboard.c
+++ b/src/gui-clipboard.c
@@ -151,7 +151,7 @@ text_to_cell_region (WBCGtk *wbcg,
if (oneline) {
GODateConventions const *date_conv = workbook_date_conv (wb);
GnmCellCopy *cc = gnm_cell_copy_new (
- (cr = cellregion_new (NULL)), 0, 0);
+ (cr = gnm_cell_region_new (NULL)), 0, 0);
char *tmp = g_strndup (data, data_len);
g_free (data_converted);
@@ -172,13 +172,13 @@ text_to_cell_region (WBCGtk *wbcg,
if (dialogresult != NULL) {
cr = stf_parse_region (dialogresult->parseoptions,
dialogresult->text, NULL, wb);
- g_return_val_if_fail (cr != NULL, cellregion_new (NULL));
+ g_return_val_if_fail (cr != NULL, gnm_cell_region_new (NULL));
stf_dialog_result_attach_formats_to_cr (dialogresult, cr);
stf_dialog_result_free (dialogresult);
} else
- cr = cellregion_new (NULL);
+ cr = gnm_cell_region_new (NULL);
}
return cr;
@@ -279,7 +279,7 @@ utf8_content_received (GtkClipboard *clipboard, const gchar *text,
* as well, but the file_opener service makes workbooks, not sheets.
*
* We use the file_opener service by wrapping the selection data in a GsfInput,
- * and calling wb_view_new_from_input.
+ * and calling workbook_view_new_from_input.
**/
static GnmCellRegion *
table_cellregion_read (WorkbookControl *wbc, char const *reader_id,
@@ -299,7 +299,7 @@ table_cellregion_read (WorkbookControl *wbc, char const *reader_id,
ioc = go_io_context_new (GO_CMD_CONTEXT (wbc));
input = gsf_input_memory_new (buffer, length, FALSE);
- wb_view = wb_view_new_from_input (input, NULL, reader, ioc, NULL);
+ wb_view = workbook_view_new_from_input (input, NULL, reader, ioc, NULL);
if (go_io_error_occurred (ioc) || wb_view == NULL) {
go_io_error_display (ioc);
goto out;
diff --git a/src/gui-file.c b/src/gui-file.c
index 08b03ab..12a6c7f 100644
--- a/src/gui-file.c
+++ b/src/gui-file.c
@@ -95,7 +95,7 @@ gui_wb_view_show (WBCGtk *wbcg, WorkbookView *wbv)
} else {
GdkScreen *screen = gtk_window_get_screen (wbcg_toplevel (wbcg));
WorkbookControl *new_wbc =
- wb_control_wrapper_new (WORKBOOK_CONTROL (wbcg),
+ workbook_control_new_wrapper (WORKBOOK_CONTROL (wbcg),
wbv, NULL, screen);
new_wbcg = WBC_GTK (new_wbc);
@@ -114,7 +114,7 @@ gui_file_read (WBCGtk *wbcg, char const *uri,
go_cmd_context_set_sensitive (GO_CMD_CONTEXT (wbcg), FALSE);
io_context = go_io_context_new (GO_CMD_CONTEXT (wbcg));
- wbv = wb_view_new_from_uri (uri, optional_format, io_context,
+ wbv = workbook_view_new_from_uri (uri, optional_format, io_context,
optional_encoding);
if (go_io_error_occurred (io_context) ||
@@ -142,7 +142,7 @@ gui_file_template (WBCGtk *wbcg, char const *uri)
go_cmd_context_set_sensitive (GO_CMD_CONTEXT (wbcg), FALSE);
io_context = go_io_context_new (GO_CMD_CONTEXT (wbcg));
- wbv = wb_view_new_from_uri (uri, optional_format, io_context,
+ wbv = workbook_view_new_from_uri (uri, optional_format, io_context,
optional_encoding);
if (go_io_error_occurred (io_context) ||
@@ -592,7 +592,7 @@ gui_file_save_as (WBCGtk *wbcg, WorkbookView *wb_view, file_save_as_t type,
gtk_combo_box_set_active (format_combo, g_list_index (savers, fs));
/* Set default file name */
- if (!(wb_uri = workbook_get_last_export_uri (wb)) || (type != FILE_SAVE_AS_EXPORT)
+ if (!(wb_uri = workbook_get_last_export_uri (wb)) || (type != FILE_SAVE_AS_EXPORT)
|| (fs != workbook_get_file_exporter (wb)))
wb_uri = go_doc_get_uri (GO_DOC (wb));
@@ -730,7 +730,7 @@ gui_file_export_repeat (WBCGtk *wbcg)
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_YES_NO,
- msg, last_uri,
+ msg, last_uri,
go_file_saver_get_description (fs));
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
diff --git a/src/gui-util.c b/src/gui-util.c
index ca05658..cb59899 100644
--- a/src/gui-util.c
+++ b/src/gui-util.c
@@ -63,12 +63,14 @@ insert_error_info (GtkTextBuffer* text, GOErrorInfo *error, gint level)
}
/**
- * gnumeric_go_error_info_dialog_new
+ * gnumeric_go_error_info_list_dialog_create:
+ * @errs: (element-type GOErrorInfo):
*
* SHOULD BE IN GOFFICE
+ * Returns: (transfer full): the newly allocated dialog.
*/
GtkWidget *
-gnumeric_go_error_info_list_dialog_new (GSList *errs)
+gnumeric_go_error_info_list_dialog_create (GSList *errs)
{
GtkWidget *dialog;
GtkWidget *scrolled_window;
@@ -146,11 +148,17 @@ gnumeric_go_error_info_list_dialog_new (GSList *errs)
return dialog;
}
+/**
+ * gnumeric_go_error_info_dialog_create:
+ *
+ * SHOULD BE IN GOFFICE
+ * Returns: (transfer full): the newly allocated dialog.
+ */
GtkWidget *
-gnumeric_go_error_info_dialog_new (GOErrorInfo *error)
+gnumeric_go_error_info_dialog_create (GOErrorInfo *error)
{
GSList *l = g_slist_append (NULL, error);
- GtkWidget *w = gnumeric_go_error_info_list_dialog_new (l);
+ GtkWidget *w = gnumeric_go_error_info_list_dialog_create (l);
g_slist_free (l);
return w;
}
@@ -162,15 +170,21 @@ gnumeric_go_error_info_dialog_new (GOErrorInfo *error)
void
gnumeric_go_error_info_dialog_show (GtkWindow *parent, GOErrorInfo *error)
{
- GtkWidget *dialog = gnumeric_go_error_info_dialog_new (error);
+ GtkWidget *dialog = gnumeric_go_error_info_dialog_create (error);
go_gtk_dialog_run (GTK_DIALOG (dialog), parent);
}
+/**
+ * gnumeric_go_error_info_list_dialog_show:
+ * @parent:
+ * @errs: (element-type GOErrorInfo):
+ *
+ */
void
gnumeric_go_error_info_list_dialog_show (GtkWindow *parent,
GSList *errs)
{
- GtkWidget *dialog = gnumeric_go_error_info_list_dialog_new (errs);
+ GtkWidget *dialog = gnumeric_go_error_info_list_dialog_create (errs);
go_gtk_dialog_run (GTK_DIALOG (dialog), parent);
}
@@ -323,13 +337,13 @@ gnumeric_keyed_dialog (WBCGtk *wbcg, GtkWindow *dialog, char const *key)
}
/**
- * gnumeric_dialog_raise_if_exists
+ * gnumeric_dialog_raise_if_exists:
*
- * @wbcg A WBCGtk
- * @key A key to identify the dialog
+ * @wbcg: A WBCGtk
+ * @key: A key to identify the dialog
*
* Raise the dialog identified by key if it is registered on the wbcg.
- * Returns TRUE if dialog found, FALSE if not.
+ * Returns: (transfer none): TRUE if dialog found, FALSE if not.
**/
gpointer
gnumeric_dialog_raise_if_exists (WBCGtk *wbcg, char const *key)
@@ -482,6 +496,11 @@ gnumeric_tooltip_set_style (GtkWidget *widget)
}
}
+/**
+ * gnumeric_create_tooltip_text_view_widget:
+ *
+ * Returns: (transfer full): the newly allocated #GtkWidget.
+ **/
GtkWidget *
gnumeric_create_tooltip_text_view_widget (void)
{
@@ -496,6 +515,11 @@ gnumeric_create_tooltip_text_view_widget (void)
return label;
}
+/**
+ * gnumeric_create_tooltip_widget:
+ *
+ * Returns: (transfer full): the newly allocated #GtkWidget.
+ **/
GtkWidget *
gnumeric_create_tooltip_widget (void)
{
@@ -510,6 +534,13 @@ gnumeric_create_tooltip_widget (void)
return label;
}
+/**
+ * gnumeric_convert_to_tooltip:
+ * @ref_widget:
+ * @label:
+ *
+ * Returns: (transfer full): the newly allcated #GtkWindow.
+ **/
GtkWidget *
gnumeric_convert_to_tooltip (GtkWidget *ref_widget, GtkWidget *label)
{
@@ -533,6 +564,11 @@ gnumeric_convert_to_tooltip (GtkWidget *ref_widget, GtkWidget *label)
return label;
}
+/**
+ * gnumeric_create_tooltip:
+ *
+ * Returns: (transfer full): the newly allocated #GtkWidget.
+ **/
GtkWidget *
gnumeric_create_tooltip (GtkWidget *ref_widget)
{
@@ -563,14 +599,15 @@ gnumeric_position_tooltip (GtkWidget *tip, int px, int py, gboolean horizontal)
}
/**
- * gnm_gtk_builder_new :
- * @cc : #GOCmdContext
- * @uifile :
+ * gnm_gtk_builder_load:
+ * @cc: #GOCmdContext
+ * @uifile:
*
* Simple utility to open ui files
+ * Returns: (transfer full): the newly allocated #GtkBuilder.
**/
GtkBuilder *
-gnm_gtk_builder_new (char const *uifile, char const *domain, GOCmdContext *cc)
+gnm_gtk_builder_load (char const *uifile, char const *domain, GOCmdContext *cc)
{
GtkBuilder *gui;
char *f;
@@ -581,7 +618,7 @@ gnm_gtk_builder_new (char const *uifile, char const *domain, GOCmdContext *cc)
f = g_strconcat ("res:gnm:", uifile, NULL);
}
- gui = go_gtk_builder_new (f, domain, cc);
+ gui = go_gtk_builder_load (f, domain, cc);
g_free (f);
return gui;
@@ -603,6 +640,15 @@ popup_item_activate (GtkWidget *item, gpointer *user_data)
gtk_widget_destroy (gtk_widget_get_toplevel (item));
}
+/**
+ * gnumeric_create_popup_menu:
+ * @element:
+ * @handler: (scope async):
+ * @user_data: user data to pass to @handler.
+ * @display_filter:
+ * @sensitive_filter:
+ * @event:
+ **/
void
gnumeric_create_popup_menu (GnumericPopupMenuElement const *element,
GnumericPopupMenuHandler handler,
@@ -945,6 +991,14 @@ int_to_entry (GtkEntry *entry, gint the_int)
}
}
+/**
+ * gnumeric_load_image:
+ * @name: the file name.
+ *
+ * utility routine to create image widgets from file named @name.
+ * looking in the gnumeric icondir.
+ * Returns: (transfer full): the newly allocated #GtkImage.
+ **/
GtkWidget *
gnumeric_load_image (char const *filename)
{
@@ -959,8 +1013,12 @@ gnumeric_load_image (char const *filename)
}
/**
- * gnumeric_load_pixbuf : utility routine to create pixbufs from file named @name.
+ * gnumeric_load_pixbuf:
+ * @name: the file name.
+ *
+ * utility routine to create pixbufs from file named @name.
* looking in the gnumeric icondir.
+ * Returns: (transfer full): the newly allocated pixbuf.
**/
GdkPixbuf *
gnumeric_load_pixbuf (char const *filename)
@@ -1018,7 +1076,7 @@ gnm_widget_set_cursor_type (GtkWidget *w, GdkCursorType ct)
/* ------------------------------------------------------------------------- */
/**
- * gnumeric_message_dialog_new :
+ * gnumeric_message_dialog_create:
*
* A convenience fonction to build HIG compliant message dialogs.
*
@@ -1028,11 +1086,11 @@ gnm_widget_set_cursor_type (GtkWidget *w, GdkCursorType ct)
* primary_message : message displayed in bold
* secondary_message : message displayed below
*
- * return : a GtkDialog, without buttons.
+ * Returns: (transfer full): a GtkDialog, without buttons.
**/
GtkWidget *
-gnumeric_message_dialog_new (GtkWindow * parent,
+gnumeric_message_dialog_create (GtkWindow * parent,
GtkDialogFlags flags,
GtkMessageType type,
gchar const * primary_message,
diff --git a/src/gui-util.h b/src/gui-util.h
index 6697fda..294e55c 100644
--- a/src/gui-util.h
+++ b/src/gui-util.h
@@ -12,8 +12,8 @@ G_BEGIN_DECLS
#define GNM_ACTION_DEF(name) \
void name (GtkAction *a, WBCGtk *wbcg)
-GtkWidget* gnumeric_go_error_info_dialog_new (GOErrorInfo *error);
-GtkWidget* gnumeric_go_error_info_list_dialog_new (GSList *errs);
+GtkWidget* gnumeric_go_error_info_dialog_create (GOErrorInfo *error);
+GtkWidget* gnumeric_go_error_info_list_dialog_create (GSList *errs);
void gnumeric_go_error_info_dialog_show (GtkWindow *parent,
GOErrorInfo *error);
void gnumeric_go_error_info_list_dialog_show (GtkWindow *parent,
@@ -47,7 +47,7 @@ GtkWidget *gnumeric_convert_to_tooltip (GtkWidget *ref_widget,
GtkWidget *widget);
void gnumeric_tooltip_set_style (GtkWidget *widget);
-GtkBuilder *gnm_gtk_builder_new (char const *uifile, char const *domain,
+GtkBuilder *gnm_gtk_builder_load (char const *uifile, char const *domain,
GOCmdContext *cc);
typedef struct {
@@ -110,11 +110,11 @@ void gnm_link_button_and_entry (GtkWidget *button, GtkWidget *entry);
void gnm_widget_set_cursor_type (GtkWidget *w, GdkCursorType ct);
void gnm_widget_set_cursor (GtkWidget *w, GdkCursor *ct);
-GtkWidget * gnumeric_message_dialog_new (GtkWindow * parent,
- GtkDialogFlags flags,
- GtkMessageType type,
- char const *primary_message,
- char const *secondary_message);
+GtkWidget * gnumeric_message_dialog_create (GtkWindow * parent,
+ GtkDialogFlags flags,
+ GtkMessageType type,
+ char const *primary_message,
+ char const *secondary_message);
typedef gboolean (*gnm_iter_search_t) (GtkTreeModel *model, GtkTreeIter* iter);
#define gnm_tree_model_iter_next gtk_tree_model_iter_next
diff --git a/src/gutils.c b/src/gutils.c
index 13063bb..b07d901 100644
--- a/src/gutils.c
+++ b/src/gutils.c
@@ -526,7 +526,7 @@ struct _GnmLocale {
char *monetary_locale;
};
/**
- * gnm_push_C_locale :
+ * gnm_push_C_locale: (skip)
*
* Returns the current locale, and sets the locale and the value-format
* engine's locale to 'C'. The caller must call gnm_pop_C_locale to free the
@@ -547,8 +547,8 @@ gnm_push_C_locale (void)
}
/**
- * gnm_pop_C_locale :
- * @locale : #GnmLocale
+ * gnm_pop_C_locale: (skip)
+ * @locale: #GnmLocale
*
* Frees the result of gnm_push_C_locale and restores the original locale.
**/
diff --git a/src/io-context-gtk.c b/src/io-context-gtk.c
index ca333fa..2713179 100644
--- a/src/io-context-gtk.c
+++ b/src/io-context-gtk.c
@@ -260,7 +260,7 @@ icg_error_error_info (GOCmdContext *cc, GOErrorInfo *error)
{
GnmIOContextGtk *icg = GNM_IO_CONTEXT_GTK (cc);
if (icg->show_warnings) {
- GtkWidget *dialog = gnumeric_go_error_info_dialog_new (error);
+ GtkWidget *dialog = gnumeric_go_error_info_dialog_create (error);
gtk_widget_show_all (GTK_WIDGET (dialog));
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
@@ -272,7 +272,7 @@ icg_error_error_info_list (GOCmdContext *cc, GSList *error)
{
GnmIOContextGtk *icg = GNM_IO_CONTEXT_GTK (cc);
if (icg->show_warnings && error != NULL && error->data != NULL) {
- GtkWidget *dialog = gnumeric_go_error_info_dialog_new
+ GtkWidget *dialog = gnumeric_go_error_info_dialog_create
(error->data);
gtk_widget_show_all (GTK_WIDGET (dialog));
gtk_dialog_run (GTK_DIALOG (dialog));
diff --git a/src/item-bar.c b/src/item-bar.c
index 78b8625..00d3a83 100644
--- a/src/item-bar.c
+++ b/src/item-bar.c
@@ -181,7 +181,7 @@ item_bar_calc_size (ItemBar *ib)
/**
* item_bar_normal_font:
* @ib: #ItemBar
- *
+ *
* Returns: (transfer none): the bar normal font.
**/
PangoFont *
diff --git a/src/libgnumeric.c b/src/libgnumeric.c
index e96e6f6..2ebd458 100644
--- a/src/libgnumeric.c
+++ b/src/libgnumeric.c
@@ -117,7 +117,7 @@ cb_gnm_option_group_post_parse (GOptionContext *context,
}
/**
- * gnm_get_option_group:
+ * gnm_get_option_group: (skip)
*
* Returns a #GOptionGroup for the commandline arguments recognized
* by libspreadsheet. You should add this group to your #GOptionContext with
@@ -142,11 +142,14 @@ gnm_get_option_group (void)
}
/**
- * gnm_pre_parse_init :
- * @gnumeric_binary : argv[0]
+ * gnm_pre_parse_init:
+ * @argc:
+ * @argv:
*
* Initialization to be done before cmd line arguments are handled.
* Needs to be called first, before any other initialization.
+ *
+ * Returns: (transfer none): the arguments in UTF-8 encoding.
**/
gchar const **
gnm_pre_parse_init (int argc, gchar const **argv)
diff --git a/src/main-application.c b/src/main-application.c
index a854514..326a7b0 100644
--- a/src/main-application.c
+++ b/src/main-application.c
@@ -319,7 +319,7 @@ main (int argc, char const **argv)
}
go_io_context_processing_file (ioc, uri);
- wbv = wb_view_new_from_uri (uri, NULL, ioc, NULL);
+ wbv = workbook_view_new_from_uri (uri, NULL, ioc, NULL);
g_free (uri);
if (go_io_error_occurred (ioc) ||
diff --git a/src/mathfunc.c b/src/mathfunc.c
index b09d0e3..5dc59ef 100644
--- a/src/mathfunc.c
+++ b/src/mathfunc.c
@@ -5837,6 +5837,20 @@ pf (gnm_float x, gnm_float n1, gnm_float n2, gboolean lower_tail, gboolean log_p
#undef DEBUG_pfuncinverter
+/**
+ * pfuncinverter:
+ * @p:
+ * @shape:
+ * @lower_tail:
+ * @log_p:
+ * @xlow:
+ * @xhigh:
+ * @x0:
+ * @pfunc: (scope call):
+ * @dpfunc_dx: (scope call):
+ *
+ * Returns:
+ **/
gnm_float
pfuncinverter (gnm_float p, const gnm_float shape[],
gboolean lower_tail, gboolean log_p,
@@ -6001,8 +6015,19 @@ pfuncinverter (gnm_float p, const gnm_float shape[],
return x;
}
-/*
- * Discrete pfuncs only. (Specifically: only integer x are allowed.
+/**
+ * discpfuncinverter:
+ * @p:
+ * @shape:
+ * @lower_tail:
+ * @log_p:
+ * @xlow:
+ * @xhigh:
+ * @x0:
+ * @pfunc: (scope call):
+ *
+ * Discrete pfuncs only. (Specifically: only integer x are allowed).
+ * Returns:
*/
gnm_float
discpfuncinverter (gnm_float p, const gnm_float shape[],
diff --git a/src/mstyle.c b/src/mstyle.c
index 5c4b96b..d0afd33 100644
--- a/src/mstyle.c
+++ b/src/mstyle.c
@@ -670,7 +670,7 @@ gnm_style_dup (GnmStyle const *src)
* A new GnmStyle that contains any elements of @overlay that are set, and uses
* @base for anything that is not set in @overlay.
*
- * Returns A ref to a new GnmStyle.
+ * Returns: (transfer full): A ref to a new GnmStyle.
**/
GnmStyle *
gnm_style_new_merged (GnmStyle const *base, GnmStyle const *overlay)
@@ -1223,6 +1223,13 @@ gnm_style_get_pattern (GnmStyle const *style)
return style->pattern;
}
+/**
+ * gnm_style_get_font:
+ * @style: #GnmStyle
+ * @context: #PangoContext
+ *
+ * Returns: (transfer none):
+ **/
GnmFont *
gnm_style_get_font (GnmStyle const *style, PangoContext *context)
{
@@ -1649,6 +1656,12 @@ gnm_style_set_validation (GnmStyle *style, GnmValidation *v)
style->validation = v;
}
+/**
+ * gnm_style_get_validation:
+ * @style: #GnmStyle
+ *
+ * Returns: (transfer none):
+ **/
GnmValidation const *
gnm_style_get_validation (GnmStyle const *style)
{
@@ -1695,6 +1708,12 @@ gnm_style_set_input_msg (GnmStyle *style, GnmInputMsg *msg)
style->input_msg = msg;
}
+/**
+ * gnm_style_get_input_msg:
+ * @style: #GnmStyle
+ *
+ * Returns: (transfer none):
+ **/
GnmInputMsg *
gnm_style_get_input_msg (GnmStyle const *style)
{
@@ -1715,6 +1734,12 @@ gnm_style_set_conditions (GnmStyle *style, GnmStyleConditions *sc)
style->conditions = sc;
}
+/**
+ * gnm_style_get_conditions:
+ * @style: #GnmStyle
+ *
+ * Returns: (transfer none):
+ **/
GnmStyleConditions *
gnm_style_get_conditions (GnmStyle const *style)
{
diff --git a/src/parse-util.c b/src/parse-util.c
index 3d155d2..2d5f3a8 100644
--- a/src/parse-util.c
+++ b/src/parse-util.c
@@ -48,6 +48,27 @@
#include <glib.h>
#include <string.h>
+static GnmLexerItem *
+gnm_lexer_item_copy (GnmLexerItem *li)
+{
+ GnmLexerItem *res = g_new (GnmLexerItem, 1);
+ *res = *li;
+ return res;
+}
+
+GType
+gnm_lexer_item_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmLexerItem",
+ (GBoxedCopyFunc)gnm_lexer_item_copy,
+ (GBoxedFreeFunc)g_free);
+ }
+ return t;
+}
+
static void
col_name_internal (GString *target, int col)
{
@@ -671,7 +692,7 @@ cellpos_parse (char const *cell_str, GnmSheetSize const *ss,
}
/**
- * gnm_expr_char_start_p :
+ * gnm_expr_char_start_p:
*
* Can the supplied string be an expression ? It does not guarantee that it is,
* however, it is possible. If it is possible it strips off any header
@@ -804,6 +825,29 @@ parse_error_free (GnmParseError *pe)
}
}
+static GnmParseError *
+gnm_parse_error_copy (GnmParseError *pe)
+{
+ GnmParseError *res = g_new (GnmParseError, 1);
+ res->begin_char = pe->begin_char;
+ res->end_char = pe->end_char;
+ res->err = (pe->err)? g_error_copy (pe->err): NULL;
+ return res;
+}
+
+GType
+gnm_parse_error_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmParseError",
+ (GBoxedCopyFunc)gnm_parse_error_copy,
+ (GBoxedFreeFunc)parse_error_free);
+ }
+ return t;
+}
+
/***************************************************************************/
static char const *
diff --git a/src/parse-util.h b/src/parse-util.h
index 8154dd0..5399d30 100644
--- a/src/parse-util.h
+++ b/src/parse-util.h
@@ -80,7 +80,9 @@ typedef struct {
gsize start, end;
int token;
} GnmLexerItem;
+GType gnm_lexer_item_get_type (void); /* Boxed type */
+GType gnm_parse_error_get_type (void); /* Boxed type */
GnmParseError *parse_error_init (GnmParseError *pe);
void parse_error_free (GnmParseError *pe);
diff --git a/src/position.c b/src/position.c
index 2301d7d..f6cc7a0 100644
--- a/src/position.c
+++ b/src/position.c
@@ -31,9 +31,62 @@
#include "cell.h"
#include "value.h"
#include "ranges.h"
+#include <string.h>
#include "workbook.h"
+/* GnmCellPos made a boxed type */
+static GnmCellPos *
+gnm_cell_pos_dup (GnmCellPos *pos)
+{
+ GnmCellPos *res = g_new (GnmCellPos, 1);
+ *res = *pos;
+ return res;
+}
+
+GType
+gnm_cell_pos_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmCellPos",
+ (GBoxedCopyFunc)gnm_cell_pos_dup,
+ (GBoxedFreeFunc)g_free);
+ }
+ return t;
+}
+
+/* GnmEvalPos made a boxed type */
+static GnmEvalPos *
+gnm_eval_pos_dup (GnmEvalPos *ep)
+{
+ GnmEvalPos *res = g_new0 (GnmEvalPos, 1);
+ memcpy (res, ep, sizeof (GnmEvalPos)); /* is this safe? */
+ return res;
+}
+
+GType
+gnm_eval_pos_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmEvalPos",
+ (GBoxedCopyFunc)gnm_eval_pos_dup,
+ (GBoxedFreeFunc)g_free);
+ }
+ return t;
+}
+/**
+ * eval_pos_init:
+ * @ep: (transfer full): The position to init.
+ * @s: #Sheet
+ * @col: column.
+ * @row: row
+ *
+ * Returns: (transfer full): the initialized #GnmEvalPos (@ep).
+ **/
GnmEvalPos *
eval_pos_init (GnmEvalPos *ep, Sheet *sheet, int col, int row)
{
@@ -49,6 +102,14 @@ eval_pos_init (GnmEvalPos *ep, Sheet *sheet, int col, int row)
return ep;
}
+/**
+ * eval_pos_init_pos:
+ * @ep: (transfer full): The position to init.
+ * @s: #Sheet
+ * @pos: #GnmCellPos
+ *
+ * Returns: (transfer full): the initialized #GnmEvalPos (@ep).
+ **/
GnmEvalPos *
eval_pos_init_pos (GnmEvalPos *ep, Sheet *sheet, GnmCellPos const *pos)
{
@@ -64,6 +125,13 @@ eval_pos_init_pos (GnmEvalPos *ep, Sheet *sheet, GnmCellPos const *pos)
return ep;
}
+/**
+ * eval_pos_init_dep:
+ * @ep: (transfer full): The position to init.
+ * @dep:
+ *
+ * Returns: (transfer full): the initialized #GnmEvalPos (@ep).
+ **/
GnmEvalPos *
eval_pos_init_dep (GnmEvalPos *ep, GnmDependent const *dep)
{
@@ -82,16 +150,14 @@ eval_pos_init_dep (GnmEvalPos *ep, GnmDependent const *dep)
}
/**
- * eval_pos_init_editpos :
- *
- * @ep : The position to init.
- * @sv : Sheetview
+ * eval_pos_init_editpos:
+ * @ep: (transfer full): The position to init.
+ * @sv: @Sheetview
*
* The function initializes an evalpos with the edit position from the
* given sheetview.
- *
- * Returns @ep
- */
+ * Returns: (transfer full): the initialized #GnmEvalPos (@ep).
+ **/
GnmEvalPos *
eval_pos_init_editpos (GnmEvalPos *ep, SheetView const *sv)
{
@@ -103,14 +169,13 @@ eval_pos_init_editpos (GnmEvalPos *ep, SheetView const *sv)
}
/**
- * eval_pos_init_cell :
- *
- * @ep : The position to init.
- * @cell : A cell
+ * eval_pos_init_cell:
+ * @ep: (transfer full): The position to init.
+ * @cell: A cell
*
* The function initializes an evalpos with the given cell
*
- * Returns @ep
+ * Returns: (transfer full): the initialized #GnmEvalPos (@ep).
*/
GnmEvalPos *
eval_pos_init_cell (GnmEvalPos *ep, GnmCell const *cell)
@@ -126,6 +191,15 @@ eval_pos_init_cell (GnmEvalPos *ep, GnmCell const *cell)
return ep;
}
+/**
+ * eval_pos_init_cell:
+ * @ep: (transfer full): The position to init.
+ * @cell: A cell
+ *
+ * The function initializes an evalpos with the given sheet.
+ *
+ * Returns: (transfer full): the initialized #GnmEvalPos (@ep).
+ */
GnmEvalPos *
eval_pos_init_sheet (GnmEvalPos *ep, Sheet const *sheet)
{
@@ -141,17 +215,39 @@ eval_pos_init_sheet (GnmEvalPos *ep, Sheet const *sheet)
}
+static GnmParsePos *
+gnm_parse_pos_dup (GnmParsePos *ep)
+{
+ GnmParsePos *res = g_new0 (GnmParsePos, 1);
+ memcpy (res, ep, sizeof (GnmParsePos)); /* is this safe? */
+ return res;
+}
+
+GType
+gnm_parse_pos_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmParsePos",
+ (GBoxedCopyFunc)gnm_parse_pos_dup,
+ (GBoxedFreeFunc)g_free);
+ }
+ return t;
+}
+
/*
- * parse_pos_init :
+ * parse_pos_init:
*
- * @pp : The position to init.
- * @sheet : The sheet being selected
- * @wb : The workbook being selected.
- * @row :
- * @col :
+ * @pp: (transfer full): The position to init.
+ * @sheet: The sheet being selected
+ * @wb: The workbook being selected.
+ * @row:
+ * @col:
*
* Use either a sheet (preferred) or a workbook to initialize the supplied
* ParsePosition.
+ * Returns: (transfer full): the initialized #GnmParsePos (@pp).
*/
GnmParsePos *
parse_pos_init (GnmParsePos *pp, Workbook *wb, Sheet const *sheet,
@@ -172,10 +268,11 @@ parse_pos_init (GnmParsePos *pp, Workbook *wb, Sheet const *sheet,
}
/*
- * parse_pos_init_dep :
+ * parse_pos_init_dep:
+ * @pp: (transfer full): The position to init.
+ * @dep: The dependent
*
- * @pp : The position to init.
- * @dep : The dependent
+ * Returns: (transfer full): the initialized #GnmParsePos (@pp).
*/
GnmParsePos *
parse_pos_init_dep (GnmParsePos *pp, GnmDependent const *dep)
@@ -192,6 +289,13 @@ parse_pos_init_dep (GnmParsePos *pp, GnmDependent const *dep)
return pp;
}
+/*
+ * parse_pos_init_cell:
+ * @pp: (transfer full): The position to init.
+ * @cell: The cell
+ *
+ * Returns: (transfer full): the initialized #GnmParsePos (@pp).
+ */
GnmParsePos *
parse_pos_init_cell (GnmParsePos *pp, GnmCell const *cell)
{
@@ -203,6 +307,13 @@ parse_pos_init_cell (GnmParsePos *pp, GnmCell const *cell)
cell->pos.col, cell->pos.row);
}
+/*
+ * parse_pos_init_evalpos:
+ * @pp: (transfer full): The position to init.
+ * @ep: #GnmEvalPos
+ *
+ * Returns: (transfer full): the initialized #GnmParsePos (@pp).
+ */
GnmParsePos *
parse_pos_init_evalpos (GnmParsePos *pp, GnmEvalPos const *ep)
{
@@ -211,6 +322,13 @@ parse_pos_init_evalpos (GnmParsePos *pp, GnmEvalPos const *ep)
return parse_pos_init (pp, NULL, ep->sheet, ep->eval.col, ep->eval.row);
}
+/*
+ * parse_pos_init_editpos:
+ * @pp: (transfer full): The position to init.
+ * @sv: sheet view
+ *
+ * Returns: (transfer full): the initialized #GnmParsePos (@pp).
+ */
GnmParsePos *
parse_pos_init_editpos (GnmParsePos *pp, SheetView const *sv)
{
@@ -220,6 +338,13 @@ parse_pos_init_editpos (GnmParsePos *pp, SheetView const *sv)
sv->edit_pos.col, sv->edit_pos.row);
}
+/*
+ * parse_pos_init_sheet:
+ * @pp: (transfer full): The position to init.
+ * @sheet: The sheet
+ *
+ * Returns: (transfer full): the initialized #GnmParsePos (@pp).
+ */
GnmParsePos *
parse_pos_init_sheet (GnmParsePos *pp, Sheet const *sheet)
{
@@ -230,6 +355,27 @@ parse_pos_init_sheet (GnmParsePos *pp, Sheet const *sheet)
/********************************************************************************/
+
+static GnmCellRef *
+gnm_cellref_dup (GnmCellRef *ep)
+{
+ GnmCellRef *res = g_new0 (GnmCellRef, 1);
+ memcpy (res, ep, sizeof (GnmCellRef)); /* is this safe? */
+ return res;
+}
+
+GType
+gnm_cellref_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmCellRef",
+ (GBoxedCopyFunc)gnm_cellref_dup,
+ (GBoxedFreeFunc)g_free);
+ }
+ return t;
+}
GnmCellRef *
gnm_cellref_init (GnmCellRef *ref, Sheet *sheet, int col, int row, gboolean relative)
{
@@ -403,6 +549,19 @@ gnm_rangeref_dup (GnmRangeRef const *rr)
return res;
}
+GType
+gnm_rangeref_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmRangeRef",
+ (GBoxedCopyFunc)gnm_rangeref_dup,
+ (GBoxedFreeFunc)g_free);
+ }
+ return t;
+}
+
/**
* gnm_rangeref_normalize : Take a range_ref and normalize it
* by converting to absolute coords and handling inversions.
diff --git a/src/position.h b/src/position.h
index 0b6c0c8..fcefafa 100644
--- a/src/position.h
+++ b/src/position.h
@@ -6,6 +6,8 @@
G_BEGIN_DECLS
+GType gnm_cell_pos_get_type (void); /* boxed type */
+
struct _GnmEvalPos {
GnmCellPos eval;
Sheet *sheet;
@@ -26,6 +28,7 @@ struct _GnmParsePos {
#define eval_sheet(a,b) (((a) != NULL) ? (a) : (b))
/* Initialization routines for Evaluation Positions */
+GType gnm_eval_pos_get_type (void); /* Boxed type */
GnmEvalPos *eval_pos_init (GnmEvalPos *ep, Sheet *s, int col, int row);
GnmEvalPos *eval_pos_init_pos (GnmEvalPos *ep, Sheet *s, GnmCellPos const *pos);
GnmEvalPos *eval_pos_init_dep (GnmEvalPos *ep, GnmDependent const *dep);
@@ -35,6 +38,7 @@ GnmEvalPos *eval_pos_init_sheet (GnmEvalPos *ep, Sheet const *sheet);
#define eval_pos_is_array_context(ep) ((ep)->array != NULL)
/* Initialization routines for Parse Positions */
+GType gnm_parse_pos_get_type (void); /* Boxed type */
GnmParsePos *parse_pos_init (GnmParsePos *pp, Workbook *wb,
Sheet const *sheet, int col, int row);
GnmParsePos *parse_pos_init_dep (GnmParsePos *pp, GnmDependent const *dep);
@@ -56,6 +60,7 @@ struct _GnmRangeRef {
GnmCellRef a, b;
};
+GType gnm_cellref_get_type (void); /* Boxed type */
GnmCellRef *gnm_cellref_init (GnmCellRef *ref, Sheet *sheet,
int col, int row, gboolean rel);
gboolean gnm_cellref_equal (GnmCellRef const *a, GnmCellRef const *b);
@@ -69,6 +74,7 @@ void gnm_cellref_set_row_ar (GnmCellRef *cr, GnmParsePos const *pp,
int gnm_cellref_get_col (GnmCellRef const *cr, GnmEvalPos const *ep);
int gnm_cellref_get_row (GnmCellRef const *cr, GnmEvalPos const *ep);
+GType gnm_rangeref_get_type (void); /* Boxed type */
gboolean gnm_rangeref_equal (GnmRangeRef const *a, GnmRangeRef const *b);
guint gnm_rangeref_hash (GnmRangeRef const *cr);
GnmRangeRef *gnm_rangeref_dup (GnmRangeRef const *cr);
diff --git a/src/print-info.c b/src/print-info.c
index c507685..52c171b 100644
--- a/src/print-info.c
+++ b/src/print-info.c
@@ -168,6 +168,19 @@ print_hf_free (PrintHF *print_hf)
g_free (print_hf);
}
+GType
+print_hf_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("PrintHF",
+ (GBoxedCopyFunc)print_hf_copy,
+ (GBoxedFreeFunc)print_hf_free);
+ }
+ return t;
+}
+
void
print_info_free (PrintInformation *pi)
{
@@ -339,13 +352,13 @@ print_info_load_defaults (PrintInformation *res)
}
/**
- * print_info_new:
+ * print_information_new:
*
* Returns a newly allocated PrintInformation buffer
*
*/
PrintInformation *
-print_info_new (gboolean load_defaults)
+print_information_new (gboolean load_defaults)
{
PrintInformation *res = g_new0 (PrintInformation, 1);
@@ -765,6 +778,36 @@ hf_render_info_destroy (HFRenderInfo *hfi)
g_free (hfi);
}
+static HFRenderInfo *
+hf_render_info_copy (HFRenderInfo *hfi)
+{
+ HFRenderInfo *res;
+ g_return_val_if_fail (hfi != NULL, NULL);
+
+ res = g_new (HFRenderInfo, 1);
+ res->sheet = hfi->sheet;
+ res->page = hfi->page;
+ res->pages = hfi->pages;
+ res->date_time = value_dup (hfi->date_time);
+ res->date_conv = hfi->date_conv;
+ res->page_area = hfi->page_area;
+ res->top_repeating = hfi->top_repeating;
+ return res;
+}
+
+GType
+hf_render_info_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("HFRenderInfo",
+ (GBoxedCopyFunc)hf_render_info_copy,
+ (GBoxedFreeFunc)hf_render_info_destroy);
+ }
+ return t;
+}
+
static void
pdf_write_workbook (G_GNUC_UNUSED GOFileSaver const *fs,
G_GNUC_UNUSED GOIOContext *context,
@@ -942,7 +985,7 @@ print_shutdown (void)
PrintInformation *
print_info_dup (PrintInformation const *src)
{
- PrintInformation *dst = print_info_new (TRUE);
+ PrintInformation *dst = print_information_new (TRUE);
print_info_load_defaults ((PrintInformation *)src);
@@ -1290,6 +1333,12 @@ print_info_get_paper_height (PrintInformation *pi, GtkUnit unit)
return gtk_page_setup_get_paper_height (pi->page_setup, unit);
}
+/**
+ * print_info_get_page_setup:
+ * @pi: #PrintInformation
+ *
+ * Returns: (transfer none): the page setup.
+ **/
GtkPageSetup*
print_info_get_page_setup (PrintInformation *pi)
{
@@ -1438,6 +1487,19 @@ gnm_page_breaks_free (GnmPageBreaks *breaks)
}
}
+GType
+gnm_page_breaks_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmPageBreaks",
+ (GBoxedCopyFunc)gnm_page_breaks_dup,
+ (GBoxedFreeFunc)gnm_page_breaks_free);
+ }
+ return t;
+}
+
GnmPageBreaks *
gnm_page_breaks_dup_non_auto_breaks (GnmPageBreaks const *src)
{
diff --git a/src/print-info.h b/src/print-info.h
index a24a26f..351fada 100644
--- a/src/print-info.h
+++ b/src/print-info.h
@@ -129,7 +129,7 @@ typedef struct {
} HFRenderInfo;
GType print_information_get_type (void);
-PrintInformation *print_info_new (gboolean load_defaults);
+PrintInformation *print_information_new (gboolean load_defaults);
PrintInformation *print_info_load_defaults (PrintInformation *pi);
PrintInformation *print_info_dup (PrintInformation const *pi);
void print_info_free (PrintInformation *pi);
@@ -138,6 +138,7 @@ void print_info_save (PrintInformation *pi);
GtkPageSetup *print_info_get_page_setup (PrintInformation *pi); /* Does not return a ref! */
void print_info_set_page_setup (PrintInformation *pi, GtkPageSetup *page_setup);
+GType print_hf_get_type (void);
PrintHF *print_hf_new (char const *left,
char const *middle,
char const *right);
@@ -149,6 +150,8 @@ gboolean print_hf_same (PrintHF const *a, PrintHF const *b);
char *hf_format_render (char const *format,
HFRenderInfo *info,
HFRenderType render_type);
+
+GType hf_render_info_get_type (void);
HFRenderInfo *hf_render_info_new (void);
void hf_render_info_destroy (HFRenderInfo *hfi);
@@ -204,6 +207,7 @@ void print_info_set_breaks (PrintInformation *pi, GnmPageBreaks *breaks);
gboolean print_info_has_manual_breaks (PrintInformation *pi);
+GType gnm_page_breaks_get_type (void);
GnmPageBreaks *gnm_page_breaks_new (gboolean is_vert);
GnmPageBreaks *gnm_page_breaks_dup (GnmPageBreaks const *src);
void gnm_page_breaks_free (GnmPageBreaks *breaks);
diff --git a/src/ranges.c b/src/ranges.c
index 40af748..1a58b97 100644
--- a/src/ranges.c
+++ b/src/ranges.c
@@ -161,7 +161,8 @@ range_parse (GnmRange *r, char const *text, GnmSheetSize const *ss)
/**
* range_list_destroy:
- * @ranges: a list of value ranges to destroy.
+ * @ranges: (element-type GnmValue) (transfer full): a list of value ranges
+ * to destroy.
*
* Destroys a list of ranges returned from parse_cell_range_list
**/
@@ -265,7 +266,7 @@ range_contained (GnmRange const *a, GnmRange const *b)
* overlapping remainder of soft as the first list item
* ( the central region in the pathalogical case ).
*
- * Return value: A list of fragments.
+ * Returns: (element-type GnmRange) (transfer full): A list of fragments.
**/
GSList *
range_split_ranges (GnmRange const *hard, GnmRange const *soft)
@@ -428,7 +429,7 @@ range_split_ranges (GnmRange const *hard, GnmRange const *soft)
*
* Copies the @r range.
*
- * Return value: A copy of the GnmRange.
+ * Returns: (transfer full): A copy of the GnmRange.
**/
GnmRange *
gnm_range_dup (GnmRange const *a)
@@ -445,8 +446,8 @@ gnm_range_dup (GnmRange const *a)
*
* Fragments the ranges into totaly non-overlapping regions,
*
- * Return value: A list of fragmented ranges or at minimum
- * simply a and b.
+ * Returns: (element-type GnmRange) (transfer full): A list of fragmented
+ * ranges or at minimum simply a and b.
**/
GSList *
range_fragment (GnmRange const *a, GnmRange const *b)
@@ -498,7 +499,7 @@ range_intersection (GnmRange *r, GnmRange const *a, GnmRange const *b)
/**
* range_normalize:
- * @r: a range
+ * @src: a range
*
* Ensures that start <= end for rows and cols.
**/
@@ -708,7 +709,7 @@ range_is_sane (GnmRange const *range)
* range_transpose:
* @range: The range.
* @sheet: the sheet in which @range lives
- * @boundary: The box to transpose inside
+ * @origin: The box to transpose inside
*
* Effectively mirrors the ranges in 'boundary' around a
* leading diagonal projected from offset.
@@ -966,7 +967,7 @@ range_list_name_try (GString *names, char const *sheet, GSList const *ranges)
/**
* undo_range_list_name:
* @sheet:
- * @ranges: GSList containing GnmRange *'s
+ * @ranges: (element-type GnmRange): 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
@@ -1065,6 +1066,16 @@ global_range_list_parse (Sheet *sheet, char const *str)
return g_slist_reverse (ranges);
}
+/**
+ * global_range_list_foreach:
+ * @gr_list: (element-type GnmRange): list of ranges.
+ * @ep:
+ * @flags:
+ * @handler: (scope call):
+ * @closure:Âuser data.
+ *
+ * Returns: (transfer none):
+ **/
GnmValue *
global_range_list_foreach (GSList *gr_list, GnmEvalPos const *ep,
CellIterFlags flags,
diff --git a/src/rendered-value.c b/src/rendered-value.c
index 7fcbaf0..32cc94f 100644
--- a/src/rendered-value.c
+++ b/src/rendered-value.c
@@ -197,13 +197,13 @@ rv_adjust_attributes (PangoAttrList *markup, double zoom, double scale, int rise
/**
- * gnm_rendered_value_new:
+ * gnm_rendered_value_new: (skip)
* @cell: The cell
- * @allow_variable_width : Allow format to depend on column width.
+ * @variable_width: Allow format to depend on column width.
*
* Formats the value of the cell according to the format style given in @mstyle
*
- * Return value: a new GnmRenderedValue
+ * Returns: a new GnmRenderedValue
**/
GnmRenderedValue *
gnm_rendered_value_new (GnmCell const *cell,
@@ -528,6 +528,13 @@ gnm_rendered_value_destroy (GnmRenderedValue *rv)
CHUNK_FREE (rendered_value_pool, rv);
}
+/**
+ * gnm_rendered_value_recontext: (skip)
+ * @rv: #GnmRenderedValue
+ * @context: the new Pango context.
+ *
+ * Returns:
+ **/
GnmRenderedValue *
gnm_rendered_value_recontext (GnmRenderedValue *rv, PangoContext *context)
{
@@ -607,6 +614,13 @@ debug_rvc (void)
return res > 0;
}
+/**
+ * gnm_rvc_new: (skip)
+ * @context: The context
+ * @size:
+ *
+ * Returns: a new GnmRenderedValueCollection
+ **/
GnmRenderedValueCollection *
gnm_rvc_new (PangoContext *context, gsize size)
{
@@ -640,6 +654,13 @@ gnm_rvc_free (GnmRenderedValueCollection *rvc)
g_free (rvc);
}
+/**
+ * gnm_rvc_query: (skip)
+ * @rvc: The rendered value collection
+ * @cell: #GnmCell
+ *
+ * Returns: the rendered value for @cell.
+ **/
GnmRenderedValue *
gnm_rvc_query (GnmRenderedValueCollection *rvc, GnmCell const *cell)
{
diff --git a/src/search.c b/src/search.c
index ef68db9..9fd964f 100644
--- a/src/search.c
+++ b/src/search.c
@@ -197,7 +197,13 @@ search_collect_cells_cb (GnmCellIter const *iter, gpointer user)
return NULL;
}
-/* Collect a list of all cells subject to search. */
+/**
+ * gnm_search_collect_cells:
+ * @sr: #GnmSearchReplace
+ *
+ * Collect a list of all cells subject to search.
+ * Returns: (element-type GnmEvalPos) (transfer full): the newly created array.
+ **/
GPtrArray *
gnm_search_collect_cells (GnmSearchReplace *sr)
{
@@ -253,11 +259,13 @@ gnm_search_collect_cells_free (GPtrArray *cells)
}
/* ------------------------------------------------------------------------- */
-/*
- * sr: The search spec.
- * cells: An array of GnmEvalPos*, presumably a result of gnm_search_collect_cells.
+/**
+ * gnm_search_filter_matching:
+ * @sr: The search spec.
+ * @cells: An array of GnmEvalPos*, presumably a result of gnm_search_collect_cells.
*
- * Returns an array of GnmSearchFilterResult*s, which the caller must free.
+ * Returns: (element-type GnmSearchReplace) (transfer full): an array of
+ * GnmSearchFilterResult*s, which the caller must free.
*/
GPtrArray *
diff --git a/src/selection.c b/src/selection.c
index ddbf9cf..4289159 100644
--- a/src/selection.c
+++ b/src/selection.c
@@ -33,12 +33,12 @@
/**
* sv_selection_calc_simplification:
- * @sv :
+ * @sv:
* @mode:
*
* Create the simplified seelction list if necessary
*
- * Returns the simplified version
+ * Returns: the simplified version
**/
static GSList *
@@ -90,7 +90,7 @@ sv_selection_calc_simplification (SheetView const *sv)
/**
* sv_is_singleton_selected:
- * @sv :
+ * @sv:
*
* See if the 1st selected region is a singleton.
*
@@ -107,12 +107,12 @@ sv_is_singleton_selected (SheetView const *sv)
}
/**
- * sv_is_pos_selected :
- * @sv :
- * @col :
- * @row :
+ * sv_is_pos_selected:
+ * @sv:
+ * @col:
+ * @row:
*
- * Returns TRUE if the supplied position is selected in view @sv.
+ * Returns: TRUE if the supplied position is selected in view @sv.
**/
gboolean
sv_is_pos_selected (SheetView const *sv, int col, int row)
@@ -130,11 +130,11 @@ sv_is_pos_selected (SheetView const *sv, int col, int row)
}
/**
- * sv_is_range_selected :
- * @sv :
- * @r :
+ * sv_is_range_selected:
+ * @sv:
+ * @r:
*
- * Returns TRUE If @r overlaps with any part of the selection in @sv.
+ * Returns: TRUE If @r overlaps with any part of the selection in @sv.
**/
gboolean
sv_is_range_selected (SheetView const *sv, GnmRange const *r)
@@ -152,10 +152,10 @@ sv_is_range_selected (SheetView const *sv, GnmRange const *r)
}
/**
- * sv_is_full_range_selected :
+ * sv_is_full_range_selected:
*
- * @sv :
- * @r :
+ * @sv:
+ * @r:
*
* Returns TRUE if all of @r is contained by the selection in @sv.
**/
@@ -175,8 +175,8 @@ sv_is_full_range_selected (SheetView const *sv, GnmRange const *r)
}
/*
- * sv_is_colrow_selected :
- * @sv : containing the selection
+ * sv_is_colrow_selected:
+ * @sv: containing the selection
* @colrow: The column or row number we are interested in.
* @is_col: A flag indicating whether this it is a column or a row.
*
@@ -216,11 +216,11 @@ sv_is_colrow_selected (SheetView const *sv, int colrow, gboolean is_col)
/**
* sv_is_full_colrow_selected
- * @sv :
- * @is_cols :
- * @index :
+ * @sv:
+ * @is_cols:
+ * @index:
*
- * Returns TRUE if all of the selected cols/rows in the selection
+ * Returns: TRUE if all of the selected cols/rows in the selection
* are fully selected and the selection contains the specified col.
**/
gboolean
@@ -251,11 +251,11 @@ sv_is_full_colrow_selected (SheetView const *sv, gboolean is_cols, int index)
}
/**
- * sv_selection_col_type :
- * @sv :
- * @col :
+ * sv_selection_col_type:
+ * @sv:
+ * @col:
*
- * Returns How much of column @col is selected in @sv.
+ * Returns: How much of column @col is selected in @sv.
**/
ColRowSelectionType
sv_selection_col_type (SheetView const *sv, int col)
@@ -287,11 +287,11 @@ sv_selection_col_type (SheetView const *sv, int col)
}
/**
- * sv_selection_row_type :
- * @sv :
- * @col :
+ * sv_selection_row_type:
+ * @sv:
+ * @col:
*
- * Returns How much of column @col is selected in @sv.
+ * Returns: How much of column @col is selected in @sv.
**/
ColRowSelectionType
sv_selection_row_type (SheetView const *sv, int row)
@@ -352,10 +352,10 @@ segments_intersect (int const s_a, int const e_a,
}
/**
- * sv_menu_enable_insert :
- * @sv :
- * @col :
- * @row :
+ * sv_menu_enable_insert:
+ * @sv:
+ * @col:
+ * @row:
*
* control whether or not it is ok to insert cols or rows. An internal routine
* used by the selection mechanism to avoid erasing the entire sheet when
@@ -391,9 +391,9 @@ sv_menu_enable_insert (SheetView *sv, gboolean col, gboolean row)
/**
* selection_first_range
- * @sv : The #SheetView whose selection we are testing.
- * @wbc : The calling context to report errors to (GUI or corba)
- * @command_name : A string naming the operation requiring a single range.
+ * @sv: The #SheetView whose selection we are testing.
+ * @cc: The calling context to report errors to (GUI or corba)
+ * @cmd_name: A string naming the operation requiring a single range.
*
* Returns the first range, if a control is supplied it displays an error if
* there is more than one range.
@@ -670,11 +670,14 @@ sv_selection_simplify (SheetView *sv)
}
/**
- * sv_selection_add_full :
- * @sv : #SheetView whose selection is append to.
- * @edit_{col,row} : cell to mark as the new edit cursor.
- * @base_{col,row} : stationary corner of the newly selected range.
- * @move_{col,row} : moving corner of the newly selected range.
+ * sv_selection_add_full:
+ * @sv: #SheetView whose selection is append to.
+ * @edit_col:
+ * @edit_row: cell to mark as the new edit cursor.
+ * @base_col:
+ * @base_row: stationary corner of the newly selected range.
+ * @move_col:
+ * @move_row: moving corner of the newly selected range.
*
* Prepends a range to the selection list and sets the edit position.
**/
@@ -747,7 +750,7 @@ sv_selection_simplified_free (SheetView *sv)
}
/**
- * sv_selection_reset :
+ * sv_selection_reset:
* @sv: The sheet view
*
* Releases the selection associated with @sv , and forces a redraw of the
@@ -785,9 +788,10 @@ sv_selection_reset (SheetView *sv)
/**
* selection_get_ranges:
* @sv: #SheetView
- * @allow_intersection : Divide the selection into nonoverlapping subranges.
+ * @allow_intersection: Divide the selection into nonoverlapping subranges.
*
* Caller is responsible for free the list and the content.
+ * Returns: (element-type GnmRange) (transfer full):
**/
GSList *
selection_get_ranges (SheetView const *sv, gboolean allow_intersection)
@@ -1075,9 +1079,9 @@ selection_get_ranges (SheetView const *sv, gboolean allow_intersection)
/**
* sv_selection_apply:
* @sv: #SheetView
- * @func: The function to apply.
- * @allow_intersection : Call the routine for the non-intersecting subregions.
- * @closure : A parameter to pass to each invocation of @func.
+ * @func: (scope call): The function to apply.
+ * @allow_intersection: Call the routine for the non-intersecting subregions.
+ * @user_data: A parameter to pass to each invocation of @func.
*
* Applies the specified function for all ranges in the selection. Optionally
* select whether to use the high level potentially over lapped ranges, rather
@@ -1183,10 +1187,10 @@ selection_to_string (SheetView *sv, gboolean include_sheet_name_prefix)
}
/**
- * sv_selection_foreach :
- * @sv : The whose selection is being iterated.
- * @range_cb : A function to call for each selected range.
- * @user_data :
+ * sv_selection_foreach:
+ * @sv: The whose selection is being iterated.
+ * @handler: (scope call): A function to call for each selected range.
+ * @user_data:
*
* Iterate through the ranges in a selection.
* NOTE : The function assumes that the callback routine does NOT change the
@@ -1228,16 +1232,15 @@ sheet_selection_is_allowed (Sheet const *sheet, GnmCellPos const *pos)
}
/**
- * walk_boundaries : Iterates through a region by row then column.
- *
- * @sv : The sheet being iterated in
- * @bound : The bounding range
- * @forward : iterate forward or backwards
- * @horizontal : across then down
+ * walk_boundaries: Iterates through a region by row then column.
+ * @sv: The sheet being iterated in
+ * @bound: The bounding range
+ * @forward: iterate forward or backwards
+ * @horizontal: across then down
* @smart_merge: iterate into merged cells only at their corners
- * @res : The result.
+ * @res: The result.
*
- * returns TRUE if the cursor leaves the boundary region.
+ * Returns: TRUE if the cursor leaves the boundary region.
**/
static gboolean
walk_boundaries (SheetView const *sv, GnmRange const * const bound,
@@ -1318,10 +1321,10 @@ loop :
}
/**
- * sv_selection_walk_step :
- * @sv : #SheetView
- * @forward :
- * @horizontal :
+ * sv_selection_walk_step:
+ * @sv: #SheetView
+ * @forward:
+ * @horizontal:
*
* Move the edit_pos of @sv 1 step according to @forward and @horizontal. The
* behavior depends several factors
diff --git a/src/sheet-control-gui.c b/src/sheet-control-gui.c
index cb652f2..df3970f 100644
--- a/src/sheet-control-gui.c
+++ b/src/sheet-control-gui.c
@@ -82,6 +82,14 @@ static void scg_unant (SheetControl *sc);
static void set_resize_pane_pos (SheetControlGUI *scg, GtkPaned *p);
static void cb_resize_pane_motion (GtkPaned *p, GParamSpec *pspec, SheetControlGUI *scg);
+
+/**
+ * scg_pane:
+ * @scg: #SheetControlGUI
+ * @pane: the pane index.
+ *
+ * Returns: (transfer none): the pane.
+ **/
GnmPane *
scg_pane (SheetControlGUI *scg, int p)
{
@@ -93,7 +101,12 @@ scg_pane (SheetControlGUI *scg, int p)
return scg->pane[p];
}
-
+/**
+ * scg_view:
+ * @scg: #SheetControlGUI
+ *
+ * Returns: (transfer none): the sheet view.
+ **/
SheetView *
scg_view (SheetControlGUI const *scg)
{
@@ -101,12 +114,26 @@ scg_view (SheetControlGUI const *scg)
return scg->sheet_control.view;
}
+
+/**
+ * scg_sheet:
+ * @scg: #SheetControlGUI
+ *
+ * Returns: (transfer none): the sheet.
+ **/
Sheet *
scg_sheet (SheetControlGUI const *scg)
{
return sc_sheet ((SheetControl *)scg);
}
+
+/**
+ * scg_wbc:
+ * @scg: #SheetControlGUI
+ *
+ * Returns: (transfer none): the workbook control.
+ **/
WorkbookControl *
scg_wbc (SheetControlGUI const *scg)
{
@@ -114,6 +141,14 @@ scg_wbc (SheetControlGUI const *scg)
return scg->sheet_control.wbc;
}
+
+/**
+ * scg_wbcg:
+ * @scg: #SheetControlGUI
+ *
+ * Returns: (transfer none): the #WBCGtk.
+ **/
+
WBCGtk *
scg_wbcg (SheetControlGUI const *scg)
{
@@ -983,11 +1018,11 @@ gnm_pane_make_cell_visible (GnmPane *pane, int col, int row,
/**
* scg_make_cell_visible
- * @scg : The gui control
- * @col :
- * @row :
- * @force_scroll : Completely recalibrate the offsets to the new position
- * @couple_panes : Scroll scroll dynamic panes back to bounds if target
+ * @scg: The gui control
+ * @col:
+ * @row:
+ * @force_scroll: Completely recalibrate the offsets to the new position
+ * @couple_panes: Scroll scroll dynamic panes back to bounds if target
* is in frozen segment.
*
* Ensure that cell (col, row) is visible.
@@ -2424,7 +2459,7 @@ scg_cursor_visible (SheetControlGUI *scg, gboolean is_visible)
/**
* scg_mode_edit:
- * @sc: The sheet control
+ * @scg: The sheet control
*
* Put @sheet into the standard state 'edit mode'. This shuts down
* any object editing and frees any objects that are created but not
@@ -2493,7 +2528,7 @@ calc_obj_place (GnmPane *pane, gint64 canvas_coord, gboolean is_col,
/**
* scg_object_select
* @scg: The #SheetControl to edit in.
- * @so : The #SheetObject to select.
+ * @so: The #SheetObject to select.
*
* Adds @so to the set of selected objects and prepares it for user editing.
* Adds a reference to @ref if it is selected.
@@ -3436,11 +3471,11 @@ scg_rangesel_extend (SheetControlGUI *scg, int n,
/**
* scg_cursor_move:
*
- * @scg : The scg
- * @count : Number of units to move the cursor
+ * @scg: The scg
+ * @dir: Number of units to move the cursor
* @jump_to_bound: skip from the start to the end of ranges
* of filled or unfilled cells.
- * @horiz : is the movement horizontal or vertical
+ * @horiz: is the movement horizontal or vertical
*
* Moves the cursor count rows
*/
@@ -3657,13 +3692,12 @@ cb_scg_queued_movement (SheetControlGUI *scg)
}
/**
- * scg_queue_movement :
- *
- * @scg :
- * @handler : The movement handler
- * @n : how far
- * @jump : TRUE jump to bound
- * @horiz : TRUE move by cols
+ * scg_queue_movement:
+ * @scg:
+ * @handler: (scope async): The movement handler
+ * @n: how far
+ * @jump: TRUE jump to bound
+ * @horiz: TRUE move by cols
*
* Do motion compression when possible to avoid redrawing an area that will
* disappear when we scroll again.
@@ -3797,7 +3831,7 @@ scg_drag_receive_spreadsheet (SheetControlGUI *scg, const gchar *uri)
if (input != NULL) {
WorkbookView *wbv;
- wbv = wb_view_new_from_input (input, uri, NULL, ioc, NULL);
+ wbv = workbook_view_new_from_input (input, uri, NULL, ioc, NULL);
if (wbv != NULL)
gui_wb_view_show (scg->wbcg,
wbv);
diff --git a/src/sheet-control.c b/src/sheet-control.c
index 4009b67..87f6a4f 100644
--- a/src/sheet-control.c
+++ b/src/sheet-control.c
@@ -63,6 +63,12 @@ sc_class_init (GObjectClass *object_class)
GSF_CLASS (SheetControl, sheet_control,
sc_class_init, NULL, G_TYPE_OBJECT)
+/**
+ * sc_wbc:
+ * @sc: #SheetControl
+ *
+ * Returns: (transfer none): the workbook control.
+ **/
WorkbookControl *
sc_wbc (SheetControl const *sc)
{
@@ -70,6 +76,12 @@ sc_wbc (SheetControl const *sc)
return sc->wbc;
}
+/**
+ * sc_sheet:
+ * @sc: #SheetControl
+ *
+ * Returns: (transfer none): the sheet.
+ **/
Sheet *
sc_sheet (SheetControl const *sc)
{
@@ -77,6 +89,12 @@ sc_sheet (SheetControl const *sc)
return sc->view ? sc->view->sheet : NULL;
}
+/**
+ * sc_view:
+ * @sc: #SheetControl
+ *
+ * Returns: (transfer none): the sheet view.
+ **/
SheetView *
sc_view (SheetControl const *sc)
{
diff --git a/src/sheet-filter.c b/src/sheet-filter.c
index f3d6c78..7b9e5db 100644
--- a/src/sheet-filter.c
+++ b/src/sheet-filter.c
@@ -89,7 +89,7 @@ gnm_filter_condition_new_bucket (gboolean top, gboolean absolute,
gboolean rel_range, double n)
{
GnmFilterCondition *res = g_new0 (GnmFilterCondition, 1);
- res->op[0] = GNM_FILTER_OP_TOP_N | (top ? 0 : 1) |
+ res->op[0] = GNM_FILTER_OP_TOP_N | (top ? 0 : 1) |
(absolute ? 0 : (rel_range ? 2 : 4));
res->op[1] = GNM_FILTER_UNUSED;
res->count = n;
diff --git a/src/sheet-merge.c b/src/sheet-merge.c
index 59b9583..0f5ace2 100644
--- a/src/sheet-merge.c
+++ b/src/sheet-merge.c
@@ -50,7 +50,7 @@ range_row_cmp (GnmRange const *a, GnmRange const *b)
* gnm_sheet_merge_add:
*
* @sheet: the sheet which will contain the region
- * @src: The region to merge
+ * @r: 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
@@ -154,7 +154,7 @@ gnm_sheet_merge_add (Sheet *sheet, GnmRange const *r, gboolean clear,
* gnm_sheet_merge_remove:
*
* @sheet: the sheet which will contain the region
- * @range: The region
+ * @r: The region
* @cc: the calling context
*
* Remove a merged range.
@@ -300,7 +300,7 @@ gnm_sheet_merge_is_corner (Sheet const *sheet, GnmCellPos const *pos)
/**
* gnm_sheet_merge_relocate:
- * @rinfo: Descriptor of what is moving.
+ * @ri: Descriptor of what is moving.
*
* Shifts merged regions that need to move.
*/
diff --git a/src/sheet-object-cell-comment.c b/src/sheet-object-cell-comment.c
index ac848ea..f5ee60f 100644
--- a/src/sheet-object-cell-comment.c
+++ b/src/sheet-object-cell-comment.c
@@ -418,6 +418,16 @@ cell_comment_set_pos (GnmComment *cc, GnmCellPos const *pos)
sheet_object_set_anchor (SHEET_OBJECT (cc), &anchor);
}
+/**
+ * cell_set_comment:
+ * @sheet: #Sheet.
+ * @pos: the position.
+ * @author: comment author.
+ * @text: comment text.
+ * @markup: comment markup.
+ *
+ * Returns: (transfer none): the newly allocated #GnmComment.
+ **/
GnmComment *
cell_set_comment (Sheet *sheet, GnmCellPos const *pos,
char const *author, char const *text,
diff --git a/src/sheet-object-graph.c b/src/sheet-object-graph.c
index b94ee0f..aa4f733 100644
--- a/src/sheet-object-graph.c
+++ b/src/sheet-object-graph.c
@@ -625,7 +625,7 @@ sheet_object_graph_new (GogGraph *graph)
/**
* sheet_object_graph_get_gog:
- * @soc: #SheetObject
+ * @sog: #SheetObject
*
* Returns: (transfer none): the embedded #GogGraph or %NULL on error.
**/
@@ -640,7 +640,7 @@ sheet_object_graph_get_gog (SheetObject *sog)
/**
* sheet_object_graph_set_gog:
- * @so: #SheetObjectGraph
+ * @sog: #SheetObjectGraph
* @graph: #GogGraph
*
* If @graph is non NULL add a reference to it, otherwise create a new graph.
diff --git a/src/sheet-object-impl.h b/src/sheet-object-impl.h
index 2d91bc2..5d22f3e 100644
--- a/src/sheet-object-impl.h
+++ b/src/sheet-object-impl.h
@@ -58,7 +58,7 @@ typedef struct {
SheetObjectView *(*new_view) (SheetObject *sheet_object,
SheetObjectViewContainer *container);
- void (*populate_menu) (SheetObject *sheet_object,
+ void (*populate_menu) (SheetObject *so,
GPtrArray *actions);
void (*user_config) (SheetObject *sheet_object,
SheetControl *s_control);
@@ -72,7 +72,7 @@ typedef struct {
SheetObject const *src);
void (*default_size) (SheetObject const *so,
- double *width_pts, double *height_pts);
+ double *w, double *h);
void (*draw_cairo) (SheetObject const *so, cairo_t *cr,
double width, double height);
diff --git a/src/sheet-object-widget.c b/src/sheet-object-widget.c
index edf57e6..80cacc7 100644
--- a/src/sheet-object-widget.c
+++ b/src/sheet-object-widget.c
@@ -526,7 +526,7 @@ sheet_widget_frame_user_config (SheetObject *so, SheetControl *sc)
if (gnumeric_dialog_raise_if_exists (wbcg, SHEET_OBJECT_CONFIG_KEY))
return;
- gui = gnm_gtk_builder_new ("so-frame.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("so-frame.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (!gui)
return;
state = g_new (FrameConfigState, 1);
@@ -871,7 +871,7 @@ sheet_widget_button_user_config (SheetObject *so, SheetControl *sc)
if (gnumeric_dialog_raise_if_exists (wbcg, SHEET_OBJECT_CONFIG_KEY))
return;
- gui = gnm_gtk_builder_new ("so-button.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("so-button.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (!gui)
return;
state = g_new (ButtonConfigState, 1);
@@ -1432,7 +1432,7 @@ sheet_widget_adjustment_user_config_impl (SheetObject *so, SheetControl *sc, cha
if (gnumeric_dialog_raise_if_exists (wbcg, SHEET_OBJECT_CONFIG_KEY))
return;
- gui = gnm_gtk_builder_new ("so-scrollbar.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("so-scrollbar.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (!gui)
return;
state = g_new (AdjustmentConfigState, 1);
@@ -2106,7 +2106,7 @@ sheet_widget_checkbox_user_config (SheetObject *so, SheetControl *sc)
if (gnumeric_dialog_raise_if_exists (wbcg, SHEET_OBJECT_CONFIG_KEY))
return;
- gui = gnm_gtk_builder_new ("so-checkbox.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("so-checkbox.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (!gui)
return;
state = g_new (CheckboxConfigState, 1);
@@ -2783,7 +2783,7 @@ sheet_widget_radio_button_user_config (SheetObject *so, SheetControl *sc)
if (gnumeric_dialog_raise_if_exists (wbcg, SHEET_OBJECT_CONFIG_KEY))
return;
- gui = gnm_gtk_builder_new ("so-radiobutton.ui", NULL, GO_CMD_CONTEXT (wbcg));
+ gui = gnm_gtk_builder_load ("so-radiobutton.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (!gui)
return;
state = g_new (RadioButtonConfigState, 1);
diff --git a/src/sheet-object.c b/src/sheet-object.c
index 914bf83..28f1270 100644
--- a/src/sheet-object.c
+++ b/src/sheet-object.c
@@ -47,6 +47,28 @@
#include <string.h>
+/* GType code for SheetObjectAnchor */
+static SheetObjectAnchor *
+sheet_object_anchor_copy (SheetObjectAnchor * soa)
+{
+ SheetObjectAnchor *res = g_new (SheetObjectAnchor, 1);
+ *res = *soa;
+ return res;
+}
+
+GType
+sheet_object_anchor_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("SheetObjectAnchor",
+ (GBoxedCopyFunc)sheet_object_anchor_copy,
+ (GBoxedFreeFunc)g_free);
+ }
+ return t;
+}
+
/* Returns the class for a SheetObject */
#define SO_CLASS(so) SHEET_OBJECT_CLASS(G_OBJECT_GET_CLASS(so))
@@ -1273,6 +1295,12 @@ sheet_object_view_set_bounds (SheetObjectView *sov,
(klass->set_bounds) (sov, coords, visible);
}
+/**
+ * sheet_object_view_get_so:
+ * @sov: #SheetObjectView
+ *
+ * Returns: (transfer none): the #SheetObject owning @view.
+ **/
SheetObject *
sheet_object_view_get_so (SheetObjectView *view)
{
@@ -1547,7 +1575,7 @@ sheet_object_write_object (SheetObject const *so, char const *format,
}
/**
- * sheet_object_move_do:
+ * sheet_object_move_undo:
* @objects: (element-type SheetObject):
* @objects_created:
*
diff --git a/src/sheet-object.h b/src/sheet-object.h
index 10acbd9..1369538 100644
--- a/src/sheet-object.h
+++ b/src/sheet-object.h
@@ -23,6 +23,7 @@ struct _SheetObjectAnchor {
GnmRange cell_bound; /* cellpos containing corners */
double offset[4]; /* offsets from the top left (in LTR of cell_bound) */
};
+GType sheet_object_anchor_get_type (void); /* Boxed type */
#define SHEET_OBJECT_TYPE (sheet_object_get_type ())
#define SHEET_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), SHEET_OBJECT_TYPE, SheetObject))
diff --git a/src/sheet-style.c b/src/sheet-style.c
index 5a2f848..035c30c 100644
--- a/src/sheet-style.c
+++ b/src/sheet-style.c
@@ -1242,11 +1242,10 @@ tail_recursion :
}
/**
- * sheet_style_set_range
- *
- * @sheet :
- * @range :
- * @style : #GnmStyle
+ * sheet_style_set_range:
+ * @sheet:
+ * @range:
+ * @style: #GnmStyle
*
* Change the complete style for a region.
* This function absorbs a reference to the new @style.
@@ -1267,10 +1266,10 @@ sheet_style_set_range (Sheet *sheet, GnmRange const *range,
}
/**
- * sheet_style_apply_col
- * @sheet :
- * @col :
- * @pstyle : #GnmStyle
+ * sheet_style_apply_col:
+ * @sheet:
+ * @col:
+ * @style: #GnmStyle
*
* NOTE : This is a simple wrapper for now. When we support col/row styles it
* will make life easier.
@@ -1287,10 +1286,10 @@ sheet_style_apply_col (Sheet *sheet, int col, GnmStyle *pstyle)
}
/**
- * sheet_style_apply_row
- * @sheet :
- * @row :
- * @pstyle : #GnmStyle
+ * sheet_style_apply_row:
+ * @sheet:
+ * @row:
+ * @style: #GnmStyle
*
* NOTE : This is a simple wrapper for now. When we support col/row styles it
* will make life easier.
@@ -2067,7 +2066,7 @@ cb_style_extent (GnmStyle *style,
* sheet_style_get_extent:
*
* @sheet: sheet to measure
- * @res: starting range and resulting range
+ * @r: starting range and resulting range
*
* A simple implementation that finds the smallest range containing all visible styles
* and containing @res.
@@ -2242,6 +2241,13 @@ sheet_style_most_common (Sheet const *sheet, gboolean is_col)
/****************************************************************************/
+/**
+ * gnm_style_region_new:
+ * @range: #GnmRange
+ * @style: #GnmStyle
+ *
+ * Returns: (transfer full): the newly allocated #GnmStyleRegion.
+ **/
GnmStyleRegion *
gnm_style_region_new (GnmRange const *range, GnmStyle *style)
{
@@ -2265,6 +2271,29 @@ gnm_style_region_free (GnmStyleRegion *sr)
g_free (sr);
}
+static GnmStyleRegion *
+gnm_style_region_copy (GnmStyleRegion *sr)
+{
+ GnmStyleRegion *res = g_new (GnmStyleRegion, 1);
+ *res = *sr;
+ gnm_style_ref (sr->style);
+ return res;
+}
+
+GType
+gnm_style_region_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmStyleRegion",
+ (GBoxedCopyFunc)gnm_style_region_copy,
+ (GBoxedFreeFunc)gnm_style_region_free);
+ }
+ return t;
+}
+
+
typedef struct {
GHashTable *cache;
gboolean (*style_equal) (GnmStyle const *a, GnmStyle const *b);
@@ -2388,14 +2417,13 @@ cb_hash_to_list (G_GNUC_UNUSED gpointer key, gpointer value, gpointer user_data)
/**
* sheet_style_get_range:
- *
* @sheet:
* @range:
*
* Get a list of rectangles and their associated styles
* Caller is responsible for freeing.
*
- * Returns: (element-type GnmStyleRange) (transfer full):
+ * Returns: (transfer full):
*/
GnmStyleList *
sheet_style_get_range (Sheet const *sheet, GnmRange const *r)
diff --git a/src/sheet-style.h b/src/sheet-style.h
index 5288045..4c1670d 100644
--- a/src/sheet-style.h
+++ b/src/sheet-style.h
@@ -89,6 +89,7 @@ GnmStyleList *sheet_style_collect_conditions (Sheet const *s, GnmRange const *r)
GnmStyleList *sheet_style_collect_hlinks (Sheet const *s, GnmRange const *r);
GnmStyleList *sheet_style_collect_validations (Sheet const *s, GnmRange const *r);
+GType gnm_style_region_get_type (void); /* boxed type */
GnmStyleRegion *gnm_style_region_new (GnmRange const *range, GnmStyle *style);
void gnm_style_region_free (GnmStyleRegion *sr);
diff --git a/src/sheet-view.c b/src/sheet-view.c
index 9bbdcbe..4cb0958 100644
--- a/src/sheet-view.c
+++ b/src/sheet-view.c
@@ -99,6 +99,12 @@ sv_sheet_r1c1_changed (Sheet *sheet,
sv->edit_pos_changed.location = TRUE;
}
+/**
+ * sv_sheet:
+ * @sv: #SheetView
+ *
+ * Returns: (transfer none): the sheet.
+ **/
Sheet *
sv_sheet (SheetView const *sv)
{
@@ -106,6 +112,12 @@ sv_sheet (SheetView const *sv)
return sv->sheet;
}
+/**
+ * sv_wbv:
+ * @sv: #SheetView
+ *
+ * Returns: (transfer none): the workbook view.
+ **/
WorkbookView *
sv_wbv (SheetView const *sv)
{
@@ -329,9 +341,9 @@ sv_unant (SheetView *sv)
}
/**
- * sv_ant :
- * @sv :
- * @ranges :
+ * sv_ant:
+ * @sv:
+ * @ranges: (element-type GnmRange):
*/
void
sv_ant (SheetView *sv, GList *ranges)
@@ -525,12 +537,13 @@ sv_set_edit_pos (SheetView *sv, GnmCellPos const *pos)
/**
* sv_flag_status_update_pos:
+ * @sv:
+ * @pos:
+ *
* flag the view 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.
*/
@@ -560,8 +573,8 @@ sv_flag_status_update_pos (SheetView *sv, GnmCellPos const *pos)
* if the supplied cell location contains the edit cursor, or intersects of
* the selected region.
*
- * @sheet :
- * @range : If NULL then force an update.
+ * @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.
@@ -704,7 +717,7 @@ sv_selection_intersects_filter_rows (SheetView const *sv)
/**
* sv_selection_extends_filter:
- * @sv : #SheetView
+ * @sv: #SheetView
*
* Returns: %NULL or GnmFilter whose rows intersect the rows
* of the current selectiona range to which the filter can be
@@ -724,10 +737,11 @@ sv_selection_extends_filter (SheetView const *sv, GnmFilter const *f)
/**
- * sv_editpos_in_slicer :
- * @sv : #SheetView
+ * sv_editpos_in_slicer:
+ * @sv: #SheetView
*
- * Returns: %NULL or #GnmSheetSlicer that overlaps the sv::edit_pos
+ * Returns: (transfer none): %NULL or #GnmSheetSlicer that overlaps the
+ * sv::edit_pos
**/
GnmSheetSlicer *
sv_editpos_in_slicer (SheetView const *sv)
@@ -867,9 +881,9 @@ sv_is_frozen (SheetView const *sv)
/**
* sv_set_initial_top_left
- * @sv : the sheet view.
- * @col :
- * @row :
+ * @sv: the sheet view.
+ * @col:
+ * @row:
*
* Sets the top left cell that a newly created sheet control should display.
* This corresponds to the top left cell visible in pane 0 (frozen or not).
diff --git a/src/sheet.c b/src/sheet.c
index 206018e..552b6de 100644
--- a/src/sheet.c
+++ b/src/sheet.c
@@ -805,7 +805,7 @@ gnm_sheet_init (Sheet *sheet)
sheet->rows.info = g_ptr_array_new ();
sheet_row_set_default_size_pts (sheet, 12.75);
- sheet->print_info = print_info_new (FALSE);
+ sheet->print_info = print_information_new (FALSE);
sheet->filters = NULL;
sheet->scenarios = NULL;
@@ -1669,7 +1669,7 @@ sheet_row_new (Sheet *sheet)
g_return_val_if_fail (IS_SHEET (sheet), NULL);
- ri = colrow_new ();
+ ri = col_row_info_new ();
*ri = sheet->rows.default_style;
ri->is_default = FALSE;
ri->needs_respan = TRUE;
@@ -1684,7 +1684,7 @@ sheet_col_new (Sheet *sheet)
g_return_val_if_fail (IS_SHEET (sheet), NULL);
- ci = colrow_new ();
+ ci = col_row_info_new ();
*ci = sheet->cols.default_style;
ci->is_default = FALSE;
@@ -2633,6 +2633,13 @@ sheet_range_set_expr_cb (GnmSheetRange const *sr, GnmExprTop const *texpr)
sr->range.end.row);
}
+/**
+ * sheet_range_set_expr_undo:
+ * @sr: #GnmSheetRange
+ * @texpr: #GnmExprTop
+ *
+ * Returns: (transfer full): the newly created #GOUndo.
+ **/
GOUndo *
sheet_range_set_expr_undo (GnmSheetRange *sr, GnmExprTop const *texpr)
{
@@ -2718,6 +2725,13 @@ sheet_range_set_text_cb (GnmSheetRange const *sr, gchar const *text)
sr->range.end.row);
}
+/**
+ * sheet_range_set_text_undo:
+ * @sr: #GnmSheetRange
+ * @text:
+ *
+ * Returns: (transfer full): the newly created #GOUndo.
+ **/
GOUndo *
sheet_range_set_text_undo (GnmSheetRange *sr,
char const *text)
@@ -2764,6 +2778,13 @@ sheet_range_set_markup_cb (GnmSheetRange const *sr, PangoAttrList *markup)
sr->range.end.row);
}
+/**
+ * sheet_range_set_markup_undo:
+ * @sr: #GnmSheetRange
+ * @markup: #PangoAttrList
+ *
+ * Returns: (transfer full): the newly created #GOUndo.
+ **/
GOUndo *
sheet_range_set_markup_undo (GnmSheetRange *sr, PangoAttrList *markup)
{
@@ -3929,7 +3950,7 @@ sheet_cell_foreach (Sheet const *sheet, GHFunc callback, gpointer data)
}
/**
- * sheet_cells_coun :
+ * sheet_cells_count:
* @sheet: #Sheet
*
* Returns the number of cells with content in the current workbook.
diff --git a/src/sort.c b/src/sort.c
index 32373ba..0a1c1e5 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -359,3 +359,16 @@ gnm_sort_data_copy (GnmSortData *data)
return result;
}
+
+GType
+gnm_sort_data_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmSortData",
+ (GBoxedCopyFunc)gnm_sort_data_copy,
+ (GBoxedFreeFunc)gnm_sort_data_destroy);
+ }
+ return t;
+}
diff --git a/src/sort.h b/src/sort.h
index 4142bfd..efb38a3 100644
--- a/src/sort.h
+++ b/src/sort.h
@@ -23,6 +23,7 @@ struct _GnmSortData {
char *locale;
};
+GType gnm_sort_data_get_type (void);
void gnm_sort_data_destroy (GnmSortData *data);
GnmSortData *gnm_sort_data_copy (GnmSortData *data);
void gnm_sort_position (GnmSortData *data, int *perm, GOCmdContext *cc);
diff --git a/src/ssconvert.c b/src/ssconvert.c
index 251a6f4..623675a 100644
--- a/src/ssconvert.c
+++ b/src/ssconvert.c
@@ -255,7 +255,7 @@ read_files_to_merge (const char *inputs[], GOFileOpener *fo,
const char *fname = *inputs;
char *uri = go_shell_arg_to_uri (fname);
WorkbookView *wbv =
- wb_view_new_from_uri (uri, fo, io_context,
+ workbook_view_new_from_uri (uri, fo, io_context,
ssconvert_import_encoding);
g_free (uri);
inputs++;
@@ -594,7 +594,7 @@ convert (char const *inarg, char const *outarg, char const *mergeargs[],
io_context = go_io_context_new (cc);
if (mergeargs == NULL) {
- wbv = wb_view_new_from_uri (infile, fo,
+ wbv = workbook_view_new_from_uri (infile, fo,
io_context,
ssconvert_import_encoding);
} else {
diff --git a/src/ssgrep.c b/src/ssgrep.c
index a0a468a..64d665f 100644
--- a/src/ssgrep.c
+++ b/src/ssgrep.c
@@ -280,7 +280,7 @@ ssgrep (const char *arg, char const *uri, GOIOContext *ioc, GHashTable *targets,
GPtrArray *matches;
gboolean has_match;
- wbv = wb_view_new_from_uri (uri, NULL, ioc, NULL);
+ wbv = workbook_view_new_from_uri (uri, NULL, ioc, NULL);
if (wbv == NULL) {
ssgrep_error = TRUE;
return;
diff --git a/src/ssindex.c b/src/ssindex.c
index 1ac88ae..44fa843 100644
--- a/src/ssindex.c
+++ b/src/ssindex.c
@@ -173,7 +173,7 @@ ssindex (char const *file, GOIOContext *ioc)
GsfOutput *gsf_stdout;
Workbook *wb;
- state.wb_view = wb_view_new_from_uri (str, NULL,
+ state.wb_view = workbook_view_new_from_uri (str, NULL,
ioc, ssindex_import_encoding);
g_free (str);
diff --git a/src/stf-export.c b/src/stf-export.c
index 0616d00..dd9ef8b 100644
--- a/src/stf-export.c
+++ b/src/stf-export.c
@@ -319,7 +319,7 @@ stf_export_sheet (GnmStfExport *stfe, Sheet *sheet)
/**
* gnm_stf_export:
- * @stfe: an export options struct
+ * @export_options: an export options struct
*
* Exports the sheets given in @stfe
*
@@ -601,6 +601,13 @@ GSF_CLASS (GnmStfExport, gnm_stf_export,
#include "dialog-stf-export.h"
#include "workbook-view.h"
+/**
+ * gnm_stf_get_stfe:
+ * @obj: #GObject with a #GnmStfExport attached as data.
+ *
+ * If non is found, a new one is created ans attached to @obj.
+ * Returns: (transfer none): the #GnmStfExport.
+ **/
GnmStfExport *
gnm_stf_get_stfe (GObject *obj)
{
@@ -738,8 +745,14 @@ gnm_stf_fs_set_export_options (GOFileSaver *fs,
return go_parse_key_value (options, err, cb_set_export_option, doc);
}
+/**
+ * gnm_stf_file_saver_create:
+ * @id:
+ *
+ * Returns: (transfer full): the newly allocated #GOFileSaver.
+ **/
GOFileSaver *
-gnm_stf_file_saver_new (gchar const *id)
+gnm_stf_file_saver_create (gchar const *id)
{
GOFileSaver *fs = go_file_saver_new (id,
"txt",
diff --git a/src/stf-export.h b/src/stf-export.h
index 522074b..14987f6 100644
--- a/src/stf-export.h
+++ b/src/stf-export.h
@@ -41,7 +41,7 @@ GnmStfExport *gnm_stf_get_stfe (GObject *obj);
gboolean gnm_stf_export (GnmStfExport *export_options);
-GOFileSaver *gnm_stf_file_saver_new (gchar const *id);
+GOFileSaver *gnm_stf_file_saver_create (gchar const *id);
G_END_DECLS
diff --git a/src/stf-parse.c b/src/stf-parse.c
index 0bf08b4..d141f1b 100644
--- a/src/stf-parse.c
+++ b/src/stf-parse.c
@@ -158,6 +158,7 @@ stf_parse_options_new (void)
parseoptions->cols_exceeded = FALSE;
parseoptions->rows_exceeded = FALSE;
+ parseoptions->ref_count = 1;
return parseoptions;
}
@@ -173,6 +174,9 @@ stf_parse_options_free (StfParseOptions_t *parseoptions)
{
g_return_if_fail (parseoptions != NULL);
+ if (parseoptions->ref_count-- > 1)
+ return;
+
g_free (parseoptions->col_import_array);
g_free (parseoptions->col_autofit_array);
g_free (parseoptions->locale);
@@ -203,6 +207,26 @@ stf_parse_options_free (StfParseOptions_t *parseoptions)
g_free (parseoptions);
}
+static StfParseOptions_t *
+stf_parse_options_ref (StfParseOptions_t *parseoptions)
+{
+ parseoptions->ref_count++;
+ return parseoptions;
+}
+
+GType
+stf_parse_options_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("StfParseOptions_t",
+ (GBoxedCopyFunc)stf_parse_options_ref,
+ (GBoxedFreeFunc)stf_parse_options_free);
+ }
+ return t;
+}
+
void
stf_parse_options_set_type (StfParseOptions_t *parseoptions, StfParseType_t const parsetype)
{
@@ -286,6 +310,9 @@ stf_parse_options_set_trim_spaces (StfParseOptions_t *parseoptions, StfTrimType_
/**
* stf_parse_options_csv_set_separators:
+ * @parseoptions: #StfParseOptions_t
+ * @character:
+ * @string: (element-type char):
*
* A copy is made of the parameters.
**/
@@ -312,7 +339,7 @@ stf_parse_options_csv_set_stringindicator (StfParseOptions_t *parseoptions, guni
/**
* stf_parse_options_csv_set_indicator_2x_is_single:
- * @indic_2x : a boolean value indicating whether we want to see two
+ * @indic_2x: a boolean value indicating whether we want to see two
* adjacent string indicators as a single string indicator
* that is part of the cell, rather than a terminator.
**/
@@ -327,7 +354,8 @@ stf_parse_options_csv_set_indicator_2x_is_single (StfParseOptions_t *parseoption
/**
* stf_parse_options_csv_set_duplicates:
- * @duplicates : a boolean value indicating whether we want to see two
+ * @pareseoptions:
+ * @duplicates: a boolean value indicating whether we want to see two
* separators right behind each other as one
**/
void
@@ -340,7 +368,7 @@ stf_parse_options_csv_set_duplicates (StfParseOptions_t *parseoptions, gboolean
/**
* stf_parse_options_csv_set_trim_seps:
- * @trim_seps : a boolean value indicating whether we want to ignore
+ * @trim_seps: a boolean value indicating whether we want to ignore
* separators at the beginning of lines
**/
void
@@ -797,7 +825,7 @@ stf_parse_general_free (GPtrArray *lines)
/**
* stf_parse_general:
*
- * Returns a GPtrArray of lines, where each line is itself a
+ * Returns: (transfer full): a GPtrArray of lines, where each line is itself a
* GPtrArray of strings.
*
* The caller must free this entire structure, for example by calling
@@ -850,6 +878,20 @@ stf_parse_general (StfParseOptions_t *parseoptions,
return lines;
}
+/**
+ * stf_parse_lines:
+ * @parseoptions: #StfParseOptions_t
+ * @lines_chunk:
+ * @data:
+ * @maxlines:
+ * @with_lineno:
+ *
+ * Returns: (transfer full): a GPtrArray of lines, where each line is itself a
+ * GPtrArray of strings.
+ *
+ * The caller must free this entire structure, for example by calling
+ * stf_parse_general_free.
+ **/
GPtrArray *
stf_parse_lines (StfParseOptions_t *parseoptions,
GStringChunk *lines_chunk,
@@ -918,8 +960,8 @@ stf_parse_find_line (StfParseOptions_t *parseoptions,
/**
* stf_parse_options_fixed_autodiscover:
* @parseoptions: a Parse options struct.
- * @data_lines : The number of lines to look at in @data.
- * @data : The actual data.
+ * @data: The actual data.
+ * @data_end: data end.
*
* Automatically try to discover columns in the text to be parsed.
* We ignore empty lines (only containing parseoptions->terminator)
@@ -1353,7 +1395,7 @@ stf_parse_region (StfParseOptions_t *parseoptions, char const *data, char const
START_LOCALE_SWITCH;
- cr = cellregion_new (NULL);
+ cr = gnm_cell_region_new (NULL);
if (!data_end)
data_end = data + strlen (data);
@@ -1488,7 +1530,12 @@ dump_guessed_options (const StfParseOptions_t *res)
g_printerr ("\n");
}
-
+/**
+ * stf_parse_options_guess:
+ * @data: the input data.
+ *
+ * Returns: (transfer full): the guessed options.
+ **/
StfParseOptions_t *
stf_parse_options_guess (char const *data)
{
@@ -1567,7 +1614,12 @@ stf_parse_options_guess (char const *data)
return res;
}
-
+/**
+ * stf_parse_options_guess_csv:
+ * @data: the CSV input data.
+ *
+ * Returns: (transfer full): the guessed options.
+ **/
StfParseOptions_t *
stf_parse_options_guess_csv (char const *data)
{
diff --git a/src/stf-parse.h b/src/stf-parse.h
index b460fb2..693c64f 100644
--- a/src/stf-parse.h
+++ b/src/stf-parse.h
@@ -56,10 +56,12 @@ typedef struct {
/* we tried to import more than */
/* SHEET_MAX_COLS columns */
gboolean rows_exceeded; /* Ditto rows. */
+ unsigned ref_count; /* Boxed type */
} StfParseOptions_t;
/* CREATION/DESTRUCTION of stf options struct */
+GType stf_parse_options_get_type (void);
void stf_parse_options_free (StfParseOptions_t *parseoptions);
StfParseOptions_t *stf_parse_options_guess (char const *data);
diff --git a/src/stf.c b/src/stf.c
index cac81b8..400d896 100644
--- a/src/stf.c
+++ b/src/stf.c
@@ -297,8 +297,9 @@ cb_get_content (GnmCellIter const *iter, GsfOutput *buf)
}
/**
- * stf_text_to_columns
- * @wbc : The control making the request
+ * stf_text_to_columns:
+ * @wbc: The control making the request
+ * @cc:
*
* Main routine, handles importing a file including all dialog mumbo-jumbo
**/
@@ -494,7 +495,7 @@ stf_read_workbook_auto_csvtab (G_GNUC_UNUSED GOFileOpener const *fo, gchar const
_("Some data did not fit on the "
"sheet and was dropped."));
}
- is_csv = po->sep.chr[0] == ',';
+ is_csv = po->sep.chr[0] == ',';
workbook_set_saveinfo
(book,
GO_FILE_FL_WRITE_ONLY,
@@ -650,7 +651,7 @@ stf_init (void)
go_file_opener_register (opener, 0);
g_object_unref (opener);
- saver = gnm_stf_file_saver_new ("Gnumeric_stf:stf_assistant");
+ saver = gnm_stf_file_saver_create ("Gnumeric_stf:stf_assistant");
go_file_saver_register (saver);
g_object_unref (saver);
diff --git a/src/style-border.c b/src/style-border.c
index 89b03ed..0474af2 100644
--- a/src/style-border.c
+++ b/src/style-border.c
@@ -317,6 +317,19 @@ gnm_style_border_unref (GnmBorder *border)
g_free (border);
}
+GType
+gnm_border_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmBorder",
+ (GBoxedCopyFunc)gnm_style_border_ref,
+ (GBoxedFreeFunc)gnm_style_border_unref);
+ }
+ return t;
+}
+
static gboolean
style_border_hmargins (GnmBorder const * const * prev_vert,
GnmStyleRow const *sr, int col,
diff --git a/src/style-border.h b/src/style-border.h
index f809d1e..303d2dd 100644
--- a/src/style-border.h
+++ b/src/style-border.h
@@ -64,6 +64,7 @@ struct _GnmBorder {
gint ref_count;
};
+GType gnm_border_get_type (void);
void gnm_style_border_unref (GnmBorder *border);
GnmBorder *gnm_style_border_ref (GnmBorder *border);
diff --git a/src/style-color.h b/src/style-color.h
index 5d66fe1..e291400 100644
--- a/src/style-color.h
+++ b/src/style-color.h
@@ -26,7 +26,7 @@ GNM_VAR_DECL GdkRGBA gs_black;
GNM_VAR_DECL GdkRGBA gs_lavender;
GNM_VAR_DECL GdkRGBA gs_yellow;
-GType gnm_color_get_type (void);
+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);
diff --git a/src/style-conditions.c b/src/style-conditions.c
index 050027d..e6ee5f7 100644
--- a/src/style-conditions.c
+++ b/src/style-conditions.c
@@ -119,6 +119,12 @@ gnm_style_cond_new (GnmStyleCondOp op, Sheet *sheet)
return res;
}
+/**
+ * gnm_style_cond_dup:
+ * @src: #GnmStyleCond
+ *
+ * Returns: (transfer full): the newly allocated #GnmStyleCond.
+ **/
GnmStyleCond *
gnm_style_cond_dup (GnmStyleCond const *src)
{
@@ -151,6 +157,25 @@ gnm_style_cond_free (GnmStyleCond *cond)
g_free (cond);
}
+GType
+gnm_style_cond_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmStyleCond",
+ (GBoxedCopyFunc)gnm_style_cond_dup,
+ (GBoxedFreeFunc)gnm_style_cond_free);
+ }
+ return t;
+}
+
+/**
+ * gnm_style_cond_get_sheet:
+ * @cond: #GnmStyleCond
+ *
+ * Returns: (transfer none): the #Sheet.
+ **/
Sheet *
gnm_style_cond_get_sheet (GnmStyleCond const *cond)
{
@@ -225,9 +250,9 @@ gnm_style_conditions_class_init (GObjectClass *gobject_class)
parent_class = g_type_class_peek_parent (gobject_class);
gobject_class->finalize = gnm_style_conditions_finalize;
}
-static GSF_CLASS (GnmStyleConditions, gnm_style_conditions,
- gnm_style_conditions_class_init, gnm_style_conditions_init,
- G_TYPE_OBJECT)
+GSF_CLASS (GnmStyleConditions, gnm_style_conditions,
+ gnm_style_conditions_class_init, gnm_style_conditions_init,
+ G_TYPE_OBJECT)
/**
* gnm_style_conditions_new :
@@ -247,6 +272,12 @@ gnm_style_conditions_new (Sheet *sheet)
return res;
}
+/**
+ * gnm_style_conditions_dup:
+ * @sc: the #GnmStyleConditions to duplicate.
+ *
+ * Returns: (transfer full): the duplicated #GnmStyleConditions.
+ **/
GnmStyleConditions *
gnm_style_conditions_dup (GnmStyleConditions const *sc)
{
@@ -303,6 +334,13 @@ gnm_style_conditions_hash (GnmStyleConditions const *sc)
#undef MIX
+
+/**
+ * gnm_style_conditions_get_sheet:
+ * @sc: #GnmStyleConditions
+ *
+ * Returns: (transfer none): the #Sheet.
+ **/
Sheet *
gnm_style_conditions_get_sheet (GnmStyleConditions const *sc)
{
@@ -329,10 +367,10 @@ gnm_style_conditions_set_sheet (GnmStyleConditions *sc, Sheet *sheet)
/**
- * gnm_style_conditions_details :
- * @sc : #GnmStyleConditions
+ * gnm_style_conditions_details:
+ * @sc: #GnmStyleConditions
*
- * Returns an array of GnmStyleCond which should not be modified.
+ * Returns: (transfer none): an array of GnmStyleCond which should not be modified.
**/
GPtrArray const *
gnm_style_conditions_details (GnmStyleConditions const *sc)
@@ -397,6 +435,13 @@ gnm_style_conditions_delete (GnmStyleConditions *sc, guint pos)
}
+/**
+ * gnm_style_conditions_overlay:
+ * @sc: #GnmStyleConditions
+ * @base: #GnmStyle
+ *
+ * Returns: (element-type GnmStyle) (transfer full): an array of #GnmStyle.
+ **/
GPtrArray *
gnm_style_conditions_overlay (GnmStyleConditions const *sc,
GnmStyle const *base)
@@ -424,11 +469,11 @@ gnm_style_conditions_overlay (GnmStyleConditions const *sc,
}
/**
- * gnm_style_conditions_eval :
- * @sc : #GnmStyleConditions
- * @ep : #GnmEvalPos
+ * gnm_style_conditions_eval:
+ * @sc: #GnmStyleConditions
+ * @pos: #GnmEvalPos
*
- * Returns the condition to use or -1 if none match.
+ * Returns: the condition to use or -1 if none match.
**/
int
gnm_style_conditions_eval (GnmStyleConditions const *sc, GnmEvalPos const *ep)
diff --git a/src/style-conditions.h b/src/style-conditions.h
index 468c5f1..43e0565 100644
--- a/src/style-conditions.h
+++ b/src/style-conditions.h
@@ -43,6 +43,7 @@ typedef struct {
GnmStyleCondOp op;
} GnmStyleCond;
+GType gnm_style_cond_get_type (void);
GnmStyleCond *gnm_style_cond_new (GnmStyleCondOp op, Sheet *sheet);
void gnm_style_cond_free (GnmStyleCond *cond);
GnmStyleCond *gnm_style_cond_dup (GnmStyleCond const *src);
@@ -60,6 +61,7 @@ void gnm_style_cond_set_expr (GnmStyleCond *cond,
Sheet *gnm_style_cond_get_sheet (GnmStyleCond const *cond);
void gnm_style_cond_set_sheet (GnmStyleCond *cond, Sheet *sheet);
+GType gnm_style_conditions_get_type (void);
GnmStyleConditions *gnm_style_conditions_new (Sheet *sheet);
GnmStyleConditions *gnm_style_conditions_dup (GnmStyleConditions const *sc);
GPtrArray const *gnm_style_conditions_details (GnmStyleConditions const *sc);
diff --git a/src/style-font.h b/src/style-font.h
index 41f749c..8172432 100644
--- a/src/style-font.h
+++ b/src/style-font.h
@@ -22,6 +22,7 @@ struct _GnmFont {
unsigned int is_italic : 1;
};
+GType gnm_font_get_type (void);
GnmFont *gnm_font_new (PangoContext *context,
char const *font_name,
double size_pts, gboolean bold, gboolean italic);
diff --git a/src/style.c b/src/style.c
index 792fccc..0f2e05c 100644
--- a/src/style.c
+++ b/src/style.c
@@ -299,6 +299,19 @@ gnm_font_unref (GnmFont *sf)
g_free (sf);
}
+GType
+gnm_font_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmFont",
+ (GBoxedCopyFunc)gnm_font_ref,
+ (GBoxedFreeFunc)gnm_font_unref);
+ }
+ return t;
+}
+
gint
gnm_font_equal (gconstpointer v, gconstpointer v2)
{
@@ -374,9 +387,10 @@ static PangoFontMap *fontmap;
static PangoContext *context;
/**
- * gnm_pango_context_get :
+ * gnm_pango_context_get:
*
* Simple wrapper to handle windowless operation
+ * Returns: (transfer full):
**/
PangoContext *
gnm_pango_context_get (void)
diff --git a/src/symbol.c b/src/symbol.c
index 6d165d4..4780535 100644
--- a/src/symbol.c
+++ b/src/symbol.c
@@ -46,7 +46,16 @@ symbol_names_cb (char const * key, Symbol *symbol, symbol_names_cb_t *data)
}
}
-/* returns a list of reffed GnmFunc* */
+/**
+ * symbol_names:
+ * @st: #SymbolTable
+ * @list: (element-type GnmFunc*) (transfer full): list to which add new
+ * GnmFunc* from @st.
+ * @prefix: function name start.
+ *
+ * Lists functions whose name start with @prefix and add the mto the list.
+ * Returns: (element-type GnmFunc*) (transfer full): a list of reffed GnmFunc*.
+ **/
GSList *
symbol_names (SymbolTable *st, GSList *list, char const *prefix)
{
@@ -66,7 +75,7 @@ symbol_names (SymbolTable *st, GSList *list, char const *prefix)
*
* @st: The symbol table
* @str: the string name
- * @SymbolType: in which hash table we perform the lookup
+ * @type: in which hash table we perform the lookup
* @data: information attached to the symbol
*/
Symbol *
@@ -126,6 +135,19 @@ symbol_unref (Symbol *sym)
}
}
+GType
+symbol_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("Symbol",
+ (GBoxedCopyFunc)symbol_ref,
+ (GBoxedFreeFunc)symbol_unref);
+ }
+ return t;
+}
+
SymbolTable *
symbol_table_new (void)
{
@@ -153,3 +175,25 @@ symbol_table_destroy (SymbolTable *st)
g_hash_table_destroy (st->hash);
g_free (st);
}
+
+static SymbolTable *
+symbol_table_copy (SymbolTable *st)
+{
+ return st;
+}
+
+/* since there is only one global symbol table, there shouls be no need
+ * to ref/unref it for introspecion. */
+GType
+symbol_table_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("SymbolTable",
+ (GBoxedCopyFunc)symbol_table_copy,
+ (GBoxedFreeFunc)symbol_table_copy);
+ }
+ return t;
+}
+
diff --git a/src/symbol.h b/src/symbol.h
index aba32e9..9e22e6d 100644
--- a/src/symbol.h
+++ b/src/symbol.h
@@ -20,6 +20,7 @@ typedef struct {
void *data;
} Symbol;
+GType symbol_table_get_type (void);
SymbolTable *symbol_table_new (void);
void symbol_table_destroy (SymbolTable *st);
@@ -28,6 +29,7 @@ Symbol *symbol_install (SymbolTable *st, char const *str,
SymbolType type, void *data);
GSList *symbol_names (SymbolTable *st, GSList *list, char const *prefix);
+GType symbol_get_type (void);
void symbol_ref (Symbol *sym);
void symbol_unref (Symbol *sym);
diff --git a/src/tools/ChangeLog b/src/tools/ChangeLog
index fbecd05..3f64660 100644
--- a/src/tools/ChangeLog
+++ b/src/tools/ChangeLog
@@ -1,3 +1,9 @@
+2012-08-16 Jean Brefort <jean brefort normalesup org>
+
+ * dao.c (dao_prepare_output): fixed introspection warnings.
+ * scenarios.c (gnm_scenario_item_get_type): ditto.
+ * scenarios.h: ditto.
+
2012-08-03 Jean Brefort <jean brefort normalesup org>
* tabulate.c: add missing header.
diff --git a/src/tools/dao.c b/src/tools/dao.c
index 236ae6d..3400201 100644
--- a/src/tools/dao.c
+++ b/src/tools/dao.c
@@ -54,7 +54,7 @@
#include <parse-util.h>
/**
- * dao_INIT:
+ * dao_init: (skip)
* @dao:
* @type:
*
@@ -92,6 +92,11 @@ dao_init (data_analysis_output_t *dao,
return dao;
}
+/**
+ * dao_init_new_sheet: (skip)
+ * @dao:
+ *
+ **/
data_analysis_output_t *
dao_init_new_sheet (data_analysis_output_t *dao)
{
@@ -107,6 +112,12 @@ void dao_free (data_analysis_output_t *dao)
g_free (dao);
}
+/**
+ * dao_load_from_value: (skip)
+ * @dao:
+ * @value:
+ *
+ **/
data_analysis_output_t *
dao_load_from_value (data_analysis_output_t *dao,
GnmValue *output_range)
@@ -271,7 +282,7 @@ dao_prepare_output (WorkbookControl *wbc, data_analysis_output_t *dao,
dao->sheet = sheet_new (wb, name, dao->cols, dao->rows);
dao->start_col = dao->start_row = 0;
workbook_sheet_attach (wb, dao->sheet);
- dao->wbc = wb_control_wrapper_new (dao->wbc, NULL, wb, NULL);
+ dao->wbc = workbook_control_new_wrapper (dao->wbc, NULL, wb, NULL);
}
if (dao->wbc)
@@ -905,7 +916,7 @@ dao_set_border (data_analysis_output_t *dao, int col1, int row1,
* @is_cols:
*
*
- *
+ * Returns: (transfer full):
**/
ColRowStateList *
dao_get_colrow_state_list (data_analysis_output_t *dao, gboolean is_cols)
@@ -1163,12 +1174,28 @@ dao_set_sheet_object (data_analysis_output_t *dao, int col, int row, SheetObject
dao->sos = g_slist_prepend (dao->sos, so);
}
+/**
+ * dao_go_data_vector:
+ * @dao:
+ * @ax:
+ * @ay:
+ * @bx:
+ * @by:
+ *
+ * Returns: (transfer full):
+ **/
GOData *
dao_go_data_vector (data_analysis_output_t *dao, int ax, int ay, int bx, int by)
{
return gnm_go_data_vector_new_expr (dao->sheet, gnm_expr_top_new (dao_get_rangeref (dao, ax, ay, bx, by)));
}
+/**
+ * dao_surrender_so:
+ * @dao:
+ *
+ * Returns: (element-type GObject) (transfer full):
+ **/
GSList *
dao_surrender_so (data_analysis_output_t *dao)
{
diff --git a/src/tools/scenarios.c b/src/tools/scenarios.c
index 0725ead..7ee8350 100644
--- a/src/tools/scenarios.c
+++ b/src/tools/scenarios.c
@@ -67,6 +67,19 @@ gnm_scenario_item_dup (GnmScenarioItem *src)
return dst;
}
+GType
+gnm_scenario_item_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmScenarioItem",
+ (GBoxedCopyFunc)gnm_scenario_item_dup,
+ (GBoxedFreeFunc)gnm_scenario_item_free);
+ }
+ return t;
+}
+
void
gnm_scenario_item_set_range (GnmScenarioItem *sci, const GnmSheetRange *sr)
{
@@ -148,7 +161,7 @@ gnm_scenario_new (char const *name, Sheet *sheet)
/**
* gnm_scenario_dup:
- * @src: #GnmScenario
+ * @sc: #GnmScenario
* @new_sheet: #Sheet
*
* Returns: (transfer full): the duplicated scenario.
diff --git a/src/tools/scenarios.h b/src/tools/scenarios.h
index f854b29..fb03b24 100644
--- a/src/tools/scenarios.h
+++ b/src/tools/scenarios.h
@@ -11,6 +11,7 @@ typedef struct {
GnmValue *value;
} GnmScenarioItem;
+GType gnm_scenario_item_get_type (void);
GnmScenarioItem *gnm_scenario_item_new (Sheet *sheet);
void gnm_scenario_item_free (GnmScenarioItem *sci);
void gnm_scenario_item_set_range (GnmScenarioItem *sci,
@@ -45,7 +46,7 @@ GType gnm_scenario_get_type (void);
GnmScenario *gnm_scenario_new (char const *name, Sheet *sheet);
-GnmScenario *gnm_scenario_dup (GnmScenario *s, Sheet *new_sheet);
+GnmScenario *gnm_scenario_dup (GnmScenario *sc, Sheet *new_sheet);
void gnm_scenario_set_comment (GnmScenario *sc, const char *comment);
diff --git a/src/validation.c b/src/validation.c
index 03e3a5a..e1c957b 100644
--- a/src/validation.c
+++ b/src/validation.c
@@ -360,6 +360,25 @@ gnm_validation_unref (GnmValidation const *val)
}
}
+GType
+gnm_validation_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmValidation",
+ (GBoxedCopyFunc)gnm_validation_ref,
+ (GBoxedFreeFunc)gnm_validation_unref);
+ }
+ return t;
+}
+
+/**
+ * gnm_validation_get_sheet:
+ * @v: #GnmValidation
+ *
+ * Returns: (transfer none): the sheet.
+ **/
Sheet *
gnm_validation_get_sheet (GnmValidation *v)
{
diff --git a/src/validation.h b/src/validation.h
index 112dee7..9de7180 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -64,6 +64,7 @@ GType gnm_validation_op_get_type (void);
#define GNM_VALIDATION_OP_TYPE (gnm_validation_op_get_type ())
+GType gnm_validation_get_type (void);
GnmValidation *gnm_validation_new (ValidationStyle style,
ValidationType type,
ValidationOp op,
diff --git a/src/value-sheet.c b/src/value-sheet.c
index 9ddfaba..9592b3c 100644
--- a/src/value-sheet.c
+++ b/src/value-sheet.c
@@ -265,13 +265,13 @@ cb_wrapper_foreach_cell_in_area (GnmCellIter const *iter, WrapperClosure *wrap)
* @v: const #GnmValue
* @ep: const #GnmEvalPos
* @flags: #CellIterFlags
- * @func: #GnmValueIterFunc
+ * @func: (scope call): #GnmValueIterFunc
* @user_data:
*
* For each existing element in an array or range , invoke the
* callback routine.
*
- * Return value:
+ * Returns: (transfer none):
* non-NULL on error, or VALUE_TERMINATE if some invoked routine requested
* to stop (by returning non-NULL).
**/
diff --git a/src/value.c b/src/value.c
index 9f1cca3..dcc0a63 100644
--- a/src/value.c
+++ b/src/value.c
@@ -1628,13 +1628,38 @@ find_column_of_field (GnmEvalPos const *ep,
void
free_criteria (GnmCriteria *criteria)
{
+ if (!criteria || criteria->ref_count-- > 1)
+ return;
value_release (criteria->x);
if (criteria->has_rx)
go_regfree (&criteria->rx);
g_free (criteria);
}
-/*
+static GnmCriteria *
+gnm_criteria_ref (GnmCriteria *criteria)
+{
+ criteria->ref_count++;
+ return criteria;
+}
+
+GType
+gnm_criteria_get_type (void)
+{
+ static GType t = 0;
+
+ if (t == 0) {
+ t = g_boxed_type_register_static ("GnmCriteria",
+ (GBoxedCopyFunc)gnm_criteria_ref,
+ (GBoxedFreeFunc)free_criteria);
+ }
+ return t;
+}
+
+/**
+ * free_criterias:
+ * @criterias: (element-type GnmCriteria) (transfer full): the criteria to be
+ * freed.
* Frees the allocated memory.
*/
void
@@ -1719,6 +1744,7 @@ parse_criteria (GnmValue const *crit_val, GODateConventions const *date_conv)
if (res->fun (empty, res))
res->iter_flags &= ~CELL_ITER_IGNORE_BLANK;
value_release (empty);
+ res->ref_count = 1;
return res;
}
@@ -1759,8 +1785,14 @@ parse_criteria_range (Sheet *sheet, int b_col, int b_row, int e_col, int e_row,
return g_slist_reverse (criterias);
}
-/*
+/**
+ * parse_database_criteria:
+ * @ep: #GnmEvalPos
+ * @database: #GnmValue
+ * @criteria: #GnmValue
+ *
* Parses the criteria cell range.
+ * Returns: (element-type GnmDBCriteria) (transfer full):
*/
GSList *
parse_database_criteria (GnmEvalPos const *ep, GnmValue const *database, GnmValue const *criteria)
@@ -1804,8 +1836,19 @@ parse_database_criteria (GnmEvalPos const *ep, GnmValue const *database, GnmValu
e_col, e_row, field_ind);
}
-/* Finds the rows from the given database that match the criteria.
- */
+/**
+ * find_rows_that_match:
+ * @sheet: #Sheet
+ * @first_col: first column.
+ * @first_row: first row.
+ * @last_col: last column.
+ * @last_row: laset row.
+ * @criterias: (element-type GnmDBCriteria): the criteria to use.
+ * @unique_only:
+ *
+ * Finds the rows from the given database that match the criteria.
+ * Returns: (element-type int) (transfer full): the list of matching rows.
+ **/
GSList *
find_rows_that_match (Sheet *sheet, int first_col, int first_row,
int last_col, int last_row,
diff --git a/src/value.h b/src/value.h
index 5d9ffad..9cf6210 100644
--- a/src/value.h
+++ b/src/value.h
@@ -202,7 +202,9 @@ struct _GnmCriteria {
GODateConventions const *date_conv;
GORegexp rx;
gboolean has_rx;
+ unsigned ref_count; /* for boxed type */
};
+GType gnm_criteria_get_type (void);
typedef struct {
int row; /* absolute */
diff --git a/src/wbc-gtk-edit.c b/src/wbc-gtk-edit.c
index cfd3d1a..2b03f8b 100644
--- a/src/wbc-gtk-edit.c
+++ b/src/wbc-gtk-edit.c
@@ -83,12 +83,12 @@ wbcg_auto_complete_destroy (WBCGtk *wbcg)
}
/**
- * wbcg_edit_finish :
- * @wbcg : #WBCGtk
- * @result : what should we do with the content
- * @showed_dialog : If non-NULL will indicate if a dialog was displayed.
+ * wbcg_edit_finish:
+ * @wbcg: #WBCGtk
+ * @result: what should we do with the content
+ * @showed_dialog: If non-NULL will indicate if a dialog was displayed.
*
- * Return TRUE if editing completed successfully, or we were no editing.
+ * Return: TRUE if editing completed successfully, or we were no editing.
**/
gboolean
wbcg_edit_finish (WBCGtk *wbcg, WBCEditResult result,
@@ -749,9 +749,9 @@ set_or_unset (PangoAttrList *dst, const PangoAttribute *attr,
}
/**
- * wbcg_edit_add_markup :
- * @wbcg : #WBCGtk
- * @attr : #PangoAttribute
+ * wbcg_edit_add_markup:
+ * @wbcg: #WBCGtk
+ * @attr: #PangoAttribute
*
* Absorbs the ref to @attr.
**/
@@ -784,10 +784,10 @@ wbcg_edit_add_markup (WBCGtk *wbcg, PangoAttribute *attr)
}
/**
- * wbcg_edit_get_markup :
- * @wbcg : #WBCGtk
+ * wbcg_edit_get_markup:
+ * @wbcg: #WBCGtk
*
- * Returns a potentially NULL PangoAttrList of the current markup while
+ * Returns: a potentially NULL PangoAttrList of the current markup while
* editing. The list belongs to @wbcg and should not be freed.
**/
PangoAttrList *
@@ -879,7 +879,7 @@ wbcg_edit_start (WBCGtk *wbcg,
GtkWidget *check;
GtkWidget *align;
- GtkWidget *d = gnumeric_message_dialog_new
+ GtkWidget *d = gnumeric_message_dialog_create
(wbcg_toplevel (wbcg),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_WARNING,
@@ -1010,9 +1010,9 @@ wbcg_edit_start (WBCGtk *wbcg,
}
/**
- * wbcg_insert_object :
- * @wbcg : #WBCGtk *
- * @so : The object the needs to be placed
+ * wbcg_insert_object:
+ * @wbcg: #WBCGtk *
+ * @so: The object the needs to be placed
*
* Takes a newly created #SheetObject that has not yet been realized and
* prepares to place it on the sheet.
@@ -1047,8 +1047,8 @@ wbcg_insert_object (WBCGtk *wbcg, SheetObject *so)
}
/**
- * wbcg_insert_object_clear :
- * @wbcg : #WBCGtk
+ * wbcg_insert_object_clear:
+ * @wbcg: #WBCGtk
*
* If we are preparing to insert a new object, unref the object, and restore
* a normal state to the scgs that was changed in wbcg_insert_object
@@ -1075,10 +1075,10 @@ wbcg_insert_object_clear (WBCGtk *wbcg)
/**
- * wbcg_get_entry :
- * @WBCGtk : @wbcg
+ * wbcg_get_entry:
+ * @wbcg: #WBCGtk
*
- * Returns the #GtkEntry associated with the current GnmExprEntry
+ * Returns: (transfer none): the #GtkEntry associated with the current GnmExprEntry
**/
GtkEntry *
wbcg_get_entry (WBCGtk const *wbcg)
@@ -1090,11 +1090,11 @@ wbcg_get_entry (WBCGtk const *wbcg)
}
/**
- * wbcg_get_entry_logical :
- * @WBCGtk : @wbcg
+ * wbcg_get_entry_logical:
+ * @wbcg: #WBCGtk
*
- * Returns the logical (allowing redirection via wbcg_set_entry for gurus)
- * #GnmExprEntry
+ * Returns: (transfer none): the logical (allowing redirection via
+ * wbcg_set_entry for gurus) #GnmExprEntry
**/
GnmExprEntry *
wbcg_get_entry_logical (WBCGtk const *wbcg)
@@ -1108,10 +1108,11 @@ wbcg_get_entry_logical (WBCGtk const *wbcg)
}
/**
- * wbcg_get_entry_underlying :
- * @wbcg : #WBCGtk
+ * wbcg_get_entry_underlying:
+ * @wbcg: #WBCGtk
*
- * Returns the #GtkEntry associated with the logical #GnmExprEntry.
+ * Returns: (transfer none): the #GtkEntry associated with the logical
+ * #GnmExprEntry.
**/
GtkWidget *
wbcg_get_entry_underlying (WBCGtk const *wbcg)
@@ -1133,10 +1134,10 @@ wbcg_set_entry (WBCGtk *wbcg, GnmExprEntry *entry)
}
/**
- * wbcg_entry_has_logical :
- * @wbcg : #WBCGtk
+ * wbcg_entry_has_logical:
+ * @wbcg: #WBCGtk
*
- * Returns TRUE if wbcg_set_entry has redirected the edit_entry.
+ * Returns: TRUE if wbcg_set_entry has redirected the edit_entry.
**/
gboolean
wbcg_entry_has_logical (WBCGtk const *wbcg)
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index df893af..854797e 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -275,8 +275,8 @@ cb_autosave (WBCGtk *wbcg)
}
/**
- * wbcg_rangesel_possible
- * @wbcg : the workbook control gui
+ * wbcg_rangesel_possible:
+ * @wbcg: the workbook control gui
*
* Returns true if the cursor keys should be used to select
* a cell range (if the cursor is in a spot in the expression
@@ -1629,21 +1629,21 @@ wbcg_menu_state_update (WorkbookControl *wbc, int flags)
}
if (MS_FILE_EXPORT_IMPORT & flags) {
Workbook *wb = wb_control_get_workbook (wbc);
- gboolean has_export_info = workbook_get_file_exporter (wb) &&
+ gboolean has_export_info = workbook_get_file_exporter (wb) &&
workbook_get_last_export_uri (wb);
wbc_gtk_set_action_sensitivity (wbcg, "DataExportRepeat", has_export_info);
if (has_export_info) {
gchar *base = go_basename_from_uri (workbook_get_last_export_uri (wb));
- gchar *new_label = g_strdup_printf (_("Repeat Export to %s"),
+ gchar *new_label = g_strdup_printf (_("Repeat Export to %s"),
base);
g_free (base);
- wbc_gtk_set_action_label (wbcg, "DataExportRepeat", NULL,
+ wbc_gtk_set_action_label (wbcg, "DataExportRepeat", NULL,
new_label, N_("Repeat the last data export"));
g_free (new_label);
} else
- wbc_gtk_set_action_label (wbcg, "DataExportRepeat", NULL,
+ wbc_gtk_set_action_label (wbcg, "DataExportRepeat", NULL,
N_("Repeat Export"), N_("Repeat the last data export"));
- }
+ }
{
gboolean const has_slicer = (NULL != sv_editpos_in_slicer (sv));
char const* label = has_slicer
@@ -1702,7 +1702,7 @@ wbcg_show_save_dialog (WBCGtk *wbcg,
msg = g_strdup (_("Save changes to workbook before closing?"));
}
- d = gnumeric_message_dialog_new (wbcg_toplevel (wbcg),
+ d = gnumeric_message_dialog_create (wbcg_toplevel (wbcg),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_WARNING,
msg,
@@ -1830,7 +1830,7 @@ wbcg_close_if_user_permits (WBCGtk *wbcg,
/**
* wbc_gtk_close:
- * @wbcg : #WBCGtk
+ * @wbcg: #WBCGtk
*
* Returns TRUE if the control should NOT be closed.
*/
@@ -5604,7 +5604,7 @@ wbc_gtk_init (GObject *obj)
char *uifile;
unsigned i;
- wbcg->gui = gnm_gtk_builder_new ("wbcg.ui", NULL, NULL);
+ wbcg->gui = gnm_gtk_builder_load ("wbcg.ui", NULL, NULL);
wbcg->cancel_button = GET_GUI_ITEM ("cancel_button");
wbcg->ok_button = GET_GUI_ITEM ("ok_button");
wbcg->func_button = GET_GUI_ITEM ("func_button");
@@ -5817,6 +5817,12 @@ wbc_gtk_new (WorkbookView *optional_view,
return wbcg;
}
+/**
+ * wbcg_toplevel:
+ * @wbcg: #WBCGtk
+ *
+ * Returns: (transfer none): the toplevel #GtkWindow.
+ **/
GtkWindow *
wbcg_toplevel (WBCGtk *wbcg)
{
@@ -5838,11 +5844,12 @@ wbcg_get_n_scg (WBCGtk const *wbcg)
}
/**
- * wbcg_get_nth_scg
+ * wbcg_get_nth_scg:
* @wbcg: #WBCGtk
* @i:
*
- * Returns the scg associated with the @i-th tab in @wbcg's notebook.
+ * Returns: (transfer none): the scg associated with the @i-th tab in
+ * @wbcg's notebook.
* NOTE : @i != scg->sv->sheet->index_in_wb
**/
SheetControlGUI *
@@ -5866,15 +5873,16 @@ wbcg_get_nth_scg (WBCGtk *wbcg, int i)
#warning merge these and clarfy whether we want the visible scg, or the logical (view) scg
/**
- * wbcg_focus_cur_scg :
- * @wbcg : The workbook control to operate on.
+ * wbcg_focus_cur_scg:
+ * @wbcg: The workbook control to operate on.
*
* A utility routine to safely ensure that the keyboard focus
* is attached to the item-grid. This is required when a user
* edits a combo-box or and entry-line which grab focus.
*
* It is called for zoom, font name/size, and accept/cancel for the editline.
- */
+ * Returns: (transfer none): the sheet.
+ **/
Sheet *
wbcg_focus_cur_scg (WBCGtk *wbcg)
{
@@ -5894,12 +5902,24 @@ wbcg_focus_cur_scg (WBCGtk *wbcg)
return scg_sheet (scg);
}
+/**
+ * wbcg_cur_scg:
+ * @wbcg: #WBCGtk
+ *
+ * Returns: (transfer none): the current #ShetControlGUI.
+ **/
SheetControlGUI *
wbcg_cur_scg (WBCGtk *wbcg)
{
return wbcg_get_scg (wbcg, wbcg_cur_sheet (wbcg));
}
+/**
+ * wbcg_cur_sheet:
+ * @wbcg: #WBCGtk
+ *
+ * Returns: (transfer none): the current #Sheet.
+ **/
Sheet *
wbcg_cur_sheet (WBCGtk *wbcg)
{
@@ -5921,6 +5941,15 @@ wbcg_get_font_desc (WBCGtk *wbcg)
return wbcg->font_desc;
}
+/**
+ * wbcg_find_for_workbook:
+ * @wb: #Workbook
+ * @candidate: a candidate #WBCGtk
+ * @pref_screen: the preferred screen.
+ * @pref_display: the preferred display.
+ *
+ * Returns: (transfer none): the found #WBCGtk or %NULL.
+ **/
WBCGtk *
wbcg_find_for_workbook (Workbook *wb,
WBCGtk *candidate,
diff --git a/src/widgets/gnm-dao.c b/src/widgets/gnm-dao.c
index 4636cea..a0083b3 100644
--- a/src/widgets/gnm-dao.c
+++ b/src/widgets/gnm-dao.c
@@ -70,7 +70,7 @@ gnm_dao_init (GnmDao *gdao)
{
GtkWidget *toplevel;
- gdao->gui = gnm_gtk_builder_new ("dao.ui", NULL, NULL);
+ gdao->gui = gnm_gtk_builder_load ("dao.ui", NULL, NULL);
if (gdao->gui == NULL)
return;
diff --git a/src/widgets/widget-font-selector.c b/src/widgets/widget-font-selector.c
index 803b6e4..885c874 100644
--- a/src/widgets/widget-font-selector.c
+++ b/src/widgets/widget-font-selector.c
@@ -371,7 +371,7 @@ fs_init (FontSelector *fs)
{
GtkWidget *w;
- fs->gui = gnm_gtk_builder_new ("font-sel.ui", NULL, NULL);
+ fs->gui = gnm_gtk_builder_load ("font-sel.ui", NULL, NULL);
if (fs->gui == NULL)
return;
diff --git a/src/workbook-control.c b/src/workbook-control.c
index a78e7cc..001f7cb 100644
--- a/src/workbook-control.c
+++ b/src/workbook-control.c
@@ -60,8 +60,17 @@ void wb_control_ ## func arglist \
}
#define WBC_VIRTUAL(func, arglist, call) WBC_VIRTUAL_FULL(func, func, arglist, call)
+/**
+ * workbook_control_new_wrapper:
+ * @wbc: #WorkbookControl
+ * @wbv: #WorkbookView
+ * @wb: #Workbook
+ * @extra:
+ *
+ * Returns: (transfer full): the newly allocated #WorkbookControl.
+ **/
WorkbookControl *
-wb_control_wrapper_new (WorkbookControl *wbc, WorkbookView *wbv, Workbook *wb,
+workbook_control_new_wrapper (WorkbookControl *wbc, WorkbookView *wbv, Workbook *wb,
void *extra)
{
WorkbookControlClass *wbc_class = WBC_CLASS (wbc);
@@ -147,11 +156,11 @@ wb_control_claim_selection (WorkbookControl *wbc)
}
/**
- * wb_control_validation_msg :
+ * wb_control_validation_msg:
* 1 : ignore invalid and accept result
* 0 : discard invalid and finish editing
* -1 : continue editing
- */
+ **/
int
wb_control_validation_msg (WorkbookControl *wbc, ValidationStyle v,
char const *title, char const *msg)
@@ -166,6 +175,12 @@ wb_control_validation_msg (WorkbookControl *wbc, ValidationStyle v,
return 1; /* no handler, always accept */
}
+/**
+ * wb_control_view:
+ * @wbc: #WorkbookControl
+ *
+ * Returns: (transfer none): the workbook view.
+ **/
WorkbookView *
wb_control_view (WorkbookControl const *wbc)
{
@@ -173,12 +188,24 @@ wb_control_view (WorkbookControl const *wbc)
return wbc->wb_view;
}
+/**
+ * wb_control_get_doc:
+ * @wbc: #WorkbookControl
+ *
+ * Returns: (transfer none): the workbook set as a #GODoc.
+ **/
GODoc *
wb_control_get_doc (WorkbookControl const *wbc)
{
return GO_DOC (wb_control_get_workbook (wbc));
}
+/**
+ * wb_control_get_workbook:
+ * @wbc: #WorkbookControl
+ *
+ * Returns: (transfer none): the workbook.
+ **/
Workbook *
wb_control_get_workbook (WorkbookControl const *wbc)
{
@@ -186,6 +213,12 @@ wb_control_get_workbook (WorkbookControl const *wbc)
return wbc->wb_view ? wb_view_get_workbook (wbc->wb_view) : NULL;
}
+/**
+ * wb_control_cur_sheet:
+ * @wbc: #WorkbookControl
+ *
+ * Returns: (transfer none): the current sheet.
+ **/
Sheet *
wb_control_cur_sheet (WorkbookControl const *wbc)
{
@@ -193,6 +226,12 @@ wb_control_cur_sheet (WorkbookControl const *wbc)
return wb_view_cur_sheet (wbc->wb_view);
}
+/**
+ * wb_control_cur_sheet_view:
+ * @wbc: #WorkbookControl
+ *
+ * Returns: (transfer none): the current sheet view.
+ **/
SheetView *
wb_control_cur_sheet_view (WorkbookControl const *wbc)
{
diff --git a/src/workbook-control.h b/src/workbook-control.h
index 013480d..74336c4 100644
--- a/src/workbook-control.h
+++ b/src/workbook-control.h
@@ -19,9 +19,9 @@ void wb_control_set_view (WorkbookControl *wbc,
void wb_control_init_state (WorkbookControl *wbc);
/* Create a new control of the same form */
-WorkbookControl *wb_control_wrapper_new (WorkbookControl *wbc,
- WorkbookView *wbv, Workbook *wb,
- void *extra);
+WorkbookControl *workbook_control_new_wrapper (WorkbookControl *wbc,
+ WorkbookView *wbv, Workbook *wb,
+ void *extra);
void wb_control_style_feedback (WorkbookControl *wbc, GnmStyle const *changes);
void wb_control_edit_line_set (WorkbookControl *wbc, char const *text);
diff --git a/src/workbook-view.c b/src/workbook-view.c
index c81c2be..9fadb3a 100644
--- a/src/workbook-view.c
+++ b/src/workbook-view.c
@@ -94,7 +94,7 @@ enum {
/**
* wb_view_get_workbook:
- * @wbv : #WorkbookView
+ * @wbv: #WorkbookView
*
* Returns: (transfer none): the #Workbook associated with @wbv
**/
@@ -107,7 +107,7 @@ wb_view_get_workbook (WorkbookView const *wbv)
/**
* wb_view_get_doc:
- * @wbv : #WorkbookView
+ * @wbv: #WorkbookView
*
* Returns: (transfer none): the #Workbook associated with @wbv cast to a #GODoc
**/
@@ -137,6 +137,12 @@ wb_view_get_index_in_wb (WorkbookView const *wbv)
return -1;
}
+/**
+ * wb_view_cur_sheet:
+ * @wbv: #WorkbookView
+ *
+ * Returns: (transfer none): the current sheet.
+ **/
Sheet *
wb_view_cur_sheet (WorkbookView const *wbv)
{
@@ -144,6 +150,12 @@ wb_view_cur_sheet (WorkbookView const *wbv)
return wbv->current_sheet;
}
+/**
+ * wb_view_cur_sheet_view:
+ * @wbv: #WorkbookView
+ *
+ * Returns: (transfer none): the current sheet view.
+ **/
SheetView *
wb_view_cur_sheet_view (WorkbookView const *wbv)
{
@@ -1080,7 +1092,7 @@ wb_view_save_to_uri (WorkbookView *wbv, GOFileSaver const *fs,
* wb_view_save_as:
* @wbv: Workbook View
* @fs: GOFileSaver object
- * @uri: URI to save as.
+ * @file_name: URI to save as.
* @context:
*
* Saves @wbv and workbook it's attached to into @uri file using
@@ -1113,14 +1125,14 @@ wb_view_save_as (WorkbookView *wbv, GOFileSaver *fs, char const *uri,
has_error = go_io_error_occurred (io_context);
has_warning = go_io_warning_occurred (io_context);
if (!has_error) {
- if (workbook_set_saveinfo
+ if (workbook_set_saveinfo
(wb, go_file_saver_get_format_level (fs), fs)) {
if (go_doc_set_uri (GO_DOC (wb), uri)) {
go_doc_set_dirty (GO_DOC (wb), FALSE);
/* See 634792. */
go_doc_set_pristine (GO_DOC (wb), FALSE);
}
- } else
+ } else
workbook_set_last_export_uri (wb, g_strdup (uri));
}
if (has_error || has_warning)
@@ -1134,7 +1146,7 @@ wb_view_save_as (WorkbookView *wbv, GOFileSaver *fs, char const *uri,
/**
* wb_view_save:
* @wbv: The view to save.
- * @context: The context that invoked the operation
+ * @cc: The context that invoked the operation
*
* Saves @wbv and workbook it's attached to into file assigned to the
* workbook using workbook's file saver. If the workbook has no file
@@ -1182,12 +1194,25 @@ wb_view_save (WorkbookView *wbv, GOCmdContext *context)
return !has_error;
}
+/**
+ * workbook_view_new_from_uri:
+ * @input: #GsfInput to read data from.
+ * @optional_format: Optional GOFileOpener
+ * @io_context: Optional context to display errors.
+ * @optional_encoding: Optional encoding for GOFileOpener that understand it
+ *
+ * Reads @uri file using given file opener @optional_fmt, or probes for a valid
+ * possibility if @optional_fmt is NULL. Reports problems to @io_context.
+ *
+ * Return value: (transfer full): the newly allocated WorkbookView or %NULL
+ * on error.
+ **/
WorkbookView *
-wb_view_new_from_input (GsfInput *input,
- const char *optional_uri,
- GOFileOpener const *optional_fmt,
- GOIOContext *io_context,
- char const *optional_enc)
+workbook_view_new_from_input (GsfInput *input,
+ const char *optional_uri,
+ GOFileOpener const *optional_fmt,
+ GOIOContext *io_context,
+ char const *optional_enc)
{
WorkbookView *new_wbv = NULL;
@@ -1261,7 +1286,7 @@ wb_view_new_from_input (GsfInput *input,
workbook_recalc (new_wb);
go_doc_set_dirty (GO_DOC (new_wb), FALSE);
if (optional_uri && workbook_get_file_exporter (new_wb))
- workbook_set_last_export_uri
+ workbook_set_last_export_uri
(new_wb, g_strdup (optional_uri));
}
} else
@@ -1272,19 +1297,20 @@ wb_view_new_from_input (GsfInput *input,
}
/**
- * wb_view_new_from_uri:
+ * workbook_view_new_from_uri:
* @uri: URI for file
- * @optional_fmt: Optional GOFileOpener
+ * @optional_format: Optional GOFileOpener
* @io_context: Optional context to display errors.
- * @optional_enc: Optional encoding for GOFileOpener that understand it
+ * @optional_encoding: Optional encoding for GOFileOpener that understand it
*
* Reads @uri file using given file opener @optional_fmt, or probes for a valid
* possibility if @optional_fmt is NULL. Reports problems to @io_context.
*
- * Return value: TRUE if file was successfully read and FALSE otherwise.
- */
+ * Return value: (transfer full): the newly allocated WorkbookView or %NULL
+ * on error.
+ **/
WorkbookView *
-wb_view_new_from_uri (char const *uri,
+workbook_view_new_from_uri (char const *uri,
GOFileOpener const *optional_fmt,
GOIOContext *io_context,
char const *optional_enc)
@@ -1302,7 +1328,7 @@ wb_view_new_from_uri (char const *uri,
#if 0
g_printerr ("Reading %s\n", uri);
#endif
- res = wb_view_new_from_input (input, uri,
+ res = workbook_view_new_from_input (input, uri,
optional_fmt, io_context,
optional_enc);
g_object_unref (G_OBJECT (input));
diff --git a/src/workbook-view.h b/src/workbook-view.h
index 57b798b..baa5dac 100644
--- a/src/workbook-view.h
+++ b/src/workbook-view.h
@@ -97,15 +97,15 @@ void wbv_save_to_output (WorkbookView *wbv, GOFileSaver const *fs,
void wb_view_save_to_uri (WorkbookView *wbv, GOFileSaver const *fs,
char const *uri, GOIOContext *io_context);
-WorkbookView *wb_view_new_from_input (GsfInput *input,
- const char *optional_uri,
- GOFileOpener const *optional_format,
- GOIOContext *io_context,
- gchar const *optional_encoding);
-WorkbookView *wb_view_new_from_uri (char const *uri,
- GOFileOpener const *optional_format,
- GOIOContext *io_context,
- gchar const *optional_encoding);
+WorkbookView *workbook_view_new_from_input (GsfInput *input,
+ const char *optional_uri,
+ GOFileOpener const *optional_format,
+ GOIOContext *io_context,
+ gchar const *optional_encoding);
+WorkbookView *workbook_view_new_from_uri (char const *uri,
+ GOFileOpener const *optional_format,
+ GOIOContext *io_context,
+ gchar const *optional_encoding);
#define WORKBOOK_VIEW_FOREACH_CONTROL(wbv, control, code) \
do { \
diff --git a/src/workbook.c b/src/workbook.c
index 3703653..b44ee36 100644
--- a/src/workbook.c
+++ b/src/workbook.c
@@ -94,7 +94,7 @@ workbook_update_history (Workbook *wb, file_save_as_t type)
break;
case FILE_SAVE_AS_EXPORT:
default:
- if (wb->last_export_uri &&
+ if (wb->last_export_uri &&
wb->file_export_format_level >= GO_FILE_FL_MANUAL_REMEMBER) {
const char *mimetype = wb->file_exporter
? go_file_saver_get_mime_type (wb->file_exporter)
@@ -403,8 +403,8 @@ workbook_new_with_sheets (int sheet_count)
/**
* workbook_set_saveinfo:
* @wb: the workbook to modify
- * @name: the file name for this worksheet.
- * @level: the file format level
+ * @lev: the file format level
+ * @saver: the file saver.
*
* If level is sufficiently advanced assign the info.
*
@@ -488,20 +488,20 @@ workbook_get_last_export_uri (Workbook *wb)
return wb->last_export_uri;
}
-void
+void
workbook_set_file_exporter (Workbook *wb, GOFileSaver *fs)
{
wb->file_exporter = fs;
- WORKBOOK_FOREACH_CONTROL (wb, wbv, wbc,
+ WORKBOOK_FOREACH_CONTROL (wb, wbv, wbc,
wb_control_menu_state_update (wbc, MS_FILE_EXPORT_IMPORT););
}
-void
+void
workbook_set_last_export_uri (Workbook *wb, gchar *uri)
{
g_free (wb->last_export_uri);
wb->last_export_uri = uri;
- WORKBOOK_FOREACH_CONTROL (wb, wbv, wbc,
+ WORKBOOK_FOREACH_CONTROL (wb, wbv, wbc,
wb_control_menu_state_update (wbc, MS_FILE_EXPORT_IMPORT););
}
@@ -511,7 +511,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.
+ * @flags: if TRUE only existing cells are sent to the handler.
* @handler: (scope call): The operator to apply to each cell.
* @closure: User data.
*
@@ -578,7 +578,7 @@ 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
+ * Returns: (element-type GnmEvalPos) (transfer full): the cells array
*/
GPtrArray *
workbook_cells (Workbook *wb, gboolean comments, GnmSheetVisibility vis)
@@ -1242,7 +1242,7 @@ workbook_sheet_rename (Workbook *wb,
* workbook_find_command:
* @wb: #Workbook
* @is_undo: undo vs redo
- * @key: command
+ * @cmd: command
*
* Returns: the 1 based index of the @key command, or 0 if it is not found
**/
@@ -1382,7 +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;
+ wss->ref_count = 1;
return wss;
}
diff --git a/src/xml-sax-read.c b/src/xml-sax-read.c
index d647835..be87a9d 100644
--- a/src/xml-sax-read.c
+++ b/src/xml-sax-read.c
@@ -397,12 +397,25 @@ maybe_update_progress (GsfXMLIn *xin)
}
}
+/**
+ * gnm_xml_in_cur_obj:
+ * @xin: #GsfXMLIn
+ *
+ * Returns: (transfer none): the current sheet object.
+ **/
SheetObject *
gnm_xml_in_cur_obj (GsfXMLIn const *xin)
{
XMLSaxParseState *state = (XMLSaxParseState *)xin->user_state;
return state->so;
}
+
+/**
+ * gnm_xml_in_cur_sheet:
+ * @xin: #GsfXMLIn
+ *
+ * Returns: (transfer none): the current sheet.
+ **/
Sheet *
gnm_xml_in_cur_sheet (GsfXMLIn const *xin)
{
@@ -3102,7 +3115,7 @@ xml_sax_clipboardrange_start (GsfXMLIn *xin, xmlChar const **attrs)
int cols = -1, rows = -1, base_col = -1, base_row = -1;
GnmCellRegion *cr;
- cr = state->clipboard = cellregion_new (state->sheet);
+ cr = state->clipboard = gnm_cell_region_new (state->sheet);
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2) {
if (gnm_xml_attr_int (attrs, "Cols", &cols) ||
@@ -3506,6 +3519,14 @@ style_parser_done (GsfXMLIn *xin, XMLSaxParseState *old_state)
read_file_free_state (old_state, TRUE);
}
+/**
+ * gnm_xml_prep_style_parser:
+ * @xin:
+ * @attrs:
+ * @handler: (scope call):
+ * @user: user data.
+ *
+ **/
void
gnm_xml_prep_style_parser (GsfXMLIn *xin,
xmlChar const **attrs,
diff --git a/src/xml-sax-write.c b/src/xml-sax-write.c
index 1138898..2ec1af9 100644
--- a/src/xml-sax-write.c
+++ b/src/xml-sax-write.c
@@ -1400,9 +1400,9 @@ gnm_xml_io_conventions (void)
}
static void
-gnm_xml_file_save_full (G_GNUC_UNUSED GOFileSaver const *fs,
+gnm_xml_file_save_full (G_GNUC_UNUSED GOFileSaver const *fs,
G_GNUC_UNUSED GOIOContext *io_context,
- GoView const *view, GsfOutput *output,
+ GoView const *view, GsfOutput *output,
gboolean compress)
{
GnmOutputXML state;
@@ -1482,7 +1482,7 @@ gnm_xml_file_save (GOFileSaver const *fs, GOIOContext *io_context,
compress = FALSE;
else
compress = (gnm_conf_get_core_xml_compression_level () > 0);
-
+
gnm_xml_file_save_full (fs, io_context, view, output, compress);
}
@@ -1502,7 +1502,7 @@ typedef struct {
} XMLCellCopyState;
static void
-cb_xml_write_cell_region_cells (GnmCellCopy *cc,
+cb_xml_write_cell_region_cells (GnmCellCopy *cc,
G_GNUC_UNUSED gconstpointer ignore,
XMLCellCopyState *state)
{
@@ -1513,12 +1513,11 @@ cb_xml_write_cell_region_cells (GnmCellCopy *cc,
}
/**
- * gnm_cellregion_to_xml :
- * @cr : the content to store.
- * @size: store the size of the buffer here.
+ * gnm_cellregion_to_xml:
+ * @cr: the content to store.
*
* Caller is responsible for free-ing the result.
- * Returns NULL on error
+ * Returns: (transfer full): NULL on error
**/
GsfOutputMemory *
gnm_cellregion_to_xml (GnmCellRegion const *cr)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]