29 lines
503 B
C++
29 lines
503 B
C++
#pragma once
|
|
#include "Screen.h"
|
|
#include "Window.h"
|
|
#include <moon/Mouse.h>
|
|
#include <ui/Canvas.h>
|
|
|
|
class Mouse
|
|
{
|
|
public:
|
|
Mouse(ui::Canvas& screen);
|
|
|
|
void update(const moon::MousePacket& packet);
|
|
|
|
void draw(ui::Canvas& screen);
|
|
|
|
void window_did_close(Window* window);
|
|
|
|
static Mouse& the();
|
|
|
|
private:
|
|
ui::Point m_position;
|
|
ui::Rect m_screen_rect;
|
|
|
|
Window* m_dragging_window = nullptr;
|
|
ui::Point m_initial_drag_position;
|
|
|
|
Window* m_active_window = nullptr;
|
|
};
|