PageRenderTime 71ms CodeModel.GetById 19ms RepoModel.GetById 0ms 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
  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, /* tp_compare */
  1425. (reprfunc)NULL, /* tp_repr */
  1426. (PyNumberMethods*)NULL, /* tp_as_number */
  1427. (PySequenceMethods*)NULL, /* tp_as_sequence */
  1428. (PyMappingMethods*)NULL, /* tp_as_mapping */
  1429. (hashfunc)NULL, /* tp_hash */
  1430. (ternaryfunc)NULL, /* tp_call */
  1431. (reprfunc)NULL, /* tp_str */
  1432. (getattrofunc)NULL, /* tp_getattro */
  1433. (setattrofunc)NULL, /* tp_setattro */
  1434. (PyBufferProcs*)NULL, /* tp_as_buffer */
  1435. Py_TPFLAGS_DEFAULT, /* tp_flags */
  1436. NULL, /* Documentation string */
  1437. (traverseproc)NULL, /* tp_traverse */
  1438. (inquiry)NULL, /* tp_clear */
  1439. (richcmpfunc)_wrap_PyQWidget__tp_richcompare, /* tp_richcompare */
  1440. 0, /* tp_weaklistoffset */
  1441. (getiterfunc)NULL, /* tp_iter */
  1442. (iternextfunc)NULL, /* tp_iternext */
  1443. (struct PyMethodDef*)PyQWidget_methods, /* tp_methods */
  1444. (struct PyMemberDef*)0, /* tp_members */
  1445. 0, /* tp_getset */
  1446. NULL, /* tp_base */
  1447. NULL, /* tp_dict */
  1448. (descrgetfunc)NULL, /* tp_descr_get */
  1449. (descrsetfunc)NULL, /* tp_descr_set */
  1450. 0, /* tp_dictoffset */
  1451. (initproc)_wrap_PyQWidget__tp_init, /* tp_init */
  1452. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  1453. (newfunc)PyType_GenericNew, /* tp_new */
  1454. (freefunc)0, /* tp_free */
  1455. (inquiry)NULL, /* tp_is_gc */
  1456. NULL, /* tp_bases */
  1457. NULL, /* tp_mro */
  1458. NULL, /* tp_cache */
  1459. NULL, /* tp_subclasses */
  1460. NULL, /* tp_weaklist */
  1461. (destructor) NULL /* tp_del */
  1462. };
  1463. static int
  1464. _wrap_PyQFileDialog__tp_init(void)
  1465. {
  1466. PyErr_SetString(PyExc_TypeError, "class 'QFileDialog' cannot be constructed ()");
  1467. return -1;
  1468. }
  1469. PyObject *
  1470. _wrap_PyQFileDialog_getOpenFileName(PyQFileDialog *PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs)
  1471. {
  1472. PyObject *py_retval;
  1473. QString retval;
  1474. PyQWidget *parent;
  1475. QWidget *parent_ptr;
  1476. const char *caption;
  1477. Py_ssize_t caption_len;
  1478. const char *dir;
  1479. Py_ssize_t dir_len;
  1480. const char *filter;
  1481. Py_ssize_t filter_len;
  1482. const char *selectedFilter;
  1483. QFileDialog::Option options;
  1484. const char *keywords[] = {"parent", "caption", "dir", "filter", "selectedFilter", "options", NULL};
  1485. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "Os#s#s#|si", (char **) keywords, &parent, &caption, &caption_len, &dir, &dir_len, &filter, &filter_len, &selectedFilter, &options)) {
  1486. return NULL;
  1487. }
  1488. if (parent && ((PyObject *) parent != Py_None) && !PyObject_IsInstance((PyObject *) parent, (PyObject *) &PyQWidget_Type)) {
  1489. PyErr_SetString(PyExc_TypeError, "Parameter 1 must be of type QWidget");
  1490. return NULL;
  1491. }
  1492. if (parent) {
  1493. if ((PyObject *) parent == Py_None)
  1494. parent_ptr = NULL;
  1495. else
  1496. parent_ptr = parent->obj;
  1497. } else {
  1498. parent_ptr = NULL;
  1499. }
  1500. retval = QFileDialog::getOpenFileName(parent_ptr, QString::fromUtf8(caption), QString::fromUtf8(dir), QString::fromUtf8(filter), new QString(""), 0);
  1501. py_retval = Py_BuildValue((char *) "s", retval.toUtf8().data());
  1502. return py_retval;
  1503. }
  1504. static PyMethodDef PyQFileDialog_methods[] = {
  1505. {(char *) "getOpenFileName", (PyCFunction) _wrap_PyQFileDialog_getOpenFileName, METH_KEYWORDS|METH_VARARGS|METH_STATIC, NULL },
  1506. {NULL, NULL, 0, NULL}
  1507. };
  1508. static void
  1509. _wrap_PyQFileDialog__tp_dealloc(PyQFileDialog *self)
  1510. {
  1511. QFileDialog *tmp = self->obj;
  1512. self->obj = NULL;
  1513. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  1514. delete tmp;
  1515. }
  1516. self->ob_type->tp_free((PyObject*)self);
  1517. }
  1518. static PyObject*
  1519. _wrap_PyQFileDialog__tp_richcompare (PyQFileDialog *PYBINDGEN_UNUSED(self), PyQFileDialog *other, int opid)
  1520. {
  1521. if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyQFileDialog_Type)) {
  1522. Py_INCREF(Py_NotImplemented);
  1523. return Py_NotImplemented;
  1524. }
  1525. switch (opid)
  1526. {
  1527. case Py_LT:
  1528. Py_INCREF(Py_NotImplemented);
  1529. return Py_NotImplemented;
  1530. case Py_LE:
  1531. Py_INCREF(Py_NotImplemented);
  1532. return Py_NotImplemented;
  1533. case Py_EQ:
  1534. Py_INCREF(Py_NotImplemented);
  1535. return Py_NotImplemented;
  1536. case Py_NE:
  1537. Py_INCREF(Py_NotImplemented);
  1538. return Py_NotImplemented;
  1539. case Py_GE:
  1540. Py_INCREF(Py_NotImplemented);
  1541. return Py_NotImplemented;
  1542. case Py_GT:
  1543. Py_INCREF(Py_NotImplemented);
  1544. return Py_NotImplemented;
  1545. } /* closes switch (opid) */
  1546. Py_INCREF(Py_NotImplemented);
  1547. return Py_NotImplemented;
  1548. }
  1549. PyTypeObject PyQFileDialog_Type = {
  1550. PyObject_HEAD_INIT(NULL)
  1551. 0, /* ob_size */
  1552. (char *) "tiled.qt.QFileDialog", /* tp_name */
  1553. sizeof(PyQFileDialog), /* tp_basicsize */
  1554. 0, /* tp_itemsize */
  1555. /* methods */
  1556. (destructor)_wrap_PyQFileDialog__tp_dealloc, /* tp_dealloc */
  1557. (printfunc)0, /* tp_print */
  1558. (getattrfunc)NULL, /* tp_getattr */
  1559. (setattrfunc)NULL, /* tp_setattr */
  1560. (cmpfunc)NULL, /* tp_compare */
  1561. (reprfunc)NULL, /* tp_repr */
  1562. (PyNumberMethods*)NULL, /* tp_as_number */
  1563. (PySequenceMethods*)NULL, /* tp_as_sequence */
  1564. (PyMappingMethods*)NULL, /* tp_as_mapping */
  1565. (hashfunc)NULL, /* tp_hash */
  1566. (ternaryfunc)NULL, /* tp_call */
  1567. (reprfunc)NULL, /* tp_str */
  1568. (getattrofunc)NULL, /* tp_getattro */
  1569. (setattrofunc)NULL, /* tp_setattro */
  1570. (PyBufferProcs*)NULL, /* tp_as_buffer */
  1571. Py_TPFLAGS_DEFAULT, /* tp_flags */
  1572. NULL, /* Documentation string */
  1573. (traverseproc)NULL, /* tp_traverse */
  1574. (inquiry)NULL, /* tp_clear */
  1575. (richcmpfunc)_wrap_PyQFileDialog__tp_richcompare, /* tp_richcompare */
  1576. 0, /* tp_weaklistoffset */
  1577. (getiterfunc)NULL, /* tp_iter */
  1578. (iternextfunc)NULL, /* tp_iternext */
  1579. (struct PyMethodDef*)PyQFileDialog_methods, /* tp_methods */
  1580. (struct PyMemberDef*)0, /* tp_members */
  1581. 0, /* tp_getset */
  1582. NULL, /* tp_base */
  1583. NULL, /* tp_dict */
  1584. (descrgetfunc)NULL, /* tp_descr_get */
  1585. (descrsetfunc)NULL, /* tp_descr_set */
  1586. 0, /* tp_dictoffset */
  1587. (initproc)_wrap_PyQFileDialog__tp_init, /* tp_init */
  1588. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  1589. (newfunc)PyType_GenericNew, /* tp_new */
  1590. (freefunc)0, /* tp_free */
  1591. (inquiry)NULL, /* tp_is_gc */
  1592. NULL, /* tp_bases */
  1593. NULL, /* tp_mro */
  1594. NULL, /* tp_cache */
  1595. NULL, /* tp_subclasses */
  1596. NULL, /* tp_weaklist */
  1597. (destructor) NULL /* tp_del */
  1598. };
  1599. /* --- containers --- */
  1600. static void
  1601. PyQVector__lt__QRgb__gt__Iter__tp_clear(PyQVector__lt__QRgb__gt__Iter *self)
  1602. {
  1603. Py_CLEAR(self->container);
  1604. delete self->iterator;
  1605. self->iterator = NULL;
  1606. }
  1607. static int
  1608. PyQVector__lt__QRgb__gt__Iter__tp_traverse(PyQVector__lt__QRgb__gt__Iter *self, visitproc visit, void *arg)
  1609. {
  1610. Py_VISIT((PyObject *) self->container);
  1611. return 0;
  1612. }
  1613. static void
  1614. _wrap_PyQVector__lt__QRgb__gt____tp_dealloc(PyQVector__lt__QRgb__gt__ *self)
  1615. {
  1616. delete self->obj;
  1617. self->obj = NULL;
  1618. self->ob_type->tp_free((PyObject*)self);
  1619. }
  1620. static void
  1621. _wrap_PyQVector__lt__QRgb__gt__Iter__tp_dealloc(PyQVector__lt__QRgb__gt__Iter *self)
  1622. {
  1623. Py_CLEAR(self->container);
  1624. delete self->iterator;
  1625. self->iterator = NULL;
  1626. self->ob_type->tp_free((PyObject*)self);
  1627. }
  1628. static PyObject*
  1629. _wrap_PyQVector__lt__QRgb__gt____tp_iter(PyQVector__lt__QRgb__gt__ *self)
  1630. {
  1631. PyQVector__lt__QRgb__gt__Iter *iter = PyObject_GC_New(PyQVector__lt__QRgb__gt__Iter, &PyQVector__lt__QRgb__gt__Iter_Type);
  1632. Py_INCREF(self);
  1633. iter->container = self;
  1634. iter->iterator = new QVector<QRgb>::iterator(self->obj->begin());
  1635. return (PyObject*) iter;
  1636. }
  1637. static PyObject*
  1638. _wrap_PyQVector__lt__QRgb__gt__Iter__tp_iter(PyQVector__lt__QRgb__gt__Iter *self)
  1639. {
  1640. Py_INCREF(self);
  1641. return (PyObject*) self;
  1642. }
  1643. static PyObject* _wrap_PyQVector__lt__QRgb__gt__Iter__tp_iternext(PyQVector__lt__QRgb__gt__Iter *self)
  1644. {
  1645. PyObject *py_retval;
  1646. QVector<QRgb>::iterator iter;
  1647. PyQRgb *py_QRgb;
  1648. iter = *self->iterator;
  1649. if (iter == self->container->obj->end()) {
  1650. PyErr_SetNone(PyExc_StopIteration);
  1651. return NULL;
  1652. }
  1653. ++(*self->iterator);
  1654. py_QRgb = PyObject_New(PyQRgb, &PyQRgb_Type);
  1655. py_QRgb->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  1656. py_QRgb->obj = new QRgb((*iter));
  1657. py_retval = Py_BuildValue((char *) "N", py_QRgb);
  1658. return py_retval;
  1659. }
  1660. int _wrap_convert_py2c__QRgb(PyObject *value, QRgb *address)
  1661. {
  1662. PyObject *py_retval;
  1663. PyQRgb *tmp_QRgb;
  1664. py_retval = Py_BuildValue((char *) "(O)", value);
  1665. if (!PyArg_ParseTuple(py_retval, (char *) "O!", &PyQRgb_Type, &tmp_QRgb)) {
  1666. Py_DECREF(py_retval);
  1667. return 0;
  1668. }
  1669. *address = *tmp_QRgb->obj;
  1670. Py_DECREF(py_retval);
  1671. return 1;
  1672. }
  1673. int _wrap_convert_py2c__QVector__lt___QRgb___gt__(PyObject *arg, QVector<QRgb> *container)
  1674. {
  1675. if (PyObject_IsInstance(arg, (PyObject*) &PyQVector__lt__QRgb__gt___Type)) {
  1676. *container = *((PyQVector__lt__QRgb__gt__*)arg)->obj;
  1677. } else if (PyList_Check(arg)) {
  1678. container->clear();
  1679. Py_ssize_t size = PyList_Size(arg);
  1680. for (Py_ssize_t i = 0; i < size; i++) {
  1681. QRgb item;
  1682. if (!_wrap_convert_py2c__QRgb(PyList_GET_ITEM(arg, i), &item)) {
  1683. return 0;
  1684. }
  1685. container->push_back(item);
  1686. }
  1687. } else {
  1688. PyErr_SetString(PyExc_TypeError, "parameter must be None, a QVector__lt__QRgb__gt__ instance, or a list of QRgb");
  1689. return 0;
  1690. }
  1691. return 1;
  1692. }
  1693. static int
  1694. _wrap_PyQVector__lt__QRgb__gt____tp_init(PyQVector__lt__QRgb__gt__ *self, PyObject *args, PyObject *kwargs)
  1695. {
  1696. const char *keywords[] = {"arg", NULL};
  1697. PyObject *arg = NULL;
  1698. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "|O", (char **) keywords, &arg)) {
  1699. return -1;
  1700. }
  1701. self->obj = new QVector<QRgb>;
  1702. if (arg == NULL)
  1703. return 0;
  1704. if (!_wrap_convert_py2c__QVector__lt___QRgb___gt__(arg, self->obj)) {
  1705. delete self->obj;
  1706. self->obj = NULL;
  1707. return -1;
  1708. }
  1709. return 0;
  1710. }
  1711. PyTypeObject PyQVector__lt__QRgb__gt___Type = {
  1712. PyObject_HEAD_INIT(NULL)
  1713. 0, /* ob_size */
  1714. (char *) "tiled.qt.QVector__lt__QRgb__gt__", /* tp_name */
  1715. sizeof(PyQVector__lt__QRgb__gt__), /* tp_basicsize */
  1716. 0, /* tp_itemsize */
  1717. /* methods */
  1718. (destructor)_wrap_PyQVector__lt__QRgb__gt____tp_dealloc, /* tp_dealloc */
  1719. (printfunc)0, /* tp_print */
  1720. (getattrfunc)NULL, /* tp_getattr */
  1721. (setattrfunc)NULL, /* tp_setattr */
  1722. (cmpfunc)NULL, /* tp_compare */
  1723. (reprfunc)NULL, /* tp_repr */
  1724. (PyNumberMethods*)NULL, /* tp_as_number */
  1725. (PySequenceMethods*)NULL, /* tp_as_sequence */
  1726. (PyMappingMethods*)NULL, /* tp_as_mapping */
  1727. (hashfunc)NULL, /* tp_hash */
  1728. (ternaryfunc)NULL, /* tp_call */
  1729. (reprfunc)NULL, /* tp_str */
  1730. (getattrofunc)NULL, /* tp_getattro */
  1731. (setattrofunc)NULL, /* tp_setattro */
  1732. (PyBufferProcs*)NULL, /* tp_as_buffer */
  1733. Py_TPFLAGS_DEFAULT, /* tp_flags */
  1734. NULL, /* Documentation string */
  1735. (traverseproc)NULL, /* tp_traverse */
  1736. (inquiry)NULL, /* tp_clear */
  1737. (richcmpfunc)NULL, /* tp_richcompare */
  1738. 0, /* tp_weaklistoffset */
  1739. (getiterfunc)_wrap_PyQVector__lt__QRgb__gt____tp_iter, /* tp_iter */
  1740. (iternextfunc)NULL, /* tp_iternext */
  1741. (struct PyMethodDef*)NULL, /* tp_methods */
  1742. (struct PyMemberDef*)0, /* tp_members */
  1743. NULL, /* tp_getset */
  1744. NULL, /* tp_base */
  1745. NULL, /* tp_dict */
  1746. (descrgetfunc)NULL, /* tp_descr_get */
  1747. (descrsetfunc)NULL, /* tp_descr_set */
  1748. 0, /* tp_dictoffset */
  1749. (initproc)_wrap_PyQVector__lt__QRgb__gt____tp_init, /* tp_init */
  1750. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  1751. (newfunc)PyType_GenericNew, /* tp_new */
  1752. (freefunc)0, /* tp_free */
  1753. (inquiry)NULL, /* tp_is_gc */
  1754. NULL, /* tp_bases */
  1755. NULL, /* tp_mro */
  1756. NULL, /* tp_cache */
  1757. NULL, /* tp_subclasses */
  1758. NULL, /* tp_weaklist */
  1759. (destructor) NULL /* tp_del */
  1760. };
  1761. PyTypeObject PyQVector__lt__QRgb__gt__Iter_Type = {
  1762. PyObject_HEAD_INIT(NULL)
  1763. 0, /* ob_size */
  1764. (char *) "tiled.qt.QVector__lt__QRgb__gt__Iter", /* tp_name */
  1765. sizeof(PyQVector__lt__QRgb__gt__Iter), /* tp_basicsize */
  1766. 0, /* tp_itemsize */
  1767. /* methods */
  1768. (destructor)_wrap_PyQVector__lt__QRgb__gt__Iter__tp_dealloc, /* tp_dealloc */
  1769. (printfunc)0, /* tp_print */
  1770. (getattrfunc)NULL, /* tp_getattr */
  1771. (setattrfunc)NULL, /* tp_setattr */
  1772. (cmpfunc)NULL, /* tp_compare */
  1773. (reprfunc)NULL, /* tp_repr */
  1774. (PyNumberMethods*)NULL, /* tp_as_number */
  1775. (PySequenceMethods*)NULL, /* tp_as_sequence */
  1776. (PyMappingMethods*)NULL, /* tp_as_mapping */
  1777. (hashfunc)NULL, /* tp_hash */
  1778. (ternaryfunc)NULL, /* tp_call */
  1779. (reprfunc)NULL, /* tp_str */
  1780. (getattrofunc)NULL, /* tp_getattro */
  1781. (setattrofunc)NULL, /* tp_setattro */
  1782. (PyBufferProcs*)NULL, /* tp_as_buffer */
  1783. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC, /* tp_flags */
  1784. NULL, /* Documentation string */
  1785. (traverseproc)PyQVector__lt__QRgb__gt__Iter__tp_traverse, /* tp_traverse */
  1786. (inquiry)PyQVector__lt__QRgb__gt__Iter__tp_clear, /* tp_clear */
  1787. (richcmpfunc)NULL, /* tp_richcompare */
  1788. 0, /* tp_weaklistoffset */
  1789. (getiterfunc)_wrap_PyQVector__lt__QRgb__gt__Iter__tp_iter, /* tp_iter */
  1790. (iternextfunc)_wrap_PyQVector__lt__QRgb__gt__Iter__tp_iternext, /* tp_iternext */
  1791. (struct PyMethodDef*)NULL, /* tp_methods */
  1792. (struct PyMemberDef*)0, /* tp_members */
  1793. NULL, /* tp_getset */
  1794. NULL, /* tp_base */
  1795. NULL, /* tp_dict */
  1796. (descrgetfunc)NULL, /* tp_descr_get */
  1797. (descrsetfunc)NULL, /* tp_descr_set */
  1798. 0, /* tp_dictoffset */
  1799. (initproc)NULL, /* tp_init */
  1800. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  1801. (newfunc)PyType_GenericNew, /* tp_new */
  1802. (freefunc)0, /* tp_free */
  1803. (inquiry)NULL, /* tp_is_gc */
  1804. NULL, /* tp_bases */
  1805. NULL, /* tp_mro */
  1806. NULL, /* tp_cache */
  1807. NULL, /* tp_subclasses */
  1808. NULL, /* tp_weaklist */
  1809. (destructor) NULL /* tp_del */
  1810. };
  1811. static void
  1812. PyQList__lt__QString__gt__Iter__tp_clear(PyQList__lt__QString__gt__Iter *self)
  1813. {
  1814. Py_CLEAR(self->container);
  1815. delete self->iterator;
  1816. self->iterator = NULL;
  1817. }
  1818. static int
  1819. PyQList__lt__QString__gt__Iter__tp_traverse(PyQList__lt__QString__gt__Iter *self, visitproc visit, void *arg)
  1820. {
  1821. Py_VISIT((PyObject *) self->container);
  1822. return 0;
  1823. }
  1824. static void
  1825. _wrap_PyQList__lt__QString__gt____tp_dealloc(PyQList__lt__QString__gt__ *self)
  1826. {
  1827. delete self->obj;
  1828. self->obj = NULL;
  1829. self->ob_type->tp_free((PyObject*)self);
  1830. }
  1831. static void
  1832. _wrap_PyQList__lt__QString__gt__Iter__tp_dealloc(PyQList__lt__QString__gt__Iter *self)
  1833. {
  1834. Py_CLEAR(self->container);
  1835. delete self->iterator;
  1836. self->iterator = NULL;
  1837. self->ob_type->tp_free((PyObject*)self);
  1838. }
  1839. static PyObject*
  1840. _wrap_PyQList__lt__QString__gt____tp_iter(PyQList__lt__QString__gt__ *self)
  1841. {
  1842. PyQList__lt__QString__gt__Iter *iter = PyObject_GC_New(PyQList__lt__QString__gt__Iter, &PyQList__lt__QString__gt__Iter_Type);
  1843. Py_INCREF(self);
  1844. iter->container = self;
  1845. iter->iterator = new QList<QString>::iterator(self->obj->begin());
  1846. return (PyObject*) iter;
  1847. }
  1848. static PyObject*
  1849. _wrap_PyQList__lt__QString__gt__Iter__tp_iter(PyQList__lt__QString__gt__Iter *self)
  1850. {
  1851. Py_INCREF(self);
  1852. return (PyObject*) self;
  1853. }
  1854. static PyObject* _wrap_PyQList__lt__QString__gt__Iter__tp_iternext(PyQList__lt__QString__gt__Iter *self)
  1855. {
  1856. PyObject *py_retval;
  1857. QList<QString>::iterator iter;
  1858. iter = *self->iterator;
  1859. if (iter == self->container->obj->end()) {
  1860. PyErr_SetNone(PyExc_StopIteration);
  1861. return NULL;
  1862. }
  1863. ++(*self->iterator);
  1864. py_retval = Py_BuildValue((char *) "s", (*iter).toUtf8().data());
  1865. return py_retval;
  1866. }
  1867. int _wrap_convert_py2c__QString(PyObject *value, QString *address)
  1868. {
  1869. PyObject *py_retval;
  1870. const char *retval_ptr;
  1871. Py_ssize_t retval_len;
  1872. py_retval = Py_BuildValue((char *) "(O)", value);
  1873. if (!PyArg_ParseTuple(py_retval, (char *) "s#", &retval_ptr, &retval_len)) {
  1874. Py_DECREF(py_retval);
  1875. return 0;
  1876. }
  1877. *address = QString(retval_ptr);
  1878. Py_DECREF(py_retval);
  1879. return 1;
  1880. }
  1881. int _wrap_convert_py2c__QList__lt___QString___gt__(PyObject *arg, QList<QString> *container)
  1882. {
  1883. if (PyObject_IsInstance(arg, (PyObject*) &PyQList__lt__QString__gt___Type)) {
  1884. *container = *((PyQList__lt__QString__gt__*)arg)->obj;
  1885. } else if (PyList_Check(arg)) {
  1886. container->clear();
  1887. Py_ssize_t size = PyList_Size(arg);
  1888. for (Py_ssize_t i = 0; i < size; i++) {
  1889. QString item;
  1890. if (!_wrap_convert_py2c__QString(PyList_GET_ITEM(arg, i), &item)) {
  1891. return 0;
  1892. }
  1893. container->push_back(item);
  1894. }
  1895. } else {
  1896. PyErr_SetString(PyExc_TypeError, "parameter must be None, a QList__lt__QString__gt__ instance, or a list of QString");
  1897. return 0;
  1898. }
  1899. return 1;
  1900. }
  1901. static int
  1902. _wrap_PyQList__lt__QString__gt____tp_init(PyQList__lt__QString__gt__ *self, PyObject *args, PyObject *kwargs)
  1903. {
  1904. const char *keywords[] = {"arg", NULL};
  1905. PyObject *arg = NULL;
  1906. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "|O", (char **) keywords, &arg)) {
  1907. return -1;
  1908. }
  1909. self->obj = new QList<QString>;
  1910. if (arg == NULL)
  1911. return 0;
  1912. if (!_wrap_convert_py2c__QList__lt___QString___gt__(arg, self->obj)) {
  1913. delete self->obj;
  1914. self->obj = NULL;
  1915. return -1;
  1916. }
  1917. return 0;
  1918. }
  1919. PyTypeObject PyQList__lt__QString__gt___Type = {
  1920. PyObject_HEAD_INIT(NULL)
  1921. 0, /* ob_size */
  1922. (char *) "tiled.qt.QList__lt__QString__gt__", /* tp_name */
  1923. sizeof(PyQList__lt__QString__gt__), /* tp_basicsize */
  1924. 0, /* tp_itemsize */
  1925. /* methods */
  1926. (destructor)_wrap_PyQList__lt__QString__gt____tp_dealloc, /* tp_dealloc */
  1927. (printfunc)0, /* tp_print */
  1928. (getattrfunc)NULL, /* tp_getattr */
  1929. (setattrfunc)NULL, /* tp_setattr */
  1930. (cmpfunc)NULL, /* tp_compare */
  1931. (reprfunc)NULL, /* tp_repr */
  1932. (PyNumberMethods*)NULL, /* tp_as_number */
  1933. (PySequenceMethods*)NULL, /* tp_as_sequence */
  1934. (PyMappingMethods*)NULL, /* tp_as_mapping */
  1935. (hashfunc)NULL, /* tp_hash */
  1936. (ternaryfunc)NULL, /* tp_call */
  1937. (reprfunc)NULL, /* tp_str */
  1938. (getattrofunc)NULL, /* tp_getattro */
  1939. (setattrofunc)NULL, /* tp_setattro */
  1940. (PyBufferProcs*)NULL, /* tp_as_buffer */
  1941. Py_TPFLAGS_DEFAULT, /* tp_flags */
  1942. NULL, /* Documentation string */
  1943. (traverseproc)NULL, /* tp_traverse */
  1944. (inquiry)NULL, /* tp_clear */
  1945. (richcmpfunc)NULL, /* tp_richcompare */
  1946. 0, /* tp_weaklistoffset */
  1947. (getiterfunc)_wrap_PyQList__lt__QString__gt____tp_iter, /* tp_iter */
  1948. (iternextfunc)NULL, /* tp_iternext */
  1949. (struct PyMethodDef*)NULL, /* tp_methods */
  1950. (struct PyMemberDef*)0, /* tp_members */
  1951. NULL, /* tp_getset */
  1952. NULL, /* tp_base */
  1953. NULL, /* tp_dict */
  1954. (descrgetfunc)NULL, /* tp_descr_get */
  1955. (descrsetfunc)NULL, /* tp_descr_set */
  1956. 0, /* tp_dictoffset */
  1957. (initproc)_wrap_PyQList__lt__QString__gt____tp_init, /* tp_init */
  1958. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  1959. (newfunc)PyType_GenericNew, /* tp_new */
  1960. (freefunc)0, /* tp_free */
  1961. (inquiry)NULL, /* tp_is_gc */
  1962. NULL, /* tp_bases */
  1963. NULL, /* tp_mro */
  1964. NULL, /* tp_cache */
  1965. NULL, /* tp_subclasses */
  1966. NULL, /* tp_weaklist */
  1967. (destructor) NULL /* tp_del */
  1968. };
  1969. PyTypeObject PyQList__lt__QString__gt__Iter_Type = {
  1970. PyObject_HEAD_INIT(NULL)
  1971. 0, /* ob_size */
  1972. (char *) "tiled.qt.QList__lt__QString__gt__Iter", /* tp_name */
  1973. sizeof(PyQList__lt__QString__gt__Iter), /* tp_basicsize */
  1974. 0, /* tp_itemsize */
  1975. /* methods */
  1976. (destructor)_wrap_PyQList__lt__QString__gt__Iter__tp_dealloc, /* tp_dealloc */
  1977. (printfunc)0, /* tp_print */
  1978. (getattrfunc)NULL, /* tp_getattr */
  1979. (setattrfunc)NULL, /* tp_setattr */
  1980. (cmpfunc)NULL, /* tp_compare */
  1981. (reprfunc)NULL, /* tp_repr */
  1982. (PyNumberMethods*)NULL, /* tp_as_number */
  1983. (PySequenceMethods*)NULL, /* tp_as_sequence */
  1984. (PyMappingMethods*)NULL, /* tp_as_mapping */
  1985. (hashfunc)NULL, /* tp_hash */
  1986. (ternaryfunc)NULL, /* tp_call */
  1987. (reprfunc)NULL, /* tp_str */
  1988. (getattrofunc)NULL, /* tp_getattro */
  1989. (setattrofunc)NULL, /* tp_setattro */
  1990. (PyBufferProcs*)NULL, /* tp_as_buffer */
  1991. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC, /* tp_flags */
  1992. NULL, /* Documentation string */
  1993. (traverseproc)PyQList__lt__QString__gt__Iter__tp_traverse, /* tp_traverse */
  1994. (inquiry)PyQList__lt__QString__gt__Iter__tp_clear, /* tp_clear */
  1995. (richcmpfunc)NULL, /* tp_richcompare */
  1996. 0, /* tp_weaklistoffset */
  1997. (getiterfunc)_wrap_PyQList__lt__QString__gt__Iter__tp_iter, /* tp_iter */
  1998. (iternextfunc)_wrap_PyQList__lt__QString__gt__Iter__tp_iternext, /* tp_iternext */
  1999. (struct PyMethodDef*)NULL, /* tp_methods */
  2000. (struct PyMemberDef*)0, /* tp_members */
  2001. NULL, /* tp_getset */
  2002. NULL, /* tp_base */
  2003. NULL, /* tp_dict */
  2004. (descrgetfunc)NULL, /* tp_descr_get */
  2005. (descrsetfunc)NULL, /* tp_descr_set */
  2006. 0, /* tp_dictoffset */
  2007. (initproc)NULL, /* tp_init */
  2008. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  2009. (newfunc)PyType_GenericNew, /* tp_new */
  2010. (freefunc)0, /* tp_free */
  2011. (inquiry)NULL, /* tp_is_gc */
  2012. NULL, /* tp_bases */
  2013. NULL, /* tp_mro */
  2014. NULL, /* tp_cache */
  2015. NULL, /* tp_subclasses */
  2016. NULL, /* tp_weaklist */
  2017. (destructor) NULL /* tp_del */
  2018. };
  2019. /* --- enumerations --- */
  2020. bool isImageLayerAt(Tiled::Map *map, int idx) {
  2021. return (dynamic_cast<const Tiled::ImageLayer*>(map->layerAt(idx)) != 0);
  2022. }
  2023. bool isTileLayerAt(Tiled::Map *map, int idx) {
  2024. return (dynamic_cast<const Tiled::TileLayer*>(map->layerAt(idx)) != 0);
  2025. }
  2026. bool isObjectGroupAt(Tiled::Map *map, int idx) {
  2027. return (dynamic_cast<const Tiled::ObjectGroup*>(map->layerAt(idx)) != 0);
  2028. }
  2029. Tiled::ImageLayer* imageLayerAt(Tiled::Map *map, int idx) {
  2030. return static_cast<Tiled::ImageLayer*>(map->layerAt(idx));
  2031. }
  2032. Tiled::TileLayer* tileLayerAt(Tiled::Map *map, int idx) {
  2033. return static_cast<Tiled::TileLayer*>(map->layerAt(idx));
  2034. }
  2035. Tiled::ObjectGroup* objectGroupAt(Tiled::Map *map, int idx) {
  2036. return static_cast<Tiled::ObjectGroup*>(map->layerAt(idx));
  2037. }
  2038. bool loadTilesetFromFile(Tiled::Tileset *ts, QString file)
  2039. {
  2040. QImage img(file);
  2041. return ts->loadFromImage(img, file);
  2042. }
  2043. static PyObject *
  2044. inittiled_qt(void)
  2045. {
  2046. PyObject *m;
  2047. m = Py_InitModule3((char *) "tiled.qt", tiled_qt_functions, NULL);
  2048. if (m == NULL) {
  2049. return NULL;
  2050. }
  2051. /* Register the 'QPointF' class */
  2052. if (PyType_Ready(&PyQPointF_Type)) {
  2053. return NULL;
  2054. }
  2055. PyModule_AddObject(m, (char *) "QPointF", (PyObject *) &PyQPointF_Type);
  2056. /* Register the 'QSizeF' class */
  2057. if (PyType_Ready(&PyQSizeF_Type)) {
  2058. return NULL;
  2059. }
  2060. PyModule_AddObject(m, (char *) "QSizeF", (PyObject *) &PyQSizeF_Type);
  2061. /* Register the 'QRgb' class */
  2062. if (PyType_Ready(&PyQRgb_Type)) {
  2063. return NULL;
  2064. }
  2065. PyModule_AddObject(m, (char *) "QRgb", (PyObject *) &PyQRgb_Type);
  2066. /* Register the 'QColor' class */
  2067. if (PyType_Ready(&PyQColor_Type)) {
  2068. return NULL;
  2069. }
  2070. PyModule_AddObject(m, (char *) "QColor", (PyObject *) &PyQColor_Type);
  2071. /* Register the 'QImage' class */
  2072. if (PyType_Ready(&PyQImage_Type)) {
  2073. return NULL;
  2074. }
  2075. PyModule_AddObject(m, (char *) "QImage", (PyObject *) &PyQImage_Type);
  2076. /* Register the 'QPixmap' class */
  2077. if (PyType_Ready(&PyQPixmap_Type)) {
  2078. return NULL;
  2079. }
  2080. PyModule_AddObject(m, (char *) "QPixmap", (PyObject *) &PyQPixmap_Type);
  2081. /* Register the 'QWidget' class */
  2082. if (PyType_Ready(&PyQWidget_Type)) {
  2083. return NULL;
  2084. }
  2085. PyModule_AddObject(m, (char *) "QWidget", (PyObject *) &PyQWidget_Type);
  2086. /* Register the 'QFileDialog' class */
  2087. if (PyType_Ready(&PyQFileDialog_Type)) {
  2088. return NULL;
  2089. }
  2090. PyModule_AddObject(m, (char *) "QFileDialog", (PyObject *) &PyQFileDialog_Type);
  2091. /* Register the 'QVector<QRgb>' class */
  2092. if (PyType_Ready(&PyQVector__lt__QRgb__gt___Type)) {
  2093. return NULL;
  2094. }
  2095. if (PyType_Ready(&PyQVector__lt__QRgb__gt__Iter_Type)) {
  2096. return NULL;
  2097. }
  2098. PyModule_AddObject(m, (char *) "QVector__lt__QRgb__gt__", (PyObject *) &PyQVector__lt__QRgb__gt___Type);
  2099. PyModule_AddObject(m, (char *) "QVector__lt__QRgb__gt__Iter", (PyObject *) &PyQVector__lt__QRgb__gt__Iter_Type);
  2100. /* Register the 'QList<QString>' class */
  2101. if (PyType_Ready(&PyQList__lt__QString__gt___Type)) {
  2102. return NULL;
  2103. }
  2104. if (PyType_Ready(&PyQList__lt__QString__gt__Iter_Type)) {
  2105. return NULL;
  2106. }
  2107. PyModule_AddObject(m, (char *) "QList__lt__QString__gt__", (PyObject *) &PyQList__lt__QString__gt___Type);
  2108. PyModule_AddObject(m, (char *) "QList__lt__QString__gt__Iter", (PyObject *) &PyQList__lt__QString__gt__Iter_Type);
  2109. {
  2110. PyObject *tmp_value;
  2111. // QImage::Format_Invalid
  2112. tmp_value = PyInt_FromLong(QImage::Format_Invalid);
  2113. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_Invalid", tmp_value);
  2114. Py_DECREF(tmp_value);
  2115. // QImage::Format_Mono
  2116. tmp_value = PyInt_FromLong(QImage::Format_Mono);
  2117. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_Mono", tmp_value);
  2118. Py_DECREF(tmp_value);
  2119. // QImage::Format_MonoLSB
  2120. tmp_value = PyInt_FromLong(QImage::Format_MonoLSB);
  2121. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_MonoLSB", tmp_value);
  2122. Py_DECREF(tmp_value);
  2123. // QImage::Format_Indexed8
  2124. tmp_value = PyInt_FromLong(QImage::Format_Indexed8);
  2125. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_Indexed8", tmp_value);
  2126. Py_DECREF(tmp_value);
  2127. // QImage::Format_RGB32
  2128. tmp_value = PyInt_FromLong(QImage::Format_RGB32);
  2129. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_RGB32", tmp_value);
  2130. Py_DECREF(tmp_value);
  2131. // QImage::Format_ARGB32
  2132. tmp_value = PyInt_FromLong(QImage::Format_ARGB32);
  2133. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_ARGB32", tmp_value);
  2134. Py_DECREF(tmp_value);
  2135. // QImage::Format_ARGB32_Premultiplied
  2136. tmp_value = PyInt_FromLong(QImage::Format_ARGB32_Premultiplied);
  2137. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_ARGB32_Premultiplied", tmp_value);
  2138. Py_DECREF(tmp_value);
  2139. // QImage::Format_RGB16
  2140. tmp_value = PyInt_FromLong(QImage::Format_RGB16);
  2141. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_RGB16", tmp_value);
  2142. Py_DECREF(tmp_value);
  2143. // QImage::Format_ARGB8565_Premultiplied
  2144. tmp_value = PyInt_FromLong(QImage::Format_ARGB8565_Premultiplied);
  2145. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_ARGB8565_Premultiplied", tmp_value);
  2146. Py_DECREF(tmp_value);
  2147. // QImage::Format_RGB666
  2148. tmp_value = PyInt_FromLong(QImage::Format_RGB666);
  2149. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_RGB666", tmp_value);
  2150. Py_DECREF(tmp_value);
  2151. // QImage::Format_ARGB6666_Premultiplied
  2152. tmp_value = PyInt_FromLong(QImage::Format_ARGB6666_Premultiplied);
  2153. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_ARGB6666_Premultiplied", tmp_value);
  2154. Py_DECREF(tmp_value);
  2155. // QImage::Format_RGB555
  2156. tmp_value = PyInt_FromLong(QImage::Format_RGB555);
  2157. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_RGB555", tmp_value);
  2158. Py_DECREF(tmp_value);
  2159. // QImage::Format_ARGB8555_Premultiplied
  2160. tmp_value = PyInt_FromLong(QImage::Format_ARGB8555_Premultiplied);
  2161. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_ARGB8555_Premultiplied", tmp_value);
  2162. Py_DECREF(tmp_value);
  2163. // QImage::Format_RGB888
  2164. tmp_value = PyInt_FromLong(QImage::Format_RGB888);
  2165. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_RGB888", tmp_value);
  2166. Py_DECREF(tmp_value);
  2167. // QImage::Format_RGB444
  2168. tmp_value = PyInt_FromLong(QImage::Format_RGB444);
  2169. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_RGB444", tmp_value);
  2170. Py_DECREF(tmp_value);
  2171. // QImage::Format_ARGB4444_Premultiplied
  2172. tmp_value = PyInt_FromLong(QImage::Format_ARGB4444_Premultiplied);
  2173. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_ARGB4444_Premultiplied", tmp_value);
  2174. Py_DECREF(tmp_value);
  2175. }
  2176. {
  2177. PyObject *tmp_value;
  2178. // QFileDialog::ShowDirsOnly
  2179. tmp_value = PyInt_FromLong(QFileDialog::ShowDirsOnly);
  2180. PyDict_SetItemString((PyObject*) PyQFileDialog_Type.tp_dict, "ShowDirsOnly", tmp_value);
  2181. Py_DECREF(tmp_value);
  2182. // QFileDialog::DontResolveSymlinks
  2183. tmp_value = PyInt_FromLong(QFileDialog::DontResolveSymlinks);
  2184. PyDict_SetItemString((PyObject*) PyQFileDialog_Type.tp_dict, "DontResolveSymlinks", tmp_value);
  2185. Py_DECREF(tmp_value);
  2186. // QFileDialog::DontConfirmOverwrite
  2187. tmp_value = PyInt_FromLong(QFileDialog::DontConfirmOverwrite);
  2188. PyDict_SetItemString((PyObject*) PyQFileDialog_Type.tp_dict, "DontConfirmOverwrite", tmp_value);
  2189. Py_DECREF(tmp_value);
  2190. // QFileDialog::DontUseNativeDialog
  2191. tmp_value = PyInt_FromLong(QFileDialog::DontUseNativeDialog);
  2192. PyDict_SetItemString((PyObject*) PyQFileDialog_Type.tp_dict, "DontUseNativeDialog", tmp_value);
  2193. Py_DECREF(tmp_value);
  2194. // QFileDialog::ReadOnly
  2195. tmp_value = PyInt_FromLong(QFileDialog::ReadOnly);
  2196. PyDict_SetItemString((PyObject*) PyQFileDialog_Type.tp_dict, "ReadOnly", tmp_value);
  2197. Py_DECREF(tmp_value);
  2198. // QFileDialog::HideNameFilterDetails
  2199. tmp_value = PyInt_FromLong(QFileDialog::HideNameFilterDetails);
  2200. PyDict_SetItemString((PyObject*) PyQFileDialog_Type.tp_dict, "HideNameFilterDetails", tmp_value);
  2201. Py_DECREF(tmp_value);
  2202. // QFileDialog::DontUseSheet
  2203. tmp_value = PyInt_FromLong(QFileDialog::DontUseSheet);
  2204. PyDict_SetItemString((PyObject*) PyQFileDialog_Type.tp_dict, "DontUseSheet", tmp_value);
  2205. Py_DECREF(tmp_value);
  2206. }
  2207. return m;
  2208. }
  2209. static PyMethodDef tiled_Tiled_functions[] = {
  2210. {NULL, NULL, 0, NULL}
  2211. };
  2212. /* --- classes --- */
  2213. static int
  2214. _wrap_PyTiledTile__tp_init(PyTiledTile *self, PyObject *args, PyObject *kwargs)
  2215. {
  2216. PyQPixmap *image;
  2217. int id;
  2218. PyTiledTileset *ts;
  2219. Tiled::Tileset *ts_ptr;
  2220. const char *keywords[] = {"image", "id", "ts", NULL};
  2221. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!iO!", (char **) keywords, &PyQPixmap_Type, &image, &id, &PyTiledTileset_Type, &ts)) {
  2222. return -1;
  2223. }
  2224. ts_ptr = (ts ? ts->obj : NULL);
  2225. self->obj = new Tiled::Tile(*((PyQPixmap *) image)->obj, id, ts_ptr);
  2226. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  2227. return 0;
  2228. }
  2229. PyObject *
  2230. _wrap_PyTiledTile_tileset(PyTiledTile *self)
  2231. {
  2232. PyObject *py_retval;
  2233. Tiled::Tileset *retval;
  2234. PyTiledTileset *py_Tileset;
  2235. retval = self->obj->tileset();
  2236. if (!(retval)) {
  2237. Py_INCREF(Py_None);
  2238. return Py_None;
  2239. }
  2240. py_Tileset = PyObject_New(PyTiledTileset, &PyTiledTileset_Type);
  2241. py_Tileset->obj = retval;
  2242. py_Tileset->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  2243. py_retval = Py_BuildValue((char *) "N", py_Tileset);
  2244. return py_retval;
  2245. }
  2246. PyObject *
  2247. _wrap_PyTiledTile_setImage(PyTiledTile *self, PyObject *args, PyObject *kwargs)
  2248. {
  2249. PyObject *py_retval;
  2250. PyQPixmap *image;
  2251. const char *keywords[] = {"image", NULL};
  2252. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQPixmap_Type, &image)) {
  2253. return NULL;
  2254. }
  2255. self->obj->setImage(*((PyQPixmap *) image)->obj);
  2256. Py_INCREF(Py_None);
  2257. py_retval = Py_None;
  2258. return py_retval;
  2259. }
  2260. PyObject *
  2261. _wrap_PyTiledTile_image(PyTiledTile *self)
  2262. {
  2263. PyObject *py_retval;
  2264. PyQPixmap *py_QPixmap;
  2265. QPixmap const & retval = self->obj->image();
  2266. py_QPixmap = PyObject_New(PyQPixmap, &PyQPixmap_Type);
  2267. py_QPixmap->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  2268. py_QPixmap->obj = new QPixmap(retval);
  2269. py_retval = Py_BuildValue((char *) "N", py_QPixmap);
  2270. return py_retval;
  2271. }
  2272. PyObject *
  2273. _wrap_PyTiledTile_height(PyTiledTile *self)
  2274. {
  2275. PyObject *py_retval;
  2276. int retval;
  2277. retval = self->obj->height();
  2278. py_retval = Py_BuildValue((char *) "i", retval);
  2279. return py_retval;
  2280. }
  2281. PyObject *
  2282. _wrap_PyTiledTile_width(PyTiledTile *self)
  2283. {
  2284. PyObject *py_retval;
  2285. int retval;
  2286. retval = self->obj->width();
  2287. py_retval = Py_BuildValue((char *) "i", retval);
  2288. return py_retval;
  2289. }
  2290. PyObject *
  2291. _wrap_PyTiledTile_id(PyTiledTile *self)
  2292. {
  2293. PyObject *py_retval;
  2294. int retval;
  2295. retval = self->obj->id();
  2296. py_retval = Py_BuildValue((char *) "i", retval);
  2297. return py_retval;
  2298. }
  2299. static PyMethodDef PyTiledTile_methods[] = {
  2300. {(char *) "tileset", (PyCFunction) _wrap_PyTiledTile_tileset, METH_NOARGS, NULL },
  2301. {(char *) "setImage", (PyCFunction) _wrap_PyTiledTile_setImage, METH_KEYWORDS|METH_VARARGS, NULL },
  2302. {(char *) "image", (PyCFunction) _wrap_PyTiledTile_image, METH_NOARGS, NULL },
  2303. {(char *) "height", (PyCFunction) _wrap_PyTiledTile_height, METH_NOARGS, NULL },
  2304. {(char *) "width", (PyCFunction) _wrap_PyTiledTile_width, METH_NOARGS, NULL },
  2305. {(char *) "id", (PyCFunction) _wrap_PyTiledTile_id, METH_NOARGS, NULL },
  2306. {NULL, NULL, 0, NULL}
  2307. };
  2308. static void
  2309. _wrap_PyTiledTile__tp_dealloc(PyTiledTile *self)
  2310. {
  2311. Tiled::Tile *tmp = self->obj;
  2312. self->obj = NULL;
  2313. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  2314. delete tmp;
  2315. }
  2316. self->ob_type->tp_free((PyObject*)self);
  2317. }
  2318. static PyObject*
  2319. _wrap_PyTiledTile__tp_richcompare (PyTiledTile *PYBINDGEN_UNUSED(self), PyTiledTile *other, int opid)
  2320. {
  2321. if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyTiledTile_Type)) {
  2322. Py_INCREF(Py_NotImplemented);
  2323. return Py_NotImplemented;
  2324. }
  2325. switch (opid)
  2326. {
  2327. case Py_LT:
  2328. Py_INCREF(Py_NotImplemented);
  2329. return Py_NotImplemented;
  2330. case Py_LE:
  2331. Py_INCREF(Py_NotImplemented);
  2332. return Py_NotImplemented;
  2333. case Py_EQ:
  2334. Py_INCREF(Py_NotImplemented);
  2335. return Py_NotImplemented;
  2336. case Py_NE:
  2337. Py_INCREF(Py_NotImplemented);
  2338. return Py_NotImplemented;
  2339. case Py_GE:
  2340. Py_INCREF(Py_NotImplemented);
  2341. return Py_NotImplemented;
  2342. case Py_GT:
  2343. Py_INCREF(Py_NotImplemented);
  2344. return Py_NotImplemented;
  2345. } /* closes switch (opid) */
  2346. Py_INCREF(Py_NotImplemented);
  2347. return Py_NotImplemented;
  2348. }
  2349. PyTypeObject PyTiledTile_Type = {
  2350. PyObject_HEAD_INIT(NULL)
  2351. 0, /* ob_size */
  2352. (char *) "tiled.Tiled.Tile", /* tp_name */
  2353. sizeof(PyTiledTile), /* tp_basicsize */
  2354. 0, /* tp_itemsize */
  2355. /* methods */
  2356. (destructor)_wrap_PyTiledTile__tp_dealloc, /* tp_dealloc */
  2357. (printfunc)0, /* tp_print */
  2358. (getattrfunc)NULL, /* tp_getattr */
  2359. (setattrfunc)NULL, /* tp_setattr */
  2360. (cmpfunc)NULL, /* tp_compare */
  2361. (reprfunc)NULL, /* tp_repr */
  2362. (PyNumberMethods*)NULL, /* tp_as_number */
  2363. (PySequenceMethods*)NULL, /* tp_as_sequence */
  2364. (PyMappingMethods*)NULL, /* tp_as_mapping */
  2365. (hashfunc)NULL, /* tp_hash */
  2366. (ternaryfunc)NULL, /* tp_call */
  2367. (reprfunc)NULL, /* tp_str */
  2368. (getattrofunc)NULL, /* tp_getattro */
  2369. (setattrofunc)NULL, /* tp_setattro */
  2370. (PyBufferProcs*)NULL, /* tp_as_buffer */
  2371. Py_TPFLAGS_DEFAULT, /* tp_flags */
  2372. NULL, /* Documentation string */
  2373. (traverseproc)NULL, /* tp_traverse */
  2374. (inquiry)NULL, /* tp_clear */
  2375. (richcmpfunc)_wrap_PyTiledTile__tp_richcompare, /* tp_richcompare */
  2376. 0, /* tp_weaklistoffset */
  2377. (getiterfunc)NULL, /* tp_iter */
  2378. (iternextfunc)NULL, /* tp_iternext */
  2379. (struct PyMethodDef*)PyTiledTile_methods, /* tp_methods */
  2380. (struct PyMemberDef*)0, /* tp_members */
  2381. 0, /* tp_getset */
  2382. NULL, /* tp_base */
  2383. NULL, /* tp_dict */
  2384. (descrgetfunc)NULL, /* tp_descr_get */
  2385. (descrsetfunc)NULL, /* tp_descr_set */
  2386. 0, /* tp_dictoffset */
  2387. (initproc)_wrap_PyTiledTile__tp_init, /* tp_init */
  2388. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  2389. (newfunc)PyType_GenericNew, /* tp_new */
  2390. (freefunc)0, /* tp_free */
  2391. (inquiry)NULL, /* tp_is_gc */
  2392. NULL, /* tp_bases */
  2393. NULL, /* tp_mro */
  2394. NULL, /* tp_cache */
  2395. NULL, /* tp_subclasses */
  2396. NULL, /* tp_weaklist */
  2397. (destructor) NULL /* tp_del */
  2398. };
  2399. static int
  2400. _wrap_PyTiledTileset__tp_init(PyTiledTileset *self, PyObject *args, PyObject *kwargs)
  2401. {
  2402. const char *name;
  2403. Py_ssize_t name_len;
  2404. int tw;
  2405. int th;
  2406. int ts;
  2407. int margin;
  2408. const char *keywords[] = {"name", "tw", "th", "ts", "margin", NULL};
  2409. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#iiii", (char **) keywords, &name, &name_len, &tw, &th, &ts, &margin)) {
  2410. return -1;
  2411. }
  2412. self->obj = new Tiled::Tileset(QString::fromUtf8(name), tw, th, ts, margin);
  2413. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  2414. return 0;
  2415. }
  2416. PyObject *
  2417. _wrap_PyTiledTileset_columnCount(PyTiledTileset *self)
  2418. {
  2419. PyObject *py_retval;
  2420. int retval;
  2421. retval = self->obj->columnCount();
  2422. py_retval = Py_BuildValue((char *) "i", retval);
  2423. return py_retval;
  2424. }
  2425. PyObject *
  2426. _wrap_PyTiledTileset_loadFromImage(PyTiledTileset *self, PyObject *args, PyObject *kwargs)
  2427. {
  2428. PyObject *py_retval;
  2429. bool retval;
  2430. PyQImage *img;
  2431. const char *file;
  2432. Py_ssize_t file_len;
  2433. const char *keywords[] = {"img", "file", NULL};
  2434. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!s#", (char **) keywords, &PyQImage_Type, &img, &file, &file_len)) {
  2435. return NULL;
  2436. }
  2437. retval = self->obj->loadFromImage(*((PyQImage *) img)->obj, QString::fromUtf8(file));
  2438. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  2439. return py_retval;
  2440. }
  2441. PyObject *
  2442. _wrap_PyTiledTileset_tileSpacing(PyTiledTileset *self)
  2443. {
  2444. PyObject *py_retval;
  2445. int retval;
  2446. retval = self->obj->tileSpacing();
  2447. py_retval = Py_BuildValue((char *) "i", retval);
  2448. return py_retval;
  2449. }
  2450. PyObject *
  2451. _wrap_PyTiledTileset_name(PyTiledTileset *self)
  2452. {
  2453. PyObject *py_retval;
  2454. QString retval;
  2455. retval = self->obj->name();
  2456. py_retval = Py_BuildValue((char *) "s", retval.toUtf8().data());
  2457. return py_retval;
  2458. }
  2459. PyObject *
  2460. _wrap_PyTiledTileset_setName(PyTiledTileset *self, PyObject *args, PyObject *kwargs)
  2461. {
  2462. PyObject *py_retval;
  2463. const char *name;
  2464. Py_ssize_t name_len;
  2465. const char *keywords[] = {"name", NULL};
  2466. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#", (char **) keywords, &name, &name_len)) {
  2467. return NULL;
  2468. }
  2469. self->obj->setName(QString::fromUtf8(name));
  2470. Py_INCREF(Py_None);
  2471. py_retval = Py_None;
  2472. return py_retval;
  2473. }
  2474. PyObject *
  2475. _wrap_PyTiledTileset_tileHeight(PyTiledTileset *self)
  2476. {
  2477. PyObject *py_retval;
  2478. int retval;
  2479. retval = self->obj->tileHeight();
  2480. py_retval = Py_BuildValue((char *) "i", retval);
  2481. return py_retval;
  2482. }
  2483. PyObject *
  2484. _wrap_PyTiledTileset_tileWidth(PyTiledTileset *self)
  2485. {
  2486. PyObject *py_retval;
  2487. int retval;
  2488. retval = self->obj->tileWidth();
  2489. py_retval = Py_BuildValue((char *) "i", retval);
  2490. return py_retval;
  2491. }
  2492. PyObject *
  2493. _wrap_PyTiledTileset_transparentColor(PyTiledTileset *self)
  2494. {
  2495. PyObject *py_retval;
  2496. PyQColor *py_QColor;
  2497. QColor retval = self->obj->transparentColor();
  2498. py_QColor = PyObject_New(PyQColor, &PyQColor_Type);
  2499. py_QColor->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  2500. py_QColor->obj = new QColor(retval);
  2501. py_retval = Py_BuildValue((char *) "N", py_QColor);
  2502. return py_retval;
  2503. }
  2504. PyObject *
  2505. _wrap_PyTiledTileset_setFileName(PyTiledTileset *self, PyObject *args, PyObject *kwargs)
  2506. {
  2507. PyObject *py_retval;
  2508. const char *name;
  2509. Py_ssize_t name_len;
  2510. const char *keywords[] = {"name", NULL};
  2511. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#", (char **) keywords, &name, &name_len)) {
  2512. return NULL;
  2513. }
  2514. self->obj->setFileName(QString::fromUtf8(name));
  2515. Py_INCREF(Py_None);
  2516. py_retval = Py_None;
  2517. return py_retval;
  2518. }
  2519. PyObject *
  2520. _wrap_PyTiledTileset_tileAt(PyTiledTileset *self, PyObject *args, PyObject *kwargs)
  2521. {
  2522. PyObject *py_retval;
  2523. Tiled::Tile *retval;
  2524. int id;
  2525. const char *keywords[] = {"id", NULL};
  2526. PyTiledTile *py_Tile;
  2527. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &id)) {
  2528. return NULL;
  2529. }
  2530. retval = self->obj->tileAt(id);
  2531. if (!(retval)) {
  2532. Py_INCREF(Py_None);
  2533. return Py_None;
  2534. }
  2535. py_Tile = PyObject_New(PyTiledTile, &PyTiledTile_Type);
  2536. py_Tile->obj = retval;
  2537. py_Tile->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  2538. py_retval = Py_BuildValue((char *) "N", py_Tile);
  2539. return py_retval;
  2540. }
  2541. PyObject *
  2542. _wrap_PyTiledTileset_fileName(PyTiledTileset *self)
  2543. {
  2544. PyObject *py_retval;
  2545. QString retval;
  2546. retval = self->obj->fileName();
  2547. py_retval = Py_BuildValue((char *) "s", retval.toUtf8().data());
  2548. return py_retval;
  2549. }
  2550. PyObject *
  2551. _wrap_PyTiledTileset_tileCount(PyTiledTileset *self)
  2552. {
  2553. PyObject *py_retval;
  2554. int retval;
  2555. retval = self->obj->tileCount();
  2556. py_retval = Py_BuildValue((char *) "i", retval);
  2557. return py_retval;
  2558. }
  2559. PyObject *
  2560. _wrap_PyTiledTileset_imageHeight(PyTiledTileset *self)
  2561. {
  2562. PyObject *py_retval;
  2563. int retval;
  2564. retval = self->obj->imageHeight();
  2565. py_retval = Py_BuildValue((char *) "i", retval);
  2566. return py_retval;
  2567. }
  2568. PyObject *
  2569. _wrap_PyTiledTileset_imageWidth(PyTiledTileset *self)
  2570. {
  2571. PyObject *py_retval;
  2572. int retval;
  2573. retval = self->obj->imageWidth();
  2574. py_retval = Py_BuildValue((char *) "i", retval);
  2575. return py_retval;
  2576. }
  2577. PyObject *
  2578. _wrap_PyTiledTileset_setTransparentColor(PyTiledTileset *self, PyObject *args, PyObject *kwargs)
  2579. {
  2580. PyObject *py_retval;
  2581. PyQColor *col;
  2582. const char *keywords[] = {"col", NULL};
  2583. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQColor_Type, &col)) {
  2584. return NULL;
  2585. }
  2586. self->obj->setTransparentColor(*((PyQColor *) col)->obj);
  2587. Py_INCREF(Py_None);
  2588. py_retval = Py_None;
  2589. return py_retval;
  2590. }
  2591. PyObject *
  2592. _wrap_PyTiledTileset_margin(PyTiledTileset *self)
  2593. {
  2594. PyObject *py_retval;
  2595. int retval;
  2596. retval = self->obj->margin();
  2597. py_retval = Py_BuildValue((char *) "i", retval);
  2598. return py_retval;
  2599. }
  2600. PyObject *
  2601. _wrap_PyTiledTileset_isExternal(PyTiledTileset *self)
  2602. {
  2603. PyObject *py_retval;
  2604. bool retval;
  2605. retval = self->obj->isExternal();
  2606. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  2607. return py_retval;
  2608. }
  2609. static PyMethodDef PyTiledTileset_methods[] = {
  2610. {(char *) "columnCount", (PyCFunction) _wrap_PyTiledTileset_columnCount, METH_NOARGS, NULL },
  2611. {(char *) "loadFromImage", (PyCFunction) _wrap_PyTiledTileset_loadFromImage, METH_KEYWORDS|METH_VARARGS, NULL },
  2612. {(char *) "tileSpacing", (PyCFunction) _wrap_PyTiledTileset_tileSpacing, METH_NOARGS, NULL },
  2613. {(char *) "name", (PyCFunction) _wrap_PyTiledTileset_name, METH_NOARGS, NULL },
  2614. {(char *) "setName", (PyCFunction) _wrap_PyTiledTileset_setName, METH_KEYWORDS|METH_VARARGS, NULL },
  2615. {(char *) "tileHeight", (PyCFunction) _wrap_PyTiledTileset_tileHeight, METH_NOARGS, NULL },
  2616. {(char *) "tileWidth", (PyCFunction) _wrap_PyTiledTileset_tileWidth, METH_NOARGS, NULL },
  2617. {(char *) "transparentColor", (PyCFunction) _wrap_PyTiledTileset_transparentColor, METH_NOARGS, NULL },
  2618. {(char *) "setFileName", (PyCFunction) _wrap_PyTiledTileset_setFileName, METH_KEYWORDS|METH_VARARGS, NULL },
  2619. {(char *) "tileAt", (PyCFunction) _wrap_PyTiledTileset_tileAt, METH_KEYWORDS|METH_VARARGS, NULL },
  2620. {(char *) "fileName", (PyCFunction) _wrap_PyTiledTileset_fileName, METH_NOARGS, NULL },
  2621. {(char *) "tileCount", (PyCFunction) _wrap_PyTiledTileset_tileCount, METH_NOARGS, NULL },
  2622. {(char *) "imageHeight", (PyCFunction) _wrap_PyTiledTileset_imageHeight, METH_NOARGS, NULL },
  2623. {(char *) "imageWidth", (PyCFunction) _wrap_PyTiledTileset_imageWidth, METH_NOARGS, NULL },
  2624. {(char *) "setTransparentColor", (PyCFunction) _wrap_PyTiledTileset_setTransparentColor, METH_KEYWORDS|METH_VARARGS, NULL },
  2625. {(char *) "margin", (PyCFunction) _wrap_PyTiledTileset_margin, METH_NOARGS, NULL },
  2626. {(char *) "isExternal", (PyCFunction) _wrap_PyTiledTileset_isExternal, METH_NOARGS, NULL },
  2627. {NULL, NULL, 0, NULL}
  2628. };
  2629. static void
  2630. _wrap_PyTiledTileset__tp_dealloc(PyTiledTileset *self)
  2631. {
  2632. Tiled::Tileset *tmp = self->obj;
  2633. self->obj = NULL;
  2634. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  2635. delete tmp;
  2636. }
  2637. self->ob_type->tp_free((PyObject*)self);
  2638. }
  2639. static PyObject*
  2640. _wrap_PyTiledTileset__tp_richcompare (PyTiledTileset *PYBINDGEN_UNUSED(self), PyTiledTileset *other, int opid)
  2641. {
  2642. if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyTiledTileset_Type)) {
  2643. Py_INCREF(Py_NotImplemented);
  2644. return Py_NotImplemented;
  2645. }
  2646. switch (opid)
  2647. {
  2648. case Py_LT:
  2649. Py_INCREF(Py_NotImplemented);
  2650. return Py_NotImplemented;
  2651. case Py_LE:
  2652. Py_INCREF(Py_NotImplemented);
  2653. return Py_NotImplemented;
  2654. case Py_EQ:
  2655. Py_INCREF(Py_NotImplemented);
  2656. return Py_NotImplemented;
  2657. case Py_NE:
  2658. Py_INCREF(Py_NotImplemented);
  2659. return Py_NotImplemented;
  2660. case Py_GE:
  2661. Py_INCREF(Py_NotImplemented);
  2662. return Py_NotImplemented;
  2663. case Py_GT:
  2664. Py_INCREF(Py_NotImplemented);
  2665. return Py_NotImplemented;
  2666. } /* closes switch (opid) */
  2667. Py_INCREF(Py_NotImplemented);
  2668. return Py_NotImplemented;
  2669. }
  2670. PyTypeObject PyTiledTileset_Type = {
  2671. PyObject_HEAD_INIT(NULL)
  2672. 0, /* ob_size */
  2673. (char *) "tiled.Tiled.Tileset", /* tp_name */
  2674. sizeof(PyTiledTileset), /* tp_basicsize */
  2675. 0, /* tp_itemsize */
  2676. /* methods */
  2677. (destructor)_wrap_PyTiledTileset__tp_dealloc, /* tp_dealloc */
  2678. (printfunc)0, /* tp_print */
  2679. (getattrfunc)NULL, /* tp_getattr */
  2680. (setattrfunc)NULL, /* tp_setattr */
  2681. (cmpfunc)NULL, /* tp_compare */
  2682. (reprfunc)NULL, /* tp_repr */
  2683. (PyNumberMethods*)NULL, /* tp_as_number */
  2684. (PySequenceMethods*)NULL, /* tp_as_sequence */
  2685. (PyMappingMethods*)NULL, /* tp_as_mapping */
  2686. (hashfunc)NULL, /* tp_hash */
  2687. (ternaryfunc)NULL, /* tp_call */
  2688. (reprfunc)NULL, /* tp_str */
  2689. (getattrofunc)NULL, /* tp_getattro */
  2690. (setattrofunc)NULL, /* tp_setattro */
  2691. (PyBufferProcs*)NULL, /* tp_as_buffer */
  2692. Py_TPFLAGS_DEFAULT, /* tp_flags */
  2693. NULL, /* Documentation string */
  2694. (traverseproc)NULL, /* tp_traverse */
  2695. (inquiry)NULL, /* tp_clear */
  2696. (richcmpfunc)_wrap_PyTiledTileset__tp_richcompare, /* tp_richcompare */
  2697. 0, /* tp_weaklistoffset */
  2698. (getiterfunc)NULL, /* tp_iter */
  2699. (iternextfunc)NULL, /* tp_iternext */
  2700. (struct PyMethodDef*)PyTiledTileset_methods, /* tp_methods */
  2701. (struct PyMemberDef*)0, /* tp_members */
  2702. 0, /* tp_getset */
  2703. NULL, /* tp_base */
  2704. NULL, /* tp_dict */
  2705. (descrgetfunc)NULL, /* tp_descr_get */
  2706. (descrsetfunc)NULL, /* tp_descr_set */
  2707. 0, /* tp_dictoffset */
  2708. (initproc)_wrap_PyTiledTileset__tp_init, /* tp_init */
  2709. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  2710. (newfunc)PyType_GenericNew, /* tp_new */
  2711. (freefunc)0, /* tp_free */
  2712. (inquiry)NULL, /* tp_is_gc */
  2713. NULL, /* tp_bases */
  2714. NULL, /* tp_mro */
  2715. NULL, /* tp_cache */
  2716. NULL, /* tp_subclasses */
  2717. NULL, /* tp_weaklist */
  2718. (destructor) NULL /* tp_del */
  2719. };
  2720. static int
  2721. _wrap_PyTiledLayer__tp_init(void)
  2722. {
  2723. PyErr_SetString(PyExc_TypeError, "class 'Layer' cannot be constructed ()");
  2724. return -1;
  2725. }
  2726. PyObject *
  2727. _wrap_PyTiledLayer_opacity(PyTiledLayer *self)
  2728. {
  2729. PyObject *py_retval;
  2730. float retval;
  2731. retval = self->obj->opacity();
  2732. py_retval = Py_BuildValue((char *) "f", retval);
  2733. return py_retval;
  2734. }
  2735. PyObject *
  2736. _wrap_PyTiledLayer_map(PyTiledLayer *self)
  2737. {
  2738. PyObject *py_retval;
  2739. Tiled::Map *retval;
  2740. PyTiledMap *py_Map;
  2741. retval = self->obj->map();
  2742. if (!(retval)) {
  2743. Py_INCREF(Py_None);
  2744. return Py_None;
  2745. }
  2746. py_Map = PyObject_New(PyTiledMap, &PyTiledMap_Type);
  2747. py_Map->obj = retval;
  2748. py_Map->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  2749. py_retval = Py_BuildValue((char *) "N", py_Map);
  2750. return py_retval;
  2751. }
  2752. PyObject *
  2753. _wrap_PyTiledLayer_asTileLayer(PyTiledLayer *self)
  2754. {
  2755. PyObject *py_retval;
  2756. Tiled::TileLayer *retval;
  2757. PyTiledTileLayer *py_TileLayer;
  2758. retval = self->obj->asTileLayer();
  2759. if (!(retval)) {
  2760. Py_INCREF(Py_None);
  2761. return Py_None;
  2762. }
  2763. py_TileLayer = PyObject_New(PyTiledTileLayer, &PyTiledTileLayer_Type);
  2764. py_TileLayer->obj = retval;
  2765. py_TileLayer->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  2766. py_retval = Py_BuildValue((char *) "N", py_TileLayer);
  2767. return py_retval;
  2768. }
  2769. PyObject *
  2770. _wrap_PyTiledLayer_setMap(PyTiledLayer *self, PyObject *args, PyObject *kwargs)
  2771. {
  2772. PyObject *py_retval;
  2773. PyTiledMap *map;
  2774. Tiled::Map *map_ptr;
  2775. const char *keywords[] = {"map", NULL};
  2776. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledMap_Type, &map)) {
  2777. return NULL;
  2778. }
  2779. map_ptr = (map ? map->obj : NULL);
  2780. self->obj->setMap(map_ptr);
  2781. Py_INCREF(Py_None);
  2782. py_retval = Py_None;
  2783. return py_retval;
  2784. }
  2785. PyObject *
  2786. _wrap_PyTiledLayer_name(PyTiledLayer *self)
  2787. {
  2788. PyObject *py_retval;
  2789. QString retval;
  2790. retval = self->obj->name();
  2791. py_retval = Py_BuildValue((char *) "s", retval.toUtf8().data());
  2792. return py_retval;
  2793. }
  2794. PyObject *
  2795. _wrap_PyTiledLayer_setName(PyTiledLayer *self, PyObject *args, PyObject *kwargs)
  2796. {
  2797. PyObject *py_retval;
  2798. const char *name;
  2799. Py_ssize_t name_len;
  2800. const char *keywords[] = {"name", NULL};
  2801. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#", (char **) keywords, &name, &name_len)) {
  2802. return NULL;
  2803. }
  2804. self->obj->setName(QString::fromUtf8(name));
  2805. Py_INCREF(Py_None);
  2806. py_retval = Py_None;
  2807. return py_retval;
  2808. }
  2809. PyObject *
  2810. _wrap_PyTiledLayer_setX(PyTiledLayer *self, PyObject *args, PyObject *kwargs)
  2811. {
  2812. PyObject *py_retval;
  2813. int x;
  2814. const char *keywords[] = {"x", NULL};
  2815. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &x)) {
  2816. return NULL;
  2817. }
  2818. self->obj->setX(x);
  2819. Py_INCREF(Py_None);
  2820. py_retval = Py_None;
  2821. return py_retval;
  2822. }
  2823. PyObject *
  2824. _wrap_PyTiledLayer_asObjectGroup(PyTiledLayer *self)
  2825. {
  2826. PyObject *py_retval;
  2827. Tiled::ObjectGroup *retval;
  2828. PyTiledObjectGroup *py_ObjectGroup;
  2829. retval = self->obj->asObjectGroup();
  2830. if (!(retval)) {
  2831. Py_INCREF(Py_None);
  2832. return Py_None;
  2833. }
  2834. py_ObjectGroup = PyObject_New(PyTiledObjectGroup, &PyTiledObjectGroup_Type);
  2835. py_ObjectGroup->obj = retval;
  2836. py_ObjectGroup->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  2837. py_retval = Py_BuildValue((char *) "N", py_ObjectGroup);
  2838. return py_retval;
  2839. }
  2840. PyObject *
  2841. _wrap_PyTiledLayer_setOpacity(PyTiledLayer *self, PyObject *args, PyObject *kwargs)
  2842. {
  2843. PyObject *py_retval;
  2844. float opacity;
  2845. const char *keywords[] = {"opacity", NULL};
  2846. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "f", (char **) keywords, &opacity)) {
  2847. return NULL;
  2848. }
  2849. self->obj->setOpacity(opacity);
  2850. Py_INCREF(Py_None);
  2851. py_retval = Py_None;
  2852. return py_retval;
  2853. }
  2854. PyObject *
  2855. _wrap_PyTiledLayer_height(PyTiledLayer *self)
  2856. {
  2857. PyObject *py_retval;
  2858. int retval;
  2859. retval = self->obj->height();
  2860. py_retval = Py_BuildValue((char *) "i", retval);
  2861. return py_retval;
  2862. }
  2863. PyObject *
  2864. _wrap_PyTiledLayer_width(PyTiledLayer *self)
  2865. {
  2866. PyObject *py_retval;
  2867. int retval;
  2868. retval = self->obj->width();
  2869. py_retval = Py_BuildValue((char *) "i", retval);
  2870. return py_retval;
  2871. }
  2872. PyObject *
  2873. _wrap_PyTiledLayer_isVisible(PyTiledLayer *self)
  2874. {
  2875. PyObject *py_retval;
  2876. bool retval;
  2877. retval = self->obj->isVisible();
  2878. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  2879. return py_retval;
  2880. }
  2881. PyObject *
  2882. _wrap_PyTiledLayer_y(PyTiledLayer *self)
  2883. {
  2884. PyObject *py_retval;
  2885. int retval;
  2886. retval = self->obj->y();
  2887. py_retval = Py_BuildValue((char *) "i", retval);
  2888. return py_retval;
  2889. }
  2890. PyObject *
  2891. _wrap_PyTiledLayer_x(PyTiledLayer *self)
  2892. {
  2893. PyObject *py_retval;
  2894. int retval;
  2895. retval = self->obj->x();
  2896. py_retval = Py_BuildValue((char *) "i", retval);
  2897. return py_retval;
  2898. }
  2899. PyObject *
  2900. _wrap_PyTiledLayer_setPosition(PyTiledLayer *self, PyObject *args, PyObject *kwargs)
  2901. {
  2902. PyObject *py_retval;
  2903. int x;
  2904. int y;
  2905. const char *keywords[] = {"x", "y", NULL};
  2906. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "ii", (char **) keywords, &x, &y)) {
  2907. return NULL;
  2908. }
  2909. self->obj->setPosition(x, y);
  2910. Py_INCREF(Py_None);
  2911. py_retval = Py_None;
  2912. return py_retval;
  2913. }
  2914. PyObject *
  2915. _wrap_PyTiledLayer_setVisible(PyTiledLayer *self, PyObject *args, PyObject *kwargs)
  2916. {
  2917. PyObject *py_retval;
  2918. bool visible;
  2919. PyObject *py_visible;
  2920. const char *keywords[] = {"visible", NULL};
  2921. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O", (char **) keywords, &py_visible)) {
  2922. return NULL;
  2923. }
  2924. visible = (bool) PyObject_IsTrue(py_visible);
  2925. self->obj->setVisible(visible);
  2926. Py_INCREF(Py_None);
  2927. py_retval = Py_None;
  2928. return py_retval;
  2929. }
  2930. PyObject *
  2931. _wrap_PyTiledLayer_setY(PyTiledLayer *self, PyObject *args, PyObject *kwargs)
  2932. {
  2933. PyObject *py_retval;
  2934. int y;
  2935. const char *keywords[] = {"y", NULL};
  2936. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &y)) {
  2937. return NULL;
  2938. }
  2939. self->obj->setY(y);
  2940. Py_INCREF(Py_None);
  2941. py_retval = Py_None;
  2942. return py_retval;
  2943. }
  2944. static PyMethodDef PyTiledLayer_methods[] = {
  2945. {(char *) "opacity", (PyCFunction) _wrap_PyTiledLayer_opacity, METH_NOARGS, NULL },
  2946. {(char *) "map", (PyCFunction) _wrap_PyTiledLayer_map, METH_NOARGS, NULL },
  2947. {(char *) "asTileLayer", (PyCFunction) _wrap_PyTiledLayer_asTileLayer, METH_NOARGS, NULL },
  2948. {(char *) "setMap", (PyCFunction) _wrap_PyTiledLayer_setMap, METH_KEYWORDS|METH_VARARGS, NULL },
  2949. {(char *) "name", (PyCFunction) _wrap_PyTiledLayer_name, METH_NOARGS, NULL },
  2950. {(char *) "setName", (PyCFunction) _wrap_PyTiledLayer_setName, METH_KEYWORDS|METH_VARARGS, NULL },
  2951. {(char *) "setX", (PyCFunction) _wrap_PyTiledLayer_setX, METH_KEYWORDS|METH_VARARGS, NULL },
  2952. {(char *) "asObjectGroup", (PyCFunction) _wrap_PyTiledLayer_asObjectGroup, METH_NOARGS, NULL },
  2953. {(char *) "setOpacity", (PyCFunction) _wrap_PyTiledLayer_setOpacity, METH_KEYWORDS|METH_VARARGS, NULL },
  2954. {(char *) "height", (PyCFunction) _wrap_PyTiledLayer_height, METH_NOARGS, NULL },
  2955. {(char *) "width", (PyCFunction) _wrap_PyTiledLayer_width, METH_NOARGS, NULL },
  2956. {(char *) "isVisible", (PyCFunction) _wrap_PyTiledLayer_isVisible, METH_NOARGS, NULL },
  2957. {(char *) "y", (PyCFunction) _wrap_PyTiledLayer_y, METH_NOARGS, NULL },
  2958. {(char *) "x", (PyCFunction) _wrap_PyTiledLayer_x, METH_NOARGS, NULL },
  2959. {(char *) "setPosition", (PyCFunction) _wrap_PyTiledLayer_setPosition, METH_KEYWORDS|METH_VARARGS, NULL },
  2960. {(char *) "setVisible", (PyCFunction) _wrap_PyTiledLayer_setVisible, METH_KEYWORDS|METH_VARARGS, NULL },
  2961. {(char *) "setY", (PyCFunction) _wrap_PyTiledLayer_setY, METH_KEYWORDS|METH_VARARGS, NULL },
  2962. {NULL, NULL, 0, NULL}
  2963. };
  2964. static void
  2965. _wrap_PyTiledLayer__tp_dealloc(PyTiledLayer *self)
  2966. {
  2967. Tiled::Layer *tmp = self->obj;
  2968. self->obj = NULL;
  2969. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  2970. delete tmp;
  2971. }
  2972. self->ob_type->tp_free((PyObject*)self);
  2973. }
  2974. static PyObject*
  2975. _wrap_PyTiledLayer__tp_richcompare (PyTiledLayer *PYBINDGEN_UNUSED(self), PyTiledLayer *other, int opid)
  2976. {
  2977. if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyTiledLayer_Type)) {
  2978. Py_INCREF(Py_NotImplemented);
  2979. return Py_NotImplemented;
  2980. }
  2981. switch (opid)
  2982. {
  2983. case Py_LT:
  2984. Py_INCREF(Py_NotImplemented);
  2985. return Py_NotImplemented;
  2986. case Py_LE:
  2987. Py_INCREF(Py_NotImplemented);
  2988. return Py_NotImplemented;
  2989. case Py_EQ:
  2990. Py_INCREF(Py_NotImplemented);
  2991. return Py_NotImplemented;
  2992. case Py_NE:
  2993. Py_INCREF(Py_NotImplemented);
  2994. return Py_NotImplemented;
  2995. case Py_GE:
  2996. Py_INCREF(Py_NotImplemented);
  2997. return Py_NotImplemented;
  2998. case Py_GT:
  2999. Py_INCREF(Py_NotImplemented);
  3000. return Py_NotImplemented;
  3001. } /* closes switch (opid) */
  3002. Py_INCREF(Py_NotImplemented);
  3003. return Py_NotImplemented;
  3004. }
  3005. PyTypeObject PyTiledLayer_Type = {
  3006. PyObject_HEAD_INIT(NULL)
  3007. 0, /* ob_size */
  3008. (char *) "tiled.Tiled.Layer", /* tp_name */
  3009. sizeof(PyTiledLayer), /* tp_basicsize */
  3010. 0, /* tp_itemsize */
  3011. /* methods */
  3012. (destructor)_wrap_PyTiledLayer__tp_dealloc, /* tp_dealloc */
  3013. (printfunc)0, /* tp_print */
  3014. (getattrfunc)NULL, /* tp_getattr */
  3015. (setattrfunc)NULL, /* tp_setattr */
  3016. (cmpfunc)NULL, /* tp_compare */
  3017. (reprfunc)NULL, /* tp_repr */
  3018. (PyNumberMethods*)NULL, /* tp_as_number */
  3019. (PySequenceMethods*)NULL, /* tp_as_sequence */
  3020. (PyMappingMethods*)NULL, /* tp_as_mapping */
  3021. (hashfunc)NULL, /* tp_hash */
  3022. (ternaryfunc)NULL, /* tp_call */
  3023. (reprfunc)NULL, /* tp_str */
  3024. (getattrofunc)NULL, /* tp_getattro */
  3025. (setattrofunc)NULL, /* tp_setattro */
  3026. (PyBufferProcs*)NULL, /* tp_as_buffer */
  3027. Py_TPFLAGS_DEFAULT, /* tp_flags */
  3028. NULL, /* Documentation string */
  3029. (traverseproc)NULL, /* tp_traverse */
  3030. (inquiry)NULL, /* tp_clear */
  3031. (richcmpfunc)_wrap_PyTiledLayer__tp_richcompare, /* tp_richcompare */
  3032. 0, /* tp_weaklistoffset */
  3033. (getiterfunc)NULL, /* tp_iter */
  3034. (iternextfunc)NULL, /* tp_iternext */
  3035. (struct PyMethodDef*)PyTiledLayer_methods, /* tp_methods */
  3036. (struct PyMemberDef*)0, /* tp_members */
  3037. 0, /* tp_getset */
  3038. NULL, /* tp_base */
  3039. NULL, /* tp_dict */
  3040. (descrgetfunc)NULL, /* tp_descr_get */
  3041. (descrsetfunc)NULL, /* tp_descr_set */
  3042. 0, /* tp_dictoffset */
  3043. (initproc)_wrap_PyTiledLayer__tp_init, /* tp_init */
  3044. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  3045. (newfunc)PyType_GenericNew, /* tp_new */
  3046. (freefunc)0, /* tp_free */
  3047. (inquiry)NULL, /* tp_is_gc */
  3048. NULL, /* tp_bases */
  3049. NULL, /* tp_mro */
  3050. NULL, /* tp_cache */
  3051. NULL, /* tp_subclasses */
  3052. NULL, /* tp_weaklist */
  3053. (destructor) NULL /* tp_del */
  3054. };
  3055. static int
  3056. _wrap_PyTiledProperties__tp_init(void)
  3057. {
  3058. PyErr_SetString(PyExc_TypeError, "class 'Properties' cannot be constructed ()");
  3059. return -1;
  3060. }
  3061. PyObject *
  3062. _wrap_PyTiledProperties_keys(PyTiledProperties *self)
  3063. {
  3064. PyObject *py_retval;
  3065. QList< QString > retval;
  3066. PyQList__lt__QString__gt__ *py_QList__lt__QString__gt__;
  3067. retval = self->obj->keys();
  3068. py_QList__lt__QString__gt__ = PyObject_New(PyQList__lt__QString__gt__, &PyQList__lt__QString__gt___Type);
  3069. py_QList__lt__QString__gt__->obj = new QList<QString>(retval);
  3070. py_retval = Py_BuildValue((char *) "N", py_QList__lt__QString__gt__);
  3071. return py_retval;
  3072. }
  3073. static PyMethodDef PyTiledProperties_methods[] = {
  3074. {(char *) "keys", (PyCFunction) _wrap_PyTiledProperties_keys, METH_NOARGS, NULL },
  3075. {NULL, NULL, 0, NULL}
  3076. };
  3077. static void
  3078. _wrap_PyTiledProperties__tp_dealloc(PyTiledProperties *self)
  3079. {
  3080. Tiled::Properties *tmp = self->obj;
  3081. self->obj = NULL;
  3082. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  3083. delete tmp;
  3084. }
  3085. self->ob_type->tp_free((PyObject*)self);
  3086. }
  3087. static PyObject*
  3088. _wrap_PyTiledProperties__tp_richcompare (PyTiledProperties *PYBINDGEN_UNUSED(self), PyTiledProperties *other, int opid)
  3089. {
  3090. if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyTiledProperties_Type)) {
  3091. Py_INCREF(Py_NotImplemented);
  3092. return Py_NotImplemented;
  3093. }
  3094. switch (opid)
  3095. {
  3096. case Py_LT:
  3097. Py_INCREF(Py_NotImplemented);
  3098. return Py_NotImplemented;
  3099. case Py_LE:
  3100. Py_INCREF(Py_NotImplemented);
  3101. return Py_NotImplemented;
  3102. case Py_EQ:
  3103. Py_INCREF(Py_NotImplemented);
  3104. return Py_NotImplemented;
  3105. case Py_NE:
  3106. Py_INCREF(Py_NotImplemented);
  3107. return Py_NotImplemented;
  3108. case Py_GE:
  3109. Py_INCREF(Py_NotImplemented);
  3110. return Py_NotImplemented;
  3111. case Py_GT:
  3112. Py_INCREF(Py_NotImplemented);
  3113. return Py_NotImplemented;
  3114. } /* closes switch (opid) */
  3115. Py_INCREF(Py_NotImplemented);
  3116. return Py_NotImplemented;
  3117. }
  3118. PyTypeObject PyTiledProperties_Type = {
  3119. PyObject_HEAD_INIT(NULL)
  3120. 0, /* ob_size */
  3121. (char *) "tiled.Tiled.Properties", /* tp_name */
  3122. sizeof(PyTiledProperties), /* tp_basicsize */
  3123. 0, /* tp_itemsize */
  3124. /* methods */
  3125. (destructor)_wrap_PyTiledProperties__tp_dealloc, /* tp_dealloc */
  3126. (printfunc)0, /* tp_print */
  3127. (getattrfunc)NULL, /* tp_getattr */
  3128. (setattrfunc)NULL, /* tp_setattr */
  3129. (cmpfunc)NULL, /* tp_compare */
  3130. (reprfunc)NULL, /* tp_repr */
  3131. (PyNumberMethods*)NULL, /* tp_as_number */
  3132. (PySequenceMethods*)NULL, /* tp_as_sequence */
  3133. (PyMappingMethods*)NULL, /* tp_as_mapping */
  3134. (hashfunc)NULL, /* tp_hash */
  3135. (ternaryfunc)NULL, /* tp_call */
  3136. (reprfunc)NULL, /* tp_str */
  3137. (getattrofunc)NULL, /* tp_getattro */
  3138. (setattrofunc)NULL, /* tp_setattro */
  3139. (PyBufferProcs*)NULL, /* tp_as_buffer */
  3140. Py_TPFLAGS_DEFAULT, /* tp_flags */
  3141. NULL, /* Documentation string */
  3142. (traverseproc)NULL, /* tp_traverse */
  3143. (inquiry)NULL, /* tp_clear */
  3144. (richcmpfunc)_wrap_PyTiledProperties__tp_richcompare, /* tp_richcompare */
  3145. 0, /* tp_weaklistoffset */
  3146. (getiterfunc)NULL, /* tp_iter */
  3147. (iternextfunc)NULL, /* tp_iternext */
  3148. (struct PyMethodDef*)PyTiledProperties_methods, /* tp_methods */
  3149. (struct PyMemberDef*)0, /* tp_members */
  3150. 0, /* tp_getset */
  3151. NULL, /* tp_base */
  3152. NULL, /* tp_dict */
  3153. (descrgetfunc)NULL, /* tp_descr_get */
  3154. (descrsetfunc)NULL, /* tp_descr_set */
  3155. 0, /* tp_dictoffset */
  3156. (initproc)_wrap_PyTiledProperties__tp_init, /* tp_init */
  3157. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  3158. (newfunc)PyType_GenericNew, /* tp_new */
  3159. (freefunc)0, /* tp_free */
  3160. (inquiry)NULL, /* tp_is_gc */
  3161. NULL, /* tp_bases */
  3162. NULL, /* tp_mro */
  3163. NULL, /* tp_cache */
  3164. NULL, /* tp_subclasses */
  3165. NULL, /* tp_weaklist */
  3166. (destructor) NULL /* tp_del */
  3167. };
  3168. static int
  3169. _wrap_PyTiledMap__tp_init__0(PyTiledMap *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  3170. {
  3171. PyTiledMap *ctor_arg;
  3172. const char *keywords[] = {"ctor_arg", NULL};
  3173. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledMap_Type, &ctor_arg)) {
  3174. {
  3175. PyObject *exc_type, *traceback;
  3176. PyErr_Fetch(&exc_type, return_exception, &traceback);
  3177. Py_XDECREF(exc_type);
  3178. Py_XDECREF(traceback);
  3179. }
  3180. return -1;
  3181. }
  3182. self->obj = new Tiled::Map(*((PyTiledMap *) ctor_arg)->obj);
  3183. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  3184. return 0;
  3185. }
  3186. static int
  3187. _wrap_PyTiledMap__tp_init__1(PyTiledMap *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  3188. {
  3189. Tiled::Map::Orientation orient;
  3190. int w;
  3191. int h;
  3192. int tileW;
  3193. int tileH;
  3194. const char *keywords[] = {"orient", "w", "h", "tileW", "tileH", NULL};
  3195. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "iiiii", (char **) keywords, &orient, &w, &h, &tileW, &tileH)) {
  3196. {
  3197. PyObject *exc_type, *traceback;
  3198. PyErr_Fetch(&exc_type, return_exception, &traceback);
  3199. Py_XDECREF(exc_type);
  3200. Py_XDECREF(traceback);
  3201. }
  3202. return -1;
  3203. }
  3204. self->obj = new Tiled::Map(orient, w, h, tileW, tileH);
  3205. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  3206. return 0;
  3207. }
  3208. int _wrap_PyTiledMap__tp_init(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  3209. {
  3210. int retval;
  3211. PyObject *error_list;
  3212. PyObject *exceptions[2] = {0,};
  3213. retval = _wrap_PyTiledMap__tp_init__0(self, args, kwargs, &exceptions[0]);
  3214. if (!exceptions[0]) {
  3215. return retval;
  3216. }
  3217. retval = _wrap_PyTiledMap__tp_init__1(self, args, kwargs, &exceptions[1]);
  3218. if (!exceptions[1]) {
  3219. Py_DECREF(exceptions[0]);
  3220. return retval;
  3221. }
  3222. error_list = PyList_New(2);
  3223. PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
  3224. Py_DECREF(exceptions[0]);
  3225. PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
  3226. Py_DECREF(exceptions[1]);
  3227. PyErr_SetObject(PyExc_TypeError, error_list);
  3228. Py_DECREF(error_list);
  3229. return -1;
  3230. }
  3231. PyObject *
  3232. _wrap_PyTiledMap_removeTilesetAt(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  3233. {
  3234. PyObject *py_retval;
  3235. int pos;
  3236. const char *keywords[] = {"pos", NULL};
  3237. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &pos)) {
  3238. return NULL;
  3239. }
  3240. self->obj->removeTilesetAt(pos);
  3241. Py_INCREF(Py_None);
  3242. py_retval = Py_None;
  3243. return py_retval;
  3244. }
  3245. PyObject *
  3246. _wrap_PyTiledMap_orientation(PyTiledMap *self)
  3247. {
  3248. PyObject *py_retval;
  3249. Tiled::Map::Orientation retval;
  3250. retval = self->obj->orientation();
  3251. py_retval = Py_BuildValue((char *) "i", retval);
  3252. return py_retval;
  3253. }
  3254. PyObject *
  3255. _wrap_PyTiledMap_height(PyTiledMap *self)
  3256. {
  3257. PyObject *py_retval;
  3258. int retval;
  3259. retval = self->obj->height();
  3260. py_retval = Py_BuildValue((char *) "i", retval);
  3261. return py_retval;
  3262. }
  3263. PyObject *
  3264. _wrap_PyTiledMap_addTileset(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  3265. {
  3266. PyObject *py_retval;
  3267. PyTiledTileset *ts;
  3268. Tiled::Tileset *ts_ptr;
  3269. const char *keywords[] = {"ts", NULL};
  3270. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledTileset_Type, &ts)) {
  3271. return NULL;
  3272. }
  3273. ts_ptr = (ts ? ts->obj : NULL);
  3274. self->obj->addTileset(ts_ptr);
  3275. if (ts) {
  3276. ts->obj = NULL;
  3277. }
  3278. Py_INCREF(Py_None);
  3279. py_retval = Py_None;
  3280. return py_retval;
  3281. }
  3282. PyObject *
  3283. _wrap_PyTiledMap_isTilesetUsed(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  3284. {
  3285. PyObject *py_retval;
  3286. bool retval;
  3287. PyTiledTileset *ts;
  3288. Tiled::Tileset *ts_ptr;
  3289. const char *keywords[] = {"ts", NULL};
  3290. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledTileset_Type, &ts)) {
  3291. return NULL;
  3292. }
  3293. ts_ptr = (ts ? ts->obj : NULL);
  3294. retval = self->obj->isTilesetUsed(ts_ptr);
  3295. if (ts) {
  3296. ts->obj = NULL;
  3297. }
  3298. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  3299. return py_retval;
  3300. }
  3301. PyObject *
  3302. _wrap_PyTiledMap_setWidth(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  3303. {
  3304. PyObject *py_retval;
  3305. int w;
  3306. const char *keywords[] = {"w", NULL};
  3307. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &w)) {
  3308. return NULL;
  3309. }
  3310. self->obj->setWidth(w);
  3311. Py_INCREF(Py_None);
  3312. py_retval = Py_None;
  3313. return py_retval;
  3314. }
  3315. PyObject *
  3316. _wrap_PyTiledMap_tileLayerCount(PyTiledMap *self)
  3317. {
  3318. PyObject *py_retval;
  3319. int retval;
  3320. retval = self->obj->tileLayerCount();
  3321. py_retval = Py_BuildValue((char *) "i", retval);
  3322. return py_retval;
  3323. }
  3324. PyObject *
  3325. _wrap_PyTiledMap_insertTileset(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  3326. {
  3327. PyObject *py_retval;
  3328. int pos;
  3329. PyTiledTileset *ts;
  3330. Tiled::Tileset *ts_ptr;
  3331. const char *keywords[] = {"pos", "ts", NULL};
  3332. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "iO!", (char **) keywords, &pos, &PyTiledTileset_Type, &ts)) {
  3333. return NULL;
  3334. }
  3335. ts_ptr = (ts ? ts->obj : NULL);
  3336. self->obj->insertTileset(pos, ts_ptr);
  3337. if (ts) {
  3338. ts->obj = NULL;
  3339. }
  3340. Py_INCREF(Py_None);
  3341. py_retval = Py_None;
  3342. return py_retval;
  3343. }
  3344. PyObject *
  3345. _wrap_PyTiledMap_width(PyTiledMap *self)
  3346. {
  3347. PyObject *py_retval;
  3348. int retval;
  3349. retval = self->obj->width();
  3350. py_retval = Py_BuildValue((char *) "i", retval);
  3351. return py_retval;
  3352. }
  3353. PyObject *
  3354. _wrap_PyTiledMap_layerCount(PyTiledMap *self)
  3355. {
  3356. PyObject *py_retval;
  3357. int retval;
  3358. retval = self->obj->layerCount();
  3359. py_retval = Py_BuildValue((char *) "i", retval);
  3360. return py_retval;
  3361. }
  3362. PyObject *
  3363. _wrap_PyTiledMap_setHeight(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  3364. {
  3365. PyObject *py_retval;
  3366. int h;
  3367. const char *keywords[] = {"h", NULL};
  3368. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &h)) {
  3369. return NULL;
  3370. }
  3371. self->obj->setHeight(h);
  3372. Py_INCREF(Py_None);
  3373. py_retval = Py_None;
  3374. return py_retval;
  3375. }
  3376. PyObject *
  3377. _wrap_PyTiledMap_tileHeight(PyTiledMap *self)
  3378. {
  3379. PyObject *py_retval;
  3380. int retval;
  3381. retval = self->obj->tileHeight();
  3382. py_retval = Py_BuildValue((char *) "i", retval);
  3383. return py_retval;
  3384. }
  3385. PyObject *
  3386. _wrap_PyTiledMap_tilesetAt(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  3387. {
  3388. PyObject *py_retval;
  3389. Tiled::Tileset *retval;
  3390. int idx;
  3391. const char *keywords[] = {"idx", NULL};
  3392. PyTiledTileset *py_Tileset;
  3393. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &idx)) {
  3394. return NULL;
  3395. }
  3396. retval = self->obj->tilesetAt(idx);
  3397. if (!(retval)) {
  3398. Py_INCREF(Py_None);
  3399. return Py_None;
  3400. }
  3401. py_Tileset = PyObject_New(PyTiledTileset, &PyTiledTileset_Type);
  3402. py_Tileset->obj = retval;
  3403. py_Tileset->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  3404. py_retval = Py_BuildValue((char *) "N", py_Tileset);
  3405. return py_retval;
  3406. }
  3407. PyObject *
  3408. _wrap_PyTiledMap_layerAt(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  3409. {
  3410. PyObject *py_retval;
  3411. Tiled::Layer *retval;
  3412. int idx;
  3413. const char *keywords[] = {"idx", NULL};
  3414. PyTiledLayer *py_Layer;
  3415. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &idx)) {
  3416. return NULL;
  3417. }
  3418. retval = self->obj->layerAt(idx);
  3419. if (!(retval)) {
  3420. Py_INCREF(Py_None);
  3421. return Py_None;
  3422. }
  3423. py_Layer = PyObject_New(PyTiledLayer, &PyTiledLayer_Type);
  3424. py_Layer->obj = retval;
  3425. py_Layer->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  3426. py_retval = Py_BuildValue((char *) "N", py_Layer);
  3427. return py_retval;
  3428. }
  3429. PyObject *
  3430. _wrap_PyTiledMap_setProperty(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  3431. {
  3432. PyObject *py_retval;
  3433. const char *name;
  3434. Py_ssize_t name_len;
  3435. const char *value;
  3436. Py_ssize_t value_len;
  3437. const char *keywords[] = {"name", "value", NULL};
  3438. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#s#", (char **) keywords, &name, &name_len, &value, &value_len)) {
  3439. return NULL;
  3440. }
  3441. self->obj->setProperty(QString::fromUtf8(name), QString::fromUtf8(value));
  3442. Py_INCREF(Py_None);
  3443. py_retval = Py_None;
  3444. return py_retval;
  3445. }
  3446. PyObject *
  3447. _wrap_PyTiledMap_objectGroupCount(PyTiledMap *self)
  3448. {
  3449. PyObject *py_retval;
  3450. int retval;
  3451. retval = self->obj->objectGroupCount();
  3452. py_retval = Py_BuildValue((char *) "i", retval);
  3453. return py_retval;
  3454. }
  3455. PyObject *
  3456. _wrap_PyTiledMap_properties(PyTiledMap *self)
  3457. {
  3458. PyObject *py_retval;
  3459. PyTiledProperties *py_Properties;
  3460. Tiled::Properties const retval = self->obj->properties();
  3461. py_Properties = PyObject_New(PyTiledProperties, &PyTiledProperties_Type);
  3462. py_Properties->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  3463. py_Properties->obj = new Tiled::Properties(retval);
  3464. py_retval = Py_BuildValue((char *) "N", py_Properties);
  3465. return py_retval;
  3466. }
  3467. PyObject *
  3468. _wrap_PyTiledMap_setOrientation(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  3469. {
  3470. PyObject *py_retval;
  3471. Tiled::Map::Orientation o;
  3472. const char *keywords[] = {"o", NULL};
  3473. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &o)) {
  3474. return NULL;
  3475. }
  3476. self->obj->setOrientation(o);
  3477. Py_INCREF(Py_None);
  3478. py_retval = Py_None;
  3479. return py_retval;
  3480. }
  3481. PyObject *
  3482. _wrap_PyTiledMap_tileWidth(PyTiledMap *self)
  3483. {
  3484. PyObject *py_retval;
  3485. int retval;
  3486. retval = self->obj->tileWidth();
  3487. py_retval = Py_BuildValue((char *) "i", retval);
  3488. return py_retval;
  3489. }
  3490. PyObject *
  3491. _wrap_PyTiledMap_replaceTileset(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  3492. {
  3493. PyObject *py_retval;
  3494. PyTiledTileset *oldts;
  3495. Tiled::Tileset *oldts_ptr;
  3496. PyTiledTileset *newts;
  3497. Tiled::Tileset *newts_ptr;
  3498. const char *keywords[] = {"oldts", "newts", NULL};
  3499. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!O!", (char **) keywords, &PyTiledTileset_Type, &oldts, &PyTiledTileset_Type, &newts)) {
  3500. return NULL;
  3501. }
  3502. oldts_ptr = (oldts ? oldts->obj : NULL);
  3503. newts_ptr = (newts ? newts->obj : NULL);
  3504. self->obj->replaceTileset(oldts_ptr, newts_ptr);
  3505. if (oldts) {
  3506. oldts->obj = NULL;
  3507. }
  3508. if (newts) {
  3509. newts->obj = NULL;
  3510. }
  3511. Py_INCREF(Py_None);
  3512. py_retval = Py_None;
  3513. return py_retval;
  3514. }
  3515. PyObject *
  3516. _wrap_PyTiledMap_indexOfTileset(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  3517. {
  3518. PyObject *py_retval;
  3519. int retval;
  3520. PyTiledTileset *ts;
  3521. Tiled::Tileset *ts_ptr;
  3522. const char *keywords[] = {"ts", NULL};
  3523. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledTileset_Type, &ts)) {
  3524. return NULL;
  3525. }
  3526. ts_ptr = (ts ? ts->obj : NULL);
  3527. retval = self->obj->indexOfTileset(ts_ptr);
  3528. if (ts) {
  3529. ts->obj = NULL;
  3530. }
  3531. py_retval = Py_BuildValue((char *) "i", retval);
  3532. return py_retval;
  3533. }
  3534. PyObject *
  3535. _wrap_PyTiledMap_property(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  3536. {
  3537. PyObject *py_retval;
  3538. QString retval;
  3539. const char *name;
  3540. Py_ssize_t name_len;
  3541. const char *keywords[] = {"name", NULL};
  3542. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#", (char **) keywords, &name, &name_len)) {
  3543. return NULL;
  3544. }
  3545. retval = self->obj->property(QString::fromUtf8(name));
  3546. py_retval = Py_BuildValue((char *) "s", retval.toUtf8().data());
  3547. return py_retval;
  3548. }
  3549. PyObject *
  3550. _wrap_PyTiledMap_addLayer__0(PyTiledMap *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  3551. {
  3552. PyObject *py_retval;
  3553. PyTiledImageLayer *l;
  3554. Tiled::ImageLayer *l_ptr;
  3555. const char *keywords[] = {"l", NULL};
  3556. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledImageLayer_Type, &l)) {
  3557. {
  3558. PyObject *exc_type, *traceback;
  3559. PyErr_Fetch(&exc_type, return_exception, &traceback);
  3560. Py_XDECREF(exc_type);
  3561. Py_XDECREF(traceback);
  3562. }
  3563. return NULL;
  3564. }
  3565. l_ptr = (l ? l->obj : NULL);
  3566. self->obj->addLayer(l_ptr);
  3567. if (l) {
  3568. l->obj = NULL;
  3569. }
  3570. Py_INCREF(Py_None);
  3571. py_retval = Py_None;
  3572. return py_retval;
  3573. }
  3574. PyObject *
  3575. _wrap_PyTiledMap_addLayer__1(PyTiledMap *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  3576. {
  3577. PyObject *py_retval;
  3578. PyTiledTileLayer *l;
  3579. Tiled::TileLayer *l_ptr;
  3580. const char *keywords[] = {"l", NULL};
  3581. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledTileLayer_Type, &l)) {
  3582. {
  3583. PyObject *exc_type, *traceback;
  3584. PyErr_Fetch(&exc_type, return_exception, &traceback);
  3585. Py_XDECREF(exc_type);
  3586. Py_XDECREF(traceback);
  3587. }
  3588. return NULL;
  3589. }
  3590. l_ptr = (l ? l->obj : NULL);
  3591. self->obj->addLayer(l_ptr);
  3592. if (l) {
  3593. l->obj = NULL;
  3594. }
  3595. Py_INCREF(Py_None);
  3596. py_retval = Py_None;
  3597. return py_retval;
  3598. }
  3599. PyObject *
  3600. _wrap_PyTiledMap_addLayer__2(PyTiledMap *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  3601. {
  3602. PyObject *py_retval;
  3603. PyTiledObjectGroup *l;
  3604. Tiled::ObjectGroup *l_ptr;
  3605. const char *keywords[] = {"l", NULL};
  3606. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledObjectGroup_Type, &l)) {
  3607. {
  3608. PyObject *exc_type, *traceback;
  3609. PyErr_Fetch(&exc_type, return_exception, &traceback);
  3610. Py_XDECREF(exc_type);
  3611. Py_XDECREF(traceback);
  3612. }
  3613. return NULL;
  3614. }
  3615. l_ptr = (l ? l->obj : NULL);
  3616. self->obj->addLayer(l_ptr);
  3617. if (l) {
  3618. l->obj = NULL;
  3619. }
  3620. Py_INCREF(Py_None);
  3621. py_retval = Py_None;
  3622. return py_retval;
  3623. }
  3624. PyObject * _wrap_PyTiledMap_addLayer(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  3625. {
  3626. PyObject * retval;
  3627. PyObject *error_list;
  3628. PyObject *exceptions[3] = {0,};
  3629. retval = _wrap_PyTiledMap_addLayer__0(self, args, kwargs, &exceptions[0]);
  3630. if (!exceptions[0]) {
  3631. return retval;
  3632. }
  3633. retval = _wrap_PyTiledMap_addLayer__1(self, args, kwargs, &exceptions[1]);
  3634. if (!exceptions[1]) {
  3635. Py_DECREF(exceptions[0]);
  3636. return retval;
  3637. }
  3638. retval = _wrap_PyTiledMap_addLayer__2(self, args, kwargs, &exceptions[2]);
  3639. if (!exceptions[2]) {
  3640. Py_DECREF(exceptions[0]);
  3641. Py_DECREF(exceptions[1]);
  3642. return retval;
  3643. }
  3644. error_list = PyList_New(3);
  3645. PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
  3646. Py_DECREF(exceptions[0]);
  3647. PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
  3648. Py_DECREF(exceptions[1]);
  3649. PyList_SET_ITEM(error_list, 2, PyObject_Str(exceptions[2]));
  3650. Py_DECREF(exceptions[2]);
  3651. PyErr_SetObject(PyExc_TypeError, error_list);
  3652. Py_DECREF(error_list);
  3653. return NULL;
  3654. }
  3655. PyObject *
  3656. _wrap_PyTiledMap_tilesetCount(PyTiledMap *self)
  3657. {
  3658. PyObject *py_retval;
  3659. int retval;
  3660. retval = self->obj->tilesetCount();
  3661. py_retval = Py_BuildValue((char *) "i", retval);
  3662. return py_retval;
  3663. }
  3664. static PyObject*
  3665. _wrap_PyTiledMap__copy__(PyTiledMap *self)
  3666. {
  3667. PyTiledMap *py_copy;
  3668. py_copy = PyObject_New(PyTiledMap, &PyTiledMap_Type);
  3669. py_copy->obj = new Tiled::Map(*self->obj);
  3670. py_copy->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  3671. return (PyObject*) py_copy;
  3672. }
  3673. static PyMethodDef PyTiledMap_methods[] = {
  3674. {(char *) "removeTilesetAt", (PyCFunction) _wrap_PyTiledMap_removeTilesetAt, METH_KEYWORDS|METH_VARARGS, NULL },
  3675. {(char *) "orientation", (PyCFunction) _wrap_PyTiledMap_orientation, METH_NOARGS, NULL },
  3676. {(char *) "height", (PyCFunction) _wrap_PyTiledMap_height, METH_NOARGS, NULL },
  3677. {(char *) "addTileset", (PyCFunction) _wrap_PyTiledMap_addTileset, METH_KEYWORDS|METH_VARARGS, NULL },
  3678. {(char *) "isTilesetUsed", (PyCFunction) _wrap_PyTiledMap_isTilesetUsed, METH_KEYWORDS|METH_VARARGS, NULL },
  3679. {(char *) "setWidth", (PyCFunction) _wrap_PyTiledMap_setWidth, METH_KEYWORDS|METH_VARARGS, NULL },
  3680. {(char *) "tileLayerCount", (PyCFunction) _wrap_PyTiledMap_tileLayerCount, METH_NOARGS, NULL },
  3681. {(char *) "insertTileset", (PyCFunction) _wrap_PyTiledMap_insertTileset, METH_KEYWORDS|METH_VARARGS, NULL },
  3682. {(char *) "width", (PyCFunction) _wrap_PyTiledMap_width, METH_NOARGS, NULL },
  3683. {(char *) "layerCount", (PyCFunction) _wrap_PyTiledMap_layerCount, METH_NOARGS, NULL },
  3684. {(char *) "setHeight", (PyCFunction) _wrap_PyTiledMap_setHeight, METH_KEYWORDS|METH_VARARGS, NULL },
  3685. {(char *) "tileHeight", (PyCFunction) _wrap_PyTiledMap_tileHeight, METH_NOARGS, NULL },
  3686. {(char *) "tilesetAt", (PyCFunction) _wrap_PyTiledMap_tilesetAt, METH_KEYWORDS|METH_VARARGS, NULL },
  3687. {(char *) "layerAt", (PyCFunction) _wrap_PyTiledMap_layerAt, METH_KEYWORDS|METH_VARARGS, NULL },
  3688. {(char *) "setProperty", (PyCFunction) _wrap_PyTiledMap_setProperty, METH_KEYWORDS|METH_VARARGS, NULL },
  3689. {(char *) "objectGroupCount", (PyCFunction) _wrap_PyTiledMap_objectGroupCount, METH_NOARGS, NULL },
  3690. {(char *) "properties", (PyCFunction) _wrap_PyTiledMap_properties, METH_NOARGS, NULL },
  3691. {(char *) "setOrientation", (PyCFunction) _wrap_PyTiledMap_setOrientation, METH_KEYWORDS|METH_VARARGS, NULL },
  3692. {(char *) "tileWidth", (PyCFunction) _wrap_PyTiledMap_tileWidth, METH_NOARGS, NULL },
  3693. {(char *) "replaceTileset", (PyCFunction) _wrap_PyTiledMap_replaceTileset, METH_KEYWORDS|METH_VARARGS, NULL },
  3694. {(char *) "indexOfTileset", (PyCFunction) _wrap_PyTiledMap_indexOfTileset, METH_KEYWORDS|METH_VARARGS, NULL },
  3695. {(char *) "property", (PyCFunction) _wrap_PyTiledMap_property, METH_KEYWORDS|METH_VARARGS, NULL },
  3696. {(char *) "addLayer", (PyCFunction) _wrap_PyTiledMap_addLayer, METH_KEYWORDS|METH_VARARGS, NULL },
  3697. {(char *) "tilesetCount", (PyCFunction) _wrap_PyTiledMap_tilesetCount, METH_NOARGS, NULL },
  3698. {(char *) "__copy__", (PyCFunction) _wrap_PyTiledMap__copy__, METH_NOARGS, NULL},
  3699. {NULL, NULL, 0, NULL}
  3700. };
  3701. static void
  3702. _wrap_PyTiledMap__tp_dealloc(PyTiledMap *self)
  3703. {
  3704. Tiled::Map *tmp = self->obj;
  3705. self->obj = NULL;
  3706. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  3707. delete tmp;
  3708. }
  3709. self->ob_type->tp_free((PyObject*)self);
  3710. }
  3711. static PyObject*
  3712. _wrap_PyTiledMap__tp_richcompare (PyTiledMap *PYBINDGEN_UNUSED(self), PyTiledMap *other, int opid)
  3713. {
  3714. if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyTiledMap_Type)) {
  3715. Py_INCREF(Py_NotImplemented);
  3716. return Py_NotImplemented;
  3717. }
  3718. switch (opid)
  3719. {
  3720. case Py_LT:
  3721. Py_INCREF(Py_NotImplemented);
  3722. return Py_NotImplemented;
  3723. case Py_LE:
  3724. Py_INCREF(Py_NotImplemented);
  3725. return Py_NotImplemented;
  3726. case Py_EQ:
  3727. Py_INCREF(Py_NotImplemented);
  3728. return Py_NotImplemented;
  3729. case Py_NE:
  3730. Py_INCREF(Py_NotImplemented);
  3731. return Py_NotImplemented;
  3732. case Py_GE:
  3733. Py_INCREF(Py_NotImplemented);
  3734. return Py_NotImplemented;
  3735. case Py_GT:
  3736. Py_INCREF(Py_NotImplemented);
  3737. return Py_NotImplemented;
  3738. } /* closes switch (opid) */
  3739. Py_INCREF(Py_NotImplemented);
  3740. return Py_NotImplemented;
  3741. }
  3742. PyTypeObject PyTiledMap_Type = {
  3743. PyObject_HEAD_INIT(NULL)
  3744. 0, /* ob_size */
  3745. (char *) "tiled.Tiled.Map", /* tp_name */
  3746. sizeof(PyTiledMap), /* tp_basicsize */
  3747. 0, /* tp_itemsize */
  3748. /* methods */
  3749. (destructor)_wrap_PyTiledMap__tp_dealloc, /* tp_dealloc */
  3750. (printfunc)0, /* tp_print */
  3751. (getattrfunc)NULL, /* tp_getattr */
  3752. (setattrfunc)NULL, /* tp_setattr */
  3753. (cmpfunc)NULL, /* tp_compare */
  3754. (reprfunc)NULL, /* tp_repr */
  3755. (PyNumberMethods*)NULL, /* tp_as_number */
  3756. (PySequenceMethods*)NULL, /* tp_as_sequence */
  3757. (PyMappingMethods*)NULL, /* tp_as_mapping */
  3758. (hashfunc)NULL, /* tp_hash */
  3759. (ternaryfunc)NULL, /* tp_call */
  3760. (reprfunc)NULL, /* tp_str */
  3761. (getattrofunc)NULL, /* tp_getattro */
  3762. (setattrofunc)NULL, /* tp_setattro */
  3763. (PyBufferProcs*)NULL, /* tp_as_buffer */
  3764. Py_TPFLAGS_DEFAULT, /* tp_flags */
  3765. NULL, /* Documentation string */
  3766. (traverseproc)NULL, /* tp_traverse */
  3767. (inquiry)NULL, /* tp_clear */
  3768. (richcmpfunc)_wrap_PyTiledMap__tp_richcompare, /* tp_richcompare */
  3769. 0, /* tp_weaklistoffset */
  3770. (getiterfunc)NULL, /* tp_iter */
  3771. (iternextfunc)NULL, /* tp_iternext */
  3772. (struct PyMethodDef*)PyTiledMap_methods, /* tp_methods */
  3773. (struct PyMemberDef*)0, /* tp_members */
  3774. 0, /* tp_getset */
  3775. NULL, /* tp_base */
  3776. NULL, /* tp_dict */
  3777. (descrgetfunc)NULL, /* tp_descr_get */
  3778. (descrsetfunc)NULL, /* tp_descr_set */
  3779. 0, /* tp_dictoffset */
  3780. (initproc)_wrap_PyTiledMap__tp_init, /* tp_init */
  3781. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  3782. (newfunc)PyType_GenericNew, /* tp_new */
  3783. (freefunc)0, /* tp_free */
  3784. (inquiry)NULL, /* tp_is_gc */
  3785. NULL, /* tp_bases */
  3786. NULL, /* tp_mro */
  3787. NULL, /* tp_cache */
  3788. NULL, /* tp_subclasses */
  3789. NULL, /* tp_weaklist */
  3790. (destructor) NULL /* tp_del */
  3791. };
  3792. static PyObject* _wrap_PyTiledCell__get_tile(PyTiledCell *self, void * PYBINDGEN_UNUSED(closure))
  3793. {
  3794. PyObject *py_retval;
  3795. PyTiledTile *py_Tile;
  3796. if (!(self->obj->tile)) {
  3797. Py_INCREF(Py_None);
  3798. return Py_None;
  3799. }
  3800. py_Tile = PyObject_New(PyTiledTile, &PyTiledTile_Type);
  3801. py_Tile->obj = new Tiled::Tile((*self->obj->tile));
  3802. py_Tile->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  3803. py_retval = Py_BuildValue((char *) "N", py_Tile);
  3804. return py_retval;
  3805. }
  3806. static PyGetSetDef PyTiledCell__getsets[] = {
  3807. {
  3808. (char*) "tile", /* attribute name */
  3809. (getter) _wrap_PyTiledCell__get_tile, /* C function to get the attribute */
  3810. (setter) NULL, /* C function to set the attribute */
  3811. NULL, /* optional doc string */
  3812. NULL /* optional additional data for getter and setter */
  3813. },
  3814. { NULL, NULL, NULL, NULL, NULL }
  3815. };
  3816. static int
  3817. _wrap_PyTiledCell__tp_init(PyTiledCell *self, PyObject *args, PyObject *kwargs)
  3818. {
  3819. PyTiledTile *tile;
  3820. Tiled::Tile *tile_ptr;
  3821. const char *keywords[] = {"tile", NULL};
  3822. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledTile_Type, &tile)) {
  3823. return -1;
  3824. }
  3825. tile_ptr = (tile ? tile->obj : NULL);
  3826. self->obj = new Tiled::Cell(tile_ptr);
  3827. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  3828. if (tile) {
  3829. tile->obj = NULL;
  3830. }
  3831. return 0;
  3832. }
  3833. PyObject *
  3834. _wrap_PyTiledCell_isEmpty(PyTiledCell *self)
  3835. {
  3836. PyObject *py_retval;
  3837. bool retval;
  3838. retval = self->obj->isEmpty();
  3839. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  3840. return py_retval;
  3841. }
  3842. static PyMethodDef PyTiledCell_methods[] = {
  3843. {(char *) "isEmpty", (PyCFunction) _wrap_PyTiledCell_isEmpty, METH_NOARGS, NULL },
  3844. {NULL, NULL, 0, NULL}
  3845. };
  3846. static void
  3847. _wrap_PyTiledCell__tp_dealloc(PyTiledCell *self)
  3848. {
  3849. Tiled::Cell *tmp = self->obj;
  3850. self->obj = NULL;
  3851. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  3852. delete tmp;
  3853. }
  3854. self->ob_type->tp_free((PyObject*)self);
  3855. }
  3856. static PyObject*
  3857. _wrap_PyTiledCell__tp_richcompare (PyTiledCell *PYBINDGEN_UNUSED(self), PyTiledCell *other, int opid)
  3858. {
  3859. if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyTiledCell_Type)) {
  3860. Py_INCREF(Py_NotImplemented);
  3861. return Py_NotImplemented;
  3862. }
  3863. switch (opid)
  3864. {
  3865. case Py_LT:
  3866. Py_INCREF(Py_NotImplemented);
  3867. return Py_NotImplemented;
  3868. case Py_LE:
  3869. Py_INCREF(Py_NotImplemented);
  3870. return Py_NotImplemented;
  3871. case Py_EQ:
  3872. Py_INCREF(Py_NotImplemented);
  3873. return Py_NotImplemented;
  3874. case Py_NE:
  3875. Py_INCREF(Py_NotImplemented);
  3876. return Py_NotImplemented;
  3877. case Py_GE:
  3878. Py_INCREF(Py_NotImplemented);
  3879. return Py_NotImplemented;
  3880. case Py_GT:
  3881. Py_INCREF(Py_NotImplemented);
  3882. return Py_NotImplemented;
  3883. } /* closes switch (opid) */
  3884. Py_INCREF(Py_NotImplemented);
  3885. return Py_NotImplemented;
  3886. }
  3887. PyTypeObject PyTiledCell_Type = {
  3888. PyObject_HEAD_INIT(NULL)
  3889. 0, /* ob_size */
  3890. (char *) "tiled.Tiled.Cell", /* tp_name */
  3891. sizeof(PyTiledCell), /* tp_basicsize */
  3892. 0, /* tp_itemsize */
  3893. /* methods */
  3894. (destructor)_wrap_PyTiledCell__tp_dealloc, /* tp_dealloc */
  3895. (printfunc)0, /* tp_print */
  3896. (getattrfunc)NULL, /* tp_getattr */
  3897. (setattrfunc)NULL, /* tp_setattr */
  3898. (cmpfunc)NULL, /* tp_compare */
  3899. (reprfunc)NULL, /* tp_repr */
  3900. (PyNumberMethods*)NULL, /* tp_as_number */
  3901. (PySequenceMethods*)NULL, /* tp_as_sequence */
  3902. (PyMappingMethods*)NULL, /* tp_as_mapping */
  3903. (hashfunc)NULL, /* tp_hash */
  3904. (ternaryfunc)NULL, /* tp_call */
  3905. (reprfunc)NULL, /* tp_str */
  3906. (getattrofunc)NULL, /* tp_getattro */
  3907. (setattrofunc)NULL, /* tp_setattro */
  3908. (PyBufferProcs*)NULL, /* tp_as_buffer */
  3909. Py_TPFLAGS_DEFAULT, /* tp_flags */
  3910. NULL, /* Documentation string */
  3911. (traverseproc)NULL, /* tp_traverse */
  3912. (inquiry)NULL, /* tp_clear */
  3913. (richcmpfunc)_wrap_PyTiledCell__tp_richcompare, /* tp_richcompare */
  3914. 0, /* tp_weaklistoffset */
  3915. (getiterfunc)NULL, /* tp_iter */
  3916. (iternextfunc)NULL, /* tp_iternext */
  3917. (struct PyMethodDef*)PyTiledCell_methods, /* tp_methods */
  3918. (struct PyMemberDef*)0, /* tp_members */
  3919. PyTiledCell__getsets, /* tp_getset */
  3920. NULL, /* tp_base */
  3921. NULL, /* tp_dict */
  3922. (descrgetfunc)NULL, /* tp_descr_get */
  3923. (descrsetfunc)NULL, /* tp_descr_set */
  3924. 0, /* tp_dictoffset */
  3925. (initproc)_wrap_PyTiledCell__tp_init, /* tp_init */
  3926. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  3927. (newfunc)PyType_GenericNew, /* tp_new */
  3928. (freefunc)0, /* tp_free */
  3929. (inquiry)NULL, /* tp_is_gc */
  3930. NULL, /* tp_bases */
  3931. NULL, /* tp_mro */
  3932. NULL, /* tp_cache */
  3933. NULL, /* tp_subclasses */
  3934. NULL, /* tp_weaklist */
  3935. (destructor) NULL /* tp_del */
  3936. };
  3937. static int
  3938. _wrap_PyTiledTileLayer__tp_init(PyTiledTileLayer *self, PyObject *args, PyObject *kwargs)
  3939. {
  3940. const char *name;
  3941. Py_ssize_t name_len;
  3942. int x;
  3943. int y;
  3944. int w;
  3945. int h;
  3946. const char *keywords[] = {"name", "x", "y", "w", "h", NULL};
  3947. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#iiii", (char **) keywords, &name, &name_len, &x, &y, &w, &h)) {
  3948. return -1;
  3949. }
  3950. self->obj = new Tiled::TileLayer(QString::fromUtf8(name), x, y, w, h);
  3951. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  3952. return 0;
  3953. }
  3954. PyObject *
  3955. _wrap_PyTiledTileLayer_referencesTileset(PyTiledTileLayer *self, PyObject *args, PyObject *kwargs)
  3956. {
  3957. PyObject *py_retval;
  3958. bool retval;
  3959. PyTiledTileset *ts;
  3960. Tiled::Tileset *ts_ptr;
  3961. const char *keywords[] = {"ts", NULL};
  3962. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledTileset_Type, &ts)) {
  3963. return NULL;
  3964. }
  3965. ts_ptr = (ts ? ts->obj : NULL);
  3966. retval = self->obj->referencesTileset(ts_ptr);
  3967. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  3968. return py_retval;
  3969. }
  3970. PyObject *
  3971. _wrap_PyTiledTileLayer_setCell(PyTiledTileLayer *self, PyObject *args, PyObject *kwargs)
  3972. {
  3973. PyObject *py_retval;
  3974. int x;
  3975. int y;
  3976. PyTiledCell *c;
  3977. const char *keywords[] = {"x", "y", "c", NULL};
  3978. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "iiO!", (char **) keywords, &x, &y, &PyTiledCell_Type, &c)) {
  3979. return NULL;
  3980. }
  3981. self->obj->setCell(x, y, *((PyTiledCell *) c)->obj);
  3982. Py_INCREF(Py_None);
  3983. py_retval = Py_None;
  3984. return py_retval;
  3985. }
  3986. PyObject *
  3987. _wrap_PyTiledTileLayer_isEmpty(PyTiledTileLayer *self)
  3988. {
  3989. PyObject *py_retval;
  3990. bool retval;
  3991. retval = self->obj->isEmpty();
  3992. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  3993. return py_retval;
  3994. }
  3995. PyObject *
  3996. _wrap_PyTiledTileLayer_cellAt(PyTiledTileLayer *self, PyObject *args, PyObject *kwargs)
  3997. {
  3998. PyObject *py_retval;
  3999. int x;
  4000. int y;
  4001. const char *keywords[] = {"x", "y", NULL};
  4002. PyTiledCell *py_Cell;
  4003. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "ii", (char **) keywords, &x, &y)) {
  4004. return NULL;
  4005. }
  4006. Tiled::Cell retval = self->obj->cellAt(x, y);
  4007. py_Cell = PyObject_New(PyTiledCell, &PyTiledCell_Type);
  4008. py_Cell->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  4009. py_Cell->obj = new Tiled::Cell(retval);
  4010. py_retval = Py_BuildValue((char *) "N", py_Cell);
  4011. return py_retval;
  4012. }
  4013. static PyMethodDef PyTiledTileLayer_methods[] = {
  4014. {(char *) "referencesTileset", (PyCFunction) _wrap_PyTiledTileLayer_referencesTileset, METH_KEYWORDS|METH_VARARGS, NULL },
  4015. {(char *) "setCell", (PyCFunction) _wrap_PyTiledTileLayer_setCell, METH_KEYWORDS|METH_VARARGS, NULL },
  4016. {(char *) "isEmpty", (PyCFunction) _wrap_PyTiledTileLayer_isEmpty, METH_NOARGS, NULL },
  4017. {(char *) "cellAt", (PyCFunction) _wrap_PyTiledTileLayer_cellAt, METH_KEYWORDS|METH_VARARGS, NULL },
  4018. {NULL, NULL, 0, NULL}
  4019. };
  4020. static void
  4021. _wrap_PyTiledTileLayer__tp_dealloc(PyTiledTileLayer *self)
  4022. {
  4023. Tiled::TileLayer *tmp = self->obj;
  4024. self->obj = NULL;
  4025. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  4026. delete tmp;
  4027. }
  4028. self->ob_type->tp_free((PyObject*)self);
  4029. }
  4030. static PyObject*
  4031. _wrap_PyTiledTileLayer__tp_richcompare (PyTiledTileLayer *PYBINDGEN_UNUSED(self), PyTiledTileLayer *other, int opid)
  4032. {
  4033. if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyTiledTileLayer_Type)) {
  4034. Py_INCREF(Py_NotImplemented);
  4035. return Py_NotImplemented;
  4036. }
  4037. switch (opid)
  4038. {
  4039. case Py_LT:
  4040. Py_INCREF(Py_NotImplemented);
  4041. return Py_NotImplemented;
  4042. case Py_LE:
  4043. Py_INCREF(Py_NotImplemented);
  4044. return Py_NotImplemented;
  4045. case Py_EQ:
  4046. Py_INCREF(Py_NotImplemented);
  4047. return Py_NotImplemented;
  4048. case Py_NE:
  4049. Py_INCREF(Py_NotImplemented);
  4050. return Py_NotImplemented;
  4051. case Py_GE:
  4052. Py_INCREF(Py_NotImplemented);
  4053. return Py_NotImplemented;
  4054. case Py_GT:
  4055. Py_INCREF(Py_NotImplemented);
  4056. return Py_NotImplemented;
  4057. } /* closes switch (opid) */
  4058. Py_INCREF(Py_NotImplemented);
  4059. return Py_NotImplemented;
  4060. }
  4061. PyTypeObject PyTiledTileLayer_Type = {
  4062. PyObject_HEAD_INIT(NULL)
  4063. 0, /* ob_size */
  4064. (char *) "tiled.Tiled.TileLayer", /* tp_name */
  4065. sizeof(PyTiledTileLayer), /* tp_basicsize */
  4066. 0, /* tp_itemsize */
  4067. /* methods */
  4068. (destructor)_wrap_PyTiledTileLayer__tp_dealloc, /* tp_dealloc */
  4069. (printfunc)0, /* tp_print */
  4070. (getattrfunc)NULL, /* tp_getattr */
  4071. (setattrfunc)NULL, /* tp_setattr */
  4072. (cmpfunc)NULL, /* tp_compare */
  4073. (reprfunc)NULL, /* tp_repr */
  4074. (PyNumberMethods*)NULL, /* tp_as_number */
  4075. (PySequenceMethods*)NULL, /* tp_as_sequence */
  4076. (PyMappingMethods*)NULL, /* tp_as_mapping */
  4077. (hashfunc)NULL, /* tp_hash */
  4078. (ternaryfunc)NULL, /* tp_call */
  4079. (reprfunc)NULL, /* tp_str */
  4080. (getattrofunc)NULL, /* tp_getattro */
  4081. (setattrofunc)NULL, /* tp_setattro */
  4082. (PyBufferProcs*)NULL, /* tp_as_buffer */
  4083. Py_TPFLAGS_DEFAULT, /* tp_flags */
  4084. NULL, /* Documentation string */
  4085. (traverseproc)NULL, /* tp_traverse */
  4086. (inquiry)NULL, /* tp_clear */
  4087. (richcmpfunc)_wrap_PyTiledTileLayer__tp_richcompare, /* tp_richcompare */
  4088. 0, /* tp_weaklistoffset */
  4089. (getiterfunc)NULL, /* tp_iter */
  4090. (iternextfunc)NULL, /* tp_iternext */
  4091. (struct PyMethodDef*)PyTiledTileLayer_methods, /* tp_methods */
  4092. (struct PyMemberDef*)0, /* tp_members */
  4093. 0, /* tp_getset */
  4094. NULL, /* tp_base */
  4095. NULL, /* tp_dict */
  4096. (descrgetfunc)NULL, /* tp_descr_get */
  4097. (descrsetfunc)NULL, /* tp_descr_set */
  4098. 0, /* tp_dictoffset */
  4099. (initproc)_wrap_PyTiledTileLayer__tp_init, /* tp_init */
  4100. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  4101. (newfunc)PyType_GenericNew, /* tp_new */
  4102. (freefunc)0, /* tp_free */
  4103. (inquiry)NULL, /* tp_is_gc */
  4104. NULL, /* tp_bases */
  4105. NULL, /* tp_mro */
  4106. NULL, /* tp_cache */
  4107. NULL, /* tp_subclasses */
  4108. NULL, /* tp_weaklist */
  4109. (destructor) NULL /* tp_del */
  4110. };
  4111. static int
  4112. _wrap_PyTiledImageLayer__tp_init(PyTiledImageLayer *self, PyObject *args, PyObject *kwargs)
  4113. {
  4114. const char *name;
  4115. Py_ssize_t name_len;
  4116. int x;
  4117. int y;
  4118. int w;
  4119. int h;
  4120. const char *keywords[] = {"name", "x", "y", "w", "h", NULL};
  4121. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#iiii", (char **) keywords, &name, &name_len, &x, &y, &w, &h)) {
  4122. return -1;
  4123. }
  4124. self->obj = new Tiled::ImageLayer(QString::fromUtf8(name), x, y, w, h);
  4125. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  4126. return 0;
  4127. }
  4128. PyObject *
  4129. _wrap_PyTiledImageLayer_image(PyTiledImageLayer *self)
  4130. {
  4131. PyObject *py_retval;
  4132. PyQPixmap *py_QPixmap;
  4133. QPixmap const & retval = self->obj->image();
  4134. py_QPixmap = PyObject_New(PyQPixmap, &PyQPixmap_Type);
  4135. py_QPixmap->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  4136. py_QPixmap->obj = new QPixmap(retval);
  4137. py_retval = Py_BuildValue((char *) "N", py_QPixmap);
  4138. return py_retval;
  4139. }
  4140. PyObject *
  4141. _wrap_PyTiledImageLayer_loadFromImage(PyTiledImageLayer *self, PyObject *args, PyObject *kwargs)
  4142. {
  4143. PyObject *py_retval;
  4144. bool retval;
  4145. PyQImage *img;
  4146. const char *file;
  4147. Py_ssize_t file_len;
  4148. const char *keywords[] = {"img", "file", NULL};
  4149. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!s#", (char **) keywords, &PyQImage_Type, &img, &file, &file_len)) {
  4150. return NULL;
  4151. }
  4152. retval = self->obj->loadFromImage(*((PyQImage *) img)->obj, QString::fromUtf8(file));
  4153. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  4154. return py_retval;
  4155. }
  4156. PyObject *
  4157. _wrap_PyTiledImageLayer_setImage(PyTiledImageLayer *self, PyObject *args, PyObject *kwargs)
  4158. {
  4159. PyObject *py_retval;
  4160. PyQPixmap *image;
  4161. const char *keywords[] = {"image", NULL};
  4162. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQPixmap_Type, &image)) {
  4163. return NULL;
  4164. }
  4165. self->obj->setImage(*((PyQPixmap *) image)->obj);
  4166. Py_INCREF(Py_None);
  4167. py_retval = Py_None;
  4168. return py_retval;
  4169. }
  4170. static PyMethodDef PyTiledImageLayer_methods[] = {
  4171. {(char *) "image", (PyCFunction) _wrap_PyTiledImageLayer_image, METH_NOARGS, NULL },
  4172. {(char *) "loadFromImage", (PyCFunction) _wrap_PyTiledImageLayer_loadFromImage, METH_KEYWORDS|METH_VARARGS, NULL },
  4173. {(char *) "setImage", (PyCFunction) _wrap_PyTiledImageLayer_setImage, METH_KEYWORDS|METH_VARARGS, NULL },
  4174. {NULL, NULL, 0, NULL}
  4175. };
  4176. static void
  4177. _wrap_PyTiledImageLayer__tp_dealloc(PyTiledImageLayer *self)
  4178. {
  4179. Tiled::ImageLayer *tmp = self->obj;
  4180. self->obj = NULL;
  4181. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  4182. delete tmp;
  4183. }
  4184. self->ob_type->tp_free((PyObject*)self);
  4185. }
  4186. static PyObject*
  4187. _wrap_PyTiledImageLayer__tp_richcompare (PyTiledImageLayer *PYBINDGEN_UNUSED(self), PyTiledImageLayer *other, int opid)
  4188. {
  4189. if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyTiledImageLayer_Type)) {
  4190. Py_INCREF(Py_NotImplemented);
  4191. return Py_NotImplemented;
  4192. }
  4193. switch (opid)
  4194. {
  4195. case Py_LT:
  4196. Py_INCREF(Py_NotImplemented);
  4197. return Py_NotImplemented;
  4198. case Py_LE:
  4199. Py_INCREF(Py_NotImplemented);
  4200. return Py_NotImplemented;
  4201. case Py_EQ:
  4202. Py_INCREF(Py_NotImplemented);
  4203. return Py_NotImplemented;
  4204. case Py_NE:
  4205. Py_INCREF(Py_NotImplemented);
  4206. return Py_NotImplemented;
  4207. case Py_GE:
  4208. Py_INCREF(Py_NotImplemented);
  4209. return Py_NotImplemented;
  4210. case Py_GT:
  4211. Py_INCREF(Py_NotImplemented);
  4212. return Py_NotImplemented;
  4213. } /* closes switch (opid) */
  4214. Py_INCREF(Py_NotImplemented);
  4215. return Py_NotImplemented;
  4216. }
  4217. PyTypeObject PyTiledImageLayer_Type = {
  4218. PyObject_HEAD_INIT(NULL)
  4219. 0, /* ob_size */
  4220. (char *) "tiled.Tiled.ImageLayer", /* tp_name */
  4221. sizeof(PyTiledImageLayer), /* tp_basicsize */
  4222. 0, /* tp_itemsize */
  4223. /* methods */
  4224. (destructor)_wrap_PyTiledImageLayer__tp_dealloc, /* tp_dealloc */
  4225. (printfunc)0, /* tp_print */
  4226. (getattrfunc)NULL, /* tp_getattr */
  4227. (setattrfunc)NULL, /* tp_setattr */
  4228. (cmpfunc)NULL, /* tp_compare */
  4229. (reprfunc)NULL, /* tp_repr */
  4230. (PyNumberMethods*)NULL, /* tp_as_number */
  4231. (PySequenceMethods*)NULL, /* tp_as_sequence */
  4232. (PyMappingMethods*)NULL, /* tp_as_mapping */
  4233. (hashfunc)NULL, /* tp_hash */
  4234. (ternaryfunc)NULL, /* tp_call */
  4235. (reprfunc)NULL, /* tp_str */
  4236. (getattrofunc)NULL, /* tp_getattro */
  4237. (setattrofunc)NULL, /* tp_setattro */
  4238. (PyBufferProcs*)NULL, /* tp_as_buffer */
  4239. Py_TPFLAGS_DEFAULT, /* tp_flags */
  4240. NULL, /* Documentation string */
  4241. (traverseproc)NULL, /* tp_traverse */
  4242. (inquiry)NULL, /* tp_clear */
  4243. (richcmpfunc)_wrap_PyTiledImageLayer__tp_richcompare, /* tp_richcompare */
  4244. 0, /* tp_weaklistoffset */
  4245. (getiterfunc)NULL, /* tp_iter */
  4246. (iternextfunc)NULL, /* tp_iternext */
  4247. (struct PyMethodDef*)PyTiledImageLayer_methods, /* tp_methods */
  4248. (struct PyMemberDef*)0, /* tp_members */
  4249. 0, /* tp_getset */
  4250. NULL, /* tp_base */
  4251. NULL, /* tp_dict */
  4252. (descrgetfunc)NULL, /* tp_descr_get */
  4253. (descrsetfunc)NULL, /* tp_descr_set */
  4254. 0, /* tp_dictoffset */
  4255. (initproc)_wrap_PyTiledImageLayer__tp_init, /* tp_init */
  4256. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  4257. (newfunc)PyType_GenericNew, /* tp_new */
  4258. (freefunc)0, /* tp_free */
  4259. (inquiry)NULL, /* tp_is_gc */
  4260. NULL, /* tp_bases */
  4261. NULL, /* tp_mro */
  4262. NULL, /* tp_cache */
  4263. NULL, /* tp_subclasses */
  4264. NULL, /* tp_weaklist */
  4265. (destructor) NULL /* tp_del */
  4266. };
  4267. static int
  4268. _wrap_PyTiledObject__tp_init(void)
  4269. {
  4270. PyErr_SetString(PyExc_TypeError, "class 'Object' cannot be constructed ()");
  4271. return -1;
  4272. }
  4273. PyObject *
  4274. _wrap_PyTiledObject_setProperty(PyTiledObject *self, PyObject *args, PyObject *kwargs)
  4275. {
  4276. PyObject *py_retval;
  4277. const char *prop;
  4278. Py_ssize_t prop_len;
  4279. const char *val;
  4280. Py_ssize_t val_len;
  4281. const char *keywords[] = {"prop", "val", NULL};
  4282. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#s#", (char **) keywords, &prop, &prop_len, &val, &val_len)) {
  4283. return NULL;
  4284. }
  4285. self->obj->setProperty(QString::fromUtf8(prop), QString::fromUtf8(val));
  4286. Py_INCREF(Py_None);
  4287. py_retval = Py_None;
  4288. return py_retval;
  4289. }
  4290. PyObject *
  4291. _wrap_PyTiledObject_property(PyTiledObject *self, PyObject *args, PyObject *kwargs)
  4292. {
  4293. PyObject *py_retval;
  4294. QString retval;
  4295. const char *prop;
  4296. Py_ssize_t prop_len;
  4297. const char *keywords[] = {"prop", NULL};
  4298. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#", (char **) keywords, &prop, &prop_len)) {
  4299. return NULL;
  4300. }
  4301. retval = self->obj->property(QString::fromUtf8(prop));
  4302. py_retval = Py_BuildValue((char *) "s", retval.toUtf8().data());
  4303. return py_retval;
  4304. }
  4305. static PyMethodDef PyTiledObject_methods[] = {
  4306. {(char *) "setProperty", (PyCFunction) _wrap_PyTiledObject_setProperty, METH_KEYWORDS|METH_VARARGS, NULL },
  4307. {(char *) "property", (PyCFunction) _wrap_PyTiledObject_property, METH_KEYWORDS|METH_VARARGS, NULL },
  4308. {NULL, NULL, 0, NULL}
  4309. };
  4310. static void
  4311. _wrap_PyTiledObject__tp_dealloc(PyTiledObject *self)
  4312. {
  4313. Tiled::Object *tmp = self->obj;
  4314. self->obj = NULL;
  4315. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  4316. delete tmp;
  4317. }
  4318. self->ob_type->tp_free((PyObject*)self);
  4319. }
  4320. static PyObject*
  4321. _wrap_PyTiledObject__tp_richcompare (PyTiledObject *PYBINDGEN_UNUSED(self), PyTiledObject *other, int opid)
  4322. {
  4323. if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyTiledObject_Type)) {
  4324. Py_INCREF(Py_NotImplemented);
  4325. return Py_NotImplemented;
  4326. }
  4327. switch (opid)
  4328. {
  4329. case Py_LT:
  4330. Py_INCREF(Py_NotImplemented);
  4331. return Py_NotImplemented;
  4332. case Py_LE:
  4333. Py_INCREF(Py_NotImplemented);
  4334. return Py_NotImplemented;
  4335. case Py_EQ:
  4336. Py_INCREF(Py_NotImplemented);
  4337. return Py_NotImplemented;
  4338. case Py_NE:
  4339. Py_INCREF(Py_NotImplemented);
  4340. return Py_NotImplemented;
  4341. case Py_GE:
  4342. Py_INCREF(Py_NotImplemented);
  4343. return Py_NotImplemented;
  4344. case Py_GT:
  4345. Py_INCREF(Py_NotImplemented);
  4346. return Py_NotImplemented;
  4347. } /* closes switch (opid) */
  4348. Py_INCREF(Py_NotImplemented);
  4349. return Py_NotImplemented;
  4350. }
  4351. PyTypeObject PyTiledObject_Type = {
  4352. PyObject_HEAD_INIT(NULL)
  4353. 0, /* ob_size */
  4354. (char *) "tiled.Tiled.Object", /* tp_name */
  4355. sizeof(PyTiledObject), /* tp_basicsize */
  4356. 0, /* tp_itemsize */
  4357. /* methods */
  4358. (destructor)_wrap_PyTiledObject__tp_dealloc, /* tp_dealloc */
  4359. (printfunc)0, /* tp_print */
  4360. (getattrfunc)NULL, /* tp_getattr */
  4361. (setattrfunc)NULL, /* tp_setattr */
  4362. (cmpfunc)NULL, /* tp_compare */
  4363. (reprfunc)NULL, /* tp_repr */
  4364. (PyNumberMethods*)NULL, /* tp_as_number */
  4365. (PySequenceMethods*)NULL, /* tp_as_sequence */
  4366. (PyMappingMethods*)NULL, /* tp_as_mapping */
  4367. (hashfunc)NULL, /* tp_hash */
  4368. (ternaryfunc)NULL, /* tp_call */
  4369. (reprfunc)NULL, /* tp_str */
  4370. (getattrofunc)NULL, /* tp_getattro */
  4371. (setattrofunc)NULL, /* tp_setattro */
  4372. (PyBufferProcs*)NULL, /* tp_as_buffer */
  4373. Py_TPFLAGS_DEFAULT, /* tp_flags */
  4374. NULL, /* Documentation string */
  4375. (traverseproc)NULL, /* tp_traverse */
  4376. (inquiry)NULL, /* tp_clear */
  4377. (richcmpfunc)_wrap_PyTiledObject__tp_richcompare, /* tp_richcompare */
  4378. 0, /* tp_weaklistoffset */
  4379. (getiterfunc)NULL, /* tp_iter */
  4380. (iternextfunc)NULL, /* tp_iternext */
  4381. (struct PyMethodDef*)PyTiledObject_methods, /* tp_methods */
  4382. (struct PyMemberDef*)0, /* tp_members */
  4383. 0, /* tp_getset */
  4384. NULL, /* tp_base */
  4385. NULL, /* tp_dict */
  4386. (descrgetfunc)NULL, /* tp_descr_get */
  4387. (descrsetfunc)NULL, /* tp_descr_set */
  4388. 0, /* tp_dictoffset */
  4389. (initproc)_wrap_PyTiledObject__tp_init, /* tp_init */
  4390. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  4391. (newfunc)PyType_GenericNew, /* tp_new */
  4392. (freefunc)0, /* tp_free */
  4393. (inquiry)NULL, /* tp_is_gc */
  4394. NULL, /* tp_bases */
  4395. NULL, /* tp_mro */
  4396. NULL, /* tp_cache */
  4397. NULL, /* tp_subclasses */
  4398. NULL, /* tp_weaklist */
  4399. (destructor) NULL /* tp_del */
  4400. };
  4401. static int
  4402. _wrap_PyTiledMapObject__tp_init__0(PyTiledMapObject *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  4403. {
  4404. const char *keywords[] = {NULL};
  4405. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "", (char **) keywords)) {
  4406. {
  4407. PyObject *exc_type, *traceback;
  4408. PyErr_Fetch(&exc_type, return_exception, &traceback);
  4409. Py_XDECREF(exc_type);
  4410. Py_XDECREF(traceback);
  4411. }
  4412. return -1;
  4413. }
  4414. self->obj = new Tiled::MapObject();
  4415. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  4416. return 0;
  4417. }
  4418. static int
  4419. _wrap_PyTiledMapObject__tp_init__1(PyTiledMapObject *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  4420. {
  4421. const char *name;
  4422. Py_ssize_t name_len;
  4423. const char *type;
  4424. Py_ssize_t type_len;
  4425. PyQPointF *pos;
  4426. PyQSizeF *size;
  4427. const char *keywords[] = {"name", "type", "pos", "size", NULL};
  4428. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#s#O!O!", (char **) keywords, &name, &name_len, &type, &type_len, &PyQPointF_Type, &pos, &PyQSizeF_Type, &size)) {
  4429. {
  4430. PyObject *exc_type, *traceback;
  4431. PyErr_Fetch(&exc_type, return_exception, &traceback);
  4432. Py_XDECREF(exc_type);
  4433. Py_XDECREF(traceback);
  4434. }
  4435. return -1;
  4436. }
  4437. self->obj = new Tiled::MapObject(QString::fromUtf8(name), QString::fromUtf8(type), *((PyQPointF *) pos)->obj, *((PyQSizeF *) size)->obj);
  4438. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  4439. return 0;
  4440. }
  4441. int _wrap_PyTiledMapObject__tp_init(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  4442. {
  4443. int retval;
  4444. PyObject *error_list;
  4445. PyObject *exceptions[2] = {0,};
  4446. retval = _wrap_PyTiledMapObject__tp_init__0(self, args, kwargs, &exceptions[0]);
  4447. if (!exceptions[0]) {
  4448. return retval;
  4449. }
  4450. retval = _wrap_PyTiledMapObject__tp_init__1(self, args, kwargs, &exceptions[1]);
  4451. if (!exceptions[1]) {
  4452. Py_DECREF(exceptions[0]);
  4453. return retval;
  4454. }
  4455. error_list = PyList_New(2);
  4456. PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
  4457. Py_DECREF(exceptions[0]);
  4458. PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
  4459. Py_DECREF(exceptions[1]);
  4460. PyErr_SetObject(PyExc_TypeError, error_list);
  4461. Py_DECREF(error_list);
  4462. return -1;
  4463. }
  4464. PyObject *
  4465. _wrap_PyTiledMapObject_setHeight(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  4466. {
  4467. PyObject *py_retval;
  4468. float h;
  4469. const char *keywords[] = {"h", NULL};
  4470. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "f", (char **) keywords, &h)) {
  4471. return NULL;
  4472. }
  4473. self->obj->setHeight(h);
  4474. Py_INCREF(Py_None);
  4475. py_retval = Py_None;
  4476. return py_retval;
  4477. }
  4478. PyObject *
  4479. _wrap_PyTiledMapObject_rotation(PyTiledMapObject *self)
  4480. {
  4481. PyObject *py_retval;
  4482. float retval;
  4483. retval = self->obj->rotation();
  4484. py_retval = Py_BuildValue((char *) "f", retval);
  4485. return py_retval;
  4486. }
  4487. PyObject *
  4488. _wrap_PyTiledMapObject_name(PyTiledMapObject *self)
  4489. {
  4490. PyObject *py_retval;
  4491. QString retval;
  4492. retval = self->obj->name();
  4493. py_retval = Py_BuildValue((char *) "s", retval.toUtf8().data());
  4494. return py_retval;
  4495. }
  4496. PyObject *
  4497. _wrap_PyTiledMapObject_type(PyTiledMapObject *self)
  4498. {
  4499. PyObject *py_retval;
  4500. QString retval;
  4501. retval = self->obj->type();
  4502. py_retval = Py_BuildValue((char *) "s", retval.toUtf8().data());
  4503. return py_retval;
  4504. }
  4505. PyObject *
  4506. _wrap_PyTiledMapObject_setWidth(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  4507. {
  4508. PyObject *py_retval;
  4509. float w;
  4510. const char *keywords[] = {"w", NULL};
  4511. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "f", (char **) keywords, &w)) {
  4512. return NULL;
  4513. }
  4514. self->obj->setWidth(w);
  4515. Py_INCREF(Py_None);
  4516. py_retval = Py_None;
  4517. return py_retval;
  4518. }
  4519. PyObject *
  4520. _wrap_PyTiledMapObject_setVisible(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  4521. {
  4522. PyObject *py_retval;
  4523. bool v;
  4524. PyObject *py_v;
  4525. const char *keywords[] = {"v", NULL};
  4526. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O", (char **) keywords, &py_v)) {
  4527. return NULL;
  4528. }
  4529. v = (bool) PyObject_IsTrue(py_v);
  4530. self->obj->setVisible(v);
  4531. Py_INCREF(Py_None);
  4532. py_retval = Py_None;
  4533. return py_retval;
  4534. }
  4535. PyObject *
  4536. _wrap_PyTiledMapObject_setSize(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  4537. {
  4538. PyObject *py_retval;
  4539. PyQSizeF *size;
  4540. const char *keywords[] = {"size", NULL};
  4541. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQSizeF_Type, &size)) {
  4542. return NULL;
  4543. }
  4544. self->obj->setSize(*((PyQSizeF *) size)->obj);
  4545. Py_INCREF(Py_None);
  4546. py_retval = Py_None;
  4547. return py_retval;
  4548. }
  4549. PyObject *
  4550. _wrap_PyTiledMapObject_isVisible(PyTiledMapObject *self)
  4551. {
  4552. PyObject *py_retval;
  4553. bool retval;
  4554. retval = self->obj->isVisible();
  4555. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  4556. return py_retval;
  4557. }
  4558. PyObject *
  4559. _wrap_PyTiledMapObject_height(PyTiledMapObject *self)
  4560. {
  4561. PyObject *py_retval;
  4562. float retval;
  4563. retval = self->obj->height();
  4564. py_retval = Py_BuildValue((char *) "f", retval);
  4565. return py_retval;
  4566. }
  4567. PyObject *
  4568. _wrap_PyTiledMapObject_cell(PyTiledMapObject *self)
  4569. {
  4570. PyObject *py_retval;
  4571. PyTiledCell *py_Cell;
  4572. Tiled::Cell const retval = self->obj->cell();
  4573. py_Cell = PyObject_New(PyTiledCell, &PyTiledCell_Type);
  4574. py_Cell->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  4575. py_Cell->obj = new Tiled::Cell(retval);
  4576. py_retval = Py_BuildValue((char *) "N", py_Cell);
  4577. return py_retval;
  4578. }
  4579. PyObject *
  4580. _wrap_PyTiledMapObject_width(PyTiledMapObject *self)
  4581. {
  4582. PyObject *py_retval;
  4583. float retval;
  4584. retval = self->obj->width();
  4585. py_retval = Py_BuildValue((char *) "f", retval);
  4586. return py_retval;
  4587. }
  4588. PyObject *
  4589. _wrap_PyTiledMapObject_shape(PyTiledMapObject *self)
  4590. {
  4591. PyObject *py_retval;
  4592. Tiled::MapObject::Shape retval;
  4593. retval = self->obj->shape();
  4594. py_retval = Py_BuildValue((char *) "i", retval);
  4595. return py_retval;
  4596. }
  4597. PyObject *
  4598. _wrap_PyTiledMapObject_setCell(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  4599. {
  4600. PyObject *py_retval;
  4601. PyTiledCell *c;
  4602. const char *keywords[] = {"c", NULL};
  4603. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledCell_Type, &c)) {
  4604. return NULL;
  4605. }
  4606. self->obj->setCell(*((PyTiledCell *) c)->obj);
  4607. Py_INCREF(Py_None);
  4608. py_retval = Py_None;
  4609. return py_retval;
  4610. }
  4611. PyObject *
  4612. _wrap_PyTiledMapObject_setName(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  4613. {
  4614. PyObject *py_retval;
  4615. const char *n;
  4616. Py_ssize_t n_len;
  4617. const char *keywords[] = {"n", NULL};
  4618. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#", (char **) keywords, &n, &n_len)) {
  4619. return NULL;
  4620. }
  4621. self->obj->setName(QString::fromUtf8(n));
  4622. Py_INCREF(Py_None);
  4623. py_retval = Py_None;
  4624. return py_retval;
  4625. }
  4626. PyObject *
  4627. _wrap_PyTiledMapObject_setType(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  4628. {
  4629. PyObject *py_retval;
  4630. const char *n;
  4631. Py_ssize_t n_len;
  4632. const char *keywords[] = {"n", NULL};
  4633. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#", (char **) keywords, &n, &n_len)) {
  4634. return NULL;
  4635. }
  4636. self->obj->setType(QString::fromUtf8(n));
  4637. Py_INCREF(Py_None);
  4638. py_retval = Py_None;
  4639. return py_retval;
  4640. }
  4641. PyObject *
  4642. _wrap_PyTiledMapObject_setRotation(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  4643. {
  4644. PyObject *py_retval;
  4645. float r;
  4646. const char *keywords[] = {"r", NULL};
  4647. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "f", (char **) keywords, &r)) {
  4648. return NULL;
  4649. }
  4650. self->obj->setRotation(r);
  4651. Py_INCREF(Py_None);
  4652. py_retval = Py_None;
  4653. return py_retval;
  4654. }
  4655. PyObject *
  4656. _wrap_PyTiledMapObject_y(PyTiledMapObject *self)
  4657. {
  4658. PyObject *py_retval;
  4659. float retval;
  4660. retval = self->obj->y();
  4661. py_retval = Py_BuildValue((char *) "f", retval);
  4662. return py_retval;
  4663. }
  4664. PyObject *
  4665. _wrap_PyTiledMapObject_x(PyTiledMapObject *self)
  4666. {
  4667. PyObject *py_retval;
  4668. float retval;
  4669. retval = self->obj->x();
  4670. py_retval = Py_BuildValue((char *) "f", retval);
  4671. return py_retval;
  4672. }
  4673. PyObject *
  4674. _wrap_PyTiledMapObject_setPosition(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  4675. {
  4676. PyObject *py_retval;
  4677. PyQPointF *pos;
  4678. const char *keywords[] = {"pos", NULL};
  4679. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQPointF_Type, &pos)) {
  4680. return NULL;
  4681. }
  4682. self->obj->setPosition(*((PyQPointF *) pos)->obj);
  4683. Py_INCREF(Py_None);
  4684. py_retval = Py_None;
  4685. return py_retval;
  4686. }
  4687. PyObject *
  4688. _wrap_PyTiledMapObject_setX(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  4689. {
  4690. PyObject *py_retval;
  4691. float x;
  4692. const char *keywords[] = {"x", NULL};
  4693. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "f", (char **) keywords, &x)) {
  4694. return NULL;
  4695. }
  4696. self->obj->setX(x);
  4697. Py_INCREF(Py_None);
  4698. py_retval = Py_None;
  4699. return py_retval;
  4700. }
  4701. PyObject *
  4702. _wrap_PyTiledMapObject_setY(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  4703. {
  4704. PyObject *py_retval;
  4705. float y;
  4706. const char *keywords[] = {"y", NULL};
  4707. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "f", (char **) keywords, &y)) {
  4708. return NULL;
  4709. }
  4710. self->obj->setY(y);
  4711. Py_INCREF(Py_None);
  4712. py_retval = Py_None;
  4713. return py_retval;
  4714. }
  4715. PyObject *
  4716. _wrap_PyTiledMapObject_setShape(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  4717. {
  4718. PyObject *py_retval;
  4719. Tiled::MapObject::Shape s;
  4720. const char *keywords[] = {"s", NULL};
  4721. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &s)) {
  4722. return NULL;
  4723. }
  4724. self->obj->setShape(s);
  4725. Py_INCREF(Py_None);
  4726. py_retval = Py_None;
  4727. return py_retval;
  4728. }
  4729. static PyMethodDef PyTiledMapObject_methods[] = {
  4730. {(char *) "setHeight", (PyCFunction) _wrap_PyTiledMapObject_setHeight, METH_KEYWORDS|METH_VARARGS, NULL },
  4731. {(char *) "rotation", (PyCFunction) _wrap_PyTiledMapObject_rotation, METH_NOARGS, NULL },
  4732. {(char *) "name", (PyCFunction) _wrap_PyTiledMapObject_name, METH_NOARGS, NULL },
  4733. {(char *) "type", (PyCFunction) _wrap_PyTiledMapObject_type, METH_NOARGS, NULL },
  4734. {(char *) "setWidth", (PyCFunction) _wrap_PyTiledMapObject_setWidth, METH_KEYWORDS|METH_VARARGS, NULL },
  4735. {(char *) "setVisible", (PyCFunction) _wrap_PyTiledMapObject_setVisible, METH_KEYWORDS|METH_VARARGS, NULL },
  4736. {(char *) "setSize", (PyCFunction) _wrap_PyTiledMapObject_setSize, METH_KEYWORDS|METH_VARARGS, NULL },
  4737. {(char *) "isVisible", (PyCFunction) _wrap_PyTiledMapObject_isVisible, METH_NOARGS, NULL },
  4738. {(char *) "height", (PyCFunction) _wrap_PyTiledMapObject_height, METH_NOARGS, NULL },
  4739. {(char *) "cell", (PyCFunction) _wrap_PyTiledMapObject_cell, METH_NOARGS, NULL },
  4740. {(char *) "width", (PyCFunction) _wrap_PyTiledMapObject_width, METH_NOARGS, NULL },
  4741. {(char *) "shape", (PyCFunction) _wrap_PyTiledMapObject_shape, METH_NOARGS, NULL },
  4742. {(char *) "setCell", (PyCFunction) _wrap_PyTiledMapObject_setCell, METH_KEYWORDS|METH_VARARGS, NULL },
  4743. {(char *) "setName", (PyCFunction) _wrap_PyTiledMapObject_setName, METH_KEYWORDS|METH_VARARGS, NULL },
  4744. {(char *) "setType", (PyCFunction) _wrap_PyTiledMapObject_setType, METH_KEYWORDS|METH_VARARGS, NULL },
  4745. {(char *) "setRotation", (PyCFunction) _wrap_PyTiledMapObject_setRotation, METH_KEYWORDS|METH_VARARGS, NULL },
  4746. {(char *) "y", (PyCFunction) _wrap_PyTiledMapObject_y, METH_NOARGS, NULL },
  4747. {(char *) "x", (PyCFunction) _wrap_PyTiledMapObject_x, METH_NOARGS, NULL },
  4748. {(char *) "setPosition", (PyCFunction) _wrap_PyTiledMapObject_setPosition, METH_KEYWORDS|METH_VARARGS, NULL },
  4749. {(char *) "setX", (PyCFunction) _wrap_PyTiledMapObject_setX, METH_KEYWORDS|METH_VARARGS, NULL },
  4750. {(char *) "setY", (PyCFunction) _wrap_PyTiledMapObject_setY, METH_KEYWORDS|METH_VARARGS, NULL },
  4751. {(char *) "setShape", (PyCFunction) _wrap_PyTiledMapObject_setShape, METH_KEYWORDS|METH_VARARGS, NULL },
  4752. {NULL, NULL, 0, NULL}
  4753. };
  4754. static void
  4755. _wrap_PyTiledMapObject__tp_dealloc(PyTiledMapObject *self)
  4756. {
  4757. Tiled::MapObject *tmp = self->obj;
  4758. self->obj = NULL;
  4759. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  4760. delete tmp;
  4761. }
  4762. self->ob_type->tp_free((PyObject*)self);
  4763. }
  4764. static PyObject*
  4765. _wrap_PyTiledMapObject__tp_richcompare (PyTiledMapObject *PYBINDGEN_UNUSED(self), PyTiledMapObject *other, int opid)
  4766. {
  4767. if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyTiledMapObject_Type)) {
  4768. Py_INCREF(Py_NotImplemented);
  4769. return Py_NotImplemented;
  4770. }
  4771. switch (opid)
  4772. {
  4773. case Py_LT:
  4774. Py_INCREF(Py_NotImplemented);
  4775. return Py_NotImplemented;
  4776. case Py_LE:
  4777. Py_INCREF(Py_NotImplemented);
  4778. return Py_NotImplemented;
  4779. case Py_EQ:
  4780. Py_INCREF(Py_NotImplemented);
  4781. return Py_NotImplemented;
  4782. case Py_NE:
  4783. Py_INCREF(Py_NotImplemented);
  4784. return Py_NotImplemented;
  4785. case Py_GE:
  4786. Py_INCREF(Py_NotImplemented);
  4787. return Py_NotImplemented;
  4788. case Py_GT:
  4789. Py_INCREF(Py_NotImplemented);
  4790. return Py_NotImplemented;
  4791. } /* closes switch (opid) */
  4792. Py_INCREF(Py_NotImplemented);
  4793. return Py_NotImplemented;
  4794. }
  4795. PyTypeObject PyTiledMapObject_Type = {
  4796. PyObject_HEAD_INIT(NULL)
  4797. 0, /* ob_size */
  4798. (char *) "tiled.Tiled.MapObject", /* tp_name */
  4799. sizeof(PyTiledMapObject), /* tp_basicsize */
  4800. 0, /* tp_itemsize */
  4801. /* methods */
  4802. (destructor)_wrap_PyTiledMapObject__tp_dealloc, /* tp_dealloc */
  4803. (printfunc)0, /* tp_print */
  4804. (getattrfunc)NULL, /* tp_getattr */
  4805. (setattrfunc)NULL, /* tp_setattr */
  4806. (cmpfunc)NULL, /* tp_compare */
  4807. (reprfunc)NULL, /* tp_repr */
  4808. (PyNumberMethods*)NULL, /* tp_as_number */
  4809. (PySequenceMethods*)NULL, /* tp_as_sequence */
  4810. (PyMappingMethods*)NULL, /* tp_as_mapping */
  4811. (hashfunc)NULL, /* tp_hash */
  4812. (ternaryfunc)NULL, /* tp_call */
  4813. (reprfunc)NULL, /* tp_str */
  4814. (getattrofunc)NULL, /* tp_getattro */
  4815. (setattrofunc)NULL, /* tp_setattro */
  4816. (PyBufferProcs*)NULL, /* tp_as_buffer */
  4817. Py_TPFLAGS_DEFAULT, /* tp_flags */
  4818. NULL, /* Documentation string */
  4819. (traverseproc)NULL, /* tp_traverse */
  4820. (inquiry)NULL, /* tp_clear */
  4821. (richcmpfunc)_wrap_PyTiledMapObject__tp_richcompare, /* tp_richcompare */
  4822. 0, /* tp_weaklistoffset */
  4823. (getiterfunc)NULL, /* tp_iter */
  4824. (iternextfunc)NULL, /* tp_iternext */
  4825. (struct PyMethodDef*)PyTiledMapObject_methods, /* tp_methods */
  4826. (struct PyMemberDef*)0, /* tp_members */
  4827. 0, /* tp_getset */
  4828. NULL, /* tp_base */
  4829. NULL, /* tp_dict */
  4830. (descrgetfunc)NULL, /* tp_descr_get */
  4831. (descrsetfunc)NULL, /* tp_descr_set */
  4832. 0, /* tp_dictoffset */
  4833. (initproc)_wrap_PyTiledMapObject__tp_init, /* tp_init */
  4834. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  4835. (newfunc)PyType_GenericNew, /* tp_new */
  4836. (freefunc)0, /* tp_free */
  4837. (inquiry)NULL, /* tp_is_gc */
  4838. NULL, /* tp_bases */
  4839. NULL, /* tp_mro */
  4840. NULL, /* tp_cache */
  4841. NULL, /* tp_subclasses */
  4842. NULL, /* tp_weaklist */
  4843. (destructor) NULL /* tp_del */
  4844. };
  4845. static int
  4846. _wrap_PyTiledObjectGroup__tp_init(PyTiledObjectGroup *self, PyObject *args, PyObject *kwargs)
  4847. {
  4848. const char *name;
  4849. Py_ssize_t name_len;
  4850. int x;
  4851. int y;
  4852. int w;
  4853. int h;
  4854. const char *keywords[] = {"name", "x", "y", "w", "h", NULL};
  4855. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#iiii", (char **) keywords, &name, &name_len, &x, &y, &w, &h)) {
  4856. return -1;
  4857. }
  4858. self->obj = new Tiled::ObjectGroup(QString::fromUtf8(name), x, y, w, h);
  4859. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  4860. return 0;
  4861. }
  4862. PyObject *
  4863. _wrap_PyTiledObjectGroup_addObject(PyTiledObjectGroup *self, PyObject *args, PyObject *kwargs)
  4864. {
  4865. PyObject *py_retval;
  4866. PyTiledMapObject *mo;
  4867. Tiled::MapObject *mo_ptr;
  4868. const char *keywords[] = {"mo", NULL};
  4869. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledMapObject_Type, &mo)) {
  4870. return NULL;
  4871. }
  4872. mo_ptr = (mo ? mo->obj : NULL);
  4873. self->obj->addObject(mo_ptr);
  4874. if (mo) {
  4875. mo->obj = NULL;
  4876. }
  4877. Py_INCREF(Py_None);
  4878. py_retval = Py_None;
  4879. return py_retval;
  4880. }
  4881. PyObject *
  4882. _wrap_PyTiledObjectGroup_insertObject(PyTiledObjectGroup *self, PyObject *args, PyObject *kwargs)
  4883. {
  4884. PyObject *py_retval;
  4885. int idx;
  4886. PyTiledMapObject *mo;
  4887. Tiled::MapObject *mo_ptr;
  4888. const char *keywords[] = {"idx", "mo", NULL};
  4889. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "iO!", (char **) keywords, &idx, &PyTiledMapObject_Type, &mo)) {
  4890. return NULL;
  4891. }
  4892. mo_ptr = (mo ? mo->obj : NULL);
  4893. self->obj->insertObject(idx, mo_ptr);
  4894. Py_INCREF(Py_None);
  4895. py_retval = Py_None;
  4896. return py_retval;
  4897. }
  4898. PyObject *
  4899. _wrap_PyTiledObjectGroup_referencesTileset(PyTiledObjectGroup *self, PyObject *args, PyObject *kwargs)
  4900. {
  4901. PyObject *py_retval;
  4902. bool retval;
  4903. PyTiledTileset *ts;
  4904. Tiled::Tileset *ts_ptr;
  4905. const char *keywords[] = {"ts", NULL};
  4906. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledTileset_Type, &ts)) {
  4907. return NULL;
  4908. }
  4909. ts_ptr = (ts ? ts->obj : NULL);
  4910. retval = self->obj->referencesTileset(ts_ptr);
  4911. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  4912. return py_retval;
  4913. }
  4914. PyObject *
  4915. _wrap_PyTiledObjectGroup_objectAt(PyTiledObjectGroup *self, PyObject *args, PyObject *kwargs)
  4916. {
  4917. PyObject *py_retval;
  4918. Tiled::MapObject *retval;
  4919. int index;
  4920. const char *keywords[] = {"index", NULL};
  4921. PyTiledMapObject *py_MapObject;
  4922. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &index)) {
  4923. return NULL;
  4924. }
  4925. retval = self->obj->objectAt(index);
  4926. if (!(retval)) {
  4927. Py_INCREF(Py_None);
  4928. return Py_None;
  4929. }
  4930. py_MapObject = PyObject_New(PyTiledMapObject, &PyTiledMapObject_Type);
  4931. py_MapObject->obj = retval;
  4932. py_MapObject->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  4933. py_retval = Py_BuildValue((char *) "N", py_MapObject);
  4934. return py_retval;
  4935. }
  4936. PyObject *
  4937. _wrap_PyTiledObjectGroup_objectCount(PyTiledObjectGroup *self)
  4938. {
  4939. PyObject *py_retval;
  4940. int retval;
  4941. retval = self->obj->objectCount();
  4942. py_retval = Py_BuildValue((char *) "i", retval);
  4943. return py_retval;
  4944. }
  4945. PyObject *
  4946. _wrap_PyTiledObjectGroup_removeObject(PyTiledObjectGroup *self, PyObject *args, PyObject *kwargs)
  4947. {
  4948. PyObject *py_retval;
  4949. int retval;
  4950. PyTiledMapObject *mo;
  4951. Tiled::MapObject *mo_ptr;
  4952. const char *keywords[] = {"mo", NULL};
  4953. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledMapObject_Type, &mo)) {
  4954. return NULL;
  4955. }
  4956. mo_ptr = (mo ? mo->obj : NULL);
  4957. retval = self->obj->removeObject(mo_ptr);
  4958. py_retval = Py_BuildValue((char *) "i", retval);
  4959. return py_retval;
  4960. }
  4961. static PyMethodDef PyTiledObjectGroup_methods[] = {
  4962. {(char *) "addObject", (PyCFunction) _wrap_PyTiledObjectGroup_addObject, METH_KEYWORDS|METH_VARARGS, NULL },
  4963. {(char *) "insertObject", (PyCFunction) _wrap_PyTiledObjectGroup_insertObject, METH_KEYWORDS|METH_VARARGS, NULL },
  4964. {(char *) "referencesTileset", (PyCFunction) _wrap_PyTiledObjectGroup_referencesTileset, METH_KEYWORDS|METH_VARARGS, NULL },
  4965. {(char *) "objectAt", (PyCFunction) _wrap_PyTiledObjectGroup_objectAt, METH_KEYWORDS|METH_VARARGS, NULL },
  4966. {(char *) "objectCount", (PyCFunction) _wrap_PyTiledObjectGroup_objectCount, METH_NOARGS, NULL },
  4967. {(char *) "removeObject", (PyCFunction) _wrap_PyTiledObjectGroup_removeObject, METH_KEYWORDS|METH_VARARGS, NULL },
  4968. {NULL, NULL, 0, NULL}
  4969. };
  4970. static void
  4971. _wrap_PyTiledObjectGroup__tp_dealloc(PyTiledObjectGroup *self)
  4972. {
  4973. Tiled::ObjectGroup *tmp = self->obj;
  4974. self->obj = NULL;
  4975. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  4976. delete tmp;
  4977. }
  4978. self->ob_type->tp_free((PyObject*)self);
  4979. }
  4980. static PyObject*
  4981. _wrap_PyTiledObjectGroup__tp_richcompare (PyTiledObjectGroup *PYBINDGEN_UNUSED(self), PyTiledObjectGroup *other, int opid)
  4982. {
  4983. if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyTiledObjectGroup_Type)) {
  4984. Py_INCREF(Py_NotImplemented);
  4985. return Py_NotImplemented;
  4986. }
  4987. switch (opid)
  4988. {
  4989. case Py_LT:
  4990. Py_INCREF(Py_NotImplemented);
  4991. return Py_NotImplemented;
  4992. case Py_LE:
  4993. Py_INCREF(Py_NotImplemented);
  4994. return Py_NotImplemented;
  4995. case Py_EQ:
  4996. Py_INCREF(Py_NotImplemented);
  4997. return Py_NotImplemented;
  4998. case Py_NE:
  4999. Py_INCREF(Py_NotImplemented);
  5000. return Py_NotImplemented;
  5001. case Py_GE:
  5002. Py_INCREF(Py_NotImplemented);
  5003. return Py_NotImplemented;
  5004. case Py_GT:
  5005. Py_INCREF(Py_NotImplemented);
  5006. return Py_NotImplemented;
  5007. } /* closes switch (opid) */
  5008. Py_INCREF(Py_NotImplemented);
  5009. return Py_NotImplemented;
  5010. }
  5011. PyTypeObject PyTiledObjectGroup_Type = {
  5012. PyObject_HEAD_INIT(NULL)
  5013. 0, /* ob_size */
  5014. (char *) "tiled.Tiled.ObjectGroup", /* tp_name */
  5015. sizeof(PyTiledObjectGroup), /* tp_basicsize */
  5016. 0, /* tp_itemsize */
  5017. /* methods */
  5018. (destructor)_wrap_PyTiledObjectGroup__tp_dealloc, /* tp_dealloc */
  5019. (printfunc)0, /* tp_print */
  5020. (getattrfunc)NULL, /* tp_getattr */
  5021. (setattrfunc)NULL, /* tp_setattr */
  5022. (cmpfunc)NULL, /* tp_compare */
  5023. (reprfunc)NULL, /* tp_repr */
  5024. (PyNumberMethods*)NULL, /* tp_as_number */
  5025. (PySequenceMethods*)NULL, /* tp_as_sequence */
  5026. (PyMappingMethods*)NULL, /* tp_as_mapping */
  5027. (hashfunc)NULL, /* tp_hash */
  5028. (ternaryfunc)NULL, /* tp_call */
  5029. (reprfunc)NULL, /* tp_str */
  5030. (getattrofunc)NULL, /* tp_getattro */
  5031. (setattrofunc)NULL, /* tp_setattro */
  5032. (PyBufferProcs*)NULL, /* tp_as_buffer */
  5033. Py_TPFLAGS_DEFAULT, /* tp_flags */
  5034. NULL, /* Documentation string */
  5035. (traverseproc)NULL, /* tp_traverse */
  5036. (inquiry)NULL, /* tp_clear */
  5037. (richcmpfunc)_wrap_PyTiledObjectGroup__tp_richcompare, /* tp_richcompare */
  5038. 0, /* tp_weaklistoffset */
  5039. (getiterfunc)NULL, /* tp_iter */
  5040. (iternextfunc)NULL, /* tp_iternext */
  5041. (struct PyMethodDef*)PyTiledObjectGroup_methods, /* tp_methods */
  5042. (struct PyMemberDef*)0, /* tp_members */
  5043. 0, /* tp_getset */
  5044. NULL, /* tp_base */
  5045. NULL, /* tp_dict */
  5046. (descrgetfunc)NULL, /* tp_descr_get */
  5047. (descrsetfunc)NULL, /* tp_descr_set */
  5048. 0, /* tp_dictoffset */
  5049. (initproc)_wrap_PyTiledObjectGroup__tp_init, /* tp_init */
  5050. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  5051. (newfunc)PyType_GenericNew, /* tp_new */
  5052. (freefunc)0, /* tp_free */
  5053. (inquiry)NULL, /* tp_is_gc */
  5054. NULL, /* tp_bases */
  5055. NULL, /* tp_mro */
  5056. NULL, /* tp_cache */
  5057. NULL, /* tp_subclasses */
  5058. NULL, /* tp_weaklist */
  5059. (destructor) NULL /* tp_del */
  5060. };
  5061. static int
  5062. _wrap_PyTiledLoggingInterface__tp_init(void)
  5063. {
  5064. PyErr_SetString(PyExc_TypeError, "class 'LoggingInterface' cannot be constructed ()");
  5065. return -1;
  5066. }
  5067. PyObject *
  5068. _wrap_PyTiledLoggingInterface_log(PyTiledLoggingInterface *self, PyObject *args, PyObject *kwargs)
  5069. {
  5070. PyObject *py_retval;
  5071. Tiled::LoggingInterface::OutputType type;
  5072. const char *msg;
  5073. Py_ssize_t msg_len;
  5074. const char *keywords[] = {"type", "msg", NULL};
  5075. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "is#", (char **) keywords, &type, &msg, &msg_len)) {
  5076. return NULL;
  5077. }
  5078. self->obj->log(type, QString::fromUtf8(msg));
  5079. Py_INCREF(Py_None);
  5080. py_retval = Py_None;
  5081. return py_retval;
  5082. }
  5083. static PyMethodDef PyTiledLoggingInterface_methods[] = {
  5084. {(char *) "log", (PyCFunction) _wrap_PyTiledLoggingInterface_log, METH_KEYWORDS|METH_VARARGS, NULL },
  5085. {NULL, NULL, 0, NULL}
  5086. };
  5087. static void
  5088. _wrap_PyTiledLoggingInterface__tp_dealloc(PyTiledLoggingInterface *self)
  5089. {
  5090. self->obj = NULL;
  5091. self->ob_type->tp_free((PyObject*)self);
  5092. }
  5093. static PyObject*
  5094. _wrap_PyTiledLoggingInterface__tp_richcompare (PyTiledLoggingInterface *PYBINDGEN_UNUSED(self), PyTiledLoggingInterface *other, int opid)
  5095. {
  5096. if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyTiledLoggingInterface_Type)) {
  5097. Py_INCREF(Py_NotImplemented);
  5098. return Py_NotImplemented;
  5099. }
  5100. switch (opid)
  5101. {
  5102. case Py_LT:
  5103. Py_INCREF(Py_NotImplemented);
  5104. return Py_NotImplemented;
  5105. case Py_LE:
  5106. Py_INCREF(Py_NotImplemented);
  5107. return Py_NotImplemented;
  5108. case Py_EQ:
  5109. Py_INCREF(Py_NotImplemented);
  5110. return Py_NotImplemented;
  5111. case Py_NE:
  5112. Py_INCREF(Py_NotImplemented);
  5113. return Py_NotImplemented;
  5114. case Py_GE:
  5115. Py_INCREF(Py_NotImplemented);
  5116. return Py_NotImplemented;
  5117. case Py_GT:
  5118. Py_INCREF(Py_NotImplemented);
  5119. return Py_NotImplemented;
  5120. } /* closes switch (opid) */
  5121. Py_INCREF(Py_NotImplemented);
  5122. return Py_NotImplemented;
  5123. }
  5124. PyTypeObject PyTiledLoggingInterface_Type = {
  5125. PyObject_HEAD_INIT(NULL)
  5126. 0, /* ob_size */
  5127. (char *) "tiled.Tiled.LoggingInterface", /* tp_name */
  5128. sizeof(PyTiledLoggingInterface), /* tp_basicsize */
  5129. 0, /* tp_itemsize */
  5130. /* methods */
  5131. (destructor)_wrap_PyTiledLoggingInterface__tp_dealloc, /* tp_dealloc */
  5132. (printfunc)0, /* tp_print */
  5133. (getattrfunc)NULL, /* tp_getattr */
  5134. (setattrfunc)NULL, /* tp_setattr */
  5135. (cmpfunc)NULL, /* tp_compare */
  5136. (reprfunc)NULL, /* tp_repr */
  5137. (PyNumberMethods*)NULL, /* tp_as_number */
  5138. (PySequenceMethods*)NULL, /* tp_as_sequence */
  5139. (PyMappingMethods*)NULL, /* tp_as_mapping */
  5140. (hashfunc)NULL, /* tp_hash */
  5141. (ternaryfunc)NULL, /* tp_call */
  5142. (reprfunc)NULL, /* tp_str */
  5143. (getattrofunc)NULL, /* tp_getattro */
  5144. (setattrofunc)NULL, /* tp_setattro */
  5145. (PyBufferProcs*)NULL, /* tp_as_buffer */
  5146. Py_TPFLAGS_DEFAULT, /* tp_flags */
  5147. NULL, /* Documentation string */
  5148. (traverseproc)NULL, /* tp_traverse */
  5149. (inquiry)NULL, /* tp_clear */
  5150. (richcmpfunc)_wrap_PyTiledLoggingInterface__tp_richcompare, /* tp_richcompare */
  5151. 0, /* tp_weaklistoffset */
  5152. (getiterfunc)NULL, /* tp_iter */
  5153. (iternextfunc)NULL, /* tp_iternext */
  5154. (struct PyMethodDef*)PyTiledLoggingInterface_methods, /* tp_methods */
  5155. (struct PyMemberDef*)0, /* tp_members */
  5156. 0, /* tp_getset */
  5157. NULL, /* tp_base */
  5158. NULL, /* tp_dict */
  5159. (descrgetfunc)NULL, /* tp_descr_get */
  5160. (descrsetfunc)NULL, /* tp_descr_set */
  5161. 0, /* tp_dictoffset */
  5162. (initproc)_wrap_PyTiledLoggingInterface__tp_init, /* tp_init */
  5163. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  5164. (newfunc)PyType_GenericNew, /* tp_new */
  5165. (freefunc)0, /* tp_free */
  5166. (inquiry)NULL, /* tp_is_gc */
  5167. NULL, /* tp_bases */
  5168. NULL, /* tp_mro */
  5169. NULL, /* tp_cache */
  5170. NULL, /* tp_subclasses */
  5171. NULL, /* tp_weaklist */
  5172. (destructor) NULL /* tp_del */
  5173. };
  5174. /* --- enumerations --- */
  5175. static PyObject *
  5176. inittiled_Tiled(void)
  5177. {
  5178. PyObject *m;
  5179. m = Py_InitModule3((char *) "tiled.Tiled", tiled_Tiled_functions, NULL);
  5180. if (m == NULL) {
  5181. return NULL;
  5182. }
  5183. /* Register the 'Tiled::Tile' class */
  5184. if (PyType_Ready(&PyTiledTile_Type)) {
  5185. return NULL;
  5186. }
  5187. PyModule_AddObject(m, (char *) "Tile", (PyObject *) &PyTiledTile_Type);
  5188. /* Register the 'Tiled::Tileset' class */
  5189. if (PyType_Ready(&PyTiledTileset_Type)) {
  5190. return NULL;
  5191. }
  5192. PyModule_AddObject(m, (char *) "Tileset", (PyObject *) &PyTiledTileset_Type);
  5193. /* Register the 'Tiled::Layer' class */
  5194. if (PyType_Ready(&PyTiledLayer_Type)) {
  5195. return NULL;
  5196. }
  5197. PyModule_AddObject(m, (char *) "Layer", (PyObject *) &PyTiledLayer_Type);
  5198. /* Register the 'Tiled::Properties' class */
  5199. if (PyType_Ready(&PyTiledProperties_Type)) {
  5200. return NULL;
  5201. }
  5202. PyModule_AddObject(m, (char *) "Properties", (PyObject *) &PyTiledProperties_Type);
  5203. /* Register the 'Tiled::Map' class */
  5204. if (PyType_Ready(&PyTiledMap_Type)) {
  5205. return NULL;
  5206. }
  5207. PyModule_AddObject(m, (char *) "Map", (PyObject *) &PyTiledMap_Type);
  5208. /* Register the 'Tiled::Cell' class */
  5209. if (PyType_Ready(&PyTiledCell_Type)) {
  5210. return NULL;
  5211. }
  5212. PyModule_AddObject(m, (char *) "Cell", (PyObject *) &PyTiledCell_Type);
  5213. /* Register the 'Tiled::TileLayer' class */
  5214. PyTiledTileLayer_Type.tp_base = &PyTiledLayer_Type;
  5215. if (PyType_Ready(&PyTiledTileLayer_Type)) {
  5216. return NULL;
  5217. }
  5218. PyModule_AddObject(m, (char *) "TileLayer", (PyObject *) &PyTiledTileLayer_Type);
  5219. /* Register the 'Tiled::ImageLayer' class */
  5220. if (PyType_Ready(&PyTiledImageLayer_Type)) {
  5221. return NULL;
  5222. }
  5223. PyModule_AddObject(m, (char *) "ImageLayer", (PyObject *) &PyTiledImageLayer_Type);
  5224. /* Register the 'Tiled::Object' class */
  5225. if (PyType_Ready(&PyTiledObject_Type)) {
  5226. return NULL;
  5227. }
  5228. PyModule_AddObject(m, (char *) "Object", (PyObject *) &PyTiledObject_Type);
  5229. /* Register the 'Tiled::MapObject' class */
  5230. PyTiledMapObject_Type.tp_base = &PyTiledObject_Type;
  5231. if (PyType_Ready(&PyTiledMapObject_Type)) {
  5232. return NULL;
  5233. }
  5234. PyModule_AddObject(m, (char *) "MapObject", (PyObject *) &PyTiledMapObject_Type);
  5235. /* Register the 'Tiled::ObjectGroup' class */
  5236. PyTiledObjectGroup_Type.tp_base = &PyTiledLayer_Type;
  5237. if (PyType_Ready(&PyTiledObjectGroup_Type)) {
  5238. return NULL;
  5239. }
  5240. PyModule_AddObject(m, (char *) "ObjectGroup", (PyObject *) &PyTiledObjectGroup_Type);
  5241. /* Register the 'Tiled::LoggingInterface' class */
  5242. if (PyType_Ready(&PyTiledLoggingInterface_Type)) {
  5243. return NULL;
  5244. }
  5245. PyModule_AddObject(m, (char *) "LoggingInterface", (PyObject *) &PyTiledLoggingInterface_Type);
  5246. {
  5247. PyObject *tmp_value;
  5248. // Tiled::Map::Unknown
  5249. tmp_value = PyInt_FromLong(Tiled::Map::Unknown);
  5250. PyDict_SetItemString((PyObject*) PyTiledMap_Type.tp_dict, "Unknown", tmp_value);
  5251. Py_DECREF(tmp_value);
  5252. // Tiled::Map::Orthogonal
  5253. tmp_value = PyInt_FromLong(Tiled::Map::Orthogonal);
  5254. PyDict_SetItemString((PyObject*) PyTiledMap_Type.tp_dict, "Orthogonal", tmp_value);
  5255. Py_DECREF(tmp_value);
  5256. // Tiled::Map::Isometric
  5257. tmp_value = PyInt_FromLong(Tiled::Map::Isometric);
  5258. PyDict_SetItemString((PyObject*) PyTiledMap_Type.tp_dict, "Isometric", tmp_value);
  5259. Py_DECREF(tmp_value);
  5260. }
  5261. {
  5262. PyObject *tmp_value;
  5263. // Tiled::MapObject::Rectangle
  5264. tmp_value = PyInt_FromLong(Tiled::MapObject::Rectangle);
  5265. PyDict_SetItemString((PyObject*) PyTiledMapObject_Type.tp_dict, "Rectangle", tmp_value);
  5266. Py_DECREF(tmp_value);
  5267. // Tiled::MapObject::Polygon
  5268. tmp_value = PyInt_FromLong(Tiled::MapObject::Polygon);
  5269. PyDict_SetItemString((PyObject*) PyTiledMapObject_Type.tp_dict, "Polygon", tmp_value);
  5270. Py_DECREF(tmp_value);
  5271. // Tiled::MapObject::Polyline
  5272. tmp_value = PyInt_FromLong(Tiled::MapObject::Polyline);
  5273. PyDict_SetItemString((PyObject*) PyTiledMapObject_Type.tp_dict, "Polyline", tmp_value);
  5274. Py_DECREF(tmp_value);
  5275. }
  5276. {
  5277. PyObject *tmp_value;
  5278. // Tiled::LoggingInterface::INFO
  5279. tmp_value = PyInt_FromLong(Tiled::LoggingInterface::INFO);
  5280. PyDict_SetItemString((PyObject*) PyTiledLoggingInterface_Type.tp_dict, "INFO", tmp_value);
  5281. Py_DECREF(tmp_value);
  5282. // Tiled::LoggingInterface::ERROR
  5283. tmp_value = PyInt_FromLong(Tiled::LoggingInterface::ERROR);
  5284. PyDict_SetItemString((PyObject*) PyTiledLoggingInterface_Type.tp_dict, "ERROR", tmp_value);
  5285. Py_DECREF(tmp_value);
  5286. }
  5287. return m;
  5288. }
  5289. /* --- module functions --- */
  5290. PyObject *
  5291. _wrap_tiled_isTileLayerAt(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs)
  5292. {
  5293. PyObject *py_retval;
  5294. bool retval;
  5295. PyTiledMap *map;
  5296. Tiled::Map *map_ptr;
  5297. int idx;
  5298. const char *keywords[] = {"map", "idx", NULL};
  5299. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!i", (char **) keywords, &PyTiledMap_Type, &map, &idx)) {
  5300. return NULL;
  5301. }
  5302. map_ptr = (map ? map->obj : NULL);
  5303. retval = isTileLayerAt(map_ptr, idx);
  5304. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  5305. return py_retval;
  5306. }
  5307. PyObject * _wrap_tiled_isTileLayerAt(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs);
  5308. PyObject *
  5309. _wrap_tiled_loadTilesetFromFile(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs)
  5310. {
  5311. PyObject *py_retval;
  5312. bool retval;
  5313. PyTiledTileset *ts;
  5314. Tiled::Tileset *ts_ptr;
  5315. const char *file;
  5316. Py_ssize_t file_len;
  5317. const char *keywords[] = {"ts", "file", NULL};
  5318. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!s#", (char **) keywords, &PyTiledTileset_Type, &ts, &file, &file_len)) {
  5319. return NULL;
  5320. }
  5321. ts_ptr = (ts ? ts->obj : NULL);
  5322. retval = loadTilesetFromFile(ts_ptr, QString::fromUtf8(file));
  5323. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  5324. return py_retval;
  5325. }
  5326. PyObject * _wrap_tiled_loadTilesetFromFile(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs);
  5327. PyObject *
  5328. _wrap_tiled_objectGroupAt(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs)
  5329. {
  5330. PyObject *py_retval;
  5331. Tiled::ObjectGroup *retval;
  5332. PyTiledMap *map;
  5333. Tiled::Map *map_ptr;
  5334. int idx;
  5335. const char *keywords[] = {"map", "idx", NULL};
  5336. PyTiledObjectGroup *py_ObjectGroup;
  5337. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!i", (char **) keywords, &PyTiledMap_Type, &map, &idx)) {
  5338. return NULL;
  5339. }
  5340. map_ptr = (map ? map->obj : NULL);
  5341. retval = objectGroupAt(map_ptr, idx);
  5342. if (!(retval)) {
  5343. Py_INCREF(Py_None);
  5344. return Py_None;
  5345. }
  5346. py_ObjectGroup = PyObject_New(PyTiledObjectGroup, &PyTiledObjectGroup_Type);
  5347. py_ObjectGroup->obj = retval;
  5348. py_ObjectGroup->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  5349. py_retval = Py_BuildValue((char *) "N", py_ObjectGroup);
  5350. return py_retval;
  5351. }
  5352. PyObject * _wrap_tiled_objectGroupAt(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs);
  5353. PyObject *
  5354. _wrap_tiled_isObjectGroupAt(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs)
  5355. {
  5356. PyObject *py_retval;
  5357. bool retval;
  5358. PyTiledMap *map;
  5359. Tiled::Map *map_ptr;
  5360. int idx;
  5361. const char *keywords[] = {"map", "idx", NULL};
  5362. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!i", (char **) keywords, &PyTiledMap_Type, &map, &idx)) {
  5363. return NULL;
  5364. }
  5365. map_ptr = (map ? map->obj : NULL);
  5366. retval = isObjectGroupAt(map_ptr, idx);
  5367. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  5368. return py_retval;
  5369. }
  5370. PyObject * _wrap_tiled_isObjectGroupAt(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs);
  5371. PyObject *
  5372. _wrap_tiled_tileLayerAt(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs)
  5373. {
  5374. PyObject *py_retval;
  5375. Tiled::TileLayer *retval;
  5376. PyTiledMap *map;
  5377. Tiled::Map *map_ptr;
  5378. int idx;
  5379. const char *keywords[] = {"map", "idx", NULL};
  5380. PyTiledTileLayer *py_TileLayer;
  5381. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!i", (char **) keywords, &PyTiledMap_Type, &map, &idx)) {
  5382. return NULL;
  5383. }
  5384. map_ptr = (map ? map->obj : NULL);
  5385. retval = tileLayerAt(map_ptr, idx);
  5386. if (!(retval)) {
  5387. Py_INCREF(Py_None);
  5388. return Py_None;
  5389. }
  5390. py_TileLayer = PyObject_New(PyTiledTileLayer, &PyTiledTileLayer_Type);
  5391. py_TileLayer->obj = retval;
  5392. py_TileLayer->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  5393. py_retval = Py_BuildValue((char *) "N", py_TileLayer);
  5394. return py_retval;
  5395. }
  5396. PyObject * _wrap_tiled_tileLayerAt(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs);
  5397. static PyMethodDef tiled_functions[] = {
  5398. {(char *) "isTileLayerAt", (PyCFunction) _wrap_tiled_isTileLayerAt, METH_KEYWORDS|METH_VARARGS, NULL },
  5399. {(char *) "loadTilesetFromFile", (PyCFunction) _wrap_tiled_loadTilesetFromFile, METH_KEYWORDS|METH_VARARGS, NULL },
  5400. {(char *) "objectGroupAt", (PyCFunction) _wrap_tiled_objectGroupAt, METH_KEYWORDS|METH_VARARGS, NULL },
  5401. {(char *) "isObjectGroupAt", (PyCFunction) _wrap_tiled_isObjectGroupAt, METH_KEYWORDS|METH_VARARGS, NULL },
  5402. {(char *) "tileLayerAt", (PyCFunction) _wrap_tiled_tileLayerAt, METH_KEYWORDS|METH_VARARGS, NULL },
  5403. {NULL, NULL, 0, NULL}
  5404. };
  5405. /* --- classes --- */
  5406. static int
  5407. _wrap_PyPythonPythonScript__tp_init(void)
  5408. {
  5409. PyErr_SetString(PyExc_TypeError, "class 'PythonScript' cannot be constructed ()");
  5410. return -1;
  5411. }
  5412. static PyMethodDef PyPythonPythonScript_methods[] = {
  5413. {NULL, NULL, 0, NULL}
  5414. };
  5415. static void
  5416. PyPythonPythonScript__tp_clear(PyPythonPythonScript *self)
  5417. {
  5418. Py_CLEAR(self->inst_dict);
  5419. Python::PythonScript *tmp = self->obj;
  5420. self->obj = NULL;
  5421. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  5422. delete tmp;
  5423. }
  5424. }
  5425. static int
  5426. PyPythonPythonScript__tp_traverse(PyPythonPythonScript *self, visitproc visit, void *arg)
  5427. {
  5428. Py_VISIT(self->inst_dict);
  5429. return 0;
  5430. }
  5431. static void
  5432. _wrap_PyPythonPythonScript__tp_dealloc(PyPythonPythonScript *self)
  5433. {
  5434. PyPythonPythonScript__tp_clear(self);
  5435. self->ob_type->tp_free((PyObject*)self);
  5436. }
  5437. static PyObject*
  5438. _wrap_PyPythonPythonScript__tp_richcompare (PyPythonPythonScript *PYBINDGEN_UNUSED(self), PyPythonPythonScript *other, int opid)
  5439. {
  5440. if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyPythonPythonScript_Type)) {
  5441. Py_INCREF(Py_NotImplemented);
  5442. return Py_NotImplemented;
  5443. }
  5444. switch (opid)
  5445. {
  5446. case Py_LT:
  5447. Py_INCREF(Py_NotImplemented);
  5448. return Py_NotImplemented;
  5449. case Py_LE:
  5450. Py_INCREF(Py_NotImplemented);
  5451. return Py_NotImplemented;
  5452. case Py_EQ:
  5453. Py_INCREF(Py_NotImplemented);
  5454. return Py_NotImplemented;
  5455. case Py_NE:
  5456. Py_INCREF(Py_NotImplemented);
  5457. return Py_NotImplemented;
  5458. case Py_GE:
  5459. Py_INCREF(Py_NotImplemented);
  5460. return Py_NotImplemented;
  5461. case Py_GT:
  5462. Py_INCREF(Py_NotImplemented);
  5463. return Py_NotImplemented;
  5464. } /* closes switch (opid) */
  5465. Py_INCREF(Py_NotImplemented);
  5466. return Py_NotImplemented;
  5467. }
  5468. PyTypeObject PyPythonPythonScript_Type = {
  5469. PyObject_HEAD_INIT(NULL)
  5470. 0, /* ob_size */
  5471. (char *) "tiled.PythonScript", /* tp_name */
  5472. sizeof(PyPythonPythonScript), /* tp_basicsize */
  5473. 0, /* tp_itemsize */
  5474. /* methods */
  5475. (destructor)_wrap_PyPythonPythonScript__tp_dealloc, /* tp_dealloc */
  5476. (printfunc)0, /* tp_print */
  5477. (getattrfunc)NULL, /* tp_getattr */
  5478. (setattrfunc)NULL, /* tp_setattr */
  5479. (cmpfunc)NULL, /* tp_compare */
  5480. (reprfunc)NULL, /* tp_repr */
  5481. (PyNumberMethods*)NULL, /* tp_as_number */
  5482. (PySequenceMethods*)NULL, /* tp_as_sequence */
  5483. (PyMappingMethods*)NULL, /* tp_as_mapping */
  5484. (hashfunc)NULL, /* tp_hash */
  5485. (ternaryfunc)NULL, /* tp_call */
  5486. (reprfunc)NULL, /* tp_str */
  5487. (getattrofunc)NULL, /* tp_getattro */
  5488. (setattrofunc)NULL, /* tp_setattro */
  5489. (PyBufferProcs*)NULL, /* tp_as_buffer */
  5490. Py_TPFLAGS_BASETYPE|Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC, /* tp_flags */
  5491. NULL, /* Documentation string */
  5492. (traverseproc)PyPythonPythonScript__tp_traverse, /* tp_traverse */
  5493. (inquiry)PyPythonPythonScript__tp_clear, /* tp_clear */
  5494. (richcmpfunc)_wrap_PyPythonPythonScript__tp_richcompare, /* tp_richcompare */
  5495. 0, /* tp_weaklistoffset */
  5496. (getiterfunc)NULL, /* tp_iter */
  5497. (iternextfunc)NULL, /* tp_iternext */
  5498. (struct PyMethodDef*)PyPythonPythonScript_methods, /* tp_methods */
  5499. (struct PyMemberDef*)0, /* tp_members */
  5500. 0, /* tp_getset */
  5501. NULL, /* tp_base */
  5502. NULL, /* tp_dict */
  5503. (descrgetfunc)NULL, /* tp_descr_get */
  5504. (descrsetfunc)NULL, /* tp_descr_set */
  5505. offsetof(PyPythonPythonScript, inst_dict), /* tp_dictoffset */
  5506. (initproc)_wrap_PyPythonPythonScript__tp_init, /* tp_init */
  5507. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  5508. (newfunc)PyType_GenericNew, /* tp_new */
  5509. (freefunc)0, /* tp_free */
  5510. (inquiry)NULL, /* tp_is_gc */
  5511. NULL, /* tp_bases */
  5512. NULL, /* tp_mro */
  5513. NULL, /* tp_cache */
  5514. NULL, /* tp_subclasses */
  5515. NULL, /* tp_weaklist */
  5516. (destructor) NULL /* tp_del */
  5517. };
  5518. PyMODINIT_FUNC
  5519. #if defined(__GNUC__) && __GNUC__ >= 4
  5520. __attribute__ ((visibility("default")))
  5521. #endif
  5522. inittiled(void)
  5523. {
  5524. PyObject *m;
  5525. PyObject *submodule;
  5526. m = Py_InitModule3((char *) "tiled", tiled_functions, NULL);
  5527. if (m == NULL) {
  5528. return;
  5529. }
  5530. /* Register the 'Python::PythonScript' class */
  5531. if (PyType_Ready(&PyPythonPythonScript_Type)) {
  5532. return;
  5533. }
  5534. PyModule_AddObject(m, (char *) "Plugin", (PyObject *) &PyPythonPythonScript_Type);
  5535. submodule = inittiled_qt();
  5536. if (submodule == NULL) {
  5537. return;
  5538. }
  5539. Py_INCREF(submodule);
  5540. PyModule_AddObject(m, (char *) "qt", submodule);
  5541. submodule = inittiled_Tiled();
  5542. if (submodule == NULL) {
  5543. return;
  5544. }
  5545. Py_INCREF(submodule);
  5546. PyModule_AddObject(m, (char *) "Tiled", submodule);
  5547. }
  5548. PyObject* _wrap_convert_c2py__Tiled__LoggingInterface(Tiled::LoggingInterface *cvalue)
  5549. {
  5550. PyObject *py_retval;
  5551. PyTiledLoggingInterface *py_LoggingInterface;
  5552. py_LoggingInterface = PyObject_New(PyTiledLoggingInterface, &PyTiledLoggingInterface_Type);
  5553. py_LoggingInterface->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  5554. py_LoggingInterface->obj = cvalue;
  5555. py_retval = Py_BuildValue((char *) "N", py_LoggingInterface);
  5556. return py_retval;
  5557. }
  5558. int _wrap_convert_py2c__Tiled__Map___star__(PyObject *value, Tiled::Map * *address)
  5559. {
  5560. PyObject *py_retval;
  5561. PyTiledMap *tmp_Map;
  5562. py_retval = Py_BuildValue((char *) "(O)", value);
  5563. if (!PyArg_ParseTuple(py_retval, (char *) "O!", &PyTiledMap_Type, &tmp_Map)) {
  5564. Py_DECREF(py_retval);
  5565. return 0;
  5566. }
  5567. *address = new Tiled::Map(*tmp_Map->obj);
  5568. Py_DECREF(py_retval);
  5569. return 1;
  5570. }
  5571. PyObject* _wrap_convert_c2py__Tiled__Map_const(Tiled::Map const *cvalue)
  5572. {
  5573. PyObject *py_retval;
  5574. PyTiledMap *py_Map;
  5575. py_Map = PyObject_New(PyTiledMap, &PyTiledMap_Type);
  5576. py_Map->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  5577. py_Map->obj = new Tiled::Map(*cvalue);
  5578. py_retval = Py_BuildValue((char *) "N", py_Map);
  5579. return py_retval;
  5580. }