Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Unified Diff: third_party/harfbuzz-ng/src/hb-unicode.h

Issue 9223010: Update harfbuzz-ng to 1a5a91dc0d8bf4b72a2f22dc6300b06ad7000b79. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't use -M option for 'git diff' to patch correctly Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-tt-font.cc ('k') | third_party/harfbuzz-ng/src/hb-unicode.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/harfbuzz-ng/src/hb-unicode.h
diff --git a/third_party/harfbuzz-ng/src/hb-unicode.h b/third_party/harfbuzz-ng/src/hb-unicode.h
index 43b04ca9994f6d254394ecd8b248d4507f39570b..13886dfbadb6b4b626fceb8ebd5509e420e586be 100644
--- a/third_party/harfbuzz-ng/src/hb-unicode.h
+++ b/third_party/harfbuzz-ng/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,176 +36,44 @@
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_CODE = -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_get_default (void);
+
+
hb_unicode_funcs_t *
-hb_unicode_funcs_create (void);
+hb_unicode_funcs_create (hb_unicode_funcs_t *parent);
hb_unicode_funcs_t *
-hb_unicode_funcs_reference (hb_unicode_funcs_t *ufuncs);
+hb_unicode_funcs_get_empty (void);
-unsigned int
-hb_unicode_funcs_get_reference_count (hb_unicode_funcs_t *ufuncs);
+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,
+ hb_bool_t replace);
+
+
+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);
@@ -209,85 +81,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_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_mirroring_func_t
-hb_unicode_funcs_get_mirroring_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_general_category_func_t
-hb_unicode_funcs_get_general_category_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);
-hb_unicode_get_script_func_t
-hb_unicode_funcs_get_script_func (hb_unicode_funcs_t *ufuncs);
-hb_unicode_get_combining_class_func_t
-hb_unicode_funcs_get_combining_class_func (hb_unicode_funcs_t *ufuncs);
+/* accessors */
-hb_unicode_get_eastasian_width_func_t
-hb_unicode_funcs_get_eastasian_width_func (hb_unicode_funcs_t *ufuncs);
+unsigned int
+hb_unicode_combining_class (hb_unicode_funcs_t *ufuncs,
+ hb_codepoint_t unicode);
+unsigned int
+hb_unicode_eastasian_width (hb_unicode_funcs_t *ufuncs,
+ hb_codepoint_t unicode);
-/* accessors */
+hb_unicode_general_category_t
+hb_unicode_general_category (hb_unicode_funcs_t *ufuncs,
+ hb_codepoint_t unicode);
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_unicode_mirroring (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);
-
-unsigned int
-hb_unicode_get_eastasian_width (hb_unicode_funcs_t *ufuncs,
- hb_codepoint_t unicode);
+hb_unicode_script (hb_unicode_funcs_t *ufuncs,
+ hb_codepoint_t unicode);
+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
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-tt-font.cc ('k') | third_party/harfbuzz-ng/src/hb-unicode.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698