[pango/introspection-fixes: 4/7] Add a boxed type for PangoScriptIter



commit bd6dcbcc2b6103b1102c84e219034ba55ec80fe5
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Fri Aug 2 11:12:15 2019 +0100

    Add a boxed type for PangoScriptIter
    
    Makes it usable by language bindings, and avoids a warning when
    introspecting the source code.

 pango/pango-script.c | 13 +++++++++++++
 pango/pango-script.h |  5 ++++-
 2 files changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/pango/pango-script.c b/pango/pango-script.c
index f7854239..fc95309f 100644
--- a/pango/pango-script.c
+++ b/pango/pango-script.c
@@ -96,6 +96,13 @@ pango_script_for_unichar (gunichar ch)
 
 /**********************************************************************/
 
+static PangoScriptIter *pango_script_iter_copy (PangoScriptIter *iter);
+
+G_DEFINE_BOXED_TYPE (PangoScriptIter,
+                     pango_script_iter,
+                     pango_script_iter_copy,
+                     pango_script_iter_free)
+
 PangoScriptIter *
 _pango_script_iter_init (PangoScriptIter *iter,
                         const char      *text,
@@ -142,6 +149,12 @@ pango_script_iter_new (const char *text,
   return _pango_script_iter_init (g_slice_new (PangoScriptIter), text, length);
 }
 
+static PangoScriptIter *
+pango_script_iter_copy (PangoScriptIter *iter)
+{
+  return g_slice_dup (PangoScriptIter, iter);
+}
+
 void
 _pango_script_iter_fini (PangoScriptIter *iter)
 {
diff --git a/pango/pango-script.h b/pango/pango-script.h
index a5c2b497..a7ec3246 100644
--- a/pango/pango-script.h
+++ b/pango/pango-script.h
@@ -22,7 +22,7 @@
 #ifndef __PANGO_SCRIPT_H__
 #define __PANGO_SCRIPT_H__
 
-#include <glib.h>
+#include <glib-object.h>
 
 G_BEGIN_DECLS
 
@@ -309,6 +309,9 @@ typedef enum {                         /* ISO 15924 code */
 PANGO_DEPRECATED_IN_1_44_FOR(g_unichar_get_script)
 PangoScript pango_script_for_unichar         (gunichar             ch) G_GNUC_CONST;
 
+PANGO_AVAILABLE_IN_1_44
+GType            pango_script_iter_get_type  (void) G_GNUC_CONST;
+
 PANGO_AVAILABLE_IN_1_4
 PangoScriptIter *pango_script_iter_new       (const char          *text,
                                              int                  length);


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