10 #define FN(EGO_FUNC, E_FUNC) \
12 EGO_FUNC (lua_State *L) \
14 luaobj_Object *obj = lua_touserdata (L, 1); \
23 #define GET_BOOL(EGO_FUNC, E_FUNC) \
25 EGO_FUNC (lua_State *L) \
27 luaobj_Object *obj = lua_touserdata (L, 1); \
28 lua_pushboolean (L, E_FUNC (obj->data)); \
32 #define SET_BOOL(EGO_FUNC, E_FUNC) \
34 EGO_FUNC (lua_State *L) \
36 luaobj_Object *obj = lua_touserdata (L, 1); \
37 E_FUNC (obj->data, lua_toboolean (L, 2)); \
45 #define GET_INTEGER(EGO_FUNC, E_FUNC) \
47 EGO_FUNC (lua_State *L) \
49 luaobj_Object *obj = lua_touserdata (L, 1); \
50 lua_pushnumber (L, E_FUNC (obj->data)); \
54 #define SET_INTEGER(EGO_FUNC, E_FUNC) \
56 EGO_FUNC (lua_State *L) \
58 luaobj_Object *obj = lua_touserdata (L, 1); \
59 E_FUNC (obj->data, luaL_checkinteger (L, 2)); \
67 #define GET_FLOAT(EGO_FUNC, E_FUNC) \
69 EGO_FUNC (lua_State *L) \
71 luaobj_Object *obj = lua_touserdata (L, 1); \
72 lua_pushnumber (L, E_FUNC (obj->data)); \
76 #define SET_FLOAT(EGO_FUNC, E_FUNC) \
78 EGO_FUNC (lua_State *L) \
80 luaobj_Object *obj = lua_touserdata (L, 1); \
81 E_FUNC (obj->data, luaL_checknumber (L, 2)); \
89 #define GET_STRING(EGO_FUNC, E_FUNC) \
91 EGO_FUNC (lua_State *L) \
93 luaobj_Object *obj = lua_touserdata (L, 1); \
94 lua_pushstring (L, (const char *) E_FUNC (obj->data)); \
98 #define SET_STRING(EGO_FUNC, E_FUNC) \
100 EGO_FUNC (lua_State *L) \
102 luaobj_Object *obj = lua_touserdata (L, 1); \
103 E_FUNC (obj->data, luaL_checkstring (L, 2)); \
111 #define GET_OBJ(EGO_FUNC, E_FUNC) \
113 EGO_FUNC (lua_State *L) \
115 luaobj_Object *obj = lua_touserdata (L, 1); \
116 Evas_Object *tar = E_FUNC (obj->data); \
119 luaobj_Ref *ref = evas_object_data_get (tar, "luaobj"); \
120 luaobj_get_ref (L, ref); \
127 #define SET_OBJ(EGO_FUNC, E_FUNC) \
129 EGO_FUNC (lua_State *L) \
131 luaobj_Object *obj = lua_touserdata (L, 1); \
132 luaobj_Object *tar = lua_touserdata (L, 2); \
133 E_FUNC (obj->data, tar->data); \
137 #define FN_STRING(EGO_FUNC, E_FUNC) \
139 EGO_FUNC (lua_State *L) \
141 luaobj_Object *obj = lua_touserdata (L, 1); \
142 E_FUNC (obj->data, luaL_checkstring (L, 2)); \
146 #define FN_2STRING(EGO_FUNC, E_FUNC) \
148 EGO_FUNC (lua_State *L) \
150 luaobj_Object *obj = lua_touserdata (L, 1); \
153 luaL_checkstring (L, 2), \
154 luaL_checkstring (L, 3)); \
158 #define FN_OBJ(EGO_FUNC, E_FUNC) \
160 EGO_FUNC (lua_State *L) \
162 luaobj_Object *obj = lua_touserdata (L, 1); \
163 luaobj_Object *tar = lua_touserdata (L, 2); \
164 E_FUNC (obj->data, tar->data); \
168 #define FN_2OBJ(EGO_FUNC, E_FUNC) \
170 EGO_FUNC (lua_State *L) \
172 luaobj_Object *obj = lua_touserdata (L, 1); \
173 luaobj_Object *tar1 = lua_touserdata (L, 2); \
174 luaobj_Object *tar2 = lua_touserdata (L, 3); \
175 E_FUNC (obj->data, tar1->data, tar2->data); \
183 #define GET_TAB2BOOL(EGO_FUNC, E_FUNC) \
185 EGO_FUNC (lua_State *L) \
187 luaobj_Object *obj = lua_touserdata (L, 1); \
189 E_FUNC (obj->data, &p1, &p2); \
191 lua_pushboolean (L, p1); lua_rawseti (L, -2, 1); \
192 lua_pushboolean (L, p2); lua_rawseti (L, -2, 2); \
196 #define SET_TAB2BOOL(EGO_FUNC, E_FUNC) \
198 EGO_FUNC (lua_State *L) \
200 luaobj_Object *obj = lua_touserdata (L, 1); \
201 lua_rawgeti (L, 2, 1); \
202 lua_rawgeti (L, 2, 2); \
205 lua_toboolean (L, -2),\
206 lua_toboolean (L, -1)); \
214 #define GET_TAB2INTEGER(EGO_FUNC, E_FUNC) \
216 EGO_FUNC (lua_State *L) \
218 luaobj_Object *obj = lua_touserdata (L, 1); \
220 E_FUNC (obj->data, &p1, &p2); \
222 lua_pushnumber (L, p1); lua_rawseti (L, -2, 1); \
223 lua_pushnumber (L, p2); lua_rawseti (L, -2, 2); \
227 #define SET_TAB2INTEGER(EGO_FUNC, E_FUNC) \
229 EGO_FUNC (lua_State *L) \
231 luaobj_Object *obj = lua_touserdata (L, 1); \
232 lua_rawgeti (L, 2, 1); \
233 lua_rawgeti (L, 2, 2); \
236 luaL_checkinteger (L, -2),\
237 luaL_checkinteger (L, -1)); \
245 #define GET_TAB2FLOAT(EGO_FUNC, E_FUNC) \
247 EGO_FUNC (lua_State *L) \
249 luaobj_Object *obj = lua_touserdata (L, 1); \
251 E_FUNC (obj->data, &p1, &p2); \
253 lua_pushnumber (L, p1); lua_rawseti (L, -2, 1); \
254 lua_pushnumber (L, p2); lua_rawseti (L, -2, 2); \
258 #define SET_TAB2FLOAT(EGO_FUNC, E_FUNC) \
260 EGO_FUNC (lua_State *L) \
262 luaobj_Object *obj = lua_touserdata (L, 1); \
263 lua_rawgeti (L, 2, 1); \
264 lua_rawgeti (L, 2, 2); \
267 luaL_checknumber (L, -2),\
268 luaL_checknumber (L, -1)); \
276 #define GET_TAB2STRING(EGO_FUNC, E_FUNC) \
278 EGO_FUNC (lua_State *L) \
280 luaobj_Object *obj = lua_touserdata (L, 1); \
282 E_FUNC (obj->data, &p1, &p2); \
284 lua_pushstring (L, p1); lua_rawseti (L, -2, 1); \
285 lua_pushstring (L, p2); lua_rawseti (L, -2, 2); \
289 #define SET_TAB2STRING(EGO_FUNC, E_FUNC) \
291 EGO_FUNC (lua_State *L) \
293 luaobj_Object *obj = lua_touserdata (L, 1); \
294 lua_rawgeti (L, 2, 1); \
295 lua_rawgeti (L, 2, 2); \
298 luaL_checkstring (L, -2),\
299 luaL_checkstring (L, -1)); \
307 #define GET_TAB3INTEGER(EGO_FUNC, E_FUNC) \
309 EGO_FUNC (lua_State *L) \
311 luaobj_Object *obj = lua_touserdata (L, 1); \
313 E_FUNC (obj->data, &p1, &p2, &p3); \
315 lua_pushnumber (L, p1); lua_rawseti (L, -2, 1); \
316 lua_pushnumber (L, p2); lua_rawseti (L, -2, 2); \
317 lua_pushnumber (L, p3); lua_rawseti (L, -2, 3); \
321 #define SET_TAB3INTEGER(EGO_FUNC, E_FUNC) \
323 EGO_FUNC (lua_State *L) \
325 luaobj_Object *obj = lua_touserdata (L, 1); \
326 lua_rawgeti (L, 2, 1); \
327 lua_rawgeti (L, 2, 2); \
328 lua_rawgeti (L, 2, 3); \
331 luaL_checkinteger (L, -3),\
332 luaL_checkinteger (L, -2),\
333 luaL_checkinteger (L, -1)); \
341 #define GET_TAB4INTEGER(EGO_FUNC, E_FUNC) \
343 EGO_FUNC (lua_State *L) \
345 luaobj_Object *obj = lua_touserdata (L, 1); \
346 int p1, p2, p3, p4; \
347 E_FUNC (obj->data, &p1, &p2, &p3, &p4); \
349 lua_pushnumber (L, p1); lua_rawseti (L, -2, 1); \
350 lua_pushnumber (L, p2); lua_rawseti (L, -2, 2); \
351 lua_pushnumber (L, p3); lua_rawseti (L, -2, 3); \
352 lua_pushnumber (L, p4); lua_rawseti (L, -2, 4); \
356 #define SET_TAB4INTEGER(EGO_FUNC, E_FUNC) \
358 EGO_FUNC (lua_State *L) \
360 luaobj_Object *obj = lua_touserdata (L, 1); \
361 lua_rawgeti (L, 2, 1); \
362 lua_rawgeti (L, 2, 2); \
363 lua_rawgeti (L, 2, 3); \
364 lua_rawgeti (L, 2, 4); \
367 luaL_checkinteger (L, -4),\
368 luaL_checkinteger (L, -3),\
369 luaL_checkinteger (L, -2),\
370 luaL_checkinteger (L, -1)); \
378 #define GET_TAB4FLOAT(EGO_FUNC, E_FUNC) \
380 EGO_FUNC (lua_State *L) \
382 luaobj_Object *obj = lua_touserdata (L, 1); \
383 double p1, p2, p3, p4; \
384 E_FUNC (obj->data, &p1, &p2, &p3, &p4); \
386 lua_pushnumber (L, p1); lua_rawseti (L, -2, 1); \
387 lua_pushnumber (L, p2); lua_rawseti (L, -2, 2); \
388 lua_pushnumber (L, p3); lua_rawseti (L, -2, 3); \
389 lua_pushnumber (L, p4); lua_rawseti (L, -2, 4); \
393 #define SET_TAB4FLOAT(EGO_FUNC, E_FUNC) \
395 EGO_FUNC (lua_State *L) \
397 luaobj_Object *obj = lua_touserdata (L, 1); \
398 lua_rawgeti (L, 2, 1); \
399 lua_rawgeti (L, 2, 2); \
400 lua_rawgeti (L, 2, 3); \
401 lua_rawgeti (L, 2, 4); \
404 luaL_checknumber (L, -4),\
405 luaL_checknumber (L, -3),\
406 luaL_checknumber (L, -2),\
407 luaL_checknumber (L, -1)); \