PageRenderTime 63ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 1ms

/src/plugins/python/pythonbind.cpp

https://github.com/geedew/tiled
C++ | 6438 lines | 5490 code | 858 blank | 90 comment | 271 complexity | 9abae927ce5454da570c81400fda84c9 MD5 | raw file
Possible License(s): Apache-2.0, GPL-2.0, AGPL-1.0

Large files files are truncated, but you can click here to view the full file

  1. /* This file was generated by PyBindGen 0.16.0 */
  2. #define PY_SSIZE_T_CLEAN
  3. #include <Python.h>
  4. #include <stddef.h>
  5. #if PY_VERSION_HEX < 0x020400F0
  6. #define PyEval_ThreadsInitialized() 1
  7. #define Py_CLEAR(op) \
  8. do { \
  9. if (op) { \
  10. PyObject *tmp = (PyObject *)(op); \
  11. (op) = NULL; \
  12. Py_DECREF(tmp); \
  13. } \
  14. } while (0)
  15. #define Py_VISIT(op) \
  16. do { \
  17. if (op) { \
  18. int vret = visit((PyObject *)(op), arg); \
  19. if (vret) \
  20. return vret; \
  21. } \
  22. } while (0)
  23. #endif
  24. #if PY_VERSION_HEX < 0x020500F0
  25. typedef int Py_ssize_t;
  26. # define PY_SSIZE_T_MAX INT_MAX
  27. # define PY_SSIZE_T_MIN INT_MIN
  28. typedef inquiry lenfunc;
  29. typedef intargfunc ssizeargfunc;
  30. typedef intobjargproc ssizeobjargproc;
  31. #endif
  32. #if __GNUC__ > 2
  33. # define PYBINDGEN_UNUSED(param) param __attribute__((__unused__))
  34. #elif __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
  35. # define PYBINDGEN_UNUSED(param) __attribute__((__unused__)) param
  36. #else
  37. # define PYBINDGEN_UNUSED(param) param
  38. #endif /* !__GNUC__ */
  39. typedef enum _PyBindGenWrapperFlags {
  40. PYBINDGEN_WRAPPER_FLAG_NONE = 0,
  41. PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED = (1<<0),
  42. } PyBindGenWrapperFlags;
  43. #include "pythonplugin.h"
  44. #include "map.h"
  45. #include "layer.h"
  46. #include "tile.h"
  47. #include "mapobject.h"
  48. #include "imagelayer.h"
  49. #include "tilelayer.h"
  50. #include "objectgroup.h"
  51. #include "tileset.h"
  52. #include <QImage>
  53. #include <QFileDialog>
  54. #include <QWidget>
  55. #include <QFlags>
  56. /* --- forward declarations --- */
  57. typedef struct {
  58. PyObject_HEAD
  59. Python::PythonScript *obj;
  60. PyObject *inst_dict;
  61. PyBindGenWrapperFlags flags:8;
  62. } PyPythonPythonScript;
  63. extern PyTypeObject PyPythonPythonScript_Type;
  64. /* --- forward declarations --- */
  65. typedef struct {
  66. PyObject_HEAD
  67. QPointF *obj;
  68. PyBindGenWrapperFlags flags:8;
  69. } PyQPointF;
  70. extern PyTypeObject PyQPointF_Type;
  71. typedef struct {
  72. PyObject_HEAD
  73. QSizeF *obj;
  74. PyBindGenWrapperFlags flags:8;
  75. } PyQSizeF;
  76. extern PyTypeObject PyQSizeF_Type;
  77. typedef struct {
  78. PyObject_HEAD
  79. QRgb *obj;
  80. PyBindGenWrapperFlags flags:8;
  81. } PyQRgb;
  82. extern PyTypeObject PyQRgb_Type;
  83. typedef struct {
  84. PyObject_HEAD
  85. QColor *obj;
  86. PyBindGenWrapperFlags flags:8;
  87. } PyQColor;
  88. extern PyTypeObject PyQColor_Type;
  89. typedef struct {
  90. PyObject_HEAD
  91. QImage *obj;
  92. PyBindGenWrapperFlags flags:8;
  93. } PyQImage;
  94. extern PyTypeObject PyQImage_Type;
  95. typedef struct {
  96. PyObject_HEAD
  97. QPixmap *obj;
  98. PyBindGenWrapperFlags flags:8;
  99. } PyQPixmap;
  100. extern PyTypeObject PyQPixmap_Type;
  101. typedef struct {
  102. PyObject_HEAD
  103. QWidget *obj;
  104. PyBindGenWrapperFlags flags:8;
  105. } PyQWidget;
  106. extern PyTypeObject PyQWidget_Type;
  107. typedef struct {
  108. PyObject_HEAD
  109. QFileDialog *obj;
  110. PyBindGenWrapperFlags flags:8;
  111. } PyQFileDialog;
  112. extern PyTypeObject PyQFileDialog_Type;
  113. typedef struct {
  114. PyObject_HEAD
  115. QVector<QRgb> *obj;
  116. } PyQVector__lt__QRgb__gt__;
  117. typedef struct {
  118. PyObject_HEAD
  119. PyQVector__lt__QRgb__gt__ *container;
  120. QVector<QRgb>::iterator *iterator;
  121. } PyQVector__lt__QRgb__gt__Iter;
  122. extern PyTypeObject PyQVector__lt__QRgb__gt___Type;
  123. extern PyTypeObject PyQVector__lt__QRgb__gt__Iter_Type;
  124. int _wrap_convert_py2c__QVector__lt___QRgb___gt__(PyObject *arg, QVector<QRgb> *container);
  125. typedef struct {
  126. PyObject_HEAD
  127. QList<QString> *obj;
  128. } PyQList__lt__QString__gt__;
  129. typedef struct {
  130. PyObject_HEAD
  131. PyQList__lt__QString__gt__ *container;
  132. QList<QString>::iterator *iterator;
  133. } PyQList__lt__QString__gt__Iter;
  134. extern PyTypeObject PyQList__lt__QString__gt___Type;
  135. extern PyTypeObject PyQList__lt__QString__gt__Iter_Type;
  136. int _wrap_convert_py2c__QList__lt___QString___gt__(PyObject *arg, QList<QString> *container);
  137. /* --- forward declarations --- */
  138. typedef struct {
  139. PyObject_HEAD
  140. Tiled::Tile *obj;
  141. PyBindGenWrapperFlags flags:8;
  142. } PyTiledTile;
  143. extern PyTypeObject PyTiledTile_Type;
  144. typedef struct {
  145. PyObject_HEAD
  146. Tiled::Tileset *obj;
  147. PyBindGenWrapperFlags flags:8;
  148. } PyTiledTileset;
  149. extern PyTypeObject PyTiledTileset_Type;
  150. typedef struct {
  151. PyObject_HEAD
  152. Tiled::Layer *obj;
  153. PyBindGenWrapperFlags flags:8;
  154. } PyTiledLayer;
  155. extern PyTypeObject PyTiledLayer_Type;
  156. typedef struct {
  157. PyObject_HEAD
  158. Tiled::Properties *obj;
  159. PyBindGenWrapperFlags flags:8;
  160. } PyTiledProperties;
  161. extern PyTypeObject PyTiledProperties_Type;
  162. typedef struct {
  163. PyObject_HEAD
  164. Tiled::Map *obj;
  165. PyBindGenWrapperFlags flags:8;
  166. } PyTiledMap;
  167. extern PyTypeObject PyTiledMap_Type;
  168. typedef struct {
  169. PyObject_HEAD
  170. Tiled::Cell *obj;
  171. PyBindGenWrapperFlags flags:8;
  172. } PyTiledCell;
  173. extern PyTypeObject PyTiledCell_Type;
  174. typedef struct {
  175. PyObject_HEAD
  176. Tiled::TileLayer *obj;
  177. PyBindGenWrapperFlags flags:8;
  178. } PyTiledTileLayer;
  179. extern PyTypeObject PyTiledTileLayer_Type;
  180. typedef struct {
  181. PyObject_HEAD
  182. Tiled::ImageLayer *obj;
  183. PyBindGenWrapperFlags flags:8;
  184. } PyTiledImageLayer;
  185. extern PyTypeObject PyTiledImageLayer_Type;
  186. typedef struct {
  187. PyObject_HEAD
  188. Tiled::Object *obj;
  189. PyBindGenWrapperFlags flags:8;
  190. } PyTiledObject;
  191. extern PyTypeObject PyTiledObject_Type;
  192. typedef struct {
  193. PyObject_HEAD
  194. Tiled::MapObject *obj;
  195. PyBindGenWrapperFlags flags:8;
  196. } PyTiledMapObject;
  197. extern PyTypeObject PyTiledMapObject_Type;
  198. typedef struct {
  199. PyObject_HEAD
  200. Tiled::ObjectGroup *obj;
  201. PyBindGenWrapperFlags flags:8;
  202. } PyTiledObjectGroup;
  203. extern PyTypeObject PyTiledObjectGroup_Type;
  204. typedef struct {
  205. PyObject_HEAD
  206. Tiled::LoggingInterface *obj;
  207. PyBindGenWrapperFlags flags:8;
  208. } PyTiledLoggingInterface;
  209. extern PyTypeObject PyTiledLoggingInterface_Type;
  210. #pragma GCC diagnostic ignored "-Wmissing-field-initializers"
  211. int _wrap_convert_py2c__QRgb(PyObject *value, QRgb *address);
  212. int _wrap_convert_py2c__QString(PyObject *value, QString *address);
  213. static PyMethodDef tiled_qt_functions[] = {
  214. {NULL, NULL, 0, NULL}
  215. };
  216. /* --- classes --- */
  217. static int
  218. _wrap_PyQPointF__tp_init(PyQPointF *self, PyObject *args, PyObject *kwargs)
  219. {
  220. float x;
  221. float y;
  222. const char *keywords[] = {"x", "y", NULL};
  223. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "ff", (char **) keywords, &x, &y)) {
  224. return -1;
  225. }
  226. self->obj = new QPointF(x, y);
  227. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  228. return 0;
  229. }
  230. PyObject *
  231. _wrap_PyQPointF_y(PyQPointF *self)
  232. {
  233. PyObject *py_retval;
  234. int retval;
  235. retval = self->obj->y();
  236. py_retval = Py_BuildValue((char *) "i", retval);
  237. return py_retval;
  238. }
  239. PyObject *
  240. _wrap_PyQPointF_x(PyQPointF *self)
  241. {
  242. PyObject *py_retval;
  243. int retval;
  244. retval = self->obj->x();
  245. py_retval = Py_BuildValue((char *) "i", retval);
  246. return py_retval;
  247. }
  248. PyObject *
  249. _wrap_PyQPointF_setX(PyQPointF *self, PyObject *args, PyObject *kwargs)
  250. {
  251. PyObject *py_retval;
  252. int x;
  253. const char *keywords[] = {"x", NULL};
  254. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &x)) {
  255. return NULL;
  256. }
  257. self->obj->setX(x);
  258. Py_INCREF(Py_None);
  259. py_retval = Py_None;
  260. return py_retval;
  261. }
  262. PyObject *
  263. _wrap_PyQPointF_setY(PyQPointF *self, PyObject *args, PyObject *kwargs)
  264. {
  265. PyObject *py_retval;
  266. int y;
  267. const char *keywords[] = {"y", NULL};
  268. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &y)) {
  269. return NULL;
  270. }
  271. self->obj->setY(y);
  272. Py_INCREF(Py_None);
  273. py_retval = Py_None;
  274. return py_retval;
  275. }
  276. static PyMethodDef PyQPointF_methods[] = {
  277. {(char *) "y", (PyCFunction) _wrap_PyQPointF_y, METH_NOARGS, NULL },
  278. {(char *) "x", (PyCFunction) _wrap_PyQPointF_x, METH_NOARGS, NULL },
  279. {(char *) "setX", (PyCFunction) _wrap_PyQPointF_setX, METH_KEYWORDS|METH_VARARGS, NULL },
  280. {(char *) "setY", (PyCFunction) _wrap_PyQPointF_setY, METH_KEYWORDS|METH_VARARGS, NULL },
  281. {NULL, NULL, 0, NULL}
  282. };
  283. static void
  284. _wrap_PyQPointF__tp_dealloc(PyQPointF *self)
  285. {
  286. QPointF *tmp = self->obj;
  287. self->obj = NULL;
  288. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  289. delete tmp;
  290. }
  291. self->ob_type->tp_free((PyObject*)self);
  292. }
  293. static PyObject*
  294. _wrap_PyQPointF__tp_richcompare (PyQPointF *PYBINDGEN_UNUSED(self), PyQPointF *other, int opid)
  295. {
  296. if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyQPointF_Type)) {
  297. Py_INCREF(Py_NotImplemented);
  298. return Py_NotImplemented;
  299. }
  300. switch (opid)
  301. {
  302. case Py_LT:
  303. Py_INCREF(Py_NotImplemented);
  304. return Py_NotImplemented;
  305. case Py_LE:
  306. Py_INCREF(Py_NotImplemented);
  307. return Py_NotImplemented;
  308. case Py_EQ:
  309. Py_INCREF(Py_NotImplemented);
  310. return Py_NotImplemented;
  311. case Py_NE:
  312. Py_INCREF(Py_NotImplemented);
  313. return Py_NotImplemented;
  314. case Py_GE:
  315. Py_INCREF(Py_NotImplemented);
  316. return Py_NotImplemented;
  317. case Py_GT:
  318. Py_INCREF(Py_NotImplemented);
  319. return Py_NotImplemented;
  320. } /* closes switch (opid) */
  321. Py_INCREF(Py_NotImplemented);
  322. return Py_NotImplemented;
  323. }
  324. PyTypeObject PyQPointF_Type = {
  325. PyObject_HEAD_INIT(NULL)
  326. 0, /* ob_size */
  327. (char *) "tiled.qt.QPointF", /* tp_name */
  328. sizeof(PyQPointF), /* tp_basicsize */
  329. 0, /* tp_itemsize */
  330. /* methods */
  331. (destructor)_wrap_PyQPointF__tp_dealloc, /* tp_dealloc */
  332. (printfunc)0, /* tp_print */
  333. (getattrfunc)NULL, /* tp_getattr */
  334. (setattrfunc)NULL, /* tp_setattr */
  335. (cmpfunc)NULL, /* tp_compare */
  336. (reprfunc)NULL, /* tp_repr */
  337. (PyNumberMethods*)NULL, /* tp_as_number */
  338. (PySequenceMethods*)NULL, /* tp_as_sequence */
  339. (PyMappingMethods*)NULL, /* tp_as_mapping */
  340. (hashfunc)NULL, /* tp_hash */
  341. (ternaryfunc)NULL, /* tp_call */
  342. (reprfunc)NULL, /* tp_str */
  343. (getattrofunc)NULL, /* tp_getattro */
  344. (setattrofunc)NULL, /* tp_setattro */
  345. (PyBufferProcs*)NULL, /* tp_as_buffer */
  346. Py_TPFLAGS_DEFAULT, /* tp_flags */
  347. NULL, /* Documentation string */
  348. (traverseproc)NULL, /* tp_traverse */
  349. (inquiry)NULL, /* tp_clear */
  350. (richcmpfunc)_wrap_PyQPointF__tp_richcompare, /* tp_richcompare */
  351. 0, /* tp_weaklistoffset */
  352. (getiterfunc)NULL, /* tp_iter */
  353. (iternextfunc)NULL, /* tp_iternext */
  354. (struct PyMethodDef*)PyQPointF_methods, /* tp_methods */
  355. (struct PyMemberDef*)0, /* tp_members */
  356. 0, /* tp_getset */
  357. NULL, /* tp_base */
  358. NULL, /* tp_dict */
  359. (descrgetfunc)NULL, /* tp_descr_get */
  360. (descrsetfunc)NULL, /* tp_descr_set */
  361. 0, /* tp_dictoffset */
  362. (initproc)_wrap_PyQPointF__tp_init, /* tp_init */
  363. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  364. (newfunc)PyType_GenericNew, /* tp_new */
  365. (freefunc)0, /* tp_free */
  366. (inquiry)NULL, /* tp_is_gc */
  367. NULL, /* tp_bases */
  368. NULL, /* tp_mro */
  369. NULL, /* tp_cache */
  370. NULL, /* tp_subclasses */
  371. NULL, /* tp_weaklist */
  372. (destructor) NULL /* tp_del */
  373. };
  374. static int
  375. _wrap_PyQSizeF__tp_init(PyQSizeF *self, PyObject *args, PyObject *kwargs)
  376. {
  377. float w;
  378. float h;
  379. const char *keywords[] = {"w", "h", NULL};
  380. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "ff", (char **) keywords, &w, &h)) {
  381. return -1;
  382. }
  383. self->obj = new QSizeF(w, h);
  384. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  385. return 0;
  386. }
  387. PyObject *
  388. _wrap_PyQSizeF_setHeight(PyQSizeF *self, PyObject *args, PyObject *kwargs)
  389. {
  390. PyObject *py_retval;
  391. int h;
  392. const char *keywords[] = {"h", NULL};
  393. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &h)) {
  394. return NULL;
  395. }
  396. self->obj->setHeight(h);
  397. Py_INCREF(Py_None);
  398. py_retval = Py_None;
  399. return py_retval;
  400. }
  401. PyObject *
  402. _wrap_PyQSizeF_width(PyQSizeF *self)
  403. {
  404. PyObject *py_retval;
  405. int retval;
  406. retval = self->obj->width();
  407. py_retval = Py_BuildValue((char *) "i", retval);
  408. return py_retval;
  409. }
  410. PyObject *
  411. _wrap_PyQSizeF_setWidth(PyQSizeF *self, PyObject *args, PyObject *kwargs)
  412. {
  413. PyObject *py_retval;
  414. int w;
  415. const char *keywords[] = {"w", NULL};
  416. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &w)) {
  417. return NULL;
  418. }
  419. self->obj->setWidth(w);
  420. Py_INCREF(Py_None);
  421. py_retval = Py_None;
  422. return py_retval;
  423. }
  424. PyObject *
  425. _wrap_PyQSizeF_height(PyQSizeF *self)
  426. {
  427. PyObject *py_retval;
  428. int retval;
  429. retval = self->obj->height();
  430. py_retval = Py_BuildValue((char *) "i", retval);
  431. return py_retval;
  432. }
  433. static PyMethodDef PyQSizeF_methods[] = {
  434. {(char *) "setHeight", (PyCFunction) _wrap_PyQSizeF_setHeight, METH_KEYWORDS|METH_VARARGS, NULL },
  435. {(char *) "width", (PyCFunction) _wrap_PyQSizeF_width, METH_NOARGS, NULL },
  436. {(char *) "setWidth", (PyCFunction) _wrap_PyQSizeF_setWidth, METH_KEYWORDS|METH_VARARGS, NULL },
  437. {(char *) "height", (PyCFunction) _wrap_PyQSizeF_height, METH_NOARGS, NULL },
  438. {NULL, NULL, 0, NULL}
  439. };
  440. static void
  441. _wrap_PyQSizeF__tp_dealloc(PyQSizeF *self)
  442. {
  443. QSizeF *tmp = self->obj;
  444. self->obj = NULL;
  445. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  446. delete tmp;
  447. }
  448. self->ob_type->tp_free((PyObject*)self);
  449. }
  450. static PyObject*
  451. _wrap_PyQSizeF__tp_richcompare (PyQSizeF *PYBINDGEN_UNUSED(self), PyQSizeF *other, int opid)
  452. {
  453. if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyQSizeF_Type)) {
  454. Py_INCREF(Py_NotImplemented);
  455. return Py_NotImplemented;
  456. }
  457. switch (opid)
  458. {
  459. case Py_LT:
  460. Py_INCREF(Py_NotImplemented);
  461. return Py_NotImplemented;
  462. case Py_LE:
  463. Py_INCREF(Py_NotImplemented);
  464. return Py_NotImplemented;
  465. case Py_EQ:
  466. Py_INCREF(Py_NotImplemented);
  467. return Py_NotImplemented;
  468. case Py_NE:
  469. Py_INCREF(Py_NotImplemented);
  470. return Py_NotImplemented;
  471. case Py_GE:
  472. Py_INCREF(Py_NotImplemented);
  473. return Py_NotImplemented;
  474. case Py_GT:
  475. Py_INCREF(Py_NotImplemented);
  476. return Py_NotImplemented;
  477. } /* closes switch (opid) */
  478. Py_INCREF(Py_NotImplemented);
  479. return Py_NotImplemented;
  480. }
  481. PyTypeObject PyQSizeF_Type = {
  482. PyObject_HEAD_INIT(NULL)
  483. 0, /* ob_size */
  484. (char *) "tiled.qt.QSizeF", /* tp_name */
  485. sizeof(PyQSizeF), /* tp_basicsize */
  486. 0, /* tp_itemsize */
  487. /* methods */
  488. (destructor)_wrap_PyQSizeF__tp_dealloc, /* tp_dealloc */
  489. (printfunc)0, /* tp_print */
  490. (getattrfunc)NULL, /* tp_getattr */
  491. (setattrfunc)NULL, /* tp_setattr */
  492. (cmpfunc)NULL, /* tp_compare */
  493. (reprfunc)NULL, /* tp_repr */
  494. (PyNumberMethods*)NULL, /* tp_as_number */
  495. (PySequenceMethods*)NULL, /* tp_as_sequence */
  496. (PyMappingMethods*)NULL, /* tp_as_mapping */
  497. (hashfunc)NULL, /* tp_hash */
  498. (ternaryfunc)NULL, /* tp_call */
  499. (reprfunc)NULL, /* tp_str */
  500. (getattrofunc)NULL, /* tp_getattro */
  501. (setattrofunc)NULL, /* tp_setattro */
  502. (PyBufferProcs*)NULL, /* tp_as_buffer */
  503. Py_TPFLAGS_DEFAULT, /* tp_flags */
  504. NULL, /* Documentation string */
  505. (traverseproc)NULL, /* tp_traverse */
  506. (inquiry)NULL, /* tp_clear */
  507. (richcmpfunc)_wrap_PyQSizeF__tp_richcompare, /* tp_richcompare */
  508. 0, /* tp_weaklistoffset */
  509. (getiterfunc)NULL, /* tp_iter */
  510. (iternextfunc)NULL, /* tp_iternext */
  511. (struct PyMethodDef*)PyQSizeF_methods, /* tp_methods */
  512. (struct PyMemberDef*)0, /* tp_members */
  513. 0, /* tp_getset */
  514. NULL, /* tp_base */
  515. NULL, /* tp_dict */
  516. (descrgetfunc)NULL, /* tp_descr_get */
  517. (descrsetfunc)NULL, /* tp_descr_set */
  518. 0, /* tp_dictoffset */
  519. (initproc)_wrap_PyQSizeF__tp_init, /* tp_init */
  520. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  521. (newfunc)PyType_GenericNew, /* tp_new */
  522. (freefunc)0, /* tp_free */
  523. (inquiry)NULL, /* tp_is_gc */
  524. NULL, /* tp_bases */
  525. NULL, /* tp_mro */
  526. NULL, /* tp_cache */
  527. NULL, /* tp_subclasses */
  528. NULL, /* tp_weaklist */
  529. (destructor) NULL /* tp_del */
  530. };
  531. static int
  532. _wrap_PyQRgb__tp_init(void)
  533. {
  534. PyErr_SetString(PyExc_TypeError, "class 'QRgb' cannot be constructed ()");
  535. return -1;
  536. }
  537. static PyMethodDef PyQRgb_methods[] = {
  538. {NULL, NULL, 0, NULL}
  539. };
  540. static void
  541. _wrap_PyQRgb__tp_dealloc(PyQRgb *self)
  542. {
  543. QRgb *tmp = self->obj;
  544. self->obj = NULL;
  545. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  546. delete tmp;
  547. }
  548. self->ob_type->tp_free((PyObject*)self);
  549. }
  550. static PyObject*
  551. _wrap_PyQRgb__tp_richcompare (PyQRgb *PYBINDGEN_UNUSED(self), PyQRgb *other, int opid)
  552. {
  553. if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyQRgb_Type)) {
  554. Py_INCREF(Py_NotImplemented);
  555. return Py_NotImplemented;
  556. }
  557. switch (opid)
  558. {
  559. case Py_LT:
  560. Py_INCREF(Py_NotImplemented);
  561. return Py_NotImplemented;
  562. case Py_LE:
  563. Py_INCREF(Py_NotImplemented);
  564. return Py_NotImplemented;
  565. case Py_EQ:
  566. Py_INCREF(Py_NotImplemented);
  567. return Py_NotImplemented;
  568. case Py_NE:
  569. Py_INCREF(Py_NotImplemented);
  570. return Py_NotImplemented;
  571. case Py_GE:
  572. Py_INCREF(Py_NotImplemented);
  573. return Py_NotImplemented;
  574. case Py_GT:
  575. Py_INCREF(Py_NotImplemented);
  576. return Py_NotImplemented;
  577. } /* closes switch (opid) */
  578. Py_INCREF(Py_NotImplemented);
  579. return Py_NotImplemented;
  580. }
  581. PyTypeObject PyQRgb_Type = {
  582. PyObject_HEAD_INIT(NULL)
  583. 0, /* ob_size */
  584. (char *) "tiled.qt.QRgb", /* tp_name */
  585. sizeof(PyQRgb), /* tp_basicsize */
  586. 0, /* tp_itemsize */
  587. /* methods */
  588. (destructor)_wrap_PyQRgb__tp_dealloc, /* tp_dealloc */
  589. (printfunc)0, /* tp_print */
  590. (getattrfunc)NULL, /* tp_getattr */
  591. (setattrfunc)NULL, /* tp_setattr */
  592. (cmpfunc)NULL, /* tp_compare */
  593. (reprfunc)NULL, /* tp_repr */
  594. (PyNumberMethods*)NULL, /* tp_as_number */
  595. (PySequenceMethods*)NULL, /* tp_as_sequence */
  596. (PyMappingMethods*)NULL, /* tp_as_mapping */
  597. (hashfunc)NULL, /* tp_hash */
  598. (ternaryfunc)NULL, /* tp_call */
  599. (reprfunc)NULL, /* tp_str */
  600. (getattrofunc)NULL, /* tp_getattro */
  601. (setattrofunc)NULL, /* tp_setattro */
  602. (PyBufferProcs*)NULL, /* tp_as_buffer */
  603. Py_TPFLAGS_DEFAULT, /* tp_flags */
  604. NULL, /* Documentation string */
  605. (traverseproc)NULL, /* tp_traverse */
  606. (inquiry)NULL, /* tp_clear */
  607. (richcmpfunc)_wrap_PyQRgb__tp_richcompare, /* tp_richcompare */
  608. 0, /* tp_weaklistoffset */
  609. (getiterfunc)NULL, /* tp_iter */
  610. (iternextfunc)NULL, /* tp_iternext */
  611. (struct PyMethodDef*)PyQRgb_methods, /* tp_methods */
  612. (struct PyMemberDef*)0, /* tp_members */
  613. 0, /* tp_getset */
  614. NULL, /* tp_base */
  615. NULL, /* tp_dict */
  616. (descrgetfunc)NULL, /* tp_descr_get */
  617. (descrsetfunc)NULL, /* tp_descr_set */
  618. 0, /* tp_dictoffset */
  619. (initproc)_wrap_PyQRgb__tp_init, /* tp_init */
  620. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  621. (newfunc)PyType_GenericNew, /* tp_new */
  622. (freefunc)0, /* tp_free */
  623. (inquiry)NULL, /* tp_is_gc */
  624. NULL, /* tp_bases */
  625. NULL, /* tp_mro */
  626. NULL, /* tp_cache */
  627. NULL, /* tp_subclasses */
  628. NULL, /* tp_weaklist */
  629. (destructor) NULL /* tp_del */
  630. };
  631. static int
  632. _wrap_PyQColor__tp_init__0(PyQColor *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  633. {
  634. PyQRgb *col;
  635. const char *keywords[] = {"col", NULL};
  636. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQRgb_Type, &col)) {
  637. {
  638. PyObject *exc_type, *traceback;
  639. PyErr_Fetch(&exc_type, return_exception, &traceback);
  640. Py_XDECREF(exc_type);
  641. Py_XDECREF(traceback);
  642. }
  643. return -1;
  644. }
  645. self->obj = new QColor(*((PyQRgb *) col)->obj);
  646. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  647. return 0;
  648. }
  649. static int
  650. _wrap_PyQColor__tp_init__1(PyQColor *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  651. {
  652. int r;
  653. int g;
  654. int b;
  655. const char *keywords[] = {"r", "g", "b", NULL};
  656. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "iii", (char **) keywords, &r, &g, &b)) {
  657. {
  658. PyObject *exc_type, *traceback;
  659. PyErr_Fetch(&exc_type, return_exception, &traceback);
  660. Py_XDECREF(exc_type);
  661. Py_XDECREF(traceback);
  662. }
  663. return -1;
  664. }
  665. self->obj = new QColor(r, g, b);
  666. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  667. return 0;
  668. }
  669. static int
  670. _wrap_PyQColor__tp_init__2(PyQColor *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  671. {
  672. int r;
  673. int g;
  674. int b;
  675. int a;
  676. const char *keywords[] = {"r", "g", "b", "a", NULL};
  677. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "iiii", (char **) keywords, &r, &g, &b, &a)) {
  678. {
  679. PyObject *exc_type, *traceback;
  680. PyErr_Fetch(&exc_type, return_exception, &traceback);
  681. Py_XDECREF(exc_type);
  682. Py_XDECREF(traceback);
  683. }
  684. return -1;
  685. }
  686. self->obj = new QColor(r, g, b, a);
  687. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  688. return 0;
  689. }
  690. int _wrap_PyQColor__tp_init(PyQColor *self, PyObject *args, PyObject *kwargs)
  691. {
  692. int retval;
  693. PyObject *error_list;
  694. PyObject *exceptions[3] = {0,};
  695. retval = _wrap_PyQColor__tp_init__0(self, args, kwargs, &exceptions[0]);
  696. if (!exceptions[0]) {
  697. return retval;
  698. }
  699. retval = _wrap_PyQColor__tp_init__1(self, args, kwargs, &exceptions[1]);
  700. if (!exceptions[1]) {
  701. Py_DECREF(exceptions[0]);
  702. return retval;
  703. }
  704. retval = _wrap_PyQColor__tp_init__2(self, args, kwargs, &exceptions[2]);
  705. if (!exceptions[2]) {
  706. Py_DECREF(exceptions[0]);
  707. Py_DECREF(exceptions[1]);
  708. return retval;
  709. }
  710. error_list = PyList_New(3);
  711. PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
  712. Py_DECREF(exceptions[0]);
  713. PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
  714. Py_DECREF(exceptions[1]);
  715. PyList_SET_ITEM(error_list, 2, PyObject_Str(exceptions[2]));
  716. Py_DECREF(exceptions[2]);
  717. PyErr_SetObject(PyExc_TypeError, error_list);
  718. Py_DECREF(error_list);
  719. return -1;
  720. }
  721. PyObject *
  722. _wrap_PyQColor_rgb(PyQColor *self)
  723. {
  724. PyObject *py_retval;
  725. PyQRgb *py_QRgb;
  726. QRgb retval = self->obj->rgb();
  727. py_QRgb = PyObject_New(PyQRgb, &PyQRgb_Type);
  728. py_QRgb->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  729. py_QRgb->obj = new QRgb(retval);
  730. py_retval = Py_BuildValue((char *) "N", py_QRgb);
  731. return py_retval;
  732. }
  733. PyObject *
  734. _wrap_PyQColor_rgba(PyQColor *self)
  735. {
  736. PyObject *py_retval;
  737. PyQRgb *py_QRgb;
  738. QRgb retval = self->obj->rgba();
  739. py_QRgb = PyObject_New(PyQRgb, &PyQRgb_Type);
  740. py_QRgb->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  741. py_QRgb->obj = new QRgb(retval);
  742. py_retval = Py_BuildValue((char *) "N", py_QRgb);
  743. return py_retval;
  744. }
  745. static PyMethodDef PyQColor_methods[] = {
  746. {(char *) "rgb", (PyCFunction) _wrap_PyQColor_rgb, METH_NOARGS, NULL },
  747. {(char *) "rgba", (PyCFunction) _wrap_PyQColor_rgba, METH_NOARGS, NULL },
  748. {NULL, NULL, 0, NULL}
  749. };
  750. static void
  751. _wrap_PyQColor__tp_dealloc(PyQColor *self)
  752. {
  753. QColor *tmp = self->obj;
  754. self->obj = NULL;
  755. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  756. delete tmp;
  757. }
  758. self->ob_type->tp_free((PyObject*)self);
  759. }
  760. static PyObject*
  761. _wrap_PyQColor__tp_richcompare (PyQColor *PYBINDGEN_UNUSED(self), PyQColor *other, int opid)
  762. {
  763. if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyQColor_Type)) {
  764. Py_INCREF(Py_NotImplemented);
  765. return Py_NotImplemented;
  766. }
  767. switch (opid)
  768. {
  769. case Py_LT:
  770. Py_INCREF(Py_NotImplemented);
  771. return Py_NotImplemented;
  772. case Py_LE:
  773. Py_INCREF(Py_NotImplemented);
  774. return Py_NotImplemented;
  775. case Py_EQ:
  776. Py_INCREF(Py_NotImplemented);
  777. return Py_NotImplemented;
  778. case Py_NE:
  779. Py_INCREF(Py_NotImplemented);
  780. return Py_NotImplemented;
  781. case Py_GE:
  782. Py_INCREF(Py_NotImplemented);
  783. return Py_NotImplemented;
  784. case Py_GT:
  785. Py_INCREF(Py_NotImplemented);
  786. return Py_NotImplemented;
  787. } /* closes switch (opid) */
  788. Py_INCREF(Py_NotImplemented);
  789. return Py_NotImplemented;
  790. }
  791. PyTypeObject PyQColor_Type = {
  792. PyObject_HEAD_INIT(NULL)
  793. 0, /* ob_size */
  794. (char *) "tiled.qt.QColor", /* tp_name */
  795. sizeof(PyQColor), /* tp_basicsize */
  796. 0, /* tp_itemsize */
  797. /* methods */
  798. (destructor)_wrap_PyQColor__tp_dealloc, /* tp_dealloc */
  799. (printfunc)0, /* tp_print */
  800. (getattrfunc)NULL, /* tp_getattr */
  801. (setattrfunc)NULL, /* tp_setattr */
  802. (cmpfunc)NULL, /* tp_compare */
  803. (reprfunc)NULL, /* tp_repr */
  804. (PyNumberMethods*)NULL, /* tp_as_number */
  805. (PySequenceMethods*)NULL, /* tp_as_sequence */
  806. (PyMappingMethods*)NULL, /* tp_as_mapping */
  807. (hashfunc)NULL, /* tp_hash */
  808. (ternaryfunc)NULL, /* tp_call */
  809. (reprfunc)NULL, /* tp_str */
  810. (getattrofunc)NULL, /* tp_getattro */
  811. (setattrofunc)NULL, /* tp_setattro */
  812. (PyBufferProcs*)NULL, /* tp_as_buffer */
  813. Py_TPFLAGS_DEFAULT, /* tp_flags */
  814. NULL, /* Documentation string */
  815. (traverseproc)NULL, /* tp_traverse */
  816. (inquiry)NULL, /* tp_clear */
  817. (richcmpfunc)_wrap_PyQColor__tp_richcompare, /* tp_richcompare */
  818. 0, /* tp_weaklistoffset */
  819. (getiterfunc)NULL, /* tp_iter */
  820. (iternextfunc)NULL, /* tp_iternext */
  821. (struct PyMethodDef*)PyQColor_methods, /* tp_methods */
  822. (struct PyMemberDef*)0, /* tp_members */
  823. 0, /* tp_getset */
  824. NULL, /* tp_base */
  825. NULL, /* tp_dict */
  826. (descrgetfunc)NULL, /* tp_descr_get */
  827. (descrsetfunc)NULL, /* tp_descr_set */
  828. 0, /* tp_dictoffset */
  829. (initproc)_wrap_PyQColor__tp_init, /* tp_init */
  830. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  831. (newfunc)PyType_GenericNew, /* tp_new */
  832. (freefunc)0, /* tp_free */
  833. (inquiry)NULL, /* tp_is_gc */
  834. NULL, /* tp_bases */
  835. NULL, /* tp_mro */
  836. NULL, /* tp_cache */
  837. NULL, /* tp_subclasses */
  838. NULL, /* tp_weaklist */
  839. (destructor) NULL /* tp_del */
  840. };
  841. static int
  842. _wrap_PyQImage__tp_init__0(PyQImage *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  843. {
  844. const char *keywords[] = {NULL};
  845. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "", (char **) keywords)) {
  846. {
  847. PyObject *exc_type, *traceback;
  848. PyErr_Fetch(&exc_type, return_exception, &traceback);
  849. Py_XDECREF(exc_type);
  850. Py_XDECREF(traceback);
  851. }
  852. return -1;
  853. }
  854. self->obj = new QImage();
  855. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  856. return 0;
  857. }
  858. static int
  859. _wrap_PyQImage__tp_init__1(PyQImage *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  860. {
  861. int w;
  862. int h;
  863. QImage::Format f;
  864. const char *keywords[] = {"w", "h", "f", NULL};
  865. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "iii", (char **) keywords, &w, &h, &f)) {
  866. {
  867. PyObject *exc_type, *traceback;
  868. PyErr_Fetch(&exc_type, return_exception, &traceback);
  869. Py_XDECREF(exc_type);
  870. Py_XDECREF(traceback);
  871. }
  872. return -1;
  873. }
  874. self->obj = new QImage(w, h, f);
  875. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  876. return 0;
  877. }
  878. int _wrap_PyQImage__tp_init(PyQImage *self, PyObject *args, PyObject *kwargs)
  879. {
  880. int retval;
  881. PyObject *error_list;
  882. PyObject *exceptions[2] = {0,};
  883. retval = _wrap_PyQImage__tp_init__0(self, args, kwargs, &exceptions[0]);
  884. if (!exceptions[0]) {
  885. return retval;
  886. }
  887. retval = _wrap_PyQImage__tp_init__1(self, args, kwargs, &exceptions[1]);
  888. if (!exceptions[1]) {
  889. Py_DECREF(exceptions[0]);
  890. return retval;
  891. }
  892. error_list = PyList_New(2);
  893. PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
  894. Py_DECREF(exceptions[0]);
  895. PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
  896. Py_DECREF(exceptions[1]);
  897. PyErr_SetObject(PyExc_TypeError, error_list);
  898. Py_DECREF(error_list);
  899. return -1;
  900. }
  901. PyObject *
  902. _wrap_PyQImage_load(PyQImage *self, PyObject *args, PyObject *kwargs)
  903. {
  904. PyObject *py_retval;
  905. bool retval;
  906. const char *fileName;
  907. Py_ssize_t fileName_len;
  908. char *fmt;
  909. const char *keywords[] = {"fileName", "fmt", NULL};
  910. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#s", (char **) keywords, &fileName, &fileName_len, &fmt)) {
  911. return NULL;
  912. }
  913. retval = self->obj->load(QString::fromUtf8(fileName), fmt);
  914. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  915. return py_retval;
  916. }
  917. PyObject *
  918. _wrap_PyQImage_setColor(PyQImage *self, PyObject *args, PyObject *kwargs)
  919. {
  920. PyObject *py_retval;
  921. int i;
  922. PyQRgb *c;
  923. const char *keywords[] = {"i", "c", NULL};
  924. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "iO!", (char **) keywords, &i, &PyQRgb_Type, &c)) {
  925. return NULL;
  926. }
  927. self->obj->setColor(i, *((PyQRgb *) c)->obj);
  928. Py_INCREF(Py_None);
  929. py_retval = Py_None;
  930. return py_retval;
  931. }
  932. PyObject *
  933. _wrap_PyQImage_color(PyQImage *self, PyObject *args, PyObject *kwargs)
  934. {
  935. PyObject *py_retval;
  936. int i;
  937. const char *keywords[] = {"i", NULL};
  938. PyQRgb *py_QRgb;
  939. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &i)) {
  940. return NULL;
  941. }
  942. QRgb retval = self->obj->color(i);
  943. py_QRgb = PyObject_New(PyQRgb, &PyQRgb_Type);
  944. py_QRgb->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  945. py_QRgb->obj = new QRgb(retval);
  946. py_retval = Py_BuildValue((char *) "N", py_QRgb);
  947. return py_retval;
  948. }
  949. PyObject *
  950. _wrap_PyQImage_mirrored(PyQImage *self, PyObject *args, PyObject *kwargs)
  951. {
  952. PyObject *py_retval;
  953. bool horiz;
  954. PyObject *py_horiz;
  955. bool vert;
  956. PyObject *py_vert;
  957. const char *keywords[] = {"horiz", "vert", NULL};
  958. PyQImage *py_QImage;
  959. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "OO", (char **) keywords, &py_horiz, &py_vert)) {
  960. return NULL;
  961. }
  962. horiz = (bool) PyObject_IsTrue(py_horiz);
  963. vert = (bool) PyObject_IsTrue(py_vert);
  964. QImage const & retval = self->obj->mirrored(horiz, vert);
  965. py_QImage = PyObject_New(PyQImage, &PyQImage_Type);
  966. py_QImage->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  967. py_QImage->obj = new QImage(retval);
  968. py_retval = Py_BuildValue((char *) "N", py_QImage);
  969. return py_retval;
  970. }
  971. PyObject *
  972. _wrap_PyQImage_height(PyQImage *self)
  973. {
  974. PyObject *py_retval;
  975. int retval;
  976. retval = self->obj->height();
  977. py_retval = Py_BuildValue((char *) "i", retval);
  978. return py_retval;
  979. }
  980. PyObject *
  981. _wrap_PyQImage_setPixel__0(PyQImage *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  982. {
  983. PyObject *py_retval;
  984. int x;
  985. int y;
  986. unsigned int color;
  987. const char *keywords[] = {"x", "y", "color", NULL};
  988. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "iiI", (char **) keywords, &x, &y, &color)) {
  989. {
  990. PyObject *exc_type, *traceback;
  991. PyErr_Fetch(&exc_type, return_exception, &traceback);
  992. Py_XDECREF(exc_type);
  993. Py_XDECREF(traceback);
  994. }
  995. return NULL;
  996. }
  997. self->obj->setPixel(x, y, color);
  998. Py_INCREF(Py_None);
  999. py_retval = Py_None;
  1000. return py_retval;
  1001. }
  1002. PyObject *
  1003. _wrap_PyQImage_setPixel__1(PyQImage *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  1004. {
  1005. PyObject *py_retval;
  1006. int x;
  1007. int y;
  1008. PyQRgb *color;
  1009. const char *keywords[] = {"x", "y", "color", NULL};
  1010. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "iiO!", (char **) keywords, &x, &y, &PyQRgb_Type, &color)) {
  1011. {
  1012. PyObject *exc_type, *traceback;
  1013. PyErr_Fetch(&exc_type, return_exception, &traceback);
  1014. Py_XDECREF(exc_type);
  1015. Py_XDECREF(traceback);
  1016. }
  1017. return NULL;
  1018. }
  1019. self->obj->setPixel(x, y, *((PyQRgb *) color)->obj);
  1020. Py_INCREF(Py_None);
  1021. py_retval = Py_None;
  1022. return py_retval;
  1023. }
  1024. PyObject * _wrap_PyQImage_setPixel(PyQImage *self, PyObject *args, PyObject *kwargs)
  1025. {
  1026. PyObject * retval;
  1027. PyObject *error_list;
  1028. PyObject *exceptions[2] = {0,};
  1029. retval = _wrap_PyQImage_setPixel__0(self, args, kwargs, &exceptions[0]);
  1030. if (!exceptions[0]) {
  1031. return retval;
  1032. }
  1033. retval = _wrap_PyQImage_setPixel__1(self, args, kwargs, &exceptions[1]);
  1034. if (!exceptions[1]) {
  1035. Py_DECREF(exceptions[0]);
  1036. return retval;
  1037. }
  1038. error_list = PyList_New(2);
  1039. PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
  1040. Py_DECREF(exceptions[0]);
  1041. PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
  1042. Py_DECREF(exceptions[1]);
  1043. PyErr_SetObject(PyExc_TypeError, error_list);
  1044. Py_DECREF(error_list);
  1045. return NULL;
  1046. }
  1047. PyObject *
  1048. _wrap_PyQImage_width(PyQImage *self)
  1049. {
  1050. PyObject *py_retval;
  1051. int retval;
  1052. retval = self->obj->width();
  1053. py_retval = Py_BuildValue((char *) "i", retval);
  1054. return py_retval;
  1055. }
  1056. PyObject *
  1057. _wrap_PyQImage_colorTable(PyQImage *self)
  1058. {
  1059. PyObject *py_retval;
  1060. QVector< QRgb > retval;
  1061. PyQVector__lt__QRgb__gt__ *py_QVector__lt__QRgb__gt__;
  1062. retval = self->obj->colorTable();
  1063. py_QVector__lt__QRgb__gt__ = PyObject_New(PyQVector__lt__QRgb__gt__, &PyQVector__lt__QRgb__gt___Type);
  1064. py_QVector__lt__QRgb__gt__->obj = new QVector<QRgb>(retval);
  1065. py_retval = Py_BuildValue((char *) "N", py_QVector__lt__QRgb__gt__);
  1066. return py_retval;
  1067. }
  1068. PyObject *
  1069. _wrap_PyQImage_setColorTable(PyQImage *self, PyObject *args, PyObject *kwargs)
  1070. {
  1071. PyObject *py_retval;
  1072. QVector<QRgb> colors_value;
  1073. const char *keywords[] = {"colors", NULL};
  1074. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O&", (char **) keywords, _wrap_convert_py2c__QVector__lt___QRgb___gt__, &colors_value)) {
  1075. return NULL;
  1076. }
  1077. self->obj->setColorTable(colors_value);
  1078. Py_INCREF(Py_None);
  1079. py_retval = Py_None;
  1080. return py_retval;
  1081. }
  1082. PyObject *
  1083. _wrap_PyQImage_fill(PyQImage *self, PyObject *args, PyObject *kwargs)
  1084. {
  1085. PyObject *py_retval;
  1086. int color;
  1087. const char *keywords[] = {"color", NULL};
  1088. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &color)) {
  1089. return NULL;
  1090. }
  1091. self->obj->fill(color);
  1092. Py_INCREF(Py_None);
  1093. py_retval = Py_None;
  1094. return py_retval;
  1095. }
  1096. static PyMethodDef PyQImage_methods[] = {
  1097. {(char *) "load", (PyCFunction) _wrap_PyQImage_load, METH_KEYWORDS|METH_VARARGS, NULL },
  1098. {(char *) "setColor", (PyCFunction) _wrap_PyQImage_setColor, METH_KEYWORDS|METH_VARARGS, NULL },
  1099. {(char *) "color", (PyCFunction) _wrap_PyQImage_color, METH_KEYWORDS|METH_VARARGS, NULL },
  1100. {(char *) "mirrored", (PyCFunction) _wrap_PyQImage_mirrored, METH_KEYWORDS|METH_VARARGS, NULL },
  1101. {(char *) "height", (PyCFunction) _wrap_PyQImage_height, METH_NOARGS, NULL },
  1102. {(char *) "setPixel", (PyCFunction) _wrap_PyQImage_setPixel, METH_KEYWORDS|METH_VARARGS, NULL },
  1103. {(char *) "width", (PyCFunction) _wrap_PyQImage_width, METH_NOARGS, NULL },
  1104. {(char *) "colorTable", (PyCFunction) _wrap_PyQImage_colorTable, METH_NOARGS, NULL },
  1105. {(char *) "setColorTable", (PyCFunction) _wrap_PyQImage_setColorTable, METH_KEYWORDS|METH_VARARGS, NULL },
  1106. {(char *) "fill", (PyCFunction) _wrap_PyQImage_fill, METH_KEYWORDS|METH_VARARGS, NULL },
  1107. {NULL, NULL, 0, NULL}
  1108. };
  1109. static void
  1110. _wrap_PyQImage__tp_dealloc(PyQImage *self)
  1111. {
  1112. QImage *tmp = self->obj;
  1113. self->obj = NULL;
  1114. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  1115. delete tmp;
  1116. }
  1117. self->ob_type->tp_free((PyObject*)self);
  1118. }
  1119. static PyObject*
  1120. _wrap_PyQImage__tp_richcompare (PyQImage *PYBINDGEN_UNUSED(self), PyQImage *other, int opid)
  1121. {
  1122. if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyQImage_Type)) {
  1123. Py_INCREF(Py_NotImplemented);
  1124. return Py_NotImplemented;
  1125. }
  1126. switch (opid)
  1127. {
  1128. case Py_LT:
  1129. Py_INCREF(Py_NotImplemented);
  1130. return Py_NotImplemented;
  1131. case Py_LE:
  1132. Py_INCREF(Py_NotImplemented);
  1133. return Py_NotImplemented;
  1134. case Py_EQ:
  1135. Py_INCREF(Py_NotImplemented);
  1136. return Py_NotImplemented;
  1137. case Py_NE:
  1138. Py_INCREF(Py_NotImplemented);
  1139. return Py_NotImplemented;
  1140. case Py_GE:
  1141. Py_INCREF(Py_NotImplemented);
  1142. return Py_NotImplemented;
  1143. case Py_GT:
  1144. Py_INCREF(Py_NotImplemented);
  1145. return Py_NotImplemented;
  1146. } /* closes switch (opid) */
  1147. Py_INCREF(Py_NotImplemented);
  1148. return Py_NotImplemented;
  1149. }
  1150. PyTypeObject PyQImage_Type = {
  1151. PyObject_HEAD_INIT(NULL)
  1152. 0, /* ob_size */
  1153. (char *) "tiled.qt.QImage", /* tp_name */
  1154. sizeof(PyQImage), /* tp_basicsize */
  1155. 0, /* tp_itemsize */
  1156. /* methods */
  1157. (destructor)_wrap_PyQImage__tp_dealloc, /* tp_dealloc */
  1158. (printfunc)0, /* tp_print */
  1159. (getattrfunc)NULL, /* tp_getattr */
  1160. (setattrfunc)NULL, /* tp_setattr */
  1161. (cmpfunc)NULL, /* tp_compare */
  1162. (reprfunc)NULL, /* tp_repr */
  1163. (PyNumberMethods*)NULL, /* tp_as_number */
  1164. (PySequenceMethods*)NULL, /* tp_as_sequence */
  1165. (PyMappingMethods*)NULL, /* tp_as_mapping */
  1166. (hashfunc)NULL, /* tp_hash */
  1167. (ternaryfunc)NULL, /* tp_call */
  1168. (reprfunc)NULL, /* tp_str */
  1169. (getattrofunc)NULL, /* tp_getattro */
  1170. (setattrofunc)NULL, /* tp_setattro */
  1171. (PyBufferProcs*)NULL, /* tp_as_buffer */
  1172. Py_TPFLAGS_DEFAULT, /* tp_flags */
  1173. NULL, /* Documentation string */
  1174. (traverseproc)NULL, /* tp_traverse */
  1175. (inquiry)NULL, /* tp_clear */
  1176. (richcmpfunc)_wrap_PyQImage__tp_richcompare, /* tp_richcompare */
  1177. 0, /* tp_weaklistoffset */
  1178. (getiterfunc)NULL, /* tp_iter */
  1179. (iternextfunc)NULL, /* tp_iternext */
  1180. (struct PyMethodDef*)PyQImage_methods, /* tp_methods */
  1181. (struct PyMemberDef*)0, /* tp_members */
  1182. 0, /* tp_getset */
  1183. NULL, /* tp_base */
  1184. NULL, /* tp_dict */
  1185. (descrgetfunc)NULL, /* tp_descr_get */
  1186. (descrsetfunc)NULL, /* tp_descr_set */
  1187. 0, /* tp_dictoffset */
  1188. (initproc)_wrap_PyQImage__tp_init, /* tp_init */
  1189. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  1190. (newfunc)PyType_GenericNew, /* tp_new */
  1191. (freefunc)0, /* tp_free */
  1192. (inquiry)NULL, /* tp_is_gc */
  1193. NULL, /* tp_bases */
  1194. NULL, /* tp_mro */
  1195. NULL, /* tp_cache */
  1196. NULL, /* tp_subclasses */
  1197. NULL, /* tp_weaklist */
  1198. (destructor) NULL /* tp_del */
  1199. };
  1200. static int
  1201. _wrap_PyQPixmap__tp_init(void)
  1202. {
  1203. PyErr_SetString(PyExc_TypeError, "class 'QPixmap' cannot be constructed ()");
  1204. return -1;
  1205. }
  1206. PyObject *
  1207. _wrap_PyQPixmap_convertFromImage(PyQPixmap *self, PyObject *args, PyObject *kwargs)
  1208. {
  1209. PyObject *py_retval;
  1210. PyQImage *image;
  1211. const char *keywords[] = {"image", NULL};
  1212. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQImage_Type, &image)) {
  1213. return NULL;
  1214. }
  1215. self->obj->convertFromImage(*((PyQImage *) image)->obj);
  1216. Py_INCREF(Py_None);
  1217. py_retval = Py_None;
  1218. return py_retval;
  1219. }
  1220. PyObject *
  1221. _wrap_PyQPixmap_width(PyQPixmap *self)
  1222. {
  1223. PyObject *py_retval;
  1224. int retval;
  1225. retval = self->obj->width();
  1226. py_retval = Py_BuildValue((char *) "i", retval);
  1227. return py_retval;
  1228. }
  1229. PyObject *
  1230. _wrap_PyQPixmap_toImage(PyQPixmap *self)
  1231. {
  1232. PyObject *py_retval;
  1233. PyQImage *py_QImage;
  1234. QImage const & retval = self->obj->toImage();
  1235. py_QImage = PyObject_New(PyQImage, &PyQImage_Type);
  1236. py_QImage->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  1237. py_QImage->obj = new QImage(retval);
  1238. py_retval = Py_BuildValue((char *) "N", py_QImage);
  1239. return py_retval;
  1240. }
  1241. PyObject *
  1242. _wrap_PyQPixmap_fromImage(PyQPixmap *self, PyObject *args, PyObject *kwargs)
  1243. {
  1244. PyObject *py_retval;
  1245. PyQImage *image;
  1246. const char *keywords[] = {"image", NULL};
  1247. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQImage_Type, &image)) {
  1248. return NULL;
  1249. }
  1250. self->obj->fromImage(*((PyQImage *) image)->obj);
  1251. Py_INCREF(Py_None);
  1252. py_retval = Py_None;
  1253. return py_retval;
  1254. }
  1255. PyObject *
  1256. _wrap_PyQPixmap_height(PyQPixmap *self)
  1257. {
  1258. PyObject *py_retval;
  1259. int retval;
  1260. retval = self->obj->height();
  1261. py_retval = Py_BuildValue((char *) "i", retval);
  1262. return py_retval;
  1263. }
  1264. static PyMethodDef PyQPixmap_methods[] = {
  1265. {(char *) "convertFromImage", (PyCFunction) _wrap_PyQPixmap_convertFromImage, METH_KEYWORDS|METH_VARARGS, NULL },
  1266. {(char *) "width", (PyCFunction) _wrap_PyQPixmap_width, METH_NOARGS, NULL },
  1267. {(char *) "toImage", (PyCFunction) _wrap_PyQPixmap_toImage, METH_NOARGS, NULL },
  1268. {(char *) "fromImage", (PyCFunction) _wrap_PyQPixmap_fromImage, METH_KEYWORDS|METH_VARARGS, NULL },
  1269. {(char *) "height", (PyCFunction) _wrap_PyQPixmap_height, METH_NOARGS, NULL },
  1270. {NULL, NULL, 0, NULL}
  1271. };
  1272. static void
  1273. _wrap_PyQPixmap__tp_dealloc(PyQPixmap *self)
  1274. {
  1275. QPixmap *tmp = self->obj;
  1276. self->obj = NULL;
  1277. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  1278. delete tmp;
  1279. }
  1280. self->ob_type->tp_free((PyObject*)self);
  1281. }
  1282. static PyObject*
  1283. _wrap_PyQPixmap__tp_richcompare (PyQPixmap *PYBINDGEN_UNUSED(self), PyQPixmap *other, int opid)
  1284. {
  1285. if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyQPixmap_Type)) {
  1286. Py_INCREF(Py_NotImplemented);
  1287. return Py_NotImplemented;
  1288. }
  1289. switch (opid)
  1290. {
  1291. case Py_LT:
  1292. Py_INCREF(Py_NotImplemented);
  1293. return Py_NotImplemented;
  1294. case Py_LE:
  1295. Py_INCREF(Py_NotImplemented);
  1296. return Py_NotImplemented;
  1297. case Py_EQ:
  1298. Py_INCREF(Py_NotImplemented);
  1299. return Py_NotImplemented;
  1300. case Py_NE:
  1301. Py_INCREF(Py_NotImplemented);
  1302. return Py_NotImplemented;
  1303. case Py_GE:
  1304. Py_INCREF(Py_NotImplemented);
  1305. return Py_NotImplemented;
  1306. case Py_GT:
  1307. Py_INCREF(Py_NotImplemented);
  1308. return Py_NotImplemented;
  1309. } /* closes switch (opid) */
  1310. Py_INCREF(Py_NotImplemented);
  1311. return Py_NotImplemented;
  1312. }
  1313. PyTypeObject PyQPixmap_Type = {
  1314. PyObject_HEAD_INIT(NULL)
  1315. 0, /* ob_size */
  1316. (char *) "tiled.qt.QPixmap", /* tp_name */
  1317. sizeof(PyQPixmap), /* tp_basicsize */
  1318. 0, /* tp_itemsize */
  1319. /* methods */
  1320. (destructor)_wrap_PyQPixmap__tp_dealloc, /* tp_dealloc */
  1321. (printfunc)0, /* tp_print */
  1322. (getattrfunc)NULL, /* tp_getattr */
  1323. (setattrfunc)NULL, /* tp_setattr */
  1324. (cmpfunc)NULL, /* tp_compare */
  1325. (reprfunc)NULL, /* tp_repr */
  1326. (PyNumberMethods*)NULL, /* tp_as_number */
  1327. (PySequenceMethods*)NULL, /* tp_as_sequence */
  1328. (PyMappingMethods*)NULL, /* tp_as_mapping */
  1329. (hashfunc)NULL, /* tp_hash */
  1330. (ternaryfunc)NULL, /* tp_call */
  1331. (reprfunc)NULL, /* tp_str */
  1332. (getattrofunc)NULL, /* tp_getattro */
  1333. (setattrofunc)NULL, /* tp_setattro */
  1334. (PyBufferProcs*)NULL, /* tp_as_buffer */
  1335. Py_TPFLAGS_DEFAULT, /* tp_flags */
  1336. NULL, /* Documentation string */
  1337. (traverseproc)NULL, /* tp_traverse */
  1338. (inquiry)NULL, /* tp_clear */
  1339. (richcmpfunc)_wrap_PyQPixmap__tp_richcompare, /* tp_richcompare */
  1340. 0, /* tp_weaklistoffset */
  1341. (getiterfunc)NULL, /* tp_iter */
  1342. (iternextfunc)NULL, /* tp_iternext */
  1343. (struct PyMethodDef*)PyQPixmap_methods, /* tp_methods */
  1344. (struct PyMemberDef*)0, /* tp_members */
  1345. 0, /* tp_getset */
  1346. NULL, /* tp_base */
  1347. NULL, /* tp_dict */
  1348. (descrgetfunc)NULL, /* tp_descr_get */
  1349. (descrsetfunc)NULL, /* tp_descr_set */
  1350. 0, /* tp_dictoffset */
  1351. (initproc)_wrap_PyQPixmap__tp_init, /* tp_init */
  1352. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  1353. (newfunc)PyType_GenericNew, /* tp_new */
  1354. (freefunc)0, /* tp_free */
  1355. (inquiry)NULL, /* tp_is_gc */
  1356. NULL, /* tp_bases */
  1357. NULL, /* tp_mro */
  1358. NULL, /* tp_cache */
  1359. NULL, /* tp_subclasses */
  1360. NULL, /* tp_weaklist */
  1361. (destructor) NULL /* tp_del */
  1362. };
  1363. static int
  1364. _wrap_PyQWidget__tp_init(void)
  1365. {
  1366. PyErr_SetString(PyExc_TypeError, "class 'QWidget' cannot be constructed ()");
  1367. return -1;
  1368. }
  1369. static PyMethodDef PyQWidget_methods[] = {
  1370. {NULL, NULL, 0, NULL}
  1371. };
  1372. static void
  1373. _wrap_PyQWidget__tp_dealloc(PyQWidget *self)
  1374. {
  1375. QWidget *tmp = self->obj;
  1376. self->obj = NULL;
  1377. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  1378. delete tmp;
  1379. }
  1380. self->ob_type->tp_free((PyObject*)self);
  1381. }
  1382. static PyObject*
  1383. _wrap_PyQWidget__tp_richcompare (PyQWidget *PYBINDGEN_UNUSED(self), PyQWidget *other, int opid)
  1384. {
  1385. if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyQWidget_Type)) {
  1386. Py_INCREF(Py_NotImplemented);
  1387. return Py_NotImplemented;
  1388. }
  1389. switch (opid)
  1390. {
  1391. case Py_LT:
  1392. Py_INCREF(Py_NotImplemented);
  1393. return Py_NotImplemented;
  1394. case Py_LE:
  1395. Py_INCREF(Py_NotImplemented);
  1396. return Py_NotImplemented;
  1397. case Py_EQ:
  1398. Py_INCREF(Py_NotImplemented);
  1399. return Py_NotImplemented;
  1400. case Py_NE:
  1401. Py_INCREF(Py_NotImplemented);
  1402. return Py_NotImplemented;
  1403. case Py_GE:
  1404. Py_INCREF(Py_NotImplemented);
  1405. return Py_NotImplemented;
  1406. case Py_GT:
  1407. Py_INCREF(Py_NotImplemented);
  1408. return Py_NotImplemented;
  1409. } /* closes switch (opid) */
  1410. Py_INCREF(Py_NotImplemented);
  1411. return Py_NotImplemented;
  1412. }
  1413. PyTypeObject PyQWidget_Type = {
  1414. PyObject_HEAD_INIT(NULL)
  1415. 0, /* ob_size */
  1416. (char *) "tiled.qt.QWidget", /* tp_name */
  1417. sizeof(PyQWidget), /* tp_basicsize */
  1418. 0, /* tp_itemsize */
  1419. /* methods */
  1420. (destructor)_wrap_PyQWidget__tp_dealloc, /* tp_dealloc */
  1421. (printfunc)0, /* tp_print */
  1422. (getattrfunc)NULL, /* tp_getattr */
  1423. (setattrfunc)NULL, /* tp_setattr */
  1424. (cmpfunc)NULL, /*…

Large files files are truncated, but you can click here to view the full file