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.

Window.hpp 2.2KB

11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 show();
  36. void hide();
  37. void close();
  38. void exec(bool lockWait = false);
  39. void focus();
  40. void repaint();
  41. bool isVisible() const noexcept;
  42. void setVisible(bool yesNo);
  43. bool isResizable() const noexcept;
  44. void setResizable(bool yesNo);
  45. int getWidth() const noexcept;
  46. int getHeight() const noexcept;
  47. Size<int> getSize() const noexcept;
  48. void setSize(unsigned int width, unsigned int height);
  49. void setTitle(const char* title);
  50. App& getApp() const noexcept;
  51. uint32_t getEventTimestamp() const;
  52. int getModifiers() const;
  53. intptr_t getWindowId() const;
  54. private:
  55. class PrivateData;
  56. PrivateData* const pData;
  57. friend class App;
  58. friend class Widget;
  59. void _addWidget(Widget* const widget);
  60. void _removeWidget(Widget* const widget);
  61. void _idle();
  62. };
  63. // -----------------------------------------------------------------------
  64. END_NAMESPACE_DGL
  65. #endif // DGL_WINDOW_HPP_INCLUDED