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.

70 lines
2.1KB

  1. /*
  2. * Carla Plugin UI
  3. * Copyright (C) 2014 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 General Public License as
  7. * published by the Free Software Foundation; either version 2 of
  8. * the License, or any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * For a full copy of the GNU General Public License see the doc/GPL.txt file.
  16. */
  17. #ifndef CARLA_PLUGIN_UI_HPP_INCLUDED
  18. #define CARLA_PLUGIN_UI_HPP_INCLUDED
  19. #include "CarlaUtils.hpp"
  20. // -----------------------------------------------------
  21. class CarlaPluginUI
  22. {
  23. public:
  24. class CloseCallback {
  25. public:
  26. virtual ~CloseCallback() {}
  27. virtual void handlePluginUIClosed() = 0;
  28. };
  29. virtual ~CarlaPluginUI() {}
  30. virtual void show() = 0;
  31. virtual void hide() = 0;
  32. virtual void focus() = 0;
  33. virtual void idle() = 0;
  34. virtual void setSize(const uint with, const uint height, const bool forceUpdate) = 0;
  35. virtual void setTitle(const char* const title) = 0;
  36. virtual void setTransientWinId(const uintptr_t winId) = 0;
  37. virtual void* getPtr() const noexcept = 0;
  38. #ifdef HAVE_X11
  39. virtual void* getDisplay() const noexcept = 0;
  40. #endif
  41. static bool tryTransientWinIdMatch(const uintptr_t pid, const char* const uiTitle, const uintptr_t winId, const bool centerUI);
  42. #ifdef CARLA_OS_MAC
  43. static CarlaPluginUI* newCocoa(CloseCallback*, uintptr_t);
  44. #endif
  45. #ifdef CARLA_OS_WIN
  46. static CarlaPluginUI* newWindows(CloseCallback*, uintptr_t);
  47. #endif
  48. #ifdef HAVE_X11
  49. static CarlaPluginUI* newX11(CloseCallback*, uintptr_t);
  50. #endif
  51. protected:
  52. bool fIsIdling;
  53. CloseCallback* fCallback;
  54. CarlaPluginUI(CloseCallback* const cb) noexcept : fIsIdling(false), fCallback(cb) {}
  55. CARLA_DECLARE_NON_COPY_CLASS(CarlaPluginUI)
  56. };
  57. // -----------------------------------------------------
  58. #endif // CARLA_PLUGIN_UI_HPP_INCLUDED