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 21 matching lines...) Expand all Loading... |
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 CFWL_PictureBoxImp::~CFWL_PictureBoxImp() {} | 37 CFWL_PictureBoxImp::~CFWL_PictureBoxImp() {} |
38 FWL_ERR CFWL_PictureBoxImp::GetClassName(CFX_WideString& wsClass) const { | 38 FWL_ERR CFWL_PictureBoxImp::GetClassName(CFX_WideString& wsClass) const { |
39 wsClass = FWL_CLASS_PictureBox; | 39 wsClass = FWL_CLASS_PictureBox; |
40 return FWL_ERR_Succeeded; | 40 return FWL_ERR_Succeeded; |
41 } | 41 } |
42 uint32_t CFWL_PictureBoxImp::GetClassID() const { | 42 |
43 return FWL_CLASSHASH_PictureBox; | |
44 } | |
45 FWL_ERR CFWL_PictureBoxImp::Initialize() { | 43 FWL_ERR CFWL_PictureBoxImp::Initialize() { |
46 if (CFWL_WidgetImp::Initialize() != FWL_ERR_Succeeded) | 44 if (CFWL_WidgetImp::Initialize() != FWL_ERR_Succeeded) |
47 return FWL_ERR_Indefinite; | 45 return FWL_ERR_Indefinite; |
48 m_pDelegate = new CFWL_PictureBoxImpDelegate(this); | 46 m_pDelegate = new CFWL_PictureBoxImpDelegate(this); |
49 return FWL_ERR_Succeeded; | 47 return FWL_ERR_Succeeded; |
50 } | 48 } |
51 FWL_ERR CFWL_PictureBoxImp::Finalize() { | 49 FWL_ERR CFWL_PictureBoxImp::Finalize() { |
52 delete m_pDelegate; | 50 delete m_pDelegate; |
53 m_pDelegate = nullptr; | 51 m_pDelegate = nullptr; |
54 return CFWL_WidgetImp::Finalize(); | 52 return CFWL_WidgetImp::Finalize(); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 } | 139 } |
142 return FALSE; | 140 return FALSE; |
143 } | 141 } |
144 CFWL_PictureBoxImpDelegate::CFWL_PictureBoxImpDelegate( | 142 CFWL_PictureBoxImpDelegate::CFWL_PictureBoxImpDelegate( |
145 CFWL_PictureBoxImp* pOwner) | 143 CFWL_PictureBoxImp* pOwner) |
146 : m_pOwner(pOwner) {} | 144 : m_pOwner(pOwner) {} |
147 FWL_ERR CFWL_PictureBoxImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, | 145 FWL_ERR CFWL_PictureBoxImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, |
148 const CFX_Matrix* pMatrix) { | 146 const CFX_Matrix* pMatrix) { |
149 return m_pOwner->DrawWidget(pGraphics, pMatrix); | 147 return m_pOwner->DrawWidget(pGraphics, pMatrix); |
150 } | 148 } |
OLD | NEW |