OLD | NEW |
---|---|
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef XFA_FWL_CORE_FWL_WIDGETMGRIMP_H_ | 7 #ifndef XFA_FWL_CORE_FWL_WIDGETMGRIMP_H_ |
8 #define XFA_FWL_CORE_FWL_WIDGETMGRIMP_H_ | 8 #define XFA_FWL_CORE_FWL_WIDGETMGRIMP_H_ |
9 | 9 |
10 #include "core/fxcrt/include/fx_system.h" | 10 #include "core/fxcrt/include/fx_system.h" |
11 #include "xfa/fwl/core/fwl_error.h" | 11 #include "xfa/fwl/core/fwl_error.h" |
12 #include "xfa/fwl/core/ifwl_widgetmgr.h" | 12 #include "xfa/fwl/core/ifwl_widgetmgr.h" |
13 #include "xfa/fxgraphics/include/cfx_graphics.h" | 13 #include "xfa/fxgraphics/include/cfx_graphics.h" |
14 | 14 |
15 #define FWL_WGTMGR_DisableThread 0x00000001 | 15 #define FWL_WGTMGR_DisableThread 0x00000001 |
16 #define FWL_WGTMGR_DisableForm 0x00000002 | 16 #define FWL_WGTMGR_DisableForm 0x00000002 |
17 | 17 |
18 class CFWL_Message; | 18 class CFWL_Message; |
19 class CFWL_WidgetMgrDelegate; | 19 class CFWL_WidgetMgrDelegate; |
20 class CXFA_FFApp; | |
21 class CXFA_FWLAdapterWidgetMgr; | |
20 class CFX_Graphics; | 22 class CFX_Graphics; |
21 class CFX_Matrix; | 23 class CFX_Matrix; |
22 class IFWL_AdapterWidgetMgr; | |
23 class IFWL_AdapterNative; | |
24 class IFWL_Widget; | 24 class IFWL_Widget; |
25 | 25 |
26 class CFWL_WidgetMgrItem { | 26 class CFWL_WidgetMgrItem { |
27 public: | 27 public: |
28 CFWL_WidgetMgrItem() | 28 CFWL_WidgetMgrItem() |
29 : pParent(NULL), | 29 : pParent(NULL), |
30 pOwner(NULL), | 30 pOwner(NULL), |
31 pChild(NULL), | 31 pChild(NULL), |
32 pPrevious(NULL), | 32 pPrevious(NULL), |
33 pNext(NULL), | 33 pNext(NULL), |
(...skipping 20 matching lines...) Expand all Loading... | |
54 IFWL_Widget* pWidget; | 54 IFWL_Widget* pWidget; |
55 CFX_Graphics* pOffscreen; | 55 CFX_Graphics* pOffscreen; |
56 int32_t iRedrawCounter; | 56 int32_t iRedrawCounter; |
57 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) | 57 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) |
58 FX_BOOL bOutsideChanged; | 58 FX_BOOL bOutsideChanged; |
59 #endif | 59 #endif |
60 }; | 60 }; |
61 | 61 |
62 class CFWL_WidgetMgr : public IFWL_WidgetMgr { | 62 class CFWL_WidgetMgr : public IFWL_WidgetMgr { |
63 public: | 63 public: |
64 CFWL_WidgetMgr(IFWL_AdapterNative* pAdapterNative); | 64 CFWL_WidgetMgr(CXFA_FFApp* pAdapterNative); |
65 ~CFWL_WidgetMgr() override; | 65 ~CFWL_WidgetMgr() override; |
66 | 66 |
67 // IFWL_WidgetMgr: | 67 // IFWL_WidgetMgr: |
68 int32_t CountWidgets(IFWL_Widget* pParent = NULL) override; | 68 int32_t CountWidgets(IFWL_Widget* pParent = NULL) override; |
69 IFWL_Widget* GetWidget(int32_t nIndex, IFWL_Widget* pParent = NULL) override; | 69 IFWL_Widget* GetWidget(int32_t nIndex, IFWL_Widget* pParent = NULL) override; |
70 IFWL_Widget* GetWidget(IFWL_Widget* pWidget, | 70 IFWL_Widget* GetWidget(IFWL_Widget* pWidget, |
71 FWL_WGTRELATION eRelation) override; | 71 FWL_WGTRELATION eRelation) override; |
72 int32_t GetWidgetIndex(IFWL_Widget* pWidget) override; | 72 int32_t GetWidgetIndex(IFWL_Widget* pWidget) override; |
73 FX_BOOL SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) override; | 73 FX_BOOL SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) override; |
74 FWL_ERR RepaintWidget(IFWL_Widget* pWidget, | 74 FWL_ERR RepaintWidget(IFWL_Widget* pWidget, |
75 const CFX_RectF* pRect = NULL) override; | 75 const CFX_RectF* pRect = NULL) override; |
76 uint32_t GetCapability() override { return m_dwCapability; } | 76 uint32_t GetCapability() override { return m_dwCapability; } |
77 | 77 |
78 void AddWidget(IFWL_Widget* pWidget); | 78 void AddWidget(IFWL_Widget* pWidget); |
79 void InsertWidget(IFWL_Widget* pParent, | 79 void InsertWidget(IFWL_Widget* pParent, |
80 IFWL_Widget* pChild, | 80 IFWL_Widget* pChild, |
81 int32_t nIndex = -1); | 81 int32_t nIndex = -1); |
82 void RemoveWidget(IFWL_Widget* pWidget); | 82 void RemoveWidget(IFWL_Widget* pWidget); |
83 void SetOwner(IFWL_Widget* pOwner, IFWL_Widget* pOwned); | 83 void SetOwner(IFWL_Widget* pOwner, IFWL_Widget* pOwned); |
84 void SetParent(IFWL_Widget* pParent, IFWL_Widget* pChild); | 84 void SetParent(IFWL_Widget* pParent, IFWL_Widget* pChild); |
85 FX_BOOL IsChild(IFWL_Widget* pChild, IFWL_Widget* pParent); | 85 FX_BOOL IsChild(IFWL_Widget* pChild, IFWL_Widget* pParent); |
86 FWL_ERR CreateWidget_Native(IFWL_Widget* pWidget); | |
87 FWL_ERR DestroyWidget_Native(IFWL_Widget* pWidget); | |
88 FWL_ERR GetWidgetRect_Native(IFWL_Widget* pWidget, CFX_RectF& rect); | |
89 FWL_ERR SetWidgetRect_Native(IFWL_Widget* pWidget, const CFX_RectF& rect); | 86 FWL_ERR SetWidgetRect_Native(IFWL_Widget* pWidget, const CFX_RectF& rect); |
90 FWL_ERR SetWidgetPosition_Native(IFWL_Widget* pWidget, | |
91 FX_FLOAT fx, | |
92 FX_FLOAT fy); | |
93 FWL_ERR SetWidgetIcon_Native(IFWL_Widget* pWidget, | |
94 const CFX_DIBitmap* pIcon, | |
95 FX_BOOL bBig); | |
96 FWL_ERR SetWidgetCaption_Native(IFWL_Widget* pWidget, | |
97 const CFX_WideStringC& wsCaption); | |
98 FWL_ERR SetBorderRegion_Native(IFWL_Widget* pWidget, CFX_Path* pPath); | |
99 FWL_ERR ShowWidget_Native(IFWL_Widget* pWidget); | |
100 FWL_ERR HideWidget_Native(IFWL_Widget* pWidget); | |
101 FWL_ERR SetNormal_Native(IFWL_Widget* pWidget); | |
102 FWL_ERR SetMaximize_Native(IFWL_Widget* pWidget); | |
103 FWL_ERR SetMinimize_Native(IFWL_Widget* pWidget); | |
104 FX_BOOL CheckMessage_Native(); | |
105 FWL_ERR DispatchMessage_Native(); | |
106 FX_BOOL IsIdleMessage_Native(); | |
107 FWL_ERR Exit_Native(int32_t iExitCode); | |
108 FWL_ERR CreateWidgetWithNativeId_Native(IFWL_Widget* pWidget, void* vp); | |
109 IFWL_Widget* GetWidgetAtPoint(IFWL_Widget* pParent, FX_FLOAT fx, FX_FLOAT fy); | 87 IFWL_Widget* GetWidgetAtPoint(IFWL_Widget* pParent, FX_FLOAT fx, FX_FLOAT fy); |
110 void NotifySizeChanged(IFWL_Widget* pForm, FX_FLOAT fx, FX_FLOAT fy); | 88 void NotifySizeChanged(IFWL_Widget* pForm, FX_FLOAT fx, FX_FLOAT fy); |
111 IFWL_Widget* nextTab(IFWL_Widget* parent, IFWL_Widget* focus, FX_BOOL& bFind); | 89 IFWL_Widget* nextTab(IFWL_Widget* parent, IFWL_Widget* focus, FX_BOOL& bFind); |
112 int32_t CountRadioButtonGroup(IFWL_Widget* pFirst); | 90 int32_t CountRadioButtonGroup(IFWL_Widget* pFirst); |
113 IFWL_Widget* GetSiblingRadioButton(IFWL_Widget* pWidget, FX_BOOL bNext); | 91 IFWL_Widget* GetSiblingRadioButton(IFWL_Widget* pWidget, FX_BOOL bNext); |
114 IFWL_Widget* GetRadioButtonGroupHeader(IFWL_Widget* pRadioButton); | 92 IFWL_Widget* GetRadioButtonGroupHeader(IFWL_Widget* pRadioButton); |
115 void GetSameGroupRadioButton(IFWL_Widget* pRadioButton, CFX_PtrArray& group); | 93 void GetSameGroupRadioButton(IFWL_Widget* pRadioButton, CFX_PtrArray& group); |
116 IFWL_Widget* GetDefaultButton(IFWL_Widget* pParent); | 94 IFWL_Widget* GetDefaultButton(IFWL_Widget* pParent); |
117 void AddRedrawCounts(IFWL_Widget* pWidget); | 95 void AddRedrawCounts(IFWL_Widget* pWidget); |
118 void ResetRedrawCounts(IFWL_Widget* pWidget); | 96 void ResetRedrawCounts(IFWL_Widget* pWidget); |
119 IFWL_AdapterWidgetMgr* GetAdapterWidgetMgr() { return m_pAdapter; } | 97 CXFA_FWLAdapterWidgetMgr* GetAdapterWidgetMgr() { return m_pAdapter; } |
Tom Sepez
2016/04/28 16:42:12
nit: const method
dsinclair
2016/04/28 17:53:46
Done.
| |
120 CFWL_WidgetMgrDelegate* GetDelegate() { return m_pDelegate; } | 98 CFWL_WidgetMgrDelegate* GetDelegate() { return m_pDelegate; } |
Tom Sepez
2016/04/28 16:42:12
nit: const method
dsinclair
2016/04/28 17:53:46
Done.
| |
121 CFWL_WidgetMgrItem* GetWidgetMgrItem(IFWL_Widget* pWidget); | 99 CFWL_WidgetMgrItem* GetWidgetMgrItem(IFWL_Widget* pWidget); |
122 FX_BOOL IsThreadEnabled(); | 100 FX_BOOL IsThreadEnabled(); |
123 FX_BOOL IsFormDisabled(); | 101 FX_BOOL IsFormDisabled(); |
124 FX_BOOL GetAdapterPopupPos(IFWL_Widget* pWidget, | 102 FX_BOOL GetAdapterPopupPos(IFWL_Widget* pWidget, |
125 FX_FLOAT fMinHeight, | 103 FX_FLOAT fMinHeight, |
126 FX_FLOAT fMaxHeight, | 104 FX_FLOAT fMaxHeight, |
127 const CFX_RectF& rtAnchor, | 105 const CFX_RectF& rtAnchor, |
128 CFX_RectF& rtPopup); | 106 CFX_RectF& rtPopup); |
129 | 107 |
130 protected: | 108 protected: |
131 int32_t TravelWidgetMgr(CFWL_WidgetMgrItem* pParent, | 109 int32_t TravelWidgetMgr(CFWL_WidgetMgrItem* pParent, |
132 int32_t* pIndex, | 110 int32_t* pIndex, |
133 CFWL_WidgetMgrItem* pItem, | 111 CFWL_WidgetMgrItem* pItem, |
134 IFWL_Widget** pWidget = NULL); | 112 IFWL_Widget** pWidget = NULL); |
135 FX_BOOL IsAbleNative(IFWL_Widget* pWidget); | 113 FX_BOOL IsAbleNative(IFWL_Widget* pWidget); |
136 CFX_MapPtrToPtr m_mapWidgetItem; | 114 CFX_MapPtrToPtr m_mapWidgetItem; |
137 IFWL_AdapterWidgetMgr* m_pAdapter; | 115 CXFA_FWLAdapterWidgetMgr* m_pAdapter; |
138 CFWL_WidgetMgrDelegate* m_pDelegate; | 116 CFWL_WidgetMgrDelegate* m_pDelegate; |
139 friend class CFWL_WidgetMgrDelegate; | 117 friend class CFWL_WidgetMgrDelegate; |
140 uint32_t m_dwCapability; | 118 uint32_t m_dwCapability; |
141 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) | 119 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) |
142 CFX_RectF m_rtScreen; | 120 CFX_RectF m_rtScreen; |
143 #endif | 121 #endif |
144 }; | 122 }; |
145 | 123 |
146 class CFWL_WidgetMgrDelegate { | 124 class CFWL_WidgetMgrDelegate { |
147 public: | 125 public: |
(...skipping 20 matching lines...) Expand all Loading... | |
168 const CFX_Matrix* pMatrix); | 146 const CFX_Matrix* pMatrix); |
169 FX_BOOL IsNeedRepaint(IFWL_Widget* pWidget, | 147 FX_BOOL IsNeedRepaint(IFWL_Widget* pWidget, |
170 CFX_Matrix* pMatrix, | 148 CFX_Matrix* pMatrix, |
171 const CFX_RectF& rtDirty); | 149 const CFX_RectF& rtDirty); |
172 FX_BOOL bUseOffscreenDirect(IFWL_Widget* pWidget); | 150 FX_BOOL bUseOffscreenDirect(IFWL_Widget* pWidget); |
173 | 151 |
174 CFWL_WidgetMgr* m_pWidgetMgr; | 152 CFWL_WidgetMgr* m_pWidgetMgr; |
175 }; | 153 }; |
176 | 154 |
177 #endif // XFA_FWL_CORE_FWL_WIDGETMGRIMP_H_ | 155 #endif // XFA_FWL_CORE_FWL_WIDGETMGRIMP_H_ |
OLD | NEW |