2004-05-30 02:46:58 +02:00
|
|
|
|
|
|
|
#ifndef _SCRIPTGLUE_H_
|
|
|
|
#define _SCRIPTGLUE_H_
|
|
|
|
|
|
|
|
#include "ScriptingHost.h"
|
|
|
|
|
2004-09-05 13:28:59 +02:00
|
|
|
typedef JSBool JSFunc(JSContext* /*context*/, JSObject* /*globalObject*/, unsigned int /*argc*/, jsval* /*argv*/, jsval* /*rval*/);
|
|
|
|
|
2004-07-07 20:27:25 +02:00
|
|
|
// Functions to be called from Javascript:
|
2004-05-30 02:46:58 +02:00
|
|
|
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc WriteLog;
|
2004-07-07 20:27:25 +02:00
|
|
|
|
2004-10-07 21:23:35 +02:00
|
|
|
// Entity
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc getEntityByHandle;
|
|
|
|
JSFunc getEntityTemplate;
|
2004-10-07 21:23:35 +02:00
|
|
|
JSBool GetEntitySet( JSContext* context, JSObject* globalObject, jsval argv, jsval* vp );
|
|
|
|
|
|
|
|
// Timer
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc setTimeout;
|
|
|
|
JSFunc setInterval;
|
|
|
|
JSFunc cancelInterval;
|
2004-06-11 00:24:03 +02:00
|
|
|
|
2004-10-07 21:23:35 +02:00
|
|
|
// Debug
|
|
|
|
JSBool forceGC( JSContext* context, JSObject* globalObject, unsigned int argc, jsval* argv, jsval* rval );
|
|
|
|
|
2004-07-11 18:22:35 +02:00
|
|
|
// Returns the sort-of-global object associated with the current GUI
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc getGUIGlobal;
|
2004-07-11 18:22:35 +02:00
|
|
|
|
2004-07-07 20:27:25 +02:00
|
|
|
// Returns the global object, e.g. for setting global variables.
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc getGlobal;
|
2004-07-09 14:44:12 +02:00
|
|
|
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc setCursor;
|
2004-07-31 14:45:30 +02:00
|
|
|
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc startServer;
|
|
|
|
JSFunc joinGame;
|
|
|
|
JSFunc startGame;
|
|
|
|
JSFunc endGame;
|
2004-08-05 15:07:51 +02:00
|
|
|
|
2004-08-21 13:45:01 +02:00
|
|
|
// Replaces the current language (locale) with a new one
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc loadLanguage;
|
|
|
|
|
|
|
|
// Returns the current language's name, in the same form as passed to loadLanguage
|
|
|
|
JSFunc getLanguageID;
|
|
|
|
|
|
|
|
JSFunc getFPS;
|
2004-08-21 13:45:01 +02:00
|
|
|
|
2004-08-30 13:20:59 +02:00
|
|
|
// Returns a string that says when ScriptGlue.cpp was last recompiled
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc buildTime;
|
2004-08-30 13:20:59 +02:00
|
|
|
|
2004-07-09 14:44:12 +02:00
|
|
|
// Tells the main loop to stop looping
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc exitProgram;
|
2004-07-07 20:27:25 +02:00
|
|
|
|
2004-07-15 21:29:56 +02:00
|
|
|
// Crashes.
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc crash;
|
2004-07-15 21:29:56 +02:00
|
|
|
|
2004-08-21 13:45:01 +02:00
|
|
|
// Tries to print the amount of remaining video memory. (I don't like starting functions with underscores).
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc js_mem;
|
2004-08-14 13:21:29 +02:00
|
|
|
|
2004-06-09 16:02:40 +02:00
|
|
|
extern JSFunctionSpec ScriptFunctionTable[];
|
2004-07-20 21:30:35 +02:00
|
|
|
extern JSPropertySpec ScriptGlobalTable[];
|
2004-05-30 02:46:58 +02:00
|
|
|
|
|
|
|
#endif
|