DISTRHO Plugin Framework
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.

46 lines
1.1KB

  1. // Copyright Jean Pierre Cimalando 2018.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #include "PluginUI.h"
  6. #include "DemoWidgetClickable.h"
  7. #include "DemoWidgetBanner.h"
  8. #include "Window.hpp"
  9. ExampleUI::ExampleUI()
  10. : UI(200, 200)
  11. {
  12. DemoWidgetClickable *widget_clickable = new DemoWidgetClickable(this);
  13. widget_clickable_.reset(widget_clickable);
  14. widget_clickable->setSize(50, 50);
  15. widget_clickable->setAbsolutePos(100, 100);
  16. DemoWidgetBanner *widget_banner = new DemoWidgetBanner(this);
  17. widget_banner_.reset(widget_banner);
  18. widget_banner->setSize(180, 80);
  19. widget_banner->setAbsolutePos(10, 10);
  20. }
  21. ExampleUI::~ExampleUI()
  22. {
  23. }
  24. void ExampleUI::onDisplay()
  25. {
  26. cairo_t *cr = getParentWindow().getGraphicsContext().cairo;
  27. cairo_set_source_rgb(cr, 1.0, 0.8, 0.5);
  28. cairo_paint(cr);
  29. }
  30. void ExampleUI::parameterChanged(uint32_t index, float value)
  31. {
  32. }
  33. UI *DISTRHO::createUI()
  34. {
  35. return new ExampleUI;
  36. }