Cleanup: unify struct declaration style for Python types, update names
Use struct identifiers in comments before the value. This has some advantages: - The struct identifiers didn't mix well with other code-comments, where other comments were wrapped onto the next line. - Minor changes could re-align all other comments in the struct. - PyVarObject_HEAD_INIT & tp_name are no longer placed on the same line. Remove overly verbose comments copied from PyTypeObject (Python v2.x), these aren't especially helpful and get outdated. Also corrected some outdated names: - PyTypeObject.tp_print -> tp_vectorcall_offset - PyTypeObject.tp_reserved -> tp_as_async
This commit is contained in:
@@ -146,82 +146,54 @@ static PyGetSetDef bpy_bmesh_op_getseters[] = {
|
||||
* ===== */
|
||||
|
||||
static PyTypeObject bmesh_op_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0) "BMeshOpFunc", /* tp_name */
|
||||
sizeof(BPy_BMeshOpFunc), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
/* methods */
|
||||
NULL, /* tp_dealloc */
|
||||
0, /* tp_vectorcall_offset */
|
||||
NULL, /* getattrfunc tp_getattr; */
|
||||
NULL, /* setattrfunc tp_setattr; */
|
||||
NULL,
|
||||
/* tp_compare */ /* DEPRECATED in python 3.0! */
|
||||
(reprfunc)bpy_bmesh_op_repr, /* tp_repr */
|
||||
|
||||
/* Method suites for standard classes */
|
||||
|
||||
NULL, /* PyNumberMethods *tp_as_number; */
|
||||
NULL, /* PySequenceMethods *tp_as_sequence; */
|
||||
NULL, /* PyMappingMethods *tp_as_mapping; */
|
||||
|
||||
/* More standard operations (here for binary compatibility) */
|
||||
|
||||
NULL, /* hashfunc tp_hash; */
|
||||
(ternaryfunc)BPy_BMO_call, /* ternaryfunc tp_call; */
|
||||
NULL, /* reprfunc tp_str; */
|
||||
|
||||
/* will only use these if this is a subtype of a py class */
|
||||
NULL, /* getattrofunc tp_getattro; */
|
||||
NULL, /* setattrofunc tp_setattro; */
|
||||
|
||||
/* Functions to access object as input/output buffer */
|
||||
NULL, /* PyBufferProcs *tp_as_buffer; */
|
||||
|
||||
/*** Flags to define presence of optional/expanded features ***/
|
||||
Py_TPFLAGS_DEFAULT, /* long tp_flags; */
|
||||
|
||||
NULL, /* char *tp_doc; Documentation string */
|
||||
/*** Assigned meaning in release 2.0 ***/
|
||||
/* call function for all accessible objects */
|
||||
NULL, /* traverseproc tp_traverse; */
|
||||
|
||||
/* delete references to contained objects */
|
||||
NULL, /* inquiry tp_clear; */
|
||||
|
||||
/*** Assigned meaning in release 2.1 ***/
|
||||
/*** rich comparisons ***/
|
||||
NULL, /* richcmpfunc tp_richcompare; */
|
||||
|
||||
/*** weak reference enabler ***/
|
||||
0,
|
||||
/*** Added in release 2.2 ***/
|
||||
/* Iterators */
|
||||
NULL, /* getiterfunc tp_iter; */
|
||||
NULL, /* iternextfunc tp_iternext; */
|
||||
|
||||
/*** Attribute descriptor and subclassing stuff ***/
|
||||
NULL, /* struct PyMethodDef *tp_methods; */
|
||||
NULL, /* struct PyMemberDef *tp_members; */
|
||||
bpy_bmesh_op_getseters, /* struct PyGetSetDef *tp_getset; */
|
||||
NULL, /* struct _typeobject *tp_base; */
|
||||
NULL, /* PyObject *tp_dict; */
|
||||
NULL, /* descrgetfunc tp_descr_get; */
|
||||
NULL, /* descrsetfunc tp_descr_set; */
|
||||
0, /* long tp_dictoffset; */
|
||||
NULL, /* initproc tp_init; */
|
||||
NULL, /* allocfunc tp_alloc; */
|
||||
NULL, /* newfunc tp_new; */
|
||||
/* Low-level free-memory routine */
|
||||
NULL, /* freefunc tp_free; */
|
||||
/* For PyObject_IS_GC */
|
||||
NULL, /* inquiry tp_is_gc; */
|
||||
NULL, /* PyObject *tp_bases; */
|
||||
/* method resolution order */
|
||||
NULL, /* PyObject *tp_mro; */
|
||||
NULL, /* PyObject *tp_cache; */
|
||||
NULL, /* PyObject *tp_subclasses; */
|
||||
NULL, /* PyObject *tp_weaklist; */
|
||||
NULL,
|
||||
/*tp_name*/ PyVarObject_HEAD_INIT(NULL, 0) "BMeshOpFunc",
|
||||
/*tp_basicsize*/ sizeof(BPy_BMeshOpFunc),
|
||||
/*tp_itemsize*/ 0,
|
||||
/*tp_dealloc*/ NULL,
|
||||
/*tp_vectorcall_offset*/ 0,
|
||||
/*tp_getattr*/ NULL,
|
||||
/*tp_setattr*/ NULL,
|
||||
/*tp_as_async*/ NULL,
|
||||
/*tp_repr*/ (reprfunc)bpy_bmesh_op_repr,
|
||||
/*tp_as_number*/ NULL,
|
||||
/*tp_as_sequence*/ NULL,
|
||||
/*tp_as_mapping*/ NULL,
|
||||
/*tp_hash*/ NULL,
|
||||
/*tp_call*/ (ternaryfunc)BPy_BMO_call,
|
||||
/*tp_str*/ NULL,
|
||||
/*tp_getattro*/ NULL,
|
||||
/*tp_setattro*/ NULL,
|
||||
/*tp_as_buffer*/ NULL,
|
||||
/*tp_flags*/ Py_TPFLAGS_DEFAULT,
|
||||
/*tp_doc*/ NULL,
|
||||
/*tp_traverse*/ NULL,
|
||||
/*tp_clear*/ NULL,
|
||||
/*tp_richcompare*/ NULL,
|
||||
/*tp_weaklistoffset*/ 0,
|
||||
/*tp_iter*/ NULL,
|
||||
/*tp_iternext*/ NULL,
|
||||
/*tp_methods*/ NULL,
|
||||
/*tp_members*/ NULL,
|
||||
/*tp_getset*/ bpy_bmesh_op_getseters,
|
||||
/*tp_base*/ NULL,
|
||||
/*tp_dict*/ NULL,
|
||||
/*tp_descr_get*/ NULL,
|
||||
/*tp_descr_set*/ NULL,
|
||||
/*tp_dictoffset*/ 0,
|
||||
/*tp_init*/ NULL,
|
||||
/*tp_alloc*/ NULL,
|
||||
/*tp_new*/ NULL,
|
||||
/*tp_free*/ NULL,
|
||||
/*tp_is_gc*/ NULL,
|
||||
/*tp_bases*/ NULL,
|
||||
/*tp_mro*/ NULL,
|
||||
/*tp_cache*/ NULL,
|
||||
/*tp_subclasses*/ NULL,
|
||||
/*tp_weaklist*/ NULL,
|
||||
/*tp_del*/ NULL,
|
||||
/*tp_version_tag*/ 0,
|
||||
/*tp_finalize*/ NULL,
|
||||
/*tp_vectorcall*/ NULL,
|
||||
};
|
||||
|
||||
/* bmesh module 'bmesh.ops'
|
||||
|
||||
@@ -3313,31 +3313,30 @@ static int bpy_bmelem_ass_subscript(BPy_BMElem *self, BPy_BMLayerItem *key, PyOb
|
||||
}
|
||||
|
||||
static PySequenceMethods bpy_bmelemseq_as_sequence = {
|
||||
(lenfunc)bpy_bmelemseq_length, /* sq_length */
|
||||
NULL, /* sq_concat */
|
||||
NULL, /* sq_repeat */
|
||||
(ssizeargfunc)bpy_bmelemseq_subscript_int,
|
||||
/* sq_item */ /* Only set this so PySequence_Check() returns True */
|
||||
NULL, /* sq_slice */
|
||||
(ssizeobjargproc)NULL, /* sq_ass_item */
|
||||
NULL, /* *was* sq_ass_slice */
|
||||
(objobjproc)bpy_bmelemseq_contains, /* sq_contains */
|
||||
(binaryfunc)NULL, /* sq_inplace_concat */
|
||||
(ssizeargfunc)NULL, /* sq_inplace_repeat */
|
||||
/*sq_length*/ (lenfunc)bpy_bmelemseq_length,
|
||||
/*sq_concat*/ NULL,
|
||||
/*sq_repeat*/ NULL,
|
||||
/* Only set this so `PySequence_Check()` returns True. */
|
||||
/*sq_item*/ (ssizeargfunc)bpy_bmelemseq_subscript_int,
|
||||
/*was_sq_slice*/ NULL,
|
||||
/*sq_ass_item*/ NULL,
|
||||
/*was_sq_ass_slice*/ NULL,
|
||||
/*sq_contains*/ (objobjproc)bpy_bmelemseq_contains,
|
||||
/*sq_inplace_concat*/ NULL,
|
||||
/*sq_inplace_repeat*/ NULL,
|
||||
};
|
||||
|
||||
static PyMappingMethods bpy_bmelemseq_as_mapping = {
|
||||
(lenfunc)bpy_bmelemseq_length, /* mp_length */
|
||||
(binaryfunc)bpy_bmelemseq_subscript, /* mp_subscript */
|
||||
(objobjargproc)NULL, /* mp_ass_subscript */
|
||||
/*mp_len*/ (lenfunc)bpy_bmelemseq_length,
|
||||
/*mp_subscript*/ (binaryfunc)bpy_bmelemseq_subscript,
|
||||
/*mp_ass_subscript*/ (objobjargproc)NULL,
|
||||
};
|
||||
|
||||
/* for customdata access */
|
||||
static PyMappingMethods bpy_bm_elem_as_mapping = {
|
||||
(lenfunc)NULL,
|
||||
/* mp_length */ /* keep this empty, messes up 'if elem: ...' test */
|
||||
(binaryfunc)bpy_bmelem_subscript, /* mp_subscript */
|
||||
(objobjargproc)bpy_bmelem_ass_subscript, /* mp_ass_subscript */
|
||||
/*mp_len*/ (lenfunc)NULL, /* Keep this empty, messes up `if elem: ...` test. */
|
||||
/*mp_subscript*/ (binaryfunc)bpy_bmelem_subscript,
|
||||
/*mp_ass_subscript*/ (objobjargproc)bpy_bmelem_ass_subscript,
|
||||
};
|
||||
|
||||
/* Iterator
|
||||
|
||||
@@ -871,23 +871,23 @@ static int bpy_bmlayercollection_contains(BPy_BMLayerCollection *self, PyObject
|
||||
}
|
||||
|
||||
static PySequenceMethods bpy_bmlayercollection_as_sequence = {
|
||||
(lenfunc)bpy_bmlayercollection_length, /* sq_length */
|
||||
NULL, /* sq_concat */
|
||||
NULL, /* sq_repeat */
|
||||
(ssizeargfunc)bpy_bmlayercollection_subscript_int,
|
||||
/* sq_item */ /* Only set this so PySequence_Check() returns True */
|
||||
NULL, /* sq_slice */
|
||||
(ssizeobjargproc)NULL, /* sq_ass_item */
|
||||
NULL, /* *was* sq_ass_slice */
|
||||
(objobjproc)bpy_bmlayercollection_contains, /* sq_contains */
|
||||
(binaryfunc)NULL, /* sq_inplace_concat */
|
||||
(ssizeargfunc)NULL, /* sq_inplace_repeat */
|
||||
/*sq_length*/ (lenfunc)bpy_bmlayercollection_length,
|
||||
/*sq_concat*/ NULL,
|
||||
/*sq_repeat*/ NULL,
|
||||
/* Only set this so `PySequence_Check()` returns True. */
|
||||
/*sq_item*/ (ssizeargfunc)bpy_bmlayercollection_subscript_int,
|
||||
/*was_sq_slice*/ NULL, /* DEPRECATED. */
|
||||
/*sq_ass_item*/ NULL,
|
||||
/*was_sq_ass_slice*/ NULL, /* DEPRECATED. */
|
||||
/*sq_contains*/ (objobjproc)bpy_bmlayercollection_contains,
|
||||
/*sq_inplace_concat*/ NULL,
|
||||
/*sq_inplace_repeat*/ NULL,
|
||||
};
|
||||
|
||||
static PyMappingMethods bpy_bmlayercollection_as_mapping = {
|
||||
(lenfunc)bpy_bmlayercollection_length, /* mp_length */
|
||||
(binaryfunc)bpy_bmlayercollection_subscript, /* mp_subscript */
|
||||
(objobjargproc)NULL, /* mp_ass_subscript */
|
||||
/*mp_len*/ (lenfunc)bpy_bmlayercollection_length,
|
||||
/*mp_subscript*/ (binaryfunc)bpy_bmlayercollection_subscript,
|
||||
/*mp_ass_subscript*/ (objobjargproc)NULL,
|
||||
};
|
||||
|
||||
/* Iterator
|
||||
|
||||
@@ -486,26 +486,24 @@ static int bpy_bmdeformvert_contains(BPy_BMDeformVert *self, PyObject *value)
|
||||
|
||||
/* only defined for __contains__ */
|
||||
static PySequenceMethods bpy_bmdeformvert_as_sequence = {
|
||||
(lenfunc)bpy_bmdeformvert_len, /* sq_length */
|
||||
NULL, /* sq_concat */
|
||||
NULL, /* sq_repeat */
|
||||
|
||||
/*sq_length*/ (lenfunc)bpy_bmdeformvert_len,
|
||||
/*sq_concat*/ NULL,
|
||||
/*sq_repeat*/ NULL,
|
||||
/* NOTE: if this is set #PySequence_Check() returns True,
|
||||
* but in this case we don't want to be treated as a seq. */
|
||||
NULL, /* sq_item */
|
||||
|
||||
NULL, /* sq_slice */
|
||||
NULL, /* sq_ass_item */
|
||||
NULL, /* *was* sq_ass_slice */
|
||||
(objobjproc)bpy_bmdeformvert_contains, /* sq_contains */
|
||||
(binaryfunc)NULL, /* sq_inplace_concat */
|
||||
(ssizeargfunc)NULL, /* sq_inplace_repeat */
|
||||
/*sq_item*/ NULL,
|
||||
/*was_sq_slice*/ NULL, /* DEPRECATED. */
|
||||
/*sq_ass_item*/ NULL,
|
||||
/*was_sq_ass_slice*/ NULL, /* DEPRECATED. */
|
||||
/*sq_contains*/ (objobjproc)bpy_bmdeformvert_contains,
|
||||
/*sq_inplace_concat*/ NULL,
|
||||
/*sq_inplace_repeat*/ NULL,
|
||||
};
|
||||
|
||||
static PyMappingMethods bpy_bmdeformvert_as_mapping = {
|
||||
(lenfunc)bpy_bmdeformvert_len,
|
||||
(binaryfunc)bpy_bmdeformvert_subscript,
|
||||
(objobjargproc)bpy_bmdeformvert_ass_subscript,
|
||||
/*mp_len*/ (lenfunc)bpy_bmdeformvert_len,
|
||||
/*mp_subscript*/ (binaryfunc)bpy_bmdeformvert_subscript,
|
||||
/*mp_ass_subscript*/ (objobjargproc)bpy_bmdeformvert_ass_subscript,
|
||||
};
|
||||
|
||||
/* Methods
|
||||
|
||||
@@ -291,23 +291,23 @@ static int bpy_bmeditselseq_contains(BPy_BMEditSelSeq *self, PyObject *value)
|
||||
}
|
||||
|
||||
static PySequenceMethods bpy_bmeditselseq_as_sequence = {
|
||||
(lenfunc)bpy_bmeditselseq_length, /* sq_length */
|
||||
NULL, /* sq_concat */
|
||||
NULL, /* sq_repeat */
|
||||
(ssizeargfunc)bpy_bmeditselseq_subscript_int,
|
||||
/* sq_item */ /* Only set this so PySequence_Check() returns True */
|
||||
NULL, /* sq_slice */
|
||||
(ssizeobjargproc)NULL, /* sq_ass_item */
|
||||
NULL, /* *was* sq_ass_slice */
|
||||
(objobjproc)bpy_bmeditselseq_contains, /* sq_contains */
|
||||
(binaryfunc)NULL, /* sq_inplace_concat */
|
||||
(ssizeargfunc)NULL, /* sq_inplace_repeat */
|
||||
/*sq_length*/ (lenfunc)bpy_bmeditselseq_length,
|
||||
/*sq_concat*/ NULL,
|
||||
/*sq_repeat*/ NULL,
|
||||
/* Only set this so `PySequence_Check()` returns True. */
|
||||
/*sq_item*/ (ssizeargfunc)bpy_bmeditselseq_subscript_int,
|
||||
/*sq_slice */ NULL,
|
||||
/*sq_ass_item */ NULL,
|
||||
/*was_sq_ass_slice*/ NULL,
|
||||
/*sq_contains*/ (objobjproc)bpy_bmeditselseq_contains,
|
||||
/*sq_inplace_concat*/ NULL,
|
||||
/*sq_inplace_repeat*/ NULL,
|
||||
};
|
||||
|
||||
static PyMappingMethods bpy_bmeditselseq_as_mapping = {
|
||||
(lenfunc)bpy_bmeditselseq_length, /* mp_length */
|
||||
(binaryfunc)bpy_bmeditselseq_subscript, /* mp_subscript */
|
||||
(objobjargproc)NULL, /* mp_ass_subscript */
|
||||
/*mp_len*/ (lenfunc)bpy_bmeditselseq_length,
|
||||
/*mp_subscript*/ (binaryfunc)bpy_bmeditselseq_subscript,
|
||||
/*mp_ass_subscript*/ (objobjargproc)NULL,
|
||||
};
|
||||
|
||||
/* Iterator
|
||||
|
||||
@@ -491,22 +491,22 @@ static bool compare_dimensions(int ndim, const int *dim1, const Py_ssize_t *dim2
|
||||
* \{ */
|
||||
|
||||
static PySequenceMethods Buffer_SeqMethods = {
|
||||
(lenfunc)Buffer_len, /* sq_length */
|
||||
(binaryfunc)NULL, /* sq_concat */
|
||||
(ssizeargfunc)NULL, /* sq_repeat */
|
||||
(ssizeargfunc)Buffer_item, /* sq_item */
|
||||
(ssizessizeargfunc)NULL, /* sq_slice, deprecated, handled in Buffer_item */
|
||||
(ssizeobjargproc)Buffer_ass_item, /* sq_ass_item */
|
||||
(ssizessizeobjargproc)NULL, /* sq_ass_slice, deprecated handled in Buffer_ass_item */
|
||||
(objobjproc)NULL, /* sq_contains */
|
||||
(binaryfunc)NULL, /* sq_inplace_concat */
|
||||
(ssizeargfunc)NULL, /* sq_inplace_repeat */
|
||||
/*sq_length*/ (lenfunc)Buffer_len,
|
||||
/*sq_concat*/ NULL,
|
||||
/*sq_repeat*/ NULL,
|
||||
/*sq_item*/ (ssizeargfunc)Buffer_item,
|
||||
/*was_sq_slice*/ NULL, /* DEPRECATED. Handled by #Buffer_item. */
|
||||
/*sq_ass_item*/ (ssizeobjargproc)Buffer_ass_item,
|
||||
/*was_sq_ass_slice*/ NULL, /* DEPRECATED. Handled by #Buffer_ass_item. */
|
||||
/*sq_contains*/ NULL,
|
||||
/*sq_inplace_concat*/ NULL,
|
||||
/*sq_inplace_repeat*/ NULL,
|
||||
};
|
||||
|
||||
static PyMappingMethods Buffer_AsMapping = {
|
||||
(lenfunc)Buffer_len,
|
||||
(binaryfunc)Buffer_subscript,
|
||||
(objobjargproc)Buffer_ass_subscript,
|
||||
/*mp_len*/ (lenfunc)Buffer_len,
|
||||
/*mp_subscript*/ (binaryfunc)Buffer_subscript,
|
||||
/*mp_ass_subscript*/ (objobjargproc)Buffer_ass_subscript,
|
||||
};
|
||||
|
||||
static void Buffer_dealloc(Buffer *self);
|
||||
@@ -568,72 +568,55 @@ static PyGetSetDef Buffer_getseters[] = {
|
||||
};
|
||||
|
||||
PyTypeObject BGL_bufferType = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0) "bgl.Buffer", /* tp_name */
|
||||
sizeof(Buffer), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
(destructor)Buffer_dealloc, /* tp_dealloc */
|
||||
(printfunc)NULL, /* tp_print */
|
||||
NULL, /* tp_getattr */
|
||||
NULL, /* tp_setattr */
|
||||
NULL, /* tp_compare */
|
||||
(reprfunc)Buffer_repr, /* tp_repr */
|
||||
NULL, /* tp_as_number */
|
||||
&Buffer_SeqMethods, /* tp_as_sequence */
|
||||
&Buffer_AsMapping, /* PyMappingMethods *tp_as_mapping; */
|
||||
|
||||
/* More standard operations (here for binary compatibility) */
|
||||
|
||||
NULL, /* hashfunc tp_hash; */
|
||||
NULL, /* ternaryfunc tp_call; */
|
||||
NULL, /* reprfunc tp_str; */
|
||||
NULL, /* getattrofunc tp_getattro; */
|
||||
NULL, /* setattrofunc tp_setattro; */
|
||||
|
||||
/* Functions to access object as input/output buffer */
|
||||
NULL, /* PyBufferProcs *tp_as_buffer; */
|
||||
|
||||
/*** Flags to define presence of optional/expanded features ***/
|
||||
Py_TPFLAGS_DEFAULT, /* long tp_flags; */
|
||||
|
||||
NULL, /* char *tp_doc; Documentation string */
|
||||
/*** Assigned meaning in release 2.0 ***/
|
||||
/* call function for all accessible objects */
|
||||
NULL, /* traverseproc tp_traverse; */
|
||||
|
||||
/* delete references to contained objects */
|
||||
NULL, /* inquiry tp_clear; */
|
||||
|
||||
/*** Assigned meaning in release 2.1 ***/
|
||||
/*** rich comparisons ***/
|
||||
NULL, /* richcmpfunc tp_richcompare; */
|
||||
|
||||
/*** weak reference enabler ***/
|
||||
0, /* long tp_weaklistoffset; */
|
||||
|
||||
/*** Added in release 2.2 ***/
|
||||
/* Iterators */
|
||||
NULL, /* getiterfunc tp_iter; */
|
||||
NULL, /* iternextfunc tp_iternext; */
|
||||
/*** Attribute descriptor and subclassing stuff ***/
|
||||
Buffer_methods, /* struct PyMethodDef *tp_methods; */
|
||||
NULL, /* struct PyMemberDef *tp_members; */
|
||||
Buffer_getseters, /* struct PyGetSetDef *tp_getset; */
|
||||
NULL, /*tp_base*/
|
||||
NULL, /*tp_dict*/
|
||||
NULL, /*tp_descr_get*/
|
||||
NULL, /*tp_descr_set*/
|
||||
0, /*tp_dictoffset*/
|
||||
NULL, /*tp_init*/
|
||||
NULL, /*tp_alloc*/
|
||||
Buffer_new, /*tp_new*/
|
||||
NULL, /*tp_free*/
|
||||
NULL, /*tp_is_gc*/
|
||||
NULL, /*tp_bases*/
|
||||
NULL, /*tp_mro*/
|
||||
NULL, /*tp_cache*/
|
||||
NULL, /*tp_subclasses*/
|
||||
NULL, /*tp_weaklist*/
|
||||
NULL, /*tp_del*/
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
/*tp_name*/ "bgl.Buffer",
|
||||
/*tp_basicsize*/ sizeof(Buffer),
|
||||
/*tp_itemsize*/ 0,
|
||||
/*tp_dealloc*/ (destructor)Buffer_dealloc,
|
||||
/*tp_vectorcall_offset*/ 0,
|
||||
/*tp_getattr*/ NULL,
|
||||
/*tp_setattr*/ NULL,
|
||||
/*tp_as_async*/ NULL,
|
||||
/*tp_repr*/ (reprfunc)Buffer_repr,
|
||||
/*tp_as_number*/ NULL,
|
||||
/*tp_as_sequence*/ &Buffer_SeqMethods,
|
||||
/*tp_as_mapping*/ &Buffer_AsMapping,
|
||||
/*tp_hash*/ NULL,
|
||||
/*tp_call*/ NULL,
|
||||
/*tp_str*/ NULL,
|
||||
/*tp_getattro*/ NULL,
|
||||
/*tp_setattro*/ NULL,
|
||||
/*tp_as_buffer*/ NULL,
|
||||
/*tp_flags*/ Py_TPFLAGS_DEFAULT,
|
||||
/*tp_doc*/ NULL,
|
||||
/*tp_traverse*/ NULL,
|
||||
/*tp_clear*/ NULL,
|
||||
/*tp_richcompare*/ NULL,
|
||||
/*tp_weaklistoffset*/ 0,
|
||||
/*tp_iter*/ NULL,
|
||||
/*tp_iternext*/ NULL,
|
||||
/*tp_methods*/ Buffer_methods,
|
||||
/*tp_members*/ NULL,
|
||||
/*tp_getset*/ Buffer_getseters,
|
||||
/*tp_base*/ NULL,
|
||||
/*tp_dict*/ NULL,
|
||||
/*tp_descr_get*/ NULL,
|
||||
/*tp_descr_set*/ NULL,
|
||||
/*tp_dictoffset*/ 0,
|
||||
/*tp_init*/ NULL,
|
||||
/*tp_alloc*/ NULL,
|
||||
/*tp_new*/ Buffer_new,
|
||||
/*tp_free*/ NULL,
|
||||
/*tp_is_gc*/ NULL,
|
||||
/*tp_bases*/ NULL,
|
||||
/*tp_mro*/ NULL,
|
||||
/*tp_cache*/ NULL,
|
||||
/*tp_subclasses*/ NULL,
|
||||
/*tp_weaklist*/ NULL,
|
||||
/*tp_del*/ NULL,
|
||||
/*tp_version_tag*/ 0,
|
||||
/*tp_finalize*/ NULL,
|
||||
/*tp_vectorcall*/ NULL,
|
||||
};
|
||||
|
||||
static Buffer *BGL_MakeBuffer_FromData(
|
||||
|
||||
@@ -1156,36 +1156,36 @@ static int BPy_Group_ViewItems_Contains(BPy_IDGroup_View *self, PyObject *value)
|
||||
}
|
||||
|
||||
static PySequenceMethods BPy_IDGroup_ViewKeys_as_sequence = {
|
||||
(lenfunc)BPy_Group_View_len, /* sq_length */
|
||||
0, /* sq_concat */
|
||||
0, /* sq_repeat */
|
||||
0, /* sq_item */
|
||||
0, /* sq_slice */
|
||||
0, /* sq_ass_item */
|
||||
0, /* sq_ass_slice */
|
||||
(objobjproc)BPy_Group_ViewKeys_Contains, /* sq_contains */
|
||||
/*sq_length*/ (lenfunc)BPy_Group_View_len,
|
||||
/*sq_concat*/ NULL,
|
||||
/*sq_repeat*/ NULL,
|
||||
/*sq_item*/ NULL,
|
||||
/*was_sq_slice*/ NULL,
|
||||
/*sq_ass_item*/ NULL,
|
||||
/*was_sq_ass_slice*/ NULL,
|
||||
/*sq_contains*/ (objobjproc)BPy_Group_ViewKeys_Contains,
|
||||
};
|
||||
|
||||
static PySequenceMethods BPy_IDGroup_ViewValues_as_sequence = {
|
||||
(lenfunc)BPy_Group_View_len, /* sq_length */
|
||||
0, /* sq_concat */
|
||||
0, /* sq_repeat */
|
||||
0, /* sq_item */
|
||||
0, /* sq_slice */
|
||||
0, /* sq_ass_item */
|
||||
0, /* sq_ass_slice */
|
||||
(objobjproc)BPy_Group_ViewValues_Contains, /* sq_contains */
|
||||
/*sq_length*/ (lenfunc)BPy_Group_View_len,
|
||||
/*sq_concat*/ NULL,
|
||||
/*sq_repeat*/ NULL,
|
||||
/*sq_item*/ NULL,
|
||||
/*was_sq_slice*/ NULL,
|
||||
/*sq_ass_item*/ NULL,
|
||||
/*was_sq_ass_slice*/ NULL,
|
||||
/*sq_contains*/ (objobjproc)BPy_Group_ViewValues_Contains,
|
||||
};
|
||||
|
||||
static PySequenceMethods BPy_IDGroup_ViewItems_as_sequence = {
|
||||
(lenfunc)BPy_Group_View_len, /* sq_length */
|
||||
0, /* sq_concat */
|
||||
0, /* sq_repeat */
|
||||
0, /* sq_item */
|
||||
0, /* sq_slice */
|
||||
0, /* sq_ass_item */
|
||||
0, /* sq_ass_slice */
|
||||
(objobjproc)BPy_Group_ViewItems_Contains, /* sq_contains */
|
||||
/*sq_length*/ (lenfunc)BPy_Group_View_len,
|
||||
/*sq_concat*/ NULL,
|
||||
/*sq_repeat*/ NULL,
|
||||
/*sq_item*/ NULL,
|
||||
/*was_sq_slice*/ NULL,
|
||||
/*sq_ass_item*/ NULL,
|
||||
/*was_sq_ass_slice*/ NULL,
|
||||
/*sq_contains*/ (objobjproc)BPy_Group_ViewItems_Contains,
|
||||
};
|
||||
|
||||
/* Methods. */
|
||||
@@ -1551,84 +1551,76 @@ static struct PyMethodDef BPy_IDGroup_methods[] = {
|
||||
* \{ */
|
||||
|
||||
static PySequenceMethods BPy_IDGroup_Seq = {
|
||||
(lenfunc)BPy_IDGroup_Map_Len, /* lenfunc sq_length */
|
||||
NULL, /* binaryfunc sq_concat */
|
||||
NULL, /* ssizeargfunc sq_repeat */
|
||||
NULL,
|
||||
/* ssizeargfunc sq_item */ /* TODO: setting this will allow PySequence_Check to return True. */
|
||||
NULL, /* intintargfunc ***was_sq_slice*** */
|
||||
NULL, /* intobjargproc sq_ass_item */
|
||||
NULL, /* ssizeobjargproc ***was_sq_ass_slice*** */
|
||||
(objobjproc)BPy_IDGroup_Contains, /* objobjproc sq_contains */
|
||||
NULL, /* binaryfunc sq_inplace_concat */
|
||||
NULL, /* ssizeargfunc sq_inplace_repeat */
|
||||
/*sq_length*/ (lenfunc)BPy_IDGroup_Map_Len,
|
||||
/*sq_concat*/ NULL,
|
||||
/*sq_repeat*/ NULL,
|
||||
/* TODO: setting this will allow `PySequence_Check()` to return True. */
|
||||
/*sq_item*/ NULL,
|
||||
/*was_sq_slice*/ NULL, /* DEPRECATED. */
|
||||
/*sq_ass_item*/ NULL,
|
||||
/*was_sq_ass_slice*/ NULL, /* DEPRECATED. */
|
||||
/*sq_contains*/ (objobjproc)BPy_IDGroup_Contains,
|
||||
/*sq_inplace_concat*/ NULL,
|
||||
/*sq_inplace_repeat*/ NULL,
|
||||
};
|
||||
|
||||
static PyMappingMethods BPy_IDGroup_Mapping = {
|
||||
(lenfunc)BPy_IDGroup_Map_Len, /* inquiry mp_length */
|
||||
(binaryfunc)BPy_IDGroup_Map_GetItem, /* binaryfunc mp_subscript */
|
||||
(objobjargproc)BPy_IDGroup_Map_SetItem, /* objobjargproc mp_ass_subscript */
|
||||
/*mp_len*/ (lenfunc)BPy_IDGroup_Map_Len,
|
||||
/*mp_subscript*/ (binaryfunc)BPy_IDGroup_Map_GetItem,
|
||||
/*mp_ass_subscript*/ (objobjargproc)BPy_IDGroup_Map_SetItem,
|
||||
};
|
||||
|
||||
PyTypeObject BPy_IDGroup_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
/* For printing, in format "<module>.<name>" */
|
||||
"IDPropertyGroup", /* char *tp_name; */
|
||||
sizeof(BPy_IDProperty), /* int tp_basicsize; */
|
||||
0, /* tp_itemsize; For allocation */
|
||||
|
||||
/* Methods to implement standard operations */
|
||||
|
||||
NULL, /* destructor tp_dealloc; */
|
||||
0, /* tp_vectorcall_offset */
|
||||
NULL, /* getattrfunc tp_getattr; */
|
||||
NULL, /* setattrfunc tp_setattr; */
|
||||
NULL, /* cmpfunc tp_compare; */
|
||||
(reprfunc)BPy_IDGroup_repr, /* reprfunc tp_repr; */
|
||||
|
||||
/* Method suites for standard classes */
|
||||
|
||||
NULL, /* PyNumberMethods *tp_as_number; */
|
||||
&BPy_IDGroup_Seq, /* PySequenceMethods *tp_as_sequence; */
|
||||
&BPy_IDGroup_Mapping, /* PyMappingMethods *tp_as_mapping; */
|
||||
|
||||
/* More standard operations (here for binary compatibility) */
|
||||
|
||||
(hashfunc)BPy_IDGroup_hash, /* hashfunc tp_hash; */
|
||||
NULL, /* ternaryfunc tp_call; */
|
||||
NULL, /* reprfunc tp_str; */
|
||||
NULL, /* getattrofunc tp_getattro; */
|
||||
NULL, /* setattrofunc tp_setattro; */
|
||||
|
||||
/* Functions to access object as input/output buffer */
|
||||
NULL, /* PyBufferProcs *tp_as_buffer; */
|
||||
|
||||
/*** Flags to define presence of optional/expanded features ***/
|
||||
Py_TPFLAGS_DEFAULT, /* long tp_flags; */
|
||||
|
||||
NULL, /* char *tp_doc; Documentation string */
|
||||
/*** Assigned meaning in release 2.0 ***/
|
||||
/* call function for all accessible objects */
|
||||
NULL, /* traverseproc tp_traverse; */
|
||||
|
||||
/* delete references to contained objects */
|
||||
NULL, /* inquiry tp_clear; */
|
||||
|
||||
/*** Assigned meaning in release 2.1 ***/
|
||||
/*** rich comparisons ***/
|
||||
NULL, /* richcmpfunc tp_richcompare; */
|
||||
|
||||
/*** weak reference enabler ***/
|
||||
0, /* long tp_weaklistoffset; */
|
||||
|
||||
/*** Added in release 2.2 ***/
|
||||
/* Iterators */
|
||||
(getiterfunc)BPy_IDGroup_iter, /* getiterfunc tp_iter; */
|
||||
NULL, /* iternextfunc tp_iternext; */
|
||||
/*** Attribute descriptor and subclassing stuff ***/
|
||||
BPy_IDGroup_methods, /* struct PyMethodDef *tp_methods; */
|
||||
NULL, /* struct PyMemberDef *tp_members; */
|
||||
BPy_IDGroup_getseters, /* struct PyGetSetDef *tp_getset; */
|
||||
/* For printing, in format `<module>.<name>`. */
|
||||
/*tp_name*/ "IDPropertyGroup",
|
||||
/*tp_basicsize*/ sizeof(BPy_IDProperty),
|
||||
/*tp_itemsize*/ 0,
|
||||
/*tp_dealloc*/ NULL,
|
||||
/*tp_vectorcall_offset*/ 0,
|
||||
/*tp_getattr*/ NULL,
|
||||
/*tp_setattr*/ NULL,
|
||||
/*tp_as_async*/ NULL,
|
||||
/*tp_repr*/ (reprfunc)BPy_IDGroup_repr,
|
||||
/*tp_as_number*/ NULL,
|
||||
/*tp_as_sequence*/ &BPy_IDGroup_Seq,
|
||||
/*tp_as_mapping*/ &BPy_IDGroup_Mapping,
|
||||
/*tp_hash*/ (hashfunc)BPy_IDGroup_hash,
|
||||
/*tp_call*/ NULL,
|
||||
/*tp_str*/ NULL,
|
||||
/*tp_getattro*/ NULL,
|
||||
/*tp_setattro*/ NULL,
|
||||
/*tp_as_buffer*/ NULL,
|
||||
/*tp_flags*/ Py_TPFLAGS_DEFAULT,
|
||||
/*tp_doc*/ NULL,
|
||||
/*tp_traverse*/ NULL,
|
||||
/*tp_clear*/ NULL,
|
||||
/*tp_richcompare*/ NULL,
|
||||
/*tp_weaklistoffset*/ 0,
|
||||
/*tp_iter*/ (getiterfunc)BPy_IDGroup_iter,
|
||||
/*tp_iternext*/ NULL,
|
||||
/*tp_methods*/ BPy_IDGroup_methods,
|
||||
/*tp_members*/ NULL,
|
||||
/*tp_getset*/ BPy_IDGroup_getseters,
|
||||
/*tp_base*/ NULL,
|
||||
/*tp_dict*/ NULL,
|
||||
/*tp_descr_get*/ NULL,
|
||||
/*tp_descr_set*/ NULL,
|
||||
/*tp_dictoffset*/ 0,
|
||||
/*tp_init*/ NULL,
|
||||
/*tp_alloc*/ NULL,
|
||||
/*tp_new*/ NULL,
|
||||
/*tp_free*/ NULL,
|
||||
/*tp_is_gc*/ NULL,
|
||||
/*tp_bases*/ NULL,
|
||||
/*tp_mro*/ NULL,
|
||||
/*tp_cache*/ NULL,
|
||||
/*tp_subclasses*/ NULL,
|
||||
/*tp_weaklist*/ NULL,
|
||||
/*tp_del*/ NULL,
|
||||
/*tp_version_tag*/ 0,
|
||||
/*tp_finalize*/ NULL,
|
||||
/*tp_vectorcall*/ NULL,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
@@ -1768,17 +1760,16 @@ static int BPy_IDArray_SetItem(BPy_IDArray *self, int index, PyObject *value)
|
||||
}
|
||||
|
||||
static PySequenceMethods BPy_IDArray_Seq = {
|
||||
(lenfunc)BPy_IDArray_Len, /* inquiry sq_length */
|
||||
NULL, /* binaryfunc sq_concat */
|
||||
NULL, /* intargfunc sq_repeat */
|
||||
(ssizeargfunc)BPy_IDArray_GetItem, /* intargfunc sq_item */
|
||||
NULL, /* intintargfunc sq_slice */
|
||||
(ssizeobjargproc)BPy_IDArray_SetItem, /* intobjargproc sq_ass_item */
|
||||
NULL, /* intintobjargproc sq_ass_slice */
|
||||
NULL, /* objobjproc sq_contains */
|
||||
/* Added in release 2.0 */
|
||||
NULL, /* binaryfunc sq_inplace_concat */
|
||||
NULL, /* intargfunc sq_inplace_repeat */
|
||||
/*sq_length*/ (lenfunc)BPy_IDArray_Len,
|
||||
/*sq_concat*/ NULL,
|
||||
/*sq_repeat*/ NULL,
|
||||
/*sq_item*/ (ssizeargfunc)BPy_IDArray_GetItem,
|
||||
/*was_sq_slice*/ NULL, /* DEPRECATED. */
|
||||
/*sq_ass_item*/ (ssizeobjargproc)BPy_IDArray_SetItem,
|
||||
/*was_sq_ass_slice*/ NULL, /* DEPRECATED. */
|
||||
/*sq_contains*/ NULL,
|
||||
/*sq_inplace_concat*/ NULL,
|
||||
/*sq_inplace_repeat*/ NULL,
|
||||
};
|
||||
|
||||
/* sequence slice (get): idparr[a:b] */
|
||||
@@ -1926,9 +1917,9 @@ static int BPy_IDArray_ass_subscript(BPy_IDArray *self, PyObject *item, PyObject
|
||||
}
|
||||
|
||||
static PyMappingMethods BPy_IDArray_AsMapping = {
|
||||
(lenfunc)BPy_IDArray_Len,
|
||||
(binaryfunc)BPy_IDArray_subscript,
|
||||
(objobjargproc)BPy_IDArray_ass_subscript,
|
||||
/*mp_len*/ (lenfunc)BPy_IDArray_Len,
|
||||
/*mp_subscript*/ (binaryfunc)BPy_IDArray_subscript,
|
||||
/*mp_ass_subscript*/ (objobjargproc)BPy_IDArray_ass_subscript,
|
||||
};
|
||||
|
||||
static int itemsize_by_idarray_type(int array_type)
|
||||
@@ -1971,8 +1962,8 @@ static void BPy_IDArray_releasebuffer(BPy_IDArray *UNUSED(self), Py_buffer *view
|
||||
}
|
||||
|
||||
static PyBufferProcs BPy_IDArray_Buffer = {
|
||||
(getbufferproc)BPy_IDArray_getbuffer,
|
||||
(releasebufferproc)BPy_IDArray_releasebuffer,
|
||||
/*bf_getbuffer*/ (getbufferproc)BPy_IDArray_getbuffer,
|
||||
/*bf_releasebuffer*/ (releasebufferproc)BPy_IDArray_releasebuffer,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
@@ -1983,83 +1974,55 @@ static PyBufferProcs BPy_IDArray_Buffer = {
|
||||
|
||||
PyTypeObject BPy_IDArray_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
/* For printing, in format "<module>.<name>" */
|
||||
"IDPropertyArray", /* char *tp_name; */
|
||||
sizeof(BPy_IDArray), /* int tp_basicsize; */
|
||||
0, /* tp_itemsize; For allocation */
|
||||
|
||||
/* Methods to implement standard operations */
|
||||
|
||||
NULL, /* destructor tp_dealloc; */
|
||||
0, /* tp_vectorcall_offset */
|
||||
NULL, /* getattrfunc tp_getattr; */
|
||||
NULL, /* setattrfunc tp_setattr; */
|
||||
NULL, /* cmpfunc tp_compare; */
|
||||
(reprfunc)BPy_IDArray_repr, /* reprfunc tp_repr; */
|
||||
|
||||
/* Method suites for standard classes */
|
||||
|
||||
NULL, /* PyNumberMethods *tp_as_number; */
|
||||
&BPy_IDArray_Seq, /* PySequenceMethods *tp_as_sequence; */
|
||||
&BPy_IDArray_AsMapping, /* PyMappingMethods *tp_as_mapping; */
|
||||
|
||||
/* More standard operations (here for binary compatibility) */
|
||||
|
||||
NULL, /* hashfunc tp_hash; */
|
||||
NULL, /* ternaryfunc tp_call; */
|
||||
NULL, /* reprfunc tp_str; */
|
||||
NULL, /* getattrofunc tp_getattro; */
|
||||
NULL, /* setattrofunc tp_setattro; */
|
||||
|
||||
/* Functions to access object as input/output buffer */
|
||||
&BPy_IDArray_Buffer, /* PyBufferProcs *tp_as_buffer; */
|
||||
|
||||
/*** Flags to define presence of optional/expanded features ***/
|
||||
Py_TPFLAGS_DEFAULT, /* long tp_flags; */
|
||||
|
||||
NULL, /* char *tp_doc; Documentation string */
|
||||
/*** Assigned meaning in release 2.0 ***/
|
||||
/* call function for all accessible objects */
|
||||
NULL, /* traverseproc tp_traverse; */
|
||||
|
||||
/* delete references to contained objects */
|
||||
NULL, /* inquiry tp_clear; */
|
||||
|
||||
/*** Assigned meaning in release 2.1 ***/
|
||||
/*** rich comparisons ***/
|
||||
NULL, /* richcmpfunc tp_richcompare; */
|
||||
|
||||
/*** weak reference enabler ***/
|
||||
0, /* long tp_weaklistoffset; */
|
||||
|
||||
/*** Added in release 2.2 ***/
|
||||
/* Iterators */
|
||||
NULL, /* getiterfunc tp_iter; */
|
||||
NULL, /* iternextfunc tp_iternext; */
|
||||
|
||||
/*** Attribute descriptor and subclassing stuff ***/
|
||||
BPy_IDArray_methods, /* struct PyMethodDef *tp_methods; */
|
||||
NULL, /* struct PyMemberDef *tp_members; */
|
||||
BPy_IDArray_getseters, /* struct PyGetSetDef *tp_getset; */
|
||||
NULL, /* struct _typeobject *tp_base; */
|
||||
NULL, /* PyObject *tp_dict; */
|
||||
NULL, /* descrgetfunc tp_descr_get; */
|
||||
NULL, /* descrsetfunc tp_descr_set; */
|
||||
0, /* long tp_dictoffset; */
|
||||
NULL, /* initproc tp_init; */
|
||||
NULL, /* allocfunc tp_alloc; */
|
||||
NULL, /* newfunc tp_new; */
|
||||
/* Low-level free-memory routine */
|
||||
NULL, /* freefunc tp_free; */
|
||||
/* For PyObject_IS_GC */
|
||||
NULL, /* inquiry tp_is_gc; */
|
||||
NULL, /* PyObject *tp_bases; */
|
||||
/* method resolution order */
|
||||
NULL, /* PyObject *tp_mro; */
|
||||
NULL, /* PyObject *tp_cache; */
|
||||
NULL, /* PyObject *tp_subclasses; */
|
||||
NULL, /* PyObject *tp_weaklist; */
|
||||
NULL,
|
||||
/* For printing, in format `<module>.<name>`. */
|
||||
/*tp_name*/ "IDPropertyArray",
|
||||
/*tp_basicsize*/ sizeof(BPy_IDArray),
|
||||
/*tp_itemsize*/ 0,
|
||||
/*tp_dealloc*/ NULL,
|
||||
/*tp_vectorcall_offset*/ 0,
|
||||
/*tp_getattr*/ NULL,
|
||||
/*tp_setattr*/ NULL,
|
||||
/*tp_as_async*/ NULL,
|
||||
/*tp_repr*/ (reprfunc)BPy_IDArray_repr,
|
||||
/*tp_as_number*/ NULL,
|
||||
/*tp_as_sequence*/ &BPy_IDArray_Seq,
|
||||
/*tp_as_mapping*/ &BPy_IDArray_AsMapping,
|
||||
/*tp_hash*/ NULL,
|
||||
/*tp_call*/ NULL,
|
||||
/*tp_str*/ NULL,
|
||||
/*tp_getattro*/ NULL,
|
||||
/*tp_setattro*/ NULL,
|
||||
/*tp_as_buffer*/ &BPy_IDArray_Buffer,
|
||||
/*tp_flags*/ Py_TPFLAGS_DEFAULT,
|
||||
/*tp_doc*/ NULL,
|
||||
/*tp_traverse*/ NULL,
|
||||
/*tp_clear*/ NULL,
|
||||
/*tp_richcompare*/ NULL,
|
||||
/*tp_weaklistoffset*/ 0,
|
||||
/*tp_iter*/ NULL,
|
||||
/*tp_iternext*/ NULL,
|
||||
/*tp_methods*/ BPy_IDArray_methods,
|
||||
/*tp_members*/ NULL,
|
||||
/*tp_getset*/ BPy_IDArray_getseters,
|
||||
/*tp_base*/ NULL,
|
||||
/*tp_dict*/ NULL,
|
||||
/*tp_descr_get*/ NULL,
|
||||
/*tp_descr_set*/ NULL,
|
||||
/*tp_dictoffset*/ 0,
|
||||
/*tp_init*/ NULL,
|
||||
/*tp_alloc*/ NULL,
|
||||
/*tp_new*/ NULL,
|
||||
/*tp_free*/ NULL,
|
||||
/*tp_is_gc*/ NULL,
|
||||
/*tp_bases*/ NULL,
|
||||
/*tp_mro*/ NULL,
|
||||
/*tp_cache*/ NULL,
|
||||
/*tp_subclasses*/ NULL,
|
||||
/*tp_weaklist*/ NULL,
|
||||
/*tp_del*/ NULL,
|
||||
/*tp_version_tag*/ 0,
|
||||
/*tp_finalize*/ NULL,
|
||||
/*tp_vectorcall*/ NULL,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
@@ -660,63 +660,55 @@ static Py_hash_t BPy_IDPropertyUIManager_hash(BPy_IDPropertyUIManager *self)
|
||||
|
||||
PyTypeObject BPy_IDPropertyUIManager_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
/* For printing, in format "<module>.<name>" */
|
||||
"IDPropertyUIManager", /* char *tp_name; */
|
||||
sizeof(BPy_IDPropertyUIManager), /* int tp_basicsize; */
|
||||
0, /* tp_itemsize; For allocation */
|
||||
|
||||
/* Methods to implement standard operations */
|
||||
|
||||
NULL, /* destructor tp_dealloc; */
|
||||
0, /* tp_vectorcall_offset */
|
||||
NULL, /* getattrfunc tp_getattr; */
|
||||
NULL, /* setattrfunc tp_setattr; */
|
||||
NULL, /* cmpfunc tp_compare; */
|
||||
(reprfunc)BPy_IDPropertyUIManager_repr, /* reprfunc tp_repr; */
|
||||
|
||||
/* Method suites for standard classes */
|
||||
|
||||
NULL, /* PyNumberMethods *tp_as_number; */
|
||||
NULL, /* PySequenceMethods *tp_as_sequence; */
|
||||
NULL, /* PyMappingMethods *tp_as_mapping; */
|
||||
|
||||
/* More standard operations (here for binary compatibility) */
|
||||
|
||||
(hashfunc)BPy_IDPropertyUIManager_hash, /* hashfunc tp_hash; */
|
||||
NULL, /* ternaryfunc tp_call; */
|
||||
NULL, /* reprfunc tp_str; */
|
||||
NULL, /* getattrofunc tp_getattro; */
|
||||
NULL, /* setattrofunc tp_setattro; */
|
||||
|
||||
/* Functions to access object as input/output buffer */
|
||||
NULL, /* PyBufferProcs *tp_as_buffer; */
|
||||
|
||||
/*** Flags to define presence of optional/expanded features ***/
|
||||
Py_TPFLAGS_DEFAULT, /* long tp_flags; */
|
||||
|
||||
NULL, /* char *tp_doc; Documentation string */
|
||||
/*** Assigned meaning in release 2.0 ***/
|
||||
/* call function for all accessible objects */
|
||||
NULL, /* traverseproc tp_traverse; */
|
||||
|
||||
/* delete references to contained objects */
|
||||
NULL, /* inquiry tp_clear; */
|
||||
|
||||
/*** Assigned meaning in release 2.1 ***/
|
||||
/*** rich comparisons ***/
|
||||
NULL, /* richcmpfunc tp_richcompare; */
|
||||
|
||||
/*** weak reference enabler ***/
|
||||
0, /* long tp_weaklistoffset; */
|
||||
|
||||
/*** Added in release 2.2 ***/
|
||||
/* Iterators */
|
||||
NULL, /* getiterfunc tp_iter; */
|
||||
NULL, /* iternextfunc tp_iternext; */
|
||||
/*** Attribute descriptor and subclassing stuff ***/
|
||||
BPy_IDPropertyUIManager_methods, /* struct PyMethodDef *tp_methods; */
|
||||
NULL, /* struct PyMemberDef *tp_members; */
|
||||
NULL, /* struct PyGetSetDef *tp_getset; */
|
||||
/* For printing, in format `<module>.<name>`. */
|
||||
/*tp_name*/ "IDPropertyUIManager",
|
||||
/*tp_basicsize*/ sizeof(BPy_IDPropertyUIManager),
|
||||
/*tp_itemsize*/ 0,
|
||||
/*tp_dealloc*/ NULL,
|
||||
/*tp_vectorcall_offset*/ 0,
|
||||
/*tp_getattr*/ NULL,
|
||||
/*tp_setattr*/ NULL,
|
||||
/*tp_as_async*/ NULL,
|
||||
/*tp_repr*/ (reprfunc)BPy_IDPropertyUIManager_repr,
|
||||
/*tp_as_number*/ NULL,
|
||||
/*tp_as_sequence*/ NULL,
|
||||
/*tp_as_mapping*/ NULL,
|
||||
/*tp_hash*/ (hashfunc)BPy_IDPropertyUIManager_hash,
|
||||
/*tp_call*/ NULL,
|
||||
/*tp_str*/ NULL,
|
||||
/*tp_getattro*/ NULL,
|
||||
/*tp_setattro*/ NULL,
|
||||
/*tp_as_buffer*/ NULL,
|
||||
/*tp_flags*/ Py_TPFLAGS_DEFAULT,
|
||||
/*tp_doc*/ NULL,
|
||||
/*tp_traverse*/ NULL,
|
||||
/*tp_clear*/ NULL,
|
||||
/*tp_richcompare*/ NULL,
|
||||
/*tp_weaklistoffset*/ 0,
|
||||
/*tp_iter*/ NULL,
|
||||
/*tp_iternext*/ NULL,
|
||||
/*tp_methods*/ BPy_IDPropertyUIManager_methods,
|
||||
/*tp_members*/ NULL,
|
||||
/*tp_getset*/ NULL,
|
||||
/*tp_base*/ NULL,
|
||||
/*tp_dict*/ NULL,
|
||||
/*tp_descr_get*/ NULL,
|
||||
/*tp_descr_set*/ NULL,
|
||||
/*tp_dictoffset*/ 0,
|
||||
/*tp_init*/ NULL,
|
||||
/*tp_alloc*/ NULL,
|
||||
/*tp_new*/ NULL,
|
||||
/*tp_free*/ NULL,
|
||||
/*tp_is_gc*/ NULL,
|
||||
/*tp_bases*/ NULL,
|
||||
/*tp_mro*/ NULL,
|
||||
/*tp_cache*/ NULL,
|
||||
/*tp_subclasses*/ NULL,
|
||||
/*tp_weaklist*/ NULL,
|
||||
/*tp_del*/ NULL,
|
||||
/*tp_version_tag*/ 0,
|
||||
/*tp_finalize*/ NULL,
|
||||
/*tp_vectorcall*/ NULL,
|
||||
};
|
||||
|
||||
void IDPropertyUIData_Init_Types()
|
||||
|
||||
@@ -348,63 +348,54 @@ static Py_hash_t py_imbuf_hash(Py_ImBuf *self)
|
||||
|
||||
PyTypeObject Py_ImBuf_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
/* For printing, in format "<module>.<name>" */
|
||||
"ImBuf", /* tp_name */
|
||||
sizeof(Py_ImBuf), /* int tp_basicsize; */
|
||||
0, /* tp_itemsize; For allocation */
|
||||
|
||||
/* Methods to implement standard operations */
|
||||
|
||||
(destructor)py_imbuf_dealloc, /* destructor tp_dealloc; */
|
||||
0, /* tp_vectorcall_offset */
|
||||
NULL, /* getattrfunc tp_getattr; */
|
||||
NULL, /* setattrfunc tp_setattr; */
|
||||
NULL, /* cmpfunc tp_compare; */
|
||||
(reprfunc)py_imbuf_repr, /* reprfunc tp_repr; */
|
||||
|
||||
/* Method suites for standard classes */
|
||||
|
||||
NULL, /* PyNumberMethods *tp_as_number; */
|
||||
NULL, /* PySequenceMethods *tp_as_sequence; */
|
||||
NULL, /* PyMappingMethods *tp_as_mapping; */
|
||||
|
||||
/* More standard operations (here for binary compatibility) */
|
||||
|
||||
(hashfunc)py_imbuf_hash, /* hashfunc tp_hash; */
|
||||
NULL, /* ternaryfunc tp_call; */
|
||||
NULL, /* reprfunc tp_str; */
|
||||
NULL, /* getattrofunc tp_getattro; */
|
||||
NULL, /* setattrofunc tp_setattro; */
|
||||
|
||||
/* Functions to access object as input/output buffer */
|
||||
NULL, /* PyBufferProcs *tp_as_buffer; */
|
||||
|
||||
/*** Flags to define presence of optional/expanded features ***/
|
||||
Py_TPFLAGS_DEFAULT, /* long tp_flags; */
|
||||
|
||||
NULL, /* char *tp_doc; Documentation string */
|
||||
/*** Assigned meaning in release 2.0 ***/
|
||||
/* call function for all accessible objects */
|
||||
NULL, /* traverseproc tp_traverse; */
|
||||
|
||||
/* delete references to contained objects */
|
||||
NULL, /* inquiry tp_clear; */
|
||||
|
||||
/*** Assigned meaning in release 2.1 ***/
|
||||
/*** rich comparisons ***/
|
||||
NULL, /* richcmpfunc tp_richcompare; */
|
||||
|
||||
/*** weak reference enabler ***/
|
||||
0, /* long tp_weaklistoffset; */
|
||||
|
||||
/*** Added in release 2.2 ***/
|
||||
/* Iterators */
|
||||
NULL, /* getiterfunc tp_iter; */
|
||||
NULL, /* iternextfunc tp_iternext; */
|
||||
/*** Attribute descriptor and subclassing stuff ***/
|
||||
Py_ImBuf_methods, /* struct PyMethodDef *tp_methods; */
|
||||
NULL, /* struct PyMemberDef *tp_members; */
|
||||
Py_ImBuf_getseters, /* struct PyGetSetDef *tp_getset; */
|
||||
/*tp_name*/ "ImBuf",
|
||||
/*tp_basicsize*/ sizeof(Py_ImBuf),
|
||||
/*tp_itemsize*/ 0,
|
||||
/*tp_dealloc*/ (destructor)py_imbuf_dealloc,
|
||||
/*tp_vectorcall_offset*/ 0,
|
||||
/*tp_getattr*/ NULL,
|
||||
/*tp_setattr*/ NULL,
|
||||
/*tp_as_async*/ NULL,
|
||||
/*tp_repr*/ (reprfunc)py_imbuf_repr,
|
||||
/*tp_as_number*/ NULL,
|
||||
/*tp_as_sequence*/ NULL,
|
||||
/*tp_as_mapping*/ NULL,
|
||||
/*tp_hash*/ (hashfunc)py_imbuf_hash,
|
||||
/*tp_call*/ NULL,
|
||||
/*tp_str*/ NULL,
|
||||
/*tp_getattro*/ NULL,
|
||||
/*tp_setattro*/ NULL,
|
||||
/*tp_as_buffer*/ NULL,
|
||||
/*tp_flags*/ Py_TPFLAGS_DEFAULT,
|
||||
/*tp_doc*/ NULL,
|
||||
/*tp_traverse*/ NULL,
|
||||
/*tp_clear*/ NULL,
|
||||
/*tp_richcompare*/ NULL,
|
||||
/*tp_weaklistoffset*/ 0,
|
||||
/*tp_iter*/ NULL,
|
||||
/*tp_iternext*/ NULL,
|
||||
/*tp_methods*/ Py_ImBuf_methods,
|
||||
/*tp_members*/ NULL,
|
||||
/*tp_getset*/ Py_ImBuf_getseters,
|
||||
/*tp_base*/ NULL,
|
||||
/*tp_dict*/ NULL,
|
||||
/*tp_descr_get*/ NULL,
|
||||
/*tp_descr_set*/ NULL,
|
||||
/*tp_dictoffset*/ 0,
|
||||
/*tp_init*/ NULL,
|
||||
/*tp_alloc*/ NULL,
|
||||
/*tp_new*/ NULL,
|
||||
/*tp_free*/ NULL,
|
||||
/*tp_is_gc*/ NULL,
|
||||
/*tp_bases*/ NULL,
|
||||
/*tp_mro*/ NULL,
|
||||
/*tp_cache*/ NULL,
|
||||
/*tp_subclasses*/ NULL,
|
||||
/*tp_weaklist*/ NULL,
|
||||
/*tp_del*/ NULL,
|
||||
/*tp_version_tag*/ 0,
|
||||
/*tp_finalize*/ NULL,
|
||||
/*tp_vectorcall*/ NULL,
|
||||
};
|
||||
|
||||
static PyObject *Py_ImBuf_CreatePyObject(ImBuf *ibuf)
|
||||
|
||||
@@ -579,22 +579,22 @@ static PyGetSetDef pygpu_buffer_getseters[] = {
|
||||
};
|
||||
|
||||
static PySequenceMethods pygpu_buffer__tp_as_sequence = {
|
||||
(lenfunc)pygpu_buffer__sq_length, /* sq_length */
|
||||
(binaryfunc)NULL, /* sq_concat */
|
||||
(ssizeargfunc)NULL, /* sq_repeat */
|
||||
(ssizeargfunc)pygpu_buffer__sq_item, /* sq_item */
|
||||
(ssizessizeargfunc)NULL, /* sq_slice, deprecated, handled in pygpu_buffer__sq_item */
|
||||
(ssizeobjargproc)pygpu_buffer__sq_ass_item, /* sq_ass_item */
|
||||
(ssizessizeobjargproc)NULL, /* sq_ass_slice, deprecated handled in pygpu_buffer__sq_ass_item */
|
||||
(objobjproc)NULL, /* sq_contains */
|
||||
(binaryfunc)NULL, /* sq_inplace_concat */
|
||||
(ssizeargfunc)NULL, /* sq_inplace_repeat */
|
||||
/*sq_length*/ (lenfunc)pygpu_buffer__sq_length,
|
||||
/*sq_concat*/ NULL,
|
||||
/*sq_repeat*/ NULL,
|
||||
/*sq_item*/ (ssizeargfunc)pygpu_buffer__sq_item,
|
||||
/*was_sq_slice*/ NULL, /* DEPRECATED. Handled by #pygpu_buffer__sq_item. */
|
||||
/*sq_ass_item*/ (ssizeobjargproc)pygpu_buffer__sq_ass_item,
|
||||
/*was_sq_ass_slice*/ NULL, /* DEPRECATED. Handled by #pygpu_buffer__sq_ass_item. */
|
||||
/*sq_contains*/ NULL,
|
||||
/*sq_inplace_concat*/ NULL,
|
||||
/*sq_inplace_repeat*/ NULL,
|
||||
};
|
||||
|
||||
static PyMappingMethods pygpu_buffer__tp_as_mapping = {
|
||||
(lenfunc)pygpu_buffer__sq_length,
|
||||
(binaryfunc)pygpu_buffer__mp_subscript,
|
||||
(objobjargproc)pygpu_buffer__mp_ass_subscript,
|
||||
/*mp_len*/ (lenfunc)pygpu_buffer__sq_length,
|
||||
/*mp_subscript*/ (binaryfunc)pygpu_buffer__mp_subscript,
|
||||
/*mp_ass_subscript*/ (objobjargproc)pygpu_buffer__mp_ass_subscript,
|
||||
};
|
||||
|
||||
#ifdef PYGPU_BUFFER_PROTOCOL
|
||||
@@ -648,8 +648,8 @@ static void pygpu_buffer__bf_releasebuffer(PyObject *UNUSED(exporter), Py_buffer
|
||||
}
|
||||
|
||||
static PyBufferProcs pygpu_buffer__tp_as_buffer = {
|
||||
(getbufferproc)pygpu_buffer__bf_getbuffer,
|
||||
(releasebufferproc)pygpu_buffer__bf_releasebuffer,
|
||||
/*bf_getbuffer*/ (getbufferproc)pygpu_buffer__bf_getbuffer,
|
||||
/*bf_releasebuffer*/ (releasebufferproc)pygpu_buffer__bf_releasebuffer,
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ static PyObject *bpy_app_handlers_persistent_new(PyTypeObject *UNUSED(type),
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* dummy type because decorators can't be PyCFunctions */
|
||||
/** Dummy type because decorators can't be a #PyCFunction. */
|
||||
static PyTypeObject BPyPersistent_Type = {
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
@@ -140,46 +140,54 @@ static PyTypeObject BPyPersistent_Type = {
|
||||
#else
|
||||
PyVarObject_HEAD_INIT(&PyType_Type, 0)
|
||||
#endif
|
||||
|
||||
"persistent", /* tp_name */
|
||||
0, /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
/* methods */
|
||||
0, /* tp_dealloc */
|
||||
0, /* tp_print */
|
||||
0, /* tp_getattr */
|
||||
0, /* tp_setattr */
|
||||
0, /* tp_reserved */
|
||||
0, /* tp_repr */
|
||||
0, /* tp_as_number */
|
||||
0, /* tp_as_sequence */
|
||||
0, /* tp_as_mapping */
|
||||
0, /* tp_hash */
|
||||
0, /* tp_call */
|
||||
0, /* tp_str */
|
||||
0, /* tp_getattro */
|
||||
0, /* tp_setattro */
|
||||
0, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
|
||||
0, /* tp_doc */
|
||||
0, /* tp_traverse */
|
||||
0, /* tp_clear */
|
||||
0, /* tp_richcompare */
|
||||
0, /* tp_weaklistoffset */
|
||||
0, /* tp_iter */
|
||||
0, /* tp_iternext */
|
||||
0, /* tp_methods */
|
||||
0, /* tp_members */
|
||||
0, /* tp_getset */
|
||||
0, /* tp_base */
|
||||
0, /* tp_dict */
|
||||
0, /* tp_descr_get */
|
||||
0, /* tp_descr_set */
|
||||
0, /* tp_dictoffset */
|
||||
0, /* tp_init */
|
||||
0, /* tp_alloc */
|
||||
bpy_app_handlers_persistent_new, /* tp_new */
|
||||
0, /* tp_free */
|
||||
/*tp_name*/ "persistent",
|
||||
/*tp_basicsize*/ 0,
|
||||
/*tp_itemsize*/ 0,
|
||||
/*tp_dealloc*/ NULL,
|
||||
/*tp_vectorcall_offset*/ 0,
|
||||
/*tp_getattr*/ NULL,
|
||||
/*tp_setattr*/ NULL,
|
||||
/*tp_as_async*/ NULL,
|
||||
/*tp_repr*/ NULL,
|
||||
/*tp_as_number*/ NULL,
|
||||
/*tp_as_sequence*/ NULL,
|
||||
/*tp_as_mapping*/ NULL,
|
||||
/*tp_hash*/ NULL,
|
||||
/*tp_call*/ NULL,
|
||||
/*tp_str*/ NULL,
|
||||
/*tp_getattro*/ NULL,
|
||||
/*tp_setattro*/ NULL,
|
||||
/*tp_as_buffer*/ NULL,
|
||||
/*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
|
||||
/*tp_doc*/ NULL,
|
||||
/*tp_traverse*/ NULL,
|
||||
/*tp_clear*/ NULL,
|
||||
/*tp_richcompare*/ NULL,
|
||||
/*tp_weaklistoffset*/ 0,
|
||||
/*tp_iter*/ NULL,
|
||||
/*tp_iternext*/ NULL,
|
||||
/*tp_methods*/ NULL,
|
||||
/*tp_members*/ NULL,
|
||||
/*tp_getset*/ NULL,
|
||||
/*tp_base*/ NULL,
|
||||
/*tp_dict*/ NULL,
|
||||
/*tp_descr_get*/ NULL,
|
||||
/*tp_descr_set*/ NULL,
|
||||
/*tp_dictoffset*/ 0,
|
||||
/*tp_init*/ NULL,
|
||||
/*tp_alloc*/ NULL,
|
||||
/*tp_new*/ bpy_app_handlers_persistent_new,
|
||||
/*tp_free*/ NULL,
|
||||
/*tp_is_gc*/ NULL,
|
||||
/*tp_bases*/ NULL,
|
||||
/*tp_mro*/ NULL,
|
||||
/*tp_cache*/ NULL,
|
||||
/*tp_subclasses*/ NULL,
|
||||
/*tp_weaklist*/ NULL,
|
||||
/*tp_del*/ NULL,
|
||||
/*tp_version_tag*/ 0,
|
||||
/*tp_finalize*/ NULL,
|
||||
/*tp_vectorcall*/ NULL,
|
||||
};
|
||||
|
||||
static PyObject *py_cb_array[BKE_CB_EVT_TOT] = {NULL};
|
||||
|
||||
@@ -773,84 +773,54 @@ PyDoc_STRVAR(app_translations_doc,
|
||||
"\n");
|
||||
static PyTypeObject BlenderAppTranslationsType = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
/* tp_name */
|
||||
"bpy.app._translations_type",
|
||||
/* tp_basicsize */
|
||||
sizeof(BlenderAppTranslations),
|
||||
0, /* tp_itemsize */
|
||||
/* methods */
|
||||
/* No destructor, this is a singleton! */
|
||||
NULL, /* tp_dealloc */
|
||||
0, /* tp_vectorcall_offset */
|
||||
NULL, /* getattrfunc tp_getattr; */
|
||||
NULL, /* setattrfunc tp_setattr; */
|
||||
NULL,
|
||||
/* tp_compare */ /* DEPRECATED in python 3.0! */
|
||||
NULL, /* tp_repr */
|
||||
|
||||
/* Method suites for standard classes */
|
||||
NULL, /* PyNumberMethods *tp_as_number; */
|
||||
NULL, /* PySequenceMethods *tp_as_sequence; */
|
||||
NULL, /* PyMappingMethods *tp_as_mapping; */
|
||||
|
||||
/* More standard operations (here for binary compatibility) */
|
||||
NULL, /* hashfunc tp_hash; */
|
||||
NULL, /* ternaryfunc tp_call; */
|
||||
NULL, /* reprfunc tp_str; */
|
||||
NULL, /* getattrofunc tp_getattro; */
|
||||
NULL, /* setattrofunc tp_setattro; */
|
||||
|
||||
/* Functions to access object as input/output buffer */
|
||||
NULL, /* PyBufferProcs *tp_as_buffer; */
|
||||
|
||||
/*** Flags to define presence of optional/expanded features ***/
|
||||
Py_TPFLAGS_DEFAULT, /* long tp_flags; */
|
||||
|
||||
app_translations_doc, /* char *tp_doc; Documentation string */
|
||||
|
||||
/*** Assigned meaning in release 2.0 ***/
|
||||
/* call function for all accessible objects */
|
||||
NULL, /* traverseproc tp_traverse; */
|
||||
|
||||
/* delete references to contained objects */
|
||||
NULL, /* inquiry tp_clear; */
|
||||
|
||||
/*** Assigned meaning in release 2.1 ***/
|
||||
/*** rich comparisons ***/
|
||||
NULL, /* richcmpfunc tp_richcompare; */
|
||||
|
||||
/*** weak reference enabler ***/
|
||||
0, /* long tp_weaklistoffset */
|
||||
|
||||
/*** Added in release 2.2 ***/
|
||||
/* Iterators */
|
||||
NULL, /* getiterfunc tp_iter; */
|
||||
NULL, /* iternextfunc tp_iternext; */
|
||||
|
||||
/*** Attribute descriptor and subclassing stuff ***/
|
||||
app_translations_methods, /* struct PyMethodDef *tp_methods; */
|
||||
app_translations_members, /* struct PyMemberDef *tp_members; */
|
||||
app_translations_getseters, /* struct PyGetSetDef *tp_getset; */
|
||||
NULL, /* struct _typeobject *tp_base; */
|
||||
NULL, /* PyObject *tp_dict; */
|
||||
NULL, /* descrgetfunc tp_descr_get; */
|
||||
NULL, /* descrsetfunc tp_descr_set; */
|
||||
0, /* long tp_dictoffset; */
|
||||
NULL, /* initproc tp_init; */
|
||||
NULL, /* allocfunc tp_alloc; */
|
||||
/* newfunc tp_new; */
|
||||
(newfunc)app_translations_new,
|
||||
/* Low-level free-memory routine */
|
||||
app_translations_free, /* freefunc tp_free; */
|
||||
/* For PyObject_IS_GC */
|
||||
NULL, /* inquiry tp_is_gc; */
|
||||
NULL, /* PyObject *tp_bases; */
|
||||
/* method resolution order */
|
||||
NULL, /* PyObject *tp_mro; */
|
||||
NULL, /* PyObject *tp_cache; */
|
||||
NULL, /* PyObject *tp_subclasses; */
|
||||
NULL, /* PyObject *tp_weaklist; */
|
||||
NULL,
|
||||
/*tp_name*/ "bpy.app._translations_type",
|
||||
/*tp_basicsize*/ sizeof(BlenderAppTranslations),
|
||||
/*tp_itemsize*/ 0,
|
||||
/*tp_dealloc*/ NULL,
|
||||
/*tp_vectorcall_offset*/ 0,
|
||||
/*tp_getattr*/ NULL,
|
||||
/*tp_setattr*/ NULL,
|
||||
/*tp_as_async*/ NULL,
|
||||
/*tp_repr*/ NULL,
|
||||
/*tp_as_number*/ NULL,
|
||||
/*tp_as_sequence*/ NULL,
|
||||
/*tp_as_mapping*/ NULL,
|
||||
/*tp_hash*/ NULL,
|
||||
/*tp_call*/ NULL,
|
||||
/*tp_str*/ NULL,
|
||||
/*tp_getattro*/ NULL,
|
||||
/*tp_setattro*/ NULL,
|
||||
/*tp_as_buffer*/ NULL,
|
||||
/*tp_flags*/ Py_TPFLAGS_DEFAULT,
|
||||
/*tp_doc*/ app_translations_doc,
|
||||
/*tp_traverse*/ NULL,
|
||||
/*tp_clear*/ NULL,
|
||||
/*tp_richcompare*/ NULL,
|
||||
/*tp_weaklistoffset*/ 0,
|
||||
/*tp_iter*/ NULL,
|
||||
/*tp_iternext*/ NULL,
|
||||
/*tp_methods*/ app_translations_methods,
|
||||
/*tp_members*/ app_translations_members,
|
||||
/*tp_getset*/ app_translations_getseters,
|
||||
/*tp_base*/ NULL,
|
||||
/*tp_dict*/ NULL,
|
||||
/*tp_descr_get*/ NULL,
|
||||
/*tp_descr_set*/ NULL,
|
||||
/*tp_dictoffset*/ 0,
|
||||
/*tp_init*/ NULL,
|
||||
/*tp_alloc*/ NULL,
|
||||
/*tp_new*/ (newfunc)app_translations_new,
|
||||
/*tp_free*/ app_translations_free,
|
||||
/*tp_is_gc*/ NULL,
|
||||
/*tp_bases*/ NULL,
|
||||
/*tp_mro*/ NULL,
|
||||
/*tp_cache*/ NULL,
|
||||
/*tp_subclasses*/ NULL,
|
||||
/*tp_weaklist*/ NULL,
|
||||
/*tp_del*/ NULL,
|
||||
/*tp_version_tag*/ 0,
|
||||
/*tp_finalize*/ NULL,
|
||||
/*tp_vectorcall*/ NULL,
|
||||
};
|
||||
|
||||
PyObject *BPY_app_translations_struct(void)
|
||||
|
||||
@@ -84,82 +84,55 @@ static void bpy_lib_dealloc(BPy_Library *self)
|
||||
}
|
||||
|
||||
static PyTypeObject bpy_lib_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0) "bpy_lib", /* tp_name */
|
||||
sizeof(BPy_Library), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
/* methods */
|
||||
(destructor)bpy_lib_dealloc, /* tp_dealloc */
|
||||
0, /* tp_vectorcall_offset */
|
||||
NULL, /* getattrfunc tp_getattr; */
|
||||
NULL, /* setattrfunc tp_setattr; */
|
||||
NULL,
|
||||
/* tp_compare */ /* DEPRECATED in python 3.0! */
|
||||
NULL, /* tp_repr */
|
||||
|
||||
/* Method suites for standard classes */
|
||||
|
||||
NULL, /* PyNumberMethods *tp_as_number; */
|
||||
NULL, /* PySequenceMethods *tp_as_sequence; */
|
||||
NULL, /* PyMappingMethods *tp_as_mapping; */
|
||||
|
||||
/* More standard operations (here for binary compatibility) */
|
||||
|
||||
NULL, /* hashfunc tp_hash; */
|
||||
NULL, /* ternaryfunc tp_call; */
|
||||
NULL, /* reprfunc tp_str; */
|
||||
|
||||
/* Will only use these if this is a sub-type of a Python class. */
|
||||
PyObject_GenericGetAttr, /* getattrofunc tp_getattro; */
|
||||
NULL, /* setattrofunc tp_setattro; */
|
||||
|
||||
/* Functions to access object as input/output buffer */
|
||||
NULL, /* PyBufferProcs *tp_as_buffer; */
|
||||
|
||||
/*** Flags to define presence of optional/expanded features ***/
|
||||
Py_TPFLAGS_DEFAULT, /* long tp_flags; */
|
||||
|
||||
NULL, /* char *tp_doc; Documentation string */
|
||||
/*** Assigned meaning in release 2.0 ***/
|
||||
/* call function for all accessible objects */
|
||||
NULL, /* traverseproc tp_traverse; */
|
||||
|
||||
/* delete references to contained objects */
|
||||
NULL, /* inquiry tp_clear; */
|
||||
|
||||
/*** Assigned meaning in release 2.1 ***/
|
||||
/*** rich comparisons (subclassed) ***/
|
||||
NULL, /* richcmpfunc tp_richcompare; */
|
||||
|
||||
/*** weak reference enabler ***/
|
||||
0,
|
||||
/*** Added in release 2.2 ***/
|
||||
/* Iterators */
|
||||
NULL, /* getiterfunc tp_iter; */
|
||||
NULL, /* iternextfunc tp_iternext; */
|
||||
|
||||
/*** Attribute descriptor and subclassing stuff ***/
|
||||
bpy_lib_methods, /* struct PyMethodDef *tp_methods; */
|
||||
NULL, /* struct PyMemberDef *tp_members; */
|
||||
NULL, /* struct PyGetSetDef *tp_getset; */
|
||||
NULL, /* struct _typeobject *tp_base; */
|
||||
NULL, /* PyObject *tp_dict; */
|
||||
NULL, /* descrgetfunc tp_descr_get; */
|
||||
NULL, /* descrsetfunc tp_descr_set; */
|
||||
offsetof(BPy_Library, dict), /* long tp_dictoffset; */
|
||||
NULL, /* initproc tp_init; */
|
||||
NULL, /* allocfunc tp_alloc; */
|
||||
NULL, /* newfunc tp_new; */
|
||||
/* Low-level free-memory routine */
|
||||
NULL, /* freefunc tp_free; */
|
||||
/* For PyObject_IS_GC */
|
||||
NULL, /* inquiry tp_is_gc; */
|
||||
NULL, /* PyObject *tp_bases; */
|
||||
/* method resolution order */
|
||||
NULL, /* PyObject *tp_mro; */
|
||||
NULL, /* PyObject *tp_cache; */
|
||||
NULL, /* PyObject *tp_subclasses; */
|
||||
NULL, /* PyObject *tp_weaklist; */
|
||||
NULL,
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
/*tp_name*/ "bpy_lib",
|
||||
/*tp_basicsize*/ sizeof(BPy_Library),
|
||||
/*tp_itemsize*/ 0,
|
||||
/*tp_dealloc*/ (destructor)bpy_lib_dealloc,
|
||||
/*tp_vectorcall_offset*/ 0,
|
||||
/*tp_getattr*/ NULL,
|
||||
/*tp_setattr*/ NULL,
|
||||
/*tp_as_async*/ NULL,
|
||||
/*tp_repr*/ NULL,
|
||||
/*tp_as_number*/ NULL,
|
||||
/*tp_as_sequence*/ NULL,
|
||||
/*tp_as_mapping*/ NULL,
|
||||
/*tp_hash*/ NULL,
|
||||
/*tp_call*/ NULL,
|
||||
/*tp_str*/ NULL,
|
||||
/*tp_getattro*/ PyObject_GenericGetAttr,
|
||||
/*tp_setattro*/ NULL,
|
||||
/*tp_as_buffer*/ NULL,
|
||||
/*tp_flags*/ Py_TPFLAGS_DEFAULT,
|
||||
/*tp_doc*/ NULL,
|
||||
/*tp_traverse*/ NULL,
|
||||
/*tp_clear*/ NULL,
|
||||
/*tp_richcompare*/ NULL,
|
||||
/*tp_weaklistoffset*/ 0,
|
||||
/*tp_iter*/ NULL,
|
||||
/*tp_iternext*/ NULL,
|
||||
/*tp_methods*/ bpy_lib_methods,
|
||||
/*tp_members*/ NULL,
|
||||
/*tp_getset*/ NULL,
|
||||
/*tp_base*/ NULL,
|
||||
/*tp_dict*/ NULL,
|
||||
/*tp_descr_get*/ NULL,
|
||||
/*tp_descr_set*/ NULL,
|
||||
/*tp_dictoffset*/ offsetof(BPy_Library, dict),
|
||||
/*tp_init*/ NULL,
|
||||
/*tp_alloc*/ NULL,
|
||||
/*tp_new*/ NULL,
|
||||
/*tp_free*/ NULL,
|
||||
/*tp_is_gc*/ NULL,
|
||||
/*tp_bases*/ NULL,
|
||||
/*tp_mro*/ NULL,
|
||||
/*tp_cache*/ NULL,
|
||||
/*tp_subclasses*/ NULL,
|
||||
/*tp_weaklist*/ NULL,
|
||||
/*tp_del*/ NULL,
|
||||
/*tp_version_tag*/ 0,
|
||||
/*tp_finalize*/ NULL,
|
||||
/*tp_vectorcall*/ NULL,
|
||||
};
|
||||
|
||||
PyDoc_STRVAR(
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -60,84 +60,56 @@ static void bpy_rna_data_context_dealloc(BPy_DataContext *self)
|
||||
Py_CLEAR(self->data_rna);
|
||||
PyObject_GC_Del(self);
|
||||
}
|
||||
|
||||
static PyTypeObject bpy_rna_data_context_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0) "bpy_rna_data_context", /* tp_name */
|
||||
sizeof(BPy_DataContext), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
/* methods */
|
||||
(destructor)bpy_rna_data_context_dealloc, /* tp_dealloc */
|
||||
0, /* tp_vectorcall_offset */
|
||||
NULL, /* getattrfunc tp_getattr; */
|
||||
NULL, /* setattrfunc tp_setattr; */
|
||||
NULL,
|
||||
/* tp_compare */ /* DEPRECATED in python 3.0! */
|
||||
NULL, /* tp_repr */
|
||||
|
||||
/* Method suites for standard classes */
|
||||
|
||||
NULL, /* PyNumberMethods *tp_as_number; */
|
||||
NULL, /* PySequenceMethods *tp_as_sequence; */
|
||||
NULL, /* PyMappingMethods *tp_as_mapping; */
|
||||
|
||||
/* More standard operations (here for binary compatibility) */
|
||||
|
||||
NULL, /* hashfunc tp_hash; */
|
||||
NULL, /* ternaryfunc tp_call; */
|
||||
NULL, /* reprfunc tp_str; */
|
||||
|
||||
/* Will only use these if this is a sub-type of a Python class. */
|
||||
NULL, /* getattrofunc tp_getattro; */
|
||||
NULL, /* setattrofunc tp_setattro; */
|
||||
|
||||
/* Functions to access object as input/output buffer */
|
||||
NULL, /* PyBufferProcs *tp_as_buffer; */
|
||||
|
||||
/*** Flags to define presence of optional/expanded features ***/
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* long tp_flags; */
|
||||
|
||||
NULL, /* char *tp_doc; Documentation string */
|
||||
/*** Assigned meaning in release 2.0 ***/
|
||||
/* call function for all accessible objects */
|
||||
(traverseproc)bpy_rna_data_context_traverse, /* traverseproc tp_traverse; */
|
||||
|
||||
/* delete references to contained objects */
|
||||
(inquiry)bpy_rna_data_context_clear, /* inquiry tp_clear; */
|
||||
|
||||
/*** Assigned meaning in release 2.1 ***/
|
||||
/*** rich comparisons (subclassed) ***/
|
||||
NULL, /* richcmpfunc tp_richcompare; */
|
||||
|
||||
/*** weak reference enabler ***/
|
||||
0,
|
||||
/*** Added in release 2.2 ***/
|
||||
/* Iterators */
|
||||
NULL, /* getiterfunc tp_iter; */
|
||||
NULL, /* iternextfunc tp_iternext; */
|
||||
|
||||
/*** Attribute descriptor and subclassing stuff ***/
|
||||
bpy_rna_data_context_methods, /* struct PyMethodDef *tp_methods; */
|
||||
NULL, /* struct PyMemberDef *tp_members; */
|
||||
NULL, /* struct PyGetSetDef *tp_getset; */
|
||||
NULL, /* struct _typeobject *tp_base; */
|
||||
NULL, /* PyObject *tp_dict; */
|
||||
NULL, /* descrgetfunc tp_descr_get; */
|
||||
NULL, /* descrsetfunc tp_descr_set; */
|
||||
0, /* long tp_dictoffset; */
|
||||
NULL, /* initproc tp_init; */
|
||||
NULL, /* allocfunc tp_alloc; */
|
||||
NULL, /* newfunc tp_new; */
|
||||
/* Low-level free-memory routine */
|
||||
NULL, /* freefunc tp_free; */
|
||||
/* For PyObject_IS_GC */
|
||||
NULL, /* inquiry tp_is_gc; */
|
||||
NULL, /* PyObject *tp_bases; */
|
||||
/* method resolution order */
|
||||
NULL, /* PyObject *tp_mro; */
|
||||
NULL, /* PyObject *tp_cache; */
|
||||
NULL, /* PyObject *tp_subclasses; */
|
||||
NULL, /* PyObject *tp_weaklist; */
|
||||
NULL,
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
/*tp_name*/ "bpy_rna_data_context",
|
||||
/*tp_basicsize*/ sizeof(BPy_DataContext),
|
||||
/*tp_itemsize*/ 0,
|
||||
/*tp_dealloc*/ (destructor)bpy_rna_data_context_dealloc,
|
||||
/*tp_vectorcall_offset*/ 0,
|
||||
/*tp_getattr*/ NULL,
|
||||
/*tp_setattr*/ NULL,
|
||||
/*tp_as_async*/ NULL,
|
||||
/*tp_repr*/ NULL,
|
||||
/*tp_as_number*/ NULL,
|
||||
/*tp_as_sequence*/ NULL,
|
||||
/*tp_as_mapping*/ NULL,
|
||||
/*tp_hash*/ NULL,
|
||||
/*tp_call*/ NULL,
|
||||
/*tp_str*/ NULL,
|
||||
/*tp_getattro*/ NULL,
|
||||
/*tp_setattro*/ NULL,
|
||||
/*tp_as_buffer*/ NULL,
|
||||
/*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
|
||||
/*tp_doc*/ NULL,
|
||||
/*tp_traverse*/ (traverseproc)bpy_rna_data_context_traverse,
|
||||
/*tp_clear*/ (inquiry)bpy_rna_data_context_clear,
|
||||
/*tp_richcompare*/ NULL,
|
||||
/*tp_weaklistoffset*/ 0,
|
||||
/*tp_iter*/ NULL,
|
||||
/*tp_iternext*/ NULL,
|
||||
/*tp_methods*/ bpy_rna_data_context_methods,
|
||||
/*tp_members*/ NULL,
|
||||
/*tp_getset*/ NULL,
|
||||
/*tp_base*/ NULL,
|
||||
/*tp_dict*/ NULL,
|
||||
/*tp_descr_get*/ NULL,
|
||||
/*tp_descr_set*/ NULL,
|
||||
/*tp_dictoffset*/ 0,
|
||||
/*tp_init*/ NULL,
|
||||
/*tp_alloc*/ NULL,
|
||||
/*tp_new*/ NULL,
|
||||
/*tp_free*/ NULL,
|
||||
/*tp_is_gc*/ NULL,
|
||||
/*tp_bases*/ NULL,
|
||||
/*tp_mro*/ NULL,
|
||||
/*tp_cache*/ NULL,
|
||||
/*tp_subclasses*/ NULL,
|
||||
/*tp_weaklist*/ NULL,
|
||||
/*tp_del*/ NULL,
|
||||
/*tp_version_tag*/ 0,
|
||||
/*tp_finalize*/ NULL,
|
||||
/*tp_vectorcall*/ NULL,
|
||||
};
|
||||
|
||||
PyDoc_STRVAR(bpy_rna_data_context_load_doc,
|
||||
|
||||
@@ -825,59 +825,61 @@ static PyObject *Color_neg(ColorObject *self)
|
||||
* \{ */
|
||||
|
||||
static PySequenceMethods Color_SeqMethods = {
|
||||
(lenfunc)Color_len, /*sq_length*/
|
||||
(binaryfunc)NULL, /*sq_concat*/
|
||||
(ssizeargfunc)NULL, /*sq_repeat*/
|
||||
(ssizeargfunc)Color_item, /*sq_item*/
|
||||
NULL, /*sq_slice(DEPRECATED)*/
|
||||
(ssizeobjargproc)Color_ass_item, /*sq_ass_item*/
|
||||
NULL, /*sq_ass_slice(DEPRECATED)*/
|
||||
(objobjproc)NULL, /*sq_contains*/
|
||||
(binaryfunc)NULL, /*sq_inplace_concat*/
|
||||
(ssizeargfunc)NULL, /*sq_inplace_repeat*/
|
||||
/*sq_length*/ (lenfunc)Color_len,
|
||||
/*sq_concat*/ NULL,
|
||||
/*sq_repeat*/ NULL,
|
||||
/*sq_item*/ (ssizeargfunc)Color_item,
|
||||
/*was_sq_slice*/ NULL, /* DEPRECATED. */
|
||||
/*sq_ass_item*/ (ssizeobjargproc)Color_ass_item,
|
||||
/*was_sq_ass_slice*/ NULL, /* DEPRECATED. */
|
||||
/*sq_contains*/ NULL,
|
||||
/*sq_inplace_concat*/ NULL,
|
||||
/*sq_inplace_repeat*/ NULL,
|
||||
};
|
||||
|
||||
static PyMappingMethods Color_AsMapping = {
|
||||
(lenfunc)Color_len,
|
||||
(binaryfunc)Color_subscript,
|
||||
(objobjargproc)Color_ass_subscript,
|
||||
/*mp_len*/ (lenfunc)Color_len,
|
||||
/*mp_subscript*/ (binaryfunc)Color_subscript,
|
||||
/*mp_ass_subscript*/ (objobjargproc)Color_ass_subscript,
|
||||
};
|
||||
|
||||
static PyNumberMethods Color_NumMethods = {
|
||||
(binaryfunc)Color_add, /*nb_add*/
|
||||
(binaryfunc)Color_sub, /*nb_subtract*/
|
||||
(binaryfunc)Color_mul, /*nb_multiply*/
|
||||
NULL, /*nb_remainder*/
|
||||
NULL, /*nb_divmod*/
|
||||
NULL, /*nb_power*/
|
||||
(unaryfunc)Color_neg, /*nb_negative*/
|
||||
(unaryfunc)Color_copy, /*tp_positive*/
|
||||
(unaryfunc)NULL, /*tp_absolute*/
|
||||
(inquiry)NULL, /*tp_bool*/
|
||||
(unaryfunc)NULL, /*nb_invert*/
|
||||
NULL, /*nb_lshift*/
|
||||
(binaryfunc)NULL, /*nb_rshift*/
|
||||
NULL, /*nb_and*/
|
||||
NULL, /*nb_xor*/
|
||||
NULL, /*nb_or*/
|
||||
NULL, /*nb_int*/
|
||||
NULL, /*nb_reserved*/
|
||||
NULL, /*nb_float*/
|
||||
Color_iadd, /*nb_inplace_add*/
|
||||
Color_isub, /*nb_inplace_subtract*/
|
||||
Color_imul, /*nb_inplace_multiply*/
|
||||
NULL, /*nb_inplace_remainder*/
|
||||
NULL, /*nb_inplace_power*/
|
||||
NULL, /*nb_inplace_lshift*/
|
||||
NULL, /*nb_inplace_rshift*/
|
||||
NULL, /*nb_inplace_and*/
|
||||
NULL, /*nb_inplace_xor*/
|
||||
NULL, /*nb_inplace_or*/
|
||||
NULL, /*nb_floor_divide*/
|
||||
Color_div, /*nb_true_divide*/
|
||||
NULL, /*nb_inplace_floor_divide*/
|
||||
Color_idiv, /*nb_inplace_true_divide*/
|
||||
NULL, /*nb_index*/
|
||||
/*nb_add*/ (binaryfunc)Color_add,
|
||||
/*nb_subtract*/ (binaryfunc)Color_sub,
|
||||
/*nb_multiply*/ (binaryfunc)Color_mul,
|
||||
/*nb_remainder*/ NULL,
|
||||
/*nb_divmod*/ NULL,
|
||||
/*nb_power*/ NULL,
|
||||
/*nb_negative*/ (unaryfunc)Color_neg,
|
||||
/*tp_positive*/ (unaryfunc)Color_copy,
|
||||
/*tp_absolute*/ NULL,
|
||||
/*tp_bool*/ NULL,
|
||||
/*nb_invert*/ NULL,
|
||||
/*nb_lshift*/ NULL,
|
||||
/*nb_rshift*/ NULL,
|
||||
/*nb_and*/ NULL,
|
||||
/*nb_xor*/ NULL,
|
||||
/*nb_or*/ NULL,
|
||||
/*nb_int*/ NULL,
|
||||
/*nb_reserved*/ NULL,
|
||||
/*nb_float*/ NULL,
|
||||
/*nb_inplace_add*/ Color_iadd,
|
||||
/*nb_inplace_subtract*/ Color_isub,
|
||||
/*nb_inplace_multiply*/ Color_imul,
|
||||
/*nb_inplace_remainder*/ NULL,
|
||||
/*nb_inplace_power*/ NULL,
|
||||
/*nb_inplace_lshift*/ NULL,
|
||||
/*nb_inplace_rshift*/ NULL,
|
||||
/*nb_inplace_and*/ NULL,
|
||||
/*nb_inplace_xor*/ NULL,
|
||||
/*nb_inplace_or*/ NULL,
|
||||
/*nb_floor_divide*/ NULL,
|
||||
/*nb_true_divide*/ Color_div,
|
||||
/*nb_inplace_floor_divide*/ NULL,
|
||||
/*nb_inplace_true_divide*/ Color_idiv,
|
||||
/*nb_index*/ NULL,
|
||||
/*nb_matrix_multiply*/ NULL,
|
||||
/*nb_inplace_matrix_multiply*/ NULL,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
@@ -1100,6 +1102,10 @@ static struct PyMethodDef Color_methods[] = {
|
||||
/** \name Color Type: Python Object Definition
|
||||
* \{ */
|
||||
|
||||
#ifdef MATH_STANDALONE
|
||||
# define Color_str NULL
|
||||
#endif
|
||||
|
||||
PyDoc_STRVAR(
|
||||
color_doc,
|
||||
".. class:: Color(rgb)\n"
|
||||
@@ -1113,57 +1119,61 @@ PyDoc_STRVAR(
|
||||
" :arg rgb: (r, g, b) color values\n"
|
||||
" :type rgb: 3d vector\n");
|
||||
PyTypeObject color_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0) "Color", /* tp_name */
|
||||
sizeof(ColorObject), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
(destructor)BaseMathObject_dealloc, /* tp_dealloc */
|
||||
(printfunc)NULL, /* tp_print */
|
||||
NULL, /* tp_getattr */
|
||||
NULL, /* tp_setattr */
|
||||
NULL, /* tp_compare */
|
||||
(reprfunc)Color_repr, /* tp_repr */
|
||||
&Color_NumMethods, /* tp_as_number */
|
||||
&Color_SeqMethods, /* tp_as_sequence */
|
||||
&Color_AsMapping, /* tp_as_mapping */
|
||||
(hashfunc)Color_hash, /* tp_hash */
|
||||
NULL, /* tp_call */
|
||||
#ifndef MATH_STANDALONE
|
||||
(reprfunc)Color_str, /* tp_str */
|
||||
#else
|
||||
NULL, /* tp_str */
|
||||
#endif
|
||||
NULL, /* tp_getattro */
|
||||
NULL, /* tp_setattro */
|
||||
NULL, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */
|
||||
color_doc, /* tp_doc */
|
||||
(traverseproc)BaseMathObject_traverse, /* tp_traverse */
|
||||
(inquiry)BaseMathObject_clear, /* tp_clear */
|
||||
(richcmpfunc)Color_richcmpr, /* tp_richcompare */
|
||||
0, /* tp_weaklistoffset */
|
||||
NULL, /* tp_iter */
|
||||
NULL, /* tp_iternext */
|
||||
Color_methods, /* tp_methods */
|
||||
NULL, /* tp_members */
|
||||
Color_getseters, /* tp_getset */
|
||||
NULL, /* tp_base */
|
||||
NULL, /* tp_dict */
|
||||
NULL, /* tp_descr_get */
|
||||
NULL, /* tp_descr_set */
|
||||
0, /* tp_dictoffset */
|
||||
NULL, /* tp_init */
|
||||
NULL, /* tp_alloc */
|
||||
Color_new, /* tp_new */
|
||||
NULL, /* tp_free */
|
||||
(inquiry)BaseMathObject_is_gc, /* tp_is_gc */
|
||||
NULL, /* tp_bases */
|
||||
NULL, /* tp_mro */
|
||||
NULL, /* tp_cache */
|
||||
NULL, /* tp_subclasses */
|
||||
NULL, /* tp_weaklist */
|
||||
NULL, /* tp_del */
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
/*tp_name*/ "Color",
|
||||
/*tp_basicsize*/ sizeof(ColorObject),
|
||||
/*tp_itemsize*/ 0,
|
||||
/*tp_dealloc*/ (destructor)BaseMathObject_dealloc,
|
||||
/*tp_vectorcall_offset*/ 0,
|
||||
/*tp_getattr*/ NULL,
|
||||
/*tp_setattr*/ NULL,
|
||||
/*tp_as_async*/ NULL,
|
||||
/*tp_repr*/ (reprfunc)Color_repr,
|
||||
/*tp_as_number*/ &Color_NumMethods,
|
||||
/*tp_as_sequence*/ &Color_SeqMethods,
|
||||
/*tp_as_mapping*/ &Color_AsMapping,
|
||||
/*tp_hash*/ (hashfunc)Color_hash,
|
||||
/*tp_call*/ NULL,
|
||||
/*tp_str*/ (reprfunc)Color_str,
|
||||
/*tp_getattro*/ NULL,
|
||||
/*tp_setattro*/ NULL,
|
||||
/*tp_as_buffer*/ NULL,
|
||||
/*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
|
||||
/*tp_doc*/ color_doc,
|
||||
/*tp_traverse*/ (traverseproc)BaseMathObject_traverse,
|
||||
/*tp_clear*/ (inquiry)BaseMathObject_clear,
|
||||
/*tp_richcompare*/ (richcmpfunc)Color_richcmpr,
|
||||
/*tp_weaklistoffset*/ 0,
|
||||
/*tp_iter*/ NULL,
|
||||
/*tp_iternext*/ NULL,
|
||||
/*tp_methods*/ Color_methods,
|
||||
/*tp_members*/ NULL,
|
||||
/*tp_getset*/ Color_getseters,
|
||||
/*tp_base*/ NULL,
|
||||
/*tp_dict*/ NULL,
|
||||
/*tp_descr_get*/ NULL,
|
||||
/*tp_descr_set*/ NULL,
|
||||
/*tp_dictoffset*/ 0,
|
||||
/*tp_init*/ NULL,
|
||||
/*tp_alloc*/ NULL,
|
||||
/*tp_new*/ Color_new,
|
||||
/*tp_free*/ NULL,
|
||||
/*tp_is_gc*/ (inquiry)BaseMathObject_is_gc,
|
||||
/*tp_bases*/ NULL,
|
||||
/*tp_mro*/ NULL,
|
||||
/*tp_cache*/ NULL,
|
||||
/*tp_subclasses*/ NULL,
|
||||
/*tp_weaklist*/ NULL,
|
||||
/*tp_del*/ NULL,
|
||||
/*tp_version_tag*/ 0,
|
||||
/*tp_finalize*/ NULL,
|
||||
/*tp_vectorcall*/ NULL,
|
||||
};
|
||||
|
||||
#ifdef MATH_STANDALONE
|
||||
# define Color_str
|
||||
#endif
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
@@ -636,22 +636,22 @@ static int Euler_ass_subscript(EulerObject *self, PyObject *item, PyObject *valu
|
||||
* \{ */
|
||||
|
||||
static PySequenceMethods Euler_SeqMethods = {
|
||||
(lenfunc)Euler_len, /*sq_length*/
|
||||
(binaryfunc)NULL, /*sq_concat*/
|
||||
(ssizeargfunc)NULL, /*sq_repeat*/
|
||||
(ssizeargfunc)Euler_item, /*sq_item*/
|
||||
(ssizessizeargfunc)NULL, /*sq_slice(DEPRECATED)*/
|
||||
(ssizeobjargproc)Euler_ass_item, /*sq_ass_item*/
|
||||
(ssizessizeobjargproc)NULL, /*sq_ass_slice(DEPRECATED)*/
|
||||
(objobjproc)NULL, /*sq_contains*/
|
||||
(binaryfunc)NULL, /*sq_inplace_concat*/
|
||||
(ssizeargfunc)NULL, /*sq_inplace_repeat*/
|
||||
/*sq_length*/ (lenfunc)Euler_len,
|
||||
/*sq_concat*/ NULL,
|
||||
/*sq_repeat*/ NULL,
|
||||
/*sq_item*/ (ssizeargfunc)Euler_item,
|
||||
/*was_sq_slice*/ NULL, /* DEPRECATED. */
|
||||
/*sq_ass_item*/ (ssizeobjargproc)Euler_ass_item,
|
||||
/*was_sq_ass_slice*/ NULL, /* DEPRECATED. */
|
||||
/*sq_contains*/ NULL,
|
||||
/*sq_inplace_concat*/ NULL,
|
||||
/*sq_inplace_repeat*/ NULL,
|
||||
};
|
||||
|
||||
static PyMappingMethods Euler_AsMapping = {
|
||||
(lenfunc)Euler_len,
|
||||
(binaryfunc)Euler_subscript,
|
||||
(objobjargproc)Euler_ass_subscript,
|
||||
/*mp_len*/ (lenfunc)Euler_len,
|
||||
/*mp_subscript*/ (binaryfunc)Euler_subscript,
|
||||
/*mp_ass_subscript*/ (objobjargproc)Euler_ass_subscript,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
@@ -766,6 +766,10 @@ static struct PyMethodDef Euler_methods[] = {
|
||||
/** \name Euler Type: Python Object Definition
|
||||
* \{ */
|
||||
|
||||
#ifdef MATH_STANDALONE
|
||||
# define Euler_str NULL
|
||||
#endif
|
||||
|
||||
PyDoc_STRVAR(
|
||||
euler_doc,
|
||||
".. class:: Euler(angles, order='XYZ')\n"
|
||||
@@ -779,57 +783,61 @@ PyDoc_STRVAR(
|
||||
" :arg order: Optional order of the angles, a permutation of ``XYZ``.\n"
|
||||
" :type order: str\n");
|
||||
PyTypeObject euler_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0) "Euler", /* tp_name */
|
||||
sizeof(EulerObject), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
(destructor)BaseMathObject_dealloc, /* tp_dealloc */
|
||||
(printfunc)NULL, /* tp_print */
|
||||
NULL, /* tp_getattr */
|
||||
NULL, /* tp_setattr */
|
||||
NULL, /* tp_compare */
|
||||
(reprfunc)Euler_repr, /* tp_repr */
|
||||
NULL, /* tp_as_number */
|
||||
&Euler_SeqMethods, /* tp_as_sequence */
|
||||
&Euler_AsMapping, /* tp_as_mapping */
|
||||
(hashfunc)Euler_hash, /* tp_hash */
|
||||
NULL, /* tp_call */
|
||||
#ifndef MATH_STANDALONE
|
||||
(reprfunc)Euler_str, /* tp_str */
|
||||
#else
|
||||
NULL, /* tp_str */
|
||||
#endif
|
||||
NULL, /* tp_getattro */
|
||||
NULL, /* tp_setattro */
|
||||
NULL, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */
|
||||
euler_doc, /* tp_doc */
|
||||
(traverseproc)BaseMathObject_traverse, /* tp_traverse */
|
||||
(inquiry)BaseMathObject_clear, /* tp_clear */
|
||||
(richcmpfunc)Euler_richcmpr, /* tp_richcompare */
|
||||
0, /* tp_weaklistoffset */
|
||||
NULL, /* tp_iter */
|
||||
NULL, /* tp_iternext */
|
||||
Euler_methods, /* tp_methods */
|
||||
NULL, /* tp_members */
|
||||
Euler_getseters, /* tp_getset */
|
||||
NULL, /* tp_base */
|
||||
NULL, /* tp_dict */
|
||||
NULL, /* tp_descr_get */
|
||||
NULL, /* tp_descr_set */
|
||||
0, /* tp_dictoffset */
|
||||
NULL, /* tp_init */
|
||||
NULL, /* tp_alloc */
|
||||
Euler_new, /* tp_new */
|
||||
NULL, /* tp_free */
|
||||
(inquiry)BaseMathObject_is_gc, /* tp_is_gc */
|
||||
NULL, /* tp_bases */
|
||||
NULL, /* tp_mro */
|
||||
NULL, /* tp_cache */
|
||||
NULL, /* tp_subclasses */
|
||||
NULL, /* tp_weaklist */
|
||||
NULL, /* tp_del */
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
/*tp_name*/ "Euler",
|
||||
/*tp_basicsize*/ sizeof(EulerObject),
|
||||
/*tp_itemsize*/ 0,
|
||||
/*tp_dealloc*/ (destructor)BaseMathObject_dealloc,
|
||||
/*tp_vectorcall_offset*/ 0,
|
||||
/*tp_getattr*/ NULL,
|
||||
/*tp_setattr*/ NULL,
|
||||
/*tp_as_async*/ NULL,
|
||||
/*tp_repr*/ (reprfunc)Euler_repr,
|
||||
/*tp_as_number*/ NULL,
|
||||
/*tp_as_sequence*/ &Euler_SeqMethods,
|
||||
/*tp_as_mapping*/ &Euler_AsMapping,
|
||||
/*tp_hash*/ (hashfunc)Euler_hash,
|
||||
/*tp_call*/ NULL,
|
||||
/*tp_str*/ (reprfunc)Euler_str,
|
||||
/*tp_getattro*/ NULL,
|
||||
/*tp_setattro*/ NULL,
|
||||
/*tp_as_buffer*/ NULL,
|
||||
/*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
|
||||
/*tp_doc*/ euler_doc,
|
||||
/*tp_traverse*/ (traverseproc)BaseMathObject_traverse,
|
||||
/*tp_clear*/ (inquiry)BaseMathObject_clear,
|
||||
/*tp_richcompare*/ (richcmpfunc)Euler_richcmpr,
|
||||
/*tp_weaklistoffset*/ 0,
|
||||
/*tp_iter*/ NULL,
|
||||
/*tp_iternext*/ NULL,
|
||||
/*tp_methods*/ Euler_methods,
|
||||
/*tp_members*/ NULL,
|
||||
/*tp_getset*/ Euler_getseters,
|
||||
/*tp_base*/ NULL,
|
||||
/*tp_dict*/ NULL,
|
||||
/*tp_descr_get*/ NULL,
|
||||
/*tp_descr_set*/ NULL,
|
||||
/*tp_dictoffset*/ 0,
|
||||
/*tp_init*/ NULL,
|
||||
/*tp_alloc*/ NULL,
|
||||
/*tp_new*/ Euler_new,
|
||||
/*tp_free*/ NULL,
|
||||
/*tp_is_gc*/ (inquiry)BaseMathObject_is_gc,
|
||||
/*tp_bases*/ NULL,
|
||||
/*tp_mro*/ NULL,
|
||||
/*tp_cache*/ NULL,
|
||||
/*tp_subclasses*/ NULL,
|
||||
/*tp_weaklist*/ NULL,
|
||||
/*tp_del*/ NULL,
|
||||
/*tp_version_tag*/ 0,
|
||||
/*tp_finalize*/ NULL,
|
||||
/*tp_vectorcall*/ NULL,
|
||||
};
|
||||
|
||||
#ifdef MATH_STANDALONE
|
||||
# undef Euler_str
|
||||
#endif
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
@@ -2964,61 +2964,61 @@ static PyObject *Matrix_imatmul(PyObject *m1, PyObject *m2)
|
||||
* \{ */
|
||||
|
||||
static PySequenceMethods Matrix_SeqMethods = {
|
||||
(lenfunc)Matrix_len, /*sq_length*/
|
||||
(binaryfunc)NULL, /*sq_concat*/
|
||||
(ssizeargfunc)NULL, /*sq_repeat*/
|
||||
(ssizeargfunc)Matrix_item_row, /*sq_item*/
|
||||
(ssizessizeargfunc)NULL, /*sq_slice(DEPRECATED)*/
|
||||
(ssizeobjargproc)Matrix_ass_item_row, /*sq_ass_item*/
|
||||
(ssizessizeobjargproc)NULL, /*sq_ass_slice(DEPRECATED)*/
|
||||
(objobjproc)NULL, /*sq_contains*/
|
||||
(binaryfunc)NULL, /*sq_inplace_concat*/
|
||||
(ssizeargfunc)NULL, /*sq_inplace_repeat*/
|
||||
/*sq_length*/ (lenfunc)Matrix_len,
|
||||
/*sq_concat*/ NULL,
|
||||
/*sq_repeat*/ NULL,
|
||||
/*sq_item*/ (ssizeargfunc)Matrix_item_row,
|
||||
/*was_sq_slice*/ NULL, /* DEPRECATED. */
|
||||
/*sq_ass_item*/ (ssizeobjargproc)Matrix_ass_item_row,
|
||||
/*was_sq_ass_slice*/ NULL, /* DEPRECATED. */
|
||||
/*sq_contains*/ NULL,
|
||||
/*sq_inplace_concat*/ NULL,
|
||||
/*sq_inplace_repeat*/ NULL,
|
||||
};
|
||||
|
||||
static PyMappingMethods Matrix_AsMapping = {
|
||||
(lenfunc)Matrix_len,
|
||||
(binaryfunc)Matrix_subscript,
|
||||
(objobjargproc)Matrix_ass_subscript,
|
||||
/*mp_len*/ (lenfunc)Matrix_len,
|
||||
/*mp_subscript*/ (binaryfunc)Matrix_subscript,
|
||||
/*mp_ass_subscript*/ (objobjargproc)Matrix_ass_subscript,
|
||||
};
|
||||
|
||||
static PyNumberMethods Matrix_NumMethods = {
|
||||
(binaryfunc)Matrix_add, /*nb_add*/
|
||||
(binaryfunc)Matrix_sub, /*nb_subtract*/
|
||||
(binaryfunc)Matrix_mul, /*nb_multiply*/
|
||||
NULL, /*nb_remainder*/
|
||||
NULL, /*nb_divmod*/
|
||||
NULL, /*nb_power*/
|
||||
(unaryfunc)0, /*nb_negative*/
|
||||
(unaryfunc)0, /*tp_positive*/
|
||||
(unaryfunc)0, /*tp_absolute*/
|
||||
(inquiry)0, /*tp_bool*/
|
||||
(unaryfunc)Matrix_inverted_noargs, /*nb_invert*/
|
||||
NULL, /*nb_lshift*/
|
||||
(binaryfunc)0, /*nb_rshift*/
|
||||
NULL, /*nb_and*/
|
||||
NULL, /*nb_xor*/
|
||||
NULL, /*nb_or*/
|
||||
NULL, /*nb_int*/
|
||||
NULL, /*nb_reserved*/
|
||||
NULL, /*nb_float*/
|
||||
NULL, /*nb_inplace_add*/
|
||||
NULL, /*nb_inplace_subtract*/
|
||||
(binaryfunc)Matrix_imul, /*nb_inplace_multiply*/
|
||||
NULL, /*nb_inplace_remainder*/
|
||||
NULL, /*nb_inplace_power*/
|
||||
NULL, /*nb_inplace_lshift*/
|
||||
NULL, /*nb_inplace_rshift*/
|
||||
NULL, /*nb_inplace_and*/
|
||||
NULL, /*nb_inplace_xor*/
|
||||
NULL, /*nb_inplace_or*/
|
||||
NULL, /*nb_floor_divide*/
|
||||
NULL, /*nb_true_divide*/
|
||||
NULL, /*nb_inplace_floor_divide*/
|
||||
NULL, /*nb_inplace_true_divide*/
|
||||
NULL, /*nb_index*/
|
||||
(binaryfunc)Matrix_matmul, /*nb_matrix_multiply*/
|
||||
(binaryfunc)Matrix_imatmul, /*nb_inplace_matrix_multiply*/
|
||||
/*nb_add*/ (binaryfunc)Matrix_add,
|
||||
/*nb_subtract*/ (binaryfunc)Matrix_sub,
|
||||
/*nb_multiply*/ (binaryfunc)Matrix_mul,
|
||||
/*nb_remainder*/ NULL,
|
||||
/*nb_divmod*/ NULL,
|
||||
/*nb_power*/ NULL,
|
||||
/*nb_negative*/ NULL,
|
||||
/*tp_positive*/ NULL,
|
||||
/*tp_absolute*/ NULL,
|
||||
/*tp_bool*/ NULL,
|
||||
/*nb_invert*/ (unaryfunc)Matrix_inverted_noargs,
|
||||
/*nb_lshift*/ NULL,
|
||||
/*nb_rshift*/ NULL,
|
||||
/*nb_and*/ NULL,
|
||||
/*nb_xor*/ NULL,
|
||||
/*nb_or*/ NULL,
|
||||
/*nb_int*/ NULL,
|
||||
/*nb_reserved*/ NULL,
|
||||
/*nb_float*/ NULL,
|
||||
/*nb_inplace_add*/ NULL,
|
||||
/*nb_inplace_subtract*/ NULL,
|
||||
/*nb_inplace_multiply*/ (binaryfunc)Matrix_imul,
|
||||
/*nb_inplace_remainder*/ NULL,
|
||||
/*nb_inplace_power*/ NULL,
|
||||
/*nb_inplace_lshift*/ NULL,
|
||||
/*nb_inplace_rshift*/ NULL,
|
||||
/*nb_inplace_and*/ NULL,
|
||||
/*nb_inplace_xor*/ NULL,
|
||||
/*nb_inplace_or*/ NULL,
|
||||
/*nb_floor_divide*/ NULL,
|
||||
/*nb_true_divide*/ NULL,
|
||||
/*nb_inplace_floor_divide*/ NULL,
|
||||
/*nb_inplace_true_divide*/ NULL,
|
||||
/*nb_index*/ NULL,
|
||||
/*nb_matrix_multiply*/ (binaryfunc)Matrix_matmul,
|
||||
/*nb_inplace_matrix_multiply*/ (binaryfunc)Matrix_imatmul,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
@@ -3314,6 +3314,10 @@ static struct PyMethodDef Matrix_methods[] = {
|
||||
/** \name Matrix Type: Python Object Definition
|
||||
* \{ */
|
||||
|
||||
#ifdef MATH_STANDALONE
|
||||
# define Matrix_str NULL
|
||||
#endif
|
||||
|
||||
PyDoc_STRVAR(
|
||||
matrix_doc,
|
||||
".. class:: Matrix([rows])\n"
|
||||
@@ -3324,57 +3328,61 @@ PyDoc_STRVAR(
|
||||
" :arg rows: Sequence of rows. When omitted, a 4x4 identity matrix is constructed.\n"
|
||||
" :type rows: 2d number sequence\n");
|
||||
PyTypeObject matrix_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0) "Matrix", /*tp_name*/
|
||||
sizeof(MatrixObject), /*tp_basicsize*/
|
||||
0, /*tp_itemsize*/
|
||||
(destructor)BaseMathObject_dealloc, /*tp_dealloc*/
|
||||
(printfunc)NULL, /*tp_print*/
|
||||
NULL, /*tp_getattr*/
|
||||
NULL, /*tp_setattr*/
|
||||
NULL, /*tp_compare*/
|
||||
(reprfunc)Matrix_repr, /*tp_repr*/
|
||||
&Matrix_NumMethods, /*tp_as_number*/
|
||||
&Matrix_SeqMethods, /*tp_as_sequence*/
|
||||
&Matrix_AsMapping, /*tp_as_mapping*/
|
||||
(hashfunc)Matrix_hash, /*tp_hash*/
|
||||
NULL, /*tp_call*/
|
||||
#ifndef MATH_STANDALONE
|
||||
(reprfunc)Matrix_str, /*tp_str*/
|
||||
#else
|
||||
NULL, /*tp_str*/
|
||||
#endif
|
||||
NULL, /*tp_getattro*/
|
||||
NULL, /*tp_setattro*/
|
||||
NULL, /*tp_as_buffer*/
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /*tp_flags*/
|
||||
matrix_doc, /*tp_doc*/
|
||||
(traverseproc)BaseMathObject_traverse, /* tp_traverse */
|
||||
(inquiry)BaseMathObject_clear, /*tp_clear*/
|
||||
(richcmpfunc)Matrix_richcmpr, /*tp_richcompare*/
|
||||
0, /*tp_weaklistoffset*/
|
||||
NULL, /*tp_iter*/
|
||||
NULL, /*tp_iternext*/
|
||||
Matrix_methods, /*tp_methods*/
|
||||
NULL, /*tp_members*/
|
||||
Matrix_getseters, /*tp_getset*/
|
||||
NULL, /*tp_base*/
|
||||
NULL, /*tp_dict*/
|
||||
NULL, /*tp_descr_get*/
|
||||
NULL, /*tp_descr_set*/
|
||||
0, /*tp_dictoffset*/
|
||||
NULL, /*tp_init*/
|
||||
NULL, /*tp_alloc*/
|
||||
Matrix_new, /*tp_new*/
|
||||
NULL, /*tp_free*/
|
||||
(inquiry)BaseMathObject_is_gc, /*tp_is_gc*/
|
||||
NULL, /*tp_bases*/
|
||||
NULL, /*tp_mro*/
|
||||
NULL, /*tp_cache*/
|
||||
NULL, /*tp_subclasses*/
|
||||
NULL, /*tp_weaklist*/
|
||||
NULL, /*tp_del*/
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
/*tp_name*/ "Matrix",
|
||||
/*tp_basicsize*/ sizeof(MatrixObject),
|
||||
/*tp_itemsize*/ 0,
|
||||
/*tp_dealloc*/ (destructor)BaseMathObject_dealloc,
|
||||
/*tp_vectorcall_offset*/ 0,
|
||||
/*tp_getattr*/ NULL,
|
||||
/*tp_setattr*/ NULL,
|
||||
/*tp_as_async*/ NULL,
|
||||
/*tp_repr*/ (reprfunc)Matrix_repr,
|
||||
/*tp_as_number*/ &Matrix_NumMethods,
|
||||
/*tp_as_sequence*/ &Matrix_SeqMethods,
|
||||
/*tp_as_mapping*/ &Matrix_AsMapping,
|
||||
/*tp_hash*/ (hashfunc)Matrix_hash,
|
||||
/*tp_call*/ NULL,
|
||||
/*tp_str*/ (reprfunc)Matrix_str,
|
||||
/*tp_getattro*/ NULL,
|
||||
/*tp_setattro*/ NULL,
|
||||
/*tp_as_buffer*/ NULL,
|
||||
/*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
|
||||
/*tp_doc*/ matrix_doc,
|
||||
/*tp_traverse*/ (traverseproc)BaseMathObject_traverse,
|
||||
/*tp_clear*/ (inquiry)BaseMathObject_clear,
|
||||
/*tp_richcompare*/ (richcmpfunc)Matrix_richcmpr,
|
||||
/*tp_weaklistoffset*/ 0,
|
||||
/*tp_iter*/ NULL,
|
||||
/*tp_iternext*/ NULL,
|
||||
/*tp_methods*/ Matrix_methods,
|
||||
/*tp_members*/ NULL,
|
||||
/*tp_getset*/ Matrix_getseters,
|
||||
/*tp_base*/ NULL,
|
||||
/*tp_dict*/ NULL,
|
||||
/*tp_descr_get*/ NULL,
|
||||
/*tp_descr_set*/ NULL,
|
||||
/*tp_dictoffset*/ 0,
|
||||
/*tp_init*/ NULL,
|
||||
/*tp_alloc*/ NULL,
|
||||
/*tp_new*/ Matrix_new,
|
||||
/*tp_free*/ NULL,
|
||||
/*tp_is_gc*/ (inquiry)BaseMathObject_is_gc,
|
||||
/*tp_bases*/ NULL,
|
||||
/*tp_mro*/ NULL,
|
||||
/*tp_cache*/ NULL,
|
||||
/*tp_subclasses*/ NULL,
|
||||
/*tp_weaklist*/ NULL,
|
||||
/*tp_del*/ NULL,
|
||||
/*tp_version_tag*/ 0,
|
||||
/*tp_finalize*/ NULL,
|
||||
/*tp_vectorcall*/ NULL,
|
||||
};
|
||||
|
||||
#ifdef MATH_STANDALONE
|
||||
# undef Matrix_str
|
||||
#endif
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
@@ -3752,9 +3760,9 @@ static PyObject *MatrixAccess_iter(MatrixAccessObject *self)
|
||||
}
|
||||
|
||||
static PyMappingMethods MatrixAccess_AsMapping = {
|
||||
(lenfunc)MatrixAccess_len,
|
||||
(binaryfunc)MatrixAccess_subscript,
|
||||
(objobjargproc)MatrixAccess_ass_subscript,
|
||||
/*mp_len*/ (lenfunc)MatrixAccess_len,
|
||||
/*mp_subscript*/ (binaryfunc)MatrixAccess_subscript,
|
||||
/*mp_ass_subscript*/ (objobjargproc)MatrixAccess_ass_subscript,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
@@ -3764,31 +3772,55 @@ static PyMappingMethods MatrixAccess_AsMapping = {
|
||||
* \{ */
|
||||
|
||||
PyTypeObject matrix_access_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0) "MatrixAccess", /*tp_name*/
|
||||
sizeof(MatrixAccessObject), /*tp_basicsize*/
|
||||
0, /*tp_itemsize*/
|
||||
(destructor)MatrixAccess_dealloc, /*tp_dealloc*/
|
||||
(printfunc)NULL, /*tp_print*/
|
||||
NULL, /*tp_getattr*/
|
||||
NULL, /*tp_setattr*/
|
||||
NULL, /*tp_compare*/
|
||||
NULL, /*tp_repr*/
|
||||
NULL, /*tp_as_number*/
|
||||
NULL /* &MatrixAccess_SeqMethods */ /* TODO */, /*tp_as_sequence*/
|
||||
&MatrixAccess_AsMapping, /*tp_as_mapping*/
|
||||
NULL, /*tp_hash*/
|
||||
NULL, /*tp_call*/
|
||||
NULL, /*tp_str*/
|
||||
NULL, /*tp_getattro*/
|
||||
NULL, /*tp_setattro*/
|
||||
NULL, /*tp_as_buffer*/
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /*tp_flags*/
|
||||
NULL, /*tp_doc*/
|
||||
(traverseproc)MatrixAccess_traverse, /*tp_traverse*/
|
||||
(inquiry)MatrixAccess_clear, /*tp_clear*/
|
||||
NULL /* (richcmpfunc)MatrixAccess_richcmpr */ /* TODO*/, /*tp_richcompare*/
|
||||
0, /*tp_weaklistoffset*/
|
||||
(getiterfunc)MatrixAccess_iter, /* getiterfunc tp_iter; */
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
/*tp_name*/ "MatrixAccess",
|
||||
/*tp_basicsize*/ sizeof(MatrixAccessObject),
|
||||
/*tp_itemsize*/ 0,
|
||||
/*tp_dealloc*/ (destructor)MatrixAccess_dealloc,
|
||||
/*tp_vectorcall_offset*/ 0,
|
||||
/*tp_getattr*/ NULL,
|
||||
/*tp_setattr*/ NULL,
|
||||
/*tp_as_async*/ NULL,
|
||||
/*tp_repr*/ NULL,
|
||||
/*tp_as_number*/ NULL,
|
||||
/*tp_as_sequence*/ NULL /* &MatrixAccess_SeqMethods */ /* TODO */,
|
||||
/*tp_as_mapping*/ &MatrixAccess_AsMapping,
|
||||
/*tp_hash*/ NULL,
|
||||
/*tp_call*/ NULL,
|
||||
/*tp_str*/ NULL,
|
||||
/*tp_getattro*/ NULL,
|
||||
/*tp_setattro*/ NULL,
|
||||
/*tp_as_buffer*/ NULL,
|
||||
/*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
|
||||
/*tp_doc*/ NULL,
|
||||
/*tp_traverse*/ (traverseproc)MatrixAccess_traverse,
|
||||
/*tp_clear*/ (inquiry)MatrixAccess_clear,
|
||||
/*tp_richcompare*/ NULL /* MatrixAccess_richcmpr */ /* TODO*/,
|
||||
/*tp_weaklistoffset*/ 0,
|
||||
/*tp_iter*/ (getiterfunc)MatrixAccess_iter,
|
||||
/*tp_iternext*/ NULL,
|
||||
/*tp_methods*/ NULL,
|
||||
/*tp_members*/ NULL,
|
||||
/*tp_getset*/ NULL,
|
||||
/*tp_base*/ NULL,
|
||||
/*tp_dict*/ NULL,
|
||||
/*tp_descr_get*/ NULL,
|
||||
/*tp_descr_set*/ NULL,
|
||||
/*tp_dictoffset*/ 0,
|
||||
/*tp_init*/ NULL,
|
||||
/*tp_alloc*/ NULL,
|
||||
/*tp_new*/ NULL,
|
||||
/*tp_free*/ NULL,
|
||||
/*tp_is_gc*/ NULL,
|
||||
/*tp_bases*/ NULL,
|
||||
/*tp_mro*/ NULL,
|
||||
/*tp_cache*/ NULL,
|
||||
/*tp_subclasses*/ NULL,
|
||||
/*tp_weaklist*/ NULL,
|
||||
/*tp_del*/ NULL,
|
||||
/*tp_version_tag*/ 0,
|
||||
/*tp_finalize*/ NULL,
|
||||
/*tp_vectorcall*/ NULL,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
@@ -1342,61 +1342,61 @@ static PyObject *Quaternion_neg(QuaternionObject *self)
|
||||
* \{ */
|
||||
|
||||
static PySequenceMethods Quaternion_SeqMethods = {
|
||||
(lenfunc)Quaternion_len, /*sq_length*/
|
||||
(binaryfunc)NULL, /*sq_concat*/
|
||||
(ssizeargfunc)NULL, /*sq_repeat*/
|
||||
(ssizeargfunc)Quaternion_item, /*sq_item*/
|
||||
(ssizessizeargfunc)NULL, /*sq_slice(deprecated)*/
|
||||
(ssizeobjargproc)Quaternion_ass_item, /*sq_ass_item*/
|
||||
(ssizessizeobjargproc)NULL, /*sq_ass_slice(deprecated)*/
|
||||
(objobjproc)NULL, /*sq_contains*/
|
||||
(binaryfunc)NULL, /*sq_inplace_concat*/
|
||||
(ssizeargfunc)NULL, /*sq_inplace_repeat*/
|
||||
/*sq_length*/ (lenfunc)Quaternion_len,
|
||||
/*sq_concat*/ NULL,
|
||||
/*sq_repeat*/ NULL,
|
||||
/*sq_item*/ (ssizeargfunc)Quaternion_item,
|
||||
/*was_sq_slice*/ NULL, /* DEPRECATED. */
|
||||
/*sq_ass_item*/ (ssizeobjargproc)Quaternion_ass_item,
|
||||
/*was_sq_ass_slice*/ NULL, /* DEPRECATED. */
|
||||
/*sq_contains*/ NULL,
|
||||
/*sq_inplace_concat*/ NULL,
|
||||
/*sq_inplace_repeat*/ NULL,
|
||||
};
|
||||
|
||||
static PyMappingMethods Quaternion_AsMapping = {
|
||||
(lenfunc)Quaternion_len,
|
||||
(binaryfunc)Quaternion_subscript,
|
||||
(objobjargproc)Quaternion_ass_subscript,
|
||||
/*mp_len*/ (lenfunc)Quaternion_len,
|
||||
/*mp_subscript*/ (binaryfunc)Quaternion_subscript,
|
||||
/*mp_ass_subscript*/ (objobjargproc)Quaternion_ass_subscript,
|
||||
};
|
||||
|
||||
static PyNumberMethods Quaternion_NumMethods = {
|
||||
(binaryfunc)Quaternion_add, /*nb_add*/
|
||||
(binaryfunc)Quaternion_sub, /*nb_subtract*/
|
||||
(binaryfunc)Quaternion_mul, /*nb_multiply*/
|
||||
NULL, /*nb_remainder*/
|
||||
NULL, /*nb_divmod*/
|
||||
NULL, /*nb_power*/
|
||||
(unaryfunc)Quaternion_neg, /*nb_negative*/
|
||||
(unaryfunc)Quaternion_copy, /*tp_positive*/
|
||||
(unaryfunc)0, /*tp_absolute*/
|
||||
(inquiry)0, /*tp_bool*/
|
||||
(unaryfunc)0, /*nb_invert*/
|
||||
NULL, /*nb_lshift*/
|
||||
(binaryfunc)0, /*nb_rshift*/
|
||||
NULL, /*nb_and*/
|
||||
NULL, /*nb_xor*/
|
||||
NULL, /*nb_or*/
|
||||
NULL, /*nb_int*/
|
||||
NULL, /*nb_reserved*/
|
||||
NULL, /*nb_float*/
|
||||
NULL, /*nb_inplace_add*/
|
||||
NULL, /*nb_inplace_subtract*/
|
||||
(binaryfunc)Quaternion_imul, /*nb_inplace_multiply*/
|
||||
NULL, /*nb_inplace_remainder*/
|
||||
NULL, /*nb_inplace_power*/
|
||||
NULL, /*nb_inplace_lshift*/
|
||||
NULL, /*nb_inplace_rshift*/
|
||||
NULL, /*nb_inplace_and*/
|
||||
NULL, /*nb_inplace_xor*/
|
||||
NULL, /*nb_inplace_or*/
|
||||
NULL, /*nb_floor_divide*/
|
||||
NULL, /*nb_true_divide*/
|
||||
NULL, /*nb_inplace_floor_divide*/
|
||||
NULL, /*nb_inplace_true_divide*/
|
||||
NULL, /*nb_index*/
|
||||
(binaryfunc)Quaternion_matmul, /*nb_matrix_multiply*/
|
||||
(binaryfunc)Quaternion_imatmul, /*nb_inplace_matrix_multiply*/
|
||||
/*nb_add*/ (binaryfunc)Quaternion_add,
|
||||
/*nb_subtract*/ (binaryfunc)Quaternion_sub,
|
||||
/*nb_multiply*/ (binaryfunc)Quaternion_mul,
|
||||
/*nb_remainder*/ NULL,
|
||||
/*nb_divmod*/ NULL,
|
||||
/*nb_power*/ NULL,
|
||||
/*nb_negative*/ (unaryfunc)Quaternion_neg,
|
||||
/*tp_positive*/ (unaryfunc)Quaternion_copy,
|
||||
/*tp_absolute*/ NULL,
|
||||
/*tp_bool*/ NULL,
|
||||
/*nb_invert*/ NULL,
|
||||
/*nb_lshift*/ NULL,
|
||||
/*nb_rshift*/ NULL,
|
||||
/*nb_and*/ NULL,
|
||||
/*nb_xor*/ NULL,
|
||||
/*nb_or*/ NULL,
|
||||
/*nb_int*/ NULL,
|
||||
/*nb_reserved*/ NULL,
|
||||
/*nb_float*/ NULL,
|
||||
/*nb_inplace_add*/ NULL,
|
||||
/*nb_inplace_subtract*/ NULL,
|
||||
/*nb_inplace_multiply*/ (binaryfunc)Quaternion_imul,
|
||||
/*nb_inplace_remainder*/ NULL,
|
||||
/*nb_inplace_power*/ NULL,
|
||||
/*nb_inplace_lshift*/ NULL,
|
||||
/*nb_inplace_rshift*/ NULL,
|
||||
/*nb_inplace_and*/ NULL,
|
||||
/*nb_inplace_xor*/ NULL,
|
||||
/*nb_inplace_or*/ NULL,
|
||||
/*nb_floor_divide*/ NULL,
|
||||
/*nb_true_divide*/ NULL,
|
||||
/*nb_inplace_floor_divide*/ NULL,
|
||||
/*nb_inplace_true_divide*/ NULL,
|
||||
/*nb_index*/ NULL,
|
||||
/*nb_matrix_multiply*/ (binaryfunc)Quaternion_matmul,
|
||||
/*nb_inplace_matrix_multiply*/ (binaryfunc)Quaternion_imatmul,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
@@ -1657,6 +1657,10 @@ static struct PyMethodDef Quaternion_methods[] = {
|
||||
/** \name Quaternion Type: Python Object Definition
|
||||
* \{ */
|
||||
|
||||
#ifdef MATH_STANDALONE
|
||||
# define Quaternion_str NULL
|
||||
#endif
|
||||
|
||||
PyDoc_STRVAR(quaternion_doc,
|
||||
".. class:: Quaternion([seq, [angle]])\n"
|
||||
"\n"
|
||||
@@ -1682,57 +1686,61 @@ PyDoc_STRVAR(quaternion_doc,
|
||||
"\n"
|
||||
" .. seealso:: :meth:`to_axis_angle`\n");
|
||||
PyTypeObject quaternion_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0) "Quaternion", /* tp_name */
|
||||
sizeof(QuaternionObject), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
(destructor)BaseMathObject_dealloc, /* tp_dealloc */
|
||||
(printfunc)NULL, /* tp_print */
|
||||
NULL, /* tp_getattr */
|
||||
NULL, /* tp_setattr */
|
||||
NULL, /* tp_compare */
|
||||
(reprfunc)Quaternion_repr, /* tp_repr */
|
||||
&Quaternion_NumMethods, /* tp_as_number */
|
||||
&Quaternion_SeqMethods, /* tp_as_sequence */
|
||||
&Quaternion_AsMapping, /* tp_as_mapping */
|
||||
(hashfunc)Quaternion_hash, /* tp_hash */
|
||||
NULL, /* tp_call */
|
||||
#ifndef MATH_STANDALONE
|
||||
(reprfunc)Quaternion_str, /* tp_str */
|
||||
#else
|
||||
NULL, /* tp_str */
|
||||
#endif
|
||||
NULL, /* tp_getattro */
|
||||
NULL, /* tp_setattro */
|
||||
NULL, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */
|
||||
quaternion_doc, /* tp_doc */
|
||||
(traverseproc)BaseMathObject_traverse, /* tp_traverse */
|
||||
(inquiry)BaseMathObject_clear, /* tp_clear */
|
||||
(richcmpfunc)Quaternion_richcmpr, /* tp_richcompare */
|
||||
0, /* tp_weaklistoffset */
|
||||
NULL, /* tp_iter */
|
||||
NULL, /* tp_iternext */
|
||||
Quaternion_methods, /* tp_methods */
|
||||
NULL, /* tp_members */
|
||||
Quaternion_getseters, /* tp_getset */
|
||||
NULL, /* tp_base */
|
||||
NULL, /* tp_dict */
|
||||
NULL, /* tp_descr_get */
|
||||
NULL, /* tp_descr_set */
|
||||
0, /* tp_dictoffset */
|
||||
NULL, /* tp_init */
|
||||
NULL, /* tp_alloc */
|
||||
Quaternion_new, /* tp_new */
|
||||
NULL, /* tp_free */
|
||||
(inquiry)BaseMathObject_is_gc, /* tp_is_gc */
|
||||
NULL, /* tp_bases */
|
||||
NULL, /* tp_mro */
|
||||
NULL, /* tp_cache */
|
||||
NULL, /* tp_subclasses */
|
||||
NULL, /* tp_weaklist */
|
||||
NULL, /* tp_del */
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
/*tp_name*/ "Quaternion",
|
||||
/*tp_basicsize*/ sizeof(QuaternionObject),
|
||||
/*tp_itemsize*/ 0,
|
||||
/*tp_dealloc*/ (destructor)BaseMathObject_dealloc,
|
||||
/*tp_vectorcall_offset*/ 0,
|
||||
/*tp_getattr*/ NULL,
|
||||
/*tp_setattr*/ NULL,
|
||||
/*tp_as_async*/ NULL,
|
||||
/*tp_repr*/ (reprfunc)Quaternion_repr,
|
||||
/*tp_as_number*/ &Quaternion_NumMethods,
|
||||
/*tp_as_sequence*/ &Quaternion_SeqMethods,
|
||||
/*tp_as_mapping*/ &Quaternion_AsMapping,
|
||||
/*tp_hash*/ (hashfunc)Quaternion_hash,
|
||||
/*tp_call*/ NULL,
|
||||
/*tp_str*/ (reprfunc)Quaternion_str,
|
||||
/*tp_getattro*/ NULL,
|
||||
/*tp_setattro*/ NULL,
|
||||
/*tp_as_buffer*/ NULL,
|
||||
/*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
|
||||
/*tp_doc*/ quaternion_doc,
|
||||
/*tp_traverse*/ (traverseproc)BaseMathObject_traverse,
|
||||
/*tp_clear*/ (inquiry)BaseMathObject_clear,
|
||||
/*tp_richcompare*/ (richcmpfunc)Quaternion_richcmpr,
|
||||
/*tp_weaklistoffset*/ 0,
|
||||
/*tp_iter*/ NULL,
|
||||
/*tp_iternext*/ NULL,
|
||||
/*tp_methods*/ Quaternion_methods,
|
||||
/*tp_members*/ NULL,
|
||||
/*tp_getset*/ Quaternion_getseters,
|
||||
/*tp_base*/ NULL,
|
||||
/*tp_dict*/ NULL,
|
||||
/*tp_descr_get*/ NULL,
|
||||
/*tp_descr_set*/ NULL,
|
||||
/*tp_dictoffset*/ 0,
|
||||
/*tp_init*/ NULL,
|
||||
/*tp_alloc*/ NULL,
|
||||
/*tp_new*/ Quaternion_new,
|
||||
/*tp_free*/ NULL,
|
||||
/*tp_is_gc*/ (inquiry)BaseMathObject_is_gc,
|
||||
/*tp_bases*/ NULL,
|
||||
/*tp_mro*/ NULL,
|
||||
/*tp_cache*/ NULL,
|
||||
/*tp_subclasses*/ NULL,
|
||||
/*tp_weaklist*/ NULL,
|
||||
/*tp_del*/ NULL,
|
||||
/*tp_version_tag*/ 0,
|
||||
/*tp_finalize*/ NULL,
|
||||
/*tp_vectorcall*/ NULL,
|
||||
};
|
||||
|
||||
#ifdef MATH_STANDALONE
|
||||
# undef Quaternion_str
|
||||
#endif
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
@@ -2387,61 +2387,61 @@ static PyObject *Vector_neg(VectorObject *self)
|
||||
* \{ */
|
||||
|
||||
static PySequenceMethods Vector_SeqMethods = {
|
||||
(lenfunc)Vector_len, /*sq_length*/
|
||||
(binaryfunc)NULL, /*sq_concat*/
|
||||
(ssizeargfunc)NULL, /*sq_repeat*/
|
||||
(ssizeargfunc)Vector_item, /*sq_item*/
|
||||
NULL, /*sq_slice(DEPRECATED)*/
|
||||
(ssizeobjargproc)Vector_ass_item, /*sq_ass_item*/
|
||||
NULL, /*sq_ass_slice(DEPRECATED)*/
|
||||
(objobjproc)NULL, /*sq_contains*/
|
||||
(binaryfunc)NULL, /*sq_inplace_concat */
|
||||
(ssizeargfunc)NULL, /*sq_inplace_repeat */
|
||||
/*sq_length*/ (lenfunc)Vector_len,
|
||||
/*sq_concat*/ NULL,
|
||||
/*sq_repeat*/ NULL,
|
||||
/*sq_item*/ (ssizeargfunc)Vector_item,
|
||||
/*was_sq_slice*/ NULL, /* DEPRECATED. */
|
||||
/*sq_ass_item*/ (ssizeobjargproc)Vector_ass_item,
|
||||
/*was_sq_ass_slice*/ NULL, /* DEPRECATED. */
|
||||
/*sq_contains*/ NULL,
|
||||
/*sq_inplace_concat */ NULL,
|
||||
/*sq_inplace_repeat */ NULL,
|
||||
};
|
||||
|
||||
static PyMappingMethods Vector_AsMapping = {
|
||||
(lenfunc)Vector_len,
|
||||
(binaryfunc)Vector_subscript,
|
||||
(objobjargproc)Vector_ass_subscript,
|
||||
/*mp_len*/ (lenfunc)Vector_len,
|
||||
/*mp_subscript*/ (binaryfunc)Vector_subscript,
|
||||
/*mp_ass_subscript*/ (objobjargproc)Vector_ass_subscript,
|
||||
};
|
||||
|
||||
static PyNumberMethods Vector_NumMethods = {
|
||||
(binaryfunc)Vector_add, /*nb_add*/
|
||||
(binaryfunc)Vector_sub, /*nb_subtract*/
|
||||
(binaryfunc)Vector_mul, /*nb_multiply*/
|
||||
NULL, /*nb_remainder*/
|
||||
NULL, /*nb_divmod*/
|
||||
NULL, /*nb_power*/
|
||||
(unaryfunc)Vector_neg, /*nb_negative*/
|
||||
(unaryfunc)Vector_copy, /*tp_positive*/
|
||||
(unaryfunc)NULL, /*tp_absolute*/
|
||||
(inquiry)NULL, /*tp_bool*/
|
||||
(unaryfunc)NULL, /*nb_invert*/
|
||||
NULL, /*nb_lshift*/
|
||||
(binaryfunc)NULL, /*nb_rshift*/
|
||||
NULL, /*nb_and*/
|
||||
NULL, /*nb_xor*/
|
||||
NULL, /*nb_or*/
|
||||
NULL, /*nb_int*/
|
||||
NULL, /*nb_reserved*/
|
||||
NULL, /*nb_float*/
|
||||
Vector_iadd, /*nb_inplace_add*/
|
||||
Vector_isub, /*nb_inplace_subtract*/
|
||||
Vector_imul, /*nb_inplace_multiply*/
|
||||
NULL, /*nb_inplace_remainder*/
|
||||
NULL, /*nb_inplace_power*/
|
||||
NULL, /*nb_inplace_lshift*/
|
||||
NULL, /*nb_inplace_rshift*/
|
||||
NULL, /*nb_inplace_and*/
|
||||
NULL, /*nb_inplace_xor*/
|
||||
NULL, /*nb_inplace_or*/
|
||||
NULL, /*nb_floor_divide*/
|
||||
Vector_div, /*nb_true_divide*/
|
||||
NULL, /*nb_inplace_floor_divide*/
|
||||
Vector_idiv, /*nb_inplace_true_divide*/
|
||||
NULL, /*nb_index*/
|
||||
(binaryfunc)Vector_matmul, /*nb_matrix_multiply*/
|
||||
(binaryfunc)Vector_imatmul, /*nb_inplace_matrix_multiply*/
|
||||
/*nb_add*/ (binaryfunc)Vector_add,
|
||||
/*nb_subtract*/ (binaryfunc)Vector_sub,
|
||||
/*nb_multiply*/ (binaryfunc)Vector_mul,
|
||||
/*nb_remainder*/ NULL,
|
||||
/*nb_divmod*/ NULL,
|
||||
/*nb_power*/ NULL,
|
||||
/*nb_negative*/ (unaryfunc)Vector_neg,
|
||||
/*tp_positive*/ (unaryfunc)Vector_copy,
|
||||
/*tp_absolute*/ NULL,
|
||||
/*tp_bool*/ NULL,
|
||||
/*nb_invert*/ NULL,
|
||||
/*nb_lshift*/ NULL,
|
||||
/*nb_rshift*/ NULL,
|
||||
/*nb_and*/ NULL,
|
||||
/*nb_xor*/ NULL,
|
||||
/*nb_or*/ NULL,
|
||||
/*nb_int*/ NULL,
|
||||
/*nb_reserved*/ NULL,
|
||||
/*nb_float*/ NULL,
|
||||
/*nb_inplace_add*/ Vector_iadd,
|
||||
/*nb_inplace_subtract*/ Vector_isub,
|
||||
/*nb_inplace_multiply*/ Vector_imul,
|
||||
/*nb_inplace_remainder*/ NULL,
|
||||
/*nb_inplace_power*/ NULL,
|
||||
/*nb_inplace_lshift*/ NULL,
|
||||
/*nb_inplace_rshift*/ NULL,
|
||||
/*nb_inplace_and*/ NULL,
|
||||
/*nb_inplace_xor*/ NULL,
|
||||
/*nb_inplace_or*/ NULL,
|
||||
/*nb_floor_divide*/ NULL,
|
||||
/*nb_true_divide*/ Vector_div,
|
||||
/*nb_inplace_floor_divide*/ NULL,
|
||||
/*nb_inplace_true_divide*/ Vector_idiv,
|
||||
/*nb_index*/ NULL,
|
||||
/*nb_matrix_multiply*/ (binaryfunc)Vector_matmul,
|
||||
/*nb_inplace_matrix_multiply*/ (binaryfunc)Vector_imatmul,
|
||||
};
|
||||
|
||||
/** \} */
|
||||
@@ -3183,6 +3183,10 @@ static struct PyMethodDef Vector_methods[] = {
|
||||
* both get sent to Vector_mul and it needs to sort out the order
|
||||
* \{ */
|
||||
|
||||
#ifdef MATH_STANDALONE
|
||||
# define Vector_str NULL
|
||||
#endif
|
||||
|
||||
PyDoc_STRVAR(vector_doc,
|
||||
".. class:: Vector(seq)\n"
|
||||
"\n"
|
||||
@@ -3192,89 +3196,60 @@ PyDoc_STRVAR(vector_doc,
|
||||
" :type seq: sequence of numbers\n");
|
||||
PyTypeObject vector_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
/* For printing, in format "<module>.<name>" */
|
||||
"Vector", /* char *tp_name; */
|
||||
sizeof(VectorObject), /* int tp_basicsize; */
|
||||
0, /* tp_itemsize; For allocation */
|
||||
|
||||
/* Methods to implement standard operations */
|
||||
|
||||
(destructor)BaseMathObject_dealloc, /* destructor tp_dealloc; */
|
||||
0, /* tp_vectorcall_offset */
|
||||
NULL, /* getattrfunc tp_getattr; */
|
||||
NULL, /* setattrfunc tp_setattr; */
|
||||
NULL, /* cmpfunc tp_compare; */
|
||||
(reprfunc)Vector_repr, /* reprfunc tp_repr; */
|
||||
|
||||
/* Method suites for standard classes */
|
||||
|
||||
&Vector_NumMethods, /* PyNumberMethods *tp_as_number; */
|
||||
&Vector_SeqMethods, /* PySequenceMethods *tp_as_sequence; */
|
||||
&Vector_AsMapping, /* PyMappingMethods *tp_as_mapping; */
|
||||
|
||||
/* More standard operations (here for binary compatibility) */
|
||||
|
||||
(hashfunc)Vector_hash, /* hashfunc tp_hash; */
|
||||
NULL, /* ternaryfunc tp_call; */
|
||||
#ifndef MATH_STANDALONE
|
||||
(reprfunc)Vector_str, /* reprfunc tp_str; */
|
||||
#else
|
||||
NULL, /* reprfunc tp_str; */
|
||||
#endif
|
||||
NULL, /* getattrofunc tp_getattro; */
|
||||
NULL, /* setattrofunc tp_setattro; */
|
||||
|
||||
/* Functions to access object as input/output buffer */
|
||||
NULL, /* PyBufferProcs *tp_as_buffer; */
|
||||
|
||||
/*** Flags to define presence of optional/expanded features ***/
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
|
||||
vector_doc, /* char *tp_doc; Documentation string */
|
||||
/*** Assigned meaning in release 2.0 ***/
|
||||
|
||||
/* call function for all accessible objects */
|
||||
(traverseproc)BaseMathObject_traverse, /* tp_traverse */
|
||||
|
||||
/* delete references to contained objects */
|
||||
(inquiry)BaseMathObject_clear, /* tp_clear */
|
||||
|
||||
/*** Assigned meaning in release 2.1 ***/
|
||||
/*** rich comparisons ***/
|
||||
(richcmpfunc)Vector_richcmpr, /* richcmpfunc tp_richcompare; */
|
||||
|
||||
/*** weak reference enabler ***/
|
||||
0, /* long tp_weaklistoffset; */
|
||||
|
||||
/*** Added in release 2.2 ***/
|
||||
/* Iterators */
|
||||
NULL, /* getiterfunc tp_iter; */
|
||||
NULL, /* iternextfunc tp_iternext; */
|
||||
|
||||
/*** Attribute descriptor and subclassing stuff ***/
|
||||
Vector_methods, /* struct PyMethodDef *tp_methods; */
|
||||
NULL, /* struct PyMemberDef *tp_members; */
|
||||
Vector_getseters, /* struct PyGetSetDef *tp_getset; */
|
||||
NULL, /* struct _typeobject *tp_base; */
|
||||
NULL, /* PyObject *tp_dict; */
|
||||
NULL, /* descrgetfunc tp_descr_get; */
|
||||
NULL, /* descrsetfunc tp_descr_set; */
|
||||
0, /* long tp_dictoffset; */
|
||||
NULL, /* initproc tp_init; */
|
||||
NULL, /* allocfunc tp_alloc; */
|
||||
Vector_new, /* newfunc tp_new; */
|
||||
/* Low-level free-memory routine */
|
||||
NULL, /* freefunc tp_free; */
|
||||
/* For PyObject_IS_GC */
|
||||
(inquiry)BaseMathObject_is_gc, /* inquiry tp_is_gc; */
|
||||
NULL, /* PyObject *tp_bases; */
|
||||
/* method resolution order */
|
||||
NULL, /* PyObject *tp_mro; */
|
||||
NULL, /* PyObject *tp_cache; */
|
||||
NULL, /* PyObject *tp_subclasses; */
|
||||
NULL, /* PyObject *tp_weaklist; */
|
||||
NULL,
|
||||
/*tp_name*/ "Vector",
|
||||
/*tp_basicsize*/ sizeof(VectorObject),
|
||||
/*tp_itemsize*/ 0,
|
||||
/*tp_dealloc*/ (destructor)BaseMathObject_dealloc,
|
||||
/*tp_vectorcall_offset*/ 0,
|
||||
/*tp_getattr*/ NULL,
|
||||
/*tp_setattr*/ NULL,
|
||||
/*tp_as_async*/ NULL,
|
||||
/*tp_repr*/ (reprfunc)Vector_repr,
|
||||
/*tp_as_number*/ &Vector_NumMethods,
|
||||
/*tp_as_sequence*/ &Vector_SeqMethods,
|
||||
/*tp_as_mapping*/ &Vector_AsMapping,
|
||||
/*tp_hash*/ (hashfunc)Vector_hash,
|
||||
/*tp_call*/ NULL,
|
||||
/*tp_str*/ (reprfunc)Vector_str,
|
||||
/*tp_getattro*/ NULL,
|
||||
/*tp_setattro*/ NULL,
|
||||
/*tp_as_buffer*/ NULL,
|
||||
/*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
|
||||
/*tp_doc*/ vector_doc,
|
||||
/*tp_traverse*/ (traverseproc)BaseMathObject_traverse,
|
||||
/*tp_clear*/ (inquiry)BaseMathObject_clear,
|
||||
/*tp_richcompare*/ (richcmpfunc)Vector_richcmpr,
|
||||
/*tp_weaklistoffset*/ 0,
|
||||
/*tp_iter*/ NULL,
|
||||
/*tp_iternext*/ NULL,
|
||||
/*tp_methods*/ Vector_methods,
|
||||
/*tp_members*/ NULL,
|
||||
/*tp_getset*/ Vector_getseters,
|
||||
/*tp_base*/ NULL,
|
||||
/*tp_dict*/ NULL,
|
||||
/*tp_descr_get*/ NULL,
|
||||
/*tp_descr_set*/ NULL,
|
||||
/*tp_dictoffset*/ 0,
|
||||
/*tp_init*/ NULL,
|
||||
/*tp_alloc*/ NULL,
|
||||
/*tp_new*/ Vector_new,
|
||||
/*tp_free*/ NULL,
|
||||
/*tp_is_gc*/ (inquiry)BaseMathObject_is_gc,
|
||||
/*tp_bases*/ NULL,
|
||||
/*tp_mro*/ NULL,
|
||||
/*tp_cache*/ NULL,
|
||||
/*tp_subclasses*/ NULL,
|
||||
/*tp_weaklist*/ NULL,
|
||||
/*tp_del*/ NULL,
|
||||
/*tp_version_tag*/ 0,
|
||||
/*tp_finalize*/ NULL,
|
||||
/*tp_vectorcall*/ NULL,
|
||||
};
|
||||
|
||||
#ifdef MATH_STANDALONE
|
||||
# undef Vector_str NULL
|
||||
#endif
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
@@ -1235,52 +1235,55 @@ static PyMethodDef py_bvhtree_methods[] = {
|
||||
};
|
||||
|
||||
PyTypeObject PyBVHTree_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0) "BVHTree", /* tp_name */
|
||||
sizeof(PyBVHTree), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
/* methods */
|
||||
(destructor)py_bvhtree__tp_dealloc, /* tp_dealloc */
|
||||
(printfunc)NULL, /* tp_print */
|
||||
NULL, /* tp_getattr */
|
||||
NULL, /* tp_setattr */
|
||||
NULL, /* tp_compare */
|
||||
NULL, /* tp_repr */
|
||||
NULL, /* tp_as_number */
|
||||
NULL, /* tp_as_sequence */
|
||||
NULL, /* tp_as_mapping */
|
||||
NULL, /* tp_hash */
|
||||
NULL, /* tp_call */
|
||||
NULL, /* tp_str */
|
||||
NULL, /* tp_getattro */
|
||||
NULL, /* tp_setattro */
|
||||
NULL, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT, /* tp_flags */
|
||||
NULL, /* Documentation string */
|
||||
NULL, /* tp_traverse */
|
||||
NULL, /* tp_clear */
|
||||
NULL, /* tp_richcompare */
|
||||
0, /* tp_weaklistoffset */
|
||||
NULL, /* tp_iter */
|
||||
NULL, /* tp_iternext */
|
||||
py_bvhtree_methods, /* tp_methods */
|
||||
NULL, /* tp_members */
|
||||
NULL, /* tp_getset */
|
||||
NULL, /* tp_base */
|
||||
NULL, /* tp_dict */
|
||||
NULL, /* tp_descr_get */
|
||||
NULL, /* tp_descr_set */
|
||||
0, /* tp_dictoffset */
|
||||
NULL, /* tp_init */
|
||||
(allocfunc)PyType_GenericAlloc, /* tp_alloc */
|
||||
(newfunc)PyType_GenericNew, /* tp_new */
|
||||
(freefunc)0, /* tp_free */
|
||||
NULL, /* tp_is_gc */
|
||||
NULL, /* tp_bases */
|
||||
NULL, /* tp_mro */
|
||||
NULL, /* tp_cache */
|
||||
NULL, /* tp_subclasses */
|
||||
NULL, /* tp_weaklist */
|
||||
(destructor)NULL, /* tp_del */
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
/*tp_name*/ "BVHTree",
|
||||
/*tp_basicsize*/ sizeof(PyBVHTree),
|
||||
/*tp_itemsize*/ 0,
|
||||
/*tp_dealloc*/ (destructor)py_bvhtree__tp_dealloc,
|
||||
/*tp_vectorcall_offset*/ 0,
|
||||
/*tp_getattr*/ NULL,
|
||||
/*tp_setattr*/ NULL,
|
||||
/*tp_as_async*/ NULL,
|
||||
/*tp_repr*/ NULL,
|
||||
/*tp_as_number*/ NULL,
|
||||
/*tp_as_sequence*/ NULL,
|
||||
/*tp_as_mapping*/ NULL,
|
||||
/*tp_hash*/ NULL,
|
||||
/*tp_call*/ NULL,
|
||||
/*tp_str*/ NULL,
|
||||
/*tp_getattro*/ NULL,
|
||||
/*tp_setattro*/ NULL,
|
||||
/*tp_as_buffer*/ NULL,
|
||||
/*tp_flags*/ Py_TPFLAGS_DEFAULT,
|
||||
/*tp_doc*/ NULL,
|
||||
/*tp_traverse*/ NULL,
|
||||
/*tp_clear*/ NULL,
|
||||
/*tp_richcompare*/ NULL,
|
||||
/*tp_weaklistoffset*/ 0,
|
||||
/*tp_iter*/ NULL,
|
||||
/*tp_iternext*/ NULL,
|
||||
/*tp_methods*/ py_bvhtree_methods,
|
||||
/*tp_members*/ NULL,
|
||||
/*tp_getset*/ NULL,
|
||||
/*tp_base*/ NULL,
|
||||
/*tp_dict*/ NULL,
|
||||
/*tp_descr_get*/ NULL,
|
||||
/*tp_descr_set*/ NULL,
|
||||
/*tp_dictoffset*/ 0,
|
||||
/*tp_init*/ NULL,
|
||||
/*tp_alloc*/ (allocfunc)PyType_GenericAlloc,
|
||||
/*tp_new*/ (newfunc)PyType_GenericNew,
|
||||
/*tp_free*/ (freefunc)0,
|
||||
/*tp_is_gc*/ NULL,
|
||||
/*tp_bases*/ NULL,
|
||||
/*tp_mro*/ NULL,
|
||||
/*tp_cache*/ NULL,
|
||||
/*tp_subclasses*/ NULL,
|
||||
/*tp_weaklist*/ NULL,
|
||||
/*tp_del*/ (destructor)NULL,
|
||||
/*tp_version_tag*/ 0,
|
||||
/*tp_finalize*/ NULL,
|
||||
/*tp_vectorcall*/ NULL,
|
||||
};
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
@@ -372,53 +372,57 @@ PyDoc_STRVAR(py_KDtree_doc,
|
||||
"\n"
|
||||
" :class:`KDTree.balance` must have been called before using any of the ``find`` "
|
||||
"methods.\n");
|
||||
|
||||
PyTypeObject PyKDTree_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0) "KDTree", /* tp_name */
|
||||
sizeof(PyKDTree), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
/* methods */
|
||||
(destructor)PyKDTree__tp_dealloc, /* tp_dealloc */
|
||||
(printfunc)NULL, /* tp_print */
|
||||
NULL, /* tp_getattr */
|
||||
NULL, /* tp_setattr */
|
||||
NULL, /* tp_compare */
|
||||
NULL, /* tp_repr */
|
||||
NULL, /* tp_as_number */
|
||||
NULL, /* tp_as_sequence */
|
||||
NULL, /* tp_as_mapping */
|
||||
NULL, /* tp_hash */
|
||||
NULL, /* tp_call */
|
||||
NULL, /* tp_str */
|
||||
NULL, /* tp_getattro */
|
||||
NULL, /* tp_setattro */
|
||||
NULL, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT, /* tp_flags */
|
||||
py_KDtree_doc, /* Documentation string */
|
||||
NULL, /* tp_traverse */
|
||||
NULL, /* tp_clear */
|
||||
NULL, /* tp_richcompare */
|
||||
0, /* tp_weaklistoffset */
|
||||
NULL, /* tp_iter */
|
||||
NULL, /* tp_iternext */
|
||||
(struct PyMethodDef *)PyKDTree_methods, /* tp_methods */
|
||||
NULL, /* tp_members */
|
||||
NULL, /* tp_getset */
|
||||
NULL, /* tp_base */
|
||||
NULL, /* tp_dict */
|
||||
NULL, /* tp_descr_get */
|
||||
NULL, /* tp_descr_set */
|
||||
0, /* tp_dictoffset */
|
||||
(initproc)PyKDTree__tp_init, /* tp_init */
|
||||
(allocfunc)PyType_GenericAlloc, /* tp_alloc */
|
||||
(newfunc)PyType_GenericNew, /* tp_new */
|
||||
(freefunc)0, /* tp_free */
|
||||
NULL, /* tp_is_gc */
|
||||
NULL, /* tp_bases */
|
||||
NULL, /* tp_mro */
|
||||
NULL, /* tp_cache */
|
||||
NULL, /* tp_subclasses */
|
||||
NULL, /* tp_weaklist */
|
||||
(destructor)NULL, /* tp_del */
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
/*tp_name*/ "KDTree",
|
||||
/*tp_basicsize*/ sizeof(PyKDTree),
|
||||
/*tp_itemsize*/ 0,
|
||||
/*tp_dealloc*/ (destructor)PyKDTree__tp_dealloc,
|
||||
/*tp_vectorcall_offset*/ 0,
|
||||
/*tp_getattr*/ NULL,
|
||||
/*tp_setattr*/ NULL,
|
||||
/*tp_as_async*/ NULL,
|
||||
/*tp_repr*/ NULL,
|
||||
/*tp_as_number*/ NULL,
|
||||
/*tp_as_sequence*/ NULL,
|
||||
/*tp_as_mapping*/ NULL,
|
||||
/*tp_hash*/ NULL,
|
||||
/*tp_call*/ NULL,
|
||||
/*tp_str*/ NULL,
|
||||
/*tp_getattro*/ NULL,
|
||||
/*tp_setattro*/ NULL,
|
||||
/*tp_as_buffer*/ NULL,
|
||||
/*tp_flags*/ Py_TPFLAGS_DEFAULT,
|
||||
/*Documentation string*/ py_KDtree_doc,
|
||||
/*tp_traverse*/ NULL,
|
||||
/*tp_clear*/ NULL,
|
||||
/*tp_richcompare*/ NULL,
|
||||
/*tp_weaklistoffset*/ 0,
|
||||
/*tp_iter*/ NULL,
|
||||
/*tp_iternext*/ NULL,
|
||||
/*tp_methods*/ (struct PyMethodDef *)PyKDTree_methods,
|
||||
/*tp_members*/ NULL,
|
||||
/*tp_getset*/ NULL,
|
||||
/*tp_base*/ NULL,
|
||||
/*tp_dict*/ NULL,
|
||||
/*tp_descr_get*/ NULL,
|
||||
/*tp_descr_set*/ NULL,
|
||||
/*tp_dictoffset*/ 0,
|
||||
/*tp_init*/ (initproc)PyKDTree__tp_init,
|
||||
/*tp_alloc*/ (allocfunc)PyType_GenericAlloc,
|
||||
/*tp_new*/ (newfunc)PyType_GenericNew,
|
||||
/*tp_free*/ (freefunc)0,
|
||||
/*tp_is_gc*/ NULL,
|
||||
/*tp_bases*/ NULL,
|
||||
/*tp_mro*/ NULL,
|
||||
/*tp_cache*/ NULL,
|
||||
/*tp_subclasses*/ NULL,
|
||||
/*tp_weaklist*/ NULL,
|
||||
/*tp_del*/ (destructor)NULL,
|
||||
/*tp_version_tag*/ 0,
|
||||
/*tp_finalize*/ NULL,
|
||||
/*tp_vectorcall*/ NULL,
|
||||
};
|
||||
|
||||
PyDoc_STRVAR(py_kdtree_doc, "Generic 3-dimensional kd-tree to perform spatial searches.");
|
||||
|
||||
Reference in New Issue
Block a user