BsScriptHandleSlider.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #pragma once
  2. #include "BsScriptEditorPrerequisites.h"
  3. #include "BsScriptObject.h"
  4. #include "BsHandleSlider.h"
  5. #include "BsQuaternion.h"
  6. #include "BsVector3.h"
  7. namespace BansheeEngine
  8. {
  9. /**
  10. * @brief Base class for all C++/CLR interop objects that deal with handle sliders.
  11. */
  12. class BS_SCR_BED_EXPORT ScriptHandleSliderBase : public ScriptObjectBase
  13. {
  14. public:
  15. ScriptHandleSliderBase(MonoObject* managedInstance);
  16. virtual ~ScriptHandleSliderBase();
  17. /**
  18. * @brief Returns the internal native handle slider.
  19. */
  20. virtual HandleSlider* getSlider() const = 0;
  21. protected:
  22. friend class ScriptHandleSlider;
  23. friend class ScriptHandleSliderManager;
  24. /**
  25. * @brief Destroys the internal native handle slider and unregisters it with
  26. * with handle manager.
  27. */
  28. void destroy();
  29. /**
  30. * @brief Destroys the internal native handle slider.
  31. */
  32. virtual void destroyInternal() = 0;
  33. };
  34. /**
  35. * @brief Interop class between C++ & CLR for HandleSlider.
  36. */
  37. class BS_SCR_BED_EXPORT ScriptHandleSlider : public ScriptObject <ScriptHandleSlider>
  38. {
  39. public:
  40. SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "HandleSlider")
  41. private:
  42. ScriptHandleSlider(MonoObject* instance);
  43. /************************************************************************/
  44. /* CLR HOOKS */
  45. /************************************************************************/
  46. static void internal_Destroy(ScriptHandleSliderBase* nativeInstance);
  47. static void internal_GetPosition(ScriptHandleSliderBase* nativeInstance, Vector3* value);
  48. static void internal_SetPosition(ScriptHandleSliderBase* nativeInstance, Vector3* value);
  49. static void internal_GetRotation(ScriptHandleSliderBase* nativeInstance, Quaternion* value);
  50. static void internal_SetRotation(ScriptHandleSliderBase* nativeInstance, Quaternion* value);
  51. static void internal_GetScale(ScriptHandleSliderBase* nativeInstance, Vector3* value);
  52. static void internal_SetScale(ScriptHandleSliderBase* nativeInstance, Vector3* value);
  53. static bool internal_GetEnabled(ScriptHandleSliderBase* nativeInstance);
  54. static void internal_SetEnabled(ScriptHandleSliderBase* nativeInstance, bool value);
  55. static void internal_GetState(ScriptHandleSliderBase* nativeInstance, HandleSlider::State* value);
  56. };
  57. }