RenderThemeSafari.h [plain text]
#ifndef RenderThemeSafari_h
#define RenderThemeSafari_h
#if USE(SAFARI_THEME)
#include "RenderTheme.h"
#include <SafariTheme/SafariThemeConstants.h>
#ifndef SafariThemeConstants_h
#include <SafariTheme/SafariTheme.h>
#endif
#if PLATFORM(WIN)
typedef void* HANDLE;
typedef struct HINSTANCE__* HINSTANCE;
typedef HINSTANCE HMODULE;
#endif
namespace WebCore {
using namespace SafariTheme;
class RenderStyle;
class RenderThemeSafari : public RenderTheme {
public:
static PassRefPtr<RenderTheme> create();
virtual int baselinePosition(const RenderObject*) const;
virtual bool controlSupportsTints(const RenderObject*) const;
virtual bool supportsControlTints() const { return true; }
virtual void adjustRepaintRect(const RenderObject*, IntRect&);
virtual bool isControlStyled(const RenderStyle*, const BorderData&,
const FillLayer&, const Color& backgroundColor) const;
virtual Color platformActiveSelectionBackgroundColor() const;
virtual Color platformInactiveSelectionBackgroundColor() const;
virtual Color activeListBoxSelectionBackgroundColor() const;
virtual Color platformFocusRingColor() const;
virtual void systemFont(int propId, FontDescription&) const;
virtual int minimumMenuListSize(RenderStyle*) const;
virtual void adjustSliderThumbSize(RenderObject*) const;
virtual void adjustSliderThumbStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
virtual int popupInternalPaddingLeft(RenderStyle*) const;
virtual int popupInternalPaddingRight(RenderStyle*) const;
virtual int popupInternalPaddingTop(RenderStyle*) const;
virtual int popupInternalPaddingBottom(RenderStyle*) const;
protected:
virtual bool paintCheckbox(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual void setCheckboxSize(RenderStyle*) const;
virtual bool paintRadio(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual void setRadioSize(RenderStyle*) 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 paintTextField(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual void adjustTextFieldStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
virtual bool paintTextArea(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual void adjustTextAreaStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
virtual bool paintMenuList(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual void adjustMenuListStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
virtual bool paintMenuListButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual void adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
virtual bool paintSliderTrack(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual bool paintSliderThumb(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual bool paintSearchField(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual void adjustSearchFieldStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
virtual void adjustSearchFieldCancelButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
virtual bool paintSearchFieldCancelButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual void adjustSearchFieldDecorationStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
virtual bool paintSearchFieldDecoration(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual void adjustSearchFieldResultsDecorationStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
virtual bool paintSearchFieldResultsDecoration(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual void adjustSearchFieldResultsButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
virtual bool paintSearchFieldResultsButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual bool paintCapsLockIndicator(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&);
#endif
private:
RenderThemeSafari();
virtual ~RenderThemeSafari();
IntRect inflateRect(const IntRect&, const IntSize&, const int* margins) const;
NSControlSize controlSizeForFont(RenderStyle*) const;
NSControlSize controlSizeForSystemFont(RenderStyle*) const;
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;
const IntSize* checkboxSizes() const;
const int* checkboxMargins(NSControlSize) const;
const IntSize* radioSizes() const;
const int* radioMargins(NSControlSize) const;
void setButtonPaddingFromControlSize(RenderStyle*, NSControlSize) const;
const IntSize* buttonSizes() const;
const int* buttonMargins(NSControlSize) const;
const IntSize* popupButtonSizes() const;
const int* popupButtonMargins(NSControlSize) const;
const int* popupButtonPadding(NSControlSize) const;
void paintMenuListButtonGradients(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
const IntSize* menuListSizes() const;
const IntSize* searchFieldSizes() const;
const IntSize* cancelButtonSizes() const;
const IntSize* resultsButtonSizes() const;
void setSearchFieldSize(RenderStyle*) const;
ThemeControlState determineState(RenderObject*) const;
};
}
#endif // #if USE(SAFARI_THEME)
#endif // RenderThemeSafari_h