Changeset View
Changeset View
Standalone View
Standalone View
source/gui/Scripting/JSInterface_IGUIObject.cpp
Show All 18 Lines | |||||
#include "JSInterface_IGUIObject.h" | #include "JSInterface_IGUIObject.h" | ||||
#include <type_traits> | #include <type_traits> | ||||
#include "gui/CGUI.h" | #include "gui/CGUI.h" | ||||
#include "gui/CGUISetting.h" | #include "gui/CGUISetting.h" | ||||
#include "gui/ObjectBases/IGUIObject.h" | #include "gui/ObjectBases/IGUIObject.h" | ||||
#include "gui/ObjectTypes/CList.h" | |||||
#include "gui/ObjectTypes/CText.h" | #include "gui/ObjectTypes/CText.h" | ||||
#include "scriptinterface/ScriptExtraHeaders.h" | #include "scriptinterface/ScriptExtraHeaders.h" | ||||
#include "scriptinterface/ScriptInterface.h" | #include "scriptinterface/ScriptInterface.h" | ||||
/** | /** | ||||
* Convenient struct to get info on a [const] function pointer. | * Convenient struct to get info on a [const] function pointer. | ||||
*/ | */ | ||||
template<typename ptr> | template<typename ptr> | ||||
Show All 38 Lines | |||||
JSI_GUI::TextObjectFactory::TextObjectFactory(ScriptInterface& scriptInterface) : JSI_GUI::GUIObjectFactory(scriptInterface) | JSI_GUI::TextObjectFactory::TextObjectFactory(ScriptInterface& scriptInterface) : JSI_GUI::GUIObjectFactory(scriptInterface) | ||||
{ | { | ||||
JSAutoRequest rq(scriptInterface.GetContext()); | JSAutoRequest rq(scriptInterface.GetContext()); | ||||
SetupHandler(&CText::GetTextSize, "getTextSize"); | SetupHandler(&CText::GetTextSize, "getTextSize"); | ||||
} | } | ||||
JSI_GUI::ListObjectFactory::ListObjectFactory(ScriptInterface& scriptInterface) : JSI_GUI::GUIObjectFactory(scriptInterface) | |||||
{ | |||||
JSAutoRequest rq(scriptInterface.GetContext()); | |||||
SetupHandler(&CList::AddItem, "pushItem"); | |||||
} | |||||
#undef SetupHandler | #undef SetupHandler | ||||
/** | /** | ||||
* Based on https://stackoverflow.com/a/32223343 | * Based on https://stackoverflow.com/a/32223343 | ||||
* make_index_sequence is not defined in C++11... Only C++14. | * make_index_sequence is not defined in C++11... Only C++14. | ||||
*/ | */ | ||||
template <size_t... Ints> | template <size_t... Ints> | ||||
struct index_sequence | struct index_sequence | ||||
▲ Show 20 Lines • Show All 277 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator