You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
699B

  1. #pragma once
  2. #include "event.hpp"
  3. namespace rack {
  4. struct WidgetState {
  5. Widget *rootWidget;
  6. Widget *hoveredWidget;
  7. Widget *draggedWidget;
  8. Widget *dragHoveredWidget;
  9. Widget *selectedWidget;
  10. WidgetState();
  11. void handleButton(math::Vec pos, int button, int action, int mods);
  12. void handleHover(math::Vec pos, math::Vec mouseDelta);
  13. void handleLeave();
  14. void handleScroll(math::Vec pos, math::Vec scrollDelta);
  15. void handleText(math::Vec pos, int codepoint);
  16. void handleKey(math::Vec pos, int key, int scancode, int action, int mods);
  17. void handleDrop(math::Vec pos, std::vector<std::string> paths);
  18. };
  19. // TODO Move this elsewhere
  20. extern WidgetState *gWidgetState;
  21. } // namespace rack