BsScriptGUIElementStyle.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. #pragma once
  2. #include "BsScriptEnginePrerequisites.h"
  3. #include "BsScriptObject.h"
  4. #include "BsGUIElementStyle.h"
  5. #include "BsMonoClass.h"
  6. #include "BsScriptGUIElementStateStyle.h"
  7. #include "BsScriptFont.h"
  8. namespace BansheeEngine
  9. {
  10. /**
  11. * @brief Interop class between C++ & CLR for GUIElementStyle.
  12. */
  13. class BS_SCR_BE_EXPORT ScriptGUIElementStyle : public ScriptObject<ScriptGUIElementStyle>
  14. {
  15. public:
  16. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUIElementStyle")
  17. ~ScriptGUIElementStyle();
  18. /**
  19. * @brief Returns the wrapped GUIElementStyle instance.
  20. */
  21. GUIElementStyle& getInternalValue() { return mElementStyle; }
  22. /**
  23. * @brief Creates a new managed object containing a copy of the provided style.
  24. */
  25. static MonoObject* create(const String& name, const GUIElementStyle& style);
  26. private:
  27. /**
  28. * @brief Creates the interop object with a default style.
  29. */
  30. ScriptGUIElementStyle(MonoObject* instance, const String& name);
  31. /**
  32. * @brief Creates the interop object referencing an existing style.
  33. */
  34. ScriptGUIElementStyle(MonoObject* instance, const String& name, const GUIElementStyle& externalStyle);
  35. String mName;
  36. GUIElementStyle mElementStyle;
  37. ScriptFont* mFont;
  38. ScriptGUIElementStateStyle* mNormal;
  39. ScriptGUIElementStateStyle* mHover;
  40. ScriptGUIElementStateStyle* mActive;
  41. ScriptGUIElementStateStyle* mFocused;
  42. ScriptGUIElementStateStyle* mNormalOn;
  43. ScriptGUIElementStateStyle* mHoverOn;
  44. ScriptGUIElementStateStyle* mActiveOn;
  45. ScriptGUIElementStateStyle* mFocusedOn;
  46. /************************************************************************/
  47. /* CLR HOOKS */
  48. /************************************************************************/
  49. static void internal_createInstance(MonoObject* instance, MonoString* name);
  50. static void internal_addSubStyle(ScriptGUIElementStyle* nativeInstance, MonoString* guiType, MonoString* styleName);
  51. static void internal_GetFont(ScriptGUIElementStyle* nativeInstance, MonoObject** value);
  52. static void internal_SetFont(ScriptGUIElementStyle* nativeInstance, MonoObject* value);
  53. static void internal_GetFontSize(ScriptGUIElementStyle* nativeInstance, UINT32* value);
  54. static void internal_SetFontSize(ScriptGUIElementStyle* nativeInstance, UINT32 value);
  55. static void internal_GetTextHorzAlign(ScriptGUIElementStyle* nativeInstance, TextHorzAlign*value);
  56. static void internal_SetTextHorzAlign(ScriptGUIElementStyle* nativeInstance, TextHorzAlign value);
  57. static void internal_GetTextVertAlign(ScriptGUIElementStyle* nativeInstance, TextVertAlign* value);
  58. static void internal_SetTextVertAlign(ScriptGUIElementStyle* nativeInstance, TextVertAlign value);
  59. static void internal_GetImagePosition(ScriptGUIElementStyle* nativeInstance, GUIImagePosition* value);
  60. static void internal_SetImagePosition(ScriptGUIElementStyle* nativeInstance, GUIImagePosition value);
  61. static void internal_GetWordWrap(ScriptGUIElementStyle* nativeInstance, bool* value);
  62. static void internal_SetWordWrap(ScriptGUIElementStyle* nativeInstance, bool value);
  63. static void internal_GetNormal(ScriptGUIElementStyle* nativeInstance, MonoObject** value);
  64. static void internal_SetNormal(ScriptGUIElementStyle* nativeInstance, MonoObject* value);
  65. static void internal_GetHover(ScriptGUIElementStyle* nativeInstance, MonoObject** value);
  66. static void internal_SetHover(ScriptGUIElementStyle* nativeInstance, MonoObject* value);
  67. static void internal_GetActive(ScriptGUIElementStyle* nativeInstance, MonoObject** value);
  68. static void internal_SetActive(ScriptGUIElementStyle* nativeInstance, MonoObject* value);
  69. static void internal_GetFocused(ScriptGUIElementStyle* nativeInstance, MonoObject** value);
  70. static void internal_SetFocused(ScriptGUIElementStyle* nativeInstance, MonoObject* value);
  71. static void internal_GetNormalOn(ScriptGUIElementStyle* nativeInstance, MonoObject** value);
  72. static void internal_SetNormalOn(ScriptGUIElementStyle* nativeInstance, MonoObject* value);
  73. static void internal_GetHoverOn(ScriptGUIElementStyle* nativeInstance, MonoObject** value);
  74. static void internal_SetHoverOn(ScriptGUIElementStyle* nativeInstance, MonoObject* value);
  75. static void internal_GetActiveOn(ScriptGUIElementStyle* nativeInstance, MonoObject** value);
  76. static void internal_SetActiveOn(ScriptGUIElementStyle* nativeInstance, MonoObject* value);
  77. static void internal_GetFocusedOn(ScriptGUIElementStyle* nativeInstance, MonoObject** value);
  78. static void internal_SetFocusedOn(ScriptGUIElementStyle* nativeInstance, MonoObject* value);
  79. static void internal_GetBorder(ScriptGUIElementStyle* nativeInstance, RectOffset* value);
  80. static void internal_SetBorder(ScriptGUIElementStyle* nativeInstance, RectOffset* value);
  81. static void internal_GetMargins(ScriptGUIElementStyle* nativeInstance, RectOffset* value);
  82. static void internal_SetMargins(ScriptGUIElementStyle* nativeInstance, RectOffset* value);
  83. static void internal_GetContentOffset(ScriptGUIElementStyle* nativeInstance, RectOffset* value);
  84. static void internal_SetContentOffset(ScriptGUIElementStyle* nativeInstance, RectOffset* value);
  85. static void internal_GetWidth(ScriptGUIElementStyle* nativeInstance, UINT32* value);
  86. static void internal_SetWidth(ScriptGUIElementStyle* nativeInstance, UINT32 value);
  87. static void internal_GetHeight(ScriptGUIElementStyle* nativeInstance, UINT32* value);
  88. static void internal_SetHeight(ScriptGUIElementStyle* nativeInstance, UINT32 value);
  89. static void internal_GetMinWidth(ScriptGUIElementStyle* nativeInstance, UINT32* value);
  90. static void internal_SetMinWidth(ScriptGUIElementStyle* nativeInstance, UINT32 value);
  91. static void internal_GetMaxWidth(ScriptGUIElementStyle* nativeInstance, UINT32* value);
  92. static void internal_SetMaxWidth(ScriptGUIElementStyle* nativeInstance, UINT32 value);
  93. static void internal_GetMinHeight(ScriptGUIElementStyle* nativeInstance, UINT32* value);
  94. static void internal_SetMinHeight(ScriptGUIElementStyle* nativeInstance, UINT32 value);
  95. static void internal_GetMaxHeight(ScriptGUIElementStyle* nativeInstance, UINT32* value);
  96. static void internal_SetMaxHeight(ScriptGUIElementStyle* nativeInstance, UINT32 value);
  97. static void internal_GetFixedWidth(ScriptGUIElementStyle* nativeInstance, bool* value);
  98. static void internal_SetFixedWidth(ScriptGUIElementStyle* nativeInstance, bool value);
  99. static void internal_GetFixedHeight(ScriptGUIElementStyle* nativeInstance, bool* value);
  100. static void internal_SetFixedHeight(ScriptGUIElementStyle* nativeInstance, bool value);
  101. };
  102. }