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.

37 lines
904B

  1. #pragma once
  2. #include "event.hpp"
  3. #include "widgets/Widget.hpp"
  4. namespace rack {
  5. struct WidgetState {
  6. Widget *rootWidget = NULL;
  7. Widget *hoveredWidget = NULL;
  8. Widget *draggedWidget = NULL;
  9. Widget *dragHoveredWidget = NULL;
  10. Widget *selectedWidget = NULL;
  11. /** For middle-click dragging */
  12. Widget *scrollWidget = NULL;
  13. void handleButton(math::Vec pos, int button, int action, int mods);
  14. void handleHover(math::Vec pos, math::Vec mouseDelta);
  15. void handleLeave();
  16. void handleScroll(math::Vec pos, math::Vec scrollDelta);
  17. void handleText(math::Vec pos, int codepoint);
  18. void handleKey(math::Vec pos, int key, int scancode, int action, int mods);
  19. void handleDrop(math::Vec pos, std::vector<std::string> paths);
  20. void handleZoom();
  21. /** Prepares a widget for deletion */
  22. void finalizeWidget(Widget *w);
  23. };
  24. // TODO Move this elsewhere
  25. extern WidgetState *gWidgetState;
  26. } // namespace rack