| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
- //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
- #pragma once
- #include "BsScriptEditorPrerequisites.h"
- #include "BsScriptObject.h"
- #include "Build/BsPlatformInfo.h"
- namespace bs
- {
- class ScriptRRefBase;
- /** @addtogroup ScriptInteropEditor
- * @{
- */
- /** Base class for all C++/CLR interop objects dealing with specific PlatformInfo implementations. */
- class BS_SCR_BED_EXPORT ScriptPlatformInfoBase : public ScriptObjectBase
- {
- public:
- /** Returns the internal native platform info object. */
- SPtr<PlatformInfo> getPlatformInfo() const { return mPlatformInfo; }
- protected:
- ScriptPlatformInfoBase(MonoObject* instance);
- virtual ~ScriptPlatformInfoBase() = default;
- SPtr<PlatformInfo> mPlatformInfo;
- };
- /** Interop class between C++ & CLR for PlatformInfo. */
- class BS_SCR_BED_EXPORT ScriptPlatformInfo : public ScriptObject <ScriptPlatformInfo, ScriptPlatformInfoBase>
- {
- public:
- SCRIPT_OBJ(EDITOR_ASSEMBLY, EDITOR_NS, "PlatformInfo")
- /** Creates a new managed platform info object that wraps the provided native platform info. */
- static MonoObject* create(const SPtr<PlatformInfo>& platformInfo);
- private:
- ScriptPlatformInfo(MonoObject* instance);
- /************************************************************************/
- /* CLR HOOKS */
- /************************************************************************/
- static PlatformType internal_GetType(ScriptPlatformInfoBase* thisPtr);
- static MonoString* internal_GetDefines(ScriptPlatformInfoBase* thisPtr);
- static void internal_SetDefines(ScriptPlatformInfoBase* thisPtr, MonoString* value);
- static MonoObject* internal_GetMainScene(ScriptPlatformInfoBase* thisPtr);
- static void internal_SetMainScene(ScriptPlatformInfoBase* thisPtr, ScriptRRefBase* prefabRef);
- static bool internal_GetFullscreen(ScriptPlatformInfoBase* thisPtr);
- static void internal_SetFullscreen(ScriptPlatformInfoBase* thisPtr, bool fullscreen);
- static void internal_GetResolution(ScriptPlatformInfoBase* thisPtr, UINT32* width, UINT32* height);
- static void internal_SetResolution(ScriptPlatformInfoBase* thisPtr, UINT32 width, UINT32 height);
- static bool internal_GetDebug(ScriptPlatformInfoBase* thisPtr);
- static void internal_SetDebug(ScriptPlatformInfoBase* thisPtr, bool debug);
- };
- /** Interop class between C++ & CLR for WinPlatformInfo. */
- class BS_SCR_BED_EXPORT ScriptWinPlatformInfo : public ScriptObject <ScriptWinPlatformInfo, ScriptPlatformInfoBase>
- {
- public:
- SCRIPT_OBJ(EDITOR_ASSEMBLY, EDITOR_NS, "WinPlatformInfo")
- /** Creates a new managed platform info object that wraps the provided native platform info. */
- static MonoObject* create(const SPtr<WinPlatformInfo>& platformInfo);
- private:
- ScriptWinPlatformInfo(MonoObject* instance);
- /** Returns the internal native Windows platform info object. */
- SPtr<WinPlatformInfo> getWinPlatformInfo() const;
- /************************************************************************/
- /* CLR HOOKS */
- /************************************************************************/
- static MonoObject* internal_GetIcon(ScriptWinPlatformInfo* thisPtr);
- static void internal_SetIcon(ScriptWinPlatformInfo* thisPtr, ScriptRRefBase* textureRef);
- static MonoString* internal_GetTitleText(ScriptWinPlatformInfo* thisPtr);
- static void internal_SetTitleText(ScriptWinPlatformInfo* thisPtr, MonoString* text);
- };
- /** @} */
- }
|