More window cleaning

This commit is contained in:
James Grogan 2022-11-11 14:22:31 +00:00
parent 6adc441e6f
commit 53c98a227d
29 changed files with 422 additions and 261 deletions

View file

@ -14,7 +14,7 @@ Window::Window()
mHeight(600),
mWidget(Widget::Create())
{
mWidget->setBounds(mWidth, mHeight);
}
Window::~Window()
@ -29,23 +29,22 @@ std::unique_ptr<Window> Window::Create()
std::vector<VisualLayer*> Window::GetLayers()
{
return mWidget->GetLayers();
return mWidget->getLayers();
}
void Window::OnMouseEvent(const MouseEvent* event)
{
mWidget->OnMouseEvent(event);
mWidget->onMouseEvent(event);
}
void Window::OnKeyboardEvent(const KeyboardEvent* event)
{
mWidget->OnKeyboardEvent(event);
mWidget->onKeyboardEvent(event);
}
void Window::OnPaint(const PaintEvent* event)
{
mWidget->SetBounds(mWidth, mHeight);
mWidget->OnPaintEvent(event);
mWidget->onPaintEvent(event);
}
void Window::AddWidget(WidgetUPtr widget)
@ -55,6 +54,7 @@ void Window::AddWidget(WidgetUPtr widget)
mWidget.reset();
}
mWidget = std::move(widget);
mWidget->setBounds(mWidth, mHeight);
}
Widget* Window::GetWidget() const
@ -76,6 +76,7 @@ void Window::SetSize(unsigned width, unsigned height)
{
mWidth = width;
mHeight = height;
mWidget->setBounds(mWidth, mHeight);
}
IPlatformWindow* Window::GetPlatformWindow() const