BsScriptGUICurvesField.generated.cpp 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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 "BsScriptGUIContent.generated.h"
  9. #include "../../../EditorCore/GUI/BsGUICurvesField.h"
  10. namespace bs
  11. {
  12. ScriptGUICurvesField::onClickedThunkDef ScriptGUICurvesField::onClickedThunk;
  13. ScriptGUICurvesField::ScriptGUICurvesField(MonoObject* managedInstance, GUICurvesField* value)
  14. :TScriptGUIElement(managedInstance, value)
  15. {
  16. value->onClicked.connect(std::bind(&ScriptGUICurvesField::onClicked, this));
  17. }
  18. void ScriptGUICurvesField::initRuntimeData()
  19. {
  20. metaData.scriptClass->addInternalCall("Internal_setCurve", (void*)&ScriptGUICurvesField::Internal_setCurve);
  21. metaData.scriptClass->addInternalCall("Internal_setCurveRange", (void*)&ScriptGUICurvesField::Internal_setCurveRange);
  22. metaData.scriptClass->addInternalCall("Internal_getCurve", (void*)&ScriptGUICurvesField::Internal_getCurve);
  23. metaData.scriptClass->addInternalCall("Internal_getMinCurve", (void*)&ScriptGUICurvesField::Internal_getMinCurve);
  24. metaData.scriptClass->addInternalCall("Internal_getMaxCurve", (void*)&ScriptGUICurvesField::Internal_getMaxCurve);
  25. metaData.scriptClass->addInternalCall("Internal_create", (void*)&ScriptGUICurvesField::Internal_create);
  26. metaData.scriptClass->addInternalCall("Internal_create0", (void*)&ScriptGUICurvesField::Internal_create0);
  27. metaData.scriptClass->addInternalCall("Internal_create1", (void*)&ScriptGUICurvesField::Internal_create1);
  28. metaData.scriptClass->addInternalCall("Internal_create2", (void*)&ScriptGUICurvesField::Internal_create2);
  29. metaData.scriptClass->addInternalCall("Internal_create3", (void*)&ScriptGUICurvesField::Internal_create3);
  30. onClickedThunk = (onClickedThunkDef)metaData.scriptClass->getMethodExact("Internal_onClicked", "")->getThunk();
  31. }
  32. void ScriptGUICurvesField::onClicked()
  33. {
  34. MonoUtil::invokeThunk(onClickedThunk, getManagedInstance());
  35. }
  36. void ScriptGUICurvesField::Internal_setCurve(ScriptGUICurvesField* thisPtr, MonoObject* curve)
  37. {
  38. SPtr<TAnimationCurve<float>> tmpcurve;
  39. ScriptTAnimationCurvefloat* scriptcurve;
  40. scriptcurve = ScriptTAnimationCurvefloat::toNative(curve);
  41. tmpcurve = scriptcurve->getInternal();
  42. static_cast<GUICurvesField*>(thisPtr->getGUIElement())->setCurve(*tmpcurve);
  43. }
  44. void ScriptGUICurvesField::Internal_setCurveRange(ScriptGUICurvesField* thisPtr, MonoObject* curveA, MonoObject* curveB)
  45. {
  46. SPtr<TAnimationCurve<float>> tmpcurveA;
  47. ScriptTAnimationCurvefloat* scriptcurveA;
  48. scriptcurveA = ScriptTAnimationCurvefloat::toNative(curveA);
  49. tmpcurveA = scriptcurveA->getInternal();
  50. SPtr<TAnimationCurve<float>> tmpcurveB;
  51. ScriptTAnimationCurvefloat* scriptcurveB;
  52. scriptcurveB = ScriptTAnimationCurvefloat::toNative(curveB);
  53. tmpcurveB = scriptcurveB->getInternal();
  54. static_cast<GUICurvesField*>(thisPtr->getGUIElement())->setCurveRange(*tmpcurveA, *tmpcurveB);
  55. }
  56. MonoObject* ScriptGUICurvesField::Internal_getCurve(ScriptGUICurvesField* thisPtr)
  57. {
  58. SPtr<TAnimationCurve<float>> tmp__output = bs_shared_ptr_new<TAnimationCurve<float>>();
  59. *tmp__output = static_cast<GUICurvesField*>(thisPtr->getGUIElement())->getCurve();
  60. MonoObject* __output;
  61. __output = ScriptTAnimationCurvefloat::create(tmp__output);
  62. return __output;
  63. }
  64. MonoObject* ScriptGUICurvesField::Internal_getMinCurve(ScriptGUICurvesField* thisPtr)
  65. {
  66. SPtr<TAnimationCurve<float>> tmp__output = bs_shared_ptr_new<TAnimationCurve<float>>();
  67. *tmp__output = static_cast<GUICurvesField*>(thisPtr->getGUIElement())->getMinCurve();
  68. MonoObject* __output;
  69. __output = ScriptTAnimationCurvefloat::create(tmp__output);
  70. return __output;
  71. }
  72. MonoObject* ScriptGUICurvesField::Internal_getMaxCurve(ScriptGUICurvesField* thisPtr)
  73. {
  74. SPtr<TAnimationCurve<float>> tmp__output = bs_shared_ptr_new<TAnimationCurve<float>>();
  75. *tmp__output = static_cast<GUICurvesField*>(thisPtr->getGUIElement())->getMaxCurve();
  76. MonoObject* __output;
  77. __output = ScriptTAnimationCurvefloat::create(tmp__output);
  78. return __output;
  79. }
  80. void ScriptGUICurvesField::Internal_create(MonoObject* managedInstance, __GUIContentInterop* labelContent, uint32_t labelWidth, MonoString* style)
  81. {
  82. GUIContent tmplabelContent;
  83. tmplabelContent = ScriptGUIContent::fromInterop(*labelContent);
  84. String tmpstyle;
  85. tmpstyle = MonoUtil::monoToString(style);
  86. GUICurvesField* instance = GUICurvesField::create(tmplabelContent, labelWidth, tmpstyle);
  87. new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
  88. }
  89. void ScriptGUICurvesField::Internal_create0(MonoObject* managedInstance, __GUIContentInterop* labelContent, MonoString* style)
  90. {
  91. GUIContent tmplabelContent;
  92. tmplabelContent = ScriptGUIContent::fromInterop(*labelContent);
  93. String tmpstyle;
  94. tmpstyle = MonoUtil::monoToString(style);
  95. GUICurvesField* instance = GUICurvesField::create(tmplabelContent, tmpstyle);
  96. new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
  97. }
  98. void ScriptGUICurvesField::Internal_create1(MonoObject* managedInstance, MonoObject* labelText, uint32_t labelWidth, MonoString* style)
  99. {
  100. SPtr<HString> tmplabelText;
  101. ScriptHString* scriptlabelText;
  102. scriptlabelText = ScriptHString::toNative(labelText);
  103. tmplabelText = scriptlabelText->getInternal();
  104. String tmpstyle;
  105. tmpstyle = MonoUtil::monoToString(style);
  106. GUICurvesField* instance = GUICurvesField::create(*tmplabelText, labelWidth, tmpstyle);
  107. new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
  108. }
  109. void ScriptGUICurvesField::Internal_create2(MonoObject* managedInstance, MonoObject* labelText, MonoString* style)
  110. {
  111. SPtr<HString> tmplabelText;
  112. ScriptHString* scriptlabelText;
  113. scriptlabelText = ScriptHString::toNative(labelText);
  114. tmplabelText = scriptlabelText->getInternal();
  115. String tmpstyle;
  116. tmpstyle = MonoUtil::monoToString(style);
  117. GUICurvesField* instance = GUICurvesField::create(*tmplabelText, tmpstyle);
  118. new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
  119. }
  120. void ScriptGUICurvesField::Internal_create3(MonoObject* managedInstance, MonoString* style)
  121. {
  122. String tmpstyle;
  123. tmpstyle = MonoUtil::monoToString(style);
  124. GUICurvesField* instance = GUICurvesField::create(tmpstyle);
  125. new (bs_alloc<ScriptGUICurvesField>())ScriptGUICurvesField(managedInstance, instance);
  126. }
  127. }