Support deleting GUI Object event handlers following rP666, refs #5387.
[0ad.git] / source / gui / Scripting / JSInterface_IGUIObject.h
bloba90f827701eb91e98c3c958ee9ed76c2dbf2e7ad
1 /* Copyright (C) 2019 Wildfire Games.
2 * This file is part of 0 A.D.
4 * 0 A.D. is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
9 * 0 A.D. is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef INCLUDED_JSI_IGUIOBJECT
19 #define INCLUDED_JSI_IGUIOBJECT
21 #include "scriptinterface/ScriptInterface.h"
23 namespace JSI_IGUIObject
25 extern JSClass JSI_class;
26 extern JSFunctionSpec JSI_methods[];
28 void RegisterScriptClass(ScriptInterface& scriptInterface);
30 bool getProperty(JSContext* cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp);
31 bool setProperty(JSContext* cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp, JS::ObjectOpResult& result);
32 bool deleteProperty(JSContext* cx, JS::HandleObject obj, JS::HandleId id, JS::ObjectOpResult& result);
33 bool toString(JSContext* cx, uint argc, JS::Value* vp);
34 bool focus(JSContext* cx, uint argc, JS::Value* vp);
35 bool blur(JSContext* cx, uint argc, JS::Value* vp);
36 bool getComputedSize(JSContext* cx, uint argc, JS::Value* vp);
37 bool getTextSize(JSContext* cx, uint argc, JS::Value* vp);
40 #endif // INCLUDED_JSI_IGUIOBJECT