[cpluscplus] Wrap hb-subset types as well
Also changes signature of get_user_data of hb.h types to take const object. This is safe.
This commit is contained in:
parent
1ac21246a7
commit
1945b400da
|
@ -303,7 +303,7 @@ hb_blob_set_user_data (hb_blob_t *blob,
|
|||
* Since: 0.9.2
|
||||
**/
|
||||
void *
|
||||
hb_blob_get_user_data (hb_blob_t *blob,
|
||||
hb_blob_get_user_data (const hb_blob_t *blob,
|
||||
hb_user_data_key_t *key)
|
||||
{
|
||||
return hb_object_get_user_data (blob, key);
|
||||
|
|
|
@ -135,7 +135,7 @@ hb_blob_set_user_data (hb_blob_t *blob,
|
|||
|
||||
|
||||
HB_EXTERN void *
|
||||
hb_blob_get_user_data (hb_blob_t *blob,
|
||||
hb_blob_get_user_data (const hb_blob_t *blob,
|
||||
hb_user_data_key_t *key);
|
||||
|
||||
|
||||
|
|
|
@ -831,7 +831,7 @@ hb_buffer_set_user_data (hb_buffer_t *buffer,
|
|||
* Since: 0.9.2
|
||||
**/
|
||||
void *
|
||||
hb_buffer_get_user_data (hb_buffer_t *buffer,
|
||||
hb_buffer_get_user_data (const hb_buffer_t *buffer,
|
||||
hb_user_data_key_t *key)
|
||||
{
|
||||
return hb_object_get_user_data (buffer, key);
|
||||
|
|
|
@ -266,7 +266,7 @@ hb_buffer_set_user_data (hb_buffer_t *buffer,
|
|||
hb_bool_t replace);
|
||||
|
||||
HB_EXTERN void *
|
||||
hb_buffer_get_user_data (hb_buffer_t *buffer,
|
||||
hb_buffer_get_user_data (const hb_buffer_t *buffer,
|
||||
hb_user_data_key_t *key);
|
||||
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ template <typename T,
|
|||
void *,
|
||||
hb_destroy_func_t,
|
||||
hb_bool_t),
|
||||
void * (*_get_user_data) (T *,
|
||||
void * (*_get_user_data) (const T *,
|
||||
hb_user_data_key_t *)>
|
||||
struct vtable_t
|
||||
{
|
||||
|
@ -164,6 +164,27 @@ HB_DEFINE_VTABLE (unicode_funcs);
|
|||
#undef HB_DEFINE_VTABLE
|
||||
|
||||
|
||||
#ifdef HB_SUBSET_H
|
||||
|
||||
#define HB_DEFINE_VTABLE(name) \
|
||||
template<> \
|
||||
struct vtable<hb_##name##_t> \
|
||||
: vtable_t<hb_##name##_t, \
|
||||
nullptr, \
|
||||
&hb_##name##_reference, \
|
||||
&hb_##name##_destroy, \
|
||||
&hb_##name##_set_user_data, \
|
||||
&hb_##name##_get_user_data> {}
|
||||
|
||||
|
||||
HB_DEFINE_VTABLE (subset_input);
|
||||
HB_DEFINE_VTABLE (subset_plan);
|
||||
|
||||
#undef HB_DEFINE_VTABLE
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
} // namespace hb
|
||||
|
||||
/* Workaround for GCC < 7, see:
|
||||
|
|
|
@ -342,7 +342,7 @@ hb_face_set_user_data (hb_face_t *face,
|
|||
* Since: 0.9.2
|
||||
**/
|
||||
void *
|
||||
hb_face_get_user_data (hb_face_t *face,
|
||||
hb_face_get_user_data (const hb_face_t *face,
|
||||
hb_user_data_key_t *key)
|
||||
{
|
||||
return hb_object_get_user_data (face, key);
|
||||
|
|
|
@ -96,7 +96,7 @@ hb_face_set_user_data (hb_face_t *face,
|
|||
hb_bool_t replace);
|
||||
|
||||
HB_EXTERN void *
|
||||
hb_face_get_user_data (hb_face_t *face,
|
||||
hb_face_get_user_data (const hb_face_t *face,
|
||||
hb_user_data_key_t *key);
|
||||
|
||||
HB_EXTERN void
|
||||
|
|
|
@ -781,7 +781,7 @@ hb_font_funcs_set_user_data (hb_font_funcs_t *ffuncs,
|
|||
* Since: 0.9.2
|
||||
**/
|
||||
void *
|
||||
hb_font_funcs_get_user_data (hb_font_funcs_t *ffuncs,
|
||||
hb_font_funcs_get_user_data (const hb_font_funcs_t *ffuncs,
|
||||
hb_user_data_key_t *key)
|
||||
{
|
||||
return hb_object_get_user_data (ffuncs, key);
|
||||
|
@ -1897,7 +1897,7 @@ hb_font_set_user_data (hb_font_t *font,
|
|||
* Since: 0.9.2
|
||||
**/
|
||||
void *
|
||||
hb_font_get_user_data (hb_font_t *font,
|
||||
hb_font_get_user_data (const hb_font_t *font,
|
||||
hb_user_data_key_t *key)
|
||||
{
|
||||
return hb_object_get_user_data (font, key);
|
||||
|
|
|
@ -86,7 +86,7 @@ hb_font_funcs_set_user_data (hb_font_funcs_t *ffuncs,
|
|||
|
||||
|
||||
HB_EXTERN void *
|
||||
hb_font_funcs_get_user_data (hb_font_funcs_t *ffuncs,
|
||||
hb_font_funcs_get_user_data (const hb_font_funcs_t *ffuncs,
|
||||
hb_user_data_key_t *key);
|
||||
|
||||
|
||||
|
@ -993,7 +993,7 @@ hb_font_set_user_data (hb_font_t *font,
|
|||
|
||||
|
||||
HB_EXTERN void *
|
||||
hb_font_get_user_data (hb_font_t *font,
|
||||
hb_font_get_user_data (const hb_font_t *font,
|
||||
hb_user_data_key_t *key);
|
||||
|
||||
HB_EXTERN void
|
||||
|
|
|
@ -145,7 +145,7 @@ hb_map_set_user_data (hb_map_t *map,
|
|||
* Since: 1.7.7
|
||||
**/
|
||||
void *
|
||||
hb_map_get_user_data (hb_map_t *map,
|
||||
hb_map_get_user_data (const hb_map_t *map,
|
||||
hb_user_data_key_t *key)
|
||||
{
|
||||
return hb_object_get_user_data (map, key);
|
||||
|
|
|
@ -74,7 +74,7 @@ hb_map_set_user_data (hb_map_t *map,
|
|||
hb_bool_t replace);
|
||||
|
||||
HB_EXTERN void *
|
||||
hb_map_get_user_data (hb_map_t *map,
|
||||
hb_map_get_user_data (const hb_map_t *map,
|
||||
hb_user_data_key_t *key);
|
||||
|
||||
|
||||
|
|
|
@ -145,7 +145,7 @@ hb_set_set_user_data (hb_set_t *set,
|
|||
* Since: 0.9.2
|
||||
**/
|
||||
void *
|
||||
hb_set_get_user_data (hb_set_t *set,
|
||||
hb_set_get_user_data (const hb_set_t *set,
|
||||
hb_user_data_key_t *key)
|
||||
{
|
||||
return hb_object_get_user_data (set, key);
|
||||
|
|
|
@ -77,7 +77,7 @@ hb_set_set_user_data (hb_set_t *set,
|
|||
hb_bool_t replace);
|
||||
|
||||
HB_EXTERN void *
|
||||
hb_set_get_user_data (hb_set_t *set,
|
||||
hb_set_get_user_data (const hb_set_t *set,
|
||||
hb_user_data_key_t *key);
|
||||
|
||||
|
||||
|
|
|
@ -358,7 +358,7 @@ hb_shape_plan_set_user_data (hb_shape_plan_t *shape_plan,
|
|||
* Since: 0.9.7
|
||||
**/
|
||||
void *
|
||||
hb_shape_plan_get_user_data (hb_shape_plan_t *shape_plan,
|
||||
hb_shape_plan_get_user_data (const hb_shape_plan_t *shape_plan,
|
||||
hb_user_data_key_t *key)
|
||||
{
|
||||
return hb_object_get_user_data (shape_plan, key);
|
||||
|
|
|
@ -102,7 +102,7 @@ hb_shape_plan_set_user_data (hb_shape_plan_t *shape_plan,
|
|||
hb_bool_t replace);
|
||||
|
||||
HB_EXTERN void *
|
||||
hb_shape_plan_get_user_data (hb_shape_plan_t *shape_plan,
|
||||
hb_shape_plan_get_user_data (const hb_shape_plan_t *shape_plan,
|
||||
hb_user_data_key_t *key);
|
||||
|
||||
|
||||
|
|
|
@ -308,7 +308,7 @@ hb_unicode_funcs_set_user_data (hb_unicode_funcs_t *ufuncs,
|
|||
* Since: 0.9.2
|
||||
**/
|
||||
void *
|
||||
hb_unicode_funcs_get_user_data (hb_unicode_funcs_t *ufuncs,
|
||||
hb_unicode_funcs_get_user_data (const hb_unicode_funcs_t *ufuncs,
|
||||
hb_user_data_key_t *key)
|
||||
{
|
||||
return hb_object_get_user_data (ufuncs, key);
|
||||
|
|
|
@ -317,7 +317,7 @@ hb_unicode_funcs_set_user_data (hb_unicode_funcs_t *ufuncs,
|
|||
|
||||
|
||||
HB_EXTERN void *
|
||||
hb_unicode_funcs_get_user_data (hb_unicode_funcs_t *ufuncs,
|
||||
hb_unicode_funcs_get_user_data (const hb_unicode_funcs_t *ufuncs,
|
||||
hb_user_data_key_t *key);
|
||||
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#endif
|
||||
|
||||
#include <hb.h>
|
||||
#include <hb-subset.h>
|
||||
#include <hb-ot.h>
|
||||
#include <hb-aat.h>
|
||||
|
||||
|
|
Loading…
Reference in New Issue