6 ltransform_get_matrix (lua_State
*L
)
8 luaobj_Object
*obj
= (luaobj_Object
*) lua_touserdata (L
, 1);
9 Evas_Transform
*trans
= (Evas_Transform
*) obj
->data
;
12 lua_pushnumber (L
, trans
->mxx
); lua_rawseti (L
, -2, 1);
13 lua_pushnumber (L
, trans
->mxy
); lua_rawseti (L
, -2, 2);
14 lua_pushnumber (L
, trans
->mxz
); lua_rawseti (L
, -2, 3);
15 lua_rawseti (L
, -2, 1);
17 lua_pushnumber (L
, trans
->myx
); lua_rawseti (L
, -2, 1);
18 lua_pushnumber (L
, trans
->myy
); lua_rawseti (L
, -2, 2);
19 lua_pushnumber (L
, trans
->myz
); lua_rawseti (L
, -2, 3);
20 lua_rawseti (L
, -2, 2);
22 lua_pushnumber (L
, trans
->mzx
); lua_rawseti (L
, -2, 1);
23 lua_pushnumber (L
, trans
->mzy
); lua_rawseti (L
, -2, 2);
24 lua_pushnumber (L
, trans
->mzz
); lua_rawseti (L
, -2, 3);
25 lua_rawseti (L
, -2, 3);
30 ltransform_set_matrix (lua_State
*L
)
32 luaobj_Object
*obj
= (luaobj_Object
*) lua_touserdata (L
, 1);
33 Evas_Transform
*trans
= (Evas_Transform
*) obj
->data
;
34 lua_rawgeti (L
, 2, 1);
35 lua_rawgeti (L
, -1, 1); trans
->mxx
= luaL_checknumber (L
, -1);
36 lua_rawgeti (L
, -2, 2); trans
->mxy
= luaL_checknumber (L
, -1);
37 lua_rawgeti (L
, -3, 3); trans
->mxz
= luaL_checknumber (L
, -1);
39 lua_rawgeti (L
, 2, 2);
40 lua_rawgeti (L
, -1, 1); trans
->myx
= luaL_checknumber (L
, -1);
41 lua_rawgeti (L
, -2, 2); trans
->myy
= luaL_checknumber (L
, -1);
42 lua_rawgeti (L
, -3, 3); trans
->myz
= luaL_checknumber (L
, -1);
44 lua_rawgeti (L
, 2, 2);
45 lua_rawgeti (L
, -1, 1); trans
->mzx
= luaL_checknumber (L
, -1);
46 lua_rawgeti (L
, -2, 2); trans
->mzy
= luaL_checknumber (L
, -1);
47 lua_rawgeti (L
, -3, 3); trans
->mzz
= luaL_checknumber (L
, -1);
53 * transform function methods
57 ltransform_fn_rotate (lua_State
* L
)
59 luaobj_Object
*obj
= (luaobj_Object
*) lua_touserdata (L
, 1);
60 evas_transform_rotate (
61 luaL_checknumber (L
, 2),
67 ltransform_fn_translate (lua_State
* L
)
69 luaobj_Object
*obj
= (luaobj_Object
*) lua_touserdata (L
, 1);
70 evas_transform_translate (
71 luaL_checknumber (L
, 2),
72 luaL_checknumber (L
, 3),
78 ltransform_fn_scale (lua_State
* L
)
80 luaobj_Object
*obj
= (luaobj_Object
*) lua_touserdata (L
, 1);
81 evas_transform_scale (
82 luaL_checknumber (L
, 2),
83 luaL_checknumber (L
, 3),
89 ltransform_fn_shear (lua_State
* L
)
91 luaobj_Object
*obj
= (luaobj_Object
*) lua_touserdata (L
, 1);
92 evas_transform_shear (
93 luaL_checknumber (L
, 2),
94 luaL_checknumber (L
, 3),
100 ltransform_fn_compose (lua_State
* L
)
102 luaobj_Object
*obj
= (luaobj_Object
*) lua_touserdata (L
, 1);
103 luaobj_Object
*lef
= (luaobj_Object
*) lua_touserdata (L
, 2);
104 evas_transform_compose (
111 ltransform_fn_identity (lua_State
* L
)
113 luaobj_Object
*obj
= (luaobj_Object
*) lua_touserdata (L
, 1);
114 evas_transform_identity_set (obj
->data
);
118 const luaL_Reg lTransform_get
[] = {
119 {"matrix", ltransform_get_matrix
},
120 {NULL
, NULL
} // sentinel
123 const luaL_Reg lTransform_set
[] = {
124 {"matrix", ltransform_set_matrix
},
125 {NULL
, NULL
} // sentinel
128 const luaL_Reg lTransform_fn
[] = {
129 {"rotate", ltransform_fn_rotate
},
130 {"translate", ltransform_fn_translate
},
131 {"scale", ltransform_fn_scale
},
132 {"shear", ltransform_fn_shear
},
133 {"compose", ltransform_fn_compose
},
134 {"identity", ltransform_fn_identity
},
135 {NULL
, NULL
} // sentinel
138 const luaL_Reg lTransform_nil
[] = {
139 {NULL
, NULL
} // sentinel
142 const luaobj_Reg mTransform
= {
149 const luaobj_Reg
*cTransform
[] = {