/Mac/Modules/qt/_Qtmodule.c
http://unladen-swallow.googlecode.com/ · C · 28091 lines · 26705 code · 1344 blank · 42 comment · 1567 complexity · 22bb6d839073acbab8d527a7d47c5c11 MD5 · raw file
Large files are truncated click here to view the full file
- /* =========================== Module _Qt =========================== */
- #include "Python.h"
- #ifndef __LP64__
- #include "pymactoolbox.h"
- /* Macro to test whether a weak-loaded CFM function exists */
- #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
- PyErr_SetString(PyExc_NotImplementedError, \
- "Not available in this shared library/OS version"); \
- return NULL; \
- }} while(0)
- #include <QuickTime/QuickTime.h>
- #ifdef USE_TOOLBOX_OBJECT_GLUE
- extern PyObject *_TrackObj_New(Track);
- extern int _TrackObj_Convert(PyObject *, Track *);
- extern PyObject *_MovieObj_New(Movie);
- extern int _MovieObj_Convert(PyObject *, Movie *);
- extern PyObject *_MovieCtlObj_New(MovieController);
- extern int _MovieCtlObj_Convert(PyObject *, MovieController *);
- extern PyObject *_TimeBaseObj_New(TimeBase);
- extern int _TimeBaseObj_Convert(PyObject *, TimeBase *);
- extern PyObject *_UserDataObj_New(UserData);
- extern int _UserDataObj_Convert(PyObject *, UserData *);
- extern PyObject *_MediaObj_New(Media);
- extern int _MediaObj_Convert(PyObject *, Media *);
- #define TrackObj_New _TrackObj_New
- #define TrackObj_Convert _TrackObj_Convert
- #define MovieObj_New _MovieObj_New
- #define MovieObj_Convert _MovieObj_Convert
- #define MovieCtlObj_New _MovieCtlObj_New
- #define MovieCtlObj_Convert _MovieCtlObj_Convert
- #define TimeBaseObj_New _TimeBaseObj_New
- #define TimeBaseObj_Convert _TimeBaseObj_Convert
- #define UserDataObj_New _UserDataObj_New
- #define UserDataObj_Convert _UserDataObj_Convert
- #define MediaObj_New _MediaObj_New
- #define MediaObj_Convert _MediaObj_Convert
- #endif
- /* Macro to allow us to GetNextInterestingTime without duration */
- #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);
- }
- 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;
- }
- 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;
- }
- static PyObject *Qt_Error;
- /* -------------------- Object type IdleManager --------------------- */
- PyTypeObject IdleManager_Type;
- #define IdleManagerObj_Check(x) ((x)->ob_type == &IdleManager_Type || PyObject_TypeCheck((x), &IdleManager_Type))
- typedef struct IdleManagerObject {
- PyObject_HEAD
- IdleManager ob_itself;
- } IdleManagerObject;
- PyObject *IdleManagerObj_New(IdleManager itself)
- {
- IdleManagerObject *it;
- if (itself == 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)
- {
- *p_itself = NULL;
- return 1;
- }
- if (!IdleManagerObj_Check(v))
- {
- PyErr_SetString(PyExc_TypeError, "IdleManager required");
- return 0;
- }
- *p_itself = ((IdleManagerObject *)v)->ob_itself;
- return 1;
- }
- static void IdleManagerObj_dealloc(IdleManagerObject *self)
- {
- /* Cleanup of self->ob_itself goes here */
- self->ob_type->tp_free((PyObject *)self);
- }
- static PyMethodDef IdleManagerObj_methods[] = {
- {NULL, NULL, 0}
- };
- #define IdleManagerObj_getsetlist NULL
- #define IdleManagerObj_compare NULL
- #define IdleManagerObj_repr NULL
- #define IdleManagerObj_hash NULL
- #define IdleManagerObj_tp_init 0
- #define IdleManagerObj_tp_alloc PyType_GenericAlloc
- static PyObject *IdleManagerObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
- {
- 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;
- }
- #define IdleManagerObj_tp_free PyObject_Del
- PyTypeObject IdleManager_Type = {
- PyObject_HEAD_INIT(NULL)
- 0, /*ob_size*/
- "_Qt.IdleManager", /*tp_name*/
- sizeof(IdleManagerObject), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- /* methods */
- (destructor) IdleManagerObj_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
- (getattrfunc)0, /*tp_getattr*/
- (setattrfunc)0, /*tp_setattr*/
- (cmpfunc) IdleManagerObj_compare, /*tp_compare*/
- (reprfunc) IdleManagerObj_repr, /*tp_repr*/
- (PyNumberMethods *)0, /* tp_as_number */
- (PySequenceMethods *)0, /* tp_as_sequence */
- (PyMappingMethods *)0, /* tp_as_mapping */
- (hashfunc) IdleManagerObj_hash, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- PyObject_GenericGetAttr, /*tp_getattro*/
- PyObject_GenericSetAttr, /*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*/
- IdleManagerObj_methods, /* tp_methods */
- 0, /*tp_members*/
- IdleManagerObj_getsetlist, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- IdleManagerObj_tp_init, /* tp_init */
- IdleManagerObj_tp_alloc, /* tp_alloc */
- IdleManagerObj_tp_new, /* tp_new */
- IdleManagerObj_tp_free, /* tp_free */
- };
- /* ------------------ End object type IdleManager ------------------- */
- /* ------------------ Object type MovieController ------------------- */
- PyTypeObject MovieController_Type;
- #define MovieCtlObj_Check(x) ((x)->ob_type == &MovieController_Type || PyObject_TypeCheck((x), &MovieController_Type))
- typedef struct MovieControllerObject {
- PyObject_HEAD
- MovieController ob_itself;
- } MovieControllerObject;
- PyObject *MovieCtlObj_New(MovieController itself)
- {
- MovieControllerObject *it;
- if (itself == 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)
- {
- *p_itself = NULL;
- return 1;
- }
- if (!MovieCtlObj_Check(v))
- {
- PyErr_SetString(PyExc_TypeError, "MovieController required");
- return 0;
- }
- *p_itself = ((MovieControllerObject *)v)->ob_itself;
- return 1;
- }
- static void MovieCtlObj_dealloc(MovieControllerObject *self)
- {
- if (self->ob_itself) DisposeMovieController(self->ob_itself);
- self->ob_type->tp_free((PyObject *)self);
- }
- static PyObject *MovieCtlObj_MCSetMovie(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- Movie theMovie;
- WindowPtr movieWindow;
- Point where;
- #ifndef MCSetMovie
- PyMac_PRECHECK(MCSetMovie);
- #endif
- if (!PyArg_ParseTuple(_args, "O&O&O&",
- MovieObj_Convert, &theMovie,
- WinObj_Convert, &movieWindow,
- PyMac_GetPoint, &where))
- return NULL;
- _rv = MCSetMovie(_self->ob_itself,
- theMovie,
- movieWindow,
- where);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCGetIndMovie(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- Movie _rv;
- short index;
- #ifndef MCGetIndMovie
- PyMac_PRECHECK(MCGetIndMovie);
- #endif
- if (!PyArg_ParseTuple(_args, "h",
- &index))
- return NULL;
- _rv = MCGetIndMovie(_self->ob_itself,
- index);
- _res = Py_BuildValue("O&",
- MovieObj_New, _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCRemoveAllMovies(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- #ifndef MCRemoveAllMovies
- PyMac_PRECHECK(MCRemoveAllMovies);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = MCRemoveAllMovies(_self->ob_itself);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCRemoveAMovie(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- Movie m;
- #ifndef MCRemoveAMovie
- PyMac_PRECHECK(MCRemoveAMovie);
- #endif
- if (!PyArg_ParseTuple(_args, "O&",
- MovieObj_Convert, &m))
- return NULL;
- _rv = MCRemoveAMovie(_self->ob_itself,
- m);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCRemoveMovie(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- #ifndef MCRemoveMovie
- PyMac_PRECHECK(MCRemoveMovie);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = MCRemoveMovie(_self->ob_itself);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCIsPlayerEvent(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- EventRecord e;
- #ifndef MCIsPlayerEvent
- PyMac_PRECHECK(MCIsPlayerEvent);
- #endif
- if (!PyArg_ParseTuple(_args, "O&",
- PyMac_GetEventRecord, &e))
- return NULL;
- _rv = MCIsPlayerEvent(_self->ob_itself,
- &e);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCDoAction(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- short action;
- void * params;
- #ifndef MCDoAction
- PyMac_PRECHECK(MCDoAction);
- #endif
- if (!PyArg_ParseTuple(_args, "hs",
- &action,
- ¶ms))
- return NULL;
- _rv = MCDoAction(_self->ob_itself,
- action,
- params);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCSetControllerAttached(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- Boolean attach;
- #ifndef MCSetControllerAttached
- PyMac_PRECHECK(MCSetControllerAttached);
- #endif
- if (!PyArg_ParseTuple(_args, "b",
- &attach))
- return NULL;
- _rv = MCSetControllerAttached(_self->ob_itself,
- attach);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCIsControllerAttached(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- #ifndef MCIsControllerAttached
- PyMac_PRECHECK(MCIsControllerAttached);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = MCIsControllerAttached(_self->ob_itself);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCSetControllerPort(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- CGrafPtr gp;
- #ifndef MCSetControllerPort
- PyMac_PRECHECK(MCSetControllerPort);
- #endif
- if (!PyArg_ParseTuple(_args, "O&",
- GrafObj_Convert, &gp))
- return NULL;
- _rv = MCSetControllerPort(_self->ob_itself,
- gp);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCGetControllerPort(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- CGrafPtr _rv;
- #ifndef MCGetControllerPort
- PyMac_PRECHECK(MCGetControllerPort);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = MCGetControllerPort(_self->ob_itself);
- _res = Py_BuildValue("O&",
- GrafObj_New, _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCSetVisible(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- Boolean visible;
- #ifndef MCSetVisible
- PyMac_PRECHECK(MCSetVisible);
- #endif
- if (!PyArg_ParseTuple(_args, "b",
- &visible))
- return NULL;
- _rv = MCSetVisible(_self->ob_itself,
- visible);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCGetVisible(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- #ifndef MCGetVisible
- PyMac_PRECHECK(MCGetVisible);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = MCGetVisible(_self->ob_itself);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCGetControllerBoundsRect(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- Rect bounds;
- #ifndef MCGetControllerBoundsRect
- PyMac_PRECHECK(MCGetControllerBoundsRect);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = MCGetControllerBoundsRect(_self->ob_itself,
- &bounds);
- _res = Py_BuildValue("lO&",
- _rv,
- PyMac_BuildRect, &bounds);
- return _res;
- }
- static PyObject *MovieCtlObj_MCSetControllerBoundsRect(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- Rect bounds;
- #ifndef MCSetControllerBoundsRect
- PyMac_PRECHECK(MCSetControllerBoundsRect);
- #endif
- if (!PyArg_ParseTuple(_args, "O&",
- PyMac_GetRect, &bounds))
- return NULL;
- _rv = MCSetControllerBoundsRect(_self->ob_itself,
- &bounds);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCGetControllerBoundsRgn(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- RgnHandle _rv;
- #ifndef MCGetControllerBoundsRgn
- PyMac_PRECHECK(MCGetControllerBoundsRgn);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = MCGetControllerBoundsRgn(_self->ob_itself);
- _res = Py_BuildValue("O&",
- ResObj_New, _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCGetWindowRgn(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- RgnHandle _rv;
- WindowPtr w;
- #ifndef MCGetWindowRgn
- PyMac_PRECHECK(MCGetWindowRgn);
- #endif
- if (!PyArg_ParseTuple(_args, "O&",
- WinObj_Convert, &w))
- return NULL;
- _rv = MCGetWindowRgn(_self->ob_itself,
- w);
- _res = Py_BuildValue("O&",
- ResObj_New, _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCMovieChanged(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- Movie m;
- #ifndef MCMovieChanged
- PyMac_PRECHECK(MCMovieChanged);
- #endif
- if (!PyArg_ParseTuple(_args, "O&",
- MovieObj_Convert, &m))
- return NULL;
- _rv = MCMovieChanged(_self->ob_itself,
- m);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCSetDuration(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- TimeValue duration;
- #ifndef MCSetDuration
- PyMac_PRECHECK(MCSetDuration);
- #endif
- if (!PyArg_ParseTuple(_args, "l",
- &duration))
- return NULL;
- _rv = MCSetDuration(_self->ob_itself,
- duration);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCGetCurrentTime(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- TimeValue _rv;
- TimeScale scale;
- #ifndef MCGetCurrentTime
- PyMac_PRECHECK(MCGetCurrentTime);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = MCGetCurrentTime(_self->ob_itself,
- &scale);
- _res = Py_BuildValue("ll",
- _rv,
- scale);
- return _res;
- }
- static PyObject *MovieCtlObj_MCNewAttachedController(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- Movie theMovie;
- WindowPtr w;
- Point where;
- #ifndef MCNewAttachedController
- PyMac_PRECHECK(MCNewAttachedController);
- #endif
- if (!PyArg_ParseTuple(_args, "O&O&O&",
- MovieObj_Convert, &theMovie,
- WinObj_Convert, &w,
- PyMac_GetPoint, &where))
- return NULL;
- _rv = MCNewAttachedController(_self->ob_itself,
- theMovie,
- w,
- where);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCDraw(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- WindowPtr w;
- #ifndef MCDraw
- PyMac_PRECHECK(MCDraw);
- #endif
- if (!PyArg_ParseTuple(_args, "O&",
- WinObj_Convert, &w))
- return NULL;
- _rv = MCDraw(_self->ob_itself,
- w);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCActivate(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- WindowPtr w;
- Boolean activate;
- #ifndef MCActivate
- PyMac_PRECHECK(MCActivate);
- #endif
- if (!PyArg_ParseTuple(_args, "O&b",
- WinObj_Convert, &w,
- &activate))
- return NULL;
- _rv = MCActivate(_self->ob_itself,
- w,
- activate);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCIdle(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- #ifndef MCIdle
- PyMac_PRECHECK(MCIdle);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = MCIdle(_self->ob_itself);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCKey(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- SInt8 key;
- long modifiers;
- #ifndef MCKey
- PyMac_PRECHECK(MCKey);
- #endif
- if (!PyArg_ParseTuple(_args, "bl",
- &key,
- &modifiers))
- return NULL;
- _rv = MCKey(_self->ob_itself,
- key,
- modifiers);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCClick(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- WindowPtr w;
- Point where;
- long when;
- long modifiers;
- #ifndef MCClick
- PyMac_PRECHECK(MCClick);
- #endif
- if (!PyArg_ParseTuple(_args, "O&O&ll",
- WinObj_Convert, &w,
- PyMac_GetPoint, &where,
- &when,
- &modifiers))
- return NULL;
- _rv = MCClick(_self->ob_itself,
- w,
- where,
- when,
- modifiers);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCEnableEditing(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- Boolean enabled;
- #ifndef MCEnableEditing
- PyMac_PRECHECK(MCEnableEditing);
- #endif
- if (!PyArg_ParseTuple(_args, "b",
- &enabled))
- return NULL;
- _rv = MCEnableEditing(_self->ob_itself,
- enabled);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCIsEditingEnabled(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- long _rv;
- #ifndef MCIsEditingEnabled
- PyMac_PRECHECK(MCIsEditingEnabled);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = MCIsEditingEnabled(_self->ob_itself);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCCopy(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- Movie _rv;
- #ifndef MCCopy
- PyMac_PRECHECK(MCCopy);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = MCCopy(_self->ob_itself);
- _res = Py_BuildValue("O&",
- MovieObj_New, _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCCut(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- Movie _rv;
- #ifndef MCCut
- PyMac_PRECHECK(MCCut);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = MCCut(_self->ob_itself);
- _res = Py_BuildValue("O&",
- MovieObj_New, _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCPaste(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- Movie srcMovie;
- #ifndef MCPaste
- PyMac_PRECHECK(MCPaste);
- #endif
- if (!PyArg_ParseTuple(_args, "O&",
- MovieObj_Convert, &srcMovie))
- return NULL;
- _rv = MCPaste(_self->ob_itself,
- srcMovie);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCClear(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- #ifndef MCClear
- PyMac_PRECHECK(MCClear);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = MCClear(_self->ob_itself);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCUndo(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- #ifndef MCUndo
- PyMac_PRECHECK(MCUndo);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = MCUndo(_self->ob_itself);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCPositionController(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- Rect movieRect;
- Rect controllerRect;
- long someFlags;
- #ifndef MCPositionController
- PyMac_PRECHECK(MCPositionController);
- #endif
- if (!PyArg_ParseTuple(_args, "O&O&l",
- PyMac_GetRect, &movieRect,
- PyMac_GetRect, &controllerRect,
- &someFlags))
- return NULL;
- _rv = MCPositionController(_self->ob_itself,
- &movieRect,
- &controllerRect,
- someFlags);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCGetControllerInfo(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- long someFlags;
- #ifndef MCGetControllerInfo
- PyMac_PRECHECK(MCGetControllerInfo);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = MCGetControllerInfo(_self->ob_itself,
- &someFlags);
- _res = Py_BuildValue("ll",
- _rv,
- someFlags);
- return _res;
- }
- static PyObject *MovieCtlObj_MCSetClip(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- RgnHandle theClip;
- RgnHandle movieClip;
- #ifndef MCSetClip
- PyMac_PRECHECK(MCSetClip);
- #endif
- if (!PyArg_ParseTuple(_args, "O&O&",
- ResObj_Convert, &theClip,
- ResObj_Convert, &movieClip))
- return NULL;
- _rv = MCSetClip(_self->ob_itself,
- theClip,
- movieClip);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCGetClip(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- RgnHandle theClip;
- RgnHandle movieClip;
- #ifndef MCGetClip
- PyMac_PRECHECK(MCGetClip);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = MCGetClip(_self->ob_itself,
- &theClip,
- &movieClip);
- _res = Py_BuildValue("lO&O&",
- _rv,
- ResObj_New, theClip,
- ResObj_New, movieClip);
- return _res;
- }
- static PyObject *MovieCtlObj_MCDrawBadge(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- RgnHandle movieRgn;
- RgnHandle badgeRgn;
- #ifndef MCDrawBadge
- PyMac_PRECHECK(MCDrawBadge);
- #endif
- if (!PyArg_ParseTuple(_args, "O&",
- ResObj_Convert, &movieRgn))
- return NULL;
- _rv = MCDrawBadge(_self->ob_itself,
- movieRgn,
- &badgeRgn);
- _res = Py_BuildValue("lO&",
- _rv,
- ResObj_New, badgeRgn);
- return _res;
- }
- static PyObject *MovieCtlObj_MCSetUpEditMenu(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- long modifiers;
- MenuHandle mh;
- #ifndef MCSetUpEditMenu
- PyMac_PRECHECK(MCSetUpEditMenu);
- #endif
- if (!PyArg_ParseTuple(_args, "lO&",
- &modifiers,
- MenuObj_Convert, &mh))
- return NULL;
- _rv = MCSetUpEditMenu(_self->ob_itself,
- modifiers,
- mh);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCGetMenuString(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- long modifiers;
- short item;
- Str255 aString;
- #ifndef MCGetMenuString
- PyMac_PRECHECK(MCGetMenuString);
- #endif
- if (!PyArg_ParseTuple(_args, "lhO&",
- &modifiers,
- &item,
- PyMac_GetStr255, aString))
- return NULL;
- _rv = MCGetMenuString(_self->ob_itself,
- modifiers,
- item,
- aString);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCPtInController(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- Point thePt;
- Boolean inController;
- #ifndef MCPtInController
- PyMac_PRECHECK(MCPtInController);
- #endif
- if (!PyArg_ParseTuple(_args, "O&",
- PyMac_GetPoint, &thePt))
- return NULL;
- _rv = MCPtInController(_self->ob_itself,
- thePt,
- &inController);
- _res = Py_BuildValue("lb",
- _rv,
- inController);
- return _res;
- }
- static PyObject *MovieCtlObj_MCInvalidate(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- WindowPtr w;
- RgnHandle invalidRgn;
- #ifndef MCInvalidate
- PyMac_PRECHECK(MCInvalidate);
- #endif
- if (!PyArg_ParseTuple(_args, "O&O&",
- WinObj_Convert, &w,
- ResObj_Convert, &invalidRgn))
- return NULL;
- _rv = MCInvalidate(_self->ob_itself,
- w,
- invalidRgn);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCAdjustCursor(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- WindowPtr w;
- Point where;
- long modifiers;
- #ifndef MCAdjustCursor
- PyMac_PRECHECK(MCAdjustCursor);
- #endif
- if (!PyArg_ParseTuple(_args, "O&O&l",
- WinObj_Convert, &w,
- PyMac_GetPoint, &where,
- &modifiers))
- return NULL;
- _rv = MCAdjustCursor(_self->ob_itself,
- w,
- where,
- modifiers);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCGetInterfaceElement(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- MCInterfaceElement whichElement;
- void * element;
- #ifndef MCGetInterfaceElement
- PyMac_PRECHECK(MCGetInterfaceElement);
- #endif
- if (!PyArg_ParseTuple(_args, "ls",
- &whichElement,
- &element))
- return NULL;
- _rv = MCGetInterfaceElement(_self->ob_itself,
- whichElement,
- element);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCAddMovieSegment(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- Movie srcMovie;
- Boolean scaled;
- #ifndef MCAddMovieSegment
- PyMac_PRECHECK(MCAddMovieSegment);
- #endif
- if (!PyArg_ParseTuple(_args, "O&b",
- MovieObj_Convert, &srcMovie,
- &scaled))
- return NULL;
- _rv = MCAddMovieSegment(_self->ob_itself,
- srcMovie,
- scaled);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCTrimMovieSegment(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- #ifndef MCTrimMovieSegment
- PyMac_PRECHECK(MCTrimMovieSegment);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = MCTrimMovieSegment(_self->ob_itself);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCSetIdleManager(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- IdleManager im;
- #ifndef MCSetIdleManager
- PyMac_PRECHECK(MCSetIdleManager);
- #endif
- if (!PyArg_ParseTuple(_args, "O&",
- IdleManagerObj_Convert, &im))
- return NULL;
- _rv = MCSetIdleManager(_self->ob_itself,
- im);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *MovieCtlObj_MCSetControllerCapabilities(MovieControllerObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentResult _rv;
- long flags;
- long flagsMask;
- #ifndef MCSetControllerCapabilities
- PyMac_PRECHECK(MCSetControllerCapabilities);
- #endif
- if (!PyArg_ParseTuple(_args, "ll",
- &flags,
- &flagsMask))
- return NULL;
- _rv = MCSetControllerCapabilities(_self->ob_itself,
- flags,
- flagsMask);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyMethodDef MovieCtlObj_methods[] = {
- {"MCSetMovie", (PyCFunction)MovieCtlObj_MCSetMovie, 1,
- PyDoc_STR("(Movie theMovie, WindowPtr movieWindow, Point where) -> (ComponentResult _rv)")},
- {"MCGetIndMovie", (PyCFunction)MovieCtlObj_MCGetIndMovie, 1,
- PyDoc_STR("(short index) -> (Movie _rv)")},
- {"MCRemoveAllMovies", (PyCFunction)MovieCtlObj_MCRemoveAllMovies, 1,
- PyDoc_STR("() -> (ComponentResult _rv)")},
- {"MCRemoveAMovie", (PyCFunction)MovieCtlObj_MCRemoveAMovie, 1,
- PyDoc_STR("(Movie m) -> (ComponentResult _rv)")},
- {"MCRemoveMovie", (PyCFunction)MovieCtlObj_MCRemoveMovie, 1,
- PyDoc_STR("() -> (ComponentResult _rv)")},
- {"MCIsPlayerEvent", (PyCFunction)MovieCtlObj_MCIsPlayerEvent, 1,
- PyDoc_STR("(EventRecord e) -> (ComponentResult _rv)")},
- {"MCDoAction", (PyCFunction)MovieCtlObj_MCDoAction, 1,
- PyDoc_STR("(short action, void * params) -> (ComponentResult _rv)")},
- {"MCSetControllerAttached", (PyCFunction)MovieCtlObj_MCSetControllerAttached, 1,
- PyDoc_STR("(Boolean attach) -> (ComponentResult _rv)")},
- {"MCIsControllerAttached", (PyCFunction)MovieCtlObj_MCIsControllerAttached, 1,
- PyDoc_STR("() -> (ComponentResult _rv)")},
- {"MCSetControllerPort", (PyCFunction)MovieCtlObj_MCSetControllerPort, 1,
- PyDoc_STR("(CGrafPtr gp) -> (ComponentResult _rv)")},
- {"MCGetControllerPort", (PyCFunction)MovieCtlObj_MCGetControllerPort, 1,
- PyDoc_STR("() -> (CGrafPtr _rv)")},
- {"MCSetVisible", (PyCFunction)MovieCtlObj_MCSetVisible, 1,
- PyDoc_STR("(Boolean visible) -> (ComponentResult _rv)")},
- {"MCGetVisible", (PyCFunction)MovieCtlObj_MCGetVisible, 1,
- PyDoc_STR("() -> (ComponentResult _rv)")},
- {"MCGetControllerBoundsRect", (PyCFunction)MovieCtlObj_MCGetControllerBoundsRect, 1,
- PyDoc_STR("() -> (ComponentResult _rv, Rect bounds)")},
- {"MCSetControllerBoundsRect", (PyCFunction)MovieCtlObj_MCSetControllerBoundsRect, 1,
- PyDoc_STR("(Rect bounds) -> (ComponentResult _rv)")},
- {"MCGetControllerBoundsRgn", (PyCFunction)MovieCtlObj_MCGetControllerBoundsRgn, 1,
- PyDoc_STR("() -> (RgnHandle _rv)")},
- {"MCGetWindowRgn", (PyCFunction)MovieCtlObj_MCGetWindowRgn, 1,
- PyDoc_STR("(WindowPtr w) -> (RgnHandle _rv)")},
- {"MCMovieChanged", (PyCFunction)MovieCtlObj_MCMovieChanged, 1,
- PyDoc_STR("(Movie m) -> (ComponentResult _rv)")},
- {"MCSetDuration", (PyCFunction)MovieCtlObj_MCSetDuration, 1,
- PyDoc_STR("(TimeValue duration) -> (ComponentResult _rv)")},
- {"MCGetCurrentTime", (PyCFunction)MovieCtlObj_MCGetCurrentTime, 1,
- PyDoc_STR("() -> (TimeValue _rv, TimeScale scale)")},
- {"MCNewAttachedController", (PyCFunction)MovieCtlObj_MCNewAttachedController, 1,
- PyDoc_STR("(Movie theMovie, WindowPtr w, Point where) -> (ComponentResult _rv)")},
- {"MCDraw", (PyCFunction)MovieCtlObj_MCDraw, 1,
- PyDoc_STR("(WindowPtr w) -> (ComponentResult _rv)")},
- {"MCActivate", (PyCFunction)MovieCtlObj_MCActivate, 1,
- PyDoc_STR("(WindowPtr w, Boolean activate) -> (ComponentResult _rv)")},
- {"MCIdle", (PyCFunction)MovieCtlObj_MCIdle, 1,
- PyDoc_STR("() -> (ComponentResult _rv)")},
- {"MCKey", (PyCFunction)MovieCtlObj_MCKey, 1,
- PyDoc_STR("(SInt8 key, long modifiers) -> (ComponentResult _rv)")},
- {"MCClick", (PyCFunction)MovieCtlObj_MCClick, 1,
- PyDoc_STR("(WindowPtr w, Point where, long when, long modifiers) -> (ComponentResult _rv)")},
- {"MCEnableEditing", (PyCFunction)MovieCtlObj_MCEnableEditing, 1,
- PyDoc_STR("(Boolean enabled) -> (ComponentResult _rv)")},
- {"MCIsEditingEnabled", (PyCFunction)MovieCtlObj_MCIsEditingEnabled, 1,
- PyDoc_STR("() -> (long _rv)")},
- {"MCCopy", (PyCFunction)MovieCtlObj_MCCopy, 1,
- PyDoc_STR("() -> (Movie _rv)")},
- {"MCCut", (PyCFunction)MovieCtlObj_MCCut, 1,
- PyDoc_STR("() -> (Movie _rv)")},
- {"MCPaste", (PyCFunction)MovieCtlObj_MCPaste, 1,
- PyDoc_STR("(Movie srcMovie) -> (ComponentResult _rv)")},
- {"MCClear", (PyCFunction)MovieCtlObj_MCClear, 1,
- PyDoc_STR("() -> (ComponentResult _rv)")},
- {"MCUndo", (PyCFunction)MovieCtlObj_MCUndo, 1,
- PyDoc_STR("() -> (ComponentResult _rv)")},
- {"MCPositionController", (PyCFunction)MovieCtlObj_MCPositionController, 1,
- PyDoc_STR("(Rect movieRect, Rect controllerRect, long someFlags) -> (ComponentResult _rv)")},
- {"MCGetControllerInfo", (PyCFunction)MovieCtlObj_MCGetControllerInfo, 1,
- PyDoc_STR("() -> (ComponentResult _rv, long someFlags)")},
- {"MCSetClip", (PyCFunction)MovieCtlObj_MCSetClip, 1,
- PyDoc_STR("(RgnHandle theClip, RgnHandle movieClip) -> (ComponentResult _rv)")},
- {"MCGetClip", (PyCFunction)MovieCtlObj_MCGetClip, 1,
- PyDoc_STR("() -> (ComponentResult _rv, RgnHandle theClip, RgnHandle movieClip)")},
- {"MCDrawBadge", (PyCFunction)MovieCtlObj_MCDrawBadge, 1,
- PyDoc_STR("(RgnHandle movieRgn) -> (ComponentResult _rv, RgnHandle badgeRgn)")},
- {"MCSetUpEditMenu", (PyCFunction)MovieCtlObj_MCSetUpEditMenu, 1,
- PyDoc_STR("(long modifiers, MenuHandle mh) -> (ComponentResult _rv)")},
- {"MCGetMenuString", (PyCFunction)MovieCtlObj_MCGetMenuString, 1,
- PyDoc_STR("(long modifiers, short item, Str255 aString) -> (ComponentResult _rv)")},
- {"MCPtInController", (PyCFunction)MovieCtlObj_MCPtInController, 1,
- PyDoc_STR("(Point thePt) -> (ComponentResult _rv, Boolean inController)")},
- {"MCInvalidate", (PyCFunction)MovieCtlObj_MCInvalidate, 1,
- PyDoc_STR("(WindowPtr w, RgnHandle invalidRgn) -> (ComponentResult _rv)")},
- {"MCAdjustCursor", (PyCFunction)MovieCtlObj_MCAdjustCursor, 1,
- PyDoc_STR("(WindowPtr w, Point where, long modifiers) -> (ComponentResult _rv)")},
- {"MCGetInterfaceElement", (PyCFunction)MovieCtlObj_MCGetInterfaceElement, 1,
- PyDoc_STR("(MCInterfaceElement whichElement, void * element) -> (ComponentResult _rv)")},
- {"MCAddMovieSegment", (PyCFunction)MovieCtlObj_MCAddMovieSegment, 1,
- PyDoc_STR("(Movie srcMovie, Boolean scaled) -> (ComponentResult _rv)")},
- {"MCTrimMovieSegment", (PyCFunction)MovieCtlObj_MCTrimMovieSegment, 1,
- PyDoc_STR("() -> (ComponentResult _rv)")},
- {"MCSetIdleManager", (PyCFunction)MovieCtlObj_MCSetIdleManager, 1,
- PyDoc_STR("(IdleManager im) -> (ComponentResult _rv)")},
- {"MCSetControllerCapabilities", (PyCFunction)MovieCtlObj_MCSetControllerCapabilities, 1,
- PyDoc_STR("(long flags, long flagsMask) -> (ComponentResult _rv)")},
- {NULL, NULL, 0}
- };
- #define MovieCtlObj_getsetlist NULL
- #define MovieCtlObj_compare NULL
- #define MovieCtlObj_repr NULL
- #define MovieCtlObj_hash NULL
- #define MovieCtlObj_tp_init 0
- #define MovieCtlObj_tp_alloc PyType_GenericAlloc
- static PyObject *MovieCtlObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
- {
- 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;
- }
- #define MovieCtlObj_tp_free PyObject_Del
- PyTypeObject MovieController_Type = {
- PyObject_HEAD_INIT(NULL)
- 0, /*ob_size*/
- "_Qt.MovieController", /*tp_name*/
- sizeof(MovieControllerObject), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- /* methods */
- (destructor) MovieCtlObj_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
- (getattrfunc)0, /*tp_getattr*/
- (setattrfunc)0, /*tp_setattr*/
- (cmpfunc) MovieCtlObj_compare, /*tp_compare*/
- (reprfunc) MovieCtlObj_repr, /*tp_repr*/
- (PyNumberMethods *)0, /* tp_as_number */
- (PySequenceMethods *)0, /* tp_as_sequence */
- (PyMappingMethods *)0, /* tp_as_mapping */
- (hashfunc) MovieCtlObj_hash, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- PyObject_GenericGetAttr, /*tp_getattro*/
- PyObject_GenericSetAttr, /*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*/
- MovieCtlObj_methods, /* tp_methods */
- 0, /*tp_members*/
- MovieCtlObj_getsetlist, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- MovieCtlObj_tp_init, /* tp_init */
- MovieCtlObj_tp_alloc, /* tp_alloc */
- MovieCtlObj_tp_new, /* tp_new */
- MovieCtlObj_tp_free, /* tp_free */
- };
- /* ---------------- End object type MovieController ----------------- */
- /* ---------------------- Object type TimeBase ---------------------- */
- PyTypeObject TimeBase_Type;
- #define TimeBaseObj_Check(x) ((x)->ob_type == &TimeBase_Type || PyObject_TypeCheck((x), &TimeBase_Type))
- typedef struct TimeBaseObject {
- PyObject_HEAD
- TimeBase ob_itself;
- } TimeBaseObject;
- PyObject *TimeBaseObj_New(TimeBase itself)
- {
- TimeBaseObject *it;
- if (itself == 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)
- {
- *p_itself = NULL;
- return 1;
- }
- if (!TimeBaseObj_Check(v))
- {
- PyErr_SetString(PyExc_TypeError, "TimeBase required");
- return 0;
- }
- *p_itself = ((TimeBaseObject *)v)->ob_itself;
- return 1;
- }
- static void TimeBaseObj_dealloc(TimeBaseObject *self)
- {
- /* Cleanup of self->ob_itself goes here */
- self->ob_type->tp_free((PyObject *)self);
- }
- static PyObject *TimeBaseObj_DisposeTimeBase(TimeBaseObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- #ifndef DisposeTimeBase
- PyMac_PRECHECK(DisposeTimeBase);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- DisposeTimeBase(_self->ob_itself);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
- }
- static PyObject *TimeBaseObj_GetTimeBaseTime(TimeBaseObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- TimeValue _rv;
- TimeScale s;
- TimeRecord tr;
- #ifndef GetTimeBaseTime
- PyMac_PRECHECK(GetTimeBaseTime);
- #endif
- if (!PyArg_ParseTuple(_args, "l",
- &s))
- return NULL;
- _rv = GetTimeBaseTime(_self->ob_itself,
- s,
- &tr);
- _res = Py_BuildValue("lO&",
- _rv,
- QtTimeRecord_New, &tr);
- return _res;
- }
- static PyObject *TimeBaseObj_SetTimeBaseTime(TimeBaseObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- TimeRecord tr;
- #ifndef SetTimeBaseTime
- PyMac_PRECHECK(SetTimeBaseTime);
- #endif
- if (!PyArg_ParseTuple(_args, "O&",
- QtTimeRecord_Convert, &tr))
- return NULL;
- SetTimeBaseTime(_self->ob_itself,
- &tr);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
- }
- static PyObject *TimeBaseObj_SetTimeBaseValue(TimeBaseObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- TimeValue t;
- TimeScale s;
- #ifndef SetTimeBaseValue
- PyMac_PRECHECK(SetTimeBaseValue);
- #endif
- if (!PyArg_ParseTuple(_args, "ll",
- &t,
- &s))
- return NULL;
- SetTimeBaseValue(_self->ob_itself,
- t,
- s);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
- }
- static PyObject *TimeBaseObj_GetTimeBaseRate(TimeBaseObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- Fixed _rv;
- #ifndef GetTimeBaseRate
- PyMac_PRECHECK(GetTimeBaseRate);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = GetTimeBaseRate(_self->ob_itself);
- _res = Py_BuildValue("O&",
- PyMac_BuildFixed, _rv);
- return _res;
- }
- static PyObject *TimeBaseObj_SetTimeBaseRate(TimeBaseObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- Fixed r;
- #ifndef SetTimeBaseRate
- PyMac_PRECHECK(SetTimeBaseRate);
- #endif
- if (!PyArg_ParseTuple(_args, "O&",
- PyMac_GetFixed, &r))
- return NULL;
- SetTimeBaseRate(_self->ob_itself,
- r);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
- }
- static PyObject *TimeBaseObj_GetTimeBaseStartTime(TimeBaseObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- TimeValue _rv;
- TimeScale s;
- TimeRecord tr;
- #ifndef GetTimeBaseStartTime
- PyMac_PRECHECK(GetTimeBaseStartTime);
- #endif
- if (!PyArg_ParseTuple(_args, "l",
- &s))
- return NULL;
- _rv = GetTimeBaseStartTime(_self->ob_itself,
- s,
- &tr);
- _res = Py_BuildValue("lO&",
- _rv,
- QtTimeRecord_New, &tr);
- return _res;
- }
- static PyObject *TimeBaseObj_SetTimeBaseStartTime(TimeBaseObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- TimeRecord tr;
- #ifndef SetTimeBaseStartTime
- PyMac_PRECHECK(SetTimeBaseStartTime);
- #endif
- if (!PyArg_ParseTuple(_args, "O&",
- QtTimeRecord_Convert, &tr))
- return NULL;
- SetTimeBaseStartTime(_self->ob_itself,
- &tr);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
- }
- static PyObject *TimeBaseObj_GetTimeBaseStopTime(TimeBaseObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- TimeValue _rv;
- TimeScale s;
- TimeRecord tr;
- #ifndef GetTimeBaseStopTime
- PyMac_PRECHECK(GetTimeBaseStopTime);
- #endif
- if (!PyArg_ParseTuple(_args, "l",
- &s))
- return NULL;
- _rv = GetTimeBaseStopTime(_self->ob_itself,
- s,
- &tr);
- _res = Py_BuildValue("lO&",
- _rv,
- QtTimeRecord_New, &tr);
- return _res;
- }
- static PyObject *TimeBaseObj_SetTimeBaseStopTime(TimeBaseObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- TimeRecord tr;
- #ifndef SetTimeBaseStopTime
- PyMac_PRECHECK(SetTimeBaseStopTime);
- #endif
- if (!PyArg_ParseTuple(_args, "O&",
- QtTimeRecord_Convert, &tr))
- return NULL;
- SetTimeBaseStopTime(_self->ob_itself,
- &tr);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
- }
- static PyObject *TimeBaseObj_GetTimeBaseFlags(TimeBaseObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- long _rv;
- #ifndef GetTimeBaseFlags
- PyMac_PRECHECK(GetTimeBaseFlags);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = GetTimeBaseFlags(_self->ob_itself);
- _res = Py_BuildValue("l",
- _rv);
- return _res;
- }
- static PyObject *TimeBaseObj_SetTimeBaseFlags(TimeBaseObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- long timeBaseFlags;
- #ifndef SetTimeBaseFlags
- PyMac_PRECHECK(SetTimeBaseFlags);
- #endif
- if (!PyArg_ParseTuple(_args, "l",
- &timeBaseFlags))
- return NULL;
- SetTimeBaseFlags(_self->ob_itself,
- timeBaseFlags);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
- }
- static PyObject *TimeBaseObj_SetTimeBaseMasterTimeBase(TimeBaseObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- TimeBase master;
- TimeRecord slaveZero;
- #ifndef SetTimeBaseMasterTimeBase
- PyMac_PRECHECK(SetTimeBaseMasterTimeBase);
- #endif
- if (!PyArg_ParseTuple(_args, "O&O&",
- TimeBaseObj_Convert, &master,
- QtTimeRecord_Convert, &slaveZero))
- return NULL;
- SetTimeBaseMasterTimeBase(_self->ob_itself,
- master,
- &slaveZero);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
- }
- static PyObject *TimeBaseObj_GetTimeBaseMasterTimeBase(TimeBaseObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- TimeBase _rv;
- #ifndef GetTimeBaseMasterTimeBase
- PyMac_PRECHECK(GetTimeBaseMasterTimeBase);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = GetTimeBaseMasterTimeBase(_self->ob_itself);
- _res = Py_BuildValue("O&",
- TimeBaseObj_New, _rv);
- return _res;
- }
- static PyObject *TimeBaseObj_SetTimeBaseMasterClock(TimeBaseObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- Component clockMeister;
- TimeRecord slaveZero;
- #ifndef SetTimeBaseMasterClock
- PyMac_PRECHECK(SetTimeBaseMasterClock);
- #endif
- if (!PyArg_ParseTuple(_args, "O&O&",
- CmpObj_Convert, &clockMeister,
- QtTimeRecord_Convert, &slaveZero))
- return NULL;
- SetTimeBaseMasterClock(_self->ob_itself,
- clockMeister,
- &slaveZero);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
- }
- static PyObject *TimeBaseObj_GetTimeBaseMasterClock(TimeBaseObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- ComponentInstance _rv;
- #ifndef GetTimeBaseMasterClock
- PyMac_PRECHECK(GetTimeBaseMasterClock);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = GetTimeBaseMasterClock(_self->ob_itself);
- _res = Py_BuildValue("O&",
- CmpInstObj_New, _rv);
- return _res;
- }
- static PyObject *TimeBaseObj_GetTimeBaseStatus(TimeBaseObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- long _rv;
- TimeRecord unpinnedTime;
- #ifndef GetTimeBaseStatus
- PyMac_PRECHECK(GetTimeBaseStatus);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = GetTimeBaseStatus(_self->ob_itself,
- &unpinnedTime);
- _res = Py_BuildValue("lO&",
- _rv,
- QtTimeRecord_New, &unpinnedTime);
- return _res;
- }
- static PyObject *TimeBaseObj_SetTimeBaseZero(TimeBaseObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- TimeRecord zero;
- #ifndef SetTimeBaseZero
- PyMac_PRECHECK(SetTimeBaseZero);
- #endif
- if (!PyArg_ParseTuple(_args, "O&",
- QtTimeRecord_Convert, &zero))
- return NULL;
- SetTimeBaseZero(_self->ob_itself,
- &zero);
- Py_INCREF(Py_None);
- _res = Py_None;
- return _res;
- }
- static PyObject *TimeBaseObj_GetTimeBaseEffectiveRate(TimeBaseObject *_self, PyObject *_args)
- {
- PyObject *_res = NULL;
- Fixed _rv;
- #ifndef GetTimeBaseEffectiveRate
- PyMac_PRECHECK(GetTimeBaseEffectiveRate);
- #endif
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- _rv = GetTimeBaseEffectiveRate(_self->ob_itself);
- _res = Py_BuildValue("O&",
- PyMac_BuildFixed, _rv);
- return _res;
- }
- static PyMethodDef TimeBaseObj_methods[] = {
- {"DisposeTimeBase", (PyCFunction)TimeBaseObj_DisposeTimeBase, 1,
- PyDoc_STR("() -> None")},
- {"GetTimeBaseTime", (PyCFunction)TimeBaseObj_GetTimeBaseTime, 1,
- PyDoc_STR("(TimeScale s) -> (TimeValue _rv, TimeRecord tr)")},
- {"SetTimeBaseTime", (PyCFunction)TimeBaseObj_SetTimeBaseTime, 1,
- PyDoc_STR("(TimeRecord tr) -> None")},
- {"SetTimeBaseValue", (PyCFunction)TimeBaseObj_SetTimeBaseValue, 1,
- PyDoc_STR("(TimeValue t, TimeScale s) -> None")},
- {"GetTimeBaseRate", (PyCFunction)TimeBaseObj_GetTimeBaseRate, 1,
- PyDoc_STR("() -> (Fixed _rv)")},
- {"SetTimeBaseRate", (PyCFunction)TimeBaseObj_SetTimeBaseRate, 1,
- PyDoc_STR("(Fixed r) -> None")},
- {"GetTimeBaseStartTime", (PyCFunction)TimeBaseObj_GetTimeBaseStartTime, 1,
- PyDoc_STR("(TimeScale s) -> (TimeValue _rv, TimeRecord tr)")},
- {"SetTimeBaseStartTime", (PyCFunction)TimeBaseObj_SetTimeBaseStartTime, 1,
- PyDoc_STR("(TimeRecord tr) -> None")},
- {"GetTimeBaseStopTime", (PyCFunction)TimeBaseObj_GetTimeBaseStopTime, 1,
- PyDoc_STR("(TimeScale s) -> (TimeValue _rv, TimeRecord tr)")},
- {"SetTimeBaseStopTime", (PyCFunction)TimeBaseObj_SetTimeBaseStopTime, 1,
- PyDoc_STR("(TimeRecord tr) -> None")},
- {"GetTimeBaseFlags", (PyCFunction)TimeBaseObj_GetTimeBaseFlags, 1,
- PyDoc_STR("() -> (long _rv)")},
- {"SetTimeBaseFlags", (PyCFunction)TimeBaseObj_SetTimeBaseFlags, 1,
- PyDoc_STR("(long timeBaseFlags) -> None")},
- {"SetTimeBaseMasterTimeBase", (PyCFunction)TimeBaseObj_SetTimeBaseMasterTimeBase, 1,
- PyDoc_STR("(TimeBase master, TimeRecord slaveZero) -> None")},
- {"GetTimeBaseMasterTimeBase", (PyCFunction)TimeBaseObj_GetTimeBaseMasterTimeBase, 1,
- PyDoc_STR("() -> (TimeBase _rv)")},
- {"SetTimeBase…