]> git.saurik.com Git - iphone-api.git/blob - WebCore/RenderThemeChromiumGtk.h
Add support for new WinterBoard Settings features.
[iphone-api.git] / WebCore / RenderThemeChromiumGtk.h
1 /*
2 * This file is part of the WebKit project.
3 *
4 * Copyright (C) 2006 Apple Computer, Inc.
5 * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
6 * Copyright (C) 2007 Holger Hans Peter Freyther
7 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
8 * Copyright (C) 2008, 2009 Google, Inc.
9 * All rights reserved.
10 *
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details.
20 *
21 * You should have received a copy of the GNU Library General Public License
22 * along with this library; see the file COPYING.LIB. If not, write to
23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 * Boston, MA 02110-1301, USA.
25 *
26 */
27
28 #ifndef RenderThemeChromiumGtk_h
29 #define RenderThemeChromiumGtk_h
30
31 #include "RenderTheme.h"
32
33 #include <gtk/gtk.h>
34
35 namespace WebCore {
36
37 class RenderThemeChromiumGtk : public RenderTheme {
38 public:
39 RenderThemeChromiumGtk();
40 ~RenderThemeChromiumGtk() { }
41
42 virtual String extraDefaultStyleSheet();
43 virtual String extraQuirksStyleSheet();
44
45 // A method asking if the theme's controls actually care about redrawing when hovered.
46 virtual bool supportsHover(const RenderStyle*) const { return true; }
47
48 // A method asking if the theme is able to draw the focus ring.
49 virtual bool supportsFocusRing(const RenderStyle*) const;
50
51 // The platform selection color.
52 virtual Color platformActiveSelectionBackgroundColor() const;
53 virtual Color platformInactiveSelectionBackgroundColor() const;
54 virtual Color platformActiveSelectionForegroundColor() const;
55 virtual Color platformInactiveSelectionForegroundColor() const;
56 virtual Color platformTextSearchHighlightColor() const;
57
58 virtual double caretBlinkInterval() const;
59
60 // System fonts.
61 virtual void systemFont(int propId, Document*, FontDescription&) const;
62
63 virtual int minimumMenuListSize(RenderStyle*) const;
64
65 virtual bool paintCheckbox(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
66 virtual void setCheckboxSize(RenderStyle*) const;
67
68 virtual bool paintRadio(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
69 virtual void setRadioSize(RenderStyle*) const;
70
71 virtual bool paintButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
72
73 virtual bool paintTextField(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
74
75 virtual bool paintTextArea(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { return paintTextField(o, i, r); }
76
77 virtual bool paintSearchField(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
78
79 virtual bool paintSearchFieldResultsDecoration(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
80 virtual bool paintSearchFieldResultsButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
81 virtual bool paintSearchFieldCancelButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
82
83 // MenuList refers to an unstyled menulist (meaning a menulist without
84 // background-color or border set) and MenuListButton refers to a styled
85 // menulist (a menulist with background-color or border set). They have
86 // this distinction to support showing aqua style themes whenever they
87 // possibly can, which is something we don't want to replicate.
88 //
89 // In short, we either go down the MenuList code path or the MenuListButton
90 // codepath. We never go down both. And in both cases, they render the
91 // entire menulist.
92 virtual void adjustMenuListStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
93 virtual bool paintMenuList(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
94 virtual void adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
95 virtual bool paintMenuListButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
96
97 // These methods define the padding for the MenuList's inner block.
98 virtual int popupInternalPaddingLeft(RenderStyle*) const;
99 virtual int popupInternalPaddingRight(RenderStyle*) const;
100 virtual int popupInternalPaddingTop(RenderStyle*) const;
101 virtual int popupInternalPaddingBottom(RenderStyle*) const;
102
103 virtual void adjustButtonInnerStyle(RenderStyle* style) const;
104
105 // A method asking if the control changes its tint when the window has focus or not.
106 virtual bool controlSupportsTints(const RenderObject*) const;
107
108 // A general method asking if any control tinting is supported at all.
109 virtual bool supportsControlTints() const { return true; }
110
111 // List Box selection color
112 virtual Color activeListBoxSelectionBackgroundColor() const;
113 virtual Color activeListBoxSelectionForegroundColor() const;
114 virtual Color inactiveListBoxSelectionBackgroundColor() const;
115 virtual Color inactiveListBoxSelectionForegroundColor() const;
116
117 private:
118 // Hold the state
119 GtkWidget* gtkEntry() const;
120 GtkWidget* gtkTreeView() const;
121
122 // Unmapped GdkWindow having a container. This is holding all our fake widgets
123 GtkContainer* gtkContainer() const;
124
125 private:
126 int menuListInternalPadding(RenderStyle*, int paddingType) const;
127
128 mutable GtkWidget* m_gtkWindow;
129 mutable GtkContainer* m_gtkContainer;
130 mutable GtkWidget* m_gtkEntry;
131 mutable GtkWidget* m_gtkTreeView;
132 };
133
134 } // namespace WebCore
135
136 #endif