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.

47 lines
1.1KB

  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. engine::Module* module = NULL;
  13. engine::Port::Type type;
  14. int portId;
  15. ui::Tooltip* tooltip = NULL;
  16. MultiLightWidget* plugLight;
  17. PortWidget();
  18. ~PortWidget();
  19. engine::Port* getPort();
  20. engine::PortInfo* getPortInfo();
  21. void createTooltip();
  22. void destroyTooltip();
  23. void step() override;
  24. void draw(const DrawArgs& args) override;
  25. void onButton(const ButtonEvent& e) override;
  26. void onEnter(const EnterEvent& e) override;
  27. void onLeave(const LeaveEvent& e) override;
  28. void onDragStart(const DragStartEvent& e) override;
  29. void onDragEnd(const DragEndEvent& e) override;
  30. void onDragDrop(const DragDropEvent& e) override;
  31. void onDragEnter(const DragEnterEvent& e) override;
  32. void onDragLeave(const DragLeaveEvent& e) override;
  33. };
  34. } // namespace app
  35. } // namespace rack