[Python-checkins] CVS: python/dist/src/Mac/Modules/qt _Qtmodule.c,1.5,1.5.2.1 qtscan.py,1.17,1.17.16.1
Jack Jansen
jackjansen@users.sourceforge.net
Wed, 19 Dec 2001 07:10:19 -0800
Update of /cvsroot/python/python/dist/src/Mac/Modules/qt
In directory usw-pr-cvs1:/tmp/cvs-serv12554/Modules/qt
Modified Files:
Tag: r22rc1-branch
_Qtmodule.c qtscan.py
Log Message:
Merged Mac subtree into the 22c1 branch.
Index: _Qtmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/_Qtmodule.c,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -C2 -d -r1.5 -r1.5.2.1
*** _Qtmodule.c 2001/12/08 18:02:53 1.5
--- _Qtmodule.c 2001/12/19 15:10:16 1.5.2.1
***************
*** 6,11 ****
--- 6,15 ----
+ #ifdef _WIN32
+ #include "pywintoolbox.h"
+ #else
#include "macglue.h"
#include "pymactoolbox.h"
+ #endif
/* Macro to test whether a weak-loaded CFM function exists */
***************
*** 823,826 ****
--- 827,860 ----
}
+ static PyObject *MovieCtlObj_MCAddMovieSegment(MovieControllerObject *_self, PyObject *_args)
+ {
+ PyObject *_res = NULL;
+ ComponentResult _rv;
+ Movie srcMovie;
+ Boolean scaled;
+ 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;
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ _rv = MCTrimMovieSegment(_self->ob_itself);
+ _res = Py_BuildValue("l",
+ _rv);
+ return _res;
+ }
+
static PyMethodDef MovieCtlObj_methods[] = {
{"MCSetMovie", (PyCFunction)MovieCtlObj_MCSetMovie, 1,
***************
*** 912,915 ****
--- 946,953 ----
{"MCGetInterfaceElement", (PyCFunction)MovieCtlObj_MCGetInterfaceElement, 1,
"(MCInterfaceElement whichElement, void * element) -> (ComponentResult _rv)"},
+ {"MCAddMovieSegment", (PyCFunction)MovieCtlObj_MCAddMovieSegment, 1,
+ "(Movie srcMovie, Boolean scaled) -> (ComponentResult _rv)"},
+ {"MCTrimMovieSegment", (PyCFunction)MovieCtlObj_MCTrimMovieSegment, 1,
+ "() -> (ComponentResult _rv)"},
{NULL, NULL, 0}
};
***************
*** 3312,3315 ****
--- 3350,3374 ----
}
+ static PyObject *TrackObj_AddClonedTrackToMovie(TrackObject *_self, PyObject *_args)
+ {
+ PyObject *_res = NULL;
+ OSErr _err;
+ Movie dstMovie;
+ long flags;
+ Track dstTrack;
+ if (!PyArg_ParseTuple(_args, "O&l",
+ MovieObj_Convert, &dstMovie,
+ &flags))
+ return NULL;
+ _err = AddClonedTrackToMovie(_self->ob_itself,
+ dstMovie,
+ flags,
+ &dstTrack);
+ if (_err != noErr) return PyMac_Error(_err);
+ _res = Py_BuildValue("O&",
+ TrackObj_New, dstTrack);
+ return _res;
+ }
+
static PyObject *TrackObj_AddTrackReference(TrackObject *_self, PyObject *_args)
{
***************
*** 3674,3677 ****
--- 3733,3738 ----
{"AddEmptyTrackToMovie", (PyCFunction)TrackObj_AddEmptyTrackToMovie, 1,
"(Movie dstMovie, Handle dataRef, OSType dataRefType) -> (Track dstTrack)"},
+ {"AddClonedTrackToMovie", (PyCFunction)TrackObj_AddClonedTrackToMovie, 1,
+ "(Movie dstMovie, long flags) -> (Track dstTrack)"},
{"AddTrackReference", (PyCFunction)TrackObj_AddTrackReference, 1,
"(Track refTrack, OSType refType) -> (long addedIndex)"},
***************
*** 4253,4256 ****
--- 4314,4331 ----
}
+ static PyObject *MovieObj_SetMovieVideoOutput(MovieObject *_self, PyObject *_args)
+ {
+ PyObject *_res = NULL;
+ ComponentInstance vout;
+ if (!PyArg_ParseTuple(_args, "O&",
+ CmpInstObj_Convert, &vout))
+ return NULL;
+ SetMovieVideoOutput(_self->ob_itself,
+ vout);
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+ }
+
static PyObject *MovieObj_PutMovieIntoHandle(MovieObject *_self, PyObject *_args)
{
***************
*** 5615,5618 ****
--- 5690,5695 ----
{"GetMovieBoundsRgn", (PyCFunction)MovieObj_GetMovieBoundsRgn, 1,
"() -> (RgnHandle _rv)"},
+ {"SetMovieVideoOutput", (PyCFunction)MovieObj_SetMovieVideoOutput, 1,
+ "(ComponentInstance vout) -> None"},
{"PutMovieIntoHandle", (PyCFunction)MovieObj_PutMovieIntoHandle, 1,
"(Handle publicMovie) -> None"},
***************
*** 6028,6031 ****
--- 6105,6134 ----
}
+ static PyObject *Qt_QTGetMIMETypeInfo(PyObject *_self, PyObject *_args)
+ {
+ PyObject *_res = NULL;
+ OSErr _err;
+ char* mimeStringStart;
+ short mimeStringLength;
+ OSType infoSelector;
+ void * infoDataPtr;
+ long infoDataSize;
+ if (!PyArg_ParseTuple(_args, "shO&s",
+ &mimeStringStart,
+ &mimeStringLength,
+ PyMac_GetOSType, &infoSelector,
+ &infoDataPtr))
+ return NULL;
+ _err = QTGetMIMETypeInfo(mimeStringStart,
+ mimeStringLength,
+ infoSelector,
+ infoDataPtr,
+ &infoDataSize);
+ if (_err != noErr) return PyMac_Error(_err);
+ _res = Py_BuildValue("l",
+ infoDataSize);
+ return _res;
+ }
+
static PyObject *Qt_TrackTimeToMediaTime(PyObject *_self, PyObject *_args)
{
***************
*** 6332,6335 ****
--- 6435,6499 ----
}
+ static PyObject *Qt_CanQuickTimeOpenFile(PyObject *_self, PyObject *_args)
+ {
+ PyObject *_res = NULL;
+ OSErr _err;
+ FSSpec fileSpec;
+ OSType fileType;
+ OSType fileNameExtension;
+ Boolean outCanOpenWithGraphicsImporter;
+ Boolean outCanOpenAsMovie;
+ Boolean outPreferGraphicsImporter;
+ UInt32 inFlags;
+ if (!PyArg_ParseTuple(_args, "O&O&O&l",
+ PyMac_GetFSSpec, &fileSpec,
+ PyMac_GetOSType, &fileType,
+ PyMac_GetOSType, &fileNameExtension,
+ &inFlags))
+ return NULL;
+ _err = CanQuickTimeOpenFile(&fileSpec,
+ fileType,
+ fileNameExtension,
+ &outCanOpenWithGraphicsImporter,
+ &outCanOpenAsMovie,
+ &outPreferGraphicsImporter,
+ inFlags);
+ if (_err != noErr) return PyMac_Error(_err);
+ _res = Py_BuildValue("bbb",
+ outCanOpenWithGraphicsImporter,
+ outCanOpenAsMovie,
+ outPreferGraphicsImporter);
+ return _res;
+ }
+
+ static PyObject *Qt_CanQuickTimeOpenDataRef(PyObject *_self, PyObject *_args)
+ {
+ PyObject *_res = NULL;
+ OSErr _err;
+ Handle dataRef;
+ OSType dataRefType;
+ Boolean outCanOpenWithGraphicsImporter;
+ Boolean outCanOpenAsMovie;
+ Boolean outPreferGraphicsImporter;
+ UInt32 inFlags;
+ if (!PyArg_ParseTuple(_args, "O&O&l",
+ ResObj_Convert, &dataRef,
+ PyMac_GetOSType, &dataRefType,
+ &inFlags))
+ return NULL;
+ _err = CanQuickTimeOpenDataRef(dataRef,
+ dataRefType,
+ &outCanOpenWithGraphicsImporter,
+ &outCanOpenAsMovie,
+ &outPreferGraphicsImporter,
+ inFlags);
+ if (_err != noErr) return PyMac_Error(_err);
+ _res = Py_BuildValue("bbb",
+ outCanOpenWithGraphicsImporter,
+ outCanOpenAsMovie,
+ outPreferGraphicsImporter);
+ return _res;
+ }
+
static PyObject *Qt_NewMovieFromScrap(PyObject *_self, PyObject *_args)
{
***************
*** 6910,6913 ****
--- 7074,7103 ----
}
+ static PyObject *Qt_TextMediaGetTextProperty(PyObject *_self, PyObject *_args)
+ {
+ PyObject *_res = NULL;
+ ComponentResult _rv;
+ MediaHandler mh;
+ TimeValue atMediaTime;
+ long propertyType;
+ void * data;
+ long dataSize;
+ if (!PyArg_ParseTuple(_args, "O&llsl",
+ CmpInstObj_Convert, &mh,
+ &atMediaTime,
+ &propertyType,
+ &data,
+ &dataSize))
+ return NULL;
+ _rv = TextMediaGetTextProperty(mh,
+ atMediaTime,
+ propertyType,
+ data,
+ dataSize);
+ _res = Py_BuildValue("l",
+ _rv);
+ return _res;
+ }
+
static PyObject *Qt_TextMediaFindNextText(PyObject *_self, PyObject *_args)
{
***************
*** 7618,7621 ****
--- 7808,7900 ----
}
+ static PyObject *Qt_FlashMediaGetFlashVariable(PyObject *_self, PyObject *_args)
+ {
+ PyObject *_res = NULL;
+ ComponentResult _rv;
+ MediaHandler mh;
+ char path;
+ char name;
+ Handle theVariableCStringOut;
+ if (!PyArg_ParseTuple(_args, "O&",
+ CmpInstObj_Convert, &mh))
+ return NULL;
+ _rv = FlashMediaGetFlashVariable(mh,
+ &path,
+ &name,
+ &theVariableCStringOut);
+ _res = Py_BuildValue("lccO&",
+ _rv,
+ path,
+ name,
+ ResObj_New, theVariableCStringOut);
+ return _res;
+ }
+
+ static PyObject *Qt_FlashMediaSetFlashVariable(PyObject *_self, PyObject *_args)
+ {
+ PyObject *_res = NULL;
+ ComponentResult _rv;
+ MediaHandler mh;
+ char path;
+ char name;
+ char value;
+ Boolean updateFocus;
+ if (!PyArg_ParseTuple(_args, "O&b",
+ CmpInstObj_Convert, &mh,
+ &updateFocus))
+ return NULL;
+ _rv = FlashMediaSetFlashVariable(mh,
+ &path,
+ &name,
+ &value,
+ updateFocus);
+ _res = Py_BuildValue("lccc",
+ _rv,
+ path,
+ name,
+ value);
+ return _res;
+ }
+
+ static PyObject *Qt_FlashMediaDoButtonActions(PyObject *_self, PyObject *_args)
+ {
+ PyObject *_res = NULL;
+ ComponentResult _rv;
+ MediaHandler mh;
+ char path;
+ long buttonID;
+ long transition;
+ if (!PyArg_ParseTuple(_args, "O&ll",
+ CmpInstObj_Convert, &mh,
+ &buttonID,
+ &transition))
+ return NULL;
+ _rv = FlashMediaDoButtonActions(mh,
+ &path,
+ buttonID,
+ transition);
+ _res = Py_BuildValue("lc",
+ _rv,
+ path);
+ return _res;
+ }
+
+ static PyObject *Qt_FlashMediaGetSupportedSwfVersion(PyObject *_self, PyObject *_args)
+ {
+ PyObject *_res = NULL;
+ ComponentResult _rv;
+ MediaHandler mh;
+ UInt8 swfVersion;
+ if (!PyArg_ParseTuple(_args, "O&",
+ CmpInstObj_Convert, &mh))
+ return NULL;
+ _rv = FlashMediaGetSupportedSwfVersion(mh,
+ &swfVersion);
+ _res = Py_BuildValue("lb",
+ _rv,
+ swfVersion);
+ return _res;
+ }
+
#if !TARGET_API_MAC_CARBON
***************
*** 7986,7999 ****
{
PyObject *_res = NULL;
! TimeRecord inout;
TimeBase newBase;
! if (!PyArg_ParseTuple(_args, "O&O&",
! QtTimeRecord_Convert, &inout,
TimeBaseObj_Convert, &newBase))
return NULL;
! ConvertTime(&inout,
newBase);
_res = Py_BuildValue("O&",
! QtTimeRecord_New, &inout);
return _res;
}
--- 8265,8277 ----
{
PyObject *_res = NULL;
! TimeRecord theTime;
TimeBase newBase;
! if (!PyArg_ParseTuple(_args, "O&",
TimeBaseObj_Convert, &newBase))
return NULL;
! ConvertTime(&theTime,
newBase);
_res = Py_BuildValue("O&",
! QtTimeRecord_New, &theTime);
return _res;
}
***************
*** 8002,8015 ****
{
PyObject *_res = NULL;
! TimeRecord inout;
TimeScale newScale;
! if (!PyArg_ParseTuple(_args, "O&l",
! QtTimeRecord_Convert, &inout,
&newScale))
return NULL;
! ConvertTimeScale(&inout,
newScale);
_res = Py_BuildValue("O&",
! QtTimeRecord_New, &inout);
return _res;
}
--- 8280,8292 ----
{
PyObject *_res = NULL;
! TimeRecord theTime;
TimeScale newScale;
! if (!PyArg_ParseTuple(_args, "l",
&newScale))
return NULL;
! ConvertTimeScale(&theTime,
newScale);
_res = Py_BuildValue("O&",
! QtTimeRecord_New, &theTime);
return _res;
}
***************
*** 8151,8154 ****
--- 8428,8433 ----
{"GetMovieImporterForDataRef", (PyCFunction)Qt_GetMovieImporterForDataRef, 1,
"(OSType dataRefType, Handle dataRef, long flags) -> (Component importer)"},
+ {"QTGetMIMETypeInfo", (PyCFunction)Qt_QTGetMIMETypeInfo, 1,
+ "(char* mimeStringStart, short mimeStringLength, OSType infoSelector, void * infoDataPtr) -> (long infoDataSize)"},
{"TrackTimeToMediaTime", (PyCFunction)Qt_TrackTimeToMediaTime, 1,
"(TimeValue value, Track theTrack) -> (TimeValue _rv)"},
***************
*** 8179,8182 ****
--- 8458,8465 ----
{"CreateShortcutMovieFile", (PyCFunction)Qt_CreateShortcutMovieFile, 1,
"(FSSpec fileSpec, OSType creator, ScriptCode scriptTag, long createMovieFileFlags, Handle targetDataRef, OSType targetDataRefType) -> None"},
+ {"CanQuickTimeOpenFile", (PyCFunction)Qt_CanQuickTimeOpenFile, 1,
+ "(FSSpec fileSpec, OSType fileType, OSType fileNameExtension, UInt32 inFlags) -> (Boolean outCanOpenWithGraphicsImporter, Boolean outCanOpenAsMovie, Boolean outPreferGraphicsImporter)"},
+ {"CanQuickTimeOpenDataRef", (PyCFunction)Qt_CanQuickTimeOpenDataRef, 1,
+ "(Handle dataRef, OSType dataRefType, UInt32 inFlags) -> (Boolean outCanOpenWithGraphicsImporter, Boolean outCanOpenAsMovie, Boolean outPreferGraphicsImporter)"},
{"NewMovieFromScrap", (PyCFunction)Qt_NewMovieFromScrap, 1,
"(long newMovieFlags) -> (Movie _rv)"},
***************
*** 8227,8230 ****
--- 8510,8515 ----
{"TextMediaRawIdle", (PyCFunction)Qt_TextMediaRawIdle, 1,
"(MediaHandler mh, GWorldPtr gw, GDHandle gd, TimeValue sampleTime, long flagsIn) -> (ComponentResult _rv, long flagsOut)"},
+ {"TextMediaGetTextProperty", (PyCFunction)Qt_TextMediaGetTextProperty, 1,
+ "(MediaHandler mh, TimeValue atMediaTime, long propertyType, void * data, long dataSize) -> (ComponentResult _rv)"},
{"TextMediaFindNextText", (PyCFunction)Qt_TextMediaFindNextText, 1,
"(MediaHandler mh, Ptr text, long size, short findFlags, TimeValue startTime) -> (ComponentResult _rv, TimeValue foundTime, TimeValue foundDuration, long offset)"},
***************
*** 8296,8299 ****
--- 8581,8592 ----
{"FlashMediaFrameLabelToMovieTime", (PyCFunction)Qt_FlashMediaFrameLabelToMovieTime, 1,
"(MediaHandler mh, Ptr theLabel) -> (ComponentResult _rv, TimeValue movieTime)"},
+ {"FlashMediaGetFlashVariable", (PyCFunction)Qt_FlashMediaGetFlashVariable, 1,
+ "(MediaHandler mh) -> (ComponentResult _rv, char path, char name, Handle theVariableCStringOut)"},
+ {"FlashMediaSetFlashVariable", (PyCFunction)Qt_FlashMediaSetFlashVariable, 1,
+ "(MediaHandler mh, Boolean updateFocus) -> (ComponentResult _rv, char path, char name, char value)"},
+ {"FlashMediaDoButtonActions", (PyCFunction)Qt_FlashMediaDoButtonActions, 1,
+ "(MediaHandler mh, long buttonID, long transition) -> (ComponentResult _rv, char path)"},
+ {"FlashMediaGetSupportedSwfVersion", (PyCFunction)Qt_FlashMediaGetSupportedSwfVersion, 1,
+ "(MediaHandler mh) -> (ComponentResult _rv, UInt8 swfVersion)"},
#if !TARGET_API_MAC_CARBON
***************
*** 8349,8355 ****
"() -> (TimeBase _rv)"},
{"ConvertTime", (PyCFunction)Qt_ConvertTime, 1,
! "(TimeRecord inout, TimeBase newBase) -> (TimeRecord inout)"},
{"ConvertTimeScale", (PyCFunction)Qt_ConvertTimeScale, 1,
! "(TimeRecord inout, TimeScale newScale) -> (TimeRecord inout)"},
{"AddTime", (PyCFunction)Qt_AddTime, 1,
"(TimeRecord dst, TimeRecord src) -> (TimeRecord dst)"},
--- 8642,8648 ----
"() -> (TimeBase _rv)"},
{"ConvertTime", (PyCFunction)Qt_ConvertTime, 1,
! "(TimeBase newBase) -> (TimeRecord theTime)"},
{"ConvertTimeScale", (PyCFunction)Qt_ConvertTimeScale, 1,
! "(TimeScale newScale) -> (TimeRecord theTime)"},
{"AddTime", (PyCFunction)Qt_AddTime, 1,
"(TimeRecord dst, TimeRecord src) -> (TimeRecord dst)"},
Index: qtscan.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/qtscan.py,v
retrieving revision 1.17
retrieving revision 1.17.16.1
diff -C2 -d -r1.17 -r1.17.16.1
*** qtscan.py 2001/01/09 22:09:30 1.17
--- qtscan.py 2001/12/19 15:10:17 1.17.16.1
***************
*** 145,148 ****
--- 145,153 ----
# AddTime and SubtractTime
([('TimeRecord', 'dst', 'OutMode')], [('TimeRecord', 'dst', 'InOutMode')]),
+
+ # Funny definitions
+ ([('char_ptr', '*', 'InMode')], [('stringptr', '*', 'InMode')]),
+ ([('FSSpecPtr', '*', 'InMode')], [('FSSpec_ptr', '*', 'InMode')]),
+ ([('unsigned_char', 'swfVersion', 'OutMode')], [('UInt8', 'swfVersion', 'OutMode')]),
]