| 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 20 matching lines...) Expand all Loading... |
| 31 FWL_Error IFWL_Caret::SetFrequency(uint32_t elapse) { | 31 FWL_Error IFWL_Caret::SetFrequency(uint32_t elapse) { |
| 32 return static_cast<CFWL_CaretImp*>(GetImpl())->SetFrequency(elapse); | 32 return static_cast<CFWL_CaretImp*>(GetImpl())->SetFrequency(elapse); |
| 33 } | 33 } |
| 34 FWL_Error IFWL_Caret::SetColor(CFX_Color crFill) { | 34 FWL_Error IFWL_Caret::SetColor(CFX_Color crFill) { |
| 35 return static_cast<CFWL_CaretImp*>(GetImpl())->SetColor(crFill); | 35 return static_cast<CFWL_CaretImp*>(GetImpl())->SetColor(crFill); |
| 36 } | 36 } |
| 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_pTimer(new CFWL_CaretTimer(this)), |
| 41 m_pTimerInfo(nullptr), | 42 m_pTimerInfo(nullptr), |
| 42 m_dwElapse(400), | 43 m_dwElapse(400), |
| 43 m_bSetColor(FALSE) { | 44 m_bSetColor(FALSE) { |
| 44 m_pTimer = new CFWL_CaretTimer(this); | |
| 45 SetStates(FWL_STATE_CAT_HightLight); | 45 SetStates(FWL_STATE_CAT_HightLight); |
| 46 } | 46 } |
| 47 | 47 |
| 48 CFWL_CaretImp::~CFWL_CaretImp() { | 48 CFWL_CaretImp::~CFWL_CaretImp() {} |
| 49 delete m_pTimer; | |
| 50 } | |
| 51 | 49 |
| 52 FWL_Error CFWL_CaretImp::GetClassName(CFX_WideString& wsClass) const { | 50 FWL_Error CFWL_CaretImp::GetClassName(CFX_WideString& wsClass) const { |
| 53 wsClass = FWL_CLASS_Caret; | 51 wsClass = FWL_CLASS_Caret; |
| 54 return FWL_Error::Succeeded; | 52 return FWL_Error::Succeeded; |
| 55 } | 53 } |
| 56 | 54 |
| 57 FWL_Type CFWL_CaretImp::GetClassID() const { | 55 FWL_Type CFWL_CaretImp::GetClassID() const { |
| 58 return FWL_Type::Caret; | 56 return FWL_Type::Caret; |
| 59 } | 57 } |
| 60 | 58 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 148 |
| 151 CFWL_CaretImpDelegate::CFWL_CaretImpDelegate(CFWL_CaretImp* pOwner) | 149 CFWL_CaretImpDelegate::CFWL_CaretImpDelegate(CFWL_CaretImp* pOwner) |
| 152 : m_pOwner(pOwner) {} | 150 : m_pOwner(pOwner) {} |
| 153 | 151 |
| 154 void CFWL_CaretImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {} | 152 void CFWL_CaretImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {} |
| 155 | 153 |
| 156 void CFWL_CaretImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, | 154 void CFWL_CaretImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, |
| 157 const CFX_Matrix* pMatrix) { | 155 const CFX_Matrix* pMatrix) { |
| 158 m_pOwner->DrawWidget(pGraphics, pMatrix); | 156 m_pOwner->DrawWidget(pGraphics, pMatrix); |
| 159 } | 157 } |
| OLD | NEW |