BsScriptGUITextureField.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #pragma once
  2. #include "BsScriptEditorPrerequisites.h"
  3. #include "BsScriptGUIElement.h"
  4. namespace BansheeEngine
  5. {
  6. /**
  7. * @brief Interop class between C++ & CLR for GUITextureField.
  8. */
  9. class BS_SCR_BED_EXPORT ScriptGUITextureField : public TScriptGUIElement <ScriptGUITextureField>
  10. {
  11. public:
  12. SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUITextureField")
  13. private:
  14. /**
  15. * @brief Triggered when the value in the native texture field changes.
  16. *
  17. * @param instance Managed GUITextureField instance.
  18. * @param newHandle Handle of the new texture.
  19. */
  20. static void onChanged(MonoObject* instance, const WeakResourceHandle<Texture>& newHandle);
  21. /**
  22. * @brief Retrieves a managed instance of the specified native texture.
  23. * Will return null if one doesn't exist.
  24. */
  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. }