annotate Mac/Modules/qd/Qdmodule.c @ 5817:48b94de85bf3 legacy-trunk

Extensive changes by AMK.
author Guido van Rossum <guido@python.org>
date Thu, 17 Jul 1997 16:29:42 +0000
parents bd708fe1934b
children 74a78666ddc8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
2 /* =========================== Module Qd ============================ */
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
4 #include "Python.h"
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
5
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
6
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
7
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
8 #define SystemSevenOrLater 1
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
9
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
10 #include "macglue.h"
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
11 #include <Memory.h>
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
12 #include <Dialogs.h>
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
13 #include <Menus.h>
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
14 #include <Controls.h>
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
15
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
16 extern PyObject *ResObj_New(Handle);
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
17 extern int ResObj_Convert(PyObject *, Handle *);
3295
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
18 extern PyObject *OptResObj_New(Handle);
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
19 extern int OptResObj_Convert(PyObject *, Handle *);
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
20
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
21 extern PyObject *WinObj_New(WindowPtr);
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
22 extern int WinObj_Convert(PyObject *, WindowPtr *);
3276
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
23 extern PyTypeObject Window_Type;
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
24 #define WinObj_Check(x) ((x)->ob_type == &Window_Type)
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
25
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
26 extern PyObject *DlgObj_New(DialogPtr);
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
27 extern int DlgObj_Convert(PyObject *, DialogPtr *);
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
28 extern PyTypeObject Dialog_Type;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
29 #define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type)
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
30
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
31 extern PyObject *MenuObj_New(MenuHandle);
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
32 extern int MenuObj_Convert(PyObject *, MenuHandle *);
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
33
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
34 extern PyObject *CtlObj_New(ControlHandle);
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
35 extern int CtlObj_Convert(PyObject *, ControlHandle *);
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
36
3276
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
37 extern PyObject *GrafObj_New(GrafPtr);
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
38 extern int GrafObj_Convert(PyObject *, GrafPtr *);
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
39
3281
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
40 extern PyObject *BMObj_New(BitMapPtr);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
41 extern int BMObj_Convert(PyObject *, BitMapPtr *);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
42
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
43 extern PyObject *WinObj_WhichWindow(WindowPtr);
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
44
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
45 #include <QuickDraw.h>
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
46
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
47 #define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
48
3292
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
49 /*
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
50 ** Parse/generate RGB records
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
51 */
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
52 PyObject *QdRGB_New(itself)
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
53 RGBColorPtr itself;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
54 {
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
55
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
56 return Py_BuildValue("lll", (long)itself->red, (long)itself->green, (long)itself->blue);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
57 }
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
58
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
59 QdRGB_Convert(v, p_itself)
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
60 PyObject *v;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
61 RGBColorPtr p_itself;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
62 {
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
63 long red, green, blue;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
64
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
65 if( !PyArg_ParseTuple(v, "lll", &red, &green, &blue) )
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
66 return 0;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
67 p_itself->red = (unsigned short)red;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
68 p_itself->green = (unsigned short)green;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
69 p_itself->blue = (unsigned short)blue;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
70 return 1;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
71 }
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
72
3314
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
73 /*
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
74 ** Generate FontInfo records
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
75 */
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
76 static
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
77 PyObject *QdFI_New(itself)
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
78 FontInfo *itself;
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
79 {
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
80
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
81 return Py_BuildValue("hhhh", itself->ascent, itself->descent,
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
82 itself->widMax, itself->leading);
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
83 }
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
84
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
85
3292
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
86
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
87 static PyObject *Qd_Error;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
88
3276
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
89 /* ---------------------- Object type GrafPort ---------------------- */
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
90
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
91 PyTypeObject GrafPort_Type;
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
92
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
93 #define GrafObj_Check(x) ((x)->ob_type == &GrafPort_Type)
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
94
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
95 typedef struct GrafPortObject {
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
96 PyObject_HEAD
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
97 GrafPtr ob_itself;
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
98 } GrafPortObject;
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
99
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
100 PyObject *GrafObj_New(itself)
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
101 GrafPtr itself;
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
102 {
3276
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
103 GrafPortObject *it;
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
104 if (itself == NULL) return PyMac_Error(resNotFound);
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
105 it = PyObject_NEW(GrafPortObject, &GrafPort_Type);
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
106 if (it == NULL) return NULL;
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
107 it->ob_itself = itself;
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
108 return (PyObject *)it;
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
109 }
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
110 GrafObj_Convert(v, p_itself)
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
111 PyObject *v;
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
112 GrafPtr *p_itself;
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
113 {
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
114 if (DlgObj_Check(v) || WinObj_Check(v)) {
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
115 *p_itself = ((GrafPortObject *)v)->ob_itself;
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
116 return 1;
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
117 }
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
118 if (!GrafObj_Check(v))
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
119 {
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
120 PyErr_SetString(PyExc_TypeError, "GrafPort required");
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
121 return 0;
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
122 }
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
123 *p_itself = ((GrafPortObject *)v)->ob_itself;
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
124 return 1;
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
125 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
126
3276
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
127 static void GrafObj_dealloc(self)
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
128 GrafPortObject *self;
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
129 {
3276
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
130 /* Cleanup of self->ob_itself goes here */
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
131 PyMem_DEL(self);
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
132 }
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
133
3276
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
134 static PyMethodDef GrafObj_methods[] = {
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
135 {NULL, NULL, 0}
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
136 };
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
137
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
138 PyMethodChain GrafObj_chain = { GrafObj_methods, NULL };
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
139
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
140 static PyObject *GrafObj_getattr(self, name)
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
141 GrafPortObject *self;
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
142 char *name;
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
143 {
3314
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
144
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
145 { CGrafPtr itself_color = (CGrafPtr)self->ob_itself;
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
146
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
147 if ( strcmp(name, "data") == 0 )
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
148 return PyString_FromStringAndSize((char *)self->ob_itself, sizeof(GrafPort));
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
149
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
150 if ( (itself_color->portVersion&0xc000) == 0xc000 ) {
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
151 /* Color-only attributes */
3295
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
152
3314
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
153 if ( strcmp(name, "portBits") == 0 )
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
154 /* XXXX Do we need HLock() stuff here?? */
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
155 return BMObj_New((BitMapPtr)*itself_color->portPixMap);
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
156 if ( strcmp(name, "grafVars") == 0 )
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
157 return Py_BuildValue("O&", ResObj_New, (Handle)itself_color->visRgn);
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
158 if ( strcmp(name, "chExtra") == 0 )
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
159 return Py_BuildValue("h", itself_color->chExtra);
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
160 if ( strcmp(name, "pnLocHFrac") == 0 )
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
161 return Py_BuildValue("h", itself_color->pnLocHFrac);
3342
00453613cd4c Added rgbFgColor and a few other members of CGrafPort
Jack Jansen <jack.jansen@cwi.nl>
parents: 3314
diff changeset
162 if ( strcmp(name, "bkPixPat") == 0 )
00453613cd4c Added rgbFgColor and a few other members of CGrafPort
Jack Jansen <jack.jansen@cwi.nl>
parents: 3314
diff changeset
163 return Py_BuildValue("O&", ResObj_New, (Handle)itself_color->bkPixPat);
00453613cd4c Added rgbFgColor and a few other members of CGrafPort
Jack Jansen <jack.jansen@cwi.nl>
parents: 3314
diff changeset
164 if ( strcmp(name, "rgbFgColor") == 0 )
00453613cd4c Added rgbFgColor and a few other members of CGrafPort
Jack Jansen <jack.jansen@cwi.nl>
parents: 3314
diff changeset
165 return Py_BuildValue("O&", QdRGB_New, &itself_color->rgbFgColor);
00453613cd4c Added rgbFgColor and a few other members of CGrafPort
Jack Jansen <jack.jansen@cwi.nl>
parents: 3314
diff changeset
166 if ( strcmp(name, "rgbBkColor") == 0 )
00453613cd4c Added rgbFgColor and a few other members of CGrafPort
Jack Jansen <jack.jansen@cwi.nl>
parents: 3314
diff changeset
167 return Py_BuildValue("O&", QdRGB_New, &itself_color->rgbBkColor);
00453613cd4c Added rgbFgColor and a few other members of CGrafPort
Jack Jansen <jack.jansen@cwi.nl>
parents: 3314
diff changeset
168 if ( strcmp(name, "pnPixPat") == 0 )
00453613cd4c Added rgbFgColor and a few other members of CGrafPort
Jack Jansen <jack.jansen@cwi.nl>
parents: 3314
diff changeset
169 return Py_BuildValue("O&", ResObj_New, (Handle)itself_color->pnPixPat);
00453613cd4c Added rgbFgColor and a few other members of CGrafPort
Jack Jansen <jack.jansen@cwi.nl>
parents: 3314
diff changeset
170 if ( strcmp(name, "fillPixPat") == 0 )
00453613cd4c Added rgbFgColor and a few other members of CGrafPort
Jack Jansen <jack.jansen@cwi.nl>
parents: 3314
diff changeset
171 return Py_BuildValue("O&", ResObj_New, (Handle)itself_color->fillPixPat);
3314
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
172 } else {
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
173 /* Mono-only attributes */
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
174 if ( strcmp(name, "portBits") == 0 )
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
175 return BMObj_New(&self->ob_itself->portBits);
3342
00453613cd4c Added rgbFgColor and a few other members of CGrafPort
Jack Jansen <jack.jansen@cwi.nl>
parents: 3314
diff changeset
176 if ( strcmp(name, "bkPat") == 0 )
00453613cd4c Added rgbFgColor and a few other members of CGrafPort
Jack Jansen <jack.jansen@cwi.nl>
parents: 3314
diff changeset
177 return Py_BuildValue("s#", (char *)&self->ob_itself->bkPat, sizeof(Pattern));
00453613cd4c Added rgbFgColor and a few other members of CGrafPort
Jack Jansen <jack.jansen@cwi.nl>
parents: 3314
diff changeset
178 if ( strcmp(name, "fillPat") == 0 )
00453613cd4c Added rgbFgColor and a few other members of CGrafPort
Jack Jansen <jack.jansen@cwi.nl>
parents: 3314
diff changeset
179 return Py_BuildValue("s#", (char *)&self->ob_itself->fillPat, sizeof(Pattern));
00453613cd4c Added rgbFgColor and a few other members of CGrafPort
Jack Jansen <jack.jansen@cwi.nl>
parents: 3314
diff changeset
180 if ( strcmp(name, "pnPat") == 0 )
00453613cd4c Added rgbFgColor and a few other members of CGrafPort
Jack Jansen <jack.jansen@cwi.nl>
parents: 3314
diff changeset
181 return Py_BuildValue("s#", (char *)&self->ob_itself->pnPat, sizeof(Pattern));
3314
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
182 }
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
183 /*
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
184 ** Accessible for both color/mono windows.
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
185 ** portVersion is really color-only, but we put it here
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
186 ** for convenience
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
187 */
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
188 if ( strcmp(name, "portVersion") == 0 )
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
189 return Py_BuildValue("h", itself_color->portVersion);
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
190 if ( strcmp(name, "device") == 0 )
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
191 return PyInt_FromLong((long)self->ob_itself->device);
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
192 if ( strcmp(name, "portRect") == 0 )
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
193 return Py_BuildValue("O&", PyMac_BuildRect, &self->ob_itself->portRect);
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
194 if ( strcmp(name, "visRgn") == 0 )
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
195 return Py_BuildValue("O&", ResObj_New, (Handle)self->ob_itself->visRgn);
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
196 if ( strcmp(name, "clipRgn") == 0 )
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
197 return Py_BuildValue("O&", ResObj_New, (Handle)self->ob_itself->clipRgn);
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
198 if ( strcmp(name, "pnLoc") == 0 )
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
199 return Py_BuildValue("O&", PyMac_BuildPoint, self->ob_itself->pnLoc);
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
200 if ( strcmp(name, "pnSize") == 0 )
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
201 return Py_BuildValue("O&", PyMac_BuildPoint, self->ob_itself->pnSize);
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
202 if ( strcmp(name, "pnMode") == 0 )
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
203 return Py_BuildValue("h", self->ob_itself->pnMode);
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
204 if ( strcmp(name, "pnVis") == 0 )
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
205 return Py_BuildValue("h", self->ob_itself->pnVis);
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
206 if ( strcmp(name, "txFont") == 0 )
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
207 return Py_BuildValue("h", self->ob_itself->txFont);
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
208 if ( strcmp(name, "txFace") == 0 )
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
209 return Py_BuildValue("h", (short)self->ob_itself->txFace);
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
210 if ( strcmp(name, "txMode") == 0 )
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
211 return Py_BuildValue("h", self->ob_itself->txMode);
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
212 if ( strcmp(name, "txSize") == 0 )
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
213 return Py_BuildValue("h", self->ob_itself->txSize);
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
214 if ( strcmp(name, "spExtra") == 0 )
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
215 return Py_BuildValue("O&", PyMac_BuildFixed, self->ob_itself->spExtra);
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
216 /* XXXX Add more, as needed */
3548
04edfcbb7121 Added _id attribute to GrafPort objects (real id of grafport, numeric)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3369
diff changeset
217 /* This one is so we can compare grafports: */
04edfcbb7121 Added _id attribute to GrafPort objects (real id of grafport, numeric)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3369
diff changeset
218 if ( strcmp(name, "_id") == 0 )
04edfcbb7121 Added _id attribute to GrafPort objects (real id of grafport, numeric)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3369
diff changeset
219 return Py_BuildValue("l", (long)self->ob_itself);
3295
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
220 }
3276
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
221 return Py_FindMethodInChain(&GrafObj_chain, (PyObject *)self, name);
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
222 }
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
223
3276
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
224 #define GrafObj_setattr NULL
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
225
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
226 PyTypeObject GrafPort_Type = {
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
227 PyObject_HEAD_INIT(&PyType_Type)
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
228 0, /*ob_size*/
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
229 "GrafPort", /*tp_name*/
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
230 sizeof(GrafPortObject), /*tp_basicsize*/
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
231 0, /*tp_itemsize*/
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
232 /* methods */
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
233 (destructor) GrafObj_dealloc, /*tp_dealloc*/
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
234 0, /*tp_print*/
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
235 (getattrfunc) GrafObj_getattr, /*tp_getattr*/
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
236 (setattrfunc) GrafObj_setattr, /*tp_setattr*/
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
237 };
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
238
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
239 /* -------------------- End object type GrafPort -------------------- */
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
240
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
241
3281
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
242 /* ----------------------- Object type BitMap ----------------------- */
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
243
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
244 PyTypeObject BitMap_Type;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
245
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
246 #define BMObj_Check(x) ((x)->ob_type == &BitMap_Type)
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
247
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
248 typedef struct BitMapObject {
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
249 PyObject_HEAD
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
250 BitMapPtr ob_itself;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
251 PyObject *referred_object;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
252 BitMap *referred_bitmap;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
253 } BitMapObject;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
254
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
255 PyObject *BMObj_New(itself)
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
256 BitMapPtr itself;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
257 {
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
258 BitMapObject *it;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
259 if (itself == NULL) return PyMac_Error(resNotFound);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
260 it = PyObject_NEW(BitMapObject, &BitMap_Type);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
261 if (it == NULL) return NULL;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
262 it->ob_itself = itself;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
263 it->referred_object = NULL;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
264 it->referred_bitmap = NULL;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
265 return (PyObject *)it;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
266 }
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
267 BMObj_Convert(v, p_itself)
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
268 PyObject *v;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
269 BitMapPtr *p_itself;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
270 {
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
271 if (!BMObj_Check(v))
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
272 {
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
273 PyErr_SetString(PyExc_TypeError, "BitMap required");
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
274 return 0;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
275 }
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
276 *p_itself = ((BitMapObject *)v)->ob_itself;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
277 return 1;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
278 }
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
279
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
280 static void BMObj_dealloc(self)
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
281 BitMapObject *self;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
282 {
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
283 Py_XDECREF(self->referred_object);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
284 if (self->referred_bitmap) free(self->referred_bitmap);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
285 PyMem_DEL(self);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
286 }
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
287
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
288 static PyMethodDef BMObj_methods[] = {
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
289 {NULL, NULL, 0}
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
290 };
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
291
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
292 PyMethodChain BMObj_chain = { BMObj_methods, NULL };
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
293
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
294 static PyObject *BMObj_getattr(self, name)
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
295 BitMapObject *self;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
296 char *name;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
297 {
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
298 if ( strcmp(name, "baseAddr") == 0 )
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
299 return PyInt_FromLong((long)self->ob_itself->baseAddr);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
300 if ( strcmp(name, "rowBytes") == 0 )
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
301 return PyInt_FromLong((long)self->ob_itself->rowBytes);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
302 if ( strcmp(name, "bounds") == 0 )
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
303 return Py_BuildValue("O&", PyMac_BuildRect, &self->ob_itself->bounds);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
304 /* XXXX Add more, as needed */
3295
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
305 if ( strcmp(name, "bitmap_data") == 0 )
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
306 return PyString_FromStringAndSize((char *)self->ob_itself, sizeof(BitMap));
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
307 if ( strcmp(name, "pixmap_data") == 0 )
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
308 return PyString_FromStringAndSize((char *)self->ob_itself, sizeof(PixMap));
3281
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
309
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
310 return Py_FindMethodInChain(&BMObj_chain, (PyObject *)self, name);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
311 }
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
312
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
313 #define BMObj_setattr NULL
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
314
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
315 PyTypeObject BitMap_Type = {
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
316 PyObject_HEAD_INIT(&PyType_Type)
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
317 0, /*ob_size*/
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
318 "BitMap", /*tp_name*/
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
319 sizeof(BitMapObject), /*tp_basicsize*/
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
320 0, /*tp_itemsize*/
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
321 /* methods */
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
322 (destructor) BMObj_dealloc, /*tp_dealloc*/
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
323 0, /*tp_print*/
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
324 (getattrfunc) BMObj_getattr, /*tp_getattr*/
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
325 (setattrfunc) BMObj_setattr, /*tp_setattr*/
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
326 };
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
327
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
328 /* --------------------- End object type BitMap --------------------- */
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
329
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
330
3369
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
331 /* ------------------ Object type QDGlobalsAccess ------------------- */
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
332
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
333 staticforward PyTypeObject QDGlobalsAccess_Type;
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
334
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
335 #define QDGA_Check(x) ((x)->ob_type == &QDGlobalsAccess_Type)
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
336
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
337 typedef struct QDGlobalsAccessObject {
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
338 PyObject_HEAD
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
339 } QDGlobalsAccessObject;
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
340
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
341 static PyObject *QDGA_New()
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
342 {
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
343 QDGlobalsAccessObject *it;
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
344 it = PyObject_NEW(QDGlobalsAccessObject, &QDGlobalsAccess_Type);
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
345 if (it == NULL) return NULL;
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
346 return (PyObject *)it;
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
347 }
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
348
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
349 static void QDGA_dealloc(self)
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
350 QDGlobalsAccessObject *self;
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
351 {
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
352 PyMem_DEL(self);
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
353 }
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
354
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
355 static PyMethodDef QDGA_methods[] = {
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
356 {NULL, NULL, 0}
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
357 };
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
358
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
359 static PyMethodChain QDGA_chain = { QDGA_methods, NULL };
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
360
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
361 static PyObject *QDGA_getattr(self, name)
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
362 QDGlobalsAccessObject *self;
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
363 char *name;
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
364 {
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
365
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
366 if ( strcmp(name, "arrow") == 0 )
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
367 return PyString_FromStringAndSize((char *)&qd.arrow, sizeof(qd.arrow));
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
368 if ( strcmp(name, "black") == 0 )
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
369 return PyString_FromStringAndSize((char *)&qd.black, sizeof(qd.black));
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
370 if ( strcmp(name, "white") == 0 )
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
371 return PyString_FromStringAndSize((char *)&qd.white, sizeof(qd.white));
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
372 if ( strcmp(name, "gray") == 0 )
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
373 return PyString_FromStringAndSize((char *)&qd.gray, sizeof(qd.gray));
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
374 if ( strcmp(name, "ltGray") == 0 )
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
375 return PyString_FromStringAndSize((char *)&qd.ltGray, sizeof(qd.ltGray));
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
376 if ( strcmp(name, "dkGray") == 0 )
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
377 return PyString_FromStringAndSize((char *)&qd.dkGray, sizeof(qd.dkGray));
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
378 if ( strcmp(name, "screenBits") == 0 )
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
379 return BMObj_New(&qd.screenBits);
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
380 if ( strcmp(name, "thePort") == 0 )
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
381 return GrafObj_New(qd.thePort);
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
382 if ( strcmp(name, "randSeed") == 0 )
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
383 return Py_BuildValue("l", &qd.randSeed);
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
384
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
385 return Py_FindMethodInChain(&QDGA_chain, (PyObject *)self, name);
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
386 }
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
387
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
388 #define QDGA_setattr NULL
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
389
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
390 staticforward PyTypeObject QDGlobalsAccess_Type = {
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
391 PyObject_HEAD_INIT(&PyType_Type)
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
392 0, /*ob_size*/
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
393 "QDGlobalsAccess", /*tp_name*/
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
394 sizeof(QDGlobalsAccessObject), /*tp_basicsize*/
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
395 0, /*tp_itemsize*/
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
396 /* methods */
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
397 (destructor) QDGA_dealloc, /*tp_dealloc*/
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
398 0, /*tp_print*/
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
399 (getattrfunc) QDGA_getattr, /*tp_getattr*/
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
400 (setattrfunc) QDGA_setattr, /*tp_setattr*/
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
401 };
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
402
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
403 /* ---------------- End object type QDGlobalsAccess ----------------- */
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
404
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
405
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
406 static PyObject *Qd_SetPort(_self, _args)
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
407 PyObject *_self;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
408 PyObject *_args;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
409 {
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
410 PyObject *_res = NULL;
3276
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
411 GrafPtr port;
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
412 if (!PyArg_ParseTuple(_args, "O&",
3276
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
413 GrafObj_Convert, &port))
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
414 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
415 SetPort(port);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
416 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
417 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
418 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
419 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
420
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
421 static PyObject *Qd_GetPort(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
422 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
423 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
424 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
425 PyObject *_res = NULL;
3276
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
426 GrafPtr port;
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
427 if (!PyArg_ParseTuple(_args, ""))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
428 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
429 GetPort(&port);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
430 _res = Py_BuildValue("O&",
3276
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
431 GrafObj_New, port);
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
432 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
433 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
434
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
435 static PyObject *Qd_GrafDevice(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
436 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
437 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
438 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
439 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
440 short device;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
441 if (!PyArg_ParseTuple(_args, "h",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
442 &device))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
443 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
444 GrafDevice(device);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
445 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
446 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
447 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
448 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
449
3281
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
450 static PyObject *Qd_SetPortBits(_self, _args)
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
451 PyObject *_self;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
452 PyObject *_args;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
453 {
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
454 PyObject *_res = NULL;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
455 BitMapPtr bm;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
456 if (!PyArg_ParseTuple(_args, "O&",
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
457 BMObj_Convert, &bm))
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
458 return NULL;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
459 SetPortBits(bm);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
460 Py_INCREF(Py_None);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
461 _res = Py_None;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
462 return _res;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
463 }
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
464
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
465 static PyObject *Qd_PortSize(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
466 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
467 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
468 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
469 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
470 short width;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
471 short height;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
472 if (!PyArg_ParseTuple(_args, "hh",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
473 &width,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
474 &height))
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
475 return NULL;
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
476 PortSize(width,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
477 height);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
478 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
479 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
480 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
481 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
482
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
483 static PyObject *Qd_MovePortTo(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
484 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
485 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
486 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
487 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
488 short leftGlobal;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
489 short topGlobal;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
490 if (!PyArg_ParseTuple(_args, "hh",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
491 &leftGlobal,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
492 &topGlobal))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
493 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
494 MovePortTo(leftGlobal,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
495 topGlobal);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
496 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
497 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
498 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
499 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
500
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
501 static PyObject *Qd_SetOrigin(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
502 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
503 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
504 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
505 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
506 short h;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
507 short v;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
508 if (!PyArg_ParseTuple(_args, "hh",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
509 &h,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
510 &v))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
511 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
512 SetOrigin(h,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
513 v);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
514 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
515 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
516 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
517 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
518
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
519 static PyObject *Qd_SetClip(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
520 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
521 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
522 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
523 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
524 RgnHandle rgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
525 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
526 ResObj_Convert, &rgn))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
527 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
528 SetClip(rgn);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
529 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
530 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
531 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
532 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
533
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
534 static PyObject *Qd_GetClip(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
535 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
536 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
537 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
538 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
539 RgnHandle rgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
540 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
541 ResObj_Convert, &rgn))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
542 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
543 GetClip(rgn);
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
544 Py_INCREF(Py_None);
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
545 _res = Py_None;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
546 return _res;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
547 }
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
548
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
549 static PyObject *Qd_ClipRect(_self, _args)
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
550 PyObject *_self;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
551 PyObject *_args;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
552 {
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
553 PyObject *_res = NULL;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
554 Rect r;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
555 if (!PyArg_ParseTuple(_args, "O&",
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
556 PyMac_GetRect, &r))
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
557 return NULL;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
558 ClipRect(&r);
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
559 Py_INCREF(Py_None);
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
560 _res = Py_None;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
561 return _res;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
562 }
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
563
3308
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
564 static PyObject *Qd_BackPat(_self, _args)
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
565 PyObject *_self;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
566 PyObject *_args;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
567 {
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
568 PyObject *_res = NULL;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
569 Pattern *pat__in__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
570 int pat__in_len__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
571 if (!PyArg_ParseTuple(_args, "s#",
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
572 (char **)&pat__in__, &pat__in_len__))
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
573 return NULL;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
574 if (pat__in_len__ != sizeof(Pattern))
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
575 {
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
576 PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)");
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
577 goto pat__error__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
578 }
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
579 BackPat(pat__in__);
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
580 Py_INCREF(Py_None);
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
581 _res = Py_None;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
582 pat__error__: ;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
583 return _res;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
584 }
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
585
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
586 static PyObject *Qd_InitCursor(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
587 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
588 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
589 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
590 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
591 if (!PyArg_ParseTuple(_args, ""))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
592 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
593 InitCursor();
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
594 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
595 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
596 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
597 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
598
3307
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
599 static PyObject *Qd_SetCursor(_self, _args)
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
600 PyObject *_self;
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
601 PyObject *_args;
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
602 {
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
603 PyObject *_res = NULL;
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
604 Cursor *crsr__in__;
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
605 int crsr__in_len__;
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
606 if (!PyArg_ParseTuple(_args, "s#",
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
607 (char **)&crsr__in__, &crsr__in_len__))
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
608 return NULL;
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
609 if (crsr__in_len__ != sizeof(Cursor))
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
610 {
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
611 PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Cursor)");
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
612 goto crsr__error__;
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
613 }
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
614 SetCursor(crsr__in__);
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
615 Py_INCREF(Py_None);
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
616 _res = Py_None;
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
617 crsr__error__: ;
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
618 return _res;
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
619 }
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
620
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
621 static PyObject *Qd_HideCursor(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
622 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
623 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
624 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
625 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
626 if (!PyArg_ParseTuple(_args, ""))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
627 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
628 HideCursor();
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
629 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
630 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
631 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
632 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
633
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
634 static PyObject *Qd_ShowCursor(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
635 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
636 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
637 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
638 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
639 if (!PyArg_ParseTuple(_args, ""))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
640 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
641 ShowCursor();
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
642 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
643 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
644 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
645 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
646
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
647 static PyObject *Qd_ObscureCursor(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
648 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
649 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
650 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
651 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
652 if (!PyArg_ParseTuple(_args, ""))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
653 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
654 ObscureCursor();
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
655 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
656 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
657 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
658 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
659
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
660 static PyObject *Qd_HidePen(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
661 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
662 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
663 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
664 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
665 if (!PyArg_ParseTuple(_args, ""))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
666 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
667 HidePen();
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
668 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
669 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
670 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
671 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
672
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
673 static PyObject *Qd_ShowPen(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
674 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
675 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
676 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
677 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
678 if (!PyArg_ParseTuple(_args, ""))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
679 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
680 ShowPen();
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
681 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
682 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
683 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
684 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
685
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
686 static PyObject *Qd_GetPen(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
687 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
688 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
689 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
690 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
691 Point pt;
3309
b828bccda189 Fixed GetPen and SetPt arguments
Jack Jansen <jack.jansen@cwi.nl>
parents: 3308
diff changeset
692 if (!PyArg_ParseTuple(_args, ""))
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
693 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
694 GetPen(&pt);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
695 _res = Py_BuildValue("O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
696 PyMac_BuildPoint, pt);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
697 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
698 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
699
3308
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
700 static PyObject *Qd_GetPenState(_self, _args)
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
701 PyObject *_self;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
702 PyObject *_args;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
703 {
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
704 PyObject *_res = NULL;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
705 PenState pnState__out__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
706 if (!PyArg_ParseTuple(_args, ""))
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
707 return NULL;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
708 GetPenState(&pnState__out__);
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
709 _res = Py_BuildValue("s#",
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
710 (char *)&pnState__out__, (int)sizeof(PenState));
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
711 pnState__error__: ;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
712 return _res;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
713 }
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
714
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
715 static PyObject *Qd_SetPenState(_self, _args)
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
716 PyObject *_self;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
717 PyObject *_args;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
718 {
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
719 PyObject *_res = NULL;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
720 PenState *pnState__in__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
721 int pnState__in_len__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
722 if (!PyArg_ParseTuple(_args, "s#",
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
723 (char **)&pnState__in__, &pnState__in_len__))
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
724 return NULL;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
725 if (pnState__in_len__ != sizeof(PenState))
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
726 {
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
727 PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(PenState)");
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
728 goto pnState__error__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
729 }
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
730 SetPenState(pnState__in__);
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
731 Py_INCREF(Py_None);
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
732 _res = Py_None;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
733 pnState__error__: ;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
734 return _res;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
735 }
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
736
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
737 static PyObject *Qd_PenSize(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
738 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
739 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
740 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
741 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
742 short width;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
743 short height;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
744 if (!PyArg_ParseTuple(_args, "hh",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
745 &width,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
746 &height))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
747 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
748 PenSize(width,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
749 height);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
750 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
751 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
752 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
753 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
754
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
755 static PyObject *Qd_PenMode(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
756 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
757 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
758 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
759 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
760 short mode;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
761 if (!PyArg_ParseTuple(_args, "h",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
762 &mode))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
763 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
764 PenMode(mode);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
765 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
766 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
767 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
768 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
769
3308
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
770 static PyObject *Qd_PenPat(_self, _args)
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
771 PyObject *_self;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
772 PyObject *_args;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
773 {
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
774 PyObject *_res = NULL;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
775 Pattern *pat__in__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
776 int pat__in_len__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
777 if (!PyArg_ParseTuple(_args, "s#",
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
778 (char **)&pat__in__, &pat__in_len__))
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
779 return NULL;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
780 if (pat__in_len__ != sizeof(Pattern))
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
781 {
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
782 PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)");
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
783 goto pat__error__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
784 }
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
785 PenPat(pat__in__);
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
786 Py_INCREF(Py_None);
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
787 _res = Py_None;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
788 pat__error__: ;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
789 return _res;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
790 }
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
791
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
792 static PyObject *Qd_PenNormal(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
793 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
794 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
795 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
796 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
797 if (!PyArg_ParseTuple(_args, ""))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
798 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
799 PenNormal();
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
800 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
801 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
802 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
803 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
804
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
805 static PyObject *Qd_MoveTo(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
806 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
807 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
808 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
809 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
810 short h;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
811 short v;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
812 if (!PyArg_ParseTuple(_args, "hh",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
813 &h,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
814 &v))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
815 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
816 MoveTo(h,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
817 v);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
818 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
819 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
820 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
821 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
822
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
823 static PyObject *Qd_Move(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
824 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
825 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
826 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
827 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
828 short dh;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
829 short dv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
830 if (!PyArg_ParseTuple(_args, "hh",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
831 &dh,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
832 &dv))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
833 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
834 Move(dh,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
835 dv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
836 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
837 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
838 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
839 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
840
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
841 static PyObject *Qd_LineTo(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
842 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
843 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
844 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
845 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
846 short h;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
847 short v;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
848 if (!PyArg_ParseTuple(_args, "hh",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
849 &h,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
850 &v))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
851 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
852 LineTo(h,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
853 v);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
854 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
855 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
856 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
857 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
858
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
859 static PyObject *Qd_Line(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
860 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
861 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
862 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
863 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
864 short dh;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
865 short dv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
866 if (!PyArg_ParseTuple(_args, "hh",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
867 &dh,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
868 &dv))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
869 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
870 Line(dh,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
871 dv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
872 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
873 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
874 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
875 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
876
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
877 static PyObject *Qd_ForeColor(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
878 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
879 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
880 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
881 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
882 long color;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
883 if (!PyArg_ParseTuple(_args, "l",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
884 &color))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
885 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
886 ForeColor(color);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
887 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
888 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
889 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
890 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
891
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
892 static PyObject *Qd_BackColor(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
893 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
894 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
895 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
896 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
897 long color;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
898 if (!PyArg_ParseTuple(_args, "l",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
899 &color))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
900 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
901 BackColor(color);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
902 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
903 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
904 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
905 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
906
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
907 static PyObject *Qd_ColorBit(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
908 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
909 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
910 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
911 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
912 short whichBit;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
913 if (!PyArg_ParseTuple(_args, "h",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
914 &whichBit))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
915 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
916 ColorBit(whichBit);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
917 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
918 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
919 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
920 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
921
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
922 static PyObject *Qd_SetRect(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
923 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
924 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
925 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
926 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
927 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
928 short left;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
929 short top;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
930 short right;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
931 short bottom;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
932 if (!PyArg_ParseTuple(_args, "hhhh",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
933 &left,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
934 &top,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
935 &right,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
936 &bottom))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
937 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
938 SetRect(&r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
939 left,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
940 top,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
941 right,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
942 bottom);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
943 _res = Py_BuildValue("O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
944 PyMac_BuildRect, &r);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
945 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
946 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
947
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
948 static PyObject *Qd_OffsetRect(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
949 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
950 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
951 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
952 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
953 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
954 short dh;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
955 short dv;
3267
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
956 if (!PyArg_ParseTuple(_args, "O&hh",
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
957 PyMac_GetRect, &r,
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
958 &dh,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
959 &dv))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
960 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
961 OffsetRect(&r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
962 dh,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
963 dv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
964 _res = Py_BuildValue("O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
965 PyMac_BuildRect, &r);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
966 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
967 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
968
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
969 static PyObject *Qd_InsetRect(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
970 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
971 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
972 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
973 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
974 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
975 short dh;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
976 short dv;
3267
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
977 if (!PyArg_ParseTuple(_args, "O&hh",
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
978 PyMac_GetRect, &r,
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
979 &dh,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
980 &dv))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
981 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
982 InsetRect(&r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
983 dh,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
984 dv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
985 _res = Py_BuildValue("O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
986 PyMac_BuildRect, &r);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
987 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
988 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
989
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
990 static PyObject *Qd_SectRect(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
991 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
992 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
993 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
994 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
995 Boolean _rv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
996 Rect src1;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
997 Rect src2;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
998 Rect dstRect;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
999 if (!PyArg_ParseTuple(_args, "O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1000 PyMac_GetRect, &src1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1001 PyMac_GetRect, &src2))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1002 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1003 _rv = SectRect(&src1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1004 &src2,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1005 &dstRect);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1006 _res = Py_BuildValue("bO&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1007 _rv,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1008 PyMac_BuildRect, &dstRect);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1009 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1010 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1011
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1012 static PyObject *Qd_UnionRect(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1013 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1014 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1015 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1016 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1017 Rect src1;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1018 Rect src2;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1019 Rect dstRect;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1020 if (!PyArg_ParseTuple(_args, "O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1021 PyMac_GetRect, &src1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1022 PyMac_GetRect, &src2))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1023 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1024 UnionRect(&src1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1025 &src2,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1026 &dstRect);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1027 _res = Py_BuildValue("O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1028 PyMac_BuildRect, &dstRect);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1029 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1030 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1031
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1032 static PyObject *Qd_EqualRect(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1033 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1034 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1035 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1036 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1037 Boolean _rv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1038 Rect rect1;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1039 Rect rect2;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1040 if (!PyArg_ParseTuple(_args, "O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1041 PyMac_GetRect, &rect1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1042 PyMac_GetRect, &rect2))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1043 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1044 _rv = EqualRect(&rect1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1045 &rect2);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1046 _res = Py_BuildValue("b",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1047 _rv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1048 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1049 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1050
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1051 static PyObject *Qd_EmptyRect(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1052 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1053 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1054 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1055 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1056 Boolean _rv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1057 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1058 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1059 PyMac_GetRect, &r))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1060 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1061 _rv = EmptyRect(&r);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1062 _res = Py_BuildValue("b",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1063 _rv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1064 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1065 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1066
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1067 static PyObject *Qd_FrameRect(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1068 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1069 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1070 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1071 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1072 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1073 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1074 PyMac_GetRect, &r))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1075 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1076 FrameRect(&r);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1077 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1078 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1079 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1080 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1081
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1082 static PyObject *Qd_PaintRect(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1083 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1084 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1085 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1086 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1087 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1088 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1089 PyMac_GetRect, &r))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1090 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1091 PaintRect(&r);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1092 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1093 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1094 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1095 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1096
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1097 static PyObject *Qd_EraseRect(_self, _args)
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1098 PyObject *_self;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1099 PyObject *_args;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1100 {
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1101 PyObject *_res = NULL;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1102 Rect r;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1103 if (!PyArg_ParseTuple(_args, "O&",
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1104 PyMac_GetRect, &r))
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1105 return NULL;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1106 EraseRect(&r);
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1107 Py_INCREF(Py_None);
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1108 _res = Py_None;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1109 return _res;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1110 }
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1111
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1112 static PyObject *Qd_InvertRect(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1113 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1114 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1115 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1116 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1117 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1118 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1119 PyMac_GetRect, &r))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1120 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1121 InvertRect(&r);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1122 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1123 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1124 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1125 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1126
3308
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1127 static PyObject *Qd_FillRect(_self, _args)
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1128 PyObject *_self;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1129 PyObject *_args;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1130 {
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1131 PyObject *_res = NULL;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1132 Rect r;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1133 Pattern *pat__in__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1134 int pat__in_len__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1135 if (!PyArg_ParseTuple(_args, "O&s#",
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1136 PyMac_GetRect, &r,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1137 (char **)&pat__in__, &pat__in_len__))
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1138 return NULL;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1139 if (pat__in_len__ != sizeof(Pattern))
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1140 {
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1141 PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)");
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1142 goto pat__error__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1143 }
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1144 FillRect(&r,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1145 pat__in__);
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1146 Py_INCREF(Py_None);
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1147 _res = Py_None;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1148 pat__error__: ;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1149 return _res;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1150 }
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1151
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1152 static PyObject *Qd_FrameOval(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1153 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1154 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1155 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1156 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1157 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1158 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1159 PyMac_GetRect, &r))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1160 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1161 FrameOval(&r);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1162 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1163 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1164 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1165 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1166
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1167 static PyObject *Qd_PaintOval(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1168 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1169 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1170 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1171 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1172 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1173 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1174 PyMac_GetRect, &r))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1175 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1176 PaintOval(&r);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1177 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1178 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1179 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1180 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1181
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1182 static PyObject *Qd_EraseOval(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1183 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1184 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1185 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1186 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1187 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1188 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1189 PyMac_GetRect, &r))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1190 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1191 EraseOval(&r);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1192 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1193 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1194 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1195 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1196
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1197 static PyObject *Qd_InvertOval(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1198 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1199 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1200 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1201 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1202 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1203 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1204 PyMac_GetRect, &r))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1205 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1206 InvertOval(&r);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1207 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1208 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1209 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1210 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1211
3308
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1212 static PyObject *Qd_FillOval(_self, _args)
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1213 PyObject *_self;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1214 PyObject *_args;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1215 {
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1216 PyObject *_res = NULL;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1217 Rect r;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1218 Pattern *pat__in__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1219 int pat__in_len__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1220 if (!PyArg_ParseTuple(_args, "O&s#",
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1221 PyMac_GetRect, &r,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1222 (char **)&pat__in__, &pat__in_len__))
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1223 return NULL;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1224 if (pat__in_len__ != sizeof(Pattern))
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1225 {
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1226 PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)");
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1227 goto pat__error__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1228 }
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1229 FillOval(&r,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1230 pat__in__);
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1231 Py_INCREF(Py_None);
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1232 _res = Py_None;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1233 pat__error__: ;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1234 return _res;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1235 }
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1236
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1237 static PyObject *Qd_FrameRoundRect(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1238 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1239 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1240 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1241 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1242 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1243 short ovalWidth;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1244 short ovalHeight;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1245 if (!PyArg_ParseTuple(_args, "O&hh",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1246 PyMac_GetRect, &r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1247 &ovalWidth,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1248 &ovalHeight))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1249 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1250 FrameRoundRect(&r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1251 ovalWidth,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1252 ovalHeight);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1253 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1254 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1255 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1256 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1257
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1258 static PyObject *Qd_PaintRoundRect(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1259 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1260 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1261 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1262 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1263 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1264 short ovalWidth;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1265 short ovalHeight;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1266 if (!PyArg_ParseTuple(_args, "O&hh",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1267 PyMac_GetRect, &r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1268 &ovalWidth,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1269 &ovalHeight))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1270 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1271 PaintRoundRect(&r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1272 ovalWidth,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1273 ovalHeight);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1274 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1275 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1276 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1277 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1278
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1279 static PyObject *Qd_EraseRoundRect(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1280 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1281 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1282 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1283 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1284 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1285 short ovalWidth;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1286 short ovalHeight;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1287 if (!PyArg_ParseTuple(_args, "O&hh",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1288 PyMac_GetRect, &r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1289 &ovalWidth,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1290 &ovalHeight))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1291 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1292 EraseRoundRect(&r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1293 ovalWidth,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1294 ovalHeight);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1295 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1296 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1297 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1298 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1299
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1300 static PyObject *Qd_InvertRoundRect(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1301 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1302 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1303 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1304 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1305 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1306 short ovalWidth;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1307 short ovalHeight;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1308 if (!PyArg_ParseTuple(_args, "O&hh",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1309 PyMac_GetRect, &r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1310 &ovalWidth,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1311 &ovalHeight))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1312 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1313 InvertRoundRect(&r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1314 ovalWidth,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1315 ovalHeight);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1316 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1317 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1318 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1319 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1320
3308
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1321 static PyObject *Qd_FillRoundRect(_self, _args)
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1322 PyObject *_self;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1323 PyObject *_args;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1324 {
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1325 PyObject *_res = NULL;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1326 Rect r;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1327 short ovalWidth;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1328 short ovalHeight;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1329 Pattern *pat__in__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1330 int pat__in_len__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1331 if (!PyArg_ParseTuple(_args, "O&hhs#",
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1332 PyMac_GetRect, &r,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1333 &ovalWidth,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1334 &ovalHeight,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1335 (char **)&pat__in__, &pat__in_len__))
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1336 return NULL;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1337 if (pat__in_len__ != sizeof(Pattern))
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1338 {
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1339 PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)");
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1340 goto pat__error__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1341 }
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1342 FillRoundRect(&r,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1343 ovalWidth,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1344 ovalHeight,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1345 pat__in__);
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1346 Py_INCREF(Py_None);
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1347 _res = Py_None;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1348 pat__error__: ;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1349 return _res;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1350 }
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1351
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1352 static PyObject *Qd_FrameArc(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1353 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1354 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1355 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1356 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1357 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1358 short startAngle;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1359 short arcAngle;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1360 if (!PyArg_ParseTuple(_args, "O&hh",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1361 PyMac_GetRect, &r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1362 &startAngle,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1363 &arcAngle))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1364 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1365 FrameArc(&r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1366 startAngle,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1367 arcAngle);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1368 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1369 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1370 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1371 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1372
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1373 static PyObject *Qd_PaintArc(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1374 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1375 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1376 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1377 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1378 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1379 short startAngle;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1380 short arcAngle;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1381 if (!PyArg_ParseTuple(_args, "O&hh",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1382 PyMac_GetRect, &r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1383 &startAngle,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1384 &arcAngle))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1385 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1386 PaintArc(&r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1387 startAngle,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1388 arcAngle);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1389 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1390 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1391 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1392 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1393
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1394 static PyObject *Qd_EraseArc(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1395 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1396 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1397 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1398 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1399 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1400 short startAngle;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1401 short arcAngle;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1402 if (!PyArg_ParseTuple(_args, "O&hh",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1403 PyMac_GetRect, &r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1404 &startAngle,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1405 &arcAngle))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1406 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1407 EraseArc(&r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1408 startAngle,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1409 arcAngle);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1410 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1411 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1412 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1413 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1414
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1415 static PyObject *Qd_InvertArc(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1416 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1417 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1418 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1419 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1420 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1421 short startAngle;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1422 short arcAngle;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1423 if (!PyArg_ParseTuple(_args, "O&hh",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1424 PyMac_GetRect, &r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1425 &startAngle,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1426 &arcAngle))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1427 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1428 InvertArc(&r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1429 startAngle,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1430 arcAngle);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1431 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1432 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1433 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1434 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1435
3308
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1436 static PyObject *Qd_FillArc(_self, _args)
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1437 PyObject *_self;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1438 PyObject *_args;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1439 {
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1440 PyObject *_res = NULL;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1441 Rect r;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1442 short startAngle;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1443 short arcAngle;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1444 Pattern *pat__in__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1445 int pat__in_len__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1446 if (!PyArg_ParseTuple(_args, "O&hhs#",
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1447 PyMac_GetRect, &r,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1448 &startAngle,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1449 &arcAngle,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1450 (char **)&pat__in__, &pat__in_len__))
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1451 return NULL;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1452 if (pat__in_len__ != sizeof(Pattern))
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1453 {
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1454 PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)");
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1455 goto pat__error__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1456 }
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1457 FillArc(&r,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1458 startAngle,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1459 arcAngle,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1460 pat__in__);
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1461 Py_INCREF(Py_None);
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1462 _res = Py_None;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1463 pat__error__: ;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1464 return _res;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1465 }
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1466
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1467 static PyObject *Qd_NewRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1468 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1469 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1470 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1471 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1472 RgnHandle _rv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1473 if (!PyArg_ParseTuple(_args, ""))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1474 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1475 _rv = NewRgn();
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1476 _res = Py_BuildValue("O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1477 ResObj_New, _rv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1478 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1479 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1480
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1481 static PyObject *Qd_OpenRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1482 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1483 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1484 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1485 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1486 if (!PyArg_ParseTuple(_args, ""))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1487 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1488 OpenRgn();
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1489 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1490 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1491 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1492 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1493
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1494 static PyObject *Qd_CloseRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1495 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1496 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1497 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1498 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1499 RgnHandle dstRgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1500 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1501 ResObj_Convert, &dstRgn))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1502 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1503 CloseRgn(dstRgn);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1504 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1505 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1506 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1507 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1508
3281
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1509 static PyObject *Qd_BitMapToRegion(_self, _args)
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1510 PyObject *_self;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1511 PyObject *_args;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1512 {
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1513 PyObject *_res = NULL;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1514 OSErr _err;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1515 RgnHandle region;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1516 BitMapPtr bMap;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1517 if (!PyArg_ParseTuple(_args, "O&O&",
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1518 ResObj_Convert, &region,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1519 BMObj_Convert, &bMap))
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1520 return NULL;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1521 _err = BitMapToRegion(region,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1522 bMap);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1523 if (_err != noErr) return PyMac_Error(_err);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1524 Py_INCREF(Py_None);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1525 _res = Py_None;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1526 return _res;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1527 }
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1528
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1529 static PyObject *Qd_DisposeRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1530 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1531 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1532 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1533 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1534 RgnHandle rgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1535 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1536 ResObj_Convert, &rgn))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1537 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1538 DisposeRgn(rgn);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1539 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1540 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1541 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1542 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1543
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1544 static PyObject *Qd_CopyRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1545 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1546 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1547 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1548 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1549 RgnHandle srcRgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1550 RgnHandle dstRgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1551 if (!PyArg_ParseTuple(_args, "O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1552 ResObj_Convert, &srcRgn,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1553 ResObj_Convert, &dstRgn))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1554 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1555 CopyRgn(srcRgn,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1556 dstRgn);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1557 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1558 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1559 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1560 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1561
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1562 static PyObject *Qd_SetEmptyRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1563 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1564 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1565 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1566 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1567 RgnHandle rgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1568 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1569 ResObj_Convert, &rgn))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1570 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1571 SetEmptyRgn(rgn);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1572 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1573 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1574 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1575 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1576
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1577 static PyObject *Qd_SetRectRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1578 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1579 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1580 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1581 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1582 RgnHandle rgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1583 short left;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1584 short top;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1585 short right;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1586 short bottom;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1587 if (!PyArg_ParseTuple(_args, "O&hhhh",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1588 ResObj_Convert, &rgn,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1589 &left,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1590 &top,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1591 &right,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1592 &bottom))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1593 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1594 SetRectRgn(rgn,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1595 left,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1596 top,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1597 right,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1598 bottom);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1599 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1600 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1601 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1602 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1603
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1604 static PyObject *Qd_RectRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1605 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1606 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1607 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1608 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1609 RgnHandle rgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1610 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1611 if (!PyArg_ParseTuple(_args, "O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1612 ResObj_Convert, &rgn,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1613 PyMac_GetRect, &r))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1614 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1615 RectRgn(rgn,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1616 &r);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1617 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1618 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1619 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1620 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1621
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1622 static PyObject *Qd_OffsetRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1623 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1624 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1625 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1626 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1627 RgnHandle rgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1628 short dh;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1629 short dv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1630 if (!PyArg_ParseTuple(_args, "O&hh",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1631 ResObj_Convert, &rgn,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1632 &dh,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1633 &dv))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1634 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1635 OffsetRgn(rgn,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1636 dh,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1637 dv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1638 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1639 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1640 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1641 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1642
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1643 static PyObject *Qd_InsetRgn(_self, _args)
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1644 PyObject *_self;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1645 PyObject *_args;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1646 {
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1647 PyObject *_res = NULL;
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1648 RgnHandle rgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1649 short dh;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1650 short dv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1651 if (!PyArg_ParseTuple(_args, "O&hh",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1652 ResObj_Convert, &rgn,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1653 &dh,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1654 &dv))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1655 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1656 InsetRgn(rgn,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1657 dh,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1658 dv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1659 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1660 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1661 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1662 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1663
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1664 static PyObject *Qd_SectRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1665 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1666 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1667 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1668 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1669 RgnHandle srcRgnA;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1670 RgnHandle srcRgnB;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1671 RgnHandle dstRgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1672 if (!PyArg_ParseTuple(_args, "O&O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1673 ResObj_Convert, &srcRgnA,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1674 ResObj_Convert, &srcRgnB,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1675 ResObj_Convert, &dstRgn))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1676 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1677 SectRgn(srcRgnA,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1678 srcRgnB,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1679 dstRgn);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1680 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1681 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1682 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1683 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1684
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1685 static PyObject *Qd_UnionRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1686 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1687 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1688 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1689 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1690 RgnHandle srcRgnA;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1691 RgnHandle srcRgnB;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1692 RgnHandle dstRgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1693 if (!PyArg_ParseTuple(_args, "O&O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1694 ResObj_Convert, &srcRgnA,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1695 ResObj_Convert, &srcRgnB,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1696 ResObj_Convert, &dstRgn))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1697 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1698 UnionRgn(srcRgnA,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1699 srcRgnB,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1700 dstRgn);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1701 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1702 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1703 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1704 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1705
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1706 static PyObject *Qd_DiffRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1707 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1708 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1709 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1710 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1711 RgnHandle srcRgnA;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1712 RgnHandle srcRgnB;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1713 RgnHandle dstRgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1714 if (!PyArg_ParseTuple(_args, "O&O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1715 ResObj_Convert, &srcRgnA,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1716 ResObj_Convert, &srcRgnB,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1717 ResObj_Convert, &dstRgn))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1718 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1719 DiffRgn(srcRgnA,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1720 srcRgnB,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1721 dstRgn);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1722 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1723 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1724 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1725 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1726
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1727 static PyObject *Qd_XorRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1728 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1729 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1730 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1731 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1732 RgnHandle srcRgnA;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1733 RgnHandle srcRgnB;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1734 RgnHandle dstRgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1735 if (!PyArg_ParseTuple(_args, "O&O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1736 ResObj_Convert, &srcRgnA,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1737 ResObj_Convert, &srcRgnB,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1738 ResObj_Convert, &dstRgn))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1739 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1740 XorRgn(srcRgnA,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1741 srcRgnB,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1742 dstRgn);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1743 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1744 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1745 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1746 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1747
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1748 static PyObject *Qd_RectInRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1749 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1750 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1751 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1752 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1753 Boolean _rv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1754 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1755 RgnHandle rgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1756 if (!PyArg_ParseTuple(_args, "O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1757 PyMac_GetRect, &r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1758 ResObj_Convert, &rgn))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1759 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1760 _rv = RectInRgn(&r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1761 rgn);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1762 _res = Py_BuildValue("b",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1763 _rv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1764 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1765 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1766
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1767 static PyObject *Qd_EqualRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1768 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1769 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1770 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1771 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1772 Boolean _rv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1773 RgnHandle rgnA;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1774 RgnHandle rgnB;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1775 if (!PyArg_ParseTuple(_args, "O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1776 ResObj_Convert, &rgnA,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1777 ResObj_Convert, &rgnB))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1778 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1779 _rv = EqualRgn(rgnA,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1780 rgnB);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1781 _res = Py_BuildValue("b",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1782 _rv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1783 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1784 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1785
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1786 static PyObject *Qd_EmptyRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1787 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1788 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1789 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1790 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1791 Boolean _rv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1792 RgnHandle rgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1793 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1794 ResObj_Convert, &rgn))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1795 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1796 _rv = EmptyRgn(rgn);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1797 _res = Py_BuildValue("b",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1798 _rv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1799 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1800 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1801
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1802 static PyObject *Qd_FrameRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1803 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1804 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1805 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1806 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1807 RgnHandle rgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1808 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1809 ResObj_Convert, &rgn))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1810 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1811 FrameRgn(rgn);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1812 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1813 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1814 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1815 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1816
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1817 static PyObject *Qd_PaintRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1818 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1819 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1820 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1821 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1822 RgnHandle rgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1823 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1824 ResObj_Convert, &rgn))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1825 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1826 PaintRgn(rgn);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1827 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1828 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1829 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1830 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1831
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1832 static PyObject *Qd_EraseRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1833 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1834 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1835 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1836 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1837 RgnHandle rgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1838 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1839 ResObj_Convert, &rgn))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1840 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1841 EraseRgn(rgn);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1842 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1843 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1844 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1845 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1846
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1847 static PyObject *Qd_InvertRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1848 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1849 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1850 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1851 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1852 RgnHandle rgn;
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1853 if (!PyArg_ParseTuple(_args, "O&",
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1854 ResObj_Convert, &rgn))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1855 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1856 InvertRgn(rgn);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1857 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1858 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1859 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1860 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1861
3308
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1862 static PyObject *Qd_FillRgn(_self, _args)
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1863 PyObject *_self;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1864 PyObject *_args;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1865 {
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1866 PyObject *_res = NULL;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1867 RgnHandle rgn;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1868 Pattern *pat__in__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1869 int pat__in_len__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1870 if (!PyArg_ParseTuple(_args, "O&s#",
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1871 ResObj_Convert, &rgn,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1872 (char **)&pat__in__, &pat__in_len__))
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1873 return NULL;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1874 if (pat__in_len__ != sizeof(Pattern))
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1875 {
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1876 PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)");
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1877 goto pat__error__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1878 }
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1879 FillRgn(rgn,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1880 pat__in__);
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1881 Py_INCREF(Py_None);
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1882 _res = Py_None;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1883 pat__error__: ;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1884 return _res;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1885 }
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
1886
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1887 static PyObject *Qd_ScrollRect(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1888 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1889 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1890 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1891 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1892 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1893 short dh;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1894 short dv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1895 RgnHandle updateRgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1896 if (!PyArg_ParseTuple(_args, "O&hhO&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1897 PyMac_GetRect, &r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1898 &dh,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1899 &dv,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1900 ResObj_Convert, &updateRgn))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1901 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1902 ScrollRect(&r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1903 dh,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1904 dv,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1905 updateRgn);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1906 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1907 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1908 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1909 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1910
3281
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1911 static PyObject *Qd_CopyBits(_self, _args)
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1912 PyObject *_self;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1913 PyObject *_args;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1914 {
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1915 PyObject *_res = NULL;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1916 BitMapPtr srcBits;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1917 BitMapPtr dstBits;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1918 Rect srcRect;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1919 Rect dstRect;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1920 short mode;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1921 RgnHandle maskRgn;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1922 if (!PyArg_ParseTuple(_args, "O&O&O&O&hO&",
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1923 BMObj_Convert, &srcBits,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1924 BMObj_Convert, &dstBits,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1925 PyMac_GetRect, &srcRect,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1926 PyMac_GetRect, &dstRect,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1927 &mode,
3295
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
1928 OptResObj_Convert, &maskRgn))
3281
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1929 return NULL;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1930 CopyBits(srcBits,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1931 dstBits,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1932 &srcRect,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1933 &dstRect,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1934 mode,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1935 maskRgn);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1936 Py_INCREF(Py_None);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1937 _res = Py_None;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1938 return _res;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1939 }
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1940
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1941 static PyObject *Qd_CopyMask(_self, _args)
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1942 PyObject *_self;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1943 PyObject *_args;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1944 {
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1945 PyObject *_res = NULL;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1946 BitMapPtr srcBits;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1947 BitMapPtr maskBits;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1948 BitMapPtr dstBits;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1949 Rect srcRect;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1950 Rect maskRect;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1951 Rect dstRect;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1952 if (!PyArg_ParseTuple(_args, "O&O&O&O&O&O&",
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1953 BMObj_Convert, &srcBits,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1954 BMObj_Convert, &maskBits,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1955 BMObj_Convert, &dstBits,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1956 PyMac_GetRect, &srcRect,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1957 PyMac_GetRect, &maskRect,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1958 PyMac_GetRect, &dstRect))
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1959 return NULL;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1960 CopyMask(srcBits,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1961 maskBits,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1962 dstBits,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1963 &srcRect,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1964 &maskRect,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1965 &dstRect);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1966 Py_INCREF(Py_None);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1967 _res = Py_None;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1968 return _res;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1969 }
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
1970
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1971 static PyObject *Qd_OpenPicture(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1972 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1973 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1974 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1975 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1976 PicHandle _rv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1977 Rect picFrame;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1978 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1979 PyMac_GetRect, &picFrame))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1980 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1981 _rv = OpenPicture(&picFrame);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1982 _res = Py_BuildValue("O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1983 ResObj_New, _rv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1984 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1985 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1986
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1987 static PyObject *Qd_PicComment(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1988 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1989 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1990 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1991 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1992 short kind;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1993 short dataSize;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1994 Handle dataHandle;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1995 if (!PyArg_ParseTuple(_args, "hhO&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1996 &kind,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1997 &dataSize,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1998 ResObj_Convert, &dataHandle))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
1999 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2000 PicComment(kind,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2001 dataSize,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2002 dataHandle);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2003 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2004 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2005 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2006 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2007
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2008 static PyObject *Qd_ClosePicture(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2009 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2010 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2011 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2012 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2013 if (!PyArg_ParseTuple(_args, ""))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2014 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2015 ClosePicture();
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2016 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2017 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2018 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2019 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2020
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2021 static PyObject *Qd_DrawPicture(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2022 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2023 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2024 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2025 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2026 PicHandle myPicture;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2027 Rect dstRect;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2028 if (!PyArg_ParseTuple(_args, "O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2029 ResObj_Convert, &myPicture,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2030 PyMac_GetRect, &dstRect))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2031 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2032 DrawPicture(myPicture,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2033 &dstRect);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2034 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2035 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2036 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2037 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2038
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2039 static PyObject *Qd_KillPicture(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2040 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2041 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2042 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2043 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2044 PicHandle myPicture;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2045 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2046 ResObj_Convert, &myPicture))
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
2047 return NULL;
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2048 KillPicture(myPicture);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2049 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2050 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2051 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2052 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2053
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2054 static PyObject *Qd_OpenPoly(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2055 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2056 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2057 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2058 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2059 PolyHandle _rv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2060 if (!PyArg_ParseTuple(_args, ""))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2061 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2062 _rv = OpenPoly();
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2063 _res = Py_BuildValue("O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2064 ResObj_New, _rv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2065 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2066 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2067
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2068 static PyObject *Qd_ClosePoly(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2069 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2070 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2071 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2072 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2073 if (!PyArg_ParseTuple(_args, ""))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2074 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2075 ClosePoly();
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2076 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2077 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2078 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2079 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2080
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2081 static PyObject *Qd_KillPoly(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2082 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2083 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2084 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2085 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2086 PolyHandle poly;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2087 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2088 ResObj_Convert, &poly))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2089 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2090 KillPoly(poly);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2091 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2092 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2093 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2094 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2095
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2096 static PyObject *Qd_OffsetPoly(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2097 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2098 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2099 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2100 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2101 PolyHandle poly;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2102 short dh;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2103 short dv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2104 if (!PyArg_ParseTuple(_args, "O&hh",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2105 ResObj_Convert, &poly,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2106 &dh,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2107 &dv))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2108 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2109 OffsetPoly(poly,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2110 dh,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2111 dv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2112 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2113 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2114 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2115 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2116
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2117 static PyObject *Qd_FramePoly(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2118 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2119 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2120 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2121 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2122 PolyHandle poly;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2123 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2124 ResObj_Convert, &poly))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2125 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2126 FramePoly(poly);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2127 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2128 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2129 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2130 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2131
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2132 static PyObject *Qd_PaintPoly(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2133 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2134 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2135 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2136 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2137 PolyHandle poly;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2138 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2139 ResObj_Convert, &poly))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2140 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2141 PaintPoly(poly);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2142 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2143 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2144 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2145 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2146
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2147 static PyObject *Qd_ErasePoly(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2148 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2149 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2150 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2151 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2152 PolyHandle poly;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2153 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2154 ResObj_Convert, &poly))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2155 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2156 ErasePoly(poly);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2157 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2158 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2159 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2160 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2161
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2162 static PyObject *Qd_InvertPoly(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2163 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2164 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2165 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2166 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2167 PolyHandle poly;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2168 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2169 ResObj_Convert, &poly))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2170 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2171 InvertPoly(poly);
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
2172 Py_INCREF(Py_None);
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
2173 _res = Py_None;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
2174 return _res;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
2175 }
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
2176
3308
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2177 static PyObject *Qd_FillPoly(_self, _args)
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2178 PyObject *_self;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2179 PyObject *_args;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2180 {
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2181 PyObject *_res = NULL;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2182 PolyHandle poly;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2183 Pattern *pat__in__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2184 int pat__in_len__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2185 if (!PyArg_ParseTuple(_args, "O&s#",
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2186 ResObj_Convert, &poly,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2187 (char **)&pat__in__, &pat__in_len__))
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2188 return NULL;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2189 if (pat__in_len__ != sizeof(Pattern))
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2190 {
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2191 PyErr_SetString(PyExc_TypeError, "buffer length should be sizeof(Pattern)");
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2192 goto pat__error__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2193 }
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2194 FillPoly(poly,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2195 pat__in__);
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2196 Py_INCREF(Py_None);
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2197 _res = Py_None;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2198 pat__error__: ;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2199 return _res;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2200 }
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
2201
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2202 static PyObject *Qd_SetPt(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2203 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2204 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2205 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2206 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2207 Point pt;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2208 short h;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2209 short v;
3309
b828bccda189 Fixed GetPen and SetPt arguments
Jack Jansen <jack.jansen@cwi.nl>
parents: 3308
diff changeset
2210 if (!PyArg_ParseTuple(_args, "hh",
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2211 &h,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2212 &v))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2213 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2214 SetPt(&pt,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2215 h,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2216 v);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2217 _res = Py_BuildValue("O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2218 PyMac_BuildPoint, pt);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2219 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2220 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2221
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2222 static PyObject *Qd_LocalToGlobal(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2223 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2224 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2225 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2226 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2227 Point pt;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2228 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2229 PyMac_GetPoint, &pt))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2230 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2231 LocalToGlobal(&pt);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2232 _res = Py_BuildValue("O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2233 PyMac_BuildPoint, pt);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2234 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2235 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2236
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2237 static PyObject *Qd_GlobalToLocal(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2238 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2239 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2240 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2241 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2242 Point pt;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2243 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2244 PyMac_GetPoint, &pt))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2245 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2246 GlobalToLocal(&pt);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2247 _res = Py_BuildValue("O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2248 PyMac_BuildPoint, pt);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2249 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2250 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2251
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2252 static PyObject *Qd_Random(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2253 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2254 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2255 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2256 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2257 short _rv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2258 if (!PyArg_ParseTuple(_args, ""))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2259 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2260 _rv = Random();
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2261 _res = Py_BuildValue("h",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2262 _rv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2263 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2264 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2265
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2266 static PyObject *Qd_GetPixel(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2267 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2268 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2269 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2270 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2271 Boolean _rv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2272 short h;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2273 short v;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2274 if (!PyArg_ParseTuple(_args, "hh",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2275 &h,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2276 &v))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2277 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2278 _rv = GetPixel(h,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2279 v);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2280 _res = Py_BuildValue("b",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2281 _rv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2282 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2283 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2284
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2285 static PyObject *Qd_ScalePt(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2286 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2287 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2288 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2289 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2290 Point pt;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2291 Rect srcRect;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2292 Rect dstRect;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2293 if (!PyArg_ParseTuple(_args, "O&O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2294 PyMac_GetPoint, &pt,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2295 PyMac_GetRect, &srcRect,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2296 PyMac_GetRect, &dstRect))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2297 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2298 ScalePt(&pt,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2299 &srcRect,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2300 &dstRect);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2301 _res = Py_BuildValue("O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2302 PyMac_BuildPoint, pt);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2303 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2304 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2305
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2306 static PyObject *Qd_MapPt(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2307 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2308 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2309 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2310 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2311 Point pt;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2312 Rect srcRect;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2313 Rect dstRect;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2314 if (!PyArg_ParseTuple(_args, "O&O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2315 PyMac_GetPoint, &pt,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2316 PyMac_GetRect, &srcRect,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2317 PyMac_GetRect, &dstRect))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2318 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2319 MapPt(&pt,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2320 &srcRect,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2321 &dstRect);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2322 _res = Py_BuildValue("O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2323 PyMac_BuildPoint, pt);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2324 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2325 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2326
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2327 static PyObject *Qd_MapRect(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2328 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2329 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2330 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2331 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2332 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2333 Rect srcRect;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2334 Rect dstRect;
3267
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
2335 if (!PyArg_ParseTuple(_args, "O&O&O&",
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
2336 PyMac_GetRect, &r,
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2337 PyMac_GetRect, &srcRect,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2338 PyMac_GetRect, &dstRect))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2339 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2340 MapRect(&r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2341 &srcRect,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2342 &dstRect);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2343 _res = Py_BuildValue("O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2344 PyMac_BuildRect, &r);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2345 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2346 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2347
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2348 static PyObject *Qd_MapRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2349 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2350 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2351 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2352 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2353 RgnHandle rgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2354 Rect srcRect;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2355 Rect dstRect;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2356 if (!PyArg_ParseTuple(_args, "O&O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2357 ResObj_Convert, &rgn,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2358 PyMac_GetRect, &srcRect,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2359 PyMac_GetRect, &dstRect))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2360 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2361 MapRgn(rgn,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2362 &srcRect,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2363 &dstRect);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2364 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2365 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2366 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2367 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2368
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2369 static PyObject *Qd_MapPoly(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2370 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2371 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2372 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2373 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2374 PolyHandle poly;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2375 Rect srcRect;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2376 Rect dstRect;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2377 if (!PyArg_ParseTuple(_args, "O&O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2378 ResObj_Convert, &poly,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2379 PyMac_GetRect, &srcRect,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2380 PyMac_GetRect, &dstRect))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2381 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2382 MapPoly(poly,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2383 &srcRect,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2384 &dstRect);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2385 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2386 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2387 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2388 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2389
3281
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2390 static PyObject *Qd_StdBits(_self, _args)
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2391 PyObject *_self;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2392 PyObject *_args;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2393 {
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2394 PyObject *_res = NULL;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2395 BitMapPtr srcBits;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2396 Rect srcRect;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2397 Rect dstRect;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2398 short mode;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2399 RgnHandle maskRgn;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2400 if (!PyArg_ParseTuple(_args, "O&O&O&hO&",
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2401 BMObj_Convert, &srcBits,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2402 PyMac_GetRect, &srcRect,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2403 PyMac_GetRect, &dstRect,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2404 &mode,
3295
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
2405 OptResObj_Convert, &maskRgn))
3281
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2406 return NULL;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2407 StdBits(srcBits,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2408 &srcRect,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2409 &dstRect,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2410 mode,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2411 maskRgn);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2412 Py_INCREF(Py_None);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2413 _res = Py_None;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2414 return _res;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2415 }
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
2416
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2417 static PyObject *Qd_AddPt(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2418 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2419 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2420 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2421 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2422 Point src;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2423 Point dst;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2424 if (!PyArg_ParseTuple(_args, "O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2425 PyMac_GetPoint, &src,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2426 PyMac_GetPoint, &dst))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2427 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2428 AddPt(src,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2429 &dst);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2430 _res = Py_BuildValue("O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2431 PyMac_BuildPoint, dst);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2432 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2433 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2434
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2435 static PyObject *Qd_EqualPt(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2436 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2437 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2438 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2439 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2440 Boolean _rv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2441 Point pt1;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2442 Point pt2;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2443 if (!PyArg_ParseTuple(_args, "O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2444 PyMac_GetPoint, &pt1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2445 PyMac_GetPoint, &pt2))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2446 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2447 _rv = EqualPt(pt1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2448 pt2);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2449 _res = Py_BuildValue("b",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2450 _rv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2451 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2452 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2453
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2454 static PyObject *Qd_PtInRect(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2455 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2456 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2457 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2458 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2459 Boolean _rv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2460 Point pt;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2461 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2462 if (!PyArg_ParseTuple(_args, "O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2463 PyMac_GetPoint, &pt,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2464 PyMac_GetRect, &r))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2465 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2466 _rv = PtInRect(pt,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2467 &r);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2468 _res = Py_BuildValue("b",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2469 _rv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2470 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2471 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2472
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2473 static PyObject *Qd_Pt2Rect(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2474 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2475 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2476 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2477 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2478 Point pt1;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2479 Point pt2;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2480 Rect dstRect;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2481 if (!PyArg_ParseTuple(_args, "O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2482 PyMac_GetPoint, &pt1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2483 PyMac_GetPoint, &pt2))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2484 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2485 Pt2Rect(pt1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2486 pt2,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2487 &dstRect);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2488 _res = Py_BuildValue("O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2489 PyMac_BuildRect, &dstRect);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2490 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2491 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2492
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2493 static PyObject *Qd_PtToAngle(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2494 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2495 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2496 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2497 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2498 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2499 Point pt;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2500 short angle;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2501 if (!PyArg_ParseTuple(_args, "O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2502 PyMac_GetRect, &r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2503 PyMac_GetPoint, &pt))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2504 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2505 PtToAngle(&r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2506 pt,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2507 &angle);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2508 _res = Py_BuildValue("h",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2509 angle);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2510 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2511 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2512
2721
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
2513 static PyObject *Qd_SubPt(_self, _args)
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
2514 PyObject *_self;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
2515 PyObject *_args;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
2516 {
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
2517 PyObject *_res = NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
2518 Point src;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
2519 Point dst;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
2520 if (!PyArg_ParseTuple(_args, "O&O&",
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
2521 PyMac_GetPoint, &src,
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
2522 PyMac_GetPoint, &dst))
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
2523 return NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
2524 SubPt(src,
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
2525 &dst);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
2526 _res = Py_BuildValue("O&",
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
2527 PyMac_BuildPoint, dst);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
2528 return _res;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
2529 }
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
2530
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2531 static PyObject *Qd_PtInRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2532 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2533 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2534 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2535 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2536 Boolean _rv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2537 Point pt;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2538 RgnHandle rgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2539 if (!PyArg_ParseTuple(_args, "O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2540 PyMac_GetPoint, &pt,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2541 ResObj_Convert, &rgn))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2542 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2543 _rv = PtInRgn(pt,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2544 rgn);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2545 _res = Py_BuildValue("b",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2546 _rv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2547 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2548 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2549
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2550 static PyObject *Qd_NewPixMap(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2551 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2552 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2553 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2554 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2555 PixMapHandle _rv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2556 if (!PyArg_ParseTuple(_args, ""))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2557 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2558 _rv = NewPixMap();
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2559 _res = Py_BuildValue("O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2560 ResObj_New, _rv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2561 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2562 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2563
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2564 static PyObject *Qd_DisposePixMap(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2565 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2566 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2567 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2568 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2569 PixMapHandle pm;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2570 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2571 ResObj_Convert, &pm))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2572 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2573 DisposePixMap(pm);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2574 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2575 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2576 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2577 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2578
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2579 static PyObject *Qd_CopyPixMap(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2580 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2581 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2582 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2583 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2584 PixMapHandle srcPM;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2585 PixMapHandle dstPM;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2586 if (!PyArg_ParseTuple(_args, "O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2587 ResObj_Convert, &srcPM,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2588 ResObj_Convert, &dstPM))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2589 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2590 CopyPixMap(srcPM,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2591 dstPM);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2592 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2593 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2594 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2595 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2596
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2597 static PyObject *Qd_NewPixPat(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2598 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2599 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2600 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2601 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2602 PixPatHandle _rv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2603 if (!PyArg_ParseTuple(_args, ""))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2604 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2605 _rv = NewPixPat();
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2606 _res = Py_BuildValue("O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2607 ResObj_New, _rv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2608 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2609 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2610
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2611 static PyObject *Qd_DisposePixPat(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2612 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2613 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2614 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2615 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2616 PixPatHandle pp;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2617 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2618 ResObj_Convert, &pp))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2619 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2620 DisposePixPat(pp);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2621 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2622 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2623 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2624 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2625
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2626 static PyObject *Qd_CopyPixPat(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2627 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2628 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2629 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2630 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2631 PixPatHandle srcPP;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2632 PixPatHandle dstPP;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2633 if (!PyArg_ParseTuple(_args, "O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2634 ResObj_Convert, &srcPP,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2635 ResObj_Convert, &dstPP))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2636 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2637 CopyPixPat(srcPP,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2638 dstPP);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2639 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2640 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2641 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2642 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2643
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2644 static PyObject *Qd_PenPixPat(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2645 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2646 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2647 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2648 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2649 PixPatHandle pp;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2650 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2651 ResObj_Convert, &pp))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2652 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2653 PenPixPat(pp);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2654 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2655 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2656 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2657 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2658
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2659 static PyObject *Qd_BackPixPat(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2660 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2661 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2662 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2663 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2664 PixPatHandle pp;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2665 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2666 ResObj_Convert, &pp))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2667 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2668 BackPixPat(pp);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2669 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2670 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2671 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2672 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2673
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2674 static PyObject *Qd_GetPixPat(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2675 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2676 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2677 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2678 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2679 PixPatHandle _rv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2680 short patID;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2681 if (!PyArg_ParseTuple(_args, "h",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2682 &patID))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2683 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2684 _rv = GetPixPat(patID);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2685 _res = Py_BuildValue("O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2686 ResObj_New, _rv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2687 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2688 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2689
3292
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2690 static PyObject *Qd_MakeRGBPat(_self, _args)
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2691 PyObject *_self;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2692 PyObject *_args;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2693 {
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2694 PyObject *_res = NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2695 PixPatHandle pp;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2696 RGBColor myColor;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2697 if (!PyArg_ParseTuple(_args, "O&O&",
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2698 ResObj_Convert, &pp,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2699 QdRGB_Convert, &myColor))
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2700 return NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2701 MakeRGBPat(pp,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2702 &myColor);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2703 Py_INCREF(Py_None);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2704 _res = Py_None;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2705 return _res;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2706 }
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2707
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2708 static PyObject *Qd_FillCRect(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2709 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2710 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2711 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2712 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2713 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2714 PixPatHandle pp;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2715 if (!PyArg_ParseTuple(_args, "O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2716 PyMac_GetRect, &r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2717 ResObj_Convert, &pp))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2718 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2719 FillCRect(&r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2720 pp);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2721 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2722 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2723 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2724 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2725
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2726 static PyObject *Qd_FillCOval(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2727 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2728 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2729 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2730 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2731 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2732 PixPatHandle pp;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2733 if (!PyArg_ParseTuple(_args, "O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2734 PyMac_GetRect, &r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2735 ResObj_Convert, &pp))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2736 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2737 FillCOval(&r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2738 pp);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2739 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2740 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2741 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2742 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2743
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2744 static PyObject *Qd_FillCRoundRect(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2745 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2746 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2747 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2748 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2749 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2750 short ovalWidth;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2751 short ovalHeight;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2752 PixPatHandle pp;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2753 if (!PyArg_ParseTuple(_args, "O&hhO&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2754 PyMac_GetRect, &r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2755 &ovalWidth,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2756 &ovalHeight,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2757 ResObj_Convert, &pp))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2758 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2759 FillCRoundRect(&r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2760 ovalWidth,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2761 ovalHeight,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2762 pp);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2763 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2764 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2765 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2766 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2767
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2768 static PyObject *Qd_FillCArc(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2769 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2770 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2771 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2772 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2773 Rect r;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2774 short startAngle;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2775 short arcAngle;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2776 PixPatHandle pp;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2777 if (!PyArg_ParseTuple(_args, "O&hhO&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2778 PyMac_GetRect, &r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2779 &startAngle,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2780 &arcAngle,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2781 ResObj_Convert, &pp))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2782 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2783 FillCArc(&r,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2784 startAngle,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2785 arcAngle,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2786 pp);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2787 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2788 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2789 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2790 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2791
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2792 static PyObject *Qd_FillCRgn(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2793 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2794 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2795 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2796 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2797 RgnHandle rgn;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2798 PixPatHandle pp;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2799 if (!PyArg_ParseTuple(_args, "O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2800 ResObj_Convert, &rgn,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2801 ResObj_Convert, &pp))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2802 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2803 FillCRgn(rgn,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2804 pp);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2805 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2806 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2807 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2808 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2809
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2810 static PyObject *Qd_FillCPoly(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2811 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2812 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2813 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2814 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2815 PolyHandle poly;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2816 PixPatHandle pp;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2817 if (!PyArg_ParseTuple(_args, "O&O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2818 ResObj_Convert, &poly,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2819 ResObj_Convert, &pp))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2820 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2821 FillCPoly(poly,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2822 pp);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2823 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2824 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2825 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2826 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2827
3292
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2828 static PyObject *Qd_RGBForeColor(_self, _args)
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2829 PyObject *_self;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2830 PyObject *_args;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2831 {
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2832 PyObject *_res = NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2833 RGBColor color;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2834 if (!PyArg_ParseTuple(_args, "O&",
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2835 QdRGB_Convert, &color))
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2836 return NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2837 RGBForeColor(&color);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2838 Py_INCREF(Py_None);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2839 _res = Py_None;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2840 return _res;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2841 }
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2842
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2843 static PyObject *Qd_RGBBackColor(_self, _args)
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2844 PyObject *_self;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2845 PyObject *_args;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2846 {
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2847 PyObject *_res = NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2848 RGBColor color;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2849 if (!PyArg_ParseTuple(_args, "O&",
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2850 QdRGB_Convert, &color))
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2851 return NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2852 RGBBackColor(&color);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2853 Py_INCREF(Py_None);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2854 _res = Py_None;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2855 return _res;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2856 }
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2857
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2858 static PyObject *Qd_SetCPixel(_self, _args)
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2859 PyObject *_self;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2860 PyObject *_args;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2861 {
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2862 PyObject *_res = NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2863 short h;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2864 short v;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2865 RGBColor cPix;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2866 if (!PyArg_ParseTuple(_args, "hhO&",
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2867 &h,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2868 &v,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2869 QdRGB_Convert, &cPix))
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2870 return NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2871 SetCPixel(h,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2872 v,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2873 &cPix);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2874 Py_INCREF(Py_None);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2875 _res = Py_None;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2876 return _res;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2877 }
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2878
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2879 static PyObject *Qd_SetPortPix(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2880 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2881 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2882 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2883 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2884 PixMapHandle pm;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2885 if (!PyArg_ParseTuple(_args, "O&",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2886 ResObj_Convert, &pm))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2887 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2888 SetPortPix(pm);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2889 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2890 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2891 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2892 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2893
3292
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2894 static PyObject *Qd_GetCPixel(_self, _args)
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2895 PyObject *_self;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2896 PyObject *_args;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2897 {
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2898 PyObject *_res = NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2899 short h;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2900 short v;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2901 RGBColor cPix;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2902 if (!PyArg_ParseTuple(_args, "hh",
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2903 &h,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2904 &v))
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2905 return NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2906 GetCPixel(h,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2907 v,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2908 &cPix);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2909 _res = Py_BuildValue("O&",
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2910 QdRGB_New, &cPix);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2911 return _res;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2912 }
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2913
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2914 static PyObject *Qd_GetForeColor(_self, _args)
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2915 PyObject *_self;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2916 PyObject *_args;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2917 {
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2918 PyObject *_res = NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2919 RGBColor color;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2920 if (!PyArg_ParseTuple(_args, ""))
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2921 return NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2922 GetForeColor(&color);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2923 _res = Py_BuildValue("O&",
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2924 QdRGB_New, &color);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2925 return _res;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2926 }
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2927
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2928 static PyObject *Qd_GetBackColor(_self, _args)
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2929 PyObject *_self;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2930 PyObject *_args;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2931 {
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2932 PyObject *_res = NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2933 RGBColor color;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2934 if (!PyArg_ParseTuple(_args, ""))
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2935 return NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2936 GetBackColor(&color);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2937 _res = Py_BuildValue("O&",
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2938 QdRGB_New, &color);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2939 return _res;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2940 }
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2941
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2942 static PyObject *Qd_OpColor(_self, _args)
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2943 PyObject *_self;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2944 PyObject *_args;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2945 {
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2946 PyObject *_res = NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2947 RGBColor color;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2948 if (!PyArg_ParseTuple(_args, "O&",
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2949 QdRGB_Convert, &color))
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2950 return NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2951 OpColor(&color);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2952 Py_INCREF(Py_None);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2953 _res = Py_None;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2954 return _res;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2955 }
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2956
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2957 static PyObject *Qd_HiliteColor(_self, _args)
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2958 PyObject *_self;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2959 PyObject *_args;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2960 {
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2961 PyObject *_res = NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2962 RGBColor color;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2963 if (!PyArg_ParseTuple(_args, "O&",
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2964 QdRGB_Convert, &color))
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2965 return NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2966 HiliteColor(&color);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2967 Py_INCREF(Py_None);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2968 _res = Py_None;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2969 return _res;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2970 }
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2971
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2972 static PyObject *Qd_AllocCursor(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2973 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2974 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2975 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2976 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2977 if (!PyArg_ParseTuple(_args, ""))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2978 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2979 AllocCursor();
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2980 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2981 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2982 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2983 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2984
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2985 static PyObject *Qd_GetCTSeed(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2986 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2987 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2988 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2989 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2990 long _rv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2991 if (!PyArg_ParseTuple(_args, ""))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2992 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2993 _rv = GetCTSeed();
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2994 _res = Py_BuildValue("l",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2995 _rv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2996 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2997 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
2998
3292
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
2999 static PyObject *Qd_Color2Index(_self, _args)
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3000 PyObject *_self;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3001 PyObject *_args;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3002 {
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3003 PyObject *_res = NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3004 long _rv;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3005 RGBColor myColor;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3006 if (!PyArg_ParseTuple(_args, "O&",
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3007 QdRGB_Convert, &myColor))
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3008 return NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3009 _rv = Color2Index(&myColor);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3010 _res = Py_BuildValue("l",
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3011 _rv);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3012 return _res;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3013 }
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3014
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3015 static PyObject *Qd_Index2Color(_self, _args)
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3016 PyObject *_self;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3017 PyObject *_args;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3018 {
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3019 PyObject *_res = NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3020 long index;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3021 RGBColor aColor;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3022 if (!PyArg_ParseTuple(_args, "l",
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3023 &index))
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3024 return NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3025 Index2Color(index,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3026 &aColor);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3027 _res = Py_BuildValue("O&",
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3028 QdRGB_New, &aColor);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3029 return _res;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3030 }
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3031
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3032 static PyObject *Qd_InvertColor(_self, _args)
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3033 PyObject *_self;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3034 PyObject *_args;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3035 {
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3036 PyObject *_res = NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3037 RGBColor myColor;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3038 if (!PyArg_ParseTuple(_args, ""))
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3039 return NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3040 InvertColor(&myColor);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3041 _res = Py_BuildValue("O&",
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3042 QdRGB_New, &myColor);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3043 return _res;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3044 }
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3045
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3046 static PyObject *Qd_RealColor(_self, _args)
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3047 PyObject *_self;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3048 PyObject *_args;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3049 {
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3050 PyObject *_res = NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3051 Boolean _rv;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3052 RGBColor color;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3053 if (!PyArg_ParseTuple(_args, "O&",
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3054 QdRGB_Convert, &color))
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3055 return NULL;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3056 _rv = RealColor(&color);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3057 _res = Py_BuildValue("b",
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3058 _rv);
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3059 return _res;
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3060 }
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3061
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3062 static PyObject *Qd_SetClientID(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3063 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3064 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3065 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3066 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3067 short id;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3068 if (!PyArg_ParseTuple(_args, "h",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3069 &id))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3070 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3071 SetClientID(id);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3072 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3073 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3074 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3075 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3076
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3077 static PyObject *Qd_ProtectEntry(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3078 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3079 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3080 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3081 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3082 short index;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3083 Boolean protect;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3084 if (!PyArg_ParseTuple(_args, "hb",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3085 &index,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3086 &protect))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3087 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3088 ProtectEntry(index,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3089 protect);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3090 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3091 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3092 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3093 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3094
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3095 static PyObject *Qd_ReserveEntry(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3096 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3097 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3098 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3099 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3100 short index;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3101 Boolean reserve;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3102 if (!PyArg_ParseTuple(_args, "hb",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3103 &index,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3104 &reserve))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3105 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3106 ReserveEntry(index,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3107 reserve);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3108 Py_INCREF(Py_None);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3109 _res = Py_None;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3110 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3111 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3112
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3113 static PyObject *Qd_QDError(_self, _args)
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3114 PyObject *_self;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3115 PyObject *_args;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3116 {
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3117 PyObject *_res = NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3118 short _rv;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3119 if (!PyArg_ParseTuple(_args, ""))
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3120 return NULL;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3121 _rv = QDError();
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3122 _res = Py_BuildValue("h",
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3123 _rv);
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3124 return _res;
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3125 }
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3126
3281
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3127 static PyObject *Qd_CopyDeepMask(_self, _args)
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3128 PyObject *_self;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3129 PyObject *_args;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3130 {
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3131 PyObject *_res = NULL;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3132 BitMapPtr srcBits;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3133 BitMapPtr maskBits;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3134 BitMapPtr dstBits;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3135 Rect srcRect;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3136 Rect maskRect;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3137 Rect dstRect;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3138 short mode;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3139 RgnHandle maskRgn;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3140 if (!PyArg_ParseTuple(_args, "O&O&O&O&O&O&hO&",
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3141 BMObj_Convert, &srcBits,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3142 BMObj_Convert, &maskBits,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3143 BMObj_Convert, &dstBits,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3144 PyMac_GetRect, &srcRect,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3145 PyMac_GetRect, &maskRect,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3146 PyMac_GetRect, &dstRect,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3147 &mode,
3295
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3148 OptResObj_Convert, &maskRgn))
3281
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3149 return NULL;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3150 CopyDeepMask(srcBits,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3151 maskBits,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3152 dstBits,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3153 &srcRect,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3154 &maskRect,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3155 &dstRect,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3156 mode,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3157 maskRgn);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3158 Py_INCREF(Py_None);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3159 _res = Py_None;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3160 return _res;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3161 }
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3162
3267
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3163 static PyObject *Qd_GetPattern(_self, _args)
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3164 PyObject *_self;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3165 PyObject *_args;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3166 {
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3167 PyObject *_res = NULL;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3168 PatHandle _rv;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3169 short patternID;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3170 if (!PyArg_ParseTuple(_args, "h",
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3171 &patternID))
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3172 return NULL;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3173 _rv = GetPattern(patternID);
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3174 _res = Py_BuildValue("O&",
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3175 ResObj_New, _rv);
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3176 return _res;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3177 }
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3178
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3179 static PyObject *Qd_GetCursor(_self, _args)
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3180 PyObject *_self;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3181 PyObject *_args;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3182 {
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3183 PyObject *_res = NULL;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3184 CursHandle _rv;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3185 short cursorID;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3186 if (!PyArg_ParseTuple(_args, "h",
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3187 &cursorID))
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3188 return NULL;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3189 _rv = GetCursor(cursorID);
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3190 _res = Py_BuildValue("O&",
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3191 ResObj_New, _rv);
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3192 return _res;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3193 }
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3194
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3195 static PyObject *Qd_GetPicture(_self, _args)
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3196 PyObject *_self;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3197 PyObject *_args;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3198 {
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3199 PyObject *_res = NULL;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3200 PicHandle _rv;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3201 short pictureID;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3202 if (!PyArg_ParseTuple(_args, "h",
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3203 &pictureID))
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3204 return NULL;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3205 _rv = GetPicture(pictureID);
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3206 _res = Py_BuildValue("O&",
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3207 ResObj_New, _rv);
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3208 return _res;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3209 }
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3210
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3211 static PyObject *Qd_DeltaPoint(_self, _args)
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3212 PyObject *_self;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3213 PyObject *_args;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3214 {
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3215 PyObject *_res = NULL;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3216 long _rv;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3217 Point ptA;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3218 Point ptB;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3219 if (!PyArg_ParseTuple(_args, "O&O&",
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3220 PyMac_GetPoint, &ptA,
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3221 PyMac_GetPoint, &ptB))
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3222 return NULL;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3223 _rv = DeltaPoint(ptA,
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3224 ptB);
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3225 _res = Py_BuildValue("l",
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3226 _rv);
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3227 return _res;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3228 }
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3229
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3230 static PyObject *Qd_ShieldCursor(_self, _args)
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3231 PyObject *_self;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3232 PyObject *_args;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3233 {
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3234 PyObject *_res = NULL;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3235 Rect shieldRect;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3236 Point offsetPt;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3237 if (!PyArg_ParseTuple(_args, "O&O&",
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3238 PyMac_GetRect, &shieldRect,
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3239 PyMac_GetPoint, &offsetPt))
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3240 return NULL;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3241 ShieldCursor(&shieldRect,
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3242 offsetPt);
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3243 Py_INCREF(Py_None);
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3244 _res = Py_None;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3245 return _res;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3246 }
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3247
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3248 static PyObject *Qd_ScreenRes(_self, _args)
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3249 PyObject *_self;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3250 PyObject *_args;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3251 {
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3252 PyObject *_res = NULL;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3253 short scrnHRes;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3254 short scrnVRes;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3255 if (!PyArg_ParseTuple(_args, ""))
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3256 return NULL;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3257 ScreenRes(&scrnHRes,
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3258 &scrnVRes);
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3259 _res = Py_BuildValue("hh",
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3260 scrnHRes,
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3261 scrnVRes);
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3262 return _res;
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3263 }
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3264
3308
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3265 static PyObject *Qd_GetIndPattern(_self, _args)
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3266 PyObject *_self;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3267 PyObject *_args;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3268 {
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3269 PyObject *_res = NULL;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3270 Pattern thePat__out__;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3271 short patternListID;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3272 short index;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3273 if (!PyArg_ParseTuple(_args, "hh",
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3274 &patternListID,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3275 &index))
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3276 return NULL;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3277 GetIndPattern(&thePat__out__,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3278 patternListID,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3279 index);
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3280 _res = Py_BuildValue("s#",
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3281 (char *)&thePat__out__, (int)sizeof(Pattern));
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3282 thePat__error__: ;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3283 return _res;
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3284 }
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3285
2721
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3286 static PyObject *Qd_TextFont(_self, _args)
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3287 PyObject *_self;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3288 PyObject *_args;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3289 {
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3290 PyObject *_res = NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3291 short font;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3292 if (!PyArg_ParseTuple(_args, "h",
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3293 &font))
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3294 return NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3295 TextFont(font);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3296 Py_INCREF(Py_None);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3297 _res = Py_None;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3298 return _res;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3299 }
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3300
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3301 static PyObject *Qd_TextFace(_self, _args)
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3302 PyObject *_self;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3303 PyObject *_args;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3304 {
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3305 PyObject *_res = NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3306 short face;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3307 if (!PyArg_ParseTuple(_args, "h",
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3308 &face))
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3309 return NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3310 TextFace(face);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3311 Py_INCREF(Py_None);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3312 _res = Py_None;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3313 return _res;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3314 }
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3315
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3316 static PyObject *Qd_TextMode(_self, _args)
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3317 PyObject *_self;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3318 PyObject *_args;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3319 {
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3320 PyObject *_res = NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3321 short mode;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3322 if (!PyArg_ParseTuple(_args, "h",
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3323 &mode))
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3324 return NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3325 TextMode(mode);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3326 Py_INCREF(Py_None);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3327 _res = Py_None;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3328 return _res;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3329 }
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3330
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3331 static PyObject *Qd_TextSize(_self, _args)
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3332 PyObject *_self;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3333 PyObject *_args;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3334 {
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3335 PyObject *_res = NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3336 short size;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3337 if (!PyArg_ParseTuple(_args, "h",
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3338 &size))
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3339 return NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3340 TextSize(size);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3341 Py_INCREF(Py_None);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3342 _res = Py_None;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3343 return _res;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3344 }
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3345
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3346 static PyObject *Qd_SpaceExtra(_self, _args)
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3347 PyObject *_self;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3348 PyObject *_args;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3349 {
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3350 PyObject *_res = NULL;
3276
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
3351 Fixed extra;
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
3352 if (!PyArg_ParseTuple(_args, "O&",
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
3353 PyMac_GetFixed, &extra))
2721
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3354 return NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3355 SpaceExtra(extra);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3356 Py_INCREF(Py_None);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3357 _res = Py_None;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3358 return _res;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3359 }
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3360
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3361 static PyObject *Qd_DrawChar(_self, _args)
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3362 PyObject *_self;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3363 PyObject *_args;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3364 {
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3365 PyObject *_res = NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3366 short ch;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3367 if (!PyArg_ParseTuple(_args, "h",
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3368 &ch))
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3369 return NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3370 DrawChar(ch);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3371 Py_INCREF(Py_None);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3372 _res = Py_None;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3373 return _res;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3374 }
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3375
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3376 static PyObject *Qd_DrawString(_self, _args)
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3377 PyObject *_self;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3378 PyObject *_args;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3379 {
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3380 PyObject *_res = NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3381 Str255 s;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3382 if (!PyArg_ParseTuple(_args, "O&",
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3383 PyMac_GetStr255, s))
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3384 return NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3385 DrawString(s);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3386 Py_INCREF(Py_None);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3387 _res = Py_None;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3388 return _res;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3389 }
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3390
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3391 static PyObject *Qd_DrawText(_self, _args)
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3392 PyObject *_self;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3393 PyObject *_args;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3394 {
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3395 PyObject *_res = NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3396 char *textBuf__in__;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3397 int textBuf__len__;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3398 int textBuf__in_len__;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3399 short firstByte;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3400 short byteCount;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3401 if (!PyArg_ParseTuple(_args, "s#hh",
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3402 &textBuf__in__, &textBuf__in_len__,
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3403 &firstByte,
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3404 &byteCount))
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3405 return NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3406 DrawText(textBuf__in__,
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3407 firstByte,
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3408 byteCount);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3409 Py_INCREF(Py_None);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3410 _res = Py_None;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3411 textBuf__error__: ;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3412 return _res;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3413 }
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3414
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3415 static PyObject *Qd_CharWidth(_self, _args)
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3416 PyObject *_self;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3417 PyObject *_args;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3418 {
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3419 PyObject *_res = NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3420 short _rv;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3421 short ch;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3422 if (!PyArg_ParseTuple(_args, "h",
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3423 &ch))
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3424 return NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3425 _rv = CharWidth(ch);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3426 _res = Py_BuildValue("h",
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3427 _rv);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3428 return _res;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3429 }
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3430
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3431 static PyObject *Qd_StringWidth(_self, _args)
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3432 PyObject *_self;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3433 PyObject *_args;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3434 {
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3435 PyObject *_res = NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3436 short _rv;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3437 Str255 s;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3438 if (!PyArg_ParseTuple(_args, "O&",
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3439 PyMac_GetStr255, s))
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3440 return NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3441 _rv = StringWidth(s);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3442 _res = Py_BuildValue("h",
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3443 _rv);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3444 return _res;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3445 }
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3446
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3447 static PyObject *Qd_TextWidth(_self, _args)
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3448 PyObject *_self;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3449 PyObject *_args;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3450 {
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3451 PyObject *_res = NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3452 short _rv;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3453 char *textBuf__in__;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3454 int textBuf__len__;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3455 int textBuf__in_len__;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3456 short firstByte;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3457 short byteCount;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3458 if (!PyArg_ParseTuple(_args, "s#hh",
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3459 &textBuf__in__, &textBuf__in_len__,
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3460 &firstByte,
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3461 &byteCount))
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3462 return NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3463 _rv = TextWidth(textBuf__in__,
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3464 firstByte,
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3465 byteCount);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3466 _res = Py_BuildValue("h",
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3467 _rv);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3468 textBuf__error__: ;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3469 return _res;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3470 }
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3471
3314
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
3472 static PyObject *Qd_GetFontInfo(_self, _args)
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
3473 PyObject *_self;
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
3474 PyObject *_args;
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
3475 {
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
3476 PyObject *_res = NULL;
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
3477 FontInfo info;
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
3478 if (!PyArg_ParseTuple(_args, ""))
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
3479 return NULL;
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
3480 GetFontInfo(&info);
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
3481 _res = Py_BuildValue("O&",
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
3482 QdFI_New, &info);
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
3483 return _res;
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
3484 }
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
3485
2721
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3486 static PyObject *Qd_CharExtra(_self, _args)
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3487 PyObject *_self;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3488 PyObject *_args;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3489 {
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3490 PyObject *_res = NULL;
3276
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
3491 Fixed extra;
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
3492 if (!PyArg_ParseTuple(_args, "O&",
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
3493 PyMac_GetFixed, &extra))
2721
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3494 return NULL;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3495 CharExtra(extra);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3496 Py_INCREF(Py_None);
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3497 _res = Py_None;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3498 return _res;
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3499 }
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3500
3281
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3501 static PyObject *Qd_BitMap(_self, _args)
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3502 PyObject *_self;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3503 PyObject *_args;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3504 {
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3505 PyObject *_res = NULL;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3506
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3507 BitMap *ptr;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3508 PyObject *source;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3509 Rect bounds;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3510 int rowbytes;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3511 char *data;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3512
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3513 if ( !PyArg_ParseTuple(_args, "O!iO&", &PyString_Type, &source, &rowbytes, PyMac_GetRect,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3514 &bounds) )
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3515 return NULL;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3516 data = PyString_AsString(source);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3517 if ((ptr=(BitMap *)malloc(sizeof(BitMap))) == NULL )
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3518 return PyErr_NoMemory();
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3519 ptr->baseAddr = (Ptr)data;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3520 ptr->rowBytes = rowbytes;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3521 ptr->bounds = bounds;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3522 if ( (_res = BMObj_New(ptr)) == NULL ) {
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3523 free(ptr);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3524 return NULL;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3525 }
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3526 ((BitMapObject *)_res)->referred_object = source;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3527 Py_INCREF(source);
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3528 ((BitMapObject *)_res)->referred_bitmap = ptr;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3529 return _res;
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3530
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3531 }
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3532
3295
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3533 static PyObject *Qd_RawBitMap(_self, _args)
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3534 PyObject *_self;
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3535 PyObject *_args;
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3536 {
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3537 PyObject *_res = NULL;
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3538
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3539 BitMap *ptr;
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3540 PyObject *source;
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3541
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3542 if ( !PyArg_ParseTuple(_args, "O!", &PyString_Type, &source) )
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3543 return NULL;
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3544 if ( PyString_Size(source) != sizeof(BitMap) && PyString_Size(source) != sizeof(PixMap) ) {
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3545 PyErr_BadArgument();
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3546 return NULL;
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3547 }
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3548 ptr = (BitMapPtr)PyString_AsString(source);
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3549 if ( (_res = BMObj_New(ptr)) == NULL ) {
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3550 return NULL;
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3551 }
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3552 ((BitMapObject *)_res)->referred_object = source;
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3553 Py_INCREF(source);
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3554 return _res;
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3555
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3556 }
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3557
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3558 static PyMethodDef Qd_methods[] = {
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3559 {"SetPort", (PyCFunction)Qd_SetPort, 1,
3276
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
3560 "(GrafPtr port) -> None"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3561 {"GetPort", (PyCFunction)Qd_GetPort, 1,
3276
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
3562 "() -> (GrafPtr port)"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3563 {"GrafDevice", (PyCFunction)Qd_GrafDevice, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3564 "(short device) -> None"},
3281
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3565 {"SetPortBits", (PyCFunction)Qd_SetPortBits, 1,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3566 "(BitMapPtr bm) -> None"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3567 {"PortSize", (PyCFunction)Qd_PortSize, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3568 "(short width, short height) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3569 {"MovePortTo", (PyCFunction)Qd_MovePortTo, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3570 "(short leftGlobal, short topGlobal) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3571 {"SetOrigin", (PyCFunction)Qd_SetOrigin, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3572 "(short h, short v) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3573 {"SetClip", (PyCFunction)Qd_SetClip, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3574 "(RgnHandle rgn) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3575 {"GetClip", (PyCFunction)Qd_GetClip, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3576 "(RgnHandle rgn) -> None"},
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3577 {"ClipRect", (PyCFunction)Qd_ClipRect, 1,
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3578 "(Rect r) -> None"},
3308
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3579 {"BackPat", (PyCFunction)Qd_BackPat, 1,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3580 "(Pattern pat) -> None"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3581 {"InitCursor", (PyCFunction)Qd_InitCursor, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3582 "() -> None"},
3307
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
3583 {"SetCursor", (PyCFunction)Qd_SetCursor, 1,
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
3584 "(Cursor crsr) -> None"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3585 {"HideCursor", (PyCFunction)Qd_HideCursor, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3586 "() -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3587 {"ShowCursor", (PyCFunction)Qd_ShowCursor, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3588 "() -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3589 {"ObscureCursor", (PyCFunction)Qd_ObscureCursor, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3590 "() -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3591 {"HidePen", (PyCFunction)Qd_HidePen, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3592 "() -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3593 {"ShowPen", (PyCFunction)Qd_ShowPen, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3594 "() -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3595 {"GetPen", (PyCFunction)Qd_GetPen, 1,
3309
b828bccda189 Fixed GetPen and SetPt arguments
Jack Jansen <jack.jansen@cwi.nl>
parents: 3308
diff changeset
3596 "() -> (Point pt)"},
3308
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3597 {"GetPenState", (PyCFunction)Qd_GetPenState, 1,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3598 "() -> (PenState pnState)"},
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3599 {"SetPenState", (PyCFunction)Qd_SetPenState, 1,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3600 "(PenState pnState) -> None"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3601 {"PenSize", (PyCFunction)Qd_PenSize, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3602 "(short width, short height) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3603 {"PenMode", (PyCFunction)Qd_PenMode, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3604 "(short mode) -> None"},
3308
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3605 {"PenPat", (PyCFunction)Qd_PenPat, 1,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3606 "(Pattern pat) -> None"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3607 {"PenNormal", (PyCFunction)Qd_PenNormal, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3608 "() -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3609 {"MoveTo", (PyCFunction)Qd_MoveTo, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3610 "(short h, short v) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3611 {"Move", (PyCFunction)Qd_Move, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3612 "(short dh, short dv) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3613 {"LineTo", (PyCFunction)Qd_LineTo, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3614 "(short h, short v) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3615 {"Line", (PyCFunction)Qd_Line, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3616 "(short dh, short dv) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3617 {"ForeColor", (PyCFunction)Qd_ForeColor, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3618 "(long color) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3619 {"BackColor", (PyCFunction)Qd_BackColor, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3620 "(long color) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3621 {"ColorBit", (PyCFunction)Qd_ColorBit, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3622 "(short whichBit) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3623 {"SetRect", (PyCFunction)Qd_SetRect, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3624 "(short left, short top, short right, short bottom) -> (Rect r)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3625 {"OffsetRect", (PyCFunction)Qd_OffsetRect, 1,
3267
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3626 "(Rect r, short dh, short dv) -> (Rect r)"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3627 {"InsetRect", (PyCFunction)Qd_InsetRect, 1,
3267
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3628 "(Rect r, short dh, short dv) -> (Rect r)"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3629 {"SectRect", (PyCFunction)Qd_SectRect, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3630 "(Rect src1, Rect src2) -> (Boolean _rv, Rect dstRect)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3631 {"UnionRect", (PyCFunction)Qd_UnionRect, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3632 "(Rect src1, Rect src2) -> (Rect dstRect)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3633 {"EqualRect", (PyCFunction)Qd_EqualRect, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3634 "(Rect rect1, Rect rect2) -> (Boolean _rv)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3635 {"EmptyRect", (PyCFunction)Qd_EmptyRect, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3636 "(Rect r) -> (Boolean _rv)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3637 {"FrameRect", (PyCFunction)Qd_FrameRect, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3638 "(Rect r) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3639 {"PaintRect", (PyCFunction)Qd_PaintRect, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3640 "(Rect r) -> None"},
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3641 {"EraseRect", (PyCFunction)Qd_EraseRect, 1,
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3642 "(Rect r) -> None"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3643 {"InvertRect", (PyCFunction)Qd_InvertRect, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3644 "(Rect r) -> None"},
3308
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3645 {"FillRect", (PyCFunction)Qd_FillRect, 1,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3646 "(Rect r, Pattern pat) -> None"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3647 {"FrameOval", (PyCFunction)Qd_FrameOval, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3648 "(Rect r) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3649 {"PaintOval", (PyCFunction)Qd_PaintOval, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3650 "(Rect r) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3651 {"EraseOval", (PyCFunction)Qd_EraseOval, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3652 "(Rect r) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3653 {"InvertOval", (PyCFunction)Qd_InvertOval, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3654 "(Rect r) -> None"},
3308
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3655 {"FillOval", (PyCFunction)Qd_FillOval, 1,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3656 "(Rect r, Pattern pat) -> None"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3657 {"FrameRoundRect", (PyCFunction)Qd_FrameRoundRect, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3658 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3659 {"PaintRoundRect", (PyCFunction)Qd_PaintRoundRect, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3660 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3661 {"EraseRoundRect", (PyCFunction)Qd_EraseRoundRect, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3662 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3663 {"InvertRoundRect", (PyCFunction)Qd_InvertRoundRect, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3664 "(Rect r, short ovalWidth, short ovalHeight) -> None"},
3308
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3665 {"FillRoundRect", (PyCFunction)Qd_FillRoundRect, 1,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3666 "(Rect r, short ovalWidth, short ovalHeight, Pattern pat) -> None"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3667 {"FrameArc", (PyCFunction)Qd_FrameArc, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3668 "(Rect r, short startAngle, short arcAngle) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3669 {"PaintArc", (PyCFunction)Qd_PaintArc, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3670 "(Rect r, short startAngle, short arcAngle) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3671 {"EraseArc", (PyCFunction)Qd_EraseArc, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3672 "(Rect r, short startAngle, short arcAngle) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3673 {"InvertArc", (PyCFunction)Qd_InvertArc, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3674 "(Rect r, short startAngle, short arcAngle) -> None"},
3308
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3675 {"FillArc", (PyCFunction)Qd_FillArc, 1,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3676 "(Rect r, short startAngle, short arcAngle, Pattern pat) -> None"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3677 {"NewRgn", (PyCFunction)Qd_NewRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3678 "() -> (RgnHandle _rv)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3679 {"OpenRgn", (PyCFunction)Qd_OpenRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3680 "() -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3681 {"CloseRgn", (PyCFunction)Qd_CloseRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3682 "(RgnHandle dstRgn) -> None"},
3281
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3683 {"BitMapToRegion", (PyCFunction)Qd_BitMapToRegion, 1,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3684 "(RgnHandle region, BitMapPtr bMap) -> None"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3685 {"DisposeRgn", (PyCFunction)Qd_DisposeRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3686 "(RgnHandle rgn) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3687 {"CopyRgn", (PyCFunction)Qd_CopyRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3688 "(RgnHandle srcRgn, RgnHandle dstRgn) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3689 {"SetEmptyRgn", (PyCFunction)Qd_SetEmptyRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3690 "(RgnHandle rgn) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3691 {"SetRectRgn", (PyCFunction)Qd_SetRectRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3692 "(RgnHandle rgn, short left, short top, short right, short bottom) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3693 {"RectRgn", (PyCFunction)Qd_RectRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3694 "(RgnHandle rgn, Rect r) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3695 {"OffsetRgn", (PyCFunction)Qd_OffsetRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3696 "(RgnHandle rgn, short dh, short dv) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3697 {"InsetRgn", (PyCFunction)Qd_InsetRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3698 "(RgnHandle rgn, short dh, short dv) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3699 {"SectRgn", (PyCFunction)Qd_SectRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3700 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3701 {"UnionRgn", (PyCFunction)Qd_UnionRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3702 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3703 {"DiffRgn", (PyCFunction)Qd_DiffRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3704 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3705 {"XorRgn", (PyCFunction)Qd_XorRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3706 "(RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3707 {"RectInRgn", (PyCFunction)Qd_RectInRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3708 "(Rect r, RgnHandle rgn) -> (Boolean _rv)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3709 {"EqualRgn", (PyCFunction)Qd_EqualRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3710 "(RgnHandle rgnA, RgnHandle rgnB) -> (Boolean _rv)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3711 {"EmptyRgn", (PyCFunction)Qd_EmptyRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3712 "(RgnHandle rgn) -> (Boolean _rv)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3713 {"FrameRgn", (PyCFunction)Qd_FrameRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3714 "(RgnHandle rgn) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3715 {"PaintRgn", (PyCFunction)Qd_PaintRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3716 "(RgnHandle rgn) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3717 {"EraseRgn", (PyCFunction)Qd_EraseRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3718 "(RgnHandle rgn) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3719 {"InvertRgn", (PyCFunction)Qd_InvertRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3720 "(RgnHandle rgn) -> None"},
3308
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3721 {"FillRgn", (PyCFunction)Qd_FillRgn, 1,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3722 "(RgnHandle rgn, Pattern pat) -> None"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3723 {"ScrollRect", (PyCFunction)Qd_ScrollRect, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3724 "(Rect r, short dh, short dv, RgnHandle updateRgn) -> None"},
3281
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3725 {"CopyBits", (PyCFunction)Qd_CopyBits, 1,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3726 "(BitMapPtr srcBits, BitMapPtr dstBits, Rect srcRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None"},
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3727 {"CopyMask", (PyCFunction)Qd_CopyMask, 1,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3728 "(BitMapPtr srcBits, BitMapPtr maskBits, BitMapPtr dstBits, Rect srcRect, Rect maskRect, Rect dstRect) -> None"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3729 {"OpenPicture", (PyCFunction)Qd_OpenPicture, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3730 "(Rect picFrame) -> (PicHandle _rv)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3731 {"PicComment", (PyCFunction)Qd_PicComment, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3732 "(short kind, short dataSize, Handle dataHandle) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3733 {"ClosePicture", (PyCFunction)Qd_ClosePicture, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3734 "() -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3735 {"DrawPicture", (PyCFunction)Qd_DrawPicture, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3736 "(PicHandle myPicture, Rect dstRect) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3737 {"KillPicture", (PyCFunction)Qd_KillPicture, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3738 "(PicHandle myPicture) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3739 {"OpenPoly", (PyCFunction)Qd_OpenPoly, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3740 "() -> (PolyHandle _rv)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3741 {"ClosePoly", (PyCFunction)Qd_ClosePoly, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3742 "() -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3743 {"KillPoly", (PyCFunction)Qd_KillPoly, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3744 "(PolyHandle poly) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3745 {"OffsetPoly", (PyCFunction)Qd_OffsetPoly, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3746 "(PolyHandle poly, short dh, short dv) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3747 {"FramePoly", (PyCFunction)Qd_FramePoly, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3748 "(PolyHandle poly) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3749 {"PaintPoly", (PyCFunction)Qd_PaintPoly, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3750 "(PolyHandle poly) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3751 {"ErasePoly", (PyCFunction)Qd_ErasePoly, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3752 "(PolyHandle poly) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3753 {"InvertPoly", (PyCFunction)Qd_InvertPoly, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3754 "(PolyHandle poly) -> None"},
3308
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3755 {"FillPoly", (PyCFunction)Qd_FillPoly, 1,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3756 "(PolyHandle poly, Pattern pat) -> None"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3757 {"SetPt", (PyCFunction)Qd_SetPt, 1,
3309
b828bccda189 Fixed GetPen and SetPt arguments
Jack Jansen <jack.jansen@cwi.nl>
parents: 3308
diff changeset
3758 "(short h, short v) -> (Point pt)"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3759 {"LocalToGlobal", (PyCFunction)Qd_LocalToGlobal, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3760 "(Point pt) -> (Point pt)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3761 {"GlobalToLocal", (PyCFunction)Qd_GlobalToLocal, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3762 "(Point pt) -> (Point pt)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3763 {"Random", (PyCFunction)Qd_Random, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3764 "() -> (short _rv)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3765 {"GetPixel", (PyCFunction)Qd_GetPixel, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3766 "(short h, short v) -> (Boolean _rv)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3767 {"ScalePt", (PyCFunction)Qd_ScalePt, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3768 "(Point pt, Rect srcRect, Rect dstRect) -> (Point pt)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3769 {"MapPt", (PyCFunction)Qd_MapPt, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3770 "(Point pt, Rect srcRect, Rect dstRect) -> (Point pt)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3771 {"MapRect", (PyCFunction)Qd_MapRect, 1,
3267
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3772 "(Rect r, Rect srcRect, Rect dstRect) -> (Rect r)"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3773 {"MapRgn", (PyCFunction)Qd_MapRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3774 "(RgnHandle rgn, Rect srcRect, Rect dstRect) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3775 {"MapPoly", (PyCFunction)Qd_MapPoly, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3776 "(PolyHandle poly, Rect srcRect, Rect dstRect) -> None"},
3281
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3777 {"StdBits", (PyCFunction)Qd_StdBits, 1,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3778 "(BitMapPtr srcBits, Rect srcRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3779 {"AddPt", (PyCFunction)Qd_AddPt, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3780 "(Point src, Point dst) -> (Point dst)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3781 {"EqualPt", (PyCFunction)Qd_EqualPt, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3782 "(Point pt1, Point pt2) -> (Boolean _rv)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3783 {"PtInRect", (PyCFunction)Qd_PtInRect, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3784 "(Point pt, Rect r) -> (Boolean _rv)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3785 {"Pt2Rect", (PyCFunction)Qd_Pt2Rect, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3786 "(Point pt1, Point pt2) -> (Rect dstRect)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3787 {"PtToAngle", (PyCFunction)Qd_PtToAngle, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3788 "(Rect r, Point pt) -> (short angle)"},
2721
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3789 {"SubPt", (PyCFunction)Qd_SubPt, 1,
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3790 "(Point src, Point dst) -> (Point dst)"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3791 {"PtInRgn", (PyCFunction)Qd_PtInRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3792 "(Point pt, RgnHandle rgn) -> (Boolean _rv)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3793 {"NewPixMap", (PyCFunction)Qd_NewPixMap, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3794 "() -> (PixMapHandle _rv)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3795 {"DisposePixMap", (PyCFunction)Qd_DisposePixMap, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3796 "(PixMapHandle pm) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3797 {"CopyPixMap", (PyCFunction)Qd_CopyPixMap, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3798 "(PixMapHandle srcPM, PixMapHandle dstPM) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3799 {"NewPixPat", (PyCFunction)Qd_NewPixPat, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3800 "() -> (PixPatHandle _rv)"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3801 {"DisposePixPat", (PyCFunction)Qd_DisposePixPat, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3802 "(PixPatHandle pp) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3803 {"CopyPixPat", (PyCFunction)Qd_CopyPixPat, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3804 "(PixPatHandle srcPP, PixPatHandle dstPP) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3805 {"PenPixPat", (PyCFunction)Qd_PenPixPat, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3806 "(PixPatHandle pp) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3807 {"BackPixPat", (PyCFunction)Qd_BackPixPat, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3808 "(PixPatHandle pp) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3809 {"GetPixPat", (PyCFunction)Qd_GetPixPat, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3810 "(short patID) -> (PixPatHandle _rv)"},
3292
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3811 {"MakeRGBPat", (PyCFunction)Qd_MakeRGBPat, 1,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3812 "(PixPatHandle pp, RGBColor myColor) -> None"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3813 {"FillCRect", (PyCFunction)Qd_FillCRect, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3814 "(Rect r, PixPatHandle pp) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3815 {"FillCOval", (PyCFunction)Qd_FillCOval, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3816 "(Rect r, PixPatHandle pp) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3817 {"FillCRoundRect", (PyCFunction)Qd_FillCRoundRect, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3818 "(Rect r, short ovalWidth, short ovalHeight, PixPatHandle pp) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3819 {"FillCArc", (PyCFunction)Qd_FillCArc, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3820 "(Rect r, short startAngle, short arcAngle, PixPatHandle pp) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3821 {"FillCRgn", (PyCFunction)Qd_FillCRgn, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3822 "(RgnHandle rgn, PixPatHandle pp) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3823 {"FillCPoly", (PyCFunction)Qd_FillCPoly, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3824 "(PolyHandle poly, PixPatHandle pp) -> None"},
3292
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3825 {"RGBForeColor", (PyCFunction)Qd_RGBForeColor, 1,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3826 "(RGBColor color) -> None"},
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3827 {"RGBBackColor", (PyCFunction)Qd_RGBBackColor, 1,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3828 "(RGBColor color) -> None"},
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3829 {"SetCPixel", (PyCFunction)Qd_SetCPixel, 1,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3830 "(short h, short v, RGBColor cPix) -> None"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3831 {"SetPortPix", (PyCFunction)Qd_SetPortPix, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3832 "(PixMapHandle pm) -> None"},
3292
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3833 {"GetCPixel", (PyCFunction)Qd_GetCPixel, 1,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3834 "(short h, short v) -> (RGBColor cPix)"},
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3835 {"GetForeColor", (PyCFunction)Qd_GetForeColor, 1,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3836 "() -> (RGBColor color)"},
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3837 {"GetBackColor", (PyCFunction)Qd_GetBackColor, 1,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3838 "() -> (RGBColor color)"},
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3839 {"OpColor", (PyCFunction)Qd_OpColor, 1,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3840 "(RGBColor color) -> None"},
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3841 {"HiliteColor", (PyCFunction)Qd_HiliteColor, 1,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3842 "(RGBColor color) -> None"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3843 {"AllocCursor", (PyCFunction)Qd_AllocCursor, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3844 "() -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3845 {"GetCTSeed", (PyCFunction)Qd_GetCTSeed, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3846 "() -> (long _rv)"},
3292
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3847 {"Color2Index", (PyCFunction)Qd_Color2Index, 1,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3848 "(RGBColor myColor) -> (long _rv)"},
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3849 {"Index2Color", (PyCFunction)Qd_Index2Color, 1,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3850 "(long index) -> (RGBColor aColor)"},
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3851 {"InvertColor", (PyCFunction)Qd_InvertColor, 1,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3852 "() -> (RGBColor myColor)"},
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3853 {"RealColor", (PyCFunction)Qd_RealColor, 1,
72357978ffd2 Added support for RGB objects (tuples in python)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3281
diff changeset
3854 "(RGBColor color) -> (Boolean _rv)"},
2580
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3855 {"SetClientID", (PyCFunction)Qd_SetClientID, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3856 "(short id) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3857 {"ProtectEntry", (PyCFunction)Qd_ProtectEntry, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3858 "(short index, Boolean protect) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3859 {"ReserveEntry", (PyCFunction)Qd_ReserveEntry, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3860 "(short index, Boolean reserve) -> None"},
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3861 {"QDError", (PyCFunction)Qd_QDError, 1,
91bc907b1e63 first cut at the whole quickdraw.h header file ...
Guido van Rossum <guido@python.org>
parents: 2267
diff changeset
3862 "() -> (short _rv)"},
3281
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3863 {"CopyDeepMask", (PyCFunction)Qd_CopyDeepMask, 1,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3864 "(BitMapPtr srcBits, BitMapPtr maskBits, BitMapPtr dstBits, Rect srcRect, Rect maskRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None"},
3267
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3865 {"GetPattern", (PyCFunction)Qd_GetPattern, 1,
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3866 "(short patternID) -> (PatHandle _rv)"},
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3867 {"GetCursor", (PyCFunction)Qd_GetCursor, 1,
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3868 "(short cursorID) -> (CursHandle _rv)"},
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3869 {"GetPicture", (PyCFunction)Qd_GetPicture, 1,
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3870 "(short pictureID) -> (PicHandle _rv)"},
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3871 {"DeltaPoint", (PyCFunction)Qd_DeltaPoint, 1,
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3872 "(Point ptA, Point ptB) -> (long _rv)"},
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3873 {"ShieldCursor", (PyCFunction)Qd_ShieldCursor, 1,
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3874 "(Rect shieldRect, Point offsetPt) -> None"},
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3875 {"ScreenRes", (PyCFunction)Qd_ScreenRes, 1,
8e733f92edc0 - Fixed handling of InsetRect, OffsetRect, MapRect
Jack Jansen <jack.jansen@cwi.nl>
parents: 3006
diff changeset
3876 "() -> (short scrnHRes, short scrnVRes)"},
3308
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3877 {"GetIndPattern", (PyCFunction)Qd_GetIndPattern, 1,
e5246571f0fd Added support for PenState and Patterns (and the accompanying qd
Jack Jansen <jack.jansen@cwi.nl>
parents: 3307
diff changeset
3878 "(short patternListID, short index) -> (Pattern thePat)"},
2721
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3879 {"TextFont", (PyCFunction)Qd_TextFont, 1,
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3880 "(short font) -> None"},
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3881 {"TextFace", (PyCFunction)Qd_TextFace, 1,
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3882 "(short face) -> None"},
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3883 {"TextMode", (PyCFunction)Qd_TextMode, 1,
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3884 "(short mode) -> None"},
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3885 {"TextSize", (PyCFunction)Qd_TextSize, 1,
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3886 "(short size) -> None"},
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3887 {"SpaceExtra", (PyCFunction)Qd_SpaceExtra, 1,
3276
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
3888 "(Fixed extra) -> None"},
2721
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3889 {"DrawChar", (PyCFunction)Qd_DrawChar, 1,
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3890 "(short ch) -> None"},
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3891 {"DrawString", (PyCFunction)Qd_DrawString, 1,
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3892 "(Str255 s) -> None"},
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3893 {"DrawText", (PyCFunction)Qd_DrawText, 1,
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3894 "(Buffer textBuf, short firstByte, short byteCount) -> None"},
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3895 {"CharWidth", (PyCFunction)Qd_CharWidth, 1,
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3896 "(short ch) -> (short _rv)"},
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3897 {"StringWidth", (PyCFunction)Qd_StringWidth, 1,
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3898 "(Str255 s) -> (short _rv)"},
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3899 {"TextWidth", (PyCFunction)Qd_TextWidth, 1,
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3900 "(Buffer textBuf, short firstByte, short byteCount) -> (short _rv)"},
3314
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
3901 {"GetFontInfo", (PyCFunction)Qd_GetFontInfo, 1,
58a67322c896 - Added FontInfo support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3309
diff changeset
3902 "() -> (FontInfo info)"},
2721
364d4a524cec Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents: 2580
diff changeset
3903 {"CharExtra", (PyCFunction)Qd_CharExtra, 1,
3276
f1fb326c7e2f Added (minimal) support for a GrafPort type
Jack Jansen <jack.jansen@cwi.nl>
parents: 3267
diff changeset
3904 "(Fixed extra) -> None"},
3281
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3905 {"BitMap", (PyCFunction)Qd_BitMap, 1,
871c768d0da2 BitMap object support (only lightly tested)
Jack Jansen <jack.jansen@cwi.nl>
parents: 3276
diff changeset
3906 "Take (string, int, Rect) argument and create BitMap"},
3295
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3907 {"RawBitMap", (PyCFunction)Qd_RawBitMap, 1,
3ca111e0b1a7 - Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents: 3292
diff changeset
3908 "Take string BitMap and turn into BitMap object"},
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3909 {NULL, NULL, 0}
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3910 };
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3911
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3912
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3913
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3914
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3915 void initQd()
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3916 {
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3917 PyObject *m;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3918 PyObject *d;
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3919
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3920
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3921
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3922
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3923 m = Py_InitModule("Qd", Qd_methods);
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3924 d = PyModule_GetDict(m);
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3925 Qd_Error = PyMac_GetOSErrException();
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3926 if (Qd_Error == NULL ||
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3927 PyDict_SetItemString(d, "Error", Qd_Error) != 0)
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3928 Py_FatalError("can't initialize Qd.Error");
3307
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
3929
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
3930 {
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
3931 PyObject *o;
3369
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
3932
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
3933 o = QDGA_New();
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
3934 if (o == NULL || PyDict_SetItemString(d, "qd", o) != 0)
3cf2d8a2d74b Fixed access to Quickdraw globals. Unfortunately, they now have to be
Jack Jansen <jack.jansen@cwi.nl>
parents: 3342
diff changeset
3935 Py_FatalError("can't initialize Qd.qd");
3307
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
3936 }
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
3937
13b24d1034bd Added support for cursors, and a way to get at the qd global 'arrow'
Jack Jansen <jack.jansen@cwi.nl>
parents: 3295
diff changeset
3938
2267
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3939 }
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3940
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3941 /* ========================= End module Qd ========================== */
7411b6a06920 Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3942