| 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 #ifndef XFA_FWL_CORE_IFWL_SCROLLBAR_H_ | 7 #ifndef XFA_FWL_CORE_IFWL_SCROLLBAR_H_ |
| 8 #define XFA_FWL_CORE_IFWL_SCROLLBAR_H_ | 8 #define XFA_FWL_CORE_IFWL_SCROLLBAR_H_ |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "core/fxcrt/fx_system.h" | 12 #include "core/fxcrt/fx_system.h" |
| 13 #include "xfa/fwl/core/cfwl_evtscroll.h" | 13 #include "xfa/fwl/core/cfwl_evtscroll.h" |
| 14 #include "xfa/fwl/core/cfwl_timer.h" |
| 14 #include "xfa/fwl/core/cfwl_widgetproperties.h" | 15 #include "xfa/fwl/core/cfwl_widgetproperties.h" |
| 15 #include "xfa/fwl/core/ifwl_timer.h" | |
| 16 #include "xfa/fwl/core/ifwl_widget.h" | 16 #include "xfa/fwl/core/ifwl_widget.h" |
| 17 | 17 |
| 18 class IFWL_Widget; | 18 class IFWL_Widget; |
| 19 | 19 |
| 20 #define FWL_STYLEEXT_SCB_Horz (0L << 0) | 20 #define FWL_STYLEEXT_SCB_Horz (0L << 0) |
| 21 #define FWL_STYLEEXT_SCB_Vert (1L << 0) | 21 #define FWL_STYLEEXT_SCB_Vert (1L << 0) |
| 22 | 22 |
| 23 class IFWL_ScrollBar : public IFWL_Widget { | 23 class IFWL_ScrollBar : public IFWL_Widget { |
| 24 public: | 24 public: |
| 25 IFWL_ScrollBar(const IFWL_App* app, | 25 IFWL_ScrollBar(const IFWL_App* app, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 49 } | 49 } |
| 50 FX_FLOAT GetPageSize() const { return m_fPageSize; } | 50 FX_FLOAT GetPageSize() const { return m_fPageSize; } |
| 51 void SetPageSize(FX_FLOAT fPageSize) { m_fPageSize = fPageSize; } | 51 void SetPageSize(FX_FLOAT fPageSize) { m_fPageSize = fPageSize; } |
| 52 FX_FLOAT GetStepSize() const { return m_fStepSize; } | 52 FX_FLOAT GetStepSize() const { return m_fStepSize; } |
| 53 void SetStepSize(FX_FLOAT fStepSize) { m_fStepSize = fStepSize; } | 53 void SetStepSize(FX_FLOAT fStepSize) { m_fStepSize = fStepSize; } |
| 54 FX_FLOAT GetPos() const { return m_fPos; } | 54 FX_FLOAT GetPos() const { return m_fPos; } |
| 55 void SetPos(FX_FLOAT fPos) { m_fPos = fPos; } | 55 void SetPos(FX_FLOAT fPos) { m_fPos = fPos; } |
| 56 void SetTrackPos(FX_FLOAT fTrackPos); | 56 void SetTrackPos(FX_FLOAT fTrackPos); |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 class Timer : public IFWL_Timer { | 59 class Timer : public CFWL_Timer { |
| 60 public: | 60 public: |
| 61 explicit Timer(IFWL_ScrollBar* pToolTip); | 61 explicit Timer(IFWL_ScrollBar* pToolTip); |
| 62 ~Timer() override {} | 62 ~Timer() override {} |
| 63 | 63 |
| 64 void Run(IFWL_TimerInfo* pTimerInfo) override; | 64 void Run(CFWL_TimerInfo* pTimerInfo) override; |
| 65 }; | 65 }; |
| 66 friend class IFWL_ScrollBar::Timer; | 66 friend class IFWL_ScrollBar::Timer; |
| 67 | 67 |
| 68 bool IsVertical() const { | 68 bool IsVertical() const { |
| 69 return !!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_SCB_Vert); | 69 return !!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_SCB_Vert); |
| 70 } | 70 } |
| 71 void DrawTrack(CFX_Graphics* pGraphics, | 71 void DrawTrack(CFX_Graphics* pGraphics, |
| 72 IFWL_ThemeProvider* pTheme, | 72 IFWL_ThemeProvider* pTheme, |
| 73 bool bLower = true, | 73 bool bLower = true, |
| 74 const CFX_Matrix* pMatrix = nullptr); | 74 const CFX_Matrix* pMatrix = nullptr); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 FX_FLOAT fx, | 111 FX_FLOAT fx, |
| 112 FX_FLOAT fy); | 112 FX_FLOAT fy); |
| 113 void DoMouseMove(int32_t iItem, | 113 void DoMouseMove(int32_t iItem, |
| 114 const CFX_RectF& rtItem, | 114 const CFX_RectF& rtItem, |
| 115 int32_t& iState, | 115 int32_t& iState, |
| 116 FX_FLOAT fx, | 116 FX_FLOAT fx, |
| 117 FX_FLOAT fy); | 117 FX_FLOAT fy); |
| 118 void DoMouseLeave(int32_t iItem, const CFX_RectF& rtItem, int32_t& iState); | 118 void DoMouseLeave(int32_t iItem, const CFX_RectF& rtItem, int32_t& iState); |
| 119 void DoMouseHover(int32_t iItem, const CFX_RectF& rtItem, int32_t& iState); | 119 void DoMouseHover(int32_t iItem, const CFX_RectF& rtItem, int32_t& iState); |
| 120 | 120 |
| 121 IFWL_TimerInfo* m_pTimerInfo; | 121 CFWL_TimerInfo* m_pTimerInfo; |
| 122 FX_FLOAT m_fRangeMin; | 122 FX_FLOAT m_fRangeMin; |
| 123 FX_FLOAT m_fRangeMax; | 123 FX_FLOAT m_fRangeMax; |
| 124 FX_FLOAT m_fPageSize; | 124 FX_FLOAT m_fPageSize; |
| 125 FX_FLOAT m_fStepSize; | 125 FX_FLOAT m_fStepSize; |
| 126 FX_FLOAT m_fPos; | 126 FX_FLOAT m_fPos; |
| 127 FX_FLOAT m_fTrackPos; | 127 FX_FLOAT m_fTrackPos; |
| 128 int32_t m_iMinButtonState; | 128 int32_t m_iMinButtonState; |
| 129 int32_t m_iMaxButtonState; | 129 int32_t m_iMaxButtonState; |
| 130 int32_t m_iThumbButtonState; | 130 int32_t m_iThumbButtonState; |
| 131 int32_t m_iMinTrackState; | 131 int32_t m_iMinTrackState; |
| 132 int32_t m_iMaxTrackState; | 132 int32_t m_iMaxTrackState; |
| 133 FX_FLOAT m_fLastTrackPos; | 133 FX_FLOAT m_fLastTrackPos; |
| 134 FX_FLOAT m_cpTrackPointX; | 134 FX_FLOAT m_cpTrackPointX; |
| 135 FX_FLOAT m_cpTrackPointY; | 135 FX_FLOAT m_cpTrackPointY; |
| 136 int32_t m_iMouseWheel; | 136 int32_t m_iMouseWheel; |
| 137 bool m_bMouseDown; | 137 bool m_bMouseDown; |
| 138 FX_FLOAT m_fButtonLen; | 138 FX_FLOAT m_fButtonLen; |
| 139 bool m_bMinSize; | 139 bool m_bMinSize; |
| 140 CFX_RectF m_rtClient; | 140 CFX_RectF m_rtClient; |
| 141 CFX_RectF m_rtThumb; | 141 CFX_RectF m_rtThumb; |
| 142 CFX_RectF m_rtMinBtn; | 142 CFX_RectF m_rtMinBtn; |
| 143 CFX_RectF m_rtMaxBtn; | 143 CFX_RectF m_rtMaxBtn; |
| 144 CFX_RectF m_rtMinTrack; | 144 CFX_RectF m_rtMinTrack; |
| 145 CFX_RectF m_rtMaxTrack; | 145 CFX_RectF m_rtMaxTrack; |
| 146 FX_FLOAT m_fMinThumb; | 146 FX_FLOAT m_fMinThumb; |
| 147 IFWL_ScrollBar::Timer m_Timer; | 147 IFWL_ScrollBar::Timer m_Timer; |
| 148 }; | 148 }; |
| 149 | 149 |
| 150 #endif // XFA_FWL_CORE_IFWL_SCROLLBAR_H_ | 150 #endif // XFA_FWL_CORE_IFWL_SCROLLBAR_H_ |
| OLD | NEW |