Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
723ad8ae
Commit
723ad8ae
authored
Dec 12, 2000
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More toolbox modules adapted to Universal Headers 3.3.2.
parent
8ed81303
Changes
20
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
2284 additions
and
535 deletions
+2284
-535
Mac/Modules/ctl/Ctlmodule.c
Mac/Modules/ctl/Ctlmodule.c
+57
-0
Mac/Modules/ctl/ctlscan.py
Mac/Modules/ctl/ctlscan.py
+3
-2
Mac/Modules/ctl/ctlsupport.py
Mac/Modules/ctl/ctlsupport.py
+3
-0
Mac/Modules/qd/qdscan.py
Mac/Modules/qd/qdscan.py
+11
-5
Mac/Modules/qd/qdsupport.py
Mac/Modules/qd/qdsupport.py
+44
-0
Mac/Modules/qdoffs/Qdoffsmodule.c
Mac/Modules/qdoffs/Qdoffsmodule.c
+1
-67
Mac/Modules/qt/Qtmodule.c
Mac/Modules/qt/Qtmodule.c
+1212
-44
Mac/Modules/qt/qtscan.py
Mac/Modules/qt/qtscan.py
+9
-0
Mac/Modules/qt/qtsupport.py
Mac/Modules/qt/qtsupport.py
+5
-0
Mac/Modules/res/Resmodule.c
Mac/Modules/res/Resmodule.c
+181
-1
Mac/Modules/res/resscan.py
Mac/Modules/res/resscan.py
+7
-0
Mac/Modules/res/ressupport.py
Mac/Modules/res/ressupport.py
+2
-0
Mac/Modules/snd/Sndmodule.c
Mac/Modules/snd/Sndmodule.c
+1
-1
Mac/Modules/snd/sndscan.py
Mac/Modules/snd/sndscan.py
+3
-14
Mac/Modules/te/TEmodule.c
Mac/Modules/te/TEmodule.c
+46
-1
Mac/Modules/te/tescan.py
Mac/Modules/te/tescan.py
+11
-1
Mac/Modules/win/Winmodule.c
Mac/Modules/win/Winmodule.c
+555
-298
Mac/Modules/win/winedit.py
Mac/Modules/win/winedit.py
+100
-100
Mac/Modules/win/winscan.py
Mac/Modules/win/winscan.py
+20
-1
Mac/Modules/win/winsupport.py
Mac/Modules/win/winsupport.py
+13
-0
No files found.
Mac/Modules/ctl/Ctlmodule.c
View file @
723ad8ae
...
...
@@ -1184,6 +1184,53 @@ static PyObject *CtlObj_GetControlDataSize(_self, _args)
#if TARGET_API_MAC_CARBON
static
PyObject
*
CtlObj_HandleControlDragTracking
(
_self
,
_args
)
ControlObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
DragTrackingMessage
inMessage
;
DragReference
inDrag
;
Boolean
outLikesDrag
;
if
(
!
PyArg_ParseTuple
(
_args
,
"hO&"
,
&
inMessage
,
DragObj_Convert
,
&
inDrag
))
return
NULL
;
_err
=
HandleControlDragTracking
(
_self
->
ob_itself
,
inMessage
,
inDrag
,
&
outLikesDrag
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"b"
,
outLikesDrag
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
CtlObj_HandleControlDragReceive
(
_self
,
_args
)
ControlObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
DragReference
inDrag
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
DragObj_Convert
,
&
inDrag
))
return
NULL
;
_err
=
HandleControlDragReceive
(
_self
->
ob_itself
,
inDrag
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
CtlObj_SetControlDragTrackingEnabled
(
_self
,
_args
)
ControlObject
*
_self
;
PyObject
*
_args
;
...
...
@@ -2064,6 +2111,16 @@ static PyMethodDef CtlObj_methods[] = {
{
"GetControlDataSize"
,
(
PyCFunction
)
CtlObj_GetControlDataSize
,
1
,
"(ControlPartCode inPart, ResType inTagName) -> (Size outMaxSize)"
},
#if TARGET_API_MAC_CARBON
{
"HandleControlDragTracking"
,
(
PyCFunction
)
CtlObj_HandleControlDragTracking
,
1
,
"(DragTrackingMessage inMessage, DragReference inDrag) -> (Boolean outLikesDrag)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"HandleControlDragReceive"
,
(
PyCFunction
)
CtlObj_HandleControlDragReceive
,
1
,
"(DragReference inDrag) -> None"
},
#endif
#if TARGET_API_MAC_CARBON
{
"SetControlDragTrackingEnabled"
,
(
PyCFunction
)
CtlObj_SetControlDragTrackingEnabled
,
1
,
"(Boolean tracks) -> None"
},
...
...
Mac/Modules/ctl/ctlscan.py
View file @
723ad8ae
...
...
@@ -35,6 +35,7 @@ class MyScanner(Scanner):
self
.
defsfile
.
write
(
"def FOUR_CHAR_CODE(x): return x
\
n
"
)
self
.
defsfile
.
write
(
"from TextEdit import *
\
n
"
)
self
.
defsfile
.
write
(
"from QuickDraw import *
\
n
"
)
self
.
defsfile
.
write
(
"from Dragconst import *
\
n
"
)
self
.
defsfile
.
write
(
"
\
n
"
)
def
makeblacklistnames
(
self
):
...
...
@@ -98,6 +99,8 @@ class MyScanner(Scanner):
(
'#if TARGET_API_MAC_CARBON'
,
[
'IsAutomaticControlDragTrackingEnabledForWindow'
,
'SetAutomaticControlDragTrackingEnabledForWindow'
,
'HandleControlDragReceive'
,
'HandleControlDragTracking'
,
'GetControlByID'
,
'IsControlDragTrackingEnabled'
,
'SetControlDragTrackingEnabled'
,
...
...
@@ -134,8 +137,6 @@ class MyScanner(Scanner):
'ControlDefSpec'
,
# Don't know how to do this yet
'ControlDefSpec_ptr'
,
# ditto
'Collection'
,
# Ditto
'DragTrackingMessage'
,
# Needs Drag module, must implement later
'DragReference'
,
# ditto
]
def
makerepairinstructions
(
self
):
...
...
Mac/Modules/ctl/ctlsupport.py
View file @
723ad8ae
...
...
@@ -45,6 +45,9 @@ ControlFontStyleRec_ptr = ControlFontStyleRec
ControlID
=
OpaqueType
(
'ControlID'
,
'PyControlID'
)
ControlID_ptr
=
ControlID
DragTrackingMessage
=
Type
(
"DragTrackingMessage"
,
"h"
)
DragReference
=
OpaqueByValueType
(
"DragReference"
,
"DragObj"
)
includestuff
=
includestuff
+
"""
#include <%s>"""
%
MACHEADERFILE
+
"""
#ifndef kControlCheckBoxUncheckedValue
...
...
Mac/Modules/qd/qdscan.py
View file @
723ad8ae
...
...
@@ -100,17 +100,24 @@ extend = 0x40
'GetPortHWND'
,
'GetHWNDPort'
,
'GetPICTFromDIB'
,
'GetPortBitMapForCopyBits'
,
# Something funny in the declaration
]
def
makegreylist
(
self
):
return
[
(
'#if !TARGET_API_MAC_CARBON'
,
[
]),
(
'#if TARGET_API_MAC_CARBON'
,
[
])]
def
makeblacklisttypes
(
self
):
return
[
## 'CCrsrHandle',
'CIconHandle'
,
# Obsolete
'CQDProcs'
,
'CQDProcsPtr'
,
'CSpecArray'
,
## 'CTabHandle',
'ColorComplementProcPtr'
,
'ColorComplementUPP'
,
'ColorSearchProcPtr'
,
...
...
@@ -118,14 +125,13 @@ extend = 0x40
'ConstPatternParam'
,
'DeviceLoopDrawingProcPtr'
,
'DeviceLoopFlags'
,
## 'FontInfo',
## 'GDHandle',
'GrafVerb'
,
'OpenCPicParams_ptr'
,
'Ptr'
,
'QDProcs'
,
'ReqListRec'
,
'void_ptr'
,
'CustomXFerProcPtr'
,
]
def
makerepairinstructions
(
self
):
...
...
Mac/Modules/qd/qdsupport.py
View file @
723ad8ae
...
...
@@ -45,9 +45,12 @@ GDHandle = OpaqueByValueType("GDHandle", "ResObj")
CGrafPtr
=
OpaqueByValueType
(
"CGrafPtr"
,
"GrafObj"
)
GrafPtr
=
OpaqueByValueType
(
"GrafPtr"
,
"GrafObj"
)
BitMap_ptr
=
OpaqueByValueType
(
"BitMapPtr"
,
"BMObj"
)
BitMap
=
BitMap_ptr
RGBColor
=
OpaqueType
(
'RGBColor'
,
'QdRGB'
)
RGBColor_ptr
=
RGBColor
FontInfo
=
OpaqueType
(
'FontInfo'
,
'QdFI'
)
Component
=
OpaqueByValueType
(
'Component'
,
'CmpObj'
)
ComponentInstance
=
OpaqueByValueType
(
'ComponentInstance'
,
'CmpInstObj'
)
Cursor_ptr
=
StructInputBufferType
(
'Cursor'
)
Pattern
=
StructOutputBufferType
(
'Pattern'
)
...
...
@@ -58,6 +61,47 @@ PenState_ptr = StructInputBufferType('PenState')
includestuff
=
includestuff
+
"""
#include <%s>"""
%
MACHEADERFILE
+
"""
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
#define GetPortBitMapForCopyBits(port) (((GrafPort)(port))->portBits)
#define GetPortBounds(port, bounds) (*(bounds) = (port)->portRect, (bounds))
#define GetPortForeColor(port, color) (*(color) = (port)->rgbFgColor, (color))
#define GetPortBackColor(port, color) (*(color) = (port)->rgbBkColor, (color))
#define GetPortOpColor(port, color) (*(color) = (*((port)->grafVars))->rgbOpColor, (color))
#define GetPortHiliteColor(port, color) (*(color) = (*((port)->grafVars))->rgbHiliteColor, (color))
#define GetPortTextFont(port) ((port)->txFont)
#define GetPortTextFace(port) ((port)->txFace)
#define GetPortTextMode(port) ((port)->txMode)
#define GetPortTextSize(port) ((port)->txSize)
#define GetPortChExtra(port) ((port)->chExtra)
#define GetPortFracHPenLocation(port) ((port)->pnLocHFrac)
#define GetPortSpExtra(port) ((port)->spExtra)
#define GetPortPenVisibility(port) ((port)->pnVis)
#define GetPortVisibleRegion(port, rgn) ((rgn) = (port)->visRgn, (rgn))
#define GetPortClipRegion(port, rgn) ((rgn) = (port)->clipRgn, (rgn))
#define GetPortBackPixPat(port, pat) ((pat) = (port)->bkPixPat, (pat))
#define GetPortPenPixPat(port, pat) ((pat) = (port)->pnPixPat, (pat))
#define GetPortFillPixPat(port, pat) ((pat) = (port)->fillPixPat, (pat))
#define GetPortPenSize(port, pensize) (*(pensize) = (port)->pnSize, (pensize))
#define GetPortPenMode(port) ((port)->pnMode)
#define GetPortPenLocation(port, location) ((*location) = (port)->pnLoc, (location))
#define IsPortRegionBeingDefined(port) ((port)->rgnSave)
#define IsPortPictureBeingDefined(port) ((port)->picSave)
/* #define IsPortOffscreen(port) */
/* #define IsPortColor(port) */
#define SetPortBounds(port, bounds) ((port)->portRect = *(bounds))
#define SetPortOpColor(port, color) ((*((port)->grafVars))->rgbOpColor = *(color))
#define SetPortVisibleRegion(port, rgn) ((port)->visRgn = (rgn))
#define SetPortClipRegion(port, rgn) ((port)->clipRgn = (rgn))
#define SetPortBackPixPat(port, pat) ((port)->bkPixPat = (pat))
#define SetPortPenPixPat(port, pat) ((port)->pnPixPat = (pat))
#define GetPortFillPixPat(port, pat) ((port)->fillPixPat = (pat))
#define SetPortPenSize(port, pensize) ((port)->pnSize = (pensize))
#define SetPortPenMode(port, mode) ((port)->pnMode = (mode))
#define SetPortFracHPenLocation(port, frac) ((port)->pnLocHFrac = (frac))
#endif
/*
** Parse/generate RGB records
*/
...
...
Mac/Modules/qdoffs/Qdoffsmodule.c
View file @
723ad8ae
...
...
@@ -147,37 +147,6 @@ PyTypeObject GWorld_Type = {
/* --------------------- End object type GWorld --------------------- */
static
PyObject
*
Qdoffs_NewGWorld
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
QDErr
_err
;
GWorldPtr
offscreenGWorld
;
short
PixelDepth
;
Rect
boundsRect
;
CTabHandle
cTable
;
GDHandle
aGDevice
;
GWorldFlags
flags
;
if
(
!
PyArg_ParseTuple
(
_args
,
"hO&O&O&l"
,
&
PixelDepth
,
PyMac_GetRect
,
&
boundsRect
,
OptResObj_Convert
,
&
cTable
,
OptResObj_Convert
,
&
aGDevice
,
&
flags
))
return
NULL
;
_err
=
NewGWorld
(
&
offscreenGWorld
,
PixelDepth
,
&
boundsRect
,
cTable
,
aGDevice
,
flags
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"O&"
,
GWorldObj_New
,
offscreenGWorld
);
return
_res
;
}
static
PyObject
*
Qdoffs_LockPixels
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
...
...
@@ -209,37 +178,6 @@ static PyObject *Qdoffs_UnlockPixels(_self, _args)
return
_res
;
}
static
PyObject
*
Qdoffs_UpdateGWorld
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
GWorldFlags
_rv
;
GWorldPtr
offscreenGWorld
;
short
pixelDepth
;
Rect
boundsRect
;
CTabHandle
cTable
;
GDHandle
aGDevice
;
GWorldFlags
flags
;
if
(
!
PyArg_ParseTuple
(
_args
,
"hO&O&O&l"
,
&
pixelDepth
,
PyMac_GetRect
,
&
boundsRect
,
OptResObj_Convert
,
&
cTable
,
OptResObj_Convert
,
&
aGDevice
,
&
flags
))
return
NULL
;
_rv
=
UpdateGWorld
(
&
offscreenGWorld
,
pixelDepth
,
&
boundsRect
,
cTable
,
aGDevice
,
flags
);
_res
=
Py_BuildValue
(
"lO&"
,
_rv
,
GWorldObj_New
,
offscreenGWorld
);
return
_res
;
}
static
PyObject
*
Qdoffs_GetGWorld
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
...
...
@@ -563,14 +501,10 @@ static PyObject *Qdoffs_PutPixMapBytes(_self, _args)
}
static
PyMethodDef
Qdoffs_methods
[]
=
{
{
"NewGWorld"
,
(
PyCFunction
)
Qdoffs_NewGWorld
,
1
,
"(short PixelDepth, Rect boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags) -> (GWorldPtr offscreenGWorld)"
},
{
"LockPixels"
,
(
PyCFunction
)
Qdoffs_LockPixels
,
1
,
"(PixMapHandle pm) -> (Boolean _rv)"
},
{
"UnlockPixels"
,
(
PyCFunction
)
Qdoffs_UnlockPixels
,
1
,
"(PixMapHandle pm) -> None"
},
{
"UpdateGWorld"
,
(
PyCFunction
)
Qdoffs_UpdateGWorld
,
1
,
"(short pixelDepth, Rect boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags) -> (GWorldFlags _rv, GWorldPtr offscreenGWorld)"
},
{
"GetGWorld"
,
(
PyCFunction
)
Qdoffs_GetGWorld
,
1
,
"() -> (CGrafPtr port, GDHandle gdh)"
},
{
"SetGWorld"
,
(
PyCFunction
)
Qdoffs_SetGWorld
,
1
,
...
...
@@ -628,7 +562,7 @@ void initQdoffs()
Qdoffs_Error
=
PyMac_GetOSErrException
();
if
(
Qdoffs_Error
==
NULL
||
PyDict_SetItemString
(
d
,
"Error"
,
Qdoffs_Error
)
!=
0
)
Py_FatalError
(
"can't initialize Qdoffs.Error"
)
;
return
;
GWorld_Type
.
ob_type
=
&
PyType_Type
;
Py_INCREF
(
&
GWorld_Type
);
if
(
PyDict_SetItemString
(
d
,
"GWorldType"
,
(
PyObject
*
)
&
GWorld_Type
)
!=
0
)
...
...
Mac/Modules/qt/Qtmodule.c
View file @
723ad8ae
This diff is collapsed.
Click to expand it.
Mac/Modules/qt/qtscan.py
View file @
723ad8ae
...
...
@@ -97,6 +97,15 @@ class MyScanner(Scanner):
"GetMovieUPP"
,
"ModalFilterUPP"
,
"TrackTransferUPP"
,
"MoviePrePrerollCompleteUPP"
,
"MovieExecuteWiredActionsUPP"
,
"QTBandwidthNotificationUPP"
,
"DoMCActionUPP"
,
"SampleReference64Ptr"
,
# Don't know what this does, yet
"QTRuntimeSpriteDescPtr"
,
"QTBandwidthReference"
,
"QTScheduledBandwidthReference"
,
"QTAtomContainer"
,
"SpriteWorld"
,
"Sprite"
,
...
...
Mac/Modules/qt/qtsupport.py
View file @
723ad8ae
...
...
@@ -91,6 +91,7 @@ CTabHandle = OpaqueByValueType("CTabHandle", "ResObj")
PixMapHandle
=
OpaqueByValueType
(
"PixMapHandle"
,
"ResObj"
)
SampleDescriptionHandle
=
OpaqueByValueType
(
"SampleDescriptionHandle"
,
"ResObj"
)
ImageDescriptionHandle
=
OpaqueByValueType
(
"ImageDescriptionHandle"
,
"ResObj"
)
TextDescriptionHandle
=
OpaqueByValueType
(
"TextDescriptionHandle"
,
"ResObj"
)
TEHandle
=
OpaqueByValueType
(
"TEHandle"
,
"ResObj"
)
CGrafPtr
=
OpaqueByValueType
(
"CGrafPtr"
,
"GrafObj"
)
GDHandle
=
OpaqueByValueType
(
"GDHandle"
,
"OptResObj"
)
...
...
@@ -127,6 +128,10 @@ mcactionparams = InputOnlyType("void *", "s")
QTParameterDialog
=
Type
(
"QTParameterDialog"
,
"l"
)
QTAtomID
=
Type
(
"QTAtomID"
,
"l"
)
MCInterfaceElement
=
Type
(
"MCInterfaceElement"
,
"l"
)
CodecType
=
OSTypeType
(
"CodecType"
)
GWorldPtr
=
OpaqueByValueType
(
"GWorldPtr"
,
"GWorldObj"
)
QTFloatSingle
=
Type
(
"QTFloatSingle"
,
"f"
)
# Could-not-be-bothered-types (NewMovieFromFile)
dummyshortptr
=
FakeType
(
'(short *)0'
)
dummyStringPtr
=
FakeType
(
'(StringPtr)0'
)
...
...
Mac/Modules/res/Resmodule.c
View file @
723ad8ae
...
...
@@ -1304,6 +1304,159 @@ static PyObject *Res_FSpCreateResFile(_self, _args)
return
_res
;
}
#if TARGET_API_MAC_CARBON
static
PyObject
*
Res_InsertResourceFile
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
OSErr
_rv
;
SInt16
refNum
;
RsrcChainLocation
where
;
if
(
!
PyArg_ParseTuple
(
_args
,
"hh"
,
&
refNum
,
&
where
))
return
NULL
;
_rv
=
InsertResourceFile
(
refNum
,
where
);
{
OSErr
_err
=
ResError
();
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
}
_res
=
Py_BuildValue
(
"h"
,
_rv
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
Res_DetachResourceFile
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
OSErr
_rv
;
SInt16
refNum
;
if
(
!
PyArg_ParseTuple
(
_args
,
"h"
,
&
refNum
))
return
NULL
;
_rv
=
DetachResourceFile
(
refNum
);
{
OSErr
_err
=
ResError
();
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
}
_res
=
Py_BuildValue
(
"h"
,
_rv
);
return
_res
;
}
#endif
static
PyObject
*
Res_FSpResourceFileAlreadyOpen
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
Boolean
_rv
;
FSSpec
resourceFile
;
Boolean
inChain
;
SInt16
refNum
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
PyMac_GetFSSpec
,
&
resourceFile
))
return
NULL
;
_rv
=
FSpResourceFileAlreadyOpen
(
&
resourceFile
,
&
inChain
,
&
refNum
);
{
OSErr
_err
=
ResError
();
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
}
_res
=
Py_BuildValue
(
"bbh"
,
_rv
,
inChain
,
refNum
);
return
_res
;
}
#if TARGET_API_MAC_CARBON
static
PyObject
*
Res_FSpOpenOrphanResFile
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
OSErr
_rv
;
FSSpec
spec
;
SignedByte
permission
;
SInt16
refNum
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&b"
,
PyMac_GetFSSpec
,
&
spec
,
&
permission
))
return
NULL
;
_rv
=
FSpOpenOrphanResFile
(
&
spec
,
permission
,
&
refNum
);
{
OSErr
_err
=
ResError
();
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
}
_res
=
Py_BuildValue
(
"hh"
,
_rv
,
refNum
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
Res_GetTopResourceFile
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
OSErr
_rv
;
SInt16
refNum
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
GetTopResourceFile
(
&
refNum
);
{
OSErr
_err
=
ResError
();
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
}
_res
=
Py_BuildValue
(
"hh"
,
_rv
,
refNum
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
Res_GetNextResourceFile
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
OSErr
_rv
;
SInt16
curRefNum
;
SInt16
nextRefNum
;
if
(
!
PyArg_ParseTuple
(
_args
,
"h"
,
&
curRefNum
))
return
NULL
;
_rv
=
GetNextResourceFile
(
curRefNum
,
&
nextRefNum
);
{
OSErr
_err
=
ResError
();
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
}
_res
=
Py_BuildValue
(
"hh"
,
_rv
,
nextRefNum
);
return
_res
;
}
#endif
static
PyObject
*
Res_Resource
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
...
...
@@ -1437,6 +1590,33 @@ static PyMethodDef Res_methods[] = {
"(FSSpec spec, SignedByte permission) -> (short _rv)"
},
{
"FSpCreateResFile"
,
(
PyCFunction
)
Res_FSpCreateResFile
,
1
,
"(FSSpec spec, OSType creator, OSType fileType, ScriptCode scriptTag) -> None"
},
#if TARGET_API_MAC_CARBON
{
"InsertResourceFile"
,
(
PyCFunction
)
Res_InsertResourceFile
,
1
,
"(SInt16 refNum, RsrcChainLocation where) -> (OSErr _rv)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"DetachResourceFile"
,
(
PyCFunction
)
Res_DetachResourceFile
,
1
,
"(SInt16 refNum) -> (OSErr _rv)"
},
#endif
{
"FSpResourceFileAlreadyOpen"
,
(
PyCFunction
)
Res_FSpResourceFileAlreadyOpen
,
1
,
"(FSSpec resourceFile) -> (Boolean _rv, Boolean inChain, SInt16 refNum)"
},
#if TARGET_API_MAC_CARBON
{
"FSpOpenOrphanResFile"
,
(
PyCFunction
)
Res_FSpOpenOrphanResFile
,
1
,
"(FSSpec spec, SignedByte permission) -> (OSErr _rv, SInt16 refNum)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"GetTopResourceFile"
,
(
PyCFunction
)
Res_GetTopResourceFile
,
1
,
"() -> (OSErr _rv, SInt16 refNum)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"GetNextResourceFile"
,
(
PyCFunction
)
Res_GetNextResourceFile
,
1
,
"(SInt16 curRefNum) -> (OSErr _rv, SInt16 nextRefNum)"
},
#endif
{
"Resource"
,
(
PyCFunction
)
Res_Resource
,
1
,
"Convert a string to a resource object.
\n\n
The created resource object is actually just a handle,
\n
apply AddResource() to write it to a resource file.
\n
See also the Handle() docstring.
\n
"
},
{
"Handle"
,
(
PyCFunction
)
Res_Handle
,
1
,
...
...
@@ -1499,7 +1679,7 @@ void initRes()
Res_Error
=
PyMac_GetOSErrException
();
if
(
Res_Error
==
NULL
||
PyDict_SetItemString
(
d
,
"Error"
,
Res_Error
)
!=
0
)
Py_FatalError
(
"can't initialize Res.Error"
)
;
return
;
Resource_Type
.
ob_type
=
&
PyType_Type
;
Py_INCREF
(
&
Resource_Type
);
if
(
PyDict_SetItemString
(
d
,
"ResourceType"
,
(
PyObject
*
)
&
Resource_Type
)
!=
0
)
...
...
Mac/Modules/res/resscan.py
View file @
723ad8ae
...
...
@@ -57,6 +57,13 @@ class ResourcesScanner(Scanner):
'RsrcZoneInit'
,
'InitResources'
,
'RsrcMapEntry'
,
]),
(
'#if TARGET_API_MAC_CARBON'
,
[
'GetNextResourceFile'
,
'GetTopResourceFile'
,
'FSpOpenOrphanResFile'
,
'DetachResourceFile'
,
'InsertResourceFile'
,
])]
def
makerepairinstructions
(
self
):
...
...
Mac/Modules/res/ressupport.py
View file @
723ad8ae
...
...
@@ -18,6 +18,8 @@ class ResMixIn:
class
ResFunction
(
ResMixIn
,
FunctionGenerator
):
pass
class
ResMethod
(
ResMixIn
,
MethodGenerator
):
pass
RsrcChainLocation
=
Type
(
"RsrcChainLocation"
,
"h"
)
# includestuff etc. are imported from macsupport
includestuff
=
includestuff
+
"""
...
...
Mac/Modules/snd/Sndmodule.c
View file @
723ad8ae
...
...
@@ -1541,7 +1541,7 @@ void initSnd()
Snd_Error
=
PyMac_GetOSErrException
();
if
(
Snd_Error
==
NULL
||
PyDict_SetItemString
(
d
,
"Error"
,
Snd_Error
)
!=
0
)
Py_FatalError
(
"can't initialize Snd.Error"
)
;
return
;
SndChannel_Type
.
ob_type
=
&
PyType_Type
;
Py_INCREF
(
&
SndChannel_Type
);
if
(
PyDict_SetItemString
(
d
,
"SndChannelType"
,
(
PyObject
*
)
&
SndChannel_Type
)
!=
0
)
...
...
Mac/Modules/snd/sndscan.py
View file @
723ad8ae
...
...
@@ -41,20 +41,9 @@ class SoundScanner(Scanner):
'SndDisposeChannel'
,
# automatic on deallocation
'SndAddModifier'
,
# for internal use only
'SndPlayDoubleBuffer'
,
# very low level routine
# Obsolete:
'StartSound'
,
'StopSound'
,
'SoundDone'
,
# These do not work for cfm68k:
## 'SndGetInfo',
## 'SndSetInfo',
## 'GetCompressionInfo',
## 'GetCompressionName',
## 'GetSoundPreference',
## 'SetSoundPreference',
# And old calls that are no longer supported
'SetSoundVol'
,
'GetSoundVol'
,
# Missing from libraries (UH332)
'SoundManagerSetInfo'
,
'SoundManagerGetInfo'
,
# Constants with funny definitions
'rate48khz'
,
'rate44khz'
,
...
...
Mac/Modules/te/TEmodule.c
View file @
723ad8ae
...
...
@@ -1012,6 +1012,41 @@ static PyObject *TE_TEToScrap(_self, _args)
return
_res
;
}
#if TARGET_API_MAC_CARBON
static
PyObject
*
TE_TEGetScrapHandle
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
Handle
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
TEGetScrapHandle
();
_res
=
Py_BuildValue
(
"O&"
,
ResObj_New
,
_rv
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
TE_TESetScrapHandle
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
Handle
value
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
ResObj_Convert
,
&
value
))
return
NULL
;
TESetScrapHandle
(
value
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
#endif
static
PyObject
*
TE_as_TE
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
...
...
@@ -1045,6 +1080,16 @@ static PyMethodDef TE_methods[] = {
"() -> None"
},
{
"TEToScrap"
,
(
PyCFunction
)
TE_TEToScrap
,
1
,
"() -> None"
},
#if TARGET_API_MAC_CARBON
{
"TEGetScrapHandle"
,
(
PyCFunction
)
TE_TEGetScrapHandle
,
1
,
"() -> (Handle _rv)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"TESetScrapHandle"
,
(
PyCFunction
)
TE_TESetScrapHandle
,
1
,
"(Handle value) -> None"
},
#endif
{
"as_TE"
,
(
PyCFunction
)
TE_as_TE
,
1
,
"(Handle h) -> (TEHandle _rv)"
},
{
NULL
,
NULL
,
0
}
...
...
@@ -1066,7 +1111,7 @@ void initTE()
TE_Error
=
PyMac_GetOSErrException
();
if
(
TE_Error
==
NULL
||
PyDict_SetItemString
(
d
,
"Error"
,
TE_Error
)
!=
0
)
Py_FatalError
(
"can't initialize TE.Error"
)
;
return
;
TE_Type
.
ob_type
=
&
PyType_Type
;
Py_INCREF
(
&
TE_Type
);
if
(
PyDict_SetItemString
(
d
,
"TEType"
,
(
PyObject
*
)
&
TE_Type
)
!=
0
)
...
...
Mac/Modules/te/tescan.py
View file @
723ad8ae
...
...
@@ -42,11 +42,21 @@ class MyScanner(Scanner):
## "TEGetHiliteRgn",
]
def
makegreylist
(
self
):
return
[
(
'#if TARGET_API_MAC_CARBON'
,
[
'TEGetScrapHandle'
,
'TESetScrapHandle'
,
])]
def
makeblacklisttypes
(
self
):
return
[
"TEClickLoopUPP"
,
"UniversalProcPtr"
,
"WordBreakUPP"
"WordBreakUPP"
,
"TEDoTextUPP"
,
"TERecalcUPP"
,
"TEFindWordUPP"
,
]
def
makerepairinstructions
(
self
):
...
...
Mac/Modules/win/Winmodule.c
View file @
723ad8ae
This diff is collapsed.
Click to expand it.
Mac/Modules/win/winedit.py
View file @
723ad8ae
# These are inline-routines/defines, so we do them "by hand"
#
f
=
Method
(
CGrafPtr
,
'GetWindowPort'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'SetPortWindowPort'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
short
,
'GetWindowKind'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'SetWindowKind'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
short
,
'wKind'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
Boolean
,
'IsWindowVisible'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
Boolean
,
'IsWindowHilited'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
Boolean
,
'GetWindowGoAwayFlag'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
Boolean
,
'GetWindowZoomFlag'
,
(
WindowRef
,
'theWindow'
,
InMode
),
condition
=
'#if !TARGET_API_MAC_CARBON'
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'GetWindowStructureRgn'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
RgnHandle
,
'r'
,
InMode
),
condition
=
'#if !TARGET_API_MAC_CARBON'
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'GetWindowContentRgn'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
RgnHandle
,
'r'
,
InMode
),
condition
=
'#if !TARGET_API_MAC_CARBON'
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'GetWindowUpdateRgn'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
RgnHandle
,
'r'
,
InMode
),
condition
=
'#if !TARGET_API_MAC_CARBON'
)
methods
.
append
(
f
)
f
=
Method
(
short
,
'GetWindowTitleWidth'
,
(
WindowRef
,
'theWindow'
,
InMode
),
condition
=
'#if !TARGET_API_MAC_CARBON'
)
methods
.
append
(
f
)
f
=
Method
(
ExistingWindowPtr
,
'GetNextWindow'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'GetWindowStandardState'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
Rect
,
'r'
,
OutMode
),
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'GetWindowUserState'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
Rect
,
'r'
,
OutMode
),
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'SetWindowStandardState'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
Rect
,
'r'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'SetWindowUserState'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
Rect
,
'r'
,
InMode
),
)
methods
.
append
(
f
)
if
0
:
f
=
Method
(
CGrafPtr
,
'GetWindowPort'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'SetPortWindowPort'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
short
,
'GetWindowKind'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'SetWindowKind'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
short
,
'wKind'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
Boolean
,
'IsWindowVisible'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
Boolean
,
'IsWindowHilited'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
Boolean
,
'GetWindowGoAwayFlag'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
Boolean
,
'GetWindowZoomFlag'
,
(
WindowRef
,
'theWindow'
,
InMode
),
condition
=
'#if !TARGET_API_MAC_CARBON'
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'GetWindowStructureRgn'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
RgnHandle
,
'r'
,
InMode
),
condition
=
'#if !TARGET_API_MAC_CARBON'
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'GetWindowContentRgn'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
RgnHandle
,
'r'
,
InMode
),
condition
=
'#if !TARGET_API_MAC_CARBON'
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'GetWindowUpdateRgn'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
RgnHandle
,
'r'
,
InMode
),
condition
=
'#if !TARGET_API_MAC_CARBON'
)
methods
.
append
(
f
)
f
=
Method
(
short
,
'GetWindowTitleWidth'
,
(
WindowRef
,
'theWindow'
,
InMode
),
condition
=
'#if !TARGET_API_MAC_CARBON'
)
methods
.
append
(
f
)
f
=
Method
(
ExistingWindowPtr
,
'GetNextWindow'
,
(
WindowRef
,
'theWindow'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'GetWindowStandardState'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
Rect
,
'r'
,
OutMode
),
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'GetWindowUserState'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
Rect
,
'r'
,
OutMode
),
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'SetWindowStandardState'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
Rect
,
'r'
,
InMode
),
)
methods
.
append
(
f
)
f
=
Method
(
void
,
'SetWindowUserState'
,
(
WindowRef
,
'theWindow'
,
InMode
),
(
Rect
,
'r'
,
InMode
),
)
methods
.
append
(
f
)
# These have Mac prefixed to their name in the 3.1 universal headers,
# so we add the old/real names by hand.
...
...
Mac/Modules/win/winscan.py
View file @
723ad8ae
...
...
@@ -42,8 +42,10 @@ class MyScanner(Scanner):
'GetWindowPropertySize'
,
'RemoveWindowProperty'
,
'MacCloseWindow'
,
'GetWindowList'
,
# Don't know whether this is safe...
# Constants with funny definitions
'kMouseUpOutOfSlop'
,
'kAllWindowClasses'
,
]
def
makegreylist
(
self
):
...
...
@@ -64,14 +66,28 @@ class MyScanner(Scanner):
'InvalRgn'
,
'InvalRect'
,
'IsValidWindowPtr'
,
# I think this is useless for Python, but not sure...
]),
(
'#if TARGET_API_MAC_CARBON'
,
[
'IsWindowUpdatePending'
,
'FindWindowOfClass'
,
'GetFrontWindowOfClass'
,
'ChangeWindowPropertyAttributes'
,
'GetWindowPropertyAttributes'
,
'GetNextWindowOfClass'
,
'ScrollWindowRegion'
,
'ScrollWindowRect'
,
'ChangeWindowAttributes'
,
'ReshapeCustomWindow'
,
])]
def
makeblacklisttypes
(
self
):
return
[
'ProcPtr'
,
'DragGrayRgnUPP'
,
'WindowPaintUPP'
,
'Collection'
,
# For now, to be done later
'DragReference'
,
# Ditto, dragmodule doesn't export it yet.
'WindowDefSpec'
,
# Too difficult for now
'WindowDefSpec_ptr'
,
]
def
makerepairinstructions
(
self
):
...
...
@@ -104,6 +120,9 @@ class MyScanner(Scanner):
[(
"ExistingWindowPtr"
,
"*"
,
"*"
)]),
([(
"WindowRef"
,
"FrontNonFloatingWindow"
,
"ReturnMode"
)],
# Ditto
[(
"ExistingWindowPtr"
,
"*"
,
"*"
)]),
([(
"Rect_ptr"
,
"*"
,
"ReturnMode"
)],
# GetWindowXXXState accessors
[(
"void"
,
"*"
,
"ReturnMode"
)]),
]
if
__name__
==
"__main__"
:
...
...
Mac/Modules/win/winsupport.py
View file @
723ad8ae
...
...
@@ -29,6 +29,8 @@ WindowPeek.passInput = lambda name: "(WindowPeek)(%s)" % name
CGrafPtr
=
OpaqueByValueType
(
"CGrafPtr"
,
"GrafObj"
)
GrafPtr
=
OpaqueByValueType
(
"GrafPtr"
,
"GrafObj"
)
DragReference
=
OpaqueByValueType
(
"DragReference"
,
"DragObj"
)
RgnHandle
=
OpaqueByValueType
(
"RgnHandle"
,
"ResObj"
)
PicHandle
=
OpaqueByValueType
(
"PicHandle"
,
"ResObj"
)
WCTabHandle
=
OpaqueByValueType
(
"WCTabHandle"
,
"ResObj"
)
...
...
@@ -44,11 +46,22 @@ WindowPositionMethod = Type("WindowPositionMethod", "l")
WindowTransitionEffect
=
Type
(
"WindowTransitionEffect"
,
"l"
)
WindowTransitionAction
=
Type
(
"WindowTransitionAction"
,
"l"
)
RGBColor
=
OpaqueType
(
"RGBColor"
,
"QdRGB"
)
RGBColor_ptr
=
RGBColor
ScrollWindowOptions
=
Type
(
"ScrollWindowOptions"
,
"l"
)
WindowPartCode
=
Type
(
"WindowPartCode"
,
"h"
)
PropertyCreator
=
OSTypeType
(
"PropertyCreator"
)
PropertyTag
=
OSTypeType
(
"PropertyTag"
)
includestuff
=
includestuff
+
"""
#include <%s>"""
%
MACHEADERFILE
+
"""
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
#define GetWindowSpareFlag(win) (((CWindowPeek)(win))->spareFlag)
#define GetWindowFromPort(port) ((WindowRef)(port))
#define GetWindowPortBounds(win, rectp) (*(rectp) = ((CWindowPeek)(win))->port.portRect)
#endif
/* Function to dispose a window, with a "normal" calling sequence */
static void
PyMac_AutoDisposeWindow(WindowPtr w)
...
...
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