PageRenderTime 86ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 1ms

/src/plugins/python/pythonbind.cpp

http://github.com/bjorn/tiled
C++ | 8025 lines | 6790 code | 1121 blank | 114 comment | 294 complexity | 066bf7b2c10cc0ae8e4f27c2d90a2a8c MD5 | raw file
Possible License(s): Apache-2.0, GPL-2.0, LGPL-2.1, AGPL-1.0
  1. #ifdef __MINGW32__
  2. #include <cmath> // included before Python.h to fix ::hypot not declared issue
  3. #endif
  4. /* This file was generated by PyBindGen 0.0.0.0 */
  5. #define PY_SSIZE_T_CLEAN
  6. #include <Python.h>
  7. #include <stddef.h>
  8. #if PY_VERSION_HEX >= 0x03000000
  9. #if PY_VERSION_HEX >= 0x03050000
  10. typedef PyAsyncMethods* cmpfunc;
  11. #else
  12. typedef void* cmpfunc;
  13. #endif
  14. #define PyCObject_FromVoidPtr(a, b) PyCapsule_New(a, NULL, b)
  15. #define PyCObject_AsVoidPtr(a) PyCapsule_GetPointer(a, NULL)
  16. #define PyString_FromString(a) PyBytes_FromString(a)
  17. #define Py_TPFLAGS_CHECKTYPES 0 /* this flag doesn't exist in python 3 */
  18. #endif
  19. #if __GNUC__ > 2
  20. # define PYBINDGEN_UNUSED(param) param __attribute__((__unused__))
  21. #elif __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
  22. # define PYBINDGEN_UNUSED(param) __attribute__((__unused__)) param
  23. #else
  24. # define PYBINDGEN_UNUSED(param) param
  25. #endif /* !__GNUC__ */
  26. #ifndef _PyBindGenWrapperFlags_defined_
  27. #define _PyBindGenWrapperFlags_defined_
  28. typedef enum _PyBindGenWrapperFlags {
  29. PYBINDGEN_WRAPPER_FLAG_NONE = 0,
  30. PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED = (1<<0),
  31. } PyBindGenWrapperFlags;
  32. #endif
  33. #include "pythonplugin.h"
  34. #include "grouplayer.h"
  35. #include "imagelayer.h"
  36. #include "layer.h"
  37. #include "logginginterface.h"
  38. #include "map.h"
  39. #include "mapobject.h"
  40. #include "objectgroup.h"
  41. #include "tile.h"
  42. #include "tilelayer.h"
  43. #include "tileset.h"
  44. #include "tilesetmanager.h"
  45. #include <QImage>
  46. #include <QFileDialog>
  47. #include <QWidget>
  48. #include <QFlags>
  49. /* --- forward declarations --- */
  50. typedef struct {
  51. PyObject_HEAD
  52. Python::PythonScript *obj;
  53. PyObject *inst_dict;
  54. PyBindGenWrapperFlags flags:8;
  55. } PyPythonPythonScript;
  56. extern PyTypeObject PyPythonPythonScript_Type;
  57. /* --- forward declarations --- */
  58. typedef struct {
  59. PyObject_HEAD
  60. QPoint *obj;
  61. PyBindGenWrapperFlags flags:8;
  62. } PyQPoint;
  63. extern PyTypeObject PyQPoint_Type;
  64. typedef struct {
  65. PyObject_HEAD
  66. QPointF *obj;
  67. PyBindGenWrapperFlags flags:8;
  68. } PyQPointF;
  69. extern PyTypeObject PyQPointF_Type;
  70. typedef struct {
  71. PyObject_HEAD
  72. QSize *obj;
  73. PyBindGenWrapperFlags flags:8;
  74. } PyQSize;
  75. extern PyTypeObject PyQSize_Type;
  76. typedef struct {
  77. PyObject_HEAD
  78. QSizeF *obj;
  79. PyBindGenWrapperFlags flags:8;
  80. } PyQSizeF;
  81. extern PyTypeObject PyQSizeF_Type;
  82. typedef struct {
  83. PyObject_HEAD
  84. QRgb *obj;
  85. PyBindGenWrapperFlags flags:8;
  86. } PyQRgb;
  87. extern PyTypeObject PyQRgb_Type;
  88. typedef struct {
  89. PyObject_HEAD
  90. QColor *obj;
  91. PyBindGenWrapperFlags flags:8;
  92. } PyQColor;
  93. extern PyTypeObject PyQColor_Type;
  94. typedef struct {
  95. PyObject_HEAD
  96. QImage *obj;
  97. PyBindGenWrapperFlags flags:8;
  98. } PyQImage;
  99. extern PyTypeObject PyQImage_Type;
  100. typedef struct {
  101. PyObject_HEAD
  102. QPixmap *obj;
  103. PyBindGenWrapperFlags flags:8;
  104. } PyQPixmap;
  105. extern PyTypeObject PyQPixmap_Type;
  106. typedef struct {
  107. PyObject_HEAD
  108. QWidget *obj;
  109. PyBindGenWrapperFlags flags:8;
  110. } PyQWidget;
  111. extern PyTypeObject PyQWidget_Type;
  112. typedef struct {
  113. PyObject_HEAD
  114. QFileDialog *obj;
  115. PyBindGenWrapperFlags flags:8;
  116. } PyQFileDialog;
  117. extern PyTypeObject PyQFileDialog_Type;
  118. typedef struct {
  119. PyObject_HEAD
  120. QVector<QRgb> *obj;
  121. } PyQVector__lt__QRgb__gt__;
  122. typedef struct {
  123. PyObject_HEAD
  124. PyQVector__lt__QRgb__gt__ *container;
  125. QVector<QRgb>::iterator *iterator;
  126. } PyQVector__lt__QRgb__gt__Iter;
  127. extern PyTypeObject PyQVector__lt__QRgb__gt___Type;
  128. extern PyTypeObject PyQVector__lt__QRgb__gt__Iter_Type;
  129. int _wrap_convert_py2c__QVector__lt___QRgb___gt__(PyObject *arg, QVector<QRgb> *container);
  130. typedef struct {
  131. PyObject_HEAD
  132. QList<QString> *obj;
  133. } PyQList__lt__QString__gt__;
  134. typedef struct {
  135. PyObject_HEAD
  136. PyQList__lt__QString__gt__ *container;
  137. QList<QString>::iterator *iterator;
  138. } PyQList__lt__QString__gt__Iter;
  139. extern PyTypeObject PyQList__lt__QString__gt___Type;
  140. extern PyTypeObject PyQList__lt__QString__gt__Iter_Type;
  141. int _wrap_convert_py2c__QList__lt___QString___gt__(PyObject *arg, QList<QString> *container);
  142. /* --- forward declarations --- */
  143. typedef struct {
  144. PyObject_HEAD
  145. Tiled::Properties *obj;
  146. PyBindGenWrapperFlags flags:8;
  147. } PyTiledProperties;
  148. extern PyTypeObject PyTiledProperties_Type;
  149. typedef struct {
  150. PyObject_HEAD
  151. Tiled::Object *obj;
  152. PyBindGenWrapperFlags flags:8;
  153. } PyTiledObject;
  154. extern PyTypeObject PyTiledObject_Type;
  155. typedef struct {
  156. PyObject_HEAD
  157. Tiled::Tile *obj;
  158. PyBindGenWrapperFlags flags:8;
  159. } PyTiledTile;
  160. extern PyTypeObject PyTiledTile_Type;
  161. typedef struct {
  162. PyObject_HEAD
  163. Tiled::Tileset *obj;
  164. PyBindGenWrapperFlags flags:8;
  165. } PyTiledTileset;
  166. extern PyTypeObject PyTiledTileset_Type;
  167. typedef struct {
  168. PyObject_HEAD
  169. Tiled::SharedTileset *obj;
  170. PyBindGenWrapperFlags flags:8;
  171. } PyTiledSharedTileset;
  172. extern PyTypeObject PyTiledSharedTileset_Type;
  173. typedef struct {
  174. PyObject_HEAD
  175. Tiled::Layer *obj;
  176. PyBindGenWrapperFlags flags:8;
  177. } PyTiledLayer;
  178. extern PyTypeObject PyTiledLayer_Type;
  179. typedef struct {
  180. PyObject_HEAD
  181. Tiled::Map *obj;
  182. PyBindGenWrapperFlags flags:8;
  183. } PyTiledMap;
  184. extern PyTypeObject PyTiledMap_Type;
  185. typedef struct {
  186. PyObject_HEAD
  187. Tiled::Cell *obj;
  188. PyBindGenWrapperFlags flags:8;
  189. } PyTiledCell;
  190. extern PyTypeObject PyTiledCell_Type;
  191. typedef struct {
  192. PyObject_HEAD
  193. Tiled::TileLayer *obj;
  194. PyBindGenWrapperFlags flags:8;
  195. } PyTiledTileLayer;
  196. extern PyTypeObject PyTiledTileLayer_Type;
  197. typedef struct {
  198. PyObject_HEAD
  199. Tiled::ImageLayer *obj;
  200. PyBindGenWrapperFlags flags:8;
  201. } PyTiledImageLayer;
  202. extern PyTypeObject PyTiledImageLayer_Type;
  203. typedef struct {
  204. PyObject_HEAD
  205. Tiled::GroupLayer *obj;
  206. PyBindGenWrapperFlags flags:8;
  207. } PyTiledGroupLayer;
  208. extern PyTypeObject PyTiledGroupLayer_Type;
  209. typedef struct {
  210. PyObject_HEAD
  211. Tiled::ObjectGroup *obj;
  212. PyBindGenWrapperFlags flags:8;
  213. } PyTiledObjectGroup;
  214. extern PyTypeObject PyTiledObjectGroup_Type;
  215. typedef struct {
  216. PyObject_HEAD
  217. Tiled::MapObject *obj;
  218. PyBindGenWrapperFlags flags:8;
  219. } PyTiledMapObject;
  220. extern PyTypeObject PyTiledMapObject_Type;
  221. typedef struct {
  222. PyObject_HEAD
  223. Tiled::LoggingInterface *obj;
  224. PyBindGenWrapperFlags flags:8;
  225. } PyTiledLoggingInterface;
  226. extern PyTypeObject PyTiledLoggingInterface_Type;
  227. #ifndef _MSC_VER
  228. #pragma GCC diagnostic ignored "-Wmissing-field-initializers"
  229. #endif
  230. int _wrap_convert_py2c__QRgb(PyObject *value, QRgb *address);
  231. int _wrap_convert_py2c__QString(PyObject *value, QString *address);
  232. static PyMethodDef tiled_qt_functions[] = {
  233. {NULL, NULL, 0, NULL}
  234. };
  235. /* --- classes --- */
  236. static int
  237. _wrap_PyQPoint__tp_init__0(PyQPoint *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  238. {
  239. PyQPoint *ctor_arg;
  240. const char *keywords[] = {"ctor_arg", NULL};
  241. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQPoint_Type, &ctor_arg)) {
  242. {
  243. PyObject *exc_type, *traceback;
  244. PyErr_Fetch(&exc_type, return_exception, &traceback);
  245. Py_XDECREF(exc_type);
  246. Py_XDECREF(traceback);
  247. }
  248. return -1;
  249. }
  250. self->obj = new QPoint(*((PyQPoint *) ctor_arg)->obj);
  251. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  252. return 0;
  253. }
  254. static int
  255. _wrap_PyQPoint__tp_init__1(PyQPoint *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  256. {
  257. int x;
  258. int y;
  259. const char *keywords[] = {"x", "y", NULL};
  260. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "ii", (char **) keywords, &x, &y)) {
  261. {
  262. PyObject *exc_type, *traceback;
  263. PyErr_Fetch(&exc_type, return_exception, &traceback);
  264. Py_XDECREF(exc_type);
  265. Py_XDECREF(traceback);
  266. }
  267. return -1;
  268. }
  269. self->obj = new QPoint(x, y);
  270. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  271. return 0;
  272. }
  273. int _wrap_PyQPoint__tp_init(PyQPoint *self, PyObject *args, PyObject *kwargs)
  274. {
  275. int retval;
  276. PyObject *error_list;
  277. PyObject *exceptions[2] = {0,};
  278. retval = _wrap_PyQPoint__tp_init__0(self, args, kwargs, &exceptions[0]);
  279. if (!exceptions[0]) {
  280. return retval;
  281. }
  282. retval = _wrap_PyQPoint__tp_init__1(self, args, kwargs, &exceptions[1]);
  283. if (!exceptions[1]) {
  284. Py_DECREF(exceptions[0]);
  285. return retval;
  286. }
  287. error_list = PyList_New(2);
  288. PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
  289. Py_DECREF(exceptions[0]);
  290. PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
  291. Py_DECREF(exceptions[1]);
  292. PyErr_SetObject(PyExc_TypeError, error_list);
  293. Py_DECREF(error_list);
  294. return -1;
  295. }
  296. PyObject *
  297. _wrap_PyQPoint_setX(PyQPoint *self, PyObject *args, PyObject *kwargs)
  298. {
  299. PyObject *py_retval;
  300. int x;
  301. const char *keywords[] = {"x", NULL};
  302. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &x)) {
  303. return NULL;
  304. }
  305. self->obj->setX(x);
  306. Py_INCREF(Py_None);
  307. py_retval = Py_None;
  308. return py_retval;
  309. }
  310. PyObject *
  311. _wrap_PyQPoint_setY(PyQPoint *self, PyObject *args, PyObject *kwargs)
  312. {
  313. PyObject *py_retval;
  314. int y;
  315. const char *keywords[] = {"y", NULL};
  316. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &y)) {
  317. return NULL;
  318. }
  319. self->obj->setY(y);
  320. Py_INCREF(Py_None);
  321. py_retval = Py_None;
  322. return py_retval;
  323. }
  324. PyObject *
  325. _wrap_PyQPoint_x(PyQPoint *self)
  326. {
  327. PyObject *py_retval;
  328. int retval;
  329. retval = self->obj->x();
  330. py_retval = Py_BuildValue((char *) "i", retval);
  331. return py_retval;
  332. }
  333. PyObject *
  334. _wrap_PyQPoint_y(PyQPoint *self)
  335. {
  336. PyObject *py_retval;
  337. int retval;
  338. retval = self->obj->y();
  339. py_retval = Py_BuildValue((char *) "i", retval);
  340. return py_retval;
  341. }
  342. static PyObject*
  343. _wrap_PyQPoint__copy__(PyQPoint *self)
  344. {
  345. PyQPoint *py_copy;
  346. py_copy = PyObject_New(PyQPoint, &PyQPoint_Type);
  347. py_copy->obj = new QPoint(*self->obj);
  348. py_copy->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  349. return (PyObject*) py_copy;
  350. }
  351. static PyMethodDef PyQPoint_methods[] = {
  352. {(char *) "setX", (PyCFunction) _wrap_PyQPoint_setX, METH_KEYWORDS|METH_VARARGS, "setX(x)\n\ntype: x: int" },
  353. {(char *) "setY", (PyCFunction) _wrap_PyQPoint_setY, METH_KEYWORDS|METH_VARARGS, "setY(y)\n\ntype: y: int" },
  354. {(char *) "x", (PyCFunction) _wrap_PyQPoint_x, METH_NOARGS, "x()\n\n" },
  355. {(char *) "y", (PyCFunction) _wrap_PyQPoint_y, METH_NOARGS, "y()\n\n" },
  356. {(char *) "__copy__", (PyCFunction) _wrap_PyQPoint__copy__, METH_NOARGS, NULL},
  357. {NULL, NULL, 0, NULL}
  358. };
  359. static void
  360. _wrap_PyQPoint__tp_dealloc(PyQPoint *self)
  361. {
  362. QPoint *tmp = self->obj;
  363. self->obj = NULL;
  364. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  365. delete tmp;
  366. }
  367. Py_TYPE(self)->tp_free((PyObject*)self);
  368. }
  369. PyTypeObject PyQPoint_Type = {
  370. PyVarObject_HEAD_INIT(NULL, 0)
  371. (char *) "tiled.qt.QPoint", /* tp_name */
  372. sizeof(PyQPoint), /* tp_basicsize */
  373. 0, /* tp_itemsize */
  374. /* methods */
  375. (destructor)_wrap_PyQPoint__tp_dealloc, /* tp_dealloc */
  376. (printfunc)0, /* tp_print */
  377. (getattrfunc)NULL, /* tp_getattr */
  378. (setattrfunc)NULL, /* tp_setattr */
  379. #if PY_MAJOR_VERSION >= 3
  380. NULL,
  381. #else
  382. (cmpfunc)NULL, /* tp_compare */
  383. #endif
  384. (reprfunc)NULL, /* tp_repr */
  385. (PyNumberMethods*)NULL, /* tp_as_number */
  386. (PySequenceMethods*)NULL, /* tp_as_sequence */
  387. (PyMappingMethods*)NULL, /* tp_as_mapping */
  388. (hashfunc)NULL, /* tp_hash */
  389. (ternaryfunc)NULL, /* tp_call */
  390. (reprfunc)NULL, /* tp_str */
  391. (getattrofunc)NULL, /* tp_getattro */
  392. (setattrofunc)NULL, /* tp_setattro */
  393. (PyBufferProcs*)NULL, /* tp_as_buffer */
  394. Py_TPFLAGS_DEFAULT, /* tp_flags */
  395. "QPoint(ctor_arg)\nQPoint(x, y)", /* Documentation string */
  396. (traverseproc)NULL, /* tp_traverse */
  397. (inquiry)NULL, /* tp_clear */
  398. (richcmpfunc)NULL, /* tp_richcompare */
  399. 0, /* tp_weaklistoffset */
  400. (getiterfunc)NULL, /* tp_iter */
  401. (iternextfunc)NULL, /* tp_iternext */
  402. (struct PyMethodDef*)PyQPoint_methods, /* tp_methods */
  403. (struct PyMemberDef*)0, /* tp_members */
  404. 0, /* tp_getset */
  405. NULL, /* tp_base */
  406. NULL, /* tp_dict */
  407. (descrgetfunc)NULL, /* tp_descr_get */
  408. (descrsetfunc)NULL, /* tp_descr_set */
  409. 0, /* tp_dictoffset */
  410. (initproc)_wrap_PyQPoint__tp_init, /* tp_init */
  411. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  412. (newfunc)PyType_GenericNew, /* tp_new */
  413. (freefunc)0, /* tp_free */
  414. (inquiry)NULL, /* tp_is_gc */
  415. NULL, /* tp_bases */
  416. NULL, /* tp_mro */
  417. NULL, /* tp_cache */
  418. NULL, /* tp_subclasses */
  419. NULL, /* tp_weaklist */
  420. (destructor) NULL /* tp_del */
  421. };
  422. static int
  423. _wrap_PyQPointF__tp_init__0(PyQPointF *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  424. {
  425. PyQPointF *ctor_arg;
  426. const char *keywords[] = {"ctor_arg", NULL};
  427. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQPointF_Type, &ctor_arg)) {
  428. {
  429. PyObject *exc_type, *traceback;
  430. PyErr_Fetch(&exc_type, return_exception, &traceback);
  431. Py_XDECREF(exc_type);
  432. Py_XDECREF(traceback);
  433. }
  434. return -1;
  435. }
  436. self->obj = new QPointF(*((PyQPointF *) ctor_arg)->obj);
  437. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  438. return 0;
  439. }
  440. static int
  441. _wrap_PyQPointF__tp_init__1(PyQPointF *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  442. {
  443. double x;
  444. double y;
  445. const char *keywords[] = {"x", "y", NULL};
  446. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "dd", (char **) keywords, &x, &y)) {
  447. {
  448. PyObject *exc_type, *traceback;
  449. PyErr_Fetch(&exc_type, return_exception, &traceback);
  450. Py_XDECREF(exc_type);
  451. Py_XDECREF(traceback);
  452. }
  453. return -1;
  454. }
  455. self->obj = new QPointF(x, y);
  456. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  457. return 0;
  458. }
  459. int _wrap_PyQPointF__tp_init(PyQPointF *self, PyObject *args, PyObject *kwargs)
  460. {
  461. int retval;
  462. PyObject *error_list;
  463. PyObject *exceptions[2] = {0,};
  464. retval = _wrap_PyQPointF__tp_init__0(self, args, kwargs, &exceptions[0]);
  465. if (!exceptions[0]) {
  466. return retval;
  467. }
  468. retval = _wrap_PyQPointF__tp_init__1(self, args, kwargs, &exceptions[1]);
  469. if (!exceptions[1]) {
  470. Py_DECREF(exceptions[0]);
  471. return retval;
  472. }
  473. error_list = PyList_New(2);
  474. PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
  475. Py_DECREF(exceptions[0]);
  476. PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
  477. Py_DECREF(exceptions[1]);
  478. PyErr_SetObject(PyExc_TypeError, error_list);
  479. Py_DECREF(error_list);
  480. return -1;
  481. }
  482. PyObject *
  483. _wrap_PyQPointF_setX(PyQPointF *self, PyObject *args, PyObject *kwargs)
  484. {
  485. PyObject *py_retval;
  486. double x;
  487. const char *keywords[] = {"x", NULL};
  488. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "d", (char **) keywords, &x)) {
  489. return NULL;
  490. }
  491. self->obj->setX(x);
  492. Py_INCREF(Py_None);
  493. py_retval = Py_None;
  494. return py_retval;
  495. }
  496. PyObject *
  497. _wrap_PyQPointF_setY(PyQPointF *self, PyObject *args, PyObject *kwargs)
  498. {
  499. PyObject *py_retval;
  500. double y;
  501. const char *keywords[] = {"y", NULL};
  502. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "d", (char **) keywords, &y)) {
  503. return NULL;
  504. }
  505. self->obj->setY(y);
  506. Py_INCREF(Py_None);
  507. py_retval = Py_None;
  508. return py_retval;
  509. }
  510. PyObject *
  511. _wrap_PyQPointF_x(PyQPointF *self)
  512. {
  513. PyObject *py_retval;
  514. double retval;
  515. retval = self->obj->x();
  516. py_retval = Py_BuildValue((char *) "d", retval);
  517. return py_retval;
  518. }
  519. PyObject *
  520. _wrap_PyQPointF_y(PyQPointF *self)
  521. {
  522. PyObject *py_retval;
  523. double retval;
  524. retval = self->obj->y();
  525. py_retval = Py_BuildValue((char *) "d", retval);
  526. return py_retval;
  527. }
  528. static PyObject*
  529. _wrap_PyQPointF__copy__(PyQPointF *self)
  530. {
  531. PyQPointF *py_copy;
  532. py_copy = PyObject_New(PyQPointF, &PyQPointF_Type);
  533. py_copy->obj = new QPointF(*self->obj);
  534. py_copy->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  535. return (PyObject*) py_copy;
  536. }
  537. static PyMethodDef PyQPointF_methods[] = {
  538. {(char *) "setX", (PyCFunction) _wrap_PyQPointF_setX, METH_KEYWORDS|METH_VARARGS, "setX(x)\n\ntype: x: double" },
  539. {(char *) "setY", (PyCFunction) _wrap_PyQPointF_setY, METH_KEYWORDS|METH_VARARGS, "setY(y)\n\ntype: y: double" },
  540. {(char *) "x", (PyCFunction) _wrap_PyQPointF_x, METH_NOARGS, "x()\n\n" },
  541. {(char *) "y", (PyCFunction) _wrap_PyQPointF_y, METH_NOARGS, "y()\n\n" },
  542. {(char *) "__copy__", (PyCFunction) _wrap_PyQPointF__copy__, METH_NOARGS, NULL},
  543. {NULL, NULL, 0, NULL}
  544. };
  545. static void
  546. _wrap_PyQPointF__tp_dealloc(PyQPointF *self)
  547. {
  548. QPointF *tmp = self->obj;
  549. self->obj = NULL;
  550. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  551. delete tmp;
  552. }
  553. Py_TYPE(self)->tp_free((PyObject*)self);
  554. }
  555. PyTypeObject PyQPointF_Type = {
  556. PyVarObject_HEAD_INIT(NULL, 0)
  557. (char *) "tiled.qt.QPointF", /* tp_name */
  558. sizeof(PyQPointF), /* tp_basicsize */
  559. 0, /* tp_itemsize */
  560. /* methods */
  561. (destructor)_wrap_PyQPointF__tp_dealloc, /* tp_dealloc */
  562. (printfunc)0, /* tp_print */
  563. (getattrfunc)NULL, /* tp_getattr */
  564. (setattrfunc)NULL, /* tp_setattr */
  565. #if PY_MAJOR_VERSION >= 3
  566. NULL,
  567. #else
  568. (cmpfunc)NULL, /* tp_compare */
  569. #endif
  570. (reprfunc)NULL, /* tp_repr */
  571. (PyNumberMethods*)NULL, /* tp_as_number */
  572. (PySequenceMethods*)NULL, /* tp_as_sequence */
  573. (PyMappingMethods*)NULL, /* tp_as_mapping */
  574. (hashfunc)NULL, /* tp_hash */
  575. (ternaryfunc)NULL, /* tp_call */
  576. (reprfunc)NULL, /* tp_str */
  577. (getattrofunc)NULL, /* tp_getattro */
  578. (setattrofunc)NULL, /* tp_setattro */
  579. (PyBufferProcs*)NULL, /* tp_as_buffer */
  580. Py_TPFLAGS_DEFAULT, /* tp_flags */
  581. "QPointF(ctor_arg)\nQPointF(x, y)", /* Documentation string */
  582. (traverseproc)NULL, /* tp_traverse */
  583. (inquiry)NULL, /* tp_clear */
  584. (richcmpfunc)NULL, /* tp_richcompare */
  585. 0, /* tp_weaklistoffset */
  586. (getiterfunc)NULL, /* tp_iter */
  587. (iternextfunc)NULL, /* tp_iternext */
  588. (struct PyMethodDef*)PyQPointF_methods, /* tp_methods */
  589. (struct PyMemberDef*)0, /* tp_members */
  590. 0, /* tp_getset */
  591. NULL, /* tp_base */
  592. NULL, /* tp_dict */
  593. (descrgetfunc)NULL, /* tp_descr_get */
  594. (descrsetfunc)NULL, /* tp_descr_set */
  595. 0, /* tp_dictoffset */
  596. (initproc)_wrap_PyQPointF__tp_init, /* tp_init */
  597. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  598. (newfunc)PyType_GenericNew, /* tp_new */
  599. (freefunc)0, /* tp_free */
  600. (inquiry)NULL, /* tp_is_gc */
  601. NULL, /* tp_bases */
  602. NULL, /* tp_mro */
  603. NULL, /* tp_cache */
  604. NULL, /* tp_subclasses */
  605. NULL, /* tp_weaklist */
  606. (destructor) NULL /* tp_del */
  607. };
  608. static int
  609. _wrap_PyQSize__tp_init__0(PyQSize *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  610. {
  611. PyQSize *ctor_arg;
  612. const char *keywords[] = {"ctor_arg", NULL};
  613. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQSize_Type, &ctor_arg)) {
  614. {
  615. PyObject *exc_type, *traceback;
  616. PyErr_Fetch(&exc_type, return_exception, &traceback);
  617. Py_XDECREF(exc_type);
  618. Py_XDECREF(traceback);
  619. }
  620. return -1;
  621. }
  622. self->obj = new QSize(*((PyQSize *) ctor_arg)->obj);
  623. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  624. return 0;
  625. }
  626. static int
  627. _wrap_PyQSize__tp_init__1(PyQSize *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  628. {
  629. int w;
  630. int h;
  631. const char *keywords[] = {"w", "h", NULL};
  632. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "ii", (char **) keywords, &w, &h)) {
  633. {
  634. PyObject *exc_type, *traceback;
  635. PyErr_Fetch(&exc_type, return_exception, &traceback);
  636. Py_XDECREF(exc_type);
  637. Py_XDECREF(traceback);
  638. }
  639. return -1;
  640. }
  641. self->obj = new QSize(w, h);
  642. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  643. return 0;
  644. }
  645. int _wrap_PyQSize__tp_init(PyQSize *self, PyObject *args, PyObject *kwargs)
  646. {
  647. int retval;
  648. PyObject *error_list;
  649. PyObject *exceptions[2] = {0,};
  650. retval = _wrap_PyQSize__tp_init__0(self, args, kwargs, &exceptions[0]);
  651. if (!exceptions[0]) {
  652. return retval;
  653. }
  654. retval = _wrap_PyQSize__tp_init__1(self, args, kwargs, &exceptions[1]);
  655. if (!exceptions[1]) {
  656. Py_DECREF(exceptions[0]);
  657. return retval;
  658. }
  659. error_list = PyList_New(2);
  660. PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
  661. Py_DECREF(exceptions[0]);
  662. PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
  663. Py_DECREF(exceptions[1]);
  664. PyErr_SetObject(PyExc_TypeError, error_list);
  665. Py_DECREF(error_list);
  666. return -1;
  667. }
  668. PyObject *
  669. _wrap_PyQSize_height(PyQSize *self)
  670. {
  671. PyObject *py_retval;
  672. int retval;
  673. retval = self->obj->height();
  674. py_retval = Py_BuildValue((char *) "i", retval);
  675. return py_retval;
  676. }
  677. PyObject *
  678. _wrap_PyQSize_setHeight(PyQSize *self, PyObject *args, PyObject *kwargs)
  679. {
  680. PyObject *py_retval;
  681. int h;
  682. const char *keywords[] = {"h", NULL};
  683. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &h)) {
  684. return NULL;
  685. }
  686. self->obj->setHeight(h);
  687. Py_INCREF(Py_None);
  688. py_retval = Py_None;
  689. return py_retval;
  690. }
  691. PyObject *
  692. _wrap_PyQSize_setWidth(PyQSize *self, PyObject *args, PyObject *kwargs)
  693. {
  694. PyObject *py_retval;
  695. int w;
  696. const char *keywords[] = {"w", NULL};
  697. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &w)) {
  698. return NULL;
  699. }
  700. self->obj->setWidth(w);
  701. Py_INCREF(Py_None);
  702. py_retval = Py_None;
  703. return py_retval;
  704. }
  705. PyObject *
  706. _wrap_PyQSize_width(PyQSize *self)
  707. {
  708. PyObject *py_retval;
  709. int retval;
  710. retval = self->obj->width();
  711. py_retval = Py_BuildValue((char *) "i", retval);
  712. return py_retval;
  713. }
  714. static PyObject*
  715. _wrap_PyQSize__copy__(PyQSize *self)
  716. {
  717. PyQSize *py_copy;
  718. py_copy = PyObject_New(PyQSize, &PyQSize_Type);
  719. py_copy->obj = new QSize(*self->obj);
  720. py_copy->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  721. return (PyObject*) py_copy;
  722. }
  723. static PyMethodDef PyQSize_methods[] = {
  724. {(char *) "height", (PyCFunction) _wrap_PyQSize_height, METH_NOARGS, "height()\n\n" },
  725. {(char *) "setHeight", (PyCFunction) _wrap_PyQSize_setHeight, METH_KEYWORDS|METH_VARARGS, "setHeight(h)\n\ntype: h: int" },
  726. {(char *) "setWidth", (PyCFunction) _wrap_PyQSize_setWidth, METH_KEYWORDS|METH_VARARGS, "setWidth(w)\n\ntype: w: int" },
  727. {(char *) "width", (PyCFunction) _wrap_PyQSize_width, METH_NOARGS, "width()\n\n" },
  728. {(char *) "__copy__", (PyCFunction) _wrap_PyQSize__copy__, METH_NOARGS, NULL},
  729. {NULL, NULL, 0, NULL}
  730. };
  731. static void
  732. _wrap_PyQSize__tp_dealloc(PyQSize *self)
  733. {
  734. QSize *tmp = self->obj;
  735. self->obj = NULL;
  736. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  737. delete tmp;
  738. }
  739. Py_TYPE(self)->tp_free((PyObject*)self);
  740. }
  741. PyTypeObject PyQSize_Type = {
  742. PyVarObject_HEAD_INIT(NULL, 0)
  743. (char *) "tiled.qt.QSize", /* tp_name */
  744. sizeof(PyQSize), /* tp_basicsize */
  745. 0, /* tp_itemsize */
  746. /* methods */
  747. (destructor)_wrap_PyQSize__tp_dealloc, /* tp_dealloc */
  748. (printfunc)0, /* tp_print */
  749. (getattrfunc)NULL, /* tp_getattr */
  750. (setattrfunc)NULL, /* tp_setattr */
  751. #if PY_MAJOR_VERSION >= 3
  752. NULL,
  753. #else
  754. (cmpfunc)NULL, /* tp_compare */
  755. #endif
  756. (reprfunc)NULL, /* tp_repr */
  757. (PyNumberMethods*)NULL, /* tp_as_number */
  758. (PySequenceMethods*)NULL, /* tp_as_sequence */
  759. (PyMappingMethods*)NULL, /* tp_as_mapping */
  760. (hashfunc)NULL, /* tp_hash */
  761. (ternaryfunc)NULL, /* tp_call */
  762. (reprfunc)NULL, /* tp_str */
  763. (getattrofunc)NULL, /* tp_getattro */
  764. (setattrofunc)NULL, /* tp_setattro */
  765. (PyBufferProcs*)NULL, /* tp_as_buffer */
  766. Py_TPFLAGS_DEFAULT, /* tp_flags */
  767. "QSize(ctor_arg)\nQSize(w, h)", /* Documentation string */
  768. (traverseproc)NULL, /* tp_traverse */
  769. (inquiry)NULL, /* tp_clear */
  770. (richcmpfunc)NULL, /* tp_richcompare */
  771. 0, /* tp_weaklistoffset */
  772. (getiterfunc)NULL, /* tp_iter */
  773. (iternextfunc)NULL, /* tp_iternext */
  774. (struct PyMethodDef*)PyQSize_methods, /* tp_methods */
  775. (struct PyMemberDef*)0, /* tp_members */
  776. 0, /* tp_getset */
  777. NULL, /* tp_base */
  778. NULL, /* tp_dict */
  779. (descrgetfunc)NULL, /* tp_descr_get */
  780. (descrsetfunc)NULL, /* tp_descr_set */
  781. 0, /* tp_dictoffset */
  782. (initproc)_wrap_PyQSize__tp_init, /* tp_init */
  783. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  784. (newfunc)PyType_GenericNew, /* tp_new */
  785. (freefunc)0, /* tp_free */
  786. (inquiry)NULL, /* tp_is_gc */
  787. NULL, /* tp_bases */
  788. NULL, /* tp_mro */
  789. NULL, /* tp_cache */
  790. NULL, /* tp_subclasses */
  791. NULL, /* tp_weaklist */
  792. (destructor) NULL /* tp_del */
  793. };
  794. static int
  795. _wrap_PyQSizeF__tp_init__0(PyQSizeF *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  796. {
  797. PyQSizeF *ctor_arg;
  798. const char *keywords[] = {"ctor_arg", NULL};
  799. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQSizeF_Type, &ctor_arg)) {
  800. {
  801. PyObject *exc_type, *traceback;
  802. PyErr_Fetch(&exc_type, return_exception, &traceback);
  803. Py_XDECREF(exc_type);
  804. Py_XDECREF(traceback);
  805. }
  806. return -1;
  807. }
  808. self->obj = new QSizeF(*((PyQSizeF *) ctor_arg)->obj);
  809. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  810. return 0;
  811. }
  812. static int
  813. _wrap_PyQSizeF__tp_init__1(PyQSizeF *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  814. {
  815. double w;
  816. double h;
  817. const char *keywords[] = {"w", "h", NULL};
  818. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "dd", (char **) keywords, &w, &h)) {
  819. {
  820. PyObject *exc_type, *traceback;
  821. PyErr_Fetch(&exc_type, return_exception, &traceback);
  822. Py_XDECREF(exc_type);
  823. Py_XDECREF(traceback);
  824. }
  825. return -1;
  826. }
  827. self->obj = new QSizeF(w, h);
  828. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  829. return 0;
  830. }
  831. int _wrap_PyQSizeF__tp_init(PyQSizeF *self, PyObject *args, PyObject *kwargs)
  832. {
  833. int retval;
  834. PyObject *error_list;
  835. PyObject *exceptions[2] = {0,};
  836. retval = _wrap_PyQSizeF__tp_init__0(self, args, kwargs, &exceptions[0]);
  837. if (!exceptions[0]) {
  838. return retval;
  839. }
  840. retval = _wrap_PyQSizeF__tp_init__1(self, args, kwargs, &exceptions[1]);
  841. if (!exceptions[1]) {
  842. Py_DECREF(exceptions[0]);
  843. return retval;
  844. }
  845. error_list = PyList_New(2);
  846. PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
  847. Py_DECREF(exceptions[0]);
  848. PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
  849. Py_DECREF(exceptions[1]);
  850. PyErr_SetObject(PyExc_TypeError, error_list);
  851. Py_DECREF(error_list);
  852. return -1;
  853. }
  854. PyObject *
  855. _wrap_PyQSizeF_height(PyQSizeF *self)
  856. {
  857. PyObject *py_retval;
  858. double retval;
  859. retval = self->obj->height();
  860. py_retval = Py_BuildValue((char *) "d", retval);
  861. return py_retval;
  862. }
  863. PyObject *
  864. _wrap_PyQSizeF_setHeight(PyQSizeF *self, PyObject *args, PyObject *kwargs)
  865. {
  866. PyObject *py_retval;
  867. double h;
  868. const char *keywords[] = {"h", NULL};
  869. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "d", (char **) keywords, &h)) {
  870. return NULL;
  871. }
  872. self->obj->setHeight(h);
  873. Py_INCREF(Py_None);
  874. py_retval = Py_None;
  875. return py_retval;
  876. }
  877. PyObject *
  878. _wrap_PyQSizeF_setWidth(PyQSizeF *self, PyObject *args, PyObject *kwargs)
  879. {
  880. PyObject *py_retval;
  881. double w;
  882. const char *keywords[] = {"w", NULL};
  883. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "d", (char **) keywords, &w)) {
  884. return NULL;
  885. }
  886. self->obj->setWidth(w);
  887. Py_INCREF(Py_None);
  888. py_retval = Py_None;
  889. return py_retval;
  890. }
  891. PyObject *
  892. _wrap_PyQSizeF_width(PyQSizeF *self)
  893. {
  894. PyObject *py_retval;
  895. double retval;
  896. retval = self->obj->width();
  897. py_retval = Py_BuildValue((char *) "d", retval);
  898. return py_retval;
  899. }
  900. static PyObject*
  901. _wrap_PyQSizeF__copy__(PyQSizeF *self)
  902. {
  903. PyQSizeF *py_copy;
  904. py_copy = PyObject_New(PyQSizeF, &PyQSizeF_Type);
  905. py_copy->obj = new QSizeF(*self->obj);
  906. py_copy->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  907. return (PyObject*) py_copy;
  908. }
  909. static PyMethodDef PyQSizeF_methods[] = {
  910. {(char *) "height", (PyCFunction) _wrap_PyQSizeF_height, METH_NOARGS, "height()\n\n" },
  911. {(char *) "setHeight", (PyCFunction) _wrap_PyQSizeF_setHeight, METH_KEYWORDS|METH_VARARGS, "setHeight(h)\n\ntype: h: double" },
  912. {(char *) "setWidth", (PyCFunction) _wrap_PyQSizeF_setWidth, METH_KEYWORDS|METH_VARARGS, "setWidth(w)\n\ntype: w: double" },
  913. {(char *) "width", (PyCFunction) _wrap_PyQSizeF_width, METH_NOARGS, "width()\n\n" },
  914. {(char *) "__copy__", (PyCFunction) _wrap_PyQSizeF__copy__, METH_NOARGS, NULL},
  915. {NULL, NULL, 0, NULL}
  916. };
  917. static void
  918. _wrap_PyQSizeF__tp_dealloc(PyQSizeF *self)
  919. {
  920. QSizeF *tmp = self->obj;
  921. self->obj = NULL;
  922. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  923. delete tmp;
  924. }
  925. Py_TYPE(self)->tp_free((PyObject*)self);
  926. }
  927. PyTypeObject PyQSizeF_Type = {
  928. PyVarObject_HEAD_INIT(NULL, 0)
  929. (char *) "tiled.qt.QSizeF", /* tp_name */
  930. sizeof(PyQSizeF), /* tp_basicsize */
  931. 0, /* tp_itemsize */
  932. /* methods */
  933. (destructor)_wrap_PyQSizeF__tp_dealloc, /* tp_dealloc */
  934. (printfunc)0, /* tp_print */
  935. (getattrfunc)NULL, /* tp_getattr */
  936. (setattrfunc)NULL, /* tp_setattr */
  937. #if PY_MAJOR_VERSION >= 3
  938. NULL,
  939. #else
  940. (cmpfunc)NULL, /* tp_compare */
  941. #endif
  942. (reprfunc)NULL, /* tp_repr */
  943. (PyNumberMethods*)NULL, /* tp_as_number */
  944. (PySequenceMethods*)NULL, /* tp_as_sequence */
  945. (PyMappingMethods*)NULL, /* tp_as_mapping */
  946. (hashfunc)NULL, /* tp_hash */
  947. (ternaryfunc)NULL, /* tp_call */
  948. (reprfunc)NULL, /* tp_str */
  949. (getattrofunc)NULL, /* tp_getattro */
  950. (setattrofunc)NULL, /* tp_setattro */
  951. (PyBufferProcs*)NULL, /* tp_as_buffer */
  952. Py_TPFLAGS_DEFAULT, /* tp_flags */
  953. "QSizeF(ctor_arg)\nQSizeF(w, h)", /* Documentation string */
  954. (traverseproc)NULL, /* tp_traverse */
  955. (inquiry)NULL, /* tp_clear */
  956. (richcmpfunc)NULL, /* tp_richcompare */
  957. 0, /* tp_weaklistoffset */
  958. (getiterfunc)NULL, /* tp_iter */
  959. (iternextfunc)NULL, /* tp_iternext */
  960. (struct PyMethodDef*)PyQSizeF_methods, /* tp_methods */
  961. (struct PyMemberDef*)0, /* tp_members */
  962. 0, /* tp_getset */
  963. NULL, /* tp_base */
  964. NULL, /* tp_dict */
  965. (descrgetfunc)NULL, /* tp_descr_get */
  966. (descrsetfunc)NULL, /* tp_descr_set */
  967. 0, /* tp_dictoffset */
  968. (initproc)_wrap_PyQSizeF__tp_init, /* tp_init */
  969. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  970. (newfunc)PyType_GenericNew, /* tp_new */
  971. (freefunc)0, /* tp_free */
  972. (inquiry)NULL, /* tp_is_gc */
  973. NULL, /* tp_bases */
  974. NULL, /* tp_mro */
  975. NULL, /* tp_cache */
  976. NULL, /* tp_subclasses */
  977. NULL, /* tp_weaklist */
  978. (destructor) NULL /* tp_del */
  979. };
  980. static int
  981. _wrap_PyQRgb__tp_init(PyQRgb *self, PyObject *args, PyObject *kwargs)
  982. {
  983. PyQRgb *ctor_arg;
  984. const char *keywords[] = {"ctor_arg", NULL};
  985. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQRgb_Type, &ctor_arg)) {
  986. return -1;
  987. }
  988. self->obj = new QRgb(*((PyQRgb *) ctor_arg)->obj);
  989. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  990. return 0;
  991. }
  992. static PyObject*
  993. _wrap_PyQRgb__copy__(PyQRgb *self)
  994. {
  995. PyQRgb *py_copy;
  996. py_copy = PyObject_New(PyQRgb, &PyQRgb_Type);
  997. py_copy->obj = new QRgb(*self->obj);
  998. py_copy->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  999. return (PyObject*) py_copy;
  1000. }
  1001. static PyMethodDef PyQRgb_methods[] = {
  1002. {(char *) "__copy__", (PyCFunction) _wrap_PyQRgb__copy__, METH_NOARGS, NULL},
  1003. {NULL, NULL, 0, NULL}
  1004. };
  1005. static void
  1006. _wrap_PyQRgb__tp_dealloc(PyQRgb *self)
  1007. {
  1008. QRgb *tmp = self->obj;
  1009. self->obj = NULL;
  1010. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  1011. delete tmp;
  1012. }
  1013. Py_TYPE(self)->tp_free((PyObject*)self);
  1014. }
  1015. PyTypeObject PyQRgb_Type = {
  1016. PyVarObject_HEAD_INIT(NULL, 0)
  1017. (char *) "tiled.qt.QRgb", /* tp_name */
  1018. sizeof(PyQRgb), /* tp_basicsize */
  1019. 0, /* tp_itemsize */
  1020. /* methods */
  1021. (destructor)_wrap_PyQRgb__tp_dealloc, /* tp_dealloc */
  1022. (printfunc)0, /* tp_print */
  1023. (getattrfunc)NULL, /* tp_getattr */
  1024. (setattrfunc)NULL, /* tp_setattr */
  1025. #if PY_MAJOR_VERSION >= 3
  1026. NULL,
  1027. #else
  1028. (cmpfunc)NULL, /* tp_compare */
  1029. #endif
  1030. (reprfunc)NULL, /* tp_repr */
  1031. (PyNumberMethods*)NULL, /* tp_as_number */
  1032. (PySequenceMethods*)NULL, /* tp_as_sequence */
  1033. (PyMappingMethods*)NULL, /* tp_as_mapping */
  1034. (hashfunc)NULL, /* tp_hash */
  1035. (ternaryfunc)NULL, /* tp_call */
  1036. (reprfunc)NULL, /* tp_str */
  1037. (getattrofunc)NULL, /* tp_getattro */
  1038. (setattrofunc)NULL, /* tp_setattro */
  1039. (PyBufferProcs*)NULL, /* tp_as_buffer */
  1040. Py_TPFLAGS_DEFAULT, /* tp_flags */
  1041. "QRgb(ctor_arg)", /* Documentation string */
  1042. (traverseproc)NULL, /* tp_traverse */
  1043. (inquiry)NULL, /* tp_clear */
  1044. (richcmpfunc)NULL, /* tp_richcompare */
  1045. 0, /* tp_weaklistoffset */
  1046. (getiterfunc)NULL, /* tp_iter */
  1047. (iternextfunc)NULL, /* tp_iternext */
  1048. (struct PyMethodDef*)PyQRgb_methods, /* tp_methods */
  1049. (struct PyMemberDef*)0, /* tp_members */
  1050. 0, /* tp_getset */
  1051. NULL, /* tp_base */
  1052. NULL, /* tp_dict */
  1053. (descrgetfunc)NULL, /* tp_descr_get */
  1054. (descrsetfunc)NULL, /* tp_descr_set */
  1055. 0, /* tp_dictoffset */
  1056. (initproc)_wrap_PyQRgb__tp_init, /* tp_init */
  1057. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  1058. (newfunc)PyType_GenericNew, /* tp_new */
  1059. (freefunc)0, /* tp_free */
  1060. (inquiry)NULL, /* tp_is_gc */
  1061. NULL, /* tp_bases */
  1062. NULL, /* tp_mro */
  1063. NULL, /* tp_cache */
  1064. NULL, /* tp_subclasses */
  1065. NULL, /* tp_weaklist */
  1066. (destructor) NULL /* tp_del */
  1067. };
  1068. static int
  1069. _wrap_PyQColor__tp_init__0(PyQColor *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  1070. {
  1071. PyQRgb *col;
  1072. const char *keywords[] = {"col", NULL};
  1073. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQRgb_Type, &col)) {
  1074. {
  1075. PyObject *exc_type, *traceback;
  1076. PyErr_Fetch(&exc_type, return_exception, &traceback);
  1077. Py_XDECREF(exc_type);
  1078. Py_XDECREF(traceback);
  1079. }
  1080. return -1;
  1081. }
  1082. self->obj = new QColor(*((PyQRgb *) col)->obj);
  1083. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  1084. return 0;
  1085. }
  1086. static int
  1087. _wrap_PyQColor__tp_init__1(PyQColor *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  1088. {
  1089. int r;
  1090. int g;
  1091. int b;
  1092. const char *keywords[] = {"r", "g", "b", NULL};
  1093. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "iii", (char **) keywords, &r, &g, &b)) {
  1094. {
  1095. PyObject *exc_type, *traceback;
  1096. PyErr_Fetch(&exc_type, return_exception, &traceback);
  1097. Py_XDECREF(exc_type);
  1098. Py_XDECREF(traceback);
  1099. }
  1100. return -1;
  1101. }
  1102. self->obj = new QColor(r, g, b);
  1103. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  1104. return 0;
  1105. }
  1106. static int
  1107. _wrap_PyQColor__tp_init__2(PyQColor *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  1108. {
  1109. int r;
  1110. int g;
  1111. int b;
  1112. int a;
  1113. const char *keywords[] = {"r", "g", "b", "a", NULL};
  1114. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "iiii", (char **) keywords, &r, &g, &b, &a)) {
  1115. {
  1116. PyObject *exc_type, *traceback;
  1117. PyErr_Fetch(&exc_type, return_exception, &traceback);
  1118. Py_XDECREF(exc_type);
  1119. Py_XDECREF(traceback);
  1120. }
  1121. return -1;
  1122. }
  1123. self->obj = new QColor(r, g, b, a);
  1124. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  1125. return 0;
  1126. }
  1127. static int
  1128. _wrap_PyQColor__tp_init__3(PyQColor *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  1129. {
  1130. PyQColor *ctor_arg;
  1131. const char *keywords[] = {"ctor_arg", NULL};
  1132. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQColor_Type, &ctor_arg)) {
  1133. {
  1134. PyObject *exc_type, *traceback;
  1135. PyErr_Fetch(&exc_type, return_exception, &traceback);
  1136. Py_XDECREF(exc_type);
  1137. Py_XDECREF(traceback);
  1138. }
  1139. return -1;
  1140. }
  1141. self->obj = new QColor(*((PyQColor *) ctor_arg)->obj);
  1142. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  1143. return 0;
  1144. }
  1145. int _wrap_PyQColor__tp_init(PyQColor *self, PyObject *args, PyObject *kwargs)
  1146. {
  1147. int retval;
  1148. PyObject *error_list;
  1149. PyObject *exceptions[4] = {0,};
  1150. retval = _wrap_PyQColor__tp_init__0(self, args, kwargs, &exceptions[0]);
  1151. if (!exceptions[0]) {
  1152. return retval;
  1153. }
  1154. retval = _wrap_PyQColor__tp_init__1(self, args, kwargs, &exceptions[1]);
  1155. if (!exceptions[1]) {
  1156. Py_DECREF(exceptions[0]);
  1157. return retval;
  1158. }
  1159. retval = _wrap_PyQColor__tp_init__2(self, args, kwargs, &exceptions[2]);
  1160. if (!exceptions[2]) {
  1161. Py_DECREF(exceptions[0]);
  1162. Py_DECREF(exceptions[1]);
  1163. return retval;
  1164. }
  1165. retval = _wrap_PyQColor__tp_init__3(self, args, kwargs, &exceptions[3]);
  1166. if (!exceptions[3]) {
  1167. Py_DECREF(exceptions[0]);
  1168. Py_DECREF(exceptions[1]);
  1169. Py_DECREF(exceptions[2]);
  1170. return retval;
  1171. }
  1172. error_list = PyList_New(4);
  1173. PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
  1174. Py_DECREF(exceptions[0]);
  1175. PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
  1176. Py_DECREF(exceptions[1]);
  1177. PyList_SET_ITEM(error_list, 2, PyObject_Str(exceptions[2]));
  1178. Py_DECREF(exceptions[2]);
  1179. PyList_SET_ITEM(error_list, 3, PyObject_Str(exceptions[3]));
  1180. Py_DECREF(exceptions[3]);
  1181. PyErr_SetObject(PyExc_TypeError, error_list);
  1182. Py_DECREF(error_list);
  1183. return -1;
  1184. }
  1185. PyObject *
  1186. _wrap_PyQColor_rgb(PyQColor *self)
  1187. {
  1188. PyObject *py_retval;
  1189. PyQRgb *py_QRgb;
  1190. QRgb retval = self->obj->rgb();
  1191. py_QRgb = PyObject_New(PyQRgb, &PyQRgb_Type);
  1192. py_QRgb->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  1193. py_QRgb->obj = new QRgb(retval);
  1194. py_retval = Py_BuildValue((char *) "N", py_QRgb);
  1195. return py_retval;
  1196. }
  1197. PyObject *
  1198. _wrap_PyQColor_rgba(PyQColor *self)
  1199. {
  1200. PyObject *py_retval;
  1201. PyQRgb *py_QRgb;
  1202. QRgb retval = self->obj->rgba();
  1203. py_QRgb = PyObject_New(PyQRgb, &PyQRgb_Type);
  1204. py_QRgb->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  1205. py_QRgb->obj = new QRgb(retval);
  1206. py_retval = Py_BuildValue((char *) "N", py_QRgb);
  1207. return py_retval;
  1208. }
  1209. static PyObject*
  1210. _wrap_PyQColor__copy__(PyQColor *self)
  1211. {
  1212. PyQColor *py_copy;
  1213. py_copy = PyObject_New(PyQColor, &PyQColor_Type);
  1214. py_copy->obj = new QColor(*self->obj);
  1215. py_copy->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  1216. return (PyObject*) py_copy;
  1217. }
  1218. static PyMethodDef PyQColor_methods[] = {
  1219. {(char *) "rgb", (PyCFunction) _wrap_PyQColor_rgb, METH_NOARGS, "rgb()\n\n" },
  1220. {(char *) "rgba", (PyCFunction) _wrap_PyQColor_rgba, METH_NOARGS, "rgba()\n\n" },
  1221. {(char *) "__copy__", (PyCFunction) _wrap_PyQColor__copy__, METH_NOARGS, NULL},
  1222. {NULL, NULL, 0, NULL}
  1223. };
  1224. static void
  1225. _wrap_PyQColor__tp_dealloc(PyQColor *self)
  1226. {
  1227. QColor *tmp = self->obj;
  1228. self->obj = NULL;
  1229. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  1230. delete tmp;
  1231. }
  1232. Py_TYPE(self)->tp_free((PyObject*)self);
  1233. }
  1234. PyTypeObject PyQColor_Type = {
  1235. PyVarObject_HEAD_INIT(NULL, 0)
  1236. (char *) "tiled.qt.QColor", /* tp_name */
  1237. sizeof(PyQColor), /* tp_basicsize */
  1238. 0, /* tp_itemsize */
  1239. /* methods */
  1240. (destructor)_wrap_PyQColor__tp_dealloc, /* tp_dealloc */
  1241. (printfunc)0, /* tp_print */
  1242. (getattrfunc)NULL, /* tp_getattr */
  1243. (setattrfunc)NULL, /* tp_setattr */
  1244. #if PY_MAJOR_VERSION >= 3
  1245. NULL,
  1246. #else
  1247. (cmpfunc)NULL, /* tp_compare */
  1248. #endif
  1249. (reprfunc)NULL, /* tp_repr */
  1250. (PyNumberMethods*)NULL, /* tp_as_number */
  1251. (PySequenceMethods*)NULL, /* tp_as_sequence */
  1252. (PyMappingMethods*)NULL, /* tp_as_mapping */
  1253. (hashfunc)NULL, /* tp_hash */
  1254. (ternaryfunc)NULL, /* tp_call */
  1255. (reprfunc)NULL, /* tp_str */
  1256. (getattrofunc)NULL, /* tp_getattro */
  1257. (setattrofunc)NULL, /* tp_setattro */
  1258. (PyBufferProcs*)NULL, /* tp_as_buffer */
  1259. Py_TPFLAGS_DEFAULT, /* tp_flags */
  1260. "QColor(r, g, b, a)\nQColor(ctor_arg)\nQColor(r, g, b)\nQColor(col)", /* Documentation string */
  1261. (traverseproc)NULL, /* tp_traverse */
  1262. (inquiry)NULL, /* tp_clear */
  1263. (richcmpfunc)NULL, /* tp_richcompare */
  1264. 0, /* tp_weaklistoffset */
  1265. (getiterfunc)NULL, /* tp_iter */
  1266. (iternextfunc)NULL, /* tp_iternext */
  1267. (struct PyMethodDef*)PyQColor_methods, /* tp_methods */
  1268. (struct PyMemberDef*)0, /* tp_members */
  1269. 0, /* tp_getset */
  1270. NULL, /* tp_base */
  1271. NULL, /* tp_dict */
  1272. (descrgetfunc)NULL, /* tp_descr_get */
  1273. (descrsetfunc)NULL, /* tp_descr_set */
  1274. 0, /* tp_dictoffset */
  1275. (initproc)_wrap_PyQColor__tp_init, /* tp_init */
  1276. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  1277. (newfunc)PyType_GenericNew, /* tp_new */
  1278. (freefunc)0, /* tp_free */
  1279. (inquiry)NULL, /* tp_is_gc */
  1280. NULL, /* tp_bases */
  1281. NULL, /* tp_mro */
  1282. NULL, /* tp_cache */
  1283. NULL, /* tp_subclasses */
  1284. NULL, /* tp_weaklist */
  1285. (destructor) NULL /* tp_del */
  1286. };
  1287. static int
  1288. _wrap_PyQImage__tp_init__0(PyQImage *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  1289. {
  1290. const char *keywords[] = {NULL};
  1291. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "", (char **) keywords)) {
  1292. {
  1293. PyObject *exc_type, *traceback;
  1294. PyErr_Fetch(&exc_type, return_exception, &traceback);
  1295. Py_XDECREF(exc_type);
  1296. Py_XDECREF(traceback);
  1297. }
  1298. return -1;
  1299. }
  1300. self->obj = new QImage();
  1301. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  1302. return 0;
  1303. }
  1304. static int
  1305. _wrap_PyQImage__tp_init__1(PyQImage *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  1306. {
  1307. int w;
  1308. int h;
  1309. QImage::Format f;
  1310. const char *keywords[] = {"w", "h", "f", NULL};
  1311. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "iii", (char **) keywords, &w, &h, &f)) {
  1312. {
  1313. PyObject *exc_type, *traceback;
  1314. PyErr_Fetch(&exc_type, return_exception, &traceback);
  1315. Py_XDECREF(exc_type);
  1316. Py_XDECREF(traceback);
  1317. }
  1318. return -1;
  1319. }
  1320. self->obj = new QImage(w, h, f);
  1321. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  1322. return 0;
  1323. }
  1324. static int
  1325. _wrap_PyQImage__tp_init__2(PyQImage *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  1326. {
  1327. PyQImage *ctor_arg;
  1328. const char *keywords[] = {"ctor_arg", NULL};
  1329. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQImage_Type, &ctor_arg)) {
  1330. {
  1331. PyObject *exc_type, *traceback;
  1332. PyErr_Fetch(&exc_type, return_exception, &traceback);
  1333. Py_XDECREF(exc_type);
  1334. Py_XDECREF(traceback);
  1335. }
  1336. return -1;
  1337. }
  1338. self->obj = new QImage(*((PyQImage *) ctor_arg)->obj);
  1339. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  1340. return 0;
  1341. }
  1342. int _wrap_PyQImage__tp_init(PyQImage *self, PyObject *args, PyObject *kwargs)
  1343. {
  1344. int retval;
  1345. PyObject *error_list;
  1346. PyObject *exceptions[3] = {0,};
  1347. retval = _wrap_PyQImage__tp_init__0(self, args, kwargs, &exceptions[0]);
  1348. if (!exceptions[0]) {
  1349. return retval;
  1350. }
  1351. retval = _wrap_PyQImage__tp_init__1(self, args, kwargs, &exceptions[1]);
  1352. if (!exceptions[1]) {
  1353. Py_DECREF(exceptions[0]);
  1354. return retval;
  1355. }
  1356. retval = _wrap_PyQImage__tp_init__2(self, args, kwargs, &exceptions[2]);
  1357. if (!exceptions[2]) {
  1358. Py_DECREF(exceptions[0]);
  1359. Py_DECREF(exceptions[1]);
  1360. return retval;
  1361. }
  1362. error_list = PyList_New(3);
  1363. PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
  1364. Py_DECREF(exceptions[0]);
  1365. PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
  1366. Py_DECREF(exceptions[1]);
  1367. PyList_SET_ITEM(error_list, 2, PyObject_Str(exceptions[2]));
  1368. Py_DECREF(exceptions[2]);
  1369. PyErr_SetObject(PyExc_TypeError, error_list);
  1370. Py_DECREF(error_list);
  1371. return -1;
  1372. }
  1373. PyObject *
  1374. _wrap_PyQImage_color(PyQImage *self, PyObject *args, PyObject *kwargs)
  1375. {
  1376. PyObject *py_retval;
  1377. int i;
  1378. const char *keywords[] = {"i", NULL};
  1379. PyQRgb *py_QRgb;
  1380. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &i)) {
  1381. return NULL;
  1382. }
  1383. QRgb retval = self->obj->color(i);
  1384. py_QRgb = PyObject_New(PyQRgb, &PyQRgb_Type);
  1385. py_QRgb->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  1386. py_QRgb->obj = new QRgb(retval);
  1387. py_retval = Py_BuildValue((char *) "N", py_QRgb);
  1388. return py_retval;
  1389. }
  1390. PyObject *
  1391. _wrap_PyQImage_colorTable(PyQImage *self)
  1392. {
  1393. PyObject *py_retval;
  1394. QVector< QRgb > retval;
  1395. PyQVector__lt__QRgb__gt__ *py_QVector__lt__QRgb__gt__;
  1396. retval = self->obj->colorTable();
  1397. py_QVector__lt__QRgb__gt__ = PyObject_New(PyQVector__lt__QRgb__gt__, &PyQVector__lt__QRgb__gt___Type);
  1398. py_QVector__lt__QRgb__gt__->obj = new QVector<QRgb>(retval);
  1399. py_retval = Py_BuildValue((char *) "N", py_QVector__lt__QRgb__gt__);
  1400. return py_retval;
  1401. }
  1402. PyObject *
  1403. _wrap_PyQImage_fill(PyQImage *self, PyObject *args, PyObject *kwargs)
  1404. {
  1405. PyObject *py_retval;
  1406. int color;
  1407. const char *keywords[] = {"color", NULL};
  1408. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &color)) {
  1409. return NULL;
  1410. }
  1411. self->obj->fill(color);
  1412. Py_INCREF(Py_None);
  1413. py_retval = Py_None;
  1414. return py_retval;
  1415. }
  1416. PyObject *
  1417. _wrap_PyQImage_height(PyQImage *self)
  1418. {
  1419. PyObject *py_retval;
  1420. int retval;
  1421. retval = self->obj->height();
  1422. py_retval = Py_BuildValue((char *) "i", retval);
  1423. return py_retval;
  1424. }
  1425. PyObject *
  1426. _wrap_PyQImage_load(PyQImage *self, PyObject *args, PyObject *kwargs)
  1427. {
  1428. PyObject *py_retval;
  1429. bool retval;
  1430. const char *fileName;
  1431. Py_ssize_t fileName_len;
  1432. char *fmt;
  1433. const char *keywords[] = {"fileName", "fmt", NULL};
  1434. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#s", (char **) keywords, &fileName, &fileName_len, &fmt)) {
  1435. return NULL;
  1436. }
  1437. retval = self->obj->load(QString::fromUtf8(fileName), fmt);
  1438. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  1439. return py_retval;
  1440. }
  1441. PyObject *
  1442. _wrap_PyQImage_mirrored(PyQImage *self, PyObject *args, PyObject *kwargs)
  1443. {
  1444. PyObject *py_retval;
  1445. bool horiz;
  1446. PyObject *py_horiz;
  1447. bool vert;
  1448. PyObject *py_vert;
  1449. const char *keywords[] = {"horiz", "vert", NULL};
  1450. PyQImage *py_QImage;
  1451. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "OO", (char **) keywords, &py_horiz, &py_vert)) {
  1452. return NULL;
  1453. }
  1454. horiz = (bool) PyObject_IsTrue(py_horiz);
  1455. vert = (bool) PyObject_IsTrue(py_vert);
  1456. QImage const & retval = self->obj->mirrored(horiz, vert);
  1457. py_QImage = PyObject_New(PyQImage, &PyQImage_Type);
  1458. py_QImage->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  1459. py_QImage->obj = new QImage(retval);
  1460. py_retval = Py_BuildValue((char *) "N", py_QImage);
  1461. return py_retval;
  1462. }
  1463. PyObject *
  1464. _wrap_PyQImage_setColor(PyQImage *self, PyObject *args, PyObject *kwargs)
  1465. {
  1466. PyObject *py_retval;
  1467. int i;
  1468. PyQRgb *c;
  1469. const char *keywords[] = {"i", "c", NULL};
  1470. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "iO!", (char **) keywords, &i, &PyQRgb_Type, &c)) {
  1471. return NULL;
  1472. }
  1473. self->obj->setColor(i, *((PyQRgb *) c)->obj);
  1474. Py_INCREF(Py_None);
  1475. py_retval = Py_None;
  1476. return py_retval;
  1477. }
  1478. PyObject *
  1479. _wrap_PyQImage_setColorTable(PyQImage *self, PyObject *args, PyObject *kwargs)
  1480. {
  1481. PyObject *py_retval;
  1482. QVector<QRgb> colors_value;
  1483. const char *keywords[] = {"colors", NULL};
  1484. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O&", (char **) keywords, _wrap_convert_py2c__QVector__lt___QRgb___gt__, &colors_value)) {
  1485. return NULL;
  1486. }
  1487. self->obj->setColorTable(colors_value);
  1488. Py_INCREF(Py_None);
  1489. py_retval = Py_None;
  1490. return py_retval;
  1491. }
  1492. PyObject *
  1493. _wrap_PyQImage_setPixel__0(PyQImage *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  1494. {
  1495. PyObject *py_retval;
  1496. int x;
  1497. int y;
  1498. unsigned int color;
  1499. const char *keywords[] = {"x", "y", "color", NULL};
  1500. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "iiI", (char **) keywords, &x, &y, &color)) {
  1501. {
  1502. PyObject *exc_type, *traceback;
  1503. PyErr_Fetch(&exc_type, return_exception, &traceback);
  1504. Py_XDECREF(exc_type);
  1505. Py_XDECREF(traceback);
  1506. }
  1507. return NULL;
  1508. }
  1509. self->obj->setPixel(x, y, color);
  1510. Py_INCREF(Py_None);
  1511. py_retval = Py_None;
  1512. return py_retval;
  1513. }
  1514. PyObject *
  1515. _wrap_PyQImage_setPixel__1(PyQImage *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  1516. {
  1517. PyObject *py_retval;
  1518. int x;
  1519. int y;
  1520. PyQRgb *color;
  1521. const char *keywords[] = {"x", "y", "color", NULL};
  1522. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "iiO!", (char **) keywords, &x, &y, &PyQRgb_Type, &color)) {
  1523. {
  1524. PyObject *exc_type, *traceback;
  1525. PyErr_Fetch(&exc_type, return_exception, &traceback);
  1526. Py_XDECREF(exc_type);
  1527. Py_XDECREF(traceback);
  1528. }
  1529. return NULL;
  1530. }
  1531. self->obj->setPixel(x, y, *((PyQRgb *) color)->obj);
  1532. Py_INCREF(Py_None);
  1533. py_retval = Py_None;
  1534. return py_retval;
  1535. }
  1536. PyObject * _wrap_PyQImage_setPixel(PyQImage *self, PyObject *args, PyObject *kwargs)
  1537. {
  1538. PyObject * retval;
  1539. PyObject *error_list;
  1540. PyObject *exceptions[2] = {0,};
  1541. retval = _wrap_PyQImage_setPixel__0(self, args, kwargs, &exceptions[0]);
  1542. if (!exceptions[0]) {
  1543. return retval;
  1544. }
  1545. retval = _wrap_PyQImage_setPixel__1(self, args, kwargs, &exceptions[1]);
  1546. if (!exceptions[1]) {
  1547. Py_DECREF(exceptions[0]);
  1548. return retval;
  1549. }
  1550. error_list = PyList_New(2);
  1551. PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
  1552. Py_DECREF(exceptions[0]);
  1553. PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
  1554. Py_DECREF(exceptions[1]);
  1555. PyErr_SetObject(PyExc_TypeError, error_list);
  1556. Py_DECREF(error_list);
  1557. return NULL;
  1558. }
  1559. PyObject *
  1560. _wrap_PyQImage_width(PyQImage *self)
  1561. {
  1562. PyObject *py_retval;
  1563. int retval;
  1564. retval = self->obj->width();
  1565. py_retval = Py_BuildValue((char *) "i", retval);
  1566. return py_retval;
  1567. }
  1568. static PyObject*
  1569. _wrap_PyQImage__copy__(PyQImage *self)
  1570. {
  1571. PyQImage *py_copy;
  1572. py_copy = PyObject_New(PyQImage, &PyQImage_Type);
  1573. py_copy->obj = new QImage(*self->obj);
  1574. py_copy->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  1575. return (PyObject*) py_copy;
  1576. }
  1577. static PyMethodDef PyQImage_methods[] = {
  1578. {(char *) "color", (PyCFunction) _wrap_PyQImage_color, METH_KEYWORDS|METH_VARARGS, "color(i)\n\ntype: i: int" },
  1579. {(char *) "colorTable", (PyCFunction) _wrap_PyQImage_colorTable, METH_NOARGS, "colorTable()\n\n" },
  1580. {(char *) "fill", (PyCFunction) _wrap_PyQImage_fill, METH_KEYWORDS|METH_VARARGS, "fill(color)\n\ntype: color: int" },
  1581. {(char *) "height", (PyCFunction) _wrap_PyQImage_height, METH_NOARGS, "height()\n\n" },
  1582. {(char *) "load", (PyCFunction) _wrap_PyQImage_load, METH_KEYWORDS|METH_VARARGS, "load(fileName, fmt)\n\ntype: fileName: QString const\ntype: fmt: char *" },
  1583. {(char *) "mirrored", (PyCFunction) _wrap_PyQImage_mirrored, METH_KEYWORDS|METH_VARARGS, "mirrored(horiz, vert)\n\ntype: horiz: bool\ntype: vert: bool" },
  1584. {(char *) "setColor", (PyCFunction) _wrap_PyQImage_setColor, METH_KEYWORDS|METH_VARARGS, "setColor(i, c)\n\ntype: i: int\ntype: c: QRgb" },
  1585. {(char *) "setColorTable", (PyCFunction) _wrap_PyQImage_setColorTable, METH_KEYWORDS|METH_VARARGS, "setColorTable(colors)\n\ntype: colors: QVector< QRgb >" },
  1586. {(char *) "setPixel", (PyCFunction) _wrap_PyQImage_setPixel, METH_KEYWORDS|METH_VARARGS, NULL },
  1587. {(char *) "width", (PyCFunction) _wrap_PyQImage_width, METH_NOARGS, "width()\n\n" },
  1588. {(char *) "__copy__", (PyCFunction) _wrap_PyQImage__copy__, METH_NOARGS, NULL},
  1589. {NULL, NULL, 0, NULL}
  1590. };
  1591. static void
  1592. _wrap_PyQImage__tp_dealloc(PyQImage *self)
  1593. {
  1594. QImage *tmp = self->obj;
  1595. self->obj = NULL;
  1596. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  1597. delete tmp;
  1598. }
  1599. Py_TYPE(self)->tp_free((PyObject*)self);
  1600. }
  1601. PyTypeObject PyQImage_Type = {
  1602. PyVarObject_HEAD_INIT(NULL, 0)
  1603. (char *) "tiled.qt.QImage", /* tp_name */
  1604. sizeof(PyQImage), /* tp_basicsize */
  1605. 0, /* tp_itemsize */
  1606. /* methods */
  1607. (destructor)_wrap_PyQImage__tp_dealloc, /* tp_dealloc */
  1608. (printfunc)0, /* tp_print */
  1609. (getattrfunc)NULL, /* tp_getattr */
  1610. (setattrfunc)NULL, /* tp_setattr */
  1611. #if PY_MAJOR_VERSION >= 3
  1612. NULL,
  1613. #else
  1614. (cmpfunc)NULL, /* tp_compare */
  1615. #endif
  1616. (reprfunc)NULL, /* tp_repr */
  1617. (PyNumberMethods*)NULL, /* tp_as_number */
  1618. (PySequenceMethods*)NULL, /* tp_as_sequence */
  1619. (PyMappingMethods*)NULL, /* tp_as_mapping */
  1620. (hashfunc)NULL, /* tp_hash */
  1621. (ternaryfunc)NULL, /* tp_call */
  1622. (reprfunc)NULL, /* tp_str */
  1623. (getattrofunc)NULL, /* tp_getattro */
  1624. (setattrofunc)NULL, /* tp_setattro */
  1625. (PyBufferProcs*)NULL, /* tp_as_buffer */
  1626. Py_TPFLAGS_DEFAULT, /* tp_flags */
  1627. "QImage(ctor_arg)\nQImage(w, h, f)\nQImage()", /* Documentation string */
  1628. (traverseproc)NULL, /* tp_traverse */
  1629. (inquiry)NULL, /* tp_clear */
  1630. (richcmpfunc)NULL, /* tp_richcompare */
  1631. 0, /* tp_weaklistoffset */
  1632. (getiterfunc)NULL, /* tp_iter */
  1633. (iternextfunc)NULL, /* tp_iternext */
  1634. (struct PyMethodDef*)PyQImage_methods, /* tp_methods */
  1635. (struct PyMemberDef*)0, /* tp_members */
  1636. 0, /* tp_getset */
  1637. NULL, /* tp_base */
  1638. NULL, /* tp_dict */
  1639. (descrgetfunc)NULL, /* tp_descr_get */
  1640. (descrsetfunc)NULL, /* tp_descr_set */
  1641. 0, /* tp_dictoffset */
  1642. (initproc)_wrap_PyQImage__tp_init, /* tp_init */
  1643. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  1644. (newfunc)PyType_GenericNew, /* tp_new */
  1645. (freefunc)0, /* tp_free */
  1646. (inquiry)NULL, /* tp_is_gc */
  1647. NULL, /* tp_bases */
  1648. NULL, /* tp_mro */
  1649. NULL, /* tp_cache */
  1650. NULL, /* tp_subclasses */
  1651. NULL, /* tp_weaklist */
  1652. (destructor) NULL /* tp_del */
  1653. };
  1654. static int
  1655. _wrap_PyQPixmap__tp_init(PyQPixmap *self, PyObject *args, PyObject *kwargs)
  1656. {
  1657. PyQPixmap *ctor_arg;
  1658. const char *keywords[] = {"ctor_arg", NULL};
  1659. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQPixmap_Type, &ctor_arg)) {
  1660. return -1;
  1661. }
  1662. self->obj = new QPixmap(*((PyQPixmap *) ctor_arg)->obj);
  1663. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  1664. return 0;
  1665. }
  1666. PyObject *
  1667. _wrap_PyQPixmap_convertFromImage(PyQPixmap *self, PyObject *args, PyObject *kwargs)
  1668. {
  1669. PyObject *py_retval;
  1670. PyQImage *image;
  1671. const char *keywords[] = {"image", NULL};
  1672. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQImage_Type, &image)) {
  1673. return NULL;
  1674. }
  1675. self->obj->convertFromImage(*((PyQImage *) image)->obj);
  1676. Py_INCREF(Py_None);
  1677. py_retval = Py_None;
  1678. return py_retval;
  1679. }
  1680. PyObject *
  1681. _wrap_PyQPixmap_fromImage(PyQPixmap *self, PyObject *args, PyObject *kwargs)
  1682. {
  1683. PyObject *py_retval;
  1684. PyQImage *image;
  1685. const char *keywords[] = {"image", NULL};
  1686. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQImage_Type, &image)) {
  1687. return NULL;
  1688. }
  1689. self->obj->fromImage(*((PyQImage *) image)->obj);
  1690. Py_INCREF(Py_None);
  1691. py_retval = Py_None;
  1692. return py_retval;
  1693. }
  1694. PyObject *
  1695. _wrap_PyQPixmap_height(PyQPixmap *self)
  1696. {
  1697. PyObject *py_retval;
  1698. int retval;
  1699. retval = self->obj->height();
  1700. py_retval = Py_BuildValue((char *) "i", retval);
  1701. return py_retval;
  1702. }
  1703. PyObject *
  1704. _wrap_PyQPixmap_toImage(PyQPixmap *self)
  1705. {
  1706. PyObject *py_retval;
  1707. PyQImage *py_QImage;
  1708. QImage const & retval = self->obj->toImage();
  1709. py_QImage = PyObject_New(PyQImage, &PyQImage_Type);
  1710. py_QImage->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  1711. py_QImage->obj = new QImage(retval);
  1712. py_retval = Py_BuildValue((char *) "N", py_QImage);
  1713. return py_retval;
  1714. }
  1715. PyObject *
  1716. _wrap_PyQPixmap_width(PyQPixmap *self)
  1717. {
  1718. PyObject *py_retval;
  1719. int retval;
  1720. retval = self->obj->width();
  1721. py_retval = Py_BuildValue((char *) "i", retval);
  1722. return py_retval;
  1723. }
  1724. static PyObject*
  1725. _wrap_PyQPixmap__copy__(PyQPixmap *self)
  1726. {
  1727. PyQPixmap *py_copy;
  1728. py_copy = PyObject_New(PyQPixmap, &PyQPixmap_Type);
  1729. py_copy->obj = new QPixmap(*self->obj);
  1730. py_copy->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  1731. return (PyObject*) py_copy;
  1732. }
  1733. static PyMethodDef PyQPixmap_methods[] = {
  1734. {(char *) "convertFromImage", (PyCFunction) _wrap_PyQPixmap_convertFromImage, METH_KEYWORDS|METH_VARARGS, "convertFromImage(image)\n\ntype: image: QImage const &" },
  1735. {(char *) "fromImage", (PyCFunction) _wrap_PyQPixmap_fromImage, METH_KEYWORDS|METH_VARARGS, "fromImage(image)\n\ntype: image: QImage const &" },
  1736. {(char *) "height", (PyCFunction) _wrap_PyQPixmap_height, METH_NOARGS, "height()\n\n" },
  1737. {(char *) "toImage", (PyCFunction) _wrap_PyQPixmap_toImage, METH_NOARGS, "toImage()\n\n" },
  1738. {(char *) "width", (PyCFunction) _wrap_PyQPixmap_width, METH_NOARGS, "width()\n\n" },
  1739. {(char *) "__copy__", (PyCFunction) _wrap_PyQPixmap__copy__, METH_NOARGS, NULL},
  1740. {NULL, NULL, 0, NULL}
  1741. };
  1742. static void
  1743. _wrap_PyQPixmap__tp_dealloc(PyQPixmap *self)
  1744. {
  1745. QPixmap *tmp = self->obj;
  1746. self->obj = NULL;
  1747. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  1748. delete tmp;
  1749. }
  1750. Py_TYPE(self)->tp_free((PyObject*)self);
  1751. }
  1752. PyTypeObject PyQPixmap_Type = {
  1753. PyVarObject_HEAD_INIT(NULL, 0)
  1754. (char *) "tiled.qt.QPixmap", /* tp_name */
  1755. sizeof(PyQPixmap), /* tp_basicsize */
  1756. 0, /* tp_itemsize */
  1757. /* methods */
  1758. (destructor)_wrap_PyQPixmap__tp_dealloc, /* tp_dealloc */
  1759. (printfunc)0, /* tp_print */
  1760. (getattrfunc)NULL, /* tp_getattr */
  1761. (setattrfunc)NULL, /* tp_setattr */
  1762. #if PY_MAJOR_VERSION >= 3
  1763. NULL,
  1764. #else
  1765. (cmpfunc)NULL, /* tp_compare */
  1766. #endif
  1767. (reprfunc)NULL, /* tp_repr */
  1768. (PyNumberMethods*)NULL, /* tp_as_number */
  1769. (PySequenceMethods*)NULL, /* tp_as_sequence */
  1770. (PyMappingMethods*)NULL, /* tp_as_mapping */
  1771. (hashfunc)NULL, /* tp_hash */
  1772. (ternaryfunc)NULL, /* tp_call */
  1773. (reprfunc)NULL, /* tp_str */
  1774. (getattrofunc)NULL, /* tp_getattro */
  1775. (setattrofunc)NULL, /* tp_setattro */
  1776. (PyBufferProcs*)NULL, /* tp_as_buffer */
  1777. Py_TPFLAGS_DEFAULT, /* tp_flags */
  1778. "QPixmap(ctor_arg)", /* Documentation string */
  1779. (traverseproc)NULL, /* tp_traverse */
  1780. (inquiry)NULL, /* tp_clear */
  1781. (richcmpfunc)NULL, /* tp_richcompare */
  1782. 0, /* tp_weaklistoffset */
  1783. (getiterfunc)NULL, /* tp_iter */
  1784. (iternextfunc)NULL, /* tp_iternext */
  1785. (struct PyMethodDef*)PyQPixmap_methods, /* tp_methods */
  1786. (struct PyMemberDef*)0, /* tp_members */
  1787. 0, /* tp_getset */
  1788. NULL, /* tp_base */
  1789. NULL, /* tp_dict */
  1790. (descrgetfunc)NULL, /* tp_descr_get */
  1791. (descrsetfunc)NULL, /* tp_descr_set */
  1792. 0, /* tp_dictoffset */
  1793. (initproc)_wrap_PyQPixmap__tp_init, /* tp_init */
  1794. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  1795. (newfunc)PyType_GenericNew, /* tp_new */
  1796. (freefunc)0, /* tp_free */
  1797. (inquiry)NULL, /* tp_is_gc */
  1798. NULL, /* tp_bases */
  1799. NULL, /* tp_mro */
  1800. NULL, /* tp_cache */
  1801. NULL, /* tp_subclasses */
  1802. NULL, /* tp_weaklist */
  1803. (destructor) NULL /* tp_del */
  1804. };
  1805. static int
  1806. _wrap_PyQWidget__tp_init(void)
  1807. {
  1808. PyErr_SetString(PyExc_TypeError, "class 'QWidget' cannot be constructed ()");
  1809. return -1;
  1810. }
  1811. static PyMethodDef PyQWidget_methods[] = {
  1812. {NULL, NULL, 0, NULL}
  1813. };
  1814. static void
  1815. _wrap_PyQWidget__tp_dealloc(PyQWidget *self)
  1816. {
  1817. QWidget *tmp = self->obj;
  1818. self->obj = NULL;
  1819. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  1820. delete tmp;
  1821. }
  1822. Py_TYPE(self)->tp_free((PyObject*)self);
  1823. }
  1824. PyTypeObject PyQWidget_Type = {
  1825. PyVarObject_HEAD_INIT(NULL, 0)
  1826. (char *) "tiled.qt.QWidget", /* tp_name */
  1827. sizeof(PyQWidget), /* tp_basicsize */
  1828. 0, /* tp_itemsize */
  1829. /* methods */
  1830. (destructor)_wrap_PyQWidget__tp_dealloc, /* tp_dealloc */
  1831. (printfunc)0, /* tp_print */
  1832. (getattrfunc)NULL, /* tp_getattr */
  1833. (setattrfunc)NULL, /* tp_setattr */
  1834. #if PY_MAJOR_VERSION >= 3
  1835. NULL,
  1836. #else
  1837. (cmpfunc)NULL, /* tp_compare */
  1838. #endif
  1839. (reprfunc)NULL, /* tp_repr */
  1840. (PyNumberMethods*)NULL, /* tp_as_number */
  1841. (PySequenceMethods*)NULL, /* tp_as_sequence */
  1842. (PyMappingMethods*)NULL, /* tp_as_mapping */
  1843. (hashfunc)NULL, /* tp_hash */
  1844. (ternaryfunc)NULL, /* tp_call */
  1845. (reprfunc)NULL, /* tp_str */
  1846. (getattrofunc)NULL, /* tp_getattro */
  1847. (setattrofunc)NULL, /* tp_setattro */
  1848. (PyBufferProcs*)NULL, /* tp_as_buffer */
  1849. Py_TPFLAGS_DEFAULT, /* tp_flags */
  1850. "", /* Documentation string */
  1851. (traverseproc)NULL, /* tp_traverse */
  1852. (inquiry)NULL, /* tp_clear */
  1853. (richcmpfunc)NULL, /* tp_richcompare */
  1854. 0, /* tp_weaklistoffset */
  1855. (getiterfunc)NULL, /* tp_iter */
  1856. (iternextfunc)NULL, /* tp_iternext */
  1857. (struct PyMethodDef*)PyQWidget_methods, /* tp_methods */
  1858. (struct PyMemberDef*)0, /* tp_members */
  1859. 0, /* tp_getset */
  1860. NULL, /* tp_base */
  1861. NULL, /* tp_dict */
  1862. (descrgetfunc)NULL, /* tp_descr_get */
  1863. (descrsetfunc)NULL, /* tp_descr_set */
  1864. 0, /* tp_dictoffset */
  1865. (initproc)_wrap_PyQWidget__tp_init, /* tp_init */
  1866. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  1867. (newfunc)PyType_GenericNew, /* tp_new */
  1868. (freefunc)0, /* tp_free */
  1869. (inquiry)NULL, /* tp_is_gc */
  1870. NULL, /* tp_bases */
  1871. NULL, /* tp_mro */
  1872. NULL, /* tp_cache */
  1873. NULL, /* tp_subclasses */
  1874. NULL, /* tp_weaklist */
  1875. (destructor) NULL /* tp_del */
  1876. };
  1877. static int
  1878. _wrap_PyQFileDialog__tp_init(void)
  1879. {
  1880. PyErr_SetString(PyExc_TypeError, "class 'QFileDialog' cannot be constructed ()");
  1881. return -1;
  1882. }
  1883. PyObject *
  1884. _wrap_PyQFileDialog_getOpenFileName(PyQFileDialog *PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs)
  1885. {
  1886. PyObject *py_retval;
  1887. QString retval;
  1888. PyQWidget *parent;
  1889. QWidget *parent_ptr;
  1890. const char *caption;
  1891. Py_ssize_t caption_len;
  1892. const char *dir;
  1893. Py_ssize_t dir_len;
  1894. const char *filter;
  1895. Py_ssize_t filter_len;
  1896. const char *selectedFilter;
  1897. QFileDialog::Option options;
  1898. const char *keywords[] = {"parent", "caption", "dir", "filter", "selectedFilter", "options", NULL};
  1899. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "Os#s#s#|si", (char **) keywords, &parent, &caption, &caption_len, &dir, &dir_len, &filter, &filter_len, &selectedFilter, &options)) {
  1900. return NULL;
  1901. }
  1902. if (parent && ((PyObject *) parent != Py_None) && !PyObject_IsInstance((PyObject *) parent, (PyObject *) &PyQWidget_Type)) {
  1903. PyErr_SetString(PyExc_TypeError, "Parameter 1 must be of type QWidget");
  1904. return NULL;
  1905. }
  1906. if (parent) {
  1907. if ((PyObject *) parent == Py_None)
  1908. parent_ptr = NULL;
  1909. else
  1910. parent_ptr = parent->obj;
  1911. } else {
  1912. parent_ptr = NULL;
  1913. }
  1914. retval = QFileDialog::getOpenFileName(parent_ptr, QString::fromUtf8(caption), QString::fromUtf8(dir), QString::fromUtf8(filter), new QString(""), 0);
  1915. py_retval = Py_BuildValue((char *) "s", retval.toUtf8().data());
  1916. return py_retval;
  1917. }
  1918. static PyMethodDef PyQFileDialog_methods[] = {
  1919. {(char *) "getOpenFileName", (PyCFunction) _wrap_PyQFileDialog_getOpenFileName, METH_KEYWORDS|METH_VARARGS|METH_STATIC, "getOpenFileName(parent, caption, dir, filter, selectedFilter, options)\n\ntype: parent: QWidget *\ntype: caption: QString const\ntype: dir: QString const\ntype: filter: QString const\ntype: selectedFilter: QString *\ntype: options: QFlags< QFileDialog::Option >" },
  1920. {NULL, NULL, 0, NULL}
  1921. };
  1922. static void
  1923. _wrap_PyQFileDialog__tp_dealloc(PyQFileDialog *self)
  1924. {
  1925. QFileDialog *tmp = self->obj;
  1926. self->obj = NULL;
  1927. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  1928. delete tmp;
  1929. }
  1930. Py_TYPE(self)->tp_free((PyObject*)self);
  1931. }
  1932. PyTypeObject PyQFileDialog_Type = {
  1933. PyVarObject_HEAD_INIT(NULL, 0)
  1934. (char *) "tiled.qt.QFileDialog", /* tp_name */
  1935. sizeof(PyQFileDialog), /* tp_basicsize */
  1936. 0, /* tp_itemsize */
  1937. /* methods */
  1938. (destructor)_wrap_PyQFileDialog__tp_dealloc, /* tp_dealloc */
  1939. (printfunc)0, /* tp_print */
  1940. (getattrfunc)NULL, /* tp_getattr */
  1941. (setattrfunc)NULL, /* tp_setattr */
  1942. #if PY_MAJOR_VERSION >= 3
  1943. NULL,
  1944. #else
  1945. (cmpfunc)NULL, /* tp_compare */
  1946. #endif
  1947. (reprfunc)NULL, /* tp_repr */
  1948. (PyNumberMethods*)NULL, /* tp_as_number */
  1949. (PySequenceMethods*)NULL, /* tp_as_sequence */
  1950. (PyMappingMethods*)NULL, /* tp_as_mapping */
  1951. (hashfunc)NULL, /* tp_hash */
  1952. (ternaryfunc)NULL, /* tp_call */
  1953. (reprfunc)NULL, /* tp_str */
  1954. (getattrofunc)NULL, /* tp_getattro */
  1955. (setattrofunc)NULL, /* tp_setattro */
  1956. (PyBufferProcs*)NULL, /* tp_as_buffer */
  1957. Py_TPFLAGS_DEFAULT, /* tp_flags */
  1958. "", /* Documentation string */
  1959. (traverseproc)NULL, /* tp_traverse */
  1960. (inquiry)NULL, /* tp_clear */
  1961. (richcmpfunc)NULL, /* tp_richcompare */
  1962. 0, /* tp_weaklistoffset */
  1963. (getiterfunc)NULL, /* tp_iter */
  1964. (iternextfunc)NULL, /* tp_iternext */
  1965. (struct PyMethodDef*)PyQFileDialog_methods, /* tp_methods */
  1966. (struct PyMemberDef*)0, /* tp_members */
  1967. 0, /* tp_getset */
  1968. NULL, /* tp_base */
  1969. NULL, /* tp_dict */
  1970. (descrgetfunc)NULL, /* tp_descr_get */
  1971. (descrsetfunc)NULL, /* tp_descr_set */
  1972. 0, /* tp_dictoffset */
  1973. (initproc)_wrap_PyQFileDialog__tp_init, /* tp_init */
  1974. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  1975. (newfunc)PyType_GenericNew, /* tp_new */
  1976. (freefunc)0, /* tp_free */
  1977. (inquiry)NULL, /* tp_is_gc */
  1978. NULL, /* tp_bases */
  1979. NULL, /* tp_mro */
  1980. NULL, /* tp_cache */
  1981. NULL, /* tp_subclasses */
  1982. NULL, /* tp_weaklist */
  1983. (destructor) NULL /* tp_del */
  1984. };
  1985. /* --- containers --- */
  1986. static void
  1987. PyQVector__lt__QRgb__gt__Iter__tp_clear(PyQVector__lt__QRgb__gt__Iter *self)
  1988. {
  1989. Py_CLEAR(self->container);
  1990. delete self->iterator;
  1991. self->iterator = NULL;
  1992. }
  1993. static int
  1994. PyQVector__lt__QRgb__gt__Iter__tp_traverse(PyQVector__lt__QRgb__gt__Iter *self, visitproc visit, void *arg)
  1995. {
  1996. Py_VISIT((PyObject *) self->container);
  1997. return 0;
  1998. }
  1999. static void
  2000. _wrap_PyQVector__lt__QRgb__gt____tp_dealloc(PyQVector__lt__QRgb__gt__ *self)
  2001. {
  2002. delete self->obj;
  2003. self->obj = NULL;
  2004. Py_TYPE(self)->tp_free((PyObject*)self);
  2005. }
  2006. static void
  2007. _wrap_PyQVector__lt__QRgb__gt__Iter__tp_dealloc(PyQVector__lt__QRgb__gt__Iter *self)
  2008. {
  2009. Py_CLEAR(self->container);
  2010. delete self->iterator;
  2011. self->iterator = NULL;
  2012. Py_TYPE(self)->tp_free((PyObject*)self);
  2013. }
  2014. static PyObject*
  2015. _wrap_PyQVector__lt__QRgb__gt____tp_iter(PyQVector__lt__QRgb__gt__ *self)
  2016. {
  2017. PyQVector__lt__QRgb__gt__Iter *iter = PyObject_GC_New(PyQVector__lt__QRgb__gt__Iter, &PyQVector__lt__QRgb__gt__Iter_Type);
  2018. Py_INCREF(self);
  2019. iter->container = self;
  2020. iter->iterator = new QVector<QRgb>::iterator(self->obj->begin());
  2021. return (PyObject*) iter;
  2022. }
  2023. static PyObject*
  2024. _wrap_PyQVector__lt__QRgb__gt__Iter__tp_iter(PyQVector__lt__QRgb__gt__Iter *self)
  2025. {
  2026. Py_INCREF(self);
  2027. return (PyObject*) self;
  2028. }
  2029. static PyObject* _wrap_PyQVector__lt__QRgb__gt__Iter__tp_iternext(PyQVector__lt__QRgb__gt__Iter *self)
  2030. {
  2031. PyObject *py_retval;
  2032. QVector<QRgb>::iterator iter;
  2033. PyQRgb *py_QRgb;
  2034. iter = *self->iterator;
  2035. if (iter == self->container->obj->end()) {
  2036. PyErr_SetNone(PyExc_StopIteration);
  2037. return NULL;
  2038. }
  2039. ++(*self->iterator);
  2040. py_QRgb = PyObject_New(PyQRgb, &PyQRgb_Type);
  2041. py_QRgb->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  2042. py_QRgb->obj = new QRgb((*iter));
  2043. py_retval = Py_BuildValue((char *) "N", py_QRgb);
  2044. return py_retval;
  2045. }
  2046. int _wrap_convert_py2c__QRgb(PyObject *value, QRgb *address)
  2047. {
  2048. PyObject *py_retval;
  2049. PyQRgb *tmp_QRgb;
  2050. py_retval = Py_BuildValue((char *) "(O)", value);
  2051. if (!PyArg_ParseTuple(py_retval, (char *) "O!", &PyQRgb_Type, &tmp_QRgb)) {
  2052. Py_DECREF(py_retval);
  2053. return 0;
  2054. }
  2055. *address = *tmp_QRgb->obj;
  2056. Py_DECREF(py_retval);
  2057. return 1;
  2058. }
  2059. int _wrap_convert_py2c__QVector__lt___QRgb___gt__(PyObject *arg, QVector<QRgb> *container)
  2060. {
  2061. if (PyObject_IsInstance(arg, (PyObject*) &PyQVector__lt__QRgb__gt___Type)) {
  2062. *container = *((PyQVector__lt__QRgb__gt__*)arg)->obj;
  2063. } else if (PyList_Check(arg)) {
  2064. container->clear();
  2065. Py_ssize_t size = PyList_Size(arg);
  2066. for (Py_ssize_t i = 0; i < size; i++) {
  2067. QRgb item;
  2068. if (!_wrap_convert_py2c__QRgb(PyList_GET_ITEM(arg, i), &item)) {
  2069. return 0;
  2070. }
  2071. container->push_back(item);
  2072. }
  2073. } else {
  2074. PyErr_SetString(PyExc_TypeError, "parameter must be None, a QVector__lt__QRgb__gt__ instance, or a list of QRgb");
  2075. return 0;
  2076. }
  2077. return 1;
  2078. }
  2079. static int
  2080. _wrap_PyQVector__lt__QRgb__gt____tp_init(PyQVector__lt__QRgb__gt__ *self, PyObject *args, PyObject *kwargs)
  2081. {
  2082. const char *keywords[] = {"arg", NULL};
  2083. PyObject *arg = NULL;
  2084. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "|O", (char **) keywords, &arg)) {
  2085. return -1;
  2086. }
  2087. self->obj = new QVector<QRgb>;
  2088. if (arg == NULL)
  2089. return 0;
  2090. if (!_wrap_convert_py2c__QVector__lt___QRgb___gt__(arg, self->obj)) {
  2091. delete self->obj;
  2092. self->obj = NULL;
  2093. return -1;
  2094. }
  2095. return 0;
  2096. }
  2097. PyTypeObject PyQVector__lt__QRgb__gt___Type = {
  2098. PyVarObject_HEAD_INIT(NULL, 0)
  2099. (char *) "tiled.qt.QVector__lt__QRgb__gt__", /* tp_name */
  2100. sizeof(PyQVector__lt__QRgb__gt__), /* tp_basicsize */
  2101. 0, /* tp_itemsize */
  2102. /* methods */
  2103. (destructor)_wrap_PyQVector__lt__QRgb__gt____tp_dealloc, /* tp_dealloc */
  2104. (printfunc)0, /* tp_print */
  2105. (getattrfunc)NULL, /* tp_getattr */
  2106. (setattrfunc)NULL, /* tp_setattr */
  2107. #if PY_MAJOR_VERSION >= 3
  2108. NULL,
  2109. #else
  2110. (cmpfunc)NULL, /* tp_compare */
  2111. #endif
  2112. (reprfunc)NULL, /* tp_repr */
  2113. (PyNumberMethods*)NULL, /* tp_as_number */
  2114. (PySequenceMethods*)NULL, /* tp_as_sequence */
  2115. (PyMappingMethods*)NULL, /* tp_as_mapping */
  2116. (hashfunc)NULL, /* tp_hash */
  2117. (ternaryfunc)NULL, /* tp_call */
  2118. (reprfunc)NULL, /* tp_str */
  2119. (getattrofunc)NULL, /* tp_getattro */
  2120. (setattrofunc)NULL, /* tp_setattro */
  2121. (PyBufferProcs*)NULL, /* tp_as_buffer */
  2122. Py_TPFLAGS_DEFAULT, /* tp_flags */
  2123. NULL, /* Documentation string */
  2124. (traverseproc)NULL, /* tp_traverse */
  2125. (inquiry)NULL, /* tp_clear */
  2126. (richcmpfunc)NULL, /* tp_richcompare */
  2127. 0, /* tp_weaklistoffset */
  2128. (getiterfunc)_wrap_PyQVector__lt__QRgb__gt____tp_iter, /* tp_iter */
  2129. (iternextfunc)NULL, /* tp_iternext */
  2130. (struct PyMethodDef*)NULL, /* tp_methods */
  2131. (struct PyMemberDef*)0, /* tp_members */
  2132. NULL, /* tp_getset */
  2133. NULL, /* tp_base */
  2134. NULL, /* tp_dict */
  2135. (descrgetfunc)NULL, /* tp_descr_get */
  2136. (descrsetfunc)NULL, /* tp_descr_set */
  2137. 0, /* tp_dictoffset */
  2138. (initproc)_wrap_PyQVector__lt__QRgb__gt____tp_init, /* tp_init */
  2139. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  2140. (newfunc)PyType_GenericNew, /* tp_new */
  2141. (freefunc)0, /* tp_free */
  2142. (inquiry)NULL, /* tp_is_gc */
  2143. NULL, /* tp_bases */
  2144. NULL, /* tp_mro */
  2145. NULL, /* tp_cache */
  2146. NULL, /* tp_subclasses */
  2147. NULL, /* tp_weaklist */
  2148. (destructor) NULL /* tp_del */
  2149. };
  2150. PyTypeObject PyQVector__lt__QRgb__gt__Iter_Type = {
  2151. PyVarObject_HEAD_INIT(NULL, 0)
  2152. (char *) "tiled.qt.QVector__lt__QRgb__gt__Iter", /* tp_name */
  2153. sizeof(PyQVector__lt__QRgb__gt__Iter), /* tp_basicsize */
  2154. 0, /* tp_itemsize */
  2155. /* methods */
  2156. (destructor)_wrap_PyQVector__lt__QRgb__gt__Iter__tp_dealloc, /* tp_dealloc */
  2157. (printfunc)0, /* tp_print */
  2158. (getattrfunc)NULL, /* tp_getattr */
  2159. (setattrfunc)NULL, /* tp_setattr */
  2160. #if PY_MAJOR_VERSION >= 3
  2161. NULL,
  2162. #else
  2163. (cmpfunc)NULL, /* tp_compare */
  2164. #endif
  2165. (reprfunc)NULL, /* tp_repr */
  2166. (PyNumberMethods*)NULL, /* tp_as_number */
  2167. (PySequenceMethods*)NULL, /* tp_as_sequence */
  2168. (PyMappingMethods*)NULL, /* tp_as_mapping */
  2169. (hashfunc)NULL, /* tp_hash */
  2170. (ternaryfunc)NULL, /* tp_call */
  2171. (reprfunc)NULL, /* tp_str */
  2172. (getattrofunc)NULL, /* tp_getattro */
  2173. (setattrofunc)NULL, /* tp_setattro */
  2174. (PyBufferProcs*)NULL, /* tp_as_buffer */
  2175. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC, /* tp_flags */
  2176. NULL, /* Documentation string */
  2177. (traverseproc)PyQVector__lt__QRgb__gt__Iter__tp_traverse, /* tp_traverse */
  2178. (inquiry)PyQVector__lt__QRgb__gt__Iter__tp_clear, /* tp_clear */
  2179. (richcmpfunc)NULL, /* tp_richcompare */
  2180. 0, /* tp_weaklistoffset */
  2181. (getiterfunc)_wrap_PyQVector__lt__QRgb__gt__Iter__tp_iter, /* tp_iter */
  2182. (iternextfunc)_wrap_PyQVector__lt__QRgb__gt__Iter__tp_iternext, /* tp_iternext */
  2183. (struct PyMethodDef*)NULL, /* tp_methods */
  2184. (struct PyMemberDef*)0, /* tp_members */
  2185. NULL, /* tp_getset */
  2186. NULL, /* tp_base */
  2187. NULL, /* tp_dict */
  2188. (descrgetfunc)NULL, /* tp_descr_get */
  2189. (descrsetfunc)NULL, /* tp_descr_set */
  2190. 0, /* tp_dictoffset */
  2191. (initproc)NULL, /* tp_init */
  2192. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  2193. (newfunc)PyType_GenericNew, /* tp_new */
  2194. (freefunc)0, /* tp_free */
  2195. (inquiry)NULL, /* tp_is_gc */
  2196. NULL, /* tp_bases */
  2197. NULL, /* tp_mro */
  2198. NULL, /* tp_cache */
  2199. NULL, /* tp_subclasses */
  2200. NULL, /* tp_weaklist */
  2201. (destructor) NULL /* tp_del */
  2202. };
  2203. static void
  2204. PyQList__lt__QString__gt__Iter__tp_clear(PyQList__lt__QString__gt__Iter *self)
  2205. {
  2206. Py_CLEAR(self->container);
  2207. delete self->iterator;
  2208. self->iterator = NULL;
  2209. }
  2210. static int
  2211. PyQList__lt__QString__gt__Iter__tp_traverse(PyQList__lt__QString__gt__Iter *self, visitproc visit, void *arg)
  2212. {
  2213. Py_VISIT((PyObject *) self->container);
  2214. return 0;
  2215. }
  2216. static void
  2217. _wrap_PyQList__lt__QString__gt____tp_dealloc(PyQList__lt__QString__gt__ *self)
  2218. {
  2219. delete self->obj;
  2220. self->obj = NULL;
  2221. Py_TYPE(self)->tp_free((PyObject*)self);
  2222. }
  2223. static void
  2224. _wrap_PyQList__lt__QString__gt__Iter__tp_dealloc(PyQList__lt__QString__gt__Iter *self)
  2225. {
  2226. Py_CLEAR(self->container);
  2227. delete self->iterator;
  2228. self->iterator = NULL;
  2229. Py_TYPE(self)->tp_free((PyObject*)self);
  2230. }
  2231. static PyObject*
  2232. _wrap_PyQList__lt__QString__gt____tp_iter(PyQList__lt__QString__gt__ *self)
  2233. {
  2234. PyQList__lt__QString__gt__Iter *iter = PyObject_GC_New(PyQList__lt__QString__gt__Iter, &PyQList__lt__QString__gt__Iter_Type);
  2235. Py_INCREF(self);
  2236. iter->container = self;
  2237. iter->iterator = new QList<QString>::iterator(self->obj->begin());
  2238. return (PyObject*) iter;
  2239. }
  2240. static PyObject*
  2241. _wrap_PyQList__lt__QString__gt__Iter__tp_iter(PyQList__lt__QString__gt__Iter *self)
  2242. {
  2243. Py_INCREF(self);
  2244. return (PyObject*) self;
  2245. }
  2246. static PyObject* _wrap_PyQList__lt__QString__gt__Iter__tp_iternext(PyQList__lt__QString__gt__Iter *self)
  2247. {
  2248. PyObject *py_retval;
  2249. QList<QString>::iterator iter;
  2250. iter = *self->iterator;
  2251. if (iter == self->container->obj->end()) {
  2252. PyErr_SetNone(PyExc_StopIteration);
  2253. return NULL;
  2254. }
  2255. ++(*self->iterator);
  2256. py_retval = Py_BuildValue((char *) "s", (*iter).toUtf8().data());
  2257. return py_retval;
  2258. }
  2259. int _wrap_convert_py2c__QString(PyObject *value, QString *address)
  2260. {
  2261. PyObject *py_retval;
  2262. const char *retval_ptr;
  2263. Py_ssize_t retval_len;
  2264. py_retval = Py_BuildValue((char *) "(O)", value);
  2265. if (!PyArg_ParseTuple(py_retval, (char *) "s#", &retval_ptr, &retval_len)) {
  2266. Py_DECREF(py_retval);
  2267. return 0;
  2268. }
  2269. *address = QString(retval_ptr);
  2270. Py_DECREF(py_retval);
  2271. return 1;
  2272. }
  2273. int _wrap_convert_py2c__QList__lt___QString___gt__(PyObject *arg, QList<QString> *container)
  2274. {
  2275. if (PyObject_IsInstance(arg, (PyObject*) &PyQList__lt__QString__gt___Type)) {
  2276. *container = *((PyQList__lt__QString__gt__*)arg)->obj;
  2277. } else if (PyList_Check(arg)) {
  2278. container->clear();
  2279. Py_ssize_t size = PyList_Size(arg);
  2280. for (Py_ssize_t i = 0; i < size; i++) {
  2281. QString item;
  2282. if (!_wrap_convert_py2c__QString(PyList_GET_ITEM(arg, i), &item)) {
  2283. return 0;
  2284. }
  2285. container->push_back(item);
  2286. }
  2287. } else {
  2288. PyErr_SetString(PyExc_TypeError, "parameter must be None, a QList__lt__QString__gt__ instance, or a list of QString");
  2289. return 0;
  2290. }
  2291. return 1;
  2292. }
  2293. static int
  2294. _wrap_PyQList__lt__QString__gt____tp_init(PyQList__lt__QString__gt__ *self, PyObject *args, PyObject *kwargs)
  2295. {
  2296. const char *keywords[] = {"arg", NULL};
  2297. PyObject *arg = NULL;
  2298. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "|O", (char **) keywords, &arg)) {
  2299. return -1;
  2300. }
  2301. self->obj = new QList<QString>;
  2302. if (arg == NULL)
  2303. return 0;
  2304. if (!_wrap_convert_py2c__QList__lt___QString___gt__(arg, self->obj)) {
  2305. delete self->obj;
  2306. self->obj = NULL;
  2307. return -1;
  2308. }
  2309. return 0;
  2310. }
  2311. PyTypeObject PyQList__lt__QString__gt___Type = {
  2312. PyVarObject_HEAD_INIT(NULL, 0)
  2313. (char *) "tiled.qt.QList__lt__QString__gt__", /* tp_name */
  2314. sizeof(PyQList__lt__QString__gt__), /* tp_basicsize */
  2315. 0, /* tp_itemsize */
  2316. /* methods */
  2317. (destructor)_wrap_PyQList__lt__QString__gt____tp_dealloc, /* tp_dealloc */
  2318. (printfunc)0, /* tp_print */
  2319. (getattrfunc)NULL, /* tp_getattr */
  2320. (setattrfunc)NULL, /* tp_setattr */
  2321. #if PY_MAJOR_VERSION >= 3
  2322. NULL,
  2323. #else
  2324. (cmpfunc)NULL, /* tp_compare */
  2325. #endif
  2326. (reprfunc)NULL, /* tp_repr */
  2327. (PyNumberMethods*)NULL, /* tp_as_number */
  2328. (PySequenceMethods*)NULL, /* tp_as_sequence */
  2329. (PyMappingMethods*)NULL, /* tp_as_mapping */
  2330. (hashfunc)NULL, /* tp_hash */
  2331. (ternaryfunc)NULL, /* tp_call */
  2332. (reprfunc)NULL, /* tp_str */
  2333. (getattrofunc)NULL, /* tp_getattro */
  2334. (setattrofunc)NULL, /* tp_setattro */
  2335. (PyBufferProcs*)NULL, /* tp_as_buffer */
  2336. Py_TPFLAGS_DEFAULT, /* tp_flags */
  2337. NULL, /* Documentation string */
  2338. (traverseproc)NULL, /* tp_traverse */
  2339. (inquiry)NULL, /* tp_clear */
  2340. (richcmpfunc)NULL, /* tp_richcompare */
  2341. 0, /* tp_weaklistoffset */
  2342. (getiterfunc)_wrap_PyQList__lt__QString__gt____tp_iter, /* tp_iter */
  2343. (iternextfunc)NULL, /* tp_iternext */
  2344. (struct PyMethodDef*)NULL, /* tp_methods */
  2345. (struct PyMemberDef*)0, /* tp_members */
  2346. NULL, /* tp_getset */
  2347. NULL, /* tp_base */
  2348. NULL, /* tp_dict */
  2349. (descrgetfunc)NULL, /* tp_descr_get */
  2350. (descrsetfunc)NULL, /* tp_descr_set */
  2351. 0, /* tp_dictoffset */
  2352. (initproc)_wrap_PyQList__lt__QString__gt____tp_init, /* tp_init */
  2353. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  2354. (newfunc)PyType_GenericNew, /* tp_new */
  2355. (freefunc)0, /* tp_free */
  2356. (inquiry)NULL, /* tp_is_gc */
  2357. NULL, /* tp_bases */
  2358. NULL, /* tp_mro */
  2359. NULL, /* tp_cache */
  2360. NULL, /* tp_subclasses */
  2361. NULL, /* tp_weaklist */
  2362. (destructor) NULL /* tp_del */
  2363. };
  2364. PyTypeObject PyQList__lt__QString__gt__Iter_Type = {
  2365. PyVarObject_HEAD_INIT(NULL, 0)
  2366. (char *) "tiled.qt.QList__lt__QString__gt__Iter", /* tp_name */
  2367. sizeof(PyQList__lt__QString__gt__Iter), /* tp_basicsize */
  2368. 0, /* tp_itemsize */
  2369. /* methods */
  2370. (destructor)_wrap_PyQList__lt__QString__gt__Iter__tp_dealloc, /* tp_dealloc */
  2371. (printfunc)0, /* tp_print */
  2372. (getattrfunc)NULL, /* tp_getattr */
  2373. (setattrfunc)NULL, /* tp_setattr */
  2374. #if PY_MAJOR_VERSION >= 3
  2375. NULL,
  2376. #else
  2377. (cmpfunc)NULL, /* tp_compare */
  2378. #endif
  2379. (reprfunc)NULL, /* tp_repr */
  2380. (PyNumberMethods*)NULL, /* tp_as_number */
  2381. (PySequenceMethods*)NULL, /* tp_as_sequence */
  2382. (PyMappingMethods*)NULL, /* tp_as_mapping */
  2383. (hashfunc)NULL, /* tp_hash */
  2384. (ternaryfunc)NULL, /* tp_call */
  2385. (reprfunc)NULL, /* tp_str */
  2386. (getattrofunc)NULL, /* tp_getattro */
  2387. (setattrofunc)NULL, /* tp_setattro */
  2388. (PyBufferProcs*)NULL, /* tp_as_buffer */
  2389. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC, /* tp_flags */
  2390. NULL, /* Documentation string */
  2391. (traverseproc)PyQList__lt__QString__gt__Iter__tp_traverse, /* tp_traverse */
  2392. (inquiry)PyQList__lt__QString__gt__Iter__tp_clear, /* tp_clear */
  2393. (richcmpfunc)NULL, /* tp_richcompare */
  2394. 0, /* tp_weaklistoffset */
  2395. (getiterfunc)_wrap_PyQList__lt__QString__gt__Iter__tp_iter, /* tp_iter */
  2396. (iternextfunc)_wrap_PyQList__lt__QString__gt__Iter__tp_iternext, /* tp_iternext */
  2397. (struct PyMethodDef*)NULL, /* tp_methods */
  2398. (struct PyMemberDef*)0, /* tp_members */
  2399. NULL, /* tp_getset */
  2400. NULL, /* tp_base */
  2401. NULL, /* tp_dict */
  2402. (descrgetfunc)NULL, /* tp_descr_get */
  2403. (descrsetfunc)NULL, /* tp_descr_set */
  2404. 0, /* tp_dictoffset */
  2405. (initproc)NULL, /* tp_init */
  2406. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  2407. (newfunc)PyType_GenericNew, /* tp_new */
  2408. (freefunc)0, /* tp_free */
  2409. (inquiry)NULL, /* tp_is_gc */
  2410. NULL, /* tp_bases */
  2411. NULL, /* tp_mro */
  2412. NULL, /* tp_cache */
  2413. NULL, /* tp_subclasses */
  2414. NULL, /* tp_weaklist */
  2415. (destructor) NULL /* tp_del */
  2416. };
  2417. /* --- enumerations --- */
  2418. bool isImageLayerAt(Tiled::Map *map, int index) {
  2419. return map->layerAt(index)->isImageLayer();
  2420. }
  2421. bool isTileLayerAt(Tiled::Map *map, int index) {
  2422. return map->layerAt(index)->isTileLayer();
  2423. }
  2424. bool isObjectGroupAt(Tiled::Map *map, int index) {
  2425. return map->layerAt(index)->isObjectGroup();
  2426. }
  2427. Tiled::ImageLayer* imageLayerAt(Tiled::Map *map, int index) {
  2428. return map->layerAt(index)->asImageLayer();
  2429. }
  2430. Tiled::TileLayer* tileLayerAt(Tiled::Map *map, int index) {
  2431. return map->layerAt(index)->asTileLayer();
  2432. }
  2433. Tiled::ObjectGroup* objectGroupAt(Tiled::Map *map, int index) {
  2434. return map->layerAt(index)->asObjectGroup();
  2435. }
  2436. static bool loadTilesetFromFile(Tiled::Tileset *ts, const QString &file)
  2437. {
  2438. QImage img(file);
  2439. return ts->loadFromImage(img, file);
  2440. }
  2441. static Tiled::SharedTileset loadTileset(const QString &file)
  2442. {
  2443. return Tiled::TilesetManager::instance()->loadTileset(file);
  2444. }
  2445. #if PY_VERSION_HEX >= 0x03000000
  2446. static struct PyModuleDef tiled_qt_moduledef = {
  2447. PyModuleDef_HEAD_INIT,
  2448. "tiled.qt",
  2449. NULL,
  2450. -1,
  2451. tiled_qt_functions,
  2452. };
  2453. #endif
  2454. static PyObject *
  2455. inittiled_qt(void)
  2456. {
  2457. PyObject *m;
  2458. #if PY_VERSION_HEX >= 0x03000000
  2459. m = PyModule_Create(&tiled_qt_moduledef);
  2460. #else
  2461. m = Py_InitModule3((char *) "tiled.qt", tiled_qt_functions, NULL);
  2462. #endif
  2463. if (m == NULL) {
  2464. return NULL;
  2465. }
  2466. /* Register the 'QPoint' class */
  2467. if (PyType_Ready(&PyQPoint_Type)) {
  2468. return NULL;
  2469. }
  2470. PyModule_AddObject(m, (char *) "QPoint", (PyObject *) &PyQPoint_Type);
  2471. /* Register the 'QPointF' class */
  2472. if (PyType_Ready(&PyQPointF_Type)) {
  2473. return NULL;
  2474. }
  2475. PyModule_AddObject(m, (char *) "QPointF", (PyObject *) &PyQPointF_Type);
  2476. /* Register the 'QSize' class */
  2477. if (PyType_Ready(&PyQSize_Type)) {
  2478. return NULL;
  2479. }
  2480. PyModule_AddObject(m, (char *) "QSize", (PyObject *) &PyQSize_Type);
  2481. /* Register the 'QSizeF' class */
  2482. if (PyType_Ready(&PyQSizeF_Type)) {
  2483. return NULL;
  2484. }
  2485. PyModule_AddObject(m, (char *) "QSizeF", (PyObject *) &PyQSizeF_Type);
  2486. /* Register the 'QRgb' class */
  2487. if (PyType_Ready(&PyQRgb_Type)) {
  2488. return NULL;
  2489. }
  2490. PyModule_AddObject(m, (char *) "QRgb", (PyObject *) &PyQRgb_Type);
  2491. /* Register the 'QColor' class */
  2492. if (PyType_Ready(&PyQColor_Type)) {
  2493. return NULL;
  2494. }
  2495. PyModule_AddObject(m, (char *) "QColor", (PyObject *) &PyQColor_Type);
  2496. /* Register the 'QImage' class */
  2497. if (PyType_Ready(&PyQImage_Type)) {
  2498. return NULL;
  2499. }
  2500. PyModule_AddObject(m, (char *) "QImage", (PyObject *) &PyQImage_Type);
  2501. /* Register the 'QPixmap' class */
  2502. if (PyType_Ready(&PyQPixmap_Type)) {
  2503. return NULL;
  2504. }
  2505. PyModule_AddObject(m, (char *) "QPixmap", (PyObject *) &PyQPixmap_Type);
  2506. /* Register the 'QWidget' class */
  2507. if (PyType_Ready(&PyQWidget_Type)) {
  2508. return NULL;
  2509. }
  2510. PyModule_AddObject(m, (char *) "QWidget", (PyObject *) &PyQWidget_Type);
  2511. /* Register the 'QFileDialog' class */
  2512. if (PyType_Ready(&PyQFileDialog_Type)) {
  2513. return NULL;
  2514. }
  2515. PyModule_AddObject(m, (char *) "QFileDialog", (PyObject *) &PyQFileDialog_Type);
  2516. /* Register the 'QVector<QRgb>' class */
  2517. if (PyType_Ready(&PyQVector__lt__QRgb__gt___Type)) {
  2518. return NULL;
  2519. }
  2520. if (PyType_Ready(&PyQVector__lt__QRgb__gt__Iter_Type)) {
  2521. return NULL;
  2522. }
  2523. PyModule_AddObject(m, (char *) "QVector__lt__QRgb__gt__", (PyObject *) &PyQVector__lt__QRgb__gt___Type);
  2524. PyModule_AddObject(m, (char *) "QVector__lt__QRgb__gt__Iter", (PyObject *) &PyQVector__lt__QRgb__gt__Iter_Type);
  2525. /* Register the 'QList<QString>' class */
  2526. if (PyType_Ready(&PyQList__lt__QString__gt___Type)) {
  2527. return NULL;
  2528. }
  2529. if (PyType_Ready(&PyQList__lt__QString__gt__Iter_Type)) {
  2530. return NULL;
  2531. }
  2532. PyModule_AddObject(m, (char *) "QList__lt__QString__gt__", (PyObject *) &PyQList__lt__QString__gt___Type);
  2533. PyModule_AddObject(m, (char *) "QList__lt__QString__gt__Iter", (PyObject *) &PyQList__lt__QString__gt__Iter_Type);
  2534. {
  2535. PyObject *tmp_value;
  2536. // QImage::Format_Invalid
  2537. tmp_value = PyLong_FromLong(QImage::Format_Invalid);
  2538. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_Invalid", tmp_value);
  2539. Py_DECREF(tmp_value);
  2540. // QImage::Format_Mono
  2541. tmp_value = PyLong_FromLong(QImage::Format_Mono);
  2542. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_Mono", tmp_value);
  2543. Py_DECREF(tmp_value);
  2544. // QImage::Format_MonoLSB
  2545. tmp_value = PyLong_FromLong(QImage::Format_MonoLSB);
  2546. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_MonoLSB", tmp_value);
  2547. Py_DECREF(tmp_value);
  2548. // QImage::Format_Indexed8
  2549. tmp_value = PyLong_FromLong(QImage::Format_Indexed8);
  2550. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_Indexed8", tmp_value);
  2551. Py_DECREF(tmp_value);
  2552. // QImage::Format_RGB32
  2553. tmp_value = PyLong_FromLong(QImage::Format_RGB32);
  2554. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_RGB32", tmp_value);
  2555. Py_DECREF(tmp_value);
  2556. // QImage::Format_ARGB32
  2557. tmp_value = PyLong_FromLong(QImage::Format_ARGB32);
  2558. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_ARGB32", tmp_value);
  2559. Py_DECREF(tmp_value);
  2560. // QImage::Format_ARGB32_Premultiplied
  2561. tmp_value = PyLong_FromLong(QImage::Format_ARGB32_Premultiplied);
  2562. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_ARGB32_Premultiplied", tmp_value);
  2563. Py_DECREF(tmp_value);
  2564. // QImage::Format_RGB16
  2565. tmp_value = PyLong_FromLong(QImage::Format_RGB16);
  2566. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_RGB16", tmp_value);
  2567. Py_DECREF(tmp_value);
  2568. // QImage::Format_ARGB8565_Premultiplied
  2569. tmp_value = PyLong_FromLong(QImage::Format_ARGB8565_Premultiplied);
  2570. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_ARGB8565_Premultiplied", tmp_value);
  2571. Py_DECREF(tmp_value);
  2572. // QImage::Format_RGB666
  2573. tmp_value = PyLong_FromLong(QImage::Format_RGB666);
  2574. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_RGB666", tmp_value);
  2575. Py_DECREF(tmp_value);
  2576. // QImage::Format_ARGB6666_Premultiplied
  2577. tmp_value = PyLong_FromLong(QImage::Format_ARGB6666_Premultiplied);
  2578. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_ARGB6666_Premultiplied", tmp_value);
  2579. Py_DECREF(tmp_value);
  2580. // QImage::Format_RGB555
  2581. tmp_value = PyLong_FromLong(QImage::Format_RGB555);
  2582. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_RGB555", tmp_value);
  2583. Py_DECREF(tmp_value);
  2584. // QImage::Format_ARGB8555_Premultiplied
  2585. tmp_value = PyLong_FromLong(QImage::Format_ARGB8555_Premultiplied);
  2586. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_ARGB8555_Premultiplied", tmp_value);
  2587. Py_DECREF(tmp_value);
  2588. // QImage::Format_RGB888
  2589. tmp_value = PyLong_FromLong(QImage::Format_RGB888);
  2590. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_RGB888", tmp_value);
  2591. Py_DECREF(tmp_value);
  2592. // QImage::Format_RGB444
  2593. tmp_value = PyLong_FromLong(QImage::Format_RGB444);
  2594. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_RGB444", tmp_value);
  2595. Py_DECREF(tmp_value);
  2596. // QImage::Format_ARGB4444_Premultiplied
  2597. tmp_value = PyLong_FromLong(QImage::Format_ARGB4444_Premultiplied);
  2598. PyDict_SetItemString((PyObject*) PyQImage_Type.tp_dict, "Format_ARGB4444_Premultiplied", tmp_value);
  2599. Py_DECREF(tmp_value);
  2600. }
  2601. {
  2602. PyObject *tmp_value;
  2603. // QFileDialog::ShowDirsOnly
  2604. tmp_value = PyLong_FromLong(QFileDialog::ShowDirsOnly);
  2605. PyDict_SetItemString((PyObject*) PyQFileDialog_Type.tp_dict, "ShowDirsOnly", tmp_value);
  2606. Py_DECREF(tmp_value);
  2607. // QFileDialog::DontResolveSymlinks
  2608. tmp_value = PyLong_FromLong(QFileDialog::DontResolveSymlinks);
  2609. PyDict_SetItemString((PyObject*) PyQFileDialog_Type.tp_dict, "DontResolveSymlinks", tmp_value);
  2610. Py_DECREF(tmp_value);
  2611. // QFileDialog::DontConfirmOverwrite
  2612. tmp_value = PyLong_FromLong(QFileDialog::DontConfirmOverwrite);
  2613. PyDict_SetItemString((PyObject*) PyQFileDialog_Type.tp_dict, "DontConfirmOverwrite", tmp_value);
  2614. Py_DECREF(tmp_value);
  2615. // QFileDialog::DontUseNativeDialog
  2616. tmp_value = PyLong_FromLong(QFileDialog::DontUseNativeDialog);
  2617. PyDict_SetItemString((PyObject*) PyQFileDialog_Type.tp_dict, "DontUseNativeDialog", tmp_value);
  2618. Py_DECREF(tmp_value);
  2619. // QFileDialog::ReadOnly
  2620. tmp_value = PyLong_FromLong(QFileDialog::ReadOnly);
  2621. PyDict_SetItemString((PyObject*) PyQFileDialog_Type.tp_dict, "ReadOnly", tmp_value);
  2622. Py_DECREF(tmp_value);
  2623. // QFileDialog::HideNameFilterDetails
  2624. tmp_value = PyLong_FromLong(QFileDialog::HideNameFilterDetails);
  2625. PyDict_SetItemString((PyObject*) PyQFileDialog_Type.tp_dict, "HideNameFilterDetails", tmp_value);
  2626. Py_DECREF(tmp_value);
  2627. // QFileDialog::DontUseSheet
  2628. tmp_value = PyLong_FromLong(QFileDialog::DontUseSheet);
  2629. PyDict_SetItemString((PyObject*) PyQFileDialog_Type.tp_dict, "DontUseSheet", tmp_value);
  2630. Py_DECREF(tmp_value);
  2631. }
  2632. return m;
  2633. }
  2634. static PyMethodDef tiled_Tiled_functions[] = {
  2635. {NULL, NULL, 0, NULL}
  2636. };
  2637. /* --- classes --- */
  2638. static int
  2639. _wrap_PyTiledProperties__tp_init(PyTiledProperties *self, PyObject *args, PyObject *kwargs)
  2640. {
  2641. PyTiledProperties *ctor_arg;
  2642. const char *keywords[] = {"ctor_arg", NULL};
  2643. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledProperties_Type, &ctor_arg)) {
  2644. return -1;
  2645. }
  2646. self->obj = new Tiled::Properties(*((PyTiledProperties *) ctor_arg)->obj);
  2647. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  2648. return 0;
  2649. }
  2650. PyObject *
  2651. _wrap_PyTiledProperties_keys(PyTiledProperties *self)
  2652. {
  2653. PyObject *py_retval;
  2654. QList< QString > retval;
  2655. PyQList__lt__QString__gt__ *py_QList__lt__QString__gt__;
  2656. retval = self->obj->keys();
  2657. py_QList__lt__QString__gt__ = PyObject_New(PyQList__lt__QString__gt__, &PyQList__lt__QString__gt___Type);
  2658. py_QList__lt__QString__gt__->obj = new QList<QString>(retval);
  2659. py_retval = Py_BuildValue((char *) "N", py_QList__lt__QString__gt__);
  2660. return py_retval;
  2661. }
  2662. static PyObject*
  2663. _wrap_PyTiledProperties__copy__(PyTiledProperties *self)
  2664. {
  2665. PyTiledProperties *py_copy;
  2666. py_copy = PyObject_New(PyTiledProperties, &PyTiledProperties_Type);
  2667. py_copy->obj = new Tiled::Properties(*self->obj);
  2668. py_copy->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  2669. return (PyObject*) py_copy;
  2670. }
  2671. static PyMethodDef PyTiledProperties_methods[] = {
  2672. {(char *) "keys", (PyCFunction) _wrap_PyTiledProperties_keys, METH_NOARGS, "keys()\n\n" },
  2673. {(char *) "__copy__", (PyCFunction) _wrap_PyTiledProperties__copy__, METH_NOARGS, NULL},
  2674. {NULL, NULL, 0, NULL}
  2675. };
  2676. static void
  2677. _wrap_PyTiledProperties__tp_dealloc(PyTiledProperties *self)
  2678. {
  2679. Tiled::Properties *tmp = self->obj;
  2680. self->obj = NULL;
  2681. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  2682. delete tmp;
  2683. }
  2684. Py_TYPE(self)->tp_free((PyObject*)self);
  2685. }
  2686. PyTypeObject PyTiledProperties_Type = {
  2687. PyVarObject_HEAD_INIT(NULL, 0)
  2688. (char *) "tiled.Tiled.Properties", /* tp_name */
  2689. sizeof(PyTiledProperties), /* tp_basicsize */
  2690. 0, /* tp_itemsize */
  2691. /* methods */
  2692. (destructor)_wrap_PyTiledProperties__tp_dealloc, /* tp_dealloc */
  2693. (printfunc)0, /* tp_print */
  2694. (getattrfunc)NULL, /* tp_getattr */
  2695. (setattrfunc)NULL, /* tp_setattr */
  2696. #if PY_MAJOR_VERSION >= 3
  2697. NULL,
  2698. #else
  2699. (cmpfunc)NULL, /* tp_compare */
  2700. #endif
  2701. (reprfunc)NULL, /* tp_repr */
  2702. (PyNumberMethods*)NULL, /* tp_as_number */
  2703. (PySequenceMethods*)NULL, /* tp_as_sequence */
  2704. (PyMappingMethods*)NULL, /* tp_as_mapping */
  2705. (hashfunc)NULL, /* tp_hash */
  2706. (ternaryfunc)NULL, /* tp_call */
  2707. (reprfunc)NULL, /* tp_str */
  2708. (getattrofunc)NULL, /* tp_getattro */
  2709. (setattrofunc)NULL, /* tp_setattro */
  2710. (PyBufferProcs*)NULL, /* tp_as_buffer */
  2711. Py_TPFLAGS_DEFAULT, /* tp_flags */
  2712. "Properties(ctor_arg)", /* Documentation string */
  2713. (traverseproc)NULL, /* tp_traverse */
  2714. (inquiry)NULL, /* tp_clear */
  2715. (richcmpfunc)NULL, /* tp_richcompare */
  2716. 0, /* tp_weaklistoffset */
  2717. (getiterfunc)NULL, /* tp_iter */
  2718. (iternextfunc)NULL, /* tp_iternext */
  2719. (struct PyMethodDef*)PyTiledProperties_methods, /* tp_methods */
  2720. (struct PyMemberDef*)0, /* tp_members */
  2721. 0, /* tp_getset */
  2722. NULL, /* tp_base */
  2723. NULL, /* tp_dict */
  2724. (descrgetfunc)NULL, /* tp_descr_get */
  2725. (descrsetfunc)NULL, /* tp_descr_set */
  2726. 0, /* tp_dictoffset */
  2727. (initproc)_wrap_PyTiledProperties__tp_init, /* tp_init */
  2728. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  2729. (newfunc)PyType_GenericNew, /* tp_new */
  2730. (freefunc)0, /* tp_free */
  2731. (inquiry)NULL, /* tp_is_gc */
  2732. NULL, /* tp_bases */
  2733. NULL, /* tp_mro */
  2734. NULL, /* tp_cache */
  2735. NULL, /* tp_subclasses */
  2736. NULL, /* tp_weaklist */
  2737. (destructor) NULL /* tp_del */
  2738. };
  2739. static int
  2740. _wrap_PyTiledObject__tp_init(void)
  2741. {
  2742. PyErr_SetString(PyExc_TypeError, "class 'Object' cannot be constructed ()");
  2743. return -1;
  2744. }
  2745. PyObject *
  2746. _wrap_PyTiledObject_properties(PyTiledObject *self)
  2747. {
  2748. PyObject *py_retval;
  2749. PyTiledProperties *py_Properties;
  2750. Tiled::Properties const retval = self->obj->properties();
  2751. py_Properties = PyObject_New(PyTiledProperties, &PyTiledProperties_Type);
  2752. py_Properties->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  2753. py_Properties->obj = new Tiled::Properties(retval);
  2754. py_retval = Py_BuildValue((char *) "N", py_Properties);
  2755. return py_retval;
  2756. }
  2757. PyObject *
  2758. _wrap_PyTiledObject_propertyAsString(PyTiledObject *self, PyObject *args, PyObject *kwargs)
  2759. {
  2760. PyObject *py_retval;
  2761. QString retval;
  2762. const char *prop;
  2763. Py_ssize_t prop_len;
  2764. const char *keywords[] = {"prop", NULL};
  2765. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#", (char **) keywords, &prop, &prop_len)) {
  2766. return NULL;
  2767. }
  2768. retval = self->obj->propertyAsString(QString::fromUtf8(prop));
  2769. py_retval = Py_BuildValue((char *) "s", retval.toUtf8().data());
  2770. return py_retval;
  2771. }
  2772. PyObject *
  2773. _wrap_PyTiledObject_propertyType(PyTiledObject *self, PyObject *args, PyObject *kwargs)
  2774. {
  2775. PyObject *py_retval;
  2776. QString retval;
  2777. const char *prop;
  2778. Py_ssize_t prop_len;
  2779. const char *keywords[] = {"prop", NULL};
  2780. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#", (char **) keywords, &prop, &prop_len)) {
  2781. return NULL;
  2782. }
  2783. retval = self->obj->propertyType(QString::fromUtf8(prop));
  2784. py_retval = Py_BuildValue((char *) "s", retval.toUtf8().data());
  2785. return py_retval;
  2786. }
  2787. PyObject *
  2788. _wrap_PyTiledObject_setProperty__0(PyTiledObject *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  2789. {
  2790. PyObject *py_retval;
  2791. const char *prop;
  2792. Py_ssize_t prop_len;
  2793. const char *val;
  2794. Py_ssize_t val_len;
  2795. const char *keywords[] = {"prop", "val", NULL};
  2796. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#s#", (char **) keywords, &prop, &prop_len, &val, &val_len)) {
  2797. {
  2798. PyObject *exc_type, *traceback;
  2799. PyErr_Fetch(&exc_type, return_exception, &traceback);
  2800. Py_XDECREF(exc_type);
  2801. Py_XDECREF(traceback);
  2802. }
  2803. return NULL;
  2804. }
  2805. self->obj->setProperty(QString::fromUtf8(prop), QString::fromUtf8(val));
  2806. Py_INCREF(Py_None);
  2807. py_retval = Py_None;
  2808. return py_retval;
  2809. }
  2810. PyObject *
  2811. _wrap_PyTiledObject_setProperty__1(PyTiledObject *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  2812. {
  2813. PyObject *py_retval;
  2814. const char *prop;
  2815. Py_ssize_t prop_len;
  2816. int val;
  2817. const char *keywords[] = {"prop", "val", NULL};
  2818. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#i", (char **) keywords, &prop, &prop_len, &val)) {
  2819. {
  2820. PyObject *exc_type, *traceback;
  2821. PyErr_Fetch(&exc_type, return_exception, &traceback);
  2822. Py_XDECREF(exc_type);
  2823. Py_XDECREF(traceback);
  2824. }
  2825. return NULL;
  2826. }
  2827. self->obj->setProperty(QString::fromUtf8(prop), val);
  2828. Py_INCREF(Py_None);
  2829. py_retval = Py_None;
  2830. return py_retval;
  2831. }
  2832. PyObject *
  2833. _wrap_PyTiledObject_setProperty__2(PyTiledObject *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  2834. {
  2835. PyObject *py_retval;
  2836. const char *prop;
  2837. Py_ssize_t prop_len;
  2838. bool val;
  2839. PyObject *py_val;
  2840. const char *keywords[] = {"prop", "val", NULL};
  2841. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#O", (char **) keywords, &prop, &prop_len, &py_val)) {
  2842. {
  2843. PyObject *exc_type, *traceback;
  2844. PyErr_Fetch(&exc_type, return_exception, &traceback);
  2845. Py_XDECREF(exc_type);
  2846. Py_XDECREF(traceback);
  2847. }
  2848. return NULL;
  2849. }
  2850. val = (bool) PyObject_IsTrue(py_val);
  2851. self->obj->setProperty(QString::fromUtf8(prop), val);
  2852. Py_INCREF(Py_None);
  2853. py_retval = Py_None;
  2854. return py_retval;
  2855. }
  2856. PyObject * _wrap_PyTiledObject_setProperty(PyTiledObject *self, PyObject *args, PyObject *kwargs)
  2857. {
  2858. PyObject * retval;
  2859. PyObject *error_list;
  2860. PyObject *exceptions[3] = {0,};
  2861. retval = _wrap_PyTiledObject_setProperty__0(self, args, kwargs, &exceptions[0]);
  2862. if (!exceptions[0]) {
  2863. return retval;
  2864. }
  2865. retval = _wrap_PyTiledObject_setProperty__1(self, args, kwargs, &exceptions[1]);
  2866. if (!exceptions[1]) {
  2867. Py_DECREF(exceptions[0]);
  2868. return retval;
  2869. }
  2870. retval = _wrap_PyTiledObject_setProperty__2(self, args, kwargs, &exceptions[2]);
  2871. if (!exceptions[2]) {
  2872. Py_DECREF(exceptions[0]);
  2873. Py_DECREF(exceptions[1]);
  2874. return retval;
  2875. }
  2876. error_list = PyList_New(3);
  2877. PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
  2878. Py_DECREF(exceptions[0]);
  2879. PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
  2880. Py_DECREF(exceptions[1]);
  2881. PyList_SET_ITEM(error_list, 2, PyObject_Str(exceptions[2]));
  2882. Py_DECREF(exceptions[2]);
  2883. PyErr_SetObject(PyExc_TypeError, error_list);
  2884. Py_DECREF(error_list);
  2885. return NULL;
  2886. }
  2887. static PyMethodDef PyTiledObject_methods[] = {
  2888. {(char *) "properties", (PyCFunction) _wrap_PyTiledObject_properties, METH_NOARGS, "properties()\n\n" },
  2889. {(char *) "propertyAsString", (PyCFunction) _wrap_PyTiledObject_propertyAsString, METH_KEYWORDS|METH_VARARGS, "propertyAsString(prop)\n\ntype: prop: QString" },
  2890. {(char *) "propertyType", (PyCFunction) _wrap_PyTiledObject_propertyType, METH_KEYWORDS|METH_VARARGS, "propertyType(prop)\n\ntype: prop: QString" },
  2891. {(char *) "setProperty", (PyCFunction) _wrap_PyTiledObject_setProperty, METH_KEYWORDS|METH_VARARGS, NULL },
  2892. {NULL, NULL, 0, NULL}
  2893. };
  2894. static void
  2895. _wrap_PyTiledObject__tp_dealloc(PyTiledObject *self)
  2896. {
  2897. Tiled::Object *tmp = self->obj;
  2898. self->obj = NULL;
  2899. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  2900. delete tmp;
  2901. }
  2902. Py_TYPE(self)->tp_free((PyObject*)self);
  2903. }
  2904. PyTypeObject PyTiledObject_Type = {
  2905. PyVarObject_HEAD_INIT(NULL, 0)
  2906. (char *) "tiled.Tiled.Object", /* tp_name */
  2907. sizeof(PyTiledObject), /* tp_basicsize */
  2908. 0, /* tp_itemsize */
  2909. /* methods */
  2910. (destructor)_wrap_PyTiledObject__tp_dealloc, /* tp_dealloc */
  2911. (printfunc)0, /* tp_print */
  2912. (getattrfunc)NULL, /* tp_getattr */
  2913. (setattrfunc)NULL, /* tp_setattr */
  2914. #if PY_MAJOR_VERSION >= 3
  2915. NULL,
  2916. #else
  2917. (cmpfunc)NULL, /* tp_compare */
  2918. #endif
  2919. (reprfunc)NULL, /* tp_repr */
  2920. (PyNumberMethods*)NULL, /* tp_as_number */
  2921. (PySequenceMethods*)NULL, /* tp_as_sequence */
  2922. (PyMappingMethods*)NULL, /* tp_as_mapping */
  2923. (hashfunc)NULL, /* tp_hash */
  2924. (ternaryfunc)NULL, /* tp_call */
  2925. (reprfunc)NULL, /* tp_str */
  2926. (getattrofunc)NULL, /* tp_getattro */
  2927. (setattrofunc)NULL, /* tp_setattro */
  2928. (PyBufferProcs*)NULL, /* tp_as_buffer */
  2929. Py_TPFLAGS_DEFAULT, /* tp_flags */
  2930. "", /* Documentation string */
  2931. (traverseproc)NULL, /* tp_traverse */
  2932. (inquiry)NULL, /* tp_clear */
  2933. (richcmpfunc)NULL, /* tp_richcompare */
  2934. 0, /* tp_weaklistoffset */
  2935. (getiterfunc)NULL, /* tp_iter */
  2936. (iternextfunc)NULL, /* tp_iternext */
  2937. (struct PyMethodDef*)PyTiledObject_methods, /* tp_methods */
  2938. (struct PyMemberDef*)0, /* tp_members */
  2939. 0, /* tp_getset */
  2940. NULL, /* tp_base */
  2941. NULL, /* tp_dict */
  2942. (descrgetfunc)NULL, /* tp_descr_get */
  2943. (descrsetfunc)NULL, /* tp_descr_set */
  2944. 0, /* tp_dictoffset */
  2945. (initproc)_wrap_PyTiledObject__tp_init, /* tp_init */
  2946. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  2947. (newfunc)PyType_GenericNew, /* tp_new */
  2948. (freefunc)0, /* tp_free */
  2949. (inquiry)NULL, /* tp_is_gc */
  2950. NULL, /* tp_bases */
  2951. NULL, /* tp_mro */
  2952. NULL, /* tp_cache */
  2953. NULL, /* tp_subclasses */
  2954. NULL, /* tp_weaklist */
  2955. (destructor) NULL /* tp_del */
  2956. };
  2957. static int
  2958. _wrap_PyTiledTile__tp_init(PyTiledTile *self, PyObject *args, PyObject *kwargs)
  2959. {
  2960. PyQPixmap *image;
  2961. int id;
  2962. PyTiledTileset *tileset;
  2963. Tiled::Tileset *tileset_ptr;
  2964. const char *keywords[] = {"image", "id", "tileset", NULL};
  2965. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!iO!", (char **) keywords, &PyQPixmap_Type, &image, &id, &PyTiledTileset_Type, &tileset)) {
  2966. return -1;
  2967. }
  2968. tileset_ptr = (tileset ? tileset->obj : NULL);
  2969. self->obj = new Tiled::Tile(*((PyQPixmap *) image)->obj, id, tileset_ptr);
  2970. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  2971. return 0;
  2972. }
  2973. PyObject *
  2974. _wrap_PyTiledTile_height(PyTiledTile *self)
  2975. {
  2976. PyObject *py_retval;
  2977. int retval;
  2978. retval = self->obj->height();
  2979. py_retval = Py_BuildValue((char *) "i", retval);
  2980. return py_retval;
  2981. }
  2982. PyObject *
  2983. _wrap_PyTiledTile_id(PyTiledTile *self)
  2984. {
  2985. PyObject *py_retval;
  2986. int retval;
  2987. retval = self->obj->id();
  2988. py_retval = Py_BuildValue((char *) "i", retval);
  2989. return py_retval;
  2990. }
  2991. PyObject *
  2992. _wrap_PyTiledTile_image(PyTiledTile *self)
  2993. {
  2994. PyObject *py_retval;
  2995. PyQPixmap *py_QPixmap;
  2996. QPixmap const & retval = self->obj->image();
  2997. py_QPixmap = PyObject_New(PyQPixmap, &PyQPixmap_Type);
  2998. py_QPixmap->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  2999. py_QPixmap->obj = new QPixmap(retval);
  3000. py_retval = Py_BuildValue((char *) "N", py_QPixmap);
  3001. return py_retval;
  3002. }
  3003. PyObject *
  3004. _wrap_PyTiledTile_setImage(PyTiledTile *self, PyObject *args, PyObject *kwargs)
  3005. {
  3006. PyObject *py_retval;
  3007. PyQPixmap *image;
  3008. const char *keywords[] = {"image", NULL};
  3009. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQPixmap_Type, &image)) {
  3010. return NULL;
  3011. }
  3012. self->obj->setImage(*((PyQPixmap *) image)->obj);
  3013. Py_INCREF(Py_None);
  3014. py_retval = Py_None;
  3015. return py_retval;
  3016. }
  3017. PyObject *
  3018. _wrap_PyTiledTile_size(PyTiledTile *self)
  3019. {
  3020. PyObject *py_retval;
  3021. PyQSize *py_QSize;
  3022. QSize retval = self->obj->size();
  3023. py_QSize = PyObject_New(PyQSize, &PyQSize_Type);
  3024. py_QSize->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  3025. py_QSize->obj = new QSize(retval);
  3026. py_retval = Py_BuildValue((char *) "N", py_QSize);
  3027. return py_retval;
  3028. }
  3029. PyObject *
  3030. _wrap_PyTiledTile_tileset(PyTiledTile *self)
  3031. {
  3032. PyObject *py_retval;
  3033. Tiled::Tileset *retval;
  3034. PyTiledTileset *py_Tileset;
  3035. retval = self->obj->tileset();
  3036. if (!(retval)) {
  3037. Py_INCREF(Py_None);
  3038. return Py_None;
  3039. }
  3040. py_Tileset = PyObject_New(PyTiledTileset, &PyTiledTileset_Type);
  3041. py_Tileset->obj = retval;
  3042. py_Tileset->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  3043. py_retval = Py_BuildValue((char *) "N", py_Tileset);
  3044. return py_retval;
  3045. }
  3046. PyObject *
  3047. _wrap_PyTiledTile_type(PyTiledTile *self)
  3048. {
  3049. PyObject *py_retval;
  3050. QString retval;
  3051. retval = self->obj->type();
  3052. py_retval = Py_BuildValue((char *) "s", retval.toUtf8().data());
  3053. return py_retval;
  3054. }
  3055. PyObject *
  3056. _wrap_PyTiledTile_width(PyTiledTile *self)
  3057. {
  3058. PyObject *py_retval;
  3059. int retval;
  3060. retval = self->obj->width();
  3061. py_retval = Py_BuildValue((char *) "i", retval);
  3062. return py_retval;
  3063. }
  3064. static PyMethodDef PyTiledTile_methods[] = {
  3065. {(char *) "height", (PyCFunction) _wrap_PyTiledTile_height, METH_NOARGS, "height()\n\n" },
  3066. {(char *) "id", (PyCFunction) _wrap_PyTiledTile_id, METH_NOARGS, "id()\n\n" },
  3067. {(char *) "image", (PyCFunction) _wrap_PyTiledTile_image, METH_NOARGS, "image()\n\n" },
  3068. {(char *) "setImage", (PyCFunction) _wrap_PyTiledTile_setImage, METH_KEYWORDS|METH_VARARGS, "setImage(image)\n\ntype: image: QPixmap const &" },
  3069. {(char *) "size", (PyCFunction) _wrap_PyTiledTile_size, METH_NOARGS, "size()\n\n" },
  3070. {(char *) "tileset", (PyCFunction) _wrap_PyTiledTile_tileset, METH_NOARGS, "tileset()\n\n" },
  3071. {(char *) "type", (PyCFunction) _wrap_PyTiledTile_type, METH_NOARGS, "type()\n\n" },
  3072. {(char *) "width", (PyCFunction) _wrap_PyTiledTile_width, METH_NOARGS, "width()\n\n" },
  3073. {NULL, NULL, 0, NULL}
  3074. };
  3075. static void
  3076. _wrap_PyTiledTile__tp_dealloc(PyTiledTile *self)
  3077. {
  3078. Tiled::Tile *tmp = self->obj;
  3079. self->obj = NULL;
  3080. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  3081. delete tmp;
  3082. }
  3083. Py_TYPE(self)->tp_free((PyObject*)self);
  3084. }
  3085. PyTypeObject PyTiledTile_Type = {
  3086. PyVarObject_HEAD_INIT(NULL, 0)
  3087. (char *) "tiled.Tiled.Tile", /* tp_name */
  3088. sizeof(PyTiledTile), /* tp_basicsize */
  3089. 0, /* tp_itemsize */
  3090. /* methods */
  3091. (destructor)_wrap_PyTiledTile__tp_dealloc, /* tp_dealloc */
  3092. (printfunc)0, /* tp_print */
  3093. (getattrfunc)NULL, /* tp_getattr */
  3094. (setattrfunc)NULL, /* tp_setattr */
  3095. #if PY_MAJOR_VERSION >= 3
  3096. NULL,
  3097. #else
  3098. (cmpfunc)NULL, /* tp_compare */
  3099. #endif
  3100. (reprfunc)NULL, /* tp_repr */
  3101. (PyNumberMethods*)NULL, /* tp_as_number */
  3102. (PySequenceMethods*)NULL, /* tp_as_sequence */
  3103. (PyMappingMethods*)NULL, /* tp_as_mapping */
  3104. (hashfunc)NULL, /* tp_hash */
  3105. (ternaryfunc)NULL, /* tp_call */
  3106. (reprfunc)NULL, /* tp_str */
  3107. (getattrofunc)NULL, /* tp_getattro */
  3108. (setattrofunc)NULL, /* tp_setattro */
  3109. (PyBufferProcs*)NULL, /* tp_as_buffer */
  3110. Py_TPFLAGS_DEFAULT, /* tp_flags */
  3111. "Tile(image, id, tileset)", /* Documentation string */
  3112. (traverseproc)NULL, /* tp_traverse */
  3113. (inquiry)NULL, /* tp_clear */
  3114. (richcmpfunc)NULL, /* tp_richcompare */
  3115. 0, /* tp_weaklistoffset */
  3116. (getiterfunc)NULL, /* tp_iter */
  3117. (iternextfunc)NULL, /* tp_iternext */
  3118. (struct PyMethodDef*)PyTiledTile_methods, /* tp_methods */
  3119. (struct PyMemberDef*)0, /* tp_members */
  3120. 0, /* tp_getset */
  3121. NULL, /* tp_base */
  3122. NULL, /* tp_dict */
  3123. (descrgetfunc)NULL, /* tp_descr_get */
  3124. (descrsetfunc)NULL, /* tp_descr_set */
  3125. 0, /* tp_dictoffset */
  3126. (initproc)_wrap_PyTiledTile__tp_init, /* tp_init */
  3127. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  3128. (newfunc)PyType_GenericNew, /* tp_new */
  3129. (freefunc)0, /* tp_free */
  3130. (inquiry)NULL, /* tp_is_gc */
  3131. NULL, /* tp_bases */
  3132. NULL, /* tp_mro */
  3133. NULL, /* tp_cache */
  3134. NULL, /* tp_subclasses */
  3135. NULL, /* tp_weaklist */
  3136. (destructor) NULL /* tp_del */
  3137. };
  3138. static int
  3139. _wrap_PyTiledTileset__tp_init(void)
  3140. {
  3141. PyErr_SetString(PyExc_TypeError, "class 'Tileset' cannot be constructed ()");
  3142. return -1;
  3143. }
  3144. PyObject *
  3145. _wrap_PyTiledTileset_columnCount(PyTiledTileset *self)
  3146. {
  3147. PyObject *py_retval;
  3148. int retval;
  3149. retval = self->obj->columnCount();
  3150. py_retval = Py_BuildValue((char *) "i", retval);
  3151. return py_retval;
  3152. }
  3153. PyObject *
  3154. _wrap_PyTiledTileset_create(PyTiledTileset *PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs)
  3155. {
  3156. PyObject *py_retval;
  3157. const char *name;
  3158. Py_ssize_t name_len;
  3159. int tileWidth;
  3160. int tileHeight;
  3161. int tileSpacing;
  3162. int margin;
  3163. const char *keywords[] = {"name", "tileWidth", "tileHeight", "tileSpacing", "margin", NULL};
  3164. PyTiledSharedTileset *py_SharedTileset;
  3165. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#iiii", (char **) keywords, &name, &name_len, &tileWidth, &tileHeight, &tileSpacing, &margin)) {
  3166. return NULL;
  3167. }
  3168. Tiled::SharedTileset retval = Tiled::Tileset::create(QString::fromUtf8(name), tileWidth, tileHeight, tileSpacing, margin);
  3169. py_SharedTileset = PyObject_New(PyTiledSharedTileset, &PyTiledSharedTileset_Type);
  3170. py_SharedTileset->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  3171. py_SharedTileset->obj = new Tiled::SharedTileset(retval);
  3172. py_retval = Py_BuildValue((char *) "N", py_SharedTileset);
  3173. return py_retval;
  3174. }
  3175. PyObject *
  3176. _wrap_PyTiledTileset_fileName(PyTiledTileset *self)
  3177. {
  3178. PyObject *py_retval;
  3179. QString retval;
  3180. retval = self->obj->fileName();
  3181. py_retval = Py_BuildValue((char *) "s", retval.toUtf8().data());
  3182. return py_retval;
  3183. }
  3184. PyObject *
  3185. _wrap_PyTiledTileset_findTile(PyTiledTileset *self, PyObject *args, PyObject *kwargs)
  3186. {
  3187. PyObject *py_retval;
  3188. Tiled::Tile *retval;
  3189. int id;
  3190. const char *keywords[] = {"id", NULL};
  3191. PyTiledTile *py_Tile;
  3192. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &id)) {
  3193. return NULL;
  3194. }
  3195. retval = self->obj->findTile(id);
  3196. if (!(retval)) {
  3197. Py_INCREF(Py_None);
  3198. return Py_None;
  3199. }
  3200. py_Tile = PyObject_New(PyTiledTile, &PyTiledTile_Type);
  3201. py_Tile->obj = retval;
  3202. py_Tile->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  3203. py_retval = Py_BuildValue((char *) "N", py_Tile);
  3204. return py_retval;
  3205. }
  3206. PyObject *
  3207. _wrap_PyTiledTileset_gridSize(PyTiledTileset *self)
  3208. {
  3209. PyObject *py_retval;
  3210. PyQSize *py_QSize;
  3211. QSize retval = self->obj->gridSize();
  3212. py_QSize = PyObject_New(PyQSize, &PyQSize_Type);
  3213. py_QSize->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  3214. py_QSize->obj = new QSize(retval);
  3215. py_retval = Py_BuildValue((char *) "N", py_QSize);
  3216. return py_retval;
  3217. }
  3218. PyObject *
  3219. _wrap_PyTiledTileset_imageHeight(PyTiledTileset *self)
  3220. {
  3221. PyObject *py_retval;
  3222. int retval;
  3223. retval = self->obj->imageHeight();
  3224. py_retval = Py_BuildValue((char *) "i", retval);
  3225. return py_retval;
  3226. }
  3227. PyObject *
  3228. _wrap_PyTiledTileset_imageSourceString(PyTiledTileset *self)
  3229. {
  3230. PyObject *py_retval;
  3231. QString retval;
  3232. retval = self->obj->imageSourceString();
  3233. py_retval = Py_BuildValue((char *) "s", retval.toUtf8().data());
  3234. return py_retval;
  3235. }
  3236. PyObject *
  3237. _wrap_PyTiledTileset_imageWidth(PyTiledTileset *self)
  3238. {
  3239. PyObject *py_retval;
  3240. int retval;
  3241. retval = self->obj->imageWidth();
  3242. py_retval = Py_BuildValue((char *) "i", retval);
  3243. return py_retval;
  3244. }
  3245. PyObject *
  3246. _wrap_PyTiledTileset_isCollection(PyTiledTileset *self)
  3247. {
  3248. PyObject *py_retval;
  3249. bool retval;
  3250. retval = self->obj->isCollection();
  3251. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  3252. return py_retval;
  3253. }
  3254. PyObject *
  3255. _wrap_PyTiledTileset_isExternal(PyTiledTileset *self)
  3256. {
  3257. PyObject *py_retval;
  3258. bool retval;
  3259. retval = self->obj->isExternal();
  3260. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  3261. return py_retval;
  3262. }
  3263. PyObject *
  3264. _wrap_PyTiledTileset_loadFromImage(PyTiledTileset *self, PyObject *args, PyObject *kwargs)
  3265. {
  3266. PyObject *py_retval;
  3267. bool retval;
  3268. PyQImage *img;
  3269. const char *file;
  3270. Py_ssize_t file_len;
  3271. const char *keywords[] = {"img", "file", NULL};
  3272. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!s#", (char **) keywords, &PyQImage_Type, &img, &file, &file_len)) {
  3273. return NULL;
  3274. }
  3275. retval = self->obj->loadFromImage(*((PyQImage *) img)->obj, QString::fromUtf8(file));
  3276. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  3277. return py_retval;
  3278. }
  3279. PyObject *
  3280. _wrap_PyTiledTileset_loadImage(PyTiledTileset *self)
  3281. {
  3282. PyObject *py_retval;
  3283. bool retval;
  3284. retval = self->obj->loadImage();
  3285. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  3286. return py_retval;
  3287. }
  3288. PyObject *
  3289. _wrap_PyTiledTileset_margin(PyTiledTileset *self)
  3290. {
  3291. PyObject *py_retval;
  3292. int retval;
  3293. retval = self->obj->margin();
  3294. py_retval = Py_BuildValue((char *) "i", retval);
  3295. return py_retval;
  3296. }
  3297. PyObject *
  3298. _wrap_PyTiledTileset_name(PyTiledTileset *self)
  3299. {
  3300. PyObject *py_retval;
  3301. QString retval;
  3302. retval = self->obj->name();
  3303. py_retval = Py_BuildValue((char *) "s", retval.toUtf8().data());
  3304. return py_retval;
  3305. }
  3306. PyObject *
  3307. _wrap_PyTiledTileset_rowCount(PyTiledTileset *self)
  3308. {
  3309. PyObject *py_retval;
  3310. int retval;
  3311. retval = self->obj->rowCount();
  3312. py_retval = Py_BuildValue((char *) "i", retval);
  3313. return py_retval;
  3314. }
  3315. PyObject *
  3316. _wrap_PyTiledTileset_setFileName(PyTiledTileset *self, PyObject *args, PyObject *kwargs)
  3317. {
  3318. PyObject *py_retval;
  3319. const char *name;
  3320. Py_ssize_t name_len;
  3321. const char *keywords[] = {"name", NULL};
  3322. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#", (char **) keywords, &name, &name_len)) {
  3323. return NULL;
  3324. }
  3325. self->obj->setFileName(QString::fromUtf8(name));
  3326. Py_INCREF(Py_None);
  3327. py_retval = Py_None;
  3328. return py_retval;
  3329. }
  3330. PyObject *
  3331. _wrap_PyTiledTileset_setGridSize(PyTiledTileset *self, PyObject *args, PyObject *kwargs)
  3332. {
  3333. PyObject *py_retval;
  3334. PyQSize *gridSize;
  3335. const char *keywords[] = {"gridSize", NULL};
  3336. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQSize_Type, &gridSize)) {
  3337. return NULL;
  3338. }
  3339. self->obj->setGridSize(*((PyQSize *) gridSize)->obj);
  3340. Py_INCREF(Py_None);
  3341. py_retval = Py_None;
  3342. return py_retval;
  3343. }
  3344. PyObject *
  3345. _wrap_PyTiledTileset_setImageSource(PyTiledTileset *self, PyObject *args, PyObject *kwargs)
  3346. {
  3347. PyObject *py_retval;
  3348. const char *source;
  3349. Py_ssize_t source_len;
  3350. const char *keywords[] = {"source", NULL};
  3351. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#", (char **) keywords, &source, &source_len)) {
  3352. return NULL;
  3353. }
  3354. self->obj->setImageSource(QString::fromUtf8(source));
  3355. Py_INCREF(Py_None);
  3356. py_retval = Py_None;
  3357. return py_retval;
  3358. }
  3359. PyObject *
  3360. _wrap_PyTiledTileset_setName(PyTiledTileset *self, PyObject *args, PyObject *kwargs)
  3361. {
  3362. PyObject *py_retval;
  3363. const char *name;
  3364. Py_ssize_t name_len;
  3365. const char *keywords[] = {"name", NULL};
  3366. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#", (char **) keywords, &name, &name_len)) {
  3367. return NULL;
  3368. }
  3369. self->obj->setName(QString::fromUtf8(name));
  3370. Py_INCREF(Py_None);
  3371. py_retval = Py_None;
  3372. return py_retval;
  3373. }
  3374. PyObject *
  3375. _wrap_PyTiledTileset_setTileOffset(PyTiledTileset *self, PyObject *args, PyObject *kwargs)
  3376. {
  3377. PyObject *py_retval;
  3378. PyQPoint *offset;
  3379. const char *keywords[] = {"offset", NULL};
  3380. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQPoint_Type, &offset)) {
  3381. return NULL;
  3382. }
  3383. self->obj->setTileOffset(*((PyQPoint *) offset)->obj);
  3384. Py_INCREF(Py_None);
  3385. py_retval = Py_None;
  3386. return py_retval;
  3387. }
  3388. PyObject *
  3389. _wrap_PyTiledTileset_setTransparentColor(PyTiledTileset *self, PyObject *args, PyObject *kwargs)
  3390. {
  3391. PyObject *py_retval;
  3392. PyQColor *col;
  3393. const char *keywords[] = {"col", NULL};
  3394. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQColor_Type, &col)) {
  3395. return NULL;
  3396. }
  3397. self->obj->setTransparentColor(*((PyQColor *) col)->obj);
  3398. Py_INCREF(Py_None);
  3399. py_retval = Py_None;
  3400. return py_retval;
  3401. }
  3402. PyObject *
  3403. _wrap_PyTiledTileset_sharedPointer(PyTiledTileset *self)
  3404. {
  3405. PyObject *py_retval;
  3406. PyTiledSharedTileset *py_SharedTileset;
  3407. Tiled::SharedTileset retval = self->obj->sharedPointer();
  3408. py_SharedTileset = PyObject_New(PyTiledSharedTileset, &PyTiledSharedTileset_Type);
  3409. py_SharedTileset->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  3410. py_SharedTileset->obj = new Tiled::SharedTileset(retval);
  3411. py_retval = Py_BuildValue((char *) "N", py_SharedTileset);
  3412. return py_retval;
  3413. }
  3414. PyObject *
  3415. _wrap_PyTiledTileset_tileAt(PyTiledTileset *self, PyObject *args, PyObject *kwargs)
  3416. {
  3417. PyObject *py_retval;
  3418. Tiled::Tile *retval;
  3419. int id;
  3420. const char *keywords[] = {"id", NULL};
  3421. PyTiledTile *py_Tile;
  3422. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &id)) {
  3423. return NULL;
  3424. }
  3425. retval = self->obj->tileAt(id);
  3426. if (!(retval)) {
  3427. Py_INCREF(Py_None);
  3428. return Py_None;
  3429. }
  3430. py_Tile = PyObject_New(PyTiledTile, &PyTiledTile_Type);
  3431. py_Tile->obj = retval;
  3432. py_Tile->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  3433. py_retval = Py_BuildValue((char *) "N", py_Tile);
  3434. return py_retval;
  3435. }
  3436. PyObject *
  3437. _wrap_PyTiledTileset_tileCount(PyTiledTileset *self)
  3438. {
  3439. PyObject *py_retval;
  3440. int retval;
  3441. retval = self->obj->tileCount();
  3442. py_retval = Py_BuildValue((char *) "i", retval);
  3443. return py_retval;
  3444. }
  3445. PyObject *
  3446. _wrap_PyTiledTileset_tileHeight(PyTiledTileset *self)
  3447. {
  3448. PyObject *py_retval;
  3449. int retval;
  3450. retval = self->obj->tileHeight();
  3451. py_retval = Py_BuildValue((char *) "i", retval);
  3452. return py_retval;
  3453. }
  3454. PyObject *
  3455. _wrap_PyTiledTileset_tileOffset(PyTiledTileset *self)
  3456. {
  3457. PyObject *py_retval;
  3458. PyQPoint *py_QPoint;
  3459. QPoint retval = self->obj->tileOffset();
  3460. py_QPoint = PyObject_New(PyQPoint, &PyQPoint_Type);
  3461. py_QPoint->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  3462. py_QPoint->obj = new QPoint(retval);
  3463. py_retval = Py_BuildValue((char *) "N", py_QPoint);
  3464. return py_retval;
  3465. }
  3466. PyObject *
  3467. _wrap_PyTiledTileset_tileSpacing(PyTiledTileset *self)
  3468. {
  3469. PyObject *py_retval;
  3470. int retval;
  3471. retval = self->obj->tileSpacing();
  3472. py_retval = Py_BuildValue((char *) "i", retval);
  3473. return py_retval;
  3474. }
  3475. PyObject *
  3476. _wrap_PyTiledTileset_tileWidth(PyTiledTileset *self)
  3477. {
  3478. PyObject *py_retval;
  3479. int retval;
  3480. retval = self->obj->tileWidth();
  3481. py_retval = Py_BuildValue((char *) "i", retval);
  3482. return py_retval;
  3483. }
  3484. PyObject *
  3485. _wrap_PyTiledTileset_transparentColor(PyTiledTileset *self)
  3486. {
  3487. PyObject *py_retval;
  3488. PyQColor *py_QColor;
  3489. QColor retval = self->obj->transparentColor();
  3490. py_QColor = PyObject_New(PyQColor, &PyQColor_Type);
  3491. py_QColor->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  3492. py_QColor->obj = new QColor(retval);
  3493. py_retval = Py_BuildValue((char *) "N", py_QColor);
  3494. return py_retval;
  3495. }
  3496. static PyMethodDef PyTiledTileset_methods[] = {
  3497. {(char *) "columnCount", (PyCFunction) _wrap_PyTiledTileset_columnCount, METH_NOARGS, "columnCount()\n\n" },
  3498. {(char *) "create", (PyCFunction) _wrap_PyTiledTileset_create, METH_KEYWORDS|METH_VARARGS|METH_STATIC, "create(name, tileWidth, tileHeight, tileSpacing, margin)\n\ntype: name: QString\ntype: tileWidth: int\ntype: tileHeight: int\ntype: tileSpacing: int\ntype: margin: int" },
  3499. {(char *) "fileName", (PyCFunction) _wrap_PyTiledTileset_fileName, METH_NOARGS, "fileName()\n\n" },
  3500. {(char *) "findTile", (PyCFunction) _wrap_PyTiledTileset_findTile, METH_KEYWORDS|METH_VARARGS, "findTile(id)\n\ntype: id: int" },
  3501. {(char *) "gridSize", (PyCFunction) _wrap_PyTiledTileset_gridSize, METH_NOARGS, "gridSize()\n\n" },
  3502. {(char *) "imageHeight", (PyCFunction) _wrap_PyTiledTileset_imageHeight, METH_NOARGS, "imageHeight()\n\n" },
  3503. {(char *) "imageSourceString", (PyCFunction) _wrap_PyTiledTileset_imageSourceString, METH_NOARGS, "imageSourceString()\n\n" },
  3504. {(char *) "imageWidth", (PyCFunction) _wrap_PyTiledTileset_imageWidth, METH_NOARGS, "imageWidth()\n\n" },
  3505. {(char *) "isCollection", (PyCFunction) _wrap_PyTiledTileset_isCollection, METH_NOARGS, "isCollection()\n\n" },
  3506. {(char *) "isExternal", (PyCFunction) _wrap_PyTiledTileset_isExternal, METH_NOARGS, "isExternal()\n\n" },
  3507. {(char *) "loadFromImage", (PyCFunction) _wrap_PyTiledTileset_loadFromImage, METH_KEYWORDS|METH_VARARGS, "loadFromImage(img, file)\n\ntype: img: QImage const &\ntype: file: QString" },
  3508. {(char *) "loadImage", (PyCFunction) _wrap_PyTiledTileset_loadImage, METH_NOARGS, "loadImage()\n\n" },
  3509. {(char *) "margin", (PyCFunction) _wrap_PyTiledTileset_margin, METH_NOARGS, "margin()\n\n" },
  3510. {(char *) "name", (PyCFunction) _wrap_PyTiledTileset_name, METH_NOARGS, "name()\n\n" },
  3511. {(char *) "rowCount", (PyCFunction) _wrap_PyTiledTileset_rowCount, METH_NOARGS, "rowCount()\n\n" },
  3512. {(char *) "setFileName", (PyCFunction) _wrap_PyTiledTileset_setFileName, METH_KEYWORDS|METH_VARARGS, "setFileName(name)\n\ntype: name: QString" },
  3513. {(char *) "setGridSize", (PyCFunction) _wrap_PyTiledTileset_setGridSize, METH_KEYWORDS|METH_VARARGS, "setGridSize(gridSize)\n\ntype: gridSize: QSize" },
  3514. {(char *) "setImageSource", (PyCFunction) _wrap_PyTiledTileset_setImageSource, METH_KEYWORDS|METH_VARARGS, "setImageSource(source)\n\ntype: source: QString" },
  3515. {(char *) "setName", (PyCFunction) _wrap_PyTiledTileset_setName, METH_KEYWORDS|METH_VARARGS, "setName(name)\n\ntype: name: QString" },
  3516. {(char *) "setTileOffset", (PyCFunction) _wrap_PyTiledTileset_setTileOffset, METH_KEYWORDS|METH_VARARGS, "setTileOffset(offset)\n\ntype: offset: QPoint" },
  3517. {(char *) "setTransparentColor", (PyCFunction) _wrap_PyTiledTileset_setTransparentColor, METH_KEYWORDS|METH_VARARGS, "setTransparentColor(col)\n\ntype: col: QColor" },
  3518. {(char *) "sharedPointer", (PyCFunction) _wrap_PyTiledTileset_sharedPointer, METH_NOARGS, "sharedPointer()\n\n" },
  3519. {(char *) "tileAt", (PyCFunction) _wrap_PyTiledTileset_tileAt, METH_KEYWORDS|METH_VARARGS, "tileAt(id)\n\ntype: id: int" },
  3520. {(char *) "tileCount", (PyCFunction) _wrap_PyTiledTileset_tileCount, METH_NOARGS, "tileCount()\n\n" },
  3521. {(char *) "tileHeight", (PyCFunction) _wrap_PyTiledTileset_tileHeight, METH_NOARGS, "tileHeight()\n\n" },
  3522. {(char *) "tileOffset", (PyCFunction) _wrap_PyTiledTileset_tileOffset, METH_NOARGS, "tileOffset()\n\n" },
  3523. {(char *) "tileSpacing", (PyCFunction) _wrap_PyTiledTileset_tileSpacing, METH_NOARGS, "tileSpacing()\n\n" },
  3524. {(char *) "tileWidth", (PyCFunction) _wrap_PyTiledTileset_tileWidth, METH_NOARGS, "tileWidth()\n\n" },
  3525. {(char *) "transparentColor", (PyCFunction) _wrap_PyTiledTileset_transparentColor, METH_NOARGS, "transparentColor()\n\n" },
  3526. {NULL, NULL, 0, NULL}
  3527. };
  3528. static void
  3529. _wrap_PyTiledTileset__tp_dealloc(PyTiledTileset *self)
  3530. {
  3531. Tiled::Tileset *tmp = self->obj;
  3532. self->obj = NULL;
  3533. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  3534. delete tmp;
  3535. }
  3536. Py_TYPE(self)->tp_free((PyObject*)self);
  3537. }
  3538. PyTypeObject PyTiledTileset_Type = {
  3539. PyVarObject_HEAD_INIT(NULL, 0)
  3540. (char *) "tiled.Tiled.Tileset", /* tp_name */
  3541. sizeof(PyTiledTileset), /* tp_basicsize */
  3542. 0, /* tp_itemsize */
  3543. /* methods */
  3544. (destructor)_wrap_PyTiledTileset__tp_dealloc, /* tp_dealloc */
  3545. (printfunc)0, /* tp_print */
  3546. (getattrfunc)NULL, /* tp_getattr */
  3547. (setattrfunc)NULL, /* tp_setattr */
  3548. #if PY_MAJOR_VERSION >= 3
  3549. NULL,
  3550. #else
  3551. (cmpfunc)NULL, /* tp_compare */
  3552. #endif
  3553. (reprfunc)NULL, /* tp_repr */
  3554. (PyNumberMethods*)NULL, /* tp_as_number */
  3555. (PySequenceMethods*)NULL, /* tp_as_sequence */
  3556. (PyMappingMethods*)NULL, /* tp_as_mapping */
  3557. (hashfunc)NULL, /* tp_hash */
  3558. (ternaryfunc)NULL, /* tp_call */
  3559. (reprfunc)NULL, /* tp_str */
  3560. (getattrofunc)NULL, /* tp_getattro */
  3561. (setattrofunc)NULL, /* tp_setattro */
  3562. (PyBufferProcs*)NULL, /* tp_as_buffer */
  3563. Py_TPFLAGS_DEFAULT, /* tp_flags */
  3564. "", /* Documentation string */
  3565. (traverseproc)NULL, /* tp_traverse */
  3566. (inquiry)NULL, /* tp_clear */
  3567. (richcmpfunc)NULL, /* tp_richcompare */
  3568. 0, /* tp_weaklistoffset */
  3569. (getiterfunc)NULL, /* tp_iter */
  3570. (iternextfunc)NULL, /* tp_iternext */
  3571. (struct PyMethodDef*)PyTiledTileset_methods, /* tp_methods */
  3572. (struct PyMemberDef*)0, /* tp_members */
  3573. 0, /* tp_getset */
  3574. NULL, /* tp_base */
  3575. NULL, /* tp_dict */
  3576. (descrgetfunc)NULL, /* tp_descr_get */
  3577. (descrsetfunc)NULL, /* tp_descr_set */
  3578. 0, /* tp_dictoffset */
  3579. (initproc)_wrap_PyTiledTileset__tp_init, /* tp_init */
  3580. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  3581. (newfunc)PyType_GenericNew, /* tp_new */
  3582. (freefunc)0, /* tp_free */
  3583. (inquiry)NULL, /* tp_is_gc */
  3584. NULL, /* tp_bases */
  3585. NULL, /* tp_mro */
  3586. NULL, /* tp_cache */
  3587. NULL, /* tp_subclasses */
  3588. NULL, /* tp_weaklist */
  3589. (destructor) NULL /* tp_del */
  3590. };
  3591. static int
  3592. _wrap_PyTiledSharedTileset__tp_init(PyTiledSharedTileset *self, PyObject *args, PyObject *kwargs)
  3593. {
  3594. PyTiledSharedTileset *ctor_arg;
  3595. const char *keywords[] = {"ctor_arg", NULL};
  3596. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledSharedTileset_Type, &ctor_arg)) {
  3597. return -1;
  3598. }
  3599. self->obj = new Tiled::SharedTileset(*((PyTiledSharedTileset *) ctor_arg)->obj);
  3600. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  3601. return 0;
  3602. }
  3603. PyObject *
  3604. _wrap_PyTiledSharedTileset_data(PyTiledSharedTileset *self)
  3605. {
  3606. PyObject *py_retval;
  3607. Tiled::Tileset *retval;
  3608. PyTiledTileset *py_Tileset;
  3609. retval = self->obj->data();
  3610. if (!(retval)) {
  3611. Py_INCREF(Py_None);
  3612. return Py_None;
  3613. }
  3614. py_Tileset = PyObject_New(PyTiledTileset, &PyTiledTileset_Type);
  3615. py_Tileset->obj = retval;
  3616. py_Tileset->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  3617. py_retval = Py_BuildValue((char *) "N", py_Tileset);
  3618. return py_retval;
  3619. }
  3620. static PyObject*
  3621. _wrap_PyTiledSharedTileset__copy__(PyTiledSharedTileset *self)
  3622. {
  3623. PyTiledSharedTileset *py_copy;
  3624. py_copy = PyObject_New(PyTiledSharedTileset, &PyTiledSharedTileset_Type);
  3625. py_copy->obj = new Tiled::SharedTileset(*self->obj);
  3626. py_copy->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  3627. return (PyObject*) py_copy;
  3628. }
  3629. static PyMethodDef PyTiledSharedTileset_methods[] = {
  3630. {(char *) "data", (PyCFunction) _wrap_PyTiledSharedTileset_data, METH_NOARGS, "data()\n\n" },
  3631. {(char *) "__copy__", (PyCFunction) _wrap_PyTiledSharedTileset__copy__, METH_NOARGS, NULL},
  3632. {NULL, NULL, 0, NULL}
  3633. };
  3634. static void
  3635. _wrap_PyTiledSharedTileset__tp_dealloc(PyTiledSharedTileset *self)
  3636. {
  3637. Tiled::SharedTileset *tmp = self->obj;
  3638. self->obj = NULL;
  3639. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  3640. delete tmp;
  3641. }
  3642. Py_TYPE(self)->tp_free((PyObject*)self);
  3643. }
  3644. PyTypeObject PyTiledSharedTileset_Type = {
  3645. PyVarObject_HEAD_INIT(NULL, 0)
  3646. (char *) "tiled.Tiled.SharedTileset", /* tp_name */
  3647. sizeof(PyTiledSharedTileset), /* tp_basicsize */
  3648. 0, /* tp_itemsize */
  3649. /* methods */
  3650. (destructor)_wrap_PyTiledSharedTileset__tp_dealloc, /* tp_dealloc */
  3651. (printfunc)0, /* tp_print */
  3652. (getattrfunc)NULL, /* tp_getattr */
  3653. (setattrfunc)NULL, /* tp_setattr */
  3654. #if PY_MAJOR_VERSION >= 3
  3655. NULL,
  3656. #else
  3657. (cmpfunc)NULL, /* tp_compare */
  3658. #endif
  3659. (reprfunc)NULL, /* tp_repr */
  3660. (PyNumberMethods*)NULL, /* tp_as_number */
  3661. (PySequenceMethods*)NULL, /* tp_as_sequence */
  3662. (PyMappingMethods*)NULL, /* tp_as_mapping */
  3663. (hashfunc)NULL, /* tp_hash */
  3664. (ternaryfunc)NULL, /* tp_call */
  3665. (reprfunc)NULL, /* tp_str */
  3666. (getattrofunc)NULL, /* tp_getattro */
  3667. (setattrofunc)NULL, /* tp_setattro */
  3668. (PyBufferProcs*)NULL, /* tp_as_buffer */
  3669. Py_TPFLAGS_DEFAULT, /* tp_flags */
  3670. "SharedTileset(ctor_arg)", /* Documentation string */
  3671. (traverseproc)NULL, /* tp_traverse */
  3672. (inquiry)NULL, /* tp_clear */
  3673. (richcmpfunc)NULL, /* tp_richcompare */
  3674. 0, /* tp_weaklistoffset */
  3675. (getiterfunc)NULL, /* tp_iter */
  3676. (iternextfunc)NULL, /* tp_iternext */
  3677. (struct PyMethodDef*)PyTiledSharedTileset_methods, /* tp_methods */
  3678. (struct PyMemberDef*)0, /* tp_members */
  3679. 0, /* tp_getset */
  3680. NULL, /* tp_base */
  3681. NULL, /* tp_dict */
  3682. (descrgetfunc)NULL, /* tp_descr_get */
  3683. (descrsetfunc)NULL, /* tp_descr_set */
  3684. 0, /* tp_dictoffset */
  3685. (initproc)_wrap_PyTiledSharedTileset__tp_init, /* tp_init */
  3686. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  3687. (newfunc)PyType_GenericNew, /* tp_new */
  3688. (freefunc)0, /* tp_free */
  3689. (inquiry)NULL, /* tp_is_gc */
  3690. NULL, /* tp_bases */
  3691. NULL, /* tp_mro */
  3692. NULL, /* tp_cache */
  3693. NULL, /* tp_subclasses */
  3694. NULL, /* tp_weaklist */
  3695. (destructor) NULL /* tp_del */
  3696. };
  3697. static int
  3698. _wrap_PyTiledLayer__tp_init(void)
  3699. {
  3700. PyErr_SetString(PyExc_TypeError, "class 'Layer' cannot be constructed ()");
  3701. return -1;
  3702. }
  3703. PyObject *
  3704. _wrap_PyTiledLayer_asGroupLayer(PyTiledLayer *self)
  3705. {
  3706. PyObject *py_retval;
  3707. Tiled::GroupLayer *retval;
  3708. PyTiledGroupLayer *py_GroupLayer;
  3709. retval = self->obj->asGroupLayer();
  3710. if (!(retval)) {
  3711. Py_INCREF(Py_None);
  3712. return Py_None;
  3713. }
  3714. py_GroupLayer = PyObject_New(PyTiledGroupLayer, &PyTiledGroupLayer_Type);
  3715. py_GroupLayer->obj = retval;
  3716. py_GroupLayer->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  3717. py_retval = Py_BuildValue((char *) "N", py_GroupLayer);
  3718. return py_retval;
  3719. }
  3720. PyObject *
  3721. _wrap_PyTiledLayer_asImageLayer(PyTiledLayer *self)
  3722. {
  3723. PyObject *py_retval;
  3724. Tiled::ImageLayer *retval;
  3725. PyTiledImageLayer *py_ImageLayer;
  3726. retval = self->obj->asImageLayer();
  3727. if (!(retval)) {
  3728. Py_INCREF(Py_None);
  3729. return Py_None;
  3730. }
  3731. py_ImageLayer = PyObject_New(PyTiledImageLayer, &PyTiledImageLayer_Type);
  3732. py_ImageLayer->obj = retval;
  3733. py_ImageLayer->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  3734. py_retval = Py_BuildValue((char *) "N", py_ImageLayer);
  3735. return py_retval;
  3736. }
  3737. PyObject *
  3738. _wrap_PyTiledLayer_asObjectGroup(PyTiledLayer *self)
  3739. {
  3740. PyObject *py_retval;
  3741. Tiled::ObjectGroup *retval;
  3742. PyTiledObjectGroup *py_ObjectGroup;
  3743. retval = self->obj->asObjectGroup();
  3744. if (!(retval)) {
  3745. Py_INCREF(Py_None);
  3746. return Py_None;
  3747. }
  3748. py_ObjectGroup = PyObject_New(PyTiledObjectGroup, &PyTiledObjectGroup_Type);
  3749. py_ObjectGroup->obj = retval;
  3750. py_ObjectGroup->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  3751. py_retval = Py_BuildValue((char *) "N", py_ObjectGroup);
  3752. return py_retval;
  3753. }
  3754. PyObject *
  3755. _wrap_PyTiledLayer_asTileLayer(PyTiledLayer *self)
  3756. {
  3757. PyObject *py_retval;
  3758. Tiled::TileLayer *retval;
  3759. PyTiledTileLayer *py_TileLayer;
  3760. retval = self->obj->asTileLayer();
  3761. if (!(retval)) {
  3762. Py_INCREF(Py_None);
  3763. return Py_None;
  3764. }
  3765. py_TileLayer = PyObject_New(PyTiledTileLayer, &PyTiledTileLayer_Type);
  3766. py_TileLayer->obj = retval;
  3767. py_TileLayer->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  3768. py_retval = Py_BuildValue((char *) "N", py_TileLayer);
  3769. return py_retval;
  3770. }
  3771. PyObject *
  3772. _wrap_PyTiledLayer_isGroupLayer(PyTiledLayer *self)
  3773. {
  3774. PyObject *py_retval;
  3775. bool retval;
  3776. retval = self->obj->isGroupLayer();
  3777. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  3778. return py_retval;
  3779. }
  3780. PyObject *
  3781. _wrap_PyTiledLayer_isHidden(PyTiledLayer *self)
  3782. {
  3783. PyObject *py_retval;
  3784. bool retval;
  3785. retval = self->obj->isHidden();
  3786. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  3787. return py_retval;
  3788. }
  3789. PyObject *
  3790. _wrap_PyTiledLayer_isImageLayer(PyTiledLayer *self)
  3791. {
  3792. PyObject *py_retval;
  3793. bool retval;
  3794. retval = self->obj->isImageLayer();
  3795. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  3796. return py_retval;
  3797. }
  3798. PyObject *
  3799. _wrap_PyTiledLayer_isLocked(PyTiledLayer *self)
  3800. {
  3801. PyObject *py_retval;
  3802. bool retval;
  3803. retval = self->obj->isLocked();
  3804. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  3805. return py_retval;
  3806. }
  3807. PyObject *
  3808. _wrap_PyTiledLayer_isObjectGroup(PyTiledLayer *self)
  3809. {
  3810. PyObject *py_retval;
  3811. bool retval;
  3812. retval = self->obj->isObjectGroup();
  3813. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  3814. return py_retval;
  3815. }
  3816. PyObject *
  3817. _wrap_PyTiledLayer_isTileLayer(PyTiledLayer *self)
  3818. {
  3819. PyObject *py_retval;
  3820. bool retval;
  3821. retval = self->obj->isTileLayer();
  3822. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  3823. return py_retval;
  3824. }
  3825. PyObject *
  3826. _wrap_PyTiledLayer_isUnlocked(PyTiledLayer *self)
  3827. {
  3828. PyObject *py_retval;
  3829. bool retval;
  3830. retval = self->obj->isUnlocked();
  3831. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  3832. return py_retval;
  3833. }
  3834. PyObject *
  3835. _wrap_PyTiledLayer_isVisible(PyTiledLayer *self)
  3836. {
  3837. PyObject *py_retval;
  3838. bool retval;
  3839. retval = self->obj->isVisible();
  3840. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  3841. return py_retval;
  3842. }
  3843. PyObject *
  3844. _wrap_PyTiledLayer_map(PyTiledLayer *self)
  3845. {
  3846. PyObject *py_retval;
  3847. Tiled::Map *retval;
  3848. PyTiledMap *py_Map;
  3849. retval = self->obj->map();
  3850. if (!(retval)) {
  3851. Py_INCREF(Py_None);
  3852. return Py_None;
  3853. }
  3854. py_Map = PyObject_New(PyTiledMap, &PyTiledMap_Type);
  3855. py_Map->obj = retval;
  3856. py_Map->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  3857. py_retval = Py_BuildValue((char *) "N", py_Map);
  3858. return py_retval;
  3859. }
  3860. PyObject *
  3861. _wrap_PyTiledLayer_name(PyTiledLayer *self)
  3862. {
  3863. PyObject *py_retval;
  3864. QString retval;
  3865. retval = self->obj->name();
  3866. py_retval = Py_BuildValue((char *) "s", retval.toUtf8().data());
  3867. return py_retval;
  3868. }
  3869. PyObject *
  3870. _wrap_PyTiledLayer_opacity(PyTiledLayer *self)
  3871. {
  3872. PyObject *py_retval;
  3873. double retval;
  3874. retval = self->obj->opacity();
  3875. py_retval = Py_BuildValue((char *) "d", retval);
  3876. return py_retval;
  3877. }
  3878. PyObject *
  3879. _wrap_PyTiledLayer_setLocked(PyTiledLayer *self, PyObject *args, PyObject *kwargs)
  3880. {
  3881. PyObject *py_retval;
  3882. bool locked;
  3883. PyObject *py_locked;
  3884. const char *keywords[] = {"locked", NULL};
  3885. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O", (char **) keywords, &py_locked)) {
  3886. return NULL;
  3887. }
  3888. locked = (bool) PyObject_IsTrue(py_locked);
  3889. self->obj->setLocked(locked);
  3890. Py_INCREF(Py_None);
  3891. py_retval = Py_None;
  3892. return py_retval;
  3893. }
  3894. PyObject *
  3895. _wrap_PyTiledLayer_setName(PyTiledLayer *self, PyObject *args, PyObject *kwargs)
  3896. {
  3897. PyObject *py_retval;
  3898. const char *name;
  3899. Py_ssize_t name_len;
  3900. const char *keywords[] = {"name", NULL};
  3901. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#", (char **) keywords, &name, &name_len)) {
  3902. return NULL;
  3903. }
  3904. self->obj->setName(QString::fromUtf8(name));
  3905. Py_INCREF(Py_None);
  3906. py_retval = Py_None;
  3907. return py_retval;
  3908. }
  3909. PyObject *
  3910. _wrap_PyTiledLayer_setOpacity(PyTiledLayer *self, PyObject *args, PyObject *kwargs)
  3911. {
  3912. PyObject *py_retval;
  3913. double opacity;
  3914. const char *keywords[] = {"opacity", NULL};
  3915. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "d", (char **) keywords, &opacity)) {
  3916. return NULL;
  3917. }
  3918. self->obj->setOpacity(opacity);
  3919. Py_INCREF(Py_None);
  3920. py_retval = Py_None;
  3921. return py_retval;
  3922. }
  3923. PyObject *
  3924. _wrap_PyTiledLayer_setPosition(PyTiledLayer *self, PyObject *args, PyObject *kwargs)
  3925. {
  3926. PyObject *py_retval;
  3927. int x;
  3928. int y;
  3929. const char *keywords[] = {"x", "y", NULL};
  3930. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "ii", (char **) keywords, &x, &y)) {
  3931. return NULL;
  3932. }
  3933. self->obj->setPosition(x, y);
  3934. Py_INCREF(Py_None);
  3935. py_retval = Py_None;
  3936. return py_retval;
  3937. }
  3938. PyObject *
  3939. _wrap_PyTiledLayer_setVisible(PyTiledLayer *self, PyObject *args, PyObject *kwargs)
  3940. {
  3941. PyObject *py_retval;
  3942. bool visible;
  3943. PyObject *py_visible;
  3944. const char *keywords[] = {"visible", NULL};
  3945. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O", (char **) keywords, &py_visible)) {
  3946. return NULL;
  3947. }
  3948. visible = (bool) PyObject_IsTrue(py_visible);
  3949. self->obj->setVisible(visible);
  3950. Py_INCREF(Py_None);
  3951. py_retval = Py_None;
  3952. return py_retval;
  3953. }
  3954. PyObject *
  3955. _wrap_PyTiledLayer_setX(PyTiledLayer *self, PyObject *args, PyObject *kwargs)
  3956. {
  3957. PyObject *py_retval;
  3958. int x;
  3959. const char *keywords[] = {"x", NULL};
  3960. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &x)) {
  3961. return NULL;
  3962. }
  3963. self->obj->setX(x);
  3964. Py_INCREF(Py_None);
  3965. py_retval = Py_None;
  3966. return py_retval;
  3967. }
  3968. PyObject *
  3969. _wrap_PyTiledLayer_setY(PyTiledLayer *self, PyObject *args, PyObject *kwargs)
  3970. {
  3971. PyObject *py_retval;
  3972. int y;
  3973. const char *keywords[] = {"y", NULL};
  3974. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &y)) {
  3975. return NULL;
  3976. }
  3977. self->obj->setY(y);
  3978. Py_INCREF(Py_None);
  3979. py_retval = Py_None;
  3980. return py_retval;
  3981. }
  3982. PyObject *
  3983. _wrap_PyTiledLayer_x(PyTiledLayer *self)
  3984. {
  3985. PyObject *py_retval;
  3986. int retval;
  3987. retval = self->obj->x();
  3988. py_retval = Py_BuildValue((char *) "i", retval);
  3989. return py_retval;
  3990. }
  3991. PyObject *
  3992. _wrap_PyTiledLayer_y(PyTiledLayer *self)
  3993. {
  3994. PyObject *py_retval;
  3995. int retval;
  3996. retval = self->obj->y();
  3997. py_retval = Py_BuildValue((char *) "i", retval);
  3998. return py_retval;
  3999. }
  4000. static PyMethodDef PyTiledLayer_methods[] = {
  4001. {(char *) "asGroupLayer", (PyCFunction) _wrap_PyTiledLayer_asGroupLayer, METH_NOARGS, "asGroupLayer()\n\n" },
  4002. {(char *) "asImageLayer", (PyCFunction) _wrap_PyTiledLayer_asImageLayer, METH_NOARGS, "asImageLayer()\n\n" },
  4003. {(char *) "asObjectGroup", (PyCFunction) _wrap_PyTiledLayer_asObjectGroup, METH_NOARGS, "asObjectGroup()\n\n" },
  4004. {(char *) "asTileLayer", (PyCFunction) _wrap_PyTiledLayer_asTileLayer, METH_NOARGS, "asTileLayer()\n\n" },
  4005. {(char *) "isGroupLayer", (PyCFunction) _wrap_PyTiledLayer_isGroupLayer, METH_NOARGS, "isGroupLayer()\n\n" },
  4006. {(char *) "isHidden", (PyCFunction) _wrap_PyTiledLayer_isHidden, METH_NOARGS, "isHidden()\n\n" },
  4007. {(char *) "isImageLayer", (PyCFunction) _wrap_PyTiledLayer_isImageLayer, METH_NOARGS, "isImageLayer()\n\n" },
  4008. {(char *) "isLocked", (PyCFunction) _wrap_PyTiledLayer_isLocked, METH_NOARGS, "isLocked()\n\n" },
  4009. {(char *) "isObjectGroup", (PyCFunction) _wrap_PyTiledLayer_isObjectGroup, METH_NOARGS, "isObjectGroup()\n\n" },
  4010. {(char *) "isTileLayer", (PyCFunction) _wrap_PyTiledLayer_isTileLayer, METH_NOARGS, "isTileLayer()\n\n" },
  4011. {(char *) "isUnlocked", (PyCFunction) _wrap_PyTiledLayer_isUnlocked, METH_NOARGS, "isUnlocked()\n\n" },
  4012. {(char *) "isVisible", (PyCFunction) _wrap_PyTiledLayer_isVisible, METH_NOARGS, "isVisible()\n\n" },
  4013. {(char *) "map", (PyCFunction) _wrap_PyTiledLayer_map, METH_NOARGS, "map()\n\n" },
  4014. {(char *) "name", (PyCFunction) _wrap_PyTiledLayer_name, METH_NOARGS, "name()\n\n" },
  4015. {(char *) "opacity", (PyCFunction) _wrap_PyTiledLayer_opacity, METH_NOARGS, "opacity()\n\n" },
  4016. {(char *) "setLocked", (PyCFunction) _wrap_PyTiledLayer_setLocked, METH_KEYWORDS|METH_VARARGS, "setLocked(locked)\n\ntype: locked: bool" },
  4017. {(char *) "setName", (PyCFunction) _wrap_PyTiledLayer_setName, METH_KEYWORDS|METH_VARARGS, "setName(name)\n\ntype: name: QString" },
  4018. {(char *) "setOpacity", (PyCFunction) _wrap_PyTiledLayer_setOpacity, METH_KEYWORDS|METH_VARARGS, "setOpacity(opacity)\n\ntype: opacity: double" },
  4019. {(char *) "setPosition", (PyCFunction) _wrap_PyTiledLayer_setPosition, METH_KEYWORDS|METH_VARARGS, "setPosition(x, y)\n\ntype: x: int\ntype: y: int" },
  4020. {(char *) "setVisible", (PyCFunction) _wrap_PyTiledLayer_setVisible, METH_KEYWORDS|METH_VARARGS, "setVisible(visible)\n\ntype: visible: bool" },
  4021. {(char *) "setX", (PyCFunction) _wrap_PyTiledLayer_setX, METH_KEYWORDS|METH_VARARGS, "setX(x)\n\ntype: x: int" },
  4022. {(char *) "setY", (PyCFunction) _wrap_PyTiledLayer_setY, METH_KEYWORDS|METH_VARARGS, "setY(y)\n\ntype: y: int" },
  4023. {(char *) "x", (PyCFunction) _wrap_PyTiledLayer_x, METH_NOARGS, "x()\n\n" },
  4024. {(char *) "y", (PyCFunction) _wrap_PyTiledLayer_y, METH_NOARGS, "y()\n\n" },
  4025. {NULL, NULL, 0, NULL}
  4026. };
  4027. static void
  4028. _wrap_PyTiledLayer__tp_dealloc(PyTiledLayer *self)
  4029. {
  4030. Tiled::Layer *tmp = self->obj;
  4031. self->obj = NULL;
  4032. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  4033. delete tmp;
  4034. }
  4035. Py_TYPE(self)->tp_free((PyObject*)self);
  4036. }
  4037. PyTypeObject PyTiledLayer_Type = {
  4038. PyVarObject_HEAD_INIT(NULL, 0)
  4039. (char *) "tiled.Tiled.Layer", /* tp_name */
  4040. sizeof(PyTiledLayer), /* tp_basicsize */
  4041. 0, /* tp_itemsize */
  4042. /* methods */
  4043. (destructor)_wrap_PyTiledLayer__tp_dealloc, /* tp_dealloc */
  4044. (printfunc)0, /* tp_print */
  4045. (getattrfunc)NULL, /* tp_getattr */
  4046. (setattrfunc)NULL, /* tp_setattr */
  4047. #if PY_MAJOR_VERSION >= 3
  4048. NULL,
  4049. #else
  4050. (cmpfunc)NULL, /* tp_compare */
  4051. #endif
  4052. (reprfunc)NULL, /* tp_repr */
  4053. (PyNumberMethods*)NULL, /* tp_as_number */
  4054. (PySequenceMethods*)NULL, /* tp_as_sequence */
  4055. (PyMappingMethods*)NULL, /* tp_as_mapping */
  4056. (hashfunc)NULL, /* tp_hash */
  4057. (ternaryfunc)NULL, /* tp_call */
  4058. (reprfunc)NULL, /* tp_str */
  4059. (getattrofunc)NULL, /* tp_getattro */
  4060. (setattrofunc)NULL, /* tp_setattro */
  4061. (PyBufferProcs*)NULL, /* tp_as_buffer */
  4062. Py_TPFLAGS_DEFAULT, /* tp_flags */
  4063. "", /* Documentation string */
  4064. (traverseproc)NULL, /* tp_traverse */
  4065. (inquiry)NULL, /* tp_clear */
  4066. (richcmpfunc)NULL, /* tp_richcompare */
  4067. 0, /* tp_weaklistoffset */
  4068. (getiterfunc)NULL, /* tp_iter */
  4069. (iternextfunc)NULL, /* tp_iternext */
  4070. (struct PyMethodDef*)PyTiledLayer_methods, /* tp_methods */
  4071. (struct PyMemberDef*)0, /* tp_members */
  4072. 0, /* tp_getset */
  4073. NULL, /* tp_base */
  4074. NULL, /* tp_dict */
  4075. (descrgetfunc)NULL, /* tp_descr_get */
  4076. (descrsetfunc)NULL, /* tp_descr_set */
  4077. 0, /* tp_dictoffset */
  4078. (initproc)_wrap_PyTiledLayer__tp_init, /* tp_init */
  4079. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  4080. (newfunc)PyType_GenericNew, /* tp_new */
  4081. (freefunc)0, /* tp_free */
  4082. (inquiry)NULL, /* tp_is_gc */
  4083. NULL, /* tp_bases */
  4084. NULL, /* tp_mro */
  4085. NULL, /* tp_cache */
  4086. NULL, /* tp_subclasses */
  4087. NULL, /* tp_weaklist */
  4088. (destructor) NULL /* tp_del */
  4089. };
  4090. static int
  4091. _wrap_PyTiledMap__tp_init(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  4092. {
  4093. Tiled::Map::Orientation orient;
  4094. int w;
  4095. int h;
  4096. int tileW;
  4097. int tileH;
  4098. const char *keywords[] = {"orient", "w", "h", "tileW", "tileH", NULL};
  4099. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "iiiii", (char **) keywords, &orient, &w, &h, &tileW, &tileH)) {
  4100. return -1;
  4101. }
  4102. self->obj = new Tiled::Map(orient, w, h, tileW, tileH);
  4103. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  4104. return 0;
  4105. }
  4106. PyObject *
  4107. _wrap_PyTiledMap_addLayer__0(PyTiledMap *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  4108. {
  4109. PyObject *py_retval;
  4110. PyTiledTileLayer *l;
  4111. Tiled::TileLayer *l_ptr;
  4112. const char *keywords[] = {"l", NULL};
  4113. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledTileLayer_Type, &l)) {
  4114. {
  4115. PyObject *exc_type, *traceback;
  4116. PyErr_Fetch(&exc_type, return_exception, &traceback);
  4117. Py_XDECREF(exc_type);
  4118. Py_XDECREF(traceback);
  4119. }
  4120. return NULL;
  4121. }
  4122. l_ptr = (l ? l->obj : NULL);
  4123. self->obj->addLayer(l_ptr);
  4124. if (l) {
  4125. l->obj = NULL;
  4126. }
  4127. Py_INCREF(Py_None);
  4128. py_retval = Py_None;
  4129. return py_retval;
  4130. }
  4131. PyObject *
  4132. _wrap_PyTiledMap_addLayer__1(PyTiledMap *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  4133. {
  4134. PyObject *py_retval;
  4135. PyTiledObjectGroup *l;
  4136. Tiled::ObjectGroup *l_ptr;
  4137. const char *keywords[] = {"l", NULL};
  4138. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledObjectGroup_Type, &l)) {
  4139. {
  4140. PyObject *exc_type, *traceback;
  4141. PyErr_Fetch(&exc_type, return_exception, &traceback);
  4142. Py_XDECREF(exc_type);
  4143. Py_XDECREF(traceback);
  4144. }
  4145. return NULL;
  4146. }
  4147. l_ptr = (l ? l->obj : NULL);
  4148. self->obj->addLayer(l_ptr);
  4149. if (l) {
  4150. l->obj = NULL;
  4151. }
  4152. Py_INCREF(Py_None);
  4153. py_retval = Py_None;
  4154. return py_retval;
  4155. }
  4156. PyObject *
  4157. _wrap_PyTiledMap_addLayer__2(PyTiledMap *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  4158. {
  4159. PyObject *py_retval;
  4160. PyTiledImageLayer *l;
  4161. Tiled::ImageLayer *l_ptr;
  4162. const char *keywords[] = {"l", NULL};
  4163. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledImageLayer_Type, &l)) {
  4164. {
  4165. PyObject *exc_type, *traceback;
  4166. PyErr_Fetch(&exc_type, return_exception, &traceback);
  4167. Py_XDECREF(exc_type);
  4168. Py_XDECREF(traceback);
  4169. }
  4170. return NULL;
  4171. }
  4172. l_ptr = (l ? l->obj : NULL);
  4173. self->obj->addLayer(l_ptr);
  4174. if (l) {
  4175. l->obj = NULL;
  4176. }
  4177. Py_INCREF(Py_None);
  4178. py_retval = Py_None;
  4179. return py_retval;
  4180. }
  4181. PyObject *
  4182. _wrap_PyTiledMap_addLayer__3(PyTiledMap *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  4183. {
  4184. PyObject *py_retval;
  4185. PyTiledGroupLayer *l;
  4186. Tiled::GroupLayer *l_ptr;
  4187. const char *keywords[] = {"l", NULL};
  4188. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledGroupLayer_Type, &l)) {
  4189. {
  4190. PyObject *exc_type, *traceback;
  4191. PyErr_Fetch(&exc_type, return_exception, &traceback);
  4192. Py_XDECREF(exc_type);
  4193. Py_XDECREF(traceback);
  4194. }
  4195. return NULL;
  4196. }
  4197. l_ptr = (l ? l->obj : NULL);
  4198. self->obj->addLayer(l_ptr);
  4199. if (l) {
  4200. l->obj = NULL;
  4201. }
  4202. Py_INCREF(Py_None);
  4203. py_retval = Py_None;
  4204. return py_retval;
  4205. }
  4206. PyObject * _wrap_PyTiledMap_addLayer(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  4207. {
  4208. PyObject * retval;
  4209. PyObject *error_list;
  4210. PyObject *exceptions[4] = {0,};
  4211. retval = _wrap_PyTiledMap_addLayer__0(self, args, kwargs, &exceptions[0]);
  4212. if (!exceptions[0]) {
  4213. return retval;
  4214. }
  4215. retval = _wrap_PyTiledMap_addLayer__1(self, args, kwargs, &exceptions[1]);
  4216. if (!exceptions[1]) {
  4217. Py_DECREF(exceptions[0]);
  4218. return retval;
  4219. }
  4220. retval = _wrap_PyTiledMap_addLayer__2(self, args, kwargs, &exceptions[2]);
  4221. if (!exceptions[2]) {
  4222. Py_DECREF(exceptions[0]);
  4223. Py_DECREF(exceptions[1]);
  4224. return retval;
  4225. }
  4226. retval = _wrap_PyTiledMap_addLayer__3(self, args, kwargs, &exceptions[3]);
  4227. if (!exceptions[3]) {
  4228. Py_DECREF(exceptions[0]);
  4229. Py_DECREF(exceptions[1]);
  4230. Py_DECREF(exceptions[2]);
  4231. return retval;
  4232. }
  4233. error_list = PyList_New(4);
  4234. PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
  4235. Py_DECREF(exceptions[0]);
  4236. PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
  4237. Py_DECREF(exceptions[1]);
  4238. PyList_SET_ITEM(error_list, 2, PyObject_Str(exceptions[2]));
  4239. Py_DECREF(exceptions[2]);
  4240. PyList_SET_ITEM(error_list, 3, PyObject_Str(exceptions[3]));
  4241. Py_DECREF(exceptions[3]);
  4242. PyErr_SetObject(PyExc_TypeError, error_list);
  4243. Py_DECREF(error_list);
  4244. return NULL;
  4245. }
  4246. PyObject *
  4247. _wrap_PyTiledMap_addTileset(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  4248. {
  4249. PyObject *py_retval;
  4250. PyTiledSharedTileset *tileset;
  4251. const char *keywords[] = {"tileset", NULL};
  4252. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledSharedTileset_Type, &tileset)) {
  4253. return NULL;
  4254. }
  4255. self->obj->addTileset(*((PyTiledSharedTileset *) tileset)->obj);
  4256. Py_INCREF(Py_None);
  4257. py_retval = Py_None;
  4258. return py_retval;
  4259. }
  4260. PyObject *
  4261. _wrap_PyTiledMap_backgroundColor(PyTiledMap *self)
  4262. {
  4263. PyObject *py_retval;
  4264. PyQColor *py_QColor;
  4265. QColor retval = self->obj->backgroundColor();
  4266. py_QColor = PyObject_New(PyQColor, &PyQColor_Type);
  4267. py_QColor->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  4268. py_QColor->obj = new QColor(retval);
  4269. py_retval = Py_BuildValue((char *) "N", py_QColor);
  4270. return py_retval;
  4271. }
  4272. PyObject *
  4273. _wrap_PyTiledMap_groupLayerCount(PyTiledMap *self)
  4274. {
  4275. PyObject *py_retval;
  4276. int retval;
  4277. retval = self->obj->groupLayerCount();
  4278. py_retval = Py_BuildValue((char *) "i", retval);
  4279. return py_retval;
  4280. }
  4281. PyObject *
  4282. _wrap_PyTiledMap_height(PyTiledMap *self)
  4283. {
  4284. PyObject *py_retval;
  4285. int retval;
  4286. retval = self->obj->height();
  4287. py_retval = Py_BuildValue((char *) "i", retval);
  4288. return py_retval;
  4289. }
  4290. PyObject *
  4291. _wrap_PyTiledMap_hexSideLength(PyTiledMap *self)
  4292. {
  4293. PyObject *py_retval;
  4294. int retval;
  4295. retval = self->obj->hexSideLength();
  4296. py_retval = Py_BuildValue((char *) "i", retval);
  4297. return py_retval;
  4298. }
  4299. PyObject *
  4300. _wrap_PyTiledMap_imageLayerCount(PyTiledMap *self)
  4301. {
  4302. PyObject *py_retval;
  4303. int retval;
  4304. retval = self->obj->imageLayerCount();
  4305. py_retval = Py_BuildValue((char *) "i", retval);
  4306. return py_retval;
  4307. }
  4308. PyObject *
  4309. _wrap_PyTiledMap_indexOfTileset(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  4310. {
  4311. PyObject *py_retval;
  4312. int retval;
  4313. PyTiledSharedTileset *tileset;
  4314. const char *keywords[] = {"tileset", NULL};
  4315. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledSharedTileset_Type, &tileset)) {
  4316. return NULL;
  4317. }
  4318. retval = self->obj->indexOfTileset(*((PyTiledSharedTileset *) tileset)->obj);
  4319. py_retval = Py_BuildValue((char *) "i", retval);
  4320. return py_retval;
  4321. }
  4322. PyObject *
  4323. _wrap_PyTiledMap_infinite(PyTiledMap *self)
  4324. {
  4325. PyObject *py_retval;
  4326. bool retval;
  4327. retval = self->obj->infinite();
  4328. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  4329. return py_retval;
  4330. }
  4331. PyObject *
  4332. _wrap_PyTiledMap_insertTileset(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  4333. {
  4334. PyObject *py_retval;
  4335. int pos;
  4336. PyTiledSharedTileset *tileset;
  4337. const char *keywords[] = {"pos", "tileset", NULL};
  4338. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "iO!", (char **) keywords, &pos, &PyTiledSharedTileset_Type, &tileset)) {
  4339. return NULL;
  4340. }
  4341. self->obj->insertTileset(pos, *((PyTiledSharedTileset *) tileset)->obj);
  4342. Py_INCREF(Py_None);
  4343. py_retval = Py_None;
  4344. return py_retval;
  4345. }
  4346. PyObject *
  4347. _wrap_PyTiledMap_isTilesetUsed(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  4348. {
  4349. PyObject *py_retval;
  4350. bool retval;
  4351. PyTiledTileset *tileset;
  4352. Tiled::Tileset *tileset_ptr;
  4353. const char *keywords[] = {"tileset", NULL};
  4354. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledTileset_Type, &tileset)) {
  4355. return NULL;
  4356. }
  4357. tileset_ptr = (tileset ? tileset->obj : NULL);
  4358. retval = self->obj->isTilesetUsed(tileset_ptr);
  4359. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  4360. return py_retval;
  4361. }
  4362. PyObject *
  4363. _wrap_PyTiledMap_layerAt(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  4364. {
  4365. PyObject *py_retval;
  4366. Tiled::Layer *retval;
  4367. int index;
  4368. const char *keywords[] = {"index", NULL};
  4369. PyTiledLayer *py_Layer;
  4370. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &index)) {
  4371. return NULL;
  4372. }
  4373. retval = self->obj->layerAt(index);
  4374. if (!(retval)) {
  4375. Py_INCREF(Py_None);
  4376. return Py_None;
  4377. }
  4378. py_Layer = PyObject_New(PyTiledLayer, &PyTiledLayer_Type);
  4379. py_Layer->obj = retval;
  4380. py_Layer->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  4381. py_retval = Py_BuildValue((char *) "N", py_Layer);
  4382. return py_retval;
  4383. }
  4384. PyObject *
  4385. _wrap_PyTiledMap_layerCount(PyTiledMap *self)
  4386. {
  4387. PyObject *py_retval;
  4388. int retval;
  4389. retval = self->obj->layerCount();
  4390. py_retval = Py_BuildValue((char *) "i", retval);
  4391. return py_retval;
  4392. }
  4393. PyObject *
  4394. _wrap_PyTiledMap_nextLayerId(PyTiledMap *self)
  4395. {
  4396. PyObject *py_retval;
  4397. int retval;
  4398. retval = self->obj->nextLayerId();
  4399. py_retval = Py_BuildValue((char *) "i", retval);
  4400. return py_retval;
  4401. }
  4402. PyObject *
  4403. _wrap_PyTiledMap_nextObjectId(PyTiledMap *self)
  4404. {
  4405. PyObject *py_retval;
  4406. int retval;
  4407. retval = self->obj->nextObjectId();
  4408. py_retval = Py_BuildValue((char *) "i", retval);
  4409. return py_retval;
  4410. }
  4411. PyObject *
  4412. _wrap_PyTiledMap_objectGroupCount(PyTiledMap *self)
  4413. {
  4414. PyObject *py_retval;
  4415. int retval;
  4416. retval = self->obj->objectGroupCount();
  4417. py_retval = Py_BuildValue((char *) "i", retval);
  4418. return py_retval;
  4419. }
  4420. PyObject *
  4421. _wrap_PyTiledMap_orientation(PyTiledMap *self)
  4422. {
  4423. PyObject *py_retval;
  4424. Tiled::Map::Orientation retval;
  4425. retval = self->obj->orientation();
  4426. py_retval = Py_BuildValue((char *) "i", retval);
  4427. return py_retval;
  4428. }
  4429. PyObject *
  4430. _wrap_PyTiledMap_removeTilesetAt(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  4431. {
  4432. PyObject *py_retval;
  4433. int pos;
  4434. const char *keywords[] = {"pos", NULL};
  4435. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &pos)) {
  4436. return NULL;
  4437. }
  4438. self->obj->removeTilesetAt(pos);
  4439. Py_INCREF(Py_None);
  4440. py_retval = Py_None;
  4441. return py_retval;
  4442. }
  4443. PyObject *
  4444. _wrap_PyTiledMap_renderOrder(PyTiledMap *self)
  4445. {
  4446. PyObject *py_retval;
  4447. Tiled::Map::RenderOrder retval;
  4448. retval = self->obj->renderOrder();
  4449. py_retval = Py_BuildValue((char *) "i", retval);
  4450. return py_retval;
  4451. }
  4452. PyObject *
  4453. _wrap_PyTiledMap_replaceTileset(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  4454. {
  4455. PyObject *py_retval;
  4456. PyTiledSharedTileset *oldTileset;
  4457. PyTiledSharedTileset *newTileset;
  4458. const char *keywords[] = {"oldTileset", "newTileset", NULL};
  4459. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!O!", (char **) keywords, &PyTiledSharedTileset_Type, &oldTileset, &PyTiledSharedTileset_Type, &newTileset)) {
  4460. return NULL;
  4461. }
  4462. self->obj->replaceTileset(*((PyTiledSharedTileset *) oldTileset)->obj, *((PyTiledSharedTileset *) newTileset)->obj);
  4463. Py_INCREF(Py_None);
  4464. py_retval = Py_None;
  4465. return py_retval;
  4466. }
  4467. PyObject *
  4468. _wrap_PyTiledMap_setBackgroundColor(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  4469. {
  4470. PyObject *py_retval;
  4471. PyQColor *col;
  4472. const char *keywords[] = {"col", NULL};
  4473. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQColor_Type, &col)) {
  4474. return NULL;
  4475. }
  4476. self->obj->setBackgroundColor(*((PyQColor *) col)->obj);
  4477. Py_INCREF(Py_None);
  4478. py_retval = Py_None;
  4479. return py_retval;
  4480. }
  4481. PyObject *
  4482. _wrap_PyTiledMap_setHeight(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  4483. {
  4484. PyObject *py_retval;
  4485. int h;
  4486. const char *keywords[] = {"h", NULL};
  4487. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &h)) {
  4488. return NULL;
  4489. }
  4490. self->obj->setHeight(h);
  4491. Py_INCREF(Py_None);
  4492. py_retval = Py_None;
  4493. return py_retval;
  4494. }
  4495. PyObject *
  4496. _wrap_PyTiledMap_setHexSideLength(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  4497. {
  4498. PyObject *py_retval;
  4499. int hexSideLength;
  4500. const char *keywords[] = {"hexSideLength", NULL};
  4501. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &hexSideLength)) {
  4502. return NULL;
  4503. }
  4504. self->obj->setHexSideLength(hexSideLength);
  4505. Py_INCREF(Py_None);
  4506. py_retval = Py_None;
  4507. return py_retval;
  4508. }
  4509. PyObject *
  4510. _wrap_PyTiledMap_setInfinite(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  4511. {
  4512. PyObject *py_retval;
  4513. bool infinite;
  4514. PyObject *py_infinite;
  4515. const char *keywords[] = {"infinite", NULL};
  4516. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O", (char **) keywords, &py_infinite)) {
  4517. return NULL;
  4518. }
  4519. infinite = (bool) PyObject_IsTrue(py_infinite);
  4520. self->obj->setInfinite(infinite);
  4521. Py_INCREF(Py_None);
  4522. py_retval = Py_None;
  4523. return py_retval;
  4524. }
  4525. PyObject *
  4526. _wrap_PyTiledMap_setNextLayerId(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  4527. {
  4528. PyObject *py_retval;
  4529. int nextLayerId;
  4530. const char *keywords[] = {"nextLayerId", NULL};
  4531. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &nextLayerId)) {
  4532. return NULL;
  4533. }
  4534. self->obj->setNextLayerId(nextLayerId);
  4535. Py_INCREF(Py_None);
  4536. py_retval = Py_None;
  4537. return py_retval;
  4538. }
  4539. PyObject *
  4540. _wrap_PyTiledMap_setNextObjectId(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  4541. {
  4542. PyObject *py_retval;
  4543. int nextObjectId;
  4544. const char *keywords[] = {"nextObjectId", NULL};
  4545. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &nextObjectId)) {
  4546. return NULL;
  4547. }
  4548. self->obj->setNextObjectId(nextObjectId);
  4549. Py_INCREF(Py_None);
  4550. py_retval = Py_None;
  4551. return py_retval;
  4552. }
  4553. PyObject *
  4554. _wrap_PyTiledMap_setOrientation(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  4555. {
  4556. PyObject *py_retval;
  4557. Tiled::Map::Orientation orientation;
  4558. const char *keywords[] = {"orientation", NULL};
  4559. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &orientation)) {
  4560. return NULL;
  4561. }
  4562. self->obj->setOrientation(orientation);
  4563. Py_INCREF(Py_None);
  4564. py_retval = Py_None;
  4565. return py_retval;
  4566. }
  4567. PyObject *
  4568. _wrap_PyTiledMap_setRenderOrder(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  4569. {
  4570. PyObject *py_retval;
  4571. Tiled::Map::RenderOrder renderOrder;
  4572. const char *keywords[] = {"renderOrder", NULL};
  4573. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &renderOrder)) {
  4574. return NULL;
  4575. }
  4576. self->obj->setRenderOrder(renderOrder);
  4577. Py_INCREF(Py_None);
  4578. py_retval = Py_None;
  4579. return py_retval;
  4580. }
  4581. PyObject *
  4582. _wrap_PyTiledMap_setStaggerAxis(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  4583. {
  4584. PyObject *py_retval;
  4585. Tiled::Map::StaggerAxis staggerAxis;
  4586. const char *keywords[] = {"staggerAxis", NULL};
  4587. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &staggerAxis)) {
  4588. return NULL;
  4589. }
  4590. self->obj->setStaggerAxis(staggerAxis);
  4591. Py_INCREF(Py_None);
  4592. py_retval = Py_None;
  4593. return py_retval;
  4594. }
  4595. PyObject *
  4596. _wrap_PyTiledMap_setStaggerIndex(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  4597. {
  4598. PyObject *py_retval;
  4599. Tiled::Map::StaggerIndex staggerIndex;
  4600. const char *keywords[] = {"staggerIndex", NULL};
  4601. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &staggerIndex)) {
  4602. return NULL;
  4603. }
  4604. self->obj->setStaggerIndex(staggerIndex);
  4605. Py_INCREF(Py_None);
  4606. py_retval = Py_None;
  4607. return py_retval;
  4608. }
  4609. PyObject *
  4610. _wrap_PyTiledMap_setWidth(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  4611. {
  4612. PyObject *py_retval;
  4613. int w;
  4614. const char *keywords[] = {"w", NULL};
  4615. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &w)) {
  4616. return NULL;
  4617. }
  4618. self->obj->setWidth(w);
  4619. Py_INCREF(Py_None);
  4620. py_retval = Py_None;
  4621. return py_retval;
  4622. }
  4623. PyObject *
  4624. _wrap_PyTiledMap_staggerAxis(PyTiledMap *self)
  4625. {
  4626. PyObject *py_retval;
  4627. Tiled::Map::StaggerAxis retval;
  4628. retval = self->obj->staggerAxis();
  4629. py_retval = Py_BuildValue((char *) "i", retval);
  4630. return py_retval;
  4631. }
  4632. PyObject *
  4633. _wrap_PyTiledMap_staggerIndex(PyTiledMap *self)
  4634. {
  4635. PyObject *py_retval;
  4636. Tiled::Map::StaggerIndex retval;
  4637. retval = self->obj->staggerIndex();
  4638. py_retval = Py_BuildValue((char *) "i", retval);
  4639. return py_retval;
  4640. }
  4641. PyObject *
  4642. _wrap_PyTiledMap_tileHeight(PyTiledMap *self)
  4643. {
  4644. PyObject *py_retval;
  4645. int retval;
  4646. retval = self->obj->tileHeight();
  4647. py_retval = Py_BuildValue((char *) "i", retval);
  4648. return py_retval;
  4649. }
  4650. PyObject *
  4651. _wrap_PyTiledMap_tileLayerCount(PyTiledMap *self)
  4652. {
  4653. PyObject *py_retval;
  4654. int retval;
  4655. retval = self->obj->tileLayerCount();
  4656. py_retval = Py_BuildValue((char *) "i", retval);
  4657. return py_retval;
  4658. }
  4659. PyObject *
  4660. _wrap_PyTiledMap_tileSize(PyTiledMap *self)
  4661. {
  4662. PyObject *py_retval;
  4663. PyQSize *py_QSize;
  4664. QSize retval = self->obj->tileSize();
  4665. py_QSize = PyObject_New(PyQSize, &PyQSize_Type);
  4666. py_QSize->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  4667. py_QSize->obj = new QSize(retval);
  4668. py_retval = Py_BuildValue((char *) "N", py_QSize);
  4669. return py_retval;
  4670. }
  4671. PyObject *
  4672. _wrap_PyTiledMap_tileWidth(PyTiledMap *self)
  4673. {
  4674. PyObject *py_retval;
  4675. int retval;
  4676. retval = self->obj->tileWidth();
  4677. py_retval = Py_BuildValue((char *) "i", retval);
  4678. return py_retval;
  4679. }
  4680. PyObject *
  4681. _wrap_PyTiledMap_tilesetAt(PyTiledMap *self, PyObject *args, PyObject *kwargs)
  4682. {
  4683. PyObject *py_retval;
  4684. int index;
  4685. const char *keywords[] = {"index", NULL};
  4686. PyTiledSharedTileset *py_SharedTileset;
  4687. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &index)) {
  4688. return NULL;
  4689. }
  4690. Tiled::SharedTileset retval = self->obj->tilesetAt(index);
  4691. py_SharedTileset = PyObject_New(PyTiledSharedTileset, &PyTiledSharedTileset_Type);
  4692. py_SharedTileset->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  4693. py_SharedTileset->obj = new Tiled::SharedTileset(retval);
  4694. py_retval = Py_BuildValue((char *) "N", py_SharedTileset);
  4695. return py_retval;
  4696. }
  4697. PyObject *
  4698. _wrap_PyTiledMap_tilesetCount(PyTiledMap *self)
  4699. {
  4700. PyObject *py_retval;
  4701. int retval;
  4702. retval = self->obj->tilesetCount();
  4703. py_retval = Py_BuildValue((char *) "i", retval);
  4704. return py_retval;
  4705. }
  4706. PyObject *
  4707. _wrap_PyTiledMap_width(PyTiledMap *self)
  4708. {
  4709. PyObject *py_retval;
  4710. int retval;
  4711. retval = self->obj->width();
  4712. py_retval = Py_BuildValue((char *) "i", retval);
  4713. return py_retval;
  4714. }
  4715. static PyMethodDef PyTiledMap_methods[] = {
  4716. {(char *) "addLayer", (PyCFunction) _wrap_PyTiledMap_addLayer, METH_KEYWORDS|METH_VARARGS, NULL },
  4717. {(char *) "addTileset", (PyCFunction) _wrap_PyTiledMap_addTileset, METH_KEYWORDS|METH_VARARGS, "addTileset(tileset)\n\ntype: tileset: SharedTileset" },
  4718. {(char *) "backgroundColor", (PyCFunction) _wrap_PyTiledMap_backgroundColor, METH_NOARGS, "backgroundColor()\n\n" },
  4719. {(char *) "groupLayerCount", (PyCFunction) _wrap_PyTiledMap_groupLayerCount, METH_NOARGS, "groupLayerCount()\n\n" },
  4720. {(char *) "height", (PyCFunction) _wrap_PyTiledMap_height, METH_NOARGS, "height()\n\n" },
  4721. {(char *) "hexSideLength", (PyCFunction) _wrap_PyTiledMap_hexSideLength, METH_NOARGS, "hexSideLength()\n\n" },
  4722. {(char *) "imageLayerCount", (PyCFunction) _wrap_PyTiledMap_imageLayerCount, METH_NOARGS, "imageLayerCount()\n\n" },
  4723. {(char *) "indexOfTileset", (PyCFunction) _wrap_PyTiledMap_indexOfTileset, METH_KEYWORDS|METH_VARARGS, "indexOfTileset(tileset)\n\ntype: tileset: SharedTileset const &" },
  4724. {(char *) "infinite", (PyCFunction) _wrap_PyTiledMap_infinite, METH_NOARGS, "infinite()\n\n" },
  4725. {(char *) "insertTileset", (PyCFunction) _wrap_PyTiledMap_insertTileset, METH_KEYWORDS|METH_VARARGS, "insertTileset(pos, tileset)\n\ntype: pos: int\ntype: tileset: SharedTileset" },
  4726. {(char *) "isTilesetUsed", (PyCFunction) _wrap_PyTiledMap_isTilesetUsed, METH_KEYWORDS|METH_VARARGS, "isTilesetUsed(tileset)\n\ntype: tileset: Tileset const *" },
  4727. {(char *) "layerAt", (PyCFunction) _wrap_PyTiledMap_layerAt, METH_KEYWORDS|METH_VARARGS, "layerAt(index)\n\ntype: index: int" },
  4728. {(char *) "layerCount", (PyCFunction) _wrap_PyTiledMap_layerCount, METH_NOARGS, "layerCount()\n\n" },
  4729. {(char *) "nextLayerId", (PyCFunction) _wrap_PyTiledMap_nextLayerId, METH_NOARGS, "nextLayerId()\n\n" },
  4730. {(char *) "nextObjectId", (PyCFunction) _wrap_PyTiledMap_nextObjectId, METH_NOARGS, "nextObjectId()\n\n" },
  4731. {(char *) "objectGroupCount", (PyCFunction) _wrap_PyTiledMap_objectGroupCount, METH_NOARGS, "objectGroupCount()\n\n" },
  4732. {(char *) "orientation", (PyCFunction) _wrap_PyTiledMap_orientation, METH_NOARGS, "orientation()\n\n" },
  4733. {(char *) "removeTilesetAt", (PyCFunction) _wrap_PyTiledMap_removeTilesetAt, METH_KEYWORDS|METH_VARARGS, "removeTilesetAt(pos)\n\ntype: pos: int" },
  4734. {(char *) "renderOrder", (PyCFunction) _wrap_PyTiledMap_renderOrder, METH_NOARGS, "renderOrder()\n\n" },
  4735. {(char *) "replaceTileset", (PyCFunction) _wrap_PyTiledMap_replaceTileset, METH_KEYWORDS|METH_VARARGS, "replaceTileset(oldTileset, newTileset)\n\ntype: oldTileset: SharedTileset\ntype: newTileset: SharedTileset" },
  4736. {(char *) "setBackgroundColor", (PyCFunction) _wrap_PyTiledMap_setBackgroundColor, METH_KEYWORDS|METH_VARARGS, "setBackgroundColor(col)\n\ntype: col: QColor" },
  4737. {(char *) "setHeight", (PyCFunction) _wrap_PyTiledMap_setHeight, METH_KEYWORDS|METH_VARARGS, "setHeight(h)\n\ntype: h: int" },
  4738. {(char *) "setHexSideLength", (PyCFunction) _wrap_PyTiledMap_setHexSideLength, METH_KEYWORDS|METH_VARARGS, "setHexSideLength(hexSideLength)\n\ntype: hexSideLength: int" },
  4739. {(char *) "setInfinite", (PyCFunction) _wrap_PyTiledMap_setInfinite, METH_KEYWORDS|METH_VARARGS, "setInfinite(infinite)\n\ntype: infinite: bool" },
  4740. {(char *) "setNextLayerId", (PyCFunction) _wrap_PyTiledMap_setNextLayerId, METH_KEYWORDS|METH_VARARGS, "setNextLayerId(nextLayerId)\n\ntype: nextLayerId: int" },
  4741. {(char *) "setNextObjectId", (PyCFunction) _wrap_PyTiledMap_setNextObjectId, METH_KEYWORDS|METH_VARARGS, "setNextObjectId(nextObjectId)\n\ntype: nextObjectId: int" },
  4742. {(char *) "setOrientation", (PyCFunction) _wrap_PyTiledMap_setOrientation, METH_KEYWORDS|METH_VARARGS, "setOrientation(orientation)\n\ntype: orientation: Tiled::Map::Orientation" },
  4743. {(char *) "setRenderOrder", (PyCFunction) _wrap_PyTiledMap_setRenderOrder, METH_KEYWORDS|METH_VARARGS, "setRenderOrder(renderOrder)\n\ntype: renderOrder: Tiled::Map::RenderOrder" },
  4744. {(char *) "setStaggerAxis", (PyCFunction) _wrap_PyTiledMap_setStaggerAxis, METH_KEYWORDS|METH_VARARGS, "setStaggerAxis(staggerAxis)\n\ntype: staggerAxis: Tiled::Map::StaggerAxis" },
  4745. {(char *) "setStaggerIndex", (PyCFunction) _wrap_PyTiledMap_setStaggerIndex, METH_KEYWORDS|METH_VARARGS, "setStaggerIndex(staggerIndex)\n\ntype: staggerIndex: Tiled::Map::StaggerIndex" },
  4746. {(char *) "setWidth", (PyCFunction) _wrap_PyTiledMap_setWidth, METH_KEYWORDS|METH_VARARGS, "setWidth(w)\n\ntype: w: int" },
  4747. {(char *) "staggerAxis", (PyCFunction) _wrap_PyTiledMap_staggerAxis, METH_NOARGS, "staggerAxis()\n\n" },
  4748. {(char *) "staggerIndex", (PyCFunction) _wrap_PyTiledMap_staggerIndex, METH_NOARGS, "staggerIndex()\n\n" },
  4749. {(char *) "tileHeight", (PyCFunction) _wrap_PyTiledMap_tileHeight, METH_NOARGS, "tileHeight()\n\n" },
  4750. {(char *) "tileLayerCount", (PyCFunction) _wrap_PyTiledMap_tileLayerCount, METH_NOARGS, "tileLayerCount()\n\n" },
  4751. {(char *) "tileSize", (PyCFunction) _wrap_PyTiledMap_tileSize, METH_NOARGS, "tileSize()\n\n" },
  4752. {(char *) "tileWidth", (PyCFunction) _wrap_PyTiledMap_tileWidth, METH_NOARGS, "tileWidth()\n\n" },
  4753. {(char *) "tilesetAt", (PyCFunction) _wrap_PyTiledMap_tilesetAt, METH_KEYWORDS|METH_VARARGS, "tilesetAt(index)\n\ntype: index: int" },
  4754. {(char *) "tilesetCount", (PyCFunction) _wrap_PyTiledMap_tilesetCount, METH_NOARGS, "tilesetCount()\n\n" },
  4755. {(char *) "width", (PyCFunction) _wrap_PyTiledMap_width, METH_NOARGS, "width()\n\n" },
  4756. {NULL, NULL, 0, NULL}
  4757. };
  4758. static void
  4759. _wrap_PyTiledMap__tp_dealloc(PyTiledMap *self)
  4760. {
  4761. Tiled::Map *tmp = self->obj;
  4762. self->obj = NULL;
  4763. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  4764. delete tmp;
  4765. }
  4766. Py_TYPE(self)->tp_free((PyObject*)self);
  4767. }
  4768. PyTypeObject PyTiledMap_Type = {
  4769. PyVarObject_HEAD_INIT(NULL, 0)
  4770. (char *) "tiled.Tiled.Map", /* tp_name */
  4771. sizeof(PyTiledMap), /* tp_basicsize */
  4772. 0, /* tp_itemsize */
  4773. /* methods */
  4774. (destructor)_wrap_PyTiledMap__tp_dealloc, /* tp_dealloc */
  4775. (printfunc)0, /* tp_print */
  4776. (getattrfunc)NULL, /* tp_getattr */
  4777. (setattrfunc)NULL, /* tp_setattr */
  4778. #if PY_MAJOR_VERSION >= 3
  4779. NULL,
  4780. #else
  4781. (cmpfunc)NULL, /* tp_compare */
  4782. #endif
  4783. (reprfunc)NULL, /* tp_repr */
  4784. (PyNumberMethods*)NULL, /* tp_as_number */
  4785. (PySequenceMethods*)NULL, /* tp_as_sequence */
  4786. (PyMappingMethods*)NULL, /* tp_as_mapping */
  4787. (hashfunc)NULL, /* tp_hash */
  4788. (ternaryfunc)NULL, /* tp_call */
  4789. (reprfunc)NULL, /* tp_str */
  4790. (getattrofunc)NULL, /* tp_getattro */
  4791. (setattrofunc)NULL, /* tp_setattro */
  4792. (PyBufferProcs*)NULL, /* tp_as_buffer */
  4793. Py_TPFLAGS_DEFAULT, /* tp_flags */
  4794. "Map(orient, w, h, tileW, tileH)", /* Documentation string */
  4795. (traverseproc)NULL, /* tp_traverse */
  4796. (inquiry)NULL, /* tp_clear */
  4797. (richcmpfunc)NULL, /* tp_richcompare */
  4798. 0, /* tp_weaklistoffset */
  4799. (getiterfunc)NULL, /* tp_iter */
  4800. (iternextfunc)NULL, /* tp_iternext */
  4801. (struct PyMethodDef*)PyTiledMap_methods, /* tp_methods */
  4802. (struct PyMemberDef*)0, /* tp_members */
  4803. 0, /* tp_getset */
  4804. NULL, /* tp_base */
  4805. NULL, /* tp_dict */
  4806. (descrgetfunc)NULL, /* tp_descr_get */
  4807. (descrsetfunc)NULL, /* tp_descr_set */
  4808. 0, /* tp_dictoffset */
  4809. (initproc)_wrap_PyTiledMap__tp_init, /* tp_init */
  4810. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  4811. (newfunc)PyType_GenericNew, /* tp_new */
  4812. (freefunc)0, /* tp_free */
  4813. (inquiry)NULL, /* tp_is_gc */
  4814. NULL, /* tp_bases */
  4815. NULL, /* tp_mro */
  4816. NULL, /* tp_cache */
  4817. NULL, /* tp_subclasses */
  4818. NULL, /* tp_weaklist */
  4819. (destructor) NULL /* tp_del */
  4820. };
  4821. static PyObject* _wrap_PyTiledCell__get_flippedHorizontally(PyTiledCell *self, void * PYBINDGEN_UNUSED(closure))
  4822. {
  4823. PyObject *py_retval;
  4824. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(self->obj->flippedHorizontally()));
  4825. return py_retval;
  4826. }
  4827. static int _wrap_PyTiledCell__set_flippedHorizontally(PyTiledCell *self, PyObject *value, void * PYBINDGEN_UNUSED(closure))
  4828. {
  4829. PyObject *py_retval;
  4830. bool tmp_value;
  4831. PyObject *py_boolretval;
  4832. py_retval = Py_BuildValue((char *) "(O)", value);
  4833. if (!PyArg_ParseTuple(py_retval, (char *) "O", &py_boolretval)) {
  4834. Py_DECREF(py_retval);
  4835. return -1;
  4836. }
  4837. tmp_value = PyObject_IsTrue(py_boolretval);
  4838. self->obj->setFlippedHorizontally(tmp_value);
  4839. Py_DECREF(py_retval);
  4840. return 0;
  4841. }
  4842. static PyObject* _wrap_PyTiledCell__get_flippedVertically(PyTiledCell *self, void * PYBINDGEN_UNUSED(closure))
  4843. {
  4844. PyObject *py_retval;
  4845. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(self->obj->flippedVertically()));
  4846. return py_retval;
  4847. }
  4848. static int _wrap_PyTiledCell__set_flippedVertically(PyTiledCell *self, PyObject *value, void * PYBINDGEN_UNUSED(closure))
  4849. {
  4850. PyObject *py_retval;
  4851. bool tmp_value;
  4852. PyObject *py_boolretval;
  4853. py_retval = Py_BuildValue((char *) "(O)", value);
  4854. if (!PyArg_ParseTuple(py_retval, (char *) "O", &py_boolretval)) {
  4855. Py_DECREF(py_retval);
  4856. return -1;
  4857. }
  4858. tmp_value = PyObject_IsTrue(py_boolretval);
  4859. self->obj->setFlippedVertically(tmp_value);
  4860. Py_DECREF(py_retval);
  4861. return 0;
  4862. }
  4863. static PyObject* _wrap_PyTiledCell__get_flippedAntiDiagonally(PyTiledCell *self, void * PYBINDGEN_UNUSED(closure))
  4864. {
  4865. PyObject *py_retval;
  4866. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(self->obj->flippedAntiDiagonally()));
  4867. return py_retval;
  4868. }
  4869. static int _wrap_PyTiledCell__set_flippedAntiDiagonally(PyTiledCell *self, PyObject *value, void * PYBINDGEN_UNUSED(closure))
  4870. {
  4871. PyObject *py_retval;
  4872. bool tmp_value;
  4873. PyObject *py_boolretval;
  4874. py_retval = Py_BuildValue((char *) "(O)", value);
  4875. if (!PyArg_ParseTuple(py_retval, (char *) "O", &py_boolretval)) {
  4876. Py_DECREF(py_retval);
  4877. return -1;
  4878. }
  4879. tmp_value = PyObject_IsTrue(py_boolretval);
  4880. self->obj->setFlippedAntiDiagonally(tmp_value);
  4881. Py_DECREF(py_retval);
  4882. return 0;
  4883. }
  4884. static PyObject* _wrap_PyTiledCell__get_rotatedHexagonal120(PyTiledCell *self, void * PYBINDGEN_UNUSED(closure))
  4885. {
  4886. PyObject *py_retval;
  4887. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(self->obj->rotatedHexagonal120()));
  4888. return py_retval;
  4889. }
  4890. static int _wrap_PyTiledCell__set_rotatedHexagonal120(PyTiledCell *self, PyObject *value, void * PYBINDGEN_UNUSED(closure))
  4891. {
  4892. PyObject *py_retval;
  4893. bool tmp_value;
  4894. PyObject *py_boolretval;
  4895. py_retval = Py_BuildValue((char *) "(O)", value);
  4896. if (!PyArg_ParseTuple(py_retval, (char *) "O", &py_boolretval)) {
  4897. Py_DECREF(py_retval);
  4898. return -1;
  4899. }
  4900. tmp_value = PyObject_IsTrue(py_boolretval);
  4901. self->obj->setRotatedHexagonal120(tmp_value);
  4902. Py_DECREF(py_retval);
  4903. return 0;
  4904. }
  4905. static PyObject* _wrap_PyTiledCell__get_checked(PyTiledCell *self, void * PYBINDGEN_UNUSED(closure))
  4906. {
  4907. PyObject *py_retval;
  4908. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(self->obj->checked()));
  4909. return py_retval;
  4910. }
  4911. static int _wrap_PyTiledCell__set_checked(PyTiledCell *self, PyObject *value, void * PYBINDGEN_UNUSED(closure))
  4912. {
  4913. PyObject *py_retval;
  4914. bool tmp_value;
  4915. PyObject *py_boolretval;
  4916. py_retval = Py_BuildValue((char *) "(O)", value);
  4917. if (!PyArg_ParseTuple(py_retval, (char *) "O", &py_boolretval)) {
  4918. Py_DECREF(py_retval);
  4919. return -1;
  4920. }
  4921. tmp_value = PyObject_IsTrue(py_boolretval);
  4922. self->obj->setChecked(tmp_value);
  4923. Py_DECREF(py_retval);
  4924. return 0;
  4925. }
  4926. static PyGetSetDef PyTiledCell__getsets[] = {
  4927. {
  4928. (char*) "flippedHorizontally", /* attribute name */
  4929. (getter) _wrap_PyTiledCell__get_flippedHorizontally, /* C function to get the attribute */
  4930. (setter) _wrap_PyTiledCell__set_flippedHorizontally, /* C function to set the attribute */
  4931. NULL, /* optional doc string */
  4932. NULL /* optional additional data for getter and setter */
  4933. },
  4934. {
  4935. (char*) "flippedVertically", /* attribute name */
  4936. (getter) _wrap_PyTiledCell__get_flippedVertically, /* C function to get the attribute */
  4937. (setter) _wrap_PyTiledCell__set_flippedVertically, /* C function to set the attribute */
  4938. NULL, /* optional doc string */
  4939. NULL /* optional additional data for getter and setter */
  4940. },
  4941. {
  4942. (char*) "flippedAntiDiagonally", /* attribute name */
  4943. (getter) _wrap_PyTiledCell__get_flippedAntiDiagonally, /* C function to get the attribute */
  4944. (setter) _wrap_PyTiledCell__set_flippedAntiDiagonally, /* C function to set the attribute */
  4945. NULL, /* optional doc string */
  4946. NULL /* optional additional data for getter and setter */
  4947. },
  4948. {
  4949. (char*) "rotatedHexagonal120", /* attribute name */
  4950. (getter) _wrap_PyTiledCell__get_rotatedHexagonal120, /* C function to get the attribute */
  4951. (setter) _wrap_PyTiledCell__set_rotatedHexagonal120, /* C function to set the attribute */
  4952. NULL, /* optional doc string */
  4953. NULL /* optional additional data for getter and setter */
  4954. },
  4955. {
  4956. (char*) "checked", /* attribute name */
  4957. (getter) _wrap_PyTiledCell__get_checked, /* C function to get the attribute */
  4958. (setter) _wrap_PyTiledCell__set_checked, /* C function to set the attribute */
  4959. NULL, /* optional doc string */
  4960. NULL /* optional additional data for getter and setter */
  4961. },
  4962. { NULL, NULL, NULL, NULL, NULL }
  4963. };
  4964. static int
  4965. _wrap_PyTiledCell__tp_init__0(PyTiledCell *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  4966. {
  4967. PyTiledTile *tile;
  4968. Tiled::Tile *tile_ptr;
  4969. const char *keywords[] = {"tile", NULL};
  4970. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledTile_Type, &tile)) {
  4971. {
  4972. PyObject *exc_type, *traceback;
  4973. PyErr_Fetch(&exc_type, return_exception, &traceback);
  4974. Py_XDECREF(exc_type);
  4975. Py_XDECREF(traceback);
  4976. }
  4977. return -1;
  4978. }
  4979. tile_ptr = (tile ? tile->obj : NULL);
  4980. self->obj = new Tiled::Cell(tile_ptr);
  4981. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  4982. return 0;
  4983. }
  4984. static int
  4985. _wrap_PyTiledCell__tp_init__1(PyTiledCell *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  4986. {
  4987. PyTiledCell *ctor_arg;
  4988. const char *keywords[] = {"ctor_arg", NULL};
  4989. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledCell_Type, &ctor_arg)) {
  4990. {
  4991. PyObject *exc_type, *traceback;
  4992. PyErr_Fetch(&exc_type, return_exception, &traceback);
  4993. Py_XDECREF(exc_type);
  4994. Py_XDECREF(traceback);
  4995. }
  4996. return -1;
  4997. }
  4998. self->obj = new Tiled::Cell(*((PyTiledCell *) ctor_arg)->obj);
  4999. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  5000. return 0;
  5001. }
  5002. int _wrap_PyTiledCell__tp_init(PyTiledCell *self, PyObject *args, PyObject *kwargs)
  5003. {
  5004. int retval;
  5005. PyObject *error_list;
  5006. PyObject *exceptions[2] = {0,};
  5007. retval = _wrap_PyTiledCell__tp_init__0(self, args, kwargs, &exceptions[0]);
  5008. if (!exceptions[0]) {
  5009. return retval;
  5010. }
  5011. retval = _wrap_PyTiledCell__tp_init__1(self, args, kwargs, &exceptions[1]);
  5012. if (!exceptions[1]) {
  5013. Py_DECREF(exceptions[0]);
  5014. return retval;
  5015. }
  5016. error_list = PyList_New(2);
  5017. PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
  5018. Py_DECREF(exceptions[0]);
  5019. PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
  5020. Py_DECREF(exceptions[1]);
  5021. PyErr_SetObject(PyExc_TypeError, error_list);
  5022. Py_DECREF(error_list);
  5023. return -1;
  5024. }
  5025. PyObject *
  5026. _wrap_PyTiledCell_isEmpty(PyTiledCell *self)
  5027. {
  5028. PyObject *py_retval;
  5029. bool retval;
  5030. retval = self->obj->isEmpty();
  5031. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  5032. return py_retval;
  5033. }
  5034. PyObject *
  5035. _wrap_PyTiledCell_setTile(PyTiledCell *self, PyObject *args, PyObject *kwargs)
  5036. {
  5037. PyObject *py_retval;
  5038. PyTiledTile *tile;
  5039. Tiled::Tile *tile_ptr;
  5040. const char *keywords[] = {"tile", NULL};
  5041. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledTile_Type, &tile)) {
  5042. return NULL;
  5043. }
  5044. tile_ptr = (tile ? tile->obj : NULL);
  5045. self->obj->setTile(tile_ptr);
  5046. Py_INCREF(Py_None);
  5047. py_retval = Py_None;
  5048. return py_retval;
  5049. }
  5050. PyObject *
  5051. _wrap_PyTiledCell_tile(PyTiledCell *self)
  5052. {
  5053. PyObject *py_retval;
  5054. Tiled::Tile *retval;
  5055. PyTiledTile *py_Tile;
  5056. retval = self->obj->tile();
  5057. if (!(retval)) {
  5058. Py_INCREF(Py_None);
  5059. return Py_None;
  5060. }
  5061. py_Tile = PyObject_New(PyTiledTile, &PyTiledTile_Type);
  5062. py_Tile->obj = retval;
  5063. py_Tile->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  5064. py_retval = Py_BuildValue((char *) "N", py_Tile);
  5065. return py_retval;
  5066. }
  5067. PyObject *
  5068. _wrap_PyTiledCell_tileset(PyTiledCell *self)
  5069. {
  5070. PyObject *py_retval;
  5071. Tiled::Tileset *retval;
  5072. PyTiledTileset *py_Tileset;
  5073. retval = self->obj->tileset();
  5074. if (!(retval)) {
  5075. Py_INCREF(Py_None);
  5076. return Py_None;
  5077. }
  5078. py_Tileset = PyObject_New(PyTiledTileset, &PyTiledTileset_Type);
  5079. py_Tileset->obj = retval;
  5080. py_Tileset->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  5081. py_retval = Py_BuildValue((char *) "N", py_Tileset);
  5082. return py_retval;
  5083. }
  5084. static PyObject*
  5085. _wrap_PyTiledCell__copy__(PyTiledCell *self)
  5086. {
  5087. PyTiledCell *py_copy;
  5088. py_copy = PyObject_New(PyTiledCell, &PyTiledCell_Type);
  5089. py_copy->obj = new Tiled::Cell(*self->obj);
  5090. py_copy->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  5091. return (PyObject*) py_copy;
  5092. }
  5093. static PyMethodDef PyTiledCell_methods[] = {
  5094. {(char *) "isEmpty", (PyCFunction) _wrap_PyTiledCell_isEmpty, METH_NOARGS, "isEmpty()\n\n" },
  5095. {(char *) "setTile", (PyCFunction) _wrap_PyTiledCell_setTile, METH_KEYWORDS|METH_VARARGS, "setTile(tile)\n\ntype: tile: Tiled::Tile *" },
  5096. {(char *) "tile", (PyCFunction) _wrap_PyTiledCell_tile, METH_NOARGS, "tile()\n\n" },
  5097. {(char *) "tileset", (PyCFunction) _wrap_PyTiledCell_tileset, METH_NOARGS, "tileset()\n\n" },
  5098. {(char *) "__copy__", (PyCFunction) _wrap_PyTiledCell__copy__, METH_NOARGS, NULL},
  5099. {NULL, NULL, 0, NULL}
  5100. };
  5101. static void
  5102. _wrap_PyTiledCell__tp_dealloc(PyTiledCell *self)
  5103. {
  5104. Tiled::Cell *tmp = self->obj;
  5105. self->obj = NULL;
  5106. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  5107. delete tmp;
  5108. }
  5109. Py_TYPE(self)->tp_free((PyObject*)self);
  5110. }
  5111. static PyObject*
  5112. _wrap_PyTiledCell__tp_richcompare (PyTiledCell *self, PyTiledCell *other, int opid)
  5113. {
  5114. if (!PyObject_IsInstance((PyObject*) other, (PyObject*) &PyTiledCell_Type)) {
  5115. Py_INCREF(Py_NotImplemented);
  5116. return Py_NotImplemented;
  5117. }
  5118. switch (opid)
  5119. {
  5120. case Py_LT:
  5121. Py_INCREF(Py_NotImplemented);
  5122. return Py_NotImplemented;
  5123. case Py_LE:
  5124. Py_INCREF(Py_NotImplemented);
  5125. return Py_NotImplemented;
  5126. case Py_EQ:
  5127. if (*self->obj == *other->obj) {
  5128. Py_INCREF(Py_True);
  5129. return Py_True;
  5130. } else {
  5131. Py_INCREF(Py_False);
  5132. return Py_False;
  5133. }
  5134. case Py_NE:
  5135. if (*self->obj != *other->obj) {
  5136. Py_INCREF(Py_True);
  5137. return Py_True;
  5138. } else {
  5139. Py_INCREF(Py_False);
  5140. return Py_False;
  5141. }
  5142. case Py_GE:
  5143. Py_INCREF(Py_NotImplemented);
  5144. return Py_NotImplemented;
  5145. case Py_GT:
  5146. Py_INCREF(Py_NotImplemented);
  5147. return Py_NotImplemented;
  5148. } /* closes switch (opid) */
  5149. Py_INCREF(Py_NotImplemented);
  5150. return Py_NotImplemented;
  5151. }
  5152. PyTypeObject PyTiledCell_Type = {
  5153. PyVarObject_HEAD_INIT(NULL, 0)
  5154. (char *) "tiled.Tiled.Cell", /* tp_name */
  5155. sizeof(PyTiledCell), /* tp_basicsize */
  5156. 0, /* tp_itemsize */
  5157. /* methods */
  5158. (destructor)_wrap_PyTiledCell__tp_dealloc, /* tp_dealloc */
  5159. (printfunc)0, /* tp_print */
  5160. (getattrfunc)NULL, /* tp_getattr */
  5161. (setattrfunc)NULL, /* tp_setattr */
  5162. #if PY_MAJOR_VERSION >= 3
  5163. NULL,
  5164. #else
  5165. (cmpfunc)NULL, /* tp_compare */
  5166. #endif
  5167. (reprfunc)NULL, /* tp_repr */
  5168. (PyNumberMethods*)NULL, /* tp_as_number */
  5169. (PySequenceMethods*)NULL, /* tp_as_sequence */
  5170. (PyMappingMethods*)NULL, /* tp_as_mapping */
  5171. (hashfunc)NULL, /* tp_hash */
  5172. (ternaryfunc)NULL, /* tp_call */
  5173. (reprfunc)NULL, /* tp_str */
  5174. (getattrofunc)NULL, /* tp_getattro */
  5175. (setattrofunc)NULL, /* tp_setattro */
  5176. (PyBufferProcs*)NULL, /* tp_as_buffer */
  5177. Py_TPFLAGS_DEFAULT, /* tp_flags */
  5178. "Cell(ctor_arg)\nCell(tile)", /* Documentation string */
  5179. (traverseproc)NULL, /* tp_traverse */
  5180. (inquiry)NULL, /* tp_clear */
  5181. (richcmpfunc)_wrap_PyTiledCell__tp_richcompare, /* tp_richcompare */
  5182. 0, /* tp_weaklistoffset */
  5183. (getiterfunc)NULL, /* tp_iter */
  5184. (iternextfunc)NULL, /* tp_iternext */
  5185. (struct PyMethodDef*)PyTiledCell_methods, /* tp_methods */
  5186. (struct PyMemberDef*)0, /* tp_members */
  5187. PyTiledCell__getsets, /* tp_getset */
  5188. NULL, /* tp_base */
  5189. NULL, /* tp_dict */
  5190. (descrgetfunc)NULL, /* tp_descr_get */
  5191. (descrsetfunc)NULL, /* tp_descr_set */
  5192. 0, /* tp_dictoffset */
  5193. (initproc)_wrap_PyTiledCell__tp_init, /* tp_init */
  5194. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  5195. (newfunc)PyType_GenericNew, /* tp_new */
  5196. (freefunc)0, /* tp_free */
  5197. (inquiry)NULL, /* tp_is_gc */
  5198. NULL, /* tp_bases */
  5199. NULL, /* tp_mro */
  5200. NULL, /* tp_cache */
  5201. NULL, /* tp_subclasses */
  5202. NULL, /* tp_weaklist */
  5203. (destructor) NULL /* tp_del */
  5204. };
  5205. static int
  5206. _wrap_PyTiledTileLayer__tp_init(PyTiledTileLayer *self, PyObject *args, PyObject *kwargs)
  5207. {
  5208. const char *name;
  5209. Py_ssize_t name_len;
  5210. int x;
  5211. int y;
  5212. int w;
  5213. int h;
  5214. const char *keywords[] = {"name", "x", "y", "w", "h", NULL};
  5215. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#iiii", (char **) keywords, &name, &name_len, &x, &y, &w, &h)) {
  5216. return -1;
  5217. }
  5218. self->obj = new Tiled::TileLayer(QString::fromUtf8(name), x, y, w, h);
  5219. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  5220. return 0;
  5221. }
  5222. PyObject *
  5223. _wrap_PyTiledTileLayer_cellAt(PyTiledTileLayer *self, PyObject *args, PyObject *kwargs)
  5224. {
  5225. PyObject *py_retval;
  5226. int x;
  5227. int y;
  5228. const char *keywords[] = {"x", "y", NULL};
  5229. PyTiledCell *py_Cell;
  5230. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "ii", (char **) keywords, &x, &y)) {
  5231. return NULL;
  5232. }
  5233. Tiled::Cell retval = self->obj->cellAt(x, y);
  5234. py_Cell = PyObject_New(PyTiledCell, &PyTiledCell_Type);
  5235. py_Cell->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  5236. py_Cell->obj = new Tiled::Cell(retval);
  5237. py_retval = Py_BuildValue((char *) "N", py_Cell);
  5238. return py_retval;
  5239. }
  5240. PyObject *
  5241. _wrap_PyTiledTileLayer_height(PyTiledTileLayer *self)
  5242. {
  5243. PyObject *py_retval;
  5244. int retval;
  5245. retval = self->obj->height();
  5246. py_retval = Py_BuildValue((char *) "i", retval);
  5247. return py_retval;
  5248. }
  5249. PyObject *
  5250. _wrap_PyTiledTileLayer_isEmpty(PyTiledTileLayer *self)
  5251. {
  5252. PyObject *py_retval;
  5253. bool retval;
  5254. retval = self->obj->isEmpty();
  5255. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  5256. return py_retval;
  5257. }
  5258. PyObject *
  5259. _wrap_PyTiledTileLayer_referencesTileset(PyTiledTileLayer *self, PyObject *args, PyObject *kwargs)
  5260. {
  5261. PyObject *py_retval;
  5262. bool retval;
  5263. PyTiledTileset *ts;
  5264. Tiled::Tileset *ts_ptr;
  5265. const char *keywords[] = {"ts", NULL};
  5266. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledTileset_Type, &ts)) {
  5267. return NULL;
  5268. }
  5269. ts_ptr = (ts ? ts->obj : NULL);
  5270. retval = self->obj->referencesTileset(ts_ptr);
  5271. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  5272. return py_retval;
  5273. }
  5274. PyObject *
  5275. _wrap_PyTiledTileLayer_setCell(PyTiledTileLayer *self, PyObject *args, PyObject *kwargs)
  5276. {
  5277. PyObject *py_retval;
  5278. int x;
  5279. int y;
  5280. PyTiledCell *c;
  5281. const char *keywords[] = {"x", "y", "c", NULL};
  5282. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "iiO!", (char **) keywords, &x, &y, &PyTiledCell_Type, &c)) {
  5283. return NULL;
  5284. }
  5285. self->obj->setCell(x, y, *((PyTiledCell *) c)->obj);
  5286. Py_INCREF(Py_None);
  5287. py_retval = Py_None;
  5288. return py_retval;
  5289. }
  5290. PyObject *
  5291. _wrap_PyTiledTileLayer_width(PyTiledTileLayer *self)
  5292. {
  5293. PyObject *py_retval;
  5294. int retval;
  5295. retval = self->obj->width();
  5296. py_retval = Py_BuildValue((char *) "i", retval);
  5297. return py_retval;
  5298. }
  5299. static PyMethodDef PyTiledTileLayer_methods[] = {
  5300. {(char *) "cellAt", (PyCFunction) _wrap_PyTiledTileLayer_cellAt, METH_KEYWORDS|METH_VARARGS, "cellAt(x, y)\n\ntype: x: int\ntype: y: int" },
  5301. {(char *) "height", (PyCFunction) _wrap_PyTiledTileLayer_height, METH_NOARGS, "height()\n\n" },
  5302. {(char *) "isEmpty", (PyCFunction) _wrap_PyTiledTileLayer_isEmpty, METH_NOARGS, "isEmpty()\n\n" },
  5303. {(char *) "referencesTileset", (PyCFunction) _wrap_PyTiledTileLayer_referencesTileset, METH_KEYWORDS|METH_VARARGS, "referencesTileset(ts)\n\ntype: ts: Tileset *" },
  5304. {(char *) "setCell", (PyCFunction) _wrap_PyTiledTileLayer_setCell, METH_KEYWORDS|METH_VARARGS, "setCell(x, y, c)\n\ntype: x: int\ntype: y: int\ntype: c: Cell" },
  5305. {(char *) "width", (PyCFunction) _wrap_PyTiledTileLayer_width, METH_NOARGS, "width()\n\n" },
  5306. {NULL, NULL, 0, NULL}
  5307. };
  5308. static void
  5309. _wrap_PyTiledTileLayer__tp_dealloc(PyTiledTileLayer *self)
  5310. {
  5311. Tiled::TileLayer *tmp = self->obj;
  5312. self->obj = NULL;
  5313. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  5314. delete tmp;
  5315. }
  5316. Py_TYPE(self)->tp_free((PyObject*)self);
  5317. }
  5318. PyTypeObject PyTiledTileLayer_Type = {
  5319. PyVarObject_HEAD_INIT(NULL, 0)
  5320. (char *) "tiled.Tiled.TileLayer", /* tp_name */
  5321. sizeof(PyTiledTileLayer), /* tp_basicsize */
  5322. 0, /* tp_itemsize */
  5323. /* methods */
  5324. (destructor)_wrap_PyTiledTileLayer__tp_dealloc, /* tp_dealloc */
  5325. (printfunc)0, /* tp_print */
  5326. (getattrfunc)NULL, /* tp_getattr */
  5327. (setattrfunc)NULL, /* tp_setattr */
  5328. #if PY_MAJOR_VERSION >= 3
  5329. NULL,
  5330. #else
  5331. (cmpfunc)NULL, /* tp_compare */
  5332. #endif
  5333. (reprfunc)NULL, /* tp_repr */
  5334. (PyNumberMethods*)NULL, /* tp_as_number */
  5335. (PySequenceMethods*)NULL, /* tp_as_sequence */
  5336. (PyMappingMethods*)NULL, /* tp_as_mapping */
  5337. (hashfunc)NULL, /* tp_hash */
  5338. (ternaryfunc)NULL, /* tp_call */
  5339. (reprfunc)NULL, /* tp_str */
  5340. (getattrofunc)NULL, /* tp_getattro */
  5341. (setattrofunc)NULL, /* tp_setattro */
  5342. (PyBufferProcs*)NULL, /* tp_as_buffer */
  5343. Py_TPFLAGS_DEFAULT, /* tp_flags */
  5344. "TileLayer(name, x, y, w, h)", /* Documentation string */
  5345. (traverseproc)NULL, /* tp_traverse */
  5346. (inquiry)NULL, /* tp_clear */
  5347. (richcmpfunc)NULL, /* tp_richcompare */
  5348. 0, /* tp_weaklistoffset */
  5349. (getiterfunc)NULL, /* tp_iter */
  5350. (iternextfunc)NULL, /* tp_iternext */
  5351. (struct PyMethodDef*)PyTiledTileLayer_methods, /* tp_methods */
  5352. (struct PyMemberDef*)0, /* tp_members */
  5353. 0, /* tp_getset */
  5354. NULL, /* tp_base */
  5355. NULL, /* tp_dict */
  5356. (descrgetfunc)NULL, /* tp_descr_get */
  5357. (descrsetfunc)NULL, /* tp_descr_set */
  5358. 0, /* tp_dictoffset */
  5359. (initproc)_wrap_PyTiledTileLayer__tp_init, /* tp_init */
  5360. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  5361. (newfunc)PyType_GenericNew, /* tp_new */
  5362. (freefunc)0, /* tp_free */
  5363. (inquiry)NULL, /* tp_is_gc */
  5364. NULL, /* tp_bases */
  5365. NULL, /* tp_mro */
  5366. NULL, /* tp_cache */
  5367. NULL, /* tp_subclasses */
  5368. NULL, /* tp_weaklist */
  5369. (destructor) NULL /* tp_del */
  5370. };
  5371. static int
  5372. _wrap_PyTiledImageLayer__tp_init(PyTiledImageLayer *self, PyObject *args, PyObject *kwargs)
  5373. {
  5374. const char *name;
  5375. Py_ssize_t name_len;
  5376. int x;
  5377. int y;
  5378. const char *keywords[] = {"name", "x", "y", NULL};
  5379. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#ii", (char **) keywords, &name, &name_len, &x, &y)) {
  5380. return -1;
  5381. }
  5382. self->obj = new Tiled::ImageLayer(QString::fromUtf8(name), x, y);
  5383. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  5384. return 0;
  5385. }
  5386. PyObject *
  5387. _wrap_PyTiledImageLayer_image(PyTiledImageLayer *self)
  5388. {
  5389. PyObject *py_retval;
  5390. PyQPixmap *py_QPixmap;
  5391. QPixmap const & retval = self->obj->image();
  5392. py_QPixmap = PyObject_New(PyQPixmap, &PyQPixmap_Type);
  5393. py_QPixmap->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  5394. py_QPixmap->obj = new QPixmap(retval);
  5395. py_retval = Py_BuildValue((char *) "N", py_QPixmap);
  5396. return py_retval;
  5397. }
  5398. PyObject *
  5399. _wrap_PyTiledImageLayer_loadFromImage(PyTiledImageLayer *self, PyObject *args, PyObject *kwargs)
  5400. {
  5401. PyObject *py_retval;
  5402. bool retval;
  5403. PyQImage *img;
  5404. const char *file;
  5405. Py_ssize_t file_len;
  5406. const char *keywords[] = {"img", "file", NULL};
  5407. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!s#", (char **) keywords, &PyQImage_Type, &img, &file, &file_len)) {
  5408. return NULL;
  5409. }
  5410. retval = self->obj->loadFromImage(*((PyQImage *) img)->obj, QString::fromUtf8(file));
  5411. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  5412. return py_retval;
  5413. }
  5414. PyObject *
  5415. _wrap_PyTiledImageLayer_setImage(PyTiledImageLayer *self, PyObject *args, PyObject *kwargs)
  5416. {
  5417. PyObject *py_retval;
  5418. PyQPixmap *image;
  5419. const char *keywords[] = {"image", NULL};
  5420. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQPixmap_Type, &image)) {
  5421. return NULL;
  5422. }
  5423. self->obj->setImage(*((PyQPixmap *) image)->obj);
  5424. Py_INCREF(Py_None);
  5425. py_retval = Py_None;
  5426. return py_retval;
  5427. }
  5428. static PyMethodDef PyTiledImageLayer_methods[] = {
  5429. {(char *) "image", (PyCFunction) _wrap_PyTiledImageLayer_image, METH_NOARGS, "image()\n\n" },
  5430. {(char *) "loadFromImage", (PyCFunction) _wrap_PyTiledImageLayer_loadFromImage, METH_KEYWORDS|METH_VARARGS, "loadFromImage(img, file)\n\ntype: img: QImage const &\ntype: file: QString" },
  5431. {(char *) "setImage", (PyCFunction) _wrap_PyTiledImageLayer_setImage, METH_KEYWORDS|METH_VARARGS, "setImage(image)\n\ntype: image: QPixmap const &" },
  5432. {NULL, NULL, 0, NULL}
  5433. };
  5434. static void
  5435. _wrap_PyTiledImageLayer__tp_dealloc(PyTiledImageLayer *self)
  5436. {
  5437. Tiled::ImageLayer *tmp = self->obj;
  5438. self->obj = NULL;
  5439. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  5440. delete tmp;
  5441. }
  5442. Py_TYPE(self)->tp_free((PyObject*)self);
  5443. }
  5444. PyTypeObject PyTiledImageLayer_Type = {
  5445. PyVarObject_HEAD_INIT(NULL, 0)
  5446. (char *) "tiled.Tiled.ImageLayer", /* tp_name */
  5447. sizeof(PyTiledImageLayer), /* tp_basicsize */
  5448. 0, /* tp_itemsize */
  5449. /* methods */
  5450. (destructor)_wrap_PyTiledImageLayer__tp_dealloc, /* tp_dealloc */
  5451. (printfunc)0, /* tp_print */
  5452. (getattrfunc)NULL, /* tp_getattr */
  5453. (setattrfunc)NULL, /* tp_setattr */
  5454. #if PY_MAJOR_VERSION >= 3
  5455. NULL,
  5456. #else
  5457. (cmpfunc)NULL, /* tp_compare */
  5458. #endif
  5459. (reprfunc)NULL, /* tp_repr */
  5460. (PyNumberMethods*)NULL, /* tp_as_number */
  5461. (PySequenceMethods*)NULL, /* tp_as_sequence */
  5462. (PyMappingMethods*)NULL, /* tp_as_mapping */
  5463. (hashfunc)NULL, /* tp_hash */
  5464. (ternaryfunc)NULL, /* tp_call */
  5465. (reprfunc)NULL, /* tp_str */
  5466. (getattrofunc)NULL, /* tp_getattro */
  5467. (setattrofunc)NULL, /* tp_setattro */
  5468. (PyBufferProcs*)NULL, /* tp_as_buffer */
  5469. Py_TPFLAGS_DEFAULT, /* tp_flags */
  5470. "ImageLayer(name, x, y)", /* Documentation string */
  5471. (traverseproc)NULL, /* tp_traverse */
  5472. (inquiry)NULL, /* tp_clear */
  5473. (richcmpfunc)NULL, /* tp_richcompare */
  5474. 0, /* tp_weaklistoffset */
  5475. (getiterfunc)NULL, /* tp_iter */
  5476. (iternextfunc)NULL, /* tp_iternext */
  5477. (struct PyMethodDef*)PyTiledImageLayer_methods, /* tp_methods */
  5478. (struct PyMemberDef*)0, /* tp_members */
  5479. 0, /* tp_getset */
  5480. NULL, /* tp_base */
  5481. NULL, /* tp_dict */
  5482. (descrgetfunc)NULL, /* tp_descr_get */
  5483. (descrsetfunc)NULL, /* tp_descr_set */
  5484. 0, /* tp_dictoffset */
  5485. (initproc)_wrap_PyTiledImageLayer__tp_init, /* tp_init */
  5486. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  5487. (newfunc)PyType_GenericNew, /* tp_new */
  5488. (freefunc)0, /* tp_free */
  5489. (inquiry)NULL, /* tp_is_gc */
  5490. NULL, /* tp_bases */
  5491. NULL, /* tp_mro */
  5492. NULL, /* tp_cache */
  5493. NULL, /* tp_subclasses */
  5494. NULL, /* tp_weaklist */
  5495. (destructor) NULL /* tp_del */
  5496. };
  5497. static int
  5498. _wrap_PyTiledGroupLayer__tp_init(PyTiledGroupLayer *self, PyObject *args, PyObject *kwargs)
  5499. {
  5500. const char *name;
  5501. Py_ssize_t name_len;
  5502. int x;
  5503. int y;
  5504. const char *keywords[] = {"name", "x", "y", NULL};
  5505. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#ii", (char **) keywords, &name, &name_len, &x, &y)) {
  5506. return -1;
  5507. }
  5508. self->obj = new Tiled::GroupLayer(QString::fromUtf8(name), x, y);
  5509. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  5510. return 0;
  5511. }
  5512. PyObject *
  5513. _wrap_PyTiledGroupLayer_layerAt(PyTiledGroupLayer *self, PyObject *args, PyObject *kwargs)
  5514. {
  5515. PyObject *py_retval;
  5516. Tiled::Layer *retval;
  5517. int index;
  5518. const char *keywords[] = {"index", NULL};
  5519. PyTiledLayer *py_Layer;
  5520. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &index)) {
  5521. return NULL;
  5522. }
  5523. retval = self->obj->layerAt(index);
  5524. if (!(retval)) {
  5525. Py_INCREF(Py_None);
  5526. return Py_None;
  5527. }
  5528. py_Layer = PyObject_New(PyTiledLayer, &PyTiledLayer_Type);
  5529. py_Layer->obj = retval;
  5530. py_Layer->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  5531. py_retval = Py_BuildValue((char *) "N", py_Layer);
  5532. return py_retval;
  5533. }
  5534. PyObject *
  5535. _wrap_PyTiledGroupLayer_layerCount(PyTiledGroupLayer *self)
  5536. {
  5537. PyObject *py_retval;
  5538. int retval;
  5539. retval = self->obj->layerCount();
  5540. py_retval = Py_BuildValue((char *) "i", retval);
  5541. return py_retval;
  5542. }
  5543. static PyMethodDef PyTiledGroupLayer_methods[] = {
  5544. {(char *) "layerAt", (PyCFunction) _wrap_PyTiledGroupLayer_layerAt, METH_KEYWORDS|METH_VARARGS, "layerAt(index)\n\ntype: index: int" },
  5545. {(char *) "layerCount", (PyCFunction) _wrap_PyTiledGroupLayer_layerCount, METH_NOARGS, "layerCount()\n\n" },
  5546. {NULL, NULL, 0, NULL}
  5547. };
  5548. static void
  5549. _wrap_PyTiledGroupLayer__tp_dealloc(PyTiledGroupLayer *self)
  5550. {
  5551. Tiled::GroupLayer *tmp = self->obj;
  5552. self->obj = NULL;
  5553. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  5554. delete tmp;
  5555. }
  5556. Py_TYPE(self)->tp_free((PyObject*)self);
  5557. }
  5558. PyTypeObject PyTiledGroupLayer_Type = {
  5559. PyVarObject_HEAD_INIT(NULL, 0)
  5560. (char *) "tiled.Tiled.GroupLayer", /* tp_name */
  5561. sizeof(PyTiledGroupLayer), /* tp_basicsize */
  5562. 0, /* tp_itemsize */
  5563. /* methods */
  5564. (destructor)_wrap_PyTiledGroupLayer__tp_dealloc, /* tp_dealloc */
  5565. (printfunc)0, /* tp_print */
  5566. (getattrfunc)NULL, /* tp_getattr */
  5567. (setattrfunc)NULL, /* tp_setattr */
  5568. #if PY_MAJOR_VERSION >= 3
  5569. NULL,
  5570. #else
  5571. (cmpfunc)NULL, /* tp_compare */
  5572. #endif
  5573. (reprfunc)NULL, /* tp_repr */
  5574. (PyNumberMethods*)NULL, /* tp_as_number */
  5575. (PySequenceMethods*)NULL, /* tp_as_sequence */
  5576. (PyMappingMethods*)NULL, /* tp_as_mapping */
  5577. (hashfunc)NULL, /* tp_hash */
  5578. (ternaryfunc)NULL, /* tp_call */
  5579. (reprfunc)NULL, /* tp_str */
  5580. (getattrofunc)NULL, /* tp_getattro */
  5581. (setattrofunc)NULL, /* tp_setattro */
  5582. (PyBufferProcs*)NULL, /* tp_as_buffer */
  5583. Py_TPFLAGS_DEFAULT, /* tp_flags */
  5584. "GroupLayer(name, x, y)", /* Documentation string */
  5585. (traverseproc)NULL, /* tp_traverse */
  5586. (inquiry)NULL, /* tp_clear */
  5587. (richcmpfunc)NULL, /* tp_richcompare */
  5588. 0, /* tp_weaklistoffset */
  5589. (getiterfunc)NULL, /* tp_iter */
  5590. (iternextfunc)NULL, /* tp_iternext */
  5591. (struct PyMethodDef*)PyTiledGroupLayer_methods, /* tp_methods */
  5592. (struct PyMemberDef*)0, /* tp_members */
  5593. 0, /* tp_getset */
  5594. NULL, /* tp_base */
  5595. NULL, /* tp_dict */
  5596. (descrgetfunc)NULL, /* tp_descr_get */
  5597. (descrsetfunc)NULL, /* tp_descr_set */
  5598. 0, /* tp_dictoffset */
  5599. (initproc)_wrap_PyTiledGroupLayer__tp_init, /* tp_init */
  5600. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  5601. (newfunc)PyType_GenericNew, /* tp_new */
  5602. (freefunc)0, /* tp_free */
  5603. (inquiry)NULL, /* tp_is_gc */
  5604. NULL, /* tp_bases */
  5605. NULL, /* tp_mro */
  5606. NULL, /* tp_cache */
  5607. NULL, /* tp_subclasses */
  5608. NULL, /* tp_weaklist */
  5609. (destructor) NULL /* tp_del */
  5610. };
  5611. static int
  5612. _wrap_PyTiledObjectGroup__tp_init(PyTiledObjectGroup *self, PyObject *args, PyObject *kwargs)
  5613. {
  5614. const char *name;
  5615. Py_ssize_t name_len;
  5616. int x;
  5617. int y;
  5618. const char *keywords[] = {"name", "x", "y", NULL};
  5619. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#ii", (char **) keywords, &name, &name_len, &x, &y)) {
  5620. return -1;
  5621. }
  5622. self->obj = new Tiled::ObjectGroup(QString::fromUtf8(name), x, y);
  5623. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  5624. return 0;
  5625. }
  5626. PyObject *
  5627. _wrap_PyTiledObjectGroup_addObject(PyTiledObjectGroup *self, PyObject *args, PyObject *kwargs)
  5628. {
  5629. PyObject *py_retval;
  5630. PyTiledMapObject *object;
  5631. Tiled::MapObject *object_ptr;
  5632. const char *keywords[] = {"object", NULL};
  5633. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledMapObject_Type, &object)) {
  5634. return NULL;
  5635. }
  5636. object_ptr = (object ? object->obj : NULL);
  5637. self->obj->addObject(object_ptr);
  5638. if (object) {
  5639. object->obj = NULL;
  5640. }
  5641. Py_INCREF(Py_None);
  5642. py_retval = Py_None;
  5643. return py_retval;
  5644. }
  5645. PyObject *
  5646. _wrap_PyTiledObjectGroup_insertObject(PyTiledObjectGroup *self, PyObject *args, PyObject *kwargs)
  5647. {
  5648. PyObject *py_retval;
  5649. int index;
  5650. PyTiledMapObject *object;
  5651. Tiled::MapObject *object_ptr;
  5652. const char *keywords[] = {"index", "object", NULL};
  5653. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "iO!", (char **) keywords, &index, &PyTiledMapObject_Type, &object)) {
  5654. return NULL;
  5655. }
  5656. object_ptr = (object ? object->obj : NULL);
  5657. self->obj->insertObject(index, object_ptr);
  5658. Py_INCREF(Py_None);
  5659. py_retval = Py_None;
  5660. return py_retval;
  5661. }
  5662. PyObject *
  5663. _wrap_PyTiledObjectGroup_objectAt(PyTiledObjectGroup *self, PyObject *args, PyObject *kwargs)
  5664. {
  5665. PyObject *py_retval;
  5666. Tiled::MapObject *retval;
  5667. int index;
  5668. const char *keywords[] = {"index", NULL};
  5669. PyTiledMapObject *py_MapObject;
  5670. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &index)) {
  5671. return NULL;
  5672. }
  5673. retval = self->obj->objectAt(index);
  5674. if (!(retval)) {
  5675. Py_INCREF(Py_None);
  5676. return Py_None;
  5677. }
  5678. py_MapObject = PyObject_New(PyTiledMapObject, &PyTiledMapObject_Type);
  5679. py_MapObject->obj = retval;
  5680. py_MapObject->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  5681. py_retval = Py_BuildValue((char *) "N", py_MapObject);
  5682. return py_retval;
  5683. }
  5684. PyObject *
  5685. _wrap_PyTiledObjectGroup_objectCount(PyTiledObjectGroup *self)
  5686. {
  5687. PyObject *py_retval;
  5688. int retval;
  5689. retval = self->obj->objectCount();
  5690. py_retval = Py_BuildValue((char *) "i", retval);
  5691. return py_retval;
  5692. }
  5693. PyObject *
  5694. _wrap_PyTiledObjectGroup_referencesTileset(PyTiledObjectGroup *self, PyObject *args, PyObject *kwargs)
  5695. {
  5696. PyObject *py_retval;
  5697. bool retval;
  5698. PyTiledTileset *ts;
  5699. Tiled::Tileset *ts_ptr;
  5700. const char *keywords[] = {"ts", NULL};
  5701. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledTileset_Type, &ts)) {
  5702. return NULL;
  5703. }
  5704. ts_ptr = (ts ? ts->obj : NULL);
  5705. retval = self->obj->referencesTileset(ts_ptr);
  5706. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  5707. return py_retval;
  5708. }
  5709. PyObject *
  5710. _wrap_PyTiledObjectGroup_removeObject(PyTiledObjectGroup *self, PyObject *args, PyObject *kwargs)
  5711. {
  5712. PyObject *py_retval;
  5713. int retval;
  5714. PyTiledMapObject *object;
  5715. Tiled::MapObject *object_ptr;
  5716. const char *keywords[] = {"object", NULL};
  5717. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledMapObject_Type, &object)) {
  5718. return NULL;
  5719. }
  5720. object_ptr = (object ? object->obj : NULL);
  5721. retval = self->obj->removeObject(object_ptr);
  5722. py_retval = Py_BuildValue((char *) "i", retval);
  5723. return py_retval;
  5724. }
  5725. static PyMethodDef PyTiledObjectGroup_methods[] = {
  5726. {(char *) "addObject", (PyCFunction) _wrap_PyTiledObjectGroup_addObject, METH_KEYWORDS|METH_VARARGS, "addObject(object)\n\ntype: object: MapObject *" },
  5727. {(char *) "insertObject", (PyCFunction) _wrap_PyTiledObjectGroup_insertObject, METH_KEYWORDS|METH_VARARGS, "insertObject(index, object)\n\ntype: index: int\ntype: object: MapObject *" },
  5728. {(char *) "objectAt", (PyCFunction) _wrap_PyTiledObjectGroup_objectAt, METH_KEYWORDS|METH_VARARGS, "objectAt(index)\n\ntype: index: int" },
  5729. {(char *) "objectCount", (PyCFunction) _wrap_PyTiledObjectGroup_objectCount, METH_NOARGS, "objectCount()\n\n" },
  5730. {(char *) "referencesTileset", (PyCFunction) _wrap_PyTiledObjectGroup_referencesTileset, METH_KEYWORDS|METH_VARARGS, "referencesTileset(ts)\n\ntype: ts: Tileset *" },
  5731. {(char *) "removeObject", (PyCFunction) _wrap_PyTiledObjectGroup_removeObject, METH_KEYWORDS|METH_VARARGS, "removeObject(object)\n\ntype: object: MapObject *" },
  5732. {NULL, NULL, 0, NULL}
  5733. };
  5734. static void
  5735. _wrap_PyTiledObjectGroup__tp_dealloc(PyTiledObjectGroup *self)
  5736. {
  5737. Tiled::ObjectGroup *tmp = self->obj;
  5738. self->obj = NULL;
  5739. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  5740. delete tmp;
  5741. }
  5742. Py_TYPE(self)->tp_free((PyObject*)self);
  5743. }
  5744. PyTypeObject PyTiledObjectGroup_Type = {
  5745. PyVarObject_HEAD_INIT(NULL, 0)
  5746. (char *) "tiled.Tiled.ObjectGroup", /* tp_name */
  5747. sizeof(PyTiledObjectGroup), /* tp_basicsize */
  5748. 0, /* tp_itemsize */
  5749. /* methods */
  5750. (destructor)_wrap_PyTiledObjectGroup__tp_dealloc, /* tp_dealloc */
  5751. (printfunc)0, /* tp_print */
  5752. (getattrfunc)NULL, /* tp_getattr */
  5753. (setattrfunc)NULL, /* tp_setattr */
  5754. #if PY_MAJOR_VERSION >= 3
  5755. NULL,
  5756. #else
  5757. (cmpfunc)NULL, /* tp_compare */
  5758. #endif
  5759. (reprfunc)NULL, /* tp_repr */
  5760. (PyNumberMethods*)NULL, /* tp_as_number */
  5761. (PySequenceMethods*)NULL, /* tp_as_sequence */
  5762. (PyMappingMethods*)NULL, /* tp_as_mapping */
  5763. (hashfunc)NULL, /* tp_hash */
  5764. (ternaryfunc)NULL, /* tp_call */
  5765. (reprfunc)NULL, /* tp_str */
  5766. (getattrofunc)NULL, /* tp_getattro */
  5767. (setattrofunc)NULL, /* tp_setattro */
  5768. (PyBufferProcs*)NULL, /* tp_as_buffer */
  5769. Py_TPFLAGS_DEFAULT, /* tp_flags */
  5770. "ObjectGroup(name, x, y)", /* Documentation string */
  5771. (traverseproc)NULL, /* tp_traverse */
  5772. (inquiry)NULL, /* tp_clear */
  5773. (richcmpfunc)NULL, /* tp_richcompare */
  5774. 0, /* tp_weaklistoffset */
  5775. (getiterfunc)NULL, /* tp_iter */
  5776. (iternextfunc)NULL, /* tp_iternext */
  5777. (struct PyMethodDef*)PyTiledObjectGroup_methods, /* tp_methods */
  5778. (struct PyMemberDef*)0, /* tp_members */
  5779. 0, /* tp_getset */
  5780. NULL, /* tp_base */
  5781. NULL, /* tp_dict */
  5782. (descrgetfunc)NULL, /* tp_descr_get */
  5783. (descrsetfunc)NULL, /* tp_descr_set */
  5784. 0, /* tp_dictoffset */
  5785. (initproc)_wrap_PyTiledObjectGroup__tp_init, /* tp_init */
  5786. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  5787. (newfunc)PyType_GenericNew, /* tp_new */
  5788. (freefunc)0, /* tp_free */
  5789. (inquiry)NULL, /* tp_is_gc */
  5790. NULL, /* tp_bases */
  5791. NULL, /* tp_mro */
  5792. NULL, /* tp_cache */
  5793. NULL, /* tp_subclasses */
  5794. NULL, /* tp_weaklist */
  5795. (destructor) NULL /* tp_del */
  5796. };
  5797. static int
  5798. _wrap_PyTiledMapObject__tp_init__0(PyTiledMapObject *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  5799. {
  5800. const char *keywords[] = {NULL};
  5801. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "", (char **) keywords)) {
  5802. {
  5803. PyObject *exc_type, *traceback;
  5804. PyErr_Fetch(&exc_type, return_exception, &traceback);
  5805. Py_XDECREF(exc_type);
  5806. Py_XDECREF(traceback);
  5807. }
  5808. return -1;
  5809. }
  5810. self->obj = new Tiled::MapObject();
  5811. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  5812. return 0;
  5813. }
  5814. static int
  5815. _wrap_PyTiledMapObject__tp_init__1(PyTiledMapObject *self, PyObject *args, PyObject *kwargs, PyObject **return_exception)
  5816. {
  5817. const char *name;
  5818. Py_ssize_t name_len;
  5819. const char *type;
  5820. Py_ssize_t type_len;
  5821. PyQPointF *pos;
  5822. PyQSizeF *size;
  5823. const char *keywords[] = {"name", "type", "pos", "size", NULL};
  5824. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#s#O!O!", (char **) keywords, &name, &name_len, &type, &type_len, &PyQPointF_Type, &pos, &PyQSizeF_Type, &size)) {
  5825. {
  5826. PyObject *exc_type, *traceback;
  5827. PyErr_Fetch(&exc_type, return_exception, &traceback);
  5828. Py_XDECREF(exc_type);
  5829. Py_XDECREF(traceback);
  5830. }
  5831. return -1;
  5832. }
  5833. self->obj = new Tiled::MapObject(QString::fromUtf8(name), QString::fromUtf8(type), *((PyQPointF *) pos)->obj, *((PyQSizeF *) size)->obj);
  5834. self->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  5835. return 0;
  5836. }
  5837. int _wrap_PyTiledMapObject__tp_init(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  5838. {
  5839. int retval;
  5840. PyObject *error_list;
  5841. PyObject *exceptions[2] = {0,};
  5842. retval = _wrap_PyTiledMapObject__tp_init__0(self, args, kwargs, &exceptions[0]);
  5843. if (!exceptions[0]) {
  5844. return retval;
  5845. }
  5846. retval = _wrap_PyTiledMapObject__tp_init__1(self, args, kwargs, &exceptions[1]);
  5847. if (!exceptions[1]) {
  5848. Py_DECREF(exceptions[0]);
  5849. return retval;
  5850. }
  5851. error_list = PyList_New(2);
  5852. PyList_SET_ITEM(error_list, 0, PyObject_Str(exceptions[0]));
  5853. Py_DECREF(exceptions[0]);
  5854. PyList_SET_ITEM(error_list, 1, PyObject_Str(exceptions[1]));
  5855. Py_DECREF(exceptions[1]);
  5856. PyErr_SetObject(PyExc_TypeError, error_list);
  5857. Py_DECREF(error_list);
  5858. return -1;
  5859. }
  5860. PyObject *
  5861. _wrap_PyTiledMapObject_cell(PyTiledMapObject *self)
  5862. {
  5863. PyObject *py_retval;
  5864. PyTiledCell *py_Cell;
  5865. Tiled::Cell const retval = self->obj->cell();
  5866. py_Cell = PyObject_New(PyTiledCell, &PyTiledCell_Type);
  5867. py_Cell->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  5868. py_Cell->obj = new Tiled::Cell(retval);
  5869. py_retval = Py_BuildValue((char *) "N", py_Cell);
  5870. return py_retval;
  5871. }
  5872. PyObject *
  5873. _wrap_PyTiledMapObject_effectiveType(PyTiledMapObject *self)
  5874. {
  5875. PyObject *py_retval;
  5876. QString retval;
  5877. retval = self->obj->effectiveType();
  5878. py_retval = Py_BuildValue((char *) "s", retval.toUtf8().data());
  5879. return py_retval;
  5880. }
  5881. PyObject *
  5882. _wrap_PyTiledMapObject_height(PyTiledMapObject *self)
  5883. {
  5884. PyObject *py_retval;
  5885. double retval;
  5886. retval = self->obj->height();
  5887. py_retval = Py_BuildValue((char *) "d", retval);
  5888. return py_retval;
  5889. }
  5890. PyObject *
  5891. _wrap_PyTiledMapObject_isVisible(PyTiledMapObject *self)
  5892. {
  5893. PyObject *py_retval;
  5894. bool retval;
  5895. retval = self->obj->isVisible();
  5896. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  5897. return py_retval;
  5898. }
  5899. PyObject *
  5900. _wrap_PyTiledMapObject_name(PyTiledMapObject *self)
  5901. {
  5902. PyObject *py_retval;
  5903. QString retval;
  5904. retval = self->obj->name();
  5905. py_retval = Py_BuildValue((char *) "s", retval.toUtf8().data());
  5906. return py_retval;
  5907. }
  5908. PyObject *
  5909. _wrap_PyTiledMapObject_objectGroup(PyTiledMapObject *self)
  5910. {
  5911. PyObject *py_retval;
  5912. Tiled::ObjectGroup *retval;
  5913. PyTiledObjectGroup *py_ObjectGroup;
  5914. retval = self->obj->objectGroup();
  5915. if (!(retval)) {
  5916. Py_INCREF(Py_None);
  5917. return Py_None;
  5918. }
  5919. py_ObjectGroup = PyObject_New(PyTiledObjectGroup, &PyTiledObjectGroup_Type);
  5920. py_ObjectGroup->obj = retval;
  5921. py_ObjectGroup->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  5922. py_retval = Py_BuildValue((char *) "N", py_ObjectGroup);
  5923. return py_retval;
  5924. }
  5925. PyObject *
  5926. _wrap_PyTiledMapObject_rotation(PyTiledMapObject *self)
  5927. {
  5928. PyObject *py_retval;
  5929. double retval;
  5930. retval = self->obj->rotation();
  5931. py_retval = Py_BuildValue((char *) "d", retval);
  5932. return py_retval;
  5933. }
  5934. PyObject *
  5935. _wrap_PyTiledMapObject_setCell(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  5936. {
  5937. PyObject *py_retval;
  5938. PyTiledCell *c;
  5939. const char *keywords[] = {"c", NULL};
  5940. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyTiledCell_Type, &c)) {
  5941. return NULL;
  5942. }
  5943. self->obj->setCell(*((PyTiledCell *) c)->obj);
  5944. Py_INCREF(Py_None);
  5945. py_retval = Py_None;
  5946. return py_retval;
  5947. }
  5948. PyObject *
  5949. _wrap_PyTiledMapObject_setHeight(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  5950. {
  5951. PyObject *py_retval;
  5952. double h;
  5953. const char *keywords[] = {"h", NULL};
  5954. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "d", (char **) keywords, &h)) {
  5955. return NULL;
  5956. }
  5957. self->obj->setHeight(h);
  5958. Py_INCREF(Py_None);
  5959. py_retval = Py_None;
  5960. return py_retval;
  5961. }
  5962. PyObject *
  5963. _wrap_PyTiledMapObject_setName(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  5964. {
  5965. PyObject *py_retval;
  5966. const char *n;
  5967. Py_ssize_t n_len;
  5968. const char *keywords[] = {"n", NULL};
  5969. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#", (char **) keywords, &n, &n_len)) {
  5970. return NULL;
  5971. }
  5972. self->obj->setName(QString::fromUtf8(n));
  5973. Py_INCREF(Py_None);
  5974. py_retval = Py_None;
  5975. return py_retval;
  5976. }
  5977. PyObject *
  5978. _wrap_PyTiledMapObject_setPosition(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  5979. {
  5980. PyObject *py_retval;
  5981. PyQPointF *pos;
  5982. const char *keywords[] = {"pos", NULL};
  5983. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQPointF_Type, &pos)) {
  5984. return NULL;
  5985. }
  5986. self->obj->setPosition(*((PyQPointF *) pos)->obj);
  5987. Py_INCREF(Py_None);
  5988. py_retval = Py_None;
  5989. return py_retval;
  5990. }
  5991. PyObject *
  5992. _wrap_PyTiledMapObject_setRotation(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  5993. {
  5994. PyObject *py_retval;
  5995. double r;
  5996. const char *keywords[] = {"r", NULL};
  5997. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "d", (char **) keywords, &r)) {
  5998. return NULL;
  5999. }
  6000. self->obj->setRotation(r);
  6001. Py_INCREF(Py_None);
  6002. py_retval = Py_None;
  6003. return py_retval;
  6004. }
  6005. PyObject *
  6006. _wrap_PyTiledMapObject_setShape(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  6007. {
  6008. PyObject *py_retval;
  6009. Tiled::MapObject::Shape s;
  6010. const char *keywords[] = {"s", NULL};
  6011. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "i", (char **) keywords, &s)) {
  6012. return NULL;
  6013. }
  6014. self->obj->setShape(s);
  6015. Py_INCREF(Py_None);
  6016. py_retval = Py_None;
  6017. return py_retval;
  6018. }
  6019. PyObject *
  6020. _wrap_PyTiledMapObject_setSize(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  6021. {
  6022. PyObject *py_retval;
  6023. PyQSizeF *size;
  6024. const char *keywords[] = {"size", NULL};
  6025. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!", (char **) keywords, &PyQSizeF_Type, &size)) {
  6026. return NULL;
  6027. }
  6028. self->obj->setSize(*((PyQSizeF *) size)->obj);
  6029. Py_INCREF(Py_None);
  6030. py_retval = Py_None;
  6031. return py_retval;
  6032. }
  6033. PyObject *
  6034. _wrap_PyTiledMapObject_setType(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  6035. {
  6036. PyObject *py_retval;
  6037. const char *n;
  6038. Py_ssize_t n_len;
  6039. const char *keywords[] = {"n", NULL};
  6040. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#", (char **) keywords, &n, &n_len)) {
  6041. return NULL;
  6042. }
  6043. self->obj->setType(QString::fromUtf8(n));
  6044. Py_INCREF(Py_None);
  6045. py_retval = Py_None;
  6046. return py_retval;
  6047. }
  6048. PyObject *
  6049. _wrap_PyTiledMapObject_setVisible(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  6050. {
  6051. PyObject *py_retval;
  6052. bool v;
  6053. PyObject *py_v;
  6054. const char *keywords[] = {"v", NULL};
  6055. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O", (char **) keywords, &py_v)) {
  6056. return NULL;
  6057. }
  6058. v = (bool) PyObject_IsTrue(py_v);
  6059. self->obj->setVisible(v);
  6060. Py_INCREF(Py_None);
  6061. py_retval = Py_None;
  6062. return py_retval;
  6063. }
  6064. PyObject *
  6065. _wrap_PyTiledMapObject_setWidth(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  6066. {
  6067. PyObject *py_retval;
  6068. double w;
  6069. const char *keywords[] = {"w", NULL};
  6070. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "d", (char **) keywords, &w)) {
  6071. return NULL;
  6072. }
  6073. self->obj->setWidth(w);
  6074. Py_INCREF(Py_None);
  6075. py_retval = Py_None;
  6076. return py_retval;
  6077. }
  6078. PyObject *
  6079. _wrap_PyTiledMapObject_setX(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  6080. {
  6081. PyObject *py_retval;
  6082. double x;
  6083. const char *keywords[] = {"x", NULL};
  6084. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "d", (char **) keywords, &x)) {
  6085. return NULL;
  6086. }
  6087. self->obj->setX(x);
  6088. Py_INCREF(Py_None);
  6089. py_retval = Py_None;
  6090. return py_retval;
  6091. }
  6092. PyObject *
  6093. _wrap_PyTiledMapObject_setY(PyTiledMapObject *self, PyObject *args, PyObject *kwargs)
  6094. {
  6095. PyObject *py_retval;
  6096. double y;
  6097. const char *keywords[] = {"y", NULL};
  6098. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "d", (char **) keywords, &y)) {
  6099. return NULL;
  6100. }
  6101. self->obj->setY(y);
  6102. Py_INCREF(Py_None);
  6103. py_retval = Py_None;
  6104. return py_retval;
  6105. }
  6106. PyObject *
  6107. _wrap_PyTiledMapObject_shape(PyTiledMapObject *self)
  6108. {
  6109. PyObject *py_retval;
  6110. Tiled::MapObject::Shape retval;
  6111. retval = self->obj->shape();
  6112. py_retval = Py_BuildValue((char *) "i", retval);
  6113. return py_retval;
  6114. }
  6115. PyObject *
  6116. _wrap_PyTiledMapObject_type(PyTiledMapObject *self)
  6117. {
  6118. PyObject *py_retval;
  6119. QString retval;
  6120. retval = self->obj->type();
  6121. py_retval = Py_BuildValue((char *) "s", retval.toUtf8().data());
  6122. return py_retval;
  6123. }
  6124. PyObject *
  6125. _wrap_PyTiledMapObject_width(PyTiledMapObject *self)
  6126. {
  6127. PyObject *py_retval;
  6128. double retval;
  6129. retval = self->obj->width();
  6130. py_retval = Py_BuildValue((char *) "d", retval);
  6131. return py_retval;
  6132. }
  6133. PyObject *
  6134. _wrap_PyTiledMapObject_x(PyTiledMapObject *self)
  6135. {
  6136. PyObject *py_retval;
  6137. double retval;
  6138. retval = self->obj->x();
  6139. py_retval = Py_BuildValue((char *) "d", retval);
  6140. return py_retval;
  6141. }
  6142. PyObject *
  6143. _wrap_PyTiledMapObject_y(PyTiledMapObject *self)
  6144. {
  6145. PyObject *py_retval;
  6146. double retval;
  6147. retval = self->obj->y();
  6148. py_retval = Py_BuildValue((char *) "d", retval);
  6149. return py_retval;
  6150. }
  6151. static PyMethodDef PyTiledMapObject_methods[] = {
  6152. {(char *) "cell", (PyCFunction) _wrap_PyTiledMapObject_cell, METH_NOARGS, "cell()\n\n" },
  6153. {(char *) "effectiveType", (PyCFunction) _wrap_PyTiledMapObject_effectiveType, METH_NOARGS, "effectiveType()\n\n" },
  6154. {(char *) "height", (PyCFunction) _wrap_PyTiledMapObject_height, METH_NOARGS, "height()\n\n" },
  6155. {(char *) "isVisible", (PyCFunction) _wrap_PyTiledMapObject_isVisible, METH_NOARGS, "isVisible()\n\n" },
  6156. {(char *) "name", (PyCFunction) _wrap_PyTiledMapObject_name, METH_NOARGS, "name()\n\n" },
  6157. {(char *) "objectGroup", (PyCFunction) _wrap_PyTiledMapObject_objectGroup, METH_NOARGS, "objectGroup()\n\n" },
  6158. {(char *) "rotation", (PyCFunction) _wrap_PyTiledMapObject_rotation, METH_NOARGS, "rotation()\n\n" },
  6159. {(char *) "setCell", (PyCFunction) _wrap_PyTiledMapObject_setCell, METH_KEYWORDS|METH_VARARGS, "setCell(c)\n\ntype: c: Tiled::Cell const" },
  6160. {(char *) "setHeight", (PyCFunction) _wrap_PyTiledMapObject_setHeight, METH_KEYWORDS|METH_VARARGS, "setHeight(h)\n\ntype: h: double" },
  6161. {(char *) "setName", (PyCFunction) _wrap_PyTiledMapObject_setName, METH_KEYWORDS|METH_VARARGS, "setName(n)\n\ntype: n: QString" },
  6162. {(char *) "setPosition", (PyCFunction) _wrap_PyTiledMapObject_setPosition, METH_KEYWORDS|METH_VARARGS, "setPosition(pos)\n\ntype: pos: QPointF" },
  6163. {(char *) "setRotation", (PyCFunction) _wrap_PyTiledMapObject_setRotation, METH_KEYWORDS|METH_VARARGS, "setRotation(r)\n\ntype: r: double" },
  6164. {(char *) "setShape", (PyCFunction) _wrap_PyTiledMapObject_setShape, METH_KEYWORDS|METH_VARARGS, "setShape(s)\n\ntype: s: Tiled::MapObject::Shape" },
  6165. {(char *) "setSize", (PyCFunction) _wrap_PyTiledMapObject_setSize, METH_KEYWORDS|METH_VARARGS, "setSize(size)\n\ntype: size: QSizeF" },
  6166. {(char *) "setType", (PyCFunction) _wrap_PyTiledMapObject_setType, METH_KEYWORDS|METH_VARARGS, "setType(n)\n\ntype: n: QString" },
  6167. {(char *) "setVisible", (PyCFunction) _wrap_PyTiledMapObject_setVisible, METH_KEYWORDS|METH_VARARGS, "setVisible(v)\n\ntype: v: bool" },
  6168. {(char *) "setWidth", (PyCFunction) _wrap_PyTiledMapObject_setWidth, METH_KEYWORDS|METH_VARARGS, "setWidth(w)\n\ntype: w: double" },
  6169. {(char *) "setX", (PyCFunction) _wrap_PyTiledMapObject_setX, METH_KEYWORDS|METH_VARARGS, "setX(x)\n\ntype: x: double" },
  6170. {(char *) "setY", (PyCFunction) _wrap_PyTiledMapObject_setY, METH_KEYWORDS|METH_VARARGS, "setY(y)\n\ntype: y: double" },
  6171. {(char *) "shape", (PyCFunction) _wrap_PyTiledMapObject_shape, METH_NOARGS, "shape()\n\n" },
  6172. {(char *) "type", (PyCFunction) _wrap_PyTiledMapObject_type, METH_NOARGS, "type()\n\n" },
  6173. {(char *) "width", (PyCFunction) _wrap_PyTiledMapObject_width, METH_NOARGS, "width()\n\n" },
  6174. {(char *) "x", (PyCFunction) _wrap_PyTiledMapObject_x, METH_NOARGS, "x()\n\n" },
  6175. {(char *) "y", (PyCFunction) _wrap_PyTiledMapObject_y, METH_NOARGS, "y()\n\n" },
  6176. {NULL, NULL, 0, NULL}
  6177. };
  6178. static void
  6179. _wrap_PyTiledMapObject__tp_dealloc(PyTiledMapObject *self)
  6180. {
  6181. Tiled::MapObject *tmp = self->obj;
  6182. self->obj = NULL;
  6183. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  6184. delete tmp;
  6185. }
  6186. Py_TYPE(self)->tp_free((PyObject*)self);
  6187. }
  6188. PyTypeObject PyTiledMapObject_Type = {
  6189. PyVarObject_HEAD_INIT(NULL, 0)
  6190. (char *) "tiled.Tiled.MapObject", /* tp_name */
  6191. sizeof(PyTiledMapObject), /* tp_basicsize */
  6192. 0, /* tp_itemsize */
  6193. /* methods */
  6194. (destructor)_wrap_PyTiledMapObject__tp_dealloc, /* tp_dealloc */
  6195. (printfunc)0, /* tp_print */
  6196. (getattrfunc)NULL, /* tp_getattr */
  6197. (setattrfunc)NULL, /* tp_setattr */
  6198. #if PY_MAJOR_VERSION >= 3
  6199. NULL,
  6200. #else
  6201. (cmpfunc)NULL, /* tp_compare */
  6202. #endif
  6203. (reprfunc)NULL, /* tp_repr */
  6204. (PyNumberMethods*)NULL, /* tp_as_number */
  6205. (PySequenceMethods*)NULL, /* tp_as_sequence */
  6206. (PyMappingMethods*)NULL, /* tp_as_mapping */
  6207. (hashfunc)NULL, /* tp_hash */
  6208. (ternaryfunc)NULL, /* tp_call */
  6209. (reprfunc)NULL, /* tp_str */
  6210. (getattrofunc)NULL, /* tp_getattro */
  6211. (setattrofunc)NULL, /* tp_setattro */
  6212. (PyBufferProcs*)NULL, /* tp_as_buffer */
  6213. Py_TPFLAGS_DEFAULT, /* tp_flags */
  6214. "MapObject(name, type, pos, size)\nMapObject()", /* Documentation string */
  6215. (traverseproc)NULL, /* tp_traverse */
  6216. (inquiry)NULL, /* tp_clear */
  6217. (richcmpfunc)NULL, /* tp_richcompare */
  6218. 0, /* tp_weaklistoffset */
  6219. (getiterfunc)NULL, /* tp_iter */
  6220. (iternextfunc)NULL, /* tp_iternext */
  6221. (struct PyMethodDef*)PyTiledMapObject_methods, /* tp_methods */
  6222. (struct PyMemberDef*)0, /* tp_members */
  6223. 0, /* tp_getset */
  6224. NULL, /* tp_base */
  6225. NULL, /* tp_dict */
  6226. (descrgetfunc)NULL, /* tp_descr_get */
  6227. (descrsetfunc)NULL, /* tp_descr_set */
  6228. 0, /* tp_dictoffset */
  6229. (initproc)_wrap_PyTiledMapObject__tp_init, /* tp_init */
  6230. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  6231. (newfunc)PyType_GenericNew, /* tp_new */
  6232. (freefunc)0, /* tp_free */
  6233. (inquiry)NULL, /* tp_is_gc */
  6234. NULL, /* tp_bases */
  6235. NULL, /* tp_mro */
  6236. NULL, /* tp_cache */
  6237. NULL, /* tp_subclasses */
  6238. NULL, /* tp_weaklist */
  6239. (destructor) NULL /* tp_del */
  6240. };
  6241. static int
  6242. _wrap_PyTiledLoggingInterface__tp_init(void)
  6243. {
  6244. PyErr_SetString(PyExc_TypeError, "class 'LoggingInterface' cannot be constructed ()");
  6245. return -1;
  6246. }
  6247. PyObject *
  6248. _wrap_PyTiledLoggingInterface_log(PyTiledLoggingInterface *self, PyObject *args, PyObject *kwargs)
  6249. {
  6250. PyObject *py_retval;
  6251. Tiled::LoggingInterface::OutputType type;
  6252. const char *msg;
  6253. Py_ssize_t msg_len;
  6254. const char *keywords[] = {"type", "msg", NULL};
  6255. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "is#", (char **) keywords, &type, &msg, &msg_len)) {
  6256. return NULL;
  6257. }
  6258. self->obj->log(type, QString::fromUtf8(msg));
  6259. Py_INCREF(Py_None);
  6260. py_retval = Py_None;
  6261. return py_retval;
  6262. }
  6263. static PyMethodDef PyTiledLoggingInterface_methods[] = {
  6264. {(char *) "log", (PyCFunction) _wrap_PyTiledLoggingInterface_log, METH_KEYWORDS|METH_VARARGS, "log(type, msg)\n\ntype: type: Tiled::LoggingInterface::OutputType\ntype: msg: QString const" },
  6265. {NULL, NULL, 0, NULL}
  6266. };
  6267. static void
  6268. _wrap_PyTiledLoggingInterface__tp_dealloc(PyTiledLoggingInterface *self)
  6269. {
  6270. self->obj = NULL;
  6271. Py_TYPE(self)->tp_free((PyObject*)self);
  6272. }
  6273. PyTypeObject PyTiledLoggingInterface_Type = {
  6274. PyVarObject_HEAD_INIT(NULL, 0)
  6275. (char *) "tiled.Tiled.LoggingInterface", /* tp_name */
  6276. sizeof(PyTiledLoggingInterface), /* tp_basicsize */
  6277. 0, /* tp_itemsize */
  6278. /* methods */
  6279. (destructor)_wrap_PyTiledLoggingInterface__tp_dealloc, /* tp_dealloc */
  6280. (printfunc)0, /* tp_print */
  6281. (getattrfunc)NULL, /* tp_getattr */
  6282. (setattrfunc)NULL, /* tp_setattr */
  6283. #if PY_MAJOR_VERSION >= 3
  6284. NULL,
  6285. #else
  6286. (cmpfunc)NULL, /* tp_compare */
  6287. #endif
  6288. (reprfunc)NULL, /* tp_repr */
  6289. (PyNumberMethods*)NULL, /* tp_as_number */
  6290. (PySequenceMethods*)NULL, /* tp_as_sequence */
  6291. (PyMappingMethods*)NULL, /* tp_as_mapping */
  6292. (hashfunc)NULL, /* tp_hash */
  6293. (ternaryfunc)NULL, /* tp_call */
  6294. (reprfunc)NULL, /* tp_str */
  6295. (getattrofunc)NULL, /* tp_getattro */
  6296. (setattrofunc)NULL, /* tp_setattro */
  6297. (PyBufferProcs*)NULL, /* tp_as_buffer */
  6298. Py_TPFLAGS_DEFAULT, /* tp_flags */
  6299. "", /* Documentation string */
  6300. (traverseproc)NULL, /* tp_traverse */
  6301. (inquiry)NULL, /* tp_clear */
  6302. (richcmpfunc)NULL, /* tp_richcompare */
  6303. 0, /* tp_weaklistoffset */
  6304. (getiterfunc)NULL, /* tp_iter */
  6305. (iternextfunc)NULL, /* tp_iternext */
  6306. (struct PyMethodDef*)PyTiledLoggingInterface_methods, /* tp_methods */
  6307. (struct PyMemberDef*)0, /* tp_members */
  6308. 0, /* tp_getset */
  6309. NULL, /* tp_base */
  6310. NULL, /* tp_dict */
  6311. (descrgetfunc)NULL, /* tp_descr_get */
  6312. (descrsetfunc)NULL, /* tp_descr_set */
  6313. 0, /* tp_dictoffset */
  6314. (initproc)_wrap_PyTiledLoggingInterface__tp_init, /* tp_init */
  6315. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  6316. (newfunc)PyType_GenericNew, /* tp_new */
  6317. (freefunc)0, /* tp_free */
  6318. (inquiry)NULL, /* tp_is_gc */
  6319. NULL, /* tp_bases */
  6320. NULL, /* tp_mro */
  6321. NULL, /* tp_cache */
  6322. NULL, /* tp_subclasses */
  6323. NULL, /* tp_weaklist */
  6324. (destructor) NULL /* tp_del */
  6325. };
  6326. /* --- enumerations --- */
  6327. #if PY_VERSION_HEX >= 0x03000000
  6328. static struct PyModuleDef tiled_Tiled_moduledef = {
  6329. PyModuleDef_HEAD_INIT,
  6330. "tiled.Tiled",
  6331. NULL,
  6332. -1,
  6333. tiled_Tiled_functions,
  6334. };
  6335. #endif
  6336. static PyObject *
  6337. inittiled_Tiled(void)
  6338. {
  6339. PyObject *m;
  6340. #if PY_VERSION_HEX >= 0x03000000
  6341. m = PyModule_Create(&tiled_Tiled_moduledef);
  6342. #else
  6343. m = Py_InitModule3((char *) "tiled.Tiled", tiled_Tiled_functions, NULL);
  6344. #endif
  6345. if (m == NULL) {
  6346. return NULL;
  6347. }
  6348. /* Register the 'Tiled::Properties' class */
  6349. if (PyType_Ready(&PyTiledProperties_Type)) {
  6350. return NULL;
  6351. }
  6352. PyModule_AddObject(m, (char *) "Properties", (PyObject *) &PyTiledProperties_Type);
  6353. /* Register the 'Tiled::Object' class */
  6354. if (PyType_Ready(&PyTiledObject_Type)) {
  6355. return NULL;
  6356. }
  6357. PyModule_AddObject(m, (char *) "Object", (PyObject *) &PyTiledObject_Type);
  6358. /* Register the 'Tiled::Tile' class */
  6359. PyTiledTile_Type.tp_base = &PyTiledObject_Type;
  6360. if (PyType_Ready(&PyTiledTile_Type)) {
  6361. return NULL;
  6362. }
  6363. PyModule_AddObject(m, (char *) "Tile", (PyObject *) &PyTiledTile_Type);
  6364. /* Register the 'Tiled::Tileset' class */
  6365. PyTiledTileset_Type.tp_base = &PyTiledObject_Type;
  6366. if (PyType_Ready(&PyTiledTileset_Type)) {
  6367. return NULL;
  6368. }
  6369. PyModule_AddObject(m, (char *) "Tileset", (PyObject *) &PyTiledTileset_Type);
  6370. /* Register the 'Tiled::SharedTileset' class */
  6371. if (PyType_Ready(&PyTiledSharedTileset_Type)) {
  6372. return NULL;
  6373. }
  6374. PyModule_AddObject(m, (char *) "SharedTileset", (PyObject *) &PyTiledSharedTileset_Type);
  6375. /* Register the 'Tiled::Layer' class */
  6376. PyTiledLayer_Type.tp_base = &PyTiledObject_Type;
  6377. if (PyType_Ready(&PyTiledLayer_Type)) {
  6378. return NULL;
  6379. }
  6380. PyModule_AddObject(m, (char *) "Layer", (PyObject *) &PyTiledLayer_Type);
  6381. /* Register the 'Tiled::Map' class */
  6382. PyTiledMap_Type.tp_base = &PyTiledObject_Type;
  6383. if (PyType_Ready(&PyTiledMap_Type)) {
  6384. return NULL;
  6385. }
  6386. PyModule_AddObject(m, (char *) "Map", (PyObject *) &PyTiledMap_Type);
  6387. /* Register the 'Tiled::Cell' class */
  6388. if (PyType_Ready(&PyTiledCell_Type)) {
  6389. return NULL;
  6390. }
  6391. PyModule_AddObject(m, (char *) "Cell", (PyObject *) &PyTiledCell_Type);
  6392. /* Register the 'Tiled::TileLayer' class */
  6393. PyTiledTileLayer_Type.tp_base = &PyTiledLayer_Type;
  6394. if (PyType_Ready(&PyTiledTileLayer_Type)) {
  6395. return NULL;
  6396. }
  6397. PyModule_AddObject(m, (char *) "TileLayer", (PyObject *) &PyTiledTileLayer_Type);
  6398. /* Register the 'Tiled::ImageLayer' class */
  6399. PyTiledImageLayer_Type.tp_base = &PyTiledLayer_Type;
  6400. if (PyType_Ready(&PyTiledImageLayer_Type)) {
  6401. return NULL;
  6402. }
  6403. PyModule_AddObject(m, (char *) "ImageLayer", (PyObject *) &PyTiledImageLayer_Type);
  6404. /* Register the 'Tiled::GroupLayer' class */
  6405. PyTiledGroupLayer_Type.tp_base = &PyTiledLayer_Type;
  6406. if (PyType_Ready(&PyTiledGroupLayer_Type)) {
  6407. return NULL;
  6408. }
  6409. PyModule_AddObject(m, (char *) "GroupLayer", (PyObject *) &PyTiledGroupLayer_Type);
  6410. /* Register the 'Tiled::ObjectGroup' class */
  6411. PyTiledObjectGroup_Type.tp_base = &PyTiledLayer_Type;
  6412. if (PyType_Ready(&PyTiledObjectGroup_Type)) {
  6413. return NULL;
  6414. }
  6415. PyModule_AddObject(m, (char *) "ObjectGroup", (PyObject *) &PyTiledObjectGroup_Type);
  6416. /* Register the 'Tiled::MapObject' class */
  6417. PyTiledMapObject_Type.tp_base = &PyTiledObject_Type;
  6418. if (PyType_Ready(&PyTiledMapObject_Type)) {
  6419. return NULL;
  6420. }
  6421. PyModule_AddObject(m, (char *) "MapObject", (PyObject *) &PyTiledMapObject_Type);
  6422. /* Register the 'Tiled::LoggingInterface' class */
  6423. if (PyType_Ready(&PyTiledLoggingInterface_Type)) {
  6424. return NULL;
  6425. }
  6426. PyModule_AddObject(m, (char *) "LoggingInterface", (PyObject *) &PyTiledLoggingInterface_Type);
  6427. {
  6428. PyObject *tmp_value;
  6429. // Tiled::Map::Unknown
  6430. tmp_value = PyLong_FromLong(Tiled::Map::Unknown);
  6431. PyDict_SetItemString((PyObject*) PyTiledMap_Type.tp_dict, "Unknown", tmp_value);
  6432. Py_DECREF(tmp_value);
  6433. // Tiled::Map::Orthogonal
  6434. tmp_value = PyLong_FromLong(Tiled::Map::Orthogonal);
  6435. PyDict_SetItemString((PyObject*) PyTiledMap_Type.tp_dict, "Orthogonal", tmp_value);
  6436. Py_DECREF(tmp_value);
  6437. // Tiled::Map::Isometric
  6438. tmp_value = PyLong_FromLong(Tiled::Map::Isometric);
  6439. PyDict_SetItemString((PyObject*) PyTiledMap_Type.tp_dict, "Isometric", tmp_value);
  6440. Py_DECREF(tmp_value);
  6441. // Tiled::Map::Staggered
  6442. tmp_value = PyLong_FromLong(Tiled::Map::Staggered);
  6443. PyDict_SetItemString((PyObject*) PyTiledMap_Type.tp_dict, "Staggered", tmp_value);
  6444. Py_DECREF(tmp_value);
  6445. // Tiled::Map::Hexagonal
  6446. tmp_value = PyLong_FromLong(Tiled::Map::Hexagonal);
  6447. PyDict_SetItemString((PyObject*) PyTiledMap_Type.tp_dict, "Hexagonal", tmp_value);
  6448. Py_DECREF(tmp_value);
  6449. }
  6450. {
  6451. PyObject *tmp_value;
  6452. // Tiled::Map::XML
  6453. tmp_value = PyLong_FromLong(Tiled::Map::XML);
  6454. PyDict_SetItemString((PyObject*) PyTiledMap_Type.tp_dict, "XML", tmp_value);
  6455. Py_DECREF(tmp_value);
  6456. // Tiled::Map::Base64
  6457. tmp_value = PyLong_FromLong(Tiled::Map::Base64);
  6458. PyDict_SetItemString((PyObject*) PyTiledMap_Type.tp_dict, "Base64", tmp_value);
  6459. Py_DECREF(tmp_value);
  6460. // Tiled::Map::Base64Gzip
  6461. tmp_value = PyLong_FromLong(Tiled::Map::Base64Gzip);
  6462. PyDict_SetItemString((PyObject*) PyTiledMap_Type.tp_dict, "Base64Gzip", tmp_value);
  6463. Py_DECREF(tmp_value);
  6464. // Tiled::Map::Base64Zlib
  6465. tmp_value = PyLong_FromLong(Tiled::Map::Base64Zlib);
  6466. PyDict_SetItemString((PyObject*) PyTiledMap_Type.tp_dict, "Base64Zlib", tmp_value);
  6467. Py_DECREF(tmp_value);
  6468. // Tiled::Map::CSV
  6469. tmp_value = PyLong_FromLong(Tiled::Map::CSV);
  6470. PyDict_SetItemString((PyObject*) PyTiledMap_Type.tp_dict, "CSV", tmp_value);
  6471. Py_DECREF(tmp_value);
  6472. }
  6473. {
  6474. PyObject *tmp_value;
  6475. // Tiled::Map::RightDown
  6476. tmp_value = PyLong_FromLong(Tiled::Map::RightDown);
  6477. PyDict_SetItemString((PyObject*) PyTiledMap_Type.tp_dict, "RightDown", tmp_value);
  6478. Py_DECREF(tmp_value);
  6479. // Tiled::Map::RightUp
  6480. tmp_value = PyLong_FromLong(Tiled::Map::RightUp);
  6481. PyDict_SetItemString((PyObject*) PyTiledMap_Type.tp_dict, "RightUp", tmp_value);
  6482. Py_DECREF(tmp_value);
  6483. // Tiled::Map::LeftDown
  6484. tmp_value = PyLong_FromLong(Tiled::Map::LeftDown);
  6485. PyDict_SetItemString((PyObject*) PyTiledMap_Type.tp_dict, "LeftDown", tmp_value);
  6486. Py_DECREF(tmp_value);
  6487. // Tiled::Map::LeftUp
  6488. tmp_value = PyLong_FromLong(Tiled::Map::LeftUp);
  6489. PyDict_SetItemString((PyObject*) PyTiledMap_Type.tp_dict, "LeftUp", tmp_value);
  6490. Py_DECREF(tmp_value);
  6491. }
  6492. {
  6493. PyObject *tmp_value;
  6494. // Tiled::Map::StaggerX
  6495. tmp_value = PyLong_FromLong(Tiled::Map::StaggerX);
  6496. PyDict_SetItemString((PyObject*) PyTiledMap_Type.tp_dict, "StaggerX", tmp_value);
  6497. Py_DECREF(tmp_value);
  6498. // Tiled::Map::StaggerY
  6499. tmp_value = PyLong_FromLong(Tiled::Map::StaggerY);
  6500. PyDict_SetItemString((PyObject*) PyTiledMap_Type.tp_dict, "StaggerY", tmp_value);
  6501. Py_DECREF(tmp_value);
  6502. }
  6503. {
  6504. PyObject *tmp_value;
  6505. // Tiled::Map::StaggerOdd
  6506. tmp_value = PyLong_FromLong(Tiled::Map::StaggerOdd);
  6507. PyDict_SetItemString((PyObject*) PyTiledMap_Type.tp_dict, "StaggerOdd", tmp_value);
  6508. Py_DECREF(tmp_value);
  6509. // Tiled::Map::StaggerEven
  6510. tmp_value = PyLong_FromLong(Tiled::Map::StaggerEven);
  6511. PyDict_SetItemString((PyObject*) PyTiledMap_Type.tp_dict, "StaggerEven", tmp_value);
  6512. Py_DECREF(tmp_value);
  6513. }
  6514. {
  6515. PyObject *tmp_value;
  6516. // Tiled::MapObject::Rectangle
  6517. tmp_value = PyLong_FromLong(Tiled::MapObject::Rectangle);
  6518. PyDict_SetItemString((PyObject*) PyTiledMapObject_Type.tp_dict, "Rectangle", tmp_value);
  6519. Py_DECREF(tmp_value);
  6520. // Tiled::MapObject::Polygon
  6521. tmp_value = PyLong_FromLong(Tiled::MapObject::Polygon);
  6522. PyDict_SetItemString((PyObject*) PyTiledMapObject_Type.tp_dict, "Polygon", tmp_value);
  6523. Py_DECREF(tmp_value);
  6524. // Tiled::MapObject::Polyline
  6525. tmp_value = PyLong_FromLong(Tiled::MapObject::Polyline);
  6526. PyDict_SetItemString((PyObject*) PyTiledMapObject_Type.tp_dict, "Polyline", tmp_value);
  6527. Py_DECREF(tmp_value);
  6528. }
  6529. {
  6530. PyObject *tmp_value;
  6531. // Tiled::LoggingInterface::INFO
  6532. tmp_value = PyLong_FromLong(Tiled::LoggingInterface::INFO);
  6533. PyDict_SetItemString((PyObject*) PyTiledLoggingInterface_Type.tp_dict, "INFO", tmp_value);
  6534. Py_DECREF(tmp_value);
  6535. // Tiled::LoggingInterface::WARNING
  6536. tmp_value = PyLong_FromLong(Tiled::LoggingInterface::WARNING);
  6537. PyDict_SetItemString((PyObject*) PyTiledLoggingInterface_Type.tp_dict, "WARNING", tmp_value);
  6538. Py_DECREF(tmp_value);
  6539. // Tiled::LoggingInterface::ERROR
  6540. tmp_value = PyLong_FromLong(Tiled::LoggingInterface::ERROR);
  6541. PyDict_SetItemString((PyObject*) PyTiledLoggingInterface_Type.tp_dict, "ERROR", tmp_value);
  6542. Py_DECREF(tmp_value);
  6543. }
  6544. return m;
  6545. }
  6546. /* --- module functions --- */
  6547. PyObject *
  6548. _wrap_tiled_imageLayerAt(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs)
  6549. {
  6550. PyObject *py_retval;
  6551. Tiled::ImageLayer *retval;
  6552. PyTiledMap *map;
  6553. Tiled::Map *map_ptr;
  6554. int index;
  6555. const char *keywords[] = {"map", "index", NULL};
  6556. PyTiledImageLayer *py_ImageLayer;
  6557. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!i", (char **) keywords, &PyTiledMap_Type, &map, &index)) {
  6558. return NULL;
  6559. }
  6560. map_ptr = (map ? map->obj : NULL);
  6561. retval = imageLayerAt(map_ptr, index);
  6562. if (!(retval)) {
  6563. Py_INCREF(Py_None);
  6564. return Py_None;
  6565. }
  6566. py_ImageLayer = PyObject_New(PyTiledImageLayer, &PyTiledImageLayer_Type);
  6567. py_ImageLayer->obj = retval;
  6568. py_ImageLayer->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  6569. py_retval = Py_BuildValue((char *) "N", py_ImageLayer);
  6570. return py_retval;
  6571. }
  6572. PyObject * _wrap_tiled_imageLayerAt(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs);
  6573. PyObject *
  6574. _wrap_tiled_isImageLayerAt(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs)
  6575. {
  6576. PyObject *py_retval;
  6577. bool retval;
  6578. PyTiledMap *map;
  6579. Tiled::Map *map_ptr;
  6580. int index;
  6581. const char *keywords[] = {"map", "index", NULL};
  6582. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!i", (char **) keywords, &PyTiledMap_Type, &map, &index)) {
  6583. return NULL;
  6584. }
  6585. map_ptr = (map ? map->obj : NULL);
  6586. retval = isImageLayerAt(map_ptr, index);
  6587. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  6588. return py_retval;
  6589. }
  6590. PyObject * _wrap_tiled_isImageLayerAt(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs);
  6591. PyObject *
  6592. _wrap_tiled_isObjectGroupAt(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs)
  6593. {
  6594. PyObject *py_retval;
  6595. bool retval;
  6596. PyTiledMap *map;
  6597. Tiled::Map *map_ptr;
  6598. int index;
  6599. const char *keywords[] = {"map", "index", NULL};
  6600. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!i", (char **) keywords, &PyTiledMap_Type, &map, &index)) {
  6601. return NULL;
  6602. }
  6603. map_ptr = (map ? map->obj : NULL);
  6604. retval = isObjectGroupAt(map_ptr, index);
  6605. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  6606. return py_retval;
  6607. }
  6608. PyObject * _wrap_tiled_isObjectGroupAt(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs);
  6609. PyObject *
  6610. _wrap_tiled_isTileLayerAt(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs)
  6611. {
  6612. PyObject *py_retval;
  6613. bool retval;
  6614. PyTiledMap *map;
  6615. Tiled::Map *map_ptr;
  6616. int index;
  6617. const char *keywords[] = {"map", "index", NULL};
  6618. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!i", (char **) keywords, &PyTiledMap_Type, &map, &index)) {
  6619. return NULL;
  6620. }
  6621. map_ptr = (map ? map->obj : NULL);
  6622. retval = isTileLayerAt(map_ptr, index);
  6623. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  6624. return py_retval;
  6625. }
  6626. PyObject * _wrap_tiled_isTileLayerAt(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs);
  6627. PyObject *
  6628. _wrap_tiled_loadTileset(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs)
  6629. {
  6630. PyObject *py_retval;
  6631. const char *file;
  6632. Py_ssize_t file_len;
  6633. const char *keywords[] = {"file", NULL};
  6634. PyTiledSharedTileset *py_SharedTileset;
  6635. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "s#", (char **) keywords, &file, &file_len)) {
  6636. return NULL;
  6637. }
  6638. Tiled::SharedTileset retval = loadTileset(QString::fromUtf8(file));
  6639. py_SharedTileset = PyObject_New(PyTiledSharedTileset, &PyTiledSharedTileset_Type);
  6640. py_SharedTileset->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  6641. py_SharedTileset->obj = new Tiled::SharedTileset(retval);
  6642. py_retval = Py_BuildValue((char *) "N", py_SharedTileset);
  6643. return py_retval;
  6644. }
  6645. PyObject * _wrap_tiled_loadTileset(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs);
  6646. PyObject *
  6647. _wrap_tiled_loadTilesetFromFile(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs)
  6648. {
  6649. PyObject *py_retval;
  6650. bool retval;
  6651. PyTiledTileset *ts;
  6652. Tiled::Tileset *ts_ptr;
  6653. const char *file;
  6654. Py_ssize_t file_len;
  6655. const char *keywords[] = {"ts", "file", NULL};
  6656. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!s#", (char **) keywords, &PyTiledTileset_Type, &ts, &file, &file_len)) {
  6657. return NULL;
  6658. }
  6659. ts_ptr = (ts ? ts->obj : NULL);
  6660. retval = loadTilesetFromFile(ts_ptr, QString::fromUtf8(file));
  6661. py_retval = Py_BuildValue((char *) "N", PyBool_FromLong(retval));
  6662. return py_retval;
  6663. }
  6664. PyObject * _wrap_tiled_loadTilesetFromFile(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs);
  6665. PyObject *
  6666. _wrap_tiled_objectGroupAt(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs)
  6667. {
  6668. PyObject *py_retval;
  6669. Tiled::ObjectGroup *retval;
  6670. PyTiledMap *map;
  6671. Tiled::Map *map_ptr;
  6672. int index;
  6673. const char *keywords[] = {"map", "index", NULL};
  6674. PyTiledObjectGroup *py_ObjectGroup;
  6675. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!i", (char **) keywords, &PyTiledMap_Type, &map, &index)) {
  6676. return NULL;
  6677. }
  6678. map_ptr = (map ? map->obj : NULL);
  6679. retval = objectGroupAt(map_ptr, index);
  6680. if (!(retval)) {
  6681. Py_INCREF(Py_None);
  6682. return Py_None;
  6683. }
  6684. py_ObjectGroup = PyObject_New(PyTiledObjectGroup, &PyTiledObjectGroup_Type);
  6685. py_ObjectGroup->obj = retval;
  6686. py_ObjectGroup->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  6687. py_retval = Py_BuildValue((char *) "N", py_ObjectGroup);
  6688. return py_retval;
  6689. }
  6690. PyObject * _wrap_tiled_objectGroupAt(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs);
  6691. PyObject *
  6692. _wrap_tiled_tileLayerAt(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs)
  6693. {
  6694. PyObject *py_retval;
  6695. Tiled::TileLayer *retval;
  6696. PyTiledMap *map;
  6697. Tiled::Map *map_ptr;
  6698. int index;
  6699. const char *keywords[] = {"map", "index", NULL};
  6700. PyTiledTileLayer *py_TileLayer;
  6701. if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "O!i", (char **) keywords, &PyTiledMap_Type, &map, &index)) {
  6702. return NULL;
  6703. }
  6704. map_ptr = (map ? map->obj : NULL);
  6705. retval = tileLayerAt(map_ptr, index);
  6706. if (!(retval)) {
  6707. Py_INCREF(Py_None);
  6708. return Py_None;
  6709. }
  6710. py_TileLayer = PyObject_New(PyTiledTileLayer, &PyTiledTileLayer_Type);
  6711. py_TileLayer->obj = retval;
  6712. py_TileLayer->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  6713. py_retval = Py_BuildValue((char *) "N", py_TileLayer);
  6714. return py_retval;
  6715. }
  6716. PyObject * _wrap_tiled_tileLayerAt(PyObject * PYBINDGEN_UNUSED(dummy), PyObject *args, PyObject *kwargs);
  6717. static PyMethodDef tiled_functions[] = {
  6718. {(char *) "imageLayerAt", (PyCFunction) _wrap_tiled_imageLayerAt, METH_KEYWORDS|METH_VARARGS, "imageLayerAt(map, index)\n\ntype: map: Tiled::Map *\ntype: index: int" },
  6719. {(char *) "isImageLayerAt", (PyCFunction) _wrap_tiled_isImageLayerAt, METH_KEYWORDS|METH_VARARGS, "isImageLayerAt(map, index)\n\ntype: map: Tiled::Map *\ntype: index: int" },
  6720. {(char *) "isObjectGroupAt", (PyCFunction) _wrap_tiled_isObjectGroupAt, METH_KEYWORDS|METH_VARARGS, "isObjectGroupAt(map, index)\n\ntype: map: Tiled::Map *\ntype: index: int" },
  6721. {(char *) "isTileLayerAt", (PyCFunction) _wrap_tiled_isTileLayerAt, METH_KEYWORDS|METH_VARARGS, "isTileLayerAt(map, index)\n\ntype: map: Tiled::Map *\ntype: index: int" },
  6722. {(char *) "loadTileset", (PyCFunction) _wrap_tiled_loadTileset, METH_KEYWORDS|METH_VARARGS, "loadTileset(file)\n\ntype: file: QString" },
  6723. {(char *) "loadTilesetFromFile", (PyCFunction) _wrap_tiled_loadTilesetFromFile, METH_KEYWORDS|METH_VARARGS, "loadTilesetFromFile(ts, file)\n\ntype: ts: Tileset *\ntype: file: QString" },
  6724. {(char *) "objectGroupAt", (PyCFunction) _wrap_tiled_objectGroupAt, METH_KEYWORDS|METH_VARARGS, "objectGroupAt(map, index)\n\ntype: map: Tiled::Map *\ntype: index: int" },
  6725. {(char *) "tileLayerAt", (PyCFunction) _wrap_tiled_tileLayerAt, METH_KEYWORDS|METH_VARARGS, "tileLayerAt(map, index)\n\ntype: map: Tiled::Map *\ntype: index: int" },
  6726. {NULL, NULL, 0, NULL}
  6727. };
  6728. /* --- classes --- */
  6729. static int
  6730. _wrap_PyPythonPythonScript__tp_init(void)
  6731. {
  6732. PyErr_SetString(PyExc_TypeError, "class 'PythonScript' cannot be constructed ()");
  6733. return -1;
  6734. }
  6735. static PyMethodDef PyPythonPythonScript_methods[] = {
  6736. {NULL, NULL, 0, NULL}
  6737. };
  6738. static void
  6739. PyPythonPythonScript__tp_clear(PyPythonPythonScript *self)
  6740. {
  6741. Py_CLEAR(self->inst_dict);
  6742. Python::PythonScript *tmp = self->obj;
  6743. self->obj = NULL;
  6744. if (!(self->flags&PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED)) {
  6745. delete tmp;
  6746. }
  6747. }
  6748. static int
  6749. PyPythonPythonScript__tp_traverse(PyPythonPythonScript *self, visitproc visit, void *arg)
  6750. {
  6751. Py_VISIT(self->inst_dict);
  6752. return 0;
  6753. }
  6754. static void
  6755. _wrap_PyPythonPythonScript__tp_dealloc(PyPythonPythonScript *self)
  6756. {
  6757. PyPythonPythonScript__tp_clear(self);
  6758. Py_TYPE(self)->tp_free((PyObject*)self);
  6759. }
  6760. PyTypeObject PyPythonPythonScript_Type = {
  6761. PyVarObject_HEAD_INIT(NULL, 0)
  6762. (char *) "tiled.PythonScript", /* tp_name */
  6763. sizeof(PyPythonPythonScript), /* tp_basicsize */
  6764. 0, /* tp_itemsize */
  6765. /* methods */
  6766. (destructor)_wrap_PyPythonPythonScript__tp_dealloc, /* tp_dealloc */
  6767. (printfunc)0, /* tp_print */
  6768. (getattrfunc)NULL, /* tp_getattr */
  6769. (setattrfunc)NULL, /* tp_setattr */
  6770. #if PY_MAJOR_VERSION >= 3
  6771. NULL,
  6772. #else
  6773. (cmpfunc)NULL, /* tp_compare */
  6774. #endif
  6775. (reprfunc)NULL, /* tp_repr */
  6776. (PyNumberMethods*)NULL, /* tp_as_number */
  6777. (PySequenceMethods*)NULL, /* tp_as_sequence */
  6778. (PyMappingMethods*)NULL, /* tp_as_mapping */
  6779. (hashfunc)NULL, /* tp_hash */
  6780. (ternaryfunc)NULL, /* tp_call */
  6781. (reprfunc)NULL, /* tp_str */
  6782. (getattrofunc)NULL, /* tp_getattro */
  6783. (setattrofunc)NULL, /* tp_setattro */
  6784. (PyBufferProcs*)NULL, /* tp_as_buffer */
  6785. Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_DEFAULT, /* tp_flags */
  6786. "", /* Documentation string */
  6787. (traverseproc)PyPythonPythonScript__tp_traverse, /* tp_traverse */
  6788. (inquiry)PyPythonPythonScript__tp_clear, /* tp_clear */
  6789. (richcmpfunc)NULL, /* tp_richcompare */
  6790. 0, /* tp_weaklistoffset */
  6791. (getiterfunc)NULL, /* tp_iter */
  6792. (iternextfunc)NULL, /* tp_iternext */
  6793. (struct PyMethodDef*)PyPythonPythonScript_methods, /* tp_methods */
  6794. (struct PyMemberDef*)0, /* tp_members */
  6795. 0, /* tp_getset */
  6796. NULL, /* tp_base */
  6797. NULL, /* tp_dict */
  6798. (descrgetfunc)NULL, /* tp_descr_get */
  6799. (descrsetfunc)NULL, /* tp_descr_set */
  6800. offsetof(PyPythonPythonScript, inst_dict), /* tp_dictoffset */
  6801. (initproc)_wrap_PyPythonPythonScript__tp_init, /* tp_init */
  6802. (allocfunc)PyType_GenericAlloc, /* tp_alloc */
  6803. (newfunc)PyType_GenericNew, /* tp_new */
  6804. (freefunc)0, /* tp_free */
  6805. (inquiry)NULL, /* tp_is_gc */
  6806. NULL, /* tp_bases */
  6807. NULL, /* tp_mro */
  6808. NULL, /* tp_cache */
  6809. NULL, /* tp_subclasses */
  6810. NULL, /* tp_weaklist */
  6811. (destructor) NULL /* tp_del */
  6812. };
  6813. #if PY_VERSION_HEX >= 0x03000000
  6814. static struct PyModuleDef tiled_moduledef = {
  6815. PyModuleDef_HEAD_INIT,
  6816. "tiled",
  6817. NULL,
  6818. -1,
  6819. tiled_functions,
  6820. };
  6821. #endif
  6822. #if PY_VERSION_HEX >= 0x03000000
  6823. #define MOD_ERROR NULL
  6824. #define MOD_INIT(name) PyObject* PyInit_##name(void)
  6825. #define MOD_RETURN(val) val
  6826. #else
  6827. #define MOD_ERROR
  6828. #define MOD_INIT(name) void init##name(void)
  6829. #define MOD_RETURN(val)
  6830. #endif
  6831. #if defined(__cplusplus)
  6832. extern "C"
  6833. #endif
  6834. #if defined(__GNUC__) && __GNUC__ >= 4
  6835. __attribute__ ((visibility("default")))
  6836. #endif
  6837. MOD_INIT(tiled)
  6838. {
  6839. PyObject *m;
  6840. PyObject *submodule;
  6841. #if PY_VERSION_HEX >= 0x03000000
  6842. m = PyModule_Create(&tiled_moduledef);
  6843. #else
  6844. m = Py_InitModule3((char *) "tiled", tiled_functions, NULL);
  6845. #endif
  6846. if (m == NULL) {
  6847. return MOD_ERROR;
  6848. }
  6849. /* Register the 'Python::PythonScript' class */
  6850. if (PyType_Ready(&PyPythonPythonScript_Type)) {
  6851. return MOD_ERROR;
  6852. }
  6853. PyModule_AddObject(m, (char *) "Plugin", (PyObject *) &PyPythonPythonScript_Type);
  6854. submodule = inittiled_qt();
  6855. if (submodule == NULL) {
  6856. return MOD_ERROR;
  6857. }
  6858. Py_INCREF(submodule);
  6859. PyModule_AddObject(m, (char *) "qt", submodule);
  6860. submodule = inittiled_Tiled();
  6861. if (submodule == NULL) {
  6862. return MOD_ERROR;
  6863. }
  6864. Py_INCREF(submodule);
  6865. PyModule_AddObject(m, (char *) "Tiled", submodule);
  6866. return MOD_RETURN(m);
  6867. }
  6868. PyObject* _wrap_convert_c2py__Tiled__LoggingInterface(Tiled::LoggingInterface *cvalue)
  6869. {
  6870. PyObject *py_retval;
  6871. PyTiledLoggingInterface *py_LoggingInterface;
  6872. py_LoggingInterface = PyObject_New(PyTiledLoggingInterface, &PyTiledLoggingInterface_Type);
  6873. py_LoggingInterface->flags = PYBINDGEN_WRAPPER_FLAG_NONE;
  6874. py_LoggingInterface->obj = cvalue;
  6875. py_retval = Py_BuildValue((char *) "N", py_LoggingInterface);
  6876. return py_retval;
  6877. }
  6878. int _wrap_convert_py2c__Tiled__Map___star__(PyObject *value, Tiled::Map * *address)
  6879. {
  6880. PyObject *py_retval;
  6881. PyTiledMap *tmp_Map;
  6882. py_retval = Py_BuildValue((char *) "(O)", value);
  6883. if (!PyArg_ParseTuple(py_retval, (char *) "O!", &PyTiledMap_Type, &tmp_Map)) {
  6884. Py_DECREF(py_retval);
  6885. return 0;
  6886. }
  6887. *address = tmp_Map->obj->clone().release();
  6888. Py_DECREF(py_retval);
  6889. return 1;
  6890. }
  6891. PyObject* _wrap_convert_c2py__Tiled__Map_const___star__(Tiled::Map const * *cvalue)
  6892. {
  6893. PyObject *py_retval;
  6894. PyTiledMap *py_Map;
  6895. if (!(*cvalue)) {
  6896. Py_INCREF(Py_None);
  6897. return Py_None;
  6898. }
  6899. py_Map = PyObject_New(PyTiledMap, &PyTiledMap_Type);
  6900. py_Map->obj = (Tiled::Map *) (*cvalue);
  6901. py_Map->flags = PYBINDGEN_WRAPPER_FLAG_OBJECT_NOT_OWNED;
  6902. py_retval = Py_BuildValue((char *) "N", py_Map);
  6903. return py_retval;
  6904. }