OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 12 matching lines...) Expand all Loading... |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef Scrollbar_h | 26 #ifndef Scrollbar_h |
27 #define Scrollbar_h | 27 #define Scrollbar_h |
28 | 28 |
29 #include "platform/Timer.h" | 29 #include "platform/Timer.h" |
30 #include "platform/Widget.h" | 30 #include "platform/Widget.h" |
31 #include "platform/scroll/ScrollTypes.h" | 31 #include "platform/scroll/ScrollTypes.h" |
32 #include "platform/scroll/ScrollbarThemeClient.h" | 32 #include "platform/scroll/ScrollbarThemeClient.h" |
| 33 #include "public/platform/WebThemeEngine.h" |
33 #include "wtf/MathExtras.h" | 34 #include "wtf/MathExtras.h" |
34 #include "wtf/PassRefPtr.h" | 35 #include "wtf/PassRefPtr.h" |
35 | 36 |
36 namespace WebCore { | 37 namespace WebCore { |
37 | 38 |
38 class GraphicsContext; | 39 class GraphicsContext; |
39 class IntRect; | 40 class IntRect; |
40 class PlatformGestureEvent; | 41 class PlatformGestureEvent; |
41 class PlatformMouseEvent; | 42 class PlatformMouseEvent; |
42 class ScrollableArea; | 43 class ScrollableArea; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 virtual ScrollbarPart hoveredPart() const OVERRIDE { return m_hoveredPart; } | 95 virtual ScrollbarPart hoveredPart() const OVERRIDE { return m_hoveredPart; } |
95 | 96 |
96 virtual void styleChanged() OVERRIDE { } | 97 virtual void styleChanged() OVERRIDE { } |
97 | 98 |
98 virtual bool enabled() const OVERRIDE { return m_enabled; } | 99 virtual bool enabled() const OVERRIDE { return m_enabled; } |
99 virtual void setEnabled(bool) OVERRIDE; | 100 virtual void setEnabled(bool) OVERRIDE; |
100 | 101 |
101 // Called by the ScrollableArea when the scroll offset changes. | 102 // Called by the ScrollableArea when the scroll offset changes. |
102 void offsetDidChange(); | 103 void offsetDidChange(); |
103 | 104 |
| 105 void updateStateTransitionData(blink::WebThemeEngine::State, blink::WebTheme
Engine::State, double); |
| 106 |
104 void disconnectFromScrollableArea() { m_scrollableArea = 0; } | 107 void disconnectFromScrollableArea() { m_scrollableArea = 0; } |
105 ScrollableArea* scrollableArea() const { return m_scrollableArea; } | 108 ScrollableArea* scrollableArea() const { return m_scrollableArea; } |
106 | 109 |
107 int pressedPos() const { return m_pressedPos; } | 110 int pressedPos() const { return m_pressedPos; } |
108 | 111 |
109 virtual void setHoveredPart(ScrollbarPart); | 112 virtual void setHoveredPart(ScrollbarPart); |
110 virtual void setPressedPart(ScrollbarPart); | 113 virtual void setPressedPart(ScrollbarPart); |
111 | 114 |
112 void setProportion(int visibleSize, int totalSize); | 115 void setProportion(int visibleSize, int totalSize); |
113 void setPressedPos(int p) { m_pressedPos = p; } | 116 void setPressedPos(int p) { m_pressedPos = p; } |
114 | 117 |
115 virtual void paint(GraphicsContext*, const IntRect& damageRect) OVERRIDE; | 118 virtual void paint(GraphicsContext*, const IntRect& damageRect) OVERRIDE; |
116 | 119 |
117 virtual bool isOverlayScrollbar() const OVERRIDE; | 120 virtual bool isOverlayScrollbar() const OVERRIDE; |
118 bool shouldParticipateInHitTesting(); | 121 bool shouldParticipateInHitTesting(); |
119 | 122 |
| 123 virtual bool isDuringStateTransitionAnimation() const OVERRIDE; |
| 124 virtual double stateTransitionProgress() const OVERRIDE; |
| 125 virtual blink::WebThemeEngine::State stateTransitionStartState() const OVERR
IDE; |
| 126 virtual blink::WebThemeEngine::State stateTransitionEndState() const OVERRID
E; |
| 127 |
120 bool isWindowActive() const; | 128 bool isWindowActive() const; |
121 | 129 |
122 bool gestureEvent(const PlatformGestureEvent&); | 130 bool gestureEvent(const PlatformGestureEvent&); |
123 | 131 |
124 // These methods are used for platform scrollbars to give :hover feedback.
They will not get called | 132 // These methods are used for platform scrollbars to give :hover feedback.
They will not get called |
125 // when the mouse went down in a scrollbar, since it is assumed the scrollba
r will start | 133 // when the mouse went down in a scrollbar, since it is assumed the scrollba
r will start |
126 // grabbing all events in that case anyway. | 134 // grabbing all events in that case anyway. |
127 void mouseMoved(const PlatformMouseEvent&); | 135 void mouseMoved(const PlatformMouseEvent&); |
128 void mouseEntered(); | 136 void mouseEntered(); |
129 void mouseExited(); | 137 void mouseExited(); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 191 |
184 bool m_enabled; | 192 bool m_enabled; |
185 | 193 |
186 Timer<Scrollbar> m_scrollTimer; | 194 Timer<Scrollbar> m_scrollTimer; |
187 bool m_overlapsResizer; | 195 bool m_overlapsResizer; |
188 | 196 |
189 bool m_suppressInvalidation; | 197 bool m_suppressInvalidation; |
190 | 198 |
191 bool m_isAlphaLocked; | 199 bool m_isAlphaLocked; |
192 | 200 |
| 201 double m_stateTransitionProgress; |
| 202 blink::WebThemeEngine::State m_startState; |
| 203 blink::WebThemeEngine::State m_endState; |
| 204 |
193 private: | 205 private: |
194 virtual bool isScrollbar() const OVERRIDE { return true; } | 206 virtual bool isScrollbar() const OVERRIDE { return true; } |
195 | 207 |
196 float scrollableAreaCurrentPos() const; | 208 float scrollableAreaCurrentPos() const; |
197 }; | 209 }; |
198 | 210 |
199 DEFINE_TYPE_CASTS(Scrollbar, Widget, widget, widget->isScrollbar(), widget.isScr
ollbar()); | 211 DEFINE_TYPE_CASTS(Scrollbar, Widget, widget, widget->isScrollbar(), widget.isScr
ollbar()); |
200 | 212 |
201 } // namespace WebCore | 213 } // namespace WebCore |
202 | 214 |
203 #endif // Scrollbar_h | 215 #endif // Scrollbar_h |
OLD | NEW |