| 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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 CFWL_CaretImp::CFWL_CaretImp(const CFWL_WidgetImpProperties& properties, | 38 CFWL_CaretImp::CFWL_CaretImp(const CFWL_WidgetImpProperties& properties, |
| 39 IFWL_Widget* pOuter) | 39 IFWL_Widget* pOuter) |
| 40 : CFWL_WidgetImp(properties, pOuter), | 40 : CFWL_WidgetImp(properties, pOuter), |
| 41 m_hTimer(nullptr), | 41 m_hTimer(nullptr), |
| 42 m_dwElapse(400), | 42 m_dwElapse(400), |
| 43 m_bSetColor(FALSE) { | 43 m_bSetColor(FALSE) { |
| 44 m_pTimer = new CFWL_CaretTimer(this); | 44 m_pTimer = new CFWL_CaretTimer(this); |
| 45 SetStates(FWL_STATE_CAT_HightLight); | 45 SetStates(FWL_STATE_CAT_HightLight); |
| 46 } | 46 } |
| 47 |
| 47 CFWL_CaretImp::~CFWL_CaretImp() { | 48 CFWL_CaretImp::~CFWL_CaretImp() { |
| 48 if (m_pTimer) { | 49 delete m_pTimer; |
| 49 delete m_pTimer; | |
| 50 m_pTimer = NULL; | |
| 51 } | |
| 52 } | 50 } |
| 51 |
| 53 FWL_ERR CFWL_CaretImp::GetClassName(CFX_WideString& wsClass) const { | 52 FWL_ERR CFWL_CaretImp::GetClassName(CFX_WideString& wsClass) const { |
| 54 wsClass = FWL_CLASS_Caret; | 53 wsClass = FWL_CLASS_Caret; |
| 55 return FWL_ERR_Succeeded; | 54 return FWL_ERR_Succeeded; |
| 56 } | 55 } |
| 57 uint32_t CFWL_CaretImp::GetClassID() const { | 56 uint32_t CFWL_CaretImp::GetClassID() const { |
| 58 return FWL_CLASSHASH_Caret; | 57 return FWL_CLASSHASH_Caret; |
| 59 } | 58 } |
| 60 FWL_ERR CFWL_CaretImp::Initialize() { | 59 FWL_ERR CFWL_CaretImp::Initialize() { |
| 61 if (CFWL_WidgetImp::Initialize() != FWL_ERR_Succeeded) | 60 if (CFWL_WidgetImp::Initialize() != FWL_ERR_Succeeded) |
| 62 return FWL_ERR_Indefinite; | 61 return FWL_ERR_Indefinite; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 } | 147 } |
| 149 CFWL_CaretImpDelegate::CFWL_CaretImpDelegate(CFWL_CaretImp* pOwner) | 148 CFWL_CaretImpDelegate::CFWL_CaretImpDelegate(CFWL_CaretImp* pOwner) |
| 150 : m_pOwner(pOwner) {} | 149 : m_pOwner(pOwner) {} |
| 151 int32_t CFWL_CaretImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { | 150 int32_t CFWL_CaretImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { |
| 152 return 1; | 151 return 1; |
| 153 } | 152 } |
| 154 FWL_ERR CFWL_CaretImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, | 153 FWL_ERR CFWL_CaretImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, |
| 155 const CFX_Matrix* pMatrix) { | 154 const CFX_Matrix* pMatrix) { |
| 156 return m_pOwner->DrawWidget(pGraphics, pMatrix); | 155 return m_pOwner->DrawWidget(pGraphics, pMatrix); |
| 157 } | 156 } |
| OLD | NEW |