BsScriptGUIVector4Field.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 "BsScriptGUIVector4Field.generated.h"
  4. #include "BsMonoMethod.h"
  5. #include "BsMonoClass.h"
  6. #include "BsMonoUtil.h"
  7. #include "../../EditorCore/GUI/BsGUIVector4Field.h"
  8. #include "BsScriptHString.generated.h"
  9. #include "Wrappers/BsScriptVector.h"
  10. #include "BsScriptGUIContent.generated.h"
  11. #include "../../EditorCore/GUI/BsGUIVector4Field.h"
  12. namespace bs
  13. {
  14. ScriptGUIVector4Field::onValueChangedThunkDef ScriptGUIVector4Field::onValueChangedThunk;
  15. ScriptGUIVector4Field::onComponentChangedThunkDef ScriptGUIVector4Field::onComponentChangedThunk;
  16. ScriptGUIVector4Field::onComponentFocusChangedThunkDef ScriptGUIVector4Field::onComponentFocusChangedThunk;
  17. ScriptGUIVector4Field::onConfirmThunkDef ScriptGUIVector4Field::onConfirmThunk;
  18. ScriptGUIVector4Field::ScriptGUIVector4Field(MonoObject* managedInstance, GUIVector4Field* value)
  19. :TScriptGUIElement(managedInstance, value)
  20. {
  21. value->onValueChanged.connect(std::bind(&ScriptGUIVector4Field::onValueChanged, this, std::placeholders::_1));
  22. value->onComponentChanged.connect(std::bind(&ScriptGUIVector4Field::onComponentChanged, this, std::placeholders::_1, std::placeholders::_2));
  23. value->onComponentFocusChanged.connect(std::bind(&ScriptGUIVector4Field::onComponentFocusChanged, this, std::placeholders::_1, std::placeholders::_2));
  24. value->onConfirm.connect(std::bind(&ScriptGUIVector4Field::onConfirm, this, std::placeholders::_1));
  25. }
  26. void ScriptGUIVector4Field::initRuntimeData()
  27. {
  28. metaData.scriptClass->addInternalCall("Internal_getValue", (void*)&ScriptGUIVector4Field::Internal_getValue);
  29. metaData.scriptClass->addInternalCall("Internal_setValue", (void*)&ScriptGUIVector4Field::Internal_setValue);
  30. metaData.scriptClass->addInternalCall("Internal_hasInputFocus", (void*)&ScriptGUIVector4Field::Internal_hasInputFocus);
  31. metaData.scriptClass->addInternalCall("Internal_setInputFocus", (void*)&ScriptGUIVector4Field::Internal_setInputFocus);
  32. metaData.scriptClass->addInternalCall("Internal_create", (void*)&ScriptGUIVector4Field::Internal_create);
  33. metaData.scriptClass->addInternalCall("Internal_create0", (void*)&ScriptGUIVector4Field::Internal_create0);
  34. metaData.scriptClass->addInternalCall("Internal_create1", (void*)&ScriptGUIVector4Field::Internal_create1);
  35. metaData.scriptClass->addInternalCall("Internal_create2", (void*)&ScriptGUIVector4Field::Internal_create2);
  36. metaData.scriptClass->addInternalCall("Internal_create3", (void*)&ScriptGUIVector4Field::Internal_create3);
  37. onValueChangedThunk = (onValueChangedThunkDef)metaData.scriptClass->getMethodExact("Internal_onValueChanged", "Vector4&")->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 ScriptGUIVector4Field::onValueChanged(const Vector4& p0)
  43. {
  44. MonoObject* tmpp0;
  45. tmpp0 = ScriptVector4::box(p0);
  46. MonoUtil::invokeThunk(onValueChangedThunk, getManagedInstance(), tmpp0);
  47. }
  48. void ScriptGUIVector4Field::onComponentChanged(float p0, VectorComponent p1)
  49. {
  50. MonoUtil::invokeThunk(onComponentChangedThunk, getManagedInstance(), p0, p1);
  51. }
  52. void ScriptGUIVector4Field::onComponentFocusChanged(bool p0, VectorComponent p1)
  53. {
  54. MonoUtil::invokeThunk(onComponentFocusChangedThunk, getManagedInstance(), p0, p1);
  55. }
  56. void ScriptGUIVector4Field::onConfirm(VectorComponent p0)
  57. {
  58. MonoUtil::invokeThunk(onConfirmThunk, getManagedInstance(), p0);
  59. }
  60. void ScriptGUIVector4Field::Internal_getValue(ScriptGUIVector4Field* thisPtr, Vector4* __output)
  61. {
  62. Vector4 tmp__output;
  63. tmp__output = static_cast<GUIVector4Field*>(thisPtr->getGUIElement())->getValue();
  64. *__output = tmp__output;
  65. }
  66. void ScriptGUIVector4Field::Internal_setValue(ScriptGUIVector4Field* thisPtr, Vector4* value)
  67. {
  68. static_cast<GUIVector4Field*>(thisPtr->getGUIElement())->setValue(*value);
  69. }
  70. bool ScriptGUIVector4Field::Internal_hasInputFocus(ScriptGUIVector4Field* thisPtr)
  71. {
  72. bool tmp__output;
  73. tmp__output = static_cast<GUIVector4Field*>(thisPtr->getGUIElement())->hasInputFocus();
  74. bool __output;
  75. __output = tmp__output;
  76. return __output;
  77. }
  78. void ScriptGUIVector4Field::Internal_setInputFocus(ScriptGUIVector4Field* thisPtr, VectorComponent component, bool focus)
  79. {
  80. static_cast<GUIVector4Field*>(thisPtr->getGUIElement())->setInputFocus(component, focus);
  81. }
  82. void ScriptGUIVector4Field::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. GUIVector4Field* instance = GUIVector4Field::create(tmplabelContent, labelWidth, tmpstyle);
  89. new (bs_alloc<ScriptGUIVector4Field>())ScriptGUIVector4Field(managedInstance, instance);
  90. }
  91. void ScriptGUIVector4Field::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. GUIVector4Field* instance = GUIVector4Field::create(tmplabelContent, tmpstyle);
  98. new (bs_alloc<ScriptGUIVector4Field>())ScriptGUIVector4Field(managedInstance, instance);
  99. }
  100. void ScriptGUIVector4Field::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. GUIVector4Field* instance = GUIVector4Field::create(*tmplabelText, labelWidth, tmpstyle);
  110. new (bs_alloc<ScriptGUIVector4Field>())ScriptGUIVector4Field(managedInstance, instance);
  111. }
  112. void ScriptGUIVector4Field::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. GUIVector4Field* instance = GUIVector4Field::create(*tmplabelText, tmpstyle);
  122. new (bs_alloc<ScriptGUIVector4Field>())ScriptGUIVector4Field(managedInstance, instance);
  123. }
  124. void ScriptGUIVector4Field::Internal_create3(MonoObject* managedInstance, MonoString* style)
  125. {
  126. String tmpstyle;
  127. tmpstyle = MonoUtil::monoToString(style);
  128. GUIVector4Field* instance = GUIVector4Field::create(tmpstyle);
  129. new (bs_alloc<ScriptGUIVector4Field>())ScriptGUIVector4Field(managedInstance, instance);
  130. }
  131. }