UChar32 -> Uchar32; UChar16 -> Uchar16

This commit is contained in:
Vincent Wei
2019-01-18 13:56:18 +08:00
parent 3a02b056ca
commit f34ac9d0fe
8 changed files with 187 additions and 187 deletions

View File

@@ -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.

View File

@@ -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);

View File

@@ -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:

File diff suppressed because it is too large Load Diff

View File

@@ -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;
}

View File

@@ -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++)

View File

@@ -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;

View File

@@ -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 */
};