Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
453ced57
Kaydet (Commit)
453ced57
authored
29 years ago
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
still untested (but it compiles)
üst
8b13703f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
156 additions
and
29 deletions
+156
-29
Qtmodule.c
Mac/Modules/qt/Qtmodule.c
+0
-0
qtgen.py
Mac/Modules/qt/qtgen.py
+0
-0
qtscan.py
Mac/Modules/qt/qtscan.py
+40
-17
qtsupport.py
Mac/Modules/qt/qtsupport.py
+116
-12
No files found.
Mac/Modules/qt/Qtmodule.c
0 → 100644
Dosyayı görüntüle @
453ced57
This diff is collapsed.
Click to expand it.
Mac/Modules/qt/qtgen.py
Dosyayı görüntüle @
453ced57
This diff is collapsed.
Click to expand it.
Mac/Modules/qt/qtscan.py
Dosyayı görüntüle @
453ced57
...
...
@@ -6,7 +6,7 @@ from scantools import Scanner
LONG
=
"QuickTime"
SHORT
=
"qt"
OBJECT
=
"Movie"
OBJECT
S
=
(
"Movie"
,
"Track"
,
"Media"
,
"UserData"
,
"TimeBase"
)
def
main
():
input
=
"Movies.h"
...
...
@@ -26,52 +26,75 @@ class MyScanner(Scanner):
listname
=
"functions"
if
arglist
:
t
,
n
,
m
=
arglist
[
0
]
if
t
==
OBJECT
and
m
==
"InMode"
:
if
t
in
OBJECTS
and
m
==
"InMode"
:
classname
=
"Method"
listname
=
"
methods"
listname
=
t
+
"_
methods"
return
classname
,
listname
def
makeblacklistnames
(
self
):
return
[
"DisposeMovie"
,
# Done on python-object disposal
"DisposeMovieTrack"
,
# ditto
"DisposeTrackMedia"
,
# ditto
"DisposeUserData"
,
# ditto
"DisposeTimeBase"
,
# ditto
"GetMovieCreationTime"
,
# type "unsigned long" in C, inparseable
"GetMovieModificationTime"
,
# Ditto
"GetTrackCreationTime"
,
# ditto
"GetTrackModificationTime"
,
# Ditto
"GetMediaCreationTime"
,
# ditto
"GetMediaModificationTime"
,
# Ditto
# The following 4 use 'void *' in an uncontrolled way
# TBD when I've read the manual...
"GetUserDataItem"
,
"SetUserDataItem"
,
"SetTextSampleData"
,
"MCDoAction"
,
# bgen gets the argument in/out wrong..
"AddTextSample"
,
"AddTESample"
,
"AddHiliteSample"
,
"HiliteTextSample"
,
]
def
makeblacklisttypes
(
self
):
return
[
"MoviesErrorUPP"
,
"Track"
,
# XXXX To be done in the future
"Media"
,
"UserData"
,
"TimeBase"
,
# I don't think we want to do these
"QTSyncTaskPtr"
,
# We dont do callbacks yet, so no need for these
"QTCallBack"
,
"Component"
,
# Skipped for now, due to laziness
"TimeRecord"
,
"TimeRecord_ptr"
,
"TrackEditState"
,
"MovieEditState"
,
"MoviePreviewCallOutUPP"
,
"MatrixRecord"
,
"MatrixRecord_ptr"
,
"SampleReferencePtr"
,
# "SampleDescription",
# "SoundDescription",
# "TextDescription",
# "MusicDescription",
# I dont know yet how to do these.
"CGrafPtr"
,
"GDHandle"
,
# Routine pointers, not yet.
"MoviesErrorUPP"
,
"MoviePreviewCallOutUPP"
,
"MovieDrawingCompleteUPP"
,
"PixMapHandle"
,
"MatrixRecord"
,
"MatrixRecord_ptr"
,
"QTCallBackUPP"
,
"TextMediaUPP"
,
"MovieProgressUPP"
,
"MovieRgnCoverUPP"
,
"MCActionFilterUPP"
,
"MCActionFilterWithRefConUPP"
,
"SampleDescription"
,
"SoundDescription"
,
"TextDescription"
,
"MusicDescription"
,
"GetMovieUPP"
,
"ModalFilterUPP"
,
]
def
makerepairinstructions
(
self
):
return
[
([(
'FSSpec'
,
'*'
,
'OutMode'
)],
[(
'FSSpec_ptr'
,
'*'
,
'InMode'
)]),
]
if
__name__
==
"__main__"
:
...
...
This diff is collapsed.
Click to expand it.
Mac/Modules/qt/qtsupport.py
Dosyayı görüntüle @
453ced57
...
...
@@ -7,7 +7,7 @@ import string
# Declarations that change for each manager
MACHEADERFILE
=
'Movies.h'
# The Apple header file
MODNAME
=
'
q
t'
# The name of the module
MODNAME
=
'
Q
t'
# The name of the module
OBJECTNAME
=
'Movie'
# The basic name of the objects used here
# The following is *usually* unchanged but may still require tuning
...
...
@@ -23,9 +23,59 @@ from macsupport import *
includestuff
=
includestuff
+
"""
#include <
%
s>"""
%
MACHEADERFILE
+
"""
/* Exported by Cmmodule.c: */
extern PyObject *CmpObj_New(Component);
extern int CmpObj_Convert(PyObject *, Component *);
extern PyObject *CmpInstObj_New(ComponentInstance);
extern int CmpInstObj_Convert(PyObject *, ComponentInstance *);
/* Exported by Qdmodule.c: */
extern PyObject *QdRGB_New(RGBColor *);
extern int QdRGB_Convert(PyObject *, RGBColor *);
/* Our own, used before defined: */
staticforward PyObject *TrackObj_New(Track);
staticforward int TrackObj_Convert(PyObject *, Track *);
staticforward PyObject *MovieObj_New(Movie);
staticforward int MovieObj_Convert(PyObject *, Movie *);
"""
Movie
=
OpaqueByValueType
(
OBJECTTYPE
,
OBJECTPREFIX
)
# Our (opaque) objects
Movie
=
OpaqueByValueType
(
'Movie'
,
'MovieObj'
)
Track
=
OpaqueByValueType
(
'Track'
,
'TrackObj'
)
Media
=
OpaqueByValueType
(
'Media'
,
'MediaObj'
)
UserData
=
OpaqueByValueType
(
'UserData'
,
'UserDataObj'
)
TimeBase
=
OpaqueByValueType
(
'TimeBase'
,
'TimeBaseObj'
)
# Other opaque objects
Component
=
OpaqueByValueType
(
'Component'
,
'CmpObj'
)
MediaHandlerComponent
=
OpaqueByValueType
(
'MediaHandlerComponent'
,
'CmpObj'
)
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"
)
CTabHandle
=
OpaqueByValueType
(
"CTabHandle"
,
"ResObj"
)
PixMapHandle
=
OpaqueByValueType
(
"PixMapHandle"
,
"ResObj"
)
SampleDescriptionHandle
=
OpaqueByValueType
(
"SampleDescriptionHandle"
,
"ResObj"
)
TEHandle
=
OpaqueByValueType
(
"TEHandle"
,
"ResObj"
)
# Silly Apple, passing an OStype by reference...
OSType_ptr
=
OpaqueType
(
"OSType"
,
"PyMac_BuildOSType"
,
"PyMac_GetOSType"
)
RGBColor
=
OpaqueType
(
"RGBColor"
,
"QdRGB"
)
RGBColor_ptr
=
OpaqueType
(
"RGBColor"
,
"QdRGB"
)
# Non-opaque types, mostly integer-ish
TimeValue
=
Type
(
"TimeValue"
,
"l"
)
TimeScale
=
Type
(
"TimeScale"
,
"l"
)
TimeBaseFlags
=
Type
(
"TimeBaseFlags"
,
"l"
)
...
...
@@ -38,12 +88,13 @@ movieFlattenFlagsEnum = Type("movieFlattenFlagsEnum", "l")
dataRefAttributesFlags
=
Type
(
"dataRefAttributesFlags"
,
"l"
)
playHintsEnum
=
Type
(
"playHintsEnum"
,
"l"
)
mediaHandlerFlagsEnum
=
Type
(
"mediaHandlerFlagsEnum"
,
"l"
)
RgnHandle
=
OpaqueByValueType
(
"RgnHandle"
,
"ResObj"
)
PicHandle
=
OpaqueByValueType
(
"PicHandle"
,
"ResObj"
)
ComponentResult
=
Type
(
"ComponentResult"
,
"l"
)
HandlerError
=
Type
(
"HandlerError"
,
"l"
)
Ptr
=
InputOnlyType
(
"Ptr"
,
"s"
)
StringPtr
=
InputOnlyType
(
"StringPtr"
,
"s"
)
class
M
y
ObjectDefinition
(
GlobalObjectDefinition
):
class
M
ovie
ObjectDefinition
(
GlobalObjectDefinition
):
def
outputCheckNewArg
(
self
):
Output
(
"""if (itself == NULL) {
PyErr_SetString(Qt_Error,"Cannot create null Movie");
...
...
@@ -52,26 +103,79 @@ class MyObjectDefinition(GlobalObjectDefinition):
def
outputFreeIt
(
self
,
itselfname
):
Output
(
"DisposeMovie(
%
s);"
,
itselfname
)
class
TrackObjectDefinition
(
GlobalObjectDefinition
):
def
outputCheckNewArg
(
self
):
Output
(
"""if (itself == NULL) {
PyErr_SetString(Qt_Error,"Cannot create null Track");
return NULL;
}"""
)
def
outputFreeIt
(
self
,
itselfname
):
Output
(
"DisposeMovieTrack(
%
s);"
,
itselfname
)
class
MediaObjectDefinition
(
GlobalObjectDefinition
):
def
outputCheckNewArg
(
self
):
Output
(
"""if (itself == NULL) {
PyErr_SetString(Qt_Error,"Cannot create null Media");
return NULL;
}"""
)
def
outputFreeIt
(
self
,
itselfname
):
Output
(
"DisposeTrackMedia(
%
s);"
,
itselfname
)
class
UserDataObjectDefinition
(
GlobalObjectDefinition
):
def
outputCheckNewArg
(
self
):
Output
(
"""if (itself == NULL) {
PyErr_SetString(Qt_Error,"Cannot create null UserData");
return NULL;
}"""
)
def
outputFreeIt
(
self
,
itselfname
):
Output
(
"DisposeUserData(
%
s);"
,
itselfname
)
class
TimeBaseObjectDefinition
(
GlobalObjectDefinition
):
def
outputCheckNewArg
(
self
):
Output
(
"""if (itself == NULL) {
PyErr_SetString(Qt_Error,"Cannot create null TimeBase");
return NULL;
}"""
)
def
outputFreeIt
(
self
,
itselfname
):
Output
(
"DisposeTimeBase(
%
s);"
,
itselfname
)
# From here on it's basically all boiler plate...
# Create the generator groups and link them
module
=
MacModule
(
MODNAME
,
MODPREFIX
,
includestuff
,
finalstuff
,
initstuff
)
object
=
MyObjectDefinition
(
OBJECTNAME
,
OBJECTPREFIX
,
OBJECTTYPE
)
module
.
addobject
(
object
)
Movie_object
=
MovieObjectDefinition
(
'Movie'
,
'MovieObj'
,
'Movie'
)
Track_object
=
TrackObjectDefinition
(
'Track'
,
'TrackObj'
,
'Track'
)
Media_object
=
MediaObjectDefinition
(
'Media'
,
'MediaObj'
,
'Media'
)
UserData_object
=
UserDataObjectDefinition
(
'UserData'
,
'UserDataObj'
,
'UserData'
)
TimeBase_object
=
TimeBaseObjectDefinition
(
'TimeBase'
,
'TimeBaseObj'
,
'TimeBase'
)
module
.
addobject
(
TimeBase_object
)
module
.
addobject
(
UserData_object
)
module
.
addobject
(
Media_object
)
module
.
addobject
(
Track_object
)
module
.
addobject
(
Movie_object
)
# Create the generator classes used to populate the lists
Function
=
FunctionGenerator
Method
=
MethodGenerator
Function
=
OSErr
FunctionGenerator
Method
=
OSErr
MethodGenerator
# Create and populate the lists
functions
=
[]
methods
=
[]
TimeBase_methods
=
[]
UserData_methods
=
[]
Media_methods
=
[]
Track_methods
=
[]
Movie_methods
=
[]
execfile
(
INPUTFILE
)
# 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
methods
:
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
)
for
f
in
Track_methods
:
Track_object
.
add
(
f
)
for
f
in
Movie_methods
:
Movie_object
.
add
(
f
)
# generate output (open the output file as late as possible)
SetOutputFileName
(
OUTPUTFILE
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment