Window.cs 14 KB

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