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.

PortWidget.hpp 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. #include <app/common.hpp>
  3. #include <widget/OpaqueWidget.hpp>
  4. #include <ui/Tooltip.hpp>
  5. #include <app/MultiLightWidget.hpp>
  6. #include <engine/Module.hpp>
  7. #include <engine/PortInfo.hpp>
  8. namespace rack {
  9. namespace app {
  10. /** Manages an engine::Port on a ModuleWidget. */
  11. struct PortWidget : widget::OpaqueWidget {
  12. struct Internal;
  13. Internal* internal;
  14. engine::Module* module = NULL;
  15. engine::Port::Type type = engine::Port::INPUT;
  16. int portId = -1;
  17. PortWidget();
  18. ~PortWidget();
  19. engine::Port* getPort();
  20. engine::PortInfo* getPortInfo();
  21. LightWidget* getPlugLight();
  22. void createTooltip();
  23. void destroyTooltip();
  24. void step() override;
  25. void draw(const DrawArgs& args) override;
  26. void onButton(const ButtonEvent& e) override;
  27. void onEnter(const EnterEvent& e) override;
  28. void onLeave(const LeaveEvent& e) override;
  29. void onDragStart(const DragStartEvent& e) override;
  30. void onDragEnd(const DragEndEvent& e) override;
  31. void onDragDrop(const DragDropEvent& e) override;
  32. void onDragEnter(const DragEnterEvent& e) override;
  33. void onDragLeave(const DragLeaveEvent& e) override;
  34. void onContextDestroy(const ContextDestroyEvent& e) override;
  35. };
  36. } // namespace app
  37. } // namespace rack