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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // appropriate platform theme. When the theme is needed in non-page dependen
t code, a default theme is | 55 // appropriate platform theme. When the theme is needed in non-page dependen
t code, a default theme is |
56 // used as fallback, which is returned for a nulled page, so the platform co
de needs to account for this. | 56 // used as fallback, which is returned for a nulled page, so the platform co
de needs to account for this. |
57 static PassRefPtr<RenderTheme> themeForPage(Page* page); | 57 static PassRefPtr<RenderTheme> themeForPage(Page* page); |
58 | 58 |
59 // When the theme is needed in non-page dependent code, the defaultTheme() i
s used as fallback. | 59 // When the theme is needed in non-page dependent code, the defaultTheme() i
s used as fallback. |
60 static inline PassRefPtr<RenderTheme> defaultTheme() | 60 static inline PassRefPtr<RenderTheme> defaultTheme() |
61 { | 61 { |
62 return themeForPage(0); | 62 return themeForPage(0); |
63 }; | 63 }; |
64 | 64 |
| 65 static void setSizeIfAuto(RenderStyle*, const IntSize&); |
| 66 |
65 // This method is called whenever style has been computed for an element and
the appearance | 67 // This method is called whenever style has been computed for an element and
the appearance |
66 // property has been set to a value other than "none". The theme should map
in all of the appropriate | 68 // property has been set to a value other than "none". The theme should map
in all of the appropriate |
67 // metrics and defaults given the contents of the style. This includes soph
isticated operations like | 69 // metrics and defaults given the contents of the style. This includes soph
isticated operations like |
68 // selection of control size based off the font, the disabling of appearance
when certain other properties like | 70 // selection of control size based off the font, the disabling of appearance
when certain other properties like |
69 // "border" are set, or if the appearance is not supported by the theme. | 71 // "border" are set, or if the appearance is not supported by the theme. |
70 void adjustStyle(StyleResolver*, RenderStyle*, Element*, bool UAHasAppearan
ce, | 72 void adjustStyle(StyleResolver*, RenderStyle*, Element*, bool UAHasAppearan
ce, |
71 const BorderData&, const FillLayer&, const Color& backgroun
dColor); | 73 const BorderData&, const FillLayer&, const Color& backgroun
dColor); |
72 | 74 |
73 // This method is called to paint the widget as a background of the RenderOb
ject. A widget's foreground, e.g., the | 75 // This method is called to paint the widget as a background of the RenderOb
ject. A widget's foreground, e.g., the |
74 // text of a button, is always rendered by the engine itself. The boolean r
eturn value indicates | 76 // text of a button, is always rendered by the engine itself. The boolean r
eturn value indicates |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, co
nst IntRect&) { return true; } | 308 virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, co
nst IntRect&) { return true; } |
307 virtual bool paintMediaRewindButton(RenderObject*, const PaintInfo&, const I
ntRect&) { return true; } | 309 virtual bool paintMediaRewindButton(RenderObject*, const PaintInfo&, const I
ntRect&) { return true; } |
308 virtual bool paintMediaReturnToRealtimeButton(RenderObject*, const PaintInfo
&, const IntRect&) { return true; } | 310 virtual bool paintMediaReturnToRealtimeButton(RenderObject*, const PaintInfo
&, const IntRect&) { return true; } |
309 virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const Paint
Info&, const IntRect&) { return true; } | 311 virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const Paint
Info&, const IntRect&) { return true; } |
310 virtual bool paintMediaControlsBackground(RenderObject*, const PaintInfo&, c
onst IntRect&) { return true; } | 312 virtual bool paintMediaControlsBackground(RenderObject*, const PaintInfo&, c
onst IntRect&) { return true; } |
311 virtual bool paintMediaCurrentTime(RenderObject*, const PaintInfo&, const In
tRect&) { return true; } | 313 virtual bool paintMediaCurrentTime(RenderObject*, const PaintInfo&, const In
tRect&) { return true; } |
312 virtual bool paintMediaTimeRemaining(RenderObject*, const PaintInfo&, const
IntRect&) { return true; } | 314 virtual bool paintMediaTimeRemaining(RenderObject*, const PaintInfo&, const
IntRect&) { return true; } |
313 virtual bool paintMediaFullScreenVolumeSliderTrack(RenderObject*, const Pain
tInfo&, const IntRect&) { return true; } | 315 virtual bool paintMediaFullScreenVolumeSliderTrack(RenderObject*, const Pain
tInfo&, const IntRect&) { return true; } |
314 virtual bool paintMediaFullScreenVolumeSliderThumb(RenderObject*, const Pain
tInfo&, const IntRect&) { return true; } | 316 virtual bool paintMediaFullScreenVolumeSliderThumb(RenderObject*, const Pain
tInfo&, const IntRect&) { return true; } |
315 | 317 |
| 318 virtual bool shouldUseFallbackTheme(RenderStyle*) const; |
| 319 void adjustStyleUsingFallbackTheme(StyleResolver*, RenderStyle*, Element*); |
| 320 bool paintUsingFallbackTheme(RenderObject*, const PaintInfo&, const IntRect&
); |
| 321 void adjustCheckboxStyleUsingFallbackTheme(StyleResolver*, RenderStyle*, Ele
ment*) const; |
| 322 bool paintCheckboxUsingFallbackTheme(RenderObject*, const PaintInfo&, const
IntRect&); |
| 323 void adjustRadioStyleUsingFallbackTheme(StyleResolver*, RenderStyle*, Elemen
t*) const; |
| 324 bool paintRadioUsingFallbackTheme(RenderObject*, const PaintInfo&, const Int
Rect&); |
| 325 |
316 public: | 326 public: |
317 // Methods for state querying | 327 // Methods for state querying |
318 ControlStates controlStatesForRenderer(const RenderObject* o) const; | 328 ControlStates controlStatesForRenderer(const RenderObject* o) const; |
319 bool isActive(const RenderObject*) const; | 329 bool isActive(const RenderObject*) const; |
320 bool isChecked(const RenderObject*) const; | 330 bool isChecked(const RenderObject*) const; |
321 bool isIndeterminate(const RenderObject*) const; | 331 bool isIndeterminate(const RenderObject*) const; |
322 bool isEnabled(const RenderObject*) const; | 332 bool isEnabled(const RenderObject*) const; |
323 bool isFocused(const RenderObject*) const; | 333 bool isFocused(const RenderObject*) const; |
324 bool isPressed(const RenderObject*) const; | 334 bool isPressed(const RenderObject*) const; |
325 bool isSpinUpButtonPartPressed(const RenderObject*) const; | 335 bool isSpinUpButtonPartPressed(const RenderObject*) const; |
(...skipping 17 matching lines...) Expand all Loading... |
343 static const RGBA32 defaultTapHighlightColor = 0x66000000; | 353 static const RGBA32 defaultTapHighlightColor = 0x66000000; |
344 | 354 |
345 #if USE(NEW_THEME) | 355 #if USE(NEW_THEME) |
346 Theme* m_theme; // The platform-specific theme. | 356 Theme* m_theme; // The platform-specific theme. |
347 #endif | 357 #endif |
348 }; | 358 }; |
349 | 359 |
350 } // namespace WebCore | 360 } // namespace WebCore |
351 | 361 |
352 #endif // RenderTheme_h | 362 #endif // RenderTheme_h |
OLD | NEW |