shared.hpp 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957
  1. #define DeclareShared(Name) \
  2. using type = Name; \
  3. using internalType = m##Name; \
  4. Name() : s##Name(new m##Name, [](auto p) { \
  5. p->unbind(); \
  6. delete p; \
  7. }) { \
  8. (*this)->bind(*this); \
  9. } \
  10. Name(const s##Name& source) : s##Name(source) { assert(source); } \
  11. template<typename T> Name(const T& source, \
  12. std::enable_if_t<std::is_base_of<internalType, typename T::internalType>::value>* = 0) : \
  13. s##Name((s##Name&)source) { assert(source); } \
  14. explicit operator bool() const { return self().operator bool(); } \
  15. auto self() const -> m##Name& { return (m##Name&)operator*(); } \
  16. #define DeclareSharedObject(Name) \
  17. DeclareShared(Name) \
  18. template<typename T, typename... P> Name(T* parent, P&&... p) : Name() { \
  19. if(parent) (*parent)->append(*this, std::forward<P>(p)...); \
  20. } \
  21. template<typename T> auto is() -> bool { \
  22. return dynamic_cast<typename T::internalType*>(s##Name::data()); \
  23. } \
  24. template<typename T> auto cast() -> T { \
  25. if(auto pointer = dynamic_cast<typename T::internalType*>(s##Name::data())) { \
  26. if(auto shared = pointer->instance.acquire()) return T(shared); \
  27. } \
  28. return T(); \
  29. } \
  30. template<typename T = string> auto attribute(const string& name) const { return self().attribute<T>(name); } \
  31. auto enabled(bool recursive = false) const { return self().enabled(recursive); } \
  32. auto focused() const { return self().focused(); } \
  33. auto font(bool recursive = false) const { return self().font(recursive); } \
  34. auto offset() const { return self().offset(); } \
  35. auto parent() const { \
  36. if(auto object = self().parent()) { \
  37. if(auto instance = object->instance.acquire()) return Object(instance); \
  38. } \
  39. return Object(); \
  40. } \
  41. auto remove() { return self().remove(), *this; } \
  42. template<typename T = string, typename U = string> auto setAttribute(const string& name, const U& value = {}) { return self().setAttribute<T, U>(name, value), *this; } \
  43. auto setEnabled(bool enabled = true) { return self().setEnabled(enabled), *this; } \
  44. auto setFocused() { return self().setFocused(), *this; } \
  45. auto setFont(const Font& font = {}) { return self().setFont(font), *this; } \
  46. auto setVisible(bool visible = true) { return self().setVisible(visible), *this; } \
  47. auto visible(bool recursive = false) const { return self().visible(recursive); } \
  48. #define DeclareSharedAction(Name) \
  49. DeclareSharedObject(Name) \
  50. #define DeclareSharedSizable(Name) \
  51. DeclareSharedObject(Name) \
  52. auto collapsible() const { return self().collapsible(); } \
  53. auto doSize() const { return self().doSize(); } \
  54. auto geometry() const { return self().geometry(); } \
  55. auto minimumSize() const { return self().minimumSize(); } \
  56. auto onSize(const function<void ()>& callback = {}) { return self().onSize(callback), *this; } \
  57. auto setCollapsible(bool collapsible = true) { return self().setCollapsible(collapsible), *this; } \
  58. auto setGeometry(Geometry geometry) { return self().setGeometry(geometry), *this; } \
  59. #define DeclareSharedWidget(Name) \
  60. DeclareSharedSizable(Name) \
  61. auto droppable() const { return self().droppable(); } \
  62. auto doDrop(vector<string> names) { return self().doDrop(names); } \
  63. auto doMouseEnter() const { return self().doMouseEnter(); } \
  64. auto doMouseLeave() const { return self().doMouseLeave(); } \
  65. auto doMouseMove(Position position) const { return self().doMouseMove(position); } \
  66. auto doMousePress(Mouse::Button button) const { return self().doMousePress(button); } \
  67. auto doMouseRelease(Mouse::Button button) const { return self().doMouseRelease(button); } \
  68. auto focusable() const { return self().focusable(); } \
  69. auto mouseCursor() const { return self().mouseCursor(); } \
  70. auto onDrop(const function<void (vector<string>)>& callback = {}) { return self().onDrop(callback), *this; } \
  71. auto onMouseEnter(const function<void ()>& callback = {}) { return self().onMouseEnter(callback), *this; } \
  72. auto onMouseLeave(const function<void ()>& callback = {}) { return self().onMouseLeave(callback), *this; } \
  73. auto onMouseMove(const function<void (Position)>& callback = {}) { return self().onMouseMove(callback), *this; } \
  74. auto onMousePress(const function<void (Mouse::Button)>& callback = {}) { return self().onMousePress(callback), *this; } \
  75. auto onMouseRelease(const function<void (Mouse::Button)>& callback = {}) { return self().onMouseRelease(callback), *this; } \
  76. auto setDroppable(bool droppable = true) { return self().setDroppable(droppable), *this; } \
  77. auto setFocusable(bool focusable = true) { return self().setFocusable(focusable), *this; } \
  78. auto setMouseCursor(const MouseCursor& mouseCursor = {}) { return self().setMouseCursor(mouseCursor), *this; } \
  79. auto setToolTip(const string& toolTip = "") { return self().setToolTip(toolTip), *this; } \
  80. auto toolTip() const { return self().toolTip(); } \
  81. #if defined(Hiro_Object)
  82. struct Object : sObject {
  83. DeclareSharedObject(Object)
  84. };
  85. #endif
  86. #if defined(Hiro_Group)
  87. struct Group : sGroup {
  88. DeclareShared(Group)
  89. template<typename... P> Group(P&&... p) : Group() { _append(std::forward<P>(p)...); }
  90. auto append(sObject object) -> type& { return self().append(object), *this; }
  91. auto object(unsigned position) const { return self().object(position); }
  92. auto objectCount() const { return self().objectCount(); }
  93. template<typename T = Object> auto objects() const -> vector<T> {
  94. vector<T> objects;
  95. for(auto object : self().objects()) {
  96. if(auto casted = object.cast<T>()) objects.append(casted);
  97. }
  98. return objects;
  99. }
  100. auto remove(sObject object) -> type& { return self().remove(object), *this; }
  101. private:
  102. auto _append() {}
  103. template<typename T, typename... P> auto _append(T* object, P&&... p) {
  104. append(*object);
  105. _append(std::forward<P>(p)...);
  106. }
  107. };
  108. #endif
  109. #if defined(Hiro_Timer)
  110. struct Timer : sTimer {
  111. DeclareSharedObject(Timer)
  112. auto doActivate() const { return self().doActivate(); }
  113. auto interval() const { return self().interval(); }
  114. auto onActivate(const function<void ()>& callback = {}) { return self().onActivate(callback), *this; }
  115. auto setInterval(unsigned interval = 0) { return self().setInterval(interval), *this; }
  116. };
  117. #endif
  118. #if defined(Hiro_Action)
  119. struct Action : sAction {
  120. DeclareSharedAction(Action)
  121. };
  122. #endif
  123. #if defined(Hiro_Menu)
  124. struct Menu : sMenu {
  125. DeclareSharedAction(Menu)
  126. auto action(unsigned position) const { return self().action(position); }
  127. auto actionCount() const { return self().actionCount(); }
  128. auto actions() const { return self().actions(); }
  129. auto append(sAction action) { return self().append(action), *this; }
  130. auto icon() const { return self().icon(); }
  131. auto remove(sAction action) { return self().remove(action), *this; }
  132. auto reset() { return self().reset(), *this; }
  133. auto setIcon(const image& icon = {}) { return self().setIcon(icon), *this; }
  134. auto setText(const string& text = "") { return self().setText(text), *this; }
  135. auto text() const { return self().text(); }
  136. };
  137. #endif
  138. #if defined(Hiro_MenuSeparator)
  139. struct MenuSeparator : sMenuSeparator {
  140. DeclareSharedAction(MenuSeparator)
  141. };
  142. #endif
  143. #if defined(Hiro_MenuItem)
  144. struct MenuItem : sMenuItem {
  145. DeclareSharedAction(MenuItem)
  146. auto doActivate() const { return self().doActivate(); }
  147. auto icon() const { return self().icon(); }
  148. auto onActivate(const function<void ()>& callback = {}) { return self().onActivate(callback), *this; }
  149. auto setIcon(const image& icon = {}) { return self().setIcon(icon), *this; }
  150. auto setText(const string& text = "") { return self().setText(text), *this; }
  151. auto text() const { return self().text(); }
  152. };
  153. #endif
  154. #if defined(Hiro_MenuCheckItem)
  155. struct MenuCheckItem : sMenuCheckItem {
  156. DeclareSharedAction(MenuCheckItem)
  157. auto checked() const { return self().checked(); }
  158. auto doToggle() const { return self().doToggle(); }
  159. auto onToggle(const function<void ()>& callback = {}) { return self().onToggle(callback), *this; }
  160. auto setChecked(bool checked = true) { return self().setChecked(checked), *this; }
  161. auto setText(const string& text = "") { return self().setText(text), *this; }
  162. auto text() const { return self().text(); }
  163. };
  164. #endif
  165. #if defined(Hiro_MenuRadioItem)
  166. struct MenuRadioItem : sMenuRadioItem {
  167. DeclareSharedAction(MenuRadioItem)
  168. auto checked() const { return self().checked(); }
  169. auto doActivate() const { return self().doActivate(); }
  170. auto group() const { return self().group(); }
  171. auto onActivate(const function<void ()>& callback = {}) { return self().onActivate(callback), *this; }
  172. auto setChecked() { return self().setChecked(), *this; }
  173. auto setText(const string& text = "") { return self().setText(text), *this; }
  174. auto text() const { return self().text(); }
  175. };
  176. #endif
  177. #if defined(Hiro_Sizable)
  178. struct Sizable : sSizable {
  179. DeclareSharedSizable(Sizable)
  180. };
  181. #endif
  182. #if defined(Hiro_Widget)
  183. struct Widget : sWidget {
  184. DeclareSharedWidget(Widget)
  185. };
  186. #endif
  187. #if defined(Hiro_Button)
  188. struct Button : sButton {
  189. DeclareSharedWidget(Button)
  190. auto bordered() const { return self().bordered(); }
  191. auto doActivate() const { return self().doActivate(); }
  192. auto icon() const { return self().icon(); }
  193. auto onActivate(const function<void ()>& callback = {}) { return self().onActivate(callback), *this; }
  194. auto orientation() const { return self().orientation(); }
  195. auto setBordered(bool bordered = true) { return self().setBordered(bordered), *this; }
  196. auto setIcon(const image& icon = {}) { return self().setIcon(icon), *this; }
  197. auto setOrientation(Orientation orientation = Orientation::Horizontal) { return self().setOrientation(orientation), *this; }
  198. auto setText(const string& text = "") { return self().setText(text), *this; }
  199. auto text() const { return self().text(); }
  200. };
  201. #endif
  202. #if defined(Hiro_Canvas)
  203. struct Canvas : sCanvas {
  204. DeclareSharedWidget(Canvas)
  205. auto alignment() const { return self().alignment(); }
  206. auto color() const { return self().color(); }
  207. auto data() { return self().data(); }
  208. auto gradient() const { return self().gradient(); }
  209. auto icon() const { return self().icon(); }
  210. auto setAlignment(Alignment alignment = {}) { return self().setAlignment(alignment), *this; }
  211. auto setColor(Color color) { return self().setColor(color), *this; }
  212. auto setGradient(Gradient gradient = {}) { return self().setGradient(gradient), *this; }
  213. auto setIcon(const image& icon = {}) { return self().setIcon(icon), *this; }
  214. auto setSize(Size size = {}) { return self().setSize(size), *this; }
  215. auto update() { return self().update(), *this; }
  216. };
  217. #endif
  218. #if defined(Hiro_CheckButton)
  219. struct CheckButton : sCheckButton {
  220. DeclareSharedWidget(CheckButton)
  221. auto bordered() const { return self().bordered(); }
  222. auto checked() const { return self().checked(); }
  223. auto doToggle() const { return self().doToggle(); }
  224. auto icon() const { return self().icon(); }
  225. auto onToggle(const function<void ()>& callback = {}) { return self().onToggle(callback), *this; }
  226. auto orientation() const { return self().orientation(); }
  227. auto setBordered(bool bordered = true) { return self().setBordered(bordered), *this; }
  228. auto setChecked(bool checked = true) { return self().setChecked(checked), *this; }
  229. auto setIcon(const image& icon = {}) { return self().setIcon(icon), *this; }
  230. auto setOrientation(Orientation orientation = Orientation::Horizontal) { return self().setOrientation(orientation), *this; }
  231. auto setText(const string& text = "") { return self().setText(text), *this; }
  232. auto text() const { return self().text(); }
  233. };
  234. #endif
  235. #if defined(Hiro_CheckLabel)
  236. struct CheckLabel : sCheckLabel {
  237. DeclareSharedWidget(CheckLabel)
  238. auto checked() const { return self().checked(); }
  239. auto doToggle() const { return self().doToggle(); }
  240. auto onToggle(const function<void ()>& callback = {}) { return self().onToggle(callback), *this; }
  241. auto setChecked(bool checked = true) { return self().setChecked(checked), *this; }
  242. auto setText(const string& text = "") { return self().setText(text), *this; }
  243. auto text() const { return self().text(); }
  244. };
  245. #endif
  246. #if defined(Hiro_ComboButton)
  247. struct ComboButtonItem : sComboButtonItem {
  248. DeclareSharedObject(ComboButtonItem)
  249. auto icon() const { return self().icon(); }
  250. auto selected() const { return self().selected(); }
  251. auto setIcon(const image& icon = {}) { return self().setIcon(icon), *this; }
  252. auto setSelected() { return self().setSelected(), *this; }
  253. auto setText(const string& text = "") { return self().setText(text), *this; }
  254. auto text() const { return self().text(); }
  255. };
  256. #endif
  257. #if defined(Hiro_ComboButton)
  258. struct ComboButton : sComboButton {
  259. DeclareSharedWidget(ComboButton)
  260. auto append(sComboButtonItem item) { return self().append(item), *this; }
  261. auto doChange() const { return self().doChange(); }
  262. auto item(unsigned position) const { return self().item(position); }
  263. auto itemCount() const { return self().itemCount(); }
  264. auto items() const { return self().items(); }
  265. auto onChange(const function<void ()>& callback = {}) { return self().onChange(callback), *this; }
  266. auto remove(sComboButtonItem item) { return self().remove(item), *this; }
  267. auto reset() { return self().reset(), *this; }
  268. auto selected() const { return self().selected(); }
  269. auto setParent(mObject* parent = nullptr, signed offset = -1) { return self().setParent(parent, offset), *this; }
  270. };
  271. #endif
  272. #if defined(Hiro_ComboEdit)
  273. struct ComboEditItem : sComboEditItem {
  274. DeclareSharedObject(ComboEditItem)
  275. auto icon() const { return self().icon(); }
  276. auto setIcon(const image& icon = {}) { return self().setIcon(icon), *this; }
  277. auto setText(const string& text = "") { return self().setText(text), *this; }
  278. auto text() const { return self().text(); }
  279. };
  280. #endif
  281. #if defined(Hiro_ComboEdit)
  282. struct ComboEdit : sComboEdit {
  283. DeclareSharedWidget(ComboEdit)
  284. auto append(sComboEditItem item) { return self().append(item), *this; }
  285. auto backgroundColor() const { return self().backgroundColor(); }
  286. auto doActivate() const { return self().doActivate(); }
  287. auto doChange() const { return self().doChange(); }
  288. auto editable() const { return self().editable(); }
  289. auto foregroundColor() const { return self().foregroundColor(); }
  290. auto item(uint position) const { return self().item(position); }
  291. auto itemCount() const { return self().itemCount(); }
  292. auto items() const { return self().items(); }
  293. auto onActivate(const function<void ()>& callback = {}) { return self().onActivate(callback), *this; }
  294. auto onChange(const function<void ()>& callback = {}) { return self().onChange(callback), *this; }
  295. auto remove(sComboEditItem item) { return self().remove(item), *this; }
  296. auto reset() { return self().reset(), *this; }
  297. auto setBackgroundColor(Color color = {}) { return self().setBackgroundColor(color), *this; }
  298. auto setEditable(bool editable = true) { return self().setEditable(editable), *this; }
  299. auto setForegroundColor(Color color = {}) { return self().setForegroundColor(color), *this; }
  300. auto setText(const string& text = "") { return self().setText(text), *this; }
  301. auto text() const { return self().text(); }
  302. };
  303. #endif
  304. #if defined(Hiro_Console)
  305. struct Console : sConsole {
  306. DeclareSharedWidget(Console)
  307. auto backgroundColor() const { return self().backgroundColor(); }
  308. auto doActivate(string command) const { return self().doActivate(command); }
  309. auto foregroundColor() const { return self().foregroundColor(); }
  310. auto onActivate(const function<void (string)>& callback = {}) { return self().onActivate(callback), *this; }
  311. auto print(const string& text) { return self().print(text), *this; }
  312. auto prompt() const { return self().prompt(); }
  313. auto reset() { return self().reset(), *this; }
  314. auto setBackgroundColor(Color color = {}) { return self().setBackgroundColor(color), *this; }
  315. auto setForegroundColor(Color color = {}) { return self().setForegroundColor(color), *this; }
  316. auto setPrompt(const string& prompt = "") { return self().setPrompt(prompt), *this; }
  317. };
  318. #endif
  319. #if defined(Hiro_Frame)
  320. struct Frame : sFrame {
  321. DeclareSharedWidget(Frame)
  322. auto append(sSizable sizable) { return self().append(sizable), *this; }
  323. auto remove(sSizable sizable) { return self().remove(sizable), *this; }
  324. auto reset() { return self().reset(), *this; }
  325. auto setText(const string& text = "") { return self().setText(text), *this; }
  326. auto sizable() const { return self().sizable(); }
  327. auto text() const { return self().text(); }
  328. };
  329. #endif
  330. #if defined(Hiro_HexEdit)
  331. struct HexEdit : sHexEdit {
  332. DeclareSharedWidget(HexEdit)
  333. auto address() const { return self().address(); }
  334. auto backgroundColor() const { return self().backgroundColor(); }
  335. auto columns() const { return self().columns(); }
  336. auto doRead(unsigned offset) const { return self().doRead(offset); }
  337. auto doWrite(unsigned offset, uint8_t data) const { return self().doWrite(offset, data); }
  338. auto foregroundColor() const { return self().foregroundColor(); }
  339. auto length() const { return self().length(); }
  340. auto onRead(const function<uint8_t (unsigned)>& callback = {}) { return self().onRead(callback), *this; }
  341. auto onWrite(const function<void (unsigned, uint8_t)>& callback = {}) { return self().onWrite(callback), *this; }
  342. auto rows() const { return self().rows(); }
  343. auto setAddress(unsigned address) { return self().setAddress(address), *this; }
  344. auto setBackgroundColor(Color color = {}) { return self().setBackgroundColor(color), *this; }
  345. auto setColumns(unsigned columns = 16) { return self().setColumns(columns), *this; }
  346. auto setForegroundColor(Color color = {}) { return self().setForegroundColor(color), *this; }
  347. auto setLength(unsigned length) { return self().setLength(length), *this; }
  348. auto setRows(unsigned rows = 16) { return self().setRows(rows), *this; }
  349. auto update() { return self().update(), *this; }
  350. };
  351. #endif
  352. #if defined(Hiro_HorizontalScrollBar)
  353. struct HorizontalScrollBar : sHorizontalScrollBar {
  354. DeclareSharedWidget(HorizontalScrollBar)
  355. auto doChange() const { return self().doChange(); }
  356. auto length() const { return self().length(); }
  357. auto onChange(const function<void ()>& callback = {}) { return self().onChange(callback), *this; }
  358. auto position() const { return self().position(); }
  359. auto setLength(unsigned length = 101) { return self().setLength(length), *this; }
  360. auto setPosition(unsigned position = 0) { return self().setPosition(position), *this; }
  361. };
  362. #endif
  363. #if defined(Hiro_HorizontalSlider)
  364. struct HorizontalSlider : sHorizontalSlider {
  365. DeclareSharedWidget(HorizontalSlider)
  366. auto doChange() const { return self().doChange(); }
  367. auto length() const { return self().length(); }
  368. auto onChange(const function<void ()>& callback = {}) { return self().onChange(callback), *this; }
  369. auto position() const { return self().position(); }
  370. auto setLength(unsigned length = 101) { return self().setLength(length), *this; }
  371. auto setPosition(unsigned position = 0) { return self().setPosition(position), *this; }
  372. };
  373. #endif
  374. #if defined(Hiro_IconView)
  375. struct IconViewItem : sIconViewItem {
  376. DeclareSharedObject(IconViewItem)
  377. auto icon() const { return self().icon(); }
  378. auto selected() const { return self().selected(); }
  379. auto setIcon(const image& icon = {}) { return self().setIcon(icon), *this; }
  380. auto setSelected(bool selected = true) { return self().setSelected(selected), *this; }
  381. auto setText(const string& text = "") { return self().setText(text), *this; }
  382. auto text() const { return self().text(); }
  383. };
  384. #endif
  385. #if defined(Hiro_IconView)
  386. struct IconView : sIconView {
  387. DeclareSharedWidget(IconView)
  388. auto append(sIconViewItem item) { return self().append(item), *this; }
  389. auto backgroundColor() const { return self().backgroundColor(); }
  390. auto batchable() const { return self().batchable(); }
  391. auto batched() const { return self().batched(); }
  392. auto doActivate() const { return self().doActivate(); }
  393. auto doChange() const { return self().doChange(); }
  394. auto doContext() const { return self().doContext(); }
  395. auto flow() const { return self().flow(); }
  396. auto foregroundColor() const { return self().foregroundColor(); }
  397. auto item(unsigned position) const { return self().item(position); }
  398. auto itemCount() const { return self().itemCount(); }
  399. auto items() const { return self().items(); }
  400. auto onActivate(const function<void ()>& callback = {}) { return self().onActivate(callback), *this; }
  401. auto onChange(const function<void ()>& callback = {}) { return self().onChange(callback), *this; }
  402. auto onContext(const function<void ()>& callback = {}) { return self().onContext(callback), *this; }
  403. auto orientation() const { return self().orientation(); }
  404. auto remove(sIconViewItem item) { return self().remove(item), *this; }
  405. auto reset() { return self().reset(), *this; }
  406. auto selected() const { return self().selected(); }
  407. auto setBackgroundColor(Color color = {}) { return self().setBackgroundColor(color), *this; }
  408. auto setBatchable(bool batchable = true) { return self().setBatchable(batchable), *this; }
  409. auto setFlow(Orientation orientation = Orientation::Vertical) { return self().setFlow(orientation), *this; }
  410. auto setForegroundColor(Color color = {}) { return self().setForegroundColor(color), *this; }
  411. auto setOrientation(Orientation orientation = Orientation::Horizontal) { return self().setOrientation(orientation), *this; }
  412. auto setSelected(const vector<signed>& selections) { return self().setSelected(selections), *this; }
  413. };
  414. #endif
  415. #if defined(Hiro_Label)
  416. struct Label : sLabel {
  417. DeclareSharedWidget(Label)
  418. auto alignment() const { return self().alignment(); }
  419. auto backgroundColor() const { return self().backgroundColor(); }
  420. auto foregroundColor() const { return self().foregroundColor(); }
  421. auto setAlignment(Alignment alignment = {}) { return self().setAlignment(alignment), *this; }
  422. auto setBackgroundColor(Color color = {}) { return self().setBackgroundColor(color), *this; }
  423. auto setForegroundColor(Color color = {}) { return self().setForegroundColor(color), *this; }
  424. auto setText(const string& text = "") { return self().setText(text), *this; }
  425. auto text() const { return self().text(); }
  426. };
  427. #endif
  428. #if defined(Hiro_LineEdit)
  429. struct LineEdit : sLineEdit {
  430. DeclareSharedWidget(LineEdit)
  431. auto backgroundColor() const { return self().backgroundColor(); }
  432. auto doActivate() const { return self().doActivate(); }
  433. auto doChange() const { return self().doChange(); }
  434. auto editable() const { return self().editable(); }
  435. auto foregroundColor() const { return self().foregroundColor(); }
  436. auto onActivate(const function<void ()>& callback = {}) { return self().onActivate(callback), *this; }
  437. auto onChange(const function<void ()>& callback = {}) { return self().onChange(callback), *this; }
  438. auto setBackgroundColor(Color color = {}) { return self().setBackgroundColor(color), *this; }
  439. auto setEditable(bool editable = true) { return self().setEditable(editable), *this; }
  440. auto setForegroundColor(Color color = {}) { return self().setForegroundColor(color), *this; }
  441. auto setText(const string& text = "") { return self().setText(text), *this; }
  442. auto text() const { return self().text(); }
  443. };
  444. #endif
  445. #if defined(Hiro_ProgressBar)
  446. struct ProgressBar : sProgressBar {
  447. DeclareSharedWidget(ProgressBar)
  448. auto position() const { return self().position(); }
  449. auto setPosition(unsigned position = 0) { return self().setPosition(position), *this; }
  450. };
  451. #endif
  452. #if defined(Hiro_RadioButton)
  453. struct RadioButton : sRadioButton {
  454. DeclareSharedWidget(RadioButton)
  455. auto bordered() const { return self().bordered(); }
  456. auto checked() const { return self().checked(); }
  457. auto doActivate() const { return self().doActivate(); }
  458. auto group() const { return self().group(); }
  459. auto icon() const { return self().icon(); }
  460. auto onActivate(const function<void ()>& callback = {}) { return self().onActivate(callback), *this; }
  461. auto orientation() const { return self().orientation(); }
  462. auto setBordered(bool bordered = true) { return self().setBordered(bordered), *this; }
  463. auto setChecked() { return self().setChecked(), *this; }
  464. auto setIcon(const image& icon = {}) { return self().setIcon(icon), *this; }
  465. auto setOrientation(Orientation orientation = Orientation::Horizontal) { return self().setOrientation(orientation), *this; }
  466. auto setText(const string& text = "") { return self().setText(text), *this; }
  467. auto text() const { return self().text(); }
  468. };
  469. #endif
  470. #if defined(Hiro_RadioLabel)
  471. struct RadioLabel : sRadioLabel {
  472. DeclareSharedWidget(RadioLabel)
  473. auto checked() const { return self().checked(); }
  474. auto doActivate() const { return self().doActivate(); }
  475. auto group() const { return self().group(); }
  476. auto onActivate(const function<void ()>& callback = {}) { return self().onActivate(callback), *this; }
  477. auto setChecked() { return self().setChecked(), *this; }
  478. auto setText(const string& text = "") { return self().setText(text), *this; }
  479. auto text() const { return self().text(); }
  480. };
  481. #endif
  482. #if defined(Hiro_SourceEdit)
  483. struct SourceEdit : sSourceEdit {
  484. DeclareSharedWidget(SourceEdit)
  485. auto doChange() const { return self().doChange(); }
  486. auto doMove() const { return self().doMove(); }
  487. auto editable() const { return self().editable(); }
  488. auto language() const { return self().language(); }
  489. auto numbered() const { return self().numbered(); }
  490. auto onChange(const function<void ()>& callback = {}) { return self().onChange(callback), *this; }
  491. auto onMove(const function<void ()>& callback = {}) { return self().onMove(callback), *this; }
  492. auto scheme() const { return self().scheme(); }
  493. auto setEditable(bool editable = true) { return self().setEditable(editable), *this; }
  494. auto setLanguage(const string& language = "") { return self().setLanguage(language), *this; }
  495. auto setNumbered(bool numbered = true) { return self().setNumbered(numbered), *this; }
  496. auto setScheme(const string& scheme = "") { return self().setScheme(scheme), *this; }
  497. auto setText(const string& text = "") { return self().setText(text), *this; }
  498. auto setTextCursor(TextCursor textCursor = {}) { return self().setTextCursor(textCursor), *this; }
  499. auto setWordWrap(bool wordWrap = true) { return self().setWordWrap(wordWrap), *this; }
  500. auto text() const { return self().text(); }
  501. auto textCursor() const { return self().textCursor(); }
  502. auto wordWrap() const { return self().wordWrap(); }
  503. };
  504. #endif
  505. #if defined(Hiro_TabFrame)
  506. struct TabFrameItem : sTabFrameItem {
  507. DeclareSharedObject(TabFrameItem)
  508. auto append(sSizable sizable) { return self().append(sizable), *this; }
  509. auto closable() const { return self().closable(); }
  510. auto icon() const { return self().icon(); }
  511. auto movable() const { return self().movable(); }
  512. auto remove(sSizable sizable) { return self().remove(sizable), *this; }
  513. auto reset() { return self().reset(), *this; }
  514. auto selected() const { return self().selected(); }
  515. auto setClosable(bool closable = true) { return self().setClosable(closable), *this; }
  516. auto setIcon(const image& icon = {}) { return self().setIcon(icon), *this; }
  517. auto setMovable(bool movable = true) { return self().setMovable(movable), *this; }
  518. auto setSelected() { return self().setSelected(), *this; }
  519. auto setText(const string& text = "") { return self().setText(text), *this; }
  520. auto sizable() const { return self().sizable(); }
  521. auto text() const { return self().text(); }
  522. };
  523. #endif
  524. #if defined(Hiro_TabFrame)
  525. struct TabFrame : sTabFrame {
  526. DeclareSharedWidget(TabFrame)
  527. auto append(sTabFrameItem item) { return self().append(item), *this; }
  528. auto doChange() const { return self().doChange(); }
  529. auto doClose(sTabFrameItem item) const { return self().doClose(item); }
  530. auto doMove(sTabFrameItem from, sTabFrameItem to) const { return self().doMove(from, to); }
  531. auto item(unsigned position) const { return self().item(position); }
  532. auto itemCount() const { return self().itemCount(); }
  533. auto items() const { return self().items(); }
  534. auto navigation() const { return self().navigation(); }
  535. auto onChange(const function<void ()>& callback = {}) { return self().onChange(callback), *this; }
  536. auto onClose(const function<void (sTabFrameItem)>& callback = {}) { return self().onClose(callback), *this; }
  537. auto onMove(const function<void (sTabFrameItem, sTabFrameItem)>& callback = {}) { return self().onMove(callback), *this; }
  538. auto remove(sTabFrameItem item) { return self().remove(item), *this; }
  539. auto reset() { return self().reset(), *this; }
  540. auto selected() const { return self().selected(); }
  541. auto setNavigation(Navigation navigation = Navigation::Top) { return self().setNavigation(navigation), *this; }
  542. };
  543. #endif
  544. #if defined(Hiro_TableView)
  545. struct TableViewColumn : sTableViewColumn {
  546. DeclareSharedObject(TableViewColumn)
  547. auto active() const { return self().active(); }
  548. auto alignment() const { return self().alignment(); }
  549. auto backgroundColor() const { return self().backgroundColor(); }
  550. auto editable() const { return self().editable(); }
  551. auto expandable() const { return self().expandable(); }
  552. auto foregroundColor() const { return self().foregroundColor(); }
  553. auto horizontalAlignment() const { return self().horizontalAlignment(); }
  554. auto icon() const { return self().icon(); }
  555. auto resizable() const { return self().resizable(); }
  556. auto setActive() { return self().setActive(), *this; }
  557. auto setAlignment(Alignment alignment = {}) { return self().setAlignment(alignment), *this; }
  558. auto setBackgroundColor(Color color = {}) { return self().setBackgroundColor(color), *this; }
  559. auto setEditable(bool editable = true) { return self().setEditable(editable), *this; }
  560. auto setExpandable(bool expandable = true) { return self().setExpandable(expandable), *this; }
  561. auto setForegroundColor(Color color = {}) { return self().setForegroundColor(color), *this; }
  562. auto setHorizontalAlignment(float alignment = 0.0) { return self().setHorizontalAlignment(alignment), *this; }
  563. auto setIcon(const image& icon = {}) { return self().setIcon(icon), *this; }
  564. auto setResizable(bool resizable = true) { return self().setResizable(resizable), *this; }
  565. auto setSorting(Sort sorting = Sort::None) { return self().setSorting(sorting), *this; }
  566. auto setText(const string& text = "") { return self().setText(text), *this; }
  567. auto setVerticalAlignment(float alignment = 0.5) { return self().setVerticalAlignment(alignment), *this; }
  568. auto setWidth(float width = 0) { return self().setWidth(width), *this; }
  569. auto sort(Sort sorting) { return self().sort(sorting), *this; }
  570. auto sorting() const { return self().sorting(); }
  571. auto text() const { return self().text(); }
  572. auto verticalAlignment() const { return self().verticalAlignment(); }
  573. auto width() const { return self().width(); }
  574. };
  575. #endif
  576. #if defined(Hiro_TableView)
  577. struct TableViewCell : sTableViewCell {
  578. DeclareSharedObject(TableViewCell)
  579. auto alignment() const { return self().alignment(); }
  580. auto backgroundColor() const { return self().backgroundColor(); }
  581. auto checkable() const { return self().checkable(); }
  582. auto checked() const { return self().checked(); }
  583. auto foregroundColor() const { return self().foregroundColor(); }
  584. auto icon() const { return self().icon(); }
  585. auto setAlignment(Alignment alignment = {}) { return self().setAlignment(alignment), *this; }
  586. auto setBackgroundColor(Color color = {}) { return self().setBackgroundColor(color), *this; }
  587. auto setCheckable(bool checkable = true) const { return self().setCheckable(checkable), *this; }
  588. auto setChecked(bool checked = true) const { return self().setChecked(checked), *this; }
  589. auto setForegroundColor(Color color = {}) { return self().setForegroundColor(color), *this; }
  590. auto setIcon(const image& icon = {}) { return self().setIcon(icon), *this; }
  591. auto setText(const string& text = "") { return self().setText(text), *this; }
  592. auto text() const { return self().text(); }
  593. };
  594. #endif
  595. #if defined(Hiro_TableView)
  596. struct TableViewItem : sTableViewItem {
  597. DeclareSharedObject(TableViewItem)
  598. auto alignment() const { return self().alignment(); }
  599. auto append(sTableViewCell cell) { return self().append(cell), *this; }
  600. auto backgroundColor() const { return self().backgroundColor(); }
  601. auto cell(unsigned position) const { return self().cell(position); }
  602. auto cellCount() const { return self().cellCount(); }
  603. auto cells() const { return self().cells(); }
  604. auto foregroundColor() const { return self().foregroundColor(); }
  605. auto remove(sTableViewCell cell) { return self().remove(cell), *this; }
  606. auto reset() { return self().reset(), *this; }
  607. auto selected() const { return self().selected(); }
  608. auto setAlignment(Alignment alignment = {}) { return self().setAlignment(alignment), *this; }
  609. auto setBackgroundColor(Color color = {}) { return self().setBackgroundColor(color), *this; }
  610. auto setForegroundColor(Color color = {}) { return self().setForegroundColor(color), *this; }
  611. auto setSelected(bool selected = true) { return self().setSelected(selected), *this; }
  612. };
  613. #endif
  614. #if defined(Hiro_TableView)
  615. struct TableView : sTableView {
  616. DeclareSharedWidget(TableView)
  617. auto alignment() const { return self().alignment(); }
  618. auto append(sTableViewColumn column) { return self().append(column), *this; }
  619. auto append(sTableViewItem item) { return self().append(item), *this; }
  620. auto backgroundColor() const { return self().backgroundColor(); }
  621. auto batchable() const { return self().batchable(); }
  622. auto batched() const { return self().batched(); }
  623. auto bordered() const { return self().bordered(); }
  624. auto column(uint position) const { return self().column(position); }
  625. auto columnCount() const { return self().columnCount(); }
  626. auto columns() const { return self().columns(); }
  627. auto doActivate(sTableViewCell cell) const { return self().doActivate(cell); }
  628. auto doChange() const { return self().doChange(); }
  629. auto doContext() const { return self().doContext(); }
  630. auto doEdit(sTableViewCell cell) const { return self().doEdit(cell); }
  631. auto doSort(sTableViewColumn column) const { return self().doSort(column); }
  632. auto doToggle(sTableViewCell cell) const { return self().doToggle(cell); }
  633. auto foregroundColor() const { return self().foregroundColor(); }
  634. auto headered() const { return self().headered(); }
  635. auto item(unsigned position) const { return self().item(position); }
  636. auto itemCount() const { return self().itemCount(); }
  637. auto items() const { return self().items(); }
  638. auto onActivate(const function<void (TableViewCell)>& callback = {}) { return self().onActivate(callback), *this; }
  639. auto onChange(const function<void ()>& callback = {}) { return self().onChange(callback), *this; }
  640. auto onContext(const function<void ()>& callback = {}) { return self().onContext(callback), *this; }
  641. auto onEdit(const function<void (TableViewCell)>& callback = {}) { return self().onEdit(callback), *this; }
  642. auto onSort(const function<void (TableViewColumn)>& callback = {}) { return self().onSort(callback), *this; }
  643. auto onToggle(const function<void (TableViewCell)>& callback = {}) { return self().onToggle(callback), *this; }
  644. auto remove(sTableViewColumn column) { return self().remove(column), *this; }
  645. auto remove(sTableViewItem item) { return self().remove(item), *this; }
  646. auto reset() { return self().reset(), *this; }
  647. auto resizeColumns() { return self().resizeColumns(), *this; }
  648. auto selectAll() { return self().selectAll(), *this; }
  649. auto selectNone() { return self().selectNone(), *this; }
  650. auto selected() const { return self().selected(); }
  651. auto setAlignment(Alignment alignment = {}) { return self().setAlignment(alignment), *this; }
  652. auto setBackgroundColor(Color color = {}) { return self().setBackgroundColor(color), *this; }
  653. auto setBatchable(bool batchable = true) { return self().setBatchable(batchable), *this; }
  654. auto setBordered(bool bordered = true) { return self().setBordered(bordered), *this; }
  655. auto setForegroundColor(Color color = {}) { return self().setForegroundColor(color), *this; }
  656. auto setHeadered(bool headered = true) { return self().setHeadered(headered), *this; }
  657. auto setSortable(bool sortable = true) { return self().setSortable(sortable), *this; }
  658. auto sort() { return self().sort(), *this; }
  659. auto sortable() const { return self().sortable(); }
  660. };
  661. #endif
  662. #if defined(Hiro_TextEdit)
  663. struct TextEdit : sTextEdit {
  664. DeclareSharedWidget(TextEdit)
  665. auto backgroundColor() const { return self().backgroundColor(); }
  666. auto doChange() const { return self().doChange(); }
  667. auto doMove() const { return self().doMove(); }
  668. auto editable() const { return self().editable(); }
  669. auto foregroundColor() const { return self().foregroundColor(); }
  670. auto onChange(const function<void ()>& callback = {}) { return self().onChange(callback), *this; }
  671. auto onMove(const function<void ()>& callback = {}) { return self().onMove(callback), *this; }
  672. auto setBackgroundColor(Color color = {}) { return self().setBackgroundColor(color), *this; }
  673. auto setEditable(bool editable = true) { return self().setEditable(editable), *this; }
  674. auto setForegroundColor(Color color = {}) { return self().setForegroundColor(color), *this; }
  675. auto setText(const string& text = "") { return self().setText(text), *this; }
  676. auto setTextCursor(TextCursor textCursor = {}) { return self().setTextCursor(textCursor), *this; }
  677. auto setWordWrap(bool wordWrap = true) { return self().setWordWrap(wordWrap), *this; }
  678. auto text() const { return self().text(); }
  679. auto textCursor() const { return self().textCursor(); }
  680. auto wordWrap() const { return self().wordWrap(); }
  681. };
  682. #endif
  683. #if defined(Hiro_TreeView)
  684. struct TreeViewItem : sTreeViewItem {
  685. DeclareSharedObject(TreeViewItem)
  686. auto append(sTreeViewItem item) { return self().append(item), *this; }
  687. auto backgroundColor() const { return self().backgroundColor(); }
  688. auto checkable() const { return self().checkable(); }
  689. auto checked() const { return self().checked(); }
  690. auto collapse(bool recursive = true) { return self().collapse(recursive), *this; }
  691. auto expand(bool recursive = true) { return self().expand(recursive), *this; }
  692. auto expanded() const { return self().expanded(); }
  693. auto foregroundColor() const { return self().foregroundColor(); }
  694. auto icon() const { return self().icon(); }
  695. auto item(const string& path) const { return self().item(path); }
  696. auto itemCount() const { return self().itemCount(); }
  697. auto items() const { return self().items(); }
  698. auto path() const { return self().path(); }
  699. auto remove(sTreeViewItem item) { return self().remove(item), *this; }
  700. auto selected() const { return self().selected(); }
  701. auto setBackgroundColor(Color color = {}) { return self().setBackgroundColor(color), *this; }
  702. auto setCheckable(bool checkable = true) { return self().setCheckable(checkable), *this; }
  703. auto setChecked(bool checked = true) { return self().setChecked(checked), *this; }
  704. auto setExpanded(bool expanded = true) { return self().setExpanded(expanded), *this; }
  705. auto setForegroundColor(Color color = {}) { return self().setForegroundColor(color), *this; }
  706. auto setIcon(const image& icon = {}) { return self().setIcon(icon), *this; }
  707. auto setSelected() { return self().setSelected(), *this; }
  708. auto setText(const string& text = "") { return self().setText(text), *this; }
  709. auto text() const { return self().text(); }
  710. };
  711. #endif
  712. #if defined(Hiro_TreeView)
  713. struct TreeView : sTreeView {
  714. DeclareSharedWidget(TreeView)
  715. auto activation() const { return self().activation(); }
  716. auto append(sTreeViewItem item) { return self().append(item), *this; }
  717. auto backgroundColor() const { return self().backgroundColor(); }
  718. auto collapse(bool recursive = true) { return self().collapse(recursive), *this; }
  719. auto doActivate() const { return self().doActivate(); }
  720. auto doChange() const { return self().doChange(); }
  721. auto doContext() const { return self().doContext(); }
  722. auto doToggle(sTreeViewItem item) const { return self().doToggle(item); }
  723. auto expand(bool recursive = true) { return self().expand(recursive), *this; }
  724. auto foregroundColor() const { return self().foregroundColor(); }
  725. auto item(const string& path) const { return self().item(path); }
  726. auto itemCount() const { return self().itemCount(); }
  727. auto items() const { return self().items(); }
  728. auto onActivate(const function<void ()>& callback = {}) { return self().onActivate(callback), *this; }
  729. auto onChange(const function<void ()>& callback = {}) { return self().onChange(callback), *this; }
  730. auto onContext(const function<void ()>& callback = {}) { return self().onContext(callback), *this; }
  731. auto onToggle(const function<void (sTreeViewItem)>& callback = {}) { return self().onToggle(callback), *this; }
  732. auto remove(sTreeViewItem item) { return self().remove(item), *this; }
  733. auto reset() { return self().reset(), *this; }
  734. auto selectNone() { return self().selectNone(), *this; }
  735. auto selected() const { return self().selected(); }
  736. auto setActivation(Mouse::Click activation = Mouse::Click::Double) { return self().setActivation(activation), *this; }
  737. auto setBackgroundColor(Color color = {}) { return self().setBackgroundColor(color), *this; }
  738. auto setForegroundColor(Color color = {}) { return self().setForegroundColor(color), *this; }
  739. };
  740. #endif
  741. #if defined(Hiro_VerticalScrollBar)
  742. struct VerticalScrollBar : sVerticalScrollBar {
  743. DeclareSharedWidget(VerticalScrollBar)
  744. auto doChange() const { return self().doChange(); }
  745. auto length() const { return self().length(); }
  746. auto onChange(const function<void ()>& callback = {}) { return self().onChange(callback), *this; }
  747. auto position() const { return self().position(); }
  748. auto setLength(unsigned length = 101) { return self().setLength(length), *this; }
  749. auto setPosition(unsigned position = 0) { return self().setPosition(position), *this; }
  750. };
  751. #endif
  752. #if defined(Hiro_VerticalSlider)
  753. struct VerticalSlider : sVerticalSlider {
  754. DeclareSharedWidget(VerticalSlider)
  755. auto doChange() const { return self().doChange(); }
  756. auto length() const { return self().length(); }
  757. auto onChange(const function<void ()>& callback = {}) { return self().onChange(callback), *this; }
  758. auto position() const { return self().position(); }
  759. auto setLength(unsigned length = 101) { return self().setLength(length), *this; }
  760. auto setPosition(unsigned position = 0) { return self().setPosition(position), *this; }
  761. };
  762. #endif
  763. #if defined(Hiro_Viewport)
  764. struct Viewport : sViewport {
  765. DeclareSharedWidget(Viewport)
  766. auto handle() const { return self().handle(); }
  767. };
  768. #endif
  769. #if defined(Hiro_StatusBar)
  770. struct StatusBar : sStatusBar {
  771. DeclareSharedObject(StatusBar)
  772. auto setText(const string& text = "") { return self().setText(text), *this; }
  773. auto text() const { return self().text(); }
  774. };
  775. #endif
  776. #if defined(Hiro_PopupMenu)
  777. struct PopupMenu : sPopupMenu {
  778. DeclareSharedObject(PopupMenu)
  779. auto action(unsigned position) const { return self().action(position); }
  780. auto actionCount() const { return self().actionCount(); }
  781. auto actions() const { return self().actions(); }
  782. auto append(sAction action) { return self().append(action), *this; }
  783. auto remove(sAction action) { return self().remove(action), *this; }
  784. auto reset() { return self().reset(), *this; }
  785. };
  786. #endif
  787. #if defined(Hiro_MenuBar)
  788. struct MenuBar : sMenuBar {
  789. DeclareSharedObject(MenuBar)
  790. auto append(sMenu menu) { return self().append(menu), *this; }
  791. auto menu(unsigned position) const { return self().menu(position); }
  792. auto menuCount() const { return self().menuCount(); }
  793. auto menus() const { return self().menus(); }
  794. auto remove(sMenu menu) { return self().remove(menu), *this; }
  795. auto reset() { return self().reset(), *this; }
  796. };
  797. #endif
  798. #if defined(Hiro_Window)
  799. struct Window : sWindow {
  800. DeclareSharedObject(Window)
  801. auto append(sMenuBar menuBar) { return self().append(menuBar), *this; }
  802. auto append(sSizable sizable) { return self().append(sizable), *this; }
  803. auto append(sStatusBar statusBar) { return self().append(statusBar), *this; }
  804. auto backgroundColor() const { return self().backgroundColor(); }
  805. auto dismissable() const { return self().dismissable(); }
  806. auto doClose() const { return self().doClose(); }
  807. auto doDrop(vector<string> names) const { return self().doDrop(names); }
  808. auto doKeyPress(signed key) const { return self().doKeyPress(key); }
  809. auto doKeyRelease(signed key) const { return self().doKeyRelease(key); }
  810. auto doMove() const { return self().doMove(); }
  811. auto doSize() const { return self().doSize(); }
  812. auto droppable() const { return self().droppable(); }
  813. auto frameGeometry() const { return self().frameGeometry(); }
  814. auto fullScreen() const { return self().fullScreen(); }
  815. auto geometry() const { return self().geometry(); }
  816. auto handle() const { return self().handle(); }
  817. auto maximized() const { return self().maximized(); }
  818. auto maximumSize() const { return self().maximumSize(); }
  819. auto menuBar() const { return self().menuBar(); }
  820. auto minimized() const { return self().minimized(); }
  821. auto minimumSize() const { return self().minimumSize(); }
  822. auto modal() const { return self().modal(); }
  823. auto monitor() const { return self().monitor(); }
  824. auto onClose(const function<void ()>& callback = {}) { return self().onClose(callback), *this; }
  825. auto onDrop(const function<void (vector<string>)>& callback = {}) { return self().onDrop(callback), *this; }
  826. auto onKeyPress(const function<void (signed)>& callback = {}) { return self().onKeyPress(callback), *this; }
  827. auto onKeyRelease(const function<void (signed)>& callback = {}) { return self().onKeyRelease(callback), *this; }
  828. auto onMove(const function<void ()>& callback = {}) { return self().onMove(callback), *this; }
  829. auto onSize(const function<void ()>& callback = {}) { return self().onSize(callback), *this; }
  830. auto remove(sMenuBar menuBar) { return self().remove(menuBar), *this; }
  831. auto remove(sSizable sizable) { return self().remove(sizable), *this; }
  832. auto remove(sStatusBar statusBar) { return self().remove(statusBar), *this; }
  833. auto reset() { return self().reset(), *this; }
  834. auto resizable() const { return self().resizable(); }
  835. auto setAlignment(Alignment alignment = Alignment::Center) { return self().setAlignment(alignment), *this; }
  836. auto setAlignment(sWindow relativeTo, Alignment alignment = Alignment::Center) { return self().setAlignment(relativeTo, alignment), *this; }
  837. auto setBackgroundColor(Color color = {}) { return self().setBackgroundColor(color), *this; }
  838. auto setDismissable(bool dismissable = true) { return self().setDismissable(dismissable), *this; }
  839. auto setDroppable(bool droppable = true) { return self().setDroppable(droppable), *this; }
  840. auto setFrameGeometry(Geometry geometry) { return self().setFrameGeometry(geometry), *this; }
  841. auto setFramePosition(Position position) { return self().setFramePosition(position), *this; }
  842. auto setFrameSize(Size size) { return self().setFrameSize(size), *this; }
  843. auto setFullScreen(bool fullScreen = true) { return self().setFullScreen(fullScreen), *this; }
  844. auto setGeometry(Geometry geometry) { return self().setGeometry(geometry), *this; }
  845. auto setGeometry(Alignment alignment, Size size) { return self().setGeometry(alignment, size), *this; }
  846. auto setMaximized(bool maximized) { return self().setMaximized(maximized), *this; }
  847. auto setMaximumSize(Size size = {}) { return self().setMaximumSize(size), *this; }
  848. auto setMinimized(bool minimized) { return self().setMinimized(minimized), *this; }
  849. auto setMinimumSize(Size size = {}) { return self().setMinimumSize(size), *this; }
  850. auto setModal(bool modal = true) { return self().setModal(modal), *this; }
  851. auto setPosition(Position position) { return self().setPosition(position), *this; }
  852. auto setPosition(sWindow relativeTo, Position position) { return self().setPosition(relativeTo, position), *this; }
  853. auto setResizable(bool resizable = true) { return self().setResizable(resizable), *this; }
  854. auto setSize(Size size) { return self().setSize(size), *this; }
  855. auto setTitle(const string& title = "") { return self().setTitle(title), *this; }
  856. auto sizable() const { return self().sizable(); }
  857. auto statusBar() const { return self().statusBar(); }
  858. auto title() const { return self().title(); }
  859. };
  860. #endif