| 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 <map> | 10 #include <map> |
| 11 #include <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 #include "core/fxcrt/include/fx_system.h" | 13 #include "core/fxcrt/include/fx_system.h" |
| 14 #include "xfa/fwl/core/fwl_error.h" | 14 #include "xfa/fwl/core/fwl_error.h" |
| 15 #include "xfa/fwl/core/ifwl_widgetmgr.h" | |
| 16 #include "xfa/fxgraphics/include/cfx_graphics.h" | 15 #include "xfa/fxgraphics/include/cfx_graphics.h" |
| 17 | 16 |
| 18 #define FWL_WGTMGR_DisableThread 0x00000001 | 17 #define FWL_WGTMGR_DisableThread 0x00000001 |
| 19 #define FWL_WGTMGR_DisableForm 0x00000002 | 18 #define FWL_WGTMGR_DisableForm 0x00000002 |
| 20 | 19 |
| 21 class CFWL_Message; | 20 class CFWL_Message; |
| 22 class CFWL_WidgetMgrDelegate; | 21 class CFWL_WidgetMgrDelegate; |
| 23 class CXFA_FFApp; | 22 class CXFA_FFApp; |
| 24 class CXFA_FWLAdapterWidgetMgr; | 23 class CXFA_FWLAdapterWidgetMgr; |
| 25 class CFX_Graphics; | 24 class CFX_Graphics; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 51 CFWL_WidgetMgrItem* pPrevious; | 50 CFWL_WidgetMgrItem* pPrevious; |
| 52 CFWL_WidgetMgrItem* pNext; | 51 CFWL_WidgetMgrItem* pNext; |
| 53 IFWL_Widget* const pWidget; | 52 IFWL_Widget* const pWidget; |
| 54 std::unique_ptr<CFX_Graphics> pOffscreen; | 53 std::unique_ptr<CFX_Graphics> pOffscreen; |
| 55 int32_t iRedrawCounter; | 54 int32_t iRedrawCounter; |
| 56 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) | 55 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) |
| 57 FX_BOOL bOutsideChanged; | 56 FX_BOOL bOutsideChanged; |
| 58 #endif | 57 #endif |
| 59 }; | 58 }; |
| 60 | 59 |
| 61 class CFWL_WidgetMgr : public IFWL_WidgetMgr { | 60 class CFWL_WidgetMgr { |
| 62 public: | 61 public: |
| 63 CFWL_WidgetMgr(CXFA_FFApp* pAdapterNative); | 62 static CFWL_WidgetMgr* GetInstance(); |
| 64 ~CFWL_WidgetMgr() override; | |
| 65 | 63 |
| 66 // IFWL_WidgetMgr: | 64 explicit CFWL_WidgetMgr(CXFA_FFApp* pAdapterNative); |
| 67 int32_t CountWidgets(IFWL_Widget* pParent = NULL) override; | 65 ~CFWL_WidgetMgr(); |
| 68 IFWL_Widget* GetWidget(int32_t nIndex, IFWL_Widget* pParent = NULL) override; | 66 |
| 69 IFWL_Widget* GetWidget(IFWL_Widget* pWidget, | 67 IFWL_Widget* GetParentWidget(IFWL_Widget* pWidget) const; |
| 70 FWL_WGTRELATION eRelation) override; | 68 IFWL_Widget* GetOwnerWidget(IFWL_Widget* pWidget) const; |
| 71 int32_t GetWidgetIndex(IFWL_Widget* pWidget) override; | 69 IFWL_Widget* GetFirstSiblingWidget(IFWL_Widget* pWidget) const; |
| 72 FX_BOOL SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) override; | 70 IFWL_Widget* GetPriorSiblingWidget(IFWL_Widget* pWidget) const; |
| 73 FWL_Error RepaintWidget(IFWL_Widget* pWidget, | 71 IFWL_Widget* GetNextSiblingWidget(IFWL_Widget* pWidget) const; |
| 74 const CFX_RectF* pRect = NULL) override; | 72 IFWL_Widget* GetLastSiblingWidget(IFWL_Widget* pWidget) const; |
| 75 uint32_t GetCapability() override { return m_dwCapability; } | 73 IFWL_Widget* GetFirstChildWidget(IFWL_Widget* pWidget) const; |
| 74 IFWL_Widget* GetLastChildWidget(IFWL_Widget* pWidget) const; |
| 75 IFWL_Widget* GetSystemFormWidget(IFWL_Widget* pWidget) const; |
| 76 |
| 77 FX_BOOL SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex); |
| 78 FWL_Error RepaintWidget(IFWL_Widget* pWidget, const CFX_RectF* pRect = NULL); |
| 76 | 79 |
| 77 void AddWidget(IFWL_Widget* pWidget); | 80 void AddWidget(IFWL_Widget* pWidget); |
| 78 void InsertWidget(IFWL_Widget* pParent, | 81 void InsertWidget(IFWL_Widget* pParent, |
| 79 IFWL_Widget* pChild, | 82 IFWL_Widget* pChild, |
| 80 int32_t nIndex = -1); | 83 int32_t nIndex = -1); |
| 81 void RemoveWidget(IFWL_Widget* pWidget); | 84 void RemoveWidget(IFWL_Widget* pWidget); |
| 82 void SetOwner(IFWL_Widget* pOwner, IFWL_Widget* pOwned); | 85 void SetOwner(IFWL_Widget* pOwner, IFWL_Widget* pOwned); |
| 83 void SetParent(IFWL_Widget* pParent, IFWL_Widget* pChild); | 86 void SetParent(IFWL_Widget* pParent, IFWL_Widget* pChild); |
| 84 FX_BOOL IsChild(IFWL_Widget* pChild, IFWL_Widget* pParent); | 87 FX_BOOL IsChild(IFWL_Widget* pChild, IFWL_Widget* pParent); |
| 85 FWL_Error SetWidgetRect_Native(IFWL_Widget* pWidget, const CFX_RectF& rect); | 88 FWL_Error SetWidgetRect_Native(IFWL_Widget* pWidget, const CFX_RectF& rect); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 103 FX_FLOAT fMinHeight, | 106 FX_FLOAT fMinHeight, |
| 104 FX_FLOAT fMaxHeight, | 107 FX_FLOAT fMaxHeight, |
| 105 const CFX_RectF& rtAnchor, | 108 const CFX_RectF& rtAnchor, |
| 106 CFX_RectF& rtPopup); | 109 CFX_RectF& rtPopup); |
| 107 | 110 |
| 108 protected: | 111 protected: |
| 109 int32_t TravelWidgetMgr(CFWL_WidgetMgrItem* pParent, | 112 int32_t TravelWidgetMgr(CFWL_WidgetMgrItem* pParent, |
| 110 int32_t* pIndex, | 113 int32_t* pIndex, |
| 111 CFWL_WidgetMgrItem* pItem, | 114 CFWL_WidgetMgrItem* pItem, |
| 112 IFWL_Widget** pWidget = NULL); | 115 IFWL_Widget** pWidget = NULL); |
| 113 FX_BOOL IsAbleNative(IFWL_Widget* pWidget); | 116 FX_BOOL IsAbleNative(IFWL_Widget* pWidget) const; |
| 114 | 117 |
| 115 uint32_t m_dwCapability; | 118 uint32_t m_dwCapability; |
| 116 std::unique_ptr<CFWL_WidgetMgrDelegate> m_pDelegate; | 119 std::unique_ptr<CFWL_WidgetMgrDelegate> m_pDelegate; |
| 117 std::map<IFWL_Widget*, std::unique_ptr<CFWL_WidgetMgrItem>> m_mapWidgetItem; | 120 std::map<IFWL_Widget*, std::unique_ptr<CFWL_WidgetMgrItem>> m_mapWidgetItem; |
| 118 CXFA_FWLAdapterWidgetMgr* const m_pAdapter; | 121 CXFA_FWLAdapterWidgetMgr* const m_pAdapter; |
| 119 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) | 122 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) |
| 120 CFX_RectF m_rtScreen; | 123 CFX_RectF m_rtScreen; |
| 121 #endif | 124 #endif |
| 122 friend class CFWL_WidgetMgrDelegate; | 125 friend class CFWL_WidgetMgrDelegate; |
| 123 }; | 126 }; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 147 const CFX_Matrix* pMatrix); | 150 const CFX_Matrix* pMatrix); |
| 148 FX_BOOL IsNeedRepaint(IFWL_Widget* pWidget, | 151 FX_BOOL IsNeedRepaint(IFWL_Widget* pWidget, |
| 149 CFX_Matrix* pMatrix, | 152 CFX_Matrix* pMatrix, |
| 150 const CFX_RectF& rtDirty); | 153 const CFX_RectF& rtDirty); |
| 151 FX_BOOL bUseOffscreenDirect(IFWL_Widget* pWidget); | 154 FX_BOOL bUseOffscreenDirect(IFWL_Widget* pWidget); |
| 152 | 155 |
| 153 CFWL_WidgetMgr* m_pWidgetMgr; | 156 CFWL_WidgetMgr* m_pWidgetMgr; |
| 154 }; | 157 }; |
| 155 | 158 |
| 156 #endif // XFA_FWL_CORE_FWL_WIDGETMGRIMP_H_ | 159 #endif // XFA_FWL_CORE_FWL_WIDGETMGRIMP_H_ |
| OLD | NEW |