ScrollbarThemeMac.h [plain text]
#ifndef ScrollbarThemeMac_h
#define ScrollbarThemeMac_h
#include "ScrollbarThemeComposite.h"
namespace WebCore {
class ScrollbarThemeMac : public ScrollbarThemeComposite {
public:
ScrollbarThemeMac();
virtual ~ScrollbarThemeMac();
void preferencesChanged();
virtual void updateEnabledState(ScrollbarThemeClient*);
virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& damageRect);
virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar);
virtual bool supportsControlTints() const { return true; }
virtual bool usesOverlayScrollbars() const;
virtual void usesOverlayScrollbarsChanged() override;
virtual void updateScrollbarOverlayStyle(ScrollbarThemeClient*);
virtual double initialAutoscrollTimerDelay();
virtual double autoscrollTimerDelay();
virtual ScrollbarButtonsPlacement buttonsPlacement() const;
virtual void registerScrollbar(ScrollbarThemeClient*);
virtual void unregisterScrollbar(ScrollbarThemeClient*);
void setNewPainterForScrollbar(ScrollbarThemeClient*, ScrollbarPainter);
ScrollbarPainter painterForScrollbar(ScrollbarThemeClient*);
void setPaintCharacteristicsForScrollbar(ScrollbarThemeClient*);
static bool isCurrentlyDrawingIntoLayer();
static void setIsCurrentlyDrawingIntoLayer(bool);
#if ENABLE(RUBBER_BANDING)
static void setUpOverhangAreaBackground(CALayer *, const Color& customBackgroundColor = Color());
static void removeOverhangAreaBackground(CALayer *);
static void setUpOverhangAreaShadow(CALayer *);
static void removeOverhangAreaShadow(CALayer *);
#endif
protected:
virtual bool hasButtons(ScrollbarThemeClient*);
virtual bool hasThumb(ScrollbarThemeClient*);
virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false);
virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false);
virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false);
virtual int maxOverlapBetweenPages() { return 40; }
virtual int minimumThumbLength(ScrollbarThemeClient*);
virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&);
virtual bool shouldDragDocumentInsteadOfThumb(ScrollbarThemeClient*, const PlatformMouseEvent&);
int scrollbarPartToHIPressedState(ScrollbarPart);
#if ENABLE(RUBBER_BANDING)
virtual void setUpOverhangAreasLayerContents(GraphicsLayer*, const Color&) override;
virtual void setUpContentShadowLayer(GraphicsLayer*) override;
#endif
};
}
#endif