OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the theme implementation for form controls in WebCore. | 2 * This file is part of the theme implementation for form controls in WebCore. |
3 * | 3 * |
4 * Copyright (C) 2005 Apple Computer, Inc. | 4 * Copyright (C) 2005 Apple Computer, Inc. |
5 * Copyright (C) 2008, 2009 Google, Inc. | 5 * Copyright (C) 2008, 2009 Google, Inc. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 19 matching lines...) Expand all Loading... |
30 #import "wtf/RetainPtr.h" | 30 #import "wtf/RetainPtr.h" |
31 | 31 |
32 OBJC_CLASS LayoutThemeNotificationObserver; | 32 OBJC_CLASS LayoutThemeNotificationObserver; |
33 | 33 |
34 namespace blink { | 34 namespace blink { |
35 | 35 |
36 class LayoutThemeMac final : public LayoutTheme { | 36 class LayoutThemeMac final : public LayoutTheme { |
37 public: | 37 public: |
38 static PassRefPtr<LayoutTheme> create(); | 38 static PassRefPtr<LayoutTheme> create(); |
39 | 39 |
40 virtual void addVisualOverflow(const LayoutObject&, IntRect& borderBox) over
ride; | 40 void addVisualOverflow(const LayoutObject&, IntRect& borderBox) override; |
41 | 41 |
42 virtual bool isControlStyled(const ComputedStyle&, const AuthorStyleInfo&) c
onst override; | 42 bool isControlStyled(const ComputedStyle&, const AuthorStyleInfo&) const ove
rride; |
43 | 43 |
44 virtual Color platformActiveSelectionBackgroundColor() const override; | 44 Color platformActiveSelectionBackgroundColor() const override; |
45 virtual Color platformInactiveSelectionBackgroundColor() const override; | 45 Color platformInactiveSelectionBackgroundColor() const override; |
46 virtual Color platformActiveSelectionForegroundColor() const override; | 46 Color platformActiveSelectionForegroundColor() const override; |
47 virtual Color platformActiveListBoxSelectionBackgroundColor() const override
; | 47 Color platformActiveListBoxSelectionBackgroundColor() const override; |
48 virtual Color platformActiveListBoxSelectionForegroundColor() const override
; | 48 Color platformActiveListBoxSelectionForegroundColor() const override; |
49 virtual Color platformInactiveListBoxSelectionBackgroundColor() const overri
de; | 49 Color platformInactiveListBoxSelectionBackgroundColor() const override; |
50 virtual Color platformInactiveListBoxSelectionForegroundColor() const overri
de; | 50 Color platformInactiveListBoxSelectionForegroundColor() const override; |
51 virtual Color platformFocusRingColor() const override; | 51 Color platformFocusRingColor() const override; |
52 | 52 |
53 virtual ScrollbarControlSize scrollbarControlSizeForPart(ControlPart part) o
verride { return part == ListboxPart ? SmallScrollbar : RegularScrollbar; } | 53 ScrollbarControlSize scrollbarControlSizeForPart(ControlPart part) override
{ return part == ListboxPart ? SmallScrollbar : RegularScrollbar; } |
54 | 54 |
55 virtual void platformColorsDidChange() override; | 55 void platformColorsDidChange() override; |
56 | 56 |
57 // System fonts. | 57 // System fonts. |
58 virtual void systemFont(CSSValueID systemFontID, FontStyle&, FontWeight&, fl
oat& fontSize, AtomicString& fontFamily) const override; | 58 void systemFont(CSSValueID systemFontID, FontStyle&, FontWeight&, float& fon
tSize, AtomicString& fontFamily) const override; |
59 | 59 |
60 virtual int minimumMenuListSize(const ComputedStyle&) const override; | 60 int minimumMenuListSize(const ComputedStyle&) const override; |
61 | 61 |
62 virtual void adjustSliderThumbSize(ComputedStyle&, Element*) const override; | 62 void adjustSliderThumbSize(ComputedStyle&, Element*) const override; |
63 | 63 |
64 virtual IntSize sliderTickSize() const override; | 64 IntSize sliderTickSize() const override; |
65 virtual int sliderTickOffsetFromTrackCenter() const override; | 65 int sliderTickOffsetFromTrackCenter() const override; |
66 | 66 |
67 virtual int popupInternalPaddingLeft(const ComputedStyle&) const override; | 67 int popupInternalPaddingLeft(const ComputedStyle&) const override; |
68 virtual int popupInternalPaddingRight(const ComputedStyle&) const override; | 68 int popupInternalPaddingRight(const ComputedStyle&) const override; |
69 virtual int popupInternalPaddingTop(const ComputedStyle&) const override; | 69 int popupInternalPaddingTop(const ComputedStyle&) const override; |
70 virtual int popupInternalPaddingBottom(const ComputedStyle&) const override; | 70 int popupInternalPaddingBottom(const ComputedStyle&) const override; |
71 | 71 |
72 virtual bool popsMenuByArrowKeys() const override { return true; } | 72 bool popsMenuByArrowKeys() const override { return true; } |
73 virtual bool popsMenuBySpaceKey() const override final { return true; } | 73 bool popsMenuBySpaceKey() const final { return true; } |
74 | 74 |
75 virtual IntSize meterSizeForBounds(const LayoutMeter*, const IntRect&) const
override; | 75 IntSize meterSizeForBounds(const LayoutMeter*, const IntRect&) const overrid
e; |
76 virtual bool supportsMeter(ControlPart) const override; | 76 bool supportsMeter(ControlPart) const override; |
77 | 77 |
78 // Returns the repeat interval of the animation for the progress bar. | 78 // Returns the repeat interval of the animation for the progress bar. |
79 virtual double animationRepeatIntervalForProgressBar() const override; | 79 double animationRepeatIntervalForProgressBar() const override; |
80 // Returns the duration of the animation for the progress bar. | 80 // Returns the duration of the animation for the progress bar. |
81 virtual double animationDurationForProgressBar() const override; | 81 double animationDurationForProgressBar() const override; |
82 | 82 |
83 virtual Color systemColor(CSSValueID) const override; | 83 Color systemColor(CSSValueID) const override; |
84 | 84 |
85 virtual bool supportsSelectionForegroundColors() const override { return fal
se; } | 85 bool supportsSelectionForegroundColors() const override { return false; } |
86 | 86 |
87 virtual bool isModalColorChooser() const { return false; } | 87 virtual bool isModalColorChooser() const { return false; } |
88 | 88 |
89 protected: | 89 protected: |
90 LayoutThemeMac(); | 90 LayoutThemeMac(); |
91 virtual ~LayoutThemeMac(); | 91 ~LayoutThemeMac() override; |
92 | 92 |
93 virtual void adjustMenuListStyle(ComputedStyle&, Element*) const override; | 93 void adjustMenuListStyle(ComputedStyle&, Element*) const override; |
94 virtual void adjustMenuListButtonStyle(ComputedStyle&, Element*) const overr
ide; | 94 void adjustMenuListButtonStyle(ComputedStyle&, Element*) const override; |
95 virtual void adjustSearchFieldStyle(ComputedStyle&, Element*) const override
; | 95 void adjustSearchFieldStyle(ComputedStyle&, Element*) const override; |
96 virtual void adjustSearchFieldCancelButtonStyle(ComputedStyle&, Element*) co
nst override; | 96 void adjustSearchFieldCancelButtonStyle(ComputedStyle&, Element*) const over
ride; |
97 virtual void adjustSearchFieldDecorationStyle(ComputedStyle&, Element*) cons
t override; | 97 void adjustSearchFieldDecorationStyle(ComputedStyle&, Element*) const overri
de; |
98 virtual void adjustSearchFieldResultsDecorationStyle(ComputedStyle&, Element
*) const override; | 98 void adjustSearchFieldResultsDecorationStyle(ComputedStyle&, Element*) const
override; |
99 | 99 |
100 public: | 100 public: |
101 // Constants and methods shared with ThemePainterMac | 101 // Constants and methods shared with ThemePainterMac |
102 | 102 |
103 // Get the control size based off the font. Used by some of the controls (li
ke buttons). | 103 // Get the control size based off the font. Used by some of the controls (li
ke buttons). |
104 NSControlSize controlSizeForFont(const ComputedStyle&) const; | 104 NSControlSize controlSizeForFont(const ComputedStyle&) const; |
105 NSControlSize controlSizeForSystemFont(const ComputedStyle&) const; | 105 NSControlSize controlSizeForSystemFont(const ComputedStyle&) const; |
106 void setControlSize(NSCell*, const IntSize* sizes, const IntSize& minSize, f
loat zoomLevel = 1.0f); | 106 void setControlSize(NSCell*, const IntSize* sizes, const IntSize& minSize, f
loat zoomLevel = 1.0f); |
107 void setSizeFromFont(ComputedStyle&, const IntSize* sizes) const; | 107 void setSizeFromFont(ComputedStyle&, const IntSize* sizes) const; |
108 IntSize sizeForFont(const ComputedStyle&, const IntSize* sizes) const; | 108 IntSize sizeForFont(const ComputedStyle&, const IntSize* sizes) const; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 static const int menuListArrowPaddingRight = 6; | 158 static const int menuListArrowPaddingRight = 6; |
159 static const int sliderThumbWidth = 15; | 159 static const int sliderThumbWidth = 15; |
160 static const int sliderThumbHeight = 15; | 160 static const int sliderThumbHeight = 15; |
161 static const int sliderThumbShadowBlur = 1; | 161 static const int sliderThumbShadowBlur = 1; |
162 static const int sliderThumbBorderWidth = 1; | 162 static const int sliderThumbBorderWidth = 1; |
163 static const int sliderTrackWidth = 5; | 163 static const int sliderTrackWidth = 5; |
164 static const int sliderTrackBorderWidth = 1; | 164 static const int sliderTrackBorderWidth = 1; |
165 | 165 |
166 protected: | 166 protected: |
167 void adjustMediaSliderThumbSize(ComputedStyle&) const; | 167 void adjustMediaSliderThumbSize(ComputedStyle&) const; |
168 virtual String extraFullScreenStyleSheet() override; | 168 String extraFullScreenStyleSheet() override; |
169 | 169 |
170 // Controls color values returned from platformFocusRingColor(). systemColor
() will be used when false. | 170 // Controls color values returned from platformFocusRingColor(). systemColor
() will be used when false. |
171 bool usesTestModeFocusRingColor() const; | 171 bool usesTestModeFocusRingColor() const; |
172 | 172 |
173 virtual bool shouldUseFallbackTheme(const ComputedStyle&) const override; | 173 bool shouldUseFallbackTheme(const ComputedStyle&) const override; |
174 | 174 |
175 private: | 175 private: |
176 virtual String fileListNameForWidth(Locale&, const FileList*, const Font&, i
nt width) const override; | 176 String fileListNameForWidth(Locale&, const FileList*, const Font&, int width
) const override; |
177 virtual String extraDefaultStyleSheet() override; | 177 String extraDefaultStyleSheet() override; |
178 virtual bool shouldShowPlaceholderWhenFocused() const override; | 178 bool shouldShowPlaceholderWhenFocused() const override; |
179 | 179 |
180 virtual ThemePainter& painter() override { return m_painter; } | 180 ThemePainter& painter() override { return m_painter; } |
181 | 181 |
182 mutable RetainPtr<NSPopUpButtonCell> m_popupButton; | 182 mutable RetainPtr<NSPopUpButtonCell> m_popupButton; |
183 mutable RetainPtr<NSSearchFieldCell> m_search; | 183 mutable RetainPtr<NSSearchFieldCell> m_search; |
184 mutable RetainPtr<NSMenu> m_searchMenuTemplate; | 184 mutable RetainPtr<NSMenu> m_searchMenuTemplate; |
185 mutable RetainPtr<NSLevelIndicatorCell> m_levelIndicator; | 185 mutable RetainPtr<NSLevelIndicatorCell> m_levelIndicator; |
186 mutable RetainPtr<NSTextFieldCell> m_textField; | 186 mutable RetainPtr<NSTextFieldCell> m_textField; |
187 | 187 |
188 mutable HashMap<int, RGBA32> m_systemColorCache; | 188 mutable HashMap<int, RGBA32> m_systemColorCache; |
189 | 189 |
190 RetainPtr<LayoutThemeNotificationObserver> m_notificationObserver; | 190 RetainPtr<LayoutThemeNotificationObserver> m_notificationObserver; |
191 | 191 |
192 ThemePainterMac m_painter; | 192 ThemePainterMac m_painter; |
193 }; | 193 }; |
194 | 194 |
195 } // namespace blink | 195 } // namespace blink |
196 | 196 |
197 #endif // LayoutThemeMac_h | 197 #endif // LayoutThemeMac_h |
OLD | NEW |