Audio plugin host https://kx.studio/carla
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.

98 lines
1.7KB

  1. /*
  2. * DISTRHO Plugin Toolkit (DPT)
  3. * Copyright (C) 2012-2013 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU Lesser General Public License for more details.
  13. *
  14. * For a full copy of the license see the LGPL.txt file
  15. */
  16. #include "../App.hpp"
  17. #include "../Widget.hpp"
  18. #include "../Window.hpp"
  19. #include <cstdio>
  20. START_NAMESPACE_DISTRHO
  21. // -------------------------------------------------
  22. // Widget
  23. Widget::Widget(Window* parent)
  24. : fParent(parent),
  25. fVisible(true)
  26. {
  27. parent->addWidget(this);
  28. }
  29. Widget::~Widget()
  30. {
  31. }
  32. bool Widget::isVisible()
  33. {
  34. return fVisible;
  35. }
  36. void Widget::setVisible(bool yesNo)
  37. {
  38. if (yesNo == fVisible)
  39. return;
  40. fVisible = yesNo;
  41. fParent->repaint();
  42. }
  43. void Widget::onDisplay()
  44. {
  45. }
  46. void Widget::onKeyboard(bool, uint32_t)
  47. {
  48. }
  49. void Widget::onMouse(int, bool, int, int)
  50. {
  51. }
  52. void Widget::onMotion(int, int)
  53. {
  54. }
  55. void Widget::onScroll(float, float)
  56. {
  57. }
  58. void Widget::onSpecial(bool, Key)
  59. {
  60. }
  61. void Widget::onReshape(int width, int height)
  62. {
  63. glEnable(GL_BLEND);
  64. glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  65. glMatrixMode(GL_PROJECTION);
  66. glLoadIdentity();
  67. glOrtho(0, width, height, 0, 0, 1);
  68. glViewport(0, 0, width, height);
  69. glMatrixMode(GL_MODELVIEW);
  70. glLoadIdentity();
  71. }
  72. void Widget::onClose()
  73. {
  74. }
  75. // -------------------------------------------------
  76. END_NAMESPACE_DISTRHO