summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/qt
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2005-07-03 20:59:44 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2005-07-03 20:59:44 (GMT)
commit918a9e2f63a037de2a32e2b009944a0e5c693742 (patch)
tree951482c937428033e9ba8ce37bf6678503b3c163 /Mac/Modules/qt
parenta6af76cbe4e5b188ccdba0b628f9d75771c623c1 (diff)
downloadcpython-918a9e2f63a037de2a32e2b009944a0e5c693742.zip
cpython-918a9e2f63a037de2a32e2b009944a0e5c693742.tar.gz
cpython-918a9e2f63a037de2a32e2b009944a0e5c693742.tar.bz2
Updated (and regenerated) for name change in tp_init method arguments:
they are now _self, _args and _kwds.
Diffstat (limited to 'Mac/Modules/qt')
-rw-r--r--Mac/Modules/qt/_Qtmodule.c222
1 files changed, 115 insertions, 107 deletions
diff --git a/Mac/Modules/qt/_Qtmodule.c b/Mac/Modules/qt/_Qtmodule.c
index 50223ec..65cec4b 100644
--- a/Mac/Modules/qt/_Qtmodule.c
+++ b/Mac/Modules/qt/_Qtmodule.c
@@ -47,45 +47,45 @@ extern int _MediaObj_Convert(PyObject *, Media *);
#endif
/* Macro to allow us to GetNextInterestingTime without duration */
-#define GetMediaNextInterestingTimeOnly(media, flags, time, rate, rv) GetMediaNextInterestingTime(media, flags, time, rate, rv, NULL)
-
+#define GetMediaNextInterestingTimeOnly(media, flags, time, rate, rv) GetMediaNextInterestingTime(media, flags, time, rate, rv, NULL)
+
/*
** Parse/generate time records
*/
static PyObject *
QtTimeRecord_New(TimeRecord *itself)
{
- if (itself->base)
- return Py_BuildValue("O&lO&", PyMac_Buildwide, &itself->value, itself->scale,
- TimeBaseObj_New, itself->base);
- else
- return Py_BuildValue("O&lO", PyMac_Buildwide, &itself->value, itself->scale,
- Py_None);
+ if (itself->base)
+ return Py_BuildValue("O&lO&", PyMac_Buildwide, &itself->value, itself->scale,
+ TimeBaseObj_New, itself->base);
+ else
+ return Py_BuildValue("O&lO", PyMac_Buildwide, &itself->value, itself->scale,
+ Py_None);
}
static int
QtTimeRecord_Convert(PyObject *v, TimeRecord *p_itself)
{
- PyObject *base = NULL;
- if( !PyArg_ParseTuple(v, "O&l|O", PyMac_Getwide, &p_itself->value, &p_itself->scale,
- &base) )
- return 0;
- if ( base == NULL || base == Py_None )
- p_itself->base = NULL;
- else
- if ( !TimeBaseObj_Convert(base, &p_itself->base) )
- return 0;
- return 1;
+ PyObject *base = NULL;
+ if( !PyArg_ParseTuple(v, "O&l|O", PyMac_Getwide, &p_itself->value, &p_itself->scale,
+ &base) )
+ return 0;
+ if ( base == NULL || base == Py_None )
+ p_itself->base = NULL;
+ else
+ if ( !TimeBaseObj_Convert(base, &p_itself->base) )
+ return 0;
+ return 1;
}
static int
QtMusicMIDIPacket_Convert(PyObject *v, MusicMIDIPacket *p_itself)
{
- int dummy;
-
- if( !PyArg_ParseTuple(v, "hls#", &p_itself->length, &p_itself->reserved, p_itself->data, dummy) )
- return 0;
- return 1;
+ int dummy;
+
+ if( !PyArg_ParseTuple(v, "hls#", &p_itself->length, &p_itself->reserved, p_itself->data, dummy) )
+ return 0;
+ return 1;
}
@@ -108,14 +108,15 @@ PyObject *IdleManagerObj_New(IdleManager itself)
{
IdleManagerObject *it;
if (itself == NULL) {
- PyErr_SetString(Qt_Error,"Cannot create IdleManager from NULL pointer");
- return NULL;
- }
+ PyErr_SetString(Qt_Error,"Cannot create IdleManager from NULL pointer");
+ return NULL;
+ }
it = PyObject_NEW(IdleManagerObject, &IdleManager_Type);
if (it == NULL) return NULL;
it->ob_itself = itself;
return (PyObject *)it;
}
+
int IdleManagerObj_Convert(PyObject *v, IdleManager *p_itself)
{
if (v == Py_None)
@@ -154,16 +155,16 @@ static PyMethodDef IdleManagerObj_methods[] = {
#define IdleManagerObj_tp_alloc PyType_GenericAlloc
-static PyObject *IdleManagerObj_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+static PyObject *IdleManagerObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
{
- PyObject *self;
+ PyObject *_self;
IdleManager itself;
char *kw[] = {"itself", 0};
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&", kw, IdleManagerObj_Convert, &itself)) return NULL;
- if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;
- ((IdleManagerObject *)self)->ob_itself = itself;
- return self;
+ if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, IdleManagerObj_Convert, &itself)) return NULL;
+ if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;
+ ((IdleManagerObject *)_self)->ob_itself = itself;
+ return _self;
}
#define IdleManagerObj_tp_free PyObject_Del
@@ -231,14 +232,15 @@ PyObject *MovieCtlObj_New(MovieController itself)
{
MovieControllerObject *it;
if (itself == NULL) {
- PyErr_SetString(Qt_Error,"Cannot create MovieController from NULL pointer");
- return NULL;
- }
+ PyErr_SetString(Qt_Error,"Cannot create MovieController from NULL pointer");
+ return NULL;
+ }
it = PyObject_NEW(MovieControllerObject, &MovieController_Type);
if (it == NULL) return NULL;
it->ob_itself = itself;
return (PyObject *)it;
}
+
int MovieCtlObj_Convert(PyObject *v, MovieController *p_itself)
{
if (v == Py_None)
@@ -1273,16 +1275,16 @@ static PyMethodDef MovieCtlObj_methods[] = {
#define MovieCtlObj_tp_alloc PyType_GenericAlloc
-static PyObject *MovieCtlObj_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+static PyObject *MovieCtlObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
{
- PyObject *self;
+ PyObject *_self;
MovieController itself;
char *kw[] = {"itself", 0};
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&", kw, MovieCtlObj_Convert, &itself)) return NULL;
- if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;
- ((MovieControllerObject *)self)->ob_itself = itself;
- return self;
+ if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, MovieCtlObj_Convert, &itself)) return NULL;
+ if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;
+ ((MovieControllerObject *)_self)->ob_itself = itself;
+ return _self;
}
#define MovieCtlObj_tp_free PyObject_Del
@@ -1350,14 +1352,15 @@ PyObject *TimeBaseObj_New(TimeBase itself)
{
TimeBaseObject *it;
if (itself == NULL) {
- PyErr_SetString(Qt_Error,"Cannot create TimeBase from NULL pointer");
- return NULL;
- }
+ PyErr_SetString(Qt_Error,"Cannot create TimeBase from NULL pointer");
+ return NULL;
+ }
it = PyObject_NEW(TimeBaseObject, &TimeBase_Type);
if (it == NULL) return NULL;
it->ob_itself = itself;
return (PyObject *)it;
}
+
int TimeBaseObj_Convert(PyObject *v, TimeBase *p_itself)
{
if (v == Py_None)
@@ -1766,16 +1769,16 @@ static PyMethodDef TimeBaseObj_methods[] = {
#define TimeBaseObj_tp_alloc PyType_GenericAlloc
-static PyObject *TimeBaseObj_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+static PyObject *TimeBaseObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
{
- PyObject *self;
+ PyObject *_self;
TimeBase itself;
char *kw[] = {"itself", 0};
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&", kw, TimeBaseObj_Convert, &itself)) return NULL;
- if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;
- ((TimeBaseObject *)self)->ob_itself = itself;
- return self;
+ if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, TimeBaseObj_Convert, &itself)) return NULL;
+ if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;
+ ((TimeBaseObject *)_self)->ob_itself = itself;
+ return _self;
}
#define TimeBaseObj_tp_free PyObject_Del
@@ -1843,14 +1846,15 @@ PyObject *UserDataObj_New(UserData itself)
{
UserDataObject *it;
if (itself == NULL) {
- PyErr_SetString(Qt_Error,"Cannot create UserData from NULL pointer");
- return NULL;
- }
+ PyErr_SetString(Qt_Error,"Cannot create UserData from NULL pointer");
+ return NULL;
+ }
it = PyObject_NEW(UserDataObject, &UserData_Type);
if (it == NULL) return NULL;
it->ob_itself = itself;
return (PyObject *)it;
}
+
int UserDataObj_Convert(PyObject *v, UserData *p_itself)
{
if (v == Py_None)
@@ -2136,16 +2140,16 @@ static PyMethodDef UserDataObj_methods[] = {
#define UserDataObj_tp_alloc PyType_GenericAlloc
-static PyObject *UserDataObj_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+static PyObject *UserDataObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
{
- PyObject *self;
+ PyObject *_self;
UserData itself;
char *kw[] = {"itself", 0};
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&", kw, UserDataObj_Convert, &itself)) return NULL;
- if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;
- ((UserDataObject *)self)->ob_itself = itself;
- return self;
+ if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, UserDataObj_Convert, &itself)) return NULL;
+ if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;
+ ((UserDataObject *)_self)->ob_itself = itself;
+ return _self;
}
#define UserDataObj_tp_free PyObject_Del
@@ -2213,14 +2217,15 @@ PyObject *MediaObj_New(Media itself)
{
MediaObject *it;
if (itself == NULL) {
- PyErr_SetString(Qt_Error,"Cannot create Media from NULL pointer");
- return NULL;
- }
+ PyErr_SetString(Qt_Error,"Cannot create Media from NULL pointer");
+ return NULL;
+ }
it = PyObject_NEW(MediaObject, &Media_Type);
if (it == NULL) return NULL;
it->ob_itself = itself;
return (PyObject *)it;
}
+
int MediaObj_Convert(PyObject *v, Media *p_itself)
{
if (v == Py_None)
@@ -3377,16 +3382,16 @@ static PyMethodDef MediaObj_methods[] = {
#define MediaObj_tp_alloc PyType_GenericAlloc
-static PyObject *MediaObj_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+static PyObject *MediaObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
{
- PyObject *self;
+ PyObject *_self;
Media itself;
char *kw[] = {"itself", 0};
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&", kw, MediaObj_Convert, &itself)) return NULL;
- if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;
- ((MediaObject *)self)->ob_itself = itself;
- return self;
+ if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, MediaObj_Convert, &itself)) return NULL;
+ if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;
+ ((MediaObject *)_self)->ob_itself = itself;
+ return _self;
}
#define MediaObj_tp_free PyObject_Del
@@ -3454,14 +3459,15 @@ PyObject *TrackObj_New(Track itself)
{
TrackObject *it;
if (itself == NULL) {
- PyErr_SetString(Qt_Error,"Cannot create Track from NULL pointer");
- return NULL;
- }
+ PyErr_SetString(Qt_Error,"Cannot create Track from NULL pointer");
+ return NULL;
+ }
it = PyObject_NEW(TrackObject, &Track_Type);
if (it == NULL) return NULL;
it->ob_itself = itself;
return (PyObject *)it;
}
+
int TrackObj_Convert(PyObject *v, Track *p_itself)
{
if (v == Py_None)
@@ -4724,16 +4730,16 @@ static PyMethodDef TrackObj_methods[] = {
#define TrackObj_tp_alloc PyType_GenericAlloc
-static PyObject *TrackObj_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+static PyObject *TrackObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
{
- PyObject *self;
+ PyObject *_self;
Track itself;
char *kw[] = {"itself", 0};
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&", kw, TrackObj_Convert, &itself)) return NULL;
- if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;
- ((TrackObject *)self)->ob_itself = itself;
- return self;
+ if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, TrackObj_Convert, &itself)) return NULL;
+ if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;
+ ((TrackObject *)_self)->ob_itself = itself;
+ return _self;
}
#define TrackObj_tp_free PyObject_Del
@@ -4801,14 +4807,15 @@ PyObject *MovieObj_New(Movie itself)
{
MovieObject *it;
if (itself == NULL) {
- PyErr_SetString(Qt_Error,"Cannot create Movie from NULL pointer");
- return NULL;
- }
+ PyErr_SetString(Qt_Error,"Cannot create Movie from NULL pointer");
+ return NULL;
+ }
it = PyObject_NEW(MovieObject, &Movie_Type);
if (it == NULL) return NULL;
it->ob_itself = itself;
return (PyObject *)it;
}
+
int MovieObj_Convert(PyObject *v, Movie *p_itself)
{
if (v == Py_None)
@@ -7276,16 +7283,16 @@ static PyMethodDef MovieObj_methods[] = {
#define MovieObj_tp_alloc PyType_GenericAlloc
-static PyObject *MovieObj_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+static PyObject *MovieObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
{
- PyObject *self;
+ PyObject *_self;
Movie itself;
char *kw[] = {"itself", 0};
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&", kw, MovieObj_Convert, &itself)) return NULL;
- if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;
- ((MovieObject *)self)->ob_itself = itself;
- return self;
+ if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, MovieObj_Convert, &itself)) return NULL;
+ if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;
+ ((MovieObject *)_self)->ob_itself = itself;
+ return _self;
}
#define MovieObj_tp_free PyObject_Del
@@ -7353,14 +7360,15 @@ PyObject *SGOutputObj_New(SGOutput itself)
{
SGOutputObject *it;
if (itself == NULL) {
- PyErr_SetString(Qt_Error,"Cannot create SGOutput from NULL pointer");
- return NULL;
- }
+ PyErr_SetString(Qt_Error,"Cannot create SGOutput from NULL pointer");
+ return NULL;
+ }
it = PyObject_NEW(SGOutputObject, &SGOutput_Type);
if (it == NULL) return NULL;
it->ob_itself = itself;
return (PyObject *)it;
}
+
int SGOutputObj_Convert(PyObject *v, SGOutput *p_itself)
{
if (v == Py_None)
@@ -7399,16 +7407,16 @@ static PyMethodDef SGOutputObj_methods[] = {
#define SGOutputObj_tp_alloc PyType_GenericAlloc
-static PyObject *SGOutputObj_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+static PyObject *SGOutputObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
{
- PyObject *self;
+ PyObject *_self;
SGOutput itself;
char *kw[] = {"itself", 0};
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&", kw, SGOutputObj_Convert, &itself)) return NULL;
- if ((self = type->tp_alloc(type, 0)) == NULL) return NULL;
- ((SGOutputObject *)self)->ob_itself = itself;
- return self;
+ if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, SGOutputObj_Convert, &itself)) return NULL;
+ if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;
+ ((SGOutputObject *)_self)->ob_itself = itself;
+ return _self;
}
#define SGOutputObj_tp_free PyObject_Del
@@ -27993,18 +28001,18 @@ void init_Qt(void)
- PyMac_INIT_TOOLBOX_OBJECT_NEW(Track, TrackObj_New);
- PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Track, TrackObj_Convert);
- PyMac_INIT_TOOLBOX_OBJECT_NEW(Movie, MovieObj_New);
- PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Movie, MovieObj_Convert);
- PyMac_INIT_TOOLBOX_OBJECT_NEW(MovieController, MovieCtlObj_New);
- PyMac_INIT_TOOLBOX_OBJECT_CONVERT(MovieController, MovieCtlObj_Convert);
- PyMac_INIT_TOOLBOX_OBJECT_NEW(TimeBase, TimeBaseObj_New);
- PyMac_INIT_TOOLBOX_OBJECT_CONVERT(TimeBase, TimeBaseObj_Convert);
- PyMac_INIT_TOOLBOX_OBJECT_NEW(UserData, UserDataObj_New);
- PyMac_INIT_TOOLBOX_OBJECT_CONVERT(UserData, UserDataObj_Convert);
- PyMac_INIT_TOOLBOX_OBJECT_NEW(Media, MediaObj_New);
- PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Media, MediaObj_Convert);
+ PyMac_INIT_TOOLBOX_OBJECT_NEW(Track, TrackObj_New);
+ PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Track, TrackObj_Convert);
+ PyMac_INIT_TOOLBOX_OBJECT_NEW(Movie, MovieObj_New);
+ PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Movie, MovieObj_Convert);
+ PyMac_INIT_TOOLBOX_OBJECT_NEW(MovieController, MovieCtlObj_New);
+ PyMac_INIT_TOOLBOX_OBJECT_CONVERT(MovieController, MovieCtlObj_Convert);
+ PyMac_INIT_TOOLBOX_OBJECT_NEW(TimeBase, TimeBaseObj_New);
+ PyMac_INIT_TOOLBOX_OBJECT_CONVERT(TimeBase, TimeBaseObj_Convert);
+ PyMac_INIT_TOOLBOX_OBJECT_NEW(UserData, UserDataObj_New);
+ PyMac_INIT_TOOLBOX_OBJECT_CONVERT(UserData, UserDataObj_Convert);
+ PyMac_INIT_TOOLBOX_OBJECT_NEW(Media, MediaObj_New);
+ PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Media, MediaObj_Convert);
m = Py_InitModule("_Qt", Qt_methods);