summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/qd
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1996-05-08 15:33:20 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1996-05-08 15:33:20 (GMT)
commit3355be3f352d905a02031bdec6d91a339489b1c8 (patch)
treeb782067e57a95879b78bb93a260f302b492ed473 /Mac/Modules/qd
parentd9585c936bec21d4bc4447ec45101bfa87ad6cf9 (diff)
downloadcpython-3355be3f352d905a02031bdec6d91a339489b1c8.zip
cpython-3355be3f352d905a02031bdec6d91a339489b1c8.tar.gz
cpython-3355be3f352d905a02031bdec6d91a339489b1c8.tar.bz2
Added _id attribute to GrafPort objects (real id of grafport, numeric)
Diffstat (limited to 'Mac/Modules/qd')
-rw-r--r--Mac/Modules/qd/Qdmodule.c6
-rw-r--r--Mac/Modules/qd/qdsupport.py3
2 files changed, 6 insertions, 3 deletions
diff --git a/Mac/Modules/qd/Qdmodule.c b/Mac/Modules/qd/Qdmodule.c
index 88cddaf..af6a92e 100644
--- a/Mac/Modules/qd/Qdmodule.c
+++ b/Mac/Modules/qd/Qdmodule.c
@@ -40,9 +40,6 @@ extern int GrafObj_Convert(PyObject *, GrafPtr *);
extern PyObject *BMObj_New(BitMapPtr);
extern int BMObj_Convert(PyObject *, BitMapPtr *);
-extern PyObject *PMObj_New(PixMapHandle);
-extern int PMObj_Convert(PyObject *, PixMapHandle *);
-
extern PyObject *WinObj_WhichWindow(WindowPtr);
#include <QuickDraw.h>
@@ -218,6 +215,9 @@ static PyObject *GrafObj_getattr(self, name)
if ( strcmp(name, "spExtra") == 0 )
return Py_BuildValue("O&", PyMac_BuildFixed, self->ob_itself->spExtra);
/* XXXX Add more, as needed */
+ /* This one is so we can compare grafports: */
+ if ( strcmp(name, "_id") == 0 )
+ return Py_BuildValue("l", (long)self->ob_itself);
}
return Py_FindMethodInChain(&GrafObj_chain, (PyObject *)self, name);
}
diff --git a/Mac/Modules/qd/qdsupport.py b/Mac/Modules/qd/qdsupport.py
index 203f8c0..61e7dd8 100644
--- a/Mac/Modules/qd/qdsupport.py
+++ b/Mac/Modules/qd/qdsupport.py
@@ -204,6 +204,9 @@ class MyGRObjectDefinition(GlobalObjectDefinition):
if ( strcmp(name, "spExtra") == 0 )
return Py_BuildValue("O&", PyMac_BuildFixed, self->ob_itself->spExtra);
/* XXXX Add more, as needed */
+ /* This one is so we can compare grafports: */
+ if ( strcmp(name, "_id") == 0 )
+ return Py_BuildValue("l", (long)self->ob_itself);
}""")
class MyBMObjectDefinition(GlobalObjectDefinition):