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
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 idle();
  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 Widget;
  59. void addWidget(Widget* const widget);
  60. void removeWidget(Widget* const widget);
  61. };
  62. // -----------------------------------------------------------------------
  63. END_NAMESPACE_DGL
  64. #endif // DGL_WINDOW_HPP_INCLUDED