BsScriptGUIElementStyle.h 6.7 KB

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