X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fhb-unicode.h;h=9aa97a6b1c4bded7ccb0b78b4da6aee12ad65a40;hb=8354e004e553856d7d743e0f0b4de4668484026a;hp=9d13ba4e371334ff4865d7d71db67b100b4fbf8a;hpb=5d91c3d547f78163b36aa7436d4388a836cca94a;p=profile%2Fivi%2Forg.tizen.video-player.git diff --git a/src/hb-unicode.h b/src/hb-unicode.h index 9d13ba4..9aa97a6 100644 --- a/src/hb-unicode.h +++ b/src/hb-unicode.h @@ -1,5 +1,7 @@ /* - * Copyright (C) 2009 Red Hat, Inc. + * Copyright © 2009 Red Hat, Inc. + * Copyright © 2011 Codethink Limited + * Copyright © 2011 Google, Inc. * * This is part of HarfBuzz, a text shaping library. * @@ -22,6 +24,8 @@ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. * * Red Hat Author(s): Behdad Esfahbod + * Codethink Author(s): Ryan Lortie + * Google Author(s): Behdad Esfahbod */ #ifndef HB_UNICODE_H @@ -32,177 +36,43 @@ HB_BEGIN_DECLS -/* Unicode General Category property */ -typedef enum -{ - HB_CATEGORY_CONTROL, /* Cc */ - HB_CATEGORY_FORMAT, /* Cf */ - HB_CATEGORY_UNASSIGNED, /* Cn */ - HB_CATEGORY_PRIVATE_USE, /* Co */ - HB_CATEGORY_SURROGATE, /* Cs */ - HB_CATEGORY_LOWERCASE_LETTER, /* Ll */ - HB_CATEGORY_MODIFIER_LETTER, /* Lm */ - HB_CATEGORY_OTHER_LETTER, /* Lo */ - HB_CATEGORY_TITLECASE_LETTER, /* Lt */ - HB_CATEGORY_UPPERCASE_LETTER, /* Lu */ - HB_CATEGORY_COMBINING_MARK, /* Mc */ - HB_CATEGORY_ENCLOSING_MARK, /* Me */ - HB_CATEGORY_NON_SPACING_MARK, /* Mn */ - HB_CATEGORY_DECIMAL_NUMBER, /* Nd */ - HB_CATEGORY_LETTER_NUMBER, /* Nl */ - HB_CATEGORY_OTHER_NUMBER, /* No */ - HB_CATEGORY_CONNECT_PUNCTUATION, /* Pc */ - HB_CATEGORY_DASH_PUNCTUATION, /* Pd */ - HB_CATEGORY_CLOSE_PUNCTUATION, /* Pe */ - HB_CATEGORY_FINAL_PUNCTUATION, /* Pf */ - HB_CATEGORY_INITIAL_PUNCTUATION, /* Pi */ - HB_CATEGORY_OTHER_PUNCTUATION, /* Po */ - HB_CATEGORY_OPEN_PUNCTUATION, /* Ps */ - HB_CATEGORY_CURRENCY_SYMBOL, /* Sc */ - HB_CATEGORY_MODIFIER_SYMBOL, /* Sk */ - HB_CATEGORY_MATH_SYMBOL, /* Sm */ - HB_CATEGORY_OTHER_SYMBOL, /* So */ - HB_CATEGORY_LINE_SEPARATOR, /* Zl */ - HB_CATEGORY_PARAGRAPH_SEPARATOR, /* Zp */ - HB_CATEGORY_SPACE_SEPARATOR /* Zs */ -} hb_category_t; - -/* Unicode Script property */ -typedef enum -{ /* ISO 15924 code */ - HB_SCRIPT_INVALID = -1, - - HB_SCRIPT_COMMON = 0, /* Zyyy */ - HB_SCRIPT_INHERITED, /* Qaai */ - HB_SCRIPT_ARABIC, /* Arab */ - HB_SCRIPT_ARMENIAN, /* Armn */ - HB_SCRIPT_BENGALI, /* Beng */ - HB_SCRIPT_BOPOMOFO, /* Bopo */ - HB_SCRIPT_CHEROKEE, /* Cher */ - HB_SCRIPT_COPTIC, /* Qaac */ - HB_SCRIPT_CYRILLIC, /* Cyrl (Cyrs) */ - HB_SCRIPT_DESERET, /* Dsrt */ - HB_SCRIPT_DEVANAGARI, /* Deva */ - HB_SCRIPT_ETHIOPIC, /* Ethi */ - HB_SCRIPT_GEORGIAN, /* Geor (Geon, Geoa) */ - HB_SCRIPT_GOTHIC, /* Goth */ - HB_SCRIPT_GREEK, /* Grek */ - HB_SCRIPT_GUJARATI, /* Gujr */ - HB_SCRIPT_GURMUKHI, /* Guru */ - HB_SCRIPT_HAN, /* Hani */ - HB_SCRIPT_HANGUL, /* Hang */ - HB_SCRIPT_HEBREW, /* Hebr */ - HB_SCRIPT_HIRAGANA, /* Hira */ - HB_SCRIPT_KANNADA, /* Knda */ - HB_SCRIPT_KATAKANA, /* Kana */ - HB_SCRIPT_KHMER, /* Khmr */ - HB_SCRIPT_LAO, /* Laoo */ - HB_SCRIPT_LATIN, /* Latn (Latf, Latg) */ - HB_SCRIPT_MALAYALAM, /* Mlym */ - HB_SCRIPT_MONGOLIAN, /* Mong */ - HB_SCRIPT_MYANMAR, /* Mymr */ - HB_SCRIPT_OGHAM, /* Ogam */ - HB_SCRIPT_OLD_ITALIC, /* Ital */ - HB_SCRIPT_ORIYA, /* Orya */ - HB_SCRIPT_RUNIC, /* Runr */ - HB_SCRIPT_SINHALA, /* Sinh */ - HB_SCRIPT_SYRIAC, /* Syrc (Syrj, Syrn, Syre) */ - HB_SCRIPT_TAMIL, /* Taml */ - HB_SCRIPT_TELUGU, /* Telu */ - HB_SCRIPT_THAANA, /* Thaa */ - HB_SCRIPT_THAI, /* Thai */ - HB_SCRIPT_TIBETAN, /* Tibt */ - HB_SCRIPT_CANADIAN_ABORIGINAL, /* Cans */ - HB_SCRIPT_YI, /* Yiii */ - HB_SCRIPT_TAGALOG, /* Tglg */ - HB_SCRIPT_HANUNOO, /* Hano */ - HB_SCRIPT_BUHID, /* Buhd */ - HB_SCRIPT_TAGBANWA, /* Tagb */ - - /* Unicode-4.0 additions */ - HB_SCRIPT_BRAILLE, /* Brai */ - HB_SCRIPT_CYPRIOT, /* Cprt */ - HB_SCRIPT_LIMBU, /* Limb */ - HB_SCRIPT_OSMANYA, /* Osma */ - HB_SCRIPT_SHAVIAN, /* Shaw */ - HB_SCRIPT_LINEAR_B, /* Linb */ - HB_SCRIPT_TAI_LE, /* Tale */ - HB_SCRIPT_UGARITIC, /* Ugar */ - - /* Unicode-4.1 additions */ - HB_SCRIPT_NEW_TAI_LUE, /* Talu */ - HB_SCRIPT_BUGINESE, /* Bugi */ - HB_SCRIPT_GLAGOLITIC, /* Glag */ - HB_SCRIPT_TIFINAGH, /* Tfng */ - HB_SCRIPT_SYLOTI_NAGRI, /* Sylo */ - HB_SCRIPT_OLD_PERSIAN, /* Xpeo */ - HB_SCRIPT_KHAROSHTHI, /* Khar */ - - /* Unicode-5.0 additions */ - HB_SCRIPT_UNKNOWN, /* Zzzz */ - HB_SCRIPT_BALINESE, /* Bali */ - HB_SCRIPT_CUNEIFORM, /* Xsux */ - HB_SCRIPT_PHOENICIAN, /* Phnx */ - HB_SCRIPT_PHAGS_PA, /* Phag */ - HB_SCRIPT_NKO, /* Nkoo */ - - /* Unicode-5.1 additions */ - HB_SCRIPT_KAYAH_LI, /* Kali */ - HB_SCRIPT_LEPCHA, /* Lepc */ - HB_SCRIPT_REJANG, /* Rjng */ - HB_SCRIPT_SUNDANESE, /* Sund */ - HB_SCRIPT_SAURASHTRA, /* Saur */ - HB_SCRIPT_CHAM, /* Cham */ - HB_SCRIPT_OL_CHIKI, /* Olck */ - HB_SCRIPT_VAI, /* Vaii */ - HB_SCRIPT_CARIAN, /* Cari */ - HB_SCRIPT_LYCIAN, /* Lyci */ - HB_SCRIPT_LYDIAN, /* Lydi */ - - /* Unicode-5.2 additions */ - HB_SCRIPT_AVESTAN, /* Avst */ - HB_SCRIPT_BAMUM, /* Bamu */ - HB_SCRIPT_EGYPTIAN_HIEROGLYPHS, /* Egyp */ - HB_SCRIPT_IMPERIAL_ARAMAIC, /* Armi */ - HB_SCRIPT_INSCRIPTIONAL_PAHLAVI, /* Phli */ - HB_SCRIPT_INSCRIPTIONAL_PARTHIAN, /* Prti */ - HB_SCRIPT_JAVANESE, /* Java */ - HB_SCRIPT_KAITHI, /* Kthi */ - HB_SCRIPT_LISU, /* Lisu */ - HB_SCRIPT_MEETEI_MAYEK, /* Mtei */ - HB_SCRIPT_OLD_SOUTH_ARABIAN, /* Sarb */ - HB_SCRIPT_OLD_TURKIC, /* Orkh */ - HB_SCRIPT_SAMARITAN, /* Samr */ - HB_SCRIPT_TAI_THAM, /* Lana */ - HB_SCRIPT_TAI_VIET, /* Tavt */ - - /* Unicode-6.0 additions */ - HB_SCRIPT_BATAK, /* Batk */ - HB_SCRIPT_BRAHMI, /* Brah */ - HB_SCRIPT_MANDAIC /* Mand */ -} hb_script_t; - - /* * hb_unicode_funcs_t */ typedef struct _hb_unicode_funcs_t hb_unicode_funcs_t; + +/* + * just give me the best implementation you've got there. + */ hb_unicode_funcs_t * -hb_unicode_funcs_create (void); +hb_unicode_funcs_get_default (void); + hb_unicode_funcs_t * -hb_unicode_funcs_reference (hb_unicode_funcs_t *ufuncs); +hb_unicode_funcs_create (hb_unicode_funcs_t *parent); -unsigned int -hb_unicode_funcs_get_reference_count (hb_unicode_funcs_t *ufuncs); +hb_unicode_funcs_t * +hb_unicode_funcs_get_empty (void); + +hb_unicode_funcs_t * +hb_unicode_funcs_reference (hb_unicode_funcs_t *ufuncs); void hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs); -hb_unicode_funcs_t * -hb_unicode_funcs_copy (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); @@ -210,96 +80,113 @@ hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs); hb_bool_t hb_unicode_funcs_is_immutable (hb_unicode_funcs_t *ufuncs); +hb_unicode_funcs_t * +hb_unicode_funcs_get_parent (hb_unicode_funcs_t *ufuncs); + + /* * funcs */ - /* typedefs */ -typedef hb_codepoint_t (*hb_unicode_get_mirroring_func_t) (hb_codepoint_t unicode); -typedef hb_category_t (*hb_unicode_get_general_category_func_t) (hb_codepoint_t unicode); -typedef hb_script_t (*hb_unicode_get_script_func_t) (hb_codepoint_t unicode); -typedef unsigned int (*hb_unicode_get_combining_class_func_t) (hb_codepoint_t unicode); -typedef unsigned int (*hb_unicode_get_eastasian_width_func_t) (hb_codepoint_t unicode); - +typedef unsigned int (*hb_unicode_combining_class_func_t) (hb_unicode_funcs_t *ufuncs, + hb_codepoint_t unicode, + void *user_data); +typedef unsigned int (*hb_unicode_eastasian_width_func_t) (hb_unicode_funcs_t *ufuncs, + hb_codepoint_t unicode, + void *user_data); +typedef hb_unicode_general_category_t (*hb_unicode_general_category_func_t) (hb_unicode_funcs_t *ufuncs, + hb_codepoint_t unicode, + void *user_data); +typedef hb_codepoint_t (*hb_unicode_mirroring_func_t) (hb_unicode_funcs_t *ufuncs, + hb_codepoint_t unicode, + void *user_data); +typedef hb_script_t (*hb_unicode_script_func_t) (hb_unicode_funcs_t *ufuncs, + hb_codepoint_t unicode, + void *user_data); + +typedef hb_bool_t (*hb_unicode_compose_func_t) (hb_unicode_funcs_t *ufuncs, + hb_codepoint_t a, + hb_codepoint_t b, + hb_codepoint_t *ab, + void *user_data); +typedef hb_bool_t (*hb_unicode_decompose_func_t) (hb_unicode_funcs_t *ufuncs, + hb_codepoint_t ab, + hb_codepoint_t *a, + hb_codepoint_t *b, + void *user_data); /* setters */ void -hb_unicode_funcs_set_mirroring_func (hb_unicode_funcs_t *ufuncs, - hb_unicode_get_mirroring_func_t mirroring_func); +hb_unicode_funcs_set_combining_class_func (hb_unicode_funcs_t *ufuncs, + hb_unicode_combining_class_func_t combining_class_func, + void *user_data, hb_destroy_func_t destroy); void -hb_unicode_funcs_set_general_category_func (hb_unicode_funcs_t *ufuncs, - hb_unicode_get_general_category_func_t general_category_func); +hb_unicode_funcs_set_eastasian_width_func (hb_unicode_funcs_t *ufuncs, + hb_unicode_eastasian_width_func_t eastasian_width_func, + void *user_data, hb_destroy_func_t destroy); void -hb_unicode_funcs_set_script_func (hb_unicode_funcs_t *ufuncs, - hb_unicode_get_script_func_t script_func); +hb_unicode_funcs_set_general_category_func (hb_unicode_funcs_t *ufuncs, + hb_unicode_general_category_func_t general_category_func, + void *user_data, hb_destroy_func_t destroy); void -hb_unicode_funcs_set_combining_class_func (hb_unicode_funcs_t *ufuncs, - hb_unicode_get_combining_class_func_t combining_class_func); +hb_unicode_funcs_set_mirroring_func (hb_unicode_funcs_t *ufuncs, + hb_unicode_mirroring_func_t mirroring_func, + void *user_data, hb_destroy_func_t destroy); void -hb_unicode_funcs_set_eastasian_width_func (hb_unicode_funcs_t *ufuncs, - hb_unicode_get_eastasian_width_func_t eastasian_width_func); - - -/* getters */ - -/* These never return NULL. Return fallback defaults instead. */ - -hb_unicode_get_mirroring_func_t -hb_unicode_funcs_get_mirroring_func (hb_unicode_funcs_t *ufuncs); - -hb_unicode_get_general_category_func_t -hb_unicode_funcs_get_general_category_func (hb_unicode_funcs_t *ufuncs); - -hb_unicode_get_script_func_t -hb_unicode_funcs_get_script_func (hb_unicode_funcs_t *ufuncs); +hb_unicode_funcs_set_script_func (hb_unicode_funcs_t *ufuncs, + hb_unicode_script_func_t script_func, + void *user_data, hb_destroy_func_t destroy); -hb_unicode_get_combining_class_func_t -hb_unicode_funcs_get_combining_class_func (hb_unicode_funcs_t *ufuncs); +void +hb_unicode_funcs_set_compose_func (hb_unicode_funcs_t *ufuncs, + hb_unicode_compose_func_t compose_func, + void *user_data, hb_destroy_func_t destroy); -hb_unicode_get_eastasian_width_func_t -hb_unicode_funcs_get_eastasian_width_func (hb_unicode_funcs_t *ufuncs); +void +hb_unicode_funcs_set_decompose_func (hb_unicode_funcs_t *ufuncs, + hb_unicode_decompose_func_t decompose_func, + void *user_data, hb_destroy_func_t destroy); /* accessors */ -hb_codepoint_t -hb_unicode_get_mirroring (hb_unicode_funcs_t *ufuncs, - hb_codepoint_t unicode); - -hb_category_t -hb_unicode_get_general_category (hb_unicode_funcs_t *ufuncs, - hb_codepoint_t unicode); - -hb_script_t -hb_unicode_get_script (hb_unicode_funcs_t *ufuncs, - hb_codepoint_t unicode); - unsigned int -hb_unicode_get_combining_class (hb_unicode_funcs_t *ufuncs, - hb_codepoint_t unicode); +hb_unicode_combining_class (hb_unicode_funcs_t *ufuncs, + hb_codepoint_t unicode); unsigned int -hb_unicode_get_eastasian_width (hb_unicode_funcs_t *ufuncs, - hb_codepoint_t unicode); +hb_unicode_eastasian_width (hb_unicode_funcs_t *ufuncs, + hb_codepoint_t unicode); +hb_unicode_general_category_t +hb_unicode_general_category (hb_unicode_funcs_t *ufuncs, + hb_codepoint_t unicode); -/* Script functions */ +hb_codepoint_t +hb_unicode_mirroring (hb_unicode_funcs_t *ufuncs, + hb_codepoint_t unicode); hb_script_t -hb_script_from_iso15924_tag (hb_tag_t tag); +hb_unicode_script (hb_unicode_funcs_t *ufuncs, + hb_codepoint_t unicode); -hb_tag_t -hb_script_to_iso15924_tag (hb_script_t script); - -hb_direction_t -hb_script_get_horizontal_direction (hb_script_t script); +hb_bool_t +hb_unicode_compose (hb_unicode_funcs_t *ufuncs, + hb_codepoint_t a, + hb_codepoint_t b, + hb_codepoint_t *ab); +hb_bool_t +hb_unicode_decompose (hb_unicode_funcs_t *ufuncs, + hb_codepoint_t ab, + hb_codepoint_t *a, + hb_codepoint_t *b); HB_END_DECLS