BsScriptGUIVector3Field.generated.cpp 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //************** Copyright (c) 2016-2019 Marko Pintera ([email protected]). All rights reserved. *******************//
  3. #include "BsScriptGUIVector3Field.generated.h"
  4. #include "BsMonoMethod.h"
  5. #include "BsMonoClass.h"
  6. #include "BsMonoUtil.h"
  7. #include "../../EditorCore/GUI/BsGUIVector3Field.h"
  8. #include "Wrappers/BsScriptVector.h"
  9. #include "BsScriptGUIContent.generated.h"
  10. #include "../../EditorCore/GUI/BsGUIVector3Field.h"
  11. #include "BsScriptHString.generated.h"
  12. namespace bs
  13. {
  14. ScriptGUIVector3Field::onValueChangedThunkDef ScriptGUIVector3Field::onValueChangedThunk;
  15. ScriptGUIVector3Field::onComponentChangedThunkDef ScriptGUIVector3Field::onComponentChangedThunk;
  16. ScriptGUIVector3Field::onComponentFocusChangedThunkDef ScriptGUIVector3Field::onComponentFocusChangedThunk;
  17. ScriptGUIVector3Field::onConfirmThunkDef ScriptGUIVector3Field::onConfirmThunk;
  18. ScriptGUIVector3Field::ScriptGUIVector3Field(MonoObject* managedInstance, GUIVector3Field* value)
  19. :TScriptGUIElement(managedInstance, value)
  20. {
  21. value->onValueChanged.connect(std::bind(&ScriptGUIVector3Field::onValueChanged, this, std::placeholders::_1));
  22. value->onComponentChanged.connect(std::bind(&ScriptGUIVector3Field::onComponentChanged, this, std::placeholders::_1, std::placeholders::_2));
  23. value->onComponentFocusChanged.connect(std::bind(&ScriptGUIVector3Field::onComponentFocusChanged, this, std::placeholders::_1, std::placeholders::_2));
  24. value->onConfirm.connect(std::bind(&ScriptGUIVector3Field::onConfirm, this, std::placeholders::_1));
  25. }
  26. void ScriptGUIVector3Field::initRuntimeData()
  27. {
  28. metaData.scriptClass->addInternalCall("Internal_getValue", (void*)&ScriptGUIVector3Field::Internal_getValue);
  29. metaData.scriptClass->addInternalCall("Internal_setValue", (void*)&ScriptGUIVector3Field::Internal_setValue);
  30. metaData.scriptClass->addInternalCall("Internal_hasInputFocus", (void*)&ScriptGUIVector3Field::Internal_hasInputFocus);
  31. metaData.scriptClass->addInternalCall("Internal_setInputFocus", (void*)&ScriptGUIVector3Field::Internal_setInputFocus);
  32. metaData.scriptClass->addInternalCall("Internal_create", (void*)&ScriptGUIVector3Field::Internal_create);
  33. metaData.scriptClass->addInternalCall("Internal_create0", (void*)&ScriptGUIVector3Field::Internal_create0);
  34. metaData.scriptClass->addInternalCall("Internal_create1", (void*)&ScriptGUIVector3Field::Internal_create1);
  35. metaData.scriptClass->addInternalCall("Internal_create2", (void*)&ScriptGUIVector3Field::Internal_create2);
  36. metaData.scriptClass->addInternalCall("Internal_create3", (void*)&ScriptGUIVector3Field::Internal_create3);
  37. onValueChangedThunk = (onValueChangedThunkDef)metaData.scriptClass->getMethodExact("Internal_onValueChanged", "Vector3&")->getThunk();
  38. onComponentChangedThunk = (onComponentChangedThunkDef)metaData.scriptClass->getMethodExact("Internal_onComponentChanged", "single,VectorComponent")->getThunk();
  39. onComponentFocusChangedThunk = (onComponentFocusChangedThunkDef)metaData.scriptClass->getMethodExact("Internal_onComponentFocusChanged", "bool,VectorComponent")->getThunk();
  40. onConfirmThunk = (onConfirmThunkDef)metaData.scriptClass->getMethodExact("Internal_onConfirm", "VectorComponent")->getThunk();
  41. }
  42. void ScriptGUIVector3Field::onValueChanged(const Vector3& p0)
  43. {
  44. MonoObject* tmpp0;
  45. tmpp0 = ScriptVector3::box(p0);
  46. MonoUtil::invokeThunk(onValueChangedThunk, getManagedInstance(), tmpp0);
  47. }
  48. void ScriptGUIVector3Field::onComponentChanged(float p0, VectorComponent p1)
  49. {
  50. MonoUtil::invokeThunk(onComponentChangedThunk, getManagedInstance(), p0, p1);
  51. }
  52. void ScriptGUIVector3Field::onComponentFocusChanged(bool p0, VectorComponent p1)
  53. {
  54. MonoUtil::invokeThunk(onComponentFocusChangedThunk, getManagedInstance(), p0, p1);
  55. }
  56. void ScriptGUIVector3Field::onConfirm(VectorComponent p0)
  57. {
  58. MonoUtil::invokeThunk(onConfirmThunk, getManagedInstance(), p0);
  59. }
  60. void ScriptGUIVector3Field::Internal_getValue(ScriptGUIVector3Field* thisPtr, Vector3* __output)
  61. {
  62. Vector3 tmp__output;
  63. tmp__output = static_cast<GUIVector3Field*>(thisPtr->getGUIElement())->getValue();
  64. *__output = tmp__output;
  65. }
  66. void ScriptGUIVector3Field::Internal_setValue(ScriptGUIVector3Field* thisPtr, Vector3* value)
  67. {
  68. static_cast<GUIVector3Field*>(thisPtr->getGUIElement())->setValue(*value);
  69. }
  70. bool ScriptGUIVector3Field::Internal_hasInputFocus(ScriptGUIVector3Field* thisPtr)
  71. {
  72. bool tmp__output;
  73. tmp__output = static_cast<GUIVector3Field*>(thisPtr->getGUIElement())->hasInputFocus();
  74. bool __output;
  75. __output = tmp__output;
  76. return __output;
  77. }
  78. void ScriptGUIVector3Field::Internal_setInputFocus(ScriptGUIVector3Field* thisPtr, VectorComponent component, bool focus)
  79. {
  80. static_cast<GUIVector3Field*>(thisPtr->getGUIElement())->setInputFocus(component, focus);
  81. }
  82. void ScriptGUIVector3Field::Internal_create(MonoObject* managedInstance, __GUIContentInterop* labelContent, uint32_t labelWidth, MonoString* style)
  83. {
  84. GUIContent tmplabelContent;
  85. tmplabelContent = ScriptGUIContent::fromInterop(*labelContent);
  86. String tmpstyle;
  87. tmpstyle = MonoUtil::monoToString(style);
  88. GUIVector3Field* instance = GUIVector3Field::create(tmplabelContent, labelWidth, tmpstyle);
  89. new (bs_alloc<ScriptGUIVector3Field>())ScriptGUIVector3Field(managedInstance, instance);
  90. }
  91. void ScriptGUIVector3Field::Internal_create0(MonoObject* managedInstance, __GUIContentInterop* labelContent, MonoString* style)
  92. {
  93. GUIContent tmplabelContent;
  94. tmplabelContent = ScriptGUIContent::fromInterop(*labelContent);
  95. String tmpstyle;
  96. tmpstyle = MonoUtil::monoToString(style);
  97. GUIVector3Field* instance = GUIVector3Field::create(tmplabelContent, tmpstyle);
  98. new (bs_alloc<ScriptGUIVector3Field>())ScriptGUIVector3Field(managedInstance, instance);
  99. }
  100. void ScriptGUIVector3Field::Internal_create1(MonoObject* managedInstance, MonoObject* labelText, uint32_t labelWidth, MonoString* style)
  101. {
  102. SPtr<HString> tmplabelText;
  103. ScriptHString* scriptlabelText;
  104. scriptlabelText = ScriptHString::toNative(labelText);
  105. if(scriptlabelText != nullptr)
  106. tmplabelText = scriptlabelText->getInternal();
  107. String tmpstyle;
  108. tmpstyle = MonoUtil::monoToString(style);
  109. GUIVector3Field* instance = GUIVector3Field::create(*tmplabelText, labelWidth, tmpstyle);
  110. new (bs_alloc<ScriptGUIVector3Field>())ScriptGUIVector3Field(managedInstance, instance);
  111. }
  112. void ScriptGUIVector3Field::Internal_create2(MonoObject* managedInstance, MonoObject* labelText, MonoString* style)
  113. {
  114. SPtr<HString> tmplabelText;
  115. ScriptHString* scriptlabelText;
  116. scriptlabelText = ScriptHString::toNative(labelText);
  117. if(scriptlabelText != nullptr)
  118. tmplabelText = scriptlabelText->getInternal();
  119. String tmpstyle;
  120. tmpstyle = MonoUtil::monoToString(style);
  121. GUIVector3Field* instance = GUIVector3Field::create(*tmplabelText, tmpstyle);
  122. new (bs_alloc<ScriptGUIVector3Field>())ScriptGUIVector3Field(managedInstance, instance);
  123. }
  124. void ScriptGUIVector3Field::Internal_create3(MonoObject* managedInstance, MonoString* style)
  125. {
  126. String tmpstyle;
  127. tmpstyle = MonoUtil::monoToString(style);
  128. GUIVector3Field* instance = GUIVector3Field::create(tmpstyle);
  129. new (bs_alloc<ScriptGUIVector3Field>())ScriptGUIVector3Field(managedInstance, instance);
  130. }
  131. }