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
Show 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)
...
@@ -552,105 +552,6 @@ static PyObject *AEDesc_AEGetDescDataSize(AEDescObject *_self, PyObject *_args)
}
}
#endif
#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
)
static
PyObject
*
AEDesc_AEResolve
(
AEDescObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
...
@@ -715,18 +616,6 @@ static PyMethodDef AEDesc_methods[] = {
...
@@ -715,18 +616,6 @@ static PyMethodDef AEDesc_methods[] = {
{
"AEGetDescDataSize"
,
(
PyCFunction
)
AEDesc_AEGetDescDataSize
,
1
,
{
"AEGetDescDataSize"
,
(
PyCFunction
)
AEDesc_AEGetDescDataSize
,
1
,
"() -> (Size _rv)"
},
"() -> (Size _rv)"
},
#endif
#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
,
{
"AEResolve"
,
(
PyCFunction
)
AEDesc_AEResolve
,
1
,
"(short callbackFlags) -> (AEDesc theToken)"
},
"(short callbackFlags) -> (AEDesc theToken)"
},
{
NULL
,
NULL
,
0
}
{
NULL
,
NULL
,
0
}
...
@@ -928,67 +817,6 @@ static PyObject *AE_AEReplaceDescData(PyObject *_self, PyObject *_args)
...
@@ -928,67 +817,6 @@ static PyObject *AE_AEReplaceDescData(PyObject *_self, PyObject *_args)
}
}
#endif
#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
)
static
PyObject
*
AE_AEInstallEventHandler
(
PyObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
...
@@ -1177,14 +1005,6 @@ static PyMethodDef AE_methods[] = {
...
@@ -1177,14 +1005,6 @@ static PyMethodDef AE_methods[] = {
{
"AEReplaceDescData"
,
(
PyCFunction
)
AE_AEReplaceDescData
,
1
,
{
"AEReplaceDescData"
,
(
PyCFunction
)
AE_AEReplaceDescData
,
1
,
"(DescType typeCode, Buffer dataPtr) -> (AEDesc theAEDesc)"
},
"(DescType typeCode, Buffer dataPtr) -> (AEDesc theAEDesc)"
},
#endif
#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
,
{
"AEInstallEventHandler"
,
(
PyCFunction
)
AE_AEInstallEventHandler
,
1
,
"(AEEventClass theAEEventClass, AEEventID theAEEventID, EventHandler handler) -> None"
},
"(AEEventClass theAEEventClass, AEEventID theAEEventID, EventHandler handler) -> None"
},
{
"AERemoveEventHandler"
,
(
PyCFunction
)
AE_AERemoveEventHandler
,
1
,
{
"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)
...
@@ -654,6 +654,93 @@ static PyObject *App_UseThemeFont(PyObject *_self, PyObject *_args)
return
_res
;
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
)
static
PyObject
*
App_DrawThemeScrollBarArrows
(
PyObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
...
@@ -1111,6 +1198,21 @@ static PyMethodDef App_methods[] = {
...
@@ -1111,6 +1198,21 @@ static PyMethodDef App_methods[] = {
"() -> (ThemeCheckBoxStyle outStyle)"
},
"() -> (ThemeCheckBoxStyle outStyle)"
},
{
"UseThemeFont"
,
(
PyCFunction
)
App_UseThemeFont
,
1
,
{
"UseThemeFont"
,
(
PyCFunction
)
App_UseThemeFont
,
1
,
"(ThemeFontID inFontID, ScriptCode inScript) -> None"
},
"(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
,
{
"DrawThemeScrollBarArrows"
,
(
PyCFunction
)
App_DrawThemeScrollBarArrows
,
1
,
"(Rect bounds, ThemeTrackEnableState enableState, ThemeTrackPressState pressState, Boolean isHoriz) -> (Rect trackBounds)"
},
"(Rect bounds, ThemeTrackEnableState enableState, ThemeTrackPressState pressState, Boolean isHoriz) -> (Rect trackBounds)"
},
{
"GetThemeScrollBarTrackRect"
,
(
PyCFunction
)
App_GetThemeScrollBarTrackRect
,
1
,
{
"GetThemeScrollBarTrackRect"
,
(
PyCFunction
)
App_GetThemeScrollBarTrackRect
,
1
,
...
...
Mac/Modules/app/appscan.py
View file @
2168e9d6
...
@@ -48,12 +48,16 @@ class MyScanner(Scanner):
...
@@ -48,12 +48,16 @@ class MyScanner(Scanner):
"appearanceBadTextColorIndexErr"
,
"appearanceBadTextColorIndexErr"
,
"appearanceThemeHasNoAccents"
,
"appearanceThemeHasNoAccents"
,
"appearanceBadCursorIndexErr"
,
"appearanceBadCursorIndexErr"
,
"DrawThemeTextBox"
,
# Funny void* out param
]
]
def
makegreylist
(
self
):
def
makegreylist
(
self
):
return
[
return
[
(
'#if TARGET_API_MAC_CARBON'
,
[
(
'#if TARGET_API_MAC_CARBON'
,
[
'GetThemeMetric'
,
'GetThemeMetric'
,
'GetThemeTextShadowOutset'
,
'GetThemeTextDimensions'
,
'TruncateThemeText'
,
])]
])]
def
makeblacklisttypes
(
self
):
def
makeblacklisttypes
(
self
):
...
@@ -71,6 +75,7 @@ class MyScanner(Scanner):
...
@@ -71,6 +75,7 @@ class MyScanner(Scanner):
"ThemeWindowMetrics_ptr"
,
# ditto
"ThemeWindowMetrics_ptr"
,
# ditto
"ThemeDrawingState"
,
# This is an opaque pointer, so it should be simple. Later.
"ThemeDrawingState"
,
# This is an opaque pointer, so it should be simple. Later.
"Collection"
,
# No interface to collection mgr yet.
"Collection"
,
# No interface to collection mgr yet.
"BytePtr"
,
# Not yet.
]
]
def
makerepairinstructions
(
self
):
def
makerepairinstructions
(
self
):
...
...
Mac/Modules/app/appsupport.py
View file @
2168e9d6
...
@@ -67,6 +67,9 @@ ThemeDragSoundKind = OSTypeType("ThemeDragSoundKind")
...
@@ -67,6 +67,9 @@ ThemeDragSoundKind = OSTypeType("ThemeDragSoundKind")
ThemeBackgroundKind
=
Type
(
"ThemeBackgroundKind"
,
"l"
)
ThemeBackgroundKind
=
Type
(
"ThemeBackgroundKind"
,
"l"
)
ThemeMetric
=
Type
(
"ThemeMetric"
,
"l"
)
ThemeMetric
=
Type
(
"ThemeMetric"
,
"l"
)
RGBColor
=
OpaqueType
(
"RGBColor"
,
"QdRGB"
)
RGBColor
=
OpaqueType
(
"RGBColor"
,
"QdRGB"
)
CFStringRef
=
OpaqueByValueType
(
"CFStringRef"
,
"CFStringRefObj"
)
CFMutableStringRef
=
OpaqueByValueType
(
"CFMutableStringRef"
,
"CFMutableStringRefObj"
)
TruncCode
=
Type
(
"TruncCode"
,
"h"
)
includestuff
=
includestuff
+
"""
includestuff
=
includestuff
+
"""
#ifdef WITHOUT_FRAMEWORKS
#ifdef WITHOUT_FRAMEWORKS
...
...
Mac/Modules/cf/_CFmodule.c
View file @
2168e9d6
...
@@ -604,6 +604,26 @@ static PyObject *CFMutableArrayRefObj_CFArrayExchangeValuesAtIndices(CFMutableAr
...
@@ -604,6 +604,26 @@ static PyObject *CFMutableArrayRefObj_CFArrayExchangeValuesAtIndices(CFMutableAr
return
_res
;
return
_res
;
}
}
static
PyObject
*
CFMutableArrayRefObj_CFArrayAppendArray
(
CFMutableArrayRefObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
CFArrayRef
otherArray
;
CFRange
otherRange
;
#ifndef CFArrayAppendArray
PyMac_PRECHECK
(
CFArrayAppendArray
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"O&O&"
,
CFArrayRefObj_Convert
,
&
otherArray
,
CFRange_Convert
,
&
otherRange
))
return
NULL
;
CFArrayAppendArray
(
_self
->
ob_itself
,
otherArray
,
otherRange
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyMethodDef
CFMutableArrayRefObj_methods
[]
=
{
static
PyMethodDef
CFMutableArrayRefObj_methods
[]
=
{
{
"CFArrayRemoveValueAtIndex"
,
(
PyCFunction
)
CFMutableArrayRefObj_CFArrayRemoveValueAtIndex
,
1
,
{
"CFArrayRemoveValueAtIndex"
,
(
PyCFunction
)
CFMutableArrayRefObj_CFArrayRemoveValueAtIndex
,
1
,
"(CFIndex idx) -> None"
},
"(CFIndex idx) -> None"
},
...
@@ -611,6 +631,8 @@ static PyMethodDef CFMutableArrayRefObj_methods[] = {
...
@@ -611,6 +631,8 @@ static PyMethodDef CFMutableArrayRefObj_methods[] = {
"() -> None"
},
"() -> None"
},
{
"CFArrayExchangeValuesAtIndices"
,
(
PyCFunction
)
CFMutableArrayRefObj_CFArrayExchangeValuesAtIndices
,
1
,
{
"CFArrayExchangeValuesAtIndices"
,
(
PyCFunction
)
CFMutableArrayRefObj_CFArrayExchangeValuesAtIndices
,
1
,
"(CFIndex idx1, CFIndex idx2) -> None"
},
"(CFIndex idx1, CFIndex idx2) -> None"
},
{
"CFArrayAppendArray"
,
(
PyCFunction
)
CFMutableArrayRefObj_CFArrayAppendArray
,
1
,
"(CFArrayRef otherArray, CFRange otherRange) -> None"
},
{
NULL
,
NULL
,
0
}
{
NULL
,
NULL
,
0
}
};
};
...
@@ -1468,19 +1490,19 @@ static PyObject *CFStringRefObj_CFStringCompareWithOptions(CFStringRefObject *_s
...
@@ -1468,19 +1490,19 @@ static PyObject *CFStringRefObj_CFStringCompareWithOptions(CFStringRefObject *_s
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
CFComparisonResult
_rv
;
CFComparisonResult
_rv
;
CFStringRef
s
tring2
;
CFStringRef
theS
tring2
;
CFRange
rangeToCompare
;
CFRange
rangeToCompare
;
CFOptionFlags
compareOptions
;
CFOptionFlags
compareOptions
;
#ifndef CFStringCompareWithOptions
#ifndef CFStringCompareWithOptions
PyMac_PRECHECK
(
CFStringCompareWithOptions
);
PyMac_PRECHECK
(
CFStringCompareWithOptions
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"O&O&l"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"O&O&l"
,
CFStringRefObj_Convert
,
&
s
tring2
,
CFStringRefObj_Convert
,
&
theS
tring2
,
CFRange_Convert
,
&
rangeToCompare
,
CFRange_Convert
,
&
rangeToCompare
,
&
compareOptions
))
&
compareOptions
))
return
NULL
;
return
NULL
;
_rv
=
CFStringCompareWithOptions
(
_self
->
ob_itself
,
_rv
=
CFStringCompareWithOptions
(
_self
->
ob_itself
,
s
tring2
,
theS
tring2
,
rangeToCompare
,
rangeToCompare
,
compareOptions
);
compareOptions
);
_res
=
Py_BuildValue
(
"l"
,
_res
=
Py_BuildValue
(
"l"
,
...
@@ -1492,17 +1514,17 @@ static PyObject *CFStringRefObj_CFStringCompare(CFStringRefObject *_self, PyObje
...
@@ -1492,17 +1514,17 @@ static PyObject *CFStringRefObj_CFStringCompare(CFStringRefObject *_self, PyObje
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
CFComparisonResult
_rv
;
CFComparisonResult
_rv
;
CFStringRef
s
tring2
;
CFStringRef
theS
tring2
;
CFOptionFlags
compareOptions
;
CFOptionFlags
compareOptions
;
#ifndef CFStringCompare
#ifndef CFStringCompare
PyMac_PRECHECK
(
CFStringCompare
);
PyMac_PRECHECK
(
CFStringCompare
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"O&l"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"O&l"
,
CFStringRefObj_Convert
,
&
s
tring2
,
CFStringRefObj_Convert
,
&
theS
tring2
,
&
compareOptions
))
&
compareOptions
))
return
NULL
;
return
NULL
;
_rv
=
CFStringCompare
(
_self
->
ob_itself
,
_rv
=
CFStringCompare
(
_self
->
ob_itself
,
s
tring2
,
theS
tring2
,
compareOptions
);
compareOptions
);
_res
=
Py_BuildValue
(
"l"
,
_res
=
Py_BuildValue
(
"l"
,
_rv
);
_rv
);
...
@@ -1750,6 +1772,28 @@ static PyObject *CFStringRefObj_CFURLCreateWithFileSystemPath(CFStringRefObject
...
@@ -1750,6 +1772,28 @@ static PyObject *CFStringRefObj_CFURLCreateWithFileSystemPath(CFStringRefObject
return
_res
;
return
_res
;
}
}
static
PyObject
*
CFStringRefObj_CFURLCreateWithFileSystemPathRelativeToBase
(
CFStringRefObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
CFURLRef
_rv
;
CFURLPathStyle
pathStyle
;
Boolean
isDirectory
;
CFURLRef
baseURL
;
if
(
!
PyArg_ParseTuple
(
_args
,
"llO&"
,
&
pathStyle
,
&
isDirectory
,
OptionalCFURLRefObj_Convert
,
&
baseURL
))
return
NULL
;
_rv
=
CFURLCreateWithFileSystemPathRelativeToBase
((
CFAllocatorRef
)
NULL
,
_self
->
ob_itself
,
pathStyle
,
isDirectory
,
baseURL
);
_res
=
Py_BuildValue
(
"O&"
,
CFURLRefObj_New
,
_rv
);
return
_res
;
}
static
PyObject
*
CFStringRefObj_CFURLCreateStringByReplacingPercentEscapes
(
CFStringRefObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
CFStringRefObj_CFURLCreateStringByReplacingPercentEscapes
(
CFStringRefObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
...
@@ -1766,6 +1810,28 @@ static PyObject *CFStringRefObj_CFURLCreateStringByReplacingPercentEscapes(CFStr
...
@@ -1766,6 +1810,28 @@ static PyObject *CFStringRefObj_CFURLCreateStringByReplacingPercentEscapes(CFStr
return
_res
;
return
_res
;
}
}
static
PyObject
*
CFStringRefObj_CFURLCreateStringByAddingPercentEscapes
(
CFStringRefObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
CFStringRef
_rv
;
CFStringRef
charactersToLeaveUnescaped
;
CFStringRef
legalURLCharactersToBeEscaped
;
CFStringEncoding
encoding
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&O&l"
,
CFStringRefObj_Convert
,
&
charactersToLeaveUnescaped
,
CFStringRefObj_Convert
,
&
legalURLCharactersToBeEscaped
,
&
encoding
))
return
NULL
;
_rv
=
CFURLCreateStringByAddingPercentEscapes
((
CFAllocatorRef
)
NULL
,
_self
->
ob_itself
,
charactersToLeaveUnescaped
,
legalURLCharactersToBeEscaped
,
encoding
);
_res
=
Py_BuildValue
(
"O&"
,
CFStringRefObj_New
,
_rv
);
return
_res
;
}
static
PyObject
*
CFStringRefObj_CFStringGetString
(
CFStringRefObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
CFStringRefObj_CFStringGetString
(
CFStringRefObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
...
@@ -1819,9 +1885,9 @@ static PyMethodDef CFStringRefObj_methods[] = {
...
@@ -1819,9 +1885,9 @@ static PyMethodDef CFStringRefObj_methods[] = {
{
"CFStringGetFastestEncoding"
,
(
PyCFunction
)
CFStringRefObj_CFStringGetFastestEncoding
,
1
,
{
"CFStringGetFastestEncoding"
,
(
PyCFunction
)
CFStringRefObj_CFStringGetFastestEncoding
,
1
,
"() -> (CFStringEncoding _rv)"
},
"() -> (CFStringEncoding _rv)"
},
{
"CFStringCompareWithOptions"
,
(
PyCFunction
)
CFStringRefObj_CFStringCompareWithOptions
,
1
,
{
"CFStringCompareWithOptions"
,
(
PyCFunction
)
CFStringRefObj_CFStringCompareWithOptions
,
1
,
"(CFStringRef
s
tring2, CFRange rangeToCompare, CFOptionFlags compareOptions) -> (CFComparisonResult _rv)"
},
"(CFStringRef
theS
tring2, CFRange rangeToCompare, CFOptionFlags compareOptions) -> (CFComparisonResult _rv)"
},
{
"CFStringCompare"
,
(
PyCFunction
)
CFStringRefObj_CFStringCompare
,
1
,
{
"CFStringCompare"
,
(
PyCFunction
)
CFStringRefObj_CFStringCompare
,
1
,
"(CFStringRef
s
tring2, CFOptionFlags compareOptions) -> (CFComparisonResult _rv)"
},
"(CFStringRef
theS
tring2, CFOptionFlags compareOptions) -> (CFComparisonResult _rv)"
},
{
"CFStringFindWithOptions"
,
(
PyCFunction
)
CFStringRefObj_CFStringFindWithOptions
,
1
,
{
"CFStringFindWithOptions"
,
(
PyCFunction
)
CFStringRefObj_CFStringFindWithOptions
,
1
,
"(CFStringRef stringToFind, CFRange rangeToSearch, CFOptionFlags searchOptions) -> (Boolean _rv, CFRange result)"
},
"(CFStringRef stringToFind, CFRange rangeToSearch, CFOptionFlags searchOptions) -> (Boolean _rv, CFRange result)"
},
{
"CFStringCreateArrayWithFindResults"
,
(
PyCFunction
)
CFStringRefObj_CFStringCreateArrayWithFindResults
,
1
,
{
"CFStringCreateArrayWithFindResults"
,
(
PyCFunction
)
CFStringRefObj_CFStringCreateArrayWithFindResults
,
1
,
...
@@ -1848,8 +1914,12 @@ static PyMethodDef CFStringRefObj_methods[] = {
...
@@ -1848,8 +1914,12 @@ static PyMethodDef CFStringRefObj_methods[] = {
"(CFURLRef baseURL) -> (CFURLRef _rv)"
},
"(CFURLRef baseURL) -> (CFURLRef _rv)"
},
{
"CFURLCreateWithFileSystemPath"
,
(
PyCFunction
)
CFStringRefObj_CFURLCreateWithFileSystemPath
,
1
,
{
"CFURLCreateWithFileSystemPath"
,
(
PyCFunction
)
CFStringRefObj_CFURLCreateWithFileSystemPath
,
1
,
"(CFURLPathStyle pathStyle, Boolean isDirectory) -> (CFURLRef _rv)"
},
"(CFURLPathStyle pathStyle, Boolean isDirectory) -> (CFURLRef _rv)"
},
{
"CFURLCreateWithFileSystemPathRelativeToBase"
,
(
PyCFunction
)
CFStringRefObj_CFURLCreateWithFileSystemPathRelativeToBase
,
1
,
"(CFURLPathStyle pathStyle, Boolean isDirectory, CFURLRef baseURL) -> (CFURLRef _rv)"
},
{
"CFURLCreateStringByReplacingPercentEscapes"
,
(
PyCFunction
)
CFStringRefObj_CFURLCreateStringByReplacingPercentEscapes
,
1
,
{
"CFURLCreateStringByReplacingPercentEscapes"
,
(
PyCFunction
)
CFStringRefObj_CFURLCreateStringByReplacingPercentEscapes
,
1
,
"(CFStringRef charactersToLeaveEscaped) -> (CFStringRef _rv)"
},
"(CFStringRef charactersToLeaveEscaped) -> (CFStringRef _rv)"
},
{
"CFURLCreateStringByAddingPercentEscapes"
,
(
PyCFunction
)
CFStringRefObj_CFURLCreateStringByAddingPercentEscapes
,
1
,
"(CFStringRef charactersToLeaveUnescaped, CFStringRef legalURLCharactersToBeEscaped, CFStringEncoding encoding) -> (CFStringRef _rv)"
},
{
"CFStringGetString"
,
(
PyCFunction
)
CFStringRefObj_CFStringGetString
,
1
,
{
"CFStringGetString"
,
(
PyCFunction
)
CFStringRefObj_CFStringGetString
,
1
,
"() -> (string _rv)"
},
"() -> (string _rv)"
},
{
"CFStringGetUnicode"
,
(
PyCFunction
)
CFStringRefObj_CFStringGetUnicode
,
1
,
{
"CFStringGetUnicode"
,
(
PyCFunction
)
CFStringRefObj_CFStringGetUnicode
,
1
,
...
@@ -1975,13 +2045,13 @@ static PyObject *CFMutableStringRefObj_CFStringAppend(CFMutableStringRefObject *
...
@@ -1975,13 +2045,13 @@ static PyObject *CFMutableStringRefObj_CFStringAppend(CFMutableStringRefObject *
static
PyObject
*
CFMutableStringRefObj_CFStringAppendPascalString
(
CFMutableStringRefObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
CFMutableStringRefObj_CFStringAppendPascalString
(
CFMutableStringRefObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
Str
ingPtr
pStr
;
Str
255
pStr
;
CFStringEncoding
encoding
;
CFStringEncoding
encoding
;
#ifndef CFStringAppendPascalString
#ifndef CFStringAppendPascalString
PyMac_PRECHECK
(
CFStringAppendPascalString
);
PyMac_PRECHECK
(
CFStringAppendPascalString
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"O&l"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"O&l"
,
PyMac_GetStr255
,
&
pStr
,
PyMac_GetStr255
,
pStr
,
&
encoding
))
&
encoding
))
return
NULL
;
return
NULL
;
CFStringAppendPascalString
(
_self
->
ob_itself
,
CFStringAppendPascalString
(
_self
->
ob_itself
,
...
@@ -2144,7 +2214,7 @@ static PyMethodDef CFMutableStringRefObj_methods[] = {
...
@@ -2144,7 +2214,7 @@ static PyMethodDef CFMutableStringRefObj_methods[] = {
{
"CFStringAppend"
,
(
PyCFunction
)
CFMutableStringRefObj_CFStringAppend
,
1
,
{
"CFStringAppend"
,
(
PyCFunction
)
CFMutableStringRefObj_CFStringAppend
,
1
,
"(CFStringRef appendedString) -> None"
},
"(CFStringRef appendedString) -> None"
},
{
"CFStringAppendPascalString"
,
(
PyCFunction
)
CFMutableStringRefObj_CFStringAppendPascalString
,
1
,
{
"CFStringAppendPascalString"
,
(
PyCFunction
)
CFMutableStringRefObj_CFStringAppendPascalString
,
1
,
"(Str
ingPtr
pStr, CFStringEncoding encoding) -> None"
},
"(Str
255
pStr, CFStringEncoding encoding) -> None"
},
{
"CFStringAppendCString"
,
(
PyCFunction
)
CFMutableStringRefObj_CFStringAppendCString
,
1
,
{
"CFStringAppendCString"
,
(
PyCFunction
)
CFMutableStringRefObj_CFStringAppendCString
,
1
,
"(char* cStr, CFStringEncoding encoding) -> None"
},
"(char* cStr, CFStringEncoding encoding) -> None"
},
{
"CFStringInsert"
,
(
PyCFunction
)
CFMutableStringRefObj_CFStringInsert
,
1
,
{
"CFStringInsert"
,
(
PyCFunction
)
CFMutableStringRefObj_CFStringInsert
,
1
,
...
@@ -2281,6 +2351,30 @@ static PyObject *CFURLRefObj_CFURLCreateData(CFURLRefObject *_self, PyObject *_a
...
@@ -2281,6 +2351,30 @@ static PyObject *CFURLRefObj_CFURLCreateData(CFURLRefObject *_self, PyObject *_a
return
_res
;
return
_res
;
}
}
static
PyObject
*
CFURLRefObj_CFURLGetFileSystemRepresentation
(
CFURLRefObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
Boolean
_rv
;
Boolean
resolveAgainstBase
;
UInt8
buffer
;
CFIndex
maxBufLen
;
#ifndef CFURLGetFileSystemRepresentation
PyMac_PRECHECK
(
CFURLGetFileSystemRepresentation
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"ll"
,
&
resolveAgainstBase
,
&
maxBufLen
))
return
NULL
;
_rv
=
CFURLGetFileSystemRepresentation
(
_self
->
ob_itself
,
resolveAgainstBase
,
&
buffer
,
maxBufLen
);
_res
=
Py_BuildValue
(
"lb"
,
_rv
,
buffer
);
return
_res
;
}
static
PyObject
*
CFURLRefObj_CFURLCopyAbsoluteURL
(
CFURLRefObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
CFURLRefObj_CFURLCopyAbsoluteURL
(
CFURLRefObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
...
@@ -2386,6 +2480,42 @@ static PyObject *CFURLRefObj_CFURLCopyPath(CFURLRefObject *_self, PyObject *_arg
...
@@ -2386,6 +2480,42 @@ static PyObject *CFURLRefObj_CFURLCopyPath(CFURLRefObject *_self, PyObject *_arg
return
_res
;
return
_res
;
}
}
static
PyObject
*
CFURLRefObj_CFURLCopyStrictPath
(
CFURLRefObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
CFStringRef
_rv
;
Boolean
isAbsolute
;
#ifndef CFURLCopyStrictPath
PyMac_PRECHECK
(
CFURLCopyStrictPath
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
CFURLCopyStrictPath
(
_self
->
ob_itself
,
&
isAbsolute
);
_res
=
Py_BuildValue
(
"O&l"
,
CFStringRefObj_New
,
_rv
,
isAbsolute
);
return
_res
;
}
static
PyObject
*
CFURLRefObj_CFURLCopyFileSystemPath
(
CFURLRefObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
CFStringRef
_rv
;
CFURLPathStyle
pathStyle
;
#ifndef CFURLCopyFileSystemPath
PyMac_PRECHECK
(
CFURLCopyFileSystemPath
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
pathStyle
))
return
NULL
;
_rv
=
CFURLCopyFileSystemPath
(
_self
->
ob_itself
,
pathStyle
);
_res
=
Py_BuildValue
(
"O&"
,
CFStringRefObj_New
,
_rv
);
return
_res
;
}
static
PyObject
*
CFURLRefObj_CFURLHasDirectoryPath
(
CFURLRefObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
CFURLRefObj_CFURLHasDirectoryPath
(
CFURLRefObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
...
@@ -2530,9 +2660,120 @@ static PyObject *CFURLRefObj_CFURLCopyFragment(CFURLRefObject *_self, PyObject *
...
@@ -2530,9 +2660,120 @@ static PyObject *CFURLRefObj_CFURLCopyFragment(CFURLRefObject *_self, PyObject *
return
_res
;
return
_res
;
}
}
static
PyObject
*
CFURLRefObj_CFURLCopyLastPathComponent
(
CFURLRefObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
CFStringRef
_rv
;
#ifndef CFURLCopyLastPathComponent
PyMac_PRECHECK
(
CFURLCopyLastPathComponent
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
CFURLCopyLastPathComponent
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"O&"
,
CFStringRefObj_New
,
_rv
);
return
_res
;
}
static
PyObject
*
CFURLRefObj_CFURLCopyPathExtension
(
CFURLRefObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
CFStringRef
_rv
;
#ifndef CFURLCopyPathExtension
PyMac_PRECHECK
(
CFURLCopyPathExtension
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
CFURLCopyPathExtension
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"O&"
,
CFStringRefObj_New
,
_rv
);
return
_res
;
}
static
PyObject
*
CFURLRefObj_CFURLCreateCopyAppendingPathComponent
(
CFURLRefObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
CFURLRef
_rv
;
CFStringRef
pathComponent
;
Boolean
isDirectory
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&l"
,
CFStringRefObj_Convert
,
&
pathComponent
,
&
isDirectory
))
return
NULL
;
_rv
=
CFURLCreateCopyAppendingPathComponent
((
CFAllocatorRef
)
NULL
,
_self
->
ob_itself
,
pathComponent
,
isDirectory
);
_res
=
Py_BuildValue
(
"O&"
,
CFURLRefObj_New
,
_rv
);
return
_res
;
}
static
PyObject
*
CFURLRefObj_CFURLCreateCopyDeletingLastPathComponent
(
CFURLRefObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
CFURLRef
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
CFURLCreateCopyDeletingLastPathComponent
((
CFAllocatorRef
)
NULL
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"O&"
,
CFURLRefObj_New
,
_rv
);
return
_res
;
}
static
PyObject
*
CFURLRefObj_CFURLCreateCopyAppendingPathExtension
(
CFURLRefObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
CFURLRef
_rv
;
CFStringRef
extension
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
CFStringRefObj_Convert
,
&
extension
))
return
NULL
;
_rv
=
CFURLCreateCopyAppendingPathExtension
((
CFAllocatorRef
)
NULL
,
_self
->
ob_itself
,
extension
);
_res
=
Py_BuildValue
(
"O&"
,
CFURLRefObj_New
,
_rv
);
return
_res
;
}
static
PyObject
*
CFURLRefObj_CFURLCreateCopyDeletingPathExtension
(
CFURLRefObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
CFURLRef
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
CFURLCreateCopyDeletingPathExtension
((
CFAllocatorRef
)
NULL
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"O&"
,
CFURLRefObj_New
,
_rv
);
return
_res
;
}
static
PyObject
*
CFURLRefObj_CFURLGetFSRef
(
CFURLRefObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
Boolean
_rv
;
FSRef
fsRef
;
#ifndef CFURLGetFSRef
PyMac_PRECHECK
(
CFURLGetFSRef
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
CFURLGetFSRef
(
_self
->
ob_itself
,
&
fsRef
);
_res
=
Py_BuildValue
(
"lO&"
,
_rv
,
PyMac_BuildFSRef
,
fsRef
);
return
_res
;
}
static
PyMethodDef
CFURLRefObj_methods
[]
=
{
static
PyMethodDef
CFURLRefObj_methods
[]
=
{
{
"CFURLCreateData"
,
(
PyCFunction
)
CFURLRefObj_CFURLCreateData
,
1
,
{
"CFURLCreateData"
,
(
PyCFunction
)
CFURLRefObj_CFURLCreateData
,
1
,
"(CFStringEncoding encoding, Boolean escapeWhitespace) -> (CFDataRef _rv)"
},
"(CFStringEncoding encoding, Boolean escapeWhitespace) -> (CFDataRef _rv)"
},
{
"CFURLGetFileSystemRepresentation"
,
(
PyCFunction
)
CFURLRefObj_CFURLGetFileSystemRepresentation
,
1
,
"(Boolean resolveAgainstBase, CFIndex maxBufLen) -> (Boolean _rv, UInt8 buffer)"
},
{
"CFURLCopyAbsoluteURL"
,
(
PyCFunction
)
CFURLRefObj_CFURLCopyAbsoluteURL
,
1
,
{
"CFURLCopyAbsoluteURL"
,
(
PyCFunction
)
CFURLRefObj_CFURLCopyAbsoluteURL
,
1
,
"() -> (CFURLRef _rv)"
},
"() -> (CFURLRef _rv)"
},
{
"CFURLGetString"
,
(
PyCFunction
)
CFURLRefObj_CFURLGetString
,
1
,
{
"CFURLGetString"
,
(
PyCFunction
)
CFURLRefObj_CFURLGetString
,
1
,
...
@@ -2547,6 +2788,10 @@ static PyMethodDef CFURLRefObj_methods[] = {
...
@@ -2547,6 +2788,10 @@ static PyMethodDef CFURLRefObj_methods[] = {
"() -> (CFStringRef _rv)"
},
"() -> (CFStringRef _rv)"
},
{
"CFURLCopyPath"
,
(
PyCFunction
)
CFURLRefObj_CFURLCopyPath
,
1
,
{
"CFURLCopyPath"
,
(
PyCFunction
)
CFURLRefObj_CFURLCopyPath
,
1
,
"() -> (CFStringRef _rv)"
},
"() -> (CFStringRef _rv)"
},
{
"CFURLCopyStrictPath"
,
(
PyCFunction
)
CFURLRefObj_CFURLCopyStrictPath
,
1
,
"() -> (CFStringRef _rv, Boolean isAbsolute)"
},
{
"CFURLCopyFileSystemPath"
,
(
PyCFunction
)
CFURLRefObj_CFURLCopyFileSystemPath
,
1
,
"(CFURLPathStyle pathStyle) -> (CFStringRef _rv)"
},
{
"CFURLHasDirectoryPath"
,
(
PyCFunction
)
CFURLRefObj_CFURLHasDirectoryPath
,
1
,
{
"CFURLHasDirectoryPath"
,
(
PyCFunction
)
CFURLRefObj_CFURLHasDirectoryPath
,
1
,
"() -> (Boolean _rv)"
},
"() -> (Boolean _rv)"
},
{
"CFURLCopyResourceSpecifier"
,
(
PyCFunction
)
CFURLRefObj_CFURLCopyResourceSpecifier
,
1
,
{
"CFURLCopyResourceSpecifier"
,
(
PyCFunction
)
CFURLRefObj_CFURLCopyResourceSpecifier
,
1
,
...
@@ -2565,6 +2810,20 @@ static PyMethodDef CFURLRefObj_methods[] = {
...
@@ -2565,6 +2810,20 @@ static PyMethodDef CFURLRefObj_methods[] = {
"(CFStringRef charactersToLeaveEscaped) -> (CFStringRef _rv)"
},
"(CFStringRef charactersToLeaveEscaped) -> (CFStringRef _rv)"
},
{
"CFURLCopyFragment"
,
(
PyCFunction
)
CFURLRefObj_CFURLCopyFragment
,
1
,
{
"CFURLCopyFragment"
,
(
PyCFunction
)
CFURLRefObj_CFURLCopyFragment
,
1
,
"(CFStringRef charactersToLeaveEscaped) -> (CFStringRef _rv)"
},
"(CFStringRef charactersToLeaveEscaped) -> (CFStringRef _rv)"
},
{
"CFURLCopyLastPathComponent"
,
(
PyCFunction
)
CFURLRefObj_CFURLCopyLastPathComponent
,
1
,
"() -> (CFStringRef _rv)"
},
{
"CFURLCopyPathExtension"
,
(
PyCFunction
)
CFURLRefObj_CFURLCopyPathExtension
,
1
,
"() -> (CFStringRef _rv)"
},
{
"CFURLCreateCopyAppendingPathComponent"
,
(
PyCFunction
)
CFURLRefObj_CFURLCreateCopyAppendingPathComponent
,
1
,
"(CFStringRef pathComponent, Boolean isDirectory) -> (CFURLRef _rv)"
},
{
"CFURLCreateCopyDeletingLastPathComponent"
,
(
PyCFunction
)
CFURLRefObj_CFURLCreateCopyDeletingLastPathComponent
,
1
,
"() -> (CFURLRef _rv)"
},
{
"CFURLCreateCopyAppendingPathExtension"
,
(
PyCFunction
)
CFURLRefObj_CFURLCreateCopyAppendingPathExtension
,
1
,
"(CFStringRef extension) -> (CFURLRef _rv)"
},
{
"CFURLCreateCopyDeletingPathExtension"
,
(
PyCFunction
)
CFURLRefObj_CFURLCreateCopyDeletingPathExtension
,
1
,
"() -> (CFURLRef _rv)"
},
{
"CFURLGetFSRef"
,
(
PyCFunction
)
CFURLRefObj_CFURLGetFSRef
,
1
,
"() -> (Boolean _rv, FSRef fsRef)"
},
{
NULL
,
NULL
,
0
}
{
NULL
,
NULL
,
0
}
};
};
...
@@ -2620,6 +2879,26 @@ PyTypeObject CFURLRef_Type = {
...
@@ -2620,6 +2879,26 @@ PyTypeObject CFURLRef_Type = {
/* -------------------- End object type CFURLRef -------------------- */
/* -------------------- End object type CFURLRef -------------------- */
static
PyObject
*
CF___CFRangeMake
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
CFRange
_rv
;
CFIndex
loc
;
CFIndex
len
;
#ifndef __CFRangeMake
PyMac_PRECHECK
(
__CFRangeMake
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"ll"
,
&
loc
,
&
len
))
return
NULL
;
_rv
=
__CFRangeMake
(
loc
,
len
);
_res
=
Py_BuildValue
(
"O&"
,
CFRange_New
,
_rv
);
return
_res
;
}
static
PyObject
*
CF_CFAllocatorGetTypeID
(
PyObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
CF_CFAllocatorGetTypeID
(
PyObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
...
@@ -2660,14 +2939,14 @@ static PyObject *CF_CFCopyTypeIDDescription(PyObject *_self, PyObject *_args)
...
@@ -2660,14 +2939,14 @@ static PyObject *CF_CFCopyTypeIDDescription(PyObject *_self, PyObject *_args)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
CFStringRef
_rv
;
CFStringRef
_rv
;
CFTypeID
t
heType
;
CFTypeID
t
ype_id
;
#ifndef CFCopyTypeIDDescription
#ifndef CFCopyTypeIDDescription
PyMac_PRECHECK
(
CFCopyTypeIDDescription
);
PyMac_PRECHECK
(
CFCopyTypeIDDescription
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
t
heType
))
&
t
ype_id
))
return
NULL
;
return
NULL
;
_rv
=
CFCopyTypeIDDescription
(
t
heType
);
_rv
=
CFCopyTypeIDDescription
(
t
ype_id
);
_res
=
Py_BuildValue
(
"O&"
,
_res
=
Py_BuildValue
(
"O&"
,
CFStringRefObj_New
,
_rv
);
CFStringRefObj_New
,
_rv
);
return
_res
;
return
_res
;
...
@@ -2712,17 +2991,17 @@ static PyObject *CF_CFArrayCreateMutableCopy(PyObject *_self, PyObject *_args)
...
@@ -2712,17 +2991,17 @@ static PyObject *CF_CFArrayCreateMutableCopy(PyObject *_self, PyObject *_args)
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
CFMutableArrayRef
_rv
;
CFMutableArrayRef
_rv
;
CFIndex
capacity
;
CFIndex
capacity
;
CFArrayRef
src
Array
;
CFArrayRef
the
Array
;
#ifndef CFArrayCreateMutableCopy
#ifndef CFArrayCreateMutableCopy
PyMac_PRECHECK
(
CFArrayCreateMutableCopy
);
PyMac_PRECHECK
(
CFArrayCreateMutableCopy
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"lO&"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"lO&"
,
&
capacity
,
&
capacity
,
CFArrayRefObj_Convert
,
&
src
Array
))
CFArrayRefObj_Convert
,
&
the
Array
))
return
NULL
;
return
NULL
;
_rv
=
CFArrayCreateMutableCopy
((
CFAllocatorRef
)
NULL
,
_rv
=
CFArrayCreateMutableCopy
((
CFAllocatorRef
)
NULL
,
capacity
,
capacity
,
src
Array
);
the
Array
);
_res
=
Py_BuildValue
(
"O&"
,
_res
=
Py_BuildValue
(
"O&"
,
CFMutableArrayRefObj_New
,
_rv
);
CFMutableArrayRefObj_New
,
_rv
);
return
_res
;
return
_res
;
...
@@ -2809,17 +3088,17 @@ static PyObject *CF_CFDataCreateMutableCopy(PyObject *_self, PyObject *_args)
...
@@ -2809,17 +3088,17 @@ static PyObject *CF_CFDataCreateMutableCopy(PyObject *_self, PyObject *_args)
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
CFMutableDataRef
_rv
;
CFMutableDataRef
_rv
;
CFIndex
capacity
;
CFIndex
capacity
;
CFDataRef
d
ata
;
CFDataRef
theD
ata
;
#ifndef CFDataCreateMutableCopy
#ifndef CFDataCreateMutableCopy
PyMac_PRECHECK
(
CFDataCreateMutableCopy
);
PyMac_PRECHECK
(
CFDataCreateMutableCopy
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"lO&"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"lO&"
,
&
capacity
,
&
capacity
,
CFDataRefObj_Convert
,
&
d
ata
))
CFDataRefObj_Convert
,
&
theD
ata
))
return
NULL
;
return
NULL
;
_rv
=
CFDataCreateMutableCopy
((
CFAllocatorRef
)
NULL
,
_rv
=
CFDataCreateMutableCopy
((
CFAllocatorRef
)
NULL
,
capacity
,
capacity
,
d
ata
);
theD
ata
);
_res
=
Py_BuildValue
(
"O&"
,
_res
=
Py_BuildValue
(
"O&"
,
CFMutableDataRefObj_New
,
_rv
);
CFMutableDataRefObj_New
,
_rv
);
return
_res
;
return
_res
;
...
@@ -2865,17 +3144,17 @@ static PyObject *CF_CFDictionaryCreateMutableCopy(PyObject *_self, PyObject *_ar
...
@@ -2865,17 +3144,17 @@ static PyObject *CF_CFDictionaryCreateMutableCopy(PyObject *_self, PyObject *_ar
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
CFMutableDictionaryRef
_rv
;
CFMutableDictionaryRef
_rv
;
CFIndex
capacity
;
CFIndex
capacity
;
CFDictionaryRef
d
ict
;
CFDictionaryRef
theD
ict
;
#ifndef CFDictionaryCreateMutableCopy
#ifndef CFDictionaryCreateMutableCopy
PyMac_PRECHECK
(
CFDictionaryCreateMutableCopy
);
PyMac_PRECHECK
(
CFDictionaryCreateMutableCopy
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"lO&"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"lO&"
,
&
capacity
,
&
capacity
,
CFDictionaryRefObj_Convert
,
&
d
ict
))
CFDictionaryRefObj_Convert
,
&
theD
ict
))
return
NULL
;
return
NULL
;
_rv
=
CFDictionaryCreateMutableCopy
((
CFAllocatorRef
)
NULL
,
_rv
=
CFDictionaryCreateMutableCopy
((
CFAllocatorRef
)
NULL
,
capacity
,
capacity
,
d
ict
);
theD
ict
);
_res
=
Py_BuildValue
(
"O&"
,
_res
=
Py_BuildValue
(
"O&"
,
CFMutableDictionaryRefObj_New
,
_rv
);
CFMutableDictionaryRefObj_New
,
_rv
);
return
_res
;
return
_res
;
...
@@ -2900,13 +3179,13 @@ static PyObject *CF_CFStringCreateWithPascalString(PyObject *_self, PyObject *_a
...
@@ -2900,13 +3179,13 @@ static PyObject *CF_CFStringCreateWithPascalString(PyObject *_self, PyObject *_a
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
CFStringRef
_rv
;
CFStringRef
_rv
;
Str
ingPtr
pStr
;
Str
255
pStr
;
CFStringEncoding
encoding
;
CFStringEncoding
encoding
;
#ifndef CFStringCreateWithPascalString
#ifndef CFStringCreateWithPascalString
PyMac_PRECHECK
(
CFStringCreateWithPascalString
);
PyMac_PRECHECK
(
CFStringCreateWithPascalString
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"O&l"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"O&l"
,
PyMac_GetStr255
,
&
pStr
,
PyMac_GetStr255
,
pStr
,
&
encoding
))
&
encoding
))
return
NULL
;
return
NULL
;
_rv
=
CFStringCreateWithPascalString
((
CFAllocatorRef
)
NULL
,
_rv
=
CFStringCreateWithPascalString
((
CFAllocatorRef
)
NULL
,
...
@@ -2942,13 +3221,13 @@ static PyObject *CF_CFStringCreateWithPascalStringNoCopy(PyObject *_self, PyObje
...
@@ -2942,13 +3221,13 @@ static PyObject *CF_CFStringCreateWithPascalStringNoCopy(PyObject *_self, PyObje
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
CFStringRef
_rv
;
CFStringRef
_rv
;
Str
ingPtr
pStr
;
Str
255
pStr
;
CFStringEncoding
encoding
;
CFStringEncoding
encoding
;
#ifndef CFStringCreateWithPascalStringNoCopy
#ifndef CFStringCreateWithPascalStringNoCopy
PyMac_PRECHECK
(
CFStringCreateWithPascalStringNoCopy
);
PyMac_PRECHECK
(
CFStringCreateWithPascalStringNoCopy
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"O&l"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"O&l"
,
PyMac_GetStr255
,
&
pStr
,
PyMac_GetStr255
,
pStr
,
&
encoding
))
&
encoding
))
return
NULL
;
return
NULL
;
_rv
=
CFStringCreateWithPascalStringNoCopy
((
CFAllocatorRef
)
NULL
,
_rv
=
CFStringCreateWithPascalStringNoCopy
((
CFAllocatorRef
)
NULL
,
...
@@ -3202,6 +3481,23 @@ static PyObject *CF_CFStringConvertEncodingToIANACharSetName(PyObject *_self, Py
...
@@ -3202,6 +3481,23 @@ static PyObject *CF_CFStringConvertEncodingToIANACharSetName(PyObject *_self, Py
return
_res
;
return
_res
;
}
}
static
PyObject
*
CF_CFStringGetMostCompatibleMacStringEncoding
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
CFStringEncoding
_rv
;
CFStringEncoding
encoding
;
#ifndef CFStringGetMostCompatibleMacStringEncoding
PyMac_PRECHECK
(
CFStringGetMostCompatibleMacStringEncoding
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
encoding
))
return
NULL
;
_rv
=
CFStringGetMostCompatibleMacStringEncoding
(
encoding
);
_res
=
Py_BuildValue
(
"l"
,
_rv
);
return
_res
;
}
static
PyObject
*
CF___CFStringMakeConstantString
(
PyObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
CF___CFStringMakeConstantString
(
PyObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
...
@@ -3261,19 +3557,90 @@ static PyObject *CF_CFURLCreateWithBytes(PyObject *_self, PyObject *_args)
...
@@ -3261,19 +3557,90 @@ static PyObject *CF_CFURLCreateWithBytes(PyObject *_self, PyObject *_args)
return
_res
;
return
_res
;
}
}
static
PyObject
*
CF_CFURLCreateFromFileSystemRepresentation
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
CFURLRef
_rv
;
unsigned
char
*
buffer__in__
;
long
buffer__len__
;
int
buffer__in_len__
;
Boolean
isDirectory
;
#ifndef CFURLCreateFromFileSystemRepresentation
PyMac_PRECHECK
(
CFURLCreateFromFileSystemRepresentation
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"s#l"
,
&
buffer__in__
,
&
buffer__in_len__
,
&
isDirectory
))
return
NULL
;
buffer__len__
=
buffer__in_len__
;
_rv
=
CFURLCreateFromFileSystemRepresentation
((
CFAllocatorRef
)
NULL
,
buffer__in__
,
buffer__len__
,
isDirectory
);
_res
=
Py_BuildValue
(
"O&"
,
CFURLRefObj_New
,
_rv
);
return
_res
;
}
static
PyObject
*
CF_CFURLCreateFromFileSystemRepresentationRelativeToBase
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
CFURLRef
_rv
;
unsigned
char
*
buffer__in__
;
long
buffer__len__
;
int
buffer__in_len__
;
Boolean
isDirectory
;
CFURLRef
baseURL
;
#ifndef CFURLCreateFromFileSystemRepresentationRelativeToBase
PyMac_PRECHECK
(
CFURLCreateFromFileSystemRepresentationRelativeToBase
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"s#lO&"
,
&
buffer__in__
,
&
buffer__in_len__
,
&
isDirectory
,
OptionalCFURLRefObj_Convert
,
&
baseURL
))
return
NULL
;
buffer__len__
=
buffer__in_len__
;
_rv
=
CFURLCreateFromFileSystemRepresentationRelativeToBase
((
CFAllocatorRef
)
NULL
,
buffer__in__
,
buffer__len__
,
isDirectory
,
baseURL
);
_res
=
Py_BuildValue
(
"O&"
,
CFURLRefObj_New
,
_rv
);
return
_res
;
}
static
PyObject
*
CF_CFURLCreateFromFSRef
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
CFURLRef
_rv
;
FSRef
fsRef
;
#ifndef CFURLCreateFromFSRef
PyMac_PRECHECK
(
CFURLCreateFromFSRef
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
PyMac_GetFSRef
,
&
fsRef
))
return
NULL
;
_rv
=
CFURLCreateFromFSRef
((
CFAllocatorRef
)
NULL
,
&
fsRef
);
_res
=
Py_BuildValue
(
"O&"
,
CFURLRefObj_New
,
_rv
);
return
_res
;
}
static
PyMethodDef
CF_methods
[]
=
{
static
PyMethodDef
CF_methods
[]
=
{
{
"__CFRangeMake"
,
(
PyCFunction
)
CF___CFRangeMake
,
1
,
"(CFIndex loc, CFIndex len) -> (CFRange _rv)"
},
{
"CFAllocatorGetTypeID"
,
(
PyCFunction
)
CF_CFAllocatorGetTypeID
,
1
,
{
"CFAllocatorGetTypeID"
,
(
PyCFunction
)
CF_CFAllocatorGetTypeID
,
1
,
"() -> (CFTypeID _rv)"
},
"() -> (CFTypeID _rv)"
},
{
"CFAllocatorGetPreferredSizeForSize"
,
(
PyCFunction
)
CF_CFAllocatorGetPreferredSizeForSize
,
1
,
{
"CFAllocatorGetPreferredSizeForSize"
,
(
PyCFunction
)
CF_CFAllocatorGetPreferredSizeForSize
,
1
,
"(CFIndex size, CFOptionFlags hint) -> (CFIndex _rv)"
},
"(CFIndex size, CFOptionFlags hint) -> (CFIndex _rv)"
},
{
"CFCopyTypeIDDescription"
,
(
PyCFunction
)
CF_CFCopyTypeIDDescription
,
1
,
{
"CFCopyTypeIDDescription"
,
(
PyCFunction
)
CF_CFCopyTypeIDDescription
,
1
,
"(CFTypeID t
heType
) -> (CFStringRef _rv)"
},
"(CFTypeID t
ype_id
) -> (CFStringRef _rv)"
},
{
"CFArrayGetTypeID"
,
(
PyCFunction
)
CF_CFArrayGetTypeID
,
1
,
{
"CFArrayGetTypeID"
,
(
PyCFunction
)
CF_CFArrayGetTypeID
,
1
,
"() -> (CFTypeID _rv)"
},
"() -> (CFTypeID _rv)"
},
{
"CFArrayCreateMutable"
,
(
PyCFunction
)
CF_CFArrayCreateMutable
,
1
,
{
"CFArrayCreateMutable"
,
(
PyCFunction
)
CF_CFArrayCreateMutable
,
1
,
"(CFIndex capacity) -> (CFMutableArrayRef _rv)"
},
"(CFIndex capacity) -> (CFMutableArrayRef _rv)"
},
{
"CFArrayCreateMutableCopy"
,
(
PyCFunction
)
CF_CFArrayCreateMutableCopy
,
1
,
{
"CFArrayCreateMutableCopy"
,
(
PyCFunction
)
CF_CFArrayCreateMutableCopy
,
1
,
"(CFIndex capacity, CFArrayRef
src
Array) -> (CFMutableArrayRef _rv)"
},
"(CFIndex capacity, CFArrayRef
the
Array) -> (CFMutableArrayRef _rv)"
},
{
"CFDataGetTypeID"
,
(
PyCFunction
)
CF_CFDataGetTypeID
,
1
,
{
"CFDataGetTypeID"
,
(
PyCFunction
)
CF_CFDataGetTypeID
,
1
,
"() -> (CFTypeID _rv)"
},
"() -> (CFTypeID _rv)"
},
{
"CFDataCreate"
,
(
PyCFunction
)
CF_CFDataCreate
,
1
,
{
"CFDataCreate"
,
(
PyCFunction
)
CF_CFDataCreate
,
1
,
...
@@ -3283,21 +3650,21 @@ static PyMethodDef CF_methods[] = {
...
@@ -3283,21 +3650,21 @@ static PyMethodDef CF_methods[] = {
{
"CFDataCreateMutable"
,
(
PyCFunction
)
CF_CFDataCreateMutable
,
1
,
{
"CFDataCreateMutable"
,
(
PyCFunction
)
CF_CFDataCreateMutable
,
1
,
"(CFIndex capacity) -> (CFMutableDataRef _rv)"
},
"(CFIndex capacity) -> (CFMutableDataRef _rv)"
},
{
"CFDataCreateMutableCopy"
,
(
PyCFunction
)
CF_CFDataCreateMutableCopy
,
1
,
{
"CFDataCreateMutableCopy"
,
(
PyCFunction
)
CF_CFDataCreateMutableCopy
,
1
,
"(CFIndex capacity, CFDataRef
d
ata) -> (CFMutableDataRef _rv)"
},
"(CFIndex capacity, CFDataRef
theD
ata) -> (CFMutableDataRef _rv)"
},
{
"CFDictionaryGetTypeID"
,
(
PyCFunction
)
CF_CFDictionaryGetTypeID
,
1
,
{
"CFDictionaryGetTypeID"
,
(
PyCFunction
)
CF_CFDictionaryGetTypeID
,
1
,
"() -> (CFTypeID _rv)"
},
"() -> (CFTypeID _rv)"
},
{
"CFDictionaryCreateMutable"
,
(
PyCFunction
)
CF_CFDictionaryCreateMutable
,
1
,
{
"CFDictionaryCreateMutable"
,
(
PyCFunction
)
CF_CFDictionaryCreateMutable
,
1
,
"(CFIndex capacity) -> (CFMutableDictionaryRef _rv)"
},
"(CFIndex capacity) -> (CFMutableDictionaryRef _rv)"
},
{
"CFDictionaryCreateMutableCopy"
,
(
PyCFunction
)
CF_CFDictionaryCreateMutableCopy
,
1
,
{
"CFDictionaryCreateMutableCopy"
,
(
PyCFunction
)
CF_CFDictionaryCreateMutableCopy
,
1
,
"(CFIndex capacity, CFDictionaryRef
d
ict) -> (CFMutableDictionaryRef _rv)"
},
"(CFIndex capacity, CFDictionaryRef
theD
ict) -> (CFMutableDictionaryRef _rv)"
},
{
"CFStringGetTypeID"
,
(
PyCFunction
)
CF_CFStringGetTypeID
,
1
,
{
"CFStringGetTypeID"
,
(
PyCFunction
)
CF_CFStringGetTypeID
,
1
,
"() -> (CFTypeID _rv)"
},
"() -> (CFTypeID _rv)"
},
{
"CFStringCreateWithPascalString"
,
(
PyCFunction
)
CF_CFStringCreateWithPascalString
,
1
,
{
"CFStringCreateWithPascalString"
,
(
PyCFunction
)
CF_CFStringCreateWithPascalString
,
1
,
"(Str
ingPtr
pStr, CFStringEncoding encoding) -> (CFStringRef _rv)"
},
"(Str
255
pStr, CFStringEncoding encoding) -> (CFStringRef _rv)"
},
{
"CFStringCreateWithCString"
,
(
PyCFunction
)
CF_CFStringCreateWithCString
,
1
,
{
"CFStringCreateWithCString"
,
(
PyCFunction
)
CF_CFStringCreateWithCString
,
1
,
"(char* cStr, CFStringEncoding encoding) -> (CFStringRef _rv)"
},
"(char* cStr, CFStringEncoding encoding) -> (CFStringRef _rv)"
},
{
"CFStringCreateWithPascalStringNoCopy"
,
(
PyCFunction
)
CF_CFStringCreateWithPascalStringNoCopy
,
1
,
{
"CFStringCreateWithPascalStringNoCopy"
,
(
PyCFunction
)
CF_CFStringCreateWithPascalStringNoCopy
,
1
,
"(Str
ingPtr
pStr, CFStringEncoding encoding) -> (CFStringRef _rv)"
},
"(Str
255
pStr, CFStringEncoding encoding) -> (CFStringRef _rv)"
},
{
"CFStringCreateWithCStringNoCopy"
,
(
PyCFunction
)
CF_CFStringCreateWithCStringNoCopy
,
1
,
{
"CFStringCreateWithCStringNoCopy"
,
(
PyCFunction
)
CF_CFStringCreateWithCStringNoCopy
,
1
,
"(char* cStr, CFStringEncoding encoding) -> (CFStringRef _rv)"
},
"(char* cStr, CFStringEncoding encoding) -> (CFStringRef _rv)"
},
{
"CFStringCreateMutable"
,
(
PyCFunction
)
CF_CFStringCreateMutable
,
1
,
{
"CFStringCreateMutable"
,
(
PyCFunction
)
CF_CFStringCreateMutable
,
1
,
...
@@ -3324,12 +3691,20 @@ static PyMethodDef CF_methods[] = {
...
@@ -3324,12 +3691,20 @@ static PyMethodDef CF_methods[] = {
"(UInt32 codepage) -> (CFStringEncoding _rv)"
},
"(UInt32 codepage) -> (CFStringEncoding _rv)"
},
{
"CFStringConvertEncodingToIANACharSetName"
,
(
PyCFunction
)
CF_CFStringConvertEncodingToIANACharSetName
,
1
,
{
"CFStringConvertEncodingToIANACharSetName"
,
(
PyCFunction
)
CF_CFStringConvertEncodingToIANACharSetName
,
1
,
"(CFStringEncoding encoding) -> (CFStringRef _rv)"
},
"(CFStringEncoding encoding) -> (CFStringRef _rv)"
},
{
"CFStringGetMostCompatibleMacStringEncoding"
,
(
PyCFunction
)
CF_CFStringGetMostCompatibleMacStringEncoding
,
1
,
"(CFStringEncoding encoding) -> (CFStringEncoding _rv)"
},
{
"__CFStringMakeConstantString"
,
(
PyCFunction
)
CF___CFStringMakeConstantString
,
1
,
{
"__CFStringMakeConstantString"
,
(
PyCFunction
)
CF___CFStringMakeConstantString
,
1
,
"(char* cStr) -> (CFStringRef _rv)"
},
"(char* cStr) -> (CFStringRef _rv)"
},
{
"CFURLGetTypeID"
,
(
PyCFunction
)
CF_CFURLGetTypeID
,
1
,
{
"CFURLGetTypeID"
,
(
PyCFunction
)
CF_CFURLGetTypeID
,
1
,
"() -> (CFTypeID _rv)"
},
"() -> (CFTypeID _rv)"
},
{
"CFURLCreateWithBytes"
,
(
PyCFunction
)
CF_CFURLCreateWithBytes
,
1
,
{
"CFURLCreateWithBytes"
,
(
PyCFunction
)
CF_CFURLCreateWithBytes
,
1
,
"(Buffer URLBytes, CFStringEncoding encoding, CFURLRef baseURL) -> (CFURLRef _rv)"
},
"(Buffer URLBytes, CFStringEncoding encoding, CFURLRef baseURL) -> (CFURLRef _rv)"
},
{
"CFURLCreateFromFileSystemRepresentation"
,
(
PyCFunction
)
CF_CFURLCreateFromFileSystemRepresentation
,
1
,
"(Buffer buffer, Boolean isDirectory) -> (CFURLRef _rv)"
},
{
"CFURLCreateFromFileSystemRepresentationRelativeToBase"
,
(
PyCFunction
)
CF_CFURLCreateFromFileSystemRepresentationRelativeToBase
,
1
,
"(Buffer buffer, Boolean isDirectory, CFURLRef baseURL) -> (CFURLRef _rv)"
},
{
"CFURLCreateFromFSRef"
,
(
PyCFunction
)
CF_CFURLCreateFromFSRef
,
1
,
"(FSRef fsRef) -> (CFURLRef _rv)"
},
{
NULL
,
NULL
,
0
}
{
NULL
,
NULL
,
0
}
};
};
...
...
Mac/Modules/cf/cfsupport.py
View file @
2168e9d6
...
@@ -171,6 +171,8 @@ CFOptionFlags = Type("CFOptionFlags", "l")
...
@@ -171,6 +171,8 @@ CFOptionFlags = Type("CFOptionFlags", "l")
CFStringEncoding
=
Type
(
"CFStringEncoding"
,
"l"
)
CFStringEncoding
=
Type
(
"CFStringEncoding"
,
"l"
)
CFComparisonResult
=
Type
(
"CFComparisonResult"
,
"l"
)
# a bit dangerous, it's an enum
CFComparisonResult
=
Type
(
"CFComparisonResult"
,
"l"
)
# a bit dangerous, it's an enum
CFURLPathStyle
=
Type
(
"CFURLPathStyle"
,
"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
char_ptr
=
stringptr
return_stringptr
=
Type
(
"char *"
,
"s"
)
# ONLY FOR RETURN VALUES!!
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)
...
@@ -402,6 +402,40 @@ static PyObject *CmpObj_OpenComponent(ComponentObject *_self, PyObject *_args)
return
_res
;
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
)
static
PyObject
*
CmpObj_GetComponentRefcon
(
ComponentObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
...
@@ -483,18 +517,6 @@ static PyObject *CmpObj_GetComponentIndString(ComponentObject *_self, PyObject *
...
@@ -483,18 +517,6 @@ static PyObject *CmpObj_GetComponentIndString(ComponentObject *_self, PyObject *
return
_res
;
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
)
static
PyObject
*
CmpObj_CountComponentInstances
(
ComponentObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
...
@@ -573,6 +595,10 @@ static PyMethodDef CmpObj_methods[] = {
...
@@ -573,6 +595,10 @@ static PyMethodDef CmpObj_methods[] = {
"(Handle componentName, Handle componentInfo, Handle componentIcon) -> (ComponentDescription cd)"
},
"(Handle componentName, Handle componentInfo, Handle componentIcon) -> (ComponentDescription cd)"
},
{
"OpenComponent"
,
(
PyCFunction
)
CmpObj_OpenComponent
,
1
,
{
"OpenComponent"
,
(
PyCFunction
)
CmpObj_OpenComponent
,
1
,
"() -> (ComponentInstance _rv)"
},
"() -> (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
,
{
"GetComponentRefcon"
,
(
PyCFunction
)
CmpObj_GetComponentRefcon
,
1
,
"() -> (long _rv)"
},
"() -> (long _rv)"
},
{
"SetComponentRefcon"
,
(
PyCFunction
)
CmpObj_SetComponentRefcon
,
1
,
{
"SetComponentRefcon"
,
(
PyCFunction
)
CmpObj_SetComponentRefcon
,
1
,
...
@@ -583,8 +609,6 @@ static PyMethodDef CmpObj_methods[] = {
...
@@ -583,8 +609,6 @@ static PyMethodDef CmpObj_methods[] = {
"(OSType resType, short resID) -> (Handle theResource)"
},
"(OSType resType, short resID) -> (Handle theResource)"
},
{
"GetComponentIndString"
,
(
PyCFunction
)
CmpObj_GetComponentIndString
,
1
,
{
"GetComponentIndString"
,
(
PyCFunction
)
CmpObj_GetComponentIndString
,
1
,
"(Str255 theString, short strListID, short index) -> None"
},
"(Str255 theString, short strListID, short index) -> None"
},
{
"ResolveComponentAlias"
,
(
PyCFunction
)
CmpObj_ResolveComponentAlias
,
1
,
"() -> (Component _rv)"
},
{
"CountComponentInstances"
,
(
PyCFunction
)
CmpObj_CountComponentInstances
,
1
,
{
"CountComponentInstances"
,
(
PyCFunction
)
CmpObj_CountComponentInstances
,
1
,
"() -> (long _rv)"
},
"() -> (long _rv)"
},
{
"SetDefaultComponent"
,
(
PyCFunction
)
CmpObj_SetDefaultComponent
,
1
,
{
"SetDefaultComponent"
,
(
PyCFunction
)
CmpObj_SetDefaultComponent
,
1
,
...
...
Mac/Modules/dlg/_Dlgmodule.c
View file @
2168e9d6
...
@@ -957,7 +957,6 @@ static PyMethodDef DlgObj_methods[] = {
...
@@ -957,7 +957,6 @@ static PyMethodDef DlgObj_methods[] = {
"() -> None"
},
"() -> None"
},
{
"GetDialogPort"
,
(
PyCFunction
)
DlgObj_GetDialogPort
,
1
,
{
"GetDialogPort"
,
(
PyCFunction
)
DlgObj_GetDialogPort
,
1
,
"() -> (CGrafPtr _rv)"
},
"() -> (CGrafPtr _rv)"
},
{
NULL
,
NULL
,
0
}
{
NULL
,
NULL
,
0
}
};
};
...
...
Mac/Modules/dlg/dlgscan.py
View file @
2168e9d6
...
@@ -54,17 +54,19 @@ class MyScanner(Scanner):
...
@@ -54,17 +54,19 @@ class MyScanner(Scanner):
'SetDialogMovableModal'
,
'SetDialogMovableModal'
,
'GetDialogControlNotificationProc'
,
'GetDialogControlNotificationProc'
,
'SetGrafPortOfDialog'
,
# Funny, and probably not useful
'SetGrafPortOfDialog'
,
# Funny, and probably not useful
# Can't find these:
'CloseStandardSheet'
,
'RunStandardAlert'
,
]
]
def
makegreylist
(
self
):
def
makegreylist
(
self
):
return
[
return
[
(
'#if !TARGET_API_MAC_CARBON'
,
[
'SetGrafPortOfDialog'
,
]),
(
'#if TARGET_API_MAC_CARBON'
,
[
(
'#if TARGET_API_MAC_CARBON'
,
[
'InsertDialogItem'
,
'InsertDialogItem'
,
'RemoveDialogItems'
,
'RemoveDialogItems'
,
'GetParamText'
,
'GetParamText'
,
'CloseStandardSheet'
,
'RunStandardAlert'
,
])]
])]
def
makeblacklisttypes
(
self
):
def
makeblacklisttypes
(
self
):
...
@@ -72,6 +74,9 @@ class MyScanner(Scanner):
...
@@ -72,6 +74,9 @@ class MyScanner(Scanner):
"AlertStdAlertParamPtr"
,
# Too much work, for now
"AlertStdAlertParamPtr"
,
# Too much work, for now
"AlertStdAlertParamRec"
,
# ditto
"AlertStdAlertParamRec"
,
# ditto
"AlertStdAlertParamRec_ptr"
,
# ditto
"AlertStdAlertParamRec_ptr"
,
# ditto
"AlertStdCFStringAlertParamPtr"
,
# ditto
"AlertStdCFStringAlertParamRec"
,
"AlertStdCFStringAlertParamRec_ptr"
,
"QTModelessCallbackProcPtr"
,
"QTModelessCallbackProcPtr"
,
]
]
...
...
Mac/Modules/dlg/dlgsupport.py
View file @
2168e9d6
...
@@ -257,21 +257,6 @@ execfile("dlggen.py")
...
@@ -257,21 +257,6 @@ execfile("dlggen.py")
for
f
in
functions
:
module
.
add
(
f
)
for
f
in
functions
:
module
.
add
(
f
)
for
f
in
methods
:
object
.
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
=
"""
setuseritembody
=
"""
PyObject *new = NULL;
PyObject *new = NULL;
...
...
Mac/Modules/evt/_Evtmodule.c
View file @
2168e9d6
...
@@ -73,18 +73,6 @@ static PyObject *Evt_WaitMouseUp(PyObject *_self, PyObject *_args)
...
@@ -73,18 +73,6 @@ static PyObject *Evt_WaitMouseUp(PyObject *_self, PyObject *_args)
return
_res
;
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
)
static
PyObject
*
Evt_GetCaretTime
(
PyObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
...
@@ -337,6 +325,136 @@ static PyObject *Evt_CheckEventQueueForUserCancel(PyObject *_self, PyObject *_ar
...
@@ -337,6 +325,136 @@ static PyObject *Evt_CheckEventQueueForUserCancel(PyObject *_self, PyObject *_ar
}
}
#endif
#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
)
static
PyObject
*
Evt_WaitNextEvent
(
PyObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
...
@@ -372,8 +490,6 @@ static PyMethodDef Evt_methods[] = {
...
@@ -372,8 +490,6 @@ static PyMethodDef Evt_methods[] = {
"() -> (Boolean _rv)"
},
"() -> (Boolean _rv)"
},
{
"WaitMouseUp"
,
(
PyCFunction
)
Evt_WaitMouseUp
,
1
,
{
"WaitMouseUp"
,
(
PyCFunction
)
Evt_WaitMouseUp
,
1
,
"() -> (Boolean _rv)"
},
"() -> (Boolean _rv)"
},
{
"TickCount"
,
(
PyCFunction
)
Evt_TickCount
,
1
,
"() -> (UInt32 _rv)"
},
{
"GetCaretTime"
,
(
PyCFunction
)
Evt_GetCaretTime
,
1
,
{
"GetCaretTime"
,
(
PyCFunction
)
Evt_GetCaretTime
,
1
,
"() -> (UInt32 _rv)"
},
"() -> (UInt32 _rv)"
},
{
"GetKeys"
,
(
PyCFunction
)
Evt_GetKeys
,
1
,
{
"GetKeys"
,
(
PyCFunction
)
Evt_GetKeys
,
1
,
...
@@ -430,6 +546,26 @@ static PyMethodDef Evt_methods[] = {
...
@@ -430,6 +546,26 @@ static PyMethodDef Evt_methods[] = {
{
"CheckEventQueueForUserCancel"
,
(
PyCFunction
)
Evt_CheckEventQueueForUserCancel
,
1
,
{
"CheckEventQueueForUserCancel"
,
(
PyCFunction
)
Evt_CheckEventQueueForUserCancel
,
1
,
"() -> (Boolean _rv)"
},
"() -> (Boolean _rv)"
},
#endif
#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
,
{
"WaitNextEvent"
,
(
PyCFunction
)
Evt_WaitNextEvent
,
1
,
"(EventMask eventMask, UInt32 sleep [,RegionHandle]) -> (Boolean _rv, EventRecord theEvent)"
},
"(EventMask eventMask, UInt32 sleep [,RegionHandle]) -> (Boolean _rv, EventRecord theEvent)"
},
{
NULL
,
NULL
,
0
}
{
NULL
,
NULL
,
0
}
...
...
Mac/Modules/help/_Helpmodule.c
View file @
2168e9d6
...
@@ -24,7 +24,7 @@ static PyObject *Help_HMGetHelpMenuHandle(PyObject *_self, PyObject *_args)
...
@@ -24,7 +24,7 @@ static PyObject *Help_HMGetHelpMenuHandle(PyObject *_self, PyObject *_args)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
OSErr
_err
;
OSErr
_err
;
Menu
Handle
mh
;
Menu
Ref
mh
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
return
NULL
;
_err
=
HMGetHelpMenuHandle
(
&
mh
);
_err
=
HMGetHelpMenuHandle
(
&
mh
);
...
@@ -239,13 +239,13 @@ static PyObject *Help_HMGetBalloonWindow(PyObject *_self, PyObject *_args)
...
@@ -239,13 +239,13 @@ static PyObject *Help_HMGetBalloonWindow(PyObject *_self, PyObject *_args)
_err
=
HMGetBalloonWindow
(
&
window
);
_err
=
HMGetBalloonWindow
(
&
window
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"O&"
,
_res
=
Py_BuildValue
(
"O&"
,
WinObj_
WhichWindo
w
,
window
);
WinObj_
Ne
w
,
window
);
return
_res
;
return
_res
;
}
}
static
PyMethodDef
Help_methods
[]
=
{
static
PyMethodDef
Help_methods
[]
=
{
{
"HMGetHelpMenuHandle"
,
(
PyCFunction
)
Help_HMGetHelpMenuHandle
,
1
,
{
"HMGetHelpMenuHandle"
,
(
PyCFunction
)
Help_HMGetHelpMenuHandle
,
1
,
"() -> (Menu
Handle
mh)"
},
"() -> (Menu
Ref
mh)"
},
{
"HMRemoveBalloon"
,
(
PyCFunction
)
Help_HMRemoveBalloon
,
1
,
{
"HMRemoveBalloon"
,
(
PyCFunction
)
Help_HMRemoveBalloon
,
1
,
"() -> None"
},
"() -> None"
},
{
"HMIsBalloon"
,
(
PyCFunction
)
Help_HMIsBalloon
,
1
,
{
"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)
...
@@ -378,8 +378,8 @@ static PyObject *ListObj_LClick(ListObject *_self, PyObject *_args)
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
Boolean
_rv
;
Boolean
_rv
;
Point
pt
;
Point
pt
;
short
modifiers
;
EventModifiers
modifiers
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&
h
"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"O&
H
"
,
PyMac_GetPoint
,
&
pt
,
PyMac_GetPoint
,
&
pt
,
&
modifiers
))
&
modifiers
))
return
NULL
;
return
NULL
;
...
@@ -580,7 +580,7 @@ static PyMethodDef ListObj_methods[] = {
...
@@ -580,7 +580,7 @@ static PyMethodDef ListObj_methods[] = {
{
"LCellSize"
,
(
PyCFunction
)
ListObj_LCellSize
,
1
,
{
"LCellSize"
,
(
PyCFunction
)
ListObj_LCellSize
,
1
,
"(Point cSize) -> None"
},
"(Point cSize) -> None"
},
{
"LClick"
,
(
PyCFunction
)
ListObj_LClick
,
1
,
{
"LClick"
,
(
PyCFunction
)
ListObj_LClick
,
1
,
"(Point pt,
short
modifiers) -> (Boolean _rv)"
},
"(Point pt,
EventModifiers
modifiers) -> (Boolean _rv)"
},
{
"LAddToCell"
,
(
PyCFunction
)
ListObj_LAddToCell
,
1
,
{
"LAddToCell"
,
(
PyCFunction
)
ListObj_LAddToCell
,
1
,
"(Buffer dataPtr, Point theCell) -> None"
},
"(Buffer dataPtr, Point theCell) -> None"
},
{
"LClrCell"
,
(
PyCFunction
)
ListObj_LClrCell
,
1
,
{
"LClrCell"
,
(
PyCFunction
)
ListObj_LClrCell
,
1
,
...
...
Mac/Modules/list/listscan.py
View file @
2168e9d6
...
@@ -56,6 +56,7 @@ class MyScanner(Scanner):
...
@@ -56,6 +56,7 @@ class MyScanner(Scanner):
def
makeblacklisttypes
(
self
):
def
makeblacklisttypes
(
self
):
return
[
return
[
"ListClickLoopUPP"
,
# Too difficult for now
"ListClickLoopUPP"
,
# Too difficult for now
"ListDefSpecPtr"
,
# later
]
]
def
makerepairinstructions
(
self
):
def
makerepairinstructions
(
self
):
...
...
Mac/Modules/list/listsupport.py
View file @
2168e9d6
...
@@ -36,6 +36,7 @@ RgnHandle = OpaqueByValueType("RgnHandle", "ResObj")
...
@@ -36,6 +36,7 @@ RgnHandle = OpaqueByValueType("RgnHandle", "ResObj")
DataHandle
=
OpaqueByValueType
(
"DataHandle"
,
"ResObj"
)
DataHandle
=
OpaqueByValueType
(
"DataHandle"
,
"ResObj"
)
Handle
=
OpaqueByValueType
(
"Handle"
,
"ResObj"
)
Handle
=
OpaqueByValueType
(
"Handle"
,
"ResObj"
)
CGrafPtr
=
OpaqueByValueType
(
"CGrafPtr"
,
"GrafObj"
)
CGrafPtr
=
OpaqueByValueType
(
"CGrafPtr"
,
"GrafObj"
)
EventModifiers
=
Type
(
"EventModifiers"
,
"H"
)
includestuff
=
includestuff
+
"""
includestuff
=
includestuff
+
"""
#ifdef WITHOUT_FRAMEWORKS
#ifdef WITHOUT_FRAMEWORKS
...
...
Mac/Modules/menu/_Menumodule.c
View file @
2168e9d6
...
@@ -112,38 +112,38 @@ static PyObject *MenuObj_CalcMenuSize(MenuObject *_self, PyObject *_args)
...
@@ -112,38 +112,38 @@ static PyObject *MenuObj_CalcMenuSize(MenuObject *_self, PyObject *_args)
return
_res
;
return
_res
;
}
}
static
PyObject
*
MenuObj_CountMenuItems
(
MenuObject
*
_self
,
PyObject
*
_args
)
#if !TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_CountMItems
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
short
_rv
;
short
_rv
;
#ifndef CountM
enu
Items
#ifndef CountMItems
PyMac_PRECHECK
(
CountM
enu
Items
);
PyMac_PRECHECK
(
CountMItems
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
return
NULL
;
_rv
=
CountM
enu
Items
(
_self
->
ob_itself
);
_rv
=
CountMItems
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"h"
,
_res
=
Py_BuildValue
(
"h"
,
_rv
);
_rv
);
return
_res
;
return
_res
;
}
}
#endif
#if !TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_CountMenuItems
(
MenuObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
MenuObj_CountMItems
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
short
_rv
;
short
_rv
;
#ifndef CountMItems
#ifndef CountM
enu
Items
PyMac_PRECHECK
(
CountMItems
);
PyMac_PRECHECK
(
CountM
enu
Items
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
return
NULL
;
_rv
=
CountMItems
(
_self
->
ob_itself
);
_rv
=
CountM
enu
Items
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"h"
,
_res
=
Py_BuildValue
(
"h"
,
_rv
);
_rv
);
return
_res
;
return
_res
;
}
}
#endif
static
PyObject
*
MenuObj_GetMenuFont
(
MenuObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
MenuObj_GetMenuFont
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
{
...
@@ -222,6 +222,181 @@ static PyObject *MenuObj_SetMenuExcludesMarkColumn(MenuObject *_self, PyObject *
...
@@ -222,6 +222,181 @@ static PyObject *MenuObj_SetMenuExcludesMarkColumn(MenuObject *_self, PyObject *
return
_res
;
return
_res
;
}
}
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_IsValidMenu
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
Boolean
_rv
;
#ifndef IsValidMenu
PyMac_PRECHECK
(
IsValidMenu
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
IsValidMenu
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"b"
,
_rv
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_GetMenuRetainCount
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
ItemCount
_rv
;
#ifndef GetMenuRetainCount
PyMac_PRECHECK
(
GetMenuRetainCount
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
GetMenuRetainCount
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"l"
,
_rv
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_RetainMenu
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
#ifndef RetainMenu
PyMac_PRECHECK
(
RetainMenu
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_err
=
RetainMenu
(
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_ReleaseMenu
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
#ifndef ReleaseMenu
PyMac_PRECHECK
(
ReleaseMenu
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_err
=
ReleaseMenu
(
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_DuplicateMenu
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
MenuHandle
outMenu
;
#ifndef DuplicateMenu
PyMac_PRECHECK
(
DuplicateMenu
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_err
=
DuplicateMenu
(
_self
->
ob_itself
,
&
outMenu
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"O&"
,
MenuObj_New
,
outMenu
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_CopyMenuTitleAsCFString
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
CFStringRef
outString
;
#ifndef CopyMenuTitleAsCFString
PyMac_PRECHECK
(
CopyMenuTitleAsCFString
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_err
=
CopyMenuTitleAsCFString
(
_self
->
ob_itself
,
&
outString
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"O&"
,
CFStringRefObj_New
,
outString
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_SetMenuTitleWithCFString
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
CFStringRef
inString
;
#ifndef SetMenuTitleWithCFString
PyMac_PRECHECK
(
SetMenuTitleWithCFString
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
CFStringRefObj_Convert
,
&
inString
))
return
NULL
;
_err
=
SetMenuTitleWithCFString
(
_self
->
ob_itself
,
inString
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_InvalidateMenuSize
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
#ifndef InvalidateMenuSize
PyMac_PRECHECK
(
InvalidateMenuSize
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_err
=
InvalidateMenuSize
(
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_IsMenuSizeInvalid
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
Boolean
_rv
;
#ifndef IsMenuSizeInvalid
PyMac_PRECHECK
(
IsMenuSizeInvalid
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
IsMenuSizeInvalid
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"b"
,
_rv
);
return
_res
;
}
#endif
static
PyObject
*
MenuObj_MacAppendMenu
(
MenuObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
MenuObj_MacAppendMenu
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
...
@@ -397,6 +572,123 @@ static PyObject *MenuObj_InsertMenuItemText(MenuObject *_self, PyObject *_args)
...
@@ -397,6 +572,123 @@ static PyObject *MenuObj_InsertMenuItemText(MenuObject *_self, PyObject *_args)
return
_res
;
return
_res
;
}
}
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_CopyMenuItems
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
MenuItemIndex
inFirstItem
;
ItemCount
inNumItems
;
MenuHandle
inDestMenu
;
MenuItemIndex
inInsertAfter
;
#ifndef CopyMenuItems
PyMac_PRECHECK
(
CopyMenuItems
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"hlO&h"
,
&
inFirstItem
,
&
inNumItems
,
MenuObj_Convert
,
&
inDestMenu
,
&
inInsertAfter
))
return
NULL
;
_err
=
CopyMenuItems
(
_self
->
ob_itself
,
inFirstItem
,
inNumItems
,
inDestMenu
,
inInsertAfter
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_DeleteMenuItems
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
MenuItemIndex
inFirstItem
;
ItemCount
inNumItems
;
#ifndef DeleteMenuItems
PyMac_PRECHECK
(
DeleteMenuItems
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"hl"
,
&
inFirstItem
,
&
inNumItems
))
return
NULL
;
_err
=
DeleteMenuItems
(
_self
->
ob_itself
,
inFirstItem
,
inNumItems
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_AppendMenuItemTextWithCFString
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
CFStringRef
inString
;
MenuItemAttributes
inAttributes
;
MenuCommand
inCommandID
;
MenuItemIndex
outNewItem
;
#ifndef AppendMenuItemTextWithCFString
PyMac_PRECHECK
(
AppendMenuItemTextWithCFString
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"O&ll"
,
CFStringRefObj_Convert
,
&
inString
,
&
inAttributes
,
&
inCommandID
))
return
NULL
;
_err
=
AppendMenuItemTextWithCFString
(
_self
->
ob_itself
,
inString
,
inAttributes
,
inCommandID
,
&
outNewItem
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"h"
,
outNewItem
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_InsertMenuItemTextWithCFString
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
CFStringRef
inString
;
MenuItemIndex
inAfterItem
;
MenuItemAttributes
inAttributes
;
MenuCommand
inCommandID
;
#ifndef InsertMenuItemTextWithCFString
PyMac_PRECHECK
(
InsertMenuItemTextWithCFString
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"O&hll"
,
CFStringRefObj_Convert
,
&
inString
,
&
inAfterItem
,
&
inAttributes
,
&
inCommandID
))
return
NULL
;
_err
=
InsertMenuItemTextWithCFString
(
_self
->
ob_itself
,
inString
,
inAfterItem
,
inAttributes
,
inCommandID
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
#endif
static
PyObject
*
MenuObj_PopUpMenuSelect
(
MenuObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
MenuObj_PopUpMenuSelect
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
...
@@ -421,6 +713,43 @@ static PyObject *MenuObj_PopUpMenuSelect(MenuObject *_self, PyObject *_args)
...
@@ -421,6 +713,43 @@ static PyObject *MenuObj_PopUpMenuSelect(MenuObject *_self, PyObject *_args)
return
_res
;
return
_res
;
}
}
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_InvalidateMenuEnabling
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
#ifndef InvalidateMenuEnabling
PyMac_PRECHECK
(
InvalidateMenuEnabling
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_err
=
InvalidateMenuEnabling
(
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_IsMenuBarInvalid
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
Boolean
_rv
;
#ifndef IsMenuBarInvalid
PyMac_PRECHECK
(
IsMenuBarInvalid
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
IsMenuBarInvalid
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"b"
,
_rv
);
return
_res
;
}
#endif
static
PyObject
*
MenuObj_MacInsertMenu
(
MenuObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
MenuObj_MacInsertMenu
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
...
@@ -438,48 +767,67 @@ static PyObject *MenuObj_MacInsertMenu(MenuObject *_self, PyObject *_args)
...
@@ -438,48 +767,67 @@ static PyObject *MenuObj_MacInsertMenu(MenuObject *_self, PyObject *_args)
return
_res
;
return
_res
;
}
}
static
PyObject
*
MenuObj_MacCheckMenuItem
(
MenuObject
*
_self
,
PyObject
*
_args
)
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_SetRootMenu
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
#ifndef SetRootMenu
PyMac_PRECHECK
(
SetRootMenu
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_err
=
SetRootMenu
(
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
#endif
#if !TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_CheckItem
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
short
item
;
short
item
;
Boolean
checked
;
Boolean
checked
;
#ifndef
MacCheckMenu
Item
#ifndef
Check
Item
PyMac_PRECHECK
(
MacCheckMenu
Item
);
PyMac_PRECHECK
(
Check
Item
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"hb"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"hb"
,
&
item
,
&
item
,
&
checked
))
&
checked
))
return
NULL
;
return
NULL
;
MacCheckMenu
Item
(
_self
->
ob_itself
,
Check
Item
(
_self
->
ob_itself
,
item
,
item
,
checked
);
checked
);
Py_INCREF
(
Py_None
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
_res
=
Py_None
;
return
_res
;
return
_res
;
}
}
#endif
#if !TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_MacCheckMenuItem
(
MenuObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
MenuObj_CheckItem
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
short
item
;
short
item
;
Boolean
checked
;
Boolean
checked
;
#ifndef
Check
Item
#ifndef
MacCheckMenu
Item
PyMac_PRECHECK
(
Check
Item
);
PyMac_PRECHECK
(
MacCheckMenu
Item
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"hb"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"hb"
,
&
item
,
&
item
,
&
checked
))
&
checked
))
return
NULL
;
return
NULL
;
Check
Item
(
_self
->
ob_itself
,
MacCheckMenu
Item
(
_self
->
ob_itself
,
item
,
item
,
checked
);
checked
);
Py_INCREF
(
Py_None
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
_res
=
Py_None
;
return
_res
;
return
_res
;
}
}
#endif
static
PyObject
*
MenuObj_SetMenuItemText
(
MenuObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
MenuObj_SetMenuItemText
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
{
...
@@ -1221,6 +1569,208 @@ static PyObject *MenuObj_IsMenuItemIconEnabled(MenuObject *_self, PyObject *_arg
...
@@ -1221,6 +1569,208 @@ static PyObject *MenuObj_IsMenuItemIconEnabled(MenuObject *_self, PyObject *_arg
#if TARGET_API_MAC_CARBON
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_SetMenuItemHierarchicalMenu
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
MenuItemIndex
inItem
;
MenuHandle
inHierMenu
;
#ifndef SetMenuItemHierarchicalMenu
PyMac_PRECHECK
(
SetMenuItemHierarchicalMenu
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"hO&"
,
&
inItem
,
MenuObj_Convert
,
&
inHierMenu
))
return
NULL
;
_err
=
SetMenuItemHierarchicalMenu
(
_self
->
ob_itself
,
inItem
,
inHierMenu
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_GetMenuItemHierarchicalMenu
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
MenuItemIndex
inItem
;
MenuHandle
outHierMenu
;
#ifndef GetMenuItemHierarchicalMenu
PyMac_PRECHECK
(
GetMenuItemHierarchicalMenu
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"h"
,
&
inItem
))
return
NULL
;
_err
=
GetMenuItemHierarchicalMenu
(
_self
->
ob_itself
,
inItem
,
&
outHierMenu
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"O&"
,
MenuObj_New
,
outHierMenu
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_CopyMenuItemTextAsCFString
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
MenuItemIndex
inItem
;
CFStringRef
outString
;
#ifndef CopyMenuItemTextAsCFString
PyMac_PRECHECK
(
CopyMenuItemTextAsCFString
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"h"
,
&
inItem
))
return
NULL
;
_err
=
CopyMenuItemTextAsCFString
(
_self
->
ob_itself
,
inItem
,
&
outString
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"O&"
,
CFStringRefObj_New
,
outString
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_SetMenuItemTextWithCFString
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
MenuItemIndex
inItem
;
CFStringRef
inString
;
#ifndef SetMenuItemTextWithCFString
PyMac_PRECHECK
(
SetMenuItemTextWithCFString
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"hO&"
,
&
inItem
,
CFStringRefObj_Convert
,
&
inString
))
return
NULL
;
_err
=
SetMenuItemTextWithCFString
(
_self
->
ob_itself
,
inItem
,
inString
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_GetMenuItemIndent
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
MenuItemIndex
inItem
;
UInt32
outIndent
;
#ifndef GetMenuItemIndent
PyMac_PRECHECK
(
GetMenuItemIndent
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"h"
,
&
inItem
))
return
NULL
;
_err
=
GetMenuItemIndent
(
_self
->
ob_itself
,
inItem
,
&
outIndent
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"l"
,
outIndent
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_SetMenuItemIndent
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
MenuItemIndex
inItem
;
UInt32
inIndent
;
#ifndef SetMenuItemIndent
PyMac_PRECHECK
(
SetMenuItemIndent
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"hl"
,
&
inItem
,
&
inIndent
))
return
NULL
;
_err
=
SetMenuItemIndent
(
_self
->
ob_itself
,
inItem
,
inIndent
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_GetMenuItemCommandKey
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
MenuItemIndex
inItem
;
Boolean
inGetVirtualKey
;
UInt16
outKey
;
#ifndef GetMenuItemCommandKey
PyMac_PRECHECK
(
GetMenuItemCommandKey
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"hb"
,
&
inItem
,
&
inGetVirtualKey
))
return
NULL
;
_err
=
GetMenuItemCommandKey
(
_self
->
ob_itself
,
inItem
,
inGetVirtualKey
,
&
outKey
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"H"
,
outKey
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_SetMenuItemCommandKey
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
MenuItemIndex
inItem
;
Boolean
inSetVirtualKey
;
UInt16
inKey
;
#ifndef SetMenuItemCommandKey
PyMac_PRECHECK
(
SetMenuItemCommandKey
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"hbH"
,
&
inItem
,
&
inSetVirtualKey
,
&
inKey
))
return
NULL
;
_err
=
SetMenuItemCommandKey
(
_self
->
ob_itself
,
inItem
,
inSetVirtualKey
,
inKey
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_GetMenuItemPropertyAttributes
(
MenuObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
MenuObj_GetMenuItemPropertyAttributes
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
...
@@ -1435,89 +1985,238 @@ static PyObject *MenuObj_MenuHasEnabledItems(MenuObject *_self, PyObject *_args)
...
@@ -1435,89 +1985,238 @@ static PyObject *MenuObj_MenuHasEnabledItems(MenuObject *_self, PyObject *_args)
#if TARGET_API_MAC_CARBON
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_GetMenuType
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
UInt16
outType
;
#ifndef GetMenuType
PyMac_PRECHECK
(
GetMenuType
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_err
=
GetMenuType
(
_self
->
ob_itself
,
&
outType
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"H"
,
outType
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_CountMenuItemsWithCommandID
(
MenuObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
MenuObj_CountMenuItemsWithCommandID
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
ItemCount
_rv
;
ItemCount
_rv
;
MenuCommand
c
ommandID
;
MenuCommand
inC
ommandID
;
#ifndef CountMenuItemsWithCommandID
#ifndef CountMenuItemsWithCommandID
PyMac_PRECHECK
(
CountMenuItemsWithCommandID
);
PyMac_PRECHECK
(
CountMenuItemsWithCommandID
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
commandID
))
&
inCommandID
))
return
NULL
;
_rv
=
CountMenuItemsWithCommandID
(
_self
->
ob_itself
,
inCommandID
);
_res
=
Py_BuildValue
(
"l"
,
_rv
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_GetIndMenuItemWithCommandID
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
MenuCommand
inCommandID
;
UInt32
inItemIndex
;
MenuHandle
outMenu
;
MenuItemIndex
outIndex
;
#ifndef GetIndMenuItemWithCommandID
PyMac_PRECHECK
(
GetIndMenuItemWithCommandID
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"ll"
,
&
inCommandID
,
&
inItemIndex
))
return
NULL
;
_err
=
GetIndMenuItemWithCommandID
(
_self
->
ob_itself
,
inCommandID
,
inItemIndex
,
&
outMenu
,
&
outIndex
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"O&h"
,
MenuObj_New
,
outMenu
,
outIndex
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_EnableMenuCommand
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
MenuCommand
inCommandID
;
#ifndef EnableMenuCommand
PyMac_PRECHECK
(
EnableMenuCommand
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
inCommandID
))
return
NULL
;
EnableMenuCommand
(
_self
->
ob_itself
,
inCommandID
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_DisableMenuCommand
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
MenuCommand
inCommandID
;
#ifndef DisableMenuCommand
PyMac_PRECHECK
(
DisableMenuCommand
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
inCommandID
))
return
NULL
;
DisableMenuCommand
(
_self
->
ob_itself
,
inCommandID
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_IsMenuCommandEnabled
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
Boolean
_rv
;
MenuCommand
inCommandID
;
#ifndef IsMenuCommandEnabled
PyMac_PRECHECK
(
IsMenuCommandEnabled
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
inCommandID
))
return
NULL
;
_rv
=
IsMenuCommandEnabled
(
_self
->
ob_itself
,
inCommandID
);
_res
=
Py_BuildValue
(
"b"
,
_rv
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_SetMenuCommandMark
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
MenuCommand
inCommandID
;
UniChar
inMark
;
#ifndef SetMenuCommandMark
PyMac_PRECHECK
(
SetMenuCommandMark
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"lh"
,
&
inCommandID
,
&
inMark
))
return
NULL
;
return
NULL
;
_rv
=
CountMenuItemsWithCommandID
(
_self
->
ob_itself
,
_err
=
SetMenuCommandMark
(
_self
->
ob_itself
,
commandID
);
inCommandID
,
_res
=
Py_BuildValue
(
"l"
,
inMark
);
_rv
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
return
_res
;
}
}
#endif
#endif
#if TARGET_API_MAC_CARBON
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_Get
IndMenuItemWithCommandID
(
MenuObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
MenuObj_Get
MenuCommandMark
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
OSStatus
_err
;
MenuCommand
commandID
;
MenuCommand
inCommandID
;
UInt32
itemIndex
;
UniChar
outMark
;
MenuHandle
outMenu
;
#ifndef GetMenuCommandMark
MenuItemIndex
outIndex
;
PyMac_PRECHECK
(
GetMenuCommandMark
);
#ifndef GetIndMenuItemWithCommandID
PyMac_PRECHECK
(
GetIndMenuItemWithCommandID
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"ll"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
commandID
,
&
inCommandID
))
&
itemIndex
))
return
NULL
;
return
NULL
;
_err
=
GetIndMenuItemWithCommandID
(
_self
->
ob_itself
,
_err
=
GetMenuCommandMark
(
_self
->
ob_itself
,
commandID
,
inCommandID
,
itemIndex
,
&
outMark
);
&
outMenu
,
&
outIndex
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"O&h"
,
_res
=
Py_BuildValue
(
"h"
,
MenuObj_New
,
outMenu
,
outMark
);
outIndex
);
return
_res
;
return
_res
;
}
}
#endif
#endif
#if TARGET_API_MAC_CARBON
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_
EnableMenuCommand
(
MenuObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
MenuObj_
GetMenuCommandPropertySize
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
MenuCommand
commandID
;
OSStatus
_err
;
#ifndef EnableMenuCommand
MenuCommand
inCommandID
;
PyMac_PRECHECK
(
EnableMenuCommand
);
OSType
inPropertyCreator
;
OSType
inPropertyTag
;
ByteCount
outSize
;
#ifndef GetMenuCommandPropertySize
PyMac_PRECHECK
(
GetMenuCommandPropertySize
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"lO&O&"
,
&
commandID
))
&
inCommandID
,
PyMac_GetOSType
,
&
inPropertyCreator
,
PyMac_GetOSType
,
&
inPropertyTag
))
return
NULL
;
return
NULL
;
EnableMenuCommand
(
_self
->
ob_itself
,
_err
=
GetMenuCommandPropertySize
(
_self
->
ob_itself
,
commandID
);
inCommandID
,
Py_INCREF
(
Py_None
);
inPropertyCreator
,
_res
=
Py_None
;
inPropertyTag
,
&
outSize
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"l"
,
outSize
);
return
_res
;
return
_res
;
}
}
#endif
#endif
#if TARGET_API_MAC_CARBON
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_
DisableMenuCommand
(
MenuObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
MenuObj_
RemoveMenuCommandProperty
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
MenuCommand
commandID
;
OSStatus
_err
;
#ifndef DisableMenuCommand
MenuCommand
inCommandID
;
PyMac_PRECHECK
(
DisableMenuCommand
);
OSType
inPropertyCreator
;
OSType
inPropertyTag
;
#ifndef RemoveMenuCommandProperty
PyMac_PRECHECK
(
RemoveMenuCommandProperty
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"lO&O&"
,
&
commandID
))
&
inCommandID
,
PyMac_GetOSType
,
&
inPropertyCreator
,
PyMac_GetOSType
,
&
inPropertyTag
))
return
NULL
;
return
NULL
;
DisableMenuCommand
(
_self
->
ob_itself
,
_err
=
RemoveMenuCommandProperty
(
_self
->
ob_itself
,
commandID
);
inCommandID
,
inPropertyCreator
,
inPropertyTag
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
_res
=
Py_None
;
return
_res
;
return
_res
;
...
@@ -1526,19 +2225,19 @@ static PyObject *MenuObj_DisableMenuCommand(MenuObject *_self, PyObject *_args)
...
@@ -1526,19 +2225,19 @@ static PyObject *MenuObj_DisableMenuCommand(MenuObject *_self, PyObject *_args)
#if TARGET_API_MAC_CARBON
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_IsMenu
CommandEnable
d
(
MenuObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
MenuObj_IsMenu
ItemInvali
d
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
Boolean
_rv
;
Boolean
_rv
;
Menu
Command
commandID
;
Menu
ItemIndex
item
;
#ifndef IsMenu
CommandEnable
d
#ifndef IsMenu
ItemInvali
d
PyMac_PRECHECK
(
IsMenu
CommandEnable
d
);
PyMac_PRECHECK
(
IsMenu
ItemInvali
d
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"
l
"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"
h
"
,
&
commandID
))
&
item
))
return
NULL
;
return
NULL
;
_rv
=
IsMenu
CommandEnable
d
(
_self
->
ob_itself
,
_rv
=
IsMenu
ItemInvali
d
(
_self
->
ob_itself
,
commandID
);
item
);
_res
=
Py_BuildValue
(
"b"
,
_res
=
Py_BuildValue
(
"b"
,
_rv
);
_rv
);
return
_res
;
return
_res
;
...
@@ -1547,55 +2246,41 @@ static PyObject *MenuObj_IsMenuCommandEnabled(MenuObject *_self, PyObject *_args
...
@@ -1547,55 +2246,41 @@ static PyObject *MenuObj_IsMenuCommandEnabled(MenuObject *_self, PyObject *_args
#if TARGET_API_MAC_CARBON
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_
GetMenuCommandPropertySize
(
MenuObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
MenuObj_
InvalidateMenuItems
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
OSStatus
_err
;
MenuCommand
commandID
;
MenuItemIndex
firstItem
;
OSType
propertyCreator
;
ItemCount
numItems
;
OSType
propertyTag
;
#ifndef InvalidateMenuItems
ByteCount
size
;
PyMac_PRECHECK
(
InvalidateMenuItems
);
#ifndef GetMenuCommandPropertySize
PyMac_PRECHECK
(
GetMenuCommandPropertySize
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"lO&O&"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"hl"
,
&
commandID
,
&
firstItem
,
PyMac_GetOSType
,
&
propertyCreator
,
&
numItems
))
PyMac_GetOSType
,
&
propertyTag
))
return
NULL
;
return
NULL
;
_err
=
GetMenuCommandPropertySize
(
_self
->
ob_itself
,
_err
=
InvalidateMenuItems
(
_self
->
ob_itself
,
commandID
,
firstItem
,
propertyCreator
,
numItems
);
propertyTag
,
&
size
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"l"
,
Py_INCREF
(
Py_None
);
size
)
;
_res
=
Py_None
;
return
_res
;
return
_res
;
}
}
#endif
#endif
#if TARGET_API_MAC_CARBON
#if TARGET_API_MAC_CARBON
static
PyObject
*
MenuObj_
RemoveMenuCommandProperty
(
MenuObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
MenuObj_
UpdateInvalidMenuItems
(
MenuObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
OSStatus
_err
;
MenuCommand
commandID
;
#ifndef UpdateInvalidMenuItems
OSType
propertyCreator
;
PyMac_PRECHECK
(
UpdateInvalidMenuItems
);
OSType
propertyTag
;
#ifndef RemoveMenuCommandProperty
PyMac_PRECHECK
(
RemoveMenuCommandProperty
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"lO&O&"
,
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
&
commandID
,
PyMac_GetOSType
,
&
propertyCreator
,
PyMac_GetOSType
,
&
propertyTag
))
return
NULL
;
return
NULL
;
_err
=
RemoveMenuCommandProperty
(
_self
->
ob_itself
,
_err
=
UpdateInvalidMenuItems
(
_self
->
ob_itself
);
commandID
,
propertyCreator
,
propertyTag
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
_res
=
Py_None
;
...
@@ -1888,13 +2573,13 @@ static PyMethodDef MenuObj_methods[] = {
...
@@ -1888,13 +2573,13 @@ static PyMethodDef MenuObj_methods[] = {
"() -> None"
},
"() -> None"
},
{
"CalcMenuSize"
,
(
PyCFunction
)
MenuObj_CalcMenuSize
,
1
,
{
"CalcMenuSize"
,
(
PyCFunction
)
MenuObj_CalcMenuSize
,
1
,
"() -> None"
},
"() -> None"
},
{
"CountMenuItems"
,
(
PyCFunction
)
MenuObj_CountMenuItems
,
1
,
"() -> (short _rv)"
},
#if !TARGET_API_MAC_CARBON
#if !TARGET_API_MAC_CARBON
{
"CountMItems"
,
(
PyCFunction
)
MenuObj_CountMItems
,
1
,
{
"CountMItems"
,
(
PyCFunction
)
MenuObj_CountMItems
,
1
,
"() -> (short _rv)"
},
"() -> (short _rv)"
},
#endif
#endif
{
"CountMenuItems"
,
(
PyCFunction
)
MenuObj_CountMenuItems
,
1
,
"() -> (short _rv)"
},
{
"GetMenuFont"
,
(
PyCFunction
)
MenuObj_GetMenuFont
,
1
,
{
"GetMenuFont"
,
(
PyCFunction
)
MenuObj_GetMenuFont
,
1
,
"() -> (SInt16 outFontID, UInt16 outFontSize)"
},
"() -> (SInt16 outFontID, UInt16 outFontSize)"
},
{
"SetMenuFont"
,
(
PyCFunction
)
MenuObj_SetMenuFont
,
1
,
{
"SetMenuFont"
,
(
PyCFunction
)
MenuObj_SetMenuFont
,
1
,
...
@@ -1903,6 +2588,51 @@ static PyMethodDef MenuObj_methods[] = {
...
@@ -1903,6 +2588,51 @@ static PyMethodDef MenuObj_methods[] = {
"() -> (Boolean _rv)"
},
"() -> (Boolean _rv)"
},
{
"SetMenuExcludesMarkColumn"
,
(
PyCFunction
)
MenuObj_SetMenuExcludesMarkColumn
,
1
,
{
"SetMenuExcludesMarkColumn"
,
(
PyCFunction
)
MenuObj_SetMenuExcludesMarkColumn
,
1
,
"(Boolean excludesMark) -> None"
},
"(Boolean excludesMark) -> None"
},
#if TARGET_API_MAC_CARBON
{
"IsValidMenu"
,
(
PyCFunction
)
MenuObj_IsValidMenu
,
1
,
"() -> (Boolean _rv)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"GetMenuRetainCount"
,
(
PyCFunction
)
MenuObj_GetMenuRetainCount
,
1
,
"() -> (ItemCount _rv)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"RetainMenu"
,
(
PyCFunction
)
MenuObj_RetainMenu
,
1
,
"() -> None"
},
#endif
#if TARGET_API_MAC_CARBON
{
"ReleaseMenu"
,
(
PyCFunction
)
MenuObj_ReleaseMenu
,
1
,
"() -> None"
},
#endif
#if TARGET_API_MAC_CARBON
{
"DuplicateMenu"
,
(
PyCFunction
)
MenuObj_DuplicateMenu
,
1
,
"() -> (MenuHandle outMenu)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"CopyMenuTitleAsCFString"
,
(
PyCFunction
)
MenuObj_CopyMenuTitleAsCFString
,
1
,
"() -> (CFStringRef outString)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"SetMenuTitleWithCFString"
,
(
PyCFunction
)
MenuObj_SetMenuTitleWithCFString
,
1
,
"(CFStringRef inString) -> None"
},
#endif
#if TARGET_API_MAC_CARBON
{
"InvalidateMenuSize"
,
(
PyCFunction
)
MenuObj_InvalidateMenuSize
,
1
,
"() -> None"
},
#endif
#if TARGET_API_MAC_CARBON
{
"IsMenuSizeInvalid"
,
(
PyCFunction
)
MenuObj_IsMenuSizeInvalid
,
1
,
"() -> (Boolean _rv)"
},
#endif
{
"MacAppendMenu"
,
(
PyCFunction
)
MenuObj_MacAppendMenu
,
1
,
{
"MacAppendMenu"
,
(
PyCFunction
)
MenuObj_MacAppendMenu
,
1
,
"(Str255 data) -> None"
},
"(Str255 data) -> None"
},
{
"InsertResMenu"
,
(
PyCFunction
)
MenuObj_InsertResMenu
,
1
,
{
"InsertResMenu"
,
(
PyCFunction
)
MenuObj_InsertResMenu
,
1
,
...
@@ -1921,17 +2651,52 @@ static PyMethodDef MenuObj_methods[] = {
...
@@ -1921,17 +2651,52 @@ static PyMethodDef MenuObj_methods[] = {
"(Str255 inString) -> None"
},
"(Str255 inString) -> None"
},
{
"InsertMenuItemText"
,
(
PyCFunction
)
MenuObj_InsertMenuItemText
,
1
,
{
"InsertMenuItemText"
,
(
PyCFunction
)
MenuObj_InsertMenuItemText
,
1
,
"(Str255 inString, MenuItemIndex afterItem) -> None"
},
"(Str255 inString, MenuItemIndex afterItem) -> None"
},
#if TARGET_API_MAC_CARBON
{
"CopyMenuItems"
,
(
PyCFunction
)
MenuObj_CopyMenuItems
,
1
,
"(MenuItemIndex inFirstItem, ItemCount inNumItems, MenuHandle inDestMenu, MenuItemIndex inInsertAfter) -> None"
},
#endif
#if TARGET_API_MAC_CARBON
{
"DeleteMenuItems"
,
(
PyCFunction
)
MenuObj_DeleteMenuItems
,
1
,
"(MenuItemIndex inFirstItem, ItemCount inNumItems) -> None"
},
#endif
#if TARGET_API_MAC_CARBON
{
"AppendMenuItemTextWithCFString"
,
(
PyCFunction
)
MenuObj_AppendMenuItemTextWithCFString
,
1
,
"(CFStringRef inString, MenuItemAttributes inAttributes, MenuCommand inCommandID) -> (MenuItemIndex outNewItem)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"InsertMenuItemTextWithCFString"
,
(
PyCFunction
)
MenuObj_InsertMenuItemTextWithCFString
,
1
,
"(CFStringRef inString, MenuItemIndex inAfterItem, MenuItemAttributes inAttributes, MenuCommand inCommandID) -> None"
},
#endif
{
"PopUpMenuSelect"
,
(
PyCFunction
)
MenuObj_PopUpMenuSelect
,
1
,
{
"PopUpMenuSelect"
,
(
PyCFunction
)
MenuObj_PopUpMenuSelect
,
1
,
"(short top, short left, short popUpItem) -> (long _rv)"
},
"(short top, short left, short popUpItem) -> (long _rv)"
},
#if TARGET_API_MAC_CARBON
{
"InvalidateMenuEnabling"
,
(
PyCFunction
)
MenuObj_InvalidateMenuEnabling
,
1
,
"() -> None"
},
#endif
#if TARGET_API_MAC_CARBON
{
"IsMenuBarInvalid"
,
(
PyCFunction
)
MenuObj_IsMenuBarInvalid
,
1
,
"() -> (Boolean _rv)"
},
#endif
{
"MacInsertMenu"
,
(
PyCFunction
)
MenuObj_MacInsertMenu
,
1
,
{
"MacInsertMenu"
,
(
PyCFunction
)
MenuObj_MacInsertMenu
,
1
,
"(MenuID beforeID) -> None"
},
"(MenuID beforeID) -> None"
},
{
"MacCheckMenuItem"
,
(
PyCFunction
)
MenuObj_MacCheckMenuItem
,
1
,
"(short item, Boolean checked) -> None"
},
#if TARGET_API_MAC_CARBON
{
"SetRootMenu"
,
(
PyCFunction
)
MenuObj_SetRootMenu
,
1
,
"() -> None"
},
#endif
#if !TARGET_API_MAC_CARBON
#if !TARGET_API_MAC_CARBON
{
"CheckItem"
,
(
PyCFunction
)
MenuObj_CheckItem
,
1
,
{
"CheckItem"
,
(
PyCFunction
)
MenuObj_CheckItem
,
1
,
"(short item, Boolean checked) -> None"
},
"(short item, Boolean checked) -> None"
},
#endif
#endif
{
"MacCheckMenuItem"
,
(
PyCFunction
)
MenuObj_MacCheckMenuItem
,
1
,
"(short item, Boolean checked) -> None"
},
{
"SetMenuItemText"
,
(
PyCFunction
)
MenuObj_SetMenuItemText
,
1
,
{
"SetMenuItemText"
,
(
PyCFunction
)
MenuObj_SetMenuItemText
,
1
,
"(short item, Str255 itemString) -> None"
},
"(short item, Str255 itemString) -> None"
},
{
"GetMenuItemText"
,
(
PyCFunction
)
MenuObj_GetMenuItemText
,
1
,
{
"GetMenuItemText"
,
(
PyCFunction
)
MenuObj_GetMenuItemText
,
1
,
...
@@ -2017,6 +2782,46 @@ static PyMethodDef MenuObj_methods[] = {
...
@@ -2017,6 +2782,46 @@ static PyMethodDef MenuObj_methods[] = {
{
"IsMenuItemIconEnabled"
,
(
PyCFunction
)
MenuObj_IsMenuItemIconEnabled
,
1
,
{
"IsMenuItemIconEnabled"
,
(
PyCFunction
)
MenuObj_IsMenuItemIconEnabled
,
1
,
"(MenuItemIndex item) -> (Boolean _rv)"
},
"(MenuItemIndex item) -> (Boolean _rv)"
},
#if TARGET_API_MAC_CARBON
{
"SetMenuItemHierarchicalMenu"
,
(
PyCFunction
)
MenuObj_SetMenuItemHierarchicalMenu
,
1
,
"(MenuItemIndex inItem, MenuHandle inHierMenu) -> None"
},
#endif
#if TARGET_API_MAC_CARBON
{
"GetMenuItemHierarchicalMenu"
,
(
PyCFunction
)
MenuObj_GetMenuItemHierarchicalMenu
,
1
,
"(MenuItemIndex inItem) -> (MenuHandle outHierMenu)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"CopyMenuItemTextAsCFString"
,
(
PyCFunction
)
MenuObj_CopyMenuItemTextAsCFString
,
1
,
"(MenuItemIndex inItem) -> (CFStringRef outString)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"SetMenuItemTextWithCFString"
,
(
PyCFunction
)
MenuObj_SetMenuItemTextWithCFString
,
1
,
"(MenuItemIndex inItem, CFStringRef inString) -> None"
},
#endif
#if TARGET_API_MAC_CARBON
{
"GetMenuItemIndent"
,
(
PyCFunction
)
MenuObj_GetMenuItemIndent
,
1
,
"(MenuItemIndex inItem) -> (UInt32 outIndent)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"SetMenuItemIndent"
,
(
PyCFunction
)
MenuObj_SetMenuItemIndent
,
1
,
"(MenuItemIndex inItem, UInt32 inIndent) -> None"
},
#endif
#if TARGET_API_MAC_CARBON
{
"GetMenuItemCommandKey"
,
(
PyCFunction
)
MenuObj_GetMenuItemCommandKey
,
1
,
"(MenuItemIndex inItem, Boolean inGetVirtualKey) -> (UInt16 outKey)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"SetMenuItemCommandKey"
,
(
PyCFunction
)
MenuObj_SetMenuItemCommandKey
,
1
,
"(MenuItemIndex inItem, Boolean inSetVirtualKey, UInt16 inKey) -> None"
},
#endif
#if TARGET_API_MAC_CARBON
#if TARGET_API_MAC_CARBON
{
"GetMenuItemPropertyAttributes"
,
(
PyCFunction
)
MenuObj_GetMenuItemPropertyAttributes
,
1
,
{
"GetMenuItemPropertyAttributes"
,
(
PyCFunction
)
MenuObj_GetMenuItemPropertyAttributes
,
1
,
"(MenuItemIndex item, OSType propertyCreator, OSType propertyTag) -> (UInt32 attributes)"
},
"(MenuItemIndex item, OSType propertyCreator, OSType propertyTag) -> (UInt32 attributes)"
},
...
@@ -2062,39 +2867,69 @@ static PyMethodDef MenuObj_methods[] = {
...
@@ -2062,39 +2867,69 @@ static PyMethodDef MenuObj_methods[] = {
"() -> (Boolean _rv)"
},
"() -> (Boolean _rv)"
},
#endif
#endif
#if TARGET_API_MAC_CARBON
{
"GetMenuType"
,
(
PyCFunction
)
MenuObj_GetMenuType
,
1
,
"() -> (UInt16 outType)"
},
#endif
#if TARGET_API_MAC_CARBON
#if TARGET_API_MAC_CARBON
{
"CountMenuItemsWithCommandID"
,
(
PyCFunction
)
MenuObj_CountMenuItemsWithCommandID
,
1
,
{
"CountMenuItemsWithCommandID"
,
(
PyCFunction
)
MenuObj_CountMenuItemsWithCommandID
,
1
,
"(MenuCommand
c
ommandID) -> (ItemCount _rv)"
},
"(MenuCommand
inC
ommandID) -> (ItemCount _rv)"
},
#endif
#endif
#if TARGET_API_MAC_CARBON
#if TARGET_API_MAC_CARBON
{
"GetIndMenuItemWithCommandID"
,
(
PyCFunction
)
MenuObj_GetIndMenuItemWithCommandID
,
1
,
{
"GetIndMenuItemWithCommandID"
,
(
PyCFunction
)
MenuObj_GetIndMenuItemWithCommandID
,
1
,
"(MenuCommand
commandID, UInt32 i
temIndex) -> (MenuHandle outMenu, MenuItemIndex outIndex)"
},
"(MenuCommand
inCommandID, UInt32 inI
temIndex) -> (MenuHandle outMenu, MenuItemIndex outIndex)"
},
#endif
#endif
#if TARGET_API_MAC_CARBON
#if TARGET_API_MAC_CARBON
{
"EnableMenuCommand"
,
(
PyCFunction
)
MenuObj_EnableMenuCommand
,
1
,
{
"EnableMenuCommand"
,
(
PyCFunction
)
MenuObj_EnableMenuCommand
,
1
,
"(MenuCommand
c
ommandID) -> None"
},
"(MenuCommand
inC
ommandID) -> None"
},
#endif
#endif
#if TARGET_API_MAC_CARBON
#if TARGET_API_MAC_CARBON
{
"DisableMenuCommand"
,
(
PyCFunction
)
MenuObj_DisableMenuCommand
,
1
,
{
"DisableMenuCommand"
,
(
PyCFunction
)
MenuObj_DisableMenuCommand
,
1
,
"(MenuCommand
c
ommandID) -> None"
},
"(MenuCommand
inC
ommandID) -> None"
},
#endif
#endif
#if TARGET_API_MAC_CARBON
#if TARGET_API_MAC_CARBON
{
"IsMenuCommandEnabled"
,
(
PyCFunction
)
MenuObj_IsMenuCommandEnabled
,
1
,
{
"IsMenuCommandEnabled"
,
(
PyCFunction
)
MenuObj_IsMenuCommandEnabled
,
1
,
"(MenuCommand commandID) -> (Boolean _rv)"
},
"(MenuCommand inCommandID) -> (Boolean _rv)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"SetMenuCommandMark"
,
(
PyCFunction
)
MenuObj_SetMenuCommandMark
,
1
,
"(MenuCommand inCommandID, UniChar inMark) -> None"
},
#endif
#if TARGET_API_MAC_CARBON
{
"GetMenuCommandMark"
,
(
PyCFunction
)
MenuObj_GetMenuCommandMark
,
1
,
"(MenuCommand inCommandID) -> (UniChar outMark)"
},
#endif
#endif
#if TARGET_API_MAC_CARBON
#if TARGET_API_MAC_CARBON
{
"GetMenuCommandPropertySize"
,
(
PyCFunction
)
MenuObj_GetMenuCommandPropertySize
,
1
,
{
"GetMenuCommandPropertySize"
,
(
PyCFunction
)
MenuObj_GetMenuCommandPropertySize
,
1
,
"(MenuCommand
commandID, OSType propertyCreator, OSType propertyTag) -> (ByteCount s
ize)"
},
"(MenuCommand
inCommandID, OSType inPropertyCreator, OSType inPropertyTag) -> (ByteCount outS
ize)"
},
#endif
#endif
#if TARGET_API_MAC_CARBON
#if TARGET_API_MAC_CARBON
{
"RemoveMenuCommandProperty"
,
(
PyCFunction
)
MenuObj_RemoveMenuCommandProperty
,
1
,
{
"RemoveMenuCommandProperty"
,
(
PyCFunction
)
MenuObj_RemoveMenuCommandProperty
,
1
,
"(MenuCommand commandID, OSType propertyCreator, OSType propertyTag) -> None"
},
"(MenuCommand inCommandID, OSType inPropertyCreator, OSType inPropertyTag) -> None"
},
#endif
#if TARGET_API_MAC_CARBON
{
"IsMenuItemInvalid"
,
(
PyCFunction
)
MenuObj_IsMenuItemInvalid
,
1
,
"(MenuItemIndex item) -> (Boolean _rv)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"InvalidateMenuItems"
,
(
PyCFunction
)
MenuObj_InvalidateMenuItems
,
1
,
"(MenuItemIndex firstItem, ItemCount numItems) -> None"
},
#endif
#if TARGET_API_MAC_CARBON
{
"UpdateInvalidMenuItems"
,
(
PyCFunction
)
MenuObj_UpdateInvalidMenuItems
,
1
,
"() -> None"
},
#endif
#endif
#if TARGET_API_MAC_CARBON
#if TARGET_API_MAC_CARBON
...
@@ -2254,18 +3089,18 @@ static PyObject *Menu_CreateNewMenu(PyObject *_self, PyObject *_args)
...
@@ -2254,18 +3089,18 @@ static PyObject *Menu_CreateNewMenu(PyObject *_self, PyObject *_args)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
OSStatus
_err
;
MenuID
m
enuID
;
MenuID
inM
enuID
;
MenuAttributes
m
enuAttributes
;
MenuAttributes
inM
enuAttributes
;
MenuHandle
outMenuRef
;
MenuHandle
outMenuRef
;
#ifndef CreateNewMenu
#ifndef CreateNewMenu
PyMac_PRECHECK
(
CreateNewMenu
);
PyMac_PRECHECK
(
CreateNewMenu
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"hl"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"hl"
,
&
m
enuID
,
&
inM
enuID
,
&
m
enuAttributes
))
&
inM
enuAttributes
))
return
NULL
;
return
NULL
;
_err
=
CreateNewMenu
(
m
enuID
,
_err
=
CreateNewMenu
(
inM
enuID
,
m
enuAttributes
,
inM
enuAttributes
,
&
outMenuRef
);
&
outMenuRef
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"O&"
,
_res
=
Py_BuildValue
(
"O&"
,
...
@@ -2453,19 +3288,19 @@ static PyObject *Menu_DuplicateMenuBar(PyObject *_self, PyObject *_args)
...
@@ -2453,19 +3288,19 @@ static PyObject *Menu_DuplicateMenuBar(PyObject *_self, PyObject *_args)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
OSStatus
_err
;
MenuBarHandle
m
bar
;
MenuBarHandle
inM
bar
;
MenuBarHandle
out
B
ar
;
MenuBarHandle
out
Mb
ar
;
#ifndef DuplicateMenuBar
#ifndef DuplicateMenuBar
PyMac_PRECHECK
(
DuplicateMenuBar
);
PyMac_PRECHECK
(
DuplicateMenuBar
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
ResObj_Convert
,
&
m
bar
))
ResObj_Convert
,
&
inM
bar
))
return
NULL
;
return
NULL
;
_err
=
DuplicateMenuBar
(
m
bar
,
_err
=
DuplicateMenuBar
(
inM
bar
,
&
out
B
ar
);
&
out
Mb
ar
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"O&"
,
_res
=
Py_BuildValue
(
"O&"
,
ResObj_New
,
out
B
ar
);
ResObj_New
,
out
Mb
ar
);
return
_res
;
return
_res
;
}
}
#endif
#endif
...
@@ -2476,14 +3311,14 @@ static PyObject *Menu_DisposeMenuBar(PyObject *_self, PyObject *_args)
...
@@ -2476,14 +3311,14 @@ static PyObject *Menu_DisposeMenuBar(PyObject *_self, PyObject *_args)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
OSStatus
_err
;
MenuBarHandle
m
bar
;
MenuBarHandle
inM
bar
;
#ifndef DisposeMenuBar
#ifndef DisposeMenuBar
PyMac_PRECHECK
(
DisposeMenuBar
);
PyMac_PRECHECK
(
DisposeMenuBar
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
ResObj_Convert
,
&
m
bar
))
ResObj_Convert
,
&
inM
bar
))
return
NULL
;
return
NULL
;
_err
=
DisposeMenuBar
(
m
bar
);
_err
=
DisposeMenuBar
(
inM
bar
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
_res
=
Py_None
;
...
@@ -2538,40 +3373,40 @@ static PyObject *Menu_ClearMenuBar(PyObject *_self, PyObject *_args)
...
@@ -2538,40 +3373,40 @@ static PyObject *Menu_ClearMenuBar(PyObject *_self, PyObject *_args)
return
_res
;
return
_res
;
}
}
static
PyObject
*
Menu_SetMenuFlashCount
(
PyObject
*
_self
,
PyObject
*
_args
)
#if !TARGET_API_MAC_CARBON
static
PyObject
*
Menu_SetMenuFlash
(
PyObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
short
count
;
short
count
;
#ifndef SetMenuFlash
Count
#ifndef SetMenuFlash
PyMac_PRECHECK
(
SetMenuFlash
Count
);
PyMac_PRECHECK
(
SetMenuFlash
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"h"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"h"
,
&
count
))
&
count
))
return
NULL
;
return
NULL
;
SetMenuFlash
Count
(
count
);
SetMenuFlash
(
count
);
Py_INCREF
(
Py_None
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
_res
=
Py_None
;
return
_res
;
return
_res
;
}
}
#endif
#if !TARGET_API_MAC_CARBON
static
PyObject
*
Menu_SetMenuFlashCount
(
PyObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
Menu_SetMenuFlash
(
PyObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
short
count
;
short
count
;
#ifndef SetMenuFlash
#ifndef SetMenuFlash
Count
PyMac_PRECHECK
(
SetMenuFlash
);
PyMac_PRECHECK
(
SetMenuFlash
Count
);
#endif
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
"h"
,
if
(
!
PyArg_ParseTuple
(
_args
,
"h"
,
&
count
))
&
count
))
return
NULL
;
return
NULL
;
SetMenuFlash
(
count
);
SetMenuFlash
Count
(
count
);
Py_INCREF
(
Py_None
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
_res
=
Py_None
;
return
_res
;
return
_res
;
}
}
#endif
static
PyObject
*
Menu_FlashMenuBar
(
PyObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
Menu_FlashMenuBar
(
PyObject
*
_self
,
PyObject
*
_args
)
{
{
...
@@ -2671,6 +3506,24 @@ static PyObject *Menu_HideMenuBar(PyObject *_self, PyObject *_args)
...
@@ -2671,6 +3506,24 @@ static PyObject *Menu_HideMenuBar(PyObject *_self, PyObject *_args)
return
_res
;
return
_res
;
}
}
#if TARGET_API_MAC_CARBON
static
PyObject
*
Menu_AcquireRootMenu
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
MenuHandle
_rv
;
#ifndef AcquireRootMenu
PyMac_PRECHECK
(
AcquireRootMenu
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
AcquireRootMenu
();
_res
=
Py_BuildValue
(
"O&"
,
MenuObj_New
,
_rv
);
return
_res
;
}
#endif
static
PyObject
*
Menu_DeleteMCEntries
(
PyObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
Menu_DeleteMCEntries
(
PyObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
...
@@ -2723,6 +3576,21 @@ static PyObject *Menu_IsShowContextualMenuClick(PyObject *_self, PyObject *_args
...
@@ -2723,6 +3576,21 @@ static PyObject *Menu_IsShowContextualMenuClick(PyObject *_self, PyObject *_args
return
_res
;
return
_res
;
}
}
static
PyObject
*
Menu_LMGetTheMenu
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
SInt16
_rv
;
#ifndef LMGetTheMenu
PyMac_PRECHECK
(
LMGetTheMenu
);
#endif
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
LMGetTheMenu
();
_res
=
Py_BuildValue
(
"h"
,
_rv
);
return
_res
;
}
#if !TARGET_API_MAC_CARBON
#if !TARGET_API_MAC_CARBON
static
PyObject
*
Menu_OpenDeskAcc
(
PyObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
Menu_OpenDeskAcc
(
PyObject
*
_self
,
PyObject
*
_args
)
...
@@ -2824,7 +3692,7 @@ static PyMethodDef Menu_methods[] = {
...
@@ -2824,7 +3692,7 @@ static PyMethodDef Menu_methods[] = {
#if TARGET_API_MAC_CARBON
#if TARGET_API_MAC_CARBON
{
"CreateNewMenu"
,
(
PyCFunction
)
Menu_CreateNewMenu
,
1
,
{
"CreateNewMenu"
,
(
PyCFunction
)
Menu_CreateNewMenu
,
1
,
"(MenuID
menuID, MenuAttributes m
enuAttributes) -> (MenuHandle outMenuRef)"
},
"(MenuID
inMenuID, MenuAttributes inM
enuAttributes) -> (MenuHandle outMenuRef)"
},
#endif
#endif
{
"MenuKey"
,
(
PyCFunction
)
Menu_MenuKey
,
1
,
{
"MenuKey"
,
(
PyCFunction
)
Menu_MenuKey
,
1
,
"(CharParameter ch) -> (long _rv)"
},
"(CharParameter ch) -> (long _rv)"
},
...
@@ -2851,12 +3719,12 @@ static PyMethodDef Menu_methods[] = {
...
@@ -2851,12 +3719,12 @@ static PyMethodDef Menu_methods[] = {
#if TARGET_API_MAC_CARBON
#if TARGET_API_MAC_CARBON
{
"DuplicateMenuBar"
,
(
PyCFunction
)
Menu_DuplicateMenuBar
,
1
,
{
"DuplicateMenuBar"
,
(
PyCFunction
)
Menu_DuplicateMenuBar
,
1
,
"(MenuBarHandle
mbar) -> (MenuBarHandle outB
ar)"
},
"(MenuBarHandle
inMbar) -> (MenuBarHandle outMb
ar)"
},
#endif
#endif
#if TARGET_API_MAC_CARBON
#if TARGET_API_MAC_CARBON
{
"DisposeMenuBar"
,
(
PyCFunction
)
Menu_DisposeMenuBar
,
1
,
{
"DisposeMenuBar"
,
(
PyCFunction
)
Menu_DisposeMenuBar
,
1
,
"(MenuBarHandle
m
bar) -> None"
},
"(MenuBarHandle
inM
bar) -> None"
},
#endif
#endif
{
"GetMenuHandle"
,
(
PyCFunction
)
Menu_GetMenuHandle
,
1
,
{
"GetMenuHandle"
,
(
PyCFunction
)
Menu_GetMenuHandle
,
1
,
"(MenuID menuID) -> (MenuHandle _rv)"
},
"(MenuID menuID) -> (MenuHandle _rv)"
},
...
@@ -2864,13 +3732,13 @@ static PyMethodDef Menu_methods[] = {
...
@@ -2864,13 +3732,13 @@ static PyMethodDef Menu_methods[] = {
"(MenuID menuID) -> None"
},
"(MenuID menuID) -> None"
},
{
"ClearMenuBar"
,
(
PyCFunction
)
Menu_ClearMenuBar
,
1
,
{
"ClearMenuBar"
,
(
PyCFunction
)
Menu_ClearMenuBar
,
1
,
"() -> None"
},
"() -> None"
},
{
"SetMenuFlashCount"
,
(
PyCFunction
)
Menu_SetMenuFlashCount
,
1
,
"(short count) -> None"
},
#if !TARGET_API_MAC_CARBON
#if !TARGET_API_MAC_CARBON
{
"SetMenuFlash"
,
(
PyCFunction
)
Menu_SetMenuFlash
,
1
,
{
"SetMenuFlash"
,
(
PyCFunction
)
Menu_SetMenuFlash
,
1
,
"(short count) -> None"
},
"(short count) -> None"
},
#endif
#endif
{
"SetMenuFlashCount"
,
(
PyCFunction
)
Menu_SetMenuFlashCount
,
1
,
"(short count) -> None"
},
{
"FlashMenuBar"
,
(
PyCFunction
)
Menu_FlashMenuBar
,
1
,
{
"FlashMenuBar"
,
(
PyCFunction
)
Menu_FlashMenuBar
,
1
,
"(MenuID menuID) -> None"
},
"(MenuID menuID) -> None"
},
...
@@ -2889,12 +3757,19 @@ static PyMethodDef Menu_methods[] = {
...
@@ -2889,12 +3757,19 @@ static PyMethodDef Menu_methods[] = {
"() -> None"
},
"() -> None"
},
{
"HideMenuBar"
,
(
PyCFunction
)
Menu_HideMenuBar
,
1
,
{
"HideMenuBar"
,
(
PyCFunction
)
Menu_HideMenuBar
,
1
,
"() -> None"
},
"() -> None"
},
#if TARGET_API_MAC_CARBON
{
"AcquireRootMenu"
,
(
PyCFunction
)
Menu_AcquireRootMenu
,
1
,
"() -> (MenuHandle _rv)"
},
#endif
{
"DeleteMCEntries"
,
(
PyCFunction
)
Menu_DeleteMCEntries
,
1
,
{
"DeleteMCEntries"
,
(
PyCFunction
)
Menu_DeleteMCEntries
,
1
,
"(MenuID menuID, short menuItem) -> None"
},
"(MenuID menuID, short menuItem) -> None"
},
{
"InitContextualMenus"
,
(
PyCFunction
)
Menu_InitContextualMenus
,
1
,
{
"InitContextualMenus"
,
(
PyCFunction
)
Menu_InitContextualMenus
,
1
,
"() -> None"
},
"() -> None"
},
{
"IsShowContextualMenuClick"
,
(
PyCFunction
)
Menu_IsShowContextualMenuClick
,
1
,
{
"IsShowContextualMenuClick"
,
(
PyCFunction
)
Menu_IsShowContextualMenuClick
,
1
,
"(EventRecord inEvent) -> (Boolean _rv)"
},
"(EventRecord inEvent) -> (Boolean _rv)"
},
{
"LMGetTheMenu"
,
(
PyCFunction
)
Menu_LMGetTheMenu
,
1
,
"() -> (SInt16 _rv)"
},
#if !TARGET_API_MAC_CARBON
#if !TARGET_API_MAC_CARBON
{
"OpenDeskAcc"
,
(
PyCFunction
)
Menu_OpenDeskAcc
,
1
,
{
"OpenDeskAcc"
,
(
PyCFunction
)
Menu_OpenDeskAcc
,
1
,
...
...
Mac/Modules/menu/menuscan.py
View file @
2168e9d6
...
@@ -42,6 +42,7 @@ class MyScanner(Scanner):
...
@@ -42,6 +42,7 @@ class MyScanner(Scanner):
"GetMenuCommandProperty"
,
"GetMenuCommandProperty"
,
"GetMenuTitle"
,
# Funny arg/returnvalue
"GetMenuTitle"
,
# Funny arg/returnvalue
"SetMenuTitle"
,
"SetMenuTitle"
,
"SetMenuTitleIcon"
,
# void*
]
]
def
makegreylist
(
self
):
def
makegreylist
(
self
):
...
@@ -83,7 +84,37 @@ class MyScanner(Scanner):
...
@@ -83,7 +84,37 @@ class MyScanner(Scanner):
'GetMenuAttributes'
,
'GetMenuAttributes'
,
'ChangeMenuItemPropertyAttributes'
,
'ChangeMenuItemPropertyAttributes'
,
'GetMenuItemPropertyAttributes'
,
'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
):
def
makeblacklisttypes
(
self
):
...
@@ -96,6 +127,10 @@ class MyScanner(Scanner):
...
@@ -96,6 +127,10 @@ class MyScanner(Scanner):
"MenuDefSpecPtr"
,
# Too difficult for now
"MenuDefSpecPtr"
,
# Too difficult for now
"MenuDefSpec_ptr"
,
# ditto
"MenuDefSpec_ptr"
,
# ditto
"MenuTrackingData"
,
"MenuTrackingData"
,
"void_ptr"
,
# Don't know yet.
"EventRef"
,
# For now, not exported yet.
"MenuItemDataPtr"
,
# Not yet.
"MenuItemDataRec_ptr"
,
]
]
def
makerepairinstructions
(
self
):
def
makerepairinstructions
(
self
):
...
...
Mac/Modules/menu/menusupport.py
View file @
2168e9d6
...
@@ -28,12 +28,15 @@ Handle = OpaqueByValueType("Handle", "ResObj")
...
@@ -28,12 +28,15 @@ Handle = OpaqueByValueType("Handle", "ResObj")
MenuBarHandle
=
OpaqueByValueType
(
"MenuBarHandle"
,
"ResObj"
)
MenuBarHandle
=
OpaqueByValueType
(
"MenuBarHandle"
,
"ResObj"
)
MenuID
=
Type
(
"MenuID"
,
"h"
)
MenuID
=
Type
(
"MenuID"
,
"h"
)
MenuItemIndex
=
Type
(
"MenuItemIndex"
,
"h"
)
MenuItemIndex
=
Type
(
"MenuItemIndex"
,
"h"
)
MenuItemID
=
Type
(
"MenuItemID"
,
"l"
)
MenuCommand
=
Type
(
"MenuCommand"
,
"l"
)
MenuCommand
=
Type
(
"MenuCommand"
,
"l"
)
MenuAttributes
=
Type
(
"MenuAttributes"
,
"l"
)
MenuAttributes
=
Type
(
"MenuAttributes"
,
"l"
)
MenuItemAttributes
=
Type
(
"MenuItemAttributes"
,
"l"
)
MenuItemAttributes
=
Type
(
"MenuItemAttributes"
,
"l"
)
unsigned_char
=
Type
(
'unsigned char'
,
'b'
)
unsigned_char
=
Type
(
'unsigned char'
,
'b'
)
FMFontFamily
=
Type
(
"FMFontFamily"
,
"h"
)
FMFontFamily
=
Type
(
"FMFontFamily"
,
"h"
)
FMFontStyle
=
Type
(
"FMFontStyle"
,
"h"
)
FMFontStyle
=
Type
(
"FMFontStyle"
,
"h"
)
CFStringRef
=
OpaqueByValueType
(
"CFStringRef"
,
"CFStringRefObj"
)
UniChar
=
Type
(
"UniChar"
,
"h"
)
includestuff
=
includestuff
+
"""
includestuff
=
includestuff
+
"""
#ifdef WITHOUT_FRAMEWORKS
#ifdef WITHOUT_FRAMEWORKS
...
...
Mac/Modules/te/_TEmodule.c
View file @
2168e9d6
...
@@ -960,6 +960,31 @@ static PyObject *TE_TESetScrapHandle(PyObject *_self, PyObject *_args)
...
@@ -960,6 +960,31 @@ static PyObject *TE_TESetScrapHandle(PyObject *_self, PyObject *_args)
}
}
#endif
#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
)
static
PyObject
*
TE_as_TE
(
PyObject
*
_self
,
PyObject
*
_args
)
{
{
PyObject
*
_res
=
NULL
;
PyObject
*
_res
=
NULL
;
...
@@ -1001,6 +1026,10 @@ static PyMethodDef TE_methods[] = {
...
@@ -1001,6 +1026,10 @@ static PyMethodDef TE_methods[] = {
{
"TESetScrapHandle"
,
(
PyCFunction
)
TE_TESetScrapHandle
,
1
,
{
"TESetScrapHandle"
,
(
PyCFunction
)
TE_TESetScrapHandle
,
1
,
"(Handle value) -> None"
},
"(Handle value) -> None"
},
#endif
#endif
{
"LMGetWordRedraw"
,
(
PyCFunction
)
TE_LMGetWordRedraw
,
1
,
"() -> (UInt8 _rv)"
},
{
"LMSetWordRedraw"
,
(
PyCFunction
)
TE_LMSetWordRedraw
,
1
,
"(UInt8 value) -> None"
},
{
"as_TE"
,
(
PyCFunction
)
TE_as_TE
,
1
,
{
"as_TE"
,
(
PyCFunction
)
TE_as_TE
,
1
,
"(Handle h) -> (TEHandle _rv)"
},
"(Handle h) -> (TEHandle _rv)"
},
{
NULL
,
NULL
,
0
}
{
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