PageRenderTime 59ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 2ms

/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

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

  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_PyQ

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