| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | |
| 6 | |
| 7 #include "xfa/fwl/lightwidget/cfwl_caret.h" | |
| 8 | |
| 9 #include <memory> | |
| 10 | |
| 11 #include "xfa/fwl/basewidget/ifwl_caret.h" | |
| 12 #include "xfa/fwl/core/fwl_targetimp.h" | |
| 13 #include "xfa/fxgraphics/cfx_color.h" | |
| 14 #include "xfa/fwl/lightwidget/cfwl_edit.h" | |
| 15 | |
| 16 CFWL_Caret* CFWL_Caret::Create() { | |
| 17 return new CFWL_Caret; | |
| 18 } | |
| 19 | |
| 20 FWL_ERR CFWL_Caret::Initialize(const CFWL_WidgetProperties* pProperties) { | |
| 21 if (m_pIface) | |
| 22 return FWL_ERR_Indefinite; | |
| 23 if (pProperties) { | |
| 24 *m_pProperties = *pProperties; | |
| 25 } | |
| 26 std::unique_ptr<IFWL_Caret> pCaret(IFWL_Caret::Create( | |
| 27 m_pProperties->MakeWidgetImpProperties(nullptr), nullptr)); | |
| 28 FWL_ERR ret = pCaret->Initialize(); | |
| 29 if (ret != FWL_ERR_Succeeded) { | |
| 30 return ret; | |
| 31 } | |
| 32 m_pIface = pCaret.release(); | |
| 33 CFWL_Widget::Initialize(); | |
| 34 return FWL_ERR_Succeeded; | |
| 35 } | |
| 36 | |
| 37 FWL_ERR CFWL_Caret::ShowCaret(FX_BOOL bFlag) { | |
| 38 return static_cast<IFWL_Caret*>(m_pIface)->ShowCaret(bFlag); | |
| 39 } | |
| 40 | |
| 41 FWL_ERR CFWL_Caret::GetFrequency(uint32_t& elapse) { | |
| 42 return static_cast<IFWL_Caret*>(m_pIface)->GetFrequency(elapse); | |
| 43 } | |
| 44 | |
| 45 FWL_ERR CFWL_Caret::SetFrequency(uint32_t elapse) { | |
| 46 return static_cast<IFWL_Caret*>(m_pIface)->SetFrequency(elapse); | |
| 47 } | |
| 48 | |
| 49 FWL_ERR CFWL_Caret::SetColor(CFX_Color crFill) { | |
| 50 return static_cast<IFWL_Caret*>(m_pIface)->SetColor(crFill); | |
| 51 } | |
| 52 | |
| 53 CFWL_Caret::CFWL_Caret() {} | |
| 54 | |
| 55 CFWL_Caret::~CFWL_Caret() {} | |
| OLD | NEW |