UIManager.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. #ifndef __UIMANAGER_H__
  2. #define __UIMANAGER_H__
  3. #pragma once
  4. namespace DuiLib {
  5. /////////////////////////////////////////////////////////////////////////////////////
  6. //
  7. class CControlUI;
  8. class CRichEditUI;
  9. class CIDropTarget;
  10. /////////////////////////////////////////////////////////////////////////////////////
  11. //
  12. enum UILIB_RESTYPE
  13. {
  14. UILIB_FILE=1, // 来自磁盘文件
  15. UILIB_ZIP, // 来自磁盘zip压缩包
  16. UILIB_RESOURCE, // 来自资源
  17. UILIB_ZIPRESOURCE, // 来自资源的zip压缩包
  18. };
  19. /////////////////////////////////////////////////////////////////////////////////////
  20. //
  21. typedef enum EVENTTYPE_UI
  22. {
  23. UIEVENT__FIRST = 1,
  24. UIEVENT__KEYBEGIN,
  25. UIEVENT_KEYDOWN,
  26. UIEVENT_KEYUP,
  27. UIEVENT_CHAR,
  28. UIEVENT_SYSKEY,
  29. UIEVENT__KEYEND,
  30. UIEVENT__MOUSEBEGIN,
  31. UIEVENT_MOUSEMOVE,
  32. UIEVENT_MOUSELEAVE,
  33. UIEVENT_MOUSEENTER,
  34. UIEVENT_MOUSEHOVER,
  35. UIEVENT_BUTTONDOWN,
  36. UIEVENT_BUTTONUP,
  37. UIEVENT_RBUTTONDOWN,
  38. UIEVENT_RBUTTONUP,
  39. UIEVENT_MBUTTONDOWN,
  40. UIEVENT_MBUTTONUP,
  41. UIEVENT_DBLCLICK,
  42. UIEVENT_CONTEXTMENU,
  43. UIEVENT_SCROLLWHEEL,
  44. UIEVENT__MOUSEEND,
  45. UIEVENT_KILLFOCUS,
  46. UIEVENT_SETFOCUS,
  47. UIEVENT_WINDOWSIZE,
  48. UIEVENT_SETCURSOR,
  49. UIEVENT_TIMER,
  50. UIEVENT__LAST,
  51. };
  52. /////////////////////////////////////////////////////////////////////////////////////
  53. //
  54. // 内部保留的消息
  55. typedef enum MSGTYPE_UI
  56. {
  57. UIMSG_TRAYICON = WM_USER + 1,// 托盘消息
  58. UIMSG_SET_DPI, // DPI
  59. WM_MENUCLICK, // 菜单消息
  60. UIMSG_USER = WM_USER + 100, // 程序自定义消息
  61. };
  62. /////////////////////////////////////////////////////////////////////////////////////
  63. //
  64. // Flags for CControlUI::GetControlFlags()
  65. #define UIFLAG_TABSTOP 0x00000001
  66. #define UIFLAG_SETCURSOR 0x00000002
  67. #define UIFLAG_WANTRETURN 0x00000004
  68. // Flags for FindControl()
  69. #define UIFIND_ALL 0x00000000
  70. #define UIFIND_VISIBLE 0x00000001
  71. #define UIFIND_ENABLED 0x00000002
  72. #define UIFIND_HITTEST 0x00000004
  73. #define UIFIND_UPDATETEST 0x00000008
  74. #define UIFIND_TOP_FIRST 0x00000010
  75. #define UIFIND_ME_FIRST 0x80000000
  76. // Flags used for controlling the paint
  77. #define UISTATE_FOCUSED 0x00000001
  78. #define UISTATE_SELECTED 0x00000002
  79. #define UISTATE_DISABLED 0x00000004
  80. #define UISTATE_HOT 0x00000008
  81. #define UISTATE_PUSHED 0x00000010
  82. #define UISTATE_READONLY 0x00000020
  83. #define UISTATE_CAPTURED 0x00000040
  84. /////////////////////////////////////////////////////////////////////////////////////
  85. //
  86. typedef struct UILIB_API tagTFontInfo
  87. {
  88. HFONT hFont;
  89. CDuiString sFontName;
  90. int iSize;
  91. bool bBold;
  92. bool bUnderline;
  93. bool bItalic;
  94. bool bStrikeout;
  95. TEXTMETRIC tm;
  96. } TFontInfo;
  97. typedef struct UILIB_API tagTImageInfo
  98. {
  99. tagTImageInfo();
  100. Gdiplus::Image* pImage;
  101. HBITMAP hBitmap;
  102. LPBYTE pBits;
  103. LPBYTE pSrcBits;
  104. int nX;
  105. int nY;
  106. bool bAlpha;
  107. bool bUseHSL;
  108. CDuiString sResType;
  109. DWORD dwMask;
  110. } TImageInfo;
  111. typedef struct UILIB_API tagTDrawInfo
  112. {
  113. tagTDrawInfo();
  114. void Parse(LPCTSTR pStrImage, LPCTSTR pStrModify, CPaintManagerUI *pManager);
  115. void Clear();
  116. CDuiString sDrawString;
  117. CDuiString sDrawModify;
  118. CDuiString sImageName;
  119. CDuiString sResType;
  120. RECT rcDest;
  121. RECT rcSource;
  122. RECT rcCorner;
  123. DWORD dwMask;
  124. UINT uFade;
  125. UINT uRotate;
  126. bool bHole;
  127. bool bTiledX;
  128. bool bTiledY;
  129. bool bHSL;
  130. bool bGdiplus;
  131. CDuiSize szImage;
  132. RECT rcPadding;
  133. CDuiString sAlign;
  134. } TDrawInfo;
  135. typedef struct UILIB_API tagTPercentInfo
  136. {
  137. double left;
  138. double top;
  139. double right;
  140. double bottom;
  141. } TPercentInfo;
  142. typedef struct UILIB_API tagTResInfo
  143. {
  144. DWORD m_dwDefaultDisabledColor;
  145. DWORD m_dwDefaultFontColor;
  146. DWORD m_dwDefaultLinkFontColor;
  147. DWORD m_dwDefaultLinkHoverFontColor;
  148. DWORD m_dwDefaultSelectedBkColor;
  149. TFontInfo m_DefaultFontInfo;
  150. CStdStringPtrMap m_CustomFonts;
  151. CStdStringPtrMap m_ImageHash;
  152. CStdStringPtrMap m_AttrHash;
  153. CStdStringPtrMap m_StyleHash;
  154. CStdStringPtrMap m_DrawInfoHash;
  155. } TResInfo;
  156. // Structure for notifications from the system
  157. // to the control implementation.
  158. typedef struct UILIB_API tagTEventUI
  159. {
  160. int Type;
  161. CControlUI* pSender;
  162. DWORD dwTimestamp;
  163. POINT ptMouse;
  164. TCHAR chKey;
  165. WORD wKeyState;
  166. WPARAM wParam;
  167. LPARAM lParam;
  168. } TEventUI;
  169. // Drag&Drop control
  170. const TCHAR* const CF_MOVECONTROL = _T("CF_MOVECONTROL");
  171. typedef struct UILIB_API tagTCFMoveUI
  172. {
  173. CControlUI* pControl;
  174. } TCFMoveUI;
  175. // Listener interface
  176. class INotifyUI
  177. {
  178. public:
  179. virtual void Notify(TNotifyUI& msg) = 0;
  180. };
  181. // MessageFilter interface
  182. class IMessageFilterUI
  183. {
  184. public:
  185. virtual LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled) = 0;
  186. };
  187. class ITranslateAccelerator
  188. {
  189. public:
  190. virtual LRESULT TranslateAccelerator(MSG *pMsg) = 0;
  191. };
  192. class IDragDropUI
  193. {
  194. public:
  195. virtual bool OnDragDrop(CControlUI* pControl) { return false; }
  196. };
  197. /////////////////////////////////////////////////////////////////////////////////////
  198. //
  199. typedef CControlUI* (*LPCREATECONTROL)(LPCTSTR pstrType);
  200. class UILIB_API CPaintManagerUI : public CIDropTarget
  201. {
  202. public:
  203. CPaintManagerUI();
  204. ~CPaintManagerUI();
  205. public:
  206. void Init(HWND hWnd, LPCTSTR pstrName = NULL);
  207. bool IsUpdateNeeded() const;
  208. void NeedUpdate();
  209. void Invalidate();
  210. void Invalidate(RECT& rcItem);
  211. LPCTSTR GetName() const;
  212. HDC GetPaintDC() const;
  213. HWND GetPaintWindow() const;
  214. HWND GetTooltipWindow() const;
  215. int GetHoverTime() const;
  216. void SetHoverTime(int iTime);
  217. POINT GetMousePos() const;
  218. SIZE GetClientSize() const;
  219. SIZE GetInitSize();
  220. void SetInitSize(int cx, int cy);
  221. RECT GetSizeBox();
  222. void SetSizeBox(RECT& rcSizeBox);
  223. RECT GetCaptionRect();
  224. void SetCaptionRect(RECT& rcCaption);
  225. SIZE GetRoundCorner();
  226. void SetRoundCorner(int cx, int cy);
  227. SIZE GetMinInfo();
  228. void SetMinInfo(int cx, int cy);
  229. SIZE GetMaxInfo();
  230. void SetMaxInfo(int cx, int cy);
  231. bool IsShowUpdateRect();
  232. void SetShowUpdateRect(bool show);
  233. bool IsNoActivate();
  234. void SetNoActivate(bool bNoActivate);
  235. BYTE GetOpacity() const;
  236. void SetOpacity(BYTE nOpacity);
  237. bool IsLayered();
  238. void SetLayered(bool bLayered);
  239. RECT& GetLayeredInset();
  240. void SetLayeredInset(RECT& rcLayeredInset);
  241. BYTE GetLayeredOpacity();
  242. void SetLayeredOpacity(BYTE nOpacity);
  243. LPCTSTR GetLayeredImage();
  244. void SetLayeredImage(LPCTSTR pstrImage);
  245. CShadowUI* GetShadow();
  246. void SetUseGdiplusText(bool bUse);
  247. bool IsUseGdiplusText() const;
  248. void SetGdiplusTextRenderingHint(int trh);
  249. int GetGdiplusTextRenderingHint() const;
  250. static HINSTANCE GetInstance();
  251. static CDuiString GetInstancePath();
  252. static CDuiString GetCurrentPath();
  253. static HINSTANCE GetResourceDll();
  254. static const CDuiString& GetResourcePath();
  255. static const CDuiString& GetResourceZip();
  256. static const CDuiString& GetResourceZipPwd();
  257. static bool IsCachedResourceZip();
  258. static HANDLE GetResourceZipHandle();
  259. static void SetInstance(HINSTANCE hInst);
  260. static void SetCurrentPath(LPCTSTR pStrPath);
  261. static void SetResourceDll(HINSTANCE hInst);
  262. static void SetResourcePath(LPCTSTR pStrPath);
  263. static void SetResourceZip(LPVOID pVoid, unsigned int len, LPCTSTR password = NULL);
  264. static void SetResourceZip(LPCTSTR pstrZip, bool bCachedResourceZip = false, LPCTSTR password = NULL);
  265. static void SetResourceType(int nType);
  266. static int GetResourceType();
  267. static bool GetHSL(short* H, short* S, short* L);
  268. static void SetHSL(bool bUseHSL, short H, short S, short L); // H:0~360, S:0~200, L:0~200
  269. static void ReloadSkin();
  270. static CPaintManagerUI* GetPaintManager(LPCTSTR pstrName);
  271. static CStdPtrArray* GetPaintManagers();
  272. static bool LoadPlugin(LPCTSTR pstrModuleName);
  273. static CStdPtrArray* GetPlugins();
  274. bool IsForceUseSharedRes() const;
  275. void SetForceUseSharedRes(bool bForce);
  276. // 注意:只支持简单类型指针,因为只释放内存,不会调用类对象的析构函数
  277. void DeletePtr(void* ptr);
  278. DWORD GetDefaultDisabledColor() const;
  279. void SetDefaultDisabledColor(DWORD dwColor, bool bShared = false);
  280. DWORD GetDefaultFontColor() const;
  281. void SetDefaultFontColor(DWORD dwColor, bool bShared = false);
  282. DWORD GetDefaultLinkFontColor() const;
  283. void SetDefaultLinkFontColor(DWORD dwColor, bool bShared = false);
  284. DWORD GetDefaultLinkHoverFontColor() const;
  285. void SetDefaultLinkHoverFontColor(DWORD dwColor, bool bShared = false);
  286. DWORD GetDefaultSelectedBkColor() const;
  287. void SetDefaultSelectedBkColor(DWORD dwColor, bool bShared = false);
  288. TFontInfo* GetDefaultFontInfo();
  289. void SetDefaultFont(LPCTSTR pStrFontName, int nSize, bool bBold, bool bUnderline, bool bItalic, bool bStrikeout, bool bShared = false);
  290. DWORD GetCustomFontCount(bool bShared = false) const;
  291. void AddFontArray(LPCTSTR pstrPath);
  292. HFONT AddFont(int id, LPCTSTR pStrFontName, int nSize, bool bBold, bool bUnderline, bool bItalic, bool bStrikeout, bool bShared = false);
  293. HFONT GetFont(int id);
  294. HFONT GetFont(LPCTSTR pStrFontName, int nSize, bool bBold, bool bUnderline, bool bItalic, bool bStrikeout);
  295. int GetFontIndex(HFONT hFont, bool bShared = false);
  296. int GetFontIndex(LPCTSTR pStrFontName, int nSize, bool bBold, bool bUnderline, bool bItalic, bool bStrikeout, bool bShared = false);
  297. void RemoveFont(HFONT hFont, bool bShared = false);
  298. void RemoveFont(int id, bool bShared = false);
  299. void RemoveAllFonts(bool bShared = false);
  300. TFontInfo* GetFontInfo(int id);
  301. TFontInfo* GetFontInfo(HFONT hFont);
  302. const TImageInfo* GetImage(LPCTSTR bitmap);
  303. const TImageInfo* GetImageEx(LPCTSTR bitmap, LPCTSTR type = NULL, DWORD mask = 0, bool bUseHSL = false, bool bGdiplus = false, HINSTANCE instance = NULL);
  304. const TImageInfo* AddImage(LPCTSTR bitmap, LPCTSTR type = NULL, DWORD mask = 0, bool bUseHSL = false, bool bGdiplus = false, bool bShared = false, HINSTANCE instance = NULL);
  305. const TImageInfo* AddImage(LPCTSTR bitmap, HBITMAP hBitmap, int iWidth, int iHeight, bool bAlpha, bool bShared = false);
  306. void RemoveImage(LPCTSTR bitmap, bool bShared = false);
  307. void RemoveAllImages(bool bShared = false);
  308. static void ReloadSharedImages();
  309. void ReloadImages();
  310. const TDrawInfo* GetDrawInfo(LPCTSTR pStrImage, LPCTSTR pStrModify);
  311. void RemoveDrawInfo(LPCTSTR pStrImage, LPCTSTR pStrModify);
  312. void RemoveAllDrawInfos();
  313. void AddDefaultAttributeList(LPCTSTR pStrControlName, LPCTSTR pStrControlAttrList, bool bShared = false);
  314. LPCTSTR GetDefaultAttributeList(LPCTSTR pStrControlName) const;
  315. bool RemoveDefaultAttributeList(LPCTSTR pStrControlName, bool bShared = false);
  316. void RemoveAllDefaultAttributeList(bool bShared = false);
  317. void AddWindowCustomAttribute(LPCTSTR pstrName, LPCTSTR pstrAttr);
  318. LPCTSTR GetWindowCustomAttribute(LPCTSTR pstrName) const;
  319. bool RemoveWindowCustomAttribute(LPCTSTR pstrName);
  320. void RemoveAllWindowCustomAttribute();
  321. // 样式管理
  322. void AddStyle(LPCTSTR pName, LPCTSTR pStyle, bool bShared = false);
  323. LPCTSTR GetStyle(LPCTSTR pName) const;
  324. BOOL RemoveStyle(LPCTSTR pName, bool bShared = false);
  325. const CStdStringPtrMap& GetStyles(bool bShared = false) const;
  326. void RemoveAllStyle(bool bShared = false);
  327. const TImageInfo* GetImageString(LPCTSTR pStrImage, LPCTSTR pStrModify = NULL);
  328. // 初始化拖拽
  329. bool EnableDragDrop(bool bEnable);
  330. void SetDragDrop(IDragDropUI* pDragDrop);
  331. virtual bool OnDrop(FORMATETC* pFmtEtc, STGMEDIUM& medium,DWORD *pdwEffect);
  332. bool IsValid();
  333. bool AttachDialog(CControlUI* pControl);
  334. bool InitControls(CControlUI* pControl, CControlUI* pParent = NULL);
  335. void ReapObjects(CControlUI* pControl);
  336. bool AddOptionGroup(LPCTSTR pStrGroupName, CControlUI* pControl);
  337. CStdPtrArray* GetOptionGroup(LPCTSTR pStrGroupName);
  338. void RemoveOptionGroup(LPCTSTR pStrGroupName, CControlUI* pControl);
  339. void RemoveAllOptionGroups();
  340. CControlUI* GetFocus() const;
  341. void SetFocus(CControlUI* pControl);
  342. void SetFocusNeeded(CControlUI* pControl);
  343. bool SetNextTabControl(bool bForward = true);
  344. bool SetTimer(CControlUI* pControl, UINT nTimerID, UINT uElapse);
  345. bool KillTimer(CControlUI* pControl, UINT nTimerID);
  346. void KillTimer(CControlUI* pControl);
  347. void RemoveAllTimers();
  348. void SetCapture();
  349. void ReleaseCapture();
  350. bool IsCaptured();
  351. bool IsPainting();
  352. void SetPainting(bool bIsPainting);
  353. bool AddNotifier(INotifyUI* pControl);
  354. bool RemoveNotifier(INotifyUI* pControl);
  355. void SendNotify(TNotifyUI& Msg, bool bAsync = false);
  356. void SendNotify(CControlUI* pControl, LPCTSTR pstrMessage, WPARAM wParam = 0, LPARAM lParam = 0, bool bAsync = false);
  357. bool AddPreMessageFilter(IMessageFilterUI* pFilter);
  358. bool RemovePreMessageFilter(IMessageFilterUI* pFilter);
  359. bool AddMessageFilter(IMessageFilterUI* pFilter);
  360. bool RemoveMessageFilter(IMessageFilterUI* pFilter);
  361. int GetPostPaintCount() const;
  362. bool IsPostPaint(CControlUI* pControl);
  363. bool AddPostPaint(CControlUI* pControl);
  364. bool RemovePostPaint(CControlUI* pControl);
  365. bool SetPostPaintIndex(CControlUI* pControl, int iIndex);
  366. int GetNativeWindowCount() const;
  367. RECT GetNativeWindowRect(HWND hChildWnd);
  368. bool AddNativeWindow(CControlUI* pControl, HWND hChildWnd);
  369. bool RemoveNativeWindow(HWND hChildWnd);
  370. void AddDelayedCleanup(CControlUI* pControl);
  371. void AddMouseLeaveNeeded(CControlUI* pControl);
  372. bool RemoveMouseLeaveNeeded(CControlUI* pControl);
  373. bool AddTranslateAccelerator(ITranslateAccelerator *pTranslateAccelerator);
  374. bool RemoveTranslateAccelerator(ITranslateAccelerator *pTranslateAccelerator);
  375. bool TranslateAccelerator(LPMSG pMsg);
  376. CControlUI* GetRoot() const;
  377. CControlUI* FindControl(POINT pt) const;
  378. CControlUI* FindControl(LPCTSTR pstrName) const;
  379. CControlUI* FindSubControlByPoint(CControlUI* pParent, POINT pt) const;
  380. CControlUI* FindSubControlByName(CControlUI* pParent, LPCTSTR pstrName) const;
  381. CControlUI* FindSubControlByClass(CControlUI* pParent, LPCTSTR pstrClass, int iIndex = 0);
  382. CStdPtrArray* FindSubControlsByClass(CControlUI* pParent, LPCTSTR pstrClass);
  383. static void MessageLoop();
  384. static bool TranslateMessage(const LPMSG pMsg);
  385. static void Term();
  386. CDPI* GetDPIObj();
  387. void ResetDPIAssets();
  388. void RebuildFont(TFontInfo* pFontInfo);
  389. void SetDPI(int iDPI);
  390. static void SetAllDPI(int iDPI);
  391. bool MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& lRes);
  392. bool PreMessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& lRes);
  393. void UsedVirtualWnd(bool bUsed);
  394. private:
  395. CStdPtrArray* GetFoundControls();
  396. static CControlUI* CALLBACK __FindControlFromNameHash(CControlUI* pThis, LPVOID pData);
  397. static CControlUI* CALLBACK __FindControlFromCount(CControlUI* pThis, LPVOID pData);
  398. static CControlUI* CALLBACK __FindControlFromPoint(CControlUI* pThis, LPVOID pData);
  399. static CControlUI* CALLBACK __FindControlFromTab(CControlUI* pThis, LPVOID pData);
  400. static CControlUI* CALLBACK __FindControlFromShortcut(CControlUI* pThis, LPVOID pData);
  401. static CControlUI* CALLBACK __FindControlFromName(CControlUI* pThis, LPVOID pData);
  402. static CControlUI* CALLBACK __FindControlFromClass(CControlUI* pThis, LPVOID pData);
  403. static CControlUI* CALLBACK __FindControlsFromClass(CControlUI* pThis, LPVOID pData);
  404. static CControlUI* CALLBACK __FindControlsFromUpdate(CControlUI* pThis, LPVOID pData);
  405. static void AdjustSharedImagesHSL();
  406. void AdjustImagesHSL();
  407. void PostAsyncNotify();
  408. private:
  409. CDuiString m_sName;
  410. HWND m_hWndPaint; //所附加的窗体的句柄
  411. HDC m_hDcPaint;
  412. HDC m_hDcOffscreen;
  413. HDC m_hDcBackground;
  414. HBITMAP m_hbmpOffscreen;
  415. BYTE* m_pOffscreenBits;
  416. HBITMAP m_hbmpBackground;
  417. COLORREF* m_pBackgroundBits;
  418. // 提示信息
  419. HWND m_hwndTooltip;
  420. TOOLINFO m_ToolTip;
  421. int m_iHoverTime;
  422. bool m_bNoActivate;
  423. bool m_bShowUpdateRect;
  424. //
  425. CControlUI* m_pRoot;
  426. CControlUI* m_pFocus;
  427. CControlUI* m_pEventHover;
  428. CControlUI* m_pEventClick;
  429. CControlUI* m_pEventRClick;
  430. CControlUI* m_pEventKey;
  431. CControlUI* m_pLastToolTip;
  432. //
  433. POINT m_ptLastMousePos;
  434. SIZE m_szMinWindow;
  435. SIZE m_szMaxWindow;
  436. SIZE m_szInitWindowSize;
  437. RECT m_rcSizeBox;
  438. SIZE m_szRoundCorner;
  439. RECT m_rcCaption;
  440. UINT m_uTimerID;
  441. bool m_bFirstLayout;
  442. bool m_bUpdateNeeded;
  443. bool m_bFocusNeeded;
  444. bool m_bOffscreenPaint;
  445. BYTE m_nOpacity;
  446. bool m_bLayered;
  447. RECT m_rcLayeredInset;
  448. bool m_bLayeredChanged;
  449. RECT m_rcLayeredUpdate;
  450. TDrawInfo m_diLayered;
  451. bool m_bMouseTracking;
  452. bool m_bMouseCapture;
  453. bool m_bIsPainting;
  454. bool m_bUsedVirtualWnd;
  455. bool m_bAsyncNotifyPosted;
  456. //
  457. CStdPtrArray m_aNotifiers;
  458. CStdPtrArray m_aTimers;
  459. CStdPtrArray m_aTranslateAccelerator;
  460. CStdPtrArray m_aPreMessageFilters;
  461. CStdPtrArray m_aMessageFilters;
  462. CStdPtrArray m_aPostPaintControls;
  463. CStdPtrArray m_aNativeWindow;
  464. CStdPtrArray m_aNativeWindowControl;
  465. CStdPtrArray m_aDelayedCleanup;
  466. CStdPtrArray m_aAsyncNotify;
  467. CStdPtrArray m_aFoundControls;
  468. CStdPtrArray m_aFonts;
  469. CStdPtrArray m_aNeedMouseLeaveNeeded;
  470. CStdStringPtrMap m_mNameHash;
  471. CStdStringPtrMap m_mWindowCustomAttrHash;
  472. CStdStringPtrMap m_mOptionGroup;
  473. bool m_bForceUseSharedRes;
  474. TResInfo m_ResInfo;
  475. // 窗口阴影
  476. CShadowUI m_shadow;
  477. // DPI管理器
  478. CDPI* m_pDPI;
  479. // 是否开启Gdiplus
  480. bool m_bUseGdiplusText;
  481. int m_trh;
  482. ULONG_PTR m_gdiplusToken;
  483. Gdiplus::GdiplusStartupInput *m_pGdiplusStartupInput;
  484. // 拖拽
  485. bool m_bDragDrop;
  486. bool m_bDragMode;
  487. HBITMAP m_hDragBitmap;
  488. IDragDropUI *m_pDragDrop;
  489. //
  490. static HINSTANCE m_hInstance;
  491. static HINSTANCE m_hResourceInstance;
  492. static CDuiString m_pStrResourcePath;
  493. static CDuiString m_pStrResourceZip;
  494. static CDuiString m_pStrResourceZipPwd;
  495. static HANDLE m_hResourceZip;
  496. static BYTE* m_cbZipBuf;
  497. static bool m_bCachedResourceZip;
  498. static int m_nResType;
  499. static TResInfo m_SharedResInfo;
  500. static bool m_bUseHSL;
  501. static short m_H;
  502. static short m_S;
  503. static short m_L;
  504. static CStdPtrArray m_aPreMessages;
  505. static CStdPtrArray m_aPlugins;
  506. };
  507. } // namespace DuiLib
  508. #endif // __UIMANAGER_H__