| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of the WebKit project. | 2 * This file is part of the WebKit project. |
| 3 * | 3 * |
| 4 * Copyright (C) 2006 Apple Computer, Inc. | 4 * Copyright (C) 2006 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 25 matching lines...) Expand all Loading... |
| 36 struct ThemeData { | 36 struct ThemeData { |
| 37 ThemeData() : m_part(0), m_state(0), m_classicState(0) {} | 37 ThemeData() : m_part(0), m_state(0), m_classicState(0) {} |
| 38 | 38 |
| 39 unsigned m_part; | 39 unsigned m_part; |
| 40 unsigned m_state; | 40 unsigned m_state; |
| 41 unsigned m_classicState; | 41 unsigned m_classicState; |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 class RenderThemeWin : public RenderTheme { | 44 class RenderThemeWin : public RenderTheme { |
| 45 public: | 45 public: |
| 46 RenderThemeWin(); | 46 RenderThemeWin() { } |
| 47 ~RenderThemeWin(); | 47 ~RenderThemeWin() { } |
| 48 | 48 |
| 49 // A method asking if the theme's controls actually care about redrawing whe
n hovered. | 49 // A method asking if the theme's controls actually care about redrawing whe
n hovered. |
| 50 virtual bool supportsHover(const RenderStyle*) const { return true; } | 50 virtual bool supportsHover(const RenderStyle*) const { return true; } |
| 51 | 51 |
| 52 // A method asking if the theme is able to draw the focus ring. | 52 // A method asking if the theme is able to draw the focus ring. |
| 53 virtual bool supportsFocusRing(const RenderStyle*) const; | 53 virtual bool supportsFocusRing(const RenderStyle*) const; |
| 54 | 54 |
| 55 // The platform selection color. | 55 // The platform selection color. |
| 56 virtual Color platformActiveSelectionBackgroundColor() const; | 56 virtual Color platformActiveSelectionBackgroundColor() const; |
| 57 virtual Color platformInactiveSelectionBackgroundColor() const; | 57 virtual Color platformInactiveSelectionBackgroundColor() const; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 73 { return paintButton(o, i, r); } | 73 { return paintButton(o, i, r); } |
| 74 virtual void setRadioSize(RenderStyle* style) const; | 74 virtual void setRadioSize(RenderStyle* style) const; |
| 75 | 75 |
| 76 virtual bool paintButton(RenderObject*, const RenderObject::PaintInfo&, cons
t IntRect&); | 76 virtual bool paintButton(RenderObject*, const RenderObject::PaintInfo&, cons
t IntRect&); |
| 77 | 77 |
| 78 virtual bool paintTextField(RenderObject*, const RenderObject::PaintInfo&, c
onst IntRect&); | 78 virtual bool paintTextField(RenderObject*, const RenderObject::PaintInfo&, c
onst IntRect&); |
| 79 | 79 |
| 80 virtual bool paintTextArea(RenderObject* o, const RenderObject::PaintInfo& i
, const IntRect& r) | 80 virtual bool paintTextArea(RenderObject* o, const RenderObject::PaintInfo& i
, const IntRect& r) |
| 81 { return paintTextField(o, i, r); } | 81 { return paintTextField(o, i, r); } |
| 82 | 82 |
| 83 // MenuList refers to an unstyled menulist (meaning a menulist without | 83 virtual bool paintSearchField(RenderObject*, const RenderObject::PaintInfo&,
const IntRect&); |
| 84 // background-color or border set) and MenuListButton refers to a styled | 84 |
| 85 // menulist (a menulist with background-color or border set). They have | 85 // MenuList refers to an unstyled menulist (meaning a menulist without |
| 86 // this distinction to support showing aqua style themes whenever they | 86 // background-color or border set) and MenuListButton refers to a styled |
| 87 // menulist (a menulist with background-color or border set). They have |
| 88 // this distinction to support showing aqua style themes whenever they |
| 87 // possibly can, which is something we don't want to replicate. | 89 // possibly can, which is something we don't want to replicate. |
| 88 // | 90 // |
| 89 // In short, we either go down the MenuList code path or the MenuListButton | 91 // 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 | 92 // codepath. We never go down both. And in both cases, they render the |
| 91 // entire menulist. | 93 // entire menulist. |
| 92 virtual void adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle* st
yle, Element* e) const; | 94 virtual void adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle* st
yle, Element* e) const; |
| 93 virtual bool paintMenuList(RenderObject*, const RenderObject::PaintInfo&, co
nst IntRect&); | 95 virtual bool paintMenuList(RenderObject*, const RenderObject::PaintInfo&, co
nst IntRect&); |
| 94 virtual void adjustMenuListButtonStyle(CSSStyleSelector* selector, RenderSty
le* style, Element* e) const; | 96 virtual void adjustMenuListButtonStyle(CSSStyleSelector* selector, RenderSty
le* style, Element* e) const; |
| 95 virtual bool paintMenuListButton(RenderObject*, const RenderObject::PaintInf
o&, const IntRect&); | 97 virtual bool paintMenuListButton(RenderObject*, const RenderObject::PaintInf
o&, const IntRect&); |
| 96 | 98 |
| 97 // These methods define the padding for the MenuList's inner block. | 99 // These methods define the padding for the MenuList's inner block. |
| 98 virtual int popupInternalPaddingLeft(RenderStyle*) const; | 100 virtual int popupInternalPaddingLeft(RenderStyle*) const; |
| 99 virtual int popupInternalPaddingRight(RenderStyle*) const; | 101 virtual int popupInternalPaddingRight(RenderStyle*) const; |
| 100 virtual int popupInternalPaddingTop(RenderStyle*) const; | 102 virtual int popupInternalPaddingTop(RenderStyle*) const; |
| 101 virtual int popupInternalPaddingBottom(RenderStyle*) const; | 103 virtual int popupInternalPaddingBottom(RenderStyle*) const; |
| 102 | 104 |
| 103 virtual void adjustButtonInnerStyle(RenderStyle* style) const; | 105 virtual void adjustButtonInnerStyle(RenderStyle* style) const; |
| 104 | 106 |
| 105 virtual void adjustSliderThumbSize(RenderObject*) const; | 107 virtual void adjustSliderThumbSize(RenderObject*) const; |
| 106 | 108 |
| 109 virtual void adjustSearchFieldStyle(CSSStyleSelector*, RenderStyle*, Element
*) const; |
| 107 virtual void adjustSearchFieldCancelButtonStyle(CSSStyleSelector*, RenderSty
le*, Element*) const; | 110 virtual void adjustSearchFieldCancelButtonStyle(CSSStyleSelector*, RenderSty
le*, Element*) const; |
| 108 virtual void adjustSearchFieldStyle(CSSStyleSelector*, RenderStyle*, Element
*) const; | |
| 109 virtual void adjustSearchFieldDecorationStyle(CSSStyleSelector*, RenderStyle
*, Element*) const; | 111 virtual void adjustSearchFieldDecorationStyle(CSSStyleSelector*, RenderStyle
*, Element*) const; |
| 110 virtual void adjustSearchFieldResultsDecorationStyle(CSSStyleSelector*, Rend
erStyle*, Element*) const; | 112 virtual void adjustSearchFieldResultsDecorationStyle(CSSStyleSelector*, Rend
erStyle*, Element*) const; |
| 111 virtual void adjustSearchFieldResultsButtonStyle(CSSStyleSelector*, RenderSt
yle*, Element*) const; | 113 virtual void adjustSearchFieldResultsButtonStyle(CSSStyleSelector*, RenderSt
yle*, Element*) const; |
| 112 | 114 |
| 113 virtual bool paintSearchField(RenderObject*, const RenderObject::PaintInfo&,
const IntRect&); | |
| 114 | |
| 115 // Provide a way to pass the default font size from the Settings object to | 115 // Provide a way to pass the default font size from the Settings object to |
| 116 // the render theme. TODO(tc): http://b/1129186 A cleaner way would be to | 116 // the render theme. TODO(tc): http://b/1129186 A cleaner way would be to |
| 117 // remove the default font size from this object and have callers that need | 117 // remove the default font size from this object and have callers that need |
| 118 // the value to get it directly from the appropriate Settings object. | 118 // the value to get it directly from the appropriate Settings object. |
| 119 static void setDefaultFontSize(int); | 119 static void setDefaultFontSize(int); |
| 120 | 120 |
| 121 private: | 121 private: |
| 122 void addIntrinsicMargins(RenderStyle*) const; | |
| 123 | |
| 124 unsigned determineState(RenderObject*); | 122 unsigned determineState(RenderObject*); |
| 125 unsigned determineClassicState(RenderObject*); | 123 unsigned determineClassicState(RenderObject*); |
| 126 | 124 |
| 127 ThemeData getThemeData(RenderObject*); | 125 ThemeData getThemeData(RenderObject*); |
| 128 | 126 |
| 129 bool paintTextFieldInternal(RenderObject*, const RenderObject::PaintInfo&, c
onst IntRect&, bool); | 127 bool paintTextFieldInternal(RenderObject*, const RenderObject::PaintInfo&, c
onst IntRect&, bool); |
| 130 | 128 |
| 131 void setButtonPadding(RenderStyle* style) const; | 129 void setButtonPadding(RenderStyle* style) const; |
| 132 | 130 |
| 133 // Gets the minimal x button padding according to the current theme. | 131 // Gets the minimal x button padding according to the current theme. |
| 134 void getMinimalButtonPadding(Length* minXPadding) const; | 132 void getMinimalButtonPadding(Length* minXPadding) const; |
| 135 | 133 |
| 136 int menuListInternalPadding(RenderStyle* style, int paddingType) const; | 134 int menuListInternalPadding(RenderStyle* style, int paddingType) const; |
| 137 }; | 135 }; |
| 138 | 136 |
| 139 } | 137 } |
| 140 | 138 |
| 141 #endif | 139 #endif |
| OLD | NEW |