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.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 event::Button& e) override;
  26. void onEnter(const event::Enter& e) override;
  27. void onLeave(const event::Leave& e) override;
  28. void onDragStart(const event::DragStart& e) override;
  29. void onDragEnd(const event::DragEnd& e) override;
  30. void onDragDrop(const event::DragDrop& e) override;
  31. void onDragEnter(const event::DragEnter& e) override;
  32. void onDragLeave(const event::DragLeave& e) override;
  33. };
  34. } // namespace app
  35. } // namespace rack