Ver Fonte

Hooked up ScriptGUIElementStyle

Marko Pintera há 12 anos atrás
pai
commit
a59cc38e2e

+ 13 - 6
BansheeEngine/Include/BsScriptGUIElementStateStyle.h

@@ -2,7 +2,10 @@
 
 #include "BsPrerequisites.h"
 #include "BsScriptObject.h"
+#include "BsScriptClass.h"
 #include "BsGUIElementStyle.h"
+#include "BsScriptMacros.h"
+#include "BsScriptSpriteTexture.h"
 
 namespace BansheeEngine
 {
@@ -12,20 +15,24 @@ namespace BansheeEngine
 		~ScriptGUIElementStateStyle();
 
 		static void initMetaData();
-		GUIElementStyle::GUIElementStateStyle* getInternalValue() const { return mElementStateStyle; }
+		GUIElementStyle::GUIElementStateStyle getInternalValue() const { return *mElementStateStyle; }
 
 	private:
 		static void internal_createInstance(MonoObject* instance);
 		static void internal_createInstanceExternal(MonoObject* instance, GUIElementStyle::GUIElementStateStyle* externalStateStyle);
 		static void internal_destroyInstance(ScriptGUIElementStateStyle* nativeInstance);
 
-		static void initRuntimeData();
+		static void initRuntimeData()
+		{
+			metaData.scriptClass->addInternalCall("Internal_CreateInstance", &ScriptGUIElementStateStyle::internal_createInstance);
+			metaData.scriptClass->addInternalCall("Internal_DestroyInstance", &ScriptGUIElementStateStyle::internal_destroyInstance);
 
-		static void internal_GetTexture(ScriptGUIElementStateStyle* nativeInstance, MonoObject** value);
-		static void internal_SetTexture(ScriptGUIElementStateStyle* nativeInstance, MonoObject* value);
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStateStyle, Texture);
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStateStyle, TextColor);
+		}
 
-		static void internal_GetTextColor(ScriptGUIElementStateStyle* nativeInstance, CM::Color* value);
-		static void internal_SetTextColor(ScriptGUIElementStateStyle* nativeInstance, CM::Color* value);
+		CM_SCRIPT_GETSET_OBJECT_SHRDPTR(ScriptGUIElementStateStyle, ScriptSpriteTexture, Texture, mElementStateStyle->texture, mSpriteTexture);
+		CM_SCRIPT_GETSET_VALUE_REF(ScriptGUIElementStateStyle, CM::Color, TextColor, mElementStateStyle->textColor);
 
 		ScriptGUIElementStateStyle();
 		ScriptGUIElementStateStyle(GUIElementStyle::GUIElementStateStyle* externalStyle);

+ 79 - 88
BansheeEngine/Include/BsScriptGUIElementStyle.h

@@ -3,6 +3,10 @@
 #include "BsPrerequisites.h"
 #include "BsScriptObject.h"
 #include "BsGUIElementStyle.h"
+#include "BsScriptMacros.h"
+#include "BsScriptClass.h"
+#include "BsScriptGUIElementStateStyle.h"
+#include "BsScriptFont.h"
 
 namespace BansheeEngine
 {
@@ -26,86 +30,73 @@ namespace BansheeEngine
 		static void internal_createInstanceExternal(MonoObject* instance, MonoString* name, GUIElementStyle* externalStyle);
 		static void internal_destroyInstance(ScriptGUIElementStyle* nativeInstance);
 
-		static void initRuntimeData();
-
-		static void internal_GetFont(ScriptGUIElementStyle* nativeInstance, MonoObject** value);
-		static void internal_SetFont(ScriptGUIElementStyle* nativeInstance, MonoObject* value);
-
-		static void internal_GetFontSize(ScriptGUIElementStyle* nativeInstance, CM::UINT32* value);
-		static void internal_SetFontSize(ScriptGUIElementStyle* nativeInstance, CM::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, CM::UINT32* value);
-		static void internal_SetWidth(ScriptGUIElementStyle* nativeInstance, CM::UINT32 value);
-
-		static void internal_GetHeight(ScriptGUIElementStyle* nativeInstance, CM::UINT32* value);
-		static void internal_SetHeight(ScriptGUIElementStyle* nativeInstance, CM::UINT32 value);
-
-		static void internal_GetMinWidth(ScriptGUIElementStyle* nativeInstance, CM::UINT32* value);
-		static void internal_SetMinWidth(ScriptGUIElementStyle* nativeInstance, CM::UINT32 value);
-
-		static void internal_GetMaxWidth(ScriptGUIElementStyle* nativeInstance, CM::UINT32* value);
-		static void internal_SetMaxWidth(ScriptGUIElementStyle* nativeInstance, CM::UINT32 value);
-
-		static void internal_GetMinHeight(ScriptGUIElementStyle* nativeInstance, CM::UINT32* value);
-		static void internal_SetMinHeight(ScriptGUIElementStyle* nativeInstance, CM::UINT32 value);
-
-		static void internal_GetMaxHeight(ScriptGUIElementStyle* nativeInstance, CM::UINT32* value);
-		static void internal_SetMaxHeight(ScriptGUIElementStyle* nativeInstance, CM::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);
+		static void initRuntimeData()
+		{
+			metaData.scriptClass->addInternalCall("Internal_CreateInstance", &ScriptGUIElementStyle::internal_createInstance);
+			metaData.scriptClass->addInternalCall("Internal_DestroyInstance", &ScriptGUIElementStyle::internal_destroyInstance);
+
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, Font);
+
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, FontSize);
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, TextHorzAlign);
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, TextVertAlign);
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, ImagePosition);
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, WordWrap);
+
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, Normal);
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, Hover);
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, Active);
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, Focused);
+
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, NormalOn);
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, HoverOn);
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, ActiveOn);
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, FocusedOn);
+
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, Border);
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, Margins);
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, ContentOffset);
+
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, Width);
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, Height);
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, MinWidth);
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, MaxWidth);
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, MinHeight);
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, MaxHeight);
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, FixedWidth);
+			CM_SCRIPT_SETGET_META(ScriptGUIElementStyle, FixedHeight);
+		}
+
+		CM_SCRIPT_GETSET_OBJECT_SHRDPTR(ScriptGUIElementStyle, ScriptFont, Font, mElementStyle->font, mFont);
+
+		CM_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, CM::UINT32, FontSize, mElementStyle->fontSize);
+		CM_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, TextHorzAlign, TextHorzAlign, mElementStyle->textHorzAlign);
+		CM_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, TextVertAlign, TextVertAlign, mElementStyle->textVertAlign);
+		CM_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, GUIImagePosition, ImagePosition, mElementStyle->imagePosition);
+		CM_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, bool, WordWrap, mElementStyle->wordWrap);
+
+		CM_SCRIPT_GETSET_OBJECT(ScriptGUIElementStyle, ScriptGUIElementStateStyle, Normal, mElementStyle->normal, mNormal);
+		CM_SCRIPT_GETSET_OBJECT(ScriptGUIElementStyle, ScriptGUIElementStateStyle, Hover, mElementStyle->hover, mHover);
+		CM_SCRIPT_GETSET_OBJECT(ScriptGUIElementStyle, ScriptGUIElementStateStyle, Active, mElementStyle->active, mActive);
+		CM_SCRIPT_GETSET_OBJECT(ScriptGUIElementStyle, ScriptGUIElementStateStyle, Focused, mElementStyle->focused, mFocused);
+
+		CM_SCRIPT_GETSET_OBJECT(ScriptGUIElementStyle, ScriptGUIElementStateStyle, NormalOn, mElementStyle->normalOn, mNormalOn);
+		CM_SCRIPT_GETSET_OBJECT(ScriptGUIElementStyle, ScriptGUIElementStateStyle, HoverOn, mElementStyle->hoverOn, mHoverOn);
+		CM_SCRIPT_GETSET_OBJECT(ScriptGUIElementStyle, ScriptGUIElementStateStyle, ActiveOn, mElementStyle->activeOn, mActiveOn);
+		CM_SCRIPT_GETSET_OBJECT(ScriptGUIElementStyle, ScriptGUIElementStateStyle, FocusedOn, mElementStyle->focusedOn, mFocusedOn);
+
+		CM_SCRIPT_GETSET_VALUE_REF(ScriptGUIElementStyle, RectOffset, Border, mElementStyle->border);
+		CM_SCRIPT_GETSET_VALUE_REF(ScriptGUIElementStyle, RectOffset, Margins, mElementStyle->margins);
+		CM_SCRIPT_GETSET_VALUE_REF(ScriptGUIElementStyle, RectOffset, ContentOffset, mElementStyle->contentOffset);
+
+		CM_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, CM::UINT32, Width, mElementStyle->width);
+		CM_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, CM::UINT32, Height, mElementStyle->height);
+		CM_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, CM::UINT32, MinWidth, mElementStyle->minWidth);
+		CM_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, CM::UINT32, MaxWidth, mElementStyle->maxWidth);
+		CM_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, CM::UINT32, MinHeight, mElementStyle->minHeight);
+		CM_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, CM::UINT32, MaxHeight, mElementStyle->maxHeight);
+		CM_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, bool, FixedWidth, mElementStyle->fixedWidth);
+		CM_SCRIPT_GETSET_VALUE(ScriptGUIElementStyle, bool, FixedHeight, mElementStyle->fixedHeight);
 
 		ScriptGUIElementStyle(const CM::String& name);
 		ScriptGUIElementStyle(const CM::String& name, GUIElementStyle* externalStyle);
@@ -115,13 +106,13 @@ namespace BansheeEngine
 		bool mOwnsStyle;
 
 		ScriptFont* mFont;
-		ScriptGUIElementStyle* mNormal;
-		ScriptGUIElementStyle* mHover;
-		ScriptGUIElementStyle* mActive;
-		ScriptGUIElementStyle* mFocused;
-		ScriptGUIElementStyle* mNormalOn;
-		ScriptGUIElementStyle* mHoverOn;
-		ScriptGUIElementStyle* mActiveOn;
-		ScriptGUIElementStyle* mFocusedOn;
+		ScriptGUIElementStateStyle* mNormal;
+		ScriptGUIElementStateStyle* mHover;
+		ScriptGUIElementStateStyle* mActive;
+		ScriptGUIElementStateStyle* mFocused;
+		ScriptGUIElementStateStyle* mNormalOn;
+		ScriptGUIElementStateStyle* mHoverOn;
+		ScriptGUIElementStateStyle* mActiveOn;
+		ScriptGUIElementStateStyle* mFocusedOn;
 	};
 }

+ 34 - 11
BansheeEngine/Include/BsScriptMacros.h

@@ -1,31 +1,31 @@
 #pragma once
 
 #define CM_SCRIPT_GETSET_VALUE(ParentType, Type, Name, Field)									\
-	void internal_Get##Name##(##ParentType##* nativeInstance, Type##* value)					\
+	static void internal_Get##Name##(##ParentType##* nativeInstance, Type##* value)				\
 	{																							\
 		*value = nativeInstance->##Field;														\
 	}																							\
 																								\
-	void internal_Set##Name##(##ParentType##* nativeInstance, Type value)						\
+	static void internal_Set##Name##(##ParentType##* nativeInstance, Type value)				\
 	{																							\
 		nativeInstance->##Field = value;															\
 	}																							\
 
-#define CM_SCRIPT_GETSET_REF_VALUE(ParentType, Type, Name, Field)								\
-	void internal_Get##Name##(##ParentType##* nativeInstance, Type##* value)					\
+#define CM_SCRIPT_GETSET_VALUE_REF(ParentType, Type, Name, Field)								\
+	static void internal_Get##Name##(##ParentType##* nativeInstance, Type##* value)				\
 	{																							\
 		*value = nativeInstance->##Field;														\
 	}																							\
 																								\
-	void internal_Set##Name##(##ParentType##* nativeInstance, Type* value)						\
+	static void internal_Set##Name##(##ParentType##* nativeInstance, Type##* value)				\
 	{																							\
 		nativeInstance->##Field = *value;														\
 	}																							\
 
-#define CM_SCRIPT_GETSET_OBJECT(ParentType, Type, Name, FieldNative, FieldNativeRaw, FieldManaged)					\
-	void internal_Get##Name##(##ParentType##* nativeInstance, MonoObject** value)									\
+#define CM_SCRIPT_GETSET_OBJECT(ParentType, Type, Name, FieldNative, FieldManaged)									\
+	static void internal_Get##Name##(##ParentType##* nativeInstance, MonoObject** value)							\
 	{																												\
-		throwIfInstancesDontMatch(nativeInstance->##FieldManaged##, nativeInstance->##FieldNativeRaw##);				\
+		throwIfInstancesDontMatch(nativeInstance->##FieldManaged##, &nativeInstance->##FieldNative##);				\
 																													\
 		if(nativeInstance->##FieldManaged != nullptr)																\
 		{																											\
@@ -36,11 +36,34 @@
 		*value = nullptr;																							\
 	}																												\
 																													\
-	void internal_Set##Name##(##ParentType##* nativeInstance, MonoObject* value)									\
+	static void internal_Set##Name##(##ParentType##* nativeInstance, MonoObject* value)								\
 	{																												\
 		Type##* nativeValue = Type##::toNative(value);																\
 		nativeInstance->##FieldNative = nativeValue->getInternalValue();												\
-	}																												
+		nativeInstance->##FieldManaged = nativeValue;																\
+	}
+
+#define CM_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 CM_SCRIPT_SETGET_META(Type, Name)																			\
-	metaData.scriptClass->addInternalCall("Internal_Get##Name##", &##Type##::internal_Get##Name##);
+	metaData.scriptClass->addInternalCall("Internal_Get" #Name, &##Type##::internal_Get##Name##);					\
+	metaData.scriptClass->addInternalCall("Internal_Set" #Name, &##Type##::internal_Set##Name##);

+ 1 - 1
BansheeEngine/Include/BsScriptSpriteTexture.h

@@ -10,7 +10,7 @@ namespace BansheeEngine
 	public:
 		static void initMetaData();
 
-		const SpriteTexturePtr& getInternalTexture() const { return mTexture; }
+		const SpriteTexturePtr& getInternalValue() const { return mTexture; }
 
 	private:
 		static void internal_createInstance(MonoObject* instance);

+ 0 - 41
BansheeEngine/Source/BsScriptGUIElementStateStyle.cpp

@@ -36,18 +36,6 @@ namespace BansheeEngine
 		ScriptManager::registerScriptType(&metaData);
 	}
 
-	void ScriptGUIElementStateStyle::initRuntimeData()
-	{
-		metaData.scriptClass->addInternalCall("Internal_CreateInstance", &ScriptGUIElementStateStyle::internal_createInstance);
-		metaData.scriptClass->addInternalCall("Internal_DestroyInstance", &ScriptGUIElementStateStyle::internal_destroyInstance);
-
-		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)
 	{
 		ScriptGUIElementStateStyle* nativeInstance = new (cm_alloc<ScriptGUIElementStateStyle>()) ScriptGUIElementStateStyle();
@@ -69,33 +57,4 @@ namespace BansheeEngine
 		nativeInstance->destroyInstance();
 		cm_delete(nativeInstance);
 	}
-
-	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->getInternalTexture();
-	}
-
-	void ScriptGUIElementStateStyle::internal_GetTextColor(ScriptGUIElementStateStyle* nativeInstance, Color* value)
-	{
-		*value = nativeInstance->mElementStateStyle->textColor;
-	}
-
-	void ScriptGUIElementStateStyle::internal_SetTextColor(ScriptGUIElementStateStyle* nativeInstance, Color* value)
-	{
-		nativeInstance->mElementStateStyle->textColor = *value;
-	}
 }

+ 0 - 367
BansheeEngine/Source/BsScriptGUIElementStyle.cpp

@@ -39,18 +39,6 @@ namespace BansheeEngine
 		ScriptManager::registerScriptType(&metaData);
 	}
 
-	void ScriptGUIElementStyle::initRuntimeData()
-	{
-		metaData.scriptClass->addInternalCall("Internal_CreateInstance", &ScriptGUIElementStyle::internal_createInstance);
-		metaData.scriptClass->addInternalCall("Internal_DestroyInstance", &ScriptGUIElementStyle::internal_destroyInstance);
-
-		metaData.scriptClass->addInternalCall("Internal_GetFont", &ScriptGUIElementStyle::internal_GetFont);
-		metaData.scriptClass->addInternalCall("Internal_SetFont", &ScriptGUIElementStyle::internal_SetFont);
-
-		metaData.scriptClass->addInternalCall("Internal_Getfont", &ScriptGUIElementStyle::internal_GetFont);
-		metaData.scriptClass->addInternalCall("Internal_Getfont", &ScriptGUIElementStyle::internal_GetFont);
-	}
-
 	void ScriptGUIElementStyle::internal_createInstance(MonoObject* instance, MonoString* name)
 	{
 		char* nativeName = mono_string_to_utf8(name);
@@ -80,359 +68,4 @@ namespace BansheeEngine
 		nativeInstance->destroyInstance();
 		cm_delete(nativeInstance);
 	}
-
-	void ScriptGUIElementStyle::internal_GetFont(ScriptGUIElementStyle* nativeInstance, MonoObject** value)
-	{
-		throwIfInstancesDontMatch(nativeInstance->mFont, nativeInstance->mElementStyle->font.get());
-
-		if(nativeInstance->mFont != nullptr)
-		{
-			*value = nativeInstance->mFont->getManagedInstance();
-			return;
-		}
-
-		*value = nullptr;
-	}
-
-	void ScriptGUIElementStyle::internal_SetFont(ScriptGUIElementStyle* nativeInstance, MonoObject* value)
-	{
-		ScriptFont* nativeValue = ScriptFont::toNative(value);
-		nativeInstance->mElementStyle->font = nativeValue->getInternalValue();
-	}
-
-
-	void ScriptGUIElementStyle::internal_GetFontSize(ScriptGUIElementStyle* nativeInstance, CM::UINT32* value)
-	{
-		*value = nativeInstance->mElementStyle->fontSize;
-	}
-
-	void ScriptGUIElementStyle::internal_SetFontSize(ScriptGUIElementStyle* nativeInstance, CM::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();
-	}
-
-
-	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();
-	}
-
-
-	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();
-	}
-
-
-	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();
-	}
-
-
-	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();
-	}
-
-
-	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();
-	}
-
-
-	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();
-	}
-
-
-	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();
-	}
-
-
-	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;
-	}
 }

+ 2 - 2
MBansheeEngine/Program.cs

@@ -11,8 +11,8 @@ namespace BansheeEngine
             Color newColor = Color.red;
 
             dbgStyle.textColor = newColor;
-            Color myColor = dbgStyle.textColor;
-            dbgStyle.textColor = myColor;
+            //Color myColor = dbgStyle.textColor;
+            //dbgStyle.textColor = myColor;
         }
     }
 }