OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple 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 29 matching lines...) Expand all Loading... |
40 class ScrollbarThemeClient; | 40 class ScrollbarThemeClient; |
41 class ScrollbarThemePaintParams; | 41 class ScrollbarThemePaintParams; |
42 | 42 |
43 class PLATFORM_EXPORT ScrollbarTheme { | 43 class PLATFORM_EXPORT ScrollbarTheme { |
44 WTF_MAKE_NONCOPYABLE(ScrollbarTheme); USING_FAST_MALLOC(ScrollbarTheme); | 44 WTF_MAKE_NONCOPYABLE(ScrollbarTheme); USING_FAST_MALLOC(ScrollbarTheme); |
45 public: | 45 public: |
46 ScrollbarTheme() { } | 46 ScrollbarTheme() { } |
47 virtual ~ScrollbarTheme() { } | 47 virtual ~ScrollbarTheme() { } |
48 | 48 |
49 // If true, then scrollbars with this theme will be painted every time | 49 // If true, then scrollbars with this theme will be painted every time |
50 // Scrollbar::setNeedsPaintInvalidation is called. If false, then scrollbar | 50 // Scrollbar::setNeedsPaintInvalidation is called. If false, then only parts |
51 // thumb and track part painting results will be cached and not repainted | 51 // which are explicitly invalidated will be repainted. |
52 // unless requested by Scrollbar::setThumbNeedsRepaint or | |
53 // Scrollbar::setTrackNeedsRepaint. | |
54 virtual bool shouldRepaintAllPartsOnInvalidation() const { return true; } | 52 virtual bool shouldRepaintAllPartsOnInvalidation() const { return true; } |
55 | 53 |
56 virtual void updateEnabledState(const ScrollbarThemeClient&) { } | 54 virtual void updateEnabledState(const ScrollbarThemeClient&) { } |
57 | 55 |
58 virtual bool paint(const ScrollbarThemeClient&, GraphicsContext&, const Cull
Rect&); | 56 virtual bool paint(const ScrollbarThemeClient&, GraphicsContext&, const Cull
Rect&); |
59 | 57 |
60 virtual ScrollbarPart hitTest(const ScrollbarThemeClient&, const IntPoint&); | 58 virtual ScrollbarPart hitTest(const ScrollbarThemeClient&, const IntPoint&); |
61 | 59 |
62 virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar) { re
turn 0; } | 60 virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar) { re
turn 0; } |
63 virtual int scrollbarMargin() const { return 0; } | 61 virtual int scrollbarMargin() const { return 0; } |
64 | 62 |
65 virtual WebScrollbarButtonsPlacement buttonsPlacement() const { return WebSc
rollbarButtonsPlacementSingle; } | 63 virtual WebScrollbarButtonsPlacement buttonsPlacement() const { return WebSc
rollbarButtonsPlacementSingle; } |
66 | 64 |
67 virtual bool supportsControlTints() const { return false; } | 65 virtual bool supportsControlTints() const { return false; } |
68 virtual bool usesOverlayScrollbars() const { return false; } | 66 virtual bool usesOverlayScrollbars() const { return false; } |
69 virtual void updateScrollbarOverlayStyle(const ScrollbarThemeClient&) { } | 67 virtual void updateScrollbarOverlayStyle(const ScrollbarThemeClient&) { } |
70 | 68 |
71 virtual bool invalidateOnMouseEnterExit() { return false; } | 69 virtual bool invalidateOnMouseEnterExit() { return false; } |
72 virtual bool invalidateOnWindowActiveChange() const { return false; } | 70 virtual bool invalidateOnWindowActiveChange() const { return false; } |
73 | 71 |
| 72 // Returns parts of the scrollbar which must be repainted following a change |
| 73 // in the thumb position, given scroll positions before and after. |
| 74 virtual ScrollbarPart invalidateOnThumbPositionChange( |
| 75 const ScrollbarThemeClient&, float oldPosition, float newPosition) const |
| 76 { |
| 77 return AllParts; |
| 78 } |
| 79 |
74 virtual void paintScrollCorner(GraphicsContext&, const DisplayItemClient&, c
onst IntRect& cornerRect); | 80 virtual void paintScrollCorner(GraphicsContext&, const DisplayItemClient&, c
onst IntRect& cornerRect); |
75 virtual void paintTickmarks(GraphicsContext&, const ScrollbarThemeClient&, c
onst IntRect&) { } | 81 virtual void paintTickmarks(GraphicsContext&, const ScrollbarThemeClient&, c
onst IntRect&) { } |
76 | 82 |
77 virtual bool shouldCenterOnThumb(const ScrollbarThemeClient&, const Platform
MouseEvent&); | 83 virtual bool shouldCenterOnThumb(const ScrollbarThemeClient&, const Platform
MouseEvent&); |
78 virtual bool shouldSnapBackToDragOrigin(const ScrollbarThemeClient&, const P
latformMouseEvent&); | 84 virtual bool shouldSnapBackToDragOrigin(const ScrollbarThemeClient&, const P
latformMouseEvent&); |
79 virtual bool shouldDragDocumentInsteadOfThumb(const ScrollbarThemeClient&, c
onst PlatformMouseEvent&) { return false; } | 85 virtual bool shouldDragDocumentInsteadOfThumb(const ScrollbarThemeClient&, c
onst PlatformMouseEvent&) { return false; } |
80 | 86 |
81 // The position of the thumb relative to the track. | 87 // The position of the thumb relative to the track. |
82 virtual int thumbPosition(const ScrollbarThemeClient&); | 88 virtual int thumbPosition(const ScrollbarThemeClient&); |
83 // The length of the thumb along the axis of the scrollbar. | 89 // The length of the thumb along the axis of the scrollbar. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 static DisplayItem::Type buttonPartToDisplayItemType(ScrollbarPart); | 135 static DisplayItem::Type buttonPartToDisplayItemType(ScrollbarPart); |
130 static DisplayItem::Type trackPiecePartToDisplayItemType(ScrollbarPart); | 136 static DisplayItem::Type trackPiecePartToDisplayItemType(ScrollbarPart); |
131 | 137 |
132 private: | 138 private: |
133 static ScrollbarTheme& nativeTheme(); // Must be implemented to return the c
orrect theme subclass. | 139 static ScrollbarTheme& nativeTheme(); // Must be implemented to return the c
orrect theme subclass. |
134 static bool gMockScrollbarsEnabled; | 140 static bool gMockScrollbarsEnabled; |
135 }; | 141 }; |
136 | 142 |
137 } | 143 } |
138 #endif | 144 #endif |
OLD | NEW |