Got rid of macglue.h, replacing it by pymactoolbox.h where relevant.
Cleaned up various things in the toolbox modules.
diff --git a/Mac/Modules/ColorPickermodule.c b/Mac/Modules/ColorPickermodule.c
index ec0afa7..62b4d5f 100644
--- a/Mac/Modules/ColorPickermodule.c
+++ b/Mac/Modules/ColorPickermodule.c
@@ -23,7 +23,6 @@
 
 #include <Carbon/Carbon.h>
 #include "Python.h"
-#include "macglue.h"
 #include "pymactoolbox.h"
 
 /* ----------------------------------------------------- */
diff --git a/Mac/Modules/Nav.c b/Mac/Modules/Nav.c
index 96c7c20..0041f76 100644
--- a/Mac/Modules/Nav.c
+++ b/Mac/Modules/Nav.c
@@ -30,7 +30,6 @@
 ******************************************************************/
 
 #include "Python.h"
-#include "macglue.h"
 #include "pymactoolbox.h"
 #include <Carbon/Carbon.h>
 
diff --git a/Mac/Modules/OSATerminology.c b/Mac/Modules/OSATerminology.c
index a3ed4b4..9de0871 100644
--- a/Mac/Modules/OSATerminology.c
+++ b/Mac/Modules/OSATerminology.c
@@ -7,7 +7,7 @@
 ** by a full interface to OpenScripting.
 */
 #include "Python.h"
-#include "macglue.h"
+#include "pymactoolbox.h"
 
 #include <Carbon/Carbon.h>
 
diff --git a/Mac/Modules/ae/_AEmodule.c b/Mac/Modules/ae/_AEmodule.c
index fd6582b..01e4246 100644
--- a/Mac/Modules/ae/_AEmodule.c
+++ b/Mac/Modules/ae/_AEmodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/ah/_AHmodule.c b/Mac/Modules/ah/_AHmodule.c
index 9408e53..160a845 100644
--- a/Mac/Modules/ah/_AHmodule.c
+++ b/Mac/Modules/ah/_AHmodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/app/_Appmodule.c b/Mac/Modules/app/_Appmodule.c
index 2a74325..df91f8f 100644
--- a/Mac/Modules/app/_Appmodule.c
+++ b/Mac/Modules/app/_Appmodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/carbonevt/CarbonEvtscan.py b/Mac/Modules/carbonevt/CarbonEvtscan.py
index d3088fd..c6bf93f 100644
--- a/Mac/Modules/carbonevt/CarbonEvtscan.py
+++ b/Mac/Modules/carbonevt/CarbonEvtscan.py
@@ -84,7 +84,6 @@
 			# Wrote by hand
 			"InstallEventHandler",
 			"RemoveEventHandler",
-			"RunApplicationEventLoop",
 						
 			# Write by hand?
 			"GetEventParameter",
diff --git a/Mac/Modules/carbonevt/CarbonEvtsupport.py b/Mac/Modules/carbonevt/CarbonEvtsupport.py
index 19d7d6d..3cc1672 100644
--- a/Mac/Modules/carbonevt/CarbonEvtsupport.py
+++ b/Mac/Modules/carbonevt/CarbonEvtsupport.py
@@ -73,26 +73,9 @@
 MouseTrackingResult = UInt16
 
 
-includestuff = r"""
+includestuff = includestuff + r"""
 #include <Carbon/Carbon.h>
 
-#include "macglue.h"
-
-/* Macro to test whether a weak-loaded CFM function exists */
-#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
-		PyErr_SetString(PyExc_NotImplementedError, \
-		"Not available in this shared library/OS version"); \
-		return; \
-	}} while(0)
-
-
-#define USE_MAC_MP_MULTITHREADING 0
-
-#if USE_MAC_MP_MULTITHREADING
-static PyThreadState *_save;
-static MPCriticalRegionID reentrantLock;
-#endif /* USE_MAC_MP_MULTITHREADING */
-
 extern int CFStringRef_New(CFStringRef *);
 
 extern int CFStringRef_Convert(PyObject *, CFStringRef *);
@@ -168,11 +151,6 @@
 	PyObject *retValue;
 	int status;
 
-#if USE_MAC_MP_MULTITHREADING
-	MPEnterCriticalRegion(reentrantLock, kDurationForever);
-	PyEval_RestoreThread(_save);
-#endif /* USE_MAC_MP_MULTITHREADING */
-
 	retValue = PyObject_CallFunction((PyObject *)outPyObject, "O&O&",
 	                                 EventHandlerCallRef_New, handlerRef,
 	                                 EventRef_New, event);
@@ -190,11 +168,6 @@
 		Py_DECREF(retValue);
 	}
 
-#if USE_MAC_MP_MULTITHREADING
-	_save = PyEval_SaveThread();
-	MPExitCriticalRegion(reentrantLock);
-#endif /* USE_MAC_MP_MULTITHREADING */
-
 	return status;
 }
 
@@ -203,7 +176,6 @@
 """
 
 initstuff = initstuff + """
-PyMac_PRECHECK(NewEventHandlerUPP); /* This can fail if CarbonLib is too old */
 myEventHandlerUPP = NewEventHandlerUPP(myEventHandler);
 """
 module = MacModule('_CarbonEvt', 'CarbonEvents', includestuff, finalstuff, initstuff)
@@ -335,32 +307,6 @@
 f.docstring = lambda: "(EventParamName eventName, EventParamType eventType) -> (String eventParamData)"
 EventRefobject.add(f)
 
-runappeventloop = """
-#if USE_MAC_MP_MULTITHREADING
-if (MPCreateCriticalRegion(&reentrantLock) != noErr) {
-	PySys_WriteStderr("lock failure\\n");
-	return NULL;
-}
-_save = PyEval_SaveThread();
-#endif /* USE_MAC_MP_MULTITHREADING */
-
-RunApplicationEventLoop();
-
-#if USE_MAC_MP_MULTITHREADING
-PyEval_RestoreThread(_save);
-
-MPDeleteCriticalRegion(reentrantLock);
-#endif /* USE_MAC_MP_MULTITHREADING */
-
-Py_INCREF(Py_None);
-_res = Py_None;
-return _res;
-"""			
-
-f = ManualGenerator("RunApplicationEventLoop", runappeventloop);
-f.docstring = lambda: "() -> ()"
-module.add(f)
-
 SetOutputFileName('_CarbonEvtmodule.c')
 module.generate()
 
diff --git a/Mac/Modules/carbonevt/_CarbonEvtmodule.c b/Mac/Modules/carbonevt/_CarbonEvtmodule.c
index 46eb31e..097f11a 100755
--- a/Mac/Modules/carbonevt/_CarbonEvtmodule.c
+++ b/Mac/Modules/carbonevt/_CarbonEvtmodule.c
@@ -5,24 +5,17 @@
 
 
 
-#include <Carbon/Carbon.h>
-
-#include "macglue.h"
+#include "pymactoolbox.h"
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
-		PyErr_SetString(PyExc_NotImplementedError, \
-		"Not available in this shared library/OS version"); \
-		return; \
-	}} while(0)
+        PyErr_SetString(PyExc_NotImplementedError, \
+        "Not available in this shared library/OS version"); \
+        return NULL; \
+    }} while(0)
 
 
-#define USE_MAC_MP_MULTITHREADING 0
-
-#if USE_MAC_MP_MULTITHREADING
-static PyThreadState *_save;
-static MPCriticalRegionID reentrantLock;
-#endif /* USE_MAC_MP_MULTITHREADING */
+#include <Carbon/Carbon.h>
 
 extern int CFStringRef_New(CFStringRef *);
 
@@ -99,11 +92,6 @@
 	PyObject *retValue;
 	int status;
 
-#if USE_MAC_MP_MULTITHREADING
-	MPEnterCriticalRegion(reentrantLock, kDurationForever);
-	PyEval_RestoreThread(_save);
-#endif /* USE_MAC_MP_MULTITHREADING */
-
 	retValue = PyObject_CallFunction((PyObject *)outPyObject, "O&O&",
 	                                 EventHandlerCallRef_New, handlerRef,
 	                                 EventRef_New, event);
@@ -121,11 +109,6 @@
 		Py_DECREF(retValue);
 	}
 
-#if USE_MAC_MP_MULTITHREADING
-	_save = PyEval_SaveThread();
-	MPExitCriticalRegion(reentrantLock);
-#endif /* USE_MAC_MP_MULTITHREADING */
-
 	return status;
 }
 
@@ -1845,6 +1828,17 @@
 	return _res;
 }
 
+static PyObject *CarbonEvents_RunApplicationEventLoop(PyObject *_self, PyObject *_args)
+{
+	PyObject *_res = NULL;
+	if (!PyArg_ParseTuple(_args, ""))
+		return NULL;
+	RunApplicationEventLoop();
+	Py_INCREF(Py_None);
+	_res = Py_None;
+	return _res;
+}
+
 static PyObject *CarbonEvents_QuitApplicationEventLoop(PyObject *_self, PyObject *_args)
 {
 	PyObject *_res = NULL;
@@ -2042,32 +2036,6 @@
 	return _res;
 }
 
-static PyObject *CarbonEvents_RunApplicationEventLoop(PyObject *_self, PyObject *_args)
-{
-	PyObject *_res = NULL;
-
-#if USE_MAC_MP_MULTITHREADING
-	if (MPCreateCriticalRegion(&reentrantLock) != noErr) {
-		PySys_WriteStderr("lock failure\n");
-		return NULL;
-	}
-	_save = PyEval_SaveThread();
-#endif /* USE_MAC_MP_MULTITHREADING */
-
-	RunApplicationEventLoop();
-
-#if USE_MAC_MP_MULTITHREADING
-	PyEval_RestoreThread(_save);
-
-	MPDeleteCriticalRegion(reentrantLock);
-#endif /* USE_MAC_MP_MULTITHREADING */
-
-	Py_INCREF(Py_None);
-	_res = Py_None;
-	return _res;
-
-}
-
 static PyMethodDef CarbonEvents_methods[] = {
 	{"GetCurrentEventLoop", (PyCFunction)CarbonEvents_GetCurrentEventLoop, 1,
 	 PyDoc_STR("() -> (EventLoopRef _rv)")},
@@ -2103,6 +2071,8 @@
 	 PyDoc_STR("() -> (EventTargetRef _rv)")},
 	{"GetEventDispatcherTarget", (PyCFunction)CarbonEvents_GetEventDispatcherTarget, 1,
 	 PyDoc_STR("() -> (EventTargetRef _rv)")},
+	{"RunApplicationEventLoop", (PyCFunction)CarbonEvents_RunApplicationEventLoop, 1,
+	 PyDoc_STR("() -> None")},
 	{"QuitApplicationEventLoop", (PyCFunction)CarbonEvents_QuitApplicationEventLoop, 1,
 	 PyDoc_STR("() -> None")},
 	{"RunAppModalLoopForWindow", (PyCFunction)CarbonEvents_RunAppModalLoopForWindow, 1,
@@ -2127,8 +2097,6 @@
 	 PyDoc_STR("(WindowPtr inWindow) -> (ControlHandle outControl)")},
 	{"RegisterEventHotKey", (PyCFunction)CarbonEvents_RegisterEventHotKey, 1,
 	 PyDoc_STR("(UInt32 inHotKeyCode, UInt32 inHotKeyModifiers, EventHotKeyID inHotKeyID, EventTargetRef inTarget, OptionBits inOptions) -> (EventHotKeyRef outRef)")},
-	{"RunApplicationEventLoop", (PyCFunction)CarbonEvents_RunApplicationEventLoop, 1,
-	 PyDoc_STR("() -> ()")},
 	{NULL, NULL, 0}
 };
 
@@ -2142,7 +2110,6 @@
 
 
 
-	PyMac_PRECHECK(NewEventHandlerUPP); /* This can fail if CarbonLib is too old */
 	myEventHandlerUPP = NewEventHandlerUPP(myEventHandler);
 
 
diff --git a/Mac/Modules/cf/_CFmodule.c b/Mac/Modules/cf/_CFmodule.c
index 8a82d2b..250e7ac 100644
--- a/Mac/Modules/cf/_CFmodule.c
+++ b/Mac/Modules/cf/_CFmodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/cf/pycfbridge.c b/Mac/Modules/cf/pycfbridge.c
index 3e4b89a..30122dc 100644
--- a/Mac/Modules/cf/pycfbridge.c
+++ b/Mac/Modules/cf/pycfbridge.c
@@ -5,7 +5,7 @@
 #include <CoreServices/CoreServices.h>
 
 #include "Python.h"
-#include "macglue.h"
+#include "pymactoolbox.h"
 #include "pycfbridge.h"
 
 
diff --git a/Mac/Modules/cg/_CGmodule.c b/Mac/Modules/cg/_CGmodule.c
index 3971185..0889766 100755
--- a/Mac/Modules/cg/_CGmodule.c
+++ b/Mac/Modules/cg/_CGmodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/cm/_Cmmodule.c b/Mac/Modules/cm/_Cmmodule.c
index f9b1bf7..95a36c0 100644
--- a/Mac/Modules/cm/_Cmmodule.c
+++ b/Mac/Modules/cm/_Cmmodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/ctl/_Ctlmodule.c b/Mac/Modules/ctl/_Ctlmodule.c
index 3f12778..9f299a1 100644
--- a/Mac/Modules/ctl/_Ctlmodule.c
+++ b/Mac/Modules/ctl/_Ctlmodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/dlg/_Dlgmodule.c b/Mac/Modules/dlg/_Dlgmodule.c
index 966e1ff..19ae1e9 100644
--- a/Mac/Modules/dlg/_Dlgmodule.c
+++ b/Mac/Modules/dlg/_Dlgmodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/drag/_Dragmodule.c b/Mac/Modules/drag/_Dragmodule.c
index 79f0384..a1f743b 100644
--- a/Mac/Modules/drag/_Dragmodule.c
+++ b/Mac/Modules/drag/_Dragmodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/evt/_Evtmodule.c b/Mac/Modules/evt/_Evtmodule.c
index 9f62a2f..6d86e51 100644
--- a/Mac/Modules/evt/_Evtmodule.c
+++ b/Mac/Modules/evt/_Evtmodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/file/_Filemodule.c b/Mac/Modules/file/_Filemodule.c
index f5f48d2..79929c5 100644
--- a/Mac/Modules/file/_Filemodule.c
+++ b/Mac/Modules/file/_Filemodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/fm/_Fmmodule.c b/Mac/Modules/fm/_Fmmodule.c
index cba96e0..816775d 100644
--- a/Mac/Modules/fm/_Fmmodule.c
+++ b/Mac/Modules/fm/_Fmmodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/folder/_Foldermodule.c b/Mac/Modules/folder/_Foldermodule.c
index 9c7afc6..bd33b8e 100644
--- a/Mac/Modules/folder/_Foldermodule.c
+++ b/Mac/Modules/folder/_Foldermodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/gestaltmodule.c b/Mac/Modules/gestaltmodule.c
index 8097de8..f82687e 100644
--- a/Mac/Modules/gestaltmodule.c
+++ b/Mac/Modules/gestaltmodule.c
@@ -25,7 +25,7 @@
 /* Macintosh Gestalt interface */
 
 #include "Python.h"
-#include "macglue.h"
+#include "pymactoolbox.h"
 
 #include <Carbon/Carbon.h>
 
diff --git a/Mac/Modules/help/_Helpmodule.c b/Mac/Modules/help/_Helpmodule.c
index 8d016a5..0da66cc 100644
--- a/Mac/Modules/help/_Helpmodule.c
+++ b/Mac/Modules/help/_Helpmodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/ibcarbon/IBCarbonsupport.py b/Mac/Modules/ibcarbon/IBCarbonsupport.py
index 04d4bc1..5d07be1 100644
--- a/Mac/Modules/ibcarbon/IBCarbonsupport.py
+++ b/Mac/Modules/ibcarbon/IBCarbonsupport.py
@@ -10,15 +10,12 @@
 
 includestuff = """
 #include <Carbon/Carbon.h>
-#include "macglue.h"
+#include "pymactoolbox.h"
 
 #ifdef USE_TOOLBOX_OBJECT_GLUE
 extern int _CFStringRefObj_Convert(PyObject *, CFStringRef *);
-//#define CFStringRefObj_Convert _CFStringRefObj_Convert
 #endif
 
-//extern int CFBundleRefObj_Convert(PyObject *, CFBundleRef *);  // need to wrap CFBundle
-
 """
 
 initstuff = """
diff --git a/Mac/Modules/ibcarbon/_IBCarbon.c b/Mac/Modules/ibcarbon/_IBCarbon.c
index 1d50db2..ce120c3 100644
--- a/Mac/Modules/ibcarbon/_IBCarbon.c
+++ b/Mac/Modules/ibcarbon/_IBCarbon.c
@@ -6,15 +6,12 @@
 
 
 #include <Carbon/Carbon.h>
-#include "macglue.h"
+#include "pymactoolbox.h"
 
 #ifdef USE_TOOLBOX_OBJECT_GLUE
 extern int _CFStringRefObj_Convert(PyObject *, CFStringRef *);
-//#define CFStringRefObj_Convert _CFStringRefObj_Convert
 #endif
 
-//extern int CFBundleRefObj_Convert(PyObject *, CFBundleRef *);  // need to wrap CFBundle
-
 
 static PyObject *IBCarbon_Error;
 
diff --git a/Mac/Modules/icgluemodule.c b/Mac/Modules/icgluemodule.c
index ee42c59..fa50f0d 100644
--- a/Mac/Modules/icgluemodule.c
+++ b/Mac/Modules/icgluemodule.c
@@ -30,7 +30,7 @@
 ******************************************************************/
 
 #include "Python.h"
-#include "macglue.h"
+#include "pymactoolbox.h"
 
 extern int ResObj_Convert(PyObject *, Handle *); /* From Resmodule.c */
 
diff --git a/Mac/Modules/icn/_Icnmodule.c b/Mac/Modules/icn/_Icnmodule.c
index 7ed2064..bbd59ab 100644
--- a/Mac/Modules/icn/_Icnmodule.c
+++ b/Mac/Modules/icn/_Icnmodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/list/_Listmodule.c b/Mac/Modules/list/_Listmodule.c
index cf94801..bfea8a3 100644
--- a/Mac/Modules/list/_Listmodule.c
+++ b/Mac/Modules/list/_Listmodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/macosmodule.c b/Mac/Modules/macosmodule.c
index f5fc23e..271a5aa 100644
--- a/Mac/Modules/macosmodule.c
+++ b/Mac/Modules/macosmodule.c
@@ -25,8 +25,7 @@
 /* Macintosh OS-specific interface */
 
 #include "Python.h"
-#include "macglue.h"
-#include "pythonresources.h"
+#include "pymactoolbox.h"
 
 #include <Carbon/Carbon.h>
 #include <ApplicationServices/ApplicationServices.h>
diff --git a/Mac/Modules/menu/_Menumodule.c b/Mac/Modules/menu/_Menumodule.c
index c48edb1..feb9bd2 100644
--- a/Mac/Modules/menu/_Menumodule.c
+++ b/Mac/Modules/menu/_Menumodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/mlte/_Mltemodule.c b/Mac/Modules/mlte/_Mltemodule.c
index 18fdd45..2c972e9f 100644
--- a/Mac/Modules/mlte/_Mltemodule.c
+++ b/Mac/Modules/mlte/_Mltemodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/qd/_Qdmodule.c b/Mac/Modules/qd/_Qdmodule.c
index e15f848..793c972 100644
--- a/Mac/Modules/qd/_Qdmodule.c
+++ b/Mac/Modules/qd/_Qdmodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/qdoffs/_Qdoffsmodule.c b/Mac/Modules/qdoffs/_Qdoffsmodule.c
index 5bc0f96..1cb4564 100644
--- a/Mac/Modules/qdoffs/_Qdoffsmodule.c
+++ b/Mac/Modules/qdoffs/_Qdoffsmodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/qt/_Qtmodule.c b/Mac/Modules/qt/_Qtmodule.c
index fd5db6f..9fc9be2 100644
--- a/Mac/Modules/qt/_Qtmodule.c
+++ b/Mac/Modules/qt/_Qtmodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/res/_Resmodule.c b/Mac/Modules/res/_Resmodule.c
index 13a9c36..d554a99 100644
--- a/Mac/Modules/res/_Resmodule.c
+++ b/Mac/Modules/res/_Resmodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/scrap/_Scrapmodule.c b/Mac/Modules/scrap/_Scrapmodule.c
index db8e58b..5ee22eb 100644
--- a/Mac/Modules/scrap/_Scrapmodule.c
+++ b/Mac/Modules/scrap/_Scrapmodule.c
@@ -5,21 +5,13 @@
 
 
 
-#ifndef PyDoc_STR
-#define PyDoc_STR(x) (x)
-#endif
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
-    	PyErr_SetString(PyExc_NotImplementedError, \
-    	"Not available in this shared library/OS version"); \
-    	return NULL; \
+        PyErr_SetString(PyExc_NotImplementedError, \
+        "Not available in this shared library/OS version"); \
+        return NULL; \
     }} while(0)
 
 
@@ -31,7 +23,7 @@
 
 PyTypeObject Scrap_Type;
 
-#define ScrapObj_Check(x) ((x)->ob_type == &Scrap_Type)
+#define ScrapObj_Check(x) ((x)->ob_type == &Scrap_Type || PyObject_TypeCheck((x), &Scrap_Type))
 
 typedef struct ScrapObject {
 	PyObject_HEAD
@@ -60,7 +52,7 @@
 static void ScrapObj_dealloc(ScrapObject *self)
 {
 	/* Cleanup of self->ob_itself goes here */
-	PyObject_DEL(self);
+	self->ob_type->tp_free((PyObject *)self);
 }
 
 static PyObject *ScrapObj_GetScrapFlavorFlags(ScrapObject *_self, PyObject *_args)
@@ -208,17 +200,17 @@
 
 static PyMethodDef ScrapObj_methods[] = {
 	{"GetScrapFlavorFlags", (PyCFunction)ScrapObj_GetScrapFlavorFlags, 1,
-	 "(ScrapFlavorType flavorType) -> (ScrapFlavorFlags flavorFlags)"},
+	 PyDoc_STR("(ScrapFlavorType flavorType) -> (ScrapFlavorFlags flavorFlags)")},
 	{"GetScrapFlavorSize", (PyCFunction)ScrapObj_GetScrapFlavorSize, 1,
-	 "(ScrapFlavorType flavorType) -> (Size byteCount)"},
+	 PyDoc_STR("(ScrapFlavorType flavorType) -> (Size byteCount)")},
 	{"GetScrapFlavorData", (PyCFunction)ScrapObj_GetScrapFlavorData, 1,
-	 "(ScrapFlavorType flavorType) -> string"},
+	 PyDoc_STR("(ScrapFlavorType flavorType, Buffer destination) -> (Size byteCount)")},
 	{"PutScrapFlavor", (PyCFunction)ScrapObj_PutScrapFlavor, 1,
-	 "(ScrapFlavorType flavorType, ScrapFlavorFlags flavorFlags, Buffer flavorData) -> None"},
+	 PyDoc_STR("(ScrapFlavorType flavorType, ScrapFlavorFlags flavorFlags, Size flavorSize, Buffer flavorData) -> None")},
 	{"GetScrapFlavorCount", (PyCFunction)ScrapObj_GetScrapFlavorCount, 1,
-	 "() -> (UInt32 infoCount)"},
+	 PyDoc_STR("() -> (UInt32 infoCount)")},
 	{"GetScrapFlavorInfoList", (PyCFunction)ScrapObj_GetScrapFlavorInfoList, 1,
-	 "() -> ([(ScrapFlavorType, ScrapFlavorInfo), ...])"},
+	 PyDoc_STR("() -> ([(ScrapFlavorType, ScrapFlavorInfo), ...])")},
 	{NULL, NULL, 0}
 };
 
@@ -326,15 +318,15 @@
 
 static PyMethodDef Scrap_methods[] = {
 	{"LoadScrap", (PyCFunction)Scrap_LoadScrap, 1,
-	 "() -> None"},
+	 PyDoc_STR("() -> None")},
 	{"UnloadScrap", (PyCFunction)Scrap_UnloadScrap, 1,
-	 "() -> None"},
+	 PyDoc_STR("() -> None")},
 	{"GetCurrentScrap", (PyCFunction)Scrap_GetCurrentScrap, 1,
-	 "() -> (ScrapRef scrap)"},
+	 PyDoc_STR("() -> (ScrapRef scrap)")},
 	{"ClearCurrentScrap", (PyCFunction)Scrap_ClearCurrentScrap, 1,
-	 "() -> None"},
+	 PyDoc_STR("() -> None")},
 	{"CallInScrapPromises", (PyCFunction)Scrap_CallInScrapPromises, 1,
-	 "() -> None"},
+	 PyDoc_STR("() -> None")},
 	{NULL, NULL, 0}
 };
 
diff --git a/Mac/Modules/snd/_Sndihooks.c b/Mac/Modules/snd/_Sndihooks.c
index cf0d8e9..74cad9b 100644
--- a/Mac/Modules/snd/_Sndihooks.c
+++ b/Mac/Modules/snd/_Sndihooks.c
@@ -30,7 +30,6 @@
 ******************************************************************/
 
 #include "Python.h"
-#include "macglue.h"
 #include "pymactoolbox.h"
 #include <Sound.h>
 
diff --git a/Mac/Modules/snd/_Sndmodule.c b/Mac/Modules/snd/_Sndmodule.c
index b8f5c33..581bf1e 100644
--- a/Mac/Modules/snd/_Sndmodule.c
+++ b/Mac/Modules/snd/_Sndmodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/te/_TEmodule.c b/Mac/Modules/te/_TEmodule.c
index c440640..0dd59c6 100644
--- a/Mac/Modules/te/_TEmodule.c
+++ b/Mac/Modules/te/_TEmodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Mac/Modules/waste/wastemodule.c b/Mac/Modules/waste/wastemodule.c
index f05e467..53aff83 100644
--- a/Mac/Modules/waste/wastemodule.c
+++ b/Mac/Modules/waste/wastemodule.c
@@ -5,27 +5,19 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
-    	PyErr_SetString(PyExc_NotImplementedError, \
-    	"Not available in this shared library/OS version"); \
-    	return NULL; \
+        PyErr_SetString(PyExc_NotImplementedError, \
+        "Not available in this shared library/OS version"); \
+        return NULL; \
     }} while(0)
 
 
 #include <WASTE.h>
 #include <WEObjectHandlers.h>
 #include <WETabs.h>
-#ifndef PyDoc_STR
-#define PyDoc_STR(x) (x)
-#endif
 
 /* Exported by Qdmodule.c: */
 extern PyObject *QdRGB_New(RGBColor *);
diff --git a/Mac/Modules/waste/wastescan.py b/Mac/Modules/waste/wastescan.py
index 1d7bdcb..8298f26 100644
--- a/Mac/Modules/waste/wastescan.py
+++ b/Mac/Modules/waste/wastescan.py
@@ -6,7 +6,7 @@
 sys.path.append(BGENDIR)
 from scantools import Scanner
 
-WASTEDIR='/Volumes/Moes/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/MacOS Support/(Third Party Support)/Waste 2.0 Distribution/C_C++ Headers/'
+WASTEDIR='/Users/jack/src/waste/C_C++ Headers/'
 		
 if not os.path.exists(WASTEDIR):
 	raise 'Error: not found: %s', WASTEDIR
diff --git a/Mac/Modules/win/_Winmodule.c b/Mac/Modules/win/_Winmodule.c
index 5bb0b5d..e971e31 100644
--- a/Mac/Modules/win/_Winmodule.c
+++ b/Mac/Modules/win/_Winmodule.c
@@ -5,12 +5,7 @@
 
 
 
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c
index 9f185be..2cfda88 100644
--- a/Modules/_localemodule.c
+++ b/Modules/_localemodule.c
@@ -29,15 +29,15 @@
 #include <wchar.h>
 #endif
 
+#if defined(__APPLE__)
+#include "pymactoolbox.h"
+#endif
+
 #if defined(MS_WINDOWS)
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #endif
 
-#if defined(__APPLE__)
-#include "macglue.h"
-#endif
-
 #ifdef RISCOS
 char *strdup(const char *);
 #endif
diff --git a/Tools/bgen/bgen/macsupport.py b/Tools/bgen/bgen/macsupport.py
index b4885ad..eef6db8 100644
--- a/Tools/bgen/bgen/macsupport.py
+++ b/Tools/bgen/bgen/macsupport.py
@@ -142,12 +142,7 @@
 
 # Stuff added immediately after the system include files
 includestuff = """
-#ifdef _WIN32
-#include "pywintoolbox.h"
-#else
-#include "macglue.h"
 #include "pymactoolbox.h"
-#endif
 
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\\
@@ -200,11 +195,3 @@
     "Subclass which gets the exception initializer from macglue.c"
     def exceptionInitializer(self):
         return "PyMac_GetOSErrException()"
-
-_SetOutputFileName = SetOutputFileName # Save original
-def SetOutputFileName(file = None):
-    "Set the output file name and set its creator&type to CWIE&TEXT"
-    _SetOutputFileName(file)
-    if file:
-        import MacOS
-        MacOS.SetCreatorAndType(file, 'CWIE', 'TEXT')