PageOverlayController.h [plain text]
#ifndef PageOverlayController_h
#define PageOverlayController_h
#include "PageOverlay.h"
#include "WKBase.h"
#include <WebCore/GraphicsLayerClient.h>
#include <wtf/HashMap.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
namespace WebCore {
class Frame;
}
namespace WebKit {
class WebMouseEvent;
class WebPage;
class PageOverlayController : public WebCore::GraphicsLayerClient {
public:
PageOverlayController(WebPage&);
void initialize();
WebCore::GraphicsLayer* documentOverlayRootLayer() const { return m_documentOverlayRootLayer.get(); }
WebCore::GraphicsLayer* viewOverlayRootLayer() const { return m_viewOverlayRootLayer.get(); }
void installPageOverlay(PassRefPtr<PageOverlay>, PageOverlay::FadeMode);
void uninstallPageOverlay(PageOverlay*, PageOverlay::FadeMode);
void setPageOverlayNeedsDisplay(PageOverlay&, const WebCore::IntRect&);
void setPageOverlayOpacity(PageOverlay&, float);
void clearPageOverlay(PageOverlay&);
void didChangeViewSize();
void didChangeDocumentSize();
void didChangePreferences();
void didChangeDeviceScaleFactor();
void didChangeExposedRect();
void didScrollFrame(WebCore::Frame*);
void didChangeOverlayFrame(PageOverlay&);
void didChangeOverlayBackgroundColor(PageOverlay&);
void flushPageOverlayLayers(WebCore::FloatRect);
bool handleMouseEvent(const WebMouseEvent&);
WKTypeRef copyAccessibilityAttributeValue(WKStringRef attribute, WKTypeRef parameter);
WKArrayRef copyAccessibilityAttributesNames(bool parameterizedNames);
private:
void updateSettingsForLayer(WebCore::GraphicsLayer&);
void updateForceSynchronousScrollLayerPositionUpdates();
virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double) override { }
virtual void notifyFlushRequired(const WebCore::GraphicsLayer*) override;
virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& clipRect) override;
virtual float deviceScaleFactor() const override;
virtual void didCommitChangesForLayer(const WebCore::GraphicsLayer*) const override { }
virtual bool shouldSkipLayerInDump(const WebCore::GraphicsLayer*) const override { return true; }
std::unique_ptr<WebCore::GraphicsLayer> m_documentOverlayRootLayer;
std::unique_ptr<WebCore::GraphicsLayer> m_viewOverlayRootLayer;
HashMap<PageOverlay*, std::unique_ptr<WebCore::GraphicsLayer>> m_overlayGraphicsLayers;
Vector<RefPtr<PageOverlay>> m_pageOverlays;
WebPage& m_webPage;
};
}
#endif // PageOverlayController_h