#ifndef WINDOWEVENTS_H #define WINDOWEVENTS_H #include "utils/Events/Event.h" //implimentation independent events namespace Archimedes { class Window; struct WindowData { Window* window; std::list eventList; std::function sendEvent; }; class ResizeWindowEvent : public Event { public: ResizeWindowEvent() : width(0), height(0) {} ResizeWindowEvent(int w, int h) : width(w), height(h) {} ResizeWindowEvent(int w, int h, std::any userData) : Event(userData), width(w), height(h) {} ~ResizeWindowEvent() { } operator std::string() const override { return "Archimedes::ResizeWindowEvent"; } int width, height; }; class CloseWindowEvent : public Event { public: CloseWindowEvent() : Event(nullptr), window(nullptr) {} CloseWindowEvent(const Window* w) : window(w) {} CloseWindowEvent(const Window* w, std::any userData) : Event(userData), window(w) {} ~CloseWindowEvent() { } operator std::string() const override { return "Archimedes::CloseWindowEvent"; } const Window* window; }; class KeyPressedWindowEvent : public Event { public: KeyPressedWindowEvent() : key(0), repeat(0) {} KeyPressedWindowEvent(unsigned int k, unsigned int r) : key(k), repeat(r) {} KeyPressedWindowEvent(unsigned int k, unsigned int r, std::any userData) : Event(userData), key(k), repeat(r) {} ~KeyPressedWindowEvent() { } operator std::string() const override { return "Archimedes::KeyPressedWindowEvent"; } unsigned int key; unsigned int repeat; }; class KeyReleasedWindowEvent : public Event { public: KeyReleasedWindowEvent() : Event(nullptr), key(0) {} KeyReleasedWindowEvent(unsigned int k) : key(k) {} KeyReleasedWindowEvent(unsigned int k, std::any userData) : Event(userData), key(k) {} ~KeyReleasedWindowEvent() { } operator std::string() const override { return "Archimedes::KeyReleasedWindowEvent"; } unsigned int key; }; class MouseButtonPressedWindowEvent : public Event { public: MouseButtonPressedWindowEvent() : button(0) {} MouseButtonPressedWindowEvent(unsigned int b) : button(b) {} MouseButtonPressedWindowEvent(unsigned int b, std::any userData) : Event(userData), button(b) {} ~MouseButtonPressedWindowEvent() { } operator std::string() const override { return "Archimedes::MouseButtonPressedWindowEvent"; } unsigned int button; }; class MouseButtonReleasedWindowEvent : public Event { public: MouseButtonReleasedWindowEvent() : button(0) {} MouseButtonReleasedWindowEvent(unsigned int b) : button(b) {} MouseButtonReleasedWindowEvent(unsigned int b, std::any userData) : Event(userData), button(b) {} ~MouseButtonReleasedWindowEvent() { } operator std::string() const override { return "Archimedes::MouseButtonReleasedWindowEvent"; } unsigned int button; }; class ScrollWindowEvent : public Event { public: ScrollWindowEvent() : dx(0), dy(0) {} ScrollWindowEvent(double x, double y) : dx(x), dy(y) {} ScrollWindowEvent(double x, double y, std::any userData) : Event(userData), dx(x), dy(y) {} ~ScrollWindowEvent() { } operator std::string() const override { return "Archimedes::ScrollWindowEvent"; } double dx, dy; }; class MouseMovedWindowEvent : public Event { public: MouseMovedWindowEvent() : x(0), y(0) {} MouseMovedWindowEvent(double x, double y) : x(x), y(y) {} MouseMovedWindowEvent(double x, double y, std::any userData) : Event(userData), x(x), y(y) {} ~MouseMovedWindowEvent() { } operator std::string() const override { return "Archimedes::MouseMovedWindowEvent"; } double x, y; }; class FocusedWindowEvent : public Event { public: FocusedWindowEvent() : window(nullptr) {} FocusedWindowEvent(const Window* w) : window(w) {} FocusedWindowEvent(const Window* w, std::any userData) : Event(userData), window(w) {} ~FocusedWindowEvent() { } operator std::string() const override { return "Archimedes::FocusedWindowEvent"; } const Window* window; }; class FocusLostWindowEvent : public Event { public: FocusLostWindowEvent() : window(nullptr) {} FocusLostWindowEvent(const Window* w) : window(w) {} FocusLostWindowEvent(const Window* w, std::any userData) : Event(userData), window(w) {} ~FocusLostWindowEvent() { } operator std::string() const override { return "Archimedes::FocusLostWindowEvent"; } const Window* window; }; class MovedWindowEvent : public Event { public: MovedWindowEvent() : x(0), y(0) {} MovedWindowEvent(int x, int y) : x(x), y(y) {} MovedWindowEvent(int x, int y, std::any userData) : Event(userData), x(x), y(y) {} ~MovedWindowEvent() { } operator std::string() const override { return "Archimedes::MovedWindowEvent"; } int x, y; }; } #endif