1 local base_types
= (...) or {}
3 local BaseType
= function(s
)
7 return 'lua_to'..s
..'(L, '..tostring(j
)..')', 1
9 push
= function(j
) -- must handle arguments (e.g. in virtual callbacks) and return values
10 return 'lua_push'..s
..'(L, '..tostring(j
)..')', 1
14 local integer_type
= {
16 return 'lua_tointeger(L, '..tostring(j
)..')', 1
18 push
= function(j
) -- must handle arguments (e.g. in virtual callbacks) and return values
19 return 'lua_pushinteger(L, '..tostring(j
)..')', 1
21 test
= function(j
) -- must handle arguments (e.g. in virtual callbacks) and return values
22 return 'lqtL_isinteger(L, '..tostring(j
)..')', 1
27 return 'lua_tonumber(L, '..tostring(j
)..')', 1
29 push
= function(j
) -- must handle arguments (e.g. in virtual callbacks) and return values
30 return 'lua_pushnumber(L, '..tostring(j
)..')', 1
32 test
= function(j
) -- must handle arguments (e.g. in virtual callbacks) and return values
33 return 'lqtL_isnumber(L, '..tostring(j
)..')', 1
36 local integer_type
= {
38 return 'lua_tointeger(L, '..tostring(j
)..')', 1
40 push
= function(j
) -- must handle arguments (e.g. in virtual callbacks) and return values
41 return 'lua_pushinteger(L, '..tostring(j
)..')', 1
43 test
= function(j
) -- must handle arguments (e.g. in virtual callbacks) and return values
44 return 'lqtL_isinteger(L, '..tostring(j
)..')', 1
49 return 'lua_toboolean(L, '..tostring(j
)..')', 1
51 push
= function(j
) -- must handle arguments (e.g. in virtual callbacks) and return values
52 return 'lua_pushboolean(L, '..tostring(j
)..')', 1
54 test
= function(j
) -- must handle arguments (e.g. in virtual callbacks) and return values
55 return 'lqtL_isboolean(L, '..tostring(j
)..')', 1
59 base_types
['char const*'] = {
61 return 'lua_tostring(L, '..tostring(j
)..')', 1
63 push
= function(j
) -- must handle arguments (e.g. in virtual callbacks) and return values
64 return 'lua_pushstring(L, '..tostring(j
)..')', 1
67 return 'lqtL_isstring(L, '..tostring(j
)..')', 1
70 base_types
['char'] = integer_type
71 base_types
['unsigned char'] = integer_type
72 base_types
['int'] = integer_type
73 base_types
['unsigned int'] = integer_type
74 base_types
['short'] = integer_type
75 base_types
['short int'] = integer_type
76 base_types
['unsigned short'] = integer_type
77 base_types
['unsigned short int'] = integer_type
78 base_types
['short unsigned int'] = integer_type
79 base_types
['long'] = integer_type
80 base_types
['unsigned long'] = integer_type
81 base_types
['long int'] = integer_type
82 base_types
['unsigned long int'] = integer_type
83 base_types
['long unsigned int'] = integer_type
84 base_types
['long long'] = integer_type
85 base_types
['unsigned long long'] = integer_type
86 base_types
['long long int'] = integer_type
87 base_types
['unsigned long long int'] = integer_type
88 base_types
['float'] = number_type
89 base_types
['double'] = number_type
90 base_types
['bool'] = bool_type
92 base_types
['QSizeF'] = {
93 get
= function(i
) return 'QSizeF(lua_tonumber(L, '..i
..'), lua_tonumber(L, '..i
..'+1))', 2 end,
94 push
= function(i
) return 'lua_pushnumber(L, '..i
..'.width()), lua_pushnumber(L, '..i
..'.height())', 2 end,
95 test
= function(i
) return '(lqtL_isnumber(L, '..i
..') && lqtL_isnumber(L, '..i
..'+1))', 2 end,
97 base_types
['QSizeF const&'] = base_types
['QSizeF']
99 base_types
['QSize'] = {
100 get
= function(i
) return 'QSize(lua_tointeger(L, '..i
..'), lua_tointeger(L, '..i
..'+1))', 2 end,
101 push
= function(i
) return 'lua_pushinteger(L, '..i
..'.width()), lua_pushinteger(L, '..i
..'.height())', 2 end,
102 test
= function(i
) return '(lqtL_isinteger(L, '..i
..') && lqtL_isinteger(L, '..i
..'+1))', 2 end,
104 base_types
['QSize const&'] = base_types
['QSize']
106 base_types
['QPoint'] = {
107 get
= function(i
) return 'QPoint(lua_tointeger(L, '..i
..'), lua_tointeger(L, '..i
..'+1))', 2 end,
108 push
= function(i
) return 'lua_pushinteger(L, '..i
..'.x()), lua_pushinteger(L, '..i
..'.y())', 2 end,
109 test
= function(i
) return '(lqtL_isinteger(L, '..i
..') && lqtL_isinteger(L, '..i
..'+1))', 2 end,
111 base_types
['QPoint const&'] = base_types
['QPoint']
113 base_types
['QPointF'] = {
114 get
= function(i
) return 'QPointF(lua_tointeger(L, '..i
..'), lua_tointeger(L, '..i
..'+1))', 2 end,
115 push
= function(i
) return 'lua_pushinteger(L, '..i
..'.x()), lua_pushinteger(L, '..i
..'.y())', 2 end,
116 test
= function(i
) return '(lqtL_isinteger(L, '..i
..') && lqtL_isinteger(L, '..i
..'+1))', 2 end,
118 base_types
['QPointF const&'] = base_types
['QPointF']
120 base_types
['QRect'] = {
121 get
= function(i
) return 'QRect(lua_tointeger(L, '..i
..'), lua_tointeger(L, '..i
..'+1), lua_tointeger(L, '..i
..'+2), lua_tointeger(L, '..i
..'+3))', 4 end,
122 push
= function(i
) return 'lua_pushinteger(L, '..i
..'.x()), lua_pushinteger(L, '..i
..'.y()), lua_pushinteger(L, '..i
..'.width()), lua_pushinteger(L, '..i
..'.height())', 4 end,
123 test
= function(i
) return '(lqtL_isinteger(L, '..i
..') && lqtL_isinteger(L, '..i
..'+1) && lqtL_isinteger(L, '..i
..'+2) && lqtL_isinteger(L, '..i
..'+3))', 4 end,
125 base_types
['QRect const&'] = base_types
['QRect']
127 base_types
['QRectF'] = {
128 get
= function(i
) return 'QRectF(lua_tointeger(L, '..i
..'), lua_tointeger(L, '..i
..'+1), lua_tointeger(L, '..i
..'+2), lua_tointeger(L, '..i
..'+3))', 4 end,
129 push
= function(i
) return 'lua_pushinteger(L, '..i
..'.x()), lua_pushinteger(L, '..i
..'.y()), lua_pushinteger(L, '..i
..'.width()), lua_pushinteger(L, '..i
..'.height())', 4 end,
130 test
= function(i
) return '(lqtL_isinteger(L, '..i
..') && lqtL_isinteger(L, '..i
..'+1) && lqtL_isinteger(L, '..i
..'+2) && lqtL_isinteger(L, '..i
..'+3))', 4 end,
132 base_types
['QRectF const&'] = base_types
['QRectF']