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
2168e9d6
Commit
2168e9d6
authored
Dec 16, 2001
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapted for Universal Headers 3.4
parent
b519638d
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
1818 additions
and
418 deletions
+1818
-418
Mac/Modules/ae/_AEmodule.c
Mac/Modules/ae/_AEmodule.c
+0
-180
Mac/Modules/app/_Appmodule.c
Mac/Modules/app/_Appmodule.c
+102
-0
Mac/Modules/app/appscan.py
Mac/Modules/app/appscan.py
+5
-0
Mac/Modules/app/appsupport.py
Mac/Modules/app/appsupport.py
+3
-0
Mac/Modules/cf/_CFmodule.c
Mac/Modules/cf/_CFmodule.c
+408
-33
Mac/Modules/cf/cfsupport.py
Mac/Modules/cf/cfsupport.py
+2
-0
Mac/Modules/cm/_Cmmodule.c
Mac/Modules/cm/_Cmmodule.c
+38
-14
Mac/Modules/dlg/_Dlgmodule.c
Mac/Modules/dlg/_Dlgmodule.c
+0
-1
Mac/Modules/dlg/dlgscan.py
Mac/Modules/dlg/dlgscan.py
+8
-3
Mac/Modules/dlg/dlgsupport.py
Mac/Modules/dlg/dlgsupport.py
+0
-15
Mac/Modules/evt/_Evtmodule.c
Mac/Modules/evt/_Evtmodule.c
+150
-14
Mac/Modules/help/_Helpmodule.c
Mac/Modules/help/_Helpmodule.c
+3
-3
Mac/Modules/list/_Listmodule.c
Mac/Modules/list/_Listmodule.c
+3
-3
Mac/Modules/list/listscan.py
Mac/Modules/list/listscan.py
+1
-0
Mac/Modules/list/listsupport.py
Mac/Modules/list/listsupport.py
+1
-0
Mac/Modules/menu/_Menumodule.c
Mac/Modules/menu/_Menumodule.c
+1026
-151
Mac/Modules/menu/menuscan.py
Mac/Modules/menu/menuscan.py
+36
-1
Mac/Modules/menu/menusupport.py
Mac/Modules/menu/menusupport.py
+3
-0
Mac/Modules/te/_TEmodule.c
Mac/Modules/te/_TEmodule.c
+29
-0
No files found.
Mac/Modules/ae/_AEmodule.c
View file @
2168e9d6
...
...
@@ -552,105 +552,6 @@ static PyObject *AEDesc_AEGetDescDataSize(AEDescObject *_self, PyObject *_args)
}
#endif
static
PyObject
*
AEDesc_AESend
(
AEDescObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
AppleEvent
reply
;
AESendMode
sendMode
;
AESendPriority
sendPriority
;
long
timeOutInTicks
;
if
(
!
PyArg_ParseTuple
(
_args
,
"lhl"
,
&
sendMode
,
&
sendPriority
,
&
timeOutInTicks
))
return
NULL
;
_err
=
AESend
(
&
_self
->
ob_itself
,
&
reply
,
sendMode
,
sendPriority
,
timeOutInTicks
,
upp_AEIdleProc
,
(
AEFilterUPP
)
0
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"O&"
,
AEDesc_New
,
&
reply
);
return
_res
;
}
static
PyObject
*
AEDesc_AEResetTimer
(
AEDescObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_err
=
AEResetTimer
(
&
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
AEDesc_AESuspendTheCurrentEvent
(
AEDescObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_err
=
AESuspendTheCurrentEvent
(
&
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
AEDesc_AEResumeTheCurrentEvent
(
AEDescObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
AppleEvent
reply
;
AEEventHandlerUPP
dispatcher__proc__
=
upp_GenericEventHandler
;
PyObject
*
dispatcher
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&O"
,
AEDesc_Convert
,
&
reply
,
&
dispatcher
))
return
NULL
;
_err
=
AEResumeTheCurrentEvent
(
&
_self
->
ob_itself
,
&
reply
,
dispatcher__proc__
,
(
long
)
dispatcher
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
Py_INCREF
(
dispatcher
);
/* XXX leak, but needed */
return
_res
;
}
static
PyObject
*
AEDesc_AEGetTheCurrentEvent
(
AEDescObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_err
=
AEGetTheCurrentEvent
(
&
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
AEDesc_AESetTheCurrentEvent
(
AEDescObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_err
=
AESetTheCurrentEvent
(
&
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
AEDesc_AEResolve
(
AEDescObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
...
...
@@ -715,18 +616,6 @@ static PyMethodDef AEDesc_methods[] = {
{
"AEGetDescDataSize"
,
(
PyCFunction
)
AEDesc_AEGetDescDataSize
,
1
,
"() -> (Size _rv)"
},
#endif
{
"AESend"
,
(
PyCFunction
)
AEDesc_AESend
,
1
,
"(AESendMode sendMode, AESendPriority sendPriority, long timeOutInTicks) -> (AppleEvent reply)"
},
{
"AEResetTimer"
,
(
PyCFunction
)
AEDesc_AEResetTimer
,
1
,
"() -> None"
},
{
"AESuspendTheCurrentEvent"
,
(
PyCFunction
)
AEDesc_AESuspendTheCurrentEvent
,
1
,
"() -> None"
},
{
"AEResumeTheCurrentEvent"
,
(
PyCFunction
)
AEDesc_AEResumeTheCurrentEvent
,
1
,
"(AppleEvent reply, EventHandler dispatcher) -> None"
},
{
"AEGetTheCurrentEvent"
,
(
PyCFunction
)
AEDesc_AEGetTheCurrentEvent
,
1
,
"() -> None"
},
{
"AESetTheCurrentEvent"
,
(
PyCFunction
)
AEDesc_AESetTheCurrentEvent
,
1
,
"() -> None"
},
{
"AEResolve"
,
(
PyCFunction
)
AEDesc_AEResolve
,
1
,
"(short callbackFlags) -> (AEDesc theToken)"
},
{
NULL
,
NULL
,
0
}
...
...
@@ -928,67 +817,6 @@ static PyObject *AE_AEReplaceDescData(PyObject *_self, PyObject *_args)
}
#endif
static
PyObject
*
AE_AEProcessAppleEvent
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
EventRecord
theEventRecord
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
PyMac_GetEventRecord
,
&
theEventRecord
))
return
NULL
;
_err
=
AEProcessAppleEvent
(
&
theEventRecord
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
AE_AEGetInteractionAllowed
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
AEInteractAllowed
level
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_err
=
AEGetInteractionAllowed
(
&
level
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"b"
,
level
);
return
_res
;
}
static
PyObject
*
AE_AESetInteractionAllowed
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
AEInteractAllowed
level
;
if
(
!
PyArg_ParseTuple
(
_args
,
"b"
,
&
level
))
return
NULL
;
_err
=
AESetInteractionAllowed
(
level
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
AE_AEInteractWithUser
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
long
timeOutInTicks
;
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
timeOutInTicks
))
return
NULL
;
_err
=
AEInteractWithUser
(
timeOutInTicks
,
(
NMRecPtr
)
0
,
upp_AEIdleProc
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
AE_AEInstallEventHandler
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
...
...
@@ -1177,14 +1005,6 @@ static PyMethodDef AE_methods[] = {
{
"AEReplaceDescData"
,
(
PyCFunction
)
AE_AEReplaceDescData
,
1
,
"(DescType typeCode, Buffer dataPtr) -> (AEDesc theAEDesc)"
},
#endif
{
"AEProcessAppleEvent"
,
(
PyCFunction
)
AE_AEProcessAppleEvent
,
1
,
"(EventRecord theEventRecord) -> None"
},
{
"AEGetInteractionAllowed"
,
(
PyCFunction
)
AE_AEGetInteractionAllowed
,
1
,
"() -> (AEInteractAllowed level)"
},
{
"AESetInteractionAllowed"
,
(
PyCFunction
)
AE_AESetInteractionAllowed
,
1
,
"(AEInteractAllowed level) -> None"
},
{
"AEInteractWithUser"
,
(
PyCFunction
)
AE_AEInteractWithUser
,
1
,
"(long timeOutInTicks) -> None"
},
{
"AEInstallEventHandler"
,
(
PyCFunction
)
AE_AEInstallEventHandler
,
1
,
"(AEEventClass theAEEventClass, AEEventID theAEEventID, EventHandler handler) -> None"
},
{
"AERemoveEventHandler"
,
(
PyCFunction
)
AE_AERemoveEventHandler
,
1
,
...
...
Mac/Modules/app/_Appmodule.c
View file @
2168e9d6
...
...
@@ -654,6 +654,93 @@ static PyObject *App_UseThemeFont(PyObject *_self, PyObject *_args)
return
_res
;
}
#if TARGET_API_MAC_CARBON
static
PyObject
*
App_TruncateThemeText
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
CFMutableStringRef
inString
;
ThemeFontID
inFontID
;
ThemeDrawState
inState
;
SInt16
inPixelWidthLimit
;
TruncCode
inTruncWhere
;
Boolean
outTruncated
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&Hlhh"
,
CFMutableStringRefObj_Convert
,
&
inString
,
&
inFontID
,
&
inState
,
&
inPixelWidthLimit
,
&
inTruncWhere
))
return
NULL
;
_err
=
TruncateThemeText
(
inString
,
inFontID
,
inState
,
inPixelWidthLimit
,
inTruncWhere
,
&
outTruncated
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"b"
,
outTruncated
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
App_GetThemeTextDimensions
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
CFStringRef
inString
;
ThemeFontID
inFontID
;
ThemeDrawState
inState
;
Boolean
inWrapToWidth
;
Point
ioBounds
;
SInt16
outBaseline
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&Hlb"
,
CFStringRefObj_Convert
,
&
inString
,
&
inFontID
,
&
inState
,
&
inWrapToWidth
))
return
NULL
;
_err
=
GetThemeTextDimensions
(
inString
,
inFontID
,
inState
,
inWrapToWidth
,
&
ioBounds
,
&
outBaseline
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"O&h"
,
PyMac_BuildPoint
,
ioBounds
,
outBaseline
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
App_GetThemeTextShadowOutset
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
ThemeFontID
inFontID
;
ThemeDrawState
inState
;
Rect
outOutset
;
if
(
!
PyArg_ParseTuple
(
_args
,
"Hl"
,
&
inFontID
,
&
inState
))
return
NULL
;
_err
=
GetThemeTextShadowOutset
(
inFontID
,
inState
,
&
outOutset
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"O&"
,
PyMac_BuildRect
,
&
outOutset
);
return
_res
;
}
#endif
static
PyObject
*
App_DrawThemeScrollBarArrows
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
...
...
@@ -1111,6 +1198,21 @@ static PyMethodDef App_methods[] = {
"() -> (ThemeCheckBoxStyle outStyle)"
},
{
"UseThemeFont"
,
(
PyCFunction
)
App_UseThemeFont
,
1
,
"(ThemeFontID inFontID, ScriptCode inScript) -> None"
},
#if TARGET_API_MAC_CARBON
{
"TruncateThemeText"
,
(
PyCFunction
)
App_TruncateThemeText
,
1
,
"(CFMutableStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, SInt16 inPixelWidthLimit, TruncCode inTruncWhere) -> (Boolean outTruncated)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"GetThemeTextDimensions"
,
(
PyCFunction
)
App_GetThemeTextDimensions
,
1
,
"(CFStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, Boolean inWrapToWidth) -> (Point ioBounds, SInt16 outBaseline)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"GetThemeTextShadowOutset"
,
(
PyCFunction
)
App_GetThemeTextShadowOutset
,
1
,
"(ThemeFontID inFontID, ThemeDrawState inState) -> (Rect outOutset)"
},
#endif
{
"DrawThemeScrollBarArrows"
,
(
PyCFunction
)
App_DrawThemeScrollBarArrows
,
1
,
"(Rect bounds, ThemeTrackEnableState enableState, ThemeTrackPressState pressState, Boolean isHoriz) -> (Rect trackBounds)"
},
{
"GetThemeScrollBarTrackRect"
,
(
PyCFunction
)
App_GetThemeScrollBarTrackRect
,
1
,
...
...
Mac/Modules/app/appscan.py
View file @
2168e9d6
...
...
@@ -48,12 +48,16 @@ class MyScanner(Scanner):
"appearanceBadTextColorIndexErr"
,
"appearanceThemeHasNoAccents"
,
"appearanceBadCursorIndexErr"
,
"DrawThemeTextBox"
,
# Funny void* out param
]
def
makegreylist
(
self
):
return
[
(
'#if TARGET_API_MAC_CARBON'
,
[
'GetThemeMetric'
,
'GetThemeTextShadowOutset'
,
'GetThemeTextDimensions'
,
'TruncateThemeText'
,
])]
def
makeblacklisttypes
(
self
):
...
...
@@ -71,6 +75,7 @@ class MyScanner(Scanner):
"ThemeWindowMetrics_ptr"
,
# ditto
"ThemeDrawingState"
,
# This is an opaque pointer, so it should be simple. Later.
"Collection"
,
# No interface to collection mgr yet.
"BytePtr"
,
# Not yet.
]
def
makerepairinstructions
(
self
):
...
...
Mac/Modules/app/appsupport.py
View file @
2168e9d6
...
...
@@ -67,6 +67,9 @@ ThemeDragSoundKind = OSTypeType("ThemeDragSoundKind")
ThemeBackgroundKind
=
Type
(
"ThemeBackgroundKind"
,
"l"
)
ThemeMetric
=
Type
(
"ThemeMetric"
,
"l"
)
RGBColor
=
OpaqueType
(
"RGBColor"
,
"QdRGB"
)
CFStringRef
=
OpaqueByValueType
(
"CFStringRef"
,
"CFStringRefObj"
)
CFMutableStringRef
=
OpaqueByValueType
(
"CFMutableStringRef"
,
"CFMutableStringRefObj"
)
TruncCode
=
Type
(
"TruncCode"
,
"h"
)
includestuff
=
includestuff
+
"""
#ifdef WITHOUT_FRAMEWORKS
...
...
Mac/Modules/cf/_CFmodule.c
View file @
2168e9d6
This diff is collapsed.
Click to expand it.
Mac/Modules/cf/cfsupport.py
View file @
2168e9d6
...
...
@@ -171,6 +171,8 @@ CFOptionFlags = Type("CFOptionFlags", "l")
CFStringEncoding
=
Type
(
"CFStringEncoding"
,
"l"
)
CFComparisonResult
=
Type
(
"CFComparisonResult"
,
"l"
)
# a bit dangerous, it's an enum
CFURLPathStyle
=
Type
(
"CFURLPathStyle"
,
"l"
)
# a bit dangerous, it's an enum
FSRef_ptr
=
OpaqueType
(
"FSRef"
,
"PyMac_BuildFSRef"
,
"PyMac_GetFSRef"
)
FSRef
=
OpaqueByValueType
(
"FSRef"
,
"PyMac_BuildFSRef"
,
"PyMac_GetFSRef"
)
char_ptr
=
stringptr
return_stringptr
=
Type
(
"char *"
,
"s"
)
# ONLY FOR RETURN VALUES!!
...
...
Mac/Modules/cm/_Cmmodule.c
View file @
2168e9d6
...
...
@@ -402,6 +402,40 @@ static PyObject *CmpObj_OpenComponent(ComponentObject *_self, PyObject *_args)
return
_res
;
}
static
PyObject
*
CmpObj_ResolveComponentAlias
(
ComponentObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
Component
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
ResolveComponentAlias
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"O&"
,
CmpObj_New
,
_rv
);
return
_res
;
}
static
PyObject
*
CmpObj_GetComponentPublicIndString
(
ComponentObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
Str255
theString
;
short
strListID
;
short
index
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&hh"
,
PyMac_GetStr255
,
theString
,
&
strListID
,
&
index
))
return
NULL
;
_err
=
GetComponentPublicIndString
(
_self
->
ob_itself
,
theString
,
strListID
,
index
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
CmpObj_GetComponentRefcon
(
ComponentObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
...
...
@@ -483,18 +517,6 @@ static PyObject *CmpObj_GetComponentIndString(ComponentObject *_self, PyObject *
return
_res
;
}
static
PyObject
*
CmpObj_ResolveComponentAlias
(
ComponentObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
Component
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
ResolveComponentAlias
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"O&"
,
CmpObj_New
,
_rv
);
return
_res
;
}
static
PyObject
*
CmpObj_CountComponentInstances
(
ComponentObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
...
...
@@ -573,6 +595,10 @@ static PyMethodDef CmpObj_methods[] = {
"(Handle componentName, Handle componentInfo, Handle componentIcon) -> (ComponentDescription cd)"
},
{
"OpenComponent"
,
(
PyCFunction
)
CmpObj_OpenComponent
,
1
,
"() -> (ComponentInstance _rv)"
},
{
"ResolveComponentAlias"
,
(
PyCFunction
)
CmpObj_ResolveComponentAlias
,
1
,
"() -> (Component _rv)"
},
{
"GetComponentPublicIndString"
,
(
PyCFunction
)
CmpObj_GetComponentPublicIndString
,
1
,
"(Str255 theString, short strListID, short index) -> None"
},
{
"GetComponentRefcon"
,
(
PyCFunction
)
CmpObj_GetComponentRefcon
,
1
,
"() -> (long _rv)"
},
{
"SetComponentRefcon"
,
(
PyCFunction
)
CmpObj_SetComponentRefcon
,
1
,
...
...
@@ -583,8 +609,6 @@ static PyMethodDef CmpObj_methods[] = {
"(OSType resType, short resID) -> (Handle theResource)"
},
{
"GetComponentIndString"
,
(
PyCFunction
)
CmpObj_GetComponentIndString
,
1
,
"(Str255 theString, short strListID, short index) -> None"
},
{
"ResolveComponentAlias"
,
(
PyCFunction
)
CmpObj_ResolveComponentAlias
,
1
,
"() -> (Component _rv)"
},
{
"CountComponentInstances"
,
(
PyCFunction
)
CmpObj_CountComponentInstances
,
1
,
"() -> (long _rv)"
},
{
"SetDefaultComponent"
,
(
PyCFunction
)
CmpObj_SetDefaultComponent
,
1
,
...
...
Mac/Modules/dlg/_Dlgmodule.c
View file @
2168e9d6
...
...
@@ -957,7 +957,6 @@ static PyMethodDef DlgObj_methods[] = {
"() -> None"
},
{
"GetDialogPort"
,
(
PyCFunction
)
DlgObj_GetDialogPort
,
1
,
"() -> (CGrafPtr _rv)"
},
{
NULL
,
NULL
,
0
}
};
...
...
Mac/Modules/dlg/dlgscan.py
View file @
2168e9d6
...
...
@@ -54,17 +54,19 @@ class MyScanner(Scanner):
'SetDialogMovableModal'
,
'GetDialogControlNotificationProc'
,
'SetGrafPortOfDialog'
,
# Funny, and probably not useful
# Can't find these:
'CloseStandardSheet'
,
'RunStandardAlert'
,
]
def
makegreylist
(
self
):
return
[
(
'#if !TARGET_API_MAC_CARBON'
,
[
'SetGrafPortOfDialog'
,
]),
(
'#if TARGET_API_MAC_CARBON'
,
[
'InsertDialogItem'
,
'RemoveDialogItems'
,
'GetParamText'
,
'CloseStandardSheet'
,
'RunStandardAlert'
,
])]
def
makeblacklisttypes
(
self
):
...
...
@@ -72,6 +74,9 @@ class MyScanner(Scanner):
"AlertStdAlertParamPtr"
,
# Too much work, for now
"AlertStdAlertParamRec"
,
# ditto
"AlertStdAlertParamRec_ptr"
,
# ditto
"AlertStdCFStringAlertParamPtr"
,
# ditto
"AlertStdCFStringAlertParamRec"
,
"AlertStdCFStringAlertParamRec_ptr"
,
"QTModelessCallbackProcPtr"
,
]
...
...
Mac/Modules/dlg/dlgsupport.py
View file @
2168e9d6
...
...
@@ -257,21 +257,6 @@ execfile("dlggen.py")
for
f
in
functions
:
module
.
add
(
f
)
for
f
in
methods
:
object
.
add
(
f
)
# Some methods that are currently macro's in C, but will be real routines
# in MacOS 8.
##f = Method(ExistingWindowPtr, 'GetDialogWindow', (DialogRef, 'dialog', InMode))
##object.add(f)
##f = Method(SInt16, 'GetDialogDefaultItem', (DialogRef, 'dialog', InMode))
##object.add(f)
##f = Method(SInt16, 'GetDialogCancelItem', (DialogRef, 'dialog', InMode))
##object.add(f)
##f = Method(SInt16, 'GetDialogKeyboardFocusItem', (DialogRef, 'dialog', InMode))
##object.add(f)
f
=
Method
(
void
,
'SetGrafPortOfDialog'
,
(
DialogRef
,
'dialog'
,
InMode
),
condition
=
'#if !TARGET_API_MAC_CARBON'
)
object
.
add
(
f
)
setuseritembody
=
"""
PyObject *new = NULL;
...
...
Mac/Modules/evt/_Evtmodule.c
View file @
2168e9d6
...
...
@@ -73,18 +73,6 @@ static PyObject *Evt_WaitMouseUp(PyObject *_self, PyObject *_args)
return
_res
;
}
static
PyObject
*
Evt_TickCount
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
UInt32
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
TickCount
();
_res
=
Py_BuildValue
(
"l"
,
_rv
);
return
_res
;
}
static
PyObject
*
Evt_GetCaretTime
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
...
...
@@ -337,6 +325,136 @@ static PyObject *Evt_CheckEventQueueForUserCancel(PyObject *_self, PyObject *_ar
}
#endif
static
PyObject
*
Evt_KeyScript
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
short
code
;
if
(
!
PyArg_ParseTuple
(
_args
,
"h"
,
&
code
))
return
NULL
;
KeyScript
(
code
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
Evt_IsCmdChar
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
Boolean
_rv
;
EventRecord
event
;
short
test
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&h"
,
PyMac_GetEventRecord
,
&
event
,
&
test
))
return
NULL
;
_rv
=
IsCmdChar
(
&
event
,
test
);
_res
=
Py_BuildValue
(
"b"
,
_rv
);
return
_res
;
}
static
PyObject
*
Evt_LMGetKeyThresh
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
SInt16
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
LMGetKeyThresh
();
_res
=
Py_BuildValue
(
"h"
,
_rv
);
return
_res
;
}
static
PyObject
*
Evt_LMSetKeyThresh
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
SInt16
value
;
if
(
!
PyArg_ParseTuple
(
_args
,
"h"
,
&
value
))
return
NULL
;
LMSetKeyThresh
(
value
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
Evt_LMGetKeyRepThresh
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
SInt16
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
LMGetKeyRepThresh
();
_res
=
Py_BuildValue
(
"h"
,
_rv
);
return
_res
;
}
static
PyObject
*
Evt_LMSetKeyRepThresh
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
SInt16
value
;
if
(
!
PyArg_ParseTuple
(
_args
,
"h"
,
&
value
))
return
NULL
;
LMSetKeyRepThresh
(
value
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
Evt_LMGetKbdLast
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
UInt8
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
LMGetKbdLast
();
_res
=
Py_BuildValue
(
"b"
,
_rv
);
return
_res
;
}
static
PyObject
*
Evt_LMSetKbdLast
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
UInt8
value
;
if
(
!
PyArg_ParseTuple
(
_args
,
"b"
,
&
value
))
return
NULL
;
LMSetKbdLast
(
value
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
Evt_LMGetKbdType
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
UInt8
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
LMGetKbdType
();
_res
=
Py_BuildValue
(
"b"
,
_rv
);
return
_res
;
}
static
PyObject
*
Evt_LMSetKbdType
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
UInt8
value
;
if
(
!
PyArg_ParseTuple
(
_args
,
"b"
,
&
value
))
return
NULL
;
LMSetKbdType
(
value
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
Evt_WaitNextEvent
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
...
...
@@ -372,8 +490,6 @@ static PyMethodDef Evt_methods[] = {
"() -> (Boolean _rv)"
},
{
"WaitMouseUp"
,
(
PyCFunction
)
Evt_WaitMouseUp
,
1
,
"() -> (Boolean _rv)"
},
{
"TickCount"
,
(
PyCFunction
)
Evt_TickCount
,
1
,
"() -> (UInt32 _rv)"
},
{
"GetCaretTime"
,
(
PyCFunction
)
Evt_GetCaretTime
,
1
,
"() -> (UInt32 _rv)"
},
{
"GetKeys"
,
(
PyCFunction
)
Evt_GetKeys
,
1
,
...
...
@@ -430,6 +546,26 @@ static PyMethodDef Evt_methods[] = {
{
"CheckEventQueueForUserCancel"
,
(
PyCFunction
)
Evt_CheckEventQueueForUserCancel
,
1
,
"() -> (Boolean _rv)"
},
#endif
{
"KeyScript"
,
(
PyCFunction
)
Evt_KeyScript
,
1
,
"(short code) -> None"
},
{
"IsCmdChar"
,
(
PyCFunction
)
Evt_IsCmdChar
,
1
,
"(EventRecord event, short test) -> (Boolean _rv)"
},
{
"LMGetKeyThresh"
,
(
PyCFunction
)
Evt_LMGetKeyThresh
,
1
,
"() -> (SInt16 _rv)"
},
{
"LMSetKeyThresh"
,
(
PyCFunction
)
Evt_LMSetKeyThresh
,
1
,
"(SInt16 value) -> None"
},
{
"LMGetKeyRepThresh"
,
(
PyCFunction
)
Evt_LMGetKeyRepThresh
,
1
,
"() -> (SInt16 _rv)"
},
{
"LMSetKeyRepThresh"
,
(
PyCFunction
)
Evt_LMSetKeyRepThresh
,
1
,
"(SInt16 value) -> None"
},
{
"LMGetKbdLast"
,
(
PyCFunction
)
Evt_LMGetKbdLast
,
1
,
"() -> (UInt8 _rv)"
},
{
"LMSetKbdLast"
,
(
PyCFunction
)
Evt_LMSetKbdLast
,
1
,
"(UInt8 value) -> None"
},
{
"LMGetKbdType"
,
(
PyCFunction
)
Evt_LMGetKbdType
,
1
,
"() -> (UInt8 _rv)"
},
{
"LMSetKbdType"
,
(
PyCFunction
)
Evt_LMSetKbdType
,
1
,
"(UInt8 value) -> None"
},
{
"WaitNextEvent"
,
(
PyCFunction
)
Evt_WaitNextEvent
,
1
,
"(EventMask eventMask, UInt32 sleep [,RegionHandle]) -> (Boolean _rv, EventRecord theEvent)"
},
{
NULL
,
NULL
,
0
}
...
...
Mac/Modules/help/_Helpmodule.c
View file @
2168e9d6
...
...
@@ -24,7 +24,7 @@ static PyObject *Help_HMGetHelpMenuHandle(PyObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
Menu
Handle
mh
;
Menu
Ref
mh
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_err
=
HMGetHelpMenuHandle
(
&
mh
);
...
...
@@ -239,13 +239,13 @@ static PyObject *Help_HMGetBalloonWindow(PyObject *_self, PyObject *_args)
_err
=
HMGetBalloonWindow
(
&
window
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"O&"
,
WinObj_
WhichWindo
w
,
window
);
WinObj_
Ne
w
,
window
);
return
_res
;
}
static
PyMethodDef
Help_methods
[]
=
{
{
"HMGetHelpMenuHandle"
,
(
PyCFunction
)
Help_HMGetHelpMenuHandle
,
1
,
"() -> (Menu
Handle
mh)"
},
"() -> (Menu
Ref
mh)"
},
{
"HMRemoveBalloon"
,
(
PyCFunction
)
Help_HMRemoveBalloon
,
1
,
"() -> None"
},
{
"HMIsBalloon"
,
(
PyCFunction
)
Help_HMIsBalloon
,
1
,
...
...
Mac/Modules/list/_Listmodule.c
View file @
2168e9d6
...
...
@@ -378,8 +378,8 @@ static PyObject *ListObj_LClick(ListObject *_self, PyObject *_args)
PyObject
*
_res
=
NULL
;
Boolean
_rv
;
Point
pt
;
short
modifiers
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&
h
"
,
EventModifiers
modifiers
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&
H
"
,
PyMac_GetPoint
,
&
pt
,
&
modifiers
))
return
NULL
;
...
...
@@ -580,7 +580,7 @@ static PyMethodDef ListObj_methods[] = {
{
"LCellSize"
,
(
PyCFunction
)
ListObj_LCellSize
,
1
,
"(Point cSize) -> None"
},
{
"LClick"
,
(
PyCFunction
)
ListObj_LClick
,
1
,
"(Point pt,
short
modifiers) -> (Boolean _rv)"
},
"(Point pt,
EventModifiers
modifiers) -> (Boolean _rv)"
},
{
"LAddToCell"
,
(
PyCFunction
)
ListObj_LAddToCell
,
1
,
"(Buffer dataPtr, Point theCell) -> None"
},
{
"LClrCell"
,
(
PyCFunction
)
ListObj_LClrCell
,
1
,
...
...
Mac/Modules/list/listscan.py
View file @
2168e9d6
...
...
@@ -56,6 +56,7 @@ class MyScanner(Scanner):
def
makeblacklisttypes
(
self
):
return
[
"ListClickLoopUPP"
,
# Too difficult for now
"ListDefSpecPtr"
,
# later
]
def
makerepairinstructions
(
self
):
...
...
Mac/Modules/list/listsupport.py
View file @
2168e9d6
...
...
@@ -36,6 +36,7 @@ RgnHandle = OpaqueByValueType("RgnHandle", "ResObj")
DataHandle
=
OpaqueByValueType
(
"DataHandle"
,
"ResObj"
)
Handle
=
OpaqueByValueType
(
"Handle"
,
"ResObj"
)
CGrafPtr
=
OpaqueByValueType
(
"CGrafPtr"
,
"GrafObj"
)
EventModifiers
=
Type
(
"EventModifiers"
,
"H"
)
includestuff
=
includestuff
+
"""
#ifdef WITHOUT_FRAMEWORKS
...
...
Mac/Modules/menu/_Menumodule.c
View file @
2168e9d6
This diff is collapsed.
Click to expand it.
Mac/Modules/menu/menuscan.py
View file @
2168e9d6
...
...
@@ -42,6 +42,7 @@ class MyScanner(Scanner):
"GetMenuCommandProperty"
,
"GetMenuTitle"
,
# Funny arg/returnvalue
"SetMenuTitle"
,
"SetMenuTitleIcon"
,
# void*
]
def
makegreylist
(
self
):
...
...
@@ -83,7 +84,37 @@ class MyScanner(Scanner):
'GetMenuAttributes'
,
'ChangeMenuItemPropertyAttributes'
,
'GetMenuItemPropertyAttributes'
,
'AcquireRootMenu'
,
'UpdateInvalidMenuItems'
,
'InvalidateMenuItems'
,
'IsMenuItemInvalid'
,
'GetMenuCommandMark'
,
'SetMenuCommandMark'
,
'GetMenuType'
,
'SetMenuItemCommandKey'
,
'GetMenuItemCommandKey'
,
'SetMenuItemIndent'
,
'GetMenuItemIndent'
,
'SetMenuItemTextWithCFString'
,
'CopyMenuItemTextAsCFString'
,
'GetMenuItemHierarchicalMenu'
,
'SetMenuItemHierarchicalMenu'
,
'SetRootMenu'
,
'IsMenuBarInvalid'
,
'InvalidateMenuEnabling'
,
'InsertMenuItemTextWithCFString'
,
'AppendMenuItemTextWithCFString'
,
'DeleteMenuItems'
,
'CopyMenuItems'
,
'IsMenuSizeInvalid'
,
'InvalidateMenuSize'
,
'SetMenuTitleWithCFString'
,
'CopyMenuTitleAsCFString'
,
'DuplicateMenu'
,
'ReleaseMenu'
,
'RetainMenu'
,
'GetMenuRetainCount'
,
'IsValidMenu'
,
])]
def
makeblacklisttypes
(
self
):
...
...
@@ -96,6 +127,10 @@ class MyScanner(Scanner):
"MenuDefSpecPtr"
,
# Too difficult for now
"MenuDefSpec_ptr"
,
# ditto
"MenuTrackingData"
,
"void_ptr"
,
# Don't know yet.
"EventRef"
,
# For now, not exported yet.
"MenuItemDataPtr"
,
# Not yet.
"MenuItemDataRec_ptr"
,
]
def
makerepairinstructions
(
self
):
...
...
Mac/Modules/menu/menusupport.py
View file @
2168e9d6
...
...
@@ -28,12 +28,15 @@ Handle = OpaqueByValueType("Handle", "ResObj")
MenuBarHandle
=
OpaqueByValueType
(
"MenuBarHandle"
,
"ResObj"
)
MenuID
=
Type
(
"MenuID"
,
"h"
)
MenuItemIndex
=
Type
(
"MenuItemIndex"
,
"h"
)
MenuItemID
=
Type
(
"MenuItemID"
,
"l"
)
MenuCommand
=
Type
(
"MenuCommand"
,
"l"
)
MenuAttributes
=
Type
(
"MenuAttributes"
,
"l"
)
MenuItemAttributes
=
Type
(
"MenuItemAttributes"
,
"l"
)
unsigned_char
=
Type
(
'unsigned char'
,
'b'
)
FMFontFamily
=
Type
(
"FMFontFamily"
,
"h"
)
FMFontStyle
=
Type
(
"FMFontStyle"
,
"h"
)
CFStringRef
=
OpaqueByValueType
(
"CFStringRef"
,
"CFStringRefObj"
)
UniChar
=
Type
(
"UniChar"
,
"h"
)
includestuff
=
includestuff
+
"""
#ifdef WITHOUT_FRAMEWORKS
...
...
Mac/Modules/te/_TEmodule.c
View file @
2168e9d6
...
...
@@ -960,6 +960,31 @@ static PyObject *TE_TESetScrapHandle(PyObject *_self, PyObject *_args)
}
#endif
static
PyObject
*
TE_LMGetWordRedraw
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
UInt8
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
LMGetWordRedraw
();
_res
=
Py_BuildValue
(
"b"
,
_rv
);
return
_res
;
}
static
PyObject
*
TE_LMSetWordRedraw
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
UInt8
value
;
if
(
!
PyArg_ParseTuple
(
_args
,
"b"
,
&
value
))
return
NULL
;
LMSetWordRedraw
(
value
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
TE_as_TE
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
...
...
@@ -1001,6 +1026,10 @@ static PyMethodDef TE_methods[] = {
{
"TESetScrapHandle"
,
(
PyCFunction
)
TE_TESetScrapHandle
,
1
,
"(Handle value) -> None"
},
#endif
{
"LMGetWordRedraw"
,
(
PyCFunction
)
TE_LMGetWordRedraw
,
1
,
"() -> (UInt8 _rv)"
},
{
"LMSetWordRedraw"
,
(
PyCFunction
)
TE_LMSetWordRedraw
,
1
,
"(UInt8 value) -> None"
},
{
"as_TE"
,
(
PyCFunction
)
TE_as_TE
,
1
,
"(Handle h) -> (TEHandle _rv)"
},
{
NULL
,
NULL
,
0
}
...
...
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