diff options
author | dsinclair <dsinclair@chromium.org> | 2016-11-21 09:04:05 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-11-21 09:04:05 -0800 |
commit | dd17234c42e4572b85b6d74a07bc901974d061be (patch) | |
tree | 31a9c3dc96bc3a637f204949f1689a501ada6906 /xfa/fwl/core/ifwl_widget.cpp | |
parent | b4455b90b1c86ab94986e4f470c963f1e91b27ba (diff) | |
download | pdfium-dd17234c42e4572b85b6d74a07bc901974d061be.tar.xz |
Split fwl/core class pt I.
Split classes in FWL to be single class per file. In the case of data providers
which added no new methods, removed and used the IFWL_DataProvider directly.
Review-Url: https://codereview.chromium.org/2506253004
Diffstat (limited to 'xfa/fwl/core/ifwl_widget.cpp')
-rw-r--r-- | xfa/fwl/core/ifwl_widget.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/xfa/fwl/core/ifwl_widget.cpp b/xfa/fwl/core/ifwl_widget.cpp index 8bb148247e..01f9a4d5d4 100644 --- a/xfa/fwl/core/ifwl_widget.cpp +++ b/xfa/fwl/core/ifwl_widget.cpp @@ -118,12 +118,23 @@ void IFWL_Widget::SetParent(IFWL_Widget* pParent) { m_pWidgetMgr->SetParent(pParent, this); } +uint32_t IFWL_Widget::GetStyles() const { + return m_pProperties->m_dwStyles; +} + void IFWL_Widget::ModifyStyles(uint32_t dwStylesAdded, uint32_t dwStylesRemoved) { m_pProperties->m_dwStyles = (m_pProperties->m_dwStyles & ~dwStylesRemoved) | dwStylesAdded; } +uint32_t IFWL_Widget::GetStylesEx() const { + return m_pProperties->m_dwStyleExes; +} +uint32_t IFWL_Widget::GetStates() const { + return m_pProperties->m_dwStates; +} + void IFWL_Widget::ModifyStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved) { m_pProperties->m_dwStyleExes = @@ -272,6 +283,14 @@ void IFWL_Widget::GetMatrix(CFX_Matrix& matrix, bool bGlobal) { parents.RemoveAll(); } +IFWL_ThemeProvider* IFWL_Widget::GetThemeProvider() const { + return m_pProperties->m_pThemeProvider; +} + +IFWL_Widget::DataProvider* IFWL_Widget::GetDataProvider() const { + return m_pProperties->m_pDataProvider; +} + void IFWL_Widget::DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) {} @@ -279,6 +298,43 @@ void IFWL_Widget::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) { m_pProperties->m_pThemeProvider = pThemeProvider; } +bool IFWL_Widget::IsEnabled() const { + return (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) == 0; +} + +bool IFWL_Widget::IsActive() const { + return (m_pProperties->m_dwStates & FWL_WGTSTATE_Deactivated) == 0; +} + +bool IFWL_Widget::HasBorder() const { + return !!(m_pProperties->m_dwStyles & FWL_WGTSTYLE_Border); +} + +bool IFWL_Widget::HasEdge() const { + return !!(m_pProperties->m_dwStyles & FWL_WGTSTYLE_EdgeMask); +} + +bool IFWL_Widget::IsVisible() const { + return (m_pProperties->m_dwStates & FWL_WGTSTATE_Invisible) == 0; +} + +bool IFWL_Widget::IsOverLapper() const { + return (m_pProperties->m_dwStyles & FWL_WGTSTYLE_WindowTypeMask) == + FWL_WGTSTYLE_OverLapper; +} + +bool IFWL_Widget::IsPopup() const { + return !!(m_pProperties->m_dwStyles & FWL_WGTSTYLE_Popup); +} + +bool IFWL_Widget::IsChild() const { + return !!(m_pProperties->m_dwStyles & FWL_WGTSTYLE_Child); +} + +bool IFWL_Widget::IsOffscreen() const { + return !!(m_pProperties->m_dwStyles & FWL_WGTSTYLE_Offscreen); +} + void IFWL_Widget::GetEdgeRect(CFX_RectF& rtEdge) { rtEdge = m_pProperties->m_rtWidget; rtEdge.left = rtEdge.top = 0; |