summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2007-12-04 19:40:31 +0100
committerGuillaume Seguin <guillaume@segu.in>2007-12-04 19:40:31 +0100
commitdf65c4ce11cd8a719d28164a7a3c9af91c22e6d1 (patch)
treeee1b81860b367fed039b4eacaac6bfa7f2b07133
parent23b3320e522eb3692e12f2c1d4e6c322546c6bdf (diff)
downloadgmathlib-df65c4ce11cd8a719d28164a7a3c9af91c22e6d1.tar.gz
gmathlib-df65c4ce11cd8a719d28164a7a3c9af91c22e6d1.tar.bz2
* Add editor mode to gMathView
-rw-r--r--bindings/python/pygmathview/gmathview.defs13
-rw-r--r--gmathview/gmathview.c13
-rw-r--r--include/gmathview.h6
3 files changed, 32 insertions, 0 deletions
diff --git a/bindings/python/pygmathview/gmathview.defs b/bindings/python/pygmathview/gmathview.defs
index 1182ef1..946b517 100644
--- a/bindings/python/pygmathview/gmathview.defs
+++ b/bindings/python/pygmathview/gmathview.defs
@@ -51,4 +51,17 @@
)
)
+(define-method get_editor_mode
+ (of-object "GMathView")
+ (c-name "g_math_view_get_editor_mode")
+ (return-type "gboolean")
+)
+(define-method set_editor_mode
+ (of-object "GMathView")
+ (c-name "g_math_view_set_editor_mode")
+ (return-type "none")
+ (parameters
+ '("gboolean" "mode")
+ )
+)
diff --git a/gmathview/gmathview.c b/gmathview/gmathview.c
index 82f6531..d067408 100644
--- a/gmathview/gmathview.c
+++ b/gmathview/gmathview.c
@@ -220,6 +220,19 @@ g_math_view_set_formula (GMathView *mathview, GMathFormula *formula)
g_math_view_update (mathview);
}
+gboolean
+g_math_view_get_editor_mode (GMathView *mathview)
+{
+ return G_MATH_VIEW_GET_PRIVATE (mathview)->cairo_context->editor_mode;
+}
+
+void
+g_math_view_set_editor_mode (GMathView *mathview, gboolean mode)
+{
+ G_MATH_VIEW_GET_PRIVATE (mathview)->cairo_context->editor_mode = mode;
+ g_math_view_update (mathview);
+}
+
GtkWidget*
g_math_view_new (void)
{
diff --git a/include/gmathview.h b/include/gmathview.h
index 253de9a..02e1470 100644
--- a/include/gmathview.h
+++ b/include/gmathview.h
@@ -79,6 +79,12 @@ g_math_view_get_formula (GMathView *mathview);
void
g_math_view_set_formula (GMathView *mathview, GMathFormula *formula);
+gboolean
+g_math_view_get_editor_mode (GMathView *mathview);
+
+void
+g_math_view_set_editor_mode (GMathView *mathview, gboolean editor_mode);
+
G_END_DECLS
#endif