summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2019-08-02 11:12:15 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2019-08-02 11:12:15 +0100
commitbd6dcbcc2b6103b1102c84e219034ba55ec80fe5 (patch)
treec3711e48152631f8b5af09d9fc450ae58e5a5f40
parent2bd9b3d7e44d9fc9985f46542824e378144bcb89 (diff)
downloadpango-bd6dcbcc2b6103b1102c84e219034ba55ec80fe5.tar.gz
Add a boxed type for PangoScriptIter
Makes it usable by language bindings, and avoids a warning when introspecting the source code.
-rw-r--r--pango/pango-script.c13
-rw-r--r--pango/pango-script.h5
2 files changed, 17 insertions, 1 deletions
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);