26 lines
840 B
C++
26 lines
840 B
C++
// Copyright (C) 2015 Jérôme Leclercq
|
|
// This file is part of the "Nazara Development Kit"
|
|
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
|
|
|
|
#include <NDK/Canvas.hpp>
|
|
|
|
namespace Ndk
|
|
{
|
|
inline Canvas::Canvas(WorldHandle world, Nz::EventHandler& eventHandler) :
|
|
m_hoveredWidget(nullptr),
|
|
m_world(std::move(world))
|
|
{
|
|
m_canvas = this;
|
|
|
|
m_mouseButtonPressedSlot.Connect(eventHandler.OnMouseButtonPressed, this, &Canvas::OnMouseButtonPressed);
|
|
m_mouseButtonReleasedSlot.Connect(eventHandler.OnMouseButtonReleased, this, &Canvas::OnMouseButtonRelease);
|
|
m_mouseMovedSlot.Connect(eventHandler.OnMouseMoved, this, &Canvas::OnMouseMoved);
|
|
m_mouseLeftSlot.Connect(eventHandler.OnMouseLeft, this, &Canvas::OnMouseLeft);
|
|
}
|
|
|
|
inline const WorldHandle& Canvas::GetWorld() const
|
|
{
|
|
return m_world;
|
|
}
|
|
}
|