diff options
author | tsepez <tsepez@chromium.org> | 2016-05-24 09:46:02 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-24 09:46:02 -0700 |
commit | 1529756d0d62638ea0fc7965416bef717ff47413 (patch) | |
tree | 81f94e0c8cc9e093a97bf59d907d051bb6086039 /xfa/fwl/core/fwl_widgetmgrimp.h | |
parent | ded3634145b214b11212a7c53faa8ba15a1789ca (diff) | |
download | pdfium-1529756d0d62638ea0fc7965416bef717ff47413.tar.xz |
Remove IWFL_WidgetMgr in favor of CFWL_WidgetMgr.
The pure virtual class isn't buying us anything, and is costing
us an otherwise unneeded vtable.
Fix pre-existing presubmit warning in fwl_noteimp.cpp:88:
If statement had no body and no else clause ...
Remove switch on enum() and make separate GetWidget() methods.
Review-Url: https://codereview.chromium.org/2004213002
Diffstat (limited to 'xfa/fwl/core/fwl_widgetmgrimp.h')
-rw-r--r-- | xfa/fwl/core/fwl_widgetmgrimp.h | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/xfa/fwl/core/fwl_widgetmgrimp.h b/xfa/fwl/core/fwl_widgetmgrimp.h index 6e4fffeca1..64fda0724e 100644 --- a/xfa/fwl/core/fwl_widgetmgrimp.h +++ b/xfa/fwl/core/fwl_widgetmgrimp.h @@ -12,7 +12,6 @@ #include "core/fxcrt/include/fx_system.h" #include "xfa/fwl/core/fwl_error.h" -#include "xfa/fwl/core/ifwl_widgetmgr.h" #include "xfa/fxgraphics/include/cfx_graphics.h" #define FWL_WGTMGR_DisableThread 0x00000001 @@ -58,21 +57,25 @@ class CFWL_WidgetMgrItem { #endif }; -class CFWL_WidgetMgr : public IFWL_WidgetMgr { +class CFWL_WidgetMgr { public: - CFWL_WidgetMgr(CXFA_FFApp* pAdapterNative); - ~CFWL_WidgetMgr() override; - - // IFWL_WidgetMgr: - int32_t CountWidgets(IFWL_Widget* pParent = NULL) override; - IFWL_Widget* GetWidget(int32_t nIndex, IFWL_Widget* pParent = NULL) override; - IFWL_Widget* GetWidget(IFWL_Widget* pWidget, - FWL_WGTRELATION eRelation) override; - int32_t GetWidgetIndex(IFWL_Widget* pWidget) override; - FX_BOOL SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) override; - FWL_Error RepaintWidget(IFWL_Widget* pWidget, - const CFX_RectF* pRect = NULL) override; - uint32_t GetCapability() override { return m_dwCapability; } + static CFWL_WidgetMgr* GetInstance(); + + explicit CFWL_WidgetMgr(CXFA_FFApp* pAdapterNative); + ~CFWL_WidgetMgr(); + + IFWL_Widget* GetParentWidget(IFWL_Widget* pWidget) const; + IFWL_Widget* GetOwnerWidget(IFWL_Widget* pWidget) const; + IFWL_Widget* GetFirstSiblingWidget(IFWL_Widget* pWidget) const; + IFWL_Widget* GetPriorSiblingWidget(IFWL_Widget* pWidget) const; + IFWL_Widget* GetNextSiblingWidget(IFWL_Widget* pWidget) const; + IFWL_Widget* GetLastSiblingWidget(IFWL_Widget* pWidget) const; + IFWL_Widget* GetFirstChildWidget(IFWL_Widget* pWidget) const; + IFWL_Widget* GetLastChildWidget(IFWL_Widget* pWidget) const; + IFWL_Widget* GetSystemFormWidget(IFWL_Widget* pWidget) const; + + FX_BOOL SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex); + FWL_Error RepaintWidget(IFWL_Widget* pWidget, const CFX_RectF* pRect = NULL); void AddWidget(IFWL_Widget* pWidget); void InsertWidget(IFWL_Widget* pParent, @@ -110,7 +113,7 @@ class CFWL_WidgetMgr : public IFWL_WidgetMgr { int32_t* pIndex, CFWL_WidgetMgrItem* pItem, IFWL_Widget** pWidget = NULL); - FX_BOOL IsAbleNative(IFWL_Widget* pWidget); + FX_BOOL IsAbleNative(IFWL_Widget* pWidget) const; uint32_t m_dwCapability; std::unique_ptr<CFWL_WidgetMgrDelegate> m_pDelegate; |