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_scrollbar.h" | 7 #include "xfa/fwl/core/ifwl_scrollbar.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
13 #include "third_party/base/ptr_util.h" | 13 #include "third_party/base/ptr_util.h" |
14 #include "xfa/fwl/core/cfwl_msgmouse.h" | 14 #include "xfa/fwl/core/cfwl_msgmouse.h" |
15 #include "xfa/fwl/core/cfwl_msgmousewheel.h" | 15 #include "xfa/fwl/core/cfwl_msgmousewheel.h" |
16 #include "xfa/fwl/core/cfwl_notedriver.h" | 16 #include "xfa/fwl/core/cfwl_notedriver.h" |
17 #include "xfa/fwl/core/cfwl_themebackground.h" | 17 #include "xfa/fwl/core/cfwl_themebackground.h" |
18 #include "xfa/fwl/core/cfwl_themepart.h" | 18 #include "xfa/fwl/core/cfwl_themepart.h" |
| 19 #include "xfa/fwl/core/cfwl_timerinfo.h" |
19 #include "xfa/fwl/core/ifwl_themeprovider.h" | 20 #include "xfa/fwl/core/ifwl_themeprovider.h" |
20 #include "xfa/fwl/core/ifwl_timerinfo.h" | |
21 | 21 |
22 #define FWL_SCROLLBAR_Elapse 500 | 22 #define FWL_SCROLLBAR_Elapse 500 |
23 #define FWL_SCROLLBAR_MinThumb 5 | 23 #define FWL_SCROLLBAR_MinThumb 5 |
24 | 24 |
25 IFWL_ScrollBar::IFWL_ScrollBar( | 25 IFWL_ScrollBar::IFWL_ScrollBar( |
26 const IFWL_App* app, | 26 const IFWL_App* app, |
27 std::unique_ptr<CFWL_WidgetProperties> properties, | 27 std::unique_ptr<CFWL_WidgetProperties> properties, |
28 IFWL_Widget* pOuter) | 28 IFWL_Widget* pOuter) |
29 : IFWL_Widget(app, std::move(properties), pOuter), | 29 : IFWL_Widget(app, std::move(properties), pOuter), |
30 m_pTimerInfo(nullptr), | 30 m_pTimerInfo(nullptr), |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 void IFWL_ScrollBar::DoMouseHover(int32_t iItem, | 543 void IFWL_ScrollBar::DoMouseHover(int32_t iItem, |
544 const CFX_RectF& rtItem, | 544 const CFX_RectF& rtItem, |
545 int32_t& iState) { | 545 int32_t& iState) { |
546 if (iState == CFWL_PartState_Hovered) | 546 if (iState == CFWL_PartState_Hovered) |
547 return; | 547 return; |
548 | 548 |
549 iState = CFWL_PartState_Hovered; | 549 iState = CFWL_PartState_Hovered; |
550 Repaint(&rtItem); | 550 Repaint(&rtItem); |
551 } | 551 } |
552 | 552 |
553 IFWL_ScrollBar::Timer::Timer(IFWL_ScrollBar* pToolTip) : IFWL_Timer(pToolTip) {} | 553 IFWL_ScrollBar::Timer::Timer(IFWL_ScrollBar* pToolTip) : CFWL_Timer(pToolTip) {} |
554 | 554 |
555 void IFWL_ScrollBar::Timer::Run(IFWL_TimerInfo* pTimerInfo) { | 555 void IFWL_ScrollBar::Timer::Run(CFWL_TimerInfo* pTimerInfo) { |
556 IFWL_ScrollBar* pButton = static_cast<IFWL_ScrollBar*>(m_pWidget); | 556 IFWL_ScrollBar* pButton = static_cast<IFWL_ScrollBar*>(m_pWidget); |
557 | 557 |
558 if (pButton->m_pTimerInfo) | 558 if (pButton->m_pTimerInfo) |
559 pButton->m_pTimerInfo->StopTimer(); | 559 pButton->m_pTimerInfo->StopTimer(); |
560 | 560 |
561 if (!pButton->SendEvent()) | 561 if (!pButton->SendEvent()) |
562 pButton->m_pTimerInfo = StartTimer(0, true); | 562 pButton->m_pTimerInfo = StartTimer(0, true); |
563 } | 563 } |
OLD | NEW |