Commit 115d24d7 authored by Morten Welinder's avatar Morten Welinder

Further introspection support

parent ee5d52c9
......@@ -498,6 +498,19 @@ gnm_cell_is_zero (GnmCell const *cell)
return v && VALUE_IS_NUMBER (v) && gnm_abs (value_get_as_float (v)) < 64 * GNM_EPSILON;
}
/**
* gnm_cell_get_value:
* @cell: #GnmCell
*
* Returns: (transfer none): @cell's value
**/
GnmValue *
gnm_cell_get_value (GnmCell const *cell)
{
g_return_val_if_fail (cell != NULL, NULL);
return cell->value;
}
/**
* gnm_cell_array_bound:
* @cell: (nullable): #GnmCell
......
......@@ -43,6 +43,7 @@ gboolean gnm_cell_is_blank (GnmCell const *cell); /* empty, or "" */
GnmValue *gnm_cell_is_error (GnmCell const *cell);
gboolean gnm_cell_is_number (GnmCell const *cell);
gboolean gnm_cell_is_zero (GnmCell const *cell);
GnmValue *gnm_cell_get_value (GnmCell const *cell);
gboolean gnm_cell_is_array (GnmCell const *cell);
gboolean gnm_cell_is_nonsingleton_array (GnmCell const *cell);
......
......@@ -2911,8 +2911,7 @@ sheet_range_set_markup_undo (GnmSheetRange *sr, PangoAttrList *markup)
* @col: Source column
* @row: Source row
*
* Retrieve the value of a cell. The returned value must
* NOT be freed or tampered with.
* Returns: (transfer none) (nullable): the cell's current value.
**/
GnmValue const *
sheet_cell_get_value (Sheet *sheet, int const col, int const row)
......@@ -2999,6 +2998,23 @@ sheet_cell_set_text (GnmCell *cell, char const *text, PangoAttrList *markup)
sheet_flag_status_update_cell (cell);
}
/**
* sheet_cell_set_text_gi: (rename-to sheet_cell_set_text)
* @sheet: #Sheet
* @col: column number
* @row: row number
* @str: the text to set.
*
* Sets the contents of a cell.
*/
void
sheet_cell_set_text_gi (Sheet *sheet, int col, int row, char const *str)
{
sheet_cell_set_text (sheet_cell_fetch (sheet, col, row), str, NULL);
}
/**
* sheet_cell_set_expr:
*
......
......@@ -388,7 +388,7 @@ SheetView *sheet_get_view (Sheet const *sheet, WorkbookView const *wbv);
// Introspection support
void sheet_cell_set_value_gi (Sheet *sheet, int col, int row, GnmValue *v);
void sheet_cell_set_text_gi (Sheet *sheet, int col, int row, char const *str);
#define SHEET_FOREACH_VIEW(sheet, view, code) \
......
......@@ -4,5 +4,6 @@
import gi
gi.require_version('Gnm', '1.12')
from gi.repository import Gnm
Gnm.init()
print Gnm.qnorm(0.4,0,1,1,0)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment