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 #include "xfa/fwl/core/cfwl_picturebox.h" | 7 #include "xfa/fwl/core/cfwl_picturebox.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
11 CFWL_PictureBox::CFWL_PictureBox(const IFWL_App* app) : CFWL_Widget(app) {} | 11 CFWL_PictureBox::CFWL_PictureBox(const IFWL_App* app) : CFWL_Widget(app) {} |
12 | 12 |
13 CFWL_PictureBox::~CFWL_PictureBox() {} | 13 CFWL_PictureBox::~CFWL_PictureBox() {} |
14 | 14 |
15 void CFWL_PictureBox::Initialize() { | 15 void CFWL_PictureBox::Initialize() { |
16 ASSERT(!m_pIface); | 16 ASSERT(!m_pIface); |
17 | 17 |
18 std::unique_ptr<IFWL_PictureBox> pPictureBox(new IFWL_PictureBox( | 18 std::unique_ptr<IFWL_PictureBox> pPictureBox(new IFWL_PictureBox( |
19 m_pApp, m_pProperties->MakeWidgetImpProperties(&m_PictureBoxDP))); | 19 m_pApp, m_pProperties->MakeWidgetImpProperties(&m_PictureBoxDP))); |
20 pPictureBox->Initialize(); | 20 pPictureBox->Initialize(); |
21 | 21 |
22 m_pIface = std::move(pPictureBox); | 22 m_pIface = std::move(pPictureBox); |
23 CFWL_Widget::Initialize(); | 23 CFWL_Widget::Initialize(); |
24 } | 24 } |
25 | 25 |
26 IFWL_PictureBox* CFWL_PictureBox::GetWidget() { | |
27 return static_cast<IFWL_PictureBox*>(m_pIface.get()); | |
28 } | |
29 | |
30 const IFWL_PictureBox* CFWL_PictureBox::GetWidget() const { | |
31 return static_cast<IFWL_PictureBox*>(m_pIface.get()); | |
32 } | |
33 | |
34 CFX_DIBitmap* CFWL_PictureBox::GetPicture() { | 26 CFX_DIBitmap* CFWL_PictureBox::GetPicture() { |
35 return m_PictureBoxDP.m_pBitmap; | 27 return m_PictureBoxDP.m_pBitmap; |
36 } | 28 } |
37 | 29 |
38 FWL_Error CFWL_PictureBox::SetPicture(CFX_DIBitmap* pBitmap) { | 30 FWL_Error CFWL_PictureBox::SetPicture(CFX_DIBitmap* pBitmap) { |
39 m_PictureBoxDP.m_pBitmap = pBitmap; | 31 m_PictureBoxDP.m_pBitmap = pBitmap; |
40 return FWL_Error::Succeeded; | 32 return FWL_Error::Succeeded; |
41 } | 33 } |
42 | 34 |
43 FX_FLOAT CFWL_PictureBox::GetRotation() { | 35 FX_FLOAT CFWL_PictureBox::GetRotation() { |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 matrix.Rotate(m_fRotation); | 132 matrix.Rotate(m_fRotation); |
141 matrix.Translate(fLen, fWid); | 133 matrix.Translate(fLen, fWid); |
142 matrix.Scale(m_fScaleX, m_fScaleY); | 134 matrix.Scale(m_fScaleX, m_fScaleY); |
143 matrix.Translate(m_fOffSetX, m_fOffSetY); | 135 matrix.Translate(m_fOffSetX, m_fOffSetY); |
144 return FWL_Error::Succeeded; | 136 return FWL_Error::Succeeded; |
145 } | 137 } |
146 | 138 |
147 int32_t CFWL_PictureBox::CFWL_PictureBoxDP::GetFlipMode(IFWL_Widget* pWidget) { | 139 int32_t CFWL_PictureBox::CFWL_PictureBoxDP::GetFlipMode(IFWL_Widget* pWidget) { |
148 return m_iFlipMode; | 140 return m_iFlipMode; |
149 } | 141 } |
OLD | NEW |