This commit is contained in:
Vincent Wei
2019-03-27 11:40:34 +08:00
parent 338fb0276e
commit db63d8cad3
14 changed files with 1383 additions and 1333 deletions
+8
View File
@@ -12773,6 +12773,14 @@ MG_EXPORT LAYOUTLINE* GUIAPI LayoutNextLine(LAYOUTINFO* layout_info,
int x, int y, int max_extent, BOOL last_line, SIZE* line_size,
CB_GLYPH_LAID_OUT cb_laid_out, GHANDLE ctxt);
/**
* Get layout line information
*/
MG_EXPORT BOOL GUIAPI GetLayoutLineInfo(LAYOUTLINE* line,
int* line_no, int* max_extent, int* nr_chars, int* nr_glyphs,
int** log_widths, int* width, int* height,
BOOL* is_ellipsized, BOOL* is_wrapped);
MG_EXPORT BOOL DrawShapedGlyph(HDC hdc, LOGFONT* lf, RGBCOLOR color,
Glyph32 gv, const GLYPHPOS* pos);
+141 -141
View File
File diff suppressed because it is too large Load Diff
+189 -189
View File
File diff suppressed because it is too large Load Diff
+32 -32
View File
@@ -1,33 +1,33 @@
/*
* This file is part of MiniGUI, a mature cross-platform windowing
* This file is part of MiniGUI, a mature cross-platform windowing
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
*
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* Or,
*
*
* As this program is a library, any link to this program must follow
* GNU General Public License version 3 (GPLv3). If you cannot accept
* GPLv3, you need to be licensed from FMSoft.
*
*
* If you have got a commercial license of this program, please use it
* under the terms and conditions of the commercial license.
*
*
* For more information about the commercial license, please refer to
* <http://www.minigui.com/en/about/licensing-policy/>.
*/
@@ -56,7 +56,7 @@
#include "ctrlmisc.h"
#include "progressbar_impl.h"
static void pbarNormalizeParams (const CONTROL* pCtrl,
static void pbarNormalizeParams (const CONTROL* pCtrl,
PROGRESSDATA* pData, BOOL fNotify)
{
if (pData->nPos >= pData->nMax) {
@@ -72,8 +72,8 @@ static void pbarNormalizeParams (const CONTROL* pCtrl,
}
}
static void
pbarOnNewPos (const CONTROL* pCtrl,
static void
pbarOnNewPos (const CONTROL* pCtrl,
PROGRESSDATA* pData, unsigned int new_pos)
{
unsigned int old_pos;
@@ -97,32 +97,32 @@ ProgressBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
HDC hdc;
PCONTROL pCtrl;
PROGRESSDATA* pData;
pCtrl = gui_Control (hwnd);
pCtrl = gui_Control (hwnd);
switch (message)
{
case MSG_CREATE:
if (!(pData = malloc (sizeof (PROGRESSDATA)))) {
_WRN_PRINTF ("CONTROL>ProgressBar: Create control failure!\n");
_WRN_PRINTF ("Create control failure!");
return -1;
}
pData->nMax = 100;
pData->nMin = 0;
pData->nPos = 0;
pData->nStepInc = 10;
pCtrl->dwAddData2 = (DWORD)pData;
break;
case MSG_DESTROY:
free ((void *)(pCtrl->dwAddData2));
break;
case MSG_NCPAINT:
return 0;
case MSG_GETDLGCODE:
return DLGC_STATIC;
@@ -135,8 +135,8 @@ ProgressBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PROGRESSDATA *data = (PROGRESSDATA *)pCtrl->dwAddData2;
hdc = BeginPaint (hwnd);
GetWindowInfo (hwnd)->we_rdr->draw_progress (hwnd,
hdc, data->nMax, data->nMin,
GetWindowInfo (hwnd)->we_rdr->draw_progress (hwnd,
hdc, data->nMax, data->nMin,
data->nPos, pCtrl->dwStyle & PBS_VERTICAL);
EndPaint (hwnd, hdc);
@@ -160,7 +160,7 @@ ProgressBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
InvalidateRect (hwnd, NULL, TRUE);
return PB_OKAY;
case PBM_SETSTEP:
pData = (PROGRESSDATA *)pCtrl->dwAddData2;
if ((int)wParam > (int)(pData->nMax - pData->nMin))
@@ -168,39 +168,39 @@ ProgressBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
pData->nStepInc = wParam;
return PB_OKAY;
case PBM_SETPOS:
pData = (PROGRESSDATA *)pCtrl->dwAddData2;
if (pData->nPos == wParam)
return PB_OKAY;
pbarOnNewPos (pCtrl, pData, wParam);
return PB_OKAY;
case PBM_DELTAPOS:
pData = (PROGRESSDATA *)pCtrl->dwAddData2;
if (wParam == 0)
return PB_OKAY;
pbarOnNewPos (pCtrl, pData, pData->nPos + wParam);
return PB_OKAY;
case PBM_STEPIT:
pData = (PROGRESSDATA *)pCtrl->dwAddData2;
if (pData->nStepInc == 0)
return PB_OKAY;
pbarOnNewPos (pCtrl, pData, pData->nPos + pData->nStepInc);
return PB_OKAY;
case MSG_FONTCHANGED:
InvalidateRect (hwnd, NULL, TRUE);
break;
}
return DefaultControlProc (hwnd, message, wParam, lParam);
}
@@ -212,7 +212,7 @@ BOOL RegisterProgressBarControl (void)
WndClass.dwStyle = WS_NONE;
WndClass.dwExStyle = WS_EX_NONE;
WndClass.hCursor = GetSystemCursor (0);
WndClass.iBkColor =
WndClass.iBkColor =
GetWindowElementPixel (HWND_NULL, WE_MAINC_THREED_BODY);
WndClass.WinProc = ProgressBarCtrlProc;
+142 -143
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -916,7 +916,7 @@ textdoc_insert_text (TextDoc *txtdoc, const char* newtext, int len)
/* insert last strings */
/* FIXME */
if (!nextnode) {
_WRN_PRINTF ("CONTROL>TextEdit: (Warning) nextnode is NULL!\n");
_WRN_PRINTF ("nextnode is NULL!");
/* set_current_node (txtdoc, LASTNODE(txtdoc), FALSE, TRUE); */
}
else {
@@ -1446,7 +1446,7 @@ static int get_line_nr (HWND hWnd, PTEDATA ptedata, TextNode *node, int indent)
HDC hdc;
if (!node) {
_WRN_PRINTF ("CONTROL>TextEdit: (Warning) pass NULL text node to get_line_nr\n");
_WRN_PRINTF ("pass NULL text node to get_line_nr");
return 0;
}
@@ -1571,7 +1571,7 @@ set_line_width (HWND hWnd, PTEDATA ptedata, TextNode *node, int indent)
HDC hdc;
if (!node) {
_WRN_PRINTF ("CONTROL>TextEdit: (Warning) pass NULL text node to set_line_width\n");
_WRN_PRINTF ("pass NULL text node to set_line_width");
return -1;
}
+64 -64
View File
@@ -1,33 +1,33 @@
/*
* This file is part of MiniGUI, a mature cross-platform windowing
* This file is part of MiniGUI, a mature cross-platform windowing
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
*
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* Or,
*
*
* As this program is a library, any link to this program must follow
* GNU General Public License version 3 (GPLv3). If you cannot accept
* GPLv3, you need to be licensed from FMSoft.
*
*
* If you have got a commercial license of this program, please use it
* under the terms and conditions of the commercial license.
*
*
* For more information about the commercial license, please refer to
* <http://www.minigui.com/en/about/licensing-policy/>.
*/
@@ -64,13 +64,13 @@ static void TrackBarOnDraw (HWND hwnd, HDC hdc, TRACKBARDATA* pData, DWORD dwSty
win_rdr = GetWindowInfo(hwnd)->we_rdr;
if (!win_rdr) {
_WRN_PRINTF ("CONTROL>TrackBar: window renderer is NULL.\n");
_WRN_PRINTF ("window renderer is NULL");
return;
}
GetClientRect (hwnd, &rc_client);
win_rdr->draw_trackbar (hwnd, hdc, (LFRDR_TRACKBARINFO *)pData);
win_rdr->draw_trackbar (hwnd, hdc, (LFRDR_TRACKBARINFO *)pData);
/* draw the tip of trackbar. */
if ((dwStyle & TBS_TIP) && !(dwStyle & TBS_VERTICAL)) {
@@ -79,7 +79,7 @@ static void TrackBarOnDraw (HWND hwnd, HDC hdc, TRACKBARDATA* pData, DWORD dwSty
RECT rc_bar, rc_border;
int sliderh, EndTipLen, x, y, w, h;
win_rdr->calc_trackbar_rect (hwnd, (LFRDR_TRACKBARINFO *)pData,
win_rdr->calc_trackbar_rect (hwnd, (LFRDR_TRACKBARINFO *)pData,
dwStyle, &rc_client, NULL, &rc_bar, &rc_border);
sliderh = RECTH (rc_bar);
@@ -88,23 +88,23 @@ static void TrackBarOnDraw (HWND hwnd, HDC hdc, TRACKBARDATA* pData, DWORD dwSty
w = RECTW (rc_border);
h = RECTH (rc_border);
SelectFont (hdc, (PLOGFONT)GetWindowElementAttr
SelectFont (hdc, (PLOGFONT)GetWindowElementAttr
(hwnd, WE_FONT_TOOLTIP));
SetBkMode (hdc, BM_TRANSPARENT);
SetBkColor (hdc, GetWindowBkColor (hwnd));
SetTextColor (hdc, GetWindowElementPixel (hwnd, WE_FGC_THREED_BODY));
TextOut (hdc, x + 1, y + (h>>1) - (sliderh>>1) - GAP_TIP_SLIDER,
TextOut (hdc, x + 1, y + (h>>1) - (sliderh>>1) - GAP_TIP_SLIDER,
pData->sStartTip);
GetTextExtent (hdc, pData->sEndTip, -1, &text_ext);
EndTipLen = text_ext.cx + 4;
TextOut (hdc, (EndTipLen > (w>>1) - 20 ? x + (w>>1) + 20 : x + w -EndTipLen),
y + (h>>1) - (sliderh>>1) - GAP_TIP_SLIDER, pData->sEndTip);
TextOut (hdc, (EndTipLen > (w>>1) - 20 ? x + (w>>1) + 20 : x + w -EndTipLen),
y + (h>>1) - (sliderh>>1) - GAP_TIP_SLIDER, pData->sEndTip);
sprintf (sPos, "%d", pData->nPos);
GetTextExtent (hdc, sPos, -1, &text_ext);
TextOut (hdc, x + ((w - text_ext.cx) >> 1),
TextOut (hdc, x + ((w - text_ext.cx) >> 1),
y + (h>>1) -(sliderh>>1) - GAP_TIP_SLIDER, sPos);
}
}
@@ -137,23 +137,23 @@ static void SetSliderPos (const CONTROL* pCtrl, int new_pos)
RECT rc_client, old_slider, new_slider;
if (new_pos > pData->nMax)
new_pos = pData->nMax;
new_pos = pData->nMax;
if (new_pos < pData->nMin)
new_pos = pData->nMin;
new_pos = pData->nMin;
if (pData->nPos == new_pos)
if (pData->nPos == new_pos)
return;
GetClientRect ((HWND)pCtrl, &rc_client);
pCtrl->we_rdr->calc_trackbar_rect ((HWND)pCtrl, (LFRDR_TRACKBARINFO *)pData,
pCtrl->we_rdr->calc_trackbar_rect ((HWND)pCtrl, (LFRDR_TRACKBARINFO *)pData,
pCtrl->dwStyle, &rc_client, NULL, &old_slider, NULL);
pData->nPos = new_pos;
TrackBarNormalizeParams (pCtrl, pData, pCtrl->dwStyle & TBS_NOTIFY);
pCtrl->we_rdr->calc_trackbar_rect ((HWND)pCtrl, (LFRDR_TRACKBARINFO *)pData,
pCtrl->we_rdr->calc_trackbar_rect ((HWND)pCtrl, (LFRDR_TRACKBARINFO *)pData,
pCtrl->dwStyle, &rc_client, NULL, &new_slider, NULL);
if (pCtrl->dwStyle & TBS_TIP) {
@@ -180,7 +180,7 @@ static int NormalizeMousePos (HWND hwnd, TRACKBARDATA* pData, int mousepos)
dwStyle = GetWindowStyle (hwnd);
win_rdr = GetWindowInfo(hwnd)->we_rdr;
win_rdr->calc_trackbar_rect (hwnd, (LFRDR_TRACKBARINFO *)pData,
win_rdr->calc_trackbar_rect (hwnd, (LFRDR_TRACKBARINFO *)pData,
dwStyle, &rcClient, NULL, &rcBar, NULL);
if (dwStyle & TBS_VERTICAL) {
@@ -212,12 +212,12 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
PCONTROL pCtrl;
TRACKBARDATA* pData;
pCtrl = gui_Control (hwnd);
switch (message)
{
case MSG_CREATE:
if (!(pData = malloc (sizeof (TRACKBARDATA)))) {
_WRN_PRINTF ("CONTROL>TrackBar: Create control failure!\n");
_WRN_PRINTF ("Create control failure!");
return -1;
}
pData->nMax = 10;
@@ -230,14 +230,14 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
pData->nTickFreq = 1;
pCtrl->dwAddData2 = (DWORD)pData;
break;
case MSG_DESTROY:
free((void *)(pCtrl->dwAddData2));
break;
case MSG_NCPAINT:
return 0;
case MSG_GETTEXTLENGTH:
case MSG_GETTEXT:
case MSG_SETTEXT:
@@ -272,15 +272,15 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
SendMessage (hwnd, TBM_SETPOS, pData->nPos, 0);
return 0;
}
case TBM_GETMIN:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
return pData->nMin;
case TBM_GETMAX:
case TBM_GETMAX:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
return pData->nMax;
case TBM_SETMIN:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
@@ -292,7 +292,7 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
pData->nPos = pData->nMin;
SendMessage (hwnd, TBM_SETPOS, pData->nPos, 0);
return 0;
case TBM_SETMAX:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
@@ -304,7 +304,7 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
pData->nPos = pData->nMax;
SendMessage (hwnd, TBM_SETPOS, pData->nPos, 0);
return 0;
case TBM_SETLINESIZE:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
if (wParam > (pData->nMax - pData->nMin))
@@ -315,26 +315,26 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
case TBM_GETLINESIZE:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
return pData->nLineSize;
case TBM_SETPAGESIZE:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
if (wParam > (pData->nMax - pData->nMin))
return -1;
pData->nPageSize = wParam;
return 0;
case TBM_GETPAGESIZE:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
return pData->nPageSize;
case TBM_SETPOS:
SetSliderPos (pCtrl, wParam);
return 0;
case TBM_GETPOS:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
return pData->nPos;
case TBM_SETTICKFREQ:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
if (wParam > (pData->nMax - pData->nMin))
@@ -346,10 +346,10 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
case TBM_GETTICKFREQ:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
return pData->nTickFreq;
case TBM_SETTIP:
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
if (wParam)
if (wParam)
strncpy(pData->sStartTip, (char *) wParam, TBLEN_TIP);
if (lParam)
strncpy (pData->sEndTip, (char *) lParam, TBLEN_TIP);
@@ -363,19 +363,19 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if (lParam)
strcpy ((char *) lParam, pData->sEndTip);
return 0;
case MSG_SETFOCUS:
if (pCtrl->dwStyle & TBS_FOCUS)
break;
pCtrl->dwStyle |= TBS_FOCUS;
InvalidateRect (hwnd, NULL, TRUE);
break;
case MSG_KILLFOCUS:
pCtrl->dwStyle &= ~TBS_FOCUS;
InvalidateRect (hwnd, NULL, TRUE);
break;
case MSG_GETDLGCODE:
return DLGC_WANTARROWS;
@@ -406,21 +406,21 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
case SCANCODE_CURSORBLOCKLEFT:
SetSliderPos (pCtrl, pData->nPos - pData->nLineSize);
break;
case SCANCODE_PAGEDOWN:
SetSliderPos (pCtrl, pData->nPos - pData->nPageSize);
break;
case SCANCODE_PAGEUP:
SetSliderPos (pCtrl, pData->nPos + pData->nPageSize);
break;
case SCANCODE_HOME:
pData->nPos = pData->nMin;
TrackBarNormalizeParams (pCtrl, pData, pCtrl->dwStyle & TBS_NOTIFY);
InvalidateRect (hwnd, NULL, TRUE);
break;
case SCANCODE_END:
pData->nPos = pData->nMax;
TrackBarNormalizeParams (pCtrl, pData, pCtrl->dwStyle & TBS_NOTIFY);
@@ -433,9 +433,9 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if (GetCapture() != hwnd) {
int mouseX = LOSWORD(lParam);
int mouseY = HISWORD(lParam);
/** set state to press slider */
pCtrl->dwStyle |= LFRDR_TBS_PRESSED;
/** set state to press slider */
pCtrl->dwStyle |= LFRDR_TBS_PRESSED;
SetCapture (hwnd);
@@ -448,7 +448,7 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
(pCtrl->dwStyle & TBS_VERTICAL)?mouseY:mouseX));
}
break;
case MSG_MOUSEMOVE:
{
/** hilite slider */
@@ -461,16 +461,16 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
pData = (TRACKBARDATA *)pCtrl->dwAddData2;
GetClientRect (hwnd, &rc_client);
pCtrl->we_rdr->calc_trackbar_rect (hwnd, (LFRDR_TRACKBARINFO *)pData,
pCtrl->we_rdr->calc_trackbar_rect (hwnd, (LFRDR_TRACKBARINFO *)pData,
pCtrl->dwStyle, &rc_client, NULL, &rc_slider, NULL);
if (GetCapture() == hwnd)
{
ScreenToClient (hwnd, &mouseX, &mouseY);
if (PtInRect (&rc_slider, mouseX, mouseY))
pCtrl->dwStyle |= LFRDR_TBS_HILITE;
else
pCtrl->dwStyle &= ~LFRDR_TBS_HILITE;
pCtrl->dwStyle |= LFRDR_TBS_HILITE;
else
pCtrl->dwStyle &= ~LFRDR_TBS_HILITE;
}
else
{
@@ -479,16 +479,16 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
/** avoid twinkle by valid redraw */
if (!(pCtrl->dwStyle & LFRDR_TBS_HILITE))
{
pCtrl->dwStyle |= LFRDR_TBS_HILITE;
pCtrl->dwStyle |= LFRDR_TBS_HILITE;
InvalidateRect (hwnd, NULL, TRUE);
}
}
else
else
{
/** avoid twinkle by valid redraw */
if (pCtrl->dwStyle & LFRDR_TBS_HILITE)
{
pCtrl->dwStyle &= ~LFRDR_TBS_HILITE;
pCtrl->dwStyle &= ~LFRDR_TBS_HILITE;
InvalidateRect (hwnd, NULL, TRUE);
}
}
@@ -503,8 +503,8 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
case MSG_LBUTTONUP:
if (GetCapture() == hwnd) {
/** set state to press slider */
pCtrl->dwStyle &= ~LFRDR_TBS_PRESSED;
/** set state to press slider */
pCtrl->dwStyle &= ~LFRDR_TBS_PRESSED;
ReleaseCapture ();
NotifyParent ((HWND)pCtrl, pCtrl->id, TBN_STOPDRAG);
@@ -512,15 +512,15 @@ static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
InvalidateRect (hwnd, NULL, TRUE);
}
break;
case MSG_FONTCHANGED:
InvalidateRect (hwnd, NULL, TRUE);
return 0;
default:
break;
break;
}
return DefaultControlProc (hwnd, message, wParam, lParam);
}
+10 -10
View File
@@ -226,70 +226,70 @@ BOOL mg_InitControlClass ()
#ifdef _MGCTRL_TREEVIEW
if (!RegisterTreeViewControl ()) {
_WRN_PRINTF ("Init MiniGUI control error: TreeView.\n");
_WRN_PRINTF ("Init MiniGUI control error: TreeView");
return FALSE;
}
#endif
#ifdef _MGCTRL_TREEVIEW_RDR
if (!RegisterTreeViewRdrControl ()) {
_WRN_PRINTF ("Init MiniGUI control error: TreeView_rdr.\n");
_WRN_PRINTF ("Init MiniGUI control error: TreeView_rdr");
return FALSE;
}
#endif
#ifdef _MGCTRL_MONTHCAL
if (!RegisterMonthCalendarControl ()) {
_WRN_PRINTF ("Init MiniGUI control error: MonthCalendar.\n");
_WRN_PRINTF ("Init MiniGUI control error: MonthCalendar");
return FALSE;
}
#endif
#ifdef _MGCTRL_SPINBOX
if (!RegisterSpinControl ()) {
_WRN_PRINTF ("Init MiniGUI control error: Spin.\n");
_WRN_PRINTF ("Init MiniGUI control error: Spin");
return FALSE;
}
#endif
#ifdef _MGCTRL_COOLBAR
if (!RegisterCoolBarControl ()) {
_WRN_PRINTF ("Init MiniGUI control error: CoolBar.\n");
_WRN_PRINTF ("Init MiniGUI control error: CoolBar");
return FALSE;
}
#endif
#ifdef _MGCTRL_LISTVIEW
if (!RegisterListViewControl ()) {
_WRN_PRINTF ("Init MiniGUI control error: ListView.\n");
_WRN_PRINTF ("Init MiniGUI control error: ListView");
return FALSE;
}
#endif
#ifdef _MGCTRL_GRIDVIEW
if (!RegisterGridViewControl ()) {
_WRN_PRINTF ("Init MiniGUI control error: GridView.\n");
_WRN_PRINTF ("Init MiniGUI control error: GridView");
return FALSE;
}
#endif
#ifdef _MGCTRL_ICONVIEW
if (!RegisterIconViewControl ()) {
_WRN_PRINTF ("Init MiniGUI control error: IconView.\n");
_WRN_PRINTF ("Init MiniGUI control error: IconView");
return FALSE;
}
#endif
#ifdef _MGCTRL_ANIMATION
if (!RegisterAnimationControl ()) {
_WRN_PRINTF ("Init MiniGUI control error: Animation.\n");
_WRN_PRINTF ("Init MiniGUI control error: Animation");
return FALSE;
}
#endif
#ifdef _MGCTRL_SCROLLBAR
if (!RegisterScrollBarControl ()) {
_WRN_PRINTF ("Init MiniGUI control error: ScrollBar.\n");
_WRN_PRINTF ("Init MiniGUI control error: ScrollBar");
return FALSE;
}
#endif
+2 -2
View File
@@ -64,7 +64,7 @@ char* gui_GetIconFile(const char* rdr_name, char* file, char* _szValue)
if (GetMgEtcValue (rdr_name, file,
iconname, sizeof(szValue)-(iconname-szValue)) < 0 ) {
_WRN_PRINTF ("SYSRES: can't get %s's value from section %s in etc.\n",
_WRN_PRINTF ("can't get %s's value from section %s in etc.",
file, rdr_name);
return NULL;
}
@@ -81,7 +81,7 @@ BOOL gui_LoadIconRes(HDC hdc, const char* rdr_name, char* file)
if (LoadResource(szValue, RES_TYPE_ICON, (DWORD)hdc) != NULL)
return TRUE;
_WRN_PRINTF ("SYSRES: can't get %s's value from section %s in etc.\n",
_WRN_PRINTF ("can't get %s's value from section %s in etc.",
file, rdr_name);
return FALSE;
+15 -15
View File
@@ -605,30 +605,30 @@ void dump_window_element_data (HWND hwnd)
return;
if (pwnd->wed == NULL) {
_WRN_PRINTF ("GUI>DumpWED: No attributes in list.\n");
_DBG_PRINTF ("GUI>DumpWED: No attributes in list.\n");
return;
}
_WRN_PRINTF ("GUI>DumpWED: The attributes of window elements:\n");
_DBG_PRINTF ("GUI>DumpWED: The attributes of window elements:\n");
list_for_each (me, &pwnd->wed->list) {
wed = list_entry (me, WND_ELEMENT_DATA, list);
switch (wed->id & WE_ATTR_TYPE_MASK) {
case WE_ATTR_TYPE_FONT:
_WRN_PRINTF ("\tfont in list:%s-%s-%s.\n",
_DBG_PRINTF ("\tfont in list:%s-%s-%s.\n",
((PLOGFONT)(wed->data))->type,
((PLOGFONT)(wed->data))->family,
((PLOGFONT)(wed->data))->charset);
break;
case WE_ATTR_TYPE_METRICS:
_WRN_PRINTF ("\tmetrics in list:%d.\n", (int)wed->data);
_DBG_PRINTF ("\tmetrics in list:%d.\n", (int)wed->data);
break;
case WE_ATTR_TYPE_COLOR:
_WRN_PRINTF ("\tcolor in list: %p.\n", (PVOID)wed->data);
_DBG_PRINTF ("\tcolor in list: %p.\n", (PVOID)wed->data);
}
}
_WRN_PRINTF ("GUI>DumpWED: Done\n");
_DBG_PRINTF ("GUI>DumpWED: Done\n");
}
#endif /* _DEBUG */
@@ -714,16 +714,16 @@ DWORD GUIAPI GetWindowElementAttr (HWND hwnd, int we_attr_id)
return data;
}
gal_pixel GUIAPI
gal_pixel GUIAPI
GetWindowElementPixelEx (HWND hwnd, HDC hdc, int we_attr_id)
{
DWORD data;
Uint8 r, g, b, a;
HDC dc;
gal_pixel pixel;
if ((we_attr_id & WE_ATTR_TYPE_MASK) != WE_ATTR_TYPE_COLOR) {
_WRN_PRINTF ("GUI: Can't get color; invalid attr id: %x.\n", we_attr_id);
_WRN_PRINTF ("Can't get color; invalid attr id: %x.", we_attr_id);
return -1;
}
@@ -795,7 +795,7 @@ BOOL GUIAPI InitWindowElementAttrs (PWERENDERER rdr)
if (!rdr || !rdr->name || rdr->name[0] == '\0')
return FALSE;
_WRN_PRINTF ("GUI>InitWEA: Initialize %s renderer window element attributes.\n",
_DBG_PRINTF ("GUI>InitWEA: Initialize %s renderer window element attributes.\n",
rdr->name);
for (i = 0; i < WE_METRICS_NUMBER; i++) {
@@ -821,8 +821,8 @@ BOOL GUIAPI InitWindowElementAttrs (PWERENDERER rdr)
if (szCKeyNames[i][j]) {
if (GetMgEtcValue (rdr->name, szCKeyNames[i][j],
buff, 12) != ETC_OK) {
_WRN_PRINTF ("GUI>InitWEA: InitWindowElementAttrs error: \
Can not Get %s color. \n", szCKeyNames[i][j]);
_WRN_PRINTF ("InitWindowElementAttrs error: \
Can not Get %s color.", szCKeyNames[i][j]);
return FALSE;
}
@@ -847,11 +847,11 @@ BOOL mg_InitLFManager (void)
/** be sure to success initializing default renderer */
rdr = wnd_lf_info[0].wnd_rdr;
if (NULL == rdr)
if (NULL == rdr)
return FALSE;
if (rdr->init && 0 != rdr->init (rdr)) {
_WRN_PRINTF ("GUI>InitLFM: failed to initialize default renderer's private info.\n");
_WRN_PRINTF ("failed to initialize default renderer's private info.");
return FALSE;
}
@@ -863,7 +863,7 @@ BOOL mg_InitLFManager (void)
if (rdr->init && 0 != rdr->init (rdr)) {
wnd_lf_info[i].wnd_rdr = NULL;
_WRN_PRINTF ("GUI>InitLFM: fail to initialize renderer[%d]'s private info.\n", i);
_WRN_PRINTF ("failed to initialize renderer[%d]'s private info.", i);
continue;
}
}
+401 -401
View File
File diff suppressed because it is too large Load Diff
+325 -325
View File
File diff suppressed because it is too large Load Diff
+41 -3
View File
@@ -1508,8 +1508,8 @@ static void layout_line_postprocess (LAYOUTLINE *line,
justify_words (line, state);
}
line->layout->is_wrapped |= wrapped;
line->layout->is_ellipsized |= ellipsized;
line->is_wrapped |= wrapped;
line->is_ellipsized |= ellipsized;
}
static LAYOUTLINE* check_next_line(LAYOUTINFO* layout, LayoutState* state)
@@ -1706,7 +1706,7 @@ LAYOUTLINE* GUIAPI LayoutNextLine(
next_line = (LAYOUTLINE*)layout->lines.next;
goto out;
}
else if ((struct list_head*)prev_line != &layout->lines) {
else if (prev_line->list.next != &layout->lines) {
next_line = (LAYOUTLINE*)prev_line->list.next;
goto out;
}
@@ -1769,6 +1769,13 @@ LAYOUTLINE* GUIAPI LayoutNextLine(
}
if (next_line) {
next_line->max_extent = max_extent;
next_line->is_last_line = last_line;
if (prev_line == 0)
next_line->line_no = 0;
else
next_line->line_no = prev_line->line_no + 1;
if (layout->persist) {
list_add_tail(&next_line->list, &layout->lines);
}
@@ -1800,5 +1807,36 @@ out:
return next_line;
}
BOOL GUIAPI GetLayoutLineInfo(LAYOUTLINE* line,
int* line_no, int* max_extent, int* nr_chars, int* nr_glyphs,
int** log_widths, int* width, int* height,
BOOL* is_ellipsized, BOOL* is_wrapped)
{
if (line == NULL)
return FALSE;
if (line_no) *line_no = line->line_no;
if (max_extent) *max_extent = line->max_extent;
if (nr_chars) *nr_chars = line->len;
if (log_widths) *log_widths = line->log_widths;
if (nr_glyphs) {
struct list_head* i;
*nr_glyphs = 0;
list_for_each(i, &line->gruns) {
GlyphRun* run = (GlyphRun*)i;
*nr_glyphs += run->gstr->nr_glyphs;
}
}
if (width) *width = line->width;
if (height) *height = line->height;
if (is_ellipsized) *is_ellipsized = line->is_ellipsized;
if (is_wrapped) *is_wrapped = line->is_wrapped;
return TRUE;
}
#endif /* _MGCHARSET_UNICODE */
+10 -5
View File
@@ -97,10 +97,17 @@ struct _LAYOUTLINE {
int si; // the start index in the uchar string
int len; // the length of line (number of uchars)
int max_extent; // the max extent specified for this line
int nr_runs; // number of glyph/layout runs
int width; // actual width
int height; // actual height
int nr_runs;
Uint8 is_paragraph_start:1;// is first line of the paragraph?
Uint8 resolved_dir:3; // resolved direction of the line
Uint32 line_no:24; // line number (0 for the first line).
Uint32 resolved_dir:4; // resolved direction of the line
Uint32 is_paragraph_start:1;// is first line of the paragraph?
Uint32 is_last_line:1; // is the last line.
Uint32 is_wrapped:1; // is wrapped?
Uint32 is_ellipsized:1; // is ellipsized?
};
struct _LAYOUTINFO {
@@ -121,8 +128,6 @@ struct _LAYOUTINFO {
Uint32 persist:1; // persist lines?
Uint32 single_paragraph:1;
Uint32 is_wrapped:1;
Uint32 is_ellipsized:1;
};
typedef struct _GlyphRunIter GlyphRunIter;