From f34ac9d0fec84c30e0b5501d20e7e37439aa0e54 Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Fri, 18 Jan 2019 13:56:18 +0800 Subject: [PATCH] UChar32 -> Uchar32; UChar16 -> Uchar16 --- ChangeLog | 2 +- include/gdi.h | 72 ++++++------ src/font/charset-arabic.c | 4 +- src/font/charset.c | 224 +++++++++++++++++++------------------- src/font/textops.c | 32 +++--- src/font/unicode-comp.c | 32 +++--- src/gui/keyboard.c | 4 +- src/include/devfont.h | 4 +- 8 files changed, 187 insertions(+), 187 deletions(-) diff --git a/ChangeLog b/ChangeLog index c2fc4ea0..c7cca661 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4761,7 +4761,7 @@ create_skin_main_window_ex: * ext/skin/skin.c 05/16. ENHANCEMENT #8: Support for UTF-16LE and UTF-16BE charsets/encodings. - * Change the definition of UChar32 to 'int'. + * Change the definition of Uchar32 to 'int'. * include/gdi.h 05/16. ENHANCEMENT #11: Support for FreeType2. diff --git a/include/gdi.h b/include/gdi.h index ec940363..32845610 100644 --- a/include/gdi.h +++ b/include/gdi.h @@ -5774,8 +5774,8 @@ typedef struct _WORDINFO WORDINFO; #define MAX_LEN_MCHAR 6 -typedef Uint16 UChar16; -typedef Uint32 UChar32; +typedef Uint16 Uchar16; +typedef Uint32 Uchar32; #define MCHAR_TYPE_NOSPACING_MARK 0x0001 #define MCHAR_TYPE_ABOVE_MARK 0x0002 @@ -6775,7 +6775,7 @@ MG_EXPORT int GUIAPI MB2WCEx (PLOGFONT log_font, void* dest, BOOL wc32, MB2WCEx (log_font, dest, sizeof(wchar_t) == 4, mstr, n) /** - * \fn int GUIAPI WC2MBEx (PLOGFONT log_font, unsigned char *s, UChar32 wc) + * \fn int GUIAPI WC2MBEx (PLOGFONT log_font, unsigned char *s, Uchar32 wc) * * \brief Converts a wide character in UCS to a multibyte character * according to the charset/encoding of the logical font. @@ -6791,7 +6791,7 @@ MG_EXPORT int GUIAPI MB2WCEx (PLOGFONT log_font, void* dest, BOOL wc32, * * \sa WC2MB, mbtowc */ -MG_EXPORT int GUIAPI WC2MBEx (PLOGFONT log_font, unsigned char *s, UChar32 wc); +MG_EXPORT int GUIAPI WC2MBEx (PLOGFONT log_font, unsigned char *s, Uchar32 wc); /** * \def WC2MB(log_font, dest, mstr, n) @@ -6800,7 +6800,7 @@ MG_EXPORT int GUIAPI WC2MBEx (PLOGFONT log_font, unsigned char *s, UChar32 wc); * \sa WC2MBEx */ #define WC2MB(log_font, s, wc) \ - WC2MBEx (log_font, s, (UChar32)wc) + WC2MBEx (log_font, s, (Uchar32)wc) /** * \fn int GUIAPI MBS2WCSEx (PLOGFONT log_font, void* dest, BOOL wc32, \ @@ -6895,39 +6895,39 @@ MG_EXPORT int GUIAPI WCS2MBSEx (PLOGFONT log_font, unsigned char* dest, n, NULL) /** The function determines whether a glyph is alphanumeric. */ -MG_EXPORT BOOL GUIAPI IsUCharAlnum(UChar32 uc); +MG_EXPORT BOOL GUIAPI IsUCharAlnum(Uchar32 uc); /** The function determines whether a character is alphabetic (i.e. a letter). */ -MG_EXPORT BOOL GUIAPI IsUCharAlpha(UChar32 uc); +MG_EXPORT BOOL GUIAPI IsUCharAlpha(Uchar32 uc); /** The function determines whether a character is a control character. */ -MG_EXPORT BOOL GUIAPI IsUCharControl(UChar32 uc); +MG_EXPORT BOOL GUIAPI IsUCharControl(Uchar32 uc); /** The function determines whether a character is numeric (i.e. a digit). */ -MG_EXPORT BOOL GUIAPI IsUCharDigit(UChar32 uc); +MG_EXPORT BOOL GUIAPI IsUCharDigit(Uchar32 uc); /** The function determines whether a character is printable and not a space */ -MG_EXPORT BOOL GUIAPI IsUCharGraph(UChar32 uc); +MG_EXPORT BOOL GUIAPI IsUCharGraph(Uchar32 uc); /** The function determines whether a character is a lowercase letter. */ -MG_EXPORT BOOL GUIAPI IsUCharLowercase(UChar32 uc); +MG_EXPORT BOOL GUIAPI IsUCharLowercase(Uchar32 uc); /** The function determines whether a character is printable. */ -MG_EXPORT BOOL GUIAPI IsUCharPrint(UChar32 uc); +MG_EXPORT BOOL GUIAPI IsUCharPrint(Uchar32 uc); /** The function determines whether a character is a uppercase letter. */ -MG_EXPORT BOOL GUIAPI IsUCharUppercase(UChar32 uc); +MG_EXPORT BOOL GUIAPI IsUCharUppercase(Uchar32 uc); /** The function determines whether a character is punctuation or a symbol. */ -MG_EXPORT BOOL GUIAPI IsUCharPunct(UChar32 uc); +MG_EXPORT BOOL GUIAPI IsUCharPunct(Uchar32 uc); /** The function determines whether a character is a space, tab, or line separator * (newline, carriage return, etc.). */ -MG_EXPORT BOOL GUIAPI IsUCharSpace(UChar32 uc); +MG_EXPORT BOOL GUIAPI IsUCharSpace(Uchar32 uc); /** The function determines whether a character is a mark (non-spacing mark, * combining mark, or enclosing mark in Unicode speak). */ -MG_EXPORT BOOL GUIAPI IsUCharMark(UChar32 uc); +MG_EXPORT BOOL GUIAPI IsUCharMark(Uchar32 uc); /** The function determines if a character is titlecase. Some characters in * Unicode which are composites, such as the DZ digraph @@ -6935,19 +6935,19 @@ MG_EXPORT BOOL GUIAPI IsUCharMark(UChar32 uc); * form is used at the beginning of a word where only the * first letter is capitalized. The titlecase form of the DZ * digraph is U+01F2 LATIN CAPITAL LETTTER D WITH SMALL LETTER Z. */ -MG_EXPORT BOOL GUIAPI IsUCharTitle(UChar32 uc); +MG_EXPORT BOOL GUIAPI IsUCharTitle(Uchar32 uc); /** The function determines if a character is a hexidecimal digit. */ -MG_EXPORT BOOL GUIAPI IsUCharXDigit(UChar32 uc); +MG_EXPORT BOOL GUIAPI IsUCharXDigit(Uchar32 uc); /** The function determines if a given character is assigned in the Unicode standard. */ -MG_EXPORT BOOL GUIAPI IsUCharDefined(UChar32 uc); +MG_EXPORT BOOL GUIAPI IsUCharDefined(Uchar32 uc); /** The function determines if a given character typically takes zero width when rendered. */ -MG_EXPORT BOOL GUIAPI IsUCharZeroWidth(UChar32 uc); +MG_EXPORT BOOL GUIAPI IsUCharZeroWidth(Uchar32 uc); /** The function determines if a character is typically rendered in a double-width cell. */ -MG_EXPORT BOOL GUIAPI IsUCharWide(UChar32 uc); +MG_EXPORT BOOL GUIAPI IsUCharWide(Uchar32 uc); /** * The function determines if a character is typically rendered in a double-width @@ -6957,31 +6957,31 @@ MG_EXPORT BOOL GUIAPI IsUCharWide(UChar32 uc); * [Unicode Standard Annex #11](http://www.unicode.org/reports/tr11/) * for details. */ -MG_EXPORT BOOL GUIAPI IsUCharWideCJK(UChar32 uc); +MG_EXPORT BOOL GUIAPI IsUCharWideCJK(Uchar32 uc); /** Converts a character to uppercase. */ -MG_EXPORT UChar32 UCharToUpper (UChar32 uc); +MG_EXPORT Uchar32 UCharToUpper (Uchar32 uc); /** Converts a character to lower case. */ -MG_EXPORT UChar32 GUIAPI UCharToLower (UChar32 uc); +MG_EXPORT Uchar32 GUIAPI UCharToLower (Uchar32 uc); /** Converts a glyph to the titlecase. */ -MG_EXPORT UChar32 GUIAPI UCharToTitle (UChar32 uc); +MG_EXPORT Uchar32 GUIAPI UCharToTitle (Uchar32 uc); /** Converts a glyph to full-width. */ -MG_EXPORT UChar32 GUIAPI UCharToFullWidth (UChar32 uc); +MG_EXPORT Uchar32 GUIAPI UCharToFullWidth (Uchar32 uc); /** Converts a glyph to single-width. */ -MG_EXPORT UChar32 GUIAPI UCharToSingleWidth (UChar32 uc); +MG_EXPORT Uchar32 GUIAPI UCharToSingleWidth (Uchar32 uc); /** Converts a glyph to full-size Kana. */ -MG_EXPORT UChar32 GUIAPI UCharToFullSizeKana (UChar32 uc); +MG_EXPORT Uchar32 GUIAPI UCharToFullSizeKana (Uchar32 uc); /** Converts a glyph to small Kana. */ -MG_EXPORT UChar32 GUIAPI UCharToSmallKana (UChar32 uc); +MG_EXPORT Uchar32 GUIAPI UCharToSmallKana (Uchar32 uc); /** Determines the canonical combining class of a Unicode character.*/ -MG_EXPORT int GUIAPI UCharCombiningClass (UChar32 uc); +MG_EXPORT int GUIAPI UCharCombiningClass (Uchar32 uc); /** * Computes the canonical ordering of a string in-place. @@ -6989,13 +6989,13 @@ MG_EXPORT int GUIAPI UCharCombiningClass (UChar32 uc); * according to their combining classes. * See the Unicode manual for more information. */ -MG_EXPORT void GUIAPI UCharCanonicalOrdering (UChar32 *string, int len); +MG_EXPORT void GUIAPI UCharCanonicalOrdering (Uchar32 *string, int len); /** Performs a single decomposition step of the Unicode canonical decomposition algorithm. */ -MG_EXPORT BOOL GUIAPI UCharCompose (UChar32 a, UChar32 b, UChar32 *ch); +MG_EXPORT BOOL GUIAPI UCharCompose (Uchar32 a, Uchar32 b, Uchar32 *ch); /** Performs a single composition step of the Unicode canonical composition algorithm. */ -MG_EXPORT BOOL GUIAPI UCharDecompose (UChar32 ch, UChar32 *a, UChar32 *b); +MG_EXPORT BOOL GUIAPI UCharDecompose (Uchar32 ch, Uchar32 *a, Uchar32 *b); /** * Computes the canonical or compatibility decomposition of a @@ -7004,8 +7004,8 @@ MG_EXPORT BOOL GUIAPI UCharDecompose (UChar32 ch, UChar32 *a, UChar32 *b); * For compatibility decomposition, pass TRUE for \a compat; * for canonical decomposition pass FALSE for \a compat. */ -MG_EXPORT int GUIAPI UCharFullyDecompose (UChar32 ch, BOOL compat, - UChar32 *result, int result_len); +MG_EXPORT int GUIAPI UCharFullyDecompose (Uchar32 ch, BOOL compat, + Uchar32 *result, int result_len); #endif /* _MGCHARSET_UNICODE */ @@ -9987,7 +9987,7 @@ MG_EXPORT int GUIAPI GetFirstWord (PLOGFONT log_font, const char* mstr, int len, WORDINFO* word_info); MG_EXPORT int GUIAPI MB2WCEx (PLOGFONT log_font, void* dest, BOOL wc32, const unsigned char* mchar, int n); -MG_EXPORT int GUIAPI WC2MBEx (PLOGFONT log_font, unsigned char *s, UChar32 wc); +MG_EXPORT int GUIAPI WC2MBEx (PLOGFONT log_font, unsigned char *s, Uchar32 wc); MG_EXPORT int GUIAPI MBS2WCSEx (PLOGFONT log_font, void* dest, BOOL wc32, const unsigned char* mstr, int mstr_len, int n, int* conved_mstr_len); diff --git a/src/font/charset-arabic.c b/src/font/charset-arabic.c index d608836b..30ba2b8f 100644 --- a/src/font/charset-arabic.c +++ b/src/font/charset-arabic.c @@ -174,7 +174,7 @@ static unsigned short iso8859_68x_unicode_map [] = 0xFEF7, 0xFEF8, 0xFEF9, 0xFEFA, /*0x130~0x133*/ }; -static UChar32 iso8859_6_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 iso8859_6_conv_to_uc32 (Glyph32 glyph_value) { if (glyph_value < 0x81) return (Glyph32) (glyph_value); @@ -184,7 +184,7 @@ static UChar32 iso8859_6_conv_to_uc32 (Glyph32 glyph_value) return 0xFFFF; } -static int iso8859_6_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int iso8859_6_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { switch (wc) { case 0x060C: diff --git a/src/font/charset.c b/src/font/charset.c index 9e208ce7..0b153f5c 100644 --- a/src/font/charset.c +++ b/src/font/charset.c @@ -196,7 +196,7 @@ static int ascii_is_this_charset (const unsigned char* charset) } #ifdef _MGCHARSET_UNICODE -static UChar32 ascii_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 ascii_conv_to_uc32 (Glyph32 glyph_value) { glyph_value = REAL_GLYPH(glyph_value); if (glyph_value < 128) @@ -205,7 +205,7 @@ static UChar32 ascii_conv_to_uc32 (Glyph32 glyph_value) return '?'; } -static int ascii_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int ascii_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { if (wc < 128) { *mchar = (unsigned char) wc; @@ -263,13 +263,13 @@ static int iso8859_1_is_this_charset (const unsigned char* charset) } #ifdef _MGCHARSET_UNICODE -static UChar32 iso8859_1_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 iso8859_1_conv_to_uc32 (Glyph32 glyph_value) { glyph_value = REAL_GLYPH(glyph_value); return glyph_value; } -static int iso8859_1_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int iso8859_1_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { if (wc < 256) { *mchar = (unsigned char) wc; @@ -363,16 +363,16 @@ static unsigned short iso8859_2_unicode_map [] = 0x00FD, 0x0163, 0x02D9 }; -static UChar32 iso8859_2_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 iso8859_2_conv_to_uc32 (Glyph32 glyph_value) { glyph_value = REAL_GLYPH(glyph_value); if (glyph_value < 0xA1) return glyph_value; else - return (UChar32) iso8859_2_unicode_map [glyph_value - 0xA1]; + return (Uchar32) iso8859_2_unicode_map [glyph_value - 0xA1]; } -static int iso8859_2_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int iso8859_2_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { int i; @@ -382,7 +382,7 @@ static int iso8859_2_conv_from_uc32 (UChar32 wc, unsigned char* mchar) } for (i = 0; i < TABLESIZE (iso8859_2_unicode_map); i++) { - if (((UChar32)iso8859_2_unicode_map [i]) == wc) { + if (((Uchar32)iso8859_2_unicode_map [i]) == wc) { *mchar = 0xA1 + i; return 1; } @@ -477,16 +477,16 @@ static unsigned short iso8859_3_unicode_map [] = 0x015D, 0x02D9 }; -static UChar32 iso8859_3_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 iso8859_3_conv_to_uc32 (Glyph32 glyph_value) { glyph_value = REAL_GLYPH(glyph_value); if (glyph_value < 0xA1) return glyph_value; else - return (UChar32) iso8859_3_unicode_map [glyph_value - 0xA1]; + return (Uchar32) iso8859_3_unicode_map [glyph_value - 0xA1]; } -static int iso8859_3_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int iso8859_3_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { int i; @@ -496,7 +496,7 @@ static int iso8859_3_conv_from_uc32 (UChar32 wc, unsigned char* mchar) } for (i = 0; i < TABLESIZE (iso8859_3_unicode_map); i++) { - if (((UChar32)iso8859_3_unicode_map [i]) == wc) { + if (((Uchar32)iso8859_3_unicode_map [i]) == wc) { *mchar = 0xA1 + i; return 1; } @@ -590,17 +590,17 @@ static unsigned short iso8859_4_unicode_map [] = 0x016B, 0x02D9 }; -static UChar32 iso8859_4_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 iso8859_4_conv_to_uc32 (Glyph32 glyph_value) { glyph_value = REAL_GLYPH(glyph_value); if (glyph_value < 0xA1) return glyph_value; else - return (UChar32) iso8859_4_unicode_map [glyph_value - 0xA1]; + return (Uchar32) iso8859_4_unicode_map [glyph_value - 0xA1]; } -static int iso8859_4_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int iso8859_4_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { int i; @@ -610,7 +610,7 @@ static int iso8859_4_conv_from_uc32 (UChar32 wc, unsigned char* mchar) } for (i = 0; i < TABLESIZE (iso8859_4_unicode_map); i++) { - if (((UChar32)iso8859_4_unicode_map [i]) == wc) { + if (((Uchar32)iso8859_4_unicode_map [i]) == wc) { *mchar = 0xA1 + i; return 1; } @@ -669,7 +669,7 @@ static int iso8859_5_is_this_charset (const unsigned char* charset) } #ifdef _MGCHARSET_UNICODE -static UChar32 iso8859_5_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 iso8859_5_conv_to_uc32 (Glyph32 glyph_value) { glyph_value = REAL_GLYPH(glyph_value); @@ -688,7 +688,7 @@ static UChar32 iso8859_5_conv_to_uc32 (Glyph32 glyph_value) return glyph_value + (0x0401 - 0xA1); } -static int iso8859_5_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int iso8859_5_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { if (wc < 0xA1) { *mchar = (unsigned char) wc; @@ -832,21 +832,21 @@ static unsigned short iso8859_7_unicode_map [] = 0x038C, 0x00BD }; -static UChar32 iso8859_7_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 iso8859_7_conv_to_uc32 (Glyph32 glyph_value) { glyph_value = REAL_GLYPH(glyph_value); if (glyph_value >= 0xBE && glyph_value <= 0xFE) { return glyph_value - 0xBE + 0x038E; } else if (glyph_value >= 0xA1 && glyph_value <= 0xBD) { - return (UChar32)iso8859_7_unicode_map [glyph_value - 0xA1]; + return (Uchar32)iso8859_7_unicode_map [glyph_value - 0xA1]; } else { return glyph_value; } } -static int iso8859_7_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int iso8859_7_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { int i; @@ -861,7 +861,7 @@ static int iso8859_7_conv_from_uc32 (UChar32 wc, unsigned char* mchar) } for (i = 0; i < TABLESIZE (iso8859_7_unicode_map); i++) { - if (((UChar32)iso8859_7_unicode_map [i]) == wc) { + if (((Uchar32)iso8859_7_unicode_map [i]) == wc) { *mchar = 0xA1 + i; return 1; } @@ -1085,7 +1085,7 @@ static BOOL iso8859_8_bidi_mirror_glyph (Glyph32 glyph, Glyph32* mirrored) } #ifdef _MGCHARSET_UNICODE -static UChar32 iso8859_8_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 iso8859_8_conv_to_uc32 (Glyph32 glyph_value) { glyph_value = REAL_GLYPH(glyph_value); if (glyph_value >= 0xE0 && glyph_value <= 0xFA) { @@ -1108,7 +1108,7 @@ static UChar32 iso8859_8_conv_to_uc32 (Glyph32 glyph_value) } } -static int iso8859_8_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int iso8859_8_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { switch (wc) { @@ -1189,7 +1189,7 @@ static int iso8859_9_is_this_charset (const unsigned char* charset) } #ifdef _MGCHARSET_UNICODE -static UChar32 iso8859_9_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 iso8859_9_conv_to_uc32 (Glyph32 glyph_value) { glyph_value = REAL_GLYPH(glyph_value); switch (glyph_value) { @@ -1210,7 +1210,7 @@ static UChar32 iso8859_9_conv_to_uc32 (Glyph32 glyph_value) return glyph_value; } -static int iso8859_9_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int iso8859_9_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { switch (wc) { case 0x011E: @@ -1327,16 +1327,16 @@ static unsigned short iso8859_10_unicode_map [] = 0x00FE, 0x0138 }; -static UChar32 iso8859_10_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 iso8859_10_conv_to_uc32 (Glyph32 glyph_value) { glyph_value = REAL_GLYPH(glyph_value); if (glyph_value < 0xA1) return glyph_value; else - return (UChar32)iso8859_10_unicode_map [glyph_value - 0xA1]; + return (Uchar32)iso8859_10_unicode_map [glyph_value - 0xA1]; } -static int iso8859_10_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int iso8859_10_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { int i; @@ -1346,7 +1346,7 @@ static int iso8859_10_conv_from_uc32 (UChar32 wc, unsigned char* mchar) } for (i = 0; i < TABLESIZE (iso8859_10_unicode_map); i++) { - if (((UChar32)iso8859_10_unicode_map [i]) == wc) { + if (((Uchar32)iso8859_10_unicode_map [i]) == wc) { *mchar = 0xA1 + i; return 1; } @@ -1441,16 +1441,16 @@ static unsigned short iso8859_11_unicode_map [] = 0x00FE, 0x00FF }; -static UChar32 iso8859_11_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 iso8859_11_conv_to_uc32 (Glyph32 glyph_value) { glyph_value = REAL_GLYPH(glyph_value); if (glyph_value < 0xA1) return glyph_value; else - return (UChar32) iso8859_11_unicode_map [glyph_value - 0xA1]; + return (Uchar32) iso8859_11_unicode_map [glyph_value - 0xA1]; } -static int iso8859_11_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int iso8859_11_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { int i; @@ -1460,7 +1460,7 @@ static int iso8859_11_conv_from_uc32 (UChar32 wc, unsigned char* mchar) } for (i = 0; i < TABLESIZE (iso8859_11_unicode_map); i++) { - if (((UChar32)iso8859_11_unicode_map [i]) == wc) { + if (((Uchar32)iso8859_11_unicode_map [i]) == wc) { *mchar = 0xA1 + i; return 1; } @@ -1554,16 +1554,16 @@ static unsigned short iso8859_13_unicode_map [] = 0x017E, 0x2019 }; -static UChar32 iso8859_13_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 iso8859_13_conv_to_uc32 (Glyph32 glyph_value) { glyph_value = REAL_GLYPH(glyph_value); if (glyph_value < 0xA1) return glyph_value; else - return (UChar32) iso8859_13_unicode_map [glyph_value - 0xA1]; + return (Uchar32) iso8859_13_unicode_map [glyph_value - 0xA1]; } -static int iso8859_13_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int iso8859_13_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { int i; @@ -1573,7 +1573,7 @@ static int iso8859_13_conv_from_uc32 (UChar32 wc, unsigned char* mchar) } for (i = 0; i < TABLESIZE (iso8859_13_unicode_map); i++) { - if (((UChar32)iso8859_13_unicode_map [i]) == wc) { + if (((Uchar32)iso8859_13_unicode_map [i]) == wc) { *mchar = 0xA1 + i; return 1; } @@ -1667,16 +1667,16 @@ static unsigned short iso8859_14_unicode_map [] = 0x0177, 0x00FF }; -static UChar32 iso8859_14_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 iso8859_14_conv_to_uc32 (Glyph32 glyph_value) { glyph_value = REAL_GLYPH(glyph_value); if (glyph_value < 0xA1) return glyph_value; else - return (UChar32) iso8859_14_unicode_map [glyph_value - 0xA1]; + return (Uchar32) iso8859_14_unicode_map [glyph_value - 0xA1]; } -static int iso8859_14_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int iso8859_14_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { int i; @@ -1686,7 +1686,7 @@ static int iso8859_14_conv_from_uc32 (UChar32 wc, unsigned char* mchar) } for (i = 0; i < TABLESIZE (iso8859_14_unicode_map); i++) { - if (((UChar32)iso8859_14_unicode_map [i]) == wc) { + if (((Uchar32)iso8859_14_unicode_map [i]) == wc) { *mchar = 0xA1 + i; return 1; } @@ -1744,7 +1744,7 @@ static int iso8859_15_is_this_charset (const unsigned char* charset) } #ifdef _MGCHARSET_UNICODE -static UChar32 iso8859_15_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 iso8859_15_conv_to_uc32 (Glyph32 glyph_value) { glyph_value = REAL_GLYPH(glyph_value); switch (glyph_value) { @@ -1769,7 +1769,7 @@ static UChar32 iso8859_15_conv_to_uc32 (Glyph32 glyph_value) } } -static int iso8859_15_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int iso8859_15_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { switch (wc) { case 0x20AC: /* EURO SIGN */ @@ -1855,7 +1855,7 @@ static int iso8859_16_is_this_charset (const unsigned char* charset) } #ifdef _MGCHARSET_UNICODE -static UChar32 iso8859_16_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 iso8859_16_conv_to_uc32 (Glyph32 glyph_value) { glyph_value = REAL_GLYPH(glyph_value); switch (glyph_value) { @@ -1904,7 +1904,7 @@ static UChar32 iso8859_16_conv_to_uc32 (Glyph32 glyph_value) return glyph_value; } -static int iso8859_16_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int iso8859_16_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { switch (wc) { case 0x0104: *mchar = 0xA1; return 1; @@ -2129,14 +2129,14 @@ static int gb2312_0_pos_first_char (const unsigned char* mstr, int mstrlen) } #ifdef _MGCHARSET_UNICODE -static UChar32 gb2312_0_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 gb2312_0_conv_to_uc32 (Glyph32 glyph_value) { - return (UChar32)__mg_gbunicode_map [REAL_GLYPH(glyph_value)]; + return (Uchar32)__mg_gbunicode_map [REAL_GLYPH(glyph_value)]; } const unsigned char* __mg_map_uc16_to_gb (unsigned short uc16); -static int gb2312_0_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int gb2312_0_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { const unsigned char* got; @@ -2287,13 +2287,13 @@ static int gbk_pos_first_char (const unsigned char* mstr, int mstrlen) } #ifdef _MGCHARSET_UNICODE -static UChar32 gbk_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 gbk_conv_to_uc32 (Glyph32 glyph_value) { - return (UChar32)__mg_gbkunicode_map[REAL_GLYPH(glyph_value)]; + return (Uchar32)__mg_gbkunicode_map[REAL_GLYPH(glyph_value)]; } const unsigned char* __mg_map_uc16_to_gbk (unsigned short uc16); -static int gbk_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int gbk_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { const unsigned char* got; @@ -2531,7 +2531,7 @@ static const unsigned char* gb18030_0_get_next_word (const unsigned char* mstr, } #ifdef _MGCHARSET_UNICODE -static UChar32 gb18030_0_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 gb18030_0_conv_to_uc32 (Glyph32 glyph_value) { glyph_value = REAL_GLYPH(glyph_value); @@ -2550,17 +2550,17 @@ static UChar32 gb18030_0_conv_to_uc32 (Glyph32 glyph_value) (m2 * 1260) + (m3 * 10) + n3 + 65536; } - return (UChar32)__mg_gb18030_0_unicode_map [glyph_value]; + return (Uchar32)__mg_gb18030_0_unicode_map [glyph_value]; } int __mg_map_ucs_to_gb18030 (int wc, unsigned char* mchar); -static int gb18030_0_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int gb18030_0_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { if (wc > 0x10FFFF) return 0; else if (wc >= 0x10000 && wc <= 0x10FFFF) { /* from 0x10000 - 0x10FFFF */ - UChar32 m1, n1, m2, n2, m3, n3; + Uchar32 m1, n1, m2, n2, m3, n3; m1 = (wc - 65536) / 12600; n1 = (wc - 65536) % 12600; m2 = n1 / 1260; @@ -2707,7 +2707,7 @@ static int big5_pos_first_char (const unsigned char* mstr, int mstrlen) } #ifdef _MGCHARSET_UNICODE -static UChar32 big5_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 big5_conv_to_uc32 (Glyph32 glyph_value) { unsigned short ucs_code = __mg_big5_unicode_map [REAL_GLYPH(glyph_value)]; @@ -2718,7 +2718,7 @@ static UChar32 big5_conv_to_uc32 (Glyph32 glyph_value) } const unsigned char* __mg_map_uc16_to_big5 (unsigned short uc16); -static int big5_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int big5_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { const unsigned char* got; @@ -2866,7 +2866,7 @@ static int ksc5601_0_pos_first_char (const unsigned char* mstr, int mstrlen) } #ifdef _MGCHARSET_UNICODE -static UChar32 ksc5601_0_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 ksc5601_0_conv_to_uc32 (Glyph32 glyph_value) { unsigned short ucs_code = __mg_ksc5601_0_unicode_map [REAL_GLYPH(glyph_value)]; @@ -2876,7 +2876,7 @@ static UChar32 ksc5601_0_conv_to_uc32 (Glyph32 glyph_value) return ucs_code; } -static int ksc5601_0_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int ksc5601_0_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { /* TODO */ return 0; @@ -2987,7 +2987,7 @@ static int jisx0201_0_is_this_charset (const unsigned char* charset) #ifdef _MGCHARSET_UNICODE -static UChar32 jisx0201_0_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 jisx0201_0_conv_to_uc32 (Glyph32 glyph_value) { glyph_value = REAL_GLYPH(glyph_value); @@ -3002,7 +3002,7 @@ static UChar32 jisx0201_0_conv_to_uc32 (Glyph32 glyph_value) } -static int jisx0201_0_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int jisx0201_0_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { /* TODO */ return 0; @@ -3133,7 +3133,7 @@ static int jisx0208_0_pos_first_char (const unsigned char* mstr, int mstrlen) } #ifdef _MGCHARSET_UNICODE -static UChar32 jisx0208_0_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 jisx0208_0_conv_to_uc32 (Glyph32 glyph_value) { unsigned short ucs_code; @@ -3145,7 +3145,7 @@ static UChar32 jisx0208_0_conv_to_uc32 (Glyph32 glyph_value) return ucs_code; } -static int jisx0208_0_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int jisx0208_0_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { /* TODO */ return 0; @@ -3200,7 +3200,7 @@ static int jisx0201_1_is_this_charset (const unsigned char* charset) #ifdef _MGCHARSET_UNICODE -static UChar32 jisx0201_1_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 jisx0201_1_conv_to_uc32 (Glyph32 glyph_value) { glyph_value = REAL_GLYPH(glyph_value); if (glyph_value >= 0xA1 && glyph_value <= 0xDF) @@ -3213,7 +3213,7 @@ static UChar32 jisx0201_1_conv_to_uc32 (Glyph32 glyph_value) return glyph_value; } -static int jisx0201_1_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int jisx0201_1_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { if (wc < 0xA1) { *mchar = (unsigned char)wc; @@ -3390,7 +3390,7 @@ static int jisx0208_1_pos_first_char (const unsigned char* mstr, int mstrlen) } #ifdef _MGCHARSET_UNICODE -static UChar32 jisx0208_1_conv_to_uc32 (Glyph32 glyph_value) +static Uchar32 jisx0208_1_conv_to_uc32 (Glyph32 glyph_value) { unsigned short ucs_code; @@ -3402,7 +3402,7 @@ static UChar32 jisx0208_1_conv_to_uc32 (Glyph32 glyph_value) return ucs_code; } -static int jisx0208_1_conv_from_uc32 (UChar32 wc, unsigned char *mchar) +static int jisx0208_1_conv_from_uc32 (Uchar32 wc, unsigned char *mchar) { /* TODO */ return 0; @@ -3467,7 +3467,7 @@ static int utf8_len_first_char (const unsigned char* mstr, int len) static Glyph32 utf8_char_glyph_value (const unsigned char* pre_mchar, int pre_len, const unsigned char* cur_mchar, int cur_len) { - UChar32 wc = *((unsigned char *)(cur_mchar++)); + Uchar32 wc = *((unsigned char *)(cur_mchar++)); int n, t; if (wc & 0x80) { @@ -3680,7 +3680,7 @@ static const unsigned char* utf8_get_next_word (const unsigned char* mstr, { const unsigned char* mchar = mstr; int ch_len; - UChar32 wc; + Uchar32 wc; word_info->len = 0; word_info->delimiter = '\0'; @@ -3758,7 +3758,7 @@ static int utf8_pos_first_char (const unsigned char* mstr, int mstrlen) return -1; } -static int utf8_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int utf8_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { int first, len; @@ -3828,7 +3828,7 @@ static CHARSETOPS CharsetOps_utf8 = { /************************* UTF-16LE Specific Operations ***********************/ static int utf16le_len_first_char (const unsigned char* mstr, int len) { - UChar16 w1, w2; + Uchar16 w1, w2; if (len < 2) return 0; @@ -3852,8 +3852,8 @@ static int utf16le_len_first_char (const unsigned char* mstr, int len) static Glyph32 utf16le_char_glyph_value (const unsigned char* pre_mchar, int pre_len, const unsigned char* cur_mchar, int cur_len) { - UChar16 w1, w2; - UChar32 wc; + Uchar16 w1, w2; + Uchar32 wc; w1 = MAKEWORD16 (cur_mchar[0], cur_mchar[1]); @@ -3929,7 +3929,7 @@ static const unsigned char* utf16le_get_next_word (const unsigned char* mstr, int mstrlen, WORDINFO* word_info) { const unsigned char* mchar = mstr; - UChar32 wc; + Uchar32 wc; int ch_len; word_info->len = 0; @@ -4003,9 +4003,9 @@ static int utf16le_pos_first_char (const unsigned char* mstr, int mstrlen) return -1; } -static int utf16le_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int utf16le_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { - UChar16 w1, w2; + Uchar16 w1, w2; if (wc > 0x10FFFF) { return 0; @@ -4054,7 +4054,7 @@ static CHARSETOPS CharsetOps_utf16le = { /************************* UTF-16BE Specific Operations ***********************/ static int utf16be_len_first_char (const unsigned char* mstr, int len) { - UChar16 w1, w2; + Uchar16 w1, w2; if (len < 2) return 0; @@ -4078,8 +4078,8 @@ static int utf16be_len_first_char (const unsigned char* mstr, int len) static Glyph32 utf16be_char_glyph_value (const unsigned char* pre_mchar, int pre_len, const unsigned char* cur_mchar, int cur_len) { - UChar16 w1, w2; - UChar32 wc; + Uchar16 w1, w2; + Uchar32 wc; w1 = MAKEWORD16 (cur_mchar[1], cur_mchar[0]); @@ -4155,7 +4155,7 @@ static const unsigned char* utf16be_get_next_word (const unsigned char* mstr, int mstrlen, WORDINFO* word_info) { const unsigned char* mchar = mstr; - UChar32 wc; + Uchar32 wc; int ch_len; word_info->len = 0; @@ -4229,9 +4229,9 @@ static int utf16be_pos_first_char (const unsigned char* mstr, int mstrlen) return -1; } -static int utf16be_conv_from_uc32 (UChar32 wc, unsigned char* mchar) +static int utf16be_conv_from_uc32 (Uchar32 wc, unsigned char* mchar) { - UChar16 w1, w2; + Uchar16 w1, w2; if (wc > 0x10FFFF) { return 0; @@ -4407,27 +4407,27 @@ BOOL IsCompatibleCharset (const char* charset, CHARSETOPS* ops) #ifdef _MGCHARSET_UNICODE -BOOL GUIAPI IsUCharAlnum(UChar32 uc) +BOOL GUIAPI IsUCharAlnum(Uchar32 uc) { return ISALDIGIT(TYPE(uc)); } -BOOL GUIAPI IsUCharAlpha(UChar32 uc) +BOOL GUIAPI IsUCharAlpha(Uchar32 uc) { return ISALPHA (TYPE(uc)); } -BOOL GUIAPI IsUCharControl(UChar32 uc) +BOOL GUIAPI IsUCharControl(Uchar32 uc) { return TYPE(uc) == UCHAR_TYPE_CONTROL; } -BOOL GUIAPI IsUCharDigit(UChar32 uc) +BOOL GUIAPI IsUCharDigit(Uchar32 uc) { return TYPE(uc) == UCHAR_TYPE_DECIMAL_NUMBER; } -BOOL GUIAPI IsUCharGraph(UChar32 uc) +BOOL GUIAPI IsUCharGraph(Uchar32 uc) { return !IS (TYPE(uc), OR (UCHAR_TYPE_CONTROL, @@ -4438,12 +4438,12 @@ BOOL GUIAPI IsUCharGraph(UChar32 uc) 0)))))); } -BOOL GUIAPI IsUCharLowercase(UChar32 uc) +BOOL GUIAPI IsUCharLowercase(Uchar32 uc) { return TYPE(uc) == UCHAR_TYPE_LOWERCASE_LETTER; } -BOOL GUIAPI IsUCharPrint(UChar32 uc) +BOOL GUIAPI IsUCharPrint(Uchar32 uc) { return !IS (TYPE(uc), OR (UCHAR_TYPE_CONTROL, @@ -4453,12 +4453,12 @@ BOOL GUIAPI IsUCharPrint(UChar32 uc) 0))))); } -BOOL GUIAPI IsUCharUppercase(UChar32 uc) +BOOL GUIAPI IsUCharUppercase(Uchar32 uc) { return TYPE(uc) == UCHAR_TYPE_UPPERCASE_LETTER; } -BOOL GUIAPI IsUCharPunct(UChar32 uc) +BOOL GUIAPI IsUCharPunct(Uchar32 uc) { return IS (TYPE(uc), OR (UCHAR_TYPE_CONNECT_PUNCTUATION, @@ -4475,7 +4475,7 @@ BOOL GUIAPI IsUCharPunct(UChar32 uc) 0)))))))))))); } -BOOL GUIAPI IsUCharSpace(UChar32 uc) +BOOL GUIAPI IsUCharSpace(Uchar32 uc) { switch (uc) { /* special-case these since Unicode thinks they are not spaces */ @@ -4499,12 +4499,12 @@ BOOL GUIAPI IsUCharSpace(UChar32 uc) return FALSE; } -BOOL GUIAPI IsUCharMark(UChar32 uc) +BOOL GUIAPI IsUCharMark(Uchar32 uc) { return ISMARK (TYPE(uc)); } -BOOL GUIAPI IsUCharTitle(UChar32 uc) +BOOL GUIAPI IsUCharTitle(Uchar32 uc) { unsigned int i; @@ -4517,14 +4517,14 @@ BOOL GUIAPI IsUCharTitle(UChar32 uc) return FALSE; } -BOOL GUIAPI IsUCharXDigit(UChar32 uc) +BOOL GUIAPI IsUCharXDigit(Uchar32 uc) { return ((uc >= 'a' && uc <= 'f') || (uc >= 'A' && uc <= 'F') || (TYPE(uc) == UCHAR_TYPE_DECIMAL_NUMBER)); } -BOOL GUIAPI IsUCharDefined(UChar32 uc) +BOOL GUIAPI IsUCharDefined(Uchar32 uc) { return !IS (TYPE(uc), OR (UCHAR_TYPE_UNASSIGNED, @@ -4532,7 +4532,7 @@ BOOL GUIAPI IsUCharDefined(UChar32 uc) 0))); } -BOOL GUIAPI IsUCharZeroWidth(UChar32 uc) +BOOL GUIAPI IsUCharZeroWidth(Uchar32 uc) { if (uc != 0x00AD && ISZEROWIDTHTYPE (TYPE(uc))) return TRUE; @@ -4543,7 +4543,7 @@ BOOL GUIAPI IsUCharZeroWidth(UChar32 uc) return FALSE; } -static inline BOOL g_unichar_iswide_bsearch (UChar32 ch) +static inline BOOL g_unichar_iswide_bsearch (Uchar32 ch) { unsigned int lower = 0; unsigned int upper = TABLESIZE (g_unicode_width_table_wide) - 1; @@ -4564,7 +4564,7 @@ static inline BOOL g_unichar_iswide_bsearch (UChar32 ch) return FALSE; } -BOOL GUIAPI IsUCharWide(UChar32 uc) +BOOL GUIAPI IsUCharWide(Uchar32 uc) { if (uc < g_unicode_width_table_wide[0].start) return FALSE; @@ -4574,7 +4574,7 @@ BOOL GUIAPI IsUCharWide(UChar32 uc) static int interval_compare (const void *key, const void *elt) { - UChar32 uc = (UChar32)((intptr_t)key); + Uchar32 uc = (Uchar32)((intptr_t)key); struct Interval *interval = (struct Interval *)elt; if (uc < interval->start) @@ -4585,7 +4585,7 @@ static int interval_compare (const void *key, const void *elt) return 0; } -BOOL GUIAPI IsUCharWideCJK (UChar32 uc) +BOOL GUIAPI IsUCharWideCJK (Uchar32 uc) { if (IsUCharWide(uc)) return TRUE; @@ -4608,11 +4608,11 @@ BOOL GUIAPI IsUCharWideCJK (UChar32 uc) /** * Converts a character to uppercase. */ -UChar32 UCharToUpper (UChar32 uc) +Uchar32 UCharToUpper (Uchar32 uc) { int t = TYPE (uc); if (t == UCHAR_TYPE_LOWERCASE_LETTER) { - UChar32 val = ATTTABLE (uc >> 8, uc & 0xff); + Uchar32 val = ATTTABLE (uc >> 8, uc & 0xff); if (val >= 0x1000000) { const unsigned char *p = special_case_table + val - 0x1000000; val = utf8_char_glyph_value (NULL, 0, p, -1); @@ -4637,11 +4637,11 @@ UChar32 UCharToUpper (UChar32 uc) /** * Converts a character to lower case. */ -UChar32 GUIAPI UCharToLower (UChar32 uc) +Uchar32 GUIAPI UCharToLower (Uchar32 uc) { int t = TYPE (uc); if (t == UCHAR_TYPE_UPPERCASE_LETTER) { - UChar32 val = ATTTABLE (uc >> 8, uc & 0xff); + Uchar32 val = ATTTABLE (uc >> 8, uc & 0xff); if (val >= 0x1000000) { const unsigned char *p = special_case_table + val - 0x1000000; return utf8_char_glyph_value (NULL, 0, p, -1); @@ -4665,7 +4665,7 @@ UChar32 GUIAPI UCharToLower (UChar32 uc) /** * Converts a glyph to the titlecase. */ -UChar32 GUIAPI UCharToTitle (UChar32 uc) +Uchar32 GUIAPI UCharToTitle (Uchar32 uc) { unsigned int i; for (i = 0; i < TABLESIZE (title_table); ++i) { @@ -4681,7 +4681,7 @@ UChar32 GUIAPI UCharToTitle (UChar32 uc) } /** Converts a glyph to full-width. */ -UChar32 GUIAPI UCharToFullWidth (UChar32 uc) +Uchar32 GUIAPI UCharToFullWidth (Uchar32 uc) { if (uc == 0x20) return 0x3000; @@ -4694,7 +4694,7 @@ UChar32 GUIAPI UCharToFullWidth (UChar32 uc) } /** Converts a glyph to single-width. */ -UChar32 GUIAPI UCharToSingleWidth (UChar32 uc) +Uchar32 GUIAPI UCharToSingleWidth (Uchar32 uc) { if (uc == 0x3000) return 0x20; @@ -4707,7 +4707,7 @@ UChar32 GUIAPI UCharToSingleWidth (UChar32 uc) } struct UCharMap { - UChar32 one, other; + Uchar32 one, other; }; static const struct UCharMap kana_small_to_full_size_table [] = { @@ -4763,7 +4763,7 @@ static const struct UCharMap kana_small_to_full_size_table [] = { }; /** Converts a glyph to full-size Kana. */ -UChar32 GUIAPI UCharToFullSizeKana (UChar32 uc) +Uchar32 GUIAPI UCharToFullSizeKana (Uchar32 uc) { unsigned int lower = 0; unsigned int upper = TABLESIZE (kana_small_to_full_size_table) - 1; @@ -4841,7 +4841,7 @@ static const struct UCharMap kana_full_size_to_small_table [] = { }; /** Converts a glyph to small Kana. */ -UChar32 GUIAPI UCharToSmallKana (UChar32 uc) +Uchar32 GUIAPI UCharToSmallKana (Uchar32 uc) { unsigned int lower = 0; unsigned int upper = TABLESIZE (kana_full_size_to_small_table) - 1; diff --git a/src/font/textops.c b/src/font/textops.c index dbcda7af..88c70e2c 100644 --- a/src/font/textops.c +++ b/src/font/textops.c @@ -239,7 +239,7 @@ int GUIAPI MB2WCEx (PLOGFONT log_font, void* dest, BOOL wc32, DEVFONT* devfont; int len_cur_char = 0; Glyph32 glyph_value; - UChar32 uc32; + Uchar32 uc32; if (mbc_devfont) { len_cur_char = mbc_devfont->charset_ops->len_first_char (mchar, n); @@ -263,15 +263,15 @@ int GUIAPI MB2WCEx (PLOGFONT log_font, void* dest, BOOL wc32, uc32 = glyph_value; if (wc32) { - UChar32* uchar32 = (UChar32*)dest; + Uchar32* uchar32 = (Uchar32*)dest; *uchar32 = uc32; } else { - UChar16* uchar16 = (UChar16*)dest; + Uchar16* uchar16 = (Uchar16*)dest; if (uc32 > 0xFFFF) *uchar16 = 0xFEFF; else - *uchar16 = (UChar16)uc32; + *uchar16 = (Uchar16)uc32; } } return len_cur_char; @@ -280,7 +280,7 @@ int GUIAPI MB2WCEx (PLOGFONT log_font, void* dest, BOOL wc32, return -1; } -int GUIAPI WC2MBEx (PLOGFONT log_font, unsigned char *s, UChar32 wc) +int GUIAPI WC2MBEx (PLOGFONT log_font, unsigned char *s, Uchar32 wc) { DEVFONT* mbc_devfont = log_font->mbc_devfont; DEVFONT* sbc_devfont = log_font->sbc_devfont; @@ -315,10 +315,10 @@ int GUIAPI MBS2WCSEx (PLOGFONT log_font, void* dest, BOOL wc32, DEVFONT* sbc_devfont = log_font->sbc_devfont; DEVFONT* devfont; int left, count = 0; - UChar32* uchar32; - UChar16* uchar16; + Uchar32* uchar32; + Uchar16* uchar16; Glyph32 glyph_value; - UChar32 uc32; + Uchar32 uc32; if (conved_mstr_len) *conved_mstr_len = 0; @@ -328,10 +328,10 @@ int GUIAPI MBS2WCSEx (PLOGFONT log_font, void* dest, BOOL wc32, if (wc32) { uchar16 = NULL; - uchar32 = (UChar32*)dest; + uchar32 = (Uchar32*)dest; } else { - uchar16 = (UChar16*)dest; + uchar16 = (Uchar16*)dest; uchar32 = NULL; } @@ -384,7 +384,7 @@ int GUIAPI MBS2WCSEx (PLOGFONT log_font, void* dest, BOOL wc32, if (uc32 > 0xFFFF) uchar16 [count] = 0xFEFF; else - uchar16 [count] = (UChar16)uc32; + uchar16 [count] = (Uchar16)uc32; } count++; @@ -410,9 +410,9 @@ int GUIAPI WCS2MBSEx (PLOGFONT log_font, unsigned char* dest, DEVFONT* sbc_devfont = log_font->sbc_devfont; int wc_count = 0, count = 0; unsigned char mchar [16] = {0}; - const UChar32* uchar32; - const UChar16* uchar16; - UChar32 uc32; + const Uchar32* uchar32; + const Uchar16* uchar16; + Uchar32 uc32; if (conved_wcs_len) *conved_wcs_len = 0; @@ -422,10 +422,10 @@ int GUIAPI WCS2MBSEx (PLOGFONT log_font, unsigned char* dest, if (wc32) { uchar16 = NULL; - uchar32 = (UChar32*)wcs; + uchar32 = (Uchar32*)wcs; } else { - uchar16 = (UChar16*)wcs; + uchar16 = (Uchar16*)wcs; uchar32 = NULL; } diff --git a/src/font/unicode-comp.c b/src/font/unicode-comp.c index a4414591..7cb1778c 100644 --- a/src/font/unicode-comp.c +++ b/src/font/unicode-comp.c @@ -63,7 +63,7 @@ ? CC_PART2 (((Char) - 0xe0000) >> 8, (Char) & 0xff) \ : 0)) -int UCharCombiningClass (UChar32 uc) +int UCharCombiningClass (Uchar32 uc) { return COMBINING_CLASS (uc); } @@ -79,7 +79,7 @@ int UCharCombiningClass (UChar32 uc) #define NCount (VCount * TCount) #define SCount (LCount * NCount) -void UCharCanonicalOrdering (UChar32 *string, int len) +void UCharCanonicalOrdering (Uchar32 *string, int len) { int i; int swap = 1; @@ -98,7 +98,7 @@ void UCharCanonicalOrdering (UChar32 *string, int len) /* Percolate item leftward through string. */ for (j = i + 1; j > 0; --j) { - UChar32 t; + Uchar32 t; if (COMBINING_CLASS (string[j - 1]) <= next) break; t = string[j]; @@ -119,7 +119,7 @@ void UCharCanonicalOrdering (UChar32 *string, int len) * r should be null or have sufficient space. Calling with r == NULL will * only calculate the result_len; however, a buffer with space for three * characters will always be big enough. */ -static void decompose_hangul (UChar32 s, UChar32 *r, int *result_len) +static void decompose_hangul (Uchar32 s, Uchar32 *r, int *result_len) { int SIndex = s - SBase; int TIndex = SIndex % TCount; @@ -141,7 +141,7 @@ static void decompose_hangul (UChar32 s, UChar32 *r, int *result_len) } /* returns a pointer to a null-terminated UTF-8 string */ -static const unsigned char * find_decomposition (UChar32 ch, BOOL compat) +static const unsigned char * find_decomposition (Uchar32 ch, BOOL compat) { int start = 0; int end = TABLESIZE (decomp_table); @@ -179,7 +179,7 @@ static const unsigned char * find_decomposition (UChar32 ch, BOOL compat) } /* L,V => LV and LV,T => LVT */ -static BOOL combine_hangul (UChar32 a, UChar32 b, UChar32 *result) +static BOOL combine_hangul (Uchar32 a, Uchar32 b, Uchar32 *result) { int LIndex = a - LBase; int SIndex = a - SBase; @@ -209,7 +209,7 @@ static BOOL combine_hangul (UChar32 a, UChar32 b, UChar32 *result) #define COMPOSE_INDEX(Char) \ (((Char >> 8) > (COMPOSE_TABLE_LAST)) ? 0 : CI((Char) >> 8, (Char) & 0xff)) -static BOOL combine (UChar32 a, UChar32 b, UChar32 *result) +static BOOL combine (Uchar32 a, Uchar32 b, Uchar32 *result) { unsigned short index_a, index_b; @@ -245,7 +245,7 @@ static BOOL combine (UChar32 a, UChar32 b, UChar32 *result) if (index_a >= COMPOSE_FIRST_START && index_a < COMPOSE_FIRST_SINGLE_START && index_b >= COMPOSE_SECOND_START && index_b < COMPOSE_SECOND_SINGLE_START) { - UChar32 res = compose_array[index_a - COMPOSE_FIRST_START][index_b - COMPOSE_SECOND_START]; + Uchar32 res = compose_array[index_a - COMPOSE_FIRST_START][index_b - COMPOSE_SECOND_START]; if (res) { @@ -257,7 +257,7 @@ static BOOL combine (UChar32 a, UChar32 b, UChar32 *result) return FALSE; } -static BOOL decompose_hangul_step (UChar32 ch, UChar32 *a, UChar32 *b) +static BOOL decompose_hangul_step (Uchar32 ch, Uchar32 *a, Uchar32 *b) { int SIndex, TIndex; @@ -281,7 +281,7 @@ static BOOL decompose_hangul_step (UChar32 ch, UChar32 *a, UChar32 *b) return TRUE; } -BOOL UCharDecompose (UChar32 ch, UChar32 *a, UChar32 *b) +BOOL UCharDecompose (Uchar32 ch, Uchar32 *a, Uchar32 *b) { int start = 0; int end = TABLESIZE (decomp_step_table); @@ -318,7 +318,7 @@ BOOL UCharDecompose (UChar32 ch, UChar32 *a, UChar32 *b) return FALSE; } -BOOL UCharCompose (UChar32 a, UChar32 b, UChar32 *ch) +BOOL UCharCompose (Uchar32 a, Uchar32 b, Uchar32 *ch) { if (combine (a, b, ch)) return TRUE; @@ -382,15 +382,15 @@ for ((Count) = 1; (Count) < (Len); ++(Count)) \ (Result) |= ((Chars)[(Count)] & 0x3f); \ } -static UChar32 utf8_to_uchar32 (const unsigned char *p) +static Uchar32 utf8_to_uchar32 (const unsigned char *p) { int i, mask = 0, len; - UChar32 result; + Uchar32 result; unsigned char c = (unsigned char) *p; UTF8_COMPUTE (c, mask, len); if (len == -1) - return (UChar32)-1; + return (Uchar32)-1; UTF8_GET (result, p, i, mask, len); return result; @@ -447,7 +447,7 @@ static int utf8_strlen (const unsigned char *p, int max) return len; } -int UCharFullyDecompose (UChar32 ch, BOOL compat, UChar32 *result, int result_len) +int UCharFullyDecompose (Uchar32 ch, BOOL compat, Uchar32 *result, int result_len) { const unsigned char *decomp; const unsigned char *p; @@ -455,7 +455,7 @@ int UCharFullyDecompose (UChar32 ch, BOOL compat, UChar32 *result, int result_l /* Hangul syllable */ if (ch >= SBase && ch < SBase + SCount) { int len, i; - UChar32 buffer[3]; + Uchar32 buffer[3]; decompose_hangul (ch, result ? buffer : NULL, &len); if (result) for (i = 0; i < len && i < result_len; i++) diff --git a/src/gui/keyboard.c b/src/gui/keyboard.c index 8a680ed5..84e18a3e 100644 --- a/src/gui/keyboard.c +++ b/src/gui/keyboard.c @@ -681,9 +681,9 @@ BOOL GUIAPI TranslateKeyMsgToChar (int message, WPARAM wParam, LPARAM lParam, WO #ifdef _MGCHARSET_UNICODE -static UChar32 utf8_to_wc (const unsigned char* mstr, int* utf8_len) +static Uchar32 utf8_to_wc (const unsigned char* mstr, int* utf8_len) { - UChar32 wc = *((unsigned char *)(mstr++)); + Uchar32 wc = *((unsigned char *)(mstr++)); int n, t; *utf8_len = 1; diff --git a/src/include/devfont.h b/src/include/devfont.h index b0b1de9b..4479e341 100644 --- a/src/include/devfont.h +++ b/src/include/devfont.h @@ -180,10 +180,10 @@ struct _CHARSETOPS #ifdef _MGCHARSET_UNICODE /** The method to convert \a mchar to 32 bit UNICODE function. */ - UChar32 (*conv_to_uc32) (Glyph32 glyph_value); + Uchar32 (*conv_to_uc32) (Glyph32 glyph_value); /** The method to convert \a wc to multily byte character function. */ - int (*conv_from_uc32) (UChar32 wc, unsigned char* mchar); + int (*conv_from_uc32) (Uchar32 wc, unsigned char* mchar); #endif /* _UNICODE_SUPPORT */ };