BsScriptHandleSlider.h 2.5 KB

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