BsScriptGUICurvesField.generated.cpp 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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. onClickedThunk = (onClickedThunkDef)metaData.scriptClass->getMethodExact("Internal_onClicked", "")->getThunk();
  38. }
  39. void ScriptGUICurvesField::onClicked()
  40. {
  41. MonoUtil::invokeThunk(onClickedThunk, getManagedInstance());
  42. }
  43. void ScriptGUICurvesField::Internal_setCurve(ScriptGUICurvesField* thisPtr, MonoObject* curve)
  44. {
  45. SPtr<TAnimationCurve<float>> tmpcurve;
  46. ScriptTAnimationCurvefloat* scriptcurve;
  47. scriptcurve = ScriptTAnimationCurvefloat::toNative(curve);
  48. if(scriptcurve != nullptr)
  49. tmpcurve = scriptcurve->getInternal();
  50. static_cast<GUICurvesField*>(thisPtr->getGUIElement())->setCurve(*tmpcurve);
  51. }
  52. void ScriptGUICurvesField::Internal_setCurveRange(ScriptGUICurvesField* thisPtr, MonoObject* curveA, MonoObject* curveB)
  53. {
  54. SPtr<TAnimationCurve<float>> tmpcurveA;
  55. ScriptTAnimationCurvefloat* scriptcurveA;
  56. scriptcurveA = ScriptTAnimationCurvefloat::toNative(curveA);
  57. if(scriptcurveA != nullptr)
  58. tmpcurveA = scriptcurveA->getInternal();
  59. SPtr<TAnimationCurve<float>> tmpcurveB;
  60. ScriptTAnimationCurvefloat* scriptcurveB;
  61. scriptcurveB = ScriptTAnimationCurvefloat::toNative(curveB);
  62. if(scriptcurveB != nullptr)
  63. tmpcurveB = scriptcurveB->getInternal();
  64. static_cast<GUICurvesField*>(thisPtr->getGUIElement())->setCurveRange(*tmpcurveA, *tmpcurveB);
  65. }
  66. MonoObject* ScriptGUICurvesField::Internal_getCurve(ScriptGUICurvesField* thisPtr)
  67. {
  68. SPtr<TAnimationCurve<float>> tmp__output = bs_shared_ptr_new<TAnimationCurve<float>>();
  69. *tmp__output = static_cast<GUICurvesField*>(thisPtr->getGUIElement())->getCurve();
  70. MonoObject* __output;
  71. __output = ScriptTAnimationCurvefloat::create(tmp__output);
  72. return __output;
  73. }
  74. MonoObject* ScriptGUICurvesField::Internal_getMinCurve(ScriptGUICurvesField* thisPtr)
  75. {
  76. SPtr<TAnimationCurve<float>> tmp__output = bs_shared_ptr_new<TAnimationCurve<float>>();
  77. *tmp__output = static_cast<GUICurvesField*>(thisPtr->getGUIElement())->getMinCurve();
  78. MonoObject* __output;
  79. __output = ScriptTAnimationCurvefloat::create(tmp__output);
  80. return __output;
  81. }
  82. MonoObject* ScriptGUICurvesField::Internal_getMaxCurve(ScriptGUICurvesField* thisPtr)
  83. {
  84. SPtr<TAnimationCurve<float>> tmp__output = bs_shared_ptr_new<TAnimationCurve<float>>();
  85. *tmp__output = static_cast<GUICurvesField*>(thisPtr->getGUIElement())->getMaxCurve();
  86. MonoObject* __output;
  87. __output = ScriptTAnimationCurvefloat::create(tmp__output);
  88. return __output;
  89. }
  90. void ScriptGUICurvesField::Internal_setRange(ScriptGUICurvesField* thisPtr, float xRange, float yRange)
  91. {
  92. static_cast<GUICurvesField*>(thisPtr->getGUIElement())->setRange(xRange, yRange);
  93. }
  94. void ScriptGUICurvesField::Internal_setOffset(ScriptGUICurvesField* thisPtr, Vector2* offset)
  95. {
  96. static_cast<GUICurvesField*>(thisPtr->getGUIElement())->setOffset(*offset);
  97. }
  98. void ScriptGUICurvesField::Internal_centerAndZoom(ScriptGUICurvesField* thisPtr)
  99. {
  100. static_cast<GUICurvesField*>(thisPtr->getGUIElement())->centerAndZoom();
  101. }
  102. void ScriptGUICurvesField::Internal_setPadding(ScriptGUICurvesField* thisPtr, uint32_t padding)
  103. {
  104. static_cast<GUICurvesField*>(thisPtr->getGUIElement())->setPadding(padding);
  105. }
  106. void ScriptGUICurvesField::Internal_create(MonoObject* managedInstance, CurveDrawOption drawOptions, __GUIContentInterop* labelContent, uint32_t labelWidth, MonoString* style)
  107. {
  108. GUIContent tmplabelContent;
  109. tmplabelContent = ScriptGUIContent::fromInterop(*labelContent);
  110. String tmpstyle;
  111. tmpstyle = MonoUtil::monoToString(style);
  112. GUICurvesField* instance = GUICurvesField::create(drawOptions, tmplabelContent, labelWidth, tmpstyle);
  113. new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
  114. }
  115. void ScriptGUICurvesField::Internal_create0(MonoObject* managedInstance, CurveDrawOption drawOptions, MonoObject* labelText, uint32_t labelWidth, MonoString* style)
  116. {
  117. SPtr<HString> tmplabelText;
  118. ScriptHString* scriptlabelText;
  119. scriptlabelText = ScriptHString::toNative(labelText);
  120. if(scriptlabelText != nullptr)
  121. tmplabelText = scriptlabelText->getInternal();
  122. String tmpstyle;
  123. tmpstyle = MonoUtil::monoToString(style);
  124. GUICurvesField* instance = GUICurvesField::create(drawOptions, *tmplabelText, labelWidth, tmpstyle);
  125. new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
  126. }
  127. void ScriptGUICurvesField::Internal_create1(MonoObject* managedInstance, __GUIContentInterop* labelContent, uint32_t labelWidth, MonoString* style)
  128. {
  129. GUIContent tmplabelContent;
  130. tmplabelContent = ScriptGUIContent::fromInterop(*labelContent);
  131. String tmpstyle;
  132. tmpstyle = MonoUtil::monoToString(style);
  133. GUICurvesField* instance = GUICurvesField::create(tmplabelContent, labelWidth, tmpstyle);
  134. new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
  135. }
  136. void ScriptGUICurvesField::Internal_create2(MonoObject* managedInstance, __GUIContentInterop* labelContent, MonoString* style)
  137. {
  138. GUIContent tmplabelContent;
  139. tmplabelContent = ScriptGUIContent::fromInterop(*labelContent);
  140. String tmpstyle;
  141. tmpstyle = MonoUtil::monoToString(style);
  142. GUICurvesField* instance = GUICurvesField::create(tmplabelContent, tmpstyle);
  143. new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
  144. }
  145. void ScriptGUICurvesField::Internal_create3(MonoObject* managedInstance, MonoObject* labelText, uint32_t labelWidth, MonoString* style)
  146. {
  147. SPtr<HString> tmplabelText;
  148. ScriptHString* scriptlabelText;
  149. scriptlabelText = ScriptHString::toNative(labelText);
  150. if(scriptlabelText != nullptr)
  151. tmplabelText = scriptlabelText->getInternal();
  152. String tmpstyle;
  153. tmpstyle = MonoUtil::monoToString(style);
  154. GUICurvesField* instance = GUICurvesField::create(*tmplabelText, labelWidth, tmpstyle);
  155. new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
  156. }
  157. void ScriptGUICurvesField::Internal_create4(MonoObject* managedInstance, MonoObject* labelText, MonoString* style)
  158. {
  159. SPtr<HString> tmplabelText;
  160. ScriptHString* scriptlabelText;
  161. scriptlabelText = ScriptHString::toNative(labelText);
  162. if(scriptlabelText != nullptr)
  163. tmplabelText = scriptlabelText->getInternal();
  164. String tmpstyle;
  165. tmpstyle = MonoUtil::monoToString(style);
  166. GUICurvesField* instance = GUICurvesField::create(*tmplabelText, tmpstyle);
  167. new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
  168. }
  169. void ScriptGUICurvesField::Internal_create5(MonoObject* managedInstance, MonoString* style)
  170. {
  171. String tmpstyle;
  172. tmpstyle = MonoUtil::monoToString(style);
  173. GUICurvesField* instance = GUICurvesField::create(tmpstyle);
  174. new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
  175. }
  176. }