]>
git.saurik.com Git - iphone-api.git/blob - WebCore/RenderThemeWin.h
2 * This file is part of the WebKit project.
4 * Copyright (C) 2006, 2008 Apple Computer, Inc.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
23 #ifndef RenderThemeWin_h
24 #define RenderThemeWin_h
26 #include "RenderTheme.h"
30 typedef struct HINSTANCE__
* HINSTANCE
;
31 typedef HINSTANCE HMODULE
;
37 ThemeData() :m_part(0), m_state(0), m_classicState(0) {}
38 ThemeData(int part
, int state
)
46 unsigned m_classicState
;
49 class RenderThemeWin
: public RenderTheme
{
54 virtual String
extraDefaultStyleSheet();
55 virtual String
extraQuirksStyleSheet();
57 // A method asking if the theme's controls actually care about redrawing when hovered.
58 virtual bool supportsHover(const RenderStyle
*) const;
60 virtual Color
platformActiveSelectionBackgroundColor() const;
61 virtual Color
platformInactiveSelectionBackgroundColor() const;
62 virtual Color
platformActiveSelectionForegroundColor() const;
63 virtual Color
platformInactiveSelectionForegroundColor() const;
66 virtual void systemFont(int propId
, FontDescription
&) const;
67 virtual Color
systemColor(int cssValueId
) const;
69 virtual bool paintCheckbox(RenderObject
* o
, const RenderObject::PaintInfo
& i
, const IntRect
& r
)
70 { return paintButton(o
, i
, r
); }
71 virtual void setCheckboxSize(RenderStyle
*) const;
73 virtual bool paintRadio(RenderObject
* o
, const RenderObject::PaintInfo
& i
, const IntRect
& r
)
74 { return paintButton(o
, i
, r
); }
75 virtual void setRadioSize(RenderStyle
* style
) const
76 { return setCheckboxSize(style
); }
78 virtual bool paintButton(RenderObject
*, const RenderObject::PaintInfo
&, const IntRect
&);
80 virtual bool paintTextField(RenderObject
*, const RenderObject::PaintInfo
&, const IntRect
&);
82 virtual bool paintTextArea(RenderObject
* o
, const RenderObject::PaintInfo
& i
, const IntRect
& r
)
83 { return paintTextField(o
, i
, r
); }
85 virtual void adjustMenuListStyle(CSSStyleSelector
* selector
, RenderStyle
* style
, Element
* e
) const;
86 virtual bool paintMenuList(RenderObject
*, const RenderObject::PaintInfo
&, const IntRect
&);
87 virtual void adjustMenuListButtonStyle(CSSStyleSelector
* selector
, RenderStyle
* style
, Element
* e
) const;
89 virtual bool paintMenuListButton(RenderObject
*, const RenderObject::PaintInfo
&, const IntRect
&);
91 virtual bool paintSliderTrack(RenderObject
* o
, const RenderObject::PaintInfo
& i
, const IntRect
& r
);
92 virtual bool paintSliderThumb(RenderObject
* o
, const RenderObject::PaintInfo
& i
, const IntRect
& r
);
93 virtual void adjustSliderThumbSize(RenderObject
*) const;
95 virtual void adjustButtonInnerStyle(RenderStyle
*) const;
97 virtual void adjustSearchFieldStyle(CSSStyleSelector
*, RenderStyle
*, Element
*) const;
98 virtual bool paintSearchField(RenderObject
*, const RenderObject::PaintInfo
&, const IntRect
&);
100 virtual void adjustSearchFieldCancelButtonStyle(CSSStyleSelector
*, RenderStyle
*, Element
*) const;
101 virtual bool paintSearchFieldCancelButton(RenderObject
*, const RenderObject::PaintInfo
&, const IntRect
&);
103 virtual void adjustSearchFieldDecorationStyle(CSSStyleSelector
*, RenderStyle
*, Element
*) const;
104 virtual bool paintSearchFieldDecoration(RenderObject
*, const RenderObject::PaintInfo
&, const IntRect
&) { return false; }
106 virtual void adjustSearchFieldResultsDecorationStyle(CSSStyleSelector
*, RenderStyle
*, Element
*) const;
107 virtual bool paintSearchFieldResultsDecoration(RenderObject
*, const RenderObject::PaintInfo
&, const IntRect
&);
109 virtual void adjustSearchFieldResultsButtonStyle(CSSStyleSelector
*, RenderStyle
*, Element
*) const;
110 virtual bool paintSearchFieldResultsButton(RenderObject
*, const RenderObject::PaintInfo
&, const IntRect
&);
112 virtual void themeChanged();
114 virtual void adjustButtonStyle(CSSStyleSelector
*, RenderStyle
* style
, Element
*) const {}
115 virtual void adjustTextFieldStyle(CSSStyleSelector
*, RenderStyle
* style
, Element
*) const {}
116 virtual void adjustTextAreaStyle(CSSStyleSelector
*, RenderStyle
* style
, Element
*) const {}
118 static void setWebKitIsBeingUnloaded();
120 virtual bool supportsFocusRing(const RenderStyle
*) const;
123 void addIntrinsicMargins(RenderStyle
*) const;
126 unsigned determineState(RenderObject
*);
127 unsigned determineClassicState(RenderObject
*);
128 unsigned determineSliderThumbState(RenderObject
*);
129 unsigned determineButtonState(RenderObject
*);
131 bool supportsFocus(ControlPart
) const;
133 ThemeData
getThemeData(RenderObject
*);
134 ThemeData
getClassicThemeData(RenderObject
* o
);
136 HANDLE
buttonTheme() const;
137 HANDLE
textFieldTheme() const;
138 HANDLE
menuListTheme() const;
139 HANDLE
sliderTheme() const;
141 mutable HANDLE m_buttonTheme
;
142 mutable HANDLE m_textFieldTheme
;
143 mutable HANDLE m_menuListTheme
;
144 mutable HANDLE m_sliderTheme
;