Commit ee8dc5d3 authored by Jack Jansen's avatar Jack Jansen

Getting rid of pre-Carbon (MacOS8) support. All code depending on

TARGET_API_MAC_OS8 (or !TARGET_API_MAC_CARBON) is gone. Also some
TARGET_API_MAC_OSX conditional code is gone, because it is no longer
used on OSX-only Python (only in MacPython-OS9).
parent bca67e8f
......@@ -83,12 +83,6 @@ int PyMac_FindCodeResourceModule(PyStringObject *, char *, char *); /* Test for
PyObject * PyMac_LoadCodeResourceModule(char *, char *); /* Load 'PYD ' resource from file */
struct filedescr *PyMac_FindModuleExtension(char *, size_t *, char *); /* Look for module in single folder */
#if TARGET_API_MAC_OS8
int PyMac_GetDirectory(FSSpec *dirfss, char *prompt); /* Ask user for a directory */
void PyMac_PromptGetFile(short numTypes, ConstSFTypeListPtr typeList,
StandardFileReply *reply, char *prompt); /* Ask user for file, with prompt */
#endif /* TARGET_API_MAC_OS8 */
void PyMac_InitApplet(void); /* Initialize and run an Applet */
void PyMac_Initialize(void); /* Initialize function for embedding Python */
......
......@@ -351,15 +351,11 @@ navrr_getattr(navrrobject *self, char *name)
PyErr_Mac(ErrorObject, err);
return NULL;
}
#if TARGET_API_MAC_CARBON
if (err=AEGetDescData(&desc, &fss, sizeof(FSSpec))) {
Py_DECREF(rv);
PyErr_Mac(ErrorObject, err);
return NULL;
}
#else
memcpy((void *)&fss, (void *)*desc.dataHandle, sizeof(FSSpec));
#endif
rvitem = PyMac_BuildFSSpec(&fss);
PyList_SetItem(rv, i, rvitem);
AEDisposeDesc(&desc);
......
......@@ -610,8 +610,6 @@ static PyObject *AEDesc_AEPutAttributeDesc(AEDescObject *_self, PyObject *_args)
return _res;
}
#if TARGET_API_MAC_CARBON
static PyObject *AEDesc_AEGetDescDataSize(AEDescObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
......@@ -626,7 +624,6 @@ static PyObject *AEDesc_AEGetDescDataSize(AEDescObject *_self, PyObject *_args)
_rv);
return _res;
}
#endif
static PyObject *AEDesc_AESend(AEDescObject *_self, PyObject *_args)
{
......@@ -807,11 +804,8 @@ static PyMethodDef AEDesc_methods[] = {
PyDoc_STR("(AEKeyword theAEKeyword, DescType typeCode, Buffer dataPtr) -> None")},
{"AEPutAttributeDesc", (PyCFunction)AEDesc_AEPutAttributeDesc, 1,
PyDoc_STR("(AEKeyword theAEKeyword, AEDesc theAEDesc) -> None")},
#if TARGET_API_MAC_CARBON
{"AEGetDescDataSize", (PyCFunction)AEDesc_AEGetDescDataSize, 1,
PyDoc_STR("() -> (Size _rv)")},
#endif
{"AESend", (PyCFunction)AEDesc_AESend, 1,
PyDoc_STR("(AESendMode sendMode, AESendPriority sendPriority, long timeOutInTicks) -> (AppleEvent reply)")},
{"AEResetTimer", (PyCFunction)AEDesc_AEResetTimer, 1,
......@@ -1048,8 +1042,6 @@ static PyObject *AE_AECreateAppleEvent(PyObject *_self, PyObject *_args)
return _res;
}
#if TARGET_API_MAC_CARBON
static PyObject *AE_AEReplaceDescData(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
......@@ -1075,7 +1067,6 @@ static PyObject *AE_AEReplaceDescData(PyObject *_self, PyObject *_args)
AEDesc_New, &theAEDesc);
return _res;
}
#endif
static PyObject *AE_AEProcessAppleEvent(PyObject *_self, PyObject *_args)
{
......@@ -1360,11 +1351,8 @@ static PyMethodDef AE_methods[] = {
PyDoc_STR("(Buffer factoringPtr, Boolean isRecord) -> (AEDescList resultList)")},
{"AECreateAppleEvent", (PyCFunction)AE_AECreateAppleEvent, 1,
PyDoc_STR("(AEEventClass theAEEventClass, AEEventID theAEEventID, AEAddressDesc target, AEReturnID returnID, AETransactionID transactionID) -> (AppleEvent result)")},
#if TARGET_API_MAC_CARBON
{"AEReplaceDescData", (PyCFunction)AE_AEReplaceDescData, 1,
PyDoc_STR("(DescType typeCode, Buffer dataPtr) -> (AEDesc theAEDesc)")},
#endif
{"AEProcessAppleEvent", (PyCFunction)AE_AEProcessAppleEvent, 1,
PyDoc_STR("(EventRecord theEventRecord) -> None")},
{"AEGetInteractionAllowed", (PyCFunction)AE_AEGetInteractionAllowed, 1,
......
......@@ -51,12 +51,6 @@ class AppleEventsScanner(Scanner):
"kAEUseStandardDispatch",
]
def makegreylist(self):
return [
('#if TARGET_API_MAC_CARBON', [
'AEGetDescDataSize',
'AEReplaceDescData',
])]
def makeblacklisttypes(self):
return [
"ProcPtr",
......
......@@ -924,8 +924,6 @@ static PyObject *App_UseThemeFont(PyObject *_self, PyObject *_args)
return _res;
}
#if TARGET_API_MAC_CARBON
static PyObject *App_DrawThemeTextBox(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
......@@ -959,9 +957,6 @@ static PyObject *App_DrawThemeTextBox(PyObject *_self, PyObject *_args)
_res = Py_None;
return _res;
}
#endif
#if TARGET_API_MAC_CARBON
static PyObject *App_TruncateThemeText(PyObject *_self, PyObject *_args)
{
......@@ -994,9 +989,6 @@ static PyObject *App_TruncateThemeText(PyObject *_self, PyObject *_args)
outTruncated);
return _res;
}
#endif
#if TARGET_API_MAC_CARBON
static PyObject *App_GetThemeTextDimensions(PyObject *_self, PyObject *_args)
{
......@@ -1030,9 +1022,6 @@ static PyObject *App_GetThemeTextDimensions(PyObject *_self, PyObject *_args)
outBaseline);
return _res;
}
#endif
#if TARGET_API_MAC_CARBON
static PyObject *App_GetThemeTextShadowOutset(PyObject *_self, PyObject *_args)
{
......@@ -1056,7 +1045,6 @@ static PyObject *App_GetThemeTextShadowOutset(PyObject *_self, PyObject *_args)
PyMac_BuildRect, &outOutset);
return _res;
}
#endif
static PyObject *App_DrawThemeScrollBarArrows(PyObject *_self, PyObject *_args)
{
......@@ -1658,8 +1646,6 @@ static PyObject *App_GetThemeTextColor(PyObject *_self, PyObject *_args)
return _res;
}
#if TARGET_API_MAC_CARBON
static PyObject *App_GetThemeMetric(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
......@@ -1679,7 +1665,6 @@ static PyObject *App_GetThemeMetric(PyObject *_self, PyObject *_args)
outMetric);
return _res;
}
#endif
static PyMethodDef App_methods[] = {
{"RegisterAppearanceClient", (PyCFunction)App_RegisterAppearanceClient, 1,
......@@ -1754,26 +1739,14 @@ static PyMethodDef App_methods[] = {
PyDoc_STR("() -> (ThemeCheckBoxStyle outStyle)")},
{"UseThemeFont", (PyCFunction)App_UseThemeFont, 1,
PyDoc_STR("(ThemeFontID inFontID, ScriptCode inScript) -> None")},
#if TARGET_API_MAC_CARBON
{"DrawThemeTextBox", (PyCFunction)App_DrawThemeTextBox, 1,
PyDoc_STR("(CFStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, Boolean inWrapToWidth, Rect inBoundingBox, SInt16 inJust) -> None")},
#endif
#if TARGET_API_MAC_CARBON
{"TruncateThemeText", (PyCFunction)App_TruncateThemeText, 1,
PyDoc_STR("(CFMutableStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, SInt16 inPixelWidthLimit, TruncCode inTruncWhere) -> (Boolean outTruncated)")},
#endif
#if TARGET_API_MAC_CARBON
{"GetThemeTextDimensions", (PyCFunction)App_GetThemeTextDimensions, 1,
PyDoc_STR("(CFStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, Boolean inWrapToWidth, Point ioBounds) -> (Point ioBounds, SInt16 outBaseline)")},
#endif
#if TARGET_API_MAC_CARBON
{"GetThemeTextShadowOutset", (PyCFunction)App_GetThemeTextShadowOutset, 1,
PyDoc_STR("(ThemeFontID inFontID, ThemeDrawState inState) -> (Rect outOutset)")},
#endif
{"DrawThemeScrollBarArrows", (PyCFunction)App_DrawThemeScrollBarArrows, 1,
PyDoc_STR("(Rect bounds, ThemeTrackEnableState enableState, ThemeTrackPressState pressState, Boolean isHoriz) -> (Rect trackBounds)")},
{"GetThemeScrollBarTrackRect", (PyCFunction)App_GetThemeScrollBarTrackRect, 1,
......@@ -1822,11 +1795,8 @@ static PyMethodDef App_methods[] = {
PyDoc_STR("(ThemeBrush inBrush, SInt16 inDepth, Boolean inColorDev) -> (RGBColor outColor)")},
{"GetThemeTextColor", (PyCFunction)App_GetThemeTextColor, 1,
PyDoc_STR("(ThemeTextColor inColor, SInt16 inDepth, Boolean inColorDev) -> (RGBColor outColor)")},
#if TARGET_API_MAC_CARBON
{"GetThemeMetric", (PyCFunction)App_GetThemeMetric, 1,
PyDoc_STR("(ThemeMetric inMetric) -> (SInt32 outMetric)")},
#endif
{NULL, NULL, 0}
};
......
......@@ -51,16 +51,6 @@ class MyScanner(Scanner):
"appearanceBadCursorIndexErr",
]
def makegreylist(self):
return [
('#if TARGET_API_MAC_CARBON', [
'GetThemeMetric',
'GetThemeTextShadowOutset',
'GetThemeTextDimensions',
'TruncateThemeText',
'DrawThemeTextBox',
])]
def makeblacklisttypes(self):
return [
"MenuTitleDrawingUPP",
......
......@@ -186,44 +186,6 @@ static PyObject *CmpInstObj_SetComponentInstanceStorage(ComponentInstanceObject
return _res;
}
#if !TARGET_API_MAC_CARBON
static PyObject *CmpInstObj_GetComponentInstanceA5(ComponentInstanceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long _rv;
#ifndef GetComponentInstanceA5
PyMac_PRECHECK(GetComponentInstanceA5);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = GetComponentInstanceA5(_self->ob_itself);
_res = Py_BuildValue("l",
_rv);
return _res;
}
#endif
#if !TARGET_API_MAC_CARBON
static PyObject *CmpInstObj_SetComponentInstanceA5(ComponentInstanceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
long theA5;
#ifndef SetComponentInstanceA5
PyMac_PRECHECK(SetComponentInstanceA5);
#endif
if (!PyArg_ParseTuple(_args, "l",
&theA5))
return NULL;
SetComponentInstanceA5(_self->ob_itself,
theA5);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
#endif
static PyObject *CmpInstObj_ComponentFunctionImplemented(ComponentInstanceObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
......@@ -286,16 +248,6 @@ static PyMethodDef CmpInstObj_methods[] = {
PyDoc_STR("() -> (Handle _rv)")},
{"SetComponentInstanceStorage", (PyCFunction)CmpInstObj_SetComponentInstanceStorage, 1,
PyDoc_STR("(Handle theStorage) -> None")},
#if !TARGET_API_MAC_CARBON
{"GetComponentInstanceA5", (PyCFunction)CmpInstObj_GetComponentInstanceA5, 1,
PyDoc_STR("() -> (long _rv)")},
#endif
#if !TARGET_API_MAC_CARBON
{"SetComponentInstanceA5", (PyCFunction)CmpInstObj_SetComponentInstanceA5, 1,
PyDoc_STR("(long theA5) -> None")},
#endif
{"ComponentFunctionImplemented", (PyCFunction)CmpInstObj_ComponentFunctionImplemented, 1,
PyDoc_STR("(short ftnNumber) -> (long _rv)")},
{"GetComponentVersion", (PyCFunction)CmpInstObj_GetComponentVersion, 1,
......
......@@ -59,15 +59,10 @@ class MyScanner(Scanner):
"OpenAComponent",
"GetComponentPublicResource", # Missing in CW Pro 6
"CallComponentGetPublicResource", # Missing in CW Pro 6
'SetComponentInstanceA5',
'GetComponentInstanceA5',
]
def makegreylist(self):
return [
('#if !TARGET_API_MAC_CARBON', [
'SetComponentInstanceA5',
'GetComponentInstanceA5',
])]
def makeblacklisttypes(self):
return [
"ResourceSpec",
......
This diff is collapsed.
......@@ -94,160 +94,13 @@ class MyScanner(Scanner):
# too lazy for now
'GetImageWellContentInfo',
'GetBevelButtonContentInfo',
# OS8 only
'GetAuxiliaryControlRecord',
'SetControlColor',
]
def makegreylist(self):
return [
('#if !TARGET_API_MAC_CARBON', [
'GetAuxiliaryControlRecord',
'SetControlColor',
# These have suddenly disappeared in UH 3.3.2...
## 'GetBevelButtonMenuValue',
## 'SetBevelButtonMenuValue',
## 'GetBevelButtonMenuHandle',
## 'SetBevelButtonTransform',
## 'SetImageWellTransform',
## 'GetTabContentRect',
## 'SetTabEnabled',
## 'SetDisclosureTriangleLastValue',
]),
('#if TARGET_API_MAC_CARBON', [
'IsAutomaticControlDragTrackingEnabledForWindow',
'SetAutomaticControlDragTrackingEnabledForWindow',
'HandleControlDragReceive',
'HandleControlDragTracking',
'GetControlByID',
'IsControlDragTrackingEnabled',
'SetControlDragTrackingEnabled',
'GetControlPropertyAttributes',
'ChangeControlPropertyAttributes',
'GetControlID',
'SetControlID',
'HandleControlSetCursor',
'GetControlClickActivation',
'HandleControlContextualMenuClick',
"CreateScrollBarControl",
"CreateSliderControl",
"CreateBevelButtonControl",
"CreateImageWellControl",
"CreatePictureControl",
"CreateIconControl",
"CreatePushButtonWithIconControl",
"SetBevelButtonContentInfo",
"SetImageWellContentInfo",
"AddDataBrowserListViewColumn",
"CreateDataBrowserControl",
"CreateScrollingTextBoxControl",
"CreateRadioGroupControl",
"CreatePopupButtonControl",
"CreateCheckBoxControl",
"CreateRadioButtonControl",
"CreatePushButtonControl",
"CreateWindowHeaderControl",
"CreateStaticTextControl",
"CreateEditTextControl",
"CreateUserPaneControl",
"CreateClockControl",
"CreatePlacardControl",
"CreatePopupArrowControl",
"CreatePopupGroupBoxControl",
"CreateCheckGroupBoxControl",
"CreateGroupBoxControl",
"CreateSeparatorControl",
"CreateChasingArrowsControl",
"CreateLittleArrowsControl",
"CreateProgressBarControl",
"CreateDisclosureTriangleControl",
"GetDataBrowserColumnViewDisplayType",
"SetDataBrowserColumnViewDisplayType",
"GetDataBrowserColumnViewPathLength",
"GetDataBrowserColumnViewPath",
"GetDataBrowserListViewDisclosureColumn",
"SetDataBrowserListViewDisclosureColumn",
"GetDataBrowserListViewUsePlainBackground",
"SetDataBrowserListViewUsePlainBackground",
"GetDataBrowserListViewHeaderBtnHeight",
"SetDataBrowserListViewHeaderBtnHeight",
"AutoSizeDataBrowserListViewColumns",
"GetDataBrowserTableViewColumnProperty",
"GetDataBrowserTableViewColumnPosition",
"SetDataBrowserTableViewColumnPosition",
"GetDataBrowserTableViewItemRow",
"SetDataBrowserTableViewItemRow",
"GetDataBrowserTableViewItemID",
"GetDataBrowserTableViewGeometry",
"SetDataBrowserTableViewGeometry",
"GetDataBrowserTableViewNamedColumnWidth",
"SetDataBrowserTableViewNamedColumnWidth",
"GetDataBrowserTableViewItemRowHeight",
"SetDataBrowserTableViewItemRowHeight",
"GetDataBrowserTableViewColumnWidth",
"SetDataBrowserTableViewColumnWidth",
"GetDataBrowserTableViewRowHeight",
"SetDataBrowserTableViewRowHeight",
"GetDataBrowserTableViewHiliteStyle",
"SetDataBrowserTableViewHiliteStyle",
"GetDataBrowserTableViewColumnCount",
"RemoveDataBrowserTableViewColumn",
"GetDataBrowserItemPartBounds",
"GetDataBrowserEditItem",
"SetDataBrowserEditItem",
"GetDataBrowserEditText",
"SetDataBrowserEditText",
"GetDataBrowserPropertyFlags",
"SetDataBrowserPropertyFlags",
"GetDataBrowserSelectionFlags",
"SetDataBrowserSelectionFlags",
"GetDataBrowserSortProperty",
"SetDataBrowserSortProperty",
"GetDataBrowserHasScrollBars",
"SetDataBrowserHasScrollBars",
"GetDataBrowserScrollPosition",
"SetDataBrowserScrollPosition",
"GetDataBrowserSortOrder",
"SetDataBrowserSortOrder",
"GetDataBrowserTarget",
"SetDataBrowserTarget",
"GetDataBrowserScrollBarInset",
"SetDataBrowserScrollBarInset",
"GetDataBrowserActiveItems",
"SetDataBrowserActiveItems",
"RevealDataBrowserItem",
"GetDataBrowserItemState",
"IsDataBrowserItemSelected",
"GetDataBrowserItemCount",
"GetDataBrowserItems",
"SortDataBrowserContainer",
"CloseDataBrowserContainer",
"OpenDataBrowserContainer",
"MoveDataBrowserSelectionAnchor",
"GetDataBrowserSelectionAnchor",
"ExecuteDataBrowserEditCommand",
"EnableDataBrowserEditCommand",
"SetDataBrowserViewStyle",
"GetDataBrowserViewStyle",
"GetControlCommandID",
"SetControlCommandID",
"CopyControlTitleAsCFString",
"SetControlTitleWithCFString",
]),
('#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',
]),
('#if TARGET_API_MAC_OSX', [
'CreateRoundButtonControl',
'CreateDisclosureButtonControl',
......
......@@ -132,11 +132,7 @@ static PyObject *CtlObj_WhichControl(ControlHandle);
#define as_Control(h) ((ControlHandle)h)
#define as_Resource(ctl) ((Handle)ctl)
#if TARGET_API_MAC_CARBON
#define GetControlRect(ctl, rectp) GetControlBounds(ctl, rectp)
#else
#define GetControlRect(ctl, rectp) (*(rectp) = ((*(ctl))->contrlRect))
#endif
#define MAXTABS 32 /* maximum number of tabs that we support in a tabs control */
/*
......@@ -769,42 +765,6 @@ f = ManualGenerator("SetControlData_Callback", setcontroldata_callback_body);
f.docstring = lambda: "(callbackfunc) -> None"
object.add(f)
# And manual generators to get/set popup menu information
getpopupdata_body = """
PopupPrivateDataHandle hdl;
if ( (*_self->ob_itself)->contrlData == NULL ) {
PyErr_SetString(Ctl_Error, "No contrlData handle in control");
return 0;
}
hdl = (PopupPrivateDataHandle)(*_self->ob_itself)->contrlData;
HLock((Handle)hdl);
_res = Py_BuildValue("O&i", MenuObj_New, (*hdl)->mHandle, (int)(*hdl)->mID);
HUnlock((Handle)hdl);
return _res;
"""
f = ManualGenerator("GetPopupData", getpopupdata_body, condition="#if !TARGET_API_MAC_CARBON")
object.add(f)
setpopupdata_body = """
PopupPrivateDataHandle hdl;
MenuHandle mHandle;
short mID;
if (!PyArg_ParseTuple(_args, "O&h", MenuObj_Convert, &mHandle, &mID) )
return 0;
if ( (*_self->ob_itself)->contrlData == NULL ) {
PyErr_SetString(Ctl_Error, "No contrlData handle in control");
return 0;
}
hdl = (PopupPrivateDataHandle)(*_self->ob_itself)->contrlData;
(*hdl)->mHandle = mHandle;
(*hdl)->mID = mID;
Py_INCREF(Py_None);
return Py_None;
"""
f = ManualGenerator("SetPopupData", setpopupdata_body, condition="#if !TARGET_API_MAC_CARBON")
object.add(f)
createtabscontrol_body = """\
......@@ -862,7 +822,7 @@ _res = Py_BuildValue("O&",
CtlObj_New, outControl);
return _res;"""
f = ManualGenerator("CreateTabsControl", createtabscontrol_body, condition="#if TARGET_API_MAC_CARBON")
f = ManualGenerator("CreateTabsControl", createtabscontrol_body)
f.docstring = lambda: "(WindowPtr window, Rect boundsRect, UInt16 size, UInt16 direction, ControlTabEntry tabArray) -> (ControlHandle outControl)"
module.add(f)
......
......@@ -447,8 +447,6 @@ static PyObject *DlgObj_ShortenDITL(DialogObject *_self, PyObject *_args)
return _res;
}
#if TARGET_API_MAC_CARBON
static PyObject *DlgObj_InsertDialogItem(DialogObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
......@@ -476,9 +474,6 @@ static PyObject *DlgObj_InsertDialogItem(DialogObject *_self, PyObject *_args)
_res = Py_None;
return _res;
}
#endif
#if TARGET_API_MAC_CARBON
static PyObject *DlgObj_RemoveDialogItems(DialogObject *_self, PyObject *_args)
{
......@@ -504,7 +499,6 @@ static PyObject *DlgObj_RemoveDialogItems(DialogObject *_self, PyObject *_args)
_res = Py_None;
return _res;
}
#endif
static PyObject *DlgObj_StdFilterProc(DialogObject *_self, PyObject *_args)
{
......@@ -911,16 +905,10 @@ static PyMethodDef DlgObj_methods[] = {
PyDoc_STR("() -> (DialogItemIndex _rv)")},
{"ShortenDITL", (PyCFunction)DlgObj_ShortenDITL, 1,
PyDoc_STR("(DialogItemIndex numberItems) -> None")},
#if TARGET_API_MAC_CARBON
{"InsertDialogItem", (PyCFunction)DlgObj_InsertDialogItem, 1,
PyDoc_STR("(DialogItemIndex afterItem, DialogItemType itemType, Handle itemHandle, Rect box) -> None")},
#endif
#if TARGET_API_MAC_CARBON
{"RemoveDialogItems", (PyCFunction)DlgObj_RemoveDialogItems, 1,
PyDoc_STR("(DialogItemIndex itemNo, DialogItemIndex amountToRemove, Boolean disposeItemData) -> None")},
#endif
{"StdFilterProc", (PyCFunction)DlgObj_StdFilterProc, 1,
PyDoc_STR("() -> (Boolean _rv, EventRecord event, DialogItemIndex itemHit)")},
{"SetDialogDefaultItem", (PyCFunction)DlgObj_SetDialogDefaultItem, 1,
......@@ -1390,8 +1378,6 @@ static PyObject *Dlg_ResetAlertStage(PyObject *_self, PyObject *_args)
return _res;
}
#if TARGET_API_MAC_CARBON
static PyObject *Dlg_GetParamText(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
......@@ -1416,7 +1402,6 @@ static PyObject *Dlg_GetParamText(PyObject *_self, PyObject *_args)
_res = Py_None;
return _res;
}
#endif
static PyObject *Dlg_NewFeaturesDialog(PyObject *_self, PyObject *_args)
{
......@@ -1539,11 +1524,8 @@ static PyMethodDef Dlg_methods[] = {
PyDoc_STR("(SInt16 fontNum) -> None")},
{"ResetAlertStage", (PyCFunction)Dlg_ResetAlertStage, 1,
PyDoc_STR("() -> None")},
#if TARGET_API_MAC_CARBON
{"GetParamText", (PyCFunction)Dlg_GetParamText, 1,
PyDoc_STR("(Str255 param0, Str255 param1, Str255 param2, Str255 param3) -> None")},
#endif
{"NewFeaturesDialog", (PyCFunction)Dlg_NewFeaturesDialog, 1,
PyDoc_STR("(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,
......
......@@ -60,16 +60,6 @@ class MyScanner(Scanner):
'RunStandardAlert',
]
def makegreylist(self):
return [
('#if TARGET_API_MAC_CARBON', [
'InsertDialogItem',
'RemoveDialogItems',
'GetParamText',
'CloseStandardSheet',
'RunStandardAlert',
])]
def makeblacklisttypes(self):
return [
"AlertStdAlertParamPtr", # Too much work, for now
......
......@@ -211,52 +211,6 @@ static PyObject *Evt_PostEvent(PyObject *_self, PyObject *_args)
return _res;
}
#if !TARGET_API_MAC_CARBON
static PyObject *Evt_OSEventAvail(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
EventMask mask;
EventRecord theEvent;
#ifndef OSEventAvail
PyMac_PRECHECK(OSEventAvail);
#endif
if (!PyArg_ParseTuple(_args, "H",
&mask))
return NULL;
_rv = OSEventAvail(mask,
&theEvent);
_res = Py_BuildValue("bO&",
_rv,
PyMac_BuildEventRecord, &theEvent);
return _res;
}
#endif
#if !TARGET_API_MAC_CARBON
static PyObject *Evt_GetOSEvent(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
EventMask mask;
EventRecord theEvent;
#ifndef GetOSEvent
PyMac_PRECHECK(GetOSEvent);
#endif
if (!PyArg_ParseTuple(_args, "H",
&mask))
return NULL;
_rv = GetOSEvent(mask,
&theEvent);
_res = Py_BuildValue("bO&",
_rv,
PyMac_BuildEventRecord, &theEvent);
return _res;
}
#endif
static PyObject *Evt_FlushEvents(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
......@@ -276,67 +230,6 @@ static PyObject *Evt_FlushEvents(PyObject *_self, PyObject *_args)
return _res;
}
#if !TARGET_API_MAC_CARBON
static PyObject *Evt_SystemClick(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
EventRecord theEvent;
WindowPtr theWindow;
#ifndef SystemClick
PyMac_PRECHECK(SystemClick);
#endif
if (!PyArg_ParseTuple(_args, "O&O&",
PyMac_GetEventRecord, &theEvent,
WinObj_Convert, &theWindow))
return NULL;
SystemClick(&theEvent,
theWindow);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
#endif
#if !TARGET_API_MAC_CARBON
static PyObject *Evt_SystemTask(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
#ifndef SystemTask
PyMac_PRECHECK(SystemTask);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
SystemTask();
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
#endif
#if !TARGET_API_MAC_CARBON
static PyObject *Evt_SystemEvent(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
EventRecord theEvent;
#ifndef SystemEvent
PyMac_PRECHECK(SystemEvent);
#endif
if (!PyArg_ParseTuple(_args, "O&",
PyMac_GetEventRecord, &theEvent))
return NULL;
_rv = SystemEvent(&theEvent);
_res = Py_BuildValue("b",
_rv);
return _res;
}
#endif
#if TARGET_API_MAC_CARBON
static PyObject *Evt_GetGlobalMouse(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
......@@ -351,9 +244,6 @@ static PyObject *Evt_GetGlobalMouse(PyObject *_self, PyObject *_args)
PyMac_BuildPoint, globalMouse);
return _res;
}
#endif
#if TARGET_API_MAC_CARBON
static PyObject *Evt_GetCurrentKeyModifiers(PyObject *_self, PyObject *_args)
{
......@@ -369,9 +259,6 @@ static PyObject *Evt_GetCurrentKeyModifiers(PyObject *_self, PyObject *_args)
_rv);
return _res;
}
#endif
#if TARGET_API_MAC_CARBON
static PyObject *Evt_CheckEventQueueForUserCancel(PyObject *_self, PyObject *_args)
{
......@@ -387,7 +274,6 @@ static PyObject *Evt_CheckEventQueueForUserCancel(PyObject *_self, PyObject *_ar
_rv);
return _res;
}
#endif
static PyObject *Evt_KeyScript(PyObject *_self, PyObject *_args)
{
......@@ -613,48 +499,14 @@ static PyMethodDef Evt_methods[] = {
PyDoc_STR("(EventMask eventMask) -> (Boolean _rv, EventRecord theEvent)")},
{"PostEvent", (PyCFunction)Evt_PostEvent, 1,
PyDoc_STR("(EventKind eventNum, UInt32 eventMsg) -> None")},
#if !TARGET_API_MAC_CARBON
{"OSEventAvail", (PyCFunction)Evt_OSEventAvail, 1,
PyDoc_STR("(EventMask mask) -> (Boolean _rv, EventRecord theEvent)")},
#endif
#if !TARGET_API_MAC_CARBON
{"GetOSEvent", (PyCFunction)Evt_GetOSEvent, 1,
PyDoc_STR("(EventMask mask) -> (Boolean _rv, EventRecord theEvent)")},
#endif
{"FlushEvents", (PyCFunction)Evt_FlushEvents, 1,
PyDoc_STR("(EventMask whichMask, EventMask stopMask) -> None")},
#if !TARGET_API_MAC_CARBON
{"SystemClick", (PyCFunction)Evt_SystemClick, 1,
PyDoc_STR("(EventRecord theEvent, WindowPtr theWindow) -> None")},
#endif
#if !TARGET_API_MAC_CARBON
{"SystemTask", (PyCFunction)Evt_SystemTask, 1,
PyDoc_STR("() -> None")},
#endif
#if !TARGET_API_MAC_CARBON
{"SystemEvent", (PyCFunction)Evt_SystemEvent, 1,
PyDoc_STR("(EventRecord theEvent) -> (Boolean _rv)")},
#endif
#if TARGET_API_MAC_CARBON
{"GetGlobalMouse", (PyCFunction)Evt_GetGlobalMouse, 1,
PyDoc_STR("() -> (Point globalMouse)")},
#endif
#if TARGET_API_MAC_CARBON
{"GetCurrentKeyModifiers", (PyCFunction)Evt_GetCurrentKeyModifiers, 1,
PyDoc_STR("() -> (UInt32 _rv)")},
#endif
#if TARGET_API_MAC_CARBON
{"CheckEventQueueForUserCancel", (PyCFunction)Evt_CheckEventQueueForUserCancel, 1,
PyDoc_STR("() -> (Boolean _rv)")},
#endif
{"KeyScript", (PyCFunction)Evt_KeyScript, 1,
PyDoc_STR("(short code) -> None")},
{"IsCmdChar", (PyCFunction)Evt_IsCmdChar, 1,
......
......@@ -36,21 +36,6 @@ class MyScanner(Scanner):
listname = "methods"
return classname, listname
def makegreylist(self):
return [
('#if !TARGET_API_MAC_CARBON', [
'SystemEvent',
'SystemTask',
'SystemClick',
'GetOSEvent',
'OSEventAvail',
]),
('#if TARGET_API_MAC_CARBON', [
'CheckEventQueueForUserCancel',
'GetCurrentKeyModifiers',
'GetGlobalMouse',
])]
def makeblacklistnames(self):
return [
"KeyTranslate",
......@@ -58,6 +43,12 @@ class MyScanner(Scanner):
"WaitNextEvent", # Manually generated because of optional region
# Constants with funny definitions
"osEvtMessageMask",
# OS8 calls
'SystemEvent',
'SystemTask',
'SystemClick',
'GetOSEvent',
'OSEventAvail',
]
def makeblacklisttypes(self):
......
......@@ -59,23 +59,6 @@ FMRec_Convert(PyObject *v, FMetricRec *p_itself)
static PyObject *Fm_Error;
#if !TARGET_API_MAC_CARBON
static PyObject *Fm_InitFonts(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
#ifndef InitFonts
PyMac_PRECHECK(InitFonts);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
InitFonts();
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
#endif
static PyObject *Fm_GetFontName(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
......@@ -132,25 +115,6 @@ static PyObject *Fm_RealFont(PyObject *_self, PyObject *_args)
return _res;
}
#if !TARGET_API_MAC_CARBON
static PyObject *Fm_SetFontLock(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean lockFlag;
#ifndef SetFontLock
PyMac_PRECHECK(SetFontLock);
#endif
if (!PyArg_ParseTuple(_args, "b",
&lockFlag))
return NULL;
SetFontLock(lockFlag);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
#endif
static PyObject *Fm_SetFScaleDisable(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
......@@ -295,25 +259,6 @@ static PyObject *Fm_GetPreserveGlyph(PyObject *_self, PyObject *_args)
return _res;
}
#if !TARGET_API_MAC_CARBON
static PyObject *Fm_FlushFonts(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
#ifndef FlushFonts
PyMac_PRECHECK(FlushFonts);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_err = FlushFonts();
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
#endif
static PyObject *Fm_GetSysFont(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
......@@ -366,22 +311,12 @@ static PyObject *Fm_QDTextBounds(PyObject *_self, PyObject *_args)
}
static PyMethodDef Fm_methods[] = {
#if !TARGET_API_MAC_CARBON
{"InitFonts", (PyCFunction)Fm_InitFonts, 1,
PyDoc_STR("() -> None")},
#endif
{"GetFontName", (PyCFunction)Fm_GetFontName, 1,
PyDoc_STR("(short familyID) -> (Str255 name)")},
{"GetFNum", (PyCFunction)Fm_GetFNum, 1,
PyDoc_STR("(Str255 name) -> (short familyID)")},
{"RealFont", (PyCFunction)Fm_RealFont, 1,
PyDoc_STR("(short fontNum, short size) -> (Boolean _rv)")},
#if !TARGET_API_MAC_CARBON
{"SetFontLock", (PyCFunction)Fm_SetFontLock, 1,
PyDoc_STR("(Boolean lockFlag) -> None")},
#endif
{"SetFScaleDisable", (PyCFunction)Fm_SetFScaleDisable, 1,
PyDoc_STR("(Boolean fscaleDisable) -> None")},
{"FontMetrics", (PyCFunction)Fm_FontMetrics, 1,
......@@ -400,11 +335,6 @@ static PyMethodDef Fm_methods[] = {
PyDoc_STR("(Boolean preserveGlyph) -> None")},
{"GetPreserveGlyph", (PyCFunction)Fm_GetPreserveGlyph, 1,
PyDoc_STR("() -> (Boolean _rv)")},
#if !TARGET_API_MAC_CARBON
{"FlushFonts", (PyCFunction)Fm_FlushFonts, 1,
PyDoc_STR("() -> None")},
#endif
{"GetSysFont", (PyCFunction)Fm_GetSysFont, 1,
PyDoc_STR("() -> (short _rv)")},
{"GetAppFont", (PyCFunction)Fm_GetAppFont, 1,
......
......@@ -42,14 +42,15 @@ class MyScanner(Scanner):
# Disabling them is the easiest path.
'SetAntiAliasedTextEnabled',
'IsAntiAliasedTextEnabled',
# OS8-only
'InitFonts',
'SetFontLock',
'FlushFonts',
]
def makegreylist(self):
return [
('#if !TARGET_API_MAC_CARBON', [
'InitFonts',
'SetFontLock',
'FlushFonts',
])]
def makeblacklisttypes(self):
return [
......
......@@ -35,16 +35,6 @@ PERFORMANCE OF THIS SOFTWARE.
extern int ResObj_Convert(PyObject *, Handle *); /* From Resmodule.c */
#ifdef WITHOUT_FRAMEWORKS
// #if !TARGET_API_MAC_OS8
// /* The Carbon headers define PRAGMA_ALIGN_SUPPORT to something illegal,
// ** because you shouldn't use it for Carbon. All good and well, but portable
// ** code still needs it. So, we undefine it here.
// */
// #undef PRAGMA_ALIGN_SUPPORTED
// #define PRAGMA_ALIGN_SUPPORTED 0
// #endif /* !TARGET_API_MAC_OS8 */
// #include "ICAPI.h"
#include <InternetConfig.h>
#else
#include <Carbon/Carbon.h>
......@@ -67,79 +57,6 @@ static PyTypeObject Icitype;
/* ---------------------------------------------------------------- */
#if TARGET_API_MAC_OS8
static char ici_ICFindConfigFile__doc__[] =
"()->None; Find config file in standard places"
;
static PyObject *
ici_ICFindConfigFile(iciobject *self, PyObject *args)
{
OSStatus err;
if (!PyArg_ParseTuple(args, ""))
return NULL;
if ((err=ICFindConfigFile(self->inst, 0, NULL)) != 0 )
return PyMac_Error(err);
Py_INCREF(Py_None);
return Py_None;
}
static char ici_ICFindUserConfigFile__doc__[] =
"(vRefNum, dirID)->None; Find config file in specified place"
;
static PyObject *
ici_ICFindUserConfigFile(iciobject *self, PyObject *args)
{
OSStatus err;
ICDirSpec where;
if (!PyArg_ParseTuple(args, "sl", &where.vRefNum, &where.dirID))
return NULL;
if ((err=ICFindUserConfigFile(self->inst, &where)) != 0 )
return PyMac_Error(err);
Py_INCREF(Py_None);
return Py_None;
}
static char ici_ICChooseConfig__doc__[] =
"()->None; Let the user choose a config file"
;
static PyObject *
ici_ICChooseConfig(iciobject *self, PyObject *args)
{
OSStatus err;
if (!PyArg_ParseTuple(args, ""))
return NULL;
if ((err=ICChooseConfig(self->inst)) != 0 )
return PyMac_Error(err);
Py_INCREF(Py_None);
return Py_None;
}
static char ici_ICChooseNewConfig__doc__[] =
"()->None; Let the user choose a new config file"
;
static PyObject *
ici_ICChooseNewConfig(iciobject *self, PyObject *args)
{
OSStatus err;
if (!PyArg_ParseTuple(args, ""))
return NULL;
if ((err=ICChooseNewConfig(self->inst)) != 0 )
return PyMac_Error(err);
Py_INCREF(Py_None);
return Py_None;
}
#endif /* TARGET_API_MAC_OS8 */
static char ici_ICGetSeed__doc__[] =
"()->int; Returns int that changes when configuration does"
......@@ -423,12 +340,6 @@ ici_ICMapTypeCreator(iciobject *self, PyObject *args)
static struct PyMethodDef ici_methods[] = {
#if TARGET_API_MAC_OS8
{"ICFindConfigFile", (PyCFunction)ici_ICFindConfigFile, METH_VARARGS, ici_ICFindConfigFile__doc__},
{"ICFindUserConfigFile", (PyCFunction)ici_ICFindUserConfigFile, METH_VARARGS, ici_ICFindUserConfigFile__doc__},
{"ICChooseConfig", (PyCFunction)ici_ICChooseConfig, METH_VARARGS, ici_ICChooseConfig__doc__},
{"ICChooseNewConfig", (PyCFunction)ici_ICChooseNewConfig, METH_VARARGS, ici_ICChooseNewConfig__doc__},
#endif /* TARGET_API_MAC_OS8 */
{"ICGetSeed", (PyCFunction)ici_ICGetSeed, METH_VARARGS, ici_ICGetSeed__doc__},
{"ICBegin", (PyCFunction)ici_ICBegin, METH_VARARGS, ici_ICBegin__doc__},
{"ICFindPrefHandle", (PyCFunction)ici_ICFindPrefHandle, METH_VARARGS, ici_ICFindPrefHandle__doc__},
......
......@@ -606,23 +606,6 @@ static PyObject *Icn_PlotCIconHandle(PyObject *_self, PyObject *_args)
return _res;
}
#if !TARGET_API_MAC_CARBON
static PyObject *Icn_IconServicesTerminate(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
#ifndef IconServicesTerminate
PyMac_PRECHECK(IconServicesTerminate);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
IconServicesTerminate();
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
#endif
static PyObject *Icn_IconRefToIconFamily(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
......@@ -1338,8 +1321,6 @@ static PyObject *Icn_IsIconRefMaskEmpty(PyObject *_self, PyObject *_args)
return _res;
}
#if TARGET_API_MAC_CARBON
static PyObject *Icn_GetIconRefVariant(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
......@@ -1362,9 +1343,6 @@ static PyObject *Icn_GetIconRefVariant(PyObject *_self, PyObject *_args)
outTransform);
return _res;
}
#endif
#if TARGET_API_MAC_CARBON
static PyObject *Icn_RegisterIconRefFromIconFile(PyObject *_self, PyObject *_args)
{
......@@ -1391,9 +1369,6 @@ static PyObject *Icn_RegisterIconRefFromIconFile(PyObject *_self, PyObject *_arg
ResObj_New, theIconRef);
return _res;
}
#endif
#if TARGET_API_MAC_CARBON
static PyObject *Icn_ReadIconFile(PyObject *_self, PyObject *_args)
{
......@@ -1414,9 +1389,6 @@ static PyObject *Icn_ReadIconFile(PyObject *_self, PyObject *_args)
ResObj_New, iconFamily);
return _res;
}
#endif
#if TARGET_API_MAC_CARBON
static PyObject *Icn_WriteIconFile(PyObject *_self, PyObject *_args)
{
......@@ -1438,7 +1410,6 @@ static PyObject *Icn_WriteIconFile(PyObject *_self, PyObject *_args)
_res = Py_None;
return _res;
}
#endif
static PyMethodDef Icn_methods[] = {
{"GetCIcon", (PyCFunction)Icn_GetCIcon, 1,
......@@ -1491,11 +1462,6 @@ static PyMethodDef Icn_methods[] = {
PyDoc_STR("(Rect theRect, IconAlignmentType align, IconTransformType transform, Handle theSICN) -> None")},
{"PlotCIconHandle", (PyCFunction)Icn_PlotCIconHandle, 1,
PyDoc_STR("(Rect theRect, IconAlignmentType align, IconTransformType transform, CIconHandle theCIcon) -> None")},
#if !TARGET_API_MAC_CARBON
{"IconServicesTerminate", (PyCFunction)Icn_IconServicesTerminate, 1,
PyDoc_STR("() -> None")},
#endif
{"IconRefToIconFamily", (PyCFunction)Icn_IconRefToIconFamily, 1,
PyDoc_STR("(IconRef theIconRef, IconSelectorValue whichIcons) -> (IconFamilyHandle iconFamily)")},
{"IconFamilyToIconSuite", (PyCFunction)Icn_IconFamilyToIconSuite, 1,
......@@ -1558,26 +1524,14 @@ static PyMethodDef Icn_methods[] = {
PyDoc_STR("(SInt16 vRefNum) -> (Boolean customIconsEnabled)")},
{"IsIconRefMaskEmpty", (PyCFunction)Icn_IsIconRefMaskEmpty, 1,
PyDoc_STR("(IconRef iconRef) -> (Boolean _rv)")},
#if TARGET_API_MAC_CARBON
{"GetIconRefVariant", (PyCFunction)Icn_GetIconRefVariant, 1,
PyDoc_STR("(IconRef inIconRef, OSType inVariant) -> (IconRef _rv, IconTransformType outTransform)")},
#endif
#if TARGET_API_MAC_CARBON
{"RegisterIconRefFromIconFile", (PyCFunction)Icn_RegisterIconRefFromIconFile, 1,
PyDoc_STR("(OSType creator, OSType iconType, FSSpec iconFile) -> (IconRef theIconRef)")},
#endif
#if TARGET_API_MAC_CARBON
{"ReadIconFile", (PyCFunction)Icn_ReadIconFile, 1,
PyDoc_STR("(FSSpec iconFile) -> (IconFamilyHandle iconFamily)")},
#endif
#if TARGET_API_MAC_CARBON
{"WriteIconFile", (PyCFunction)Icn_WriteIconFile, 1,
PyDoc_STR("(IconFamilyHandle iconFamily, FSSpec iconFile) -> None")},
#endif
{NULL, NULL, 0}
};
......
......@@ -46,20 +46,10 @@ class MyScanner(Scanner):
"svAllAvailableData",
# Something in a comment accidentally seen as a const definition
"err",
# OS8 only
'IconServicesTerminate',
]
def makegreylist(self):
return [
('#if !TARGET_API_MAC_CARBON', [
'IconServicesTerminate',
]),
('#if TARGET_API_MAC_CARBON', [
'WriteIconFile',
'ReadIconFile',
'RegisterIconRefFromIconFile',
'GetIconRefVariant',
])]
def makeblacklisttypes(self):
return [
"IconActionUPP",
......
......@@ -64,39 +64,6 @@ extern int _ListObj_Convert(PyObject *, ListHandle *);
static ListDefUPP myListDefFunctionUPP;
#if !TARGET_API_MAC_CARBON
#define kJumpAbs 0x4EF9
#pragma options align=mac68k
typedef struct {
short jmpabs; /* 4EF9 */
ListDefUPP theUPP; /* 00000000 */
} LDEFStub, **LDEFStubHandle;
#pragma options align=reset
static OSErr installLDEFStub(ListHandle list) {
LDEFStubHandle stubH;
stubH = (LDEFStubHandle)NewHandleClear(sizeof(LDEFStub));
if (stubH == NULL)
return MemError();
(*stubH)->jmpabs = kJumpAbs;
(*stubH)->theUPP = myListDefFunctionUPP;
HLock((Handle) stubH);
(*list)->listDefProc = (Handle)stubH;
return noErr;
}
static void removeLDEFStub(ListHandle list) {
if ((*list)->listDefProc)
DisposeHandle((Handle)(*list)->listDefProc);
(*list)->listDefProc = NULL;
}
#endif
static PyObject *List_Error;
......@@ -110,7 +77,6 @@ typedef struct ListObject {
PyObject_HEAD
ListHandle ob_itself;
PyObject *ob_ldef_func;
int ob_have_ldef_stub;
int ob_must_be_disposed;
} ListObject;
......@@ -125,7 +91,6 @@ PyObject *ListObj_New(ListHandle itself)
if (it == NULL) return NULL;
it->ob_itself = itself;
it->ob_ldef_func = NULL;
it->ob_have_ldef_stub = 0;
it->ob_must_be_disposed = 1;
SetListRefCon(itself, (long)it);
return (PyObject *)it;
......@@ -145,9 +110,6 @@ static void ListObj_dealloc(ListObject *self)
{
Py_XDECREF(self->ob_ldef_func);
self->ob_ldef_func = NULL;
#if !TARGET_API_MAC_CARBON
if (self->ob_have_ldef_stub) removeLDEFStub(self->ob_itself);
#endif
SetListRefCon(self->ob_itself, (long)0);
if (self->ob_must_be_disposed && self->ob_itself) LDispose(self->ob_itself);
PyObject_Del(self);
......@@ -901,7 +863,6 @@ static PyObject *List_CreateCustomList(PyObject *_self, PyObject *_args)
return NULL;
#if TARGET_API_MAC_CARBON
/* Carbon applications use the CreateCustomList API */
theSpec.u.userProc = myListDefFunctionUPP;
CreateCustomList(&rView,
......@@ -915,33 +876,12 @@ static PyObject *List_CreateCustomList(PyObject *_self, PyObject *_args)
scrollVert,
&outList);
#else
/* pre-Carbon applications set the address in the LDEF
to a routine descriptor referring to their list
definition routine. */
outList = LNew(&rView,
&dataBounds,
cellSize,
0,
theWindow,
drawIt, /* XXX must be false */
hasGrow,
scrollHoriz,
scrollVert);
if (installLDEFStub(outList) != noErr) {
PyErr_SetString(PyExc_MemoryError, "can't create LDEF stub");
return NULL;
}
#endif
_res = ListObj_New(outList);
if (_res == NULL)
return NULL;
Py_INCREF(listDefFunc);
((ListObject*)_res)->ob_ldef_func = listDefFunc;
#if !TARGET_API_MAC_CARBON
((ListObject*)_res)->ob_have_ldef_stub = 1;
#endif
return _res;
}
......
......@@ -83,39 +83,6 @@ extern int _ListObj_Convert(PyObject *, ListHandle *);
static ListDefUPP myListDefFunctionUPP;
#if !TARGET_API_MAC_CARBON
#define kJumpAbs 0x4EF9
#pragma options align=mac68k
typedef struct {
short jmpabs; /* 4EF9 */
ListDefUPP theUPP; /* 00000000 */
} LDEFStub, **LDEFStubHandle;
#pragma options align=reset
static OSErr installLDEFStub(ListHandle list) {
LDEFStubHandle stubH;
stubH = (LDEFStubHandle)NewHandleClear(sizeof(LDEFStub));
if (stubH == NULL)
return MemError();
(*stubH)->jmpabs = kJumpAbs;
(*stubH)->theUPP = myListDefFunctionUPP;
HLock((Handle) stubH);
(*list)->listDefProc = (Handle)stubH;
return noErr;
}
static void removeLDEFStub(ListHandle list) {
if ((*list)->listDefProc)
DisposeHandle((Handle)(*list)->listDefProc);
(*list)->listDefProc = NULL;
}
#endif
"""
initstuff = initstuff + """
......@@ -159,7 +126,6 @@ class MyObjectDefinition(PEP253Mixin, GlobalObjectDefinition):
def outputStructMembers(self):
ObjectDefinition.outputStructMembers(self)
Output("PyObject *ob_ldef_func;")
Output("int ob_have_ldef_stub;")
Output("int ob_must_be_disposed;")
def outputCheckNewArg(self):
......@@ -171,16 +137,12 @@ class MyObjectDefinition(PEP253Mixin, GlobalObjectDefinition):
def outputInitStructMembers(self):
ObjectDefinition.outputInitStructMembers(self)
Output("it->ob_ldef_func = NULL;")
Output("it->ob_have_ldef_stub = 0;")
Output("it->ob_must_be_disposed = 1;")
Output("SetListRefCon(itself, (long)it);")
def outputFreeIt(self, itselfname):
Output("Py_XDECREF(self->ob_ldef_func);")
Output("self->ob_ldef_func = NULL;")
Output("#if !TARGET_API_MAC_CARBON")
Output("if (self->ob_have_ldef_stub) removeLDEFStub(self->ob_itself);");
Output("#endif");
Output("SetListRefCon(self->ob_itself, (long)0);")
Output("if (self->ob_must_be_disposed && %s) LDispose(%s);", itselfname, itselfname)
......@@ -285,7 +247,6 @@ if (!PyArg_ParseTuple(_args, "O&O&O&(iO)O&bbbb",
return NULL;
#if TARGET_API_MAC_CARBON
/* Carbon applications use the CreateCustomList API */
theSpec.u.userProc = myListDefFunctionUPP;
CreateCustomList(&rView,
......@@ -299,33 +260,12 @@ CreateCustomList(&rView,
scrollVert,
&outList);
#else
/* pre-Carbon applications set the address in the LDEF
to a routine descriptor referring to their list
definition routine. */
outList = LNew(&rView,
&dataBounds,
cellSize,
0,
theWindow,
drawIt, /* XXX must be false */
hasGrow,
scrollHoriz,
scrollVert);
if (installLDEFStub(outList) != noErr) {
PyErr_SetString(PyExc_MemoryError, "can't create LDEF stub");
return NULL;
}
#endif
_res = ListObj_New(outList);
if (_res == NULL)
return NULL;
Py_INCREF(listDefFunc);
((ListObject*)_res)->ob_ldef_func = listDefFunc;
#if !TARGET_API_MAC_CARBON
((ListObject*)_res)->ob_have_ldef_stub = 1;
#endif
return _res;\
"""
......
......@@ -244,16 +244,8 @@ struct _inittab _PyImport_Inittab[] = {
{"_Scrap", init_Scrap},
{"_TE", init_TE},
{"ColorPicker", initColorPicker},
#if !TARGET_API_MAC_CARBON
{"_Help", init_Help},
{"Printing", initPrinting},
#endif
#if TARGET_API_MAC_CARBON
{"_CF", init_CF},
#endif
#if TARGET_API_MAC_CARBON
{"hfsplus", inithfsplus},
#endif
#endif /* USE_TOOLBOX */
#ifdef USE_QT
{"_Cm", init_Cm},
......
......@@ -382,7 +382,6 @@ _mfs_GetFSSpecFromFSSpec(PyObject *self, FSSpec *fssp)
static int
_mfs_GetFSSpecFromFSRef(PyObject *self, FSSpec *fssp)
{
#if !TARGET_API_MAC_OS8
static FSRef *fsrp;
if ( is_mfsrobject(self) ) {
......@@ -390,7 +389,6 @@ _mfs_GetFSSpecFromFSRef(PyObject *self, FSSpec *fssp)
if ( FSGetCatalogInfo(&((mfsrobject *)self)->fsref, kFSCatInfoNone, NULL, NULL, fssp, NULL) == noErr )
return 1;
}
#endif
return 0;
}
......@@ -398,12 +396,10 @@ _mfs_GetFSSpecFromFSRef(PyObject *self, FSSpec *fssp)
static int
_mfs_GetFSRefFromFSRef(PyObject *self, FSRef *fsrp)
{
#if !TARGET_API_MAC_OS8
if ( is_mfsrobject(self) ) {
*fsrp = ((mfsrobject *)self)->fsref;
return 1;
}
#endif
return 0;
}
......@@ -411,12 +407,10 @@ _mfs_GetFSRefFromFSRef(PyObject *self, FSRef *fsrp)
static int
_mfs_GetFSRefFromFSSpec(PyObject *self, FSRef *fsrp)
{
#if !TARGET_API_MAC_OS8
if ( is_mfssobject(self) ) {
if ( FSpMakeFSRef(&((mfssobject *)self)->fsspec, fsrp) == noErr )
return 1;
}
#endif
return 0;
}
......@@ -533,10 +527,6 @@ mfss_NewAliasMinimal(mfssobject *self, PyObject *args)
static PyObject *
mfss_FSpMakeFSRef(mfssobject *self, PyObject *args)
{
#if TARGET_API_MAC_OS8
PyErr_SetString(PyExc_NotImplementedError, "FSRef objects not supported on this platform");
return 0;
#else
OSErr err;
FSRef fsref;
......@@ -548,7 +538,6 @@ mfss_FSpMakeFSRef(mfssobject *self, PyObject *args)
return NULL;
}
return (PyObject *)newmfsrobject(&fsref);
#endif
}
/* XXXX These routines should be replaced by a wrapper to the *FInfo routines */
......@@ -777,7 +766,6 @@ statichere PyTypeObject Mfsstype = {
/* End of code for FSSpec objects */
/* -------------------------------------------------------- */
#if !TARGET_API_MAC_OS8
static PyObject *
mfsr_as_fsspec(mfsrobject *self, PyObject *args)
{
......@@ -891,7 +879,6 @@ statichere PyTypeObject Mfsrtype = {
};
/* End of code for FSRef objects */
#endif /* !TARGET_API_MAC_OS8 */
/* -------------------------------------------------------- */
static PyObject *
......@@ -911,91 +898,6 @@ mfs_ResolveAliasFile(PyObject *self, PyObject *args)
return Py_BuildValue("Oii", newmfssobject(&fss), (int)isfolder, (int)wasaliased);
}
#if !TARGET_API_MAC_CARBON
static PyObject *
mfs_StandardGetFile(PyObject *self, PyObject *args)
{
SFTypeList list;
short numtypes;
StandardFileReply reply;
list[0] = list[1] = list[2] = list[3] = 0;
numtypes = 0;
if (!PyArg_ParseTuple(args, "|O&O&O&O&", PyMac_GetOSType, &list[0],
PyMac_GetOSType, &list[1], PyMac_GetOSType, &list[2],
PyMac_GetOSType, &list[3]) )
return NULL;
while ( numtypes < 4 && list[numtypes] ) {
numtypes++;
}
if ( numtypes == 0 )
numtypes = -1;
StandardGetFile((FileFilterUPP)0, numtypes, list, &reply);
return Py_BuildValue("(Oi)", newmfssobject(&reply.sfFile), reply.sfGood);
}
static PyObject *
mfs_PromptGetFile(PyObject *self, PyObject *args)
{
SFTypeList list;
short numtypes;
StandardFileReply reply;
char *prompt = NULL;
list[0] = list[1] = list[2] = list[3] = 0;
numtypes = 0;
if (!PyArg_ParseTuple(args, "s|O&O&O&O&", &prompt, PyMac_GetOSType, &list[0],
PyMac_GetOSType, &list[1], PyMac_GetOSType, &list[2],
PyMac_GetOSType, &list[3]) )
return NULL;
while ( numtypes < 4 && list[numtypes] ) {
numtypes++;
}
if ( numtypes == 0 )
numtypes = -1;
PyMac_PromptGetFile(numtypes, list, &reply, prompt);
return Py_BuildValue("(Oi)", newmfssobject(&reply.sfFile), reply.sfGood);
}
static PyObject *
mfs_StandardPutFile(PyObject *self, PyObject *args)
{
Str255 prompt, dft;
StandardFileReply reply;
dft[0] = 0;
if (!PyArg_ParseTuple(args, "O&|O&", PyMac_GetStr255, &prompt, PyMac_GetStr255, &dft) )
return NULL;
StandardPutFile(prompt, dft, &reply);
return Py_BuildValue("(Oi)",newmfssobject(&reply.sfFile), reply.sfGood);
}
/*
** Set initial directory for file dialogs */
static PyObject *
mfs_SetFolder(PyObject *self, PyObject *args)
{
FSSpec spec;
FSSpec ospec;
short orefnum;
long oparid;
/* Get old values */
orefnum = -LMGetSFSaveDisk();
oparid = LMGetCurDirStore();
(void)FSMakeFSSpec(orefnum, oparid, "\pplaceholder", &ospec);
/* Go to working directory by default */
(void)FSMakeFSSpec(0, 0, "\p:placeholder", &spec);
if (!PyArg_ParseTuple(args, "|O&", PyMac_GetFSSpec, &spec))
return NULL;
/* Set standard-file working directory */
LMSetSFSaveDisk(-spec.vRefNum);
LMSetCurDirStore(spec.parID);
return (PyObject *)newmfssobject(&ospec);
}
#endif
static PyObject *
mfs_FSSpec(PyObject *self, PyObject *args)
{
......@@ -1009,16 +911,11 @@ mfs_FSSpec(PyObject *self, PyObject *args)
static PyObject *
mfs_FSRef(PyObject *self, PyObject *args)
{
#if TARGET_API_MAC_OS8
PyErr_SetString(PyExc_NotImplementedError, "FSRef objects not supported on this platform");
return 0;
#else
FSRef fsr;
if (!PyArg_ParseTuple(args, "O&", PyMac_GetFSRef, &fsr))
return NULL;
return (PyObject *)newmfsrobject(&fsr);
#endif
}
static PyObject *
......@@ -1056,22 +953,6 @@ mfs_RawAlias(PyObject *self, PyObject *args)
return (PyObject *)newmfsaobject((AliasHandle)h);
}
#if !TARGET_API_MAC_CARBON
static PyObject *
mfs_GetDirectory(PyObject *self, PyObject *args)
{
FSSpec fsdir;
int ok;
char *prompt = NULL;
if (!PyArg_ParseTuple(args, "|s", &prompt) )
return NULL;
ok = PyMac_GetDirectory(&fsdir, prompt);
return Py_BuildValue("(Oi)", newmfssobject(&fsdir), ok);
}
#endif
static PyObject *
mfs_FindFolder(PyObject *self, PyObject *args)
{
......@@ -1143,13 +1024,6 @@ mfs_NewAliasMinimalFromFullPath(PyObject *self, PyObject *args)
static struct PyMethodDef mfs_methods[] = {
{"ResolveAliasFile", mfs_ResolveAliasFile, 1},
#if !TARGET_API_MAC_CARBON
{"StandardGetFile", mfs_StandardGetFile, 1},
{"PromptGetFile", mfs_PromptGetFile, 1},
{"StandardPutFile", mfs_StandardPutFile, 1},
{"GetDirectory", mfs_GetDirectory, 1},
{"SetFolder", mfs_SetFolder, 1},
#endif
{"FSSpec", mfs_FSSpec, 1},
{"FSRef", mfs_FSRef, 1},
{"RawFSSpec", mfs_RawFSSpec, 1},
......@@ -1170,10 +1044,6 @@ static struct PyMethodDef mfs_methods[] = {
int
PyMac_GetFSRef(PyObject *v, FSRef *fsr)
{
#if TARGET_API_MAC_OS8
PyErr_SetString(PyExc_TypeError, "FSRef objects not supported on this platform");
return 0;
#else
/* If it's an FSRef we're also okay. */
if (_mfs_GetFSRefFromFSRef(v, fsr))
return 1;
......@@ -1195,17 +1065,12 @@ PyMac_GetFSRef(PyObject *v, FSRef *fsr)
}
PyErr_SetString(PyExc_TypeError, "FSRef argument should be existing FSRef, FSSpec or (OSX only) pathname");
return 0;
#endif
}
/* Convert FSSpec to PyObject */
PyObject *PyMac_BuildFSRef(FSRef *v)
{
#if TARGET_API_MAC_OS8
return NULL;
#else
return (PyObject *)newmfsrobject(v);
#endif
}
/*
......
......@@ -32,11 +32,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <string.h>
#include <errno.h>
#if TARGET_API_MAC_OS8
/* Skip for Carbon */
#include "macstat.h"
#endif
#ifdef USE_GUSI
/* Remove defines from macstat.h */
#undef S_IFMT
......@@ -49,9 +44,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <sys/types.h>
#include <sys/stat.h>
#else /* USE_GUSI */
#if TARGET_API_MAC_OS8
#define stat macstat
#endif
#endif /* USE_GUSI */
#ifdef USE_GUSI2
......@@ -239,24 +231,6 @@ mac_fdopen(self, args)
}
#endif
#if TARGET_API_MAC_OS8
static PyObject *
mac_getbootvol(self, args)
PyObject *self;
PyObject *args;
{
char *res;
if (!PyArg_ParseTuple(args, ""))
return NULL;
Py_BEGIN_ALLOW_THREADS
res = getbootvol();
Py_END_ALLOW_THREADS
if (res == NULL)
return mac_error();
return PyString_FromString(res);
}
#endif
static PyObject *
mac_getcwd(self, args)
PyObject *self;
......@@ -471,38 +445,12 @@ static PyStructSequence_Desc stat_result_desc = {
static PyTypeObject StatResultType;
#ifdef TARGET_API_MAC_OS8
static PyStructSequence_Field xstat_result_fields[] = {
COMMON_STAT_RESULT_FIELDS
{ "st_rsize" },
{ "st_creator" },
{ "st_type "},
{0}
};
static PyStructSequence_Desc xstat_result_desc = {
"mac.xstat_result",
stat_result__doc__,
xstat_result_fields,
13
};
static PyTypeObject XStatResultType;
#endif
static PyObject *
_pystat_from_struct_stat(struct stat st, void* _mst)
{
PyObject *v;
#if TARGET_API_MAC_OS8
struct macstat *mst;
if (_mst != NULL)
v = PyStructSequence_New(&XStatResultType);
else
#endif
v = PyStructSequence_New(&StatResultType);
v = PyStructSequence_New(&StatResultType);
PyStructSequence_SET_ITEM(v, 0, PyInt_FromLong((long)st.st_mode));
PyStructSequence_SET_ITEM(v, 1, PyInt_FromLong((long)st.st_ino));
PyStructSequence_SET_ITEM(v, 2, PyInt_FromLong((long)st.st_dev));
......@@ -516,26 +464,12 @@ _pystat_from_struct_stat(struct stat st, void* _mst)
PyFloat_FromDouble((double)st.st_mtime));
PyStructSequence_SET_ITEM(v, 9,
PyFloat_FromDouble((double)st.st_ctime));
#if TARGET_API_MAC_OS8
if (_mst != NULL) {
mst = (struct macstat *) _mst;
PyStructSequence_SET_ITEM(v, 10,
PyInt_FromLong((long)mst->st_rsize));
PyStructSequence_SET_ITEM(v, 11,
PyString_FromStringAndSize(mst->st_creator,
4));
PyStructSequence_SET_ITEM(v, 12,
PyString_FromStringAndSize(mst->st_type,
4));
if (PyErr_Occurred()) {
Py_DECREF(v);
return NULL;
}
#endif
if (PyErr_Occurred()) {
Py_DECREF(v);
return NULL;
}
return v;
return v;
}
......@@ -579,38 +513,6 @@ mac_fstat(self, args)
}
#endif /* WEHAVE_FSTAT */
#if TARGET_API_MAC_OS8
static PyObject *
mac_xstat(self, args)
PyObject *self;
PyObject *args;
{
struct macstat mst;
struct stat st;
char *path;
int res;
if (!PyArg_ParseTuple(args, "s", &path))
return NULL;
/*
** Convoluted: we want stat() and xstat() to agree, so we call both
** stat and macstat, and use the latter only for values not provided by
** the former.
*/
Py_BEGIN_ALLOW_THREADS
res = macstat(path, &mst);
Py_END_ALLOW_THREADS
if (res != 0)
return mac_error();
Py_BEGIN_ALLOW_THREADS
res = stat(path, &st);
Py_END_ALLOW_THREADS
if (res != 0)
return mac_error();
return _pystat_from_struct_stat(st, (void*) &mst);
}
#endif
static PyObject *
mac_sync(self, args)
PyObject *self;
......@@ -683,9 +585,6 @@ static struct PyMethodDef mac_methods[] = {
#endif
#ifdef WEHAVE_FSTAT
{"fstat", mac_fstat, 1},
#endif
#if TARGET_API_MAC_OS8
{"getbootvol", mac_getbootvol, 1}, /* non-standard */
#endif
{"getcwd", mac_getcwd, 1},
{"listdir", mac_listdir, 1},
......@@ -696,9 +595,6 @@ static struct PyMethodDef mac_methods[] = {
{"rename", mac_rename, 1},
{"rmdir", mac_rmdir, 1},
{"stat", mac_stat, 1},
#if TARGET_API_MAC_OS8
{"xstat", mac_xstat, 1},
#endif
{"sync", mac_sync, 1},
{"remove", mac_unlink, 1},
{"unlink", mac_unlink, 1},
......@@ -823,8 +719,4 @@ initmac()
PyStructSequence_InitType(&StatResultType, &stat_result_desc);
PyDict_SetItemString(d, "stat_result", (PyObject*) &StatResultType);
#if TARGET_API_MAC_OS8
PyStructSequence_InitType(&XStatResultType, &xstat_result_desc);
PyDict_SetItemString(d, "xstat_result", (PyObject*) &XStatResultType);
#endif
}
......@@ -348,49 +348,6 @@ MacOS_SetCreatorAndType(PyObject *self, PyObject *args)
return Py_None;
}
#if TARGET_API_MAC_OS8
/*----------------------------------------------------------------------*/
/* STDWIN High Level Event interface */
#include <EPPC.h>
#include <Events.h>
static char accepthle_doc[] = "Get arguments of pending high-level event";
static PyObject *
MacOS_AcceptHighLevelEvent(self, args)
PyObject *self;
PyObject *args;
{
TargetID sender;
unsigned long refcon;
Ptr buf;
unsigned long len;
OSErr err;
PyObject *res;
buf = NULL;
len = 0;
err = AcceptHighLevelEvent(&sender, &refcon, buf, &len);
if (err == bufferIsSmall) {
buf = malloc(len);
if (buf == NULL)
return PyErr_NoMemory();
err = AcceptHighLevelEvent(&sender, &refcon, buf, &len);
if (err != noErr) {
free(buf);
return PyErr_Mac(MacOS_Error, (int)err);
}
}
else if (err != noErr)
return PyErr_Mac(MacOS_Error, (int)err);
res = Py_BuildValue("s#ls#",
(char *)&sender, (int)(sizeof sender), refcon, (char *)buf, (int)len);
free(buf);
return res;
}
#endif
#if !TARGET_API_MAC_OSX
static char schedparams_doc[] = "Set/return mainloop interrupt check flag, etc";
......@@ -701,9 +658,6 @@ MacOS_OutputSeen(PyObject *self, PyObject *args)
#endif /* !TARGET_API_MAC_OSX */
static PyMethodDef MacOS_Methods[] = {
#if TARGET_API_MAC_OS8
{"AcceptHighLevelEvent", MacOS_AcceptHighLevelEvent, 1, accepthle_doc},
#endif
{"GetCreatorAndType", MacOS_GetCreatorAndType, 1, getcrtp_doc},
{"SetCreatorAndType", MacOS_SetCreatorAndType, 1, setcrtp_doc},
#if !TARGET_API_MAC_OSX
......@@ -759,8 +713,6 @@ initMacOS(void)
}
#if TARGET_API_MAC_OSX
#define PY_RUNTIMEMODEL "macho"
#elif TARGET_API_MAC_OS8
#define PY_RUNTIMEMODEL "ppc"
#elif TARGET_API_MAC_CARBON
#define PY_RUNTIMEMODEL "carbon"
#else
......
This diff is collapsed.
f = Function(void, 'OpenDeskAcc',
(Str255, 'name', InMode),
condition='#if !TARGET_API_MAC_CARBON'
)
functions.append(f)
f = Function(MenuHandle, 'as_Menu', (Handle, 'h', InMode))
functions.append(f)
......@@ -67,7 +61,6 @@ functions.append(f)
f = Function(ItemCount, 'CountMenuItemsWithCommandID',
(OptMenuRef, 'inMenu', InMode),
(MenuCommand, 'inCommandID', InMode),
condition='#if TARGET_API_MAC_CARBON',
)
functions.append(f)
......@@ -77,28 +70,24 @@ f = Function(OSStatus, 'GetIndMenuItemWithCommandID',
(UInt32, 'inItemIndex', InMode),
(MenuRef, 'outMenu', OutMode),
(MenuItemIndex, 'outIndex', OutMode),
condition='#if TARGET_API_MAC_CARBON',
)
functions.append(f)
f = Function(void, 'EnableMenuCommand',
(OptMenuRef, 'inMenu', InMode),
(MenuCommand, 'inCommandID', InMode),
condition='#if TARGET_API_MAC_CARBON',
)
functions.append(f)
f = Function(void, 'DisableMenuCommand',
(OptMenuRef, 'inMenu', InMode),
(MenuCommand, 'inCommandID', InMode),
condition='#if TARGET_API_MAC_CARBON',
)
functions.append(f)
f = Function(Boolean, 'IsMenuCommandEnabled',
(OptMenuRef, 'inMenu', InMode),
(MenuCommand, 'inCommandID', InMode),
condition='#if TARGET_API_MAC_CARBON',
)
functions.append(f)
......@@ -106,7 +95,6 @@ f = Function(OSStatus, 'SetMenuCommandMark',
(OptMenuRef, 'inMenu', InMode),
(MenuCommand, 'inCommandID', InMode),
(UniChar, 'inMark', InMode),
condition='#if TARGET_API_MAC_CARBON',
)
functions.append(f)
......@@ -114,7 +102,6 @@ f = Function(OSStatus, 'GetMenuCommandMark',
(OptMenuRef, 'inMenu', InMode),
(MenuCommand, 'inCommandID', InMode),
(UniChar, 'outMark', OutMode),
condition='#if TARGET_API_MAC_CARBON',
)
functions.append(f)
......@@ -124,7 +111,6 @@ f = Function(OSStatus, 'GetMenuCommandPropertySize',
(OSType, 'inPropertyCreator', InMode),
(OSType, 'inPropertyTag', InMode),
(ByteCount, 'outSize', OutMode),
condition='#if TARGET_API_MAC_CARBON',
)
functions.append(f)
......@@ -133,7 +119,6 @@ f = Function(OSStatus, 'RemoveMenuCommandProperty',
(MenuCommand, 'inCommandID', InMode),
(OSType, 'inPropertyCreator', InMode),
(OSType, 'inPropertyTag', InMode),
condition='#if TARGET_API_MAC_CARBON',
)
functions.append(f)
......@@ -44,80 +44,21 @@ class MyScanner(Scanner):
"GetMenuTitle", # Funny arg/returnvalue
"SetMenuTitle",
"SetMenuTitleIcon", # void*
# OS8 calls:
'GetMenuItemRefCon2',
'SetMenuItemRefCon2',
'EnableItem',
'DisableItem',
'CheckItem',
'CountMItems',
'OpenDeskAcc',
'SystemEdit',
'SystemMenu',
'SetMenuFlash',
'InitMenus',
'InitProcMenu',
]
def makegreylist(self):
return [
('#if !TARGET_API_MAC_CARBON', [
'GetMenuItemRefCon2',
'SetMenuItemRefCon2',
'EnableItem',
'DisableItem',
'CheckItem',
'CountMItems',
'OpenDeskAcc',
'SystemEdit',
'SystemMenu',
'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',
'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):
return [
'MCTableHandle',
......
......@@ -245,27 +245,6 @@ static PyObject *TXNObj_TXNClick(TXNObjectObject *_self, PyObject *_args)
return _res;
}
#if TARGET_API_MAC_OS8
static PyObject *TXNObj_TXNTSMCheck(TXNObjectObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
EventRecord ioEvent;
#ifndef TXNTSMCheck
PyMac_PRECHECK(TXNTSMCheck);
#endif
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = TXNTSMCheck(_self->ob_itself,
&ioEvent);
_res = Py_BuildValue("bO&",
_rv,
PyMac_BuildEventRecord, &ioEvent);
return _res;
}
#endif
static PyObject *TXNObj_TXNSelectAll(TXNObjectObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
......@@ -1193,11 +1172,6 @@ static PyMethodDef TXNObj_methods[] = {
PyDoc_STR("(RgnHandle ioCursorRgn) -> None")},
{"TXNClick", (PyCFunction)TXNObj_TXNClick, 1,
PyDoc_STR("(EventRecord iEvent) -> None")},
#if TARGET_API_MAC_OS8
{"TXNTSMCheck", (PyCFunction)TXNObj_TXNTSMCheck, 1,
PyDoc_STR("() -> (Boolean _rv, EventRecord ioEvent)")},
#endif
{"TXNSelectAll", (PyCFunction)TXNObj_TXNSelectAll, 1,
PyDoc_STR("() -> None")},
{"TXNFocus", (PyCFunction)TXNObj_TXNFocus, 1,
......
......@@ -78,12 +78,12 @@ kTXNFontSizeAttributeSize = 4
"kTXNFontSizeAttributeSize",
"status",
"justification",
'TXNTSMCheck', # OS8
]
def makegreylist(self):
return [
('#if TARGET_API_MAC_OS8', [
'TXNTSMCheck',
])]
......
......@@ -105,12 +105,6 @@ extern int _QdRGB_Convert(PyObject *, RGBColorPtr);
#endif /* ACCESSOR_CALLS_ARE_FUNCTIONS */
#if !TARGET_API_MAC_CARBON
#define QDFlushPortBuffer(port, rgn) /* pass */
#define QDIsPortBufferDirty(port) 0
#define QDIsPortBuffered(port) 0
#endif /* !TARGET_API_MAC_CARBON */
static PyObject *BMObj_NewCopied(BitMapPtr);
/*
......@@ -219,8 +213,6 @@ static PyObject *GrafObj_MacSetPort(GrafPortObject *_self, PyObject *_args)
return _res;
}
#if TARGET_API_MAC_CARBON
static PyObject *GrafObj_IsValidPort(GrafPortObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
......@@ -235,7 +227,6 @@ static PyObject *GrafObj_IsValidPort(GrafPortObject *_self, PyObject *_args)
_rv);
return _res;
}
#endif
static PyObject *GrafObj_GetPortPixMap(GrafPortObject *_self, PyObject *_args)
{
......@@ -636,8 +627,6 @@ static PyObject *GrafObj_IsPortPictureBeingDefined(GrafPortObject *_self, PyObje
return _res;
}
#if TARGET_API_MAC_CARBON
static PyObject *GrafObj_IsPortPolyBeingDefined(GrafPortObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
......@@ -652,9 +641,6 @@ static PyObject *GrafObj_IsPortPolyBeingDefined(GrafPortObject *_self, PyObject
_rv);
return _res;
}
#endif
#if TARGET_API_MAC_CARBON
static PyObject *GrafObj_IsPortOffscreen(GrafPortObject *_self, PyObject *_args)
{
......@@ -670,9 +656,6 @@ static PyObject *GrafObj_IsPortOffscreen(GrafPortObject *_self, PyObject *_args)
_rv);
return _res;
}
#endif
#if TARGET_API_MAC_CARBON
static PyObject *GrafObj_IsPortColor(GrafPortObject *_self, PyObject *_args)
{
......@@ -688,7 +671,6 @@ static PyObject *GrafObj_IsPortColor(GrafPortObject *_self, PyObject *_args)
_rv);
return _res;
}
#endif
static PyObject *GrafObj_SetPortBounds(GrafPortObject *_self, PyObject *_args)
{
......@@ -860,8 +842,6 @@ static PyObject *GrafObj_SetPortFracHPenLocation(GrafPortObject *_self, PyObject
return _res;
}
#if TARGET_API_MAC_CARBON
static PyObject *GrafObj_DisposePort(GrafPortObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
......@@ -875,7 +855,6 @@ static PyObject *GrafObj_DisposePort(GrafPortObject *_self, PyObject *_args)
_res = Py_None;
return _res;
}
#endif
static PyObject *GrafObj_QDIsPortBuffered(GrafPortObject *_self, PyObject *_args)
{
......@@ -924,8 +903,6 @@ static PyObject *GrafObj_QDFlushPortBuffer(GrafPortObject *_self, PyObject *_arg
return _res;
}
#if TARGET_API_MAC_CARBON
static PyObject *GrafObj_QDGetDirtyRegion(GrafPortObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
......@@ -944,9 +921,6 @@ static PyObject *GrafObj_QDGetDirtyRegion(GrafPortObject *_self, PyObject *_args
_res = Py_None;
return _res;
}
#endif
#if TARGET_API_MAC_CARBON
static PyObject *GrafObj_QDSetDirtyRegion(GrafPortObject *_self, PyObject *_args)
{
......@@ -966,16 +940,12 @@ static PyObject *GrafObj_QDSetDirtyRegion(GrafPortObject *_self, PyObject *_args
_res = Py_None;
return _res;
}
#endif
static PyMethodDef GrafObj_methods[] = {
{"MacSetPort", (PyCFunction)GrafObj_MacSetPort, 1,
PyDoc_STR("() -> None")},
#if TARGET_API_MAC_CARBON
{"IsValidPort", (PyCFunction)GrafObj_IsValidPort, 1,
PyDoc_STR("() -> (Boolean _rv)")},
#endif
{"GetPortPixMap", (PyCFunction)GrafObj_GetPortPixMap, 1,
PyDoc_STR("() -> (PixMapHandle _rv)")},
{"GetPortBitMapForCopyBits", (PyCFunction)GrafObj_GetPortBitMapForCopyBits, 1,
......@@ -1026,21 +996,12 @@ static PyMethodDef GrafObj_methods[] = {
PyDoc_STR("() -> (Boolean _rv)")},
{"IsPortPictureBeingDefined", (PyCFunction)GrafObj_IsPortPictureBeingDefined, 1,
PyDoc_STR("() -> (Boolean _rv)")},
#if TARGET_API_MAC_CARBON
{"IsPortPolyBeingDefined", (PyCFunction)GrafObj_IsPortPolyBeingDefined, 1,
PyDoc_STR("() -> (Boolean _rv)")},
#endif
#if TARGET_API_MAC_CARBON
{"IsPortOffscreen", (PyCFunction)GrafObj_IsPortOffscreen, 1,
PyDoc_STR("() -> (Boolean _rv)")},
#endif
#if TARGET_API_MAC_CARBON
{"IsPortColor", (PyCFunction)GrafObj_IsPortColor, 1,
PyDoc_STR("() -> (Boolean _rv)")},
#endif
{"SetPortBounds", (PyCFunction)GrafObj_SetPortBounds, 1,
PyDoc_STR("(Rect rect) -> None")},
{"SetPortOpColor", (PyCFunction)GrafObj_SetPortOpColor, 1,
......@@ -1061,27 +1022,18 @@ static PyMethodDef GrafObj_methods[] = {
PyDoc_STR("(SInt32 penMode) -> None")},
{"SetPortFracHPenLocation", (PyCFunction)GrafObj_SetPortFracHPenLocation, 1,
PyDoc_STR("(short pnLocHFrac) -> None")},
#if TARGET_API_MAC_CARBON
{"DisposePort", (PyCFunction)GrafObj_DisposePort, 1,
PyDoc_STR("() -> None")},
#endif
{"QDIsPortBuffered", (PyCFunction)GrafObj_QDIsPortBuffered, 1,
PyDoc_STR("() -> (Boolean _rv)")},
{"QDIsPortBufferDirty", (PyCFunction)GrafObj_QDIsPortBufferDirty, 1,
PyDoc_STR("() -> (Boolean _rv)")},
{"QDFlushPortBuffer", (PyCFunction)GrafObj_QDFlushPortBuffer, 1,
PyDoc_STR("(RgnHandle region) -> None")},
#if TARGET_API_MAC_CARBON
{"QDGetDirtyRegion", (PyCFunction)GrafObj_QDGetDirtyRegion, 1,
PyDoc_STR("(RgnHandle rgn) -> None")},
#endif
#if TARGET_API_MAC_CARBON
{"QDSetDirtyRegion", (PyCFunction)GrafObj_QDSetDirtyRegion, 1,
PyDoc_STR("(RgnHandle rgn) -> None")},
#endif
{NULL, NULL, 0}
};
......@@ -2548,8 +2500,6 @@ static PyObject *Qd_BitMapToRegion(PyObject *_self, PyObject *_args)
return _res;
}
#if TARGET_API_MAC_CARBON
static PyObject *Qd_RgnToHandle(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
......@@ -2568,7 +2518,6 @@ static PyObject *Qd_RgnToHandle(PyObject *_self, PyObject *_args)
_res = Py_None;
return _res;
}
#endif
static PyObject *Qd_DisposeRgn(PyObject *_self, PyObject *_args)
{
......@@ -5005,8 +4954,6 @@ static PyObject *Qd_GetRegionBounds(PyObject *_self, PyObject *_args)
return _res;
}
#if TARGET_API_MAC_CARBON
static PyObject *Qd_IsRegionRectangular(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
......@@ -5023,9 +4970,6 @@ static PyObject *Qd_IsRegionRectangular(PyObject *_self, PyObject *_args)
_rv);
return _res;
}
#endif
#if TARGET_API_MAC_CARBON
static PyObject *Qd_CreateNewPort(PyObject *_self, PyObject *_args)
{
......@@ -5041,9 +4985,6 @@ static PyObject *Qd_CreateNewPort(PyObject *_self, PyObject *_args)
GrafObj_New, _rv);
return _res;
}
#endif
#if TARGET_API_MAC_CARBON
static PyObject *Qd_SetQDError(PyObject *_self, PyObject *_args)
{
......@@ -5060,7 +5001,6 @@ static PyObject *Qd_SetQDError(PyObject *_self, PyObject *_args)
_res = Py_None;
return _res;
}
#endif
static PyObject *Qd_LMGetScrVRes(PyObject *_self, PyObject *_args)
{
......@@ -6456,11 +6396,8 @@ static PyMethodDef Qd_methods[] = {
PyDoc_STR("(RgnHandle dstRgn) -> None")},
{"BitMapToRegion", (PyCFunction)Qd_BitMapToRegion, 1,
PyDoc_STR("(RgnHandle region, BitMapPtr bMap) -> None")},
#if TARGET_API_MAC_CARBON
{"RgnToHandle", (PyCFunction)Qd_RgnToHandle, 1,
PyDoc_STR("(RgnHandle region, Handle flattenedRgnDataHdl) -> None")},
#endif
{"DisposeRgn", (PyCFunction)Qd_DisposeRgn, 1,
PyDoc_STR("(RgnHandle rgn) -> None")},
{"MacCopyRgn", (PyCFunction)Qd_MacCopyRgn, 1,
......@@ -6723,21 +6660,12 @@ static PyMethodDef Qd_methods[] = {
PyDoc_STR("(Cursor arrow) -> None")},
{"GetRegionBounds", (PyCFunction)Qd_GetRegionBounds, 1,
PyDoc_STR("(RgnHandle region) -> (Rect bounds)")},
#if TARGET_API_MAC_CARBON
{"IsRegionRectangular", (PyCFunction)Qd_IsRegionRectangular, 1,
PyDoc_STR("(RgnHandle region) -> (Boolean _rv)")},
#endif
#if TARGET_API_MAC_CARBON
{"CreateNewPort", (PyCFunction)Qd_CreateNewPort, 1,
PyDoc_STR("() -> (CGrafPtr _rv)")},
#endif
#if TARGET_API_MAC_CARBON
{"SetQDError", (PyCFunction)Qd_SetQDError, 1,
PyDoc_STR("(OSErr err) -> None")},
#endif
{"LMGetScrVRes", (PyCFunction)Qd_LMGetScrVRes, 1,
PyDoc_STR("() -> (SInt16 _rv)")},
{"LMSetScrVRes", (PyCFunction)Qd_LMSetScrVRes, 1,
......
......@@ -118,25 +118,6 @@ extend = 0x40
'CursorComponentSetData',
]
def makegreylist(self):
return [
('#if !TARGET_API_MAC_CARBON', [
]),
('#if TARGET_API_MAC_CARBON', [
'IsPortOffscreen', # Lazy
'IsPortColor', # Lazy
'IsRegionRectangular',
'CreateNewPort',
'DisposePort',
'SetQDError',
'IsPortPolyBeingDefined',
'QDSetDirtyRegion',
'QDGetDirtyRegion',
'IsValidPort',
'RgnToHandle',
])]
def makeblacklisttypes(self):
return [
'CIconHandle', # Obsolete
......
......@@ -151,12 +151,6 @@ extern int _QdRGB_Convert(PyObject *, RGBColorPtr);
#endif /* ACCESSOR_CALLS_ARE_FUNCTIONS */
#if !TARGET_API_MAC_CARBON
#define QDFlushPortBuffer(port, rgn) /* pass */
#define QDIsPortBufferDirty(port) 0
#define QDIsPortBuffered(port) 0
#endif /* !TARGET_API_MAC_CARBON */
static PyObject *BMObj_NewCopied(BitMapPtr);
/*
......
This diff is collapsed.
......@@ -62,24 +62,21 @@ class MyScanner(Scanner):
"MakeTrackTimeTable", # Uses long * return?
"MakeMediaTimeTable", # ditto
## "VideoMediaGetStallCount", # Undefined in CW Pro 3 library
]
# OS8 only:
'SpriteMediaGetIndImageProperty', # XXXX Why isn't this in carbon?
'CheckQuickTimeRegistration',
'SetMovieAnchorDataRef',
'GetMovieAnchorDataRef',
'GetMovieLoadState',
'OpenADataHandler',
'MovieMediaGetCurrentMovieProperty',
'MovieMediaGetCurrentTrackProperty',
'MovieMediaGetChildMovieDataReference',
'MovieMediaSetChildMovieDataReference',
'MovieMediaLoadChildMovieFromDataReference',
'Media3DGetViewObject',
def makegreylist(self):
return [
('#if !TARGET_API_MAC_CARBON', [
'SpriteMediaGetIndImageProperty', # XXXX Why isn't this in carbon?
'CheckQuickTimeRegistration',
'SetMovieAnchorDataRef',
'GetMovieAnchorDataRef',
'GetMovieLoadState',
'OpenADataHandler',
'MovieMediaGetCurrentMovieProperty',
'MovieMediaGetCurrentTrackProperty',
'MovieMediaGetChildMovieDataReference',
'MovieMediaSetChildMovieDataReference',
'MovieMediaLoadChildMovieFromDataReference',
'Media3DGetViewObject',
])]
]
def makeblacklisttypes(self):
return [
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment