BsScriptGUIButton.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsScriptEnginePrerequisites.h"
  5. #include "Wrappers/GUI/BsScriptGUIElement.h"
  6. #include "Image/BsColor.h"
  7. namespace bs
  8. {
  9. struct __GUIContentInterop;
  10. /** @addtogroup ScriptInteropEngine
  11. * @{
  12. */
  13. /** Interop class between C++ & CLR for GUIButton. */
  14. class BS_SCR_BE_EXPORT ScriptGUIButton : public TScriptGUIElement<ScriptGUIButton>
  15. {
  16. public:
  17. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUIButton")
  18. private:
  19. ScriptGUIButton(MonoObject* instance, GUIButton* button);
  20. /** Triggers when the GUI button is clicked. */
  21. void onClick();
  22. /** Triggers when the GUI button is double-clicked. */
  23. void onDoubleClick();
  24. /** Triggers when the GUI button is hovered over. */
  25. void onHover();
  26. /** Triggers when the pointer leaves the GUI button. */
  27. void onOut();
  28. /************************************************************************/
  29. /* CLR HOOKS */
  30. /************************************************************************/
  31. static void internal_createInstance(MonoObject* instance, __GUIContentInterop* content, MonoString* style, MonoArray* guiOptions);
  32. static void internal_setContent(ScriptGUIButton* nativeInstance, __GUIContentInterop* content);
  33. static void internal_setTint(ScriptGUIButton* nativeInstance, Color* color);
  34. typedef void (BS_THUNKCALL *OnClickThunkDef) (MonoObject*, MonoException**);
  35. typedef void (BS_THUNKCALL *OnDoubleClickThunkDef) (MonoObject*, MonoException**);
  36. typedef void (BS_THUNKCALL *OnHoverThunkDef) (MonoObject*, MonoException**);
  37. typedef void (BS_THUNKCALL *OnOutThunkDef) (MonoObject*, MonoException**);
  38. static OnClickThunkDef onClickThunk;
  39. static OnDoubleClickThunkDef onDoubleClickThunk;
  40. static OnHoverThunkDef onHoverThunk;
  41. static OnOutThunkDef onOutThunk;
  42. };
  43. /** @} */
  44. }