2021-04-17 12:57:14 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
#include "INativeDrawingSurface.h"
|
|
|
|
|
2022-05-15 13:58:31 +00:00
|
|
|
class Grid;
|
|
|
|
class Image;
|
|
|
|
|
2021-04-17 12:57:14 +00:00
|
|
|
class DrawingSurface
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DrawingSurface() = default;
|
|
|
|
|
|
|
|
static std::unique_ptr<DrawingSurface> Create();
|
|
|
|
|
|
|
|
INativeDrawingSurface* GetNativeSurface();
|
|
|
|
|
|
|
|
void SetNativeSurface(std::unique_ptr<INativeDrawingSurface> surface);
|
|
|
|
|
|
|
|
void SetSize(unsigned width, unsigned height);
|
|
|
|
|
|
|
|
unsigned GetWidth() const;
|
|
|
|
|
|
|
|
unsigned GetHeight() const;
|
|
|
|
|
2022-05-15 13:58:31 +00:00
|
|
|
void Paint(Grid* grid);
|
|
|
|
|
|
|
|
Image* GetAsImage() const;
|
|
|
|
|
2021-04-17 12:57:14 +00:00
|
|
|
private:
|
|
|
|
|
|
|
|
unsigned mWidth = 0;
|
|
|
|
unsigned mHeight = 0;
|
2022-05-15 13:58:31 +00:00
|
|
|
std::unique_ptr<Image> mImageBuffer;
|
2021-04-17 12:57:14 +00:00
|
|
|
std::unique_ptr<INativeDrawingSurface> mNativeDrawingSurface;
|
|
|
|
};
|