[API] Add _set/get_user_data() for all objects
authorBehdad Esfahbod <behdad@behdad.org>
Thu, 28 Apr 2011 01:46:01 +0000 (21:46 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Thu, 28 Apr 2011 01:46:01 +0000 (21:46 -0400)
src/hb-blob.cc
src/hb-blob.h
src/hb-buffer.cc
src/hb-buffer.h
src/hb-font.cc
src/hb-font.h
src/hb-unicode.cc
src/hb-unicode.h

index 435d37b..83a75f6 100644 (file)
@@ -162,6 +162,23 @@ hb_blob_destroy (hb_blob_t *blob)
   free (blob);
 }
 
+hb_bool_t
+hb_blob_set_user_data (hb_blob_t          *blob,
+                      hb_user_data_key_t *key,
+                      void *              data,
+                      hb_destroy_func_t   destroy)
+{
+  return hb_object_set_user_data (blob, key, data, destroy);
+}
+
+void *
+hb_blob_get_user_data (hb_blob_t          *blob,
+                      hb_user_data_key_t *key)
+{
+  return hb_object_get_user_data (blob, key);
+}
+
+
 unsigned int
 hb_blob_get_length (hb_blob_t *blob)
 {
index 76ea80d..d698ee2 100644 (file)
@@ -62,6 +62,18 @@ hb_blob_reference (hb_blob_t *blob);
 void
 hb_blob_destroy (hb_blob_t *blob);
 
+hb_bool_t
+hb_blob_set_user_data (hb_blob_t          *blob,
+                      hb_user_data_key_t *key,
+                      void *              data,
+                      hb_destroy_func_t   destroy);
+
+
+void *
+hb_blob_get_user_data (hb_blob_t          *blob,
+                      hb_user_data_key_t *key);
+
+
 unsigned int
 hb_blob_get_length (hb_blob_t *blob);
 
index 2ae29ca..98ddd96 100644 (file)
@@ -167,6 +167,22 @@ hb_buffer_destroy (hb_buffer_t *buffer)
   free (buffer);
 }
 
+hb_bool_t
+hb_buffer_set_user_data (hb_buffer_t        *buffer,
+                        hb_user_data_key_t *key,
+                        void *              data,
+                        hb_destroy_func_t   destroy)
+{
+  return hb_object_set_user_data (buffer, key, data, destroy);
+}
+
+void *
+hb_buffer_get_user_data (hb_buffer_t        *buffer,
+                        hb_user_data_key_t *key)
+{
+  return hb_object_get_user_data (buffer, key);
+}
+
 
 void
 hb_buffer_set_unicode_funcs (hb_buffer_t        *buffer,
index e7ef087..47a2123 100644 (file)
@@ -68,6 +68,16 @@ hb_buffer_reference (hb_buffer_t *buffer);
 void
 hb_buffer_destroy (hb_buffer_t *buffer);
 
+hb_bool_t
+hb_buffer_set_user_data (hb_buffer_t        *buffer,
+                        hb_user_data_key_t *key,
+                        void *              data,
+                        hb_destroy_func_t   destroy);
+
+void *
+hb_buffer_get_user_data (hb_buffer_t        *buffer,
+                        hb_user_data_key_t *key);
+
 
 void
 hb_buffer_set_unicode_funcs (hb_buffer_t        *buffer,
index 5506480..b067901 100644 (file)
@@ -124,6 +124,23 @@ hb_font_funcs_destroy (hb_font_funcs_t *ffuncs)
   free (ffuncs);
 }
 
+hb_bool_t
+hb_font_funcs_set_user_data (hb_font_funcs_t    *ffuncs,
+                            hb_user_data_key_t *key,
+                            void *              data,
+                            hb_destroy_func_t   destroy)
+{
+  return hb_object_set_user_data (ffuncs, key, data, destroy);
+}
+
+void *
+hb_font_funcs_get_user_data (hb_font_funcs_t    *ffuncs,
+                            hb_user_data_key_t *key)
+{
+  return hb_object_get_user_data (ffuncs, key);
+}
+
+
 hb_font_funcs_t *
 hb_font_funcs_copy (hb_font_funcs_t *other_ffuncs)
 {
@@ -408,6 +425,23 @@ hb_face_destroy (hb_face_t *face)
   free (face);
 }
 
+hb_bool_t
+hb_face_set_user_data (hb_face_t          *face,
+                      hb_user_data_key_t *key,
+                      void *              data,
+                      hb_destroy_func_t   destroy)
+{
+  return hb_object_set_user_data (face, key, data, destroy);
+}
+
+void *
+hb_face_get_user_data (hb_face_t          *face,
+                      hb_user_data_key_t *key)
+{
+  return hb_object_get_user_data (face, key);
+}
+
+
 hb_blob_t *
 hb_face_reference_table (hb_face_t *face,
                   hb_tag_t   tag)
@@ -480,6 +514,23 @@ hb_font_destroy (hb_font_t *font)
   free (font);
 }
 
+hb_bool_t
+hb_font_set_user_data (hb_font_t          *font,
+                      hb_user_data_key_t *key,
+                      void *              data,
+                      hb_destroy_func_t   destroy)
+{
+  return hb_object_set_user_data (font, key, data, destroy);
+}
+
+void *
+hb_font_get_user_data (hb_font_t          *font,
+                      hb_user_data_key_t *key)
+{
+  return hb_object_get_user_data (font, key);
+}
+
+
 void
 hb_font_set_funcs (hb_font_t         *font,
                   hb_font_funcs_t   *klass,
index e349591..f018a8b 100644 (file)
@@ -58,6 +58,18 @@ hb_face_reference (hb_face_t *face);
 void
 hb_face_destroy (hb_face_t *face);
 
+hb_bool_t
+hb_face_set_user_data (hb_face_t          *face,
+                      hb_user_data_key_t *key,
+                      void *              data,
+                      hb_destroy_func_t   destroy);
+
+
+void *
+hb_face_get_user_data (hb_face_t          *face,
+                      hb_user_data_key_t *key);
+
+
 /* XXX
  *
  * I have two major concerns about this API as it is right now:
@@ -91,6 +103,18 @@ hb_font_funcs_reference (hb_font_funcs_t *ffuncs);
 void
 hb_font_funcs_destroy (hb_font_funcs_t *ffuncs);
 
+hb_bool_t
+hb_font_funcs_set_user_data (hb_font_funcs_t    *ffuncs,
+                            hb_user_data_key_t *key,
+                            void *              data,
+                            hb_destroy_func_t   destroy);
+
+
+void *
+hb_font_funcs_get_user_data (hb_font_funcs_t    *ffuncs,
+                            hb_user_data_key_t *key);
+
+
 hb_font_funcs_t *
 hb_font_funcs_copy (hb_font_funcs_t *ffuncs);
 
@@ -203,6 +227,18 @@ hb_font_reference (hb_font_t *font);
 void
 hb_font_destroy (hb_font_t *font);
 
+hb_bool_t
+hb_font_set_user_data (hb_font_t          *font,
+                      hb_user_data_key_t *key,
+                      void *              data,
+                      hb_destroy_func_t   destroy);
+
+
+void *
+hb_font_get_user_data (hb_font_t          *font,
+                      hb_user_data_key_t *key);
+
+
 void
 hb_font_set_funcs (hb_font_t         *font,
                   hb_font_funcs_t   *klass,
index 9922955..0486be3 100644 (file)
@@ -155,6 +155,23 @@ hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs)
   free (ufuncs);
 }
 
+hb_bool_t
+hb_unicode_funcs_set_user_data (hb_unicode_funcs_t *ufuncs,
+                               hb_user_data_key_t *key,
+                               void *              data,
+                               hb_destroy_func_t   destroy)
+{
+  return hb_object_set_user_data (ufuncs, key, data, destroy);
+}
+
+void *
+hb_unicode_funcs_get_user_data (hb_unicode_funcs_t *ufuncs,
+                               hb_user_data_key_t *key)
+{
+  return hb_object_get_user_data (ufuncs, key);
+}
+
+
 void
 hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs)
 {
index d558c22..a46431b 100644 (file)
@@ -59,6 +59,18 @@ hb_unicode_funcs_reference (hb_unicode_funcs_t *ufuncs);
 void
 hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs);
 
+hb_bool_t
+hb_unicode_funcs_set_user_data (hb_unicode_funcs_t *ufuncs,
+                               hb_user_data_key_t *key,
+                               void *              data,
+                               hb_destroy_func_t   destroy);
+
+
+void *
+hb_unicode_funcs_get_user_data (hb_unicode_funcs_t *ufuncs,
+                               hb_user_data_key_t *key);
+
+
 void
 hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs);