Marko Pintera 10 lat temu
rodzic
commit
9565409788

+ 25 - 4
SBansheeEngine/Include/BsScriptGUIButton.h

@@ -6,22 +6,43 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for GUIButton.
+	 */
 	class BS_SCR_BE_EXPORT ScriptGUIButton : public TScriptGUIElement<ScriptGUIButton>
 	class BS_SCR_BE_EXPORT ScriptGUIButton : public TScriptGUIElement<ScriptGUIButton>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUIButton")
 		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUIButton")
 
 
 	private:
 	private:
-		static void internal_createInstance(MonoObject* instance, MonoObject* content, MonoString* style, MonoArray* guiOptions);
-		static void internal_setContent(ScriptGUIButton* nativeInstance, MonoObject* content);
-		static void internal_setTint(ScriptGUIButton* nativeInstance, Color color);
+		ScriptGUIButton(MonoObject* instance, GUIButton* button);
 
 
+		/**
+		 * @brief	Triggers when the GUI button is clicked.
+		 */
 		static void onClick(MonoObject* instance);
 		static void onClick(MonoObject* instance);
+
+		/**
+		 * @brief	Triggers when the GUI button is double-clicked.
+		 */
 		static void onDoubleClick(MonoObject* instance);
 		static void onDoubleClick(MonoObject* instance);
+
+		/**
+		 * @brief	Triggers when the GUI button is hovered over.
+		 */
 		static void onHover(MonoObject* instance);
 		static void onHover(MonoObject* instance);
+
+		/**
+		 * @brief	Triggers when the pointer leaves the GUI button.
+		 */
 		static void onOut(MonoObject* instance);
 		static void onOut(MonoObject* instance);
 
 
-		ScriptGUIButton(MonoObject* instance, GUIButton* button);
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_createInstance(MonoObject* instance, MonoObject* content, MonoString* style, MonoArray* guiOptions);
+		static void internal_setContent(ScriptGUIButton* nativeInstance, MonoObject* content);
+		static void internal_setTint(ScriptGUIButton* nativeInstance, Color color);
 
 
 		typedef void (__stdcall *OnClickThunkDef) (MonoObject*, MonoException**);
 		typedef void (__stdcall *OnClickThunkDef) (MonoObject*, MonoException**);
 		typedef void (__stdcall *OnDoubleClickThunkDef) (MonoObject*, MonoException**);
 		typedef void (__stdcall *OnDoubleClickThunkDef) (MonoObject*, MonoException**);

+ 16 - 2
SBansheeEngine/Include/BsScriptGUIContent.h

@@ -5,20 +5,34 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for GUIContent.
+	 */
 	class BS_SCR_BE_EXPORT ScriptGUIContent : public ScriptObject<ScriptGUIContent>
 	class BS_SCR_BE_EXPORT ScriptGUIContent : public ScriptObject<ScriptGUIContent>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUIContent")
 		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUIContent")
 
 
+		/**
+		 * @brief	Retrieves the title text in a managed GUIContent instance.
+		 */
 		static const HString& getText(MonoObject* instance);
 		static const HString& getText(MonoObject* instance);
+
+		/**
+		 * @brief	Retrieves the tooltip text in a managed GUIContent instance.
+		 */
 		static const HString& getTooltip(MonoObject* instance);
 		static const HString& getTooltip(MonoObject* instance);
+
+		/**
+		 * @brief	Retrieves the content image in a managed GUIContent instance.
+		 */
 		static HSpriteTexture getImage(MonoObject* instance);
 		static HSpriteTexture getImage(MonoObject* instance);
 
 
 	private:
 	private:
+		ScriptGUIContent(MonoObject* instance);
+
 		static MonoField* mTextField;
 		static MonoField* mTextField;
 		static MonoField* mTooltipField;
 		static MonoField* mTooltipField;
 		static MonoField* mImageField;
 		static MonoField* mImageField;
-
-		ScriptGUIContent(MonoObject* instance);
 	};
 	};
 }
 }

+ 63 - 2
SBansheeEngine/Include/BsScriptGUIElement.h

@@ -7,24 +7,56 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for all elements inheriting from
+	 *			GUIElementBase.
+	 */
 	class BS_SCR_BE_EXPORT ScriptGUIElementBaseTBase : public ScriptObjectBase
 	class BS_SCR_BE_EXPORT ScriptGUIElementBaseTBase : public ScriptObjectBase
 	{
 	{
 	public:
 	public:
 		ScriptGUIElementBaseTBase(MonoObject* instance);
 		ScriptGUIElementBaseTBase(MonoObject* instance);
 		virtual ~ScriptGUIElementBaseTBase() {}
 		virtual ~ScriptGUIElementBaseTBase() {}
 
 
+		/**
+		 * @brief	Returns the underlying GUIElementBase wrapped by this object.
+		 */
 		GUIElementBase* getGUIElement() const { return (GUIElementBase*)mElement; }
 		GUIElementBase* getGUIElement() const { return (GUIElementBase*)mElement; }
 
 
+		/**
+		 * @brief	Destroys the underlying GUIElementBase.
+		 */
 		virtual void destroy() = 0;
 		virtual void destroy() = 0;
+
+		/**
+		 * @brief	Checks have we destroyed the underlying GUIElementBase.
+		 */
 		bool isDestroyed() const { return mIsDestroyed; }
 		bool isDestroyed() const { return mIsDestroyed; }
+
+		/**
+		 * @brief	Returns the parent interop object for a GUI layout or a GUI panel.
+		 */
 		ScriptGUILayout* getParent() const { return mParent; }
 		ScriptGUILayout* getParent() const { return mParent; }
+
+		/**
+		 * @brief	Sets an interop object for a GUI layout or a panel as this object's parent.
+		 */
 		void setParent(ScriptGUILayout* parent) { mParent = parent; }
 		void setParent(ScriptGUILayout* parent) { mParent = parent; }
 
 
 	protected:
 	protected:
+		/**
+		 * @brief	Initializes the interop object with a previously initialized GUI
+		 *			element. You must call this before using this object.
+		 */
 		void initialize(GUIElementBase* element);
 		void initialize(GUIElementBase* element);
 
 
+		/**
+		 * @copydoc	ScriptObjectBase::_onManagedInstanceDeleted
+		 */
 		virtual void _onManagedInstanceDeleted() override;
 		virtual void _onManagedInstanceDeleted() override;
 
 
+		/**
+		 * @brief	Triggered when the focus changes for the underlying GUIElementBase.
+		 */
 		static void onFocusChanged(MonoObject* instance, bool focus);
 		static void onFocusChanged(MonoObject* instance, bool focus);
 
 
 		bool mIsDestroyed;
 		bool mIsDestroyed;
@@ -32,6 +64,10 @@ namespace BansheeEngine
 		ScriptGUILayout* mParent;
 		ScriptGUILayout* mParent;
 	};
 	};
 
 
+	/**
+	 * @brief	A more specialized implementation of ScriptGUIElementBaseTBase that
+	 *			references a specific GUI element type instead of the generic GUIElementBase.
+	 */
 	template <class Type>
 	template <class Type>
 	class TScriptGUIElementBase : public ScriptObject<Type, ScriptGUIElementBaseTBase>
 	class TScriptGUIElementBase : public ScriptObject<Type, ScriptGUIElementBaseTBase>
 	{
 	{
@@ -45,6 +81,9 @@ namespace BansheeEngine
 			initialize(element);
 			initialize(element);
 		}
 		}
 
 
+		/**
+		 * @copydoc	ScriptObjectBase::_onManagedInstanceDeleted
+		 */
 		void _onManagedInstanceDeleted()
 		void _onManagedInstanceDeleted()
 		{
 		{
 			// Elements with a GUIWidget parent are destroyed automatically when widget is destroyed, but those without one
 			// Elements with a GUIWidget parent are destroyed automatically when widget is destroyed, but those without one
@@ -56,15 +95,26 @@ namespace BansheeEngine
 		}
 		}
 	};
 	};
 
 
+	/**
+	 * @brief	Interop class between C++ & CLR for all elements inheriting from
+	 *			GUIElement.
+	 */
 	class BS_SCR_BE_EXPORT ScriptGUIElementTBase : public ScriptGUIElementBaseTBase
 	class BS_SCR_BE_EXPORT ScriptGUIElementTBase : public ScriptGUIElementBaseTBase
 	{
 	{
 	public:
 	public:
 		ScriptGUIElementTBase(MonoObject* instance);
 		ScriptGUIElementTBase(MonoObject* instance);
 		virtual ~ScriptGUIElementTBase() {}
 		virtual ~ScriptGUIElementTBase() {}
 
 
+		/**
+		 * @copydoc	ScriptGUIElementBaseTBase::destroy
+		 */
 		virtual void destroy() override;
 		virtual void destroy() override;
 	};
 	};
 
 
+	/**
+	 * @brief	A more specialized implementation of ScriptGUIElementTBase that
+	 *			references a specific GUI element type instead of the generic GUIElement.
+	 */
 	template <class Type>
 	template <class Type>
 	class TScriptGUIElement : public ScriptObject<Type, ScriptGUIElementTBase>
 	class TScriptGUIElement : public ScriptObject<Type, ScriptGUIElementTBase>
 	{
 	{
@@ -78,6 +128,9 @@ namespace BansheeEngine
 			initialize(element);
 			initialize(element);
 		}
 		}
 
 
+		/**
+		 * @copydoc	ScriptObjectBase::_onManagedInstanceDeleted
+		 */
 		void _onManagedInstanceDeleted()
 		void _onManagedInstanceDeleted()
 		{
 		{
 			// Elements with a GUIWidget parent are destroyed automatically when widget is destroyed, but those without one
 			// Elements with a GUIWidget parent are destroyed automatically when widget is destroyed, but those without one
@@ -89,6 +142,11 @@ namespace BansheeEngine
 		}
 		}
 	};
 	};
 
 
+	/**
+	 * @brief	Interop class between C++ & CLR for GUIElement. This includes only base
+	 *			methods belonging directly to GUIElement while specific GUI element 
+	 *			implementations have their own interop classes.
+	 */
 	class BS_SCR_BE_EXPORT ScriptGUIElement : public ScriptObject<ScriptGUIElement>
 	class BS_SCR_BE_EXPORT ScriptGUIElement : public ScriptObject<ScriptGUIElement>
 	{
 	{
 	public:
 	public:
@@ -99,6 +157,11 @@ namespace BansheeEngine
 		static OnFocusChangedThunkDef onFocusChangedThunk;
 		static OnFocusChangedThunkDef onFocusChangedThunk;
 
 
 	private:
 	private:
+		ScriptGUIElement(MonoObject* instance);
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
 		static void internal_destroy(ScriptGUIElementBaseTBase* nativeInstance);
 		static void internal_destroy(ScriptGUIElementBaseTBase* nativeInstance);
 		static void internal_setVisible(ScriptGUIElementBaseTBase* nativeInstance, bool visible);
 		static void internal_setVisible(ScriptGUIElementBaseTBase* nativeInstance, bool visible);
 		static void internal_setFocus(ScriptGUIElementBaseTBase* nativeInstance, bool focus);
 		static void internal_setFocus(ScriptGUIElementBaseTBase* nativeInstance, bool focus);
@@ -112,7 +175,5 @@ namespace BansheeEngine
 		static void internal_SetFlexibleHeight(ScriptGUIElementBaseTBase* nativeInstance, UINT32 minHeight, UINT32 maxHeight);
 		static void internal_SetFlexibleHeight(ScriptGUIElementBaseTBase* nativeInstance, UINT32 minHeight, UINT32 maxHeight);
 		static void internal_SetContextMenu(ScriptGUIElementBaseTBase* nativeInstance, ScriptContextMenu* contextMenu);
 		static void internal_SetContextMenu(ScriptGUIElementBaseTBase* nativeInstance, ScriptContextMenu* contextMenu);
 		static void internal_ResetDimensions(ScriptGUIElementBaseTBase* nativeInstance);
 		static void internal_ResetDimensions(ScriptGUIElementBaseTBase* nativeInstance);
-
-		ScriptGUIElement(MonoObject* instance);
 	};
 	};
 }
 }

+ 25 - 7
SBansheeEngine/Include/BsScriptGUIElementStateStyle.h

@@ -4,11 +4,13 @@
 #include "BsScriptObject.h"
 #include "BsScriptObject.h"
 #include "BsMonoClass.h"
 #include "BsMonoClass.h"
 #include "BsGUIElementStyle.h"
 #include "BsGUIElementStyle.h"
-#include "BsScriptMacros.h"
 #include "BsScriptSpriteTexture.h"
 #include "BsScriptSpriteTexture.h"
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for GUIElementStateStyle.
+	 */
 	class BS_SCR_BE_EXPORT ScriptGUIElementStateStyle : public ScriptObject<ScriptGUIElementStateStyle>
 	class BS_SCR_BE_EXPORT ScriptGUIElementStateStyle : public ScriptObject<ScriptGUIElementStateStyle>
 	{
 	{
 	public:
 	public:
@@ -16,20 +18,36 @@ namespace BansheeEngine
 
 
 		~ScriptGUIElementStateStyle();
 		~ScriptGUIElementStateStyle();
 
 
+		/**
+		 * @brief	Returns a copy of the internal GUIElementStateStyle.
+		 */
 		GUIElementStyle::GUIElementStateStyle getInternalValue() const { return *mElementStateStyle; }
 		GUIElementStyle::GUIElementStateStyle getInternalValue() const { return *mElementStateStyle; }
 
 
 	private:
 	private:
-		static void internal_createInstance(MonoObject* instance);
-		static void internal_createInstanceExternal(MonoObject* instance, GUIElementStyle::GUIElementStateStyle* externalStateStyle);
-
-		BS_SCRIPT_GETSET_OBJECT_SHRDPTR(ScriptGUIElementStateStyle, ScriptSpriteTexture, Texture, mElementStateStyle->texture, mSpriteTexture);
-		BS_SCRIPT_GETSET_VALUE_REF(ScriptGUIElementStateStyle, Color, TextColor, mElementStateStyle->textColor);
-
+		/**
+		 * @brief	Creates the interop object with a brand new default style.
+		 */
 		ScriptGUIElementStateStyle(MonoObject* instance);
 		ScriptGUIElementStateStyle(MonoObject* instance);
+
+		/**
+		 * @brief	Creates the interop object by referencing an existing style instance.
+		 */
 		ScriptGUIElementStateStyle(MonoObject* instance, GUIElementStyle::GUIElementStateStyle* externalStyle);
 		ScriptGUIElementStateStyle(MonoObject* instance, GUIElementStyle::GUIElementStateStyle* externalStyle);
 
 
 		GUIElementStyle::GUIElementStateStyle* mElementStateStyle;
 		GUIElementStyle::GUIElementStateStyle* mElementStateStyle;
 		ScriptSpriteTexture* mSpriteTexture;
 		ScriptSpriteTexture* mSpriteTexture;
 		bool mOwnsStyle;
 		bool mOwnsStyle;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_createInstance(MonoObject* instance);
+		static void internal_createInstanceExternal(MonoObject* instance, GUIElementStyle::GUIElementStateStyle* externalStateStyle);
+
+		static void internal_GetTexture(ScriptGUIElementStateStyle* nativeInstance, MonoObject** value);
+		static void internal_SetTexture(ScriptGUIElementStateStyle* nativeInstance, MonoObject* value);
+
+		static void internal_GetTextColor(ScriptGUIElementStateStyle* nativeInstance, Color* value);
+		static void internal_SetTextColor(ScriptGUIElementStateStyle* nativeInstance, Color* value);
 	};
 	};
 }
 }

+ 76 - 45
SBansheeEngine/Include/BsScriptGUIElementStyle.h

@@ -3,21 +3,15 @@
 #include "BsScriptEnginePrerequisites.h"
 #include "BsScriptEnginePrerequisites.h"
 #include "BsScriptObject.h"
 #include "BsScriptObject.h"
 #include "BsGUIElementStyle.h"
 #include "BsGUIElementStyle.h"
-#include "BsScriptMacros.h"
 #include "BsMonoClass.h"
 #include "BsMonoClass.h"
 #include "BsScriptGUIElementStateStyle.h"
 #include "BsScriptGUIElementStateStyle.h"
 #include "BsScriptFont.h"
 #include "BsScriptFont.h"
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
-	template<class ParentType, class Type>
-	class script_getset_value
-	{
-	private:
-		static void internal_get(ParentType* nativeInstance, Type* value);
-		static void internal_set(ParentType* nativeInstance, Type value);
-	};
-
+	/**
+	 * @brief	Interop class between C++ & CLR for GUIElementStyle.
+	 */
 	class BS_SCR_BE_EXPORT ScriptGUIElementStyle : public ScriptObject<ScriptGUIElementStyle>
 	class BS_SCR_BE_EXPORT ScriptGUIElementStyle : public ScriptObject<ScriptGUIElementStyle>
 	{
 	{
 	public:
 	public:
@@ -25,46 +19,20 @@ namespace BansheeEngine
 
 
 		~ScriptGUIElementStyle();
 		~ScriptGUIElementStyle();
 
 
+		/**
+		 * @brief	Returns the wrapped GUIElementStyle instance.
+		 */
 		GUIElementStyle* getInternalValue() const { return mElementStyle; }
 		GUIElementStyle* getInternalValue() const { return mElementStyle; }
 
 
 	private:
 	private:
-		static void internal_createInstance(MonoObject* instance, MonoString* name);
-		static void internal_createInstanceExternal(MonoObject* instance, MonoString* name, GUIElementStyle* externalStyle);
-		static void internal_addSubStyle(ScriptGUIElementStyle* nativeInstance, MonoString* guiType, MonoString* styleName);
-
-		static void internal_GetFont(ScriptGUIElementStyle* nativeInstance, MonoObject** value);
-		static void internal_SetFont(ScriptGUIElementStyle* nativeInstance, MonoObject* value);
-
-		BS_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, UINT32, FontSize, mElementStyle->fontSize);
-		BS_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, TextHorzAlign, TextHorzAlign, mElementStyle->textHorzAlign);
-		BS_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, TextVertAlign, TextVertAlign, mElementStyle->textVertAlign);
-		BS_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, GUIImagePosition, ImagePosition, mElementStyle->imagePosition);
-		BS_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, bool, WordWrap, mElementStyle->wordWrap);
-
-		BS_SCRIPT_GETSET_OBJECT(ScriptGUIElementStyle, ScriptGUIElementStateStyle, Normal, mElementStyle->normal, mNormal);
-		BS_SCRIPT_GETSET_OBJECT(ScriptGUIElementStyle, ScriptGUIElementStateStyle, Hover, mElementStyle->hover, mHover);
-		BS_SCRIPT_GETSET_OBJECT(ScriptGUIElementStyle, ScriptGUIElementStateStyle, Active, mElementStyle->active, mActive);
-		BS_SCRIPT_GETSET_OBJECT(ScriptGUIElementStyle, ScriptGUIElementStateStyle, Focused, mElementStyle->focused, mFocused);
-
-		BS_SCRIPT_GETSET_OBJECT(ScriptGUIElementStyle, ScriptGUIElementStateStyle, NormalOn, mElementStyle->normalOn, mNormalOn);
-		BS_SCRIPT_GETSET_OBJECT(ScriptGUIElementStyle, ScriptGUIElementStateStyle, HoverOn, mElementStyle->hoverOn, mHoverOn);
-		BS_SCRIPT_GETSET_OBJECT(ScriptGUIElementStyle, ScriptGUIElementStateStyle, ActiveOn, mElementStyle->activeOn, mActiveOn);
-		BS_SCRIPT_GETSET_OBJECT(ScriptGUIElementStyle, ScriptGUIElementStateStyle, FocusedOn, mElementStyle->focusedOn, mFocusedOn);
-
-		BS_SCRIPT_GETSET_VALUE_REF(ScriptGUIElementStyle, RectOffset, Border, mElementStyle->border);
-		BS_SCRIPT_GETSET_VALUE_REF(ScriptGUIElementStyle, RectOffset, Margins, mElementStyle->margins);
-		BS_SCRIPT_GETSET_VALUE_REF(ScriptGUIElementStyle, RectOffset, ContentOffset, mElementStyle->contentOffset);
-
-		BS_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, UINT32, Width, mElementStyle->width);
-		BS_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, UINT32, Height, mElementStyle->height);
-		BS_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, UINT32, MinWidth, mElementStyle->minWidth);
-		BS_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, UINT32, MaxWidth, mElementStyle->maxWidth);
-		BS_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, UINT32, MinHeight, mElementStyle->minHeight);
-		BS_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, UINT32, MaxHeight, mElementStyle->maxHeight);
-		BS_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, bool, FixedWidth, mElementStyle->fixedWidth);
-		BS_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, bool, FixedHeight, mElementStyle->fixedHeight);
-
+		/**
+		 * @brief	Creates the interop object with a default style.
+		 */
 		ScriptGUIElementStyle(MonoObject* instance, const String& name);
 		ScriptGUIElementStyle(MonoObject* instance, const String& name);
+
+		/**
+		 * @brief	Creates the interop object referencing an existing style.
+		 */
 		ScriptGUIElementStyle(MonoObject* instance, const String& name, GUIElementStyle* externalStyle);
 		ScriptGUIElementStyle(MonoObject* instance, const String& name, GUIElementStyle* externalStyle);
 
 
 		String mName;
 		String mName;
@@ -80,5 +48,68 @@ namespace BansheeEngine
 		ScriptGUIElementStateStyle* mHoverOn;
 		ScriptGUIElementStateStyle* mHoverOn;
 		ScriptGUIElementStateStyle* mActiveOn;
 		ScriptGUIElementStateStyle* mActiveOn;
 		ScriptGUIElementStateStyle* mFocusedOn;
 		ScriptGUIElementStateStyle* mFocusedOn;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_createInstance(MonoObject* instance, MonoString* name);
+		static void internal_createInstanceExternal(MonoObject* instance, MonoString* name, GUIElementStyle* externalStyle);
+		static void internal_addSubStyle(ScriptGUIElementStyle* nativeInstance, MonoString* guiType, MonoString* styleName);
+
+		static void internal_GetFont(ScriptGUIElementStyle* nativeInstance, MonoObject** value);
+		static void internal_SetFont(ScriptGUIElementStyle* nativeInstance, MonoObject* value);
+
+		static void internal_GetFontSize(ScriptGUIElementStyle* nativeInstance, UINT32* value);
+		static void internal_SetFontSize(ScriptGUIElementStyle* nativeInstance, UINT32 value);
+		static void internal_GetTextHorzAlign(ScriptGUIElementStyle* nativeInstance, TextHorzAlign*value);
+		static void internal_SetTextHorzAlign(ScriptGUIElementStyle* nativeInstance, TextHorzAlign value);
+		static void internal_GetTextVertAlign(ScriptGUIElementStyle* nativeInstance, TextVertAlign* value);
+		static void internal_SetTextVertAlign(ScriptGUIElementStyle* nativeInstance, TextVertAlign value);
+		static void internal_GetImagePosition(ScriptGUIElementStyle* nativeInstance, GUIImagePosition* value);
+		static void internal_SetImagePosition(ScriptGUIElementStyle* nativeInstance, GUIImagePosition value);
+		static void internal_GetWordWrap(ScriptGUIElementStyle* nativeInstance, bool* value);
+		static void internal_SetWordWrap(ScriptGUIElementStyle* nativeInstance, bool value);
+
+		static void internal_GetNormal(ScriptGUIElementStyle* nativeInstance, MonoObject** value);
+		static void internal_SetNormal(ScriptGUIElementStyle* nativeInstance, MonoObject* value);
+		static void internal_GetHover(ScriptGUIElementStyle* nativeInstance, MonoObject** value);
+		static void internal_SetHover(ScriptGUIElementStyle* nativeInstance, MonoObject* value);
+		static void internal_GetActive(ScriptGUIElementStyle* nativeInstance, MonoObject** value);
+		static void internal_SetActive(ScriptGUIElementStyle* nativeInstance, MonoObject* value);
+		static void internal_GetFocused(ScriptGUIElementStyle* nativeInstance, MonoObject** value);
+		static void internal_SetFocused(ScriptGUIElementStyle* nativeInstance, MonoObject* value);
+
+		static void internal_GetNormalOn(ScriptGUIElementStyle* nativeInstance, MonoObject** value);
+		static void internal_SetNormalOn(ScriptGUIElementStyle* nativeInstance, MonoObject* value);
+		static void internal_GetHoverOn(ScriptGUIElementStyle* nativeInstance, MonoObject** value);
+		static void internal_SetHoverOn(ScriptGUIElementStyle* nativeInstance, MonoObject* value);
+		static void internal_GetActiveOn(ScriptGUIElementStyle* nativeInstance, MonoObject** value);
+		static void internal_SetActiveOn(ScriptGUIElementStyle* nativeInstance, MonoObject* value);
+		static void internal_GetFocusedOn(ScriptGUIElementStyle* nativeInstance, MonoObject** value);
+		static void internal_SetFocusedOn(ScriptGUIElementStyle* nativeInstance, MonoObject* value);
+
+		static void internal_GetBorder(ScriptGUIElementStyle* nativeInstance, RectOffset* value);
+		static void internal_SetBorder(ScriptGUIElementStyle* nativeInstance, RectOffset* value);
+		static void internal_GetMargins(ScriptGUIElementStyle* nativeInstance, RectOffset* value);
+		static void internal_SetMargins(ScriptGUIElementStyle* nativeInstance, RectOffset* value);
+		static void internal_GetContentOffset(ScriptGUIElementStyle* nativeInstance, RectOffset* value);
+		static void internal_SetContentOffset(ScriptGUIElementStyle* nativeInstance, RectOffset* value);
+
+		static void internal_GetWidth(ScriptGUIElementStyle* nativeInstance, UINT32* value);
+		static void internal_SetWidth(ScriptGUIElementStyle* nativeInstance, UINT32 value);
+		static void internal_GetHeight(ScriptGUIElementStyle* nativeInstance, UINT32* value);
+		static void internal_SetHeight(ScriptGUIElementStyle* nativeInstance, UINT32 value);
+		static void internal_GetMinWidth(ScriptGUIElementStyle* nativeInstance, UINT32* value);
+		static void internal_SetMinWidth(ScriptGUIElementStyle* nativeInstance, UINT32 value);
+		static void internal_GetMaxWidth(ScriptGUIElementStyle* nativeInstance, UINT32* value);
+		static void internal_SetMaxWidth(ScriptGUIElementStyle* nativeInstance, UINT32 value);
+		static void internal_GetMinHeight(ScriptGUIElementStyle* nativeInstance, UINT32* value);
+		static void internal_SetMinHeight(ScriptGUIElementStyle* nativeInstance, UINT32 value);
+		static void internal_GetMaxHeight(ScriptGUIElementStyle* nativeInstance, UINT32* value);
+		static void internal_SetMaxHeight(ScriptGUIElementStyle* nativeInstance, UINT32 value);
+		static void internal_GetFixedWidth(ScriptGUIElementStyle* nativeInstance, bool* value);
+		static void internal_SetFixedWidth(ScriptGUIElementStyle* nativeInstance, bool value);
+		static void internal_GetFixedHeight(ScriptGUIElementStyle* nativeInstance, bool* value);
+		static void internal_SetFixedHeight(ScriptGUIElementStyle* nativeInstance, bool value);
 	};
 	};
 }
 }

+ 13 - 4
SBansheeEngine/Include/BsScriptGUIFixedSpace.h

@@ -5,20 +5,29 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for GUIFixedSpace.
+	 */
 	class BS_SCR_BE_EXPORT ScriptGUIFixedSpace : public TScriptGUIElementBase<ScriptGUIFixedSpace>
 	class BS_SCR_BE_EXPORT ScriptGUIFixedSpace : public TScriptGUIElementBase<ScriptGUIFixedSpace>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUIFixedSpace")
 		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUIFixedSpace")
 
 
 	private:
 	private:
-		static void internal_createInstance(MonoObject* instance, UINT32 size);
-		static void internal_setSize(ScriptGUIFixedSpace* nativeInstance, UINT32 size);
-
 		ScriptGUIFixedSpace(MonoObject* instance, GUIFixedSpace* fixedSpace);
 		ScriptGUIFixedSpace(MonoObject* instance, GUIFixedSpace* fixedSpace);
 
 
-		void destroy();
+		/**
+		 * @copydoc	ScriptGUIElementBaseTBase::destroy
+		 */
+		void destroy() override;
 
 
 		GUIFixedSpace* mFixedSpace;
 		GUIFixedSpace* mFixedSpace;
 		bool mIsDestroyed;
 		bool mIsDestroyed;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_createInstance(MonoObject* instance, UINT32 size);
+		static void internal_setSize(ScriptGUIFixedSpace* nativeInstance, UINT32 size);
 	};
 	};
 }
 }

+ 12 - 3
SBansheeEngine/Include/BsScriptGUIFlexibleSpace.h

@@ -5,19 +5,28 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for GUIFlexibleSpace.
+	 */
 	class BS_SCR_BE_EXPORT ScriptGUIFlexibleSpace : public TScriptGUIElementBase<ScriptGUIFlexibleSpace>
 	class BS_SCR_BE_EXPORT ScriptGUIFlexibleSpace : public TScriptGUIElementBase<ScriptGUIFlexibleSpace>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUIFlexibleSpace")
 		SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUIFlexibleSpace")
 
 
 	private:
 	private:
-		static void internal_createInstance(MonoObject* instance);
-
 		ScriptGUIFlexibleSpace(MonoObject* instance, GUIFlexibleSpace* flexibleSpace);
 		ScriptGUIFlexibleSpace(MonoObject* instance, GUIFlexibleSpace* flexibleSpace);
 
 
-		void destroy();
+		/**
+		 * @copydoc	ScriptGUIElementBaseTBase::destroy
+		 */
+		void destroy() override;
 
 
 		GUIFlexibleSpace* mFlexibleSpace;
 		GUIFlexibleSpace* mFlexibleSpace;
 		bool mIsDestroyed;
 		bool mIsDestroyed;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_createInstance(MonoObject* instance);
 	};
 	};
 }
 }

+ 0 - 69
SBansheeEngine/Include/BsScriptMacros.h

@@ -1,69 +0,0 @@
-#pragma once
-
-#define BS_SCRIPT_GETSET_VALUE(ParentType, Type, Name, Field)									\
-	static void internal_Get##Name##(##ParentType##* nativeInstance, Type##* value)				\
-	{																							\
-		*value = nativeInstance->##Field;														\
-	}																							\
-																								\
-	static void internal_Set##Name##(##ParentType##* nativeInstance, Type value)				\
-	{																							\
-		nativeInstance->##Field = value;															\
-	}																							\
-
-#define BS_SCRIPT_GETSET_VALUE_REF(ParentType, Type, Name, Field)								\
-	static void internal_Get##Name##(##ParentType##* nativeInstance, Type##* value)				\
-	{																							\
-		*value = nativeInstance->##Field;														\
-	}																							\
-																								\
-	static void internal_Set##Name##(##ParentType##* nativeInstance, Type##* value)				\
-	{																							\
-		nativeInstance->##Field = *value;														\
-	}																							\
-
-#define BS_SCRIPT_GETSET_OBJECT(ParentType, Type, Name, FieldNative, FieldManaged)									\
-	static void internal_Get##Name##(##ParentType##* nativeInstance, MonoObject** value)							\
-	{																												\
-		throwIfInstancesDontMatch(nativeInstance->##FieldManaged##, &nativeInstance->##FieldNative##);				\
-																													\
-		if(nativeInstance->##FieldManaged != nullptr)																\
-		{																											\
-			*value = nativeInstance->##FieldManaged##->getManagedInstance();											\
-			return;																									\
-		}																											\
-																													\
-		*value = nullptr;																							\
-	}																												\
-																													\
-	static void internal_Set##Name##(##ParentType##* nativeInstance, MonoObject* value)								\
-	{																												\
-		Type##* nativeValue = Type##::toNative(value);																\
-		nativeInstance->##FieldNative = nativeValue->getInternalValue();												\
-		nativeInstance->##FieldManaged = nativeValue;																\
-	}
-
-#define BS_SCRIPT_GETSET_OBJECT_SHRDPTR(ParentType, Type, Name, FieldNative, FieldManaged)							\
-	static void internal_Get##Name##(##ParentType##* nativeInstance, MonoObject** value)							\
-	{																												\
-		throwIfInstancesDontMatch(nativeInstance->##FieldManaged##, nativeInstance->##FieldNative##.get());			\
-																													\
-		if(nativeInstance->##FieldManaged != nullptr)																\
-		{																											\
-			*value = nativeInstance->##FieldManaged##->getManagedInstance();											\
-			return;																									\
-		}																											\
-																													\
-		*value = nullptr;																							\
-	}																												\
-																													\
-	static void internal_Set##Name##(##ParentType##* nativeInstance, MonoObject* value)								\
-	{																												\
-		Type##* nativeValue = Type##::toNative(value);																\
-		nativeInstance->##FieldNative = nativeValue->getInternalValue();												\
-		nativeInstance->##FieldManaged = nativeValue;																\
-	}
-
-#define BS_SCRIPT_SETGET_META(Type, Name)																			\
-	metaData.scriptClass->addInternalCall("Internal_Get" #Name, &##Type##::internal_Get##Name##);					\
-	metaData.scriptClass->addInternalCall("Internal_Set" #Name, &##Type##::internal_Set##Name##);

+ 0 - 1
SBansheeEngine/SBansheeEngine.vcxproj

@@ -287,7 +287,6 @@
     <ClInclude Include="Include\BsScriptInput.h" />
     <ClInclude Include="Include\BsScriptInput.h" />
     <ClInclude Include="Include\BsScriptInputConfiguration.h" />
     <ClInclude Include="Include\BsScriptInputConfiguration.h" />
     <ClInclude Include="Include\BsScriptLightInternal.h" />
     <ClInclude Include="Include\BsScriptLightInternal.h" />
-    <ClInclude Include="Include\BsScriptMacros.h" />
     <ClInclude Include="Include\BsScriptManagedResource.h" />
     <ClInclude Include="Include\BsScriptManagedResource.h" />
     <ClInclude Include="Include\BsScriptMaterial.h" />
     <ClInclude Include="Include\BsScriptMaterial.h" />
     <ClInclude Include="Include\BsScriptMesh.h" />
     <ClInclude Include="Include\BsScriptMesh.h" />

+ 0 - 3
SBansheeEngine/SBansheeEngine.vcxproj.filters

@@ -45,9 +45,6 @@
     <ClInclude Include="Include\BsScriptTexture2D.h">
     <ClInclude Include="Include\BsScriptTexture2D.h">
       <Filter>Header Files</Filter>
       <Filter>Header Files</Filter>
     </ClInclude>
     </ClInclude>
-    <ClInclude Include="Include\BsScriptMacros.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Include\BsScriptEnginePrerequisites.h">
     <ClInclude Include="Include\BsScriptEnginePrerequisites.h">
       <Filter>Header Files</Filter>
       <Filter>Header Files</Filter>
     </ClInclude>
     </ClInclude>

+ 34 - 3
SBansheeEngine/Source/BsScriptGUIElementStateStyle.cpp

@@ -30,9 +30,10 @@ namespace BansheeEngine
 	void ScriptGUIElementStateStyle::initRuntimeData()
 	void ScriptGUIElementStateStyle::initRuntimeData()
 	{
 	{
 		metaData.scriptClass->addInternalCall("Internal_CreateInstance", &ScriptGUIElementStateStyle::internal_createInstance);
 		metaData.scriptClass->addInternalCall("Internal_CreateInstance", &ScriptGUIElementStateStyle::internal_createInstance);
-
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStateStyle, Texture);
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStateStyle, TextColor);
+		metaData.scriptClass->addInternalCall("Internal_GetTexture", &ScriptGUIElementStateStyle::internal_GetTexture);	
+		metaData.scriptClass->addInternalCall("Internal_SetTexture", &ScriptGUIElementStateStyle::internal_SetTexture);
+		metaData.scriptClass->addInternalCall("Internal_GetTextColor", &ScriptGUIElementStateStyle::internal_GetTextColor);
+		metaData.scriptClass->addInternalCall("Internal_SetTextColor", &ScriptGUIElementStateStyle::internal_SetTextColor);
 	}
 	}
 
 
 	void ScriptGUIElementStateStyle::internal_createInstance(MonoObject* instance)
 	void ScriptGUIElementStateStyle::internal_createInstance(MonoObject* instance)
@@ -44,4 +45,34 @@ namespace BansheeEngine
 	{
 	{
 		ScriptGUIElementStateStyle* nativeInstance = new (bs_alloc<ScriptGUIElementStateStyle>()) ScriptGUIElementStateStyle(instance, externalStyle);
 		ScriptGUIElementStateStyle* nativeInstance = new (bs_alloc<ScriptGUIElementStateStyle>()) ScriptGUIElementStateStyle(instance, externalStyle);
 	}
 	}
+
+	void ScriptGUIElementStateStyle::internal_GetTexture(ScriptGUIElementStateStyle* nativeInstance, MonoObject** value)
+	{
+		throwIfInstancesDontMatch(nativeInstance->mSpriteTexture, nativeInstance->mElementStateStyle->texture.get());	
+
+		if (nativeInstance->mSpriteTexture != nullptr)
+		{	
+			*value = nativeInstance->mSpriteTexture->getManagedInstance();
+			return;
+		}
+
+		*value = nullptr;
+	}
+
+	void ScriptGUIElementStateStyle::internal_SetTexture(ScriptGUIElementStateStyle* nativeInstance, MonoObject* value)
+	{
+		ScriptSpriteTexture* nativeValue = ScriptSpriteTexture::toNative(value);
+		nativeInstance->mElementStateStyle->texture = nativeValue->getInternalValue();
+		nativeInstance->mSpriteTexture = nativeValue;
+	}
+
+	void ScriptGUIElementStateStyle::internal_GetTextColor(ScriptGUIElementStateStyle* nativeInstance, Color* value)
+	{
+		*value = nativeInstance->mElementStateStyle->textColor;
+	}
+
+	void ScriptGUIElementStateStyle::internal_SetTextColor(ScriptGUIElementStateStyle* nativeInstance, Color* value)
+	{
+		nativeInstance->mElementStateStyle->textColor = *value;
+	}	
 }
 }

+ 373 - 28
SBansheeEngine/Source/BsScriptGUIElementStyle.cpp

@@ -39,34 +39,58 @@ namespace BansheeEngine
 		metaData.scriptClass->addInternalCall("Internal_GetFont", &ScriptGUIElementStyle::internal_GetFont);
 		metaData.scriptClass->addInternalCall("Internal_GetFont", &ScriptGUIElementStyle::internal_GetFont);
 		metaData.scriptClass->addInternalCall("Internal_SetFont", &ScriptGUIElementStyle::internal_SetFont);
 		metaData.scriptClass->addInternalCall("Internal_SetFont", &ScriptGUIElementStyle::internal_SetFont);
 
 
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, FontSize);
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, TextHorzAlign);
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, TextVertAlign);
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, ImagePosition);
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, WordWrap);
-
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, Normal);
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, Hover);
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, Active);
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, Focused);
-
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, NormalOn);
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, HoverOn);
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, ActiveOn);
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, FocusedOn);
-
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, Border);
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, Margins);
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, ContentOffset);
-
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, Width);
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, Height);
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, MinWidth);
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, MaxWidth);
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, MinHeight);
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, MaxHeight);
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, FixedWidth);
-		BS_SCRIPT_SETGET_META(ScriptGUIElementStyle, FixedHeight);
+		metaData.scriptClass->addInternalCall("Internal_GetFontSize", &ScriptGUIElementStyle::internal_GetFontSize);
+		metaData.scriptClass->addInternalCall("Internal_SetFontSize", &ScriptGUIElementStyle::internal_SetFontSize);
+		metaData.scriptClass->addInternalCall("Internal_GetTextHorzAlign", &ScriptGUIElementStyle::internal_GetTextHorzAlign);
+		metaData.scriptClass->addInternalCall("Internal_SetTextHorzAlign", &ScriptGUIElementStyle::internal_SetTextHorzAlign);
+		metaData.scriptClass->addInternalCall("Internal_GetTextVertAlign", &ScriptGUIElementStyle::internal_GetTextVertAlign);
+		metaData.scriptClass->addInternalCall("Internal_SetTextVertAlign", &ScriptGUIElementStyle::internal_SetTextVertAlign);
+		metaData.scriptClass->addInternalCall("Internal_GetImagePosition", &ScriptGUIElementStyle::internal_GetImagePosition);
+		metaData.scriptClass->addInternalCall("Internal_SetImagePosition", &ScriptGUIElementStyle::internal_SetImagePosition);
+		metaData.scriptClass->addInternalCall("Internal_GetWordWrap", &ScriptGUIElementStyle::internal_GetWordWrap);
+		metaData.scriptClass->addInternalCall("Internal_SetWordWrap", &ScriptGUIElementStyle::internal_SetWordWrap);
+
+		metaData.scriptClass->addInternalCall("Internal_GetNormal", &ScriptGUIElementStyle::internal_GetNormal);
+		metaData.scriptClass->addInternalCall("Internal_SetNormal", &ScriptGUIElementStyle::internal_SetNormal);
+		metaData.scriptClass->addInternalCall("Internal_GetHover", &ScriptGUIElementStyle::internal_GetHover);
+		metaData.scriptClass->addInternalCall("Internal_SetHover", &ScriptGUIElementStyle::internal_SetHover);
+		metaData.scriptClass->addInternalCall("Internal_GetActive", &ScriptGUIElementStyle::internal_GetActive);
+		metaData.scriptClass->addInternalCall("Internal_SetActive", &ScriptGUIElementStyle::internal_SetActive);
+		metaData.scriptClass->addInternalCall("Internal_GetFocused", &ScriptGUIElementStyle::internal_GetFocused);
+		metaData.scriptClass->addInternalCall("Internal_SetFocused", &ScriptGUIElementStyle::internal_SetFocused);
+
+		metaData.scriptClass->addInternalCall("Internal_GetNormalOn", &ScriptGUIElementStyle::internal_GetNormalOn);
+		metaData.scriptClass->addInternalCall("Internal_SetNormalOn", &ScriptGUIElementStyle::internal_SetNormalOn);
+		metaData.scriptClass->addInternalCall("Internal_GetHoverOn", &ScriptGUIElementStyle::internal_GetHoverOn);
+		metaData.scriptClass->addInternalCall("Internal_SetHoverOn", &ScriptGUIElementStyle::internal_SetHoverOn);
+		metaData.scriptClass->addInternalCall("Internal_GetActiveOn", &ScriptGUIElementStyle::internal_GetActiveOn);
+		metaData.scriptClass->addInternalCall("Internal_SetActiveOn", &ScriptGUIElementStyle::internal_SetActiveOn);
+		metaData.scriptClass->addInternalCall("Internal_GetFocusedOn", &ScriptGUIElementStyle::internal_GetFocusedOn);
+		metaData.scriptClass->addInternalCall("Internal_SetFocusedOn", &ScriptGUIElementStyle::internal_SetFocusedOn);
+
+		metaData.scriptClass->addInternalCall("Internal_GetBorder", &ScriptGUIElementStyle::internal_GetBorder);
+		metaData.scriptClass->addInternalCall("Internal_SetBorder", &ScriptGUIElementStyle::internal_SetBorder);
+		metaData.scriptClass->addInternalCall("Internal_GetMargins", &ScriptGUIElementStyle::internal_GetMargins);
+		metaData.scriptClass->addInternalCall("Internal_SetMargins", &ScriptGUIElementStyle::internal_SetMargins);
+		metaData.scriptClass->addInternalCall("Internal_GetContentOffset", &ScriptGUIElementStyle::internal_GetContentOffset);
+		metaData.scriptClass->addInternalCall("Internal_SetContentOffset", &ScriptGUIElementStyle::internal_SetContentOffset);
+
+		metaData.scriptClass->addInternalCall("Internal_GetWidth", &ScriptGUIElementStyle::internal_GetWidth);
+		metaData.scriptClass->addInternalCall("Internal_SetWidth", &ScriptGUIElementStyle::internal_SetWidth);
+		metaData.scriptClass->addInternalCall("Internal_GetHeight", &ScriptGUIElementStyle::internal_GetHeight);
+		metaData.scriptClass->addInternalCall("Internal_SetHeight", &ScriptGUIElementStyle::internal_SetHeight);
+		metaData.scriptClass->addInternalCall("Internal_GetMinWidth", &ScriptGUIElementStyle::internal_GetMinWidth);
+		metaData.scriptClass->addInternalCall("Internal_SetMinWidth", &ScriptGUIElementStyle::internal_SetMinWidth);
+		metaData.scriptClass->addInternalCall("Internal_GetMaxWidth", &ScriptGUIElementStyle::internal_GetMaxWidth);
+		metaData.scriptClass->addInternalCall("Internal_SetMaxWidth", &ScriptGUIElementStyle::internal_SetMaxWidth);
+		metaData.scriptClass->addInternalCall("Internal_GetMinHeight", &ScriptGUIElementStyle::internal_GetMinHeight);
+		metaData.scriptClass->addInternalCall("Internal_SetMinHeight", &ScriptGUIElementStyle::internal_SetMinHeight);
+		metaData.scriptClass->addInternalCall("Internal_GetMaxHeight", &ScriptGUIElementStyle::internal_GetMaxHeight);
+		metaData.scriptClass->addInternalCall("Internal_SetMaxHeight", &ScriptGUIElementStyle::internal_SetMaxHeight);
+		metaData.scriptClass->addInternalCall("Internal_GetFixedWidth", &ScriptGUIElementStyle::internal_GetFixedWidth);
+		metaData.scriptClass->addInternalCall("Internal_SetFixedWidth", &ScriptGUIElementStyle::internal_SetFixedWidth);
+		metaData.scriptClass->addInternalCall("Internal_GetFixedHeight", &ScriptGUIElementStyle::internal_GetFixedHeight);
+		metaData.scriptClass->addInternalCall("Internal_SetFixedHeight", &ScriptGUIElementStyle::internal_SetFixedHeight);
 	}
 	}
 
 
 	void ScriptGUIElementStyle::internal_createInstance(MonoObject* instance, MonoString* name)
 	void ScriptGUIElementStyle::internal_createInstance(MonoObject* instance, MonoString* name)
@@ -114,4 +138,325 @@ namespace BansheeEngine
 		nativeInstance->mElementStyle->font = static_resource_cast<Font>(nativeValue->getNativeHandle());
 		nativeInstance->mElementStyle->font = static_resource_cast<Font>(nativeValue->getNativeHandle());
 		nativeInstance->mFont = nativeValue;
 		nativeInstance->mFont = nativeValue;
 	}
 	}
+
+	void ScriptGUIElementStyle::internal_GetFontSize(ScriptGUIElementStyle* nativeInstance, UINT32* value)
+	{
+		*value = nativeInstance->mElementStyle->fontSize;
+	}
+
+	void ScriptGUIElementStyle::internal_SetFontSize(ScriptGUIElementStyle* nativeInstance, UINT32 value)
+	{
+		nativeInstance->mElementStyle->fontSize = value;
+	}
+
+	void ScriptGUIElementStyle::internal_GetTextHorzAlign(ScriptGUIElementStyle* nativeInstance, TextHorzAlign*value)
+	{
+		*value = nativeInstance->mElementStyle->textHorzAlign;
+	}
+
+	void ScriptGUIElementStyle::internal_SetTextHorzAlign(ScriptGUIElementStyle* nativeInstance, TextHorzAlign value)
+	{
+		nativeInstance->mElementStyle->textHorzAlign = value;
+	}
+
+	void ScriptGUIElementStyle::internal_GetTextVertAlign(ScriptGUIElementStyle* nativeInstance, TextVertAlign* value)
+	{
+		*value = nativeInstance->mElementStyle->textVertAlign;
+	}
+
+	void ScriptGUIElementStyle::internal_SetTextVertAlign(ScriptGUIElementStyle* nativeInstance, TextVertAlign value)
+	{
+		nativeInstance->mElementStyle->textVertAlign = value;
+	}
+
+	void ScriptGUIElementStyle::internal_GetImagePosition(ScriptGUIElementStyle* nativeInstance, GUIImagePosition* value)
+	{
+		*value = nativeInstance->mElementStyle->imagePosition;
+	}
+
+	void ScriptGUIElementStyle::internal_SetImagePosition(ScriptGUIElementStyle* nativeInstance, GUIImagePosition value)
+	{
+		nativeInstance->mElementStyle->imagePosition = value;
+	}
+
+	void ScriptGUIElementStyle::internal_GetWordWrap(ScriptGUIElementStyle* nativeInstance, bool* value)
+	{
+		*value = nativeInstance->mElementStyle->wordWrap;
+	}
+
+	void ScriptGUIElementStyle::internal_SetWordWrap(ScriptGUIElementStyle* nativeInstance, bool value)
+	{
+		nativeInstance->mElementStyle->wordWrap = value;
+	}
+
+	void ScriptGUIElementStyle::internal_GetNormal(ScriptGUIElementStyle* nativeInstance, MonoObject** value)
+	{
+		throwIfInstancesDontMatch(nativeInstance->mNormal, &nativeInstance->mElementStyle->normal);
+
+		if (nativeInstance->mNormal != nullptr)
+		{
+			*value = nativeInstance->mNormal->getManagedInstance();
+			return;	
+		}
+
+		*value = nullptr;
+	}
+
+	void ScriptGUIElementStyle::internal_SetNormal(ScriptGUIElementStyle* nativeInstance, MonoObject* value)
+	{
+		ScriptGUIElementStateStyle* nativeValue = ScriptGUIElementStateStyle::toNative(value);
+		nativeInstance->mElementStyle->normal = nativeValue->getInternalValue();
+		nativeInstance->mNormal = nativeValue;
+	}
+
+
+	void ScriptGUIElementStyle::internal_GetHover(ScriptGUIElementStyle* nativeInstance, MonoObject** value)
+	{
+		throwIfInstancesDontMatch(nativeInstance->mHover, &nativeInstance->mElementStyle->hover);
+
+		if (nativeInstance->mHover != nullptr)
+		{
+			*value = nativeInstance->mHover->getManagedInstance();
+			return;
+		}
+
+		*value = nullptr;
+	}
+
+	void ScriptGUIElementStyle::internal_SetHover(ScriptGUIElementStyle* nativeInstance, MonoObject* value)
+	{
+		ScriptGUIElementStateStyle* nativeValue = ScriptGUIElementStateStyle::toNative(value);
+		nativeInstance->mElementStyle->hover = nativeValue->getInternalValue();
+		nativeInstance->mHover = nativeValue;
+	}
+
+	void ScriptGUIElementStyle::internal_GetActive(ScriptGUIElementStyle* nativeInstance, MonoObject** value)
+	{
+		throwIfInstancesDontMatch(nativeInstance->mActive, &nativeInstance->mElementStyle->active);
+
+		if (nativeInstance->mActive != nullptr)
+		{
+			*value = nativeInstance->mActive->getManagedInstance();
+			return;
+		}
+
+		*value = nullptr;
+	}
+
+	void ScriptGUIElementStyle::internal_SetActive(ScriptGUIElementStyle* nativeInstance, MonoObject* value)
+	{
+		ScriptGUIElementStateStyle* nativeValue = ScriptGUIElementStateStyle::toNative(value);
+		nativeInstance->mElementStyle->active = nativeValue->getInternalValue();
+		nativeInstance->mActive = nativeValue;
+	}
+
+	void ScriptGUIElementStyle::internal_GetFocused(ScriptGUIElementStyle* nativeInstance, MonoObject** value)
+	{
+		throwIfInstancesDontMatch(nativeInstance->mFocused, &nativeInstance->mElementStyle->focused);
+
+		if (nativeInstance->mFocused != nullptr)
+		{
+			*value = nativeInstance->mFocused->getManagedInstance();
+			return;
+		}
+
+		*value = nullptr;
+	}
+
+	void ScriptGUIElementStyle::internal_SetFocused(ScriptGUIElementStyle* nativeInstance, MonoObject* value)
+	{
+		ScriptGUIElementStateStyle* nativeValue = ScriptGUIElementStateStyle::toNative(value);
+		nativeInstance->mElementStyle->focused = nativeValue->getInternalValue();
+		nativeInstance->mFocused = nativeValue;
+	}
+
+	void ScriptGUIElementStyle::internal_GetNormalOn(ScriptGUIElementStyle* nativeInstance, MonoObject** value)
+	{
+		throwIfInstancesDontMatch(nativeInstance->mNormalOn, &nativeInstance->mElementStyle->normalOn);
+
+		if (nativeInstance->mNormalOn != nullptr)
+		{
+			*value = nativeInstance->mNormalOn->getManagedInstance();
+			return;
+		}
+
+		*value = nullptr;
+	}
+
+	void ScriptGUIElementStyle::internal_SetNormalOn(ScriptGUIElementStyle* nativeInstance, MonoObject* value)
+	{
+		ScriptGUIElementStateStyle* nativeValue = ScriptGUIElementStateStyle::toNative(value);
+		nativeInstance->mElementStyle->normalOn = nativeValue->getInternalValue();
+		nativeInstance->mNormalOn = nativeValue;
+	}
+
+	void ScriptGUIElementStyle::internal_GetHoverOn(ScriptGUIElementStyle* nativeInstance, MonoObject** value)
+	{
+		throwIfInstancesDontMatch(nativeInstance->mHoverOn, &nativeInstance->mElementStyle->hoverOn);
+
+		if (nativeInstance->mHoverOn != nullptr)
+		{
+			*value = nativeInstance->mHoverOn->getManagedInstance();
+			return;
+		}
+
+		*value = nullptr;
+	}
+
+	void ScriptGUIElementStyle::internal_SetHoverOn(ScriptGUIElementStyle* nativeInstance, MonoObject* value)
+	{
+		ScriptGUIElementStateStyle* nativeValue = ScriptGUIElementStateStyle::toNative(value);
+		nativeInstance->mElementStyle->hoverOn = nativeValue->getInternalValue();
+		nativeInstance->mHoverOn = nativeValue;
+	}
+
+	void ScriptGUIElementStyle::internal_GetActiveOn(ScriptGUIElementStyle* nativeInstance, MonoObject** value)
+	{
+		throwIfInstancesDontMatch(nativeInstance->mActiveOn, &nativeInstance->mElementStyle->activeOn);
+
+		if (nativeInstance->mActiveOn != nullptr)
+		{
+			*value = nativeInstance->mActiveOn->getManagedInstance();
+			return;
+		}
+
+		*value = nullptr;
+	}
+
+	void ScriptGUIElementStyle::internal_SetActiveOn(ScriptGUIElementStyle* nativeInstance, MonoObject* value)
+	{
+		ScriptGUIElementStateStyle* nativeValue = ScriptGUIElementStateStyle::toNative(value);
+		nativeInstance->mElementStyle->activeOn = nativeValue->getInternalValue();
+		nativeInstance->mActiveOn = nativeValue;
+	}
+
+	void ScriptGUIElementStyle::internal_GetFocusedOn(ScriptGUIElementStyle* nativeInstance, MonoObject** value)
+	{
+		throwIfInstancesDontMatch(nativeInstance->mFocusedOn, &nativeInstance->mElementStyle->focusedOn);
+
+		if (nativeInstance->mFocusedOn != nullptr)
+		{
+			*value = nativeInstance->mFocusedOn->getManagedInstance();
+			return;
+		}
+
+		*value = nullptr;
+	}
+
+	void ScriptGUIElementStyle::internal_SetFocusedOn(ScriptGUIElementStyle* nativeInstance, MonoObject* value)
+	{
+		ScriptGUIElementStateStyle* nativeValue = ScriptGUIElementStateStyle::toNative(value);
+		nativeInstance->mElementStyle->focusedOn = nativeValue->getInternalValue();
+		nativeInstance->mFocusedOn = nativeValue;
+	}
+
+	void ScriptGUIElementStyle::internal_GetBorder(ScriptGUIElementStyle* nativeInstance, RectOffset* value)
+	{
+		*value = nativeInstance->mElementStyle->border;
+	}
+
+	void ScriptGUIElementStyle::internal_SetBorder(ScriptGUIElementStyle* nativeInstance, RectOffset* value)
+	{
+		nativeInstance->mElementStyle->border = *value;
+	}
+
+	void ScriptGUIElementStyle::internal_GetMargins(ScriptGUIElementStyle* nativeInstance, RectOffset* value)
+	{
+		*value = nativeInstance->mElementStyle->margins;
+	}
+
+	void ScriptGUIElementStyle::internal_SetMargins(ScriptGUIElementStyle* nativeInstance, RectOffset* value)
+	{
+		nativeInstance->mElementStyle->margins = *value;
+	}
+
+	void ScriptGUIElementStyle::internal_GetContentOffset(ScriptGUIElementStyle* nativeInstance, RectOffset* value)
+	{
+		*value = nativeInstance->mElementStyle->contentOffset;
+	}
+
+	void ScriptGUIElementStyle::internal_SetContentOffset(ScriptGUIElementStyle* nativeInstance, RectOffset* value)
+	{
+		nativeInstance->mElementStyle->contentOffset = *value;
+	}
+
+	void ScriptGUIElementStyle::internal_GetWidth(ScriptGUIElementStyle* nativeInstance, UINT32* value)
+	{
+		*value = nativeInstance->mElementStyle->width;
+	}
+
+	void ScriptGUIElementStyle::internal_SetWidth(ScriptGUIElementStyle* nativeInstance, UINT32 value)
+	{
+		nativeInstance->mElementStyle->width = value;
+	}
+
+	void ScriptGUIElementStyle::internal_GetHeight(ScriptGUIElementStyle* nativeInstance, UINT32* value)
+	{
+		*value = nativeInstance->mElementStyle->height;
+	}
+
+	void ScriptGUIElementStyle::internal_SetHeight(ScriptGUIElementStyle* nativeInstance, UINT32 value)
+	{
+		nativeInstance->mElementStyle->height = value;
+	}
+
+	void ScriptGUIElementStyle::internal_GetMinWidth(ScriptGUIElementStyle* nativeInstance, UINT32* value)
+	{
+		*value = nativeInstance->mElementStyle->minWidth;
+	}
+
+	void ScriptGUIElementStyle::internal_SetMinWidth(ScriptGUIElementStyle* nativeInstance, UINT32 value)
+	{
+		nativeInstance->mElementStyle->minWidth = value;
+	}
+
+	void ScriptGUIElementStyle::internal_GetMaxWidth(ScriptGUIElementStyle* nativeInstance, UINT32* value)
+	{
+		*value = nativeInstance->mElementStyle->maxWidth;
+	}
+
+	void ScriptGUIElementStyle::internal_SetMaxWidth(ScriptGUIElementStyle* nativeInstance, UINT32 value)
+	{
+		nativeInstance->mElementStyle->maxWidth = value;
+	}
+
+	void ScriptGUIElementStyle::internal_GetMinHeight(ScriptGUIElementStyle* nativeInstance, UINT32* value)
+	{
+		*value = nativeInstance->mElementStyle->minHeight;
+	}
+
+	void ScriptGUIElementStyle::internal_SetMinHeight(ScriptGUIElementStyle* nativeInstance, UINT32 value)
+	{
+		nativeInstance->mElementStyle->minHeight = value;
+	}
+
+	void ScriptGUIElementStyle::internal_GetMaxHeight(ScriptGUIElementStyle* nativeInstance, UINT32* value)
+	{
+		*value = nativeInstance->mElementStyle->maxHeight;
+	}
+
+	void ScriptGUIElementStyle::internal_SetMaxHeight(ScriptGUIElementStyle* nativeInstance, UINT32 value)
+	{
+		nativeInstance->mElementStyle->maxHeight = value;
+	}
+
+	void ScriptGUIElementStyle::internal_GetFixedWidth(ScriptGUIElementStyle* nativeInstance, bool* value)
+	{
+		*value = nativeInstance->mElementStyle->fixedWidth;
+	}
+
+	void ScriptGUIElementStyle::internal_SetFixedWidth(ScriptGUIElementStyle* nativeInstance, bool value)
+	{
+		nativeInstance->mElementStyle->fixedWidth = value;
+	}
+
+	void ScriptGUIElementStyle::internal_GetFixedHeight(ScriptGUIElementStyle* nativeInstance, bool* value)
+	{
+		*value = nativeInstance->mElementStyle->fixedHeight;
+	}
+
+	void ScriptGUIElementStyle::internal_SetFixedHeight(ScriptGUIElementStyle* nativeInstance, bool value)
+	{
+		nativeInstance->mElementStyle->fixedHeight = value;
+	}
 }
 }

+ 5 - 2
TODO.txt

@@ -57,10 +57,13 @@ Code quality improvements:
 ----------------------------------------------------------------------
 ----------------------------------------------------------------------
 Polish stage 1
 Polish stage 1
 
 
-Selecting a resource doesn't clear selection overlay
 Test inspector selection, selecting a resource and adding/removing component updates
 Test inspector selection, selecting a resource and adding/removing component updates
 Showing the inspector causes a considerable slowdown (maybe stuff gets refreshed too often?)
 Showing the inspector causes a considerable slowdown (maybe stuff gets refreshed too often?)
-Crash when showing the inspector (invalid index in Layout.InsertElement)
+ - It seems to be rebuilding a lot of GUI just because I moused over an element. Can I avoid that?
+   - Layout update should only be called if I change element size or reposition it in some way
+ - UpdateLayout seems to be taking a huge amount of time, and update meshes isn't much better
+
+Crash when showing the inspector (invalid index in Layout.InsertElement called from InspectableObject.Update)
 
 
 Handle seems to lag behind the selected mesh
 Handle seems to lag behind the selected mesh
 ProjectLibrary seems to import some files on every start-up
 ProjectLibrary seems to import some files on every start-up