summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/qd
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2000-06-02 21:35:07 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2000-06-02 21:35:07 (GMT)
commite79dc76f53dfa18fb08c35f71b049259642c0142 (patch)
tree2d9cc6228cc713336a01d9ff09571eacff3a2ba0 /Mac/Modules/qd
parent33d1ad28cba273b94c70ffc22deb6c53b0c1b068 (diff)
downloadcpython-e79dc76f53dfa18fb08c35f71b049259642c0142.zip
cpython-e79dc76f53dfa18fb08c35f71b049259642c0142.tar.gz
cpython-e79dc76f53dfa18fb08c35f71b049259642c0142.tar.bz2
Made the core toolbox modules carbon-compatible using the new greylist feature of bgen: non-carbon methods are still included in non-carbon MacPython. The issue of backward compatibility of Python code is still open.
Macmodule and macosmodule have also been carbonified. Some functionality is still missing there.
Diffstat (limited to 'Mac/Modules/qd')
-rw-r--r--Mac/Modules/qd/Qdmodule.c4
-rw-r--r--Mac/Modules/qd/qdsupport.py4
2 files changed, 8 insertions, 0 deletions
diff --git a/Mac/Modules/qd/Qdmodule.c b/Mac/Modules/qd/Qdmodule.c
index 299c9ca..a5e6871 100644
--- a/Mac/Modules/qd/Qdmodule.c
+++ b/Mac/Modules/qd/Qdmodule.c
@@ -141,6 +141,7 @@ static PyObject *GrafObj_getattr(self, name)
GrafPortObject *self;
char *name;
{
+#ifndef TARGET_API_MAC_CARBON
{ CGrafPtr itself_color = (CGrafPtr)self->ob_itself;
@@ -218,6 +219,7 @@ static PyObject *GrafObj_getattr(self, name)
if ( strcmp(name, "_id") == 0 )
return Py_BuildValue("l", (long)self->ob_itself);
}
+#endif
return Py_FindMethodInChain(&GrafObj_chain, (PyObject *)self, name);
}
@@ -424,6 +426,7 @@ static PyObject *QDGA_getattr(self, name)
QDGlobalsAccessObject *self;
char *name;
{
+#ifndef TARGET_API_MAC_CARBON
if ( strcmp(name, "arrow") == 0 )
return PyString_FromStringAndSize((char *)&qd.arrow, sizeof(qd.arrow));
@@ -444,6 +447,7 @@ static PyObject *QDGA_getattr(self, name)
if ( strcmp(name, "randSeed") == 0 )
return Py_BuildValue("l", &qd.randSeed);
+#endif
return Py_FindMethodInChain(&QDGA_chain, (PyObject *)self, name);
}
diff --git a/Mac/Modules/qd/qdsupport.py b/Mac/Modules/qd/qdsupport.py
index 33e8832..671b359 100644
--- a/Mac/Modules/qd/qdsupport.py
+++ b/Mac/Modules/qd/qdsupport.py
@@ -132,6 +132,7 @@ class MyGRObjectDefinition(GlobalObjectDefinition):
Output("return 1;")
OutRbrace()
def outputGetattrHook(self):
+ Output("#ifndef TARGET_API_MAC_CARBON")
Output("""
{ CGrafPtr itself_color = (CGrafPtr)self->ob_itself;
@@ -209,6 +210,7 @@ class MyGRObjectDefinition(GlobalObjectDefinition):
if ( strcmp(name, "_id") == 0 )
return Py_BuildValue("l", (long)self->ob_itself);
}""")
+ Output("#endif")
class MyBMObjectDefinition(GlobalObjectDefinition):
def outputCheckNewArg(self):
@@ -259,6 +261,7 @@ class QDGlobalsAccessObjectDefinition(ObjectDefinition):
pass
def outputGetattrHook(self):
+ Output("#ifndef TARGET_API_MAC_CARBON")
Output("""
if ( strcmp(name, "arrow") == 0 )
return PyString_FromStringAndSize((char *)&qd.arrow, sizeof(qd.arrow));
@@ -279,6 +282,7 @@ class QDGlobalsAccessObjectDefinition(ObjectDefinition):
if ( strcmp(name, "randSeed") == 0 )
return Py_BuildValue("l", &qd.randSeed);
""")
+ Output("#endif")
# Create the generator groups and link them
module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff, variablestuff)