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, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc. | 4 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 #ifndef RenderTheme_h | 23 #ifndef RenderTheme_h |
24 #define RenderTheme_h | 24 #define RenderTheme_h |
25 | 25 |
26 #if USE(NEW_THEME) | 26 #if USE(NEW_THEME) |
27 #include "platform/Theme.h" | 27 #include "platform/Theme.h" |
28 #else | 28 #else |
29 #include "platform/ThemeTypes.h" | 29 #include "platform/ThemeTypes.h" |
30 #endif | 30 #endif |
31 #include "core/rendering/RenderObject.h" | 31 #include "core/rendering/RenderObject.h" |
32 #include "core/rendering/style/CachedUAStyle.h" | |
33 #include "platform/scroll/ScrollTypes.h" | 32 #include "platform/scroll/ScrollTypes.h" |
34 #include "wtf/PassRefPtr.h" | 33 #include "wtf/PassRefPtr.h" |
35 #include "wtf/RefCounted.h" | 34 #include "wtf/RefCounted.h" |
36 #include "wtf/text/WTFString.h" | 35 #include "wtf/text/WTFString.h" |
37 | 36 |
38 namespace blink { | 37 namespace blink { |
39 | 38 |
40 class Element; | 39 class Element; |
41 class FileList; | 40 class FileList; |
42 class HTMLInputElement; | 41 class HTMLInputElement; |
(...skipping 12 matching lines...) Expand all Loading... |
55 // appropriate platform theme. | 54 // appropriate platform theme. |
56 static RenderTheme& theme(); | 55 static RenderTheme& theme(); |
57 | 56 |
58 static void setSizeIfAuto(RenderStyle*, const IntSize&); | 57 static void setSizeIfAuto(RenderStyle*, const IntSize&); |
59 | 58 |
60 // This method is called whenever style has been computed for an element and
the appearance | 59 // This method is called whenever style has been computed for an element and
the appearance |
61 // property has been set to a value other than "none". The theme should map
in all of the appropriate | 60 // property has been set to a value other than "none". The theme should map
in all of the appropriate |
62 // metrics and defaults given the contents of the style. This includes soph
isticated operations like | 61 // metrics and defaults given the contents of the style. This includes soph
isticated operations like |
63 // selection of control size based off the font, the disabling of appearance
when certain other properties like | 62 // selection of control size based off the font, the disabling of appearance
when certain other properties like |
64 // "border" are set, or if the appearance is not supported by the theme. | 63 // "border" are set, or if the appearance is not supported by the theme. |
65 void adjustStyle(RenderStyle*, Element*, const CachedUAStyle*); | 64 void adjustStyle(RenderStyle*, Element*, bool uaStyleHasWebkitAppearance, bo
ol valuesUnchangedForWebkitAppearance); |
66 | 65 |
67 // This method is called to paint the widget as a background of the RenderOb
ject. A widget's foreground, e.g., the | 66 // This method is called to paint the widget as a background of the RenderOb
ject. A widget's foreground, e.g., the |
68 // text of a button, is always rendered by the engine itself. The boolean r
eturn value indicates | 67 // text of a button, is always rendered by the engine itself. The boolean r
eturn value indicates |
69 // whether the CSS border/background should also be painted. | 68 // whether the CSS border/background should also be painted. |
70 bool paint(RenderObject*, const PaintInfo&, const IntRect&); | 69 bool paint(RenderObject*, const PaintInfo&, const IntRect&); |
71 bool paintBorderOnly(RenderObject*, const PaintInfo&, const IntRect&); | 70 bool paintBorderOnly(RenderObject*, const PaintInfo&, const IntRect&); |
72 bool paintDecorations(RenderObject*, const PaintInfo&, const IntRect&); | 71 bool paintDecorations(RenderObject*, const PaintInfo&, const IntRect&); |
73 | 72 |
74 // The remaining methods should be implemented by the platform-specific port
ion of the theme, e.g., | 73 // The remaining methods should be implemented by the platform-specific port
ion of the theme, e.g., |
75 // RenderThemeMac.cpp for Mac OS X. | 74 // RenderThemeMac.cpp for Mac OS X. |
(...skipping 11 matching lines...) Expand all Loading... |
87 virtual int baselinePosition(const RenderObject*) const; | 86 virtual int baselinePosition(const RenderObject*) const; |
88 | 87 |
89 // A method for asking if a control is a container or not. Leaf controls ha
ve to have some special behavior (like | 88 // A method for asking if a control is a container or not. Leaf controls ha
ve to have some special behavior (like |
90 // the baseline position API above). | 89 // the baseline position API above). |
91 bool isControlContainer(ControlPart) const; | 90 bool isControlContainer(ControlPart) const; |
92 | 91 |
93 // A method asking if the control changes its tint when the window has focus
or not. | 92 // A method asking if the control changes its tint when the window has focus
or not. |
94 virtual bool controlSupportsTints(const RenderObject*) const { return false;
} | 93 virtual bool controlSupportsTints(const RenderObject*) const { return false;
} |
95 | 94 |
96 // Whether or not the control has been styled enough by the author to disabl
e the native appearance. | 95 // Whether or not the control has been styled enough by the author to disabl
e the native appearance. |
97 virtual bool isControlStyled(const RenderStyle*, const CachedUAStyle*) const
; | 96 bool isControlStyled(const RenderStyle*, bool valuesUnchangedForWebkitAppear
ance) const; |
98 | 97 |
99 // A general method asking if any control tinting is supported at all. | 98 // A general method asking if any control tinting is supported at all. |
100 virtual bool supportsControlTints() const { return false; } | 99 virtual bool supportsControlTints() const { return false; } |
101 | 100 |
102 // Some controls may spill out of their containers (e.g., the check on an OS
X checkbox). When these controls repaint, | 101 // Some controls may spill out of their containers (e.g., the check on an OS
X checkbox). When these controls repaint, |
103 // the theme needs to communicate this inflated rect to the engine so that i
t can invalidate the whole control. | 102 // the theme needs to communicate this inflated rect to the engine so that i
t can invalidate the whole control. |
104 virtual void adjustRepaintRect(const RenderObject*, IntRect&); | 103 virtual void adjustRepaintRect(const RenderObject*, IntRect&); |
105 | 104 |
106 // This method is called whenever a relevant state changes on a particular t
hemed object, e.g., the mouse becomes pressed | 105 // This method is called whenever a relevant state changes on a particular t
hemed object, e.g., the mouse becomes pressed |
107 // or a control becomes disabled. | 106 // or a control becomes disabled. |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 static const RGBA32 defaultCompositionBackgroundColor = 0xFFFFDD55; | 308 static const RGBA32 defaultCompositionBackgroundColor = 0xFFFFDD55; |
310 | 309 |
311 #if USE(NEW_THEME) | 310 #if USE(NEW_THEME) |
312 Theme* m_platformTheme; // The platform-specific theme. | 311 Theme* m_platformTheme; // The platform-specific theme. |
313 #endif | 312 #endif |
314 }; | 313 }; |
315 | 314 |
316 } // namespace blink | 315 } // namespace blink |
317 | 316 |
318 #endif // RenderTheme_h | 317 #endif // RenderTheme_h |
OLD | NEW |