BsScriptGUIVector4Field.generated.cpp 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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::onConfirmThunkDef ScriptGUIVector4Field::onConfirmThunk;
  17. ScriptGUIVector4Field::ScriptGUIVector4Field(MonoObject* managedInstance, GUIVector4Field* value)
  18. :TScriptGUIElement(managedInstance, value)
  19. {
  20. value->onValueChanged.connect(std::bind(&ScriptGUIVector4Field::onValueChanged, this, std::placeholders::_1));
  21. value->onComponentChanged.connect(std::bind(&ScriptGUIVector4Field::onComponentChanged, this, std::placeholders::_1, std::placeholders::_2));
  22. value->onConfirm.connect(std::bind(&ScriptGUIVector4Field::onConfirm, this, std::placeholders::_1));
  23. }
  24. void ScriptGUIVector4Field::initRuntimeData()
  25. {
  26. metaData.scriptClass->addInternalCall("Internal_getValue", (void*)&ScriptGUIVector4Field::Internal_getValue);
  27. metaData.scriptClass->addInternalCall("Internal_setValue", (void*)&ScriptGUIVector4Field::Internal_setValue);
  28. metaData.scriptClass->addInternalCall("Internal_hasInputFocus", (void*)&ScriptGUIVector4Field::Internal_hasInputFocus);
  29. metaData.scriptClass->addInternalCall("Internal_setInputFocus", (void*)&ScriptGUIVector4Field::Internal_setInputFocus);
  30. metaData.scriptClass->addInternalCall("Internal_create", (void*)&ScriptGUIVector4Field::Internal_create);
  31. metaData.scriptClass->addInternalCall("Internal_create0", (void*)&ScriptGUIVector4Field::Internal_create0);
  32. metaData.scriptClass->addInternalCall("Internal_create1", (void*)&ScriptGUIVector4Field::Internal_create1);
  33. metaData.scriptClass->addInternalCall("Internal_create2", (void*)&ScriptGUIVector4Field::Internal_create2);
  34. metaData.scriptClass->addInternalCall("Internal_create3", (void*)&ScriptGUIVector4Field::Internal_create3);
  35. onValueChangedThunk = (onValueChangedThunkDef)metaData.scriptClass->getMethodExact("Internal_onValueChanged", "Vector4&")->getThunk();
  36. onComponentChangedThunk = (onComponentChangedThunkDef)metaData.scriptClass->getMethodExact("Internal_onComponentChanged", "single,VectorComponent")->getThunk();
  37. onConfirmThunk = (onConfirmThunkDef)metaData.scriptClass->getMethodExact("Internal_onConfirm", "VectorComponent")->getThunk();
  38. }
  39. void ScriptGUIVector4Field::onValueChanged(const Vector4& p0)
  40. {
  41. MonoObject* tmpp0;
  42. tmpp0 = ScriptVector4::box(p0);
  43. MonoUtil::invokeThunk(onValueChangedThunk, getManagedInstance(), tmpp0);
  44. }
  45. void ScriptGUIVector4Field::onComponentChanged(float p0, VectorComponent p1)
  46. {
  47. MonoUtil::invokeThunk(onComponentChangedThunk, getManagedInstance(), p0, p1);
  48. }
  49. void ScriptGUIVector4Field::onConfirm(VectorComponent p0)
  50. {
  51. MonoUtil::invokeThunk(onConfirmThunk, getManagedInstance(), p0);
  52. }
  53. void ScriptGUIVector4Field::Internal_getValue(ScriptGUIVector4Field* thisPtr, Vector4* __output)
  54. {
  55. Vector4 tmp__output;
  56. tmp__output = static_cast<GUIVector4Field*>(thisPtr->getGUIElement())->getValue();
  57. *__output = tmp__output;
  58. }
  59. void ScriptGUIVector4Field::Internal_setValue(ScriptGUIVector4Field* thisPtr, Vector4* value)
  60. {
  61. static_cast<GUIVector4Field*>(thisPtr->getGUIElement())->setValue(*value);
  62. }
  63. bool ScriptGUIVector4Field::Internal_hasInputFocus(ScriptGUIVector4Field* thisPtr)
  64. {
  65. bool tmp__output;
  66. tmp__output = static_cast<GUIVector4Field*>(thisPtr->getGUIElement())->hasInputFocus();
  67. bool __output;
  68. __output = tmp__output;
  69. return __output;
  70. }
  71. void ScriptGUIVector4Field::Internal_setInputFocus(ScriptGUIVector4Field* thisPtr, VectorComponent component, bool focus)
  72. {
  73. static_cast<GUIVector4Field*>(thisPtr->getGUIElement())->setInputFocus(component, focus);
  74. }
  75. void ScriptGUIVector4Field::Internal_create(MonoObject* managedInstance, __GUIContentInterop* labelContent, uint32_t labelWidth, MonoString* style)
  76. {
  77. GUIContent tmplabelContent;
  78. tmplabelContent = ScriptGUIContent::fromInterop(*labelContent);
  79. String tmpstyle;
  80. tmpstyle = MonoUtil::monoToString(style);
  81. GUIVector4Field* instance = GUIVector4Field::create(tmplabelContent, labelWidth, tmpstyle);
  82. new (bs_alloc<ScriptGUIVector4Field>())ScriptGUIVector4Field(managedInstance, instance);
  83. }
  84. void ScriptGUIVector4Field::Internal_create0(MonoObject* managedInstance, __GUIContentInterop* labelContent, MonoString* style)
  85. {
  86. GUIContent tmplabelContent;
  87. tmplabelContent = ScriptGUIContent::fromInterop(*labelContent);
  88. String tmpstyle;
  89. tmpstyle = MonoUtil::monoToString(style);
  90. GUIVector4Field* instance = GUIVector4Field::create(tmplabelContent, tmpstyle);
  91. new (bs_alloc<ScriptGUIVector4Field>())ScriptGUIVector4Field(managedInstance, instance);
  92. }
  93. void ScriptGUIVector4Field::Internal_create1(MonoObject* managedInstance, MonoObject* labelText, uint32_t labelWidth, MonoString* style)
  94. {
  95. SPtr<HString> tmplabelText;
  96. ScriptHString* scriptlabelText;
  97. scriptlabelText = ScriptHString::toNative(labelText);
  98. if(scriptlabelText != nullptr)
  99. tmplabelText = scriptlabelText->getInternal();
  100. String tmpstyle;
  101. tmpstyle = MonoUtil::monoToString(style);
  102. GUIVector4Field* instance = GUIVector4Field::create(*tmplabelText, labelWidth, tmpstyle);
  103. new (bs_alloc<ScriptGUIVector4Field>())ScriptGUIVector4Field(managedInstance, instance);
  104. }
  105. void ScriptGUIVector4Field::Internal_create2(MonoObject* managedInstance, MonoObject* labelText, MonoString* style)
  106. {
  107. SPtr<HString> tmplabelText;
  108. ScriptHString* scriptlabelText;
  109. scriptlabelText = ScriptHString::toNative(labelText);
  110. if(scriptlabelText != nullptr)
  111. tmplabelText = scriptlabelText->getInternal();
  112. String tmpstyle;
  113. tmpstyle = MonoUtil::monoToString(style);
  114. GUIVector4Field* instance = GUIVector4Field::create(*tmplabelText, tmpstyle);
  115. new (bs_alloc<ScriptGUIVector4Field>())ScriptGUIVector4Field(managedInstance, instance);
  116. }
  117. void ScriptGUIVector4Field::Internal_create3(MonoObject* managedInstance, MonoString* style)
  118. {
  119. String tmpstyle;
  120. tmpstyle = MonoUtil::monoToString(style);
  121. GUIVector4Field* instance = GUIVector4Field::create(tmpstyle);
  122. new (bs_alloc<ScriptGUIVector4Field>())ScriptGUIVector4Field(managedInstance, instance);
  123. }
  124. }