Ver código fonte

Documentation

Marko Pintera 10 anos atrás
pai
commit
c2038fb509

+ 10 - 0
SBansheeEditor/Include/BsScriptHandleSliderManager.h

@@ -5,12 +5,22 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Tracks all managed handle sliders.
+	 */
 	class BS_SCR_BED_EXPORT ScriptHandleSliderManager : public Module<ScriptHandleSliderManager>
 	class BS_SCR_BED_EXPORT ScriptHandleSliderManager : public Module<ScriptHandleSliderManager>
 	{
 	{
 	public:
 	public:
 		~ScriptHandleSliderManager();
 		~ScriptHandleSliderManager();
 
 
+		/**
+		 * @brief	Registers a new active managed handle slider.
+		 */
 		void registerSlider(ScriptHandleSliderBase* slider);
 		void registerSlider(ScriptHandleSliderBase* slider);
+
+		/**
+		 * @brief	Unregisters a managed handle slider when it is destroyed.
+		 */
 		void unregisterSlider(ScriptHandleSliderBase* slider);
 		void unregisterSlider(ScriptHandleSliderBase* slider);
 
 
 	private:
 	private:

+ 18 - 5
SBansheeEditor/Include/BsScriptHandleSliderPlane.h

@@ -8,22 +8,35 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for HandleSliderPlane.
+	 */
 	class BS_SCR_BED_EXPORT ScriptHandleSliderPlane : public ScriptObject <ScriptHandleSliderPlane, ScriptHandleSliderBase>
 	class BS_SCR_BED_EXPORT ScriptHandleSliderPlane : public ScriptObject <ScriptHandleSliderPlane, ScriptHandleSliderBase>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "HandleSliderPlane")
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "HandleSliderPlane")
 
 
 	protected:
 	protected:
-		virtual HandleSlider* getSlider() const { return mSlider; }
-		virtual void destroyInternal();
+		/**
+		 * @copydoc	ScriptHandleSliderBase::getSlider
+		 */
+		virtual HandleSlider* getSlider() const override { return mSlider; }
 
 
-	private:
-		static void internal_CreateInstance(MonoObject* instance, Vector3 dir1, Vector3 dir2, float length, bool fixedScale);
-		static void internal_GetDelta(ScriptHandleSliderPlane* nativeInstance, Vector2* value);
+		/**
+		 * @copydoc	ScriptHandleSliderBase::getSlider
+		 */
+		virtual void destroyInternal() override;
 
 
+	private:
 		ScriptHandleSliderPlane(MonoObject* instance, const Vector3& dir1, const Vector3& dir2, float length, bool fixedScale);
 		ScriptHandleSliderPlane(MonoObject* instance, const Vector3& dir1, const Vector3& dir2, float length, bool fixedScale);
 		~ScriptHandleSliderPlane();
 		~ScriptHandleSliderPlane();
 
 
 		HandleSliderPlane* mSlider;
 		HandleSliderPlane* mSlider;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_CreateInstance(MonoObject* instance, Vector3 dir1, Vector3 dir2, float length, bool fixedScale);
+		static void internal_GetDelta(ScriptHandleSliderPlane* nativeInstance, Vector2* value);
 	};
 	};
 }
 }

+ 75 - 10
SBansheeEditor/Include/BsScriptImportOptions.h

@@ -7,9 +7,16 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Base class for all C++/CLR interop objects wrapping various
+	 *			implementations of ImportOptions.
+	 */
 	class BS_SCR_BED_EXPORT ScriptImportOptionsBase : public ScriptObjectBase
 	class BS_SCR_BED_EXPORT ScriptImportOptionsBase : public ScriptObjectBase
 	{
 	{
 	public:
 	public:
+		/**
+		 * @brief	Returns the internal native import options.
+		 */
 		SPtr<ImportOptions> getImportOptions() const { return mImportOptions; }
 		SPtr<ImportOptions> getImportOptions() const { return mImportOptions; }
 
 
 	protected:
 	protected:
@@ -19,31 +26,55 @@ namespace BansheeEngine
 		SPtr<ImportOptions> mImportOptions;
 		SPtr<ImportOptions> mImportOptions;
 	};
 	};
 
 
+	/**
+	 * @brief	Interop class between C++ & CLR for ImportOptions.
+	 */
 	class BS_SCR_BED_EXPORT ScriptImportOptions : public ScriptObject <ScriptImportOptions, ScriptImportOptionsBase>
 	class BS_SCR_BED_EXPORT ScriptImportOptions : public ScriptObject <ScriptImportOptions, ScriptImportOptionsBase>
 	{
 	{
 	public:
 	public:
-		static String getAssemblyName() { return EDITOR_ASSEMBLY; }
-		static String getNamespace() { return "BansheeEditor"; }
-		static String getTypeName() { return "ImportOptions"; }
-		static void initRuntimeData() { }
+		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "ImportOptions")
 
 
+		/**
+		 * @brief	Creates a new managed ImportOptions instance containing
+		 *			the provided import options.
+		 */
 		static MonoObject* create(const SPtr<ImportOptions>& importOptions);
 		static MonoObject* create(const SPtr<ImportOptions>& importOptions);
 
 
 	private:
 	private:
 		ScriptImportOptions(MonoObject* instance);
 		ScriptImportOptions(MonoObject* instance);
 	};
 	};
 
 
+	/**
+	 * @brief	Interop class between C++ & CLR for TextureImportOptions.
+	 */
 	class BS_SCR_BED_EXPORT ScriptTextureImportOptions : public ScriptObject<ScriptTextureImportOptions, ScriptImportOptionsBase>
 	class BS_SCR_BED_EXPORT ScriptTextureImportOptions : public ScriptObject<ScriptTextureImportOptions, ScriptImportOptionsBase>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "TextureImportOptions")
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "TextureImportOptions")
 
 
+		/**
+		 * @brief	Creates a new managed TextureImportOptions instance containing the 
+		 *			default import options for textures.
+		 */
 		static MonoObject* create();
 		static MonoObject* create();
+
+		/**
+		 * @brief	Creates a new managed TextureImportOptions instance containing 
+		 *			the provided import options.
+		 */
 		static MonoObject* create(const SPtr<TextureImportOptions>& options);
 		static MonoObject* create(const SPtr<TextureImportOptions>& options);
 
 
 	private:
 	private:
+		ScriptTextureImportOptions(MonoObject* instance);
+
+		/**
+		 * @brief	Returns the internal native import options.
+		 */
 		SPtr<TextureImportOptions> getTexImportOptions();
 		SPtr<TextureImportOptions> getTexImportOptions();
 
 
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
 		static void internal_CreateInstance(MonoObject* instance);
 		static void internal_CreateInstance(MonoObject* instance);
 		static PixelFormat internal_GetPixelFormat(ScriptTextureImportOptions* thisPtr);
 		static PixelFormat internal_GetPixelFormat(ScriptTextureImportOptions* thisPtr);
 		static void internal_SetPixelFormat(ScriptTextureImportOptions* thisPtr, PixelFormat value);
 		static void internal_SetPixelFormat(ScriptTextureImportOptions* thisPtr, PixelFormat value);
@@ -51,21 +82,39 @@ namespace BansheeEngine
 		static void internal_SetGenerateMipmaps(ScriptTextureImportOptions* thisPtr, bool value);
 		static void internal_SetGenerateMipmaps(ScriptTextureImportOptions* thisPtr, bool value);
 		static UINT32 internal_GetMaxMipmapLevel(ScriptTextureImportOptions* thisPtr);
 		static UINT32 internal_GetMaxMipmapLevel(ScriptTextureImportOptions* thisPtr);
 		static void internal_SetMaxMipmapLevel(ScriptTextureImportOptions* thisPtr, UINT32 value);
 		static void internal_SetMaxMipmapLevel(ScriptTextureImportOptions* thisPtr, UINT32 value);
-
-		ScriptTextureImportOptions(MonoObject* instance);
 	};
 	};
 
 
+	/**
+	 * @brief	Interop class between C++ & CLR for FontImportOptions.
+	 */
 	class BS_SCR_BED_EXPORT ScriptFontImportOptions : public ScriptObject <ScriptFontImportOptions, ScriptImportOptionsBase>
 	class BS_SCR_BED_EXPORT ScriptFontImportOptions : public ScriptObject <ScriptFontImportOptions, ScriptImportOptionsBase>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "FontImportOptions")
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "FontImportOptions")
 
 
+		/**
+		 * @brief	Creates a new managed FontImportOptions instance containing the 
+		 *			default import options for fonts.
+		 */
 		static MonoObject* create();
 		static MonoObject* create();
+
+		/**
+		 * @brief	Creates a new managed FontImportOptions instance containing 
+		 *			the provided import options.
+		 */
 		static MonoObject* create(const SPtr<FontImportOptions>& options);
 		static MonoObject* create(const SPtr<FontImportOptions>& options);
 
 
 	private:
 	private:
+		ScriptFontImportOptions(MonoObject* instance);
+
+		/**
+		 * @brief	Returns the internal native import options.
+		 */
 		SPtr<FontImportOptions> getFontImportOptions();
 		SPtr<FontImportOptions> getFontImportOptions();
 
 
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
 		static void internal_CreateInstance(MonoObject* instance);
 		static void internal_CreateInstance(MonoObject* instance);
 		static MonoArray* internal_GetFontSizes(ScriptFontImportOptions* thisPtr);
 		static MonoArray* internal_GetFontSizes(ScriptFontImportOptions* thisPtr);
 		static void internal_SetFontSizes(ScriptFontImportOptions* thisPtr, MonoArray* value);
 		static void internal_SetFontSizes(ScriptFontImportOptions* thisPtr, MonoArray* value);
@@ -75,25 +124,41 @@ namespace BansheeEngine
 		static void internal_SetAntialiasing(ScriptFontImportOptions* thisPtr, bool value);
 		static void internal_SetAntialiasing(ScriptFontImportOptions* thisPtr, bool value);
 		static MonoArray* internal_GetCharRanges(ScriptFontImportOptions* thisPtr);
 		static MonoArray* internal_GetCharRanges(ScriptFontImportOptions* thisPtr);
 		static void internal_SetCharRanges(ScriptFontImportOptions* thisPtr, MonoArray* value);
 		static void internal_SetCharRanges(ScriptFontImportOptions* thisPtr, MonoArray* value);
-
-		ScriptFontImportOptions(MonoObject* instance);
 	};
 	};
 
 
+	/**
+	 * @brief	Interop class between C++ & CLR for ScriptCodeImportOptions.
+	 */
 	class BS_SCR_BED_EXPORT ScriptScriptCodeImportOptions : public ScriptObject <ScriptScriptCodeImportOptions, ScriptImportOptionsBase>
 	class BS_SCR_BED_EXPORT ScriptScriptCodeImportOptions : public ScriptObject <ScriptScriptCodeImportOptions, ScriptImportOptionsBase>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "ScriptCodeImportOptions")
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "ScriptCodeImportOptions")
 
 
+		/**
+		 * @brief	Creates a new managed ScriptCodeImportOptions instance containing the 
+		 *			default import options for script code files.
+		 */
 		static MonoObject* create();
 		static MonoObject* create();
+
+		/**
+		 * @brief	Creates a new managed ScriptCodeImportOptions instance containing 
+		 *			the provided import options.
+		 */
 		static MonoObject* create(const SPtr<ScriptCodeImportOptions>& options);
 		static MonoObject* create(const SPtr<ScriptCodeImportOptions>& options);
 
 
 	private:
 	private:
+		ScriptScriptCodeImportOptions(MonoObject* instance);
+
+		/**
+		 * @brief	Returns the internal native import options.
+		 */
 		SPtr<ScriptCodeImportOptions> getCodeImportOptions();
 		SPtr<ScriptCodeImportOptions> getCodeImportOptions();
 
 
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
 		static void internal_CreateInstance(MonoObject* instance);
 		static void internal_CreateInstance(MonoObject* instance);
 		static bool internal_IsEditorScript(ScriptScriptCodeImportOptions* thisPtr);
 		static bool internal_IsEditorScript(ScriptScriptCodeImportOptions* thisPtr);
 		static void internal_SetEditorScript(ScriptScriptCodeImportOptions* thisPtr, bool value);
 		static void internal_SetEditorScript(ScriptScriptCodeImportOptions* thisPtr, bool value);
-
-		ScriptScriptCodeImportOptions(MonoObject* instance);
 	};
 	};
 }
 }

+ 94 - 12
SBansheeEditor/Include/BsScriptModalWindow.h

@@ -9,8 +9,14 @@ namespace BansheeEngine
 {
 {
 	class ManagedModalWindow;
 	class ManagedModalWindow;
 
 
+	/**
+	 * @brief	Interop class between C++ & CLR for ManagedModalWindow.
+	 */
 	class BS_SCR_BED_EXPORT ScriptModalWindow : public ScriptObject <ScriptModalWindow, PersistentScriptObjectBase>
 	class BS_SCR_BED_EXPORT ScriptModalWindow : public ScriptObject <ScriptModalWindow, PersistentScriptObjectBase>
 	{
 	{
+		/**
+		 * @brief	Contains data about the managed handle to a modal window.
+		 */
 		struct ModalWindowHandle
 		struct ModalWindowHandle
 		{
 		{
 			uint32_t gcHandle;
 			uint32_t gcHandle;
@@ -26,22 +32,34 @@ namespace BansheeEngine
 
 
 		ScriptModalWindow(ManagedModalWindow* editorWidget);
 		ScriptModalWindow(ManagedModalWindow* editorWidget);
 
 
-		static void internal_createInstance(MonoObject* instance, bool allowCloseButton);
-		static void internal_close(ScriptModalWindow* thisPtr);
-		static UINT32 internal_getWidth(ScriptModalWindow* thisPtr);
-		static UINT32 internal_getHeight(ScriptModalWindow* thisPtr);
-		static void internal_setWidth(ScriptModalWindow* thisPtr, UINT32 value);
-		static void internal_setHeight(ScriptModalWindow* thisPtr, UINT32 value);
-		static void internal_setTitle(ScriptModalWindow* thisPtr, MonoObject* title);
-		static void internal_screenToWindowPos(ScriptModalWindow* thisPtr, Vector2I screenPos, Vector2I* windowPos);
-		static void internal_windowToScreenPos(ScriptModalWindow* thisPtr, Vector2I windowPos, Vector2I* screenPos);
-
-		void onAssemblyRefreshStarted();
-
+		/**
+		 * @copydoc	ScriptObjectBase::_onManagedInstanceDeleted
+		 */
 		void _onManagedInstanceDeleted() override;
 		void _onManagedInstanceDeleted() override;
+
+		/**
+		 * @copydoc	ScriptObjectBase::beginRefresh
+		 */
 		ScriptObjectBackup beginRefresh() override;
 		ScriptObjectBackup beginRefresh() override;
+
+		/**
+		 * @copydoc	ScriptObjectBase::endRefresh
+		 */
 		void endRefresh(const ScriptObjectBackup& backupData) override;
 		void endRefresh(const ScriptObjectBackup& backupData) override;
+
+		/**
+		 * @copydoc	ScriptObjectBase::_createManagedInstance
+		 */
 		MonoObject* _createManagedInstance(bool construct) override;
 		MonoObject* _createManagedInstance(bool construct) override;
+
+		/**
+		 * @brief	Triggered when assembly refresh has started.
+		 */
+		void onAssemblyRefreshStarted();
+
+		/**
+		 * @brief	Triggered when the native modal window is closed.
+		 */
 		void notifyWindowDestroyed();
 		void notifyWindowDestroyed();
 
 
 		ManagedModalWindow* mModalWindow;
 		ManagedModalWindow* mModalWindow;
@@ -49,26 +67,90 @@ namespace BansheeEngine
 		bool mRefreshInProgress;
 		bool mRefreshInProgress;
 
 
 		static MonoField* guiPanelField;
 		static MonoField* guiPanelField;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		static void internal_createInstance(MonoObject* instance, bool allowCloseButton);
+		static void internal_close(ScriptModalWindow* thisPtr);
+		static UINT32 internal_getWidth(ScriptModalWindow* thisPtr);
+		static UINT32 internal_getHeight(ScriptModalWindow* thisPtr);
+		static void internal_setWidth(ScriptModalWindow* thisPtr, UINT32 value);
+		static void internal_setHeight(ScriptModalWindow* thisPtr, UINT32 value);
+		static void internal_setTitle(ScriptModalWindow* thisPtr, MonoObject* title);
+		static void internal_screenToWindowPos(ScriptModalWindow* thisPtr, Vector2I screenPos, Vector2I* windowPos);
+		static void internal_windowToScreenPos(ScriptModalWindow* thisPtr, Vector2I windowPos, Vector2I* screenPos);
 	};
 	};
 
 
+	/**
+	 * @brief	Modal window implementation that handles managed modal window implementations.
+	 *			Each implementation is wrapped in this object and then managed by its parent interop
+	 *			object of ScriptModalWindow type.
+	 */
 	class BS_SCR_BED_EXPORT ManagedModalWindow : public ModalWindow
 	class BS_SCR_BED_EXPORT ManagedModalWindow : public ModalWindow
 	{
 	{
 	public:
 	public:
 		ManagedModalWindow(bool allowCloseButton, MonoObject* managedInstance);
 		ManagedModalWindow(bool allowCloseButton, MonoObject* managedInstance);
 		~ManagedModalWindow();
 		~ManagedModalWindow();
 
 
+		/**
+		 * @brief	Attempts to create a managed instance for the modal window described by the
+		 *			type provided upon construction.
+		 *
+		 * @return	True if the managed instance was created.
+		 */
 		bool createManagedInstance();
 		bool createManagedInstance();
+
+		/**
+		 * @brief	Releases the internally held handle to the managed instance. This will cause
+		 *			managed instance to be destroyed if no other references are being held.
+		 */
 		void releaseManagedInstance();
 		void releaseManagedInstance();
 
 
+		/**
+		 * @brief	Sets the parent interop object that handles part of the communication
+		 *			between this object and the managed instance.
+		 */
 		void setParent(ScriptModalWindow* parent);
 		void setParent(ScriptModalWindow* parent);
+
+		/**
+		 * @copydoc	ModalWindow::update 
+		 */
 		void update() override;
 		void update() override;
+		
+		/**
+		 * @brief	Loads all required mono methods, fields and types required
+		 *			for operation of this object. Must be called after construction
+		 *			and after assembly refresh.
+		 *
+		 * @param	windowClass	Mono class to load the types from.
+		 */
 		void reloadMonoTypes(MonoClass* windowClass);
 		void reloadMonoTypes(MonoClass* windowClass);
+
+		/**
+		 * @brief	Triggers OnInitialize callbacks on the managed instance.
+		 */
 		void triggerOnInitialize();
 		void triggerOnInitialize();
+
+		/**
+		 * @brief	Triggers OnDestroy callbacks on the managed instance.
+		 */
 		void triggerOnDestroy();
 		void triggerOnDestroy();
 
 
+		/**
+		 * @brief	Returns the managed instance for the modal window
+		 *			represented by this object.
+		 */
 		MonoObject* getManagedInstance() const { return mManagedInstance; }
 		MonoObject* getManagedInstance() const { return mManagedInstance; }
 	protected:
 	protected:
+		/**
+		 * @copydoc	ModalWindow::resized
+		 */
 		virtual void resized() override;
 		virtual void resized() override;
+
+		/**
+		 * @copydoc	ModalWindow::close
+		 */
 		virtual void close() override;
 		virtual void close() override;
 
 
 	private:
 	private:

+ 106 - 24
SBansheeEditor/Include/BsScriptOSDropTarget.h

@@ -6,58 +6,140 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Interop class between C++ & CLR for OSDropTarget. Managed drop target
+	 *			is always associated with a managed EditorWindow.
+	 */
 	class BS_SCR_BED_EXPORT ScriptOSDropTarget : public ScriptObject <ScriptOSDropTarget>
 	class BS_SCR_BED_EXPORT ScriptOSDropTarget : public ScriptObject <ScriptOSDropTarget>
 	{
 	{
 	public:
 	public:
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "OSDropTarget")
 		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "OSDropTarget")
 
 
 	private:
 	private:
-		ScriptEditorWindow* mParent;
-		OSDropTarget* mDropTarget;
-		Rect2I mParentArea;
-		Rect2I mArea;
-		bool mIsDestroyed;
-
-		HEvent mDropTargetEnterConn;
-		HEvent mDropTargetMoveConn;
-		HEvent mDropTargetLeaveConn;
-		HEvent mDropTargetDroppedConn;
-		HEvent mWidgetParentChangedConn;
-		HEvent mWidgetMovedConn;
-		HEvent mWidgetResizedConn;
-
 		ScriptOSDropTarget(MonoObject* instance, ScriptEditorWindow* parent);
 		ScriptOSDropTarget(MonoObject* instance, ScriptEditorWindow* parent);
 		~ScriptOSDropTarget();
 		~ScriptOSDropTarget();
 
 
+		/**
+		 * @brief	Destroys the internal native drop target.
+		 */
 		void destroy();
 		void destroy();
+
+		/**
+		 * @brief	Creates an internal native drop target over the specified window. Any previous
+		 *			drop target is overwritten.
+		 * 
+		 * @param	parentWindow	Window the drop target is located on.
+		 * @param	x				X position of the drop target, relative to window, in pixels.
+		 * @param	y				Y position of the drop target, relative to window, in pixels.
+		 * @param	width			Width of the drop target in pixels.
+		 * @param	height			Height of the drop target in pixels.
+		 */
 		void setDropTarget(const RenderWindowPtr& parentWindow, INT32 x, INT32 y, UINT32 width, UINT32 height);
 		void setDropTarget(const RenderWindowPtr& parentWindow, INT32 x, INT32 y, UINT32 width, UINT32 height);
+
+		/**
+		 * @brief	Updates bounds of an existing drop target.
+		 *
+		 * @param	bounds	Area of the drop target relative to 
+		 *			the editor widget (EditorWindow in managed terms).
+		 */
 		void setBounds(const Rect2I& bounds);
 		void setBounds(const Rect2I& bounds);
 
 
+		/**
+		 * @brief	Triggered when editor widget (EditorWindow in managed terms) parent
+		 *			changes. This might mean we need to re-create the drop target
+		 *			as the parent render window might have changed.
+		 */
 		void widgetParentChanged(EditorWidgetContainer* parent);
 		void widgetParentChanged(EditorWidgetContainer* parent);
+
+		/**
+		 * @brief	Triggered when the parent editor widget (EditorWindow in managed terms) is resized.
+		 */
 		void widgetResized(UINT32 width, UINT32 height);
 		void widgetResized(UINT32 width, UINT32 height);
+
+		/**
+		 * @brief	Triggered when the parent editor widget (EditorWindow in managed terms) is moved.
+		 */
 		void widgetMoved(INT32 x, INT32 y);
 		void widgetMoved(INT32 x, INT32 y);
 
 
+		/**
+		 * @brief	Returns the editor widget (EditorWindow in managed terms) this drop target belongs to.
+		 */
 		EditorWidgetBase* getParentWidget() const;
 		EditorWidgetBase* getParentWidget() const;
-		Rect2I getDropTargetArea() const;
-
-		typedef void(__stdcall *OnEnterThunkDef) (MonoObject*, INT32, INT32, MonoException**);
-		typedef void(__stdcall *OnMoveDef) (MonoObject*, INT32, INT32, MonoException**);
-		typedef void(__stdcall *OnLeaveDef) (MonoObject*, MonoException**);
-		typedef void(__stdcall *OnDropThunkDef) (MonoObject*, INT32, INT32, MonoException**);
 
 
-		static void internal_CreateInstance(MonoObject* instance, ScriptEditorWindow* editorWindow);
-		static void internal_Destroy(ScriptOSDropTarget* nativeInstance);
-		static void internal_SetBounds(ScriptOSDropTarget* nativeInstance, Rect2I bounds);
-		static MonoArray* internal_GetFilePaths(ScriptOSDropTarget* nativeInstance);
+		/**
+		 * @brief	Returns the bounds of the drop target, relative to the parent window. This depends
+		 *			of set bounds using ::setBounds and the current position and size of the editor widget.
+		 */
+		Rect2I getDropTargetArea() const;
 
 
+		/**
+		 * @brief	Triggered when the drag and drop operation has entered the area over an OS drop target.
+		 *
+		 * @param	thisPtr		C++/CLR interop object that contains the native OSDropTarget
+		 *						that triggered the event.
+		 * @param	x			X coordinate of the pointer, relative to parent window, in pixels.
+		 * @param	y			Y coordinate of the pointer, relative to parent window, in pixels.
+		 */
 		static void dropTargetDragEnter(ScriptOSDropTarget* thisPtr, INT32 x, INT32 y);
 		static void dropTargetDragEnter(ScriptOSDropTarget* thisPtr, INT32 x, INT32 y);
+
+		/**
+		 * @brief	Triggered every frame that pointer moves while over the area over an OS drop target.
+		 *
+		 * @param	thisPtr		C++/CLR interop object that contains the native OSDropTarget
+		 *						that triggered the event.
+		 * @param	x			X coordinate of the pointer, relative to parent window, in pixels.
+		 * @param	y			Y coordinate of the pointer, relative to parent window, in pixels.
+		 */
 		static void dropTargetDragMove(ScriptOSDropTarget* thisPtr, INT32 x, INT32 y);
 		static void dropTargetDragMove(ScriptOSDropTarget* thisPtr, INT32 x, INT32 y);
+
+		/**
+		 * @brief	Triggered when the drag and drop operation has left the area over an OS drop target.
+		 *
+		 * @param	thisPtr		C++/CLR interop object that contains the native OSDropTarget
+		 *						that triggered the event.
+		 */
 		static void dropTargetDragLeave(ScriptOSDropTarget* thisPtr);
 		static void dropTargetDragLeave(ScriptOSDropTarget* thisPtr);
+
+		/**
+		 * @brief	Triggered when the drag and drop operation has finished over an OS drop target.
+		 *
+		 * @param	thisPtr		C++/CLR interop object that contains the native OSDropTarget
+		 *						that triggered the event.
+		 * @param	x			X coordinate of the pointer, relative to parent window, in pixels.
+		 * @param	y			Y coordinate of the pointer, relative to parent window, in pixels.
+		 */
 		static void dropTargetDragDropped(ScriptOSDropTarget* thisPtr, INT32 x, INT32 y);
 		static void dropTargetDragDropped(ScriptOSDropTarget* thisPtr, INT32 x, INT32 y);
 
 
+		ScriptEditorWindow* mParent;
+		OSDropTarget* mDropTarget;
+		Rect2I mParentArea;
+		Rect2I mArea;
+		bool mIsDestroyed;
+
+		HEvent mDropTargetEnterConn;
+		HEvent mDropTargetMoveConn;
+		HEvent mDropTargetLeaveConn;
+		HEvent mDropTargetDroppedConn;
+		HEvent mWidgetParentChangedConn;
+		HEvent mWidgetMovedConn;
+		HEvent mWidgetResizedConn;
+
+		/************************************************************************/
+		/* 								CLR HOOKS						   		*/
+		/************************************************************************/
+		typedef void(__stdcall *OnEnterThunkDef) (MonoObject*, INT32, INT32, MonoException**);
+		typedef void(__stdcall *OnMoveDef) (MonoObject*, INT32, INT32, MonoException**);
+		typedef void(__stdcall *OnLeaveDef) (MonoObject*, MonoException**);
+		typedef void(__stdcall *OnDropThunkDef) (MonoObject*, INT32, INT32, MonoException**);
+
 		static OnEnterThunkDef onEnterThunk;
 		static OnEnterThunkDef onEnterThunk;
 		static OnMoveDef onMoveThunk;
 		static OnMoveDef onMoveThunk;
 		static OnLeaveDef onLeaveThunk;
 		static OnLeaveDef onLeaveThunk;
 		static OnDropThunkDef onDropThunk;
 		static OnDropThunkDef onDropThunk;
+
+		static void internal_CreateInstance(MonoObject* instance, ScriptEditorWindow* editorWindow);
+		static void internal_Destroy(ScriptOSDropTarget* nativeInstance);
+		static void internal_SetBounds(ScriptOSDropTarget* nativeInstance, Rect2I bounds);
+		static MonoArray* internal_GetFilePaths(ScriptOSDropTarget* nativeInstance);
 	};
 	};
 }
 }

+ 3 - 0
SBansheeEditor/Source/BsScriptImportOptions.cpp

@@ -25,6 +25,9 @@ namespace BansheeEngine
 		:ScriptObjectBase(instance)
 		:ScriptObjectBase(instance)
 	{ }
 	{ }
 
 
+	void ScriptImportOptions::initRuntimeData() 
+	{ }
+
 	MonoObject* ScriptImportOptions::create(const SPtr<ImportOptions>& importOptions)
 	MonoObject* ScriptImportOptions::create(const SPtr<ImportOptions>& importOptions)
 	{
 	{
 		UINT32 typeId = importOptions->getRTTI()->getRTTIId();
 		UINT32 typeId = importOptions->getRTTI()->getRTTIId();

+ 3 - 0
TODO.txt

@@ -54,6 +54,9 @@ Polish
 
 
 Test:
 Test:
  - Saving a scene seems to create another (unselectable) copy of the dragon mesh
  - Saving a scene seems to create another (unselectable) copy of the dragon mesh
+  - Renderable/Light/Camera components initialize their handlers in constructors
+  - Moving them to OnInitialize doesn't solve the issue because when deserializing
+    those components OnInitialize will then overwrite any deserialized data
  - Loading a saved level doesn't seem to persist scene object positions
  - Loading a saved level doesn't seem to persist scene object positions
  - Loaded scene test component has empty values
  - Loaded scene test component has empty values
  - Loading a scene multiple times causes an exception when updating Renderables in scene manager
  - Loading a scene multiple times causes an exception when updating Renderables in scene manager