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/core/ifwl_caret.h" | 7 #include "xfa/fwl/core/ifwl_caret.h" |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "third_party/base/ptr_util.h" | 11 #include "third_party/base/ptr_util.h" |
12 #include "xfa/fwl/core/cfwl_notedriver.h" | 12 #include "xfa/fwl/core/cfwl_notedriver.h" |
13 #include "xfa/fwl/core/cfwl_themebackground.h" | 13 #include "xfa/fwl/core/cfwl_themebackground.h" |
| 14 #include "xfa/fwl/core/cfwl_timerinfo.h" |
14 #include "xfa/fwl/core/cfwl_widgetproperties.h" | 15 #include "xfa/fwl/core/cfwl_widgetproperties.h" |
15 #include "xfa/fwl/core/ifwl_themeprovider.h" | 16 #include "xfa/fwl/core/ifwl_themeprovider.h" |
16 #include "xfa/fwl/core/ifwl_timerinfo.h" | |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 const uint32_t kFrequency = 400; | 20 const uint32_t kFrequency = 400; |
21 | 21 |
22 } // namespace | 22 } // namespace |
23 | 23 |
24 IFWL_Caret::IFWL_Caret(const IFWL_App* app, | 24 IFWL_Caret::IFWL_Caret(const IFWL_App* app, |
25 std::unique_ptr<CFWL_WidgetProperties> properties, | 25 std::unique_ptr<CFWL_WidgetProperties> properties, |
26 IFWL_Widget* pOuter) | 26 IFWL_Widget* pOuter) |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 pTheme->DrawBackground(¶m); | 85 pTheme->DrawBackground(¶m); |
86 } | 86 } |
87 | 87 |
88 void IFWL_Caret::OnProcessMessage(CFWL_Message* pMessage) {} | 88 void IFWL_Caret::OnProcessMessage(CFWL_Message* pMessage) {} |
89 | 89 |
90 void IFWL_Caret::OnDrawWidget(CFX_Graphics* pGraphics, | 90 void IFWL_Caret::OnDrawWidget(CFX_Graphics* pGraphics, |
91 const CFX_Matrix* pMatrix) { | 91 const CFX_Matrix* pMatrix) { |
92 DrawWidget(pGraphics, pMatrix); | 92 DrawWidget(pGraphics, pMatrix); |
93 } | 93 } |
94 | 94 |
95 IFWL_Caret::Timer::Timer(IFWL_Caret* pCaret) : IFWL_Timer(pCaret) {} | 95 IFWL_Caret::Timer::Timer(IFWL_Caret* pCaret) : CFWL_Timer(pCaret) {} |
96 | 96 |
97 void IFWL_Caret::Timer::Run(IFWL_TimerInfo* pTimerInfo) { | 97 void IFWL_Caret::Timer::Run(CFWL_TimerInfo* pTimerInfo) { |
98 IFWL_Caret* pCaret = static_cast<IFWL_Caret*>(m_pWidget); | 98 IFWL_Caret* pCaret = static_cast<IFWL_Caret*>(m_pWidget); |
99 pCaret->SetStates(FWL_STATE_CAT_HightLight, | 99 pCaret->SetStates(FWL_STATE_CAT_HightLight, |
100 !(pCaret->GetStates() & FWL_STATE_CAT_HightLight)); | 100 !(pCaret->GetStates() & FWL_STATE_CAT_HightLight)); |
101 | 101 |
102 CFX_RectF rt; | 102 CFX_RectF rt; |
103 pCaret->GetWidgetRect(rt); | 103 pCaret->GetWidgetRect(rt); |
104 rt.Set(0, 0, rt.width + 1, rt.height); | 104 rt.Set(0, 0, rt.width + 1, rt.height); |
105 pCaret->Repaint(&rt); | 105 pCaret->Repaint(&rt); |
106 } | 106 } |
OLD | NEW |