added "install" instruction
[Leditor.git] / src / lqt_bind_QSyntaxHighlighter.cpp
blob47e93d482228ce43756cc678f98b96cae5a94541
1 #include "lqt_bind_QSyntaxHighlighter.hpp"
3 int LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__tr__OverloadedVersion__1 (lua_State *L) {
4 const char * arg1 = lua_tostring(L, 1);
5 const char * arg2 = (lua_type(L, 2)==LUA_TSTRING)?lua_tostring(L, 2):static_cast< const char * >(0);
6 QString ret = QSyntaxHighlighter::tr(arg1, arg2);
7 lua_pushlstring(L, ret.toAscii().data(), ret.toAscii().size());
8 return 1;
10 int LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__tr__OverloadedVersion__2 (lua_State *L) {
11 const char * arg1 = lua_tostring(L, 1);
12 const char * arg2 = lua_tostring(L, 2);
13 int arg3 = lua_tointeger(L, 3);
14 QString ret = QSyntaxHighlighter::tr(arg1, arg2, arg3);
15 lua_pushlstring(L, ret.toAscii().data(), ret.toAscii().size());
16 return 1;
18 int LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__tr (lua_State *L) {
19 int score[3];
20 const int premium = 11+lua_gettop(L);
21 score[1] = 0;
22 if ((lua_type(L, 1)==LUA_TSTRING)) {
23 score[1] += premium;
24 } else if (false) {
25 score[1] += premium-1; // table: 0xa86b00;
26 } else {
27 score[1] -= premium*premium;
29 if ((lua_type(L, 2)==LUA_TSTRING)) {
30 score[1] += premium;
31 } else if (true) {
32 score[1] += premium-1; // table: 0xeae5f0;
33 } else {
34 score[1] -= premium*premium;
36 score[2] = 0;
37 if ((lua_type(L, 1)==LUA_TSTRING)) {
38 score[2] += premium;
39 } else if (false) {
40 score[2] += premium-1; // table: 0x8ae060;
41 } else {
42 score[2] -= premium*premium;
44 if ((lua_type(L, 2)==LUA_TSTRING)) {
45 score[2] += premium;
46 } else if (false) {
47 score[2] += premium-1; // table: 0x979540;
48 } else {
49 score[2] -= premium*premium;
51 if (lua_isnumber(L, 3)) {
52 score[2] += premium;
53 } else if (false) {
54 score[2] += premium-1; // table: 0xc46500;
55 } else {
56 score[2] -= premium*premium;
58 int best = 1;
59 for (int i=1;i<=2;i++) {
60 if (score[best] < score[i]) { best = i; }
62 switch (best) {
63 case 1: return __LuaWrapCall__tr__OverloadedVersion__1(L); break;
64 case 2: return __LuaWrapCall__tr__OverloadedVersion__2(L); break;
66 lua_pushstring(L, "no overload of function __LuaWrapCall__tr matching arguments");
67 lua_error(L);
68 return 0;
70 int LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__delete (lua_State *L) {
71 QSyntaxHighlighter *& __lua__obj = *static_cast<QSyntaxHighlighter**>(lqtL_checkudata(L, 1, "QSyntaxHighlighter*"));
72 if (__lua__obj==0) {
73 lua_pushstring(L, "trying to reference deleted pointer");
74 lua_error(L);
75 return 0;
77 delete __lua__obj;
78 __lua__obj = 0;
79 return 0;
81 int LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__new__OverloadedVersion__1 (lua_State *L) {
82 QObject * arg1 = *static_cast<QObject**>(lqtL_checkudata(L, 1, "QObject*"));
83 QSyntaxHighlighter * ret = new LuaBinder< QSyntaxHighlighter >(L, arg1);
84 lqtL_passudata(L, ret, "QSyntaxHighlighter*");
85 return 1;
87 int LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__new__OverloadedVersion__2 (lua_State *L) {
88 QTextDocument * arg1 = *static_cast<QTextDocument**>(lqtL_checkudata(L, 1, "QTextDocument*"));
89 QSyntaxHighlighter * ret = new LuaBinder< QSyntaxHighlighter >(L, arg1);
90 lqtL_passudata(L, ret, "QSyntaxHighlighter*");
91 return 1;
93 int LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__new__OverloadedVersion__3 (lua_State *L) {
94 QTextEdit * arg1 = *static_cast<QTextEdit**>(lqtL_checkudata(L, 1, "QTextEdit*"));
95 QSyntaxHighlighter * ret = new LuaBinder< QSyntaxHighlighter >(L, arg1);
96 lqtL_passudata(L, ret, "QSyntaxHighlighter*");
97 return 1;
99 int LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__new (lua_State *L) {
100 int score[4];
101 const int premium = 11+lua_gettop(L);
102 score[1] = 0;
103 if (lqtL_testudata(L, 1, "QObject*")) {
104 score[1] += premium;
105 } else if (false) {
106 score[1] += premium-1; // table: 0xe4af40;
107 } else {
108 score[1] -= premium*premium;
110 score[2] = 0;
111 if (lqtL_testudata(L, 1, "QTextDocument*")) {
112 score[2] += premium;
113 } else if (false) {
114 score[2] += premium-1; // table: 0x796ff0;
115 } else {
116 score[2] -= premium*premium;
118 score[3] = 0;
119 if (lqtL_testudata(L, 1, "QTextEdit*")) {
120 score[3] += premium;
121 } else if (false) {
122 score[3] += premium-1; // table: 0xd2be50;
123 } else {
124 score[3] -= premium*premium;
126 int best = 1;
127 for (int i=1;i<=3;i++) {
128 if (score[best] < score[i]) { best = i; }
130 switch (best) {
131 case 1: return __LuaWrapCall__new__OverloadedVersion__1(L); break;
132 case 2: return __LuaWrapCall__new__OverloadedVersion__2(L); break;
133 case 3: return __LuaWrapCall__new__OverloadedVersion__3(L); break;
135 lua_pushstring(L, "no overload of function __LuaWrapCall__new matching arguments");
136 lua_error(L);
137 return 0;
139 int LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__setDocument (lua_State *L) {
140 QSyntaxHighlighter *& __lua__obj = *static_cast<QSyntaxHighlighter**>(lqtL_checkudata(L, 1, "QSyntaxHighlighter*"));
141 if (__lua__obj==0) {
142 lua_pushstring(L, "trying to reference deleted pointer");
143 lua_error(L);
144 return 0;
146 QTextDocument * arg1 = *static_cast<QTextDocument**>(lqtL_checkudata(L, 2, "QTextDocument*"));
147 __lua__obj->QSyntaxHighlighter::setDocument(arg1);
148 return 0;
150 int LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__trUtf8__OverloadedVersion__1 (lua_State *L) {
151 const char * arg1 = lua_tostring(L, 1);
152 const char * arg2 = (lua_type(L, 2)==LUA_TSTRING)?lua_tostring(L, 2):static_cast< const char * >(0);
153 QString ret = QSyntaxHighlighter::trUtf8(arg1, arg2);
154 lua_pushlstring(L, ret.toAscii().data(), ret.toAscii().size());
155 return 1;
157 int LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__trUtf8__OverloadedVersion__2 (lua_State *L) {
158 const char * arg1 = lua_tostring(L, 1);
159 const char * arg2 = lua_tostring(L, 2);
160 int arg3 = lua_tointeger(L, 3);
161 QString ret = QSyntaxHighlighter::trUtf8(arg1, arg2, arg3);
162 lua_pushlstring(L, ret.toAscii().data(), ret.toAscii().size());
163 return 1;
165 int LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__trUtf8 (lua_State *L) {
166 int score[3];
167 const int premium = 11+lua_gettop(L);
168 score[1] = 0;
169 if ((lua_type(L, 1)==LUA_TSTRING)) {
170 score[1] += premium;
171 } else if (false) {
172 score[1] += premium-1; // table: 0x9ed820;
173 } else {
174 score[1] -= premium*premium;
176 if ((lua_type(L, 2)==LUA_TSTRING)) {
177 score[1] += premium;
178 } else if (true) {
179 score[1] += premium-1; // table: 0xee36c0;
180 } else {
181 score[1] -= premium*premium;
183 score[2] = 0;
184 if ((lua_type(L, 1)==LUA_TSTRING)) {
185 score[2] += premium;
186 } else if (false) {
187 score[2] += premium-1; // table: 0x947210;
188 } else {
189 score[2] -= premium*premium;
191 if ((lua_type(L, 2)==LUA_TSTRING)) {
192 score[2] += premium;
193 } else if (false) {
194 score[2] += premium-1; // table: 0x94b260;
195 } else {
196 score[2] -= premium*premium;
198 if (lua_isnumber(L, 3)) {
199 score[2] += premium;
200 } else if (false) {
201 score[2] += premium-1; // table: 0x9355a0;
202 } else {
203 score[2] -= premium*premium;
205 int best = 1;
206 for (int i=1;i<=2;i++) {
207 if (score[best] < score[i]) { best = i; }
209 switch (best) {
210 case 1: return __LuaWrapCall__trUtf8__OverloadedVersion__1(L); break;
211 case 2: return __LuaWrapCall__trUtf8__OverloadedVersion__2(L); break;
213 lua_pushstring(L, "no overload of function __LuaWrapCall__trUtf8 matching arguments");
214 lua_error(L);
215 return 0;
217 int LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__metaObject (lua_State *L) {
218 QSyntaxHighlighter *& __lua__obj = *static_cast<QSyntaxHighlighter**>(lqtL_checkudata(L, 1, "QSyntaxHighlighter*"));
219 if (__lua__obj==0) {
220 lua_pushstring(L, "trying to reference deleted pointer");
221 lua_error(L);
222 return 0;
224 const QMetaObject * ret = __lua__obj->QSyntaxHighlighter::metaObject();
225 lqtL_pushudata(L, ret, "QMetaObject*");
226 return 1;
228 int LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__rehighlight (lua_State *L) {
229 QSyntaxHighlighter *& __lua__obj = *static_cast<QSyntaxHighlighter**>(lqtL_checkudata(L, 1, "QSyntaxHighlighter*"));
230 if (__lua__obj==0) {
231 lua_pushstring(L, "trying to reference deleted pointer");
232 lua_error(L);
233 return 0;
235 __lua__obj->QSyntaxHighlighter::rehighlight();
236 return 0;
238 int LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__document (lua_State *L) {
239 QSyntaxHighlighter *& __lua__obj = *static_cast<QSyntaxHighlighter**>(lqtL_checkudata(L, 1, "QSyntaxHighlighter*"));
240 if (__lua__obj==0) {
241 lua_pushstring(L, "trying to reference deleted pointer");
242 lua_error(L);
243 return 0;
245 QTextDocument * ret = __lua__obj->QSyntaxHighlighter::document();
246 lqtL_pushudata(L, ret, "QTextDocument*");
247 return 1;
249 bool LuaBinder< QSyntaxHighlighter >::eventFilter (QObject * arg1, QEvent * arg2) {
250 bool absorbed = false;
251 int oldtop = lua_gettop(L);
252 lqtL_pushudata(L, this, "QSyntaxHighlighter*");
253 if (lua_getmetatable(L, -1)) {
254 lua_getfield(L, -1, "eventFilter");
255 lua_remove(L, -2);
256 } else {
257 lua_pushnil(L);
259 lua_insert(L, -2);
260 lqtL_pushudata(L, arg1, "QObject*");
261 lqtL_pushudata(L, arg2, "QEvent*");
262 if (lua_isfunction(L, -2-2)) {
263 lua_pcall(L, 2+1, 2, 0);
264 absorbed = (bool)lua_toboolean(L, -1) || (bool)lua_toboolean(L, -2);
265 lua_pop(L, 1);
267 if (!absorbed) {
268 lua_settop(L, oldtop);
269 return this->QObject::eventFilter(arg1, arg2);
271 bool ret = (bool)lua_toboolean(L, -1);
272 lua_settop(L, oldtop);
273 return ret;
275 void LuaBinder< QSyntaxHighlighter >::highlightBlock (const QString& arg1) {
276 bool absorbed = false;
277 int oldtop = lua_gettop(L);
278 lqtL_pushudata(L, this, "QSyntaxHighlighter*");
279 if (lua_getmetatable(L, -1)) {
280 lua_getfield(L, -1, "highlightBlock");
281 lua_remove(L, -2);
282 } else {
283 lua_pushnil(L);
285 lua_insert(L, -2);
286 lua_pushlstring(L, arg1.toAscii().data(), arg1.toAscii().size());
287 if (lua_isfunction(L, -1-2)) {
288 lua_pcall(L, 1+1, 2, 0);
289 absorbed = (bool)lua_toboolean(L, -1) || (bool)lua_toboolean(L, -2);
290 lua_pop(L, 1);
292 if (!absorbed) {
293 lua_settop(L, oldtop);
295 lua_settop(L, oldtop);
297 const QMetaObject * LuaBinder< QSyntaxHighlighter >::metaObject () const {
298 bool absorbed = false;
299 int oldtop = lua_gettop(L);
300 lqtL_pushudata(L, this, "QSyntaxHighlighter*");
301 if (lua_getmetatable(L, -1)) {
302 lua_getfield(L, -1, "metaObject");
303 lua_remove(L, -2);
304 } else {
305 lua_pushnil(L);
307 lua_insert(L, -2);
308 if (lua_isfunction(L, -0-2)) {
309 lua_pcall(L, 0+1, 2, 0);
310 absorbed = (bool)lua_toboolean(L, -1) || (bool)lua_toboolean(L, -2);
311 lua_pop(L, 1);
313 if (!absorbed) {
314 lua_settop(L, oldtop);
315 return this->QSyntaxHighlighter::metaObject();
317 const QMetaObject * ret = *static_cast<QMetaObject**>(lqtL_checkudata(L, -1, "QMetaObject*"));
318 lua_settop(L, oldtop);
319 return ret;
321 bool LuaBinder< QSyntaxHighlighter >::event (QEvent * arg1) {
322 bool absorbed = false;
323 int oldtop = lua_gettop(L);
324 lqtL_pushudata(L, this, "QSyntaxHighlighter*");
325 if (lua_getmetatable(L, -1)) {
326 lua_getfield(L, -1, "event");
327 lua_remove(L, -2);
328 } else {
329 lua_pushnil(L);
331 lua_insert(L, -2);
332 lqtL_pushudata(L, arg1, "QEvent*");
333 if (lua_isfunction(L, -1-2)) {
334 lua_pcall(L, 1+1, 2, 0);
335 absorbed = (bool)lua_toboolean(L, -1) || (bool)lua_toboolean(L, -2);
336 lua_pop(L, 1);
338 if (!absorbed) {
339 lua_settop(L, oldtop);
340 return this->QObject::event(arg1);
342 bool ret = (bool)lua_toboolean(L, -1);
343 lua_settop(L, oldtop);
344 return ret;
346 void LuaBinder< QSyntaxHighlighter >::disconnectNotify (const char * arg1) {
347 bool absorbed = false;
348 int oldtop = lua_gettop(L);
349 lqtL_pushudata(L, this, "QSyntaxHighlighter*");
350 if (lua_getmetatable(L, -1)) {
351 lua_getfield(L, -1, "disconnectNotify");
352 lua_remove(L, -2);
353 } else {
354 lua_pushnil(L);
356 lua_insert(L, -2);
357 lua_pushstring(L, arg1);
358 if (lua_isfunction(L, -1-2)) {
359 lua_pcall(L, 1+1, 2, 0);
360 absorbed = (bool)lua_toboolean(L, -1) || (bool)lua_toboolean(L, -2);
361 lua_pop(L, 1);
363 if (!absorbed) {
364 lua_settop(L, oldtop);
365 this->QObject::disconnectNotify(arg1);
367 lua_settop(L, oldtop);
369 void LuaBinder< QSyntaxHighlighter >::connectNotify (const char * arg1) {
370 bool absorbed = false;
371 int oldtop = lua_gettop(L);
372 lqtL_pushudata(L, this, "QSyntaxHighlighter*");
373 if (lua_getmetatable(L, -1)) {
374 lua_getfield(L, -1, "connectNotify");
375 lua_remove(L, -2);
376 } else {
377 lua_pushnil(L);
379 lua_insert(L, -2);
380 lua_pushstring(L, arg1);
381 if (lua_isfunction(L, -1-2)) {
382 lua_pcall(L, 1+1, 2, 0);
383 absorbed = (bool)lua_toboolean(L, -1) || (bool)lua_toboolean(L, -2);
384 lua_pop(L, 1);
386 if (!absorbed) {
387 lua_settop(L, oldtop);
388 this->QObject::connectNotify(arg1);
390 lua_settop(L, oldtop);
392 void LuaBinder< QSyntaxHighlighter >::timerEvent (QTimerEvent * arg1) {
393 bool absorbed = false;
394 int oldtop = lua_gettop(L);
395 lqtL_pushudata(L, this, "QSyntaxHighlighter*");
396 if (lua_getmetatable(L, -1)) {
397 lua_getfield(L, -1, "timerEvent");
398 lua_remove(L, -2);
399 } else {
400 lua_pushnil(L);
402 lua_insert(L, -2);
403 lqtL_pushudata(L, arg1, "QTimerEvent*");
404 if (lua_isfunction(L, -1-2)) {
405 lua_pcall(L, 1+1, 2, 0);
406 absorbed = (bool)lua_toboolean(L, -1) || (bool)lua_toboolean(L, -2);
407 lua_pop(L, 1);
409 if (!absorbed) {
410 lua_settop(L, oldtop);
411 this->QObject::timerEvent(arg1);
413 lua_settop(L, oldtop);
415 void LuaBinder< QSyntaxHighlighter >::childEvent (QChildEvent * arg1) {
416 bool absorbed = false;
417 int oldtop = lua_gettop(L);
418 lqtL_pushudata(L, this, "QSyntaxHighlighter*");
419 if (lua_getmetatable(L, -1)) {
420 lua_getfield(L, -1, "childEvent");
421 lua_remove(L, -2);
422 } else {
423 lua_pushnil(L);
425 lua_insert(L, -2);
426 lqtL_pushudata(L, arg1, "QChildEvent*");
427 if (lua_isfunction(L, -1-2)) {
428 lua_pcall(L, 1+1, 2, 0);
429 absorbed = (bool)lua_toboolean(L, -1) || (bool)lua_toboolean(L, -2);
430 lua_pop(L, 1);
432 if (!absorbed) {
433 lua_settop(L, oldtop);
434 this->QObject::childEvent(arg1);
436 lua_settop(L, oldtop);
438 void LuaBinder< QSyntaxHighlighter >::customEvent (QEvent * arg1) {
439 bool absorbed = false;
440 int oldtop = lua_gettop(L);
441 lqtL_pushudata(L, this, "QSyntaxHighlighter*");
442 if (lua_getmetatable(L, -1)) {
443 lua_getfield(L, -1, "customEvent");
444 lua_remove(L, -2);
445 } else {
446 lua_pushnil(L);
448 lua_insert(L, -2);
449 lqtL_pushudata(L, arg1, "QEvent*");
450 if (lua_isfunction(L, -1-2)) {
451 lua_pcall(L, 1+1, 2, 0);
452 absorbed = (bool)lua_toboolean(L, -1) || (bool)lua_toboolean(L, -2);
453 lua_pop(L, 1);
455 if (!absorbed) {
456 lua_settop(L, oldtop);
457 this->QObject::customEvent(arg1);
459 lua_settop(L, oldtop);
461 LuaBinder< QSyntaxHighlighter >:: ~LuaBinder< QSyntaxHighlighter > () {
462 int oldtop = lua_gettop(L);
463 lqtL_pushudata(L, this, "QSyntaxHighlighter*");
464 lua_getfield(L, -1, "~QSyntaxHighlighter");
466 if (lua_isfunction(L, -1)) {
467 lua_insert(L, -2);
468 lua_pcall(L, 1, 1, 0);
469 } else {
471 lua_settop(L, oldtop);
473 int luaopen_QSyntaxHighlighter (lua_State *L) {
474 if (luaL_newmetatable(L, "QSyntaxHighlighter*")) {
475 lua_pushcfunction(L, LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__tr);
476 lua_setfield(L, -2, "tr");
477 lua_pushcfunction(L, LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__delete);
478 lua_setfield(L, -2, "delete");
479 lua_pushcfunction(L, LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__new);
480 lua_setfield(L, -2, "new");
481 lua_pushcfunction(L, LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__setDocument);
482 lua_setfield(L, -2, "setDocument");
483 lua_pushcfunction(L, LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__trUtf8);
484 lua_setfield(L, -2, "trUtf8");
485 lua_pushcfunction(L, LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__metaObject);
486 lua_setfield(L, -2, "metaObject");
487 lua_pushcfunction(L, LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__rehighlight);
488 lua_setfield(L, -2, "rehighlight");
489 lua_pushcfunction(L, LuaBinder< QSyntaxHighlighter >::__LuaWrapCall__document);
490 lua_setfield(L, -2, "document");
491 lua_newtable(L);
492 lua_pushboolean(L, 1);
493 lua_setfield(L, -2, "QObject*");
494 lua_setfield(L, -2, "__base");
495 lua_pushcfunction(L, lqtL_newindex);
496 lua_setfield(L, -2, "__newindex");
497 lua_pushcfunction(L, lqtL_index);
498 lua_setfield(L, -2, "__index");
499 lua_pushcfunction(L, lqtL_gc);
500 lua_setfield(L, -2, "__gc");
501 lua_pushstring(L, "QSyntaxHighlighter");
502 lua_setfield(L, -2, "__qtype");
503 lua_setglobal(L, "QSyntaxHighlighter");
504 } else {
505 lua_pop(L, 1);
507 return 0;