added evas object box
[ego.git] / src / lib / animator.c
blob7647f96f209356c4d7a0070aec034de7061c6e75
1 #include "luaobj.h"
2 #include "class.h"
3 #include "animator.h"
5 int
6 lanimator_cb (void *DATA)
8 luaobj_Object *obj = (luaobj_Object *) DATA;
9 luaobj_Ref *ref3 = (luaobj_Ref *) obj->datc; // function
10 luaobj_Ref *ref2 = (luaobj_Ref *) obj->datb; // userdata
11 lua_State *L = obj->L;
12 luaobj_get_ref (L, ref3);
13 luaobj_get_ref (L, ref2);
15 if (lua_pcall (L, 1, 1, 0))
16 printf ("lanimator_cb: %s\n", luaL_checkstring (L, -1));
17 int res = (int) lua_toboolean (L, -1);
18 if (res)
19 return 1;
20 else
21 return 0;
24 static int
25 lanimator_fn_del (lua_State * L)
27 /* 1: animator
29 luaobj_Object *obj = (luaobj_Object *) lua_touserdata (L, 1);
30 ecore_animator_del (obj->data);
31 return 0;
34 const luaL_Reg lAnimator_nil[] = {
35 {NULL, NULL} // sentinel
38 const luaL_Reg lAnimator_fn[] = {
39 {"del", lanimator_fn_del},
40 {NULL, NULL} // sentinel
43 const luaobj_Reg mAnimator = {
44 lAnimator_nil, // mt
45 lAnimator_nil, // get
46 lAnimator_nil, // set
47 lAnimator_fn
50 const luaobj_Reg *cAnimator [] = {
51 &mClass,
52 &mAnimator,
53 NULL // sentinel