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/cfwl_caret.h" | 7 #include "xfa/fwl/cfwl_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/cfwl_notedriver.h" |
13 #include "xfa/fwl/core/cfwl_themebackground.h" | 13 #include "xfa/fwl/cfwl_themebackground.h" |
14 #include "xfa/fwl/core/cfwl_timerinfo.h" | 14 #include "xfa/fwl/cfwl_timerinfo.h" |
15 #include "xfa/fwl/core/cfwl_widgetproperties.h" | 15 #include "xfa/fwl/cfwl_widgetproperties.h" |
16 #include "xfa/fwl/core/ifwl_themeprovider.h" | 16 #include "xfa/fwl/ifwl_themeprovider.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 CFWL_Caret::CFWL_Caret(const CFWL_App* app, | 24 CFWL_Caret::CFWL_Caret(const CFWL_App* app, |
25 std::unique_ptr<CFWL_WidgetProperties> properties, | 25 std::unique_ptr<CFWL_WidgetProperties> properties, |
26 CFWL_Widget* pOuter) | 26 CFWL_Widget* pOuter) |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 CFWL_Caret* pCaret = static_cast<CFWL_Caret*>(m_pWidget); | 103 CFWL_Caret* pCaret = static_cast<CFWL_Caret*>(m_pWidget); |
104 if (!(pCaret->GetStates() & FWL_STATE_CAT_HightLight)) | 104 if (!(pCaret->GetStates() & FWL_STATE_CAT_HightLight)) |
105 pCaret->SetStates(FWL_STATE_CAT_HightLight); | 105 pCaret->SetStates(FWL_STATE_CAT_HightLight); |
106 else | 106 else |
107 pCaret->RemoveStates(FWL_STATE_CAT_HightLight); | 107 pCaret->RemoveStates(FWL_STATE_CAT_HightLight); |
108 | 108 |
109 CFX_RectF rt = pCaret->GetWidgetRect(); | 109 CFX_RectF rt = pCaret->GetWidgetRect(); |
110 rt.Set(0, 0, rt.width + 1, rt.height); | 110 rt.Set(0, 0, rt.width + 1, rt.height); |
111 pCaret->Repaint(&rt); | 111 pCaret->Repaint(&rt); |
112 } | 112 } |
OLD | NEW |