summaryrefslogtreecommitdiff
path: root/Mac
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2003-11-20 13:31:00 +0000
committerJack Jansen <jack.jansen@cwi.nl>2003-11-20 13:31:00 +0000
commit91a0228601dab234123a4f9812ccc13bf85dd1dc (patch)
tree444cc26a8a3ca8ed8c0440b02a884760966df9a8 /Mac
parent89eea4aff9f6f2c27c2ce028f577991f0d240f06 (diff)
downloadcpython-91a0228601dab234123a4f9812ccc13bf85dd1dc.tar.gz
Got rid of macglue.h, replacing it by pymactoolbox.h where relevant.
Cleaned up various things in the toolbox modules.
Diffstat (limited to 'Mac')
-rw-r--r--Mac/Modules/ColorPickermodule.c1
-rw-r--r--Mac/Modules/Nav.c1
-rw-r--r--Mac/Modules/OSATerminology.c2
-rw-r--r--Mac/Modules/ae/_AEmodule.c5
-rw-r--r--Mac/Modules/ah/_AHmodule.c5
-rw-r--r--Mac/Modules/app/_Appmodule.c5
-rw-r--r--Mac/Modules/carbonevt/CarbonEvtscan.py1
-rw-r--r--Mac/Modules/carbonevt/CarbonEvtsupport.py56
-rwxr-xr-xMac/Modules/carbonevt/_CarbonEvtmodule.c71
-rw-r--r--Mac/Modules/cf/_CFmodule.c5
-rw-r--r--Mac/Modules/cf/pycfbridge.c2
-rwxr-xr-xMac/Modules/cg/_CGmodule.c5
-rw-r--r--Mac/Modules/cm/_Cmmodule.c5
-rw-r--r--Mac/Modules/ctl/_Ctlmodule.c5
-rw-r--r--Mac/Modules/dlg/_Dlgmodule.c5
-rw-r--r--Mac/Modules/drag/_Dragmodule.c5
-rw-r--r--Mac/Modules/evt/_Evtmodule.c5
-rw-r--r--Mac/Modules/file/_Filemodule.c5
-rw-r--r--Mac/Modules/fm/_Fmmodule.c5
-rw-r--r--Mac/Modules/folder/_Foldermodule.c5
-rw-r--r--Mac/Modules/gestaltmodule.c2
-rw-r--r--Mac/Modules/help/_Helpmodule.c5
-rw-r--r--Mac/Modules/ibcarbon/IBCarbonsupport.py5
-rw-r--r--Mac/Modules/ibcarbon/_IBCarbon.c5
-rw-r--r--Mac/Modules/icgluemodule.c2
-rw-r--r--Mac/Modules/icn/_Icnmodule.c5
-rw-r--r--Mac/Modules/list/_Listmodule.c5
-rw-r--r--Mac/Modules/macosmodule.c3
-rw-r--r--Mac/Modules/menu/_Menumodule.c5
-rw-r--r--Mac/Modules/mlte/_Mltemodule.c5
-rw-r--r--Mac/Modules/qd/_Qdmodule.c5
-rw-r--r--Mac/Modules/qdoffs/_Qdoffsmodule.c5
-rw-r--r--Mac/Modules/qt/_Qtmodule.c5
-rw-r--r--Mac/Modules/res/_Resmodule.c5
-rw-r--r--Mac/Modules/scrap/_Scrapmodule.c40
-rw-r--r--Mac/Modules/snd/_Sndihooks.c1
-rw-r--r--Mac/Modules/snd/_Sndmodule.c5
-rw-r--r--Mac/Modules/te/_TEmodule.c5
-rw-r--r--Mac/Modules/waste/wastemodule.c14
-rw-r--r--Mac/Modules/waste/wastescan.py2
-rw-r--r--Mac/Modules/win/_Winmodule.c5
41 files changed, 47 insertions, 286 deletions
diff --git a/Mac/Modules/ColorPickermodule.c b/Mac/Modules/ColorPickermodule.c
index ec0afa74c5..62b4d5f641 100644
--- a/Mac/Modules/ColorPickermodule.c
+++ b/Mac/Modules/ColorPickermodule.c
@@ -23,7 +23,6 @@ PERFORMANCE OF THIS SOFTWARE.
#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 96c7c20439..0041f765ae 100644
--- a/Mac/Modules/Nav.c
+++ b/Mac/Modules/Nav.c
@@ -30,7 +30,6 @@ PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
#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 a3ed4b4340..9de087122e 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 fd6582b74a..01e4246b65 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 9408e53083..160a845fe3 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 2a743250c0..df91f8f2db 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 d3088fd0f2..c6bf93f1a2 100644
--- a/Mac/Modules/carbonevt/CarbonEvtscan.py
+++ b/Mac/Modules/carbonevt/CarbonEvtscan.py
@@ -84,7 +84,6 @@ class CarbonEvents_Scanner(Scanner_OSX):
# 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 19d7d6d6fd..3cc1672fbb 100644
--- a/Mac/Modules/carbonevt/CarbonEvtsupport.py
+++ b/Mac/Modules/carbonevt/CarbonEvtsupport.py
@@ -73,26 +73,9 @@ GrafPtr = OpaqueByValueType("GrafPtr", "GrafObj")
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 @@ myEventHandler(EventHandlerCallRef handlerRef, EventRef event, void *outPyObject
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 @@ myEventHandler(EventHandlerCallRef handlerRef, EventRef event, void *outPyObject
Py_DECREF(retValue);
}
-#if USE_MAC_MP_MULTITHREADING
- _save = PyEval_SaveThread();
- MPExitCriticalRegion(reentrantLock);
-#endif /* USE_MAC_MP_MULTITHREADING */
-
return status;
}
@@ -203,7 +176,6 @@ myEventHandler(EventHandlerCallRef handlerRef, EventRef event, void *outPyObject
"""
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 = ManualGenerator("GetEventParameter", geteventparameter);
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 46eb31e414..097f11a6a2 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 @@ myEventHandler(EventHandlerCallRef handlerRef, EventRef event, void *outPyObject
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 @@ myEventHandler(EventHandlerCallRef handlerRef, EventRef event, void *outPyObject
Py_DECREF(retValue);
}
-#if USE_MAC_MP_MULTITHREADING
- _save = PyEval_SaveThread();
- MPExitCriticalRegion(reentrantLock);
-#endif /* USE_MAC_MP_MULTITHREADING */
-
return status;
}
@@ -1845,6 +1828,17 @@ static PyObject *CarbonEvents_GetEventDispatcherTarget(PyObject *_self, PyObject
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 @@ static PyObject *CarbonEvents_RegisterEventHotKey(PyObject *_self, PyObject *_ar
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 @@ static PyMethodDef CarbonEvents_methods[] = {
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 @@ static PyMethodDef CarbonEvents_methods[] = {
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 @@ void init_CarbonEvt(void)
- 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 8a82d2bd79..250e7acffc 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 3e4b89a77d..30122dcdd0 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 3971185863..088976643e 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 f9b1bf7b95..95a36c06f9 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 3f127788aa..9f299a18e3 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 966e1ff752..19ae1e9211 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 79f03849cf..a1f743b4f3 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 9f62a2f7c9..6d86e510f8 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 f5f48d2dce..79929c59ce 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 cba96e02fe..816775d695 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 9c7afc666b..bd33b8e10d 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 8097de82dc..f82687e216 100644
--- a/Mac/Modules/gestaltmodule.c
+++ b/Mac/Modules/gestaltmodule.c
@@ -25,7 +25,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
/* 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 8d016a5080..0da66cc0dd 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 04d4bc135c..5d07be1239 100644
--- a/Mac/Modules/ibcarbon/IBCarbonsupport.py
+++ b/Mac/Modules/ibcarbon/IBCarbonsupport.py
@@ -10,15 +10,12 @@ IBCarbonMethod = OSErrMethodGenerator
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 1d50db2ba4..ce120c3b9e 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 ee42c59fc0..fa50f0d463 100644
--- a/Mac/Modules/icgluemodule.c
+++ b/Mac/Modules/icgluemodule.c
@@ -30,7 +30,7 @@ PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
#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 7ed2064e0a..bbd59ab189 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 cf9480198d..bfea8a3591 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 f5fc23e6db..271a5aa3d3 100644
--- a/Mac/Modules/macosmodule.c
+++ b/Mac/Modules/macosmodule.c
@@ -25,8 +25,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
/* 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 c48edb1405..feb9bd26cc 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 18fdd45bc6..2c972e9f80 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 e15f84870d..793c9721be 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 5bc0f968b2..1cb4564c5d 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 fd5db6fa2a..9fc9be2664 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 13a9c36ed8..d554a99b50 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 db8e58be24..5ee22eba34 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 @@ static PyObject *Scrap_Error;
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 @@ int ScrapObj_Convert(PyObject *v, ScrapRef *p_itself)
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 PyObject *ScrapObj_GetScrapFlavorInfoList(ScrapObject *_self, PyObject *_
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 PyObject *Scrap_CallInScrapPromises(PyObject *_self, PyObject *_args)
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 cf0d8e9cde..74cad9be56 100644
--- a/Mac/Modules/snd/_Sndihooks.c
+++ b/Mac/Modules/snd/_Sndihooks.c
@@ -30,7 +30,6 @@ PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
#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 b8f5c33b24..581bf1e506 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 c440640d17..0dd59c6d0d 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 f05e467b0b..53aff83d2b 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 1d7bdcb1ea..8298f26d09 100644
--- a/Mac/Modules/waste/wastescan.py
+++ b/Mac/Modules/waste/wastescan.py
@@ -6,7 +6,7 @@ from bgenlocations import TOOLBOXDIR, BGENDIR
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 5bb0b5ddb0..e971e31ab2 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 ) {\