GraphicsContextPlatformPrivateCairo.h [plain text]
#ifndef GraphicsContextPlatformPrivateCairo_h
#define GraphicsContextPlatformPrivateCairo_h
#include "GraphicsContext.h"
#if USE(CAIRO)
#include "PlatformContextCairo.h"
#include "RefPtrCairo.h"
#include <cairo.h>
#include <math.h>
#include <stdio.h>
#if PLATFORM(WIN)
#include <cairo-win32.h>
#endif
namespace WebCore {
class GraphicsContextPlatformPrivate {
public:
GraphicsContextPlatformPrivate(PlatformContextCairo* newPlatformContext)
: platformContext(newPlatformContext)
#if PLATFORM(WIN) || (PLATFORM(GTK) && OS(WINDOWS))
, m_hdc(0)
, m_shouldIncludeChildWindows(false)
#endif
{
}
virtual ~GraphicsContextPlatformPrivate()
{
}
#if PLATFORM(WIN)
void save();
void restore();
void flush();
void clip(const FloatRect&);
void clip(const Path&);
void scale(const FloatSize&);
void rotate(float);
void translate(float, float);
void concatCTM(const AffineTransform&);
void setCTM(const AffineTransform&);
void syncContext(cairo_t* cr);
#else
void save() {}
void restore() {}
void flush() {}
void clip(const FloatRect&) {}
void clip(const Path&) {}
void scale(const FloatSize&) {}
void rotate(float) {}
void translate(float, float) {}
void concatCTM(const AffineTransform&) {}
void setCTM(const AffineTransform&) {}
void syncContext(cairo_t*) { }
#endif
PlatformContextCairo* platformContext;
Vector<float> layers;
#if PLATFORM(WIN) || (PLATFORM(GTK) && OS(WINDOWS))
HDC m_hdc;
bool m_shouldIncludeChildWindows;
#endif
};
class GraphicsContextPlatformPrivateToplevel : public GraphicsContextPlatformPrivate {
public:
GraphicsContextPlatformPrivateToplevel(PlatformContextCairo* platformContext)
: GraphicsContextPlatformPrivate(platformContext)
{
}
virtual ~GraphicsContextPlatformPrivateToplevel()
{
delete platformContext;
}
};
}
#endif // USE(CAIRO)
#endif // GraphicsContextPlatformPrivateCairo_h