fixed X11_softare_info changing
[ego.git] / src / lib / table.c
blob722ccfe0af2f4fc950800b398fe8fd7555d7ffe8
1 #include "table.h"
2 #include "luaobj.h"
3 #include "class.h"
4 #include "object.h"
5 #include "macro.h"
7 GET_INTEGER (ltable_set_homogeneous, evas_object_table_homogeneous_set);
8 SET_INTEGER (ltable_get_homogeneous, evas_object_table_homogeneous_get);
10 GET_TAB2INTEGER (ltable_get_padding, evas_object_table_padding_get);
11 SET_TAB2INTEGER (ltable_set_padding, evas_object_table_padding_set);
13 GET_TAB2FLOAT (ltable_get_align, evas_object_table_align_get);
14 SET_TAB2FLOAT (ltable_set_align, evas_object_table_align_set);
16 static int
17 ltable_fn_pack (lua_State *L)
19 luaobj_Object *obj = (luaobj_Object *) lua_touserdata (L, 1);
20 luaobj_Object *pac = (luaobj_Object *) lua_touserdata (L, 2);
21 evas_object_table_pack (
22 obj->data, pac->data,
23 luaL_checkint (L, 3), luaL_checkint (L, 4), // x, y
24 luaL_checkint (L, 5), luaL_checkint (L, 6)); // w, h
25 return 0;
27 FN_OBJ (ltable_fn_unpack, evas_object_table_unpack);
28 FN_BOOL (ltable_fn_clear, evas_object_table_clear);
30 GET_TAB2INTEGER (ltable_get_col_row_size, evas_object_table_col_row_size_get);
32 const struct luaL_Reg lTable_fn[] = {
33 {"pack", ltable_fn_pack},
34 {"unpack", ltable_fn_unpack},
35 {"clear", ltable_fn_clear},
36 {NULL, NULL} // sentinel
39 const struct luaL_Reg lTable_get[] = {
40 {"homogeneous", ltable_get_homogeneous},
41 {"padding", ltable_get_padding},
42 {"align", ltable_get_align},
43 {"col_row_size", ltable_get_col_row_size},
44 {NULL, NULL} // sentinel
47 const struct luaL_Reg lTable_set[] = {
48 {"homogeneous", ltable_set_homogeneous},
49 {"padding", ltable_set_padding},
50 {"align", ltable_set_align},
51 {NULL, NULL} // sentinel
53 const luaL_Reg lTable_nil [] = {
54 {NULL, NULL} // sentinel
57 const luaobj_Reg mTable = {
58 lTable_nil, // mt
59 lTable_get,
60 lTable_set,
61 lTable_fn
64 const luaobj_Reg *cTable [] = {
65 &mClass,
66 &mObject,
67 &mTable,
68 NULL // sentinel