api_maki.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  1. // ----------------------------------------------------------------------------
  2. // Generated by InterfaceFactory [Fri Oct 01 02:49:40 1999]
  3. //
  4. // File : api_maki.h
  5. // Class : api_maki
  6. // class layer : Dispatchable Interface
  7. // ----------------------------------------------------------------------------
  8. #ifndef __API_MAKI_H
  9. #define __API_MAKI_H
  10. #include <bfc/dispatch.h>
  11. class ScriptObject;
  12. class ScriptObjectController;
  13. #include <api/script/scriptvar.h>
  14. #include <api/script/vcputypes.h>
  15. // ----------------------------------------------------------------------------
  16. class NOVTABLE api_maki: public Dispatchable {
  17. protected:
  18. api_maki() {}
  19. ~api_maki() {}
  20. public:
  21. void maki_pushObject(void *o);
  22. void maki_pushInt(int i);
  23. void maki_pushBoolean(int b);
  24. void maki_pushFloat(float f);
  25. void maki_pushDouble(double d);
  26. void maki_pushString(const wchar_t *s);
  27. void maki_pushVoid();
  28. void maki_pushAny(scriptVar v);
  29. void *maki_popObject();
  30. int maki_popInt();
  31. bool maki_popBoolean();
  32. float maki_popFloat();
  33. double maki_popDouble();
  34. const wchar_t *maki_popString();
  35. scriptVar maki_popAny();
  36. void maki_popDiscard();
  37. const wchar_t *maki_getFunction(int dlfid, int *nparams, ScriptObjectController **p);
  38. int maki_addDlfRef(ScriptObjectController *o, const wchar_t *function_name, void *host);
  39. void maki_addDlfClassRef(ScriptObjectController *o, void *host);
  40. void maki_remDlfRef(void *host);
  41. scriptVar maki_callFunction(ScriptObject *o, int dlfid, scriptVar **params);
  42. scriptVar maki_triggerEvent(ScriptObject *o, int dlfid, int np, int scriptid = -1);
  43. int maki_getScriptInt(scriptVar v);
  44. bool maki_getScriptBoolean(scriptVar v);
  45. float maki_getScriptFloat(scriptVar v);
  46. double maki_getScriptDouble(scriptVar v);
  47. const wchar_t *maki_getScriptString(scriptVar v);
  48. ScriptObject *maki_getScriptObject(scriptVar v);
  49. scriptVar maki_updateDlf(maki_cmd *cmd, int *dlfid, int *linkcount);
  50. ScriptObject *maki_instantiate(GUID classguid);
  51. void maki_destroy(ScriptObject *o);
  52. void *maki_encapsulate(GUID classguid, ScriptObject *o);
  53. void maki_deencapsulate(GUID classguid, void *o);
  54. ScriptObjectController *maki_getController(GUID scriptclass);
  55. int maki_createOrphan(int type);
  56. void maki_killOrphan(int id);
  57. void maki_setObjectAtom(const wchar_t *atomname, ScriptObject *object);
  58. ScriptObject *maki_getObjectAtom(const wchar_t *atomname);
  59. #ifdef WASABI_COMPILE_WND
  60. ScriptObject *maki_findObject(const wchar_t *name);
  61. #endif
  62. void vcpu_addScriptObject(ScriptObject *o);
  63. void vcpu_removeScriptObject(ScriptObject *o);
  64. int vcpu_getCacheCount();
  65. int vcpu_isValidScriptId(int id);
  66. int vcpu_mapVarId(int varid, int scriptid);
  67. int vcpu_getUserAncestorId(int varid, int scriptid);
  68. int vcpu_getNumEvents();
  69. int vcpu_getEvent(int event, int *dlf, int *script, int *var);
  70. int vcpu_getComplete();
  71. void vcpu_setComplete();
  72. void vcpu_resetComplete();
  73. const wchar_t *vcpu_getClassName(int vcpuid, int localclassid);
  74. protected:
  75. enum {
  76. API_MAKI_MAKI_PUSHOBJECT = 10,
  77. API_MAKI_MAKI_PUSHINT = 20,
  78. API_MAKI_MAKI_PUSHBOOLEAN = 30,
  79. API_MAKI_MAKI_PUSHFLOAT = 40,
  80. API_MAKI_MAKI_PUSHDOUBLE = 50,
  81. API_MAKI_MAKI_PUSHSTRING = 60,
  82. API_MAKI_MAKI_PUSHVOID = 70,
  83. API_MAKI_MAKI_PUSHANY = 80,
  84. API_MAKI_MAKI_POPOBJECT = 90,
  85. API_MAKI_MAKI_POPINT = 100,
  86. API_MAKI_MAKI_POPBOOLEAN = 110,
  87. API_MAKI_MAKI_POPFLOAT = 120,
  88. API_MAKI_MAKI_POPDOUBLE = 130,
  89. API_MAKI_MAKI_POPSTRING = 140,
  90. API_MAKI_MAKI_POPANY = 150,
  91. API_MAKI_MAKI_POPDISCARD = 160,
  92. API_MAKI_MAKI_GETFUNCTION = 170,
  93. API_MAKI_MAKI_ADDDLFREF = 180,
  94. API_MAKI_MAKI_ADDDLFCLASSREF = 190,
  95. API_MAKI_MAKI_REMDLFREF = 200,
  96. API_MAKI_MAKI_CALLFUNCTION = 210,
  97. API_MAKI_MAKI_TRIGGEREVENT = 220,
  98. API_MAKI_MAKI_GETSCRIPTINT = 230,
  99. API_MAKI_MAKI_GETSCRIPTBOOLEAN = 240,
  100. API_MAKI_MAKI_GETSCRIPTFLOAT = 250,
  101. API_MAKI_MAKI_GETSCRIPTDOUBLE = 260,
  102. API_MAKI_MAKI_GETSCRIPTSTRING = 270,
  103. API_MAKI_MAKI_GETSCRIPTOBJECT = 280,
  104. API_MAKI_MAKI_UPDATEDLF = 290,
  105. API_MAKI_MAKI_INSTANTIATE = 300,
  106. API_MAKI_MAKI_DESTROY = 310,
  107. API_MAKI_MAKI_ENCAPSULATE = 320,
  108. API_MAKI_MAKI_DEENCAPSULATE = 330,
  109. API_MAKI_MAKI_GETCONTROLLER = 340,
  110. API_MAKI_MAKI_CREATEORPHAN = 350,
  111. API_MAKI_MAKI_KILLORPHAN = 360,
  112. API_MAKI_MAKI_SETOBJECTATOM = 370,
  113. API_MAKI_MAKI_GETOBJECTATOM = 380,
  114. #ifdef WASABI_COMPILE_WND
  115. API_MAKI_MAKI_FINDOBJECT = 390,
  116. #endif
  117. API_MAKI_VCPU_ADDSCRIPTOBJECT = 400,
  118. API_MAKI_VCPU_REMOVESCRIPTOBJECT = 410,
  119. API_MAKI_VCPU_GETCACHECOUNT = 420,
  120. API_MAKI_VCPU_ISVALIDSCRIPTID = 430,
  121. API_MAKI_VCPU_MAPVARID = 440,
  122. API_MAKI_VCPU_GETUSERANCESTORID = 450,
  123. API_MAKI_VCPU_GETNUMEVENTS = 460,
  124. API_MAKI_VCPU_GETEVENT = 470,
  125. API_MAKI_VCPU_GETCOMPLETE = 480,
  126. API_MAKI_VCPU_SETCOMPLETE = 481,
  127. API_MAKI_VCPU_RESETCOMPLETE = 482,
  128. API_MAKI_VCPU_GETCLASSNAME = 490,
  129. };
  130. };
  131. // ----------------------------------------------------------------------------
  132. inline void api_maki::maki_pushObject(void *o) {
  133. _voidcall(API_MAKI_MAKI_PUSHOBJECT, o);
  134. }
  135. inline void api_maki::maki_pushInt(int i) {
  136. _voidcall(API_MAKI_MAKI_PUSHINT, i);
  137. }
  138. inline void api_maki::maki_pushBoolean(int b) {
  139. _voidcall(API_MAKI_MAKI_PUSHBOOLEAN, b);
  140. }
  141. inline void api_maki::maki_pushFloat(float f) {
  142. _voidcall(API_MAKI_MAKI_PUSHFLOAT, f);
  143. }
  144. inline void api_maki::maki_pushDouble(double d) {
  145. _voidcall(API_MAKI_MAKI_PUSHDOUBLE, d);
  146. }
  147. inline void api_maki::maki_pushString(const wchar_t *s) {
  148. _voidcall(API_MAKI_MAKI_PUSHSTRING, s);
  149. }
  150. inline void api_maki::maki_pushVoid() {
  151. _voidcall(API_MAKI_MAKI_PUSHVOID);
  152. }
  153. inline void api_maki::maki_pushAny(scriptVar v) {
  154. _voidcall(API_MAKI_MAKI_PUSHANY, v);
  155. }
  156. inline void *api_maki::maki_popObject() {
  157. void *__retval = _call(API_MAKI_MAKI_POPOBJECT, (void *)NULL);
  158. return __retval;
  159. }
  160. inline int api_maki::maki_popInt() {
  161. int __retval = _call(API_MAKI_MAKI_POPINT, (int)0);
  162. return __retval;
  163. }
  164. inline bool api_maki::maki_popBoolean() {
  165. bool __retval = _call(API_MAKI_MAKI_POPBOOLEAN, (bool)0);
  166. return __retval;
  167. }
  168. inline float api_maki::maki_popFloat() {
  169. float __retval = _call(API_MAKI_MAKI_POPFLOAT, (float)0);
  170. return __retval;
  171. }
  172. inline double api_maki::maki_popDouble() {
  173. double __retval = _call(API_MAKI_MAKI_POPDOUBLE, (double)0);
  174. return __retval;
  175. }
  176. inline const wchar_t *api_maki::maki_popString() {
  177. return _call(API_MAKI_MAKI_POPSTRING, (const wchar_t *)0);
  178. }
  179. inline scriptVar api_maki::maki_popAny()
  180. {
  181. scriptVar r; r.type = SCRIPT_VOID; r.data.idata = 0;
  182. scriptVar __retval = _call(API_MAKI_MAKI_POPANY, (scriptVar)r);
  183. return __retval;
  184. }
  185. inline void api_maki::maki_popDiscard() {
  186. _voidcall(API_MAKI_MAKI_POPDISCARD);
  187. }
  188. inline const wchar_t *api_maki::maki_getFunction(int dlfid, int *nparams, ScriptObjectController **p) {
  189. return _call(API_MAKI_MAKI_GETFUNCTION, (const wchar_t *)0, dlfid, nparams, p);
  190. }
  191. inline int api_maki::maki_addDlfRef(ScriptObjectController *o, const wchar_t *function_name, void *host) {
  192. int __retval = _call(API_MAKI_MAKI_ADDDLFREF, (int)0, o, function_name, host);
  193. return __retval;
  194. }
  195. inline void api_maki::maki_addDlfClassRef(ScriptObjectController *o, void *host) {
  196. _voidcall(API_MAKI_MAKI_ADDDLFCLASSREF, o, host);
  197. }
  198. inline void api_maki::maki_remDlfRef(void *host) {
  199. _voidcall(API_MAKI_MAKI_REMDLFREF, host);
  200. }
  201. inline scriptVar api_maki::maki_callFunction(ScriptObject *o, int dlfid, scriptVar **params) {
  202. scriptVar r; r.type = SCRIPT_VOID; r.data.idata = 0;
  203. scriptVar __retval = _call(API_MAKI_MAKI_CALLFUNCTION, (scriptVar)r, o, dlfid, params);
  204. return __retval;
  205. }
  206. inline scriptVar api_maki::maki_triggerEvent(ScriptObject *o, int dlfid, int np, int scriptid) {
  207. scriptVar r; r.type = SCRIPT_VOID; r.data.idata = 0;
  208. scriptVar __retval = _call(API_MAKI_MAKI_TRIGGEREVENT, (scriptVar)r, o, dlfid, np, scriptid);
  209. return __retval;
  210. }
  211. inline int api_maki::maki_getScriptInt(scriptVar v) {
  212. int __retval = _call(API_MAKI_MAKI_GETSCRIPTINT, (int)0, v);
  213. return __retval;
  214. }
  215. inline bool api_maki::maki_getScriptBoolean(scriptVar v) {
  216. bool __retval = _call(API_MAKI_MAKI_GETSCRIPTBOOLEAN, (bool)0, v);
  217. return __retval;
  218. }
  219. inline float api_maki::maki_getScriptFloat(scriptVar v) {
  220. float __retval = _call(API_MAKI_MAKI_GETSCRIPTFLOAT, (float)0, v);
  221. return __retval;
  222. }
  223. inline double api_maki::maki_getScriptDouble(scriptVar v) {
  224. double __retval = _call(API_MAKI_MAKI_GETSCRIPTDOUBLE, (double)0, v);
  225. return __retval;
  226. }
  227. inline const wchar_t *api_maki::maki_getScriptString(scriptVar v) {
  228. const wchar_t *__retval = _call(API_MAKI_MAKI_GETSCRIPTSTRING, (const wchar_t *)0, v);
  229. return __retval;
  230. }
  231. inline ScriptObject *api_maki::maki_getScriptObject(scriptVar v) {
  232. ScriptObject *__retval = _call(API_MAKI_MAKI_GETSCRIPTOBJECT, (ScriptObject *)NULL, v);
  233. return __retval;
  234. }
  235. inline scriptVar api_maki::maki_updateDlf(maki_cmd *cmd, int *dlfid, int *linkcount) {
  236. scriptVar r; r.type = SCRIPT_VOID; r.data.idata = 0;
  237. scriptVar __retval = _call(API_MAKI_MAKI_UPDATEDLF, (scriptVar)r, cmd, dlfid, linkcount);
  238. return __retval;
  239. }
  240. inline ScriptObject *api_maki::maki_instantiate(GUID classguid) {
  241. ScriptObject *__retval = _call(API_MAKI_MAKI_INSTANTIATE, (ScriptObject *)NULL, classguid);
  242. return __retval;
  243. }
  244. inline void api_maki::maki_destroy(ScriptObject *o) {
  245. _voidcall(API_MAKI_MAKI_DESTROY, o);
  246. }
  247. inline void *api_maki::maki_encapsulate(GUID classguid, ScriptObject *o) {
  248. void *__retval = _call(API_MAKI_MAKI_ENCAPSULATE, (void *)NULL, classguid, o);
  249. return __retval;
  250. }
  251. inline void api_maki::maki_deencapsulate(GUID classguid, void *o) {
  252. _voidcall(API_MAKI_MAKI_DEENCAPSULATE, classguid, o);
  253. }
  254. inline ScriptObjectController *api_maki::maki_getController(GUID scriptclass) {
  255. ScriptObjectController *__retval = _call(API_MAKI_MAKI_GETCONTROLLER, (ScriptObjectController *)NULL, scriptclass);
  256. return __retval;
  257. }
  258. inline int api_maki::maki_createOrphan(int type) {
  259. int __retval = _call(API_MAKI_MAKI_CREATEORPHAN, (int)0, type);
  260. return __retval;
  261. }
  262. inline void api_maki::maki_killOrphan(int id) {
  263. _voidcall(API_MAKI_MAKI_KILLORPHAN, id);
  264. }
  265. inline void api_maki::maki_setObjectAtom(const wchar_t *atomname, ScriptObject *object) {
  266. _voidcall(API_MAKI_MAKI_SETOBJECTATOM, atomname, object);
  267. }
  268. inline ScriptObject *api_maki::maki_getObjectAtom(const wchar_t *atomname) {
  269. ScriptObject *__retval = _call(API_MAKI_MAKI_GETOBJECTATOM, (ScriptObject *)NULL, atomname);
  270. return __retval;
  271. }
  272. #ifdef WASABI_COMPILE_WND
  273. inline ScriptObject *api_maki::maki_findObject(const wchar_t *name) {
  274. ScriptObject *__retval = _call(API_MAKI_MAKI_FINDOBJECT, (ScriptObject *)NULL, name);
  275. return __retval;
  276. }
  277. #endif
  278. inline void api_maki::vcpu_addScriptObject(ScriptObject *o) {
  279. _voidcall(API_MAKI_VCPU_ADDSCRIPTOBJECT, o);
  280. }
  281. inline void api_maki::vcpu_removeScriptObject(ScriptObject *o) {
  282. _voidcall(API_MAKI_VCPU_REMOVESCRIPTOBJECT, o);
  283. }
  284. inline int api_maki::vcpu_getCacheCount() {
  285. int __retval = _call(API_MAKI_VCPU_GETCACHECOUNT, (int)0);
  286. return __retval;
  287. }
  288. inline int api_maki::vcpu_isValidScriptId(int id) {
  289. int __retval = _call(API_MAKI_VCPU_ISVALIDSCRIPTID, (int)0, id);
  290. return __retval;
  291. }
  292. inline int api_maki::vcpu_mapVarId(int varid, int scriptid) {
  293. int __retval = _call(API_MAKI_VCPU_MAPVARID, (int)0, varid, scriptid);
  294. return __retval;
  295. }
  296. inline int api_maki::vcpu_getUserAncestorId(int varid, int scriptid) {
  297. int __retval = _call(API_MAKI_VCPU_GETUSERANCESTORID, (int)0, varid, scriptid);
  298. return __retval;
  299. }
  300. inline int api_maki::vcpu_getNumEvents() {
  301. int __retval = _call(API_MAKI_VCPU_GETNUMEVENTS, (int)0);
  302. return __retval;
  303. }
  304. inline int api_maki::vcpu_getEvent(int event, int *dlf, int *script, int *var) {
  305. int __retval = _call(API_MAKI_VCPU_GETEVENT, (int)0, event, dlf, script, var);
  306. return __retval;
  307. }
  308. inline int api_maki::vcpu_getComplete() {
  309. int __retval = _call(API_MAKI_VCPU_GETCOMPLETE, (int)0);
  310. return __retval;
  311. }
  312. inline void api_maki::vcpu_setComplete() {
  313. _voidcall(API_MAKI_VCPU_SETCOMPLETE);
  314. }
  315. inline void api_maki::vcpu_resetComplete() {
  316. _voidcall(API_MAKI_VCPU_RESETCOMPLETE);
  317. }
  318. inline const wchar_t *api_maki::vcpu_getClassName(int vcpuid, int localclassid) {
  319. return _call(API_MAKI_VCPU_GETCLASSNAME, (const wchar_t *)0, vcpuid, localclassid);
  320. }
  321. // ----------------------------------------------------------------------------
  322. // {87D2391B-C928-4a49-8E0B-D47C049E0711}
  323. static const GUID makiApiServiceGuid =
  324. { 0x87d2391b, 0xc928, 0x4a49, { 0x8e, 0xb, 0xd4, 0x7c, 0x4, 0x9e, 0x7, 0x11 } };
  325. extern api_maki *makiApi;
  326. #endif // __API_MAKI_H