window.hpp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #if defined(Hiro_Window)
  2. struct mWindow : mObject {
  3. Declare(Window)
  4. using mObject::remove;
  5. mWindow();
  6. auto append(sMenuBar menuBar) -> type&;
  7. auto append(sSizable sizable) -> type&;
  8. auto append(sStatusBar statusBar) -> type&;
  9. auto backgroundColor() const -> Color;
  10. auto dismissable() const -> bool;
  11. auto doClose() const -> void;
  12. auto doDrop(vector<string>) const -> void;
  13. auto doKeyPress(int) const -> void;
  14. auto doKeyRelease(int) const -> void;
  15. auto doMove() const -> void;
  16. auto doSize() const -> void;
  17. auto droppable() const -> bool;
  18. auto frameGeometry() const -> Geometry;
  19. auto fullScreen() const -> bool;
  20. auto geometry() const -> Geometry;
  21. auto handle() const -> uintptr_t;
  22. auto maximized() const -> bool;
  23. auto maximumSize() const -> Size;
  24. auto menuBar() const -> MenuBar;
  25. auto minimized() const -> bool;
  26. auto minimumSize() const -> Size;
  27. auto modal() const -> bool;
  28. auto monitor() const -> uint;
  29. auto onClose(const function<void ()>& callback = {}) -> type&;
  30. auto onDrop(const function<void (vector<string>)>& callback = {}) -> type&;
  31. auto onKeyPress(const function<void (int)>& callback = {}) -> type&;
  32. auto onKeyRelease(const function<void (int)>& callback = {}) -> type&;
  33. auto onMove(const function<void ()>& callback = {}) -> type&;
  34. auto onSize(const function<void ()>& callback = {}) -> type&;
  35. auto remove(sMenuBar menuBar) -> type&;
  36. auto remove(sSizable sizable) -> type&;
  37. auto remove(sStatusBar statusBar) -> type&;
  38. auto reset() -> type& override;
  39. auto resizable() const -> bool;
  40. auto setAlignment(Alignment = Alignment::Center) -> type&;
  41. auto setAlignment(sWindow relativeTo, Alignment = Alignment::Center) -> type&;
  42. auto setBackgroundColor(Color color = {}) -> type&;
  43. auto setDismissable(bool dismissable = true) -> type&;
  44. auto setDroppable(bool droppable = true) -> type&;
  45. auto setFrameGeometry(Geometry geometry) -> type&;
  46. auto setFramePosition(Position position) -> type&;
  47. auto setFrameSize(Size size) -> type&;
  48. auto setFullScreen(bool fullScreen = true) -> type&;
  49. auto setGeometry(Geometry geometry) -> type&;
  50. auto setGeometry(Alignment, Size) -> type&;
  51. auto setMaximized(bool maximized = true) -> type&;
  52. auto setMaximumSize(Size size = {}) -> type&;
  53. auto setMinimized(bool minimized = true) -> type&;
  54. auto setMinimumSize(Size size = {}) -> type&;
  55. auto setModal(bool modal = true) -> type&;
  56. auto setPosition(Position) -> type&;
  57. auto setPosition(sWindow relativeTo, Position) -> type&;
  58. auto setResizable(bool resizable = true) -> type&;
  59. auto setSize(Size size) -> type&;
  60. auto setTitle(const string& title = "") -> type&;
  61. auto setVisible(bool visible = true) -> type&;
  62. auto sizable() const -> Sizable;
  63. auto statusBar() const -> StatusBar;
  64. auto title() const -> string;
  65. //private:
  66. struct State {
  67. Color backgroundColor;
  68. bool dismissable = false;
  69. bool droppable = false;
  70. bool fullScreen = false;
  71. Geometry geometry = {128, 128, 256, 256};
  72. bool maximized = false;
  73. Size maximumSize;
  74. bool minimized = false;
  75. Size minimumSize;
  76. sMenuBar menuBar;
  77. bool modal = false;
  78. function<void ()> onClose;
  79. function<void (vector<string>)> onDrop;
  80. function<void (int)> onKeyPress;
  81. function<void (int)> onKeyRelease;
  82. function<void ()> onMove;
  83. function<void ()> onSize;
  84. bool resizable = true;
  85. sSizable sizable;
  86. sStatusBar statusBar;
  87. string title;
  88. } state;
  89. auto destruct() -> void;
  90. };
  91. #endif