]> granicus.if.org Git - python/commitdiff
Under carbon use the GetQDGlobalxxx methods to implement Qd.qd.member access.
authorJack Jansen <jack.jansen@cwi.nl>
Tue, 20 Jun 2000 07:42:00 +0000 (07:42 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Tue, 20 Jun 2000 07:42:00 +0000 (07:42 +0000)
Mac/Modules/qd/Qdmodule.c
Mac/Modules/qd/qdsupport.py

index a5e68715de219cac6e98cd9ac0ef02ed4286c1e7..d4f91d44f3fcf76e3e860c507dfa5b515e85b4f1 100644 (file)
@@ -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);
 }
index 671b359341af52c31c44965ac6b17a88225480f6..3be0b0c711d520bb95c4e4c0fdaf82194d1ac4d6 100644 (file)
@@ -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