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.

RackScrollWidget.hpp 1003B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include <app/common.hpp>
  3. #include <ui/ScrollWidget.hpp>
  4. #include <widget/ZoomWidget.hpp>
  5. #include <app/RackWidget.hpp>
  6. namespace rack {
  7. namespace app {
  8. struct RackScrollWidget : ui::ScrollWidget {
  9. struct Internal;
  10. Internal* internal;
  11. widget::ZoomWidget* zoomWidget;
  12. RackWidget* rackWidget;
  13. PRIVATE RackScrollWidget();
  14. PRIVATE ~RackScrollWidget();
  15. void reset();
  16. /** Gets the top-left scroll offset in grid coordinates.
  17. */
  18. math::Vec getGridOffset();
  19. void setGridOffset(math::Vec gridOffset);
  20. float getZoom();
  21. /** Sets the zoom level, with a pivot at the center of the scroll viewport.
  22. */
  23. void setZoom(float zoom);
  24. void setZoom(float zoom, math::Vec pivot);
  25. void step() override;
  26. void draw(const DrawArgs& args) override;
  27. void onHoverKey(const HoverKeyEvent& e) override;
  28. void onHoverScroll(const HoverScrollEvent& e) override;
  29. void onHover(const HoverEvent& e) override;
  30. void onButton(const ButtonEvent& e) override;
  31. };
  32. } // namespace app
  33. } // namespace rack