Initial commit.

This commit is contained in:
jmsgrogan 2020-05-02 08:31:03 +01:00
commit 59c6161fdb
134 changed files with 4751 additions and 0 deletions

View file

@ -0,0 +1,67 @@
#include "Window.h"
namespace mt{
Window::Window()
:mWidth(400),
mHeight(300),
mWidget()
{
}
Window::~Window()
{
}
std::vector<VisualLayerPtr> Window::GetLayers()
{
return mLayers;
}
void Window::OnMouseEvent(MouseEventPtr event)
{
mWidget->OnMouseEvent(event);
}
void Window::OnPaint(PaintEventPtr event)
{
mLayers.clear();
mWidget->SetSize(mWidth, mHeight);
mWidget->OnPaintEvent(event);
auto layers = mWidget->GetLayers();
mLayers.insert(mLayers.end(), layers.begin(), layers.end());
}
std::shared_ptr<Window> Window::Create()
{
return std::make_shared<Window>();
}
void Window::AddWidget(WidgetPtr widget)
{
mWidget = widget;
}
WidgetPtr Window::GetWidget()
{
return mWidget;
}
unsigned Window::GetWidth()
{
return mWidth;
}
unsigned Window::GetHeight()
{
return mHeight;
}
void Window::SetSize(unsigned width, unsigned height)
{
mWidth = width;
mHeight = height;
}
}