| 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 10 matching lines...) Expand all Loading... |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 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 ScrollbarThemeMac_h | 26 #ifndef ScrollbarThemeMac_h |
| 27 #define ScrollbarThemeMac_h | 27 #define ScrollbarThemeMac_h |
| 28 | 28 |
| 29 #include "core/platform/ScrollbarThemeComposite.h" | 29 #include "core/platform/ScrollbarThemeComposite.h" |
| 30 | 30 |
| 31 typedef id ScrollbarPainter; | |
| 32 | |
| 33 namespace WebCore { | 31 namespace WebCore { |
| 34 | 32 |
| 35 class ScrollbarThemeMacCommon : public ScrollbarThemeComposite { | 33 class ScrollbarThemeMacCommon : public ScrollbarThemeComposite { |
| 36 public: | 34 public: |
| 37 ScrollbarThemeMacCommon(); | 35 ScrollbarThemeMacCommon(); |
| 38 virtual ~ScrollbarThemeMacCommon(); | 36 virtual ~ScrollbarThemeMacCommon(); |
| 39 | 37 |
| 40 virtual void registerScrollbar(ScrollbarThemeClient*); | 38 virtual void registerScrollbar(ScrollbarThemeClient*); |
| 41 virtual void unregisterScrollbar(ScrollbarThemeClient*); | 39 virtual void unregisterScrollbar(ScrollbarThemeClient*); |
| 42 void preferencesChanged(); | 40 void preferencesChanged(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 56 virtual bool shouldDragDocumentInsteadOfThumb(ScrollbarThemeClient*, const P
latformMouseEvent&); | 54 virtual bool shouldDragDocumentInsteadOfThumb(ScrollbarThemeClient*, const P
latformMouseEvent&); |
| 57 int scrollbarPartToHIPressedState(ScrollbarPart); | 55 int scrollbarPartToHIPressedState(ScrollbarPart); |
| 58 | 56 |
| 59 virtual void updateButtonPlacement() { } | 57 virtual void updateButtonPlacement() { } |
| 60 | 58 |
| 61 void paintGivenTickmarks(GraphicsContext*, ScrollbarThemeClient*, const IntR
ect&, const Vector<IntRect>&); | 59 void paintGivenTickmarks(GraphicsContext*, ScrollbarThemeClient*, const IntR
ect&, const Vector<IntRect>&); |
| 62 | 60 |
| 63 RefPtr<Pattern> m_overhangPattern; | 61 RefPtr<Pattern> m_overhangPattern; |
| 64 }; | 62 }; |
| 65 | 63 |
| 66 class ScrollbarThemeMacOverlayAPI : public ScrollbarThemeMacCommon { | |
| 67 public: | |
| 68 virtual void updateEnabledState(ScrollbarThemeClient*); | |
| 69 virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar); | |
| 70 virtual bool usesOverlayScrollbars() const; | |
| 71 virtual void updateScrollbarOverlayStyle(ScrollbarThemeClient*); | |
| 72 virtual ScrollbarButtonsPlacement buttonsPlacement() const; | |
| 73 | |
| 74 virtual void registerScrollbar(ScrollbarThemeClient*); | |
| 75 virtual void unregisterScrollbar(ScrollbarThemeClient*); | |
| 76 | |
| 77 void setNewPainterForScrollbar(ScrollbarThemeClient*, ScrollbarPainter); | |
| 78 ScrollbarPainter painterForScrollbar(ScrollbarThemeClient*); | |
| 79 | |
| 80 virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, c
onst IntRect&); | |
| 81 virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRe
ct&); | |
| 82 | |
| 83 protected: | |
| 84 virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false); | |
| 85 virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool pa
inting = false); | |
| 86 virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool
painting = false); | |
| 87 | |
| 88 virtual bool hasButtons(ScrollbarThemeClient*) { return false; } | |
| 89 virtual bool hasThumb(ScrollbarThemeClient*); | |
| 90 | |
| 91 virtual int minimumThumbLength(ScrollbarThemeClient*); | |
| 92 }; | |
| 93 | |
| 94 class ScrollbarThemeMacNonOverlayAPI : public ScrollbarThemeMacCommon { | |
| 95 public: | |
| 96 virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar); | |
| 97 virtual bool usesOverlayScrollbars() const { return false; } | |
| 98 virtual ScrollbarButtonsPlacement buttonsPlacement() const; | |
| 99 | |
| 100 virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& d
amageRect); | |
| 101 | |
| 102 protected: | |
| 103 virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false); | |
| 104 virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool pa
inting = false); | |
| 105 virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool
painting = false); | |
| 106 | |
| 107 virtual void updateButtonPlacement(); | |
| 108 | |
| 109 virtual bool hasButtons(ScrollbarThemeClient*); | |
| 110 virtual bool hasThumb(ScrollbarThemeClient*); | |
| 111 | |
| 112 virtual int minimumThumbLength(ScrollbarThemeClient*); | |
| 113 }; | |
| 114 | |
| 115 } | 64 } |
| 116 | 65 |
| 117 #endif | 66 #endif |
| OLD | NEW |