BsScriptGUITextureField.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsScriptEditorPrerequisites.h"
  5. #include "BsScriptGUIElement.h"
  6. namespace BansheeEngine
  7. {
  8. /** @addtogroup ScriptInteropEditor
  9. * @{
  10. */
  11. /** Interop class between C++ & CLR for GUITextureField. */
  12. class BS_SCR_BED_EXPORT ScriptGUITextureField : public TScriptGUIElement <ScriptGUITextureField>
  13. {
  14. public:
  15. SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUITextureField")
  16. private:
  17. /**
  18. * Triggered when the value in the native texture field changes.
  19. *
  20. * @param[in] instance Managed GUITextureField instance.
  21. * @param[in] newHandle Handle of the new texture.
  22. */
  23. static void onChanged(MonoObject* instance, const WeakResourceHandle<Texture>& newHandle);
  24. /** Retrieves a managed instance of the specified native texture. Will return null if one doesn't exist. */
  25. static MonoObject* nativeToManagedResource(const HTexture& instance);
  26. ScriptGUITextureField(MonoObject* instance, GUITextureField* textureField);
  27. /************************************************************************/
  28. /* CLR HOOKS */
  29. /************************************************************************/
  30. static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
  31. MonoString* style, MonoArray* guiOptions, bool withTitle);
  32. static void internal_getValue(ScriptGUITextureField* nativeInstance, MonoObject** output);
  33. static void internal_setValue(ScriptGUITextureField* nativeInstance, MonoObject* value);
  34. static void internal_getValueRef(ScriptGUITextureField* nativeInstance, MonoObject** output);
  35. static void internal_setValueRef(ScriptGUITextureField* nativeInstance, MonoObject* value);
  36. static void internal_setTint(ScriptGUITextureField* nativeInstance, Color* color);
  37. typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, MonoObject*, MonoException**);
  38. static OnChangedThunkDef onChangedThunk;
  39. };
  40. /** @} */
  41. }