4#include "core/SHostWnd.h"
6#include "helper/SColor.h"
7#include "helper/SplitString.h"
8#include "helper/STime.h"
9#include <helper/SHostMgr.h>
10#include <core/SHostPresenter.h>
13#pragma comment(lib, "imm32.lib")
22 SDummyWnd(SHostWnd *pOwner)
32 m_pOwner->OnPrint(NULL);
37 m_pOwner->m_dummyWnd = NULL;
40 virtual void OnFinalMessage(HWND hWnd)
45 BEGIN_MSG_MAP_EX(SDummyWnd)
47 MSG_WM_DESTROY(OnDestroy)
57 : m_hAppIconSmall(NULL)
66 DestroyIcon(m_hAppIconSmall);
68 DestroyIcon(m_hAppIconBig);
85 DestroyIcon(m_hAppIconSmall);
87 DestroyIcon(m_hAppIconBig);
88 m_hAppIconSmall = NULL;
110 rcRet.left =
m_rcMargin[0].toPixelSize(nScale);
111 rcRet.top =
m_rcMargin[1].toPixelSize(nScale);
112 rcRet.right =
m_rcMargin[2].toPixelSize(nScale);
113 rcRet.bottom =
m_rcMargin[3].toPixelSize(nScale);
120 szRet.cx =
m_szMin[0].toPixelSize(nScale);
121 szRet.cy =
m_szMin[1].toPixelSize(nScale);
155 Ani_win = (Ani_win_enter | Ani_win_exit),
157 Ani_All = (Ani_win | Ani_host),
161 : m_pHostWnd(pHostWnd)
173 m_pHostWnd->m_memRT->BeginDraw();
174 m_pHostWnd->m_memRT->ClearRect(rcWnd, 0);
175 m_pHostWnd->m_memRT->EndDraw();
185 if (pAni == m_aniEnter || pAni == m_aniExit)
187 m_pHostWnd->m_AniState &= ~Ani_win;
188 if (pAni == m_aniExit)
190 ULONG_PTR data = pAni->getUserData();
191 if (data == kAni4Destroy)
192 m_pHostWnd->SNativeWnd::DestroyWindow();
193 else if (data == kAni4Hide)
195 m_pHostWnd->SNativeWnd::SetWindowPos(NULL, 0, 0, 0, 0, SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER);
197 pAni->setUserData(0);
213 if (crTxt != CR_INVALID)
228 SIZE szAppSet = m_pHostWnd->m_szAppSetted;
229 if ((szAppSet.cx <= 0 || szAppSet.cy <= 0) &&
GetLayoutParam()->IsWrapContent(Any))
231 int nWid = szAppSet.cx;
236 int nHei = szAppSet.cy;
253 SStringT str = S_CW2T(
tr(m_pHostWnd->m_hostAttr.m_strTitle));
254 m_pHostWnd->SetWindowText(str);
274 while (rcSour.IsRectEmpty())
281 m_pHostWnd->OnRedraw(rcSour, FALSE);
291 EventMenuCmd evt(
this);
344 m_hostAnimationHandler.m_pHostWnd =
this;
373 SSLOGW() <<
"OnGetInitXmlNode return empty xml";
385 dwExStyle |= WS_EX_LAYERED;
387 dwExStyle |= WS_EX_COMPOSITED;
397 if ((nWidth == 0 || nHeight == 0) && (x == 0 && y == 0))
398 CenterWindow(hWndParent);
404 DWORD dwStyle = WS_CLIPCHILDREN;
406 dwStyle |= WS_TABSTOP;
407 return CreateEx(hWndParent, dwStyle, 0, x, y, nWidth, nHeight);
414 EventSwndSize *e2 = sobj_cast<EventSwndSize>(e);
416 CRect rcWnd(CPoint(), e2->szWnd);
417 rcWnd.InflateRect(
GetRoot()->GetStyle().GetMargin());
418 SetWindowPos(NULL, 0, 0, rcWnd.Width(), rcWnd.Height(), SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
445 SASSERT_MSGA(FALSE,
"Null XML node");
454 if (pUiDefInfo->
Init2(pNode, FALSE))
498 SStringT strSrc = S_CW2T(attrSrc.
value());
500 ParseResID(strSrc, lstSrc);
501 LPCTSTR pszType = NULL;
502 LPCTSTR pszName = NULL;
503 if (lstSrc.GetCount() == 2)
528 SStringA utf8Script = S_CW2A(strScript, CP_UTF8);
543 dwStyle |= WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_THICKFRAME;
547 dwStyle |= WS_MINIMIZEBOX;
551 dwStyle |= WS_SYSMENU;
552 dwExStyle |= WS_EX_APPWINDOW;
556 dwExStyle |= WS_EX_TOOLWINDOW;
560 dwStyle =
m_hostAttr.m_dwStyle & (~WS_VISIBLE);
564 ModifyStyle(0, dwStyle);
565 ModifyStyleEx(0, dwExStyle);
570 SendMessage(WM_SETICON, FALSE, (LPARAM)
m_hostAttr.m_hAppIconSmall);
574 SendMessage(WM_SETICON, TRUE, (LPARAM)
m_hostAttr.m_hAppIconBig);
594 SetWindowLongPtr(GWL_EXSTYLE, GetWindowLongPtr(GWL_EXSTYLE) | WS_EX_LAYERED);
596 HMONITOR hMonitor = MonitorFromWindow(
m_hWnd, MONITOR_DEFAULTTONEAREST);
597 MONITORINFO info = {
sizeof(MONITORINFO) };
598 GetMonitorInfo(hMonitor, &info);
599 SStringT dummyTitle = SStringT().Format(_T(
"%s_dummy"),
m_hostAttr.m_strTitle.c_str());
600 m_dummyWnd->CreateNative(dummyTitle, WS_POPUP, WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE, info.rcWork.left, info.rcWork.top, 1, 1,
m_hWnd, 0, NULL);
601 m_dummyWnd->SetWindowLongPtr(GWL_EXSTYLE, WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE | WS_EX_LAYERED);
602 ::SetLayeredWindowAttributes(
m_dummyWnd->m_hWnd, 0, 0, LWA_ALPHA);
603 if (IsWindowVisible())
610 else if (dwExStyle & WS_EX_LAYERED ||
GetRoot()->GetAlpha() != 0xFF)
616 if (!(dwExStyle & WS_EX_LAYERED))
619 ModifyStyleEx(0, WS_EX_LAYERED);
621 ModifyStyleEx(0, WS_EX_LAYERED | WS_EX_COMPOSITED);
624 SetLayeredWindowAttributes(0,
GetRoot()->GetAlpha(), LWA_ALPHA);
631 GETRENDERFACTORY->CreateRenderTarget(&
m_memRT, rcWnd.Width(), rcWnd.Height());
645 nWidth = SIZE_WRAP_CONTENT;
647 nHeight = SIZE_WRAP_CONTENT;
651 if (nWidth == 0 && pLayoutParam->IsSpecifiedSize(Horz))
655 if (nHeight == 0 && pLayoutParam->IsSpecifiedSize(Vert))
660 if (nWidth <= 0 || nHeight <= 0)
664 nWidth = SIZE_WRAP_CONTENT;
668 nHeight = SIZE_WRAP_CONTENT;
671 if (nWidth == SIZE_WRAP_CONTENT)
672 nWidth = szRoot.cx + szNc.cx;
673 if (nHeight == SIZE_WRAP_CONTENT)
674 nHeight = szRoot.cy + szNc.cy;
681 SetWindowPos(NULL, 0, 0, nWidth, nHeight, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
728 CRect rcWnd =
m_pRoot->GetWindowRect();
736 rcInvalid.IntersectRect(rcInvalid, rcWnd);
737 m_memRT->PushClipRegion(pRgnUpdate, RGN_COPY);
743 m_memRT->PushClipRect(&rcInvalid, RGN_COPY);
746 m_memRT->ClearRect(rcInvalid, 0);
752 m_memRT->RestoreClip(clipState);
763 if (!(
GetRoot()->IsLayoutDirty() || IsWindowVisible()))
794 ::GetClipBox(dc, &rcUpdate);
795 rcInvalid = rcInvalid | rcUpdate;
803 dc = ::BeginPaint(
m_hWnd, &ps);
819 return GETTOOLTIPFACTORY->CreateToolTip(
m_hWnd);
824 GETTOOLTIPFACTORY->DestroyToolTip(pTooltip);
837 SSLOGW() <<
"resId is empty";
860 GETRENDERFACTORY->CreateRenderTarget(&
m_memRT, rcWnd.Width(), rcWnd.Height());
884 SSLOGW() <<
"OnGetInitXmlNode return empty xml";
938 pRunnable->Release();
950 SetMsgHandled(FALSE);
954 if (size.cx == 0 || size.cy == 0)
957 BOOL bSizeChange = size !=
m_szPrev;
983 tme.cbSize =
sizeof(tme);
985 tme.dwFlags = TME_LEAVE;
989 OnMouseEvent(WM_MOUSEMOVE, nFlags, MAKELPARAM(point.x, point.y));
1002 if (nHitTest == HTCLIENT)
1006 ScreenToClient(&pt);
1007 return DoFrameEvent(WM_SETCURSOR, 0, MAKELPARAM(pt.x, pt.y)) != 0;
1041 ::KillTimer(
m_hWnd, idEvent);
1046 SetMsgHandled(FALSE);
1054 case WM_LBUTTONDOWN:
1055 case WM_LBUTTONDBLCLK:
1056 case WM_RBUTTONDOWN:
1057 case WM_RBUTTONDBLCLK:
1058 case WM_MBUTTONDOWN:
1059 case WM_MBUTTONDBLCLK:
1099 if (uMsg == WM_SYSKEYDOWN || uMsg == WM_SYSKEYUP)
1102 if (!pFocus || !(pFocus->
OnGetDlgCode() & SC_WANTSYSKEY))
1104 SetMsgHandled(FALSE);
1109 SetMsgHandled(
GetRoot()->IsMsgHandled());
1122 ScreenToClient(&pt);
1123 return DoFrameEvent(WM_MOUSEWHEEL, MAKEWPARAM(nFlags, zDelta), MAKELPARAM(pt.x, pt.y)) != 0;
1128 if (nState != WA_INACTIVE)
1146 EventCmd *e2 = sobj_cast<EventCmd>(evt);
1149 bool bSysBtn =
true;
1152 case SNcPainter::IDC_SYS_CLOSE:
1153 PostMessage(WM_SYSCOMMAND, SC_CLOSE);
1155 case SNcPainter::IDC_SYS_MIN:
1156 PostMessage(WM_SYSCOMMAND, SC_MINIMIZE);
1158 case SNcPainter::IDC_SYS_MAX:
1159 PostMessage(WM_SYSCOMMAND, SC_MAXIMIZE);
1161 case SNcPainter::IDC_SYS_RESTORE:
1162 PostMessage(WM_SYSCOMMAND, SC_RESTORE);
1186 byAlpha = (BYTE)((
int)byAlpha *
GetRoot()->GetAlpha() / 255);
1188 m_presenter->OnHostPresent(dc, pRT, rcInvalid, byAlpha);
1214 if (GetCapture() ==
m_hWnd)
1218 ScreenToClient(&pt);
1219 PostMessage(WM_MOUSEMOVE, 0, MAKELPARAM(pt.x, pt.y));
1256 if (!
m_hostAttr.m_bHasMsgLoop && GetCurrentMessage())
1289 ClientToScreen2(&rc2);
1297 HMONITOR hMonitor = ::MonitorFromWindow(
m_hWnd, MONITOR_DEFAULTTONULL);
1301 MONITORINFO mi = {
sizeof(MONITORINFO) };
1302 ::GetMonitorInfo(hMonitor, &mi);
1304 CRect rcWork = mi.rcWork, rcMonitor = mi.rcMonitor;
1306 lpMMI->ptMaxPosition.x = abs(rcWork.left - rcMonitor.left) - rcMaxInset.left;
1307 lpMMI->ptMaxPosition.y = abs(rcWork.top - rcMonitor.top) - rcMaxInset.top;
1308 lpMMI->ptMaxSize.x = abs(rcWork.Width()) + rcMaxInset.right + rcMaxInset.left;
1309 lpMMI->ptMaxSize.y = abs(rcWork.Height()) + rcMaxInset.bottom + rcMaxInset.top;
1310 lpMMI->ptMaxTrackSize.x = abs(rcWork.Width()) + rcMaxInset.right + rcMaxInset.left;
1311 lpMMI->ptMaxTrackSize.y = abs(rcWork.Height()) + rcMaxInset.bottom + rcMaxInset.top;
1313 lpMMI->ptMinTrackSize = CPoint(szMin.cx, szMin.cy);
1317 SetMsgHandled(FALSE);
1333 return S_OK == pRTDst->
BitBlt(&rcDst, pRTSrc, ptSrc.x, ptSrc.y, SRCCOPY);
1340 return ::AnimateWindow(
m_hWnd, dwTime, dwFlags);
1346 CRect rcShow(rcWnd);
1349 GETRENDERFACTORY->CreateRenderTarget(&pRT, rcShow.Width(), rcShow.Height());
1354 int nSteps = dwTime / 10;
1356 if (dwFlags & AW_HIDE)
1358 if (dwFlags & AW_SLIDE)
1360 LONG x1 = rcShow.left;
1361 LONG x2 = rcShow.left;
1362 LONG y1 = rcShow.top;
1363 LONG y2 = rcShow.top;
1364 LONG *x = &rcShow.left;
1365 LONG *y = &rcShow.top;
1367 if (dwFlags & AW_HOR_POSITIVE)
1369 x1 = rcShow.left, x2 = rcShow.right;
1372 else if (dwFlags & AW_HOR_NEGATIVE)
1374 x1 = rcShow.right, x2 = rcShow.left;
1377 if (dwFlags & AW_VER_POSITIVE)
1379 y1 = rcShow.top, y2 = rcShow.bottom;
1382 else if (dwFlags & AW_VER_NEGATIVE)
1384 y1 = rcShow.bottom, y2 = rcShow.top;
1387 LONG xStepLen = (x2 - x1) / nSteps;
1388 LONG yStepLen = (y2 - y1) / nSteps;
1390 for (
int i = 0; i < nSteps; i++)
1395 pRT->ClearRect(rcWnd, 0);
1397 if (dwFlags & AW_VER_NEGATIVE)
1398 ptAnchor.y = rcWnd.bottom - rcShow.Height();
1399 if (dwFlags & AW_HOR_NEGATIVE)
1400 ptAnchor.x = rcWnd.right - rcShow.Width();
1401 _BitBlt(pRT,
m_memRT, rcShow, ptAnchor);
1409 else if (dwFlags & AW_CENTER)
1411 int xStep = rcShow.Width() / (2 * nSteps);
1412 int yStep = rcShow.Height() / (2 * nSteps);
1413 for (
int i = 0; i < nSteps; i++)
1415 rcShow.DeflateRect(xStep, yStep);
1417 pRT->ClearRect(rcWnd, 0);
1418 _BitBlt(pRT,
m_memRT, rcShow, rcShow.TopLeft());
1426 else if (dwFlags & AW_BLEND)
1428 BYTE byAlpha2 = byAlpha;
1429 for (
int i = 0; i < nSteps; i++)
1431 byAlpha2 -= 255 / nSteps;
1442 pRT->ClearRect(rcWnd, 0);
1444 SetWindowPos(HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW | ((dwFlags & AW_ACTIVATE) ? 0 : SWP_NOACTIVATE));
1446 if (dwFlags & AW_SLIDE)
1448 LONG x1 = rcShow.left;
1449 LONG x2 = rcShow.left;
1450 LONG y1 = rcShow.top;
1451 LONG y2 = rcShow.top;
1452 LONG *x = &rcShow.left;
1453 LONG *y = &rcShow.top;
1455 if (dwFlags & AW_HOR_POSITIVE)
1457 x1 = rcShow.left, x2 = rcShow.right;
1458 rcShow.right = rcShow.left, x = &rcShow.right;
1460 else if (dwFlags & AW_HOR_NEGATIVE)
1462 x1 = rcShow.right, x2 = rcShow.left;
1463 rcShow.left = rcShow.right, x = &rcShow.left;
1465 if (dwFlags & AW_VER_POSITIVE)
1467 y1 = rcShow.top, y2 = rcShow.bottom;
1468 rcShow.bottom = rcShow.top, y = &rcShow.bottom;
1470 else if (dwFlags & AW_VER_NEGATIVE)
1472 y1 = rcShow.bottom, y2 = rcShow.top;
1473 rcShow.top = rcShow.bottom, y = &rcShow.top;
1475 LONG xStepLen = (x2 - x1) / nSteps;
1476 LONG yStepLen = (y2 - y1) / nSteps;
1478 for (
int i = 0; i < nSteps; i++)
1483 pRT->ClearRect(rcWnd, 0);
1485 if (dwFlags & AW_VER_POSITIVE)
1486 ptAnchor.y = rcWnd.bottom - rcShow.Height();
1487 if (dwFlags & AW_HOR_POSITIVE)
1488 ptAnchor.x = rcWnd.right - rcShow.Width();
1489 _BitBlt(pRT,
m_memRT, rcShow, ptAnchor);
1498 else if (dwFlags & AW_CENTER)
1500 int xStep = rcShow.Width() / (2 * nSteps);
1501 int yStep = rcShow.Height() / (2 * nSteps);
1502 rcShow.left = rcShow.right = (rcShow.left + rcShow.right) / 2;
1503 rcShow.top = rcShow.bottom = (rcShow.top + rcShow.bottom) / 2;
1504 for (
int i = 0; i < nSteps; i++)
1506 rcShow.InflateRect(xStep, yStep);
1508 pRT->ClearRect(rcWnd, 0);
1509 _BitBlt(pRT,
m_memRT, rcShow, rcShow.TopLeft());
1517 else if (dwFlags & AW_BLEND)
1520 for (
int i = 0; i < nSteps; i++)
1522 byAlpha2 += byAlpha / nSteps;
1539 if (bEmpty1 && !bEmpty2)
1551 if (!bEmpty1 && bEmpty2)
1567 tid = GetCurrentThreadId();
1571#if (!DISABLE_SWNDSPY)
1573LRESULT SHostWnd::OnSpyMsgSwndEnum(UINT uMsg, WPARAM wParam, LPARAM lParam)
1577 SWND swndCur = (SWND)wParam;
1589LRESULT SHostWnd::OnSpyMsgSwndSpy(UINT uMsg, WPARAM wParam, LPARAM lParam)
1593 SWND swndCur = (SWND)wParam;
1600 SWNDINFO *pSwndInfo =
new SWNDINFO;
1602 cds.dwData = SPYMSG_SWNDINFO;
1603 cds.cbData =
sizeof(SWNDINFO);
1604 cds.lpData = pSwndInfo;
1605 memset(pSwndInfo, 0,
sizeof(SWNDINFO));
1607 pSwndInfo->swnd = swndCur;
1610 pSwndInfo->bVisible = pSwnd->
IsVisible(TRUE);
1611 pSwndInfo->nID = pSwnd->
GetID();
1613 SStringW strTmp = pSwnd->
GetName();
1614 if (strTmp.
GetLength() <= SWND_MAX_NAME)
1615 wcscpy(pSwndInfo->szName, strTmp);
1617 wcscpy(pSwndInfo->szName, L
"##buf overflow!");
1620 if (strTmp.
GetLength() <= SWND_MAX_CLASS)
1621 wcscpy(pSwndInfo->szClassName, strTmp);
1623 wcscpy(pSwndInfo->szClassName, L
"##buf overflow!");
1625 wcscpy(pSwndInfo->szXmlStr, L
"##unavailable!");
1627 strTmp = pSwnd->m_strXml;
1629 wcscpy(pSwndInfo->szXmlStr, strTmp);
1631 wcscpy(pSwndInfo->szXmlStr, L
"##buf overflow!");
1633 ::SendMessage(m_hSpyWnd, WM_COPYDATA, (WPARAM)
m_hWnd, (LPARAM)&cds);
1638LRESULT SHostWnd::OnSpyMsgSetSpy(UINT uMsg, WPARAM wParam, LPARAM lParam)
1640 m_hSpyWnd = (HWND)lParam;
1641 if (!::IsWindow(m_hSpyWnd))
1649LRESULT SHostWnd::OnSpyMsgHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam)
1651 CPoint pt(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
1664 TCHAR szClassName[30];
1665 ::GetClassName(wnd, szClassName, 30);
1666 if (_tcscmp(szClassName, _T(
"CLIPBRDWNDCLASS")) == 0)
1697 if (
m_pRoot->m_aniExit && !IsIconic())
1699 m_pRoot->m_aniExit->setUserData(kAni4Destroy);
1746 SetMsgHandled(FALSE);
1750 if (!(lpWndPos->flags & SWP_NOMOVE))
1752 HMONITOR hMonitor = MonitorFromWindow(
m_hWnd, MONITOR_DEFAULTTONEAREST);
1753 MONITORINFO info = {
sizeof(MONITORINFO) };
1754 if (GetMonitorInfo(hMonitor, &info))
1756 m_dummyWnd->SetWindowPos(NULL, info.rcWork.left, info.rcWork.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
1759 if ((lpWndPos->flags & SWP_SHOWWINDOW))
1761 m_dummyWnd->SetWindowPos(NULL, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
1763 else if ((lpWndPos->flags & SWP_HIDEWINDOW))
1765 m_dummyWnd->SetWindowPos(NULL, 0, 0, 0, 0, SWP_HIDEWINDOW | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
1771#ifdef SOUI_ENABLE_ACC
1772 IAccessible *pAcc = NULL;
1773 DWORD dwObjectId = lParam;
1774 if (dwObjectId == OBJID_CLIENT)
1776 pAcc =
GetRoot()->GetAccessible();
1782 pAcc = pWnd->GetAccessible();
1787 return LresultFromObject(IID_IAccessible, wParam, pAcc);
1792 SetMsgHandled(FALSE);
1801 case WM_LBUTTONDOWN:
1802 case WM_LBUTTONDBLCLK:
1805 case WM_RBUTTONDOWN:
1806 case WM_RBUTTONDBLCLK:
1809 case WM_MBUTTONDOWN:
1810 case WM_MBUTTONDBLCLK:
1861 HMONITOR hMonitor = MonitorFromWindow(
m_hWnd, MONITOR_DEFAULTTONEAREST);
1862 MONITORINFO info = {
sizeof(MONITORINFO) };
1863 GetMonitorInfo(hMonitor, &info);
1864 rcParent = info.rcWork;
1867 m_hostAnimationHandler.m_rcInit = rcWnd;
1883 SSLOGD() <<
"unhandled xml node:" << xmlUser.
name();
1898 HIMC hImc = ImmGetContext(
m_hWnd);
1901 hImc = ImmCreateContext();
1902 ImmAssociateContext(
m_hWnd, hImc);
1907 HIMC hImc = ImmGetContext(
m_hWnd);
1908 ImmAssociateContext(
m_hWnd, NULL);
1911 ImmDestroyContext(hImc);
1921 PostMessage(WM_SETCURSOR, (WPARAM)
m_hWnd, MAKELPARAM(ht, WM_MOUSEMOVE));
1943 if (nID == SC_RESTORE)
1953 SetMsgHandled(TRUE);
2014 if (!rcCanvas.IsRectEmpty())
2041 if (nShowCmd != SW_HIDE)
2043 if (IsWindowVisible())
2054 bWaitAniDone = FALSE;
2060 if (!IsWindowVisible())
2067 m_pRoot->m_aniExit->setUserData(kAni4Hide);
2072 SNativeWnd::SetWindowPos(NULL, 0, 0, 0, 0, SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER);
2073 bWaitAniDone = FALSE;
2082 if (!msgLoop->WaitMsg())
2084 msgLoop->HandleMsg();
2091 if (uNotifyCode == 0)
2098 SetMsgHandled(FALSE);
2106 GetNcPainter()->GetRoot()->SDispatchMessage(UM_SETSCALE, nScale, 0);
2108 SetWindowPos(NULL, desRect->left, desRect->top, desRect->right - desRect->left, desRect->bottom - desRect->top, SWP_NOZORDER | SWP_NOACTIVATE);
2135 SendMessage(UM_RUN_TASKS);
2140 PostMessage(UM_RUN_TASKS);
2142 else if (tasks == 1)
2157 SPOSITION pos2 = pos;
2159 if (p->getObject() == pObj)
2170 SPOSITION pos2 = pos;
2172 if (p->getObject() == pObj)
2196 pRunnable->Release();
2217 IAnimation *pAni =
m_pHostWnd->m_hostAnimation;
2218 uint64_t tm = pAni->getStartTime();
2232 CRect rc2 = rc.toRect();
2233 ::SetWindowPos(
m_pHostWnd->m_hWnd, NULL, rc2.left, rc2.top, rc2.Width(), rc2.Height(), SWP_NOZORDER | SWP_NOACTIVATE);
2243 else if (
m_pHostWnd->GetExStyle() & WS_EX_LAYERED)
Header file for the SAutoBuf class, a smart buffer management class.
IMessageLoop * GetMsgLoop(tid_t tid=::GetCurrentThreadId()) SCONST OVERRIDE
Get the message loop for a specific thread.
IMsgLoopFactory * GetMsgLoopFactory() OVERRIDE
Get the message loop factory.
HRESULT CreateScriptModule(IScriptModule **ppScriptModule) OVERRIDE
Create a script module.
A smart buffer management class that automatically handles memory allocation and deallocation.
Auto-lock class for managing critical sections.
Smart pointer class for managing COM-style reference-counted objects.
BOOL subscribeEvent(DWORD dwEventID, const IEvtSlot &subscriber)
订阅事件
BOOL addEvent(DWORD dwEventID, LPCWSTR pszEventHandlerName)
添加一个新事件到事件集
bool RemoveHostMsgHandler(HWND hHost)
移除宿主窗口消息处理程序
bool AddHostMsgHandler(HWND hHost)
添加宿主窗口消息处理程序
Presenter class for the host window. This class manages the lifecycle and rendering of the host windo...
SHostWnd * m_pHostWnd
Pointer to the host window.
void OnNextFrame() OVERRIDE
Called on each frame of the animation.
CRect m_rcInit
Initial rectangle of the host window.
void SetSendWheel2Hover(bool value)
Sets whether wheel messages are sent to the hover window.
SLayoutSize m_rcMaxInset[4]
void SetTranslucent(bool bTranslucent)
Sets whether the window is translucent.
CSize GetMinSize(int nScale) const
Gets the minimum size of the window.
SLayoutSize m_rcMargin[4]
virtual LPCWSTR GetTrCtx() const
Gets the translation context.
~SHostWndAttr()
Destructor for SHostWndAttr.
void SetTrCtx(const SStringW &strTrCtx)
Sets the translation context.
CRect GetMaxInset(int nScale) const
Gets the maximum inset size of the window.
void Init()
Initializes the window attributes.
CRect GetMargin(int nScale) const
Gets the margin of the window.
SHostWndAttr(void)
Constructor for SHostWndAttr.
BOOL OnSetCursor(HWND hWnd, UINT nHitTest, UINT message)
Handles the WM_SETCURSOR message.
BOOL UnregisterTimelineHandler(ITimelineHandler *pHandler) OVERRIDE
Unregisters a timeline handler.
LRESULT OnKeyEvent(UINT uMsg, WPARAM wParam, LPARAM lParam)
Handles key events.
BOOL RegisterTimelineHandler(ITimelineHandler *pHandler) OVERRIDE
Registers a timeline handler.
EventHandlerInfo * GetEventHandler() OVERRIDE
Gets the event handler information for the host window.
void OnDestroy()
Handles the WM_DESTROY message.
virtual void OnHostAnimationStoped(IAnimation *pAni)
Called when the host window animation stops.
void _Init()
Initializes the host window.
CRect GetClientRect() const
Gets the client rectangle.
static void SetHideLocalUiDef(BOOL bHide)
Sets whether to hide local UI definitions globally.
void EnableHostPrivateUiDef(BOOL bEnable) OVERRIDE
Enables or disables host private UI definitions.
void OnRedraw(LPCRECT rc, BOOL bClip) OVERRIDE
Redraws the specified rectangle in the container.
void UpdatePresenter(HDC dc, IRenderTarget *pRT, LPCRECT rc, BYTE byAlpha=255, UINT uFlag=0)
Updates the presenter.
void EnableDragDrop() OVERRIDE
Enables drag-and-drop functionality for the host window.
LRESULT OnActivateApp(UINT uMsg, WPARAM wParam, LPARAM lParam)
Handles the WM_ACTIVATEAPP message.
BOOL ShowWindow(int nCmdShow) OVERRIDE
Shows or hides the host window.
EventHandlerInfo m_evtHandler
SAutoRefPtr< IUiDefInfo > m_privateUiDefInfo
void OnSysCommand(UINT nID, CPoint lParam)
Handles the WM_SYSCOMMAND message.
BOOL IsTranslucent() SCONST OVERRIDE
Checks if the host window is translucent.
virtual ~SHostWnd()
Destructor for SHostWnd.
void _Invalidate(LPCRECT prc)
Invalidates a specific region of the window.
BOOL InitFromXml(IXmlNode *pNode) OVERRIDE
Initializes the host window from an XML node.
SNativeWnd * GetNative()
Gets the native window interface.
BOOL OnEraseBkgnd(HDC dc)
Handles the WM_ERASEBKGND message.
virtual BOOL onRootResize(IEvtArgs *e)
Handles the resize event of the root window.
virtual IToolTip * CreateTooltip() const
Creates a tooltip for the container.
LRESULT OnGetObject(UINT uMsg, WPARAM wParam, LPARAM lParam)
Handles the WM_GETOBJECT message.
void _RedrawRegion(IRegionS *pRgn, CRect &rcInvalid)
Redraws a specific region of the window.
virtual SRootWindow * CreateRoot()
Creates the root window.
BOOL OnFireEvent(IEvtArgs *evt) OVERRIDE
Fires an event in the container.
BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
Handles the WM_MOUSEWHEEL message.
void SetToolTip(LPCRECT rc, UINT tipAlign, LPCTSTR pszTip) OVERRIDE
Sets the tooltip for the container.
SList< IRunnable * > m_runnables
SAutoRefPtr< IRenderTarget > m_memRT
void _RestoreClickState()
Restores the click state of the window.
SHostWnd(LPCWSTR pszResName=NULL)
Constructs a SHostWnd object with an optional resource name.
void OnCommand(UINT uNotifyCode, int nID, HWND wndCtl)
Handles the WM_COMMAND message.
void SetEventHandler(FunCallback fun, void *ctx) OVERRIDE
Sets the event handler for the host window.
virtual void OnUserXmlNode(SXmlNode xmlUser)
Handles user-defined XML node.
static void SetTaskQueueBufSize(int nBufSize)
Sets the buffer size for asynchronous task queues.
LRESULT OnUpdateFont(UINT uMsg, WPARAM wp, LPARAM lp)
Handles the WM_UPDATEFONT message.
LRESULT OnRunTasks(UINT uMsg, WPARAM wp, LPARAM lp)
Handles the UM_RUN_TASKS message.
HWND Create(HWND hWndParent, int x=0, int y=0, int nWidth=0, int nHeight=0) OVERRIDE
Creates the host window.
void OnSize(UINT nType, CSize size)
Handles the WM_SIZE message.
virtual BOOL _HandleEvent(IEvtArgs *pEvt)
Handles an event.
BOOL IsSendWheel2Hover() const OVERRIDE
Checks if wheel messages are sent to the hover window.
SAutoRefPtr< IAnimation > m_hostAnimation
void _PaintVideoCanvasForeground(IRenderTarget *pRT)
Paints the video canvas in the foreground.
void OnGetMinMaxInfo(LPMINMAXINFO lpMMI)
Handles the WM_GETMINMAXINFO message.
BOOL OnReleaseSwndCapture() OVERRIDE
Releases the capture from the container.
SAutoRefPtr< IRegionS > m_rgnInvalidate
void OnMouseLeave()
Handles the WM_MOUSELEAVE message.
virtual void OnHostAnimationStarted(IAnimation *pAni)
Called when the host window animation starts.
void ShowHostWnd(int uShowCmd, BOOL bWaitAniDone) OVERRIDE
Shows the host window with optional animation.
CRect GetWindowRect() const
Gets the window rectangle.
SCriticalSection m_csRunningQueue
LRESULT OnMenuExEvent(UINT uMsg, WPARAM wParam, LPARAM lParam)
Handles custom menu events.
void _ExcludeVideoCanvasFromPaint(IRenderTarget *pRT)
Excludes the video canvas from painting.
void OnUpdateCursor() OVERRIDE
Updates the cursor for the container.
void UpdateAutoSizeCount(bool bInc)
Updates the auto-size count.
SWND OnSetSwndCapture(SWND swnd) OVERRIDE
Sets the capture to the specified window.
SAutoRefPtr< SNcPainter > m_pNcPainter
virtual SXmlNode OnGetInitXmlNode(SXmlDoc &xmlDoc)
Gets the initial XML node.
int RemoveTasksForObject(void *pObj) OVERRIDE
Removes tasks for the specified object.
void SetPresenter(IHostPresenter *pPresenter) OVERRIDE
Sets the presenter for rendering.
void UpdateTooltip() OVERRIDE
Updates the tooltip for the container.
IHostPresenter * GetPresenter() OVERRIDE
Gets the presenter interface for rendering.
void OnWindowPosChanged(LPWINDOWPOS lpWndPos)
Handles the WM_WINDOWPOSCHANGED message.
BOOL UpdateWindow(BOOL bForce=TRUE) OVERRIDE
Updates the window.
BOOL DestroyWindow() OVERRIDE
Destroys the host window.
BOOL AnimateHostWindow(DWORD dwTime, DWORD dwFlags) OVERRIDE
Animates the host window.
SWindow * GetRoot() const
Gets the root window.
bool StartHostAnimation(IAnimation *pAni)
Starts an animation for the host window.
void SetScale(int nScale, LPCRECT pDestRect) OVERRIDE
Sets the scale factor for the host window.
void OnKillFocus(HWND wndFocus)
Handles the WM_KILLFOCUS message.
void UpdateRegion(IRegionS *rgn) OVERRIDE
Updates the specified region in the container.
void OnCaptureChanged(HWND wnd)
Handles the WM_CAPTURECHANGED message.
LRESULT OnSetLanguage(UINT uMsg, WPARAM wp, LPARAM lp)
Handles the WM_SETLANGUAGE message.
SAutoRefPtr< IScriptModule > m_pScriptModule
void OnPrint(HDC dc, UINT uFlags=0)
Handles the WM_PRINT message.
void OnPaint(HDC dc)
Handles the WM_PAINT message.
static int s_TaskQueueBufSize
static BOOL s_HideLocalUiDef
void EnableIME(BOOL bEnable) OVERRIDE
Enables or disables IME (Input Method Editor).
void EnablePrivateUiDef(BOOL bEnable) OVERRIDE
Enables or disables private UI definitions for the host window.
virtual void DestroyTooltip(IToolTip *pTooltip) const
Destroys the specified tooltip.
HWND GetHostHwnd() OVERRIDE
Gets the handle to the host window.
void OnSetFocus(HWND wndOld)
Handles the WM_SETFOCUS message.
LPCWSTR GetTranslatorContext() const OVERRIDE
Gets the translator context for the container.
void GetContainerRect(RECT *ret) const OVERRIDE
Gets the rectangle of the container.
void OnMouseMove(UINT nFlags, CPoint point)
Handles the WM_MOUSEMOVE message.
BOOL PostTask(IRunnable *runable, BOOL bAsync=TRUE) OVERRIDE
Posts a task to the container.
LRESULT OnMouseEvent(UINT uMsg, WPARAM wParam, LPARAM lParam)
Handles mouse events.
virtual BOOL OnLoadLayoutFromResourceID(SXmlDoc &xmlDoc)
Loads the layout from a resource ID.
int GetScale() const OVERRIDE
Gets the scale factor for the container.
void OnTimer(UINT_PTR idEvent)
Handles the WM_TIMER message.
SAutoRefPtr< IHostPresenter > m_presenter
void _SetToolTipInfo(const SwndToolTipInfo *info, BOOL bNcTip)
Sets tooltip information for the window.
IScriptModule * GetScriptModule() OVERRIDE
Gets the script module for the container.
int OnCreate(LPCREATESTRUCT lpCreateStruct)
Handles the WM_CREATE message.
bool StopHostAnimation()
Stops the current animation for the host window.
void _Redraw()
Redraws the entire window.
SList< IRunnable * > m_runningQueue
IMessageLoop * GetMsgLoop() OVERRIDE
Gets the message loop interface.
void OnActivate(UINT nState, BOOL bMinimized, HWND wndOther)
Handles the WM_ACTIVATE message.
INcPainter * GetNcPainter() OVERRIDE
Gets the non-client area painter for the host window.
HWND CreateEx(HWND hWndParent, DWORD dwStyle, DWORD dwExStyle, int x, int y, int nWidth, int nHeight, IXmlNode *xmlInit=NULL) OVERRIDE
Creates the host window with extended styles.
void OnWindowPosChanging(LPWINDOWPOS lpWndPos)
Handles the WM_WINDOWPOSCHANGING message.
int toPixelSize(int scale) const
将大小转换为像素值
The SMatrix class holds a 3x3 matrix for transforming coordinates. SMatrix does not have a constructo...
void postTranslate(float dx, float dy)
Post-concats the matrix with the specified translation.
void preTranslate(float dx, float dy)
Pre-concats the matrix with the specified translation.
bool mapRect(SRect *dst, const SRect &src) const
Apply this matrix to the src rectangle, and write the transformed rectangle into dst....
bool rectStaysRect() const
Returns true if the matrix will map a rectangle to another rectangle. This can be true if the matrix ...
Class for managing native window operations.
BOOL ScreenToClient(LPPOINT lpPoint) SCONST OVERRIDE
Converts screen coordinates to client coordinates.
HWND SetCapture() OVERRIDE
Sets the window to capture the mouse.
BOOL GetWindowRect(LPRECT lpRect) SCONST OVERRIDE
Retrieves the window rectangle.
BOOL Invalidate(BOOL bErase=TRUE) OVERRIDE
Invalidates the entire window.
BOOL IsWindow() SCONST OVERRIDE
Checks if the handle is a valid window handle.
UINT_PTR SetTimer(UINT_PTR nIDEvent, UINT nElapse, void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD)=NULL) OVERRIDE
Sets a timer for the window.
DWORD GetStyle() SCONST OVERRIDE
Retrieves the window style.
HWND GetParent() OVERRIDE
Retrieves the handle to the parent window.
HWND SetFocus() OVERRIDE
Sets the input focus to the window.
DWORD GetExStyle() SCONST OVERRIDE
Retrieves the extended window style.
BOOL ShowWindow(int nCmdShow) OVERRIDE
Sets the show state of the window.
BOOL KillTimer(UINT_PTR nIDEvent) OVERRIDE
Kills a timer for the window.
HWND m_hWnd
Handle to the window.
BOOL GetClientRect(LPRECT lpRect) SCONST OVERRIDE
Retrieves the client rectangle.
HWND CreateNative(LPCTSTR lpWindowName, DWORD dwStyle, DWORD dwExStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, int nID=0, LPVOID lpParam=0) OVERRIDE
Creates a native window.
BOOL SetWindowPos(HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags) OVERRIDE
Sets the window position.
LRESULT DefWindowProc()
Calls the default window procedure.
BOOL InvalidateRect(LPCRECT lpRect, BOOL bErase=TRUE) OVERRIDE
Invalidates a specified rectangle of the window.
BOOL DestroyWindow() OVERRIDE
Destroys the window.
static void updateSystemButton(SWindow *pRoot, UINT nResizeMode)
Updates system buttons in the non-client area.
int GetID() SCONST OVERRIDE
Retrieves the object's ID.
LPCWSTR GetName() SCONST OVERRIDE
Retrieves the object's name.
LPCWSTR GetObjectClass() SCONST OVERRIDE
Retrieves the object's class name.
static LPCWSTR GetClassName()
Helper class for painting.
SAutoRefPtr< IFontS > oldFont
size_t GetRawBufferSize(LPCTSTR pszType, LPCTSTR pszResName) OVERRIDE
Retrieves the size of the raw buffer for a resource.
BOOL GetRawBuffer(LPCTSTR pszType, LPCTSTR pszResName, LPVOID pBuf, size_t size) OVERRIDE
Retrieves the raw buffer for a resource.
virtual void OnAnimationInvalidate(IAnimation *pAni, bool bErase)
Called when an animation is invalidated.
virtual void BeforePaint(IRenderTarget *pRT, SPainter &painter)
Called before painting the window.
SRootWindow(SHostWnd *pHostWnd)
Constructor for SRootWindow.
virtual void OnScaleChanged(int scale)
Called when the scale changes.
void OnAnimationStop(IAnimation *pAni) OVERRIDE
Called when an animation stops.
SHostWnd * GetHostWnd() const
Gets the pointer to the host window.
virtual void AfterPaint(IRenderTarget *pRT, SPainter &painter)
Called after painting the window.
void FireMenuCmd(int menuID)
Fires a menu command event.
virtual HRESULT OnLanguageChanged()
Called when the language changes.
void UpdateLayout() OVERRIDE
Updates the layout of the window.
static SHostMgr * getSingletonPtr(void)
static SApplication & getSingleton(void)
static SApplication * getSingletonPtr(void)
static int GetDefIndex(DWORD dwState, bool checkAsPushdown=false)
Gets the default index for a given state.
A class representing an ASCII string.
int GetLength() SCONST
Retrieves the length of the string.
A class representing an ASCII string.
BOOL IsEmpty() SCONST
Checks if the string is empty.
int GetLength() SCONST
Retrieves the length of the string.
static uint64_t GetCurrentTimeMs()
获取当前时间的毫秒数
Structure representing a timer ID.
static IUiDefInfo * CreateUiDefInfo()
Creates a new UI definition information object.
Base class for SOUI DUI windows.
void StartAnimation(IAnimation *animation) OVERRIDE
Starts an animation for the window.
virtual void OnAnimationInvalidate(IAnimation *pAni, bool bErase)
Called when an animation requires a redraw.
UINT OnGetDlgCode() SCONST OVERRIDE
Retrieves the dialog code for the window.
BOOL FireEvent(IEvtArgs *evt) OVERRIDE
Fires an event.
void GetDesiredSize(SIZE *psz, int nParentWid, int nParentHei) OVERRIDE
Retrieves the desired size of the window.
SWND GetSwnd() SCONST OVERRIDE
Retrieves the window handle.
virtual BOOL UpdateToolTip(CPoint pt, SwndToolTipInfo &tipInfo)
Handle tooltip updates.
SWindow * GetParent() const
Retrieves the parent window.
DWORD GetState() SCONST OVERRIDE
Retrieves the current state of the window.
void OnAnimationStop(IAnimation *animation)
Called when an animation stops.
SWND SwndFromPoint(POINT *pt, BOOL bIncludeMsgTransparent=FALSE) SCONST OVERRIDE
Retrieves the window handle at a specified point.
void GetClientRect(LPRECT prect) SCONST OVERRIDE
Retrieves the client rectangle of the window.
BOOL IsLayoutDirty() SCONST OVERRIDE
Checks if the layout is dirty.
void SDispatchMessage(UINT uMsg, WPARAM wParam=0, LPARAM lParam=0) OVERRIDE
Dispatches a message to the window.
int GetScale() SCONST OVERRIDE
Retrieves the scale factor of the window.
void GetVisibleRect(LPRECT prect) SCONST OVERRIDE
Retrieves the visible rectangle of the window.
BOOL IsVisible(BOOL bCheckParent=FALSE) SCONST OVERRIDE
Checks if the window is visible.
void PaintForeground(IRenderTarget *pRT, LPRECT pRc, SWindow *pStartFrom=NULL)
Draws the foreground content of the window.
virtual void OnScaleChanged(int scale)
Called when the scale of the window changes.
BYTE GetAlpha() SCONST OVERRIDE
Retrieves the alpha value of the window.
IAnimation * GetAnimation() SCONST OVERRIDE
Retrieves the animation object associated with the window.
virtual CRect GetClientRect() const
Retrieves the client rectangle of the window.
LRESULT SSendMessage(UINT uMsg, WPARAM wParam=0, LPARAM lParam=0, BOOL *pbMsgHandled=NULL) OVERRIDE
Sends a message to the window.
void InvalidateRect(LPCRECT lprect) OVERRIDE
Invalidates a specific rectangle area of the window.
void UpdateLayout() OVERRIDE
Updates the layout of the window.
virtual SStringW tr(const SStringW &strSrc) const
Translation function.
LayoutDirtyType m_layoutDirty
virtual BOOL OnRelayout(const CRect &rcWnd)
Handles window position changes during layout updates.
void ClearAnimation() OVERRIDE
Clears the animation for the window.
ILayoutParam * GetLayoutParam() SCONST OVERRIDE
Retrieves the layout parameter object associated with the window.
SWindow * GetWindow(int uCode) const
Retrieves a window based on a given code.
SEventSet * GetEventSet()
Retrieves the event set associated with the window.
void RedrawRegion(IRenderTarget *pRT, IRegionS *pRgn)
Renders the content of the window and its child windows onto the RenderTarget.
void RequestRelayout() OVERRIDE
Requests a relayout of the window.
void GetWindowRect(LPRECT prect) SCONST OVERRIDE
Retrieves the bounding rectangle of the window.
BOOL InitFromXml(IXmlNode *pNode) OVERRIDE
Initializes the window from an XML node.
void Update(BOOL bForce=FALSE) OVERRIDE
Updates the window.
const SwndStyle & GetStyle() const
Retrieves the style of the window.
SWND m_swnd
Member variables representing various properties of the window.
static SWindow * GetWindow(SWND swnd)
Retrieves the SWindow pointer from a given handle.
Class representing an XML attribute.
const wchar_t * name() const
Gets the attribute name.
const wchar_t * value() const
Gets the attribute value.
Implementation of IXmlDoc.
SXmlNode root() const
Retrieves the root node of the document.
Class representing an XML node.
SXmlNode next_sibling() const
Gets the next sibling node in the children list of the parent node.
SXmlNode first_child() const
Gets the first child node of the node.
SXmlAttr append_copy(const SXmlAttr &proto)
Adds a copy of the specified attribute.
const wchar_t * name() const
Gets the name of the node.
const wchar_t * child_value() const
Gets the child value of the current node.
SXmlAttr attribute(const wchar_t *name, bool bCaseSensitive=false) const
Gets the attribute with the specified name.
int get_userdata() SCONST OVERRIDE
Gets user data for the node.
SXmlNode child(const wchar_t *name, bool bCaseSensitive=false) const
Gets the child node, attribute, or next/previous sibling with the specified name.
BOOL set_userdata(int data) OVERRIDE
Sets user data for the node.
void BuildWndTreeZorder() OVERRIDE
Rebuilds the window tree's z-order.
STimerlineHandlerMgr m_timelineHandlerMgr
BOOL RegisterTimelineHandler(ITimelineHandler *pHandler) OVERRIDE
Registers a timeline handler.
BOOL RegisterDragDrop(SWND swnd, IDropTarget *pDropTarget) OVERRIDE
Registers a drop target for a window.
void SetRoot(SWindow *pRoot)
Sets the root window of the container.
void OnNextFrame() OVERRIDE
Called when the next frame is ready.
SList< SWND > m_lstVideoCanvas
virtual LRESULT DoFrameEvent(UINT uMsg, WPARAM wParam, LPARAM lParam)
Processes frame events.
BOOL OnReleaseSwndCapture() OVERRIDE
Releases the window capture.
SWND OnSetSwndCapture(SWND swnd) OVERRIDE
Sets the window capture.
BOOL UnregisterTimelineHandler(ITimelineHandler *pHandler) OVERRIDE
Unregisters a timeline handler.
IDropTarget * GetDropTarget()
Retrieves the drop target.
Manages the style attributes of SOUI windows.
IFontPtr GetTextFont(int iState)
Retrieves the text font for a specific state.
COLORREF GetTextColor(int iState)
Retrieves the text color for a specific state.
long AddRef() override
Increments the reference count.
long Release() override
Decrements the reference count and deletes the object if the count reaches zero.
Interface for handling idle time.
Interface for message loops.
BOOL AddIdleHandler(IIdleHandler *pIdleHandler) PURE
Adds an idle handler.
void Quit(int exitCode=0) PURE
Quits the message loop.
BOOL RemoveMessageFilter(IMsgFilter *pMessageFilter) PURE
Removes a message filter.
BOOL RemoveIdleHandler(IIdleHandler *pIdleHandler) PURE
Removes an idle handler.
BOOL AddMessageFilter(IMsgFilter *pMessageFilter) PURE
Adds a message filter.
HRESULT CreateMsgLoop(IMessageLoop **ppMsgLoop, IMessageLoop *pParentLoop=NULL) PURE
Creates a message loop.
long Release() PURE
Decreases the reference count.
BOOL IsEmpty() SCONST PURE
Checks if the region is empty.
void GetRgnBox(LPRECT lprect) SCONST PURE
Retrieves the bounding rectangle of the region.
void CombineRect(LPCRECT lprect, int nCombineMode) PURE
Combines a rectangle with the region.
Base class for all renderable objects.
Interface for rendering target objects.
HRESULT BitBlt(LPCRECT pRcDest, IRenderTarget *pRTSour, int xSrc, int ySrc, DWORD dwRop=kSrcCopy) PURE
Performs a bit-block transfer (BitBlt) operation.
BOOL IsOffscreen() SCONST PURE
Check if the render target is offscreen.
HRESULT SelectObject(IRenderObj *pObj, IRenderObj **pOldObj=NULL) PURE
Selects a new rendering object and optionally retrieves the previous one.
HRESULT PushClipRect(LPCRECT pRect, UINT mode=RGN_AND) PURE
Push a rectangular clip region.
HRESULT SelectDefaultObject(OBJTYPE objType, IRenderObj **pOldObj=NULL) PURE
Resets the specified rendering object to its default state.
COLORREF SetTextColor(COLORREF color) PURE
Sets the current text color.
Interface for UI definition information.
virtual UINT Init2(IXmlNode *pNode, BOOL bGlobalDomain, IResProvider *pResProvider=NULL)=0
Initializes the UI definition from an XML node.
BOOL Empty() SCONST PURE
Checks if the node is empty.
Identifier for a tooltip.