[goffice] Introspection improvements.



commit 5727612d09a1a08914e8048c5b5615b29af85f8e
Author: Morten Welinder <terra gnome org>
Date:   Tue Feb 16 11:22:59 2016 -0500

    Introspection improvements.

 ChangeLog                 |    5 +++++
 NEWS                      |    1 +
 goffice/math/go-complex.c |   29 +++++++++++++++++++++++++++++
 goffice/math/go-complex.h |    4 ++++
 4 files changed, 39 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b936ae4..ab83802 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-02-16  Morten Welinder  <terra gnome org>
+
+       * goffice/math/go-complex.c: Make a boxed type for the benefit of
+       introspection.
+
 2016-02-08  Morten Welinder  <terra gnome org>
 
        * configure.ac: Require C99.  Fix handling of $CC that includes
diff --git a/NEWS b/NEWS
index a99cdae..b8e47f6 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ goffice 0.10.28:
 
 Morten:
        * Configuration fixes.
+       * Introspection improvements.
 
 --------------------------------------------------------------------------
 goffice 0.10.27:
diff --git a/goffice/math/go-complex.c b/goffice/math/go-complex.c
index abab90e..9726ba1 100644
--- a/goffice/math/go-complex.c
+++ b/goffice/math/go-complex.c
@@ -59,6 +59,35 @@
 
 /* ------------------------------------------------------------------------- */
 
+static COMPLEX *
+SUFFIX(go_complex_dup) (COMPLEX *src)
+{
+       return g_memdup (src, sizeof (*src));
+}
+
+#define MAKE_BOXED_TYPE(id,name)                                       \
+GType                                                                  \
+id (void)                                                              \
+{                                                                      \
+       static GType t = 0;                                             \
+                                                                       \
+       if (t == 0)                                                     \
+               t = g_boxed_type_register_static                        \
+                       (name,                                          \
+                        (GBoxedCopyFunc)SUFFIX(go_complex_dup),        \
+                        (GBoxedFreeFunc)g_free);                       \
+       return t;                                                       \
+}
+
+
+#ifdef LONG_DOUBLE_VERSION
+MAKE_BOXED_TYPE(go_complexl_get_type, "GOComplexl")
+#else
+MAKE_BOXED_TYPE(go_complex_get_type, "GOComplex")
+#endif
+
+/* ------------------------------------------------------------------------- */
+
 char *
 SUFFIX(go_complex_to_string) (COMPLEX const *src, char const *reformat,
                   char const *imformat, char imunit)
diff --git a/goffice/math/go-complex.h b/goffice/math/go-complex.h
index 9746883..994df6a 100644
--- a/goffice/math/go-complex.h
+++ b/goffice/math/go-complex.h
@@ -21,6 +21,8 @@ typedef struct {
 
 /* ------------------------------------------------------------------------- */
 
+GType go_complex_get_type (void);
+
 char *go_complex_to_string (GOComplex const *src, char const *reformat,
                         char const *imformat, char imunit);
 
@@ -57,6 +59,8 @@ void go_complex_tan (GOComplex *dst, GOComplex const *src);
 
 #ifdef GOFFICE_WITH_LONG_DOUBLE
 
+GType go_complexl_get_type (void);
+
 char *go_complex_to_stringl (GOComplexl const *src, char const *reformat,
                         char const *imformat, char imunit);
 


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