Mercurial > cpython-lru_cache-weakref
annotate Mac/Modules/ctl/Ctlmodule.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 | 4e53746e51af |
| children | 36df4434b3b3 |
| 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 Ctl =========================== */ |
|
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:
3265
diff
changeset
|
18 extern PyObject *OptResObj_New(Handle); |
|
3ca111e0b1a7
- Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents:
3265
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 *); |
|
3295
3ca111e0b1a7
- Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents:
3265
diff
changeset
|
23 extern PyTypeObject Window_Type; |
|
3ca111e0b1a7
- Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents:
3265
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 |
|
3295
3ca111e0b1a7
- Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents:
3265
diff
changeset
|
37 extern PyObject *GrafObj_New(GrafPtr); |
|
3ca111e0b1a7
- Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents:
3265
diff
changeset
|
38 extern int GrafObj_Convert(PyObject *, GrafPtr *); |
|
3ca111e0b1a7
- Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents:
3265
diff
changeset
|
39 |
|
3ca111e0b1a7
- Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents:
3265
diff
changeset
|
40 extern PyObject *BMObj_New(BitMapPtr); |
|
3ca111e0b1a7
- Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents:
3265
diff
changeset
|
41 extern int BMObj_Convert(PyObject *, BitMapPtr *); |
|
3ca111e0b1a7
- Added color window/pixmap support
Jack Jansen <jack.jansen@cwi.nl>
parents:
3265
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 <Controls.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 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
49 extern PyObject *CtlObj_WhichControl(ControlHandle); /* Forward */ |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
50 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
51 #ifdef THINK_C |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
52 #define ControlActionUPP ProcPtr |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
53 #endif |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
54 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
55 static PyObject *Ctl_Error; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
56 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
57 /* ---------------------- Object type Control ----------------------- */ |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
58 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
59 PyTypeObject Control_Type; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
60 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
61 #define CtlObj_Check(x) ((x)->ob_type == &Control_Type) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
62 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
63 typedef struct ControlObject { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
64 PyObject_HEAD |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
65 ControlHandle ob_itself; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
66 } ControlObject; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
67 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
68 PyObject *CtlObj_New(itself) |
|
2720
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
69 ControlHandle itself; |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
70 { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
71 ControlObject *it; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
72 if (itself == NULL) return PyMac_Error(resNotFound); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
73 it = PyObject_NEW(ControlObject, &Control_Type); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
74 if (it == NULL) return NULL; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
75 it->ob_itself = itself; |
|
5269
4e53746e51af
Changed [SG]etCRefCon to [SG]etControlReference
Jack Jansen <jack.jansen@cwi.nl>
parents:
4348
diff
changeset
|
76 SetControlReference(itself, (long)it); |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
77 return (PyObject *)it; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
78 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
79 CtlObj_Convert(v, p_itself) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
80 PyObject *v; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
81 ControlHandle *p_itself; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
82 { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
83 if (!CtlObj_Check(v)) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
84 { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
85 PyErr_SetString(PyExc_TypeError, "Control required"); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
86 return 0; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
87 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
88 *p_itself = ((ControlObject *)v)->ob_itself; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
89 return 1; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
90 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
91 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
92 static void CtlObj_dealloc(self) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
93 ControlObject *self; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
94 { |
|
5269
4e53746e51af
Changed [SG]etCRefCon to [SG]etControlReference
Jack Jansen <jack.jansen@cwi.nl>
parents:
4348
diff
changeset
|
95 if (self->ob_itself) SetControlReference(self->ob_itself, (long)0); /* Make it forget about us */ |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
96 PyMem_DEL(self); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
97 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
98 |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
99 static PyObject *CtlObj_ShowControl(_self, _args) |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
100 ControlObject *_self; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
101 PyObject *_args; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
102 { |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
103 PyObject *_res = NULL; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
104 if (!PyArg_ParseTuple(_args, "")) |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
105 return NULL; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
106 ShowControl(_self->ob_itself); |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
107 Py_INCREF(Py_None); |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
108 _res = Py_None; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
109 return _res; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
110 } |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
111 |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
112 static PyObject *CtlObj_HideControl(_self, _args) |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
113 ControlObject *_self; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
114 PyObject *_args; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
115 { |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
116 PyObject *_res = NULL; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
117 if (!PyArg_ParseTuple(_args, "")) |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
118 return NULL; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
119 HideControl(_self->ob_itself); |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
120 Py_INCREF(Py_None); |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
121 _res = Py_None; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
122 return _res; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
123 } |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
124 |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
125 static PyObject *CtlObj_Draw1Control(_self, _args) |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
126 ControlObject *_self; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
127 PyObject *_args; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
128 { |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
129 PyObject *_res = NULL; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
130 if (!PyArg_ParseTuple(_args, "")) |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
131 return NULL; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
132 Draw1Control(_self->ob_itself); |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
133 Py_INCREF(Py_None); |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
134 _res = Py_None; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
135 return _res; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
136 } |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
137 |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
138 static PyObject *CtlObj_HiliteControl(_self, _args) |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
139 ControlObject *_self; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
140 PyObject *_args; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
141 { |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
142 PyObject *_res = NULL; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
143 ControlPartCode hiliteState; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
144 if (!PyArg_ParseTuple(_args, "h", |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
145 &hiliteState)) |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
146 return NULL; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
147 HiliteControl(_self->ob_itself, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
148 hiliteState); |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
149 Py_INCREF(Py_None); |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
150 _res = Py_None; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
151 return _res; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
152 } |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
153 |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
154 static PyObject *CtlObj_TrackControl(_self, _args) |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
155 ControlObject *_self; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
156 PyObject *_args; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
157 { |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
158 PyObject *_res = NULL; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
159 ControlPartCode _rv; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
160 Point thePoint; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
161 if (!PyArg_ParseTuple(_args, "O&", |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
162 PyMac_GetPoint, &thePoint)) |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
163 return NULL; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
164 _rv = TrackControl(_self->ob_itself, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
165 thePoint, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
166 (ControlActionUPP)0); |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
167 _res = Py_BuildValue("h", |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
168 _rv); |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
169 return _res; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
170 } |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
171 |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
172 static PyObject *CtlObj_DragControl(_self, _args) |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
173 ControlObject *_self; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
174 PyObject *_args; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
175 { |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
176 PyObject *_res = NULL; |
|
3265
2f837d824120
Regenerated because of minor changes in universal headers
Jack Jansen <jack.jansen@cwi.nl>
parents:
3006
diff
changeset
|
177 Point startPoint; |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
178 Rect limitRect; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
179 Rect slopRect; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
180 DragConstraint axis; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
181 if (!PyArg_ParseTuple(_args, "O&O&O&h", |
|
3265
2f837d824120
Regenerated because of minor changes in universal headers
Jack Jansen <jack.jansen@cwi.nl>
parents:
3006
diff
changeset
|
182 PyMac_GetPoint, &startPoint, |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
183 PyMac_GetRect, &limitRect, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
184 PyMac_GetRect, &slopRect, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
185 &axis)) |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
186 return NULL; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
187 DragControl(_self->ob_itself, |
|
3265
2f837d824120
Regenerated because of minor changes in universal headers
Jack Jansen <jack.jansen@cwi.nl>
parents:
3006
diff
changeset
|
188 startPoint, |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
189 &limitRect, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
190 &slopRect, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
191 axis); |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
192 Py_INCREF(Py_None); |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
193 _res = Py_None; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
194 return _res; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
195 } |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
196 |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
197 static PyObject *CtlObj_TestControl(_self, _args) |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
198 ControlObject *_self; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
199 PyObject *_args; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
200 { |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
201 PyObject *_res = NULL; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
202 ControlPartCode _rv; |
|
3265
2f837d824120
Regenerated because of minor changes in universal headers
Jack Jansen <jack.jansen@cwi.nl>
parents:
3006
diff
changeset
|
203 Point thePoint; |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
204 if (!PyArg_ParseTuple(_args, "O&", |
|
3265
2f837d824120
Regenerated because of minor changes in universal headers
Jack Jansen <jack.jansen@cwi.nl>
parents:
3006
diff
changeset
|
205 PyMac_GetPoint, &thePoint)) |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
206 return NULL; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
207 _rv = TestControl(_self->ob_itself, |
|
3265
2f837d824120
Regenerated because of minor changes in universal headers
Jack Jansen <jack.jansen@cwi.nl>
parents:
3006
diff
changeset
|
208 thePoint); |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
209 _res = Py_BuildValue("h", |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
210 _rv); |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
211 return _res; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
212 } |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
213 |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
214 static PyObject *CtlObj_MoveControl(_self, _args) |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
215 ControlObject *_self; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
216 PyObject *_args; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
217 { |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
218 PyObject *_res = NULL; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
219 SInt16 h; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
220 SInt16 v; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
221 if (!PyArg_ParseTuple(_args, "hh", |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
222 &h, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
223 &v)) |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
224 return NULL; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
225 MoveControl(_self->ob_itself, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
226 h, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
227 v); |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
228 Py_INCREF(Py_None); |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
229 _res = Py_None; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
230 return _res; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
231 } |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
232 |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
233 static PyObject *CtlObj_SizeControl(_self, _args) |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
234 ControlObject *_self; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
235 PyObject *_args; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
236 { |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
237 PyObject *_res = NULL; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
238 SInt16 w; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
239 SInt16 h; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
240 if (!PyArg_ParseTuple(_args, "hh", |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
241 &w, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
242 &h)) |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
243 return NULL; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
244 SizeControl(_self->ob_itself, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
245 w, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
246 h); |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
247 Py_INCREF(Py_None); |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
248 _res = Py_None; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
249 return _res; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
250 } |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
251 |
|
2720
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
252 static PyObject *CtlObj_SetControlTitle(_self, _args) |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
253 ControlObject *_self; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
254 PyObject *_args; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
255 { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
256 PyObject *_res = NULL; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
257 Str255 title; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
258 if (!PyArg_ParseTuple(_args, "O&", |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
259 PyMac_GetStr255, title)) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
260 return NULL; |
|
2720
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
261 SetControlTitle(_self->ob_itself, |
|
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
262 title); |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
263 Py_INCREF(Py_None); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
264 _res = Py_None; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
265 return _res; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
266 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
267 |
|
2720
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
268 static PyObject *CtlObj_GetControlTitle(_self, _args) |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
269 ControlObject *_self; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
270 PyObject *_args; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
271 { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
272 PyObject *_res = NULL; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
273 Str255 title; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
274 if (!PyArg_ParseTuple(_args, "O&", |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
275 PyMac_GetStr255, title)) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
276 return NULL; |
|
2720
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
277 GetControlTitle(_self->ob_itself, |
|
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
278 title); |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
279 Py_INCREF(Py_None); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
280 _res = Py_None; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
281 return _res; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
282 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
283 |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
284 static PyObject *CtlObj_GetControlValue(_self, _args) |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
285 ControlObject *_self; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
286 PyObject *_args; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
287 { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
288 PyObject *_res = NULL; |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
289 SInt16 _rv; |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
290 if (!PyArg_ParseTuple(_args, "")) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
291 return NULL; |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
292 _rv = GetControlValue(_self->ob_itself); |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
293 _res = Py_BuildValue("h", |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
294 _rv); |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
295 return _res; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
296 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
297 |
|
2720
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
298 static PyObject *CtlObj_SetControlValue(_self, _args) |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
299 ControlObject *_self; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
300 PyObject *_args; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
301 { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
302 PyObject *_res = NULL; |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
303 SInt16 newValue; |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
304 if (!PyArg_ParseTuple(_args, "h", |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
305 &newValue)) |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
306 return NULL; |
|
2720
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
307 SetControlValue(_self->ob_itself, |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
308 newValue); |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
309 Py_INCREF(Py_None); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
310 _res = Py_None; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
311 return _res; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
312 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
313 |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
314 static PyObject *CtlObj_GetControlMinimum(_self, _args) |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
315 ControlObject *_self; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
316 PyObject *_args; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
317 { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
318 PyObject *_res = NULL; |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
319 SInt16 _rv; |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
320 if (!PyArg_ParseTuple(_args, "")) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
321 return NULL; |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
322 _rv = GetControlMinimum(_self->ob_itself); |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
323 _res = Py_BuildValue("h", |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
324 _rv); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
325 return _res; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
326 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
327 |
|
2720
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
328 static PyObject *CtlObj_SetControlMinimum(_self, _args) |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
329 ControlObject *_self; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
330 PyObject *_args; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
331 { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
332 PyObject *_res = NULL; |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
333 SInt16 newMinimum; |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
334 if (!PyArg_ParseTuple(_args, "h", |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
335 &newMinimum)) |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
336 return NULL; |
|
2720
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
337 SetControlMinimum(_self->ob_itself, |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
338 newMinimum); |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
339 Py_INCREF(Py_None); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
340 _res = Py_None; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
341 return _res; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
342 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
343 |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
344 static PyObject *CtlObj_GetControlMaximum(_self, _args) |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
345 ControlObject *_self; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
346 PyObject *_args; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
347 { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
348 PyObject *_res = NULL; |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
349 SInt16 _rv; |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
350 if (!PyArg_ParseTuple(_args, "")) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
351 return NULL; |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
352 _rv = GetControlMaximum(_self->ob_itself); |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
353 _res = Py_BuildValue("h", |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
354 _rv); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
355 return _res; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
356 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
357 |
|
2720
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
358 static PyObject *CtlObj_SetControlMaximum(_self, _args) |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
359 ControlObject *_self; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
360 PyObject *_args; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
361 { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
362 PyObject *_res = NULL; |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
363 SInt16 newMaximum; |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
364 if (!PyArg_ParseTuple(_args, "h", |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
365 &newMaximum)) |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
366 return NULL; |
|
2720
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
367 SetControlMaximum(_self->ob_itself, |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
368 newMaximum); |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
369 Py_INCREF(Py_None); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
370 _res = Py_None; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
371 return _res; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
372 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
373 |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
374 static PyObject *CtlObj_GetControlVariant(_self, _args) |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
375 ControlObject *_self; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
376 PyObject *_args; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
377 { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
378 PyObject *_res = NULL; |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
379 SInt16 _rv; |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
380 if (!PyArg_ParseTuple(_args, "")) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
381 return NULL; |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
382 _rv = GetControlVariant(_self->ob_itself); |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
383 _res = Py_BuildValue("h", |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
384 _rv); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
385 return _res; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
386 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
387 |
|
2720
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
388 static PyObject *CtlObj_SetControlAction(_self, _args) |
|
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
389 ControlObject *_self; |
|
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
390 PyObject *_args; |
|
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
391 { |
|
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
392 PyObject *_res = NULL; |
|
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
393 if (!PyArg_ParseTuple(_args, "")) |
|
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
394 return NULL; |
|
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
395 SetControlAction(_self->ob_itself, |
|
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
396 (ControlActionUPP)0); |
|
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
397 Py_INCREF(Py_None); |
|
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
398 _res = Py_None; |
|
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
399 return _res; |
|
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
400 } |
|
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
401 |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
402 static PyObject *CtlObj_SetControlReference(_self, _args) |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
403 ControlObject *_self; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
404 PyObject *_args; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
405 { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
406 PyObject *_res = NULL; |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
407 SInt32 data; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
408 if (!PyArg_ParseTuple(_args, "l", |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
409 &data)) |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
410 return NULL; |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
411 SetControlReference(_self->ob_itself, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
412 data); |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
413 Py_INCREF(Py_None); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
414 _res = Py_None; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
415 return _res; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
416 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
417 |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
418 static PyObject *CtlObj_GetControlReference(_self, _args) |
|
2720
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
419 ControlObject *_self; |
|
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
420 PyObject *_args; |
|
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
421 { |
|
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
422 PyObject *_res = NULL; |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
423 SInt32 _rv; |
|
2720
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
424 if (!PyArg_ParseTuple(_args, "")) |
|
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
425 return NULL; |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
426 _rv = GetControlReference(_self->ob_itself); |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
427 _res = Py_BuildValue("l", |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
428 _rv); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
429 return _res; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
430 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
431 |
|
2751
ae64003b2a75
Added as_Resource() method to convert ctl object to res object
Jack Jansen <jack.jansen@cwi.nl>
parents:
2723
diff
changeset
|
432 static PyObject *CtlObj_as_Resource(_self, _args) |
|
ae64003b2a75
Added as_Resource() method to convert ctl object to res object
Jack Jansen <jack.jansen@cwi.nl>
parents:
2723
diff
changeset
|
433 ControlObject *_self; |
|
ae64003b2a75
Added as_Resource() method to convert ctl object to res object
Jack Jansen <jack.jansen@cwi.nl>
parents:
2723
diff
changeset
|
434 PyObject *_args; |
|
ae64003b2a75
Added as_Resource() method to convert ctl object to res object
Jack Jansen <jack.jansen@cwi.nl>
parents:
2723
diff
changeset
|
435 { |
|
ae64003b2a75
Added as_Resource() method to convert ctl object to res object
Jack Jansen <jack.jansen@cwi.nl>
parents:
2723
diff
changeset
|
436 PyObject *_res = NULL; |
|
ae64003b2a75
Added as_Resource() method to convert ctl object to res object
Jack Jansen <jack.jansen@cwi.nl>
parents:
2723
diff
changeset
|
437 |
|
ae64003b2a75
Added as_Resource() method to convert ctl object to res object
Jack Jansen <jack.jansen@cwi.nl>
parents:
2723
diff
changeset
|
438 return ResObj_New((Handle)_self->ob_itself); |
|
ae64003b2a75
Added as_Resource() method to convert ctl object to res object
Jack Jansen <jack.jansen@cwi.nl>
parents:
2723
diff
changeset
|
439 |
|
ae64003b2a75
Added as_Resource() method to convert ctl object to res object
Jack Jansen <jack.jansen@cwi.nl>
parents:
2723
diff
changeset
|
440 } |
|
ae64003b2a75
Added as_Resource() method to convert ctl object to res object
Jack Jansen <jack.jansen@cwi.nl>
parents:
2723
diff
changeset
|
441 |
|
4348
852ca23c80cc
Fixed very nasty null-dereferencing bug in DisposeControl/destroy
Jack Jansen <jack.jansen@cwi.nl>
parents:
3929
diff
changeset
|
442 static PyObject *CtlObj_DisposeControl(_self, _args) |
|
852ca23c80cc
Fixed very nasty null-dereferencing bug in DisposeControl/destroy
Jack Jansen <jack.jansen@cwi.nl>
parents:
3929
diff
changeset
|
443 ControlObject *_self; |
|
852ca23c80cc
Fixed very nasty null-dereferencing bug in DisposeControl/destroy
Jack Jansen <jack.jansen@cwi.nl>
parents:
3929
diff
changeset
|
444 PyObject *_args; |
|
852ca23c80cc
Fixed very nasty null-dereferencing bug in DisposeControl/destroy
Jack Jansen <jack.jansen@cwi.nl>
parents:
3929
diff
changeset
|
445 { |
|
852ca23c80cc
Fixed very nasty null-dereferencing bug in DisposeControl/destroy
Jack Jansen <jack.jansen@cwi.nl>
parents:
3929
diff
changeset
|
446 PyObject *_res = NULL; |
|
852ca23c80cc
Fixed very nasty null-dereferencing bug in DisposeControl/destroy
Jack Jansen <jack.jansen@cwi.nl>
parents:
3929
diff
changeset
|
447 |
|
852ca23c80cc
Fixed very nasty null-dereferencing bug in DisposeControl/destroy
Jack Jansen <jack.jansen@cwi.nl>
parents:
3929
diff
changeset
|
448 if (!PyArg_ParseTuple(_args, "")) |
|
852ca23c80cc
Fixed very nasty null-dereferencing bug in DisposeControl/destroy
Jack Jansen <jack.jansen@cwi.nl>
parents:
3929
diff
changeset
|
449 return NULL; |
|
852ca23c80cc
Fixed very nasty null-dereferencing bug in DisposeControl/destroy
Jack Jansen <jack.jansen@cwi.nl>
parents:
3929
diff
changeset
|
450 if ( _self->ob_itself ) { |
|
5269
4e53746e51af
Changed [SG]etCRefCon to [SG]etControlReference
Jack Jansen <jack.jansen@cwi.nl>
parents:
4348
diff
changeset
|
451 SetControlReference(_self->ob_itself, (long)0); /* Make it forget about us */ |
|
4348
852ca23c80cc
Fixed very nasty null-dereferencing bug in DisposeControl/destroy
Jack Jansen <jack.jansen@cwi.nl>
parents:
3929
diff
changeset
|
452 DisposeControl(_self->ob_itself); |
|
852ca23c80cc
Fixed very nasty null-dereferencing bug in DisposeControl/destroy
Jack Jansen <jack.jansen@cwi.nl>
parents:
3929
diff
changeset
|
453 _self->ob_itself = NULL; |
|
852ca23c80cc
Fixed very nasty null-dereferencing bug in DisposeControl/destroy
Jack Jansen <jack.jansen@cwi.nl>
parents:
3929
diff
changeset
|
454 } |
|
852ca23c80cc
Fixed very nasty null-dereferencing bug in DisposeControl/destroy
Jack Jansen <jack.jansen@cwi.nl>
parents:
3929
diff
changeset
|
455 Py_INCREF(Py_None); |
|
852ca23c80cc
Fixed very nasty null-dereferencing bug in DisposeControl/destroy
Jack Jansen <jack.jansen@cwi.nl>
parents:
3929
diff
changeset
|
456 _res = Py_None; |
|
852ca23c80cc
Fixed very nasty null-dereferencing bug in DisposeControl/destroy
Jack Jansen <jack.jansen@cwi.nl>
parents:
3929
diff
changeset
|
457 return _res; |
|
852ca23c80cc
Fixed very nasty null-dereferencing bug in DisposeControl/destroy
Jack Jansen <jack.jansen@cwi.nl>
parents:
3929
diff
changeset
|
458 |
|
852ca23c80cc
Fixed very nasty null-dereferencing bug in DisposeControl/destroy
Jack Jansen <jack.jansen@cwi.nl>
parents:
3929
diff
changeset
|
459 } |
|
852ca23c80cc
Fixed very nasty null-dereferencing bug in DisposeControl/destroy
Jack Jansen <jack.jansen@cwi.nl>
parents:
3929
diff
changeset
|
460 |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
461 static PyMethodDef CtlObj_methods[] = { |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
462 {"ShowControl", (PyCFunction)CtlObj_ShowControl, 1, |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
463 "() -> None"}, |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
464 {"HideControl", (PyCFunction)CtlObj_HideControl, 1, |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
465 "() -> None"}, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
466 {"Draw1Control", (PyCFunction)CtlObj_Draw1Control, 1, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
467 "() -> None"}, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
468 {"HiliteControl", (PyCFunction)CtlObj_HiliteControl, 1, |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
469 "(ControlPartCode hiliteState) -> None"}, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
470 {"TrackControl", (PyCFunction)CtlObj_TrackControl, 1, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
471 "(Point thePoint) -> (ControlPartCode _rv)"}, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
472 {"DragControl", (PyCFunction)CtlObj_DragControl, 1, |
|
3265
2f837d824120
Regenerated because of minor changes in universal headers
Jack Jansen <jack.jansen@cwi.nl>
parents:
3006
diff
changeset
|
473 "(Point startPoint, Rect limitRect, Rect slopRect, DragConstraint axis) -> None"}, |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
474 {"TestControl", (PyCFunction)CtlObj_TestControl, 1, |
|
3265
2f837d824120
Regenerated because of minor changes in universal headers
Jack Jansen <jack.jansen@cwi.nl>
parents:
3006
diff
changeset
|
475 "(Point thePoint) -> (ControlPartCode _rv)"}, |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
476 {"MoveControl", (PyCFunction)CtlObj_MoveControl, 1, |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
477 "(SInt16 h, SInt16 v) -> None"}, |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
478 {"SizeControl", (PyCFunction)CtlObj_SizeControl, 1, |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
479 "(SInt16 w, SInt16 h) -> None"}, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
480 {"SetControlTitle", (PyCFunction)CtlObj_SetControlTitle, 1, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
481 "(Str255 title) -> None"}, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
482 {"GetControlTitle", (PyCFunction)CtlObj_GetControlTitle, 1, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
483 "(Str255 title) -> None"}, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
484 {"GetControlValue", (PyCFunction)CtlObj_GetControlValue, 1, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
485 "() -> (SInt16 _rv)"}, |
|
2720
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
486 {"SetControlValue", (PyCFunction)CtlObj_SetControlValue, 1, |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
487 "(SInt16 newValue) -> None"}, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
488 {"GetControlMinimum", (PyCFunction)CtlObj_GetControlMinimum, 1, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
489 "() -> (SInt16 _rv)"}, |
|
2720
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
490 {"SetControlMinimum", (PyCFunction)CtlObj_SetControlMinimum, 1, |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
491 "(SInt16 newMinimum) -> None"}, |
|
2720
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
492 {"GetControlMaximum", (PyCFunction)CtlObj_GetControlMaximum, 1, |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
493 "() -> (SInt16 _rv)"}, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
494 {"SetControlMaximum", (PyCFunction)CtlObj_SetControlMaximum, 1, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
495 "(SInt16 newMaximum) -> None"}, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
496 {"GetControlVariant", (PyCFunction)CtlObj_GetControlVariant, 1, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
497 "() -> (SInt16 _rv)"}, |
|
2720
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
498 {"SetControlAction", (PyCFunction)CtlObj_SetControlAction, 1, |
|
abf116db523f
Trying again to check it in. Changes to:
Jack Jansen <jack.jansen@cwi.nl>
parents:
2267
diff
changeset
|
499 "() -> None"}, |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
500 {"SetControlReference", (PyCFunction)CtlObj_SetControlReference, 1, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
501 "(SInt32 data) -> None"}, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
502 {"GetControlReference", (PyCFunction)CtlObj_GetControlReference, 1, |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
503 "() -> (SInt32 _rv)"}, |
|
2751
ae64003b2a75
Added as_Resource() method to convert ctl object to res object
Jack Jansen <jack.jansen@cwi.nl>
parents:
2723
diff
changeset
|
504 {"as_Resource", (PyCFunction)CtlObj_as_Resource, 1, |
|
ae64003b2a75
Added as_Resource() method to convert ctl object to res object
Jack Jansen <jack.jansen@cwi.nl>
parents:
2723
diff
changeset
|
505 "Return this Control as a Resource"}, |
|
4348
852ca23c80cc
Fixed very nasty null-dereferencing bug in DisposeControl/destroy
Jack Jansen <jack.jansen@cwi.nl>
parents:
3929
diff
changeset
|
506 {"DisposeControl", (PyCFunction)CtlObj_DisposeControl, 1, |
|
852ca23c80cc
Fixed very nasty null-dereferencing bug in DisposeControl/destroy
Jack Jansen <jack.jansen@cwi.nl>
parents:
3929
diff
changeset
|
507 "() -> None"}, |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
508 {NULL, NULL, 0} |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
509 }; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
510 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
511 PyMethodChain CtlObj_chain = { CtlObj_methods, NULL }; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
512 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
513 static PyObject *CtlObj_getattr(self, name) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
514 ControlObject *self; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
515 char *name; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
516 { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
517 return Py_FindMethodInChain(&CtlObj_chain, (PyObject *)self, name); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
518 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
519 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
520 #define CtlObj_setattr NULL |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
521 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
522 PyTypeObject Control_Type = { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
523 PyObject_HEAD_INIT(&PyType_Type) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
524 0, /*ob_size*/ |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
525 "Control", /*tp_name*/ |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
526 sizeof(ControlObject), /*tp_basicsize*/ |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
527 0, /*tp_itemsize*/ |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
528 /* methods */ |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
529 (destructor) CtlObj_dealloc, /*tp_dealloc*/ |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
530 0, /*tp_print*/ |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
531 (getattrfunc) CtlObj_getattr, /*tp_getattr*/ |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
532 (setattrfunc) CtlObj_setattr, /*tp_setattr*/ |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
533 }; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
534 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
535 /* -------------------- End object type Control --------------------- */ |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
536 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
537 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
538 static PyObject *Ctl_NewControl(_self, _args) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
539 PyObject *_self; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
540 PyObject *_args; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
541 { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
542 PyObject *_res = NULL; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
543 ControlHandle _rv; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
544 WindowPtr theWindow; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
545 Rect boundsRect; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
546 Str255 title; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
547 Boolean visible; |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
548 SInt16 value; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
549 SInt16 min; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
550 SInt16 max; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
551 SInt16 procID; |
|
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
552 SInt32 refCon; |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
553 if (!PyArg_ParseTuple(_args, "O&O&O&bhhhhl", |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
554 WinObj_Convert, &theWindow, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
555 PyMac_GetRect, &boundsRect, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
556 PyMac_GetStr255, title, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
557 &visible, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
558 &value, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
559 &min, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
560 &max, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
561 &procID, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
562 &refCon)) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
563 return NULL; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
564 _rv = NewControl(theWindow, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
565 &boundsRect, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
566 title, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
567 visible, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
568 value, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
569 min, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
570 max, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
571 procID, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
572 refCon); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
573 _res = Py_BuildValue("O&", |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
574 CtlObj_New, _rv); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
575 return _res; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
576 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
577 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
578 static PyObject *Ctl_GetNewControl(_self, _args) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
579 PyObject *_self; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
580 PyObject *_args; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
581 { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
582 PyObject *_res = NULL; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
583 ControlHandle _rv; |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
584 SInt16 controlID; |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
585 WindowPtr owner; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
586 if (!PyArg_ParseTuple(_args, "hO&", |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
587 &controlID, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
588 WinObj_Convert, &owner)) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
589 return NULL; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
590 _rv = GetNewControl(controlID, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
591 owner); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
592 _res = Py_BuildValue("O&", |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
593 CtlObj_New, _rv); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
594 return _res; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
595 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
596 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
597 static PyObject *Ctl_DrawControls(_self, _args) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
598 PyObject *_self; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
599 PyObject *_args; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
600 { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
601 PyObject *_res = NULL; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
602 WindowPtr theWindow; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
603 if (!PyArg_ParseTuple(_args, "O&", |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
604 WinObj_Convert, &theWindow)) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
605 return NULL; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
606 DrawControls(theWindow); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
607 Py_INCREF(Py_None); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
608 _res = Py_None; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
609 return _res; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
610 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
611 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
612 static PyObject *Ctl_UpdateControls(_self, _args) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
613 PyObject *_self; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
614 PyObject *_args; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
615 { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
616 PyObject *_res = NULL; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
617 WindowPtr theWindow; |
|
3499
5f25040fd63e
Replaced various dummy updateRegions by real arguments
Jack Jansen <jack.jansen@cwi.nl>
parents:
3295
diff
changeset
|
618 RgnHandle updateRegion; |
|
5f25040fd63e
Replaced various dummy updateRegions by real arguments
Jack Jansen <jack.jansen@cwi.nl>
parents:
3295
diff
changeset
|
619 if (!PyArg_ParseTuple(_args, "O&O&", |
|
5f25040fd63e
Replaced various dummy updateRegions by real arguments
Jack Jansen <jack.jansen@cwi.nl>
parents:
3295
diff
changeset
|
620 WinObj_Convert, &theWindow, |
|
5f25040fd63e
Replaced various dummy updateRegions by real arguments
Jack Jansen <jack.jansen@cwi.nl>
parents:
3295
diff
changeset
|
621 ResObj_Convert, &updateRegion)) |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
622 return NULL; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
623 UpdateControls(theWindow, |
|
3499
5f25040fd63e
Replaced various dummy updateRegions by real arguments
Jack Jansen <jack.jansen@cwi.nl>
parents:
3295
diff
changeset
|
624 updateRegion); |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
625 Py_INCREF(Py_None); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
626 _res = Py_None; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
627 return _res; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
628 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
629 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
630 static PyObject *Ctl_FindControl(_self, _args) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
631 PyObject *_self; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
632 PyObject *_args; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
633 { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
634 PyObject *_res = NULL; |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
635 ControlPartCode _rv; |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
636 Point thePoint; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
637 WindowPtr theWindow; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
638 ControlHandle theControl; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
639 if (!PyArg_ParseTuple(_args, "O&O&", |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
640 PyMac_GetPoint, &thePoint, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
641 WinObj_Convert, &theWindow)) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
642 return NULL; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
643 _rv = FindControl(thePoint, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
644 theWindow, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
645 &theControl); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
646 _res = Py_BuildValue("hO&", |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
647 _rv, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
648 CtlObj_WhichControl, theControl); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
649 return _res; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
650 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
651 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
652 static PyMethodDef Ctl_methods[] = { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
653 {"NewControl", (PyCFunction)Ctl_NewControl, 1, |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
654 "(WindowPtr theWindow, Rect boundsRect, Str255 title, Boolean visible, SInt16 value, SInt16 min, SInt16 max, SInt16 procID, SInt32 refCon) -> (ControlHandle _rv)"}, |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
655 {"GetNewControl", (PyCFunction)Ctl_GetNewControl, 1, |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
656 "(SInt16 controlID, WindowPtr owner) -> (ControlHandle _rv)"}, |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
657 {"DrawControls", (PyCFunction)Ctl_DrawControls, 1, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
658 "(WindowPtr theWindow) -> None"}, |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
659 {"UpdateControls", (PyCFunction)Ctl_UpdateControls, 1, |
|
3499
5f25040fd63e
Replaced various dummy updateRegions by real arguments
Jack Jansen <jack.jansen@cwi.nl>
parents:
3295
diff
changeset
|
660 "(WindowPtr theWindow, RgnHandle updateRegion) -> None"}, |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
661 {"FindControl", (PyCFunction)Ctl_FindControl, 1, |
|
2723
a0fc94b3bb21
Ported to Universal Header 2.0.1f (i.e. CW6)
Jack Jansen <jack.jansen@cwi.nl>
parents:
2720
diff
changeset
|
662 "(Point thePoint, WindowPtr theWindow) -> (ControlPartCode _rv, ControlHandle theControl)"}, |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
663 {NULL, NULL, 0} |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
664 }; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
665 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
666 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
667 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
668 PyObject * |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
669 CtlObj_WhichControl(ControlHandle c) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
670 { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
671 PyObject *it; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
672 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
673 /* XXX What if we find a control belonging to some other package? */ |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
674 if (c == NULL) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
675 it = NULL; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
676 else |
|
5269
4e53746e51af
Changed [SG]etCRefCon to [SG]etControlReference
Jack Jansen <jack.jansen@cwi.nl>
parents:
4348
diff
changeset
|
677 it = (PyObject *) GetControlReference(c); |
|
2267
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
678 if (it == NULL || ((ControlObject *)it)->ob_itself != c) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
679 it = Py_None; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
680 Py_INCREF(it); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
681 return it; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
682 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
683 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
684 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
685 void initCtl() |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
686 { |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
687 PyObject *m; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
688 PyObject *d; |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
689 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
690 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
691 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
692 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
693 m = Py_InitModule("Ctl", Ctl_methods); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
694 d = PyModule_GetDict(m); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
695 Ctl_Error = PyMac_GetOSErrException(); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
696 if (Ctl_Error == NULL || |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
697 PyDict_SetItemString(d, "Error", Ctl_Error) != 0) |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
698 Py_FatalError("can't initialize Ctl.Error"); |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
699 } |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
700 |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
701 /* ========================= End module Ctl ========================= */ |
|
7411b6a06920
Committed a more or less working version.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
702 |
