diff options
author | dsinclair <dsinclair@chromium.org> | 2016-11-15 12:33:06 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-11-15 12:33:06 -0800 |
commit | 38eaf4b11383e24a00192132b683cc07e38622a6 (patch) | |
tree | 169f9d48784035519ddee9191aa412cc817a4531 /xfa/fwl/core/cfwl_picturebox.cpp | |
parent | 05b9a317d66c29f740e4b0e89ea87143a11d61fc (diff) | |
download | pdfium-38eaf4b11383e24a00192132b683cc07e38622a6.tar.xz |
Cleanup cfwl_* files.
This Cl cleans up the visibility, method usage and return values in the
remaining CFWL files.
Review-Url: https://codereview.chromium.org/2498163002
Diffstat (limited to 'xfa/fwl/core/cfwl_picturebox.cpp')
-rw-r--r-- | xfa/fwl/core/cfwl_picturebox.cpp | 107 |
1 files changed, 1 insertions, 106 deletions
diff --git a/xfa/fwl/core/cfwl_picturebox.cpp b/xfa/fwl/core/cfwl_picturebox.cpp index b701ae7eba..4b8bf70d07 100644 --- a/xfa/fwl/core/cfwl_picturebox.cpp +++ b/xfa/fwl/core/cfwl_picturebox.cpp @@ -10,16 +10,7 @@ #include "third_party/base/ptr_util.h" -CFWL_PictureBox::CFWL_PictureBox(const IFWL_App* app) - : CFWL_Widget(app), - m_pBitmap(nullptr), - m_iOpacity(0), - m_iFlipMode(0), - m_fRotation(0.0f), - m_fScaleX(1.0f), - m_fScaleY(1.0f), - m_fOffSetX(0.0f), - m_fOffSetY(0.0f) {} +CFWL_PictureBox::CFWL_PictureBox(const IFWL_App* app) : CFWL_Widget(app) {} CFWL_PictureBox::~CFWL_PictureBox() {} @@ -32,101 +23,5 @@ void CFWL_PictureBox::Initialize() { CFWL_Widget::Initialize(); } -CFX_DIBitmap* CFWL_PictureBox::GetPicture() { - return m_pBitmap; -} - -FWL_Error CFWL_PictureBox::SetPicture(CFX_DIBitmap* pBitmap) { - m_pBitmap = pBitmap; - return FWL_Error::Succeeded; -} - -FX_FLOAT CFWL_PictureBox::GetRotation() { - return m_fRotation; -} - -FWL_Error CFWL_PictureBox::SetRotation(FX_FLOAT fRotation) { - m_fRotation = fRotation; - return FWL_Error::Succeeded; -} - -int32_t CFWL_PictureBox::GetFlipMode() { - return GetFlipMode(m_pIface.get()); -} - -FWL_Error CFWL_PictureBox::SetFlipMode(int32_t iFlipMode) { - m_iFlipMode = iFlipMode; - return FWL_Error::Succeeded; -} - -int32_t CFWL_PictureBox::GetOpacity() { - return GetOpacity(m_pIface.get()); -} - -FWL_Error CFWL_PictureBox::SetOpacity(int32_t iOpacity) { - m_iOpacity = iOpacity; - return FWL_Error::Succeeded; -} - -FWL_Error CFWL_PictureBox::GetScale(FX_FLOAT& fScaleX, FX_FLOAT& fScaleY) { - CFX_Matrix matrix; - GetMatrix(m_pIface.get(), matrix); - matrix.Scale(fScaleX, fScaleY); - return FWL_Error::Succeeded; -} - -FWL_Error CFWL_PictureBox::SetScale(FX_FLOAT fScaleX, FX_FLOAT fScaleY) { - m_fScaleX = fScaleX; - m_fScaleY = fScaleY; - return FWL_Error::Succeeded; -} - -FWL_Error CFWL_PictureBox::GetOffset(FX_FLOAT& fx, FX_FLOAT& fy) { - CFX_Matrix matrix; - GetMatrix(m_pIface.get(), matrix); - fx = matrix.e; - fy = matrix.f; - return FWL_Error::Succeeded; -} - -FWL_Error CFWL_PictureBox::SetOffset(FX_FLOAT fx, FX_FLOAT fy) { - m_fOffSetX = fx; - m_fOffSetY = fy; - return FWL_Error::Succeeded; -} - void CFWL_PictureBox::GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption) {} - -CFX_DIBitmap* CFWL_PictureBox::GetPicture(IFWL_Widget* pWidget) { - return m_pBitmap; -} - -CFX_DIBitmap* CFWL_PictureBox::GetErrorPicture(IFWL_Widget* pWidget) { - return m_pBitmap; -} - -CFX_DIBitmap* CFWL_PictureBox::GetInitialPicture(IFWL_Widget* pWidget) { - return m_pBitmap; -} - -int32_t CFWL_PictureBox::GetOpacity(IFWL_Widget* pWidget) { - return m_iOpacity; -} - -void CFWL_PictureBox::GetMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) { - CFX_RectF rect; - pWidget->GetClientRect(rect); - FX_FLOAT fLen = rect.width / 2; - FX_FLOAT fWid = rect.height / 2; - matrix.SetIdentity(); - matrix.Translate(-fLen, -fWid); - matrix.Rotate(m_fRotation); - matrix.Translate(fLen, fWid); - matrix.Scale(m_fScaleX, m_fScaleY); - matrix.Translate(m_fOffSetX, m_fOffSetY); -} - -int32_t CFWL_PictureBox::GetFlipMode(IFWL_Widget* pWidget) { - return m_iFlipMode; -} |