BsScriptGUICurvesField.generated.cpp 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //************** Copyright (c) 2016-2019 Marko Pintera ([email protected]). All rights reserved. *******************//
  3. #include "BsScriptGUICurvesField.generated.h"
  4. #include "BsMonoMethod.h"
  5. #include "BsMonoClass.h"
  6. #include "BsMonoUtil.h"
  7. #include "../../EditorCore/GUI/BsGUICurvesField.h"
  8. #include "BsScriptHString.generated.h"
  9. #include "BsScriptTAnimationCurve.generated.h"
  10. #include "Wrappers/BsScriptVector.h"
  11. #include "BsScriptGUIContent.generated.h"
  12. #include "../../EditorCore/GUI/BsGUICurvesField.h"
  13. namespace bs
  14. {
  15. ScriptGUICurvesField::onClickedThunkDef ScriptGUICurvesField::onClickedThunk;
  16. ScriptGUICurvesField::ScriptGUICurvesField(MonoObject* managedInstance, GUICurvesField* value)
  17. :TScriptGUIElement(managedInstance, value)
  18. {
  19. value->onClicked.connect(std::bind(&ScriptGUICurvesField::onClicked, this));
  20. }
  21. void ScriptGUICurvesField::initRuntimeData()
  22. {
  23. metaData.scriptClass->addInternalCall("Internal_setCurve", (void*)&ScriptGUICurvesField::Internal_setCurve);
  24. metaData.scriptClass->addInternalCall("Internal_setCurveRange", (void*)&ScriptGUICurvesField::Internal_setCurveRange);
  25. metaData.scriptClass->addInternalCall("Internal_getCurve", (void*)&ScriptGUICurvesField::Internal_getCurve);
  26. metaData.scriptClass->addInternalCall("Internal_getMinCurve", (void*)&ScriptGUICurvesField::Internal_getMinCurve);
  27. metaData.scriptClass->addInternalCall("Internal_getMaxCurve", (void*)&ScriptGUICurvesField::Internal_getMaxCurve);
  28. metaData.scriptClass->addInternalCall("Internal_setRange", (void*)&ScriptGUICurvesField::Internal_setRange);
  29. metaData.scriptClass->addInternalCall("Internal_setOffset", (void*)&ScriptGUICurvesField::Internal_setOffset);
  30. metaData.scriptClass->addInternalCall("Internal_centerAndZoom", (void*)&ScriptGUICurvesField::Internal_centerAndZoom);
  31. metaData.scriptClass->addInternalCall("Internal_setPadding", (void*)&ScriptGUICurvesField::Internal_setPadding);
  32. metaData.scriptClass->addInternalCall("Internal_create", (void*)&ScriptGUICurvesField::Internal_create);
  33. metaData.scriptClass->addInternalCall("Internal_create0", (void*)&ScriptGUICurvesField::Internal_create0);
  34. metaData.scriptClass->addInternalCall("Internal_create1", (void*)&ScriptGUICurvesField::Internal_create1);
  35. metaData.scriptClass->addInternalCall("Internal_create2", (void*)&ScriptGUICurvesField::Internal_create2);
  36. metaData.scriptClass->addInternalCall("Internal_create3", (void*)&ScriptGUICurvesField::Internal_create3);
  37. metaData.scriptClass->addInternalCall("Internal_create4", (void*)&ScriptGUICurvesField::Internal_create4);
  38. metaData.scriptClass->addInternalCall("Internal_create5", (void*)&ScriptGUICurvesField::Internal_create5);
  39. metaData.scriptClass->addInternalCall("Internal_create6", (void*)&ScriptGUICurvesField::Internal_create6);
  40. onClickedThunk = (onClickedThunkDef)metaData.scriptClass->getMethodExact("Internal_onClicked", "")->getThunk();
  41. }
  42. void ScriptGUICurvesField::onClicked()
  43. {
  44. MonoUtil::invokeThunk(onClickedThunk, getManagedInstance());
  45. }
  46. void ScriptGUICurvesField::Internal_setCurve(ScriptGUICurvesField* thisPtr, MonoObject* curve)
  47. {
  48. SPtr<TAnimationCurve<float>> tmpcurve;
  49. ScriptTAnimationCurvefloat* scriptcurve;
  50. scriptcurve = ScriptTAnimationCurvefloat::toNative(curve);
  51. if(scriptcurve != nullptr)
  52. tmpcurve = scriptcurve->getInternal();
  53. static_cast<GUICurvesField*>(thisPtr->getGUIElement())->setCurve(*tmpcurve);
  54. }
  55. void ScriptGUICurvesField::Internal_setCurveRange(ScriptGUICurvesField* thisPtr, MonoObject* curveA, MonoObject* curveB)
  56. {
  57. SPtr<TAnimationCurve<float>> tmpcurveA;
  58. ScriptTAnimationCurvefloat* scriptcurveA;
  59. scriptcurveA = ScriptTAnimationCurvefloat::toNative(curveA);
  60. if(scriptcurveA != nullptr)
  61. tmpcurveA = scriptcurveA->getInternal();
  62. SPtr<TAnimationCurve<float>> tmpcurveB;
  63. ScriptTAnimationCurvefloat* scriptcurveB;
  64. scriptcurveB = ScriptTAnimationCurvefloat::toNative(curveB);
  65. if(scriptcurveB != nullptr)
  66. tmpcurveB = scriptcurveB->getInternal();
  67. static_cast<GUICurvesField*>(thisPtr->getGUIElement())->setCurveRange(*tmpcurveA, *tmpcurveB);
  68. }
  69. MonoObject* ScriptGUICurvesField::Internal_getCurve(ScriptGUICurvesField* thisPtr)
  70. {
  71. SPtr<TAnimationCurve<float>> tmp__output = bs_shared_ptr_new<TAnimationCurve<float>>();
  72. *tmp__output = static_cast<GUICurvesField*>(thisPtr->getGUIElement())->getCurve();
  73. MonoObject* __output;
  74. __output = ScriptTAnimationCurvefloat::create(tmp__output);
  75. return __output;
  76. }
  77. MonoObject* ScriptGUICurvesField::Internal_getMinCurve(ScriptGUICurvesField* thisPtr)
  78. {
  79. SPtr<TAnimationCurve<float>> tmp__output = bs_shared_ptr_new<TAnimationCurve<float>>();
  80. *tmp__output = static_cast<GUICurvesField*>(thisPtr->getGUIElement())->getMinCurve();
  81. MonoObject* __output;
  82. __output = ScriptTAnimationCurvefloat::create(tmp__output);
  83. return __output;
  84. }
  85. MonoObject* ScriptGUICurvesField::Internal_getMaxCurve(ScriptGUICurvesField* thisPtr)
  86. {
  87. SPtr<TAnimationCurve<float>> tmp__output = bs_shared_ptr_new<TAnimationCurve<float>>();
  88. *tmp__output = static_cast<GUICurvesField*>(thisPtr->getGUIElement())->getMaxCurve();
  89. MonoObject* __output;
  90. __output = ScriptTAnimationCurvefloat::create(tmp__output);
  91. return __output;
  92. }
  93. void ScriptGUICurvesField::Internal_setRange(ScriptGUICurvesField* thisPtr, float xRange, float yRange)
  94. {
  95. static_cast<GUICurvesField*>(thisPtr->getGUIElement())->setRange(xRange, yRange);
  96. }
  97. void ScriptGUICurvesField::Internal_setOffset(ScriptGUICurvesField* thisPtr, Vector2* offset)
  98. {
  99. static_cast<GUICurvesField*>(thisPtr->getGUIElement())->setOffset(*offset);
  100. }
  101. void ScriptGUICurvesField::Internal_centerAndZoom(ScriptGUICurvesField* thisPtr)
  102. {
  103. static_cast<GUICurvesField*>(thisPtr->getGUIElement())->centerAndZoom();
  104. }
  105. void ScriptGUICurvesField::Internal_setPadding(ScriptGUICurvesField* thisPtr, uint32_t padding)
  106. {
  107. static_cast<GUICurvesField*>(thisPtr->getGUIElement())->setPadding(padding);
  108. }
  109. void ScriptGUICurvesField::Internal_create(MonoObject* managedInstance, CurveDrawOption drawOptions, __GUIContentInterop* labelContent, uint32_t labelWidth, MonoString* style)
  110. {
  111. GUIContent tmplabelContent;
  112. tmplabelContent = ScriptGUIContent::fromInterop(*labelContent);
  113. String tmpstyle;
  114. tmpstyle = MonoUtil::monoToString(style);
  115. GUICurvesField* instance = GUICurvesField::create(drawOptions, tmplabelContent, labelWidth, tmpstyle);
  116. new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
  117. }
  118. void ScriptGUICurvesField::Internal_create0(MonoObject* managedInstance, CurveDrawOption drawOptions, MonoObject* labelText, uint32_t labelWidth, MonoString* style)
  119. {
  120. SPtr<HString> tmplabelText;
  121. ScriptHString* scriptlabelText;
  122. scriptlabelText = ScriptHString::toNative(labelText);
  123. if(scriptlabelText != nullptr)
  124. tmplabelText = scriptlabelText->getInternal();
  125. String tmpstyle;
  126. tmpstyle = MonoUtil::monoToString(style);
  127. GUICurvesField* instance = GUICurvesField::create(drawOptions, *tmplabelText, labelWidth, tmpstyle);
  128. new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
  129. }
  130. void ScriptGUICurvesField::Internal_create1(MonoObject* managedInstance, CurveDrawOption drawOptions, MonoString* style)
  131. {
  132. String tmpstyle;
  133. tmpstyle = MonoUtil::monoToString(style);
  134. GUICurvesField* instance = GUICurvesField::create(drawOptions, tmpstyle);
  135. new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
  136. }
  137. void ScriptGUICurvesField::Internal_create2(MonoObject* managedInstance, __GUIContentInterop* labelContent, uint32_t labelWidth, MonoString* style)
  138. {
  139. GUIContent tmplabelContent;
  140. tmplabelContent = ScriptGUIContent::fromInterop(*labelContent);
  141. String tmpstyle;
  142. tmpstyle = MonoUtil::monoToString(style);
  143. GUICurvesField* instance = GUICurvesField::create(tmplabelContent, labelWidth, tmpstyle);
  144. new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
  145. }
  146. void ScriptGUICurvesField::Internal_create3(MonoObject* managedInstance, __GUIContentInterop* labelContent, MonoString* style)
  147. {
  148. GUIContent tmplabelContent;
  149. tmplabelContent = ScriptGUIContent::fromInterop(*labelContent);
  150. String tmpstyle;
  151. tmpstyle = MonoUtil::monoToString(style);
  152. GUICurvesField* instance = GUICurvesField::create(tmplabelContent, tmpstyle);
  153. new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
  154. }
  155. void ScriptGUICurvesField::Internal_create4(MonoObject* managedInstance, MonoObject* labelText, uint32_t labelWidth, MonoString* style)
  156. {
  157. SPtr<HString> tmplabelText;
  158. ScriptHString* scriptlabelText;
  159. scriptlabelText = ScriptHString::toNative(labelText);
  160. if(scriptlabelText != nullptr)
  161. tmplabelText = scriptlabelText->getInternal();
  162. String tmpstyle;
  163. tmpstyle = MonoUtil::monoToString(style);
  164. GUICurvesField* instance = GUICurvesField::create(*tmplabelText, labelWidth, tmpstyle);
  165. new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
  166. }
  167. void ScriptGUICurvesField::Internal_create5(MonoObject* managedInstance, MonoObject* labelText, MonoString* style)
  168. {
  169. SPtr<HString> tmplabelText;
  170. ScriptHString* scriptlabelText;
  171. scriptlabelText = ScriptHString::toNative(labelText);
  172. if(scriptlabelText != nullptr)
  173. tmplabelText = scriptlabelText->getInternal();
  174. String tmpstyle;
  175. tmpstyle = MonoUtil::monoToString(style);
  176. GUICurvesField* instance = GUICurvesField::create(*tmplabelText, tmpstyle);
  177. new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
  178. }
  179. void ScriptGUICurvesField::Internal_create6(MonoObject* managedInstance, MonoString* style)
  180. {
  181. String tmpstyle;
  182. tmpstyle = MonoUtil::monoToString(style);
  183. GUICurvesField* instance = GUICurvesField::create(tmpstyle);
  184. new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
  185. }
  186. }