Window.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // Window.cs
  6. //
  7. // Copyright 2015 Xamarin Inc. All rights reserved.
  8. using System;
  9. using System.Runtime.InteropServices;
  10. using System.Collections.Generic;
  11. using Urho.Urho2D;
  12. using Urho.Gui;
  13. using Urho.Resources;
  14. using Urho.IO;
  15. using Urho.Navigation;
  16. using Urho.Network;
  17. namespace Urho.Gui
  18. {
  19. /// <summary>
  20. /// %Window %UI element that can optionally by moved or resized.
  21. /// </summary>
  22. public unsafe partial class Window : BorderImage
  23. {
  24. public Window (IntPtr handle) : base (handle)
  25. {
  26. }
  27. protected Window (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  28. {
  29. }
  30. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  31. internal static extern int Window_GetType (IntPtr handle);
  32. private StringHash UrhoGetType ()
  33. {
  34. Runtime.ValidateRefCounted (this);
  35. return new StringHash (Window_GetType (handle));
  36. }
  37. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  38. internal static extern IntPtr Window_GetTypeName (IntPtr handle);
  39. private string GetTypeName ()
  40. {
  41. Runtime.ValidateRefCounted (this);
  42. return Marshal.PtrToStringAnsi (Window_GetTypeName (handle));
  43. }
  44. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  45. internal static extern int Window_GetTypeStatic ();
  46. private static StringHash GetTypeStatic ()
  47. {
  48. Runtime.Validate (typeof(Window));
  49. return new StringHash (Window_GetTypeStatic ());
  50. }
  51. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  52. internal static extern IntPtr Window_GetTypeNameStatic ();
  53. private static string GetTypeNameStatic ()
  54. {
  55. Runtime.Validate (typeof(Window));
  56. return Marshal.PtrToStringAnsi (Window_GetTypeNameStatic ());
  57. }
  58. public Window () : this (Application.CurrentContext)
  59. {
  60. }
  61. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  62. internal static extern IntPtr Window_Window (IntPtr context);
  63. public Window (Context context) : base (UrhoObjectFlag.Empty)
  64. {
  65. Runtime.Validate (typeof(Window));
  66. handle = Window_Window ((object)context == null ? IntPtr.Zero : context.Handle);
  67. Runtime.RegisterObject (this);
  68. }
  69. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  70. internal static extern void Window_RegisterObject (IntPtr context);
  71. /// <summary>
  72. /// Register object factory.
  73. /// </summary>
  74. public new static void RegisterObject (Context context)
  75. {
  76. Runtime.Validate (typeof(Window));
  77. Window_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
  78. }
  79. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  80. internal static extern void Window_OnHover (IntPtr handle, ref Urho.IntVector2 position, ref Urho.IntVector2 screenPosition, int buttons, int qualifiers, IntPtr cursor);
  81. /// <summary>
  82. /// React to mouse hover.
  83. /// </summary>
  84. public override void OnHover (Urho.IntVector2 position, Urho.IntVector2 screenPosition, int buttons, int qualifiers, Cursor cursor)
  85. {
  86. Runtime.ValidateRefCounted (this);
  87. Window_OnHover (handle, ref position, ref screenPosition, buttons, qualifiers, (object)cursor == null ? IntPtr.Zero : cursor.Handle);
  88. }
  89. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  90. internal static extern void Window_SetMovable (IntPtr handle, bool enable);
  91. /// <summary>
  92. /// Set whether can be moved.
  93. /// </summary>
  94. private void SetMovable (bool enable)
  95. {
  96. Runtime.ValidateRefCounted (this);
  97. Window_SetMovable (handle, enable);
  98. }
  99. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  100. internal static extern void Window_SetResizable (IntPtr handle, bool enable);
  101. /// <summary>
  102. /// Set whether can be resized.
  103. /// </summary>
  104. private void SetResizable (bool enable)
  105. {
  106. Runtime.ValidateRefCounted (this);
  107. Window_SetResizable (handle, enable);
  108. }
  109. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  110. internal static extern void Window_SetFixedWidthResizing (IntPtr handle, bool enable);
  111. /// <summary>
  112. /// Set whether resizing width is fixed.
  113. /// </summary>
  114. private void SetFixedWidthResizing (bool enable)
  115. {
  116. Runtime.ValidateRefCounted (this);
  117. Window_SetFixedWidthResizing (handle, enable);
  118. }
  119. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  120. internal static extern void Window_SetFixedHeightResizing (IntPtr handle, bool enable);
  121. /// <summary>
  122. /// Set whether resizing height is fixed.
  123. /// </summary>
  124. private void SetFixedHeightResizing (bool enable)
  125. {
  126. Runtime.ValidateRefCounted (this);
  127. Window_SetFixedHeightResizing (handle, enable);
  128. }
  129. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  130. internal static extern void Window_SetResizeBorder (IntPtr handle, ref Urho.IntRect rect);
  131. /// <summary>
  132. /// Set resize area width at edges.
  133. /// </summary>
  134. private void SetResizeBorder (Urho.IntRect rect)
  135. {
  136. Runtime.ValidateRefCounted (this);
  137. Window_SetResizeBorder (handle, ref rect);
  138. }
  139. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  140. internal static extern void Window_SetModal (IntPtr handle, bool modal);
  141. /// <summary>
  142. /// Set modal flag. When the modal flag is set, the focused window needs to be dismissed first to allow other UI elements to gain focus.
  143. /// </summary>
  144. private void SetModal (bool modal)
  145. {
  146. Runtime.ValidateRefCounted (this);
  147. Window_SetModal (handle, modal);
  148. }
  149. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  150. internal static extern void Window_SetModalShadeColor (IntPtr handle, ref Urho.Color color);
  151. /// <summary>
  152. /// Set modal shade color.
  153. /// </summary>
  154. private void SetModalShadeColor (Urho.Color color)
  155. {
  156. Runtime.ValidateRefCounted (this);
  157. Window_SetModalShadeColor (handle, ref color);
  158. }
  159. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  160. internal static extern void Window_SetModalFrameColor (IntPtr handle, ref Urho.Color color);
  161. /// <summary>
  162. /// Set modal frame color.
  163. /// </summary>
  164. private void SetModalFrameColor (Urho.Color color)
  165. {
  166. Runtime.ValidateRefCounted (this);
  167. Window_SetModalFrameColor (handle, ref color);
  168. }
  169. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  170. internal static extern void Window_SetModalFrameSize (IntPtr handle, ref Urho.IntVector2 size);
  171. /// <summary>
  172. /// Set modal frame size.
  173. /// </summary>
  174. private void SetModalFrameSize (Urho.IntVector2 size)
  175. {
  176. Runtime.ValidateRefCounted (this);
  177. Window_SetModalFrameSize (handle, ref size);
  178. }
  179. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  180. internal static extern void Window_SetModalAutoDismiss (IntPtr handle, bool enable);
  181. /// <summary>
  182. /// Set whether model window can be dismissed with the escape key. Default true.
  183. /// </summary>
  184. private void SetModalAutoDismiss (bool enable)
  185. {
  186. Runtime.ValidateRefCounted (this);
  187. Window_SetModalAutoDismiss (handle, enable);
  188. }
  189. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  190. internal static extern bool Window_IsMovable (IntPtr handle);
  191. /// <summary>
  192. /// Return whether is movable.
  193. /// </summary>
  194. private bool IsMovable ()
  195. {
  196. Runtime.ValidateRefCounted (this);
  197. return Window_IsMovable (handle);
  198. }
  199. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  200. internal static extern bool Window_IsResizable (IntPtr handle);
  201. /// <summary>
  202. /// Return whether is resizable.
  203. /// </summary>
  204. private bool IsResizable ()
  205. {
  206. Runtime.ValidateRefCounted (this);
  207. return Window_IsResizable (handle);
  208. }
  209. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  210. internal static extern bool Window_GetFixedWidthResizing (IntPtr handle);
  211. /// <summary>
  212. /// Return whether is resizing width is fixed.
  213. /// </summary>
  214. private bool GetFixedWidthResizing ()
  215. {
  216. Runtime.ValidateRefCounted (this);
  217. return Window_GetFixedWidthResizing (handle);
  218. }
  219. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  220. internal static extern bool Window_GetFixedHeightResizing (IntPtr handle);
  221. /// <summary>
  222. /// Return whether is resizing height is fixed.
  223. /// </summary>
  224. private bool GetFixedHeightResizing ()
  225. {
  226. Runtime.ValidateRefCounted (this);
  227. return Window_GetFixedHeightResizing (handle);
  228. }
  229. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  230. internal static extern Urho.IntRect Window_GetResizeBorder (IntPtr handle);
  231. /// <summary>
  232. /// Return resize area width at edges.
  233. /// </summary>
  234. private Urho.IntRect GetResizeBorder ()
  235. {
  236. Runtime.ValidateRefCounted (this);
  237. return Window_GetResizeBorder (handle);
  238. }
  239. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  240. internal static extern bool Window_IsModal (IntPtr handle);
  241. /// <summary>
  242. /// Return modal flag.
  243. /// </summary>
  244. private bool IsModal ()
  245. {
  246. Runtime.ValidateRefCounted (this);
  247. return Window_IsModal (handle);
  248. }
  249. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  250. internal static extern Urho.Color Window_GetModalShadeColor (IntPtr handle);
  251. /// <summary>
  252. /// Get modal shade color.
  253. /// </summary>
  254. private Urho.Color GetModalShadeColor ()
  255. {
  256. Runtime.ValidateRefCounted (this);
  257. return Window_GetModalShadeColor (handle);
  258. }
  259. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  260. internal static extern Urho.Color Window_GetModalFrameColor (IntPtr handle);
  261. /// <summary>
  262. /// Get modal frame color.
  263. /// </summary>
  264. private Urho.Color GetModalFrameColor ()
  265. {
  266. Runtime.ValidateRefCounted (this);
  267. return Window_GetModalFrameColor (handle);
  268. }
  269. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  270. internal static extern Urho.IntVector2 Window_GetModalFrameSize (IntPtr handle);
  271. /// <summary>
  272. /// Get modal frame size.
  273. /// </summary>
  274. private Urho.IntVector2 GetModalFrameSize ()
  275. {
  276. Runtime.ValidateRefCounted (this);
  277. return Window_GetModalFrameSize (handle);
  278. }
  279. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  280. internal static extern bool Window_GetModalAutoDismiss (IntPtr handle);
  281. /// <summary>
  282. /// Return whether can be dismissed with escape key.
  283. /// </summary>
  284. private bool GetModalAutoDismiss ()
  285. {
  286. Runtime.ValidateRefCounted (this);
  287. return Window_GetModalAutoDismiss (handle);
  288. }
  289. public override StringHash Type {
  290. get {
  291. return UrhoGetType ();
  292. }
  293. }
  294. public override string TypeName {
  295. get {
  296. return GetTypeName ();
  297. }
  298. }
  299. public new static StringHash TypeStatic {
  300. get {
  301. return GetTypeStatic ();
  302. }
  303. }
  304. public new static string TypeNameStatic {
  305. get {
  306. return GetTypeNameStatic ();
  307. }
  308. }
  309. /// <summary>
  310. /// Return whether is movable.
  311. /// Or
  312. /// Set whether can be moved.
  313. /// </summary>
  314. public bool Movable {
  315. get {
  316. return IsMovable ();
  317. }
  318. set {
  319. SetMovable (value);
  320. }
  321. }
  322. /// <summary>
  323. /// Return whether is resizable.
  324. /// Or
  325. /// Set whether can be resized.
  326. /// </summary>
  327. public bool Resizable {
  328. get {
  329. return IsResizable ();
  330. }
  331. set {
  332. SetResizable (value);
  333. }
  334. }
  335. /// <summary>
  336. /// Return whether is resizing width is fixed.
  337. /// Or
  338. /// Set whether resizing width is fixed.
  339. /// </summary>
  340. public bool FixedWidthResizing {
  341. get {
  342. return GetFixedWidthResizing ();
  343. }
  344. set {
  345. SetFixedWidthResizing (value);
  346. }
  347. }
  348. /// <summary>
  349. /// Return whether is resizing height is fixed.
  350. /// Or
  351. /// Set whether resizing height is fixed.
  352. /// </summary>
  353. public bool FixedHeightResizing {
  354. get {
  355. return GetFixedHeightResizing ();
  356. }
  357. set {
  358. SetFixedHeightResizing (value);
  359. }
  360. }
  361. /// <summary>
  362. /// Return resize area width at edges.
  363. /// Or
  364. /// Set resize area width at edges.
  365. /// </summary>
  366. public Urho.IntRect ResizeBorder {
  367. get {
  368. return GetResizeBorder ();
  369. }
  370. set {
  371. SetResizeBorder (value);
  372. }
  373. }
  374. /// <summary>
  375. /// Return modal flag.
  376. /// Or
  377. /// Set modal flag. When the modal flag is set, the focused window needs to be dismissed first to allow other UI elements to gain focus.
  378. /// </summary>
  379. public bool Modal {
  380. get {
  381. return IsModal ();
  382. }
  383. set {
  384. SetModal (value);
  385. }
  386. }
  387. /// <summary>
  388. /// Get modal shade color.
  389. /// Or
  390. /// Set modal shade color.
  391. /// </summary>
  392. public Urho.Color ModalShadeColor {
  393. get {
  394. return GetModalShadeColor ();
  395. }
  396. set {
  397. SetModalShadeColor (value);
  398. }
  399. }
  400. /// <summary>
  401. /// Get modal frame color.
  402. /// Or
  403. /// Set modal frame color.
  404. /// </summary>
  405. public Urho.Color ModalFrameColor {
  406. get {
  407. return GetModalFrameColor ();
  408. }
  409. set {
  410. SetModalFrameColor (value);
  411. }
  412. }
  413. /// <summary>
  414. /// Get modal frame size.
  415. /// Or
  416. /// Set modal frame size.
  417. /// </summary>
  418. public Urho.IntVector2 ModalFrameSize {
  419. get {
  420. return GetModalFrameSize ();
  421. }
  422. set {
  423. SetModalFrameSize (value);
  424. }
  425. }
  426. /// <summary>
  427. /// Return whether can be dismissed with escape key.
  428. /// Or
  429. /// Set whether model window can be dismissed with the escape key. Default true.
  430. /// </summary>
  431. public bool ModalAutoDismiss {
  432. get {
  433. return GetModalAutoDismiss ();
  434. }
  435. set {
  436. SetModalAutoDismiss (value);
  437. }
  438. }
  439. }
  440. }