[pango/for-master: 32/38] Add missing GType for PangoOT deprecated types



commit 6d90ae0ce23b4ebf25f63d6b1a4f209b49753f22
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Apr 14 18:15:03 2020 +0100

    Add missing GType for PangoOT deprecated types
    
    This way consumers of the deprecated API can get appropriate memory
    management for a couple of boxed types.

 pango/pango-ot-buffer.c  | 14 ++++++++++++++
 pango/pango-ot-ruleset.c |  4 ++++
 pango/pango-ot.h         | 10 ++++++++++
 3 files changed, 28 insertions(+)
---
diff --git a/pango/pango-ot-buffer.c b/pango/pango-ot-buffer.c
index 334df746..bec4365a 100644
--- a/pango/pango-ot-buffer.c
+++ b/pango/pango-ot-buffer.c
@@ -23,6 +23,20 @@
 
 #include "pango-ot-private.h"
 
+static PangoOTBuffer *
+pango_ot_buffer_copy (PangoOTBuffer *src)
+{
+  PangoOTBuffer *dst = g_slice_new (PangoOTBuffer);
+
+  dst->buffer = hb_buffer_reference (src->buffer);
+
+  return dst;
+}
+
+G_DEFINE_BOXED_TYPE (PangoOTBuffer, pango_ot_buffer,
+                     pango_ot_buffer_copy,
+                     pango_ot_buffer_destroy)
+
 /**
  * pango_ot_buffer_new
  * @font: a #PangoFcFont
diff --git a/pango/pango-ot-ruleset.c b/pango/pango-ot-ruleset.c
index 36bf65a2..9df8faef 100644
--- a/pango/pango-ot-ruleset.c
+++ b/pango/pango-ot-ruleset.c
@@ -364,6 +364,10 @@ pango_ot_ruleset_description_equal (const PangoOTRulesetDescription *desc1,
   return TRUE;
 }
 
+G_DEFINE_BOXED_TYPE (PangoOTRulesetDescription, pango_ot_ruleset_description,
+                     pango_ot_ruleset_description_copy,
+                     pango_ot_ruleset_description_free)
+
 /**
  * pango_ot_ruleset_description_copy:
  * @desc: ruleset description to copy
diff --git a/pango/pango-ot.h b/pango/pango-ot.h
index 501ca8b6..2c9f42d5 100644
--- a/pango/pango-ot.h
+++ b/pango/pango-ot.h
@@ -300,6 +300,11 @@ PangoOTTag *pango_ot_info_list_features  (PangoOTInfo      *info,
                                          guint             script_index,
                                          guint             language_index);
 
+#define PANGO_TYPE_OT_BUFFER (pango_ot_buffer_get_type())
+
+PANGO_DEPRECATED
+GType          pango_ot_buffer_get_type   (void) G_GNUC_CONST;
+
 PANGO_DEPRECATED
 PangoOTBuffer *pango_ot_buffer_new        (PangoFcFont       *font);
 PANGO_DEPRECATED
@@ -378,6 +383,11 @@ PangoLanguage  *pango_ot_tag_to_language   (PangoOTTag     language_tag) G_GNUC_
 PANGO_DEPRECATED
 PangoOTTag      pango_ot_tag_from_language (PangoLanguage *language) G_GNUC_CONST;
 
+#define PANGO_TYPE_OT_RULESET_DESCRIPTION (pango_ot_ruleset_description_get_type())
+
+PANGO_DEPRECATED
+GType           pango_ot_ruleset_description_get_type (void) G_GNUC_CONST;
+
 PANGO_DEPRECATED
 guint           pango_ot_ruleset_description_hash  (const PangoOTRulesetDescription *desc) G_GNUC_PURE;
 


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