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.

68 lines
1.5KB

  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. #ifndef __DGL_WIDGET_HPP__
  17. #define __DGL_WIDGET_HPP__
  18. #include "Base.hpp"
  19. START_NAMESPACE_DISTRHO
  20. // -------------------------------------------------
  21. class Window;
  22. class Widget
  23. {
  24. public:
  25. Widget(Window* parent);
  26. virtual ~Widget();
  27. bool isVisible();
  28. void setVisible(bool yesNo);
  29. void show()
  30. {
  31. setVisible(true);
  32. }
  33. void hide()
  34. {
  35. setVisible(false);
  36. }
  37. protected:
  38. virtual void onDisplay();
  39. virtual void onKeyboard(bool press, uint32_t key);
  40. virtual void onMouse(int button, bool press, int x, int y);
  41. virtual void onMotion(int x, int y);
  42. virtual void onScroll(float dx, float dy);
  43. virtual void onSpecial(bool press, Key key);
  44. virtual void onReshape(int width, int height);
  45. virtual void onClose();
  46. private:
  47. Window* fParent;
  48. bool fVisible;
  49. friend class Window;
  50. };
  51. // -------------------------------------------------
  52. END_NAMESPACE_DISTRHO
  53. #endif // __DGL_WIDGET_HPP__