#ifndef BWIDGETS_MOUSE_HANDLER_HPP #define BWIDGETS_MOUSE_HANDLER_HPP #include #include struct SDL_MouseButtonEvent; struct SDL_MouseMotionEvent; namespace bwidgets { class MouseHandler : public virtual FocusHandler, public virtual EventHandler { protected: using EventHandler::EventHandler; public: // Set click handler. virtual void click_handler(std::function) = 0; // Disable mouse event handling. virtual void disable_mouse_handler() = 0; // Enable mouse event handling. virtual void enable_mouse_handler(const SDL_Rect&, const SDL_Rect&) = 0; // Called on hover state changes. virtual void hover_handler(std::function) = 0; // Get current hover state. [[nodiscard]] virtual bool hovered() const = 0; // Set mouse motion handler. virtual void mouse_motion_handler(std::function) = 0; // Get current push state (mouse button down) [[nodiscard]] virtual bool pushed() const = 0; }; } #endif