makiapi.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef __SCRIPTAPI_H
  2. #define __SCRIPTAPI_H
  3. #include <api/script/api_makii.h>
  4. class ScriptApi : public api_makiI {
  5. public:
  6. ScriptApi();
  7. virtual ~ScriptApi();
  8. virtual void maki_pushObject(void *o);
  9. virtual void maki_pushInt(int v);
  10. virtual void maki_pushBoolean(int b);
  11. virtual void maki_pushFloat(float f);
  12. virtual void maki_pushDouble(double d);
  13. virtual void maki_pushString(const wchar_t *s);
  14. virtual void maki_pushVoid();
  15. virtual void maki_pushAny(scriptVar v);
  16. virtual void *maki_popObject();
  17. virtual int maki_popInt();
  18. virtual bool maki_popBoolean();
  19. virtual float maki_popFloat();
  20. virtual double maki_popDouble();
  21. virtual const wchar_t *maki_popString();
  22. virtual scriptVar maki_popAny();
  23. virtual void maki_popDiscard();
  24. virtual const wchar_t *maki_getFunction(int dlfid, int *n, ScriptObjectController **p);
  25. virtual int maki_addDlfRef(ScriptObjectController *o, const wchar_t *function_name, void *host);
  26. virtual void maki_addDlfClassRef(ScriptObjectController *o, void *host);
  27. virtual void maki_remDlfRef(void *host);
  28. virtual scriptVar maki_callFunction(ScriptObject *o, int dlfid, scriptVar **params);
  29. virtual scriptVar maki_triggerEvent(ScriptObject *o, int dlfid, int np, int scriptid0=-1);
  30. virtual int maki_getScriptInt(scriptVar v);
  31. virtual bool maki_getScriptBoolean(scriptVar v);
  32. virtual float maki_getScriptFloat(scriptVar v);
  33. virtual double maki_getScriptDouble(scriptVar v);
  34. virtual const wchar_t *maki_getScriptString(scriptVar v);
  35. virtual ScriptObject *maki_getScriptObject(scriptVar v);
  36. virtual scriptVar maki_updateDlf(maki_cmd *cmd, int *dlfid, int *linkcount);
  37. virtual ScriptObject *maki_instantiate(GUID classguid);
  38. virtual void maki_destroy(ScriptObject *o);
  39. virtual void *maki_encapsulate(GUID classguid, ScriptObject *o);
  40. virtual void maki_deencapsulate(GUID classguid, void *o);
  41. virtual ScriptObjectController *maki_getController(GUID scriptclass);
  42. virtual int maki_createOrphan(int type);
  43. virtual void maki_killOrphan(int id);
  44. virtual void maki_setObjectAtom(const wchar_t *atomname, ScriptObject *object);
  45. virtual ScriptObject *maki_getObjectAtom(const wchar_t *atomname);
  46. #ifdef WASABI_COMPILE_WND
  47. virtual ScriptObject *maki_findObject(const wchar_t *name);
  48. #endif
  49. virtual void vcpu_addScriptObject(ScriptObject *o);
  50. virtual void vcpu_removeScriptObject(ScriptObject *o);
  51. virtual int vcpu_getCacheCount();
  52. virtual int vcpu_isValidScriptId(int id);
  53. virtual int vcpu_mapVarId(int varid, int scriptid);
  54. virtual int vcpu_getUserAncestorId(int varid, int scriptid);
  55. virtual int vcpu_getNumEvents();
  56. virtual int vcpu_getEvent(int event, int *dlf, int *script, int *var);
  57. virtual int vcpu_getComplete();
  58. virtual const wchar_t *vcpu_getClassName(int vcpuid, int localclassid);
  59. };
  60. extern api_maki *makiApi;
  61. #endif