[Python-checkins] python/dist/src/Mac/Modules/qt _Qtmodule.c, 1.24, 1.25
jackjansen@users.sourceforge.net
jackjansen at users.sourceforge.net
Sun Jul 3 22:59:45 CEST 2005
Update of /cvsroot/python/python/dist/src/Mac/Modules/qt
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25508/qt
Modified Files:
_Qtmodule.c
Log Message:
Updated (and regenerated) for name change in tp_init method arguments:
they are now _self, _args and _kwds.
Index: _Qtmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/_Qtmodule.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- _Qtmodule.c 11 Jan 2004 22:52:11 -0000 1.24
+++ _Qtmodule.c 3 Jul 2005 20:59:42 -0000 1.25
@@ -47,45 +47,45 @@
#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 @@
{
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 @@
#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 @@
{
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 @@
#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 @@
{
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 @@
#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 @@
{
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 @@
#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 @@
{
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 @@
#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 @@
{
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 @@
#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 @@
{
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 @@
#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 @@
{
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 @@
#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 @@
- 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);
More information about the Python-checkins
mailing list