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_CFWL_WIDGETMGR_H_ | 7 #ifndef XFA_FWL_CORE_CFWL_WIDGETMGR_H_ |
8 #define XFA_FWL_CORE_CFWL_WIDGETMGR_H_ | 8 #define XFA_FWL_CORE_CFWL_WIDGETMGR_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 28 matching lines...) Expand all Loading... |
39 IFWL_Widget* const pWidget; | 39 IFWL_Widget* const pWidget; |
40 std::unique_ptr<CFX_Graphics> pOffscreen; | 40 std::unique_ptr<CFX_Graphics> pOffscreen; |
41 int32_t iRedrawCounter; | 41 int32_t iRedrawCounter; |
42 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) | 42 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) |
43 FX_BOOL bOutsideChanged; | 43 FX_BOOL bOutsideChanged; |
44 #endif | 44 #endif |
45 }; | 45 }; |
46 | 46 |
47 class CFWL_WidgetMgr { | 47 class CFWL_WidgetMgr { |
48 public: | 48 public: |
49 static CFWL_WidgetMgr* GetInstance(); | |
50 | |
51 explicit CFWL_WidgetMgr(CXFA_FFApp* pAdapterNative); | 49 explicit CFWL_WidgetMgr(CXFA_FFApp* pAdapterNative); |
52 ~CFWL_WidgetMgr(); | 50 ~CFWL_WidgetMgr(); |
53 | 51 |
54 IFWL_Widget* GetParentWidget(IFWL_Widget* pWidget) const; | 52 IFWL_Widget* GetParentWidget(IFWL_Widget* pWidget) const; |
55 IFWL_Widget* GetOwnerWidget(IFWL_Widget* pWidget) const; | 53 IFWL_Widget* GetOwnerWidget(IFWL_Widget* pWidget) const; |
56 IFWL_Widget* GetFirstSiblingWidget(IFWL_Widget* pWidget) const; | 54 IFWL_Widget* GetFirstSiblingWidget(IFWL_Widget* pWidget) const; |
57 IFWL_Widget* GetPriorSiblingWidget(IFWL_Widget* pWidget) const; | 55 IFWL_Widget* GetPriorSiblingWidget(IFWL_Widget* pWidget) const; |
58 IFWL_Widget* GetNextSiblingWidget(IFWL_Widget* pWidget) const; | 56 IFWL_Widget* GetNextSiblingWidget(IFWL_Widget* pWidget) const; |
59 IFWL_Widget* GetLastSiblingWidget(IFWL_Widget* pWidget) const; | 57 IFWL_Widget* GetLastSiblingWidget(IFWL_Widget* pWidget) const; |
60 IFWL_Widget* GetFirstChildWidget(IFWL_Widget* pWidget) const; | 58 IFWL_Widget* GetFirstChildWidget(IFWL_Widget* pWidget) const; |
(...skipping 29 matching lines...) Expand all Loading... |
90 CFWL_WidgetMgrItem* GetWidgetMgrItem(IFWL_Widget* pWidget) const; | 88 CFWL_WidgetMgrItem* GetWidgetMgrItem(IFWL_Widget* pWidget) const; |
91 bool IsThreadEnabled(); | 89 bool IsThreadEnabled(); |
92 bool IsFormDisabled(); | 90 bool IsFormDisabled(); |
93 FX_BOOL GetAdapterPopupPos(IFWL_Widget* pWidget, | 91 FX_BOOL GetAdapterPopupPos(IFWL_Widget* pWidget, |
94 FX_FLOAT fMinHeight, | 92 FX_FLOAT fMinHeight, |
95 FX_FLOAT fMaxHeight, | 93 FX_FLOAT fMaxHeight, |
96 const CFX_RectF& rtAnchor, | 94 const CFX_RectF& rtAnchor, |
97 CFX_RectF& rtPopup); | 95 CFX_RectF& rtPopup); |
98 | 96 |
99 protected: | 97 protected: |
| 98 friend class CFWL_WidgetMgrDelegate; |
| 99 |
100 int32_t TravelWidgetMgr(CFWL_WidgetMgrItem* pParent, | 100 int32_t TravelWidgetMgr(CFWL_WidgetMgrItem* pParent, |
101 int32_t* pIndex, | 101 int32_t* pIndex, |
102 CFWL_WidgetMgrItem* pItem, | 102 CFWL_WidgetMgrItem* pItem, |
103 IFWL_Widget** pWidget = nullptr); | 103 IFWL_Widget** pWidget = nullptr); |
104 FX_BOOL IsAbleNative(IFWL_Widget* pWidget) const; | 104 FX_BOOL IsAbleNative(IFWL_Widget* pWidget) const; |
105 | 105 |
106 uint32_t m_dwCapability; | 106 uint32_t m_dwCapability; |
107 std::unique_ptr<CFWL_WidgetMgrDelegate> m_pDelegate; | 107 std::unique_ptr<CFWL_WidgetMgrDelegate> m_pDelegate; |
108 std::map<IFWL_Widget*, std::unique_ptr<CFWL_WidgetMgrItem>> m_mapWidgetItem; | 108 std::map<IFWL_Widget*, std::unique_ptr<CFWL_WidgetMgrItem>> m_mapWidgetItem; |
109 CXFA_FWLAdapterWidgetMgr* const m_pAdapter; | 109 CXFA_FWLAdapterWidgetMgr* const m_pAdapter; |
110 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) | 110 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) |
111 CFX_RectF m_rtScreen; | 111 CFX_RectF m_rtScreen; |
112 #endif | 112 #endif |
113 friend class CFWL_WidgetMgrDelegate; | |
114 }; | 113 }; |
115 | 114 |
116 class CFWL_WidgetMgrDelegate { | 115 class CFWL_WidgetMgrDelegate { |
117 public: | 116 public: |
118 explicit CFWL_WidgetMgrDelegate(CFWL_WidgetMgr* pWidgetMgr); | 117 explicit CFWL_WidgetMgrDelegate(CFWL_WidgetMgr* pWidgetMgr); |
119 ~CFWL_WidgetMgrDelegate() {} | 118 ~CFWL_WidgetMgrDelegate() {} |
120 | 119 |
121 FWL_Error OnSetCapability(uint32_t dwCapability = FWL_WGTMGR_DisableThread); | 120 FWL_Error OnSetCapability(uint32_t dwCapability = FWL_WGTMGR_DisableThread); |
122 void OnProcessMessageToForm(CFWL_Message* pMessage); | 121 void OnProcessMessageToForm(CFWL_Message* pMessage); |
123 void OnDrawWidget(IFWL_Widget* pWidget, | 122 void OnDrawWidget(IFWL_Widget* pWidget, |
(...skipping 14 matching lines...) Expand all Loading... |
138 const CFX_Matrix* pMatrix); | 137 const CFX_Matrix* pMatrix); |
139 FX_BOOL IsNeedRepaint(IFWL_Widget* pWidget, | 138 FX_BOOL IsNeedRepaint(IFWL_Widget* pWidget, |
140 CFX_Matrix* pMatrix, | 139 CFX_Matrix* pMatrix, |
141 const CFX_RectF& rtDirty); | 140 const CFX_RectF& rtDirty); |
142 FX_BOOL bUseOffscreenDirect(IFWL_Widget* pWidget); | 141 FX_BOOL bUseOffscreenDirect(IFWL_Widget* pWidget); |
143 | 142 |
144 CFWL_WidgetMgr* m_pWidgetMgr; | 143 CFWL_WidgetMgr* m_pWidgetMgr; |
145 }; | 144 }; |
146 | 145 |
147 #endif // XFA_FWL_CORE_CFWL_WIDGETMGR_H_ | 146 #endif // XFA_FWL_CORE_CFWL_WIDGETMGR_H_ |
OLD | NEW |