提交 5fa849b7 编写于 作者: B Behdad Esfahbod

[API] Add _set/get_user_data() for all objects

上级 852e08ec
......@@ -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)
{
......
......@@ -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);
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
......@@ -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)
{
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册