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.

39 lines
907B

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