updated binding sources to the last version
[Leditor.git] / src / lqt_bind_QPaintDevice.cpp
blob89aef3c18f3b27facaf5dafba9b97e81a6a1220c
1 #include "lqt_bind_QPaintDevice.hpp"
3 int LuaBinder< QPaintDevice >::__LuaWrapCall__delete (lua_State *L) {
4 QPaintDevice *& __lua__obj = *static_cast<QPaintDevice**>(lqtL_checkudata(L, 1, "QPaintDevice*"));
5 if (__lua__obj==0) {
6 lua_pushstring(L, "trying to reference deleted pointer");
7 lua_error(L);
8 return 0;
10 delete __lua__obj;
11 __lua__obj = 0;
12 return 0;
14 int LuaBinder< QPaintDevice >::__LuaWrapCall__logicalDpiX (lua_State *L) {
15 QPaintDevice *& __lua__obj = *static_cast<QPaintDevice**>(lqtL_checkudata(L, 1, "QPaintDevice*"));
16 if (__lua__obj==0) {
17 lua_pushstring(L, "trying to reference deleted pointer");
18 lua_error(L);
19 return 0;
21 int ret = __lua__obj->QPaintDevice::logicalDpiX();
22 lua_pushinteger(L, ret);
23 return 1;
25 int LuaBinder< QPaintDevice >::__LuaWrapCall__width (lua_State *L) {
26 QPaintDevice *& __lua__obj = *static_cast<QPaintDevice**>(lqtL_checkudata(L, 1, "QPaintDevice*"));
27 if (__lua__obj==0) {
28 lua_pushstring(L, "trying to reference deleted pointer");
29 lua_error(L);
30 return 0;
32 int ret = __lua__obj->QPaintDevice::width();
33 lua_pushinteger(L, ret);
34 return 1;
36 int LuaBinder< QPaintDevice >::__LuaWrapCall__widthMM (lua_State *L) {
37 QPaintDevice *& __lua__obj = *static_cast<QPaintDevice**>(lqtL_checkudata(L, 1, "QPaintDevice*"));
38 if (__lua__obj==0) {
39 lua_pushstring(L, "trying to reference deleted pointer");
40 lua_error(L);
41 return 0;
43 int ret = __lua__obj->QPaintDevice::widthMM();
44 lua_pushinteger(L, ret);
45 return 1;
47 int LuaBinder< QPaintDevice >::__LuaWrapCall__height (lua_State *L) {
48 QPaintDevice *& __lua__obj = *static_cast<QPaintDevice**>(lqtL_checkudata(L, 1, "QPaintDevice*"));
49 if (__lua__obj==0) {
50 lua_pushstring(L, "trying to reference deleted pointer");
51 lua_error(L);
52 return 0;
54 int ret = __lua__obj->QPaintDevice::height();
55 lua_pushinteger(L, ret);
56 return 1;
58 int LuaBinder< QPaintDevice >::__LuaWrapCall__numColors (lua_State *L) {
59 QPaintDevice *& __lua__obj = *static_cast<QPaintDevice**>(lqtL_checkudata(L, 1, "QPaintDevice*"));
60 if (__lua__obj==0) {
61 lua_pushstring(L, "trying to reference deleted pointer");
62 lua_error(L);
63 return 0;
65 int ret = __lua__obj->QPaintDevice::numColors();
66 lua_pushinteger(L, ret);
67 return 1;
69 int LuaBinder< QPaintDevice >::__LuaWrapCall__physicalDpiX (lua_State *L) {
70 QPaintDevice *& __lua__obj = *static_cast<QPaintDevice**>(lqtL_checkudata(L, 1, "QPaintDevice*"));
71 if (__lua__obj==0) {
72 lua_pushstring(L, "trying to reference deleted pointer");
73 lua_error(L);
74 return 0;
76 int ret = __lua__obj->QPaintDevice::physicalDpiX();
77 lua_pushinteger(L, ret);
78 return 1;
80 int LuaBinder< QPaintDevice >::__LuaWrapCall__physicalDpiY (lua_State *L) {
81 QPaintDevice *& __lua__obj = *static_cast<QPaintDevice**>(lqtL_checkudata(L, 1, "QPaintDevice*"));
82 if (__lua__obj==0) {
83 lua_pushstring(L, "trying to reference deleted pointer");
84 lua_error(L);
85 return 0;
87 int ret = __lua__obj->QPaintDevice::physicalDpiY();
88 lua_pushinteger(L, ret);
89 return 1;
91 int LuaBinder< QPaintDevice >::__LuaWrapCall__devType (lua_State *L) {
92 QPaintDevice *& __lua__obj = *static_cast<QPaintDevice**>(lqtL_checkudata(L, 1, "QPaintDevice*"));
93 if (__lua__obj==0) {
94 lua_pushstring(L, "trying to reference deleted pointer");
95 lua_error(L);
96 return 0;
98 int ret = __lua__obj->QPaintDevice::devType();
99 lua_pushinteger(L, ret);
100 return 1;
102 int LuaBinder< QPaintDevice >::__LuaWrapCall__logicalDpiY (lua_State *L) {
103 QPaintDevice *& __lua__obj = *static_cast<QPaintDevice**>(lqtL_checkudata(L, 1, "QPaintDevice*"));
104 if (__lua__obj==0) {
105 lua_pushstring(L, "trying to reference deleted pointer");
106 lua_error(L);
107 return 0;
109 int ret = __lua__obj->QPaintDevice::logicalDpiY();
110 lua_pushinteger(L, ret);
111 return 1;
113 int LuaBinder< QPaintDevice >::__LuaWrapCall__paintingActive (lua_State *L) {
114 QPaintDevice *& __lua__obj = *static_cast<QPaintDevice**>(lqtL_checkudata(L, 1, "QPaintDevice*"));
115 if (__lua__obj==0) {
116 lua_pushstring(L, "trying to reference deleted pointer");
117 lua_error(L);
118 return 0;
120 bool ret = __lua__obj->QPaintDevice::paintingActive();
121 lua_pushboolean(L, ret);
122 return 1;
124 int LuaBinder< QPaintDevice >::__LuaWrapCall__depth (lua_State *L) {
125 QPaintDevice *& __lua__obj = *static_cast<QPaintDevice**>(lqtL_checkudata(L, 1, "QPaintDevice*"));
126 if (__lua__obj==0) {
127 lua_pushstring(L, "trying to reference deleted pointer");
128 lua_error(L);
129 return 0;
131 int ret = __lua__obj->QPaintDevice::depth();
132 lua_pushinteger(L, ret);
133 return 1;
135 int LuaBinder< QPaintDevice >::__LuaWrapCall__heightMM (lua_State *L) {
136 QPaintDevice *& __lua__obj = *static_cast<QPaintDevice**>(lqtL_checkudata(L, 1, "QPaintDevice*"));
137 if (__lua__obj==0) {
138 lua_pushstring(L, "trying to reference deleted pointer");
139 lua_error(L);
140 return 0;
142 int ret = __lua__obj->QPaintDevice::heightMM();
143 lua_pushinteger(L, ret);
144 return 1;
146 QPaintEngine * LuaBinder< QPaintDevice >::paintEngine () const {
147 bool absorbed = false;
148 int oldtop = lua_gettop(L);
149 lqtL_pushudata(L, this, "QPaintDevice*");
150 if (lua_getmetatable(L, -1)) {
151 lua_getfield(L, -1, "paintEngine");
152 lua_remove(L, -2);
153 } else {
154 lua_pushnil(L);
156 lua_insert(L, -2);
157 if (lua_isfunction(L, -0-2)) {
158 lua_pcall(L, 0+1, 2, 0);
159 absorbed = (bool)lua_toboolean(L, -1) || (bool)lua_toboolean(L, -2);
160 lua_pop(L, 1);
162 if (!absorbed) {
163 lua_settop(L, oldtop);
165 QPaintEngine * ret = *static_cast<QPaintEngine**>(lqtL_checkudata(L, -1, "QPaintEngine*"));
166 lua_settop(L, oldtop);
167 return ret;
169 int LuaBinder< QPaintDevice >::metric (QPaintDevice::PaintDeviceMetric arg1) const {
170 bool absorbed = false;
171 int oldtop = lua_gettop(L);
172 lqtL_pushudata(L, this, "QPaintDevice*");
173 if (lua_getmetatable(L, -1)) {
174 lua_getfield(L, -1, "metric");
175 lua_remove(L, -2);
176 } else {
177 lua_pushnil(L);
179 lua_insert(L, -2);
180 lqtL_pushenum(L, arg1, "QPaintDevice::PaintDeviceMetric");
181 if (lua_isfunction(L, -1-2)) {
182 lua_pcall(L, 1+1, 2, 0);
183 absorbed = (bool)lua_toboolean(L, -1) || (bool)lua_toboolean(L, -2);
184 lua_pop(L, 1);
186 if (!absorbed) {
187 lua_settop(L, oldtop);
188 return this->QPaintDevice::metric(arg1);
190 int ret = lua_tointeger(L, -1);
191 lua_settop(L, oldtop);
192 return ret;
194 int LuaBinder< QPaintDevice >::devType () const {
195 bool absorbed = false;
196 int oldtop = lua_gettop(L);
197 lqtL_pushudata(L, this, "QPaintDevice*");
198 if (lua_getmetatable(L, -1)) {
199 lua_getfield(L, -1, "devType");
200 lua_remove(L, -2);
201 } else {
202 lua_pushnil(L);
204 lua_insert(L, -2);
205 if (lua_isfunction(L, -0-2)) {
206 lua_pcall(L, 0+1, 2, 0);
207 absorbed = (bool)lua_toboolean(L, -1) || (bool)lua_toboolean(L, -2);
208 lua_pop(L, 1);
210 if (!absorbed) {
211 lua_settop(L, oldtop);
212 return this->QPaintDevice::devType();
214 int ret = lua_tointeger(L, -1);
215 lua_settop(L, oldtop);
216 return ret;
218 LuaBinder< QPaintDevice >:: ~LuaBinder< QPaintDevice > () {
219 int oldtop = lua_gettop(L);
220 lqtL_pushudata(L, this, "QPaintDevice*");
221 lua_getfield(L, -1, "~QPaintDevice");
223 if (lua_isfunction(L, -1)) {
224 lua_insert(L, -2);
225 lua_pcall(L, 1, 1, 0);
226 } else {
228 lua_settop(L, oldtop);
230 int LuaBinder< QPaintDevice >::lqt_pushenum_PaintDeviceMetric (lua_State *L) {
231 int enum_table = 0;
232 lua_getfield(L, LUA_REGISTRYINDEX, LQT_ENUMS);
233 if (!lua_istable(L, -1)) {
234 lua_pop(L, 1);
235 lua_newtable(L);
236 lua_pushvalue(L, -1);
237 lua_setfield(L, LUA_REGISTRYINDEX, LQT_ENUMS);
239 lua_newtable(L);
240 enum_table = lua_gettop(L);
241 lua_pushstring(L, "PdmWidth");
242 lua_rawseti(L, enum_table, 1);
243 lua_pushinteger(L, 1);
244 lua_setfield(L, enum_table, "PdmWidth");
245 lua_pushstring(L, "PdmHeight");
246 lua_rawseti(L, enum_table, 2);
247 lua_pushinteger(L, 2);
248 lua_setfield(L, enum_table, "PdmHeight");
249 lua_pushstring(L, "PdmWidthMM");
250 lua_rawseti(L, enum_table, 3);
251 lua_pushinteger(L, 3);
252 lua_setfield(L, enum_table, "PdmWidthMM");
253 lua_pushstring(L, "PdmHeightMM");
254 lua_rawseti(L, enum_table, 4);
255 lua_pushinteger(L, 4);
256 lua_setfield(L, enum_table, "PdmHeightMM");
257 lua_pushstring(L, "PdmNumColors");
258 lua_rawseti(L, enum_table, 5);
259 lua_pushinteger(L, 5);
260 lua_setfield(L, enum_table, "PdmNumColors");
261 lua_pushstring(L, "PdmDepth");
262 lua_rawseti(L, enum_table, 6);
263 lua_pushinteger(L, 6);
264 lua_setfield(L, enum_table, "PdmDepth");
265 lua_pushstring(L, "PdmDpiX");
266 lua_rawseti(L, enum_table, 7);
267 lua_pushinteger(L, 7);
268 lua_setfield(L, enum_table, "PdmDpiX");
269 lua_pushstring(L, "PdmDpiY");
270 lua_rawseti(L, enum_table, 8);
271 lua_pushinteger(L, 8);
272 lua_setfield(L, enum_table, "PdmDpiY");
273 lua_pushstring(L, "PdmPhysicalDpiX");
274 lua_rawseti(L, enum_table, 9);
275 lua_pushinteger(L, 9);
276 lua_setfield(L, enum_table, "PdmPhysicalDpiX");
277 lua_pushstring(L, "PdmPhysicalDpiY");
278 lua_rawseti(L, enum_table, 10);
279 lua_pushinteger(L, 10);
280 lua_setfield(L, enum_table, "PdmPhysicalDpiY");
281 lua_pushcfunction(L, LuaBinder< QPaintDevice >::lqt_pushenum_PaintDeviceMetric_QFLAGS_CREATOR);
282 lua_setfield(L, enum_table, "QFlags");
283 lua_pushvalue(L, -1);
284 lua_setfield(L, -3, "QPaintDevice::PaintDeviceMetric");
285 lua_remove(L, -2);
286 return 1;
288 int LuaBinder< QPaintDevice >::lqt_pushenum_PaintDeviceMetric_QFLAGS_CREATOR (lua_State *L) {
289 int argn = lua_gettop(L);
290 int i = 0;
291 void *p = lua_newuserdata(L, sizeof(QFlags<QPaintDevice::PaintDeviceMetric>*) + sizeof(QFlags<QPaintDevice::PaintDeviceMetric>));
292 QFlags<QPaintDevice::PaintDeviceMetric> *fl = static_cast<QFlags<QPaintDevice::PaintDeviceMetric>*>( static_cast<void*>(&static_cast<QFlags<QPaintDevice::PaintDeviceMetric>**>(p)[1]) );
293 *(void**)p = fl;
294 for (i=1;i<=argn;i++) {
295 *fl |= static_cast<QPaintDevice::PaintDeviceMetric>(lqtL_toenum(L, i, "QPaintDevice::PaintDeviceMetric"));
297 if (luaL_newmetatable(L, "QFlags<QPaintDevice::PaintDeviceMetric>*")) {
298 lua_pushstring(L, "QFlags<QPaintDevice::PaintDeviceMetric>*");
299 lua_setfield(L, -2, "__qtype");
301 lua_setmetatable(L, -2);
302 return 1;
304 int luaopen_QPaintDevice (lua_State *L) {
305 if (luaL_newmetatable(L, "QPaintDevice*")) {
306 lua_pushcfunction(L, LuaBinder< QPaintDevice >::__LuaWrapCall__delete);
307 lua_setfield(L, -2, "delete");
308 lua_pushcfunction(L, LuaBinder< QPaintDevice >::__LuaWrapCall__logicalDpiX);
309 lua_setfield(L, -2, "logicalDpiX");
310 lua_pushcfunction(L, LuaBinder< QPaintDevice >::__LuaWrapCall__width);
311 lua_setfield(L, -2, "width");
312 lua_pushcfunction(L, LuaBinder< QPaintDevice >::__LuaWrapCall__widthMM);
313 lua_setfield(L, -2, "widthMM");
314 lua_pushcfunction(L, LuaBinder< QPaintDevice >::__LuaWrapCall__height);
315 lua_setfield(L, -2, "height");
316 lua_pushcfunction(L, LuaBinder< QPaintDevice >::__LuaWrapCall__numColors);
317 lua_setfield(L, -2, "numColors");
318 lua_pushcfunction(L, LuaBinder< QPaintDevice >::__LuaWrapCall__physicalDpiX);
319 lua_setfield(L, -2, "physicalDpiX");
320 lua_pushcfunction(L, LuaBinder< QPaintDevice >::__LuaWrapCall__physicalDpiY);
321 lua_setfield(L, -2, "physicalDpiY");
322 lua_pushcfunction(L, LuaBinder< QPaintDevice >::__LuaWrapCall__devType);
323 lua_setfield(L, -2, "devType");
324 lua_pushcfunction(L, LuaBinder< QPaintDevice >::__LuaWrapCall__logicalDpiY);
325 lua_setfield(L, -2, "logicalDpiY");
326 lua_pushcfunction(L, LuaBinder< QPaintDevice >::__LuaWrapCall__paintingActive);
327 lua_setfield(L, -2, "paintingActive");
328 lua_pushcfunction(L, LuaBinder< QPaintDevice >::__LuaWrapCall__depth);
329 lua_setfield(L, -2, "depth");
330 lua_pushcfunction(L, LuaBinder< QPaintDevice >::__LuaWrapCall__heightMM);
331 lua_setfield(L, -2, "heightMM");
332 LuaBinder< QPaintDevice >::lqt_pushenum_PaintDeviceMetric(L);
333 lua_setfield(L, -2, "PaintDeviceMetric");
334 lua_newtable(L);
335 lua_setfield(L, -2, "__base");
336 lua_pushcfunction(L, lqtL_newindex);
337 lua_setfield(L, -2, "__newindex");
338 lua_pushcfunction(L, lqtL_index);
339 lua_setfield(L, -2, "__index");
340 lua_pushcfunction(L, lqtL_gc);
341 lua_setfield(L, -2, "__gc");
342 lua_pushstring(L, "QPaintDevice");
343 lua_setfield(L, -2, "__qtype");
344 lua_setglobal(L, "QPaintDevice");
345 } else {
346 lua_pop(L, 1);
348 return 0;