| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright © 2009 Red Hat, Inc. | 2 * Copyright © 2009 Red Hat, Inc. |
| 3 * Copyright © 2011 Codethink Limited | 3 * Copyright © 2011 Codethink Limited |
| 4 * Copyright © 2010,2011,2012 Google, Inc. | 4 * Copyright © 2010,2011,2012 Google, Inc. |
| 5 * | 5 * |
| 6 * This is part of HarfBuzz, a text shaping library. | 6 * This is part of HarfBuzz, a text shaping library. |
| 7 * | 7 * |
| 8 * Permission is hereby granted, without written agreement and without | 8 * Permission is hereby granted, without written agreement and without |
| 9 * license or royalty fees, to use, copy, modify, and distribute this | 9 * license or royalty fees, to use, copy, modify, and distribute this |
| 10 * software and its documentation for any purpose, provided that the | 10 * software and its documentation for any purpose, provided that the |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 #endif | 151 #endif |
| 152 | 152 |
| 153 /** | 153 /** |
| 154 * hb_unicode_funcs_create: (Xconstructor) | 154 * hb_unicode_funcs_create: (Xconstructor) |
| 155 * @parent: (nullable): | 155 * @parent: (nullable): |
| 156 * | 156 * |
| 157 * | 157 * |
| 158 * | 158 * |
| 159 * Return value: (transfer full): | 159 * Return value: (transfer full): |
| 160 * | 160 * |
| 161 * Since: 1.0 | 161 * Since: 0.9.2 |
| 162 **/ | 162 **/ |
| 163 hb_unicode_funcs_t * | 163 hb_unicode_funcs_t * |
| 164 hb_unicode_funcs_create (hb_unicode_funcs_t *parent) | 164 hb_unicode_funcs_create (hb_unicode_funcs_t *parent) |
| 165 { | 165 { |
| 166 hb_unicode_funcs_t *ufuncs; | 166 hb_unicode_funcs_t *ufuncs; |
| 167 | 167 |
| 168 if (!(ufuncs = hb_object_create<hb_unicode_funcs_t> ())) | 168 if (!(ufuncs = hb_object_create<hb_unicode_funcs_t> ())) |
| 169 return hb_unicode_funcs_get_empty (); | 169 return hb_unicode_funcs_get_empty (); |
| 170 | 170 |
| 171 if (!parent) | 171 if (!parent) |
| (...skipping 25 matching lines...) Expand all Loading... |
| 197 } | 197 } |
| 198 }; | 198 }; |
| 199 | 199 |
| 200 /** | 200 /** |
| 201 * hb_unicode_funcs_get_empty: | 201 * hb_unicode_funcs_get_empty: |
| 202 * | 202 * |
| 203 * | 203 * |
| 204 * | 204 * |
| 205 * Return value: (transfer full): | 205 * Return value: (transfer full): |
| 206 * | 206 * |
| 207 * Since: 1.0 | 207 * Since: 0.9.2 |
| 208 **/ | 208 **/ |
| 209 hb_unicode_funcs_t * | 209 hb_unicode_funcs_t * |
| 210 hb_unicode_funcs_get_empty (void) | 210 hb_unicode_funcs_get_empty (void) |
| 211 { | 211 { |
| 212 return const_cast<hb_unicode_funcs_t *> (&_hb_unicode_funcs_nil); | 212 return const_cast<hb_unicode_funcs_t *> (&_hb_unicode_funcs_nil); |
| 213 } | 213 } |
| 214 | 214 |
| 215 /** | 215 /** |
| 216 * hb_unicode_funcs_reference: (skip) | 216 * hb_unicode_funcs_reference: (skip) |
| 217 * @ufuncs: Unicode functions. | 217 * @ufuncs: Unicode functions. |
| 218 * | 218 * |
| 219 * | 219 * |
| 220 * | 220 * |
| 221 * Return value: (transfer full): | 221 * Return value: (transfer full): |
| 222 * | 222 * |
| 223 * Since: 1.0 | 223 * Since: 0.9.2 |
| 224 **/ | 224 **/ |
| 225 hb_unicode_funcs_t * | 225 hb_unicode_funcs_t * |
| 226 hb_unicode_funcs_reference (hb_unicode_funcs_t *ufuncs) | 226 hb_unicode_funcs_reference (hb_unicode_funcs_t *ufuncs) |
| 227 { | 227 { |
| 228 return hb_object_reference (ufuncs); | 228 return hb_object_reference (ufuncs); |
| 229 } | 229 } |
| 230 | 230 |
| 231 /** | 231 /** |
| 232 * hb_unicode_funcs_destroy: (skip) | 232 * hb_unicode_funcs_destroy: (skip) |
| 233 * @ufuncs: Unicode functions. | 233 * @ufuncs: Unicode functions. |
| 234 * | 234 * |
| 235 * | 235 * |
| 236 * | 236 * |
| 237 * Since: 1.0 | 237 * Since: 0.9.2 |
| 238 **/ | 238 **/ |
| 239 void | 239 void |
| 240 hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs) | 240 hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs) |
| 241 { | 241 { |
| 242 if (!hb_object_destroy (ufuncs)) return; | 242 if (!hb_object_destroy (ufuncs)) return; |
| 243 | 243 |
| 244 #define HB_UNICODE_FUNC_IMPLEMENT(name) \ | 244 #define HB_UNICODE_FUNC_IMPLEMENT(name) \ |
| 245 if (ufuncs->destroy.name) ufuncs->destroy.name (ufuncs->user_data.name); | 245 if (ufuncs->destroy.name) ufuncs->destroy.name (ufuncs->user_data.name); |
| 246 HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS | 246 HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS |
| 247 #undef HB_UNICODE_FUNC_IMPLEMENT | 247 #undef HB_UNICODE_FUNC_IMPLEMENT |
| 248 | 248 |
| 249 hb_unicode_funcs_destroy (ufuncs->parent); | 249 hb_unicode_funcs_destroy (ufuncs->parent); |
| 250 | 250 |
| 251 free (ufuncs); | 251 free (ufuncs); |
| 252 } | 252 } |
| 253 | 253 |
| 254 /** | 254 /** |
| 255 * hb_unicode_funcs_set_user_data: (skip) | 255 * hb_unicode_funcs_set_user_data: (skip) |
| 256 * @ufuncs: Unicode functions. | 256 * @ufuncs: Unicode functions. |
| 257 * @key: | 257 * @key: |
| 258 * @data: | 258 * @data: |
| 259 * @destroy: | 259 * @destroy: |
| 260 * @replace: | 260 * @replace: |
| 261 * | 261 * |
| 262 * | 262 * |
| 263 * | 263 * |
| 264 * Return value: | 264 * Return value: |
| 265 * | 265 * |
| 266 * Since: 1.0 | 266 * Since: 0.9.2 |
| 267 **/ | 267 **/ |
| 268 hb_bool_t | 268 hb_bool_t |
| 269 hb_unicode_funcs_set_user_data (hb_unicode_funcs_t *ufuncs, | 269 hb_unicode_funcs_set_user_data (hb_unicode_funcs_t *ufuncs, |
| 270 hb_user_data_key_t *key, | 270 hb_user_data_key_t *key, |
| 271 void * data, | 271 void * data, |
| 272 hb_destroy_func_t destroy, | 272 hb_destroy_func_t destroy, |
| 273 hb_bool_t replace) | 273 hb_bool_t replace) |
| 274 { | 274 { |
| 275 return hb_object_set_user_data (ufuncs, key, data, destroy, replace); | 275 return hb_object_set_user_data (ufuncs, key, data, destroy, replace); |
| 276 } | 276 } |
| 277 | 277 |
| 278 /** | 278 /** |
| 279 * hb_unicode_funcs_get_user_data: (skip) | 279 * hb_unicode_funcs_get_user_data: (skip) |
| 280 * @ufuncs: Unicode functions. | 280 * @ufuncs: Unicode functions. |
| 281 * @key: | 281 * @key: |
| 282 * | 282 * |
| 283 * | 283 * |
| 284 * | 284 * |
| 285 * Return value: (transfer none): | 285 * Return value: (transfer none): |
| 286 * | 286 * |
| 287 * Since: 1.0 | 287 * Since: 0.9.2 |
| 288 **/ | 288 **/ |
| 289 void * | 289 void * |
| 290 hb_unicode_funcs_get_user_data (hb_unicode_funcs_t *ufuncs, | 290 hb_unicode_funcs_get_user_data (hb_unicode_funcs_t *ufuncs, |
| 291 hb_user_data_key_t *key) | 291 hb_user_data_key_t *key) |
| 292 { | 292 { |
| 293 return hb_object_get_user_data (ufuncs, key); | 293 return hb_object_get_user_data (ufuncs, key); |
| 294 } | 294 } |
| 295 | 295 |
| 296 | 296 |
| 297 /** | 297 /** |
| 298 * hb_unicode_funcs_make_immutable: | 298 * hb_unicode_funcs_make_immutable: |
| 299 * @ufuncs: Unicode functions. | 299 * @ufuncs: Unicode functions. |
| 300 * | 300 * |
| 301 * | 301 * |
| 302 * | 302 * |
| 303 * Since: 1.0 | 303 * Since: 0.9.2 |
| 304 **/ | 304 **/ |
| 305 void | 305 void |
| 306 hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs) | 306 hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs) |
| 307 { | 307 { |
| 308 if (unlikely (hb_object_is_inert (ufuncs))) | 308 if (unlikely (hb_object_is_inert (ufuncs))) |
| 309 return; | 309 return; |
| 310 | 310 |
| 311 ufuncs->immutable = true; | 311 ufuncs->immutable = true; |
| 312 } | 312 } |
| 313 | 313 |
| 314 /** | 314 /** |
| 315 * hb_unicode_funcs_is_immutable: | 315 * hb_unicode_funcs_is_immutable: |
| 316 * @ufuncs: Unicode functions. | 316 * @ufuncs: Unicode functions. |
| 317 * | 317 * |
| 318 * | 318 * |
| 319 * | 319 * |
| 320 * Return value: | 320 * Return value: |
| 321 * | 321 * |
| 322 * Since: 1.0 | 322 * Since: 0.9.2 |
| 323 **/ | 323 **/ |
| 324 hb_bool_t | 324 hb_bool_t |
| 325 hb_unicode_funcs_is_immutable (hb_unicode_funcs_t *ufuncs) | 325 hb_unicode_funcs_is_immutable (hb_unicode_funcs_t *ufuncs) |
| 326 { | 326 { |
| 327 return ufuncs->immutable; | 327 return ufuncs->immutable; |
| 328 } | 328 } |
| 329 | 329 |
| 330 /** | 330 /** |
| 331 * hb_unicode_funcs_get_parent: | 331 * hb_unicode_funcs_get_parent: |
| 332 * @ufuncs: Unicode functions. | 332 * @ufuncs: Unicode functions. |
| 333 * | 333 * |
| 334 * | 334 * |
| 335 * | 335 * |
| 336 * Return value: | 336 * Return value: |
| 337 * | 337 * |
| 338 * Since: 1.0 | 338 * Since: 0.9.2 |
| 339 **/ | 339 **/ |
| 340 hb_unicode_funcs_t * | 340 hb_unicode_funcs_t * |
| 341 hb_unicode_funcs_get_parent (hb_unicode_funcs_t *ufuncs) | 341 hb_unicode_funcs_get_parent (hb_unicode_funcs_t *ufuncs) |
| 342 { | 342 { |
| 343 return ufuncs->parent ? ufuncs->parent : hb_unicode_funcs_get_empty (); | 343 return ufuncs->parent ? ufuncs->parent : hb_unicode_funcs_get_empty (); |
| 344 } | 344 } |
| 345 | 345 |
| 346 | 346 |
| 347 #define HB_UNICODE_FUNC_IMPLEMENT(name)
\ | 347 #define HB_UNICODE_FUNC_IMPLEMENT(name)
\ |
| 348
\ | 348
\ |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 230, /* HB_UNICODE_COMBINING_CLASS_ABOVE */ | 554 230, /* HB_UNICODE_COMBINING_CLASS_ABOVE */ |
| 555 231, | 555 231, |
| 556 232, /* HB_UNICODE_COMBINING_CLASS_ABOVE_RIGHT */ | 556 232, /* HB_UNICODE_COMBINING_CLASS_ABOVE_RIGHT */ |
| 557 233, /* HB_UNICODE_COMBINING_CLASS_DOUBLE_BELOW */ | 557 233, /* HB_UNICODE_COMBINING_CLASS_DOUBLE_BELOW */ |
| 558 234, /* HB_UNICODE_COMBINING_CLASS_DOUBLE_ABOVE */ | 558 234, /* HB_UNICODE_COMBINING_CLASS_DOUBLE_ABOVE */ |
| 559 235, 236, 237, 238, 239, | 559 235, 236, 237, 238, 239, |
| 560 240, /* HB_UNICODE_COMBINING_CLASS_IOTA_SUBSCRIPT */ | 560 240, /* HB_UNICODE_COMBINING_CLASS_IOTA_SUBSCRIPT */ |
| 561 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, | 561 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, |
| 562 255, /* HB_UNICODE_COMBINING_CLASS_INVALID */ | 562 255, /* HB_UNICODE_COMBINING_CLASS_INVALID */ |
| 563 }; | 563 }; |
| OLD | NEW |