BsScriptGUISlider.h 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. /** Interop class between C++ & CLR for GUISliderH. */
  12. class BS_SCR_BE_EXPORT ScriptGUISliderH : public TScriptGUIElement<ScriptGUISliderH>
  13. {
  14. public:
  15. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUISliderH")
  16. private:
  17. ScriptGUISliderH(MonoObject* instance, GUISliderHorz* slider);
  18. /** Triggered when the native slider is moved. */
  19. void onChanged(float percent);
  20. /************************************************************************/
  21. /* CLR HOOKS */
  22. /************************************************************************/
  23. static void internal_createInstance(MonoObject* instance, MonoString* style, MonoArray* guiOptions);
  24. static void internal_setPercent(ScriptGUISliderH* nativeInstance, float percent);
  25. static float internal_getPercent(ScriptGUISliderH* nativeInstance);
  26. static float internal_getValue(ScriptGUISliderH* nativeInstance);
  27. static void internal_setValue(ScriptGUISliderH* nativeInstance, float percent);
  28. static void internal_setRange(ScriptGUISliderH* nativeInstance, float min, float max);
  29. static float internal_getRangeMaximum(ScriptGUISliderH* nativeInstance);
  30. static float internal_getRangeMinimum(ScriptGUISliderH* nativeInstance);
  31. static void internal_setStep(ScriptGUISliderH* nativeInstance, float step);
  32. static float internal_getStep(ScriptGUISliderH* nativeInstance);
  33. static void internal_setTint(ScriptGUISliderH* nativeInstance, Color* color);
  34. typedef void(BS_THUNKCALL *OnChangedThunkDef) (MonoObject*, float, MonoException**);
  35. static OnChangedThunkDef onChangedThunk;
  36. };
  37. /** Interop class between C++ & CLR for GUISliderV. */
  38. class BS_SCR_BE_EXPORT ScriptGUISliderV : public TScriptGUIElement<ScriptGUISliderV>
  39. {
  40. public:
  41. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUISliderV")
  42. private:
  43. ScriptGUISliderV(MonoObject* instance, GUISliderVert* slider);
  44. /** Triggered when the native slider is moved. */
  45. void onChanged(float percent);
  46. /************************************************************************/
  47. /* CLR HOOKS */
  48. /************************************************************************/
  49. static void internal_createInstance(MonoObject* instance, MonoString* style, MonoArray* guiOptions);
  50. static void internal_setPercent(ScriptGUISliderV* nativeInstance, float percent);
  51. static float internal_getPercent(ScriptGUISliderV* nativeInstance);
  52. static float internal_getValue(ScriptGUISliderV* nativeInstance);
  53. static void internal_setValue(ScriptGUISliderV* nativeInstance, float percent);
  54. static void internal_setRange(ScriptGUISliderV* nativeInstance, float min, float max);
  55. static float internal_getRangeMaximum(ScriptGUISliderV* nativeInstance);
  56. static float internal_getRangeMinimum(ScriptGUISliderV* nativeInstance);
  57. static void internal_setStep(ScriptGUISliderV* nativeInstance, float step);
  58. static float internal_getStep(ScriptGUISliderV* nativeInstance);
  59. static void internal_setTint(ScriptGUISliderV* nativeInstance, Color* color);
  60. typedef void(BS_THUNKCALL *OnChangedThunkDef) (MonoObject*, float, MonoException**);
  61. static OnChangedThunkDef onChangedThunk;
  62. };
  63. /** @} */
  64. }