summaryrefslogtreecommitdiffstats
path: root/Mac/Modules
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2003-11-19 16:34:04 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2003-11-19 16:34:04 (GMT)
commita53f4eba19856613a55ccbcfdb8c862d24a691b9 (patch)
tree55e8e3616059daa41c666e3b0abd92ed8a0efd43 /Mac/Modules
parent9588770e25db99692f3ebb680235bc1a02b65017 (diff)
downloadcpython-a53f4eba19856613a55ccbcfdb8c862d24a691b9.zip
cpython-a53f4eba19856613a55ccbcfdb8c862d24a691b9.tar.gz
cpython-a53f4eba19856613a55ccbcfdb8c862d24a691b9.tar.bz2
Getting rid of code conditional on TARGET_API_MAC_*.
Diffstat (limited to 'Mac/Modules')
-rw-r--r--Mac/Modules/ae/_AEmodule.c9
-rw-r--r--Mac/Modules/ae/aesupport.py6
-rwxr-xr-xMac/Modules/cg/_CGmodule.c124
-rwxr-xr-xMac/Modules/cg/cgsupport.py126
-rw-r--r--Mac/Modules/ctl/_Ctlmodule.c48
-rw-r--r--Mac/Modules/ctl/ctlscan.py14
-rw-r--r--Mac/Modules/file/_Filemodule.c66
-rw-r--r--Mac/Modules/file/filescan.py8
-rw-r--r--Mac/Modules/file/filesupport.py48
-rw-r--r--Mac/Modules/fm/fmscan.py4
-rw-r--r--Mac/Modules/help/_Helpmodule.c3
-rw-r--r--Mac/Modules/macosmodule.c186
-rw-r--r--Mac/Modules/mlte/mltescan.py6
-rw-r--r--Mac/Modules/res/_Resmodule.c3
-rw-r--r--Mac/Modules/win/_Winmodule.c6
-rw-r--r--Mac/Modules/win/winscan.py8
16 files changed, 2 insertions, 663 deletions
diff --git a/Mac/Modules/ae/_AEmodule.c b/Mac/Modules/ae/_AEmodule.c
index 91364e7..fd6582b 100644
--- a/Mac/Modules/ae/_AEmodule.c
+++ b/Mac/Modules/ae/_AEmodule.c
@@ -20,9 +20,6 @@
}} while(0)
-#ifndef PyDoc_STR
-#define PyDoc_STR(x) (x)
-#endif
#include <Carbon/Carbon.h>
#ifdef USE_TOOLBOX_OBJECT_GLUE
@@ -44,12 +41,6 @@ static pascal Boolean AEIdleProc(EventRecord *theEvent, long *sleepTime, RgnHand
{
if ( PyOS_InterruptOccurred() )
return 1;
-#if !TARGET_API_MAC_OSX
- if ( PyMac_HandleEvent(theEvent) < 0 ) {
- PySys_WriteStderr("Exception in user event handler during AE processing\n");
- PyErr_Clear();
- }
-#endif
return 0;
}
diff --git a/Mac/Modules/ae/aesupport.py b/Mac/Modules/ae/aesupport.py
index 96d1ccf..17184db 100644
--- a/Mac/Modules/ae/aesupport.py
+++ b/Mac/Modules/ae/aesupport.py
@@ -103,12 +103,6 @@ static pascal Boolean AEIdleProc(EventRecord *theEvent, long *sleepTime, RgnHand
{
if ( PyOS_InterruptOccurred() )
return 1;
-#if !TARGET_API_MAC_OSX
- if ( PyMac_HandleEvent(theEvent) < 0 ) {
- PySys_WriteStderr("Exception in user event handler during AE processing\\n");
- PyErr_Clear();
- }
-#endif
return 0;
}
diff --git a/Mac/Modules/cg/_CGmodule.c b/Mac/Modules/cg/_CGmodule.c
index 09b803c..3971185 100755
--- a/Mac/Modules/cg/_CGmodule.c
+++ b/Mac/Modules/cg/_CGmodule.c
@@ -22,113 +22,6 @@
#include <ApplicationServices/ApplicationServices.h>
-#if !TARGET_API_MAC_OSX
- /* This code is adapted from the CallMachOFramework demo at:
- http://developer.apple.com/samplecode/Sample_Code/Runtime_Architecture/CallMachOFramework.htm
- It allows us to call Mach-O functions from CFM apps. */
-
- #include <Folders.h>
- #include "CFMLateImport.h"
-
- static OSStatus LoadFrameworkBundle(CFStringRef framework, CFBundleRef *bundlePtr)
- // This routine finds a the named framework and creates a CFBundle
- // object for it. It looks for the framework in the frameworks folder,
- // as defined by the Folder Manager. Currently this is
- // "/System/Library/Frameworks", but we recommend that you avoid hard coded
- // paths to ensure future compatibility.
- //
- // You might think that you could use CFBundleGetBundleWithIdentifier but
- // that only finds bundles that are already loaded into your context.
- // That would work in the case of the System framework but it wouldn't
- // work if you're using some other, less-obvious, framework.
- {
- OSStatus err;
- FSRef frameworksFolderRef;
- CFURLRef baseURL;
- CFURLRef bundleURL;
-
- *bundlePtr = nil;
-
- baseURL = nil;
- bundleURL = nil;
-
- // Find the frameworks folder and create a URL for it.
-
- err = FSFindFolder(kOnAppropriateDisk, kFrameworksFolderType, true, &frameworksFolderRef);
- if (err == noErr) {
- baseURL = CFURLCreateFromFSRef(kCFAllocatorSystemDefault, &frameworksFolderRef);
- if (baseURL == nil) {
- err = coreFoundationUnknownErr;
- }
- }
-
- // Append the name of the framework to the URL.
-
- if (err == noErr) {
- bundleURL = CFURLCreateCopyAppendingPathComponent(kCFAllocatorSystemDefault, baseURL, framework, false);
- if (bundleURL == nil) {
- err = coreFoundationUnknownErr;
- }
- }
-
- // Create a bundle based on that URL and load the bundle into memory.
- // We never unload the bundle, which is reasonable in this case because
- // the sample assumes that you'll be calling functions from this
- // framework throughout the life of your application.
-
- if (err == noErr) {
- *bundlePtr = CFBundleCreate(kCFAllocatorSystemDefault, bundleURL);
- if (*bundlePtr == nil) {
- err = coreFoundationUnknownErr;
- }
- }
- if (err == noErr) {
- if ( ! CFBundleLoadExecutable( *bundlePtr ) ) {
- err = coreFoundationUnknownErr;
- }
- }
-
- // Clean up.
-
- if (err != noErr && *bundlePtr != nil) {
- CFRelease(*bundlePtr);
- *bundlePtr = nil;
- }
- if (bundleURL != nil) {
- CFRelease(bundleURL);
- }
- if (baseURL != nil) {
- CFRelease(baseURL);
- }
-
- return err;
- }
-
-
-
- // The CFMLateImport approach requires that you define a fragment
- // initialisation routine that latches the fragment's connection
- // ID and locator. If your code already has a fragment initialiser
- // you will have to integrate the following into it.
-
- static CFragConnectionID gFragToFixConnID;
- static FSSpec gFragToFixFile;
- static CFragSystem7DiskFlatLocator gFragToFixLocator;
-
- extern OSErr FragmentInit(const CFragInitBlock *initBlock);
- extern OSErr FragmentInit(const CFragInitBlock *initBlock)
- {
- __initialize(initBlock); /* call the "original" initializer */
- gFragToFixConnID = (CFragConnectionID) initBlock->closureID;
- gFragToFixFile = *(initBlock->fragLocator.u.onDisk.fileSpec);
- gFragToFixLocator = initBlock->fragLocator.u.onDisk;
- gFragToFixLocator.fileSpec = &gFragToFixFile;
-
- return noErr;
- }
-
-#endif
-
extern int GrafObj_Convert(PyObject *, GrafPtr *);
/*
@@ -1369,23 +1262,6 @@ void init_CG(void)
-#if !TARGET_API_MAC_OSX
- CFBundleRef sysBundle;
- OSStatus err;
-
- if (&LoadFrameworkBundle == NULL) {
- PyErr_SetString(PyExc_ImportError, "CoreCraphics not supported");
- return;
- }
- err = LoadFrameworkBundle(CFSTR("ApplicationServices.framework"), &sysBundle);
- if (err == noErr)
- err = CFMLateImportBundle(&gFragToFixLocator, gFragToFixConnID, FragmentInit, "\pCGStubLib", sysBundle);
- if (err != noErr) {
- PyErr_SetString(PyExc_ImportError, "CoreCraphics not supported");
- return;
- };
-#endif /* !TARGET_API_MAC_OSX */
-
m = Py_InitModule("_CG", CG_methods);
d = PyModule_GetDict(m);
diff --git a/Mac/Modules/cg/cgsupport.py b/Mac/Modules/cg/cgsupport.py
index a8372f2..1b667c0 100755
--- a/Mac/Modules/cg/cgsupport.py
+++ b/Mac/Modules/cg/cgsupport.py
@@ -25,113 +25,6 @@ RgnHandle = OpaqueByValueType("RgnHandle", "ResObj")
includestuff = includestuff + """
#include <ApplicationServices/ApplicationServices.h>
-#if !TARGET_API_MAC_OSX
- /* This code is adapted from the CallMachOFramework demo at:
- http://developer.apple.com/samplecode/Sample_Code/Runtime_Architecture/CallMachOFramework.htm
- It allows us to call Mach-O functions from CFM apps. */
-
- #include <Folders.h>
- #include "CFMLateImport.h"
-
- static OSStatus LoadFrameworkBundle(CFStringRef framework, CFBundleRef *bundlePtr)
- // This routine finds a the named framework and creates a CFBundle
- // object for it. It looks for the framework in the frameworks folder,
- // as defined by the Folder Manager. Currently this is
- // "/System/Library/Frameworks", but we recommend that you avoid hard coded
- // paths to ensure future compatibility.
- //
- // You might think that you could use CFBundleGetBundleWithIdentifier but
- // that only finds bundles that are already loaded into your context.
- // That would work in the case of the System framework but it wouldn't
- // work if you're using some other, less-obvious, framework.
- {
- OSStatus err;
- FSRef frameworksFolderRef;
- CFURLRef baseURL;
- CFURLRef bundleURL;
-
- *bundlePtr = nil;
-
- baseURL = nil;
- bundleURL = nil;
-
- // Find the frameworks folder and create a URL for it.
-
- err = FSFindFolder(kOnAppropriateDisk, kFrameworksFolderType, true, &frameworksFolderRef);
- if (err == noErr) {
- baseURL = CFURLCreateFromFSRef(kCFAllocatorSystemDefault, &frameworksFolderRef);
- if (baseURL == nil) {
- err = coreFoundationUnknownErr;
- }
- }
-
- // Append the name of the framework to the URL.
-
- if (err == noErr) {
- bundleURL = CFURLCreateCopyAppendingPathComponent(kCFAllocatorSystemDefault, baseURL, framework, false);
- if (bundleURL == nil) {
- err = coreFoundationUnknownErr;
- }
- }
-
- // Create a bundle based on that URL and load the bundle into memory.
- // We never unload the bundle, which is reasonable in this case because
- // the sample assumes that you'll be calling functions from this
- // framework throughout the life of your application.
-
- if (err == noErr) {
- *bundlePtr = CFBundleCreate(kCFAllocatorSystemDefault, bundleURL);
- if (*bundlePtr == nil) {
- err = coreFoundationUnknownErr;
- }
- }
- if (err == noErr) {
- if ( ! CFBundleLoadExecutable( *bundlePtr ) ) {
- err = coreFoundationUnknownErr;
- }
- }
-
- // Clean up.
-
- if (err != noErr && *bundlePtr != nil) {
- CFRelease(*bundlePtr);
- *bundlePtr = nil;
- }
- if (bundleURL != nil) {
- CFRelease(bundleURL);
- }
- if (baseURL != nil) {
- CFRelease(baseURL);
- }
-
- return err;
- }
-
-
-
- // The CFMLateImport approach requires that you define a fragment
- // initialisation routine that latches the fragment's connection
- // ID and locator. If your code already has a fragment initialiser
- // you will have to integrate the following into it.
-
- static CFragConnectionID gFragToFixConnID;
- static FSSpec gFragToFixFile;
- static CFragSystem7DiskFlatLocator gFragToFixLocator;
-
- extern OSErr FragmentInit(const CFragInitBlock *initBlock);
- extern OSErr FragmentInit(const CFragInitBlock *initBlock)
- {
- __initialize(initBlock); /* call the "original" initializer */
- gFragToFixConnID = (CFragConnectionID) initBlock->closureID;
- gFragToFixFile = *(initBlock->fragLocator.u.onDisk.fileSpec);
- gFragToFixLocator = initBlock->fragLocator.u.onDisk;
- gFragToFixLocator.fileSpec = &gFragToFixFile;
-
- return noErr;
- }
-
-#endif
-
extern int GrafObj_Convert(PyObject *, GrafPtr *);
/*
@@ -205,25 +98,6 @@ CGAffineTransform_Convert(PyObject *v, CGAffineTransform *p_itself)
}
"""
-initstuff = initstuff + """
-#if !TARGET_API_MAC_OSX
-CFBundleRef sysBundle;
-OSStatus err;
-
-if (&LoadFrameworkBundle == NULL) {
- PyErr_SetString(PyExc_ImportError, "CoreCraphics not supported");
- return;
-}
-err = LoadFrameworkBundle(CFSTR("ApplicationServices.framework"), &sysBundle);
-if (err == noErr)
- err = CFMLateImportBundle(&gFragToFixLocator, gFragToFixConnID, FragmentInit, "\pCGStubLib", sysBundle);
-if (err != noErr) {
- PyErr_SetString(PyExc_ImportError, "CoreCraphics not supported");
- return;
-};
-#endif /* !TARGET_API_MAC_OSX */
-"""
-
class MyOpaqueByValueType(OpaqueByValueType):
"""Sort of a mix between OpaqueByValueType and OpaqueType."""
def mkvalueArgs(self, name):
diff --git a/Mac/Modules/ctl/_Ctlmodule.c b/Mac/Modules/ctl/_Ctlmodule.c
index 60fcef4..3f12778 100644
--- a/Mac/Modules/ctl/_Ctlmodule.c
+++ b/Mac/Modules/ctl/_Ctlmodule.c
@@ -306,8 +306,6 @@ static PyObject *CtlObj_SetControlVisibility(ControlObject *_self, PyObject *_ar
return _res;
}
-#if TARGET_API_MAC_OSX
-
static PyObject *CtlObj_IsControlEnabled(ControlObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@@ -322,9 +320,6 @@ static PyObject *CtlObj_IsControlEnabled(ControlObject *_self, PyObject *_args)
_rv);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_OSX
static PyObject *CtlObj_EnableControl(ControlObject *_self, PyObject *_args)
{
@@ -341,9 +336,6 @@ static PyObject *CtlObj_EnableControl(ControlObject *_self, PyObject *_args)
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_OSX
static PyObject *CtlObj_DisableControl(ControlObject *_self, PyObject *_args)
{
@@ -360,7 +352,6 @@ static PyObject *CtlObj_DisableControl(ControlObject *_self, PyObject *_args)
_res = Py_None;
return _res;
}
-#endif
static PyObject *CtlObj_Draw1Control(ControlObject *_self, PyObject *_args)
{
@@ -2461,8 +2452,6 @@ static PyObject *CtlObj_SetDataBrowserEditText(ControlObject *_self, PyObject *_
return _res;
}
-#if TARGET_API_MAC_OSX
-
static PyObject *CtlObj_CopyDataBrowserEditText(ControlObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@@ -2480,7 +2469,6 @@ static PyObject *CtlObj_CopyDataBrowserEditText(ControlObject *_self, PyObject *
CFStringRefObj_New, text);
return _res;
}
-#endif
static PyObject *CtlObj_GetDataBrowserEditText(ControlObject *_self, PyObject *_args)
{
@@ -3508,21 +3496,12 @@ static PyMethodDef CtlObj_methods[] = {
PyDoc_STR("() -> None")},
{"SetControlVisibility", (PyCFunction)CtlObj_SetControlVisibility, 1,
PyDoc_STR("(Boolean inIsVisible, Boolean inDoDraw) -> None")},
-
-#if TARGET_API_MAC_OSX
{"IsControlEnabled", (PyCFunction)CtlObj_IsControlEnabled, 1,
PyDoc_STR("() -> (Boolean _rv)")},
-#endif
-
-#if TARGET_API_MAC_OSX
{"EnableControl", (PyCFunction)CtlObj_EnableControl, 1,
PyDoc_STR("() -> None")},
-#endif
-
-#if TARGET_API_MAC_OSX
{"DisableControl", (PyCFunction)CtlObj_DisableControl, 1,
PyDoc_STR("() -> None")},
-#endif
{"Draw1Control", (PyCFunction)CtlObj_Draw1Control, 1,
PyDoc_STR("() -> None")},
{"GetBestControlRect", (PyCFunction)CtlObj_GetBestControlRect, 1,
@@ -3745,11 +3724,8 @@ static PyMethodDef CtlObj_methods[] = {
PyDoc_STR("(UInt32 property) -> (UInt32 flags)")},
{"SetDataBrowserEditText", (PyCFunction)CtlObj_SetDataBrowserEditText, 1,
PyDoc_STR("(CFStringRef text) -> None")},
-
-#if TARGET_API_MAC_OSX
{"CopyDataBrowserEditText", (PyCFunction)CtlObj_CopyDataBrowserEditText, 1,
PyDoc_STR("() -> (CFStringRef text)")},
-#endif
{"GetDataBrowserEditText", (PyCFunction)CtlObj_GetDataBrowserEditText, 1,
PyDoc_STR("(CFMutableStringRef text) -> None")},
{"SetDataBrowserEditItem", (PyCFunction)CtlObj_SetDataBrowserEditItem, 1,
@@ -4460,8 +4436,6 @@ static PyObject *Ctl_CreateProgressBarControl(PyObject *_self, PyObject *_args)
return _res;
}
-#if TARGET_API_MAC_OSX
-
static PyObject *Ctl_CreateRelevanceBarControl(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@@ -4493,7 +4467,6 @@ static PyObject *Ctl_CreateRelevanceBarControl(PyObject *_self, PyObject *_args)
CtlObj_New, outControl);
return _res;
}
-#endif
static PyObject *Ctl_CreateLittleArrowsControl(PyObject *_self, PyObject *_args)
{
@@ -5232,8 +5205,6 @@ static PyObject *Ctl_CreateScrollingTextBoxControl(PyObject *_self, PyObject *_a
return _res;
}
-#if TARGET_API_MAC_OSX
-
static PyObject *Ctl_CreateDisclosureButtonControl(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@@ -5262,9 +5233,6 @@ static PyObject *Ctl_CreateDisclosureButtonControl(PyObject *_self, PyObject *_a
CtlObj_New, outControl);
return _res;
}
-#endif
-
-#if TARGET_API_MAC_OSX
static PyObject *Ctl_CreateRoundButtonControl(PyObject *_self, PyObject *_args)
{
@@ -5294,7 +5262,6 @@ static PyObject *Ctl_CreateRoundButtonControl(PyObject *_self, PyObject *_args)
CtlObj_New, outControl);
return _res;
}
-#endif
static PyObject *Ctl_CreateDataBrowserControl(PyObject *_self, PyObject *_args)
{
@@ -5322,8 +5289,6 @@ static PyObject *Ctl_CreateDataBrowserControl(PyObject *_self, PyObject *_args)
return _res;
}
-#if TARGET_API_MAC_OSX
-
static PyObject *Ctl_CreateEditUnicodeTextControl(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@@ -5355,7 +5320,6 @@ static PyObject *Ctl_CreateEditUnicodeTextControl(PyObject *_self, PyObject *_ar
CtlObj_New, outControl);
return _res;
}
-#endif
static PyObject *Ctl_FindControlUnderMouse(PyObject *_self, PyObject *_args)
{
@@ -5498,11 +5462,8 @@ static PyMethodDef Ctl_methods[] = {
PyDoc_STR("(WindowPtr window, Rect boundsRect, UInt16 orientation, CFStringRef title, SInt32 initialValue, Boolean drawTitle, Boolean autoToggles) -> (ControlHandle outControl)")},
{"CreateProgressBarControl", (PyCFunction)Ctl_CreateProgressBarControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, SInt32 value, SInt32 minimum, SInt32 maximum, Boolean indeterminate) -> (ControlHandle outControl)")},
-
-#if TARGET_API_MAC_OSX
{"CreateRelevanceBarControl", (PyCFunction)Ctl_CreateRelevanceBarControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, SInt32 value, SInt32 minimum, SInt32 maximum) -> (ControlHandle outControl)")},
-#endif
{"CreateLittleArrowsControl", (PyCFunction)Ctl_CreateLittleArrowsControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, SInt32 value, SInt32 minimum, SInt32 maximum, SInt32 increment) -> (ControlHandle outControl)")},
{"CreateChasingArrowsControl", (PyCFunction)Ctl_CreateChasingArrowsControl, 1,
@@ -5551,23 +5512,14 @@ static PyMethodDef Ctl_methods[] = {
PyDoc_STR("(WindowPtr window, Rect boundsRect) -> (ControlHandle outControl)")},
{"CreateScrollingTextBoxControl", (PyCFunction)Ctl_CreateScrollingTextBoxControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, SInt16 contentResID, Boolean autoScroll, UInt32 delayBeforeAutoScroll, UInt32 delayBetweenAutoScroll, UInt16 autoScrollAmount) -> (ControlHandle outControl)")},
-
-#if TARGET_API_MAC_OSX
{"CreateDisclosureButtonControl", (PyCFunction)Ctl_CreateDisclosureButtonControl, 1,
PyDoc_STR("(WindowPtr inWindow, Rect inBoundsRect, SInt32 inValue, Boolean inAutoToggles) -> (ControlHandle outControl)")},
-#endif
-
-#if TARGET_API_MAC_OSX
{"CreateRoundButtonControl", (PyCFunction)Ctl_CreateRoundButtonControl, 1,
PyDoc_STR("(WindowPtr inWindow, Rect inBoundsRect, SInt16 inSize, ControlButtonContentInfo inContent) -> (ControlHandle outControl)")},
-#endif
{"CreateDataBrowserControl", (PyCFunction)Ctl_CreateDataBrowserControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, OSType style) -> (ControlHandle outControl)")},
-
-#if TARGET_API_MAC_OSX
{"CreateEditUnicodeTextControl", (PyCFunction)Ctl_CreateEditUnicodeTextControl, 1,
PyDoc_STR("(WindowPtr window, Rect boundsRect, CFStringRef text, Boolean isPassword, ControlFontStyleRec style) -> (ControlHandle outControl)")},
-#endif
{"FindControlUnderMouse", (PyCFunction)Ctl_FindControlUnderMouse, 1,
PyDoc_STR("(Point inWhere, WindowPtr inWindow) -> (ControlHandle _rv, SInt16 outPart)")},
{"as_Control", (PyCFunction)Ctl_as_Control, 1,
diff --git a/Mac/Modules/ctl/ctlscan.py b/Mac/Modules/ctl/ctlscan.py
index f7bd888..ac1d3f4 100644
--- a/Mac/Modules/ctl/ctlscan.py
+++ b/Mac/Modules/ctl/ctlscan.py
@@ -99,20 +99,6 @@ class MyScanner(Scanner):
'SetControlColor',
]
- def makegreylist(self):
- return [
- ('#if TARGET_API_MAC_OSX', [
- 'CreateRoundButtonControl',
- 'CreateDisclosureButtonControl',
- 'CreateRelevanceBarControl',
- 'DisableControl',
- 'EnableControl',
- 'IsControlEnabled',
- 'CreateEditUnicodeTextControl',
- 'CopyDataBrowserEditText',
- ]),
- ]
-
def makeblacklisttypes(self):
return [
'ProcPtr',
diff --git a/Mac/Modules/file/_Filemodule.c b/Mac/Modules/file/_Filemodule.c
index 9d6e371..f5f48d2 100644
--- a/Mac/Modules/file/_Filemodule.c
+++ b/Mac/Modules/file/_Filemodule.c
@@ -1757,8 +1757,6 @@ static PyObject *FSRef_FSOpenFork(FSRefObject *_self, PyObject *_args)
return _res;
}
-#if TARGET_API_MAC_OSX
-
static PyObject *FSRef_FNNotify(FSRefObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@@ -1777,7 +1775,6 @@ static PyObject *FSRef_FNNotify(FSRefObject *_self, PyObject *_args)
_res = Py_None;
return _res;
}
-#endif
static PyObject *FSRef_FSNewAliasMinimal(FSRefObject *_self, PyObject *_args)
{
@@ -1836,26 +1833,9 @@ static PyObject *FSRef_as_pathname(FSRefObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
-#if TARGET_API_MAC_OSX
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_res = FSRef_FSRefMakePath(_self, _args);
-#else
- char strbuf[1024];
- OSErr err;
- FSSpec fss;
-
- if (!PyArg_ParseTuple(_args, ""))
- return NULL;
- if ( !PyMac_GetFSSpec((PyObject *)_self, &fss))
- return NULL;
- err = PyMac_GetFullPathname(&fss, strbuf, sizeof(strbuf));
- if ( err ) {
- PyMac_Error(err);
- return NULL;
- }
- _res = PyString_FromString(strbuf);
-#endif
return _res;
}
@@ -1887,11 +1867,8 @@ static PyMethodDef FSRef_methods[] = {
PyDoc_STR("(Buffer forkNameLength) -> None")},
{"FSOpenFork", (PyCFunction)FSRef_FSOpenFork, 1,
PyDoc_STR("(Buffer forkNameLength, SInt8 permissions) -> (SInt16 forkRefNum)")},
-
-#if TARGET_API_MAC_OSX
{"FNNotify", (PyCFunction)FSRef_FNNotify, 1,
PyDoc_STR("(FNMessage message, OptionBits flags) -> None")},
-#endif
{"FSNewAliasMinimal", (PyCFunction)FSRef_FSNewAliasMinimal, 1,
PyDoc_STR("() -> (AliasHandle inAlias)")},
{"FSIsAliasFile", (PyCFunction)FSRef_FSIsAliasFile, 1,
@@ -2726,8 +2703,6 @@ static PyObject *File_FSPathMakeRef(PyObject *_self, PyObject *_args)
return _res;
}
-#if TARGET_API_MAC_OSX
-
static PyObject *File_FNNotifyByPath(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@@ -2748,9 +2723,6 @@ static PyObject *File_FNNotifyByPath(PyObject *_self, PyObject *_args)
_res = Py_None;
return _res;
}
-#endif
-
-#if TARGET_API_MAC_OSX
static PyObject *File_FNNotifyAll(PyObject *_self, PyObject *_args)
{
@@ -2769,7 +2741,6 @@ static PyObject *File_FNNotifyAll(PyObject *_self, PyObject *_args)
_res = Py_None;
return _res;
}
-#endif
static PyObject *File_NewAlias(PyObject *_self, PyObject *_args)
{
@@ -3106,16 +3077,10 @@ static PyMethodDef File_methods[] = {
PyDoc_STR("() -> (HFSUniStr255 resourceForkName)")},
{"FSPathMakeRef", (PyCFunction)File_FSPathMakeRef, 1,
PyDoc_STR("(UInt8 * path) -> (FSRef ref, Boolean isDirectory)")},
-
-#if TARGET_API_MAC_OSX
{"FNNotifyByPath", (PyCFunction)File_FNNotifyByPath, 1,
PyDoc_STR("(UInt8 * path, FNMessage message, OptionBits flags) -> None")},
-#endif
-
-#if TARGET_API_MAC_OSX
{"FNNotifyAll", (PyCFunction)File_FNNotifyAll, 1,
PyDoc_STR("(FNMessage message, OptionBits flags) -> None")},
-#endif
{"NewAlias", (PyCFunction)File_NewAlias, 1,
PyDoc_STR("(FSSpec fromFile, FSSpec target) -> (AliasHandle alias)")},
{"NewAliasMinimalFromFullPath", (PyCFunction)File_NewAliasMinimalFromFullPath, 1,
@@ -3167,32 +3132,10 @@ PyMac_GetFSSpec(PyObject *v, FSSpec *spec)
return 1;
}
PyErr_Clear();
-#if !TARGET_API_MAC_OSX
- /* On OS9 we now try a pathname */
- if ( PyString_Check(v) ) {
- /* It's a pathname */
- if( !PyArg_Parse(v, "O&", PyMac_GetStr255, &path) )
- return 0;
- refnum = 0; /* XXXX Should get CurWD here?? */
- parid = 0;
- err = FSMakeFSSpec(refnum, parid, path, spec);
- if ( err && err != fnfErr ) {
- PyMac_Error(err);
- return 0;
- }
- return 1;
- }
- PyErr_Clear();
-#endif
/* Otherwise we try to go via an FSRef. On OSX we go all the way,
** on OS9 we accept only a real FSRef object
*/
-#if TARGET_API_MAC_OSX
if ( PyMac_GetFSRef(v, &fsr) ) {
-#else
- if (FSRef_Check(v)) {
- fsr = ((FSRefObject *)v)->ob_itself;
-#endif
err = FSGetCatalogInfo(&fsr, kFSCatInfoNone, NULL, NULL, spec, NULL);
if (err != noErr) {
PyMac_Error(err);
@@ -3200,9 +3143,6 @@ PyMac_GetFSSpec(PyObject *v, FSSpec *spec)
}
return 1;
}
-#if !TARGET_API_MAC_OSX
- PyErr_SetString(PyExc_TypeError, "FSSpec, FSRef, pathname or (refnum, parid, path) required");
-#endif
return 0;
}
@@ -3217,7 +3157,6 @@ PyMac_GetFSRef(PyObject *v, FSRef *fsr)
return 1;
}
-#if TARGET_API_MAC_OSX
/* On OSX we now try a pathname */
if ( PyString_Check(v) || PyUnicode_Check(v)) {
char *path = NULL;
@@ -3230,14 +3169,9 @@ PyMac_GetFSRef(PyObject *v, FSRef *fsr)
return 1;
}
/* XXXX Should try unicode here too */
-#endif
/* Otherwise we try to go via an FSSpec */
-#if TARGET_API_MAC_OSX
if (FSSpec_Check(v)) {
fss = ((FSSpecObject *)v)->ob_itself;
-#else
- if (PyMac_GetFSSpec(v, &fss)) {
-#endif
if ((err=FSpMakeFSRef(&fss, fsr)) == 0)
return 1;
PyMac_Error(err);
diff --git a/Mac/Modules/file/filescan.py b/Mac/Modules/file/filescan.py
index ca977af..8d663a3 100644
--- a/Mac/Modules/file/filescan.py
+++ b/Mac/Modules/file/filescan.py
@@ -105,14 +105,6 @@ class MyScanner(Scanner_OSX):
]
- def makegreylist(self):
- return [
- ('#if TARGET_API_MAC_OSX', [
- 'FNNotifyAll',
- 'FNNotifyByPath',
- 'FNNotify',
- ])]
-
def makeblacklisttypes(self):
return [
"CInfoPBPtr", # Old stuff
diff --git a/Mac/Modules/file/filesupport.py b/Mac/Modules/file/filesupport.py
index 9fa8edd..f06bbb8 100644
--- a/Mac/Modules/file/filesupport.py
+++ b/Mac/Modules/file/filesupport.py
@@ -225,32 +225,10 @@ PyMac_GetFSSpec(PyObject *v, FSSpec *spec)
return 1;
}
PyErr_Clear();
-#if !TARGET_API_MAC_OSX
- /* On OS9 we now try a pathname */
- if ( PyString_Check(v) ) {
- /* It's a pathname */
- if( !PyArg_Parse(v, "O&", PyMac_GetStr255, &path) )
- return 0;
- refnum = 0; /* XXXX Should get CurWD here?? */
- parid = 0;
- err = FSMakeFSSpec(refnum, parid, path, spec);
- if ( err && err != fnfErr ) {
- PyMac_Error(err);
- return 0;
- }
- return 1;
- }
- PyErr_Clear();
-#endif
/* Otherwise we try to go via an FSRef. On OSX we go all the way,
** on OS9 we accept only a real FSRef object
*/
-#if TARGET_API_MAC_OSX
if ( PyMac_GetFSRef(v, &fsr) ) {
-#else
- if (FSRef_Check(v)) {
- fsr = ((FSRefObject *)v)->ob_itself;
-#endif
err = FSGetCatalogInfo(&fsr, kFSCatInfoNone, NULL, NULL, spec, NULL);
if (err != noErr) {
PyMac_Error(err);
@@ -258,9 +236,6 @@ PyMac_GetFSSpec(PyObject *v, FSSpec *spec)
}
return 1;
}
-#if !TARGET_API_MAC_OSX
- PyErr_SetString(PyExc_TypeError, "FSSpec, FSRef, pathname or (refnum, parid, path) required");
-#endif
return 0;
}
@@ -275,7 +250,6 @@ PyMac_GetFSRef(PyObject *v, FSRef *fsr)
return 1;
}
-#if TARGET_API_MAC_OSX
/* On OSX we now try a pathname */
if ( PyString_Check(v) || PyUnicode_Check(v)) {
char *path = NULL;
@@ -288,14 +262,9 @@ PyMac_GetFSRef(PyObject *v, FSRef *fsr)
return 1;
}
/* XXXX Should try unicode here too */
-#endif
/* Otherwise we try to go via an FSSpec */
-#if TARGET_API_MAC_OSX
if (FSSpec_Check(v)) {
fss = ((FSSpecObject *)v)->ob_itself;
-#else
- if (PyMac_GetFSSpec(v, &fss)) {
-#endif
if ((err=FSpMakeFSRef(&fss, fsr)) == 0)
return 1;
PyMac_Error(err);
@@ -814,26 +783,9 @@ f.docstring = lambda: "() -> string"
fsref_methods.append(f)
FSRef_as_pathname_body = """
-#if TARGET_API_MAC_OSX
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_res = FSRef_FSRefMakePath(_self, _args);
-#else
-char strbuf[1024];
-OSErr err;
-FSSpec fss;
-
-if (!PyArg_ParseTuple(_args, ""))
- return NULL;
-if ( !PyMac_GetFSSpec((PyObject *)_self, &fss))
- return NULL;
-err = PyMac_GetFullPathname(&fss, strbuf, sizeof(strbuf));
-if ( err ) {
- PyMac_Error(err);
- return NULL;
-}
-_res = PyString_FromString(strbuf);
-#endif
return _res;
"""
f = ManualGenerator("as_pathname", FSRef_as_pathname_body)
diff --git a/Mac/Modules/fm/fmscan.py b/Mac/Modules/fm/fmscan.py
index 12fb52e..73aad3e 100644
--- a/Mac/Modules/fm/fmscan.py
+++ b/Mac/Modules/fm/fmscan.py
@@ -48,10 +48,6 @@ class MyScanner(Scanner):
'FlushFonts',
]
- def makegreylist(self):
- return [
- ('#if !TARGET_API_MAC_CARBON', [
- ])]
def makeblacklisttypes(self):
return [
"FMInput_ptr", # Not needed for now
diff --git a/Mac/Modules/help/_Helpmodule.c b/Mac/Modules/help/_Helpmodule.c
index 8bd4270..8d016a5 100644
--- a/Mac/Modules/help/_Helpmodule.c
+++ b/Mac/Modules/help/_Helpmodule.c
@@ -20,9 +20,6 @@
}} while(0)
-#ifndef PyDoc_STR
-#define PyDoc_STR(x) (x)
-#endif
#include <Carbon/Carbon.h>
static PyObject *Help_Error;
diff --git a/Mac/Modules/macosmodule.c b/Mac/Modules/macosmodule.c
index 242cf57..f5fc23e 100644
--- a/Mac/Modules/macosmodule.c
+++ b/Mac/Modules/macosmodule.c
@@ -33,11 +33,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
static PyObject *MacOS_Error; /* Exception MacOS.Error */
-#ifdef TARGET_API_MAC_OSX
#define PATHNAMELEN 1024
-#else
-#define PATHNAMELEN 256
-#endif
/* ----------------------------------------------------- */
@@ -337,94 +333,6 @@ MacOS_SetCreatorAndType(PyObject *self, PyObject *args)
return Py_None;
}
-#if !TARGET_API_MAC_OSX
-static char schedparams_doc[] = "Set/return mainloop interrupt check flag, etc";
-
-/*
-** Set scheduler parameters
-*/
-static PyObject *
-MacOS_SchedParams(PyObject *self, PyObject *args)
-{
- PyMacSchedParams old, new;
-
- PyMac_GetSchedParams(&old);
- new = old;
- if (!PyArg_ParseTuple(args, "|iiidd", &new.check_interrupt, &new.process_events,
- &new.besocial, &new.check_interval, &new.bg_yield))
- return NULL;
- PyMac_SetSchedParams(&new);
- return Py_BuildValue("iiidd", old.check_interrupt, old.process_events,
- old.besocial, old.check_interval, old.bg_yield);
-}
-
-static char appswitch_doc[] = "Obsolete, use SchedParams";
-
-/* Obsolete, for backward compatability */
-static PyObject *
-MacOS_EnableAppswitch(PyObject *self, PyObject *args)
-{
- int new, old;
- PyMacSchedParams schp;
-
- if (!PyArg_ParseTuple(args, "i", &new))
- return NULL;
- PyMac_GetSchedParams(&schp);
- if ( schp.process_events )
- old = 1;
- else if ( schp.check_interrupt )
- old = 0;
- else
- old = -1;
- if ( new > 0 ) {
- schp.process_events = mDownMask|keyDownMask|osMask;
- schp.check_interrupt = 1;
- } else if ( new == 0 ) {
- schp.process_events = 0;
- schp.check_interrupt = 1;
- } else {
- schp.process_events = 0;
- schp.check_interrupt = 0;
- }
- PyMac_SetSchedParams(&schp);
- return Py_BuildValue("i", old);
-}
-
-static char setevh_doc[] = "Set python event handler to be called in mainloop";
-
-static PyObject *
-MacOS_SetEventHandler(PyObject *self, PyObject *args)
-{
- PyObject *evh = NULL;
-
- if (!PyArg_ParseTuple(args, "|O", &evh))
- return NULL;
- if (evh == Py_None)
- evh = NULL;
- if ( evh && !PyCallable_Check(evh) ) {
- PyErr_SetString(PyExc_ValueError, "SetEventHandler argument must be callable");
- return NULL;
- }
- if ( !PyMac_SetEventHandler(evh) )
- return NULL;
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-static char handleev_doc[] = "Pass event to other interested parties like sioux";
-
-static PyObject *
-MacOS_HandleEvent(PyObject *self, PyObject *args)
-{
- EventRecord ev;
-
- if (!PyArg_ParseTuple(args, "O&", PyMac_GetEventRecord, &ev))
- return NULL;
- PyMac_HandleEventIntern(&ev);
- Py_INCREF(Py_None);
- return Py_None;
-}
-#endif /* !TARGET_API_MAC_OSX */
static char geterr_doc[] = "Convert OSErr number to string";
@@ -523,7 +431,6 @@ MacOS_WMAvailable(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, ""))
return NULL;
if (!rv) {
-#if TARGET_API_MAC_OSX
ProcessSerialNumber psn;
/*
@@ -543,9 +450,6 @@ MacOS_WMAvailable(PyObject *self, PyObject *args)
rv = Py_True;
}
}
-#else
- rv = Py_True;
-#endif
}
Py_INCREF(rv);
return rv;
@@ -619,83 +523,10 @@ MacOS_openrf(PyObject *self, PyObject *args)
return (PyObject *)fp;
}
-#if !TARGET_API_MAC_OSX
-static char FreeMem_doc[] = "Return the total amount of free space in the heap";
-
-static PyObject *
-MacOS_FreeMem(PyObject *self, PyObject *args)
-{
- long rv;
-
- if (!PyArg_ParseTuple(args, ""))
- return NULL;
- rv = FreeMem();
- return Py_BuildValue("l", rv);
-}
-
-static char MaxBlock_doc[] = "Return the largest contiguous block of free space in the heap";
-
-static PyObject *
-MacOS_MaxBlock(PyObject *self, PyObject *args)
-{
- long rv;
-
- if (!PyArg_ParseTuple(args, ""))
- return NULL;
- rv = MaxBlock();
- return Py_BuildValue("l", rv);
-}
-
-static char CompactMem_doc[] = "(wanted size)->actual largest block after compacting";
-
-static PyObject *
-MacOS_CompactMem(PyObject *self, PyObject *args)
-{
- long value;
- long rv;
-
- if (!PyArg_ParseTuple(args, "l", &value))
- return NULL;
- rv = CompactMem(value);
- return Py_BuildValue("l", rv);
-}
-
-static char KeepConsole_doc[] = "(flag) Keep console open 0:never, 1:on output 2:on error, 3:always";
-
-static PyObject *
-MacOS_KeepConsole(PyObject *self, PyObject *args)
-{
- int value;
-
- if (!PyArg_ParseTuple(args, "i", &value))
- return NULL;
- PyMac_options.keep_console = value;
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-static char OutputSeen_doc[] = "Call to reset the 'unseen output' flag for the keep-console-open option";
-
-static PyObject *
-MacOS_OutputSeen(PyObject *self, PyObject *args)
-{
- if (!PyArg_ParseTuple(args, ""))
- return NULL;
- PyMac_OutputSeen();
- Py_INCREF(Py_None);
- return Py_None;
-}
-#endif /* !TARGET_API_MAC_OSX */
static PyMethodDef MacOS_Methods[] = {
{"GetCreatorAndType", MacOS_GetCreatorAndType, 1, getcrtp_doc},
{"SetCreatorAndType", MacOS_SetCreatorAndType, 1, setcrtp_doc},
-#if !TARGET_API_MAC_OSX
- {"SchedParams", MacOS_SchedParams, 1, schedparams_doc},
- {"EnableAppswitch", MacOS_EnableAppswitch, 1, appswitch_doc},
- {"SetEventHandler", MacOS_SetEventHandler, 1, setevh_doc},
- {"HandleEvent", MacOS_HandleEvent, 1, handleev_doc},
-#endif
{"GetErrorString", MacOS_GetErrorString, 1, geterr_doc},
{"openrf", MacOS_openrf, 1, openrf_doc},
{"splash", MacOS_splash, 1, splash_doc},
@@ -703,13 +534,6 @@ static PyMethodDef MacOS_Methods[] = {
{"GetTicks", MacOS_GetTicks, 1, GetTicks_doc},
{"SysBeep", MacOS_SysBeep, 1, SysBeep_doc},
{"WMAvailable", MacOS_WMAvailable, 1, WMAvailable_doc},
-#if !TARGET_API_MAC_OSX
- {"FreeMem", MacOS_FreeMem, 1, FreeMem_doc},
- {"MaxBlock", MacOS_MaxBlock, 1, MaxBlock_doc},
- {"CompactMem", MacOS_CompactMem, 1, CompactMem_doc},
- {"KeepConsole", MacOS_KeepConsole, 1, KeepConsole_doc},
- {"OutputSeen", MacOS_OutputSeen, 1, OutputSeen_doc},
-#endif
{NULL, NULL} /* Sentinel */
};
@@ -742,19 +566,11 @@ initMacOS(void)
if( PyDict_SetItemString(d, "string_id_to_buffer", Py_BuildValue("i", off)) != 0)
return;
}
-#if TARGET_API_MAC_OSX
#define PY_RUNTIMEMODEL "macho"
-#elif TARGET_API_MAC_CARBON
-#define PY_RUNTIMEMODEL "carbon"
-#else
-#error "None of the TARGET_API_MAC_XXX I know about is set"
-#endif
if (PyDict_SetItemString(d, "runtimemodel",
Py_BuildValue("s", PY_RUNTIMEMODEL)) != 0)
return;
-#if !TARGET_API_MAC_OSX
-#define PY_LINKMODEL "cfm"
-#elif defined(WITH_NEXT_FRAMEWORK)
+#if defined(WITH_NEXT_FRAMEWORK)
#define PY_LINKMODEL "framework"
#elif defined(Py_ENABLE_SHARED)
#define PY_LINKMODEL "shared"
diff --git a/Mac/Modules/mlte/mltescan.py b/Mac/Modules/mlte/mltescan.py
index 9bd1dfc..011d7bb 100644
--- a/Mac/Modules/mlte/mltescan.py
+++ b/Mac/Modules/mlte/mltescan.py
@@ -81,12 +81,6 @@ kTXNFontSizeAttributeSize = 4
'TXNTSMCheck', # OS8
]
- def makegreylist(self):
- return [
- ('#if TARGET_API_MAC_OS8', [
- ])]
-
-
def makeblacklisttypes(self):
return [
"TXNTab", # TBD
diff --git a/Mac/Modules/res/_Resmodule.c b/Mac/Modules/res/_Resmodule.c
index 0737b19..13a9c36 100644
--- a/Mac/Modules/res/_Resmodule.c
+++ b/Mac/Modules/res/_Resmodule.c
@@ -20,9 +20,6 @@
}} while(0)
-#ifndef PyDoc_STR
-#define PyDoc_STR(x) (x)
-#endif
#include <Carbon/Carbon.h>
#ifdef USE_TOOLBOX_OBJECT_GLUE
diff --git a/Mac/Modules/win/_Winmodule.c b/Mac/Modules/win/_Winmodule.c
index d88a5bc..5bb0b5d 100644
--- a/Mac/Modules/win/_Winmodule.c
+++ b/Mac/Modules/win/_Winmodule.c
@@ -1358,8 +1358,6 @@ static PyObject *WinObj_TransitionWindow(WindowObject *_self, PyObject *_args)
return _res;
}
-#if TARGET_API_MAC_OSX
-
static PyObject *WinObj_TransitionWindowAndParent(WindowObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
@@ -1387,7 +1385,6 @@ static PyObject *WinObj_TransitionWindowAndParent(WindowObject *_self, PyObject
_res = Py_None;
return _res;
}
-#endif
static PyObject *WinObj_MacMoveWindow(WindowObject *_self, PyObject *_args)
{
@@ -2451,11 +2448,8 @@ static PyMethodDef WinObj_methods[] = {
PyDoc_STR("(Boolean hilited) -> None")},
{"TransitionWindow", (PyCFunction)WinObj_TransitionWindow, 1,
PyDoc_STR("(WindowTransitionEffect effect, WindowTransitionAction action, Rect rect) -> None")},
-
-#if TARGET_API_MAC_OSX
{"TransitionWindowAndParent", (PyCFunction)WinObj_TransitionWindowAndParent, 1,
PyDoc_STR("(WindowPtr parentWindow, WindowTransitionEffect effect, WindowTransitionAction action, Rect rect) -> None")},
-#endif
{"MacMoveWindow", (PyCFunction)WinObj_MacMoveWindow, 1,
PyDoc_STR("(short hGlobal, short vGlobal, Boolean front) -> None")},
{"SizeWindow", (PyCFunction)WinObj_SizeWindow, 1,
diff --git a/Mac/Modules/win/winscan.py b/Mac/Modules/win/winscan.py
index a79381d..1aefbd3 100644
--- a/Mac/Modules/win/winscan.py
+++ b/Mac/Modules/win/winscan.py
@@ -70,13 +70,7 @@ class MyScanner(Scanner):
'GetWindowGoAwayFlag',
'GetWindowSpareFlag',
]
-
- def makegreylist(self):
- return [
- ('#if TARGET_API_MAC_OSX', [
- 'TransitionWindowAndParent',
- ])]
-
+
def makeblacklisttypes(self):
return [
'ProcPtr',