Rename hb_category_t to hb_unicode_general_category_t

This commit is contained in:
Behdad Esfahbod 2011-04-11 15:47:40 -04:00
parent 4188096a77
commit 99b74760a4
7 changed files with 74 additions and 74 deletions

View File

@ -36,7 +36,7 @@ HB_BEGIN_DECLS
static hb_codepoint_t hb_glib_get_mirroring (hb_codepoint_t unicode) { g_unichar_get_mirror_char (unicode, &unicode); return unicode; }
static hb_category_t hb_glib_get_general_category (hb_codepoint_t unicode) { return g_unichar_type (unicode); }
static hb_unicode_general_category_t hb_glib_get_general_category (hb_codepoint_t unicode) { return g_unichar_type (unicode); }
static hb_script_t hb_glib_get_script (hb_codepoint_t unicode) { return g_unichar_get_script (unicode); }
static unsigned int hb_glib_get_combining_class (hb_codepoint_t unicode) { return g_unichar_combining_class (unicode); }
static unsigned int hb_glib_get_eastasian_width (hb_codepoint_t unicode) { return g_unichar_iswide (unicode); }

View File

@ -58,53 +58,53 @@ hb_icu_get_eastasian_width (hb_codepoint_t unicode)
return 1;
}
static hb_category_t
static hb_unicode_general_category_t
hb_icu_get_general_category (hb_codepoint_t unicode)
{
switch (u_getIntPropertyValue(unicode, UCHAR_GENERAL_CATEGORY))
{
case U_UNASSIGNED: return HB_CATEGORY_UNASSIGNED;
case U_UNASSIGNED: return HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED;
case U_UPPERCASE_LETTER: return HB_CATEGORY_UPPERCASE_LETTER; /* Lu */
case U_LOWERCASE_LETTER: return HB_CATEGORY_LOWERCASE_LETTER; /* Ll */
case U_TITLECASE_LETTER: return HB_CATEGORY_TITLECASE_LETTER; /* Lt */
case U_MODIFIER_LETTER: return HB_CATEGORY_MODIFIER_LETTER; /* Lm */
case U_OTHER_LETTER: return HB_CATEGORY_OTHER_LETTER; /* Lo */
case U_UPPERCASE_LETTER: return HB_UNICODE_GENERAL_CATEGORY_UPPERCASE_LETTER; /* Lu */
case U_LOWERCASE_LETTER: return HB_UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER; /* Ll */
case U_TITLECASE_LETTER: return HB_UNICODE_GENERAL_CATEGORY_TITLECASE_LETTER; /* Lt */
case U_MODIFIER_LETTER: return HB_UNICODE_GENERAL_CATEGORY_MODIFIER_LETTER; /* Lm */
case U_OTHER_LETTER: return HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER; /* Lo */
case U_NON_SPACING_MARK: return HB_CATEGORY_NON_SPACING_MARK; /* Mn */
case U_ENCLOSING_MARK: return HB_CATEGORY_ENCLOSING_MARK; /* Me */
case U_COMBINING_SPACING_MARK: return HB_CATEGORY_COMBINING_MARK; /* Mc */
case U_NON_SPACING_MARK: return HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK; /* Mn */
case U_ENCLOSING_MARK: return HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK; /* Me */
case U_COMBINING_SPACING_MARK: return HB_UNICODE_GENERAL_CATEGORY_COMBINING_MARK; /* Mc */
case U_DECIMAL_DIGIT_NUMBER: return HB_CATEGORY_DECIMAL_NUMBER; /* Nd */
case U_LETTER_NUMBER: return HB_CATEGORY_LETTER_NUMBER; /* Nl */
case U_OTHER_NUMBER: return HB_CATEGORY_OTHER_NUMBER; /* No */
case U_DECIMAL_DIGIT_NUMBER: return HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER; /* Nd */
case U_LETTER_NUMBER: return HB_UNICODE_GENERAL_CATEGORY_LETTER_NUMBER; /* Nl */
case U_OTHER_NUMBER: return HB_UNICODE_GENERAL_CATEGORY_OTHER_NUMBER; /* No */
case U_SPACE_SEPARATOR: return HB_CATEGORY_SPACE_SEPARATOR; /* Zs */
case U_LINE_SEPARATOR: return HB_CATEGORY_LINE_SEPARATOR; /* Zl */
case U_PARAGRAPH_SEPARATOR: return HB_CATEGORY_PARAGRAPH_SEPARATOR; /* Zp */
case U_SPACE_SEPARATOR: return HB_UNICODE_GENERAL_CATEGORY_SPACE_SEPARATOR; /* Zs */
case U_LINE_SEPARATOR: return HB_UNICODE_GENERAL_CATEGORY_LINE_SEPARATOR; /* Zl */
case U_PARAGRAPH_SEPARATOR: return HB_UNICODE_GENERAL_CATEGORY_PARAGRAPH_SEPARATOR; /* Zp */
case U_CONTROL_CHAR: return HB_CATEGORY_CONTROL; /* Cc */
case U_FORMAT_CHAR: return HB_CATEGORY_FORMAT; /* Cf */
case U_PRIVATE_USE_CHAR: return HB_CATEGORY_PRIVATE_USE; /* Co */
case U_SURROGATE: return HB_CATEGORY_SURROGATE; /* Cs */
case U_CONTROL_CHAR: return HB_UNICODE_GENERAL_CATEGORY_CONTROL; /* Cc */
case U_FORMAT_CHAR: return HB_UNICODE_GENERAL_CATEGORY_FORMAT; /* Cf */
case U_PRIVATE_USE_CHAR: return HB_UNICODE_GENERAL_CATEGORY_PRIVATE_USE; /* Co */
case U_SURROGATE: return HB_UNICODE_GENERAL_CATEGORY_SURROGATE; /* Cs */
case U_DASH_PUNCTUATION: return HB_CATEGORY_DASH_PUNCTUATION; /* Pd */
case U_START_PUNCTUATION: return HB_CATEGORY_OPEN_PUNCTUATION; /* Ps */
case U_END_PUNCTUATION: return HB_CATEGORY_CLOSE_PUNCTUATION; /* Pe */
case U_CONNECTOR_PUNCTUATION: return HB_CATEGORY_CONNECT_PUNCTUATION; /* Pc */
case U_OTHER_PUNCTUATION: return HB_CATEGORY_OTHER_PUNCTUATION; /* Po */
case U_DASH_PUNCTUATION: return HB_UNICODE_GENERAL_CATEGORY_DASH_PUNCTUATION; /* Pd */
case U_START_PUNCTUATION: return HB_UNICODE_GENERAL_CATEGORY_OPEN_PUNCTUATION; /* Ps */
case U_END_PUNCTUATION: return HB_UNICODE_GENERAL_CATEGORY_CLOSE_PUNCTUATION; /* Pe */
case U_CONNECTOR_PUNCTUATION: return HB_UNICODE_GENERAL_CATEGORY_CONNECT_PUNCTUATION; /* Pc */
case U_OTHER_PUNCTUATION: return HB_UNICODE_GENERAL_CATEGORY_OTHER_PUNCTUATION; /* Po */
case U_MATH_SYMBOL: return HB_CATEGORY_MATH_SYMBOL; /* Sm */
case U_CURRENCY_SYMBOL: return HB_CATEGORY_CURRENCY_SYMBOL; /* Sc */
case U_MODIFIER_SYMBOL: return HB_CATEGORY_MODIFIER_SYMBOL; /* Sk */
case U_OTHER_SYMBOL: return HB_CATEGORY_OTHER_SYMBOL; /* So */
case U_MATH_SYMBOL: return HB_UNICODE_GENERAL_CATEGORY_MATH_SYMBOL; /* Sm */
case U_CURRENCY_SYMBOL: return HB_UNICODE_GENERAL_CATEGORY_CURRENCY_SYMBOL; /* Sc */
case U_MODIFIER_SYMBOL: return HB_UNICODE_GENERAL_CATEGORY_MODIFIER_SYMBOL; /* Sk */
case U_OTHER_SYMBOL: return HB_UNICODE_GENERAL_CATEGORY_OTHER_SYMBOL; /* So */
case U_INITIAL_PUNCTUATION: return HB_CATEGORY_INITIAL_PUNCTUATION; /* Pi */
case U_FINAL_PUNCTUATION: return HB_CATEGORY_FINAL_PUNCTUATION; /* Pf */
case U_INITIAL_PUNCTUATION: return HB_UNICODE_GENERAL_CATEGORY_INITIAL_PUNCTUATION; /* Pi */
case U_FINAL_PUNCTUATION: return HB_UNICODE_GENERAL_CATEGORY_FINAL_PUNCTUATION; /* Pf */
}
return HB_CATEGORY_UNASSIGNED;
return HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED;
}
static hb_script_t

View File

@ -57,7 +57,7 @@ enum {
#include "hb-ot-shape-complex-arabic-table.h"
static unsigned int get_joining_type (hb_codepoint_t u, hb_category_t gen_cat)
static unsigned int get_joining_type (hb_codepoint_t u, hb_unicode_general_category_t gen_cat)
{
/* TODO Macroize the magic bit operations */
@ -71,7 +71,7 @@ static unsigned int get_joining_type (hb_codepoint_t u, hb_category_t gen_cat)
if (unlikely (0x1800 <= u && u <= 0x18AF))
{
/* All letters, SIBE SYLLABLE BOUNDARY MARKER, and NIRUGU are D */
if (gen_cat == HB_CATEGORY_OTHER_LETTER || u == 0x1807 || u == 0x180A)
if (gen_cat == HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER || u == 0x1807 || u == 0x180A)
return JOINING_TYPE_D;
}
@ -79,7 +79,7 @@ static unsigned int get_joining_type (hb_codepoint_t u, hb_category_t gen_cat)
return u == 0x200C ? JOINING_TYPE_U : JOINING_TYPE_C;
}
return ((1<<gen_cat) & ((1<<HB_CATEGORY_NON_SPACING_MARK)|(1<<HB_CATEGORY_ENCLOSING_MARK)|(1<<HB_CATEGORY_FORMAT))) ?
return ((1<<gen_cat) & ((1<<HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)|(1<<HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK)|(1<<HB_UNICODE_GENERAL_CATEGORY_FORMAT))) ?
JOINING_TYPE_T : JOINING_TYPE_U;
}
@ -170,7 +170,7 @@ _hb_ot_shape_complex_setup_masks_arabic (hb_ot_shape_context_t *c)
for (unsigned int i = 0; i < count; i++)
{
unsigned int this_type = get_joining_type (c->buffer->info[i].codepoint, (hb_category_t) c->buffer->info[i].general_category());
unsigned int this_type = get_joining_type (c->buffer->info[i].codepoint, (hb_unicode_general_category_t) c->buffer->info[i].general_category());
if (unlikely (this_type == JOINING_TYPE_T)) {
c->buffer->info[i].arabic_shaping_action() = NONE;

View File

@ -37,7 +37,7 @@ HB_BEGIN_DECLS
/* buffer var allocations */
#define general_category() var1.u8[0] /* unicode general_category (hb_category_t) */
#define general_category() var1.u8[0] /* unicode general_category (hb_unicode_general_category_t) */
#define combining_class() var1.u8[1] /* unicode combining_class (uint8_t) */

View File

@ -159,7 +159,7 @@ hb_form_clusters (hb_ot_shape_context_t *c)
{
unsigned int count = c->buffer->len;
for (unsigned int i = 1; i < count; i++)
if (c->buffer->info[i].general_category() == HB_CATEGORY_NON_SPACING_MARK)
if (c->buffer->info[i].general_category() == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)
c->buffer->info[i].cluster = c->buffer->info[i - 1].cluster;
}

View File

@ -36,7 +36,7 @@ HB_BEGIN_DECLS
*/
static hb_codepoint_t hb_unicode_get_mirroring_nil (hb_codepoint_t unicode) { return unicode; }
static hb_category_t hb_unicode_get_general_category_nil (hb_codepoint_t unicode HB_UNUSED) { return HB_CATEGORY_OTHER_LETTER; }
static hb_unicode_general_category_t hb_unicode_get_general_category_nil (hb_codepoint_t unicode HB_UNUSED) { return HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER; }
static hb_script_t hb_unicode_get_script_nil (hb_codepoint_t unicode HB_UNUSED) { return HB_SCRIPT_UNKNOWN; }
static unsigned int hb_unicode_get_combining_class_nil (hb_codepoint_t unicode HB_UNUSED) { return 0; }
static unsigned int hb_unicode_get_eastasian_width_nil (hb_codepoint_t unicode HB_UNUSED) { return 1; }
@ -205,7 +205,7 @@ hb_unicode_get_mirroring (hb_unicode_funcs_t *ufuncs,
return ufuncs->v.get_mirroring (unicode);
}
hb_category_t
hb_unicode_general_category_t
hb_unicode_get_general_category (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t unicode)
{

View File

@ -35,37 +35,37 @@ 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;
HB_UNICODE_GENERAL_CATEGORY_CONTROL, /* Cc */
HB_UNICODE_GENERAL_CATEGORY_FORMAT, /* Cf */
HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED, /* Cn */
HB_UNICODE_GENERAL_CATEGORY_PRIVATE_USE, /* Co */
HB_UNICODE_GENERAL_CATEGORY_SURROGATE, /* Cs */
HB_UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER, /* Ll */
HB_UNICODE_GENERAL_CATEGORY_MODIFIER_LETTER, /* Lm */
HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER, /* Lo */
HB_UNICODE_GENERAL_CATEGORY_TITLECASE_LETTER, /* Lt */
HB_UNICODE_GENERAL_CATEGORY_UPPERCASE_LETTER, /* Lu */
HB_UNICODE_GENERAL_CATEGORY_COMBINING_MARK, /* Mc */
HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK, /* Me */
HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK, /* Mn */
HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER, /* Nd */
HB_UNICODE_GENERAL_CATEGORY_LETTER_NUMBER, /* Nl */
HB_UNICODE_GENERAL_CATEGORY_OTHER_NUMBER, /* No */
HB_UNICODE_GENERAL_CATEGORY_CONNECT_PUNCTUATION, /* Pc */
HB_UNICODE_GENERAL_CATEGORY_DASH_PUNCTUATION, /* Pd */
HB_UNICODE_GENERAL_CATEGORY_CLOSE_PUNCTUATION, /* Pe */
HB_UNICODE_GENERAL_CATEGORY_FINAL_PUNCTUATION, /* Pf */
HB_UNICODE_GENERAL_CATEGORY_INITIAL_PUNCTUATION, /* Pi */
HB_UNICODE_GENERAL_CATEGORY_OTHER_PUNCTUATION, /* Po */
HB_UNICODE_GENERAL_CATEGORY_OPEN_PUNCTUATION, /* Ps */
HB_UNICODE_GENERAL_CATEGORY_CURRENCY_SYMBOL, /* Sc */
HB_UNICODE_GENERAL_CATEGORY_MODIFIER_SYMBOL, /* Sk */
HB_UNICODE_GENERAL_CATEGORY_MATH_SYMBOL, /* Sm */
HB_UNICODE_GENERAL_CATEGORY_OTHER_SYMBOL, /* So */
HB_UNICODE_GENERAL_CATEGORY_LINE_SEPARATOR, /* Zl */
HB_UNICODE_GENERAL_CATEGORY_PARAGRAPH_SEPARATOR, /* Zp */
HB_UNICODE_GENERAL_CATEGORY_SPACE_SEPARATOR /* Zs */
} hb_unicode_general_category_t;
/* Unicode Script property */
typedef enum
@ -218,7 +218,7 @@ hb_unicode_funcs_is_immutable (hb_unicode_funcs_t *ufuncs);
/* 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_unicode_general_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);
@ -273,7 +273,7 @@ hb_codepoint_t
hb_unicode_get_mirroring (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t unicode);
hb_category_t
hb_unicode_general_category_t
hb_unicode_get_general_category (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t unicode);