1
/* -*- Mode: C; c-basic-offset: 4 -*-
2
Gimp-Python - allows the writing of Gimp plugins in Python.
3
Copyright (C) 2006 Manish Singh <yosh@gimp.org>
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 2 of the License, or
8
(at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
15
You should have received a copy of the GNU General Public License
16
along with this program; if not, write to the Free Software
17
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
28
static PyObject *vectors_bezier_stroke_new(PyGimpVectors *vectors, int stroke);
35
} PyGimpVectorsStroke;
38
vs_get_length(PyGimpVectorsStroke *self, PyObject *args, PyObject *kwargs)
43
static char *kwlist[] = { "precision", NULL };
45
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "d:get_length", kwlist,
49
length = gimp_vectors_stroke_get_length(self->vectors_ID, self->stroke,
52
return PyFloat_FromDouble(length);
56
vs_get_point_at_dist(PyGimpVectorsStroke *self, PyObject *args, PyObject *kwargs)
58
double dist, precision;
63
static char *kwlist[] = { "dist", "precision", NULL };
65
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
66
"dd:get_point_at_dist", kwlist,
70
gimp_vectors_stroke_get_point_at_dist(self->vectors_ID, self->stroke,
72
&x, &y, &slope, &valid);
78
PyTuple_SetItem(ret, 0, PyFloat_FromDouble(x));
79
PyTuple_SetItem(ret, 1, PyFloat_FromDouble(y));
80
PyTuple_SetItem(ret, 2, PyFloat_FromDouble(slope));
81
PyTuple_SetItem(ret, 3, PyBool_FromLong(valid));
87
vs_close(PyGimpVectorsStroke *self)
89
gimp_vectors_stroke_close(self->vectors_ID, self->stroke);
96
vs_translate(PyGimpVectorsStroke *self, PyObject *args, PyObject *kwargs)
100
static char *kwlist[] = { "off_x", "off_y", NULL };
102
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "dd:translate", kwlist,
106
gimp_vectors_stroke_translate(self->vectors_ID, self->stroke, off_x, off_y);
113
vs_scale(PyGimpVectorsStroke *self, PyObject *args, PyObject *kwargs)
115
double scale_x, scale_y;
117
static char *kwlist[] = { "scale_x", "scale_y", NULL };
119
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "dd:scale", kwlist,
123
gimp_vectors_stroke_scale(self->vectors_ID, self->stroke, scale_x, scale_y);
130
vs_rotate(PyGimpVectorsStroke *self, PyObject *args, PyObject *kwargs)
132
double center_x, center_y, angle;
134
static char *kwlist[] = { "center_x", "center_y", "angle", NULL };
136
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ddd:rotate", kwlist,
137
¢er_x, ¢er_y, &angle))
140
gimp_vectors_stroke_rotate(self->vectors_ID, self->stroke, center_x,
148
vs_flip(PyGimpVectorsStroke *self, PyObject *args, PyObject *kwargs)
153
static char *kwlist[] = { "flip_type", "axis", NULL };
155
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "id:rotate", kwlist,
159
gimp_vectors_stroke_flip(self->vectors_ID, self->stroke, flip_type, axis);
166
vs_flip_free(PyGimpVectorsStroke *self, PyObject *args, PyObject *kwargs)
170
static char *kwlist[] = { "x1", "y1", "x2", "y2", NULL };
172
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "dddd:rotate", kwlist,
176
gimp_vectors_stroke_flip_free(self->vectors_ID, self->stroke,
185
vs_interpolate(PyGimpVectorsStroke *self, PyObject *args, PyObject *kwargs)
191
PyObject *ret, *ret_coords;
193
static char *kwlist[] = { "precision", NULL };
195
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "d:interpolate", kwlist,
199
coords = gimp_vectors_stroke_interpolate(self->vectors_ID, self->stroke,
200
precision, &num_coords, &closed);
202
ret = PyTuple_New(2);
206
ret_coords = PyList_New(num_coords);
207
if (ret_coords == NULL) {
212
for (i = 0; i < num_coords; i++)
213
PyList_SetItem(ret_coords, i, PyFloat_FromDouble(coords[i]));
215
PyTuple_SetItem(ret, 0, ret_coords);
216
PyTuple_SetItem(ret, 1, PyBool_FromLong(closed));
221
static PyMethodDef vs_methods[] = {
222
{ "get_length", (PyCFunction)vs_get_length, METH_VARARGS | METH_KEYWORDS },
223
{ "get_point_at_dist", (PyCFunction)vs_get_point_at_dist, METH_VARARGS | METH_KEYWORDS },
224
{ "close", (PyCFunction)vs_close, METH_NOARGS },
225
{ "translate", (PyCFunction)vs_translate, METH_VARARGS | METH_KEYWORDS },
226
{ "scale", (PyCFunction)vs_scale, METH_VARARGS | METH_KEYWORDS },
227
{ "rotate", (PyCFunction)vs_rotate, METH_VARARGS | METH_KEYWORDS },
228
{ "flip", (PyCFunction)vs_flip, METH_VARARGS | METH_KEYWORDS },
229
{ "flip_free", (PyCFunction)vs_flip_free, METH_VARARGS | METH_KEYWORDS },
230
{ "interpolate", (PyCFunction)vs_interpolate, METH_VARARGS | METH_KEYWORDS },
235
vs_get_ID(PyGimpVectorsStroke *self, void *closure)
237
return PyInt_FromLong(self->stroke);
241
vs_get_vectors_ID(PyGimpVectorsStroke *self, void *closure)
243
return PyInt_FromLong(self->vectors_ID);
247
vs_get_points(PyGimpVectorsStroke *self, void *closure)
249
double *controlpoints;
252
PyObject *ret, *ret_points;
254
gimp_vectors_stroke_get_points(self->vectors_ID, self->stroke,
255
&num_points, &controlpoints, &closed);
257
ret = PyTuple_New(2);
261
ret_points = PyList_New(num_points);
262
if (ret_points == NULL) {
267
for (i = 0; i < num_points; i++)
268
PyList_SetItem(ret_points, i, PyFloat_FromDouble(controlpoints[i]));
270
PyTuple_SetItem(ret, 0, ret_points);
271
PyTuple_SetItem(ret, 1, PyBool_FromLong(closed));
276
static PyGetSetDef vs_getsets[] = {
277
{ "ID", (getter)vs_get_ID, (setter)0 },
278
{ "vectors_ID", (getter)vs_get_vectors_ID, (setter)0 },
279
{ "points", (getter)vs_get_points, (setter)0 },
280
{ NULL, (getter)0, (setter)0 }
284
vs_dealloc(PyGimpVectorsStroke *self)
290
vs_repr(PyGimpVectorsStroke *self)
295
name = gimp_vectors_get_name(self->vectors_ID);
296
s = PyString_FromFormat("<gimp.VectorsStroke %d of gimp.Vectors '%s'>",
297
self->stroke, name ? name : "(null)");
304
vs_cmp(PyGimpVectorsStroke *self, PyGimpVectorsStroke *other)
306
if (self->vectors_ID == other->vectors_ID) {
307
if (self->stroke == other->stroke)
309
if (self->stroke > other->stroke)
313
if (self->vectors_ID > other->vectors_ID)
318
PyTypeObject PyGimpVectorsStroke_Type = {
319
PyObject_HEAD_INIT(NULL)
321
"gimp.VectorsStroke", /* tp_name */
322
sizeof(PyGimpVectorsStroke), /* tp_basicsize */
325
(destructor)vs_dealloc, /* tp_dealloc */
326
(printfunc)0, /* tp_print */
327
(getattrfunc)0, /* tp_getattr */
328
(setattrfunc)0, /* tp_setattr */
329
(cmpfunc)vs_cmp, /* tp_compare */
330
(reprfunc)vs_repr, /* tp_repr */
331
0, /* tp_as_number */
332
0, /* tp_as_sequence */
333
0, /* tp_as_mapping */
334
(hashfunc)0, /* tp_hash */
335
(ternaryfunc)0, /* tp_call */
336
(reprfunc)0, /* tp_str */
337
(getattrofunc)0, /* tp_getattro */
338
(setattrofunc)0, /* tp_setattro */
339
0, /* tp_as_buffer */
340
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
341
NULL, /* Documentation string */
342
(traverseproc)0, /* tp_traverse */
343
(inquiry)0, /* tp_clear */
344
(richcmpfunc)0, /* tp_richcompare */
345
0, /* tp_weaklistoffset */
346
(getiterfunc)0, /* tp_iter */
347
(iternextfunc)0, /* tp_iternext */
348
vs_methods, /* tp_methods */
350
vs_getsets, /* tp_getset */
351
(PyTypeObject *)0, /* tp_base */
352
(PyObject *)0, /* tp_dict */
353
0, /* tp_descr_get */
354
0, /* tp_descr_set */
355
0, /* tp_dictoffset */
356
(initproc)0, /* tp_init */
357
(allocfunc)0, /* tp_alloc */
358
(newfunc)0, /* tp_new */
363
vbs_new_moveto(PyTypeObject *type, PyObject *args, PyObject *kwargs)
365
PyGimpVectors *vectors;
369
static char *kwlist[] = { "vectors", "x0", "y0", NULL };
371
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
372
"O!dd:new_moveto", kwlist,
373
&PyGimpVectors_Type, &vectors,
377
stroke = gimp_vectors_bezier_stroke_new_moveto(vectors->ID, x0, y0);
379
return vectors_bezier_stroke_new(vectors, stroke);
383
vbs_new_ellipse(PyTypeObject *type, PyObject *args, PyObject *kwargs)
385
PyGimpVectors *vectors;
386
double x0, y0, radius_x, radius_y, angle;
389
static char *kwlist[] = { "vectors", "x0", "y0", "radius_x", "radius_y",
392
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
393
"O!ddddd:new_ellipse", kwlist,
394
&PyGimpVectors_Type, &vectors,
395
&x0, &y0, &radius_x, &radius_y, &angle))
398
stroke = gimp_vectors_bezier_stroke_new_ellipse(vectors->ID, x0, y0,
399
radius_x, radius_y, angle);
401
return vectors_bezier_stroke_new(vectors, stroke);
405
vbs_lineto(PyGimpVectorsStroke *self, PyObject *args, PyObject *kwargs)
409
static char *kwlist[] = { "x0", "y0", NULL };
411
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
416
gimp_vectors_bezier_stroke_lineto(self->vectors_ID, self->stroke, x0, y0);
423
vbs_conicto(PyGimpVectorsStroke *self, PyObject *args, PyObject *kwargs)
425
double x0, y0, x1, y1;
427
static char *kwlist[] = { "x0", "y0", "x1", "y1", NULL };
429
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
430
"dddd:conicto", kwlist,
434
gimp_vectors_bezier_stroke_conicto(self->vectors_ID, self->stroke,
442
vbs_cubicto(PyGimpVectorsStroke *self, PyObject *args, PyObject *kwargs)
444
double x0, y0, x1, y1, x2, y2;
446
static char *kwlist[] = { "x0", "y0", "x1", "y1", "x2", "y2", NULL };
448
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
449
"dddddd:conicto", kwlist,
450
&x0, &y0, &x1, &y1, &x2, &y2))
453
gimp_vectors_bezier_stroke_cubicto(self->vectors_ID, self->stroke,
454
x0, y0, x1, y1, x2, y2);
460
static PyMethodDef vbs_methods[] = {
461
{ "new_moveto", (PyCFunction)vbs_new_moveto, METH_VARARGS | METH_KEYWORDS | METH_CLASS },
462
{ "new_ellipse", (PyCFunction)vbs_new_ellipse, METH_VARARGS | METH_KEYWORDS | METH_CLASS },
463
{ "lineto", (PyCFunction)vbs_lineto, METH_VARARGS | METH_KEYWORDS },
464
{ "conicto", (PyCFunction)vbs_conicto, METH_VARARGS | METH_KEYWORDS },
465
{ "cubicto", (PyCFunction)vbs_cubicto, METH_VARARGS | METH_KEYWORDS },
470
vbs_repr(PyGimpVectorsStroke *self)
475
name = gimp_vectors_get_name(self->vectors_ID);
476
s = PyString_FromFormat("<gimp.VectorsBezierStroke %d of gimp.Vectors '%s'>",
477
self->stroke, name ? name : "(null)");
484
vbs_init(PyGimpVectorsStroke *self, PyObject *args, PyObject *kwargs)
486
PyGimpVectors *vectors;
487
double *controlpoints;
488
gboolean closed = FALSE;
489
PyObject *py_controlpoints, *item;
492
static char *kwlist[] = { "vectors", "controlpoints", "closed", NULL };
494
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
495
"O!O|i:gimp.VectorsBezierStroke.__init__",
497
&PyGimpVectors_Type, &vectors,
498
&py_controlpoints, &closed));
501
if (!PySequence_Check(py_controlpoints)) {
502
PyErr_SetString(PyExc_TypeError,
503
"controlpoints must be a sequence");
507
num_points = PySequence_Length(py_controlpoints);
508
controlpoints = g_new(gdouble, num_points);
510
for (i = 0; i < num_points; i++) {
511
item = PySequence_GetItem(py_controlpoints, i);
513
if (!PyFloat_Check(item)) {
514
PyErr_SetString(PyExc_TypeError,
515
"controlpoints must be a sequence of floats");
516
g_free(controlpoints);
520
controlpoints[i] = PyFloat_AsDouble(item);
523
self->vectors_ID = vectors->ID;
525
gimp_vectors_stroke_new_from_points(self->vectors_ID,
526
GIMP_VECTORS_STROKE_TYPE_BEZIER,
527
num_points, controlpoints, closed);
529
g_free(controlpoints);
534
PyTypeObject PyGimpVectorsBezierStroke_Type = {
535
PyObject_HEAD_INIT(NULL)
537
"gimp.VectorsBezierStroke", /* tp_name */
538
sizeof(PyGimpVectorsStroke), /* tp_basicsize */
541
(destructor)vs_dealloc, /* tp_dealloc */
542
(printfunc)0, /* tp_print */
543
(getattrfunc)0, /* tp_getattr */
544
(setattrfunc)0, /* tp_setattr */
545
(cmpfunc)vs_cmp, /* tp_compare */
546
(reprfunc)vbs_repr, /* tp_repr */
547
0, /* tp_as_number */
548
0, /* tp_as_sequence */
549
0, /* tp_as_mapping */
550
(hashfunc)0, /* tp_hash */
551
(ternaryfunc)0, /* tp_call */
552
(reprfunc)0, /* tp_str */
553
(getattrofunc)0, /* tp_getattro */
554
(setattrofunc)0, /* tp_setattro */
555
0, /* tp_as_buffer */
556
Py_TPFLAGS_DEFAULT, /* tp_flags */
557
NULL, /* Documentation string */
558
(traverseproc)0, /* tp_traverse */
559
(inquiry)0, /* tp_clear */
560
(richcmpfunc)0, /* tp_richcompare */
561
0, /* tp_weaklistoffset */
562
(getiterfunc)0, /* tp_iter */
563
(iternextfunc)0, /* tp_iternext */
564
vbs_methods, /* tp_methods */
567
&PyGimpVectorsStroke_Type, /* tp_base */
568
(PyObject *)0, /* tp_dict */
569
0, /* tp_descr_get */
570
0, /* tp_descr_set */
571
0, /* tp_dictoffset */
572
(initproc)vbs_init, /* tp_init */
573
(allocfunc)0, /* tp_alloc */
574
(newfunc)0, /* tp_new */
578
vectors_bezier_stroke_new(PyGimpVectors *vectors, int stroke)
580
PyGimpVectorsStroke *self;
582
self = PyObject_NEW(PyGimpVectorsStroke, &PyGimpVectorsBezierStroke_Type);
587
self->vectors_ID = vectors->ID;
588
self->stroke = stroke;
590
return (PyObject *)self;
595
vectors_remove_stroke(PyGimpVectors *self, PyObject *args, PyObject *kwargs)
599
static char *kwlist[] = { "stroke", NULL };
601
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:remove_stroke", kwlist,
606
gimp_vectors_remove_stroke(self->ID, stroke);
613
vectors_to_selection(PyGimpVectors *self, PyObject *args, PyObject *kwargs)
615
GimpChannelOps operation = GIMP_CHANNEL_OP_REPLACE;
616
gboolean antialias = TRUE, feather = FALSE;
617
double feather_radius_x = 0.0, feather_radius_y = 0.0;
619
static char *kwlist[] = { "operation", "antialias", "feather",
620
"feather_radius_x", "feather_radius_y", NULL };
622
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
623
"|iiidd:to_selection", kwlist,
624
&operation, &antialias, &feather,
625
&feather_radius_x, &feather_radius_y))
628
gimp_vectors_to_selection(self->ID, operation, antialias, feather,
629
feather_radius_x, feather_radius_y);
636
vectors_parasite_find(PyGimpVectors *self, PyObject *args)
640
if (!PyArg_ParseTuple(args, "s:parasite_find", &name))
643
return pygimp_parasite_new(gimp_vectors_parasite_find(self->ID, name));
647
vectors_parasite_attach(PyGimpVectors *self, PyObject *args)
649
PyGimpParasite *parasite;
651
if (!PyArg_ParseTuple(args, "O!:parasite_attach", &PyGimpParasite_Type,
655
if (!gimp_vectors_parasite_attach(self->ID, parasite->para)) {
656
PyErr_Format(pygimp_error,
657
"could not attach parasite '%s' to vectors (ID %d)",
658
parasite->para->name, self->ID);
667
vectors_parasite_detach(PyGimpVectors *self, PyObject *args)
671
if (!PyArg_ParseTuple(args, "s:parasite_detach", &name))
674
if (!gimp_vectors_parasite_detach(self->ID, name)) {
675
PyErr_Format(pygimp_error,
676
"could not detach parasite '%s' from vectors (ID %d)",
686
vectors_parasite_list(PyGimpVectors *self)
691
if (gimp_vectors_parasite_list(self->ID, &num_parasites, ¶sites)) {
695
ret = PyTuple_New(num_parasites);
697
for (i = 0; i < num_parasites; i++) {
698
PyTuple_SetItem(ret, i, PyString_FromString(parasites[i]));
699
g_free(parasites[i]);
706
PyErr_Format(pygimp_error, "could not list parasites on vectors (ID %d)",
711
static PyMethodDef vectors_methods[] = {
713
(PyCFunction)vectors_remove_stroke,
714
METH_VARARGS | METH_KEYWORDS },
716
(PyCFunction)vectors_to_selection,
717
METH_VARARGS | METH_KEYWORDS },
719
(PyCFunction)vectors_parasite_find,
722
(PyCFunction)vectors_parasite_attach,
725
(PyCFunction)vectors_parasite_detach,
728
(PyCFunction)vectors_parasite_list,
734
vectors_get_image(PyGimpVectors *self, void *closure)
736
return pygimp_image_new(gimp_vectors_get_image(self->ID));
740
vectors_get_ID(PyGimpVectors *self, void *closure)
742
return PyInt_FromLong(self->ID);
746
vectors_get_name(PyGimpVectors *self, void *closure)
748
return PyString_FromString(gimp_vectors_get_name(self->ID));
752
vectors_set_name(PyGimpVectors *self, PyObject *value, void *closure)
755
PyErr_SetString(PyExc_TypeError, "cannot delete name");
759
if (!PyString_Check(value) && !PyUnicode_Check(value)) {
760
PyErr_SetString(PyExc_TypeError, "type mismatch");
764
gimp_vectors_set_name(self->ID, PyString_AsString(value));
770
vectors_get_visible(PyGimpVectors *self, void *closure)
772
return PyBool_FromLong(gimp_vectors_get_visible(self->ID));
776
vectors_set_visible(PyGimpVectors *self, PyObject *value, void *closure)
779
PyErr_SetString(PyExc_TypeError, "cannot delete visible");
783
if (!PyInt_Check(value)) {
784
PyErr_SetString(PyExc_TypeError, "type mismatch");
788
gimp_vectors_set_visible(self->ID, PyInt_AsLong(value));
794
vectors_get_linked(PyGimpVectors *self, void *closure)
796
return PyBool_FromLong(gimp_vectors_get_linked(self->ID));
800
vectors_set_linked(PyGimpVectors *self, PyObject *value, void *closure)
803
PyErr_SetString(PyExc_TypeError, "cannot delete linked");
807
if (!PyInt_Check(value)) {
808
PyErr_SetString(PyExc_TypeError, "type mismatch");
812
gimp_vectors_set_linked(self->ID, PyInt_AsLong(value));
818
vectors_get_tattoo(PyGimpVectors *self, void *closure)
820
return PyInt_FromLong(gimp_vectors_get_tattoo(self->ID));
824
vectors_set_tattoo(PyGimpVectors *self, PyObject *value, void *closure)
827
PyErr_SetString(PyExc_TypeError, "cannot delete tattoo");
831
if (!PyInt_Check(value)) {
832
PyErr_SetString(PyExc_TypeError, "type mismatch");
836
gimp_vectors_set_tattoo(self->ID, PyInt_AsLong(value));
842
vectors_get_strokes(PyGimpVectors *self, void *closure)
848
strokes = gimp_vectors_get_strokes(self->ID, &num_strokes);
850
ret = PyList_New(num_strokes);
854
for (i = 0; i < num_strokes; i++)
855
PyList_SetItem(ret, i, vectors_bezier_stroke_new(self, strokes[i]));
862
static PyGetSetDef vectors_getsets[] = {
863
{ "ID", (getter)vectors_get_ID, (setter)0 },
864
{ "image", (getter)vectors_get_image, (setter)0 },
865
{ "name", (getter)vectors_get_name, (setter)vectors_set_name },
866
{ "visible", (getter)vectors_get_visible, (setter)vectors_set_visible },
867
{ "linked", (getter)vectors_get_linked, (setter)vectors_set_linked },
868
{ "tattoo", (getter)vectors_get_tattoo, (setter)vectors_set_tattoo },
869
{ "strokes", (getter)vectors_get_strokes, (setter)0 },
870
{ NULL, (getter)0, (setter)0 }
874
vectors_dealloc(PyGimpVectors *self)
880
vectors_repr(PyGimpVectors *self)
885
name = gimp_vectors_get_name(self->ID);
886
s = PyString_FromFormat("<gimp.Vectors '%s'>", name ? name : "(null)");
893
vectors_cmp(PyGimpVectors *self, PyGimpVectors *other)
895
if (self->ID == other->ID)
897
if (self->ID > other->ID)
903
vectors_init(PyGimpVectors *self, PyObject *args, PyObject *kwargs)
908
static char *kwlist[] = { "image", "name", NULL };
910
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
911
"O!s:gimp.Vectors.__init__",
913
&PyGimpImage_Type, &img, &name))
916
self->ID = gimp_vectors_new(img->ID, name);
919
PyErr_Format(pygimp_error,
920
"could not create vectors '%s' on image (ID %d)",
928
PyTypeObject PyGimpVectors_Type = {
929
PyObject_HEAD_INIT(NULL)
931
"gimp.Vectors", /* tp_name */
932
sizeof(PyGimpVectors), /* tp_basicsize */
935
(destructor)vectors_dealloc, /* tp_dealloc */
936
(printfunc)0, /* tp_print */
937
(getattrfunc)0, /* tp_getattr */
938
(setattrfunc)0, /* tp_setattr */
939
(cmpfunc)vectors_cmp, /* tp_compare */
940
(reprfunc)vectors_repr, /* tp_repr */
941
0, /* tp_as_number */
942
0, /* tp_as_sequence */
943
0, /* tp_as_mapping */
944
(hashfunc)0, /* tp_hash */
945
(ternaryfunc)0, /* tp_call */
946
(reprfunc)0, /* tp_str */
947
(getattrofunc)0, /* tp_getattro */
948
(setattrofunc)0, /* tp_setattro */
949
0, /* tp_as_buffer */
950
Py_TPFLAGS_DEFAULT, /* tp_flags */
951
NULL, /* Documentation string */
952
(traverseproc)0, /* tp_traverse */
953
(inquiry)0, /* tp_clear */
954
(richcmpfunc)0, /* tp_richcompare */
955
0, /* tp_weaklistoffset */
956
(getiterfunc)0, /* tp_iter */
957
(iternextfunc)0, /* tp_iternext */
958
vectors_methods, /* tp_methods */
960
vectors_getsets, /* tp_getset */
961
(PyTypeObject *)0, /* tp_base */
962
(PyObject *)0, /* tp_dict */
963
0, /* tp_descr_get */
964
0, /* tp_descr_set */
965
0, /* tp_dictoffset */
966
(initproc)vectors_init, /* tp_init */
967
(allocfunc)0, /* tp_alloc */
968
(newfunc)0, /* tp_new */
972
pygimp_vectors_new(gint32 ID)
981
self = PyObject_NEW(PyGimpVectors, &PyGimpVectors_Type);
988
return (PyObject *)self;