#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() : Event(nullptr), width(0), height(0) {} ResizeWindowEvent(int w, int h, void* userData = nullptr) : 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, void* userData = nullptr) : Event(userData), window(w) {} ~CloseWindowEvent() { } operator std::string() const override { return "Archimedes::CloseWindowEvent"; } const Window* window; }; class KeyPressedWindowEvent : public Event { public: KeyPressedWindowEvent() : Event(nullptr), key(0), repeat(0) {} KeyPressedWindowEvent(unsigned int k, unsigned int r, void* userData = nullptr) : 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, void* userData = nullptr) : Event(userData), key(k) {} ~KeyReleasedWindowEvent() { } operator std::string() const override { return "Archimedes::KeyReleasedWindowEvent"; } unsigned int key; }; class MouseButtonPressedWindowEvent : public Event { public: MouseButtonPressedWindowEvent() : Event(nullptr), button(0) {} MouseButtonPressedWindowEvent(unsigned int b, void* userData = nullptr) : Event(userData), button(b) {} ~MouseButtonPressedWindowEvent() { } operator std::string() const override { return "Archimedes::MouseButtonPressedWindowEvent"; } unsigned int button; }; class MouseButtonReleasedWindowEvent : public Event { public: MouseButtonReleasedWindowEvent() : Event(nullptr), button(0) {} MouseButtonReleasedWindowEvent(unsigned int b, void* userData = nullptr) : Event(userData), button(b) {} ~MouseButtonReleasedWindowEvent() { } operator std::string() const override { return "Archimedes::MouseButtonReleasedWindowEvent"; } unsigned int button; }; class ScrollWindowEvent : public Event { public: ScrollWindowEvent() : Event(nullptr), dx(0), dy(0) {} ScrollWindowEvent(double x, double y, void* userData = nullptr) : Event(userData), dx(x), dy(y) {} ~ScrollWindowEvent() { } operator std::string() const override { return "Archimedes::ScrollWindowEvent"; } double dx, dy; }; class MouseMovedWindowEvent : public Event { public: MouseMovedWindowEvent() : Event(nullptr), x(0), y(0) {} MouseMovedWindowEvent(double x, double y, void* userData = nullptr) : Event(userData), x(x), y(y) {} ~MouseMovedWindowEvent() { } operator std::string() const override { return "Archimedes::MouseMovedWindowEvent"; } double x, y; }; class FocusedWindowEvent : public Event { public: FocusedWindowEvent() : Event(nullptr), window(nullptr) {} FocusedWindowEvent(const Window* w, void* userData = nullptr) : Event(userData), window(w) {} ~FocusedWindowEvent() { } operator std::string() const override { return "Archimedes::FocusedWindowEvent"; } const Window* window; }; class FocusLostWindowEvent : public Event { public: FocusLostWindowEvent() : Event(nullptr), window(nullptr) {} FocusLostWindowEvent(const Window* w, void* userData = nullptr) : Event(userData), window(w) {} ~FocusLostWindowEvent() { } operator std::string() const override { return "Archimedes::FocusLostWindowEvent"; } const Window* window; }; class MovedWindowEvent : public Event { public: MovedWindowEvent() : Event(nullptr), x(0), y(0) {} MovedWindowEvent(int x, int y, void* userData = nullptr) : Event(userData), x(x), y(y) {} ~MovedWindowEvent() { } operator std::string() const override { return "Archimedes::MovedWindowEvent"; } int x, y; }; } #endif