BsScriptGUIColorField.generated.cpp 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //************** Copyright (c) 2016-2019 Marko Pintera ([email protected]). All rights reserved. *******************//
  3. #include "BsScriptGUIColorField.generated.h"
  4. #include "BsMonoMethod.h"
  5. #include "BsMonoClass.h"
  6. #include "BsMonoUtil.h"
  7. #include "../../EditorCore/GUI/BsGUIColorField.h"
  8. #include "Wrappers/BsScriptColor.h"
  9. #include "BsScriptGUIContent.generated.h"
  10. #include "../../EditorCore/GUI/BsGUIColorField.h"
  11. #include "BsScriptHString.generated.h"
  12. namespace bs
  13. {
  14. ScriptGUIColorField::onClickedThunkDef ScriptGUIColorField::onClickedThunk;
  15. ScriptGUIColorField::ScriptGUIColorField(MonoObject* managedInstance, GUIColorField* value)
  16. :TScriptGUIElement(managedInstance, value)
  17. {
  18. value->onClicked.connect(std::bind(&ScriptGUIColorField::onClicked, this));
  19. }
  20. void ScriptGUIColorField::initRuntimeData()
  21. {
  22. metaData.scriptClass->addInternalCall("Internal_getValue", (void*)&ScriptGUIColorField::Internal_getValue);
  23. metaData.scriptClass->addInternalCall("Internal_setValue", (void*)&ScriptGUIColorField::Internal_setValue);
  24. metaData.scriptClass->addInternalCall("Internal_getAllowHDR", (void*)&ScriptGUIColorField::Internal_getAllowHDR);
  25. metaData.scriptClass->addInternalCall("Internal_setAllowHDR", (void*)&ScriptGUIColorField::Internal_setAllowHDR);
  26. metaData.scriptClass->addInternalCall("Internal_create", (void*)&ScriptGUIColorField::Internal_create);
  27. metaData.scriptClass->addInternalCall("Internal_create0", (void*)&ScriptGUIColorField::Internal_create0);
  28. metaData.scriptClass->addInternalCall("Internal_create1", (void*)&ScriptGUIColorField::Internal_create1);
  29. metaData.scriptClass->addInternalCall("Internal_create2", (void*)&ScriptGUIColorField::Internal_create2);
  30. metaData.scriptClass->addInternalCall("Internal_create3", (void*)&ScriptGUIColorField::Internal_create3);
  31. onClickedThunk = (onClickedThunkDef)metaData.scriptClass->getMethodExact("Internal_onClicked", "")->getThunk();
  32. }
  33. void ScriptGUIColorField::onClicked()
  34. {
  35. MonoUtil::invokeThunk(onClickedThunk, getManagedInstance());
  36. }
  37. void ScriptGUIColorField::Internal_getValue(ScriptGUIColorField* thisPtr, Color* __output)
  38. {
  39. Color tmp__output;
  40. tmp__output = static_cast<GUIColorField*>(thisPtr->getGUIElement())->getValue();
  41. *__output = tmp__output;
  42. }
  43. void ScriptGUIColorField::Internal_setValue(ScriptGUIColorField* thisPtr, Color* value)
  44. {
  45. static_cast<GUIColorField*>(thisPtr->getGUIElement())->setValue(*value);
  46. }
  47. bool ScriptGUIColorField::Internal_getAllowHDR(ScriptGUIColorField* thisPtr)
  48. {
  49. bool tmp__output;
  50. tmp__output = static_cast<GUIColorField*>(thisPtr->getGUIElement())->getAllowHDR();
  51. bool __output;
  52. __output = tmp__output;
  53. return __output;
  54. }
  55. void ScriptGUIColorField::Internal_setAllowHDR(ScriptGUIColorField* thisPtr, bool allow)
  56. {
  57. static_cast<GUIColorField*>(thisPtr->getGUIElement())->setAllowHDR(allow);
  58. }
  59. void ScriptGUIColorField::Internal_create(MonoObject* managedInstance, __GUIContentInterop* labelContent, uint32_t labelWidth, MonoString* style)
  60. {
  61. GUIContent tmplabelContent;
  62. tmplabelContent = ScriptGUIContent::fromInterop(*labelContent);
  63. String tmpstyle;
  64. tmpstyle = MonoUtil::monoToString(style);
  65. GUIColorField* instance = GUIColorField::create(tmplabelContent, labelWidth, tmpstyle);
  66. new (bs_alloc<ScriptGUIColorField>())ScriptGUIColorField(managedInstance, instance);
  67. }
  68. void ScriptGUIColorField::Internal_create0(MonoObject* managedInstance, __GUIContentInterop* labelContent, MonoString* style)
  69. {
  70. GUIContent tmplabelContent;
  71. tmplabelContent = ScriptGUIContent::fromInterop(*labelContent);
  72. String tmpstyle;
  73. tmpstyle = MonoUtil::monoToString(style);
  74. GUIColorField* instance = GUIColorField::create(tmplabelContent, tmpstyle);
  75. new (bs_alloc<ScriptGUIColorField>())ScriptGUIColorField(managedInstance, instance);
  76. }
  77. void ScriptGUIColorField::Internal_create1(MonoObject* managedInstance, MonoObject* labelText, uint32_t labelWidth, MonoString* style)
  78. {
  79. SPtr<HString> tmplabelText;
  80. ScriptHString* scriptlabelText;
  81. scriptlabelText = ScriptHString::toNative(labelText);
  82. if(scriptlabelText != nullptr)
  83. tmplabelText = scriptlabelText->getInternal();
  84. String tmpstyle;
  85. tmpstyle = MonoUtil::monoToString(style);
  86. GUIColorField* instance = GUIColorField::create(*tmplabelText, labelWidth, tmpstyle);
  87. new (bs_alloc<ScriptGUIColorField>())ScriptGUIColorField(managedInstance, instance);
  88. }
  89. void ScriptGUIColorField::Internal_create2(MonoObject* managedInstance, MonoObject* labelText, MonoString* style)
  90. {
  91. SPtr<HString> tmplabelText;
  92. ScriptHString* scriptlabelText;
  93. scriptlabelText = ScriptHString::toNative(labelText);
  94. if(scriptlabelText != nullptr)
  95. tmplabelText = scriptlabelText->getInternal();
  96. String tmpstyle;
  97. tmpstyle = MonoUtil::monoToString(style);
  98. GUIColorField* instance = GUIColorField::create(*tmplabelText, tmpstyle);
  99. new (bs_alloc<ScriptGUIColorField>())ScriptGUIColorField(managedInstance, instance);
  100. }
  101. void ScriptGUIColorField::Internal_create3(MonoObject* managedInstance, MonoString* style)
  102. {
  103. String tmpstyle;
  104. tmpstyle = MonoUtil::monoToString(style);
  105. GUIColorField* instance = GUIColorField::create(tmpstyle);
  106. new (bs_alloc<ScriptGUIColorField>())ScriptGUIColorField(managedInstance, instance);
  107. }
  108. }