OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef WebThemeEngine_h | 31 #ifndef WebThemeEngine_h |
32 #define WebThemeEngine_h | 32 #define WebThemeEngine_h |
33 | 33 |
34 #include "../WebCanvas.h" | 34 #include "WebCanvas.h" |
35 #include "../WebColor.h" | 35 #include "WebColor.h" |
36 #include "../WebSize.h" | 36 #include "WebSize.h" |
37 | 37 |
38 namespace blink { | 38 namespace blink { |
39 | 39 |
40 struct WebRect; | 40 struct WebRect; |
41 | 41 |
| 42 // FIXME: crbug.com/327471. We need to merge the Apple and non-Apple implementat
ions. |
| 43 |
42 class WebThemeEngine { | 44 class WebThemeEngine { |
43 public: | 45 public: |
| 46 // The current state of the associated Part. |
| 47 enum State { |
| 48 StateDisabled, |
| 49 StateHover, // non-Apple |
| 50 StateNormal, // non-Apple |
| 51 StatePressed, |
| 52 StateFocused, // non-Apple |
| 53 StateReadonly, // non-Apple |
| 54 StateInactive, // Apple-specific |
| 55 StateActive, // Apple-specific |
| 56 }; |
| 57 |
| 58 // FIXME: The next section describes stuff only used on the Apple port. |
| 59 enum Size { |
| 60 SizeRegular, |
| 61 SizeSmall, |
| 62 }; |
| 63 |
| 64 enum ScrollbarOrientation { |
| 65 ScrollbarOrientationHorizontal, |
| 66 ScrollbarOrientationVertical, |
| 67 }; |
| 68 |
| 69 enum ScrollbarParent { |
| 70 ScrollbarParentScrollView, |
| 71 ScrollbarParentRenderLayer, |
| 72 }; |
| 73 |
| 74 struct ScrollbarInfo { |
| 75 ScrollbarOrientation orientation; |
| 76 ScrollbarParent parent; |
| 77 int maxValue; |
| 78 int currentValue; |
| 79 int visibleSize; |
| 80 int totalSize; |
| 81 }; |
| 82 |
| 83 virtual void paintScrollbarThumb(WebCanvas*, State, Size, const WebRect&, co
nst ScrollbarInfo&) { } |
| 84 |
| 85 // FIXME: The remaining definitions are only used on the non-Apple ports. |
| 86 |
44 // The UI part which is being accessed. | 87 // The UI part which is being accessed. |
45 enum Part { | 88 enum Part { |
46 // ScrollbarTheme parts | 89 // ScrollbarTheme parts |
47 PartScrollbarDownArrow, | 90 PartScrollbarDownArrow, |
48 PartScrollbarLeftArrow, | 91 PartScrollbarLeftArrow, |
49 PartScrollbarRightArrow, | 92 PartScrollbarRightArrow, |
50 PartScrollbarUpArrow, | 93 PartScrollbarUpArrow, |
51 PartScrollbarHorizontalThumb, | 94 PartScrollbarHorizontalThumb, |
52 PartScrollbarVerticalThumb, | 95 PartScrollbarVerticalThumb, |
53 PartScrollbarHorizontalTrack, | 96 PartScrollbarHorizontalTrack, |
54 PartScrollbarVerticalTrack, | 97 PartScrollbarVerticalTrack, |
55 PartScrollbarCorner, | 98 PartScrollbarCorner, |
56 | 99 |
57 // RenderTheme parts | 100 // RenderTheme parts |
58 PartCheckbox, | 101 PartCheckbox, |
59 PartRadio, | 102 PartRadio, |
60 PartButton, | 103 PartButton, |
61 PartTextField, | 104 PartTextField, |
62 PartMenuList, | 105 PartMenuList, |
63 PartSliderTrack, | 106 PartSliderTrack, |
64 PartSliderThumb, | 107 PartSliderThumb, |
65 PartInnerSpinButton, | 108 PartInnerSpinButton, |
66 PartProgressBar | 109 PartProgressBar |
67 }; | 110 }; |
68 | 111 |
69 // The current state of the associated Part. | |
70 enum State { | |
71 StateDisabled, | |
72 StateHover, | |
73 StateNormal, | |
74 StatePressed, | |
75 StateFocused, | |
76 StateReadonly, | |
77 }; | |
78 | 112 |
79 // Extra parameters for drawing the PartScrollbarHorizontalTrack and | 113 // Extra parameters for drawing the PartScrollbarHorizontalTrack and |
80 // PartScrollbarVerticalTrack. | 114 // PartScrollbarVerticalTrack. |
81 struct ScrollbarTrackExtraParams { | 115 struct ScrollbarTrackExtraParams { |
82 bool isBack; // Whether this is the 'back' part or the 'forward' part. | 116 bool isBack; // Whether this is the 'back' part or the 'forward' part. |
83 | 117 |
84 // The bounds of the entire track, as opposed to the part being painted. | 118 // The bounds of the entire track, as opposed to the part being painted. |
85 int trackX; | 119 int trackX; |
86 int trackY; | 120 int trackY; |
87 int trackWidth; | 121 int trackWidth; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 // like vertical scrollbar thumbs, the width will be the required width of | 184 // like vertical scrollbar thumbs, the width will be the required width of |
151 // the track while the height will be the minimum height. | 185 // the track while the height will be the minimum height. |
152 virtual WebSize getSize(Part) { return WebSize(); } | 186 virtual WebSize getSize(Part) { return WebSize(); } |
153 // Paint the given the given theme part. | 187 // Paint the given the given theme part. |
154 virtual void paint(WebCanvas*, Part, State, const WebRect&, const ExtraParam
s*) { } | 188 virtual void paint(WebCanvas*, Part, State, const WebRect&, const ExtraParam
s*) { } |
155 }; | 189 }; |
156 | 190 |
157 } // namespace blink | 191 } // namespace blink |
158 | 192 |
159 #endif | 193 #endif |
OLD | NEW |