#ifndef EVENT_HPP #define EVENT_HPP #include namespace sftk { enum EventType { Closed, Resized, MousePressed, MouseReleased, MouseClicked, MouseEntered, MouseLeft, MouseMoved, MouseDragged, MouseScrolled, TextInputed, EventTypeLength, }; struct _Resized { sf::Vector2f size; // The parent Container's new size. }; struct _MouseEnteredLeftMoved { sf::Vector2f pos; }; typedef _MouseEnteredLeftMoved MousePosition; struct _MousePressedReleasedClicked { sf::Vector2f pos; sf::Mouse::Button button; }; struct _MouseDragged { sf::Vector2f start; sf::Vector2f now; sf::Mouse::Button button; }; struct _MouseScrolled { float delta; }; struct _TextInputed { wchar_t uchar; }; union EventData { _Resized resized; _MousePressedReleasedClicked mousePressed; _MousePressedReleasedClicked mouseReleased; _MousePressedReleasedClicked mouseClicked; _MouseEnteredLeftMoved mouseEntered; _MouseEnteredLeftMoved mouseLeft; _MouseEnteredLeftMoved mouseMoved; _MouseDragged mouseDragged; _MouseScrolled mouseScrolled; _TextInputed textInputed; }; struct Event { EventType type; EventData data; }; }; #endif