[gnumeric] Introspection fixes
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Introspection fixes
- Date: Thu, 12 Apr 2018 19:55:14 +0000 (UTC)
commit d626b015093487d8bd4266b58424e1c99faa1bef
Author: Morten Welinder <terra gnome org>
Date: Thu Apr 12 15:54:56 2018 -0400
Introspection fixes
README-introspection | 60 +++++++++++++++++++++++++++++++++---
src/mstyle.c | 18 ++++++-----
src/sheet.c | 1 -
test/t3001-introspection-simple.py | 6 ++--
4 files changed, 68 insertions(+), 17 deletions(-)
---
diff --git a/README-introspection b/README-introspection
index fd91e96..87d7b75 100644
--- a/README-introspection
+++ b/README-introspection
@@ -13,14 +13,22 @@ This is incomplete. In particular, I'll have to look at
* Style information
* File i/o
* Copy and paste
+* Installing a gi override module for more pythony structure handling
-----------------------------------------------------------------------------
+Note: the Python version of type names excludes the Gnm prefix.
Workbook: [GObject]
new_with_sheets(count)
sheet_by_index(no)
sheet_by_name(string)
- props.name
+ recalc()
+ recalc_all()
+ cells(qcomments,visibility)
+ props.recalc_mode
+ props.uri
+ props.dirty
+ props.pristine
Sheet: [GObject]
@@ -33,6 +41,40 @@ Sheet: [GObject]
cells(range)
cells_count()
is_cell_empty(col,row)
+ props.name
+ props.workbook
+ props.rtl
+ props.visibility
+ props.display_formulas
+ props.display_zeros
+ props.display_grid
+ props.display_column_header
+ props.display_row_header
+ props.display_outlines
+ props.display_outlines_below
+ props.display_outlines_right
+ props.protected
+ props.protected_allow_edit_objects
+ props.protected_allow_edit_scenarios
+ props.protected_allow_cell_formatting
+ props.protected_allow_column_formatting
+ props.protected_allow_row_formatting
+ props.protected_allow_insert_columns
+ props.protected_allow_insert_rows
+ props.protected_allow_insert_hyperlinks
+ props.protected_allow_delete_columns
+ props.protected_allow_delete_rows
+ props.protected_allow_select_locked_cells
+ props.protected_allow_sort_ranges
+ props.protected_allow_edit_auto_filters
+ props.protected_allow_edit_pivottable
+ props.protected_allow_select_unlocked_cells
+ props.use_r1c1
+ props.tab_foreground
+ props.tab_background
+ props.zoom_factor
+ props.columns
+ props.rows
GnmCell: [Structure] [2]
@@ -55,9 +97,10 @@ GnmValue: [Structure]
get_as_int()
get_as_float()
type_of()
+ hash()
-ValueType: [Enum]
+GnmValueType: [Enum]
EMPTY
BOOLEAN
FLOAT
@@ -68,10 +111,10 @@ ValueType: [Enum]
GnmRange: [Simple structure]
- init(int,int,int,int)
+ init(col,row,col,row)
init_full_sheet(sheet)
- init_cols(sheet,int,int)
- init_rows(sheet,int,int)
+ init_cols(sheet,start,end)
+ init_rows(sheet,start,end)
init_cellpos(sheet,cellpos)
as_string()
start
@@ -83,6 +126,13 @@ GnmCellPos: [Simple structure]
row
+GnmSheetVisibility: [Enum]
+ VISIBLE
+ HIDDEN
+ VERY_HIDDEN
+
+
+
Footnotes:
[1] This function is not calling the obvious C function, but uses
introspection's rename-to feature to present a better API.
diff --git a/src/mstyle.c b/src/mstyle.c
index 2dd4e2c..4e5ea9d 100644
--- a/src/mstyle.c
+++ b/src/mstyle.c
@@ -611,11 +611,9 @@ gnm_style_clear_font (GnmStyle *style)
}
/**
- * gnm_style_new :
+ * gnm_style_new:
*
- * Caller is responsible for unrefing the result.
- *
- * Returns a new style with _no_ elements set.
+ * Returns: (transfer full): a new style with _no_ elements set.
**/
GnmStyle *
gnm_style_new (void)
@@ -643,9 +641,7 @@ gnm_style_new (void)
/**
* gnm_style_new_default:
*
- * Caller is responsible for unrefing the result.
- *
- * Return value: a new style initialized to the default state.
+ * Returns: (transfer full): a new style initialized to the default state.
**/
GnmStyle *
gnm_style_new_default (void)
@@ -748,6 +744,12 @@ gnm_style_new_merged (GnmStyle const *base, GnmStyle const *overlay)
return new_style;
}
+/**
+ * gnm_style_ref: (skip)
+ * @style: #GnmStyle
+ *
+ * Adds a reference to @style.
+ */
void
gnm_style_ref (GnmStyle const *style)
{
@@ -759,7 +761,7 @@ gnm_style_ref (GnmStyle const *style)
}
/**
- * gnm_style_unref :
+ * gnm_style_unref: (skip)
* @style: #GnmStyle const
*
* Unrefs and _potentially frees_ @style.
diff --git a/src/sheet.c b/src/sheet.c
index 80617ce..c66b74e 100644
--- a/src/sheet.c
+++ b/src/sheet.c
@@ -3014,7 +3014,6 @@ sheet_cell_set_text_gi (Sheet *sheet, int col, int row, char const *str)
}
-
/**
* sheet_cell_set_expr:
*
diff --git a/test/t3001-introspection-simple.py b/test/t3001-introspection-simple.py
index 299303b..174936c 100755
--- a/test/t3001-introspection-simple.py
+++ b/test/t3001-introspection-simple.py
@@ -11,9 +11,9 @@ wb = Gnm.Workbook.new_with_sheets(1)
# Get sheet. Index starts at 0
sheet = wb.sheet_by_index(0)
-print "Name:",sheet.props.name
-print "Number of columns:", sheet.get_size().max_cols
-print "Number of rows:", sheet.get_size().max_rows
+print "Name:", sheet.props.name
+print "Number of columns:", sheet.props.columns
+print "Number of rows:", sheet.props.rows
# Store values and expressions is some cells. Coordinates are (col,row)
# both starting at 0. (So what the gui sees as row 1 is 0 here.)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]