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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 virtual bool isCustomScrollbar() const { return false; } | 78 virtual bool isCustomScrollbar() const { return false; } |
79 virtual ScrollbarOrientation orientation() const { return m_orientation; } | 79 virtual ScrollbarOrientation orientation() const { return m_orientation; } |
80 | 80 |
81 virtual int value() const { return lroundf(m_currentPos); } | 81 virtual int value() const { return lroundf(m_currentPos); } |
82 virtual float currentPos() const { return m_currentPos; } | 82 virtual float currentPos() const { return m_currentPos; } |
83 virtual int visibleSize() const { return m_visibleSize; } | 83 virtual int visibleSize() const { return m_visibleSize; } |
84 virtual int totalSize() const { return m_totalSize; } | 84 virtual int totalSize() const { return m_totalSize; } |
85 virtual int maximum() const { return m_totalSize - m_visibleSize; } | 85 virtual int maximum() const { return m_totalSize - m_visibleSize; } |
86 virtual ScrollbarControlSize controlSize() const { return m_controlSize; } | 86 virtual ScrollbarControlSize controlSize() const { return m_controlSize; } |
87 | 87 |
88 virtual int lineStep() const { return m_lineStep; } | |
89 virtual int pageStep() const { return m_pageStep; } | |
90 | |
91 virtual ScrollbarPart pressedPart() const { return m_pressedPart; } | 88 virtual ScrollbarPart pressedPart() const { return m_pressedPart; } |
92 virtual ScrollbarPart hoveredPart() const { return m_hoveredPart; } | 89 virtual ScrollbarPart hoveredPart() const { return m_hoveredPart; } |
93 | 90 |
94 virtual void styleChanged() { } | 91 virtual void styleChanged() { } |
95 | 92 |
96 virtual bool enabled() const { return m_enabled; } | 93 virtual bool enabled() const { return m_enabled; } |
97 virtual void setEnabled(bool); | 94 virtual void setEnabled(bool); |
98 | 95 |
99 // Called by the ScrollableArea when the scroll offset changes. | 96 // Called by the ScrollableArea when the scroll offset changes. |
100 void offsetDidChange(); | 97 void offsetDidChange(); |
101 | 98 |
102 static int pixelsPerLineStep() { return 40; } | |
103 static float minFractionToStepWhenPaging() { return 0.875f; } | |
104 static int maxOverlapBetweenPages(); | |
105 | |
106 void disconnectFromScrollableArea() { m_scrollableArea = 0; } | 99 void disconnectFromScrollableArea() { m_scrollableArea = 0; } |
107 ScrollableArea* scrollableArea() const { return m_scrollableArea; } | 100 ScrollableArea* scrollableArea() const { return m_scrollableArea; } |
108 | 101 |
109 int pressedPos() const { return m_pressedPos; } | 102 int pressedPos() const { return m_pressedPos; } |
110 | 103 |
111 float pixelStep() const { return m_pixelStep; } | |
112 | |
113 virtual void setHoveredPart(ScrollbarPart); | 104 virtual void setHoveredPart(ScrollbarPart); |
114 virtual void setPressedPart(ScrollbarPart); | 105 virtual void setPressedPart(ScrollbarPart); |
115 | 106 |
116 void setSteps(int lineStep, int pageStep, int pixelsPerStep = 1); | |
117 void setProportion(int visibleSize, int totalSize); | 107 void setProportion(int visibleSize, int totalSize); |
118 void setPressedPos(int p) { m_pressedPos = p; } | 108 void setPressedPos(int p) { m_pressedPos = p; } |
119 | 109 |
120 virtual void paint(GraphicsContext*, const IntRect& damageRect); | 110 virtual void paint(GraphicsContext*, const IntRect& damageRect); |
121 | 111 |
122 virtual bool isOverlayScrollbar() const; | 112 virtual bool isOverlayScrollbar() const; |
123 bool shouldParticipateInHitTesting(); | 113 bool shouldParticipateInHitTesting(); |
124 | 114 |
125 bool isWindowActive() const; | 115 bool isWindowActive() const; |
126 | 116 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 161 |
172 ScrollableArea* m_scrollableArea; | 162 ScrollableArea* m_scrollableArea; |
173 ScrollbarOrientation m_orientation; | 163 ScrollbarOrientation m_orientation; |
174 ScrollbarControlSize m_controlSize; | 164 ScrollbarControlSize m_controlSize; |
175 ScrollbarTheme* m_theme; | 165 ScrollbarTheme* m_theme; |
176 | 166 |
177 int m_visibleSize; | 167 int m_visibleSize; |
178 int m_totalSize; | 168 int m_totalSize; |
179 float m_currentPos; | 169 float m_currentPos; |
180 float m_dragOrigin; | 170 float m_dragOrigin; |
181 int m_lineStep; | |
182 int m_pageStep; | |
183 float m_pixelStep; | |
184 | 171 |
185 ScrollbarPart m_hoveredPart; | 172 ScrollbarPart m_hoveredPart; |
186 ScrollbarPart m_pressedPart; | 173 ScrollbarPart m_pressedPart; |
187 int m_pressedPos; | 174 int m_pressedPos; |
188 float m_scrollPos; | 175 float m_scrollPos; |
189 bool m_draggingDocument; | 176 bool m_draggingDocument; |
190 int m_documentDragPos; | 177 int m_documentDragPos; |
191 | 178 |
192 bool m_enabled; | 179 bool m_enabled; |
193 | 180 |
194 Timer<Scrollbar> m_scrollTimer; | 181 Timer<Scrollbar> m_scrollTimer; |
195 bool m_overlapsResizer; | 182 bool m_overlapsResizer; |
196 | 183 |
197 bool m_suppressInvalidation; | 184 bool m_suppressInvalidation; |
198 | 185 |
199 bool m_isAlphaLocked; | 186 bool m_isAlphaLocked; |
200 | 187 |
201 private: | 188 private: |
202 virtual bool isScrollbar() const { return true; } | 189 virtual bool isScrollbar() const { return true; } |
203 virtual AXObjectCache* existingAXObjectCache() const; | 190 virtual AXObjectCache* existingAXObjectCache() const; |
| 191 |
| 192 float scrollableAreaCurrentPos() const; |
204 }; | 193 }; |
205 | 194 |
206 } // namespace WebCore | 195 } // namespace WebCore |
207 | 196 |
208 #endif // Scrollbar_h | 197 #endif // Scrollbar_h |
OLD | NEW |