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
f7d5aa61
Commit
f7d5aa61
authored
Dec 10, 2000
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapted to Universal Headers 3.3.2. More to follow.
parent
c6c28384
Changes
28
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
3034 additions
and
546 deletions
+3034
-546
Mac/Modules/ae/AEmodule.c
Mac/Modules/ae/AEmodule.c
+100
-31
Mac/Modules/ae/aescan.py
Mac/Modules/ae/aescan.py
+8
-0
Mac/Modules/ae/aesupport.py
Mac/Modules/ae/aesupport.py
+1
-0
Mac/Modules/app/Appmodule.c
Mac/Modules/app/Appmodule.c
+28
-1
Mac/Modules/app/appscan.py
Mac/Modules/app/appscan.py
+6
-0
Mac/Modules/app/appsupport.py
Mac/Modules/app/appsupport.py
+1
-0
Mac/Modules/cm/Cmmodule.c
Mac/Modules/cm/Cmmodule.c
+1
-1
Mac/Modules/cm/cmscan.py
Mac/Modules/cm/cmscan.py
+4
-0
Mac/Modules/ctl/Ctlmodule.c
Mac/Modules/ctl/Ctlmodule.c
+760
-189
Mac/Modules/ctl/ctlscan.py
Mac/Modules/ctl/ctlscan.py
+44
-9
Mac/Modules/ctl/ctlsupport.py
Mac/Modules/ctl/ctlsupport.py
+27
-0
Mac/Modules/dlg/Dlgmodule.c
Mac/Modules/dlg/Dlgmodule.c
+184
-2
Mac/Modules/dlg/dlgscan.py
Mac/Modules/dlg/dlgscan.py
+7
-0
Mac/Modules/dlg/dlgsupport.py
Mac/Modules/dlg/dlgsupport.py
+17
-8
Mac/Modules/drag/Dragmodule.c
Mac/Modules/drag/Dragmodule.c
+296
-219
Mac/Modules/drag/dragsupport.py
Mac/Modules/drag/dragsupport.py
+7
-17
Mac/Modules/evt/Evtmodule.c
Mac/Modules/evt/Evtmodule.c
+67
-1
Mac/Modules/evt/evtscan.py
Mac/Modules/evt/evtscan.py
+5
-0
Mac/Modules/fm/Fmmodule.c
Mac/Modules/fm/Fmmodule.c
+12
-12
Mac/Modules/help/Helpmodule.c
Mac/Modules/help/Helpmodule.c
+1
-1
Mac/Modules/icn/Icnmodule.c
Mac/Modules/icn/Icnmodule.c
+137
-1
Mac/Modules/icn/icnscan.py
Mac/Modules/icn/icnscan.py
+6
-0
Mac/Modules/list/Listmodule.c
Mac/Modules/list/Listmodule.c
+383
-1
Mac/Modules/list/listscan.py
Mac/Modules/list/listscan.py
+14
-0
Mac/Modules/list/listsupport.py
Mac/Modules/list/listsupport.py
+30
-0
Mac/Modules/menu/Menumodule.c
Mac/Modules/menu/Menumodule.c
+838
-52
Mac/Modules/menu/menuscan.py
Mac/Modules/menu/menuscan.py
+32
-0
Mac/Modules/menu/menusupport.py
Mac/Modules/menu/menusupport.py
+18
-1
No files found.
Mac/Modules/ae/AEmodule.c
View file @
f7d5aa61
...
...
@@ -9,6 +9,7 @@
#include "pymactoolbox.h"
#include <AppleEvents.h>
#include <AEObjects.h>
static
pascal
OSErr
GenericEventHandler
();
/* Forward */
...
...
@@ -69,34 +70,6 @@ static void AEDesc_dealloc(self)
PyMem_DEL
(
self
);
}
static
PyObject
*
AEDesc_AESend
(
_self
,
_args
)
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
(
_self
,
_args
)
AEDescObject
*
_self
;
PyObject
*
_args
;
...
...
@@ -672,9 +645,24 @@ static PyObject *AEDesc_AEPutAttributeDesc(_self, _args)
return
_res
;
}
#if TARGET_API_MAC_CARBON
static
PyObject
*
AEDesc_AEGetDescDataSize
(
_self
,
_args
)
AEDescObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
Size
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
AEGetDescDataSize
(
&
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"l"
,
_rv
);
return
_res
;
}
#endif
static
PyMethodDef
AEDesc_methods
[]
=
{
{
"AESend"
,
(
PyCFunction
)
AEDesc_AESend
,
1
,
"(AESendMode sendMode, AESendPriority sendPriority, long timeOutInTicks) -> (AppleEvent reply)"
},
{
"AEResetTimer"
,
(
PyCFunction
)
AEDesc_AEResetTimer
,
1
,
"() -> None"
},
{
"AESuspendTheCurrentEvent"
,
(
PyCFunction
)
AEDesc_AESuspendTheCurrentEvent
,
1
,
...
...
@@ -725,6 +713,11 @@ static PyMethodDef AEDesc_methods[] = {
"(AEKeyword theAEKeyword, DescType typeCode, Buffer dataPtr) -> None"
},
{
"AEPutAttributeDesc"
,
(
PyCFunction
)
AEDesc_AEPutAttributeDesc
,
1
,
"(AEKeyword theAEKeyword, AEDesc theAEDesc) -> None"
},
#if TARGET_API_MAC_CARBON
{
"AEGetDescDataSize"
,
(
PyCFunction
)
AEDesc_AEGetDescDataSize
,
1
,
"() -> (Size _rv)"
},
#endif
{
NULL
,
NULL
,
0
}
};
...
...
@@ -941,6 +934,44 @@ static PyObject *AE_AEGetEventHandler(_self, _args)
return
_res
;
}
static
PyObject
*
AE_AEInstallSpecialHandler
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
AEKeyword
functionClass
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
PyMac_GetOSType
,
&
functionClass
))
return
NULL
;
_err
=
AEInstallSpecialHandler
(
functionClass
,
upp_GenericEventHandler
,
0
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
AE_AERemoveSpecialHandler
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
AEKeyword
functionClass
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
PyMac_GetOSType
,
&
functionClass
))
return
NULL
;
_err
=
AERemoveSpecialHandler
(
functionClass
,
upp_GenericEventHandler
,
0
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
AE_AEManagerInfo
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
...
...
@@ -1072,6 +1103,35 @@ static PyObject *AE_AECreateAppleEvent(_self, _args)
return
_res
;
}
#if TARGET_API_MAC_CARBON
static
PyObject
*
AE_AEReplaceDescData
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
DescType
typeCode
;
char
*
dataPtr__in__
;
long
dataPtr__len__
;
int
dataPtr__in_len__
;
AEDesc
theAEDesc
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&s#"
,
PyMac_GetOSType
,
&
typeCode
,
&
dataPtr__in__
,
&
dataPtr__in_len__
))
return
NULL
;
dataPtr__len__
=
dataPtr__in_len__
;
_err
=
AEReplaceDescData
(
typeCode
,
dataPtr__in__
,
dataPtr__len__
,
&
theAEDesc
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"O&"
,
AEDesc_New
,
&
theAEDesc
);
dataPtr__error__:
;
return
_res
;
}
#endif
static
PyMethodDef
AE_methods
[]
=
{
{
"AEProcessAppleEvent"
,
(
PyCFunction
)
AE_AEProcessAppleEvent
,
1
,
"(EventRecord theEventRecord) -> None"
},
...
...
@@ -1087,6 +1147,10 @@ static PyMethodDef AE_methods[] = {
"(AEEventClass theAEEventClass, AEEventID theAEEventID) -> None"
},
{
"AEGetEventHandler"
,
(
PyCFunction
)
AE_AEGetEventHandler
,
1
,
"(AEEventClass theAEEventClass, AEEventID theAEEventID) -> (EventHandler handler)"
},
{
"AEInstallSpecialHandler"
,
(
PyCFunction
)
AE_AEInstallSpecialHandler
,
1
,
"(AEKeyword functionClass) -> None"
},
{
"AERemoveSpecialHandler"
,
(
PyCFunction
)
AE_AERemoveSpecialHandler
,
1
,
"(AEKeyword functionClass) -> None"
},
{
"AEManagerInfo"
,
(
PyCFunction
)
AE_AEManagerInfo
,
1
,
"(AEKeyword keyWord) -> (long result)"
},
{
"AECoercePtr"
,
(
PyCFunction
)
AE_AECoercePtr
,
1
,
...
...
@@ -1097,6 +1161,11 @@ static PyMethodDef AE_methods[] = {
"(Buffer factoringPtr, Boolean isRecord) -> (AEDescList resultList)"
},
{
"AECreateAppleEvent"
,
(
PyCFunction
)
AE_AECreateAppleEvent
,
1
,
"(AEEventClass theAEEventClass, AEEventID theAEEventID, AEAddressDesc target, AEReturnID returnID, AETransactionID transactionID) -> (AppleEvent result)"
},
#if TARGET_API_MAC_CARBON
{
"AEReplaceDescData"
,
(
PyCFunction
)
AE_AEReplaceDescData
,
1
,
"(DescType typeCode, Buffer dataPtr) -> (AEDesc theAEDesc)"
},
#endif
{
NULL
,
NULL
,
0
}
};
...
...
@@ -1149,7 +1218,7 @@ void initAE()
AE_Error
=
PyMac_GetOSErrException
();
if
(
AE_Error
==
NULL
||
PyDict_SetItemString
(
d
,
"Error"
,
AE_Error
)
!=
0
)
Py_FatalError
(
"can't initialize AE.Error"
)
;
return
;
AEDesc_Type
.
ob_type
=
&
PyType_Type
;
Py_INCREF
(
&
AEDesc_Type
);
if
(
PyDict_SetItemString
(
d
,
"AEDescType"
,
(
PyObject
*
)
&
AEDesc_Type
)
!=
0
)
...
...
Mac/Modules/ae/aescan.py
View file @
f7d5aa61
...
...
@@ -70,11 +70,19 @@ class AppleEventsScanner(Scanner):
return
[
"AEDisposeDesc"
,
# "AEGetEventHandler",
"AEGetDescData"
,
# Use object.data
"AEGetSpecialHandler"
,
# Constants with funny definitions
"kAEDontDisposeOnResume"
,
"kAEUseStandardDispatch"
,
]
def
makegreylist
(
self
):
return
[
(
'#if TARGET_API_MAC_CARBON'
,
[
'AEGetDescDataSize'
,
'AEReplaceDescData'
,
])]
def
makeblacklisttypes
(
self
):
return
[
"ProcPtr"
,
...
...
Mac/Modules/ae/aesupport.py
View file @
f7d5aa61
...
...
@@ -83,6 +83,7 @@ AEMethod = OSErrMethodGenerator
includestuff
=
includestuff
+
"""
#include <AppleEvents.h>
#include <AEObjects.h>
static pascal OSErr GenericEventHandler(); /* Forward */
...
...
Mac/Modules/app/Appmodule.c
View file @
f7d5aa61
...
...
@@ -1111,6 +1111,28 @@ static PyObject *App_GetThemeTextColor(_self, _args)
return
_res
;
}
#if TARGET_API_MAC_CARBON
static
PyObject
*
App_GetThemeMetric
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
ThemeMetric
inMetric
;
SInt32
outMetric
;
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
inMetric
))
return
NULL
;
_err
=
GetThemeMetric
(
inMetric
,
&
outMetric
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"l"
,
outMetric
);
return
_res
;
}
#endif
static
PyMethodDef
App_methods
[]
=
{
{
"RegisterAppearanceClient"
,
(
PyCFunction
)
App_RegisterAppearanceClient
,
1
,
"() -> None"
},
...
...
@@ -1218,6 +1240,11 @@ static PyMethodDef App_methods[] = {
"(ThemeBrush inBrush, SInt16 inDepth, Boolean inColorDev) -> (RGBColor outColor)"
},
{
"GetThemeTextColor"
,
(
PyCFunction
)
App_GetThemeTextColor
,
1
,
"(ThemeTextColor inColor, SInt16 inDepth, Boolean inColorDev) -> (RGBColor outColor)"
},
#if TARGET_API_MAC_CARBON
{
"GetThemeMetric"
,
(
PyCFunction
)
App_GetThemeMetric
,
1
,
"(ThemeMetric inMetric) -> (SInt32 outMetric)"
},
#endif
{
NULL
,
NULL
,
0
}
};
...
...
@@ -1237,7 +1264,7 @@ void initApp()
App_Error
=
PyMac_GetOSErrException
();
if
(
App_Error
==
NULL
||
PyDict_SetItemString
(
d
,
"Error"
,
App_Error
)
!=
0
)
Py_FatalError
(
"can't initialize App.Error"
)
;
return
;
}
/* ========================= End module App ========================= */
...
...
Mac/Modules/app/appscan.py
View file @
f7d5aa61
...
...
@@ -43,6 +43,12 @@ class MyScanner(Scanner):
"GetThemeFont"
,
# Funny stringbuffer in/out parameter, I think...
]
def
makegreylist
(
self
):
return
[
(
'#if TARGET_API_MAC_CARBON'
,
[
'GetThemeMetric'
,
])]
def
makeblacklisttypes
(
self
):
return
[
"MenuTitleDrawingUPP"
,
...
...
Mac/Modules/app/appsupport.py
View file @
f7d5aa61
...
...
@@ -65,6 +65,7 @@ ThemeGrowDirection = Type("ThemeGrowDirection", "H")
ThemeSoundKind
=
OSTypeType
(
"ThemeSoundKind"
)
ThemeDragSoundKind
=
OSTypeType
(
"ThemeDragSoundKind"
)
ThemeBackgroundKind
=
Type
(
"ThemeBackgroundKind"
,
"l"
)
ThemeMetric
=
Type
(
"ThemeMetric"
,
"l"
)
RGBColor
=
OpaqueType
(
"RGBColor"
,
"QdRGB"
)
includestuff
=
includestuff
+
"""
...
...
Mac/Modules/cm/Cmmodule.c
View file @
f7d5aa61
...
...
@@ -831,7 +831,7 @@ void initCm()
Cm_Error
=
PyMac_GetOSErrException
();
if
(
Cm_Error
==
NULL
||
PyDict_SetItemString
(
d
,
"Error"
,
Cm_Error
)
!=
0
)
Py_FatalError
(
"can't initialize Cm.Error"
)
;
return
;
ComponentInstance_Type
.
ob_type
=
&
PyType_Type
;
Py_INCREF
(
&
ComponentInstance_Type
);
if
(
PyDict_SetItemString
(
d
,
"ComponentInstanceType"
,
(
PyObject
*
)
&
ComponentInstance_Type
)
!=
0
)
...
...
Mac/Modules/cm/cmscan.py
View file @
f7d5aa61
...
...
@@ -56,6 +56,8 @@ class MyScanner(Scanner):
"CallComponentClose"
,
"CallComponentOpen"
,
"OpenAComponent"
,
"GetComponentPublicResource"
,
# Missing in CW Pro 6
"CallComponentGetPublicResource"
,
# Missing in CW Pro 6
]
def
makegreylist
(
self
):
...
...
@@ -77,6 +79,8 @@ class MyScanner(Scanner):
"ComponentRoutineUPP"
,
"ComponentMPWorkFunctionUPP"
,
"ComponentFunctionUPP"
,
"GetMissingComponentResourceUPP"
,
]
def
makerepairinstructions
(
self
):
...
...
Mac/Modules/ctl/Ctlmodule.c
View file @
f7d5aa61
This diff is collapsed.
Click to expand it.
Mac/Modules/ctl/ctlscan.py
View file @
f7d5aa61
...
...
@@ -8,7 +8,8 @@ from scantools import Scanner
from
bgenlocations
import
TOOLBOXDIR
def
main
():
input
=
"Controls.h"
# input = "Controls.h" # Universal Headers < 3.3
input
=
[
"Controls.h"
,
"ControlDefinitions.h"
]
# Universal Headers >= 3.3
output
=
"ctlgen.py"
defsoutput
=
TOOLBOXDIR
+
"Controls.py"
scanner
=
MyScanner
(
input
,
output
,
defsoutput
)
...
...
@@ -85,14 +86,43 @@ class MyScanner(Scanner):
'GetAuxiliaryControlRecord'
,
'SetControlColor'
,
# These have suddenly disappeared in UH 3.3.2...
'GetBevelButtonMenuValue'
,
'SetBevelButtonMenuValue'
,
'GetBevelButtonMenuHandle'
,
'SetBevelButtonTransform'
,
'SetImageWellTransform'
,
'GetTabContentRect'
,
'SetTabEnabled'
,
'SetDisclosureTriangleLastValue'
,
## 'GetBevelButtonMenuValue',
## 'SetBevelButtonMenuValue',
## 'GetBevelButtonMenuHandle',
## 'SetBevelButtonTransform',
## 'SetImageWellTransform',
## 'GetTabContentRect',
## 'SetTabEnabled',
## 'SetDisclosureTriangleLastValue',
]),
(
'#if TARGET_API_MAC_CARBON'
,
[
'IsAutomaticControlDragTrackingEnabledForWindow'
,
'SetAutomaticControlDragTrackingEnabledForWindow'
,
'GetControlByID'
,
'IsControlDragTrackingEnabled'
,
'SetControlDragTrackingEnabled'
,
'GetControlPropertyAttributes'
,
'ChangeControlPropertyAttributes'
,
'GetControlID'
,
'SetControlID'
,
'HandleControlSetCursor'
,
'GetControlClickActivation'
,
'HandleControlContextualMenuClick'
,
]),
(
'#if ACCESSOR_CALLS_ARE_FUNCTIONS'
,
[
# XXX These are silly, they should be #defined to access the fields
# directly. Later...
'GetControlBounds'
,
'IsControlHilited'
,
'GetControlHilite'
,
'GetControlOwner'
,
'GetControlDataHandle'
,
'GetControlPopupMenuHandle'
,
'GetControlPopupMenuID'
,
'SetControlDataHandle'
,
'SetControlBounds'
,
'SetControlPopupMenuHandle'
,
'SetControlPopupMenuID'
,
])]
def
makeblacklisttypes
(
self
):
...
...
@@ -101,6 +131,11 @@ class MyScanner(Scanner):
'ControlActionUPP'
,
'ControlButtonContentInfoPtr'
,
'Ptr'
,
'ControlDefSpec'
,
# Don't know how to do this yet
'ControlDefSpec_ptr'
,
# ditto
'Collection'
,
# Ditto
'DragTrackingMessage'
,
# Needs Drag module, must implement later
'DragReference'
,
# ditto
]
def
makerepairinstructions
(
self
):
...
...
Mac/Modules/ctl/ctlsupport.py
View file @
f7d5aa61
...
...
@@ -32,6 +32,8 @@ ControlPartCode = Type("ControlPartCode", "h")
DragConstraint
=
Type
(
"DragConstraint"
,
"H"
)
ControlVariant
=
Type
(
"ControlVariant"
,
"h"
)
IconTransformType
=
Type
(
"IconTransformType"
,
"h"
)
EventModifiers
=
Type
(
"EventModifiers"
,
"H"
)
ClickActivationResult
=
Type
(
"ClickActivationResult"
,
"l"
)
ControlButtonGraphicAlignment
=
Type
(
"ControlButtonGraphicAlignment"
,
"h"
)
ControlButtonTextAlignment
=
Type
(
"ControlButtonTextAlignment"
,
"h"
)
ControlButtonTextPlacement
=
Type
(
"ControlButtonTextPlacement"
,
"h"
)
...
...
@@ -40,9 +42,14 @@ ControlFocusPart = Type("ControlFocusPart", "h")
ControlFontStyleRec
=
OpaqueType
(
'ControlFontStyleRec'
,
'ControlFontStyle'
)
ControlFontStyleRec_ptr
=
ControlFontStyleRec
ControlID
=
OpaqueType
(
'ControlID'
,
'PyControlID'
)
ControlID_ptr
=
ControlID
includestuff
=
includestuff
+
"""
#include <%s>"""
%
MACHEADERFILE
+
"""
#ifndef kControlCheckBoxUncheckedValue
#include <ControlDefinitions.h>
#endif
staticforward PyObject *CtlObj_WhichControl(ControlHandle);
...
...
@@ -80,6 +87,26 @@ ControlFontStyle_Convert(v, itself)
QdRGB_Convert, &itself->backColor);
}
/*
** Parse/generate ControlID records
*/
static PyObject *
PyControlID_New(itself)
ControlID *itself;
{
return Py_BuildValue("O&l", PyMac_BuildOSType, itself->signature, itself->id);
}
static int
PyControlID_Convert(v, itself)
PyObject *v;
ControlID *itself;
{
return PyArg_ParseTuple(v, "O&l", PyMac_GetOSType, &itself->signature, &itself->id);
}
/* TrackControl and HandleControlClick callback support */
static PyObject *tracker;
static ControlActionUPP mytracker_upp;
...
...
Mac/Modules/dlg/Dlgmodule.c
View file @
f7d5aa61
...
...
@@ -10,6 +10,13 @@
#include <Dialogs.h>
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
#define GetDialogTextEditHandle(dlg) (((DialogPeek)(dlg))->textH)
#define SetPortDialogPort(dlg) SetPort(dlg)
#define GetDialogPort(dlg) ((CGrafPtr)(dlg))
#define GetDialogFromWindow(win) ((DialogRef)(win))
#endif
/* XXX Shouldn't this be a stack? */
static
PyObject
*
Dlg_FilterProc_callback
=
NULL
;
...
...
@@ -399,6 +406,63 @@ static PyObject *DlgObj_ShortenDITL(_self, _args)
return
_res
;
}
#if TARGET_API_MAC_CARBON
static
PyObject
*
DlgObj_InsertDialogItem
(
_self
,
_args
)
DialogObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
DialogItemIndex
afterItem
;
DialogItemType
itemType
;
Handle
itemHandle
;
Rect
box
;
if
(
!
PyArg_ParseTuple
(
_args
,
"hhO&O&"
,
&
afterItem
,
&
itemType
,
ResObj_Convert
,
&
itemHandle
,
PyMac_GetRect
,
&
box
))
return
NULL
;
_err
=
InsertDialogItem
(
_self
->
ob_itself
,
afterItem
,
itemType
,
itemHandle
,
&
box
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
DlgObj_RemoveDialogItems
(
_self
,
_args
)
DialogObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
DialogItemIndex
itemNo
;
DialogItemIndex
amountToRemove
;
Boolean
disposeItemData
;
if
(
!
PyArg_ParseTuple
(
_args
,
"hhb"
,
&
itemNo
,
&
amountToRemove
,
&
disposeItemData
))
return
NULL
;
_err
=
RemoveDialogItems
(
_self
->
ob_itself
,
itemNo
,
amountToRemove
,
disposeItemData
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
#endif
static
PyObject
*
DlgObj_StdFilterProc
(
_self
,
_args
)
DialogObject
*
_self
;
PyObject
*
_args
;
...
...
@@ -666,7 +730,21 @@ static PyObject *DlgObj_GetDialogWindow(_self, _args)
return
NULL
;
_rv
=
GetDialogWindow
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"O&"
,
WinObj_WhichWindow
,
_rv
);
WinObj_New
,
_rv
);
return
_res
;
}
static
PyObject
*
DlgObj_GetDialogTextEditHandle
(
_self
,
_args
)
DialogObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
TEHandle
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
GetDialogTextEditHandle
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"O&"
,
ResObj_New
,
_rv
);
return
_res
;
}
...
...
@@ -712,6 +790,33 @@ static PyObject *DlgObj_GetDialogKeyboardFocusItem(_self, _args)
return
_res
;
}
static
PyObject
*
DlgObj_SetPortDialogPort
(
_self
,
_args
)
DialogObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
SetPortDialogPort
(
_self
->
ob_itself
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
DlgObj_GetDialogPort
(
_self
,
_args
)
DialogObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
CGrafPtr
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
GetDialogPort
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"O&"
,
GrafObj_New
,
_rv
);
return
_res
;
}
#if !TARGET_API_MAC_CARBON
static
PyObject
*
DlgObj_SetGrafPortOfDialog
(
_self
,
_args
)
...
...
@@ -759,6 +864,16 @@ static PyMethodDef DlgObj_methods[] = {
"() -> (DialogItemIndex _rv)"
},
{
"ShortenDITL"
,
(
PyCFunction
)
DlgObj_ShortenDITL
,
1
,
"(DialogItemIndex numberItems) -> None"
},
#if TARGET_API_MAC_CARBON
{
"InsertDialogItem"
,
(
PyCFunction
)
DlgObj_InsertDialogItem
,
1
,
"(DialogItemIndex afterItem, DialogItemType itemType, Handle itemHandle, Rect box) -> None"
},
#endif
#if TARGET_API_MAC_CARBON
{
"RemoveDialogItems"
,
(
PyCFunction
)
DlgObj_RemoveDialogItems
,
1
,
"(DialogItemIndex itemNo, DialogItemIndex amountToRemove, Boolean disposeItemData) -> None"
},
#endif
{
"StdFilterProc"
,
(
PyCFunction
)
DlgObj_StdFilterProc
,
1
,
"() -> (Boolean _rv, EventRecord event, DialogItemIndex itemHit)"
},
{
"SetDialogDefaultItem"
,
(
PyCFunction
)
DlgObj_SetDialogDefaultItem
,
1
,
...
...
@@ -787,12 +902,18 @@ static PyMethodDef DlgObj_methods[] = {
"() -> (EventMask outMask)"
},
{
"GetDialogWindow"
,
(
PyCFunction
)
DlgObj_GetDialogWindow
,
1
,
"() -> (WindowPtr _rv)"
},
{
"GetDialogTextEditHandle"
,
(
PyCFunction
)
DlgObj_GetDialogTextEditHandle
,
1
,
"() -> (TEHandle _rv)"
},
{
"GetDialogDefaultItem"
,
(
PyCFunction
)
DlgObj_GetDialogDefaultItem
,
1
,
"() -> (SInt16 _rv)"
},
{
"GetDialogCancelItem"
,
(
PyCFunction
)
DlgObj_GetDialogCancelItem
,
1
,
"() -> (SInt16 _rv)"
},
{
"GetDialogKeyboardFocusItem"
,
(
PyCFunction
)
DlgObj_GetDialogKeyboardFocusItem
,
1
,
"() -> (SInt16 _rv)"
},
{
"SetPortDialogPort"
,
(
PyCFunction
)
DlgObj_SetPortDialogPort
,
1
,
"() -> None"
},
{
"GetDialogPort"
,
(
PyCFunction
)
DlgObj_GetDialogPort
,
1
,
"() -> (CGrafPtr _rv)"
},
#if !TARGET_API_MAC_CARBON
{
"SetGrafPortOfDialog"
,
(
PyCFunction
)
DlgObj_SetGrafPortOfDialog
,
1
,
...
...
@@ -1168,6 +1289,33 @@ static PyObject *Dlg_ResetAlertStage(_self, _args)
return
_res
;
}
#if TARGET_API_MAC_CARBON
static
PyObject
*
Dlg_GetParamText
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
Str255
param0
;
Str255
param1
;
Str255
param2
;
Str255
param3
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&O&O&O&"
,
PyMac_GetStr255
,
param0
,
PyMac_GetStr255
,
param1
,
PyMac_GetStr255
,
param2
,
PyMac_GetStr255
,
param3
))
return
NULL
;
GetParamText
(
param0
,
param1
,
param2
,
param3
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
#endif
static
PyObject
*
Dlg_NewFeaturesDialog
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
...
...
@@ -1209,6 +1357,22 @@ static PyObject *Dlg_NewFeaturesDialog(_self, _args)
return
_res
;
}
static
PyObject
*
Dlg_GetDialogFromWindow
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
DialogPtr
_rv
;
WindowPtr
window
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
WinObj_Convert
,
&
window
))
return
NULL
;
_rv
=
GetDialogFromWindow
(
window
);
_res
=
Py_BuildValue
(
"O&"
,
DlgObj_New
,
_rv
);
return
_res
;
}
static
PyObject
*
Dlg_SetUserItemHandler
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
...
...
@@ -1273,8 +1437,15 @@ static PyMethodDef Dlg_methods[] = {
"(SInt16 fontNum) -> None"
},
{
"ResetAlertStage"
,
(
PyCFunction
)
Dlg_ResetAlertStage
,
1
,
"() -> None"
},
#if TARGET_API_MAC_CARBON
{
"GetParamText"
,
(
PyCFunction
)
Dlg_GetParamText
,
1
,
"(Str255 param0, Str255 param1, Str255 param2, Str255 param3) -> None"
},
#endif
{
"NewFeaturesDialog"
,
(
PyCFunction
)
Dlg_NewFeaturesDialog
,
1
,
"(Rect inBoundsRect, Str255 inTitle, Boolean inIsVisible, SInt16 inProcID, WindowPtr inBehind, Boolean inGoAwayFlag, SInt32 inRefCon, Handle inItemListHandle, UInt32 inFlags) -> (DialogPtr _rv)"
},
{
"GetDialogFromWindow"
,
(
PyCFunction
)
Dlg_GetDialogFromWindow
,
1
,
"(WindowPtr window) -> (DialogPtr _rv)"
},
{
"SetUserItemHandler"
,
(
PyCFunction
)
Dlg_SetUserItemHandler
,
1
,
NULL
},
{
NULL
,
NULL
,
0
}
...
...
@@ -1282,6 +1453,17 @@ static PyMethodDef Dlg_methods[] = {
/* Return the WindowPtr corresponding to a DialogObject */
WindowPtr
DlgObj_ConvertToWindow
(
self
)
PyObject
*
self
;
{
if
(
DlgObj_Check
(
self
)
)
return
GetDialogWindow
(((
DialogObject
*
)
self
)
->
ob_itself
);
return
NULL
;
}
void
initDlg
()
{
...
...
@@ -1296,7 +1478,7 @@ void initDlg()
Dlg_Error
=
PyMac_GetOSErrException
();
if
(
Dlg_Error
==
NULL
||
PyDict_SetItemString
(
d
,
"Error"
,
Dlg_Error
)
!=
0
)
Py_FatalError
(
"can't initialize Dlg.Error"
)
;
return
;
Dialog_Type
.
ob_type
=
&
PyType_Type
;
Py_INCREF
(
&
Dialog_Type
);
if
(
PyDict_SetItemString
(
d
,
"DialogType"
,
(
PyObject
*
)
&
Dialog_Type
)
!=
0
)
...
...
Mac/Modules/dlg/dlgscan.py
View file @
f7d5aa61
...
...
@@ -59,11 +59,18 @@ class MyScanner(Scanner):
return
[
(
'#if !TARGET_API_MAC_CARBON'
,
[
'SetGrafPortOfDialog'
,
]),
(
'#if TARGET_API_MAC_CARBON'
,
[
'InsertDialogItem'
,
'RemoveDialogItems'
,
'GetParamText'
,
])]
def
makeblacklisttypes
(
self
):
return
[
"AlertStdAlertParamPtr"
,
# Too much work, for now
"AlertStdAlertParamRec"
,
# ditto
"AlertStdAlertParamRec_ptr"
,
# ditto
"QTModelessCallbackProcPtr"
,
]
...
...
Mac/Modules/dlg/dlgsupport.py
View file @
f7d5aa61
...
...
@@ -19,6 +19,8 @@ ModalFilterProcPtr.passInput = lambda name: "NewModalFilterProc(Dlg_PassFilterPr
ModalFilterUPP
=
ModalFilterProcPtr
RgnHandle
=
OpaqueByValueType
(
"RgnHandle"
,
"ResObj"
)
TEHandle
=
OpaqueByValueType
(
"TEHandle"
,
"ResObj"
)
CGrafPtr
=
OpaqueByValueType
(
"CGrafPtr"
,
"GrafObj"
)
DITLMethod
=
Type
(
"DITLMethod"
,
"h"
)
DialogItemIndex
=
Type
(
"DialogItemIndex"
,
"h"
)
...
...
@@ -31,6 +33,13 @@ EventMask = Type("EventMask", "H")
includestuff
=
includestuff
+
"""
#include <Dialogs.h>
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
#define GetDialogTextEditHandle(dlg) (((DialogPeek)(dlg))->textH)
#define SetPortDialogPort(dlg) SetPort(dlg)
#define GetDialogPort(dlg) ((CGrafPtr)(dlg))
#define GetDialogFromWindow(win) ((DialogRef)(win))
#endif
/* XXX Shouldn't this be a stack? */
static PyObject *Dlg_FilterProc_callback = NULL;
...
...
@@ -178,14 +187,14 @@ 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(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
)
...
...
Mac/Modules/drag/Dragmodule.c
View file @
f7d5aa61
This diff is collapsed.
Click to expand it.
Mac/Modules/drag/dragsupport.py
View file @
f7d5aa61
...
...
@@ -12,7 +12,7 @@ OBJECTNAME = 'DragObj' # The basic name of the objects used here
# The following is *usually* unchanged but may still require tuning
MODPREFIX
=
MODNAME
# The prefix for module-wide routines
OBJECTTYPE
=
'DragRef
erence
'
# The C type used to represent them
OBJECTTYPE
=
'DragRef'
# The C type used to represent them
OBJECTPREFIX
=
MODPREFIX
+
'Obj'
# The prefix for object methods
INPUTFILE
=
string
.
lower
(
MODPREFIX
)
+
'gen.py'
# The file generated by the scanner
OUTPUTFILE
=
MODNAME
+
"module.c"
# The file generated by this program
...
...
@@ -21,31 +21,21 @@ from macsupport import *
# Create the type objects
DragReference
=
OpaqueByValueType
(
OBJECTTYPE
,
OBJECTPREFIX
)
DragRef
=
OpaqueByValueType
(
OBJECTTYPE
,
OBJECTPREFIX
)
DragItemRef
=
Type
(
"ItemReference"
,
"l"
)
# Old names
DragReference
=
DragRef
ItemReference
=
DragItemRef
##CCTabHandle = OpaqueByValueType("CCTabHandle", "ResObj")
##AuxCtlHandle = OpaqueByValueType("AuxCtlHandle", "ResObj")
##ControlPartCode = Type("ControlPartCode", "h")
##DragConstraint = Type("DragConstraint", "h")
##ControlVariant = Type("ControlVariant", "h")
##IconTransformType = Type("IconTransformType", "h")
##ControlButtonGraphicAlignment = Type("ControlButtonGraphicAlignment", "h")
##ControlButtonTextAlignment = Type("ControlButtonTextAlignment", "h")
##ControlButtonTextPlacement = Type("ControlButtonTextPlacement", "h")
##ControlContentType = Type("ControlContentType", "h")
##ControlFocusPart = Type("ControlFocusPart", "h")
##
##ControlFontStyleRec = OpaqueType('ControlFontStyleRec', 'ControlFontStyle')
##ControlFontStyleRec_ptr = ControlFontStyleRec
PixMapHandle
=
OpaqueByValueType
(
"PixMapHandle"
,
"ResObj"
)
RgnHandle
=
OpaqueByValueType
(
"RgnHandle"
,
"ResObj"
)
AEDesc
=
OpaqueType
(
'AEDesc'
)
AEDesc_ptr
=
AEDesc
RGBColor
=
OpaqueType
(
"RGBColor"
,
"QdRGB"
)
ItemReference
=
Type
(
"ItemReference"
,
"l"
)
FlavorType
=
OSTypeType
(
"FlavorType"
)
DragAttributes
=
Type
(
"DragAttributes"
,
"l"
)
DragBehaviors
=
Type
(
"DragBehaviors"
,
"l"
)
DragImageFlags
=
Type
(
"DragImageFlags"
,
"l"
)
DragImageTranslucency
=
Type
(
"DragImageTranslucency"
,
"l"
)
DragRegionMessage
=
Type
(
"DragRegionMessage"
,
"h"
)
...
...
Mac/Modules/evt/Evtmodule.c
View file @
f7d5aa61
...
...
@@ -316,6 +316,57 @@ static PyObject *Evt_SystemEvent(_self, _args)
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
Evt_GetGlobalMouse
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
Point
globalMouse
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
GetGlobalMouse
(
&
globalMouse
);
_res
=
Py_BuildValue
(
"O&"
,
PyMac_BuildPoint
,
globalMouse
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
Evt_GetCurrentKeyModifiers
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
UInt32
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
GetCurrentKeyModifiers
();
_res
=
Py_BuildValue
(
"l"
,
_rv
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
Evt_CheckEventQueueForUserCancel
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
Boolean
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
CheckEventQueueForUserCancel
();
_res
=
Py_BuildValue
(
"b"
,
_rv
);
return
_res
;
}
#endif
static
PyObject
*
Evt_WaitNextEvent
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
...
...
@@ -396,6 +447,21 @@ static PyMethodDef Evt_methods[] = {
{
"SystemEvent"
,
(
PyCFunction
)
Evt_SystemEvent
,
1
,
"(EventRecord theEvent) -> (Boolean _rv)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"GetGlobalMouse"
,
(
PyCFunction
)
Evt_GetGlobalMouse
,
1
,
"() -> (Point globalMouse)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"GetCurrentKeyModifiers"
,
(
PyCFunction
)
Evt_GetCurrentKeyModifiers
,
1
,
"() -> (UInt32 _rv)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"CheckEventQueueForUserCancel"
,
(
PyCFunction
)
Evt_CheckEventQueueForUserCancel
,
1
,
"() -> (Boolean _rv)"
},
#endif
{
"WaitNextEvent"
,
(
PyCFunction
)
Evt_WaitNextEvent
,
1
,
"(EventMask eventMask, UInt32 sleep [,RegionHandle]) -> (Boolean _rv, EventRecord theEvent)"
},
{
NULL
,
NULL
,
0
}
...
...
@@ -417,7 +483,7 @@ void initEvt()
Evt_Error
=
PyMac_GetOSErrException
();
if
(
Evt_Error
==
NULL
||
PyDict_SetItemString
(
d
,
"Error"
,
Evt_Error
)
!=
0
)
Py_FatalError
(
"can't initialize Evt.Error"
)
;
return
;
}
/* ========================= End module Evt ========================= */
...
...
Mac/Modules/evt/evtscan.py
View file @
f7d5aa61
...
...
@@ -43,6 +43,11 @@ class MyScanner(Scanner):
'SystemClick'
,
'GetOSEvent'
,
'OSEventAvail'
,
]),
(
'#if TARGET_API_MAC_CARBON'
,
[
'CheckEventQueueForUserCancel'
,
'GetCurrentKeyModifiers'
,
'GetGlobalMouse'
,
])]
def
makeblacklistnames
(
self
):
...
...
Mac/Modules/fm/Fmmodule.c
View file @
f7d5aa61
...
...
@@ -319,14 +319,14 @@ static PyObject *Fm_SetAntiAliasedTextEnabled(_self, _args)
{
PyObject
*
_res
=
NULL
;
OSStatus
_err
;
Boolean
i
n
Enable
;
SInt16
i
n
MinFontSize
;
Boolean
iEnable
;
SInt16
iMinFontSize
;
if
(
!
PyArg_ParseTuple
(
_args
,
"bh"
,
&
i
n
Enable
,
&
i
n
MinFontSize
))
&
iEnable
,
&
iMinFontSize
))
return
NULL
;
_err
=
SetAntiAliasedTextEnabled
(
i
n
Enable
,
i
n
MinFontSize
);
_err
=
SetAntiAliasedTextEnabled
(
iEnable
,
iMinFontSize
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
...
...
@@ -339,13 +339,13 @@ static PyObject *Fm_IsAntiAliasedTextEnabled(_self, _args)
{
PyObject
*
_res
=
NULL
;
Boolean
_rv
;
SInt16
o
ut
MinFontSize
;
SInt16
oMinFontSize
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
IsAntiAliasedTextEnabled
(
&
o
ut
MinFontSize
);
_rv
=
IsAntiAliasedTextEnabled
(
&
oMinFontSize
);
_res
=
Py_BuildValue
(
"bh"
,
_rv
,
o
ut
MinFontSize
);
oMinFontSize
);
return
_res
;
}
...
...
@@ -394,9 +394,9 @@ static PyMethodDef Fm_methods[] = {
{
"GetAppFont"
,
(
PyCFunction
)
Fm_GetAppFont
,
1
,
"() -> (short _rv)"
},
{
"SetAntiAliasedTextEnabled"
,
(
PyCFunction
)
Fm_SetAntiAliasedTextEnabled
,
1
,
"(Boolean i
nEnable, SInt16 in
MinFontSize) -> None"
},
"(Boolean i
Enable, SInt16 i
MinFontSize) -> None"
},
{
"IsAntiAliasedTextEnabled"
,
(
PyCFunction
)
Fm_IsAntiAliasedTextEnabled
,
1
,
"() -> (Boolean _rv, SInt16 o
ut
MinFontSize)"
},
"() -> (Boolean _rv, SInt16 oMinFontSize)"
},
{
NULL
,
NULL
,
0
}
};
...
...
@@ -416,7 +416,7 @@ void initFm()
Fm_Error
=
PyMac_GetOSErrException
();
if
(
Fm_Error
==
NULL
||
PyDict_SetItemString
(
d
,
"Error"
,
Fm_Error
)
!=
0
)
Py_FatalError
(
"can't initialize Fm.Error"
)
;
return
;
}
/* ========================= End module Fm ========================== */
...
...
Mac/Modules/help/Helpmodule.c
View file @
f7d5aa61
...
...
@@ -315,7 +315,7 @@ void initHelp()
Help_Error
=
PyMac_GetOSErrException
();
if
(
Help_Error
==
NULL
||
PyDict_SetItemString
(
d
,
"Error"
,
Help_Error
)
!=
0
)
Py_FatalError
(
"can't initialize Help.Error"
)
;
return
;
}
/* ======================== End module Help ========================= */
...
...
Mac/Modules/icn/Icnmodule.c
View file @
f7d5aa61
...
...
@@ -1248,6 +1248,120 @@ static PyObject *Icn_GetCustomIconsEnabled(_self, _args)
return
_res
;
}
static
PyObject
*
Icn_IsIconRefMaskEmpty
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
Boolean
_rv
;
IconRef
iconRef
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
ResObj_Convert
,
&
iconRef
))
return
NULL
;
_rv
=
IsIconRefMaskEmpty
(
iconRef
);
_res
=
Py_BuildValue
(
"b"
,
_rv
);
return
_res
;
}
#if TARGET_API_MAC_CARBON
static
PyObject
*
Icn_GetIconRefVariant
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
IconRef
_rv
;
IconRef
inIconRef
;
OSType
inVariant
;
IconTransformType
outTransform
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&O&"
,
ResObj_Convert
,
&
inIconRef
,
PyMac_GetOSType
,
&
inVariant
))
return
NULL
;
_rv
=
GetIconRefVariant
(
inIconRef
,
inVariant
,
&
outTransform
);
_res
=
Py_BuildValue
(
"O&h"
,
ResObj_New
,
_rv
,
outTransform
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
Icn_RegisterIconRefFromIconFile
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
OSType
creator
;
OSType
iconType
;
FSSpec
iconFile
;
IconRef
theIconRef
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&O&O&"
,
PyMac_GetOSType
,
&
creator
,
PyMac_GetOSType
,
&
iconType
,
PyMac_GetFSSpec
,
&
iconFile
))
return
NULL
;
_err
=
RegisterIconRefFromIconFile
(
creator
,
iconType
,
&
iconFile
,
&
theIconRef
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"O&"
,
ResObj_New
,
theIconRef
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
Icn_ReadIconFile
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
FSSpec
iconFile
;
IconFamilyHandle
iconFamily
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
PyMac_GetFSSpec
,
&
iconFile
))
return
NULL
;
_err
=
ReadIconFile
(
&
iconFile
,
&
iconFamily
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"O&"
,
ResObj_New
,
iconFamily
);
return
_res
;
}
#endif
#if TARGET_API_MAC_CARBON
static
PyObject
*
Icn_WriteIconFile
(
_self
,
_args
)
PyObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
IconFamilyHandle
iconFamily
;
FSSpec
iconFile
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&O&"
,
ResObj_Convert
,
&
iconFamily
,
PyMac_GetFSSpec
,
&
iconFile
))
return
NULL
;
_err
=
WriteIconFile
(
iconFamily
,
&
iconFile
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
#endif
static
PyMethodDef
Icn_methods
[]
=
{
{
"GetCIcon"
,
(
PyCFunction
)
Icn_GetCIcon
,
1
,
"(SInt16 iconID) -> (CIconHandle _rv)"
},
...
...
@@ -1364,6 +1478,28 @@ static PyMethodDef Icn_methods[] = {
"(SInt16 vRefNum, Boolean enableCustomIcons) -> None"
},
{
"GetCustomIconsEnabled"
,
(
PyCFunction
)
Icn_GetCustomIconsEnabled
,
1
,
"(SInt16 vRefNum) -> (Boolean customIconsEnabled)"
},
{
"IsIconRefMaskEmpty"
,
(
PyCFunction
)
Icn_IsIconRefMaskEmpty
,
1
,
"(IconRef iconRef) -> (Boolean _rv)"
},
#if TARGET_API_MAC_CARBON
{
"GetIconRefVariant"
,
(
PyCFunction
)
Icn_GetIconRefVariant
,
1
,
"(IconRef inIconRef, OSType inVariant) -> (IconRef _rv, IconTransformType outTransform)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"RegisterIconRefFromIconFile"
,
(
PyCFunction
)
Icn_RegisterIconRefFromIconFile
,
1
,
"(OSType creator, OSType iconType, FSSpec iconFile) -> (IconRef theIconRef)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"ReadIconFile"
,
(
PyCFunction
)
Icn_ReadIconFile
,
1
,
"(FSSpec iconFile) -> (IconFamilyHandle iconFamily)"
},
#endif
#if TARGET_API_MAC_CARBON
{
"WriteIconFile"
,
(
PyCFunction
)
Icn_WriteIconFile
,
1
,
"(IconFamilyHandle iconFamily, FSSpec iconFile) -> None"
},
#endif
{
NULL
,
NULL
,
0
}
};
...
...
@@ -1383,7 +1519,7 @@ void initIcn()
Icn_Error
=
PyMac_GetOSErrException
();
if
(
Icn_Error
==
NULL
||
PyDict_SetItemString
(
d
,
"Error"
,
Icn_Error
)
!=
0
)
Py_FatalError
(
"can't initialize Icn.Error"
)
;
return
;
}
/* ========================= End module Icn ========================= */
...
...
Mac/Modules/icn/icnscan.py
View file @
f7d5aa61
...
...
@@ -49,6 +49,12 @@ class MyScanner(Scanner):
return
[
(
'#if !TARGET_API_MAC_CARBON'
,
[
'IconServicesTerminate'
,
]),
(
'#if TARGET_API_MAC_CARBON'
,
[
'WriteIconFile'
,
'ReadIconFile'
,
'RegisterIconRefFromIconFile'
,
'GetIconRefVariant'
,
])]
def
makeblacklisttypes
(
self
):
...
...
Mac/Modules/list/Listmodule.c
View file @
f7d5aa61
This diff is collapsed.
Click to expand it.
Mac/Modules/list/listscan.py
View file @
f7d5aa61
...
...
@@ -40,10 +40,24 @@ class MyScanner(Scanner):
"LDispose"
,
# Done by removing the object
"LSearch"
,
# We don't want to handle procs just yet
"LGetCellDataLocation"
,
# What does this do??
# These have funny argument/return values
"GetListViewBounds"
,
"GetListCellIndent"
,
"GetListCellSize"
,
"GetListVisibleCells"
,
"GetListClickLocation"
,
"GetListMouseLocation"
,
"GetListDataBounds"
,
"SetListLastClick"
,
]
def
makeblacklisttypes
(
self
):
return
[
'ListDefSpec'
,
# Too difficult for now
'ListDefSpec_ptr'
,
# ditto
"ListDefUPP"
,
"ListClickLoopUPP"
,
]
def
makerepairinstructions
(
self
):
...
...
Mac/Modules/list/listsupport.py
View file @
f7d5aa61
...
...
@@ -22,16 +22,46 @@ from macsupport import *
# Create the type objects
ListHandle
=
OpaqueByValueType
(
"ListHandle"
,
"ListObj"
)
ListRef
=
ListHandle
# Obsolete, but used in Lists.h
Cell
=
Point
ListBounds
=
Rect
ListBounds_ptr
=
Rect_ptr
VarOutBufferShortsize
=
VarHeapOutputBufferType
(
'char'
,
'short'
,
's'
)
# (buf, &len)
InBufferShortsize
=
VarInputBufferType
(
'char'
,
'short'
,
's'
)
# (buf, len)
RgnHandle
=
OpaqueByValueType
(
"RgnHandle"
,
"ResObj"
)
DataHandle
=
OpaqueByValueType
(
"DataHandle"
,
"ResObj"
)
Handle
=
OpaqueByValueType
(
"Handle"
,
"ResObj"
)
CGrafPtr
=
OpaqueByValueType
(
"CGrafPtr"
,
"GrafObj"
)
includestuff
=
includestuff
+
"""
#include <%s>"""
%
MACHEADERFILE
+
"""
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
#define GetListPort(list) ((CGrafPtr)(*(list))->port)
#define GetListVerticalScrollBar(list) ((*(list))->vScroll)
#define GetListHorizontalScrollBar(list) ((*(list))->hScroll)
#define GetListActive(list) ((*(list))->lActive)
#define GetListClickTime(list) ((*(list))->clikTime)
#define GetListRefCon(list) ((*(list))->refCon)
#define GetListDefinition(list) ((*(list))->listDefProc) /* XXX Is this indeed the same? */
#define GetListUserHandle(list) ((*(list))->userHandle)
#define GetListDataHandle(list) ((*(list))->cells)
#define GetListFlags(list) ((*(list))->listFlags)
#define GetListSelectionFlags(list) ((*(list))->selFlags)
#define SetListViewBounds(list, bounds) (((*(list))->rView) = *(bounds))
#define SetListPort(list, port) (((*(list))->port) = (GrafPtr)(port))
#define SetListCellIndent(list, ind) (((*(list))->indent) = *(ind))
#define SetListClickTime(list, time) (((*(list))->clikTime) = (time))
#define SetListLastClick(list, click) (((*(list)->lastClick) = *(click))
#define SetListRefCon(list, refcon) (((*(list))->refCon) = (refcon))
#define SetListUserHandle(list, handle) (((*(list))->userHandle) = (handle))
#define SetListFlags(list, flags) (((*(list))->listFlags) = (flags))
#define SetListSelectionFlags(list, flags) (((*(list))->selFlags) = (flags))
#endif
#define as_List(x) ((ListHandle)x)
#define as_Resource(lh) ((Handle)lh)
"""
...
...
Mac/Modules/menu/Menumodule.c
View file @
f7d5aa61
This diff is collapsed.
Click to expand it.
Mac/Modules/menu/menuscan.py
View file @
f7d5aa61
...
...
@@ -38,6 +38,10 @@ class MyScanner(Scanner):
"GetMenuItemPropertySize"
,
"SetMenuItemProperty"
,
"RemoveMenuItemProperty"
,
"SetMenuCommandProperty"
,
"GetMenuCommandProperty"
,
"GetMenuTitle"
,
# Funny arg/returnvalue
"SetMenuTitle"
,
]
def
makegreylist
(
self
):
...
...
@@ -55,6 +59,31 @@ class MyScanner(Scanner):
'SetMenuFlash'
,
'InitMenus'
,
'InitProcMenu'
,
]),
(
'#if TARGET_API_MAC_CARBON'
,
[
'DisposeMenuBar'
,
'DuplicateMenuBar'
,
'CreateNewMenu'
,
'GetFontFamilyFromMenuSelection'
,
'UpdateStandardFontMenu'
,
'CreateStandardFontMenu'
,
'RemoveMenuCommandProperty'
,
'GetMenuCommandPropertySize'
,
'IsMenuCommandEnabled'
,
'DisableMenuCommand'
,
'EnableMenuCommand'
,
'GetIndMenuItemWithCommandID'
,
'CountMenuItemsWithCommandID'
,
'MenuHasEnabledItems'
,
'EnableAllMenuItems'
,
'DisableAllMenuItems'
,
'ChangeMenuItemAttributes'
,
'GetMenuItemAttributes'
,
'ChangeMenuAttributes'
,
'GetMenuAttributes'
,
'ChangeMenuItemPropertyAttributes'
,
'GetMenuItemPropertyAttributes'
,
])]
def
makeblacklisttypes
(
self
):
...
...
@@ -64,6 +93,9 @@ class MyScanner(Scanner):
'MCTablePtr'
,
'AEDesc_ptr'
,
# For now: doable, but not easy
'ProcessSerialNumber'
,
# ditto
"MenuDefSpecPtr"
,
# Too difficult for now
"MenuDefSpec_ptr"
,
# ditto
"MenuTrackingData"
,
]
def
makerepairinstructions
(
self
):
...
...
Mac/Modules/menu/menusupport.py
View file @
f7d5aa61
...
...
@@ -25,13 +25,30 @@ from macsupport import *
MenuHandle
=
OpaqueByValueType
(
OBJECTTYPE
,
OBJECTPREFIX
)
MenuRef
=
MenuHandle
Handle
=
OpaqueByValueType
(
"Handle"
,
"ResObj"
)
MenuBarHandle
=
OpaqueByValueType
(
"MenuBarHandle"
,
"ResObj"
)
MenuID
=
Type
(
"MenuID"
,
"h"
)
MenuItemIndex
=
Type
(
"MenuItemIndex"
,
"h"
)
MenuCommand
=
Type
(
"MenuCommand"
,
"l"
)
MenuAttributes
=
Type
(
"MenuAttributes"
,
"l"
)
MenuItemAttributes
=
Type
(
"MenuItemAttributes"
,
"l"
)
unsigned_char
=
Type
(
'unsigned char'
,
'b'
)
FMFontFamily
=
Type
(
"FMFontFamily"
,
"h"
)
FMFontStyle
=
Type
(
"FMFontStyle"
,
"h"
)
includestuff
=
includestuff
+
"""
#include <Devices.h> /* Defines OpenDeskAcc in universal headers */
#include <%s>"""
%
MACHEADERFILE
+
"""
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
#define GetMenuID(menu) ((*(menu))->menuID)
#define GetMenuWidth(menu) ((*(menu))->menuWidth)
#define GetMenuHeight(menu) ((*(menu))->menuHeight)
#define SetMenuID(menu, id) ((*(menu))->menuID = (id))
#define SetMenuWidth(menu, width) ((*(menu))->menuWidth = (width))
#define SetMenuHeight(menu, height) ((*(menu))->menuHeight = (height))
#endif
#define as_Menu(h) ((MenuHandle)h)
#define as_Resource(h) ((Handle)h)
"""
...
...
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