ScummVM API documentation
ltm.h
1 /*
2 ** Tag methods
3 ** See Copyright Notice in lua.h
4 */
5 
6 #ifndef GRIM_LTM_H
7 #define GRIM_LTM_H
8 
9 #include "engines/grim/lua/lobject.h"
10 #include "engines/grim/lua/lstate.h"
11 
12 namespace Grim {
13 
14 /*
15 * WARNING: if you change the order of this enumeration,
16 * grep "ORDER IM"
17 */
18 typedef enum {
19  IM_GETTABLE = 0,
20  IM_SETTABLE,
21  IM_INDEX,
22  IM_GETGLOBAL,
23  IM_SETGLOBAL,
24  IM_ADD,
25  IM_SUB,
26  IM_MUL,
27  IM_DIV,
28  IM_POW,
29  IM_UNM,
30  IM_LT,
31  IM_LE,
32  IM_GT,
33  IM_GE,
34  IM_CONCAT,
35  IM_GC,
36  IM_FUNCTION
37 } eIMS;
38 typedef int32 IMS;
39 
40 #define IM_N 18
41 
42 struct IM {
43  TObject int_method[IM_N];
44 };
45 
46 #define luaT_getim(tag, event) (&IMtable[-(tag)].int_method[event])
47 #define luaT_getimbyObj(o, e) (luaT_getim(luaT_efectivetag(o), (e)))
48 
49 extern const char *luaT_eventname[];
50 
51 void luaT_init();
52 void luaT_realtag(int32 tag);
53 int32 luaT_efectivetag(TObject *o);
54 void luaT_settagmethod(int32 t, const char *event, TObject *func);
55 TObject *luaT_gettagmethod(int32 t, const char *event);
56 const char *luaT_travtagmethods(int32 (*fn)(TObject *));
57 
58 void luaT_setfallback(); // only if LUA_COMPAT2_5
59 
60 } // end of namespace Grim
61 
62 #endif
Definition: lobject.h:65
Definition: ltm.h:42
Definition: actor.h:33