BsScriptGUICurvesField.generated.cpp 9.5 KB

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