|
1 /* |
|
2 * Copyright (C) 2010 Google Inc. All rights reserved. |
|
3 * |
|
4 * Redistribution and use in source and binary forms, with or without |
|
5 * modification, are permitted provided that the following conditions are |
|
6 * met: |
|
7 * |
|
8 * * Redistributions of source code must retain the above copyright |
|
9 * notice, this list of conditions and the following disclaimer. |
|
10 * * Redistributions in binary form must reproduce the above |
|
11 * copyright notice, this list of conditions and the following disclaimer |
|
12 * in the documentation and/or other materials provided with the |
|
13 * distribution. |
|
14 * * Neither the name of Google Inc. nor the names of its |
|
15 * contributors may be used to endorse or promote products derived from |
|
16 * this software without specific prior written permission. |
|
17 * |
|
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
|
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
|
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
|
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
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. |
|
29 */ |
|
30 |
|
31 // This implements the WebThemeEngine API used by the Windows version of |
|
32 // Chromium to render native form controls like checkboxes, radio buttons, |
|
33 // and scroll bars. |
|
34 // The normal implementation (native_theme) renders the controls using either |
|
35 // the UXTheme theming engine present in XP, Vista, and Win 7, or the "classic" |
|
36 // theme used if that theme is selected in the Desktop settings. |
|
37 // Unfortunately, both of these themes render controls differently on the |
|
38 // different versions of Windows. |
|
39 // |
|
40 // In order to ensure maximum consistency of baselines across the different |
|
41 // Windows versions, we provide a simple implementation for DRT here |
|
42 // instead. These controls are actually platform-independent (they're rendered |
|
43 // using Skia) and could be used on Linux and the Mac as well, should we |
|
44 // choose to do so at some point. |
|
45 // |
|
46 |
|
47 #ifndef WebThemeEngineDRT_h |
|
48 #define WebThemeEngineDRT_h |
|
49 |
|
50 #include "public/WebThemeEngine.h" |
|
51 #include <wtf/Noncopyable.h> |
|
52 |
|
53 class WebThemeEngineDRT : public WebKit::WebThemeEngine, public Noncopyable { |
|
54 public: |
|
55 WebThemeEngineDRT() {} |
|
56 |
|
57 // WebThemeEngine methods: |
|
58 virtual void paintButton( |
|
59 WebKit::WebCanvas*, int part, int state, int classicState, |
|
60 const WebKit::WebRect&); |
|
61 |
|
62 virtual void paintMenuList( |
|
63 WebKit::WebCanvas*, int part, int state, int classicState, |
|
64 const WebKit::WebRect&); |
|
65 |
|
66 virtual void paintScrollbarArrow( |
|
67 WebKit::WebCanvas*, int state, int classicState, |
|
68 const WebKit::WebRect&); |
|
69 |
|
70 virtual void paintScrollbarThumb( |
|
71 WebKit::WebCanvas*, int part, int state, int classicState, |
|
72 const WebKit::WebRect&); |
|
73 |
|
74 virtual void paintScrollbarTrack( |
|
75 WebKit::WebCanvas*, int part, int state, int classicState, |
|
76 const WebKit::WebRect&, const WebKit::WebRect& alignRect); |
|
77 |
|
78 virtual void paintSpinButton( |
|
79 WebKit::WebCanvas*, int part, int state, int classicState, |
|
80 const WebKit::WebRect&); |
|
81 |
|
82 virtual void paintTextField( |
|
83 WebKit::WebCanvas*, int part, int state, int classicState, |
|
84 const WebKit::WebRect&, WebKit::WebColor, bool fillContentArea, |
|
85 bool drawEdges); |
|
86 |
|
87 virtual void paintTrackbar( |
|
88 WebKit::WebCanvas*, int part, int state, int classicState, |
|
89 const WebKit::WebRect&); |
|
90 |
|
91 virtual void paintProgressBar( |
|
92 WebKit::WebCanvas*, const WebKit::WebRect& barRect, |
|
93 const WebKit::WebRect& valueRect, |
|
94 bool determinate, double time); |
|
95 }; |
|
96 |
|
97 #endif // WebThemeEngineDRT_h |