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_caretimp.h" | 7 #include "xfa/fwl/basewidget/fwl_caretimp.h" |
8 | 8 |
9 #include "xfa/fwl/basewidget/ifwl_caret.h" | 9 #include "xfa/fwl/basewidget/ifwl_caret.h" |
10 #include "xfa/fwl/core/cfwl_themebackground.h" | 10 #include "xfa/fwl/core/cfwl_themebackground.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 } | 46 } |
47 | 47 |
48 CFWL_CaretImp::~CFWL_CaretImp() { | 48 CFWL_CaretImp::~CFWL_CaretImp() { |
49 delete m_pTimer; | 49 delete m_pTimer; |
50 } | 50 } |
51 | 51 |
52 FWL_Error CFWL_CaretImp::GetClassName(CFX_WideString& wsClass) const { | 52 FWL_Error CFWL_CaretImp::GetClassName(CFX_WideString& wsClass) const { |
53 wsClass = FWL_CLASS_Caret; | 53 wsClass = FWL_CLASS_Caret; |
54 return FWL_Error::Succeeded; | 54 return FWL_Error::Succeeded; |
55 } | 55 } |
56 uint32_t CFWL_CaretImp::GetClassID() const { | 56 |
57 return FWL_CLASSHASH_Caret; | 57 FWL_Type CFWL_CaretImp::GetClassID() const { |
| 58 return FWL_Type::Caret; |
58 } | 59 } |
| 60 |
59 FWL_Error CFWL_CaretImp::Initialize() { | 61 FWL_Error CFWL_CaretImp::Initialize() { |
60 if (CFWL_WidgetImp::Initialize() != FWL_Error::Succeeded) | 62 if (CFWL_WidgetImp::Initialize() != FWL_Error::Succeeded) |
61 return FWL_Error::Indefinite; | 63 return FWL_Error::Indefinite; |
| 64 |
62 m_pDelegate = new CFWL_CaretImpDelegate(this); | 65 m_pDelegate = new CFWL_CaretImpDelegate(this); |
63 return FWL_Error::Succeeded; | 66 return FWL_Error::Succeeded; |
64 } | 67 } |
| 68 |
65 FWL_Error CFWL_CaretImp::Finalize() { | 69 FWL_Error CFWL_CaretImp::Finalize() { |
66 if (m_hTimer) { | 70 if (m_hTimer) { |
67 FWL_StopTimer(m_hTimer); | 71 FWL_StopTimer(m_hTimer); |
68 m_hTimer = NULL; | 72 m_hTimer = NULL; |
69 } | 73 } |
70 delete m_pDelegate; | 74 delete m_pDelegate; |
71 m_pDelegate = nullptr; | 75 m_pDelegate = nullptr; |
72 return CFWL_WidgetImp::Finalize(); | 76 return CFWL_WidgetImp::Finalize(); |
73 } | 77 } |
74 FWL_Error CFWL_CaretImp::DrawWidget(CFX_Graphics* pGraphics, | 78 FWL_Error CFWL_CaretImp::DrawWidget(CFX_Graphics* pGraphics, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 153 |
150 CFWL_CaretImpDelegate::CFWL_CaretImpDelegate(CFWL_CaretImp* pOwner) | 154 CFWL_CaretImpDelegate::CFWL_CaretImpDelegate(CFWL_CaretImp* pOwner) |
151 : m_pOwner(pOwner) {} | 155 : m_pOwner(pOwner) {} |
152 | 156 |
153 void CFWL_CaretImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {} | 157 void CFWL_CaretImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {} |
154 | 158 |
155 void CFWL_CaretImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, | 159 void CFWL_CaretImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, |
156 const CFX_Matrix* pMatrix) { | 160 const CFX_Matrix* pMatrix) { |
157 m_pOwner->DrawWidget(pGraphics, pMatrix); | 161 m_pOwner->DrawWidget(pGraphics, pMatrix); |
158 } | 162 } |
OLD | NEW |