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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // appropriate platform theme. | 58 // appropriate platform theme. |
59 static RenderTheme& theme(); | 59 static RenderTheme& theme(); |
60 | 60 |
61 static void setSizeIfAuto(RenderStyle*, const IntSize&); | 61 static void setSizeIfAuto(RenderStyle*, const IntSize&); |
62 | 62 |
63 // This method is called whenever style has been computed for an element and
the appearance | 63 // This method is called whenever style has been computed for an element and
the appearance |
64 // property has been set to a value other than "none". The theme should map
in all of the appropriate | 64 // property has been set to a value other than "none". The theme should map
in all of the appropriate |
65 // metrics and defaults given the contents of the style. This includes soph
isticated operations like | 65 // metrics and defaults given the contents of the style. This includes soph
isticated operations like |
66 // selection of control size based off the font, the disabling of appearance
when certain other properties like | 66 // selection of control size based off the font, the disabling of appearance
when certain other properties like |
67 // "border" are set, or if the appearance is not supported by the theme. | 67 // "border" are set, or if the appearance is not supported by the theme. |
68 void adjustStyle(RenderStyle*, Element*, const CachedUAStyle&); | 68 void adjustStyle(RenderStyle*, Element*, const CachedUAStyle*); |
69 | 69 |
70 // This method is called to paint the widget as a background of the RenderOb
ject. A widget's foreground, e.g., the | 70 // This method is called to paint the widget as a background of the RenderOb
ject. A widget's foreground, e.g., the |
71 // text of a button, is always rendered by the engine itself. The boolean r
eturn value indicates | 71 // text of a button, is always rendered by the engine itself. The boolean r
eturn value indicates |
72 // whether the CSS border/background should also be painted. | 72 // whether the CSS border/background should also be painted. |
73 bool paint(RenderObject*, const PaintInfo&, const IntRect&); | 73 bool paint(RenderObject*, const PaintInfo&, const IntRect&); |
74 bool paintBorderOnly(RenderObject*, const PaintInfo&, const IntRect&); | 74 bool paintBorderOnly(RenderObject*, const PaintInfo&, const IntRect&); |
75 bool paintDecorations(RenderObject*, const PaintInfo&, const IntRect&); | 75 bool paintDecorations(RenderObject*, const PaintInfo&, const IntRect&); |
76 | 76 |
77 // The remaining methods should be implemented by the platform-specific port
ion of the theme, e.g., | 77 // The remaining methods should be implemented by the platform-specific port
ion of the theme, e.g., |
78 // RenderThemeMac.cpp for Mac OS X. | 78 // RenderThemeMac.cpp for Mac OS X. |
(...skipping 11 matching lines...) Expand all Loading... |
90 virtual int baselinePosition(const RenderObject*) const; | 90 virtual int baselinePosition(const RenderObject*) const; |
91 | 91 |
92 // A method for asking if a control is a container or not. Leaf controls ha
ve to have some special behavior (like | 92 // A method for asking if a control is a container or not. Leaf controls ha
ve to have some special behavior (like |
93 // the baseline position API above). | 93 // the baseline position API above). |
94 bool isControlContainer(ControlPart) const; | 94 bool isControlContainer(ControlPart) const; |
95 | 95 |
96 // A method asking if the control changes its tint when the window has focus
or not. | 96 // A method asking if the control changes its tint when the window has focus
or not. |
97 virtual bool controlSupportsTints(const RenderObject*) const { return false;
} | 97 virtual bool controlSupportsTints(const RenderObject*) const { return false;
} |
98 | 98 |
99 // Whether or not the control has been styled enough by the author to disabl
e the native appearance. | 99 // Whether or not the control has been styled enough by the author to disabl
e the native appearance. |
100 virtual bool isControlStyled(const RenderStyle*, const CachedUAStyle&) const
; | 100 virtual bool isControlStyled(const RenderStyle*, const CachedUAStyle*) const
; |
101 | 101 |
102 // A general method asking if any control tinting is supported at all. | 102 // A general method asking if any control tinting is supported at all. |
103 virtual bool supportsControlTints() const { return false; } | 103 virtual bool supportsControlTints() const { return false; } |
104 | 104 |
105 // Some controls may spill out of their containers (e.g., the check on an OS
X checkbox). When these controls repaint, | 105 // Some controls may spill out of their containers (e.g., the check on an OS
X checkbox). When these controls repaint, |
106 // the theme needs to communicate this inflated rect to the engine so that i
t can invalidate the whole control. | 106 // the theme needs to communicate this inflated rect to the engine so that i
t can invalidate the whole control. |
107 virtual void adjustRepaintRect(const RenderObject*, IntRect&); | 107 virtual void adjustRepaintRect(const RenderObject*, IntRect&); |
108 | 108 |
109 // This method is called whenever a relevant state changes on a particular t
hemed object, e.g., the mouse becomes pressed | 109 // This method is called whenever a relevant state changes on a particular t
hemed object, e.g., the mouse becomes pressed |
110 // or a control becomes disabled. | 110 // or a control becomes disabled. |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 static const RGBA32 defaultTapHighlightColor = 0x66000000; | 307 static const RGBA32 defaultTapHighlightColor = 0x66000000; |
308 | 308 |
309 #if USE(NEW_THEME) | 309 #if USE(NEW_THEME) |
310 Theme* m_platformTheme; // The platform-specific theme. | 310 Theme* m_platformTheme; // The platform-specific theme. |
311 #endif | 311 #endif |
312 }; | 312 }; |
313 | 313 |
314 } // namespace WebCore | 314 } // namespace WebCore |
315 | 315 |
316 #endif // RenderTheme_h | 316 #endif // RenderTheme_h |
OLD | NEW |