KRenderingDeviceQuartz.h [plain text]
#ifndef KRenderingDeviceQuartz_H
#define KRenderingDeviceQuartz_H
#if SVG_SUPPORT
#import <kcanvas/device/KRenderingDevice.h>
typedef struct CGRect CGRect;
typedef struct CGContext *CGContextRef;
#if __OBJC__
@class NSGraphicsContext;
#else
class NSGraphicsContext;
#endif
namespace WebCore {
class KRenderingDeviceContextQuartz : public KRenderingDeviceContext
{
public:
KRenderingDeviceContextQuartz(CGContextRef context);
virtual ~KRenderingDeviceContextQuartz();
virtual KCanvasMatrix concatCTM(const KCanvasMatrix &worldMatrix);
virtual KCanvasMatrix ctm() const;
virtual IntRect mapFromVisual(const IntRect &rect);
virtual IntRect mapToVisual(const IntRect &rect);
virtual void clearPath();
virtual void addPath(const KCanvasPath*);
virtual GraphicsContext* createGraphicsContext();
CGContextRef cgContext() const { return m_cgContext; };
NSGraphicsContext *nsGraphicsContext();
private:
CGContextRef m_cgContext;
NSGraphicsContext *m_nsGraphicsContext;
};
class KRenderingDeviceQuartz : public KRenderingDevice
{
public:
KRenderingDeviceQuartz() { }
virtual ~KRenderingDeviceQuartz() { }
virtual bool isBuffered() const { return false; }
virtual KRenderingDeviceContext *popContext();
virtual void pushContext(KRenderingDeviceContext *context);
KRenderingDeviceContextQuartz *quartzContext() const;
CGContextRef currentCGContext() const;
virtual KRenderingDeviceContext *contextForImage(KCanvasImage *) const;
virtual DeprecatedString stringForPath(const KCanvasPath* path);
virtual KCanvasResource *createResource(const KCResourceType &type) const;
virtual KRenderingPaintServer *createPaintServer(const KCPaintServerType &type) const;
virtual KCanvasFilterEffect *createFilterEffect(const KCFilterEffectType &type) const;
virtual KCanvasPath* createPath() const;
virtual RenderPath *createItem(RenderArena *arena, RenderStyle *style, SVGStyledElement *node, KCanvasPath* path) const;
static bool filtersEnabled();
static void setFiltersEnabled(bool enabled);
static bool KRenderingDeviceQuartz::hardwareRenderingEnabled();
static void KRenderingDeviceQuartz::setHardwareRenderingEnabled(bool enabled);
};
}
#endif // SVG_SUPPORT
#endif