GUIArea.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. namespace BansheeEngine
  4. {
  5. public sealed class GUIArea : ScriptObject
  6. {
  7. private GUILayout _layout;
  8. public GUILayout layout
  9. {
  10. get { return _layout;}
  11. }
  12. internal GUIArea()
  13. { }
  14. internal static GUIArea Create(GUIBase parent, int x, int y, int width, int height, short depth)
  15. {
  16. GUIArea newArea = new GUIArea();
  17. Internal_CreateInstance(newArea, parent, x, y, width, height, depth);
  18. newArea._layout = new GUILayoutX(newArea);
  19. return newArea;
  20. }
  21. internal static GUIArea CreateResizableX(GUIBase parent, int offsetLeft, int offsetRight, int offsetTop, int height, short depth)
  22. {
  23. GUIArea newArea = new GUIArea();
  24. Internal_CreateInstanceResizableX(newArea, parent, offsetLeft, offsetRight, offsetTop, height, depth);
  25. newArea._layout = new GUILayoutX(newArea);
  26. return newArea;
  27. }
  28. internal static GUIArea CreateResizableY(GUIBase parent, int offsetTop, int offsetBottom, int offsetLeft, int width, short depth)
  29. {
  30. GUIArea newArea = new GUIArea();
  31. Internal_CreateInstanceResizableY(newArea, parent, offsetTop, offsetBottom, offsetLeft, width, depth);
  32. newArea._layout = new GUILayoutX(newArea);
  33. return newArea;
  34. }
  35. internal static GUIArea CreateResizableXY(GUIBase parent, int offsetLeft, int offsetRight, int offsetTop, int offsetBottom, short depth)
  36. {
  37. GUIArea newArea = new GUIArea();
  38. Internal_CreateInstanceResizableXY(newArea, parent, offsetLeft, offsetRight, offsetTop, offsetBottom, depth);
  39. newArea._layout = new GUILayoutX(newArea);
  40. return newArea;
  41. }
  42. public void Destroy()
  43. {
  44. Internal_Destroy(mCachedPtr);
  45. }
  46. public void Enable()
  47. {
  48. Internal_Enable(mCachedPtr);
  49. }
  50. public void Disable()
  51. {
  52. Internal_Disable(mCachedPtr);
  53. }
  54. [MethodImpl(MethodImplOptions.InternalCall)]
  55. private static extern void Internal_CreateInstance(GUIArea instance, GUIBase parent, int x, int y, int width, int height, short depth);
  56. [MethodImpl(MethodImplOptions.InternalCall)]
  57. private static extern void Internal_CreateInstanceResizableX(GUIArea instance, GUIBase parent, int offsetLeft, int offsetRight, int offsetTop,
  58. int height, short depth);
  59. [MethodImpl(MethodImplOptions.InternalCall)]
  60. private static extern void Internal_CreateInstanceResizableY(GUIArea instance, GUIBase parent, int offsetTop, int offsetBottom, int offsetLeft,
  61. int width, short depth);
  62. [MethodImpl(MethodImplOptions.InternalCall)]
  63. private static extern void Internal_CreateInstanceResizableXY(GUIArea instance, GUIBase parent, int offsetLeft, int offsetRight, int offsetTop,
  64. int offsetBottom, short depth);
  65. [MethodImpl(MethodImplOptions.InternalCall)]
  66. private static extern void Internal_Destroy(IntPtr nativeInstance);
  67. [MethodImpl(MethodImplOptions.InternalCall)]
  68. private static extern void Internal_Enable(IntPtr nativeInstance);
  69. [MethodImpl(MethodImplOptions.InternalCall)]
  70. private static extern void Internal_Disable(IntPtr nativeInstance);
  71. }
  72. }