| Index: rendering/RenderThemeChromiumMac.h
|
| ===================================================================
|
| --- rendering/RenderThemeChromiumMac.h (revision 48239)
|
| +++ rendering/RenderThemeChromiumMac.h (working copy)
|
| @@ -3,7 +3,6 @@
|
| *
|
| * Copyright (C) 2005 Apple Computer, Inc.
|
| * Copyright (C) 2008, 2009 Google, Inc.
|
| - * Copyright (C) 2009 Kenneth Rohde Christiansen
|
| *
|
| * This library is free software; you can redistribute it and/or
|
| * modify it under the terms of the GNU Library General Public
|
| @@ -26,7 +25,6 @@
|
| #define RenderThemeChromiumMac_h
|
|
|
| #import "RenderTheme.h"
|
| -#import <AppKit/AppKit.h>
|
| #import <wtf/HashMap.h>
|
| #import <wtf/RetainPtr.h>
|
|
|
| @@ -36,186 +34,169 @@
|
| class WebCoreRenderThemeNotificationObserver;
|
| #endif
|
|
|
| +// This file (and its associated .mm file) is a clone of RenderThemeMac.h. See
|
| +// the .mm file for details.
|
| +
|
| namespace WebCore {
|
|
|
| - class RenderStyle;
|
| +class RenderStyle;
|
|
|
| - class RenderThemeChromiumMac : public RenderTheme {
|
| - public:
|
| - static PassRefPtr<RenderTheme> create();
|
| +class RenderThemeChromiumMac : public RenderTheme {
|
| +public:
|
| + static PassRefPtr<RenderTheme> create();
|
|
|
| - // A method to obtain the baseline position for a "leaf" control. This will only be used if a baseline
|
| - // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of
|
| - // controls that need to do this.
|
| - virtual int baselinePosition(const RenderObject*) const;
|
| + // A method asking if the control changes its tint when the window has focus or not.
|
| + virtual bool controlSupportsTints(const RenderObject*) const;
|
|
|
| - // A method asking if the control changes its tint when the window has focus or not.
|
| - virtual bool controlSupportsTints(const RenderObject*) const;
|
| + // A general method asking if any control tinting is supported at all.
|
| + virtual bool supportsControlTints() const { return true; }
|
|
|
| - // A general method asking if any control tinting is supported at all.
|
| - virtual bool supportsControlTints() const { return true; }
|
| + virtual void adjustRepaintRect(const RenderObject*, IntRect&);
|
|
|
| - virtual void adjustRepaintRect(const RenderObject*, IntRect&);
|
| + virtual bool isControlStyled(const RenderStyle*, const BorderData&,
|
| + const FillLayer&, const Color& backgroundColor) const;
|
|
|
| - virtual bool isControlStyled(const RenderStyle*, const BorderData&,
|
| - const FillLayer&, const Color& backgroundColor) const;
|
| + virtual Color platformActiveSelectionBackgroundColor() const;
|
| + virtual Color platformInactiveSelectionBackgroundColor() const;
|
| + virtual Color platformActiveListBoxSelectionBackgroundColor() const;
|
| + virtual Color platformActiveListBoxSelectionForegroundColor() const;
|
| + virtual Color platformInactiveListBoxSelectionBackgroundColor() const;
|
| + virtual Color platformInactiveListBoxSelectionForegroundColor() const;
|
| + virtual Color platformFocusRingColor() const;
|
|
|
| - virtual Color platformActiveSelectionBackgroundColor() const;
|
| - virtual Color platformInactiveSelectionBackgroundColor() const;
|
| - virtual Color platformActiveListBoxSelectionBackgroundColor() const;
|
| + virtual ScrollbarControlSize scrollbarControlSizeForPart(ControlPart) { return SmallScrollbar; }
|
| +
|
| + virtual void platformColorsDidChange();
|
|
|
| - virtual Color platformFocusRingColor() const;
|
| -
|
| - virtual void platformColorsDidChange();
|
| + // System fonts.
|
| + virtual void systemFont(int cssValueId, FontDescription&) const;
|
|
|
| - // System fonts.
|
| - virtual void systemFont(int cssValueId, FontDescription&) const;
|
| + virtual int minimumMenuListSize(RenderStyle*) const;
|
|
|
| - virtual int minimumMenuListSize(RenderStyle*) const;
|
| -
|
| - virtual void adjustSliderThumbSize(RenderObject*) const;
|
| -
|
| - virtual int popupInternalPaddingLeft(RenderStyle*) const;
|
| - virtual int popupInternalPaddingRight(RenderStyle*) const;
|
| - virtual int popupInternalPaddingTop(RenderStyle*) const;
|
| - virtual int popupInternalPaddingBottom(RenderStyle*) const;
|
| -
|
| - virtual ScrollbarControlSize scrollbarControlSizeForPart(ControlPart) { return SmallScrollbar; }
|
| + virtual void adjustSliderThumbSize(RenderObject*) const;
|
|
|
| - virtual bool paintCapsLockIndicator(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + virtual int popupInternalPaddingLeft(RenderStyle*) const;
|
| + virtual int popupInternalPaddingRight(RenderStyle*) const;
|
| + virtual int popupInternalPaddingTop(RenderStyle*) const;
|
| + virtual int popupInternalPaddingBottom(RenderStyle*) const;
|
| +
|
| + virtual bool paintCapsLockIndicator(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
|
|
| - virtual Color systemColor(int cssValueId) const;
|
| + virtual Color systemColor(int cssValueId) const;
|
|
|
| - protected:
|
| - virtual bool supportsSelectionForegroundColors() const { return false; }
|
| +protected:
|
| + virtual bool supportsSelectionForegroundColors() const { return false; }
|
|
|
| - // Methods for each appearance value.
|
| - virtual bool paintCheckbox(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| - virtual void setCheckboxSize(RenderStyle*) const;
|
| + virtual bool paintTextField(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + virtual void adjustTextFieldStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
|
|
|
| - virtual bool paintRadio(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| - virtual void setRadioSize(RenderStyle*) const;
|
| + virtual bool paintTextArea(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + virtual void adjustTextAreaStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
|
|
|
| - virtual void adjustButtonStyle(CSSStyleSelector*, RenderStyle*, WebCore::Element*) const;
|
| - virtual bool paintButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| - virtual void setButtonSize(RenderStyle*) const;
|
| + virtual bool paintMenuList(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + virtual void adjustMenuListStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
|
|
|
| - virtual bool paintTextField(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| - virtual void adjustTextFieldStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
|
| + virtual bool paintMenuListButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + virtual void adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
|
|
|
| - virtual bool paintTextArea(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| - virtual void adjustTextAreaStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
|
| + virtual bool paintSliderTrack(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + virtual void adjustSliderTrackStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
|
|
|
| - virtual bool paintMenuList(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| - virtual void adjustMenuListStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
|
| + virtual bool paintSliderThumb(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + virtual void adjustSliderThumbStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
|
|
|
| - virtual bool paintMenuListButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| - virtual void adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
|
| + virtual bool paintSearchField(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + virtual void adjustSearchFieldStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
|
|
|
| - virtual bool paintSliderTrack(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| - virtual void adjustSliderTrackStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
|
| + virtual void adjustSearchFieldCancelButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
|
| + virtual bool paintSearchFieldCancelButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
|
|
| - virtual bool paintSliderThumb(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| - virtual void adjustSliderThumbStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
|
| + virtual void adjustSearchFieldDecorationStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
|
| + virtual bool paintSearchFieldDecoration(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
|
|
| - virtual bool paintSearchField(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| - virtual void adjustSearchFieldStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
|
| + virtual void adjustSearchFieldResultsDecorationStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
|
| + virtual bool paintSearchFieldResultsDecoration(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
|
|
| - virtual void adjustSearchFieldCancelButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
|
| - virtual bool paintSearchFieldCancelButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + virtual void adjustSearchFieldResultsButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
|
| + virtual bool paintSearchFieldResultsButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
|
|
| - virtual void adjustSearchFieldDecorationStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
|
| - virtual bool paintSearchFieldDecoration(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| +#if ENABLE(VIDEO)
|
| + virtual bool paintMediaFullscreenButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + virtual bool paintMediaPlayButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + virtual bool paintMediaMuteButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + virtual bool paintMediaSeekBackButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + virtual bool paintMediaSeekForwardButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + virtual bool paintMediaSliderTrack(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + virtual bool paintMediaSliderThumb(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + virtual bool paintMediaRewindButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + virtual bool paintMediaReturnToRealtimeButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + virtual bool paintMediaControlsBackground(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + virtual bool paintMediaCurrentTime(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + virtual bool paintMediaTimeRemaining(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
|
|
| - virtual void adjustSearchFieldResultsDecorationStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
|
| - virtual bool paintSearchFieldResultsDecoration(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + // Media controls
|
| + virtual String extraMediaControlsStyleSheet();
|
| +#endif
|
|
|
| - virtual void adjustSearchFieldResultsButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
|
| - virtual bool paintSearchFieldResultsButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| +private:
|
| + RenderThemeChromiumMac();
|
| + virtual ~RenderThemeChromiumMac();
|
|
|
| - virtual bool paintMediaFullscreenButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| - virtual bool paintMediaPlayButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| - virtual bool paintMediaMuteButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| - virtual bool paintMediaSeekBackButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| - virtual bool paintMediaSeekForwardButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| - virtual bool paintMediaSliderTrack(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| - virtual bool paintMediaSliderThumb(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + IntRect inflateRect(const IntRect&, const IntSize&, const int* margins, float zoomLevel = 1.0f) const;
|
|
|
| - private:
|
| - RenderThemeChromiumMac();
|
| - virtual ~RenderThemeChromiumMac();
|
| + FloatRect convertToPaintingRect(const RenderObject* inputRenderer, const RenderObject* partRenderer, const FloatRect& inputRect, const IntRect& r) const;
|
| +
|
| + // Get the control size based off the font. Used by some of the controls (like buttons).
|
| + NSControlSize controlSizeForFont(RenderStyle*) const;
|
| + NSControlSize controlSizeForSystemFont(RenderStyle*) const;
|
| + void setControlSize(NSCell*, const IntSize* sizes, const IntSize& minSize, float zoomLevel = 1.0f);
|
| + void setSizeFromFont(RenderStyle*, const IntSize* sizes) const;
|
| + IntSize sizeForFont(RenderStyle*, const IntSize* sizes) const;
|
| + IntSize sizeForSystemFont(RenderStyle*, const IntSize* sizes) const;
|
| + void setFontFromControlSize(CSSStyleSelector*, RenderStyle*, NSControlSize) const;
|
|
|
| - IntRect inflateRect(const IntRect&, const IntSize&, const int* margins, float zoomLevel = 1.0f) const;
|
| + void updateActiveState(NSCell*, const RenderObject*);
|
| + void updateCheckedState(NSCell*, const RenderObject*);
|
| + void updateEnabledState(NSCell*, const RenderObject*);
|
| + void updateFocusedState(NSCell*, const RenderObject*);
|
| + void updatePressedState(NSCell*, const RenderObject*);
|
|
|
| - // Get the control size based off the font. Used by some of the controls (like buttons).
|
| - NSControlSize controlSizeForFont(RenderStyle*) const;
|
| - NSControlSize controlSizeForSystemFont(RenderStyle*) const;
|
| - void setControlSize(NSCell*, const IntSize* sizes, const IntSize& minSize, float zoomLevel = 1.0f);
|
| - void setSizeFromFont(RenderStyle*, const IntSize* sizes) const;
|
| - IntSize sizeForFont(RenderStyle*, const IntSize* sizes) const;
|
| - IntSize sizeForSystemFont(RenderStyle*, const IntSize* sizes) const;
|
| - void setFontFromControlSize(CSSStyleSelector*, RenderStyle*, NSControlSize) const;
|
| + // Helpers for adjusting appearance and for painting
|
|
|
| - void updateActiveState(NSCell*, const RenderObject*);
|
| - void updateCheckedState(NSCell*, const RenderObject*);
|
| - void updateEnabledState(NSCell*, const RenderObject*);
|
| - void updateFocusedState(NSCell*, const RenderObject*);
|
| - void updatePressedState(NSCell*, const RenderObject*);
|
| + void setPopupButtonCellState(const RenderObject*, const IntRect&);
|
| + const IntSize* popupButtonSizes() const;
|
| + const int* popupButtonMargins() const;
|
| + const int* popupButtonPadding(NSControlSize) const;
|
| + void paintMenuListButtonGradients(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| + const IntSize* menuListSizes() const;
|
|
|
| - // Helpers for adjusting appearance and for painting
|
| - const IntSize* checkboxSizes() const;
|
| - const int* checkboxMargins() const;
|
| - void setCheckboxCellState(const RenderObject*, const IntRect&);
|
| + const IntSize* searchFieldSizes() const;
|
| + const IntSize* cancelButtonSizes() const;
|
| + const IntSize* resultsButtonSizes() const;
|
| + void setSearchCellState(RenderObject*, const IntRect&);
|
| + void setSearchFieldSize(RenderStyle*) const;
|
| +
|
| + NSPopUpButtonCell* popupButton() const;
|
| + NSSearchFieldCell* search() const;
|
| + NSMenu* searchMenuTemplate() const;
|
| + NSSliderCell* sliderThumbHorizontal() const;
|
| + NSSliderCell* sliderThumbVertical() const;
|
|
|
| - const IntSize* radioSizes() const;
|
| - const int* radioMargins() const;
|
| - void setRadioCellState(const RenderObject*, const IntRect&);
|
| +private:
|
| + mutable RetainPtr<NSPopUpButtonCell> m_popupButton;
|
| + mutable RetainPtr<NSSearchFieldCell> m_search;
|
| + mutable RetainPtr<NSMenu> m_searchMenuTemplate;
|
| + mutable RetainPtr<NSSliderCell> m_sliderThumbHorizontal;
|
| + mutable RetainPtr<NSSliderCell> m_sliderThumbVertical;
|
|
|
| - void setButtonPaddingFromControlSize(RenderStyle*, NSControlSize) const;
|
| - const IntSize* buttonSizes() const;
|
| - const int* buttonMargins() const;
|
| - void setButtonCellState(const RenderObject*, const IntRect&);
|
| + bool m_isSliderThumbHorizontalPressed;
|
| + bool m_isSliderThumbVerticalPressed;
|
|
|
| - void setPopupButtonCellState(const RenderObject*, const IntRect&);
|
| - const IntSize* popupButtonSizes() const;
|
| - const int* popupButtonMargins() const;
|
| - const int* popupButtonPadding(NSControlSize) const;
|
| - void paintMenuListButtonGradients(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
|
| - const IntSize* menuListSizes() const;
|
| + mutable HashMap<int, RGBA32> m_systemColorCache;
|
|
|
| - const IntSize* searchFieldSizes() const;
|
| - const IntSize* cancelButtonSizes() const;
|
| - const IntSize* resultsButtonSizes() const;
|
| - void setSearchCellState(RenderObject*, const IntRect&);
|
| - void setSearchFieldSize(RenderStyle*) const;
|
| -
|
| - NSButtonCell* checkbox() const;
|
| - NSButtonCell* radio() const;
|
| - NSButtonCell* button() const;
|
| - NSPopUpButtonCell* popupButton() const;
|
| - NSSearchFieldCell* search() const;
|
| - NSMenu* searchMenuTemplate() const;
|
| - NSSliderCell* sliderThumbHorizontal() const;
|
| - NSSliderCell* sliderThumbVertical() const;
|
| + RetainPtr<WebCoreRenderThemeNotificationObserver> m_notificationObserver;
|
| +};
|
|
|
| - private:
|
| - mutable RetainPtr<NSButtonCell> m_checkbox;
|
| - mutable RetainPtr<NSButtonCell> m_radio;
|
| - mutable RetainPtr<NSButtonCell> m_button;
|
| - mutable RetainPtr<NSPopUpButtonCell> m_popupButton;
|
| - mutable RetainPtr<NSSearchFieldCell> m_search;
|
| - mutable RetainPtr<NSMenu> m_searchMenuTemplate;
|
| - mutable RetainPtr<NSSliderCell> m_sliderThumbHorizontal;
|
| - mutable RetainPtr<NSSliderCell> m_sliderThumbVertical;
|
| -
|
| - bool m_isSliderThumbHorizontalPressed;
|
| - bool m_isSliderThumbVerticalPressed;
|
| -
|
| - mutable HashMap<int, RGBA32> m_systemColorCache;
|
| -
|
| - RetainPtr<WebCoreRenderThemeNotificationObserver> m_notificationObserver;
|
| - };
|
| -
|
| } // namespace WebCore
|
|
|
| -#endif
|
| +#endif // RenderThemeChromiumMac_h
|
|
|