[gnumeric] Introspection: GnmStyle.



commit 347e42d6b38078f75fbd3db784cf6dd673e8ef27
Author: Morten Welinder <terra gnome org>
Date:   Thu Apr 12 16:13:50 2018 -0400

    Introspection: GnmStyle.

 README-introspection               |   53 +++++++++++++++++++++++++++++++++--
 src/mstyle.c                       |    6 ++++
 test/t3001-introspection-simple.py |    4 +++
 3 files changed, 60 insertions(+), 3 deletions(-)
---
diff --git a/README-introspection b/README-introspection
index 87d7b75..658b699 100644
--- a/README-introspection
+++ b/README-introspection
@@ -10,7 +10,7 @@ be useful in this setting and actually work.
 
 This is incomplete.  In particular, I'll have to look at
 * Expressions other than via text
-* Style information
+* Applying style information
 * File i/o
 * Copy and paste
 * Installing a gi override module for more pythony structure handling
@@ -77,7 +77,7 @@ Sheet: [GObject]
   props.rows
 
 
-GnmCell: [Structure] [2]
+GnmCell: [Boxed structure] [2]
   name()
   get_value()
 
@@ -87,7 +87,7 @@ GnmSheetSize: [Simple structure]
   max_rows
 
 
-GnmValue: [Structure]
+GnmValue: [Boxed union]
   new_int(int)
   new_bool(bool)
   new_float(double)
@@ -132,6 +132,53 @@ GnmSheetVisibility: [Enum]
   VERY_HIDDEN
 
 
+GnmStyle: [Boxed structure]
+  new()
+  new_default()
+  is_complete()
+  is_element_set()
+  unset_element()
+  set_pattern(int)
+  get_pattern()
+  set_font_name(string)
+  get_font_name()
+  set_font_bold(bool)
+  get_font_bold()
+  set_font_italic(bool)
+  get_font_italic()
+  set_font_uline(uline)
+  get_font_uline()
+  set_font_strike(bool)
+  get_font_strike()
+  set_font_script(script)
+  get_font_script()
+  set_font_size(pts)
+  get_font_size()
+  set_format(fmt)
+  set_format_text(fmtstring)
+  get_format()
+  set_align_h(halign)
+  get_align_h()
+  set_align_v(valign)
+  get_align_v()
+  set_indent(int)
+  get_indent()
+  set_rotation(degs)
+  get_rotation()
+  set_text_dir(dir)
+  get_text_dir()
+  set_text_wrap(bool)
+  get_text_wrap()
+  set_shrink_to_fit(bool)
+  get_shrink_to_fit()
+  set_contents_locked(bool)
+  get_contents_locked()
+  set_contents_hidden(bool)
+  get_contents_hidden()
+  get_effective_text_wrap()
+  visible_in_blank()
+
+
 
 Footnotes:
 [1] This function is not calling the obvious C function, but uses
diff --git a/src/mstyle.c b/src/mstyle.c
index 4e5ea9d..26fb1bd 100644
--- a/src/mstyle.c
+++ b/src/mstyle.c
@@ -1476,6 +1476,12 @@ gnm_style_set_font_name (GnmStyle *style, char const *name)
        gnm_style_clear_pango (style);
 }
 
+/**
+ * gnm_style_set_font_name:
+ * @style: the style to query
+ *
+ * Returns: (transfer none): the currently set font name
+ */
 char const *
 gnm_style_get_font_name (GnmStyle const *style)
 {
diff --git a/test/t3001-introspection-simple.py b/test/t3001-introspection-simple.py
index 174936c..40442e3 100755
--- a/test/t3001-introspection-simple.py
+++ b/test/t3001-introspection-simple.py
@@ -25,6 +25,10 @@ sheet.cell_set_text(0,4,"zzz")
 sheet.cell_set_value(0,5,Gnm.Value.new_string("abc"))
 sheet.cell_set_value(0,6,Gnm.Value.new_bool(1))
 
+st = Gnm.Style.new()
+st.set_font_bold(1)
+# FIXME: Apply somewhere
+
 # Recalculate all cells that need it
 wb.recalc()
 


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