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/basewidget/fwl_pictureboximp.h" | 7 #include "xfa/fwl/basewidget/fwl_pictureboximp.h" |
8 | 8 |
9 #include "xfa/fwl/core/fwl_noteimp.h" | 9 #include "xfa/fwl/core/fwl_noteimp.h" |
10 #include "xfa/fwl/core/fwl_widgetimp.h" | 10 #include "xfa/fwl/core/fwl_widgetimp.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 const CFWL_WidgetImpProperties& properties, | 27 const CFWL_WidgetImpProperties& properties, |
28 IFWL_Widget* pOuter) | 28 IFWL_Widget* pOuter) |
29 : CFWL_WidgetImp(properties, pOuter), | 29 : CFWL_WidgetImp(properties, pOuter), |
30 m_bTop(FALSE), | 30 m_bTop(FALSE), |
31 m_bVCenter(FALSE), | 31 m_bVCenter(FALSE), |
32 m_bButton(FALSE) { | 32 m_bButton(FALSE) { |
33 m_rtClient.Reset(); | 33 m_rtClient.Reset(); |
34 m_rtImage.Reset(); | 34 m_rtImage.Reset(); |
35 m_matrix.SetIdentity(); | 35 m_matrix.SetIdentity(); |
36 } | 36 } |
| 37 |
37 CFWL_PictureBoxImp::~CFWL_PictureBoxImp() {} | 38 CFWL_PictureBoxImp::~CFWL_PictureBoxImp() {} |
| 39 |
38 FWL_Error CFWL_PictureBoxImp::GetClassName(CFX_WideString& wsClass) const { | 40 FWL_Error CFWL_PictureBoxImp::GetClassName(CFX_WideString& wsClass) const { |
39 wsClass = FWL_CLASS_PictureBox; | 41 wsClass = FWL_CLASS_PictureBox; |
40 return FWL_Error::Succeeded; | 42 return FWL_Error::Succeeded; |
41 } | 43 } |
42 uint32_t CFWL_PictureBoxImp::GetClassID() const { | 44 |
43 return FWL_CLASSHASH_PictureBox; | 45 FWL_Type CFWL_PictureBoxImp::GetClassID() const { |
| 46 return FWL_Type::PictureBox; |
44 } | 47 } |
| 48 |
45 FWL_Error CFWL_PictureBoxImp::Initialize() { | 49 FWL_Error CFWL_PictureBoxImp::Initialize() { |
46 if (CFWL_WidgetImp::Initialize() != FWL_Error::Succeeded) | 50 if (CFWL_WidgetImp::Initialize() != FWL_Error::Succeeded) |
47 return FWL_Error::Indefinite; | 51 return FWL_Error::Indefinite; |
| 52 |
48 m_pDelegate = new CFWL_PictureBoxImpDelegate(this); | 53 m_pDelegate = new CFWL_PictureBoxImpDelegate(this); |
49 return FWL_Error::Succeeded; | 54 return FWL_Error::Succeeded; |
50 } | 55 } |
| 56 |
51 FWL_Error CFWL_PictureBoxImp::Finalize() { | 57 FWL_Error CFWL_PictureBoxImp::Finalize() { |
52 delete m_pDelegate; | 58 delete m_pDelegate; |
53 m_pDelegate = nullptr; | 59 m_pDelegate = nullptr; |
54 return CFWL_WidgetImp::Finalize(); | 60 return CFWL_WidgetImp::Finalize(); |
55 } | 61 } |
56 FWL_Error CFWL_PictureBoxImp::GetWidgetRect(CFX_RectF& rect, | 62 FWL_Error CFWL_PictureBoxImp::GetWidgetRect(CFX_RectF& rect, |
57 FX_BOOL bAutoSize) { | 63 FX_BOOL bAutoSize) { |
58 if (bAutoSize) { | 64 if (bAutoSize) { |
59 rect.Set(0, 0, 0, 0); | 65 rect.Set(0, 0, 0, 0); |
60 if (!m_pProperties->m_pDataProvider) | 66 if (!m_pProperties->m_pDataProvider) |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 } | 150 } |
145 | 151 |
146 CFWL_PictureBoxImpDelegate::CFWL_PictureBoxImpDelegate( | 152 CFWL_PictureBoxImpDelegate::CFWL_PictureBoxImpDelegate( |
147 CFWL_PictureBoxImp* pOwner) | 153 CFWL_PictureBoxImp* pOwner) |
148 : m_pOwner(pOwner) {} | 154 : m_pOwner(pOwner) {} |
149 | 155 |
150 void CFWL_PictureBoxImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, | 156 void CFWL_PictureBoxImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, |
151 const CFX_Matrix* pMatrix) { | 157 const CFX_Matrix* pMatrix) { |
152 m_pOwner->DrawWidget(pGraphics, pMatrix); | 158 m_pOwner->DrawWidget(pGraphics, pMatrix); |
153 } | 159 } |
OLD | NEW |