mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-02-07 02:52:42 +08:00
New API: GetNextUChar
This commit is contained in:
@@ -11624,6 +11624,30 @@ typedef Uint32 Glyph32;
|
||||
MG_EXPORT Achar32 GUIAPI GetACharValue (LOGFONT* logfont, const char* mchar,
|
||||
int mchar_len, const char* pre_mchar, int pre_len);
|
||||
|
||||
#ifdef _MGCHARSET_UNICODE
|
||||
|
||||
/**
|
||||
* \fn int GUIAPI GetNextUChar (LOGFONT* logfont, const char* mchar,
|
||||
* int mchar_len, Uchar32* uc)
|
||||
* \brief Get the Uchar32 value (Unicode code point) of a multi-byte character
|
||||
* in specified LOGFONT object.
|
||||
*
|
||||
* This function get the Uchar32 value of a mutil-byte character in specified
|
||||
* LOGFONT object \a logfont, which is under speicific charset/encoding.
|
||||
*
|
||||
* \param logfont The logical font.
|
||||
* \param mchar The pointer to the multi-byte character.
|
||||
* \param mchar_len The length of \a mchar in bytes.
|
||||
* \param uc The buffer to receive the Uchar32 value.
|
||||
*
|
||||
* \return The number of bytes consumed, i.e., the lenght of the
|
||||
* multi-byte character.
|
||||
*/
|
||||
MG_EXPORT int GUIAPI GetNextUChar(LOGFONT* logfont, const char* mchar,
|
||||
int mchar_len, Uchar32* uc);
|
||||
|
||||
#endif /* _MGCHARSET_UNICODE */
|
||||
|
||||
/**
|
||||
* \fn Uint32 GUIAPI GetACharType (LOGFONT* logfont, Achar32 chv)
|
||||
* \brief Retrieve the basic type, the general cateory of Unicode, and
|
||||
@@ -12348,7 +12372,7 @@ MG_EXPORT int GUIAPI GetUCharsUntilParagraphBoundary(LOGFONT* logfont,
|
||||
|
||||
/**
|
||||
* \fn AChar2UChar(LOGFONT* logfont, Achar32 chv)
|
||||
* \brief Get Uchar32 value (Unicode whide character value) from
|
||||
* \brief Get Uchar32 value (Unicode wide character value) from
|
||||
* a LOGFONT abstract character value.
|
||||
*
|
||||
* Only valid for UNICODE.
|
||||
@@ -12356,7 +12380,7 @@ MG_EXPORT int GUIAPI GetUCharsUntilParagraphBoundary(LOGFONT* logfont,
|
||||
* \param logfont The LOGFONT object
|
||||
* \param chv The LOGFONT character value.
|
||||
*
|
||||
* \return The Uchar32 value (Unicode code point) of the glyph.
|
||||
* \return The Uchar32 value (Unicode code point) of the abstract character.
|
||||
*
|
||||
* \note Only available when support for UNICODE is enabled.
|
||||
*
|
||||
|
||||
@@ -503,6 +503,9 @@ void GUIAPI DestroyLogFont (PLOGFONT logfont)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!logfont)
|
||||
return;
|
||||
|
||||
for (i = 0; i < MAXNR_DEVFONTS; i++) {
|
||||
DEVFONT* df = logfont->devfonts[i];
|
||||
if (df && df->font_ops->delete_instance)
|
||||
|
||||
@@ -5408,9 +5408,7 @@ BOOL GUIAPI DestroyWindow (HWND hWnd)
|
||||
|
||||
if (!IsControl (hWnd)) return FALSE;
|
||||
|
||||
if (SendMessage (hWnd, MSG_DESTROY, 0, 0))
|
||||
{
|
||||
|
||||
if (SendMessage (hWnd, MSG_DESTROY, 0, 0)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -5499,7 +5497,6 @@ BOOL GUIAPI DestroyWindow (HWND hWnd)
|
||||
--pCtrl->we_rdr->refcount;
|
||||
|
||||
free (pCtrl);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -1230,8 +1230,9 @@ int GUIAPI ThrowAwayMessages (HWND hWnd)
|
||||
for (slot = 0; slot < DEF_NR_TIMERS; slot++) {
|
||||
if (pMsgQueue->TimerMask & (0x01UL << slot)) {
|
||||
HWND timer_wnd = __mg_get_timer_hwnd (slot);
|
||||
if (timer_wnd == hWnd
|
||||
|| gui_GetMainWindowPtrOfControl (timer_wnd) == (PMAINWIN)hWnd){
|
||||
if (timer_wnd == hWnd
|
||||
|| (MG_IS_MAIN_WINDOW (hWnd) &&
|
||||
gui_GetMainWindowPtrOfControl (timer_wnd) == (PMAINWIN)hWnd)) {
|
||||
RemoveMsgQueueTimerFlag (pMsgQueue, slot);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -431,6 +431,8 @@ BOOL GUIAPI SetTimerEx (HWND hWnd, LINT id, DWORD speed,
|
||||
timerstr[slot]->tick_count = 0;
|
||||
timerstr[slot]->msg_queue = pMsgQueue;
|
||||
|
||||
_MG_PRINTF ("KERNEL>Timer: setup a new timer for window (%p) at slot (%d)\n", hWnd, slot);
|
||||
|
||||
#ifdef _MGRM_PROCESSES
|
||||
if (!mgIsServer)
|
||||
__mg_set_select_timeout (USEC_10MS * speed);
|
||||
|
||||
@@ -377,7 +377,7 @@ static int usctxt_push_back(struct ustr_ctxt* ctxt, Uchar32 uc)
|
||||
return ctxt->n;
|
||||
}
|
||||
|
||||
static int get_next_uchar(LOGFONT* lf, const char* mstr, int mstr_len,
|
||||
int GetNextUChar(LOGFONT* lf, const char* mstr, int mstr_len,
|
||||
Uchar32* uc)
|
||||
{
|
||||
int mclen = 0;
|
||||
@@ -426,7 +426,7 @@ static int is_next_mchar_bt(LOGFONT* lf,
|
||||
{
|
||||
int mclen;
|
||||
|
||||
mclen = get_next_uchar(lf, mstr, mstr_len, uc);
|
||||
mclen = GetNextUChar(lf, mstr, mstr_len, uc);
|
||||
if (mclen > 0 && UCharGetBreakType(*uc) == bt)
|
||||
return mclen;
|
||||
|
||||
@@ -449,7 +449,7 @@ static int collapse_space(LOGFONT* lf, const char* mstr, int mstr_len)
|
||||
do {
|
||||
int mclen;
|
||||
|
||||
mclen = get_next_uchar(lf, mstr, mstr_len, &uc);
|
||||
mclen = GetNextUChar(lf, mstr, mstr_len, &uc);
|
||||
if (mclen == 0)
|
||||
break;
|
||||
|
||||
@@ -504,7 +504,7 @@ int GUIAPI GetUCharsUntilParagraphBoundary(LOGFONT* logfont,
|
||||
int next_mclen;
|
||||
int cosumed_one_loop = 0;
|
||||
|
||||
mclen = get_next_uchar(logfont, mstr, mstr_len, &uc);
|
||||
mclen = GetNextUChar(logfont, mstr, mstr_len, &uc);
|
||||
if (mclen == 0) {
|
||||
// badly encoded or end of text
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user