BsScriptGUIScrollBar.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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. namespace bs
  7. {
  8. /** @addtogroup ScriptInteropEngine
  9. * @{
  10. */
  11. class GUIScrollBar;
  12. /** Interop class between C++ & CLR for GUIScrollBar. */
  13. class BS_SCR_BE_EXPORT ScriptGUIScrollBar : public TScriptGUIElement<ScriptGUIScrollBar>
  14. {
  15. public:
  16. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUIScrollBar")
  17. private:
  18. ScriptGUIScrollBar(MonoObject* instance);
  19. /************************************************************************/
  20. /* CLR HOOKS */
  21. /************************************************************************/
  22. static float internal_GetPosition(ScriptGUIElementBaseTBase* nativeInstance);
  23. static void internal_SetPosition(ScriptGUIElementBaseTBase* nativeInstance, float percent);
  24. static float internal_GetHandleSize(ScriptGUIElementBaseTBase* nativeInstance);
  25. static void internal_SetHandleSize(ScriptGUIElementBaseTBase* nativeInstance, float percent);
  26. static void internal_SetTint(ScriptGUIElementBaseTBase* nativeInstance, Color* color);
  27. };
  28. /** Interop class between C++ & CLR for GUIScrollBarH. */
  29. class BS_SCR_BE_EXPORT ScriptGUIScrollBarH : public TScriptGUIElement<ScriptGUIScrollBarH>
  30. {
  31. public:
  32. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUIScrollBarH")
  33. private:
  34. ScriptGUIScrollBarH(MonoObject* instance, GUIScrollBarHorz* scrollBar);
  35. /** Triggers when the user scrolls the scroll bar. */
  36. void onScroll(float position, float size);
  37. /************************************************************************/
  38. /* CLR HOOKS */
  39. /************************************************************************/
  40. static void internal_CreateInstance(MonoObject* instance, MonoString* style, MonoArray* guiOptions);
  41. typedef void(BS_THUNKCALL *OnScrolledThunkDef) (MonoObject*, float, MonoException**);
  42. static OnScrolledThunkDef onScrolledThunk;
  43. };
  44. /** Interop class between C++ & CLR for GUIScrollBarV. */
  45. class BS_SCR_BE_EXPORT ScriptGUIScrollBarV : public TScriptGUIElement<ScriptGUIScrollBarV>
  46. {
  47. public:
  48. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUIScrollBarV")
  49. private:
  50. ScriptGUIScrollBarV(MonoObject* instance, GUIScrollBarVert* scrollBar);
  51. /** Triggers when the user scrolls the scroll bar. */
  52. void onScroll(float position, float size);
  53. /************************************************************************/
  54. /* CLR HOOKS */
  55. /************************************************************************/
  56. static void internal_CreateInstance(MonoObject* instance, MonoString* style, MonoArray* guiOptions);
  57. typedef void(BS_THUNKCALL *OnScrolledThunkDef) (MonoObject*, float, MonoException**);
  58. static OnScrolledThunkDef onScrolledThunk;
  59. };
  60. /** Interop class between C++ & CLR for GUIResizeableScrollBarH. */
  61. class BS_SCR_BE_EXPORT ScriptGUIResizeableScrollBarH : public TScriptGUIElement<ScriptGUIResizeableScrollBarH>
  62. {
  63. public:
  64. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUIResizeableScrollBarH")
  65. private:
  66. ScriptGUIResizeableScrollBarH(MonoObject* instance, GUIScrollBarHorz* scrollBar);
  67. /** Triggers when the user scrolls the scroll bar. */
  68. void onScroll(float position, float size);
  69. /************************************************************************/
  70. /* CLR HOOKS */
  71. /************************************************************************/
  72. static void internal_CreateInstance(MonoObject* instance, MonoString* style, MonoArray* guiOptions);
  73. typedef void(BS_THUNKCALL *OnScrollOrResizeThunkDef) (MonoObject*, float, float, MonoException**);
  74. static OnScrollOrResizeThunkDef onScrollOrResizeThunk;
  75. };
  76. /** Interop class between C++ & CLR for GUIResizeableScrollBarV. */
  77. class BS_SCR_BE_EXPORT ScriptGUIResizeableScrollBarV : public TScriptGUIElement<ScriptGUIResizeableScrollBarV>
  78. {
  79. public:
  80. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUIResizeableScrollBarV")
  81. private:
  82. ScriptGUIResizeableScrollBarV(MonoObject* instance, GUIScrollBarVert* scrollBar);
  83. /** Triggers when the user scrolls the scroll bar. */
  84. void onScroll(float position, float size);
  85. /************************************************************************/
  86. /* CLR HOOKS */
  87. /************************************************************************/
  88. static void internal_CreateInstance(MonoObject* instance, MonoString* style, MonoArray* guiOptions);
  89. typedef void(BS_THUNKCALL *OnScrollOrResizeThunkDef) (MonoObject*, float, float, MonoException**);
  90. static OnScrollOrResizeThunkDef onScrollOrResizeThunk;
  91. };
  92. /** @} */
  93. }