Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/gui/scripting/GuiScriptConversions.cpp
Show All 21 Lines | |||||
#include "gui/CGUISeries.h" | #include "gui/CGUISeries.h" | ||||
#include "gui/GUIbase.h" | #include "gui/GUIbase.h" | ||||
#include "gui/IGUIObject.h" | #include "gui/IGUIObject.h" | ||||
#include "lib/external_libraries/libsdl.h" | #include "lib/external_libraries/libsdl.h" | ||||
#include "maths/Vector2D.h" | #include "maths/Vector2D.h" | ||||
#include "ps/Hotkey.h" | #include "ps/Hotkey.h" | ||||
#include "scriptinterface/ScriptConversions.h" | #include "scriptinterface/ScriptConversions.h" | ||||
#include <string> | |||||
#define SET(obj, name, value) STMT(JS::RootedValue v_(cx); AssignOrToJSVal(cx, &v_, (value)); JS_SetProperty(cx, obj, (name), v_)) | #define SET(obj, name, value) STMT(JS::RootedValue v_(cx); AssignOrToJSVal(cx, &v_, (value)); JS_SetProperty(cx, obj, (name), v_)) | ||||
// ignore JS_SetProperty return value, because errors should be impossible | // ignore JS_SetProperty return value, because errors should be impossible | ||||
// and we can't do anything useful in the case of errors anyway | // and we can't do anything useful in the case of errors anyway | ||||
template<> void ScriptInterface::ToJSVal<SDL_Event_>(JSContext* cx, JS::MutableHandleValue ret, SDL_Event_ const& val) | template<> void ScriptInterface::ToJSVal<SDL_Event_>(JSContext* cx, JS::MutableHandleValue ret, SDL_Event_ const& val) | ||||
{ | { | ||||
JSAutoRequest rq(cx); | JSAutoRequest rq(cx); | ||||
const char* typeName; | const char* typeName; | ||||
▲ Show 20 Lines • Show All 320 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator