From 3355be3f352d905a02031bdec6d91a339489b1c8 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 8 May 1996 15:33:20 +0000 Subject: [PATCH] Added _id attribute to GrafPort objects (real id of grafport, numeric) --- Mac/Modules/qd/Qdmodule.c | 6 +++--- Mac/Modules/qd/qdsupport.py | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Mac/Modules/qd/Qdmodule.c b/Mac/Modules/qd/Qdmodule.c index 88cddaf7d30..af6a92e5480 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 @@ -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 203f8c05b94..61e7dd852db 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):