summaryrefslogtreecommitdiffstats
path: root/Mac/Modules
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2000-06-20 07:42:00 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2000-06-20 07:42:00 (GMT)
commitfd78de3a744e833982ea7390c99faae8b81a751c (patch)
tree0a4136e265e3ee578811bbb5d18efcb4a03d642d /Mac/Modules
parentca23d910f89e2c4ee7b4dd0d634dd157b30e87dc (diff)
downloadcpython-fd78de3a744e833982ea7390c99faae8b81a751c.zip
cpython-fd78de3a744e833982ea7390c99faae8b81a751c.tar.gz
cpython-fd78de3a744e833982ea7390c99faae8b81a751c.tar.bz2
Under carbon use the GetQDGlobalxxx methods to implement Qd.qd.member access.
Diffstat (limited to 'Mac/Modules')
-rw-r--r--Mac/Modules/qd/Qdmodule.c42
-rw-r--r--Mac/Modules/qd/qdsupport.py42
2 files changed, 84 insertions, 0 deletions
diff --git a/Mac/Modules/qd/Qdmodule.c b/Mac/Modules/qd/Qdmodule.c
index a5e6871..d4f91d4 100644
--- a/Mac/Modules/qd/Qdmodule.c
+++ b/Mac/Modules/qd/Qdmodule.c
@@ -447,6 +447,48 @@ static PyObject *QDGA_getattr(self, name)
if ( strcmp(name, "randSeed") == 0 )
return Py_BuildValue("l", &qd.randSeed);
+#else
+
+ if ( strcmp(name, "arrow") == 0 ) {
+ Cursor rv;
+ GetQDGlobalsArrow(&rv);
+ return PyString_FromStringAndSize((char *)&rv, sizeof(rv));
+ }
+ if ( strcmp(name, "black") == 0 ) {
+ Pattern rv;
+ GetQDGlobalsBlack(&rv);
+ return PyString_FromStringAndSize((char *)&rv, sizeof(rv));
+ }
+ if ( strcmp(name, "white") == 0 ) {
+ Pattern rv;
+ GetQDGlobalsWhite(&rv);
+ return PyString_FromStringAndSize((char *)&rv, sizeof(rv));
+ }
+ if ( strcmp(name, "gray") == 0 ) {
+ Pattern rv;
+ GetQDGlobalsGray(&rv);
+ return PyString_FromStringAndSize((char *)&rv, sizeof(rv));
+ }
+ if ( strcmp(name, "ltGray") == 0 ) {
+ Pattern rv;
+ GetQDGlobalsLightGray(&rv);
+ return PyString_FromStringAndSize((char *)&rv, sizeof(rv));
+ }
+ if ( strcmp(name, "dkGray") == 0 ) {
+ Pattern rv;
+ GetQDGlobalsDarkGray(&rv);
+ return PyString_FromStringAndSize((char *)&rv, sizeof(rv));
+ }
+ if ( strcmp(name, "screenBits") == 0 ) {
+ BitMap rv;
+ GetQDGlobalsScreenBits(&rv);
+ return BMObj_New(&rv);
+ }
+ if ( strcmp(name, "thePort") == 0 )
+ return GrafObj_New(GetQDGlobalsThePort());
+ if ( strcmp(name, "randSeed") == 0 )
+ return Py_BuildValue("l", GetQDGlobalsRandomSeed());
+
#endif
return Py_FindMethodInChain(&QDGA_chain, (PyObject *)self, name);
}
diff --git a/Mac/Modules/qd/qdsupport.py b/Mac/Modules/qd/qdsupport.py
index 671b359..3be0b0c 100644
--- a/Mac/Modules/qd/qdsupport.py
+++ b/Mac/Modules/qd/qdsupport.py
@@ -282,6 +282,48 @@ class QDGlobalsAccessObjectDefinition(ObjectDefinition):
if ( strcmp(name, "randSeed") == 0 )
return Py_BuildValue("l", &qd.randSeed);
""")
+ Output("#else")
+ Output("""
+ if ( strcmp(name, "arrow") == 0 ) {
+ Cursor rv;
+ GetQDGlobalsArrow(&rv);
+ return PyString_FromStringAndSize((char *)&rv, sizeof(rv));
+ }
+ if ( strcmp(name, "black") == 0 ) {
+ Pattern rv;
+ GetQDGlobalsBlack(&rv);
+ return PyString_FromStringAndSize((char *)&rv, sizeof(rv));
+ }
+ if ( strcmp(name, "white") == 0 ) {
+ Pattern rv;
+ GetQDGlobalsWhite(&rv);
+ return PyString_FromStringAndSize((char *)&rv, sizeof(rv));
+ }
+ if ( strcmp(name, "gray") == 0 ) {
+ Pattern rv;
+ GetQDGlobalsGray(&rv);
+ return PyString_FromStringAndSize((char *)&rv, sizeof(rv));
+ }
+ if ( strcmp(name, "ltGray") == 0 ) {
+ Pattern rv;
+ GetQDGlobalsLightGray(&rv);
+ return PyString_FromStringAndSize((char *)&rv, sizeof(rv));
+ }
+ if ( strcmp(name, "dkGray") == 0 ) {
+ Pattern rv;
+ GetQDGlobalsDarkGray(&rv);
+ return PyString_FromStringAndSize((char *)&rv, sizeof(rv));
+ }
+ if ( strcmp(name, "screenBits") == 0 ) {
+ BitMap rv;
+ GetQDGlobalsScreenBits(&rv);
+ return BMObj_New(&rv);
+ }
+ if ( strcmp(name, "thePort") == 0 )
+ return GrafObj_New(GetQDGlobalsThePort());
+ if ( strcmp(name, "randSeed") == 0 )
+ return Py_BuildValue("l", GetQDGlobalsRandomSeed());
+ """)
Output("#endif")
# Create the generator groups and link them