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.

87 lines
2.2KB

  1. /*
  2. * DISTRHO Plugin Toolkit (DPT)
  3. * Copyright (C) 2012-2013 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any purpose with
  6. * or without fee is hereby granted, provided that the above copyright notice and this
  7. * permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
  10. * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
  11. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  12. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  13. * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  14. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef DGL_WINDOW_HPP_INCLUDED
  17. #define DGL_WINDOW_HPP_INCLUDED
  18. #include "Geometry.hpp"
  19. #ifdef PROPER_CPP11_SUPPORT
  20. # include <cstdint>
  21. #else
  22. # include <stdint.h>
  23. #endif
  24. START_NAMESPACE_DGL
  25. // -----------------------------------------------------------------------
  26. class App;
  27. class Widget;
  28. class Window
  29. {
  30. public:
  31. Window(App& app);
  32. Window(App& app, Window& parent);
  33. Window(App& app, intptr_t parentId);
  34. virtual ~Window();
  35. void setTransient(const intptr_t win);
  36. void show();
  37. void hide();
  38. void close();
  39. void exec(bool lockWait = false);
  40. void focus();
  41. void repaint();
  42. bool isVisible() const noexcept;
  43. void setVisible(bool yesNo);
  44. bool isResizable() const noexcept;
  45. void setResizable(bool yesNo);
  46. int getWidth() const noexcept;
  47. int getHeight() const noexcept;
  48. Size<int> getSize() const noexcept;
  49. void setSize(unsigned int width, unsigned int height);
  50. void setTitle(const char* title);
  51. App& getApp() const noexcept;
  52. uint32_t getEventTimestamp() const;
  53. int getModifiers() const;
  54. intptr_t getWindowId() const;
  55. private:
  56. class PrivateData;
  57. PrivateData* const pData;
  58. friend class App;
  59. friend class Widget;
  60. void _addWidget(Widget* const widget);
  61. void _removeWidget(Widget* const widget);
  62. void _idle();
  63. };
  64. // -----------------------------------------------------------------------
  65. END_NAMESPACE_DGL
  66. #endif // DGL_WINDOW_HPP_INCLUDED