summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/qt/qtsupport.py
diff options
context:
space:
mode:
Diffstat (limited to 'Mac/Modules/qt/qtsupport.py')
-rw-r--r--Mac/Modules/qt/qtsupport.py51
1 files changed, 46 insertions, 5 deletions
diff --git a/Mac/Modules/qt/qtsupport.py b/Mac/Modules/qt/qtsupport.py
index ef5cac7..17ba808 100644
--- a/Mac/Modules/qt/qtsupport.py
+++ b/Mac/Modules/qt/qtsupport.py
@@ -3,6 +3,8 @@
# The function specifications are generated by scanning the mamager's header file,
# using the "scantools" package (customized for this particular manager).
+#error missing SetActionFilter
+
import string
# Declarations that change for each manager
@@ -39,6 +41,8 @@ staticforward PyObject *TrackObj_New(Track);
staticforward int TrackObj_Convert(PyObject *, Track *);
staticforward PyObject *MovieObj_New(Movie);
staticforward int MovieObj_Convert(PyObject *, Movie *);
+staticforward PyObject *MovieCtlObj_New(MovieController);
+staticforward int MovieCtlObj_Convert(PyObject *, MovieController *);
"""
@@ -49,6 +53,7 @@ Track = OpaqueByValueType('Track', 'TrackObj')
Media = OpaqueByValueType('Media', 'MediaObj')
UserData = OpaqueByValueType('UserData', 'UserDataObj')
TimeBase = OpaqueByValueType('TimeBase', 'TimeBaseObj')
+MovieController = OpaqueByValueType('MovieController', 'MovieCtlObj')
# Other opaque objects
Component = OpaqueByValueType('Component', 'CmpObj')
@@ -58,10 +63,6 @@ DataHandlerComponent = OpaqueByValueType('DataHandlerComponent', 'CmpObj')
ComponentInstance = OpaqueByValueType('ComponentInstance', 'CmpInstObj')
MediaHandler = OpaqueByValueType('MediaHandler', 'CmpInstObj')
DataHandler = OpaqueByValueType('DataHandler', 'CmpInstObj')
-# XXXX The next one should really be a full-fledged object here, but the
-# type is sometimes specified as MovieController and some times as
-# ComponentInstance.
-MovieController = OpaqueByValueType('MovieController', 'CmpInstObj')
RgnHandle = OpaqueByValueType("RgnHandle", "ResObj")
PicHandle = OpaqueByValueType("PicHandle", "ResObj")
@@ -91,8 +92,12 @@ mediaHandlerFlagsEnum = Type("mediaHandlerFlagsEnum", "l")
ComponentResult = Type("ComponentResult", "l")
HandlerError = Type("HandlerError", "l")
Ptr = InputOnlyType("Ptr", "s")
-StringPtr = InputOnlyType("StringPtr", "s")
+StringPtr = Type("StringPtr", "s")
+mcactionparams = InputOnlyType("void *", "s")
+# Could-not-be-bothered-types (NewMovieFromFile)
+dummyshortptr = FakeType('(short *)0')
+dummyStringPtr = FakeType('(StringPtr)0')
class MovieObjectDefinition(GlobalObjectDefinition):
def outputCheckNewArg(self):
@@ -139,6 +144,15 @@ class TimeBaseObjectDefinition(GlobalObjectDefinition):
def outputFreeIt(self, itselfname):
Output("DisposeTimeBase(%s);", itselfname)
+class MovieCtlObjectDefinition(GlobalObjectDefinition):
+ def outputCheckNewArg(self):
+ Output("""if (itself == NULL) {
+ PyErr_SetString(Qt_Error,"Cannot create null MovieController");
+ return NULL;
+ }""")
+ def outputFreeIt(self, itselfname):
+ Output("DisposeMovieController(%s);", itselfname)
+
# From here on it's basically all boiler plate...
# Create the generator groups and link them
@@ -148,7 +162,9 @@ Track_object = TrackObjectDefinition('Track', 'TrackObj', 'Track')
Media_object = MediaObjectDefinition('Media', 'MediaObj', 'Media')
UserData_object = UserDataObjectDefinition('UserData', 'UserDataObj', 'UserData')
TimeBase_object = TimeBaseObjectDefinition('TimeBase', 'TimeBaseObj', 'TimeBase')
+MovieController_object = MovieCtlObjectDefinition('MovieController', 'MovieCtlObj', 'MovieController')
+module.addobject(MovieController_object)
module.addobject(TimeBase_object)
module.addobject(UserData_object)
module.addobject(Media_object)
@@ -161,6 +177,7 @@ Method = OSErrMethodGenerator
# Create and populate the lists
functions = []
+MovieController_methods = []
TimeBase_methods = []
UserData_methods = []
Media_methods = []
@@ -168,9 +185,33 @@ Track_methods = []
Movie_methods = []
execfile(INPUTFILE)
+#
+# Some functions from ImageCompression.h that we need:
+ICMAlignmentProcRecordPtr = FakeType('(ICMAlignmentProcRecordPtr)0')
+dummyRect = FakeType('(Rect *)0')
+
+f = Function(void, 'AlignWindow',
+ (WindowPtr, 'wp', InMode),
+ (Boolean, 'front', InMode),
+ (dummyRect, 'alignmentRect', InMode),
+ (ICMAlignmentProcRecordPtr, 'alignmentProc', InMode),
+)
+functions.append(f)
+
+f = Function(void, 'DragAlignedWindow',
+ (WindowPtr, 'wp', InMode),
+ (Point, 'startPt', InMode),
+ (Rect_ptr, 'boundsRect', InMode),
+ (dummyRect, 'alignmentRect', InMode),
+ (ICMAlignmentProcRecordPtr, 'alignmentProc', InMode),
+)
+functions.append(f)
+
+
# add the populated lists to the generator groups
# (in a different wordl the scan program would generate this)
for f in functions: module.add(f)
+for f in MovieController_methods: MovieController_object.add(f)
for f in TimeBase_methods: TimeBase_object.add(f)
for f in UserData_methods: UserData_object.add(f)
for f in Media_methods: Media_object.add(f)