WidgetBackingStore.h [plain text]
#ifndef WidgetBackingStore_h
#define WidgetBackingStore_h
#include "IntRect.h"
#include "IntSize.h"
#include <wtf/FastAllocBase.h>
#include <wtf/Noncopyable.h>
#include <wtf/PassOwnPtr.h>
#if PLATFORM(GTK)
#include <gtk/gtk.h>
#elif PLATFORM(EFL)
#include <Evas.h>
#endif
typedef struct _cairo_surface cairo_surface_t;
namespace WebCore {
class WidgetBackingStorePrivate;
#if PLATFORM(GTK)
typedef GtkWidget* PlatformWidget;
#elif PLATFORM(EFL)
typedef Evas_Object* PlatformWidget;
#endif
class WidgetBackingStore {
WTF_MAKE_NONCOPYABLE(WidgetBackingStore);
WTF_MAKE_FAST_ALLOCATED;
public:
static PassOwnPtr<WidgetBackingStore> create(PlatformWidget, const IntSize&);
~WidgetBackingStore();
cairo_surface_t* cairoSurface();
void scroll(const IntRect& scrollRect, const IntSize& scrollOffset);
const IntSize& size() { return m_size; }
private:
WidgetBackingStore(PlatformWidget, const IntSize&);
OwnPtr<WidgetBackingStorePrivate> m_private;
IntSize m_size;
};
}
#endif // WidgetBackingStore_h