Mercurial > cpython-lru_cache-weakref
annotate Modules/flmodule.c @ 3044:7e7bb00a0a2e legacy-trunk
Added functionality: locate CW projects, copy them, empty them and
binhex them.
| author | Jack Jansen <jack.jansen@cwi.nl> |
|---|---|
| date | Thu, 31 Aug 1995 13:47:14 +0000 |
| parents | 172ba04a5191 |
| children | cf9a97bfc023 |
| rev | line source |
|---|---|
| 328 | 1 /********************************************************** |
|
2061
172ba04a5191
Added 1995 to copyright message.
Guido van Rossum <guido@python.org>
parents:
1746
diff
changeset
|
2 Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, |
|
172ba04a5191
Added 1995 to copyright message.
Guido van Rossum <guido@python.org>
parents:
1746
diff
changeset
|
3 The Netherlands. |
| 328 | 4 |
| 5 All Rights Reserved | |
| 6 | |
| 7 Permission to use, copy, modify, and distribute this software and its | |
| 8 documentation for any purpose and without fee is hereby granted, | |
| 9 provided that the above copyright notice appear in all copies and that | |
| 10 both that copyright notice and this permission notice appear in | |
| 11 supporting documentation, and that the names of Stichting Mathematisch | |
| 12 Centrum or CWI not be used in advertising or publicity pertaining to | |
| 13 distribution of the software without specific, written prior permission. | |
| 14 | |
| 15 STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO | |
| 16 THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND | |
| 17 FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE | |
| 18 FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
| 19 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
| 20 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT | |
| 21 OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
| 22 | |
| 23 ******************************************************************/ | |
| 24 | |
| 25 /* FL module -- interface to Mark Overmars' FORMS Library. */ | |
| 26 | |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
27 /* This code works with FORMS version 2.2a. |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
28 FORMS can be ftp'ed from ftp.cs.ruu.nl (131.211.80.17), directory |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
29 /pub/SGI/FORMS. */ |
| 469 | 30 |
|
947
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
31 /* A half-hearted attempt has been made to allow programs using this |
|
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
32 * module to exploit parallelism (through the threads module). No provisions |
|
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
33 * have been made for multiple threads to use this module at the same time, |
|
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
34 * though. So, a program with a forms thread and a non-forms thread will work |
|
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
35 * fine but a program with two threads using forms will probably crash (unless |
|
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
36 * the program takes precaution to ensure that only one thread can be in |
|
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
37 * this module at any time). This will have to be fixed some time. |
|
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
38 * (A fix will probably also have to synchronise with the gl module). |
|
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
39 */ |
|
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
40 |
| 328 | 41 #include "forms.h" |
| 42 | |
| 43 #include "allobjects.h" | |
| 44 #include "import.h" | |
| 45 #include "modsupport.h" | |
| 46 #include "structmember.h" | |
| 926 | 47 #include "ceval.h" |
| 328 | 48 |
| 49 /* Generic Forms Objects */ | |
| 50 | |
| 51 typedef struct { | |
| 52 OB_HEAD | |
| 53 FL_OBJECT *ob_generic; | |
| 54 struct methodlist *ob_methods; | |
| 55 object *ob_callback; | |
| 56 object *ob_callback_arg; | |
| 57 } genericobject; | |
| 58 | |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
59 staticforward typeobject GenericObjecttype; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
60 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
61 #define is_genericobject(g) ((g)->ob_type == &GenericObjecttype) |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
62 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
63 /* List of all objects (XXX this should be a hash table on address...) */ |
| 328 | 64 |
| 65 static object *allgenerics = NULL; | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
66 static int nfreeslots = 0; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
67 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
68 /* Add an object to the list of known objects */ |
| 328 | 69 |
| 70 static void | |
| 71 knowgeneric(g) | |
| 72 genericobject *g; | |
| 73 { | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
74 int i, n; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
75 /* Create the list if it doesn't already exist */ |
| 328 | 76 if (allgenerics == NULL) { |
| 77 allgenerics = newlistobject(0); | |
| 78 if (allgenerics == NULL) { | |
| 79 err_clear(); | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
80 return; /* Too bad, live without allgenerics... */ |
| 328 | 81 } |
| 82 } | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
83 if (nfreeslots > 0) { |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
84 /* Search the list for reusable slots (NULL items) */ |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
85 /* XXX This can be made faster! */ |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
86 n = getlistsize(allgenerics); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
87 for (i = 0; i < n; i++) { |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
88 if (getlistitem(allgenerics, i) == NULL) { |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
89 INCREF(g); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
90 setlistitem(allgenerics, i, (object *)g); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
91 nfreeslots--; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
92 return; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
93 } |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
94 } |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
95 /* Strange... no free slots found... */ |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
96 nfreeslots = 0; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
97 } |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
98 /* No free entries, append new item to the end */ |
| 328 | 99 addlistitem(allgenerics, (object *)g); |
| 100 } | |
| 101 | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
102 /* Find an object in the list of known objects */ |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
103 |
| 328 | 104 static genericobject * |
| 105 findgeneric(generic) | |
| 106 FL_OBJECT *generic; | |
| 107 { | |
| 108 int i, n; | |
| 109 genericobject *g; | |
| 110 | |
| 111 if (allgenerics == NULL) | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
112 return NULL; /* No objects known yet */ |
| 328 | 113 n = getlistsize(allgenerics); |
| 114 for (i = 0; i < n; i++) { | |
| 115 g = (genericobject *)getlistitem(allgenerics, i); | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
116 if (g != NULL && g->ob_generic == generic) |
| 328 | 117 return g; |
| 118 } | |
| 119 return NULL; /* Unknown object */ | |
| 120 } | |
| 121 | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
122 /* Remove an object from the list of known objects */ |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
123 |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
124 static void |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
125 forgetgeneric(g) |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
126 genericobject *g; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
127 { |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
128 int i, n; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
129 |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
130 XDECREF(g->ob_callback); |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
131 g->ob_callback = NULL; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
132 XDECREF(g->ob_callback_arg); |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
133 g->ob_callback_arg = NULL; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
134 if (allgenerics == NULL) |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
135 return; /* No objects known yet */ |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
136 n = getlistsize(allgenerics); |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
137 for (i = 0; i < n; i++) { |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
138 if (g == (genericobject *)getlistitem(allgenerics, i)) { |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
139 setlistitem(allgenerics, i, (object *)NULL); |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
140 nfreeslots++; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
141 break; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
142 } |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
143 } |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
144 } |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
145 |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
146 /* Called when a form is about to be freed -- |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
147 remove all the objects that we know about from it. */ |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
148 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
149 static void |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
150 releaseobjects(form) |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
151 FL_FORM *form; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
152 { |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
153 int i, n; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
154 genericobject *g; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
155 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
156 if (allgenerics == NULL) |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
157 return; /* No objects known yet */ |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
158 n = getlistsize(allgenerics); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
159 for (i = 0; i < n; i++) { |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
160 g = (genericobject *)getlistitem(allgenerics, i); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
161 if (g != NULL && g->ob_generic->form == form) { |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
162 fl_delete_object(g->ob_generic); |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
163 /* The object is now unreachable for |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
164 do_forms and check_forms, so |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
165 delete it from the list of known objects */ |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
166 XDECREF(g->ob_callback); |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
167 g->ob_callback = NULL; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
168 XDECREF(g->ob_callback_arg); |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
169 g->ob_callback_arg = NULL; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
170 setlistitem(allgenerics, i, (object *)NULL); |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
171 nfreeslots++; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
172 } |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
173 } |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
174 } |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
175 |
| 328 | 176 |
| 177 /* Methods of generic objects */ | |
| 178 | |
| 179 static object * | |
| 180 generic_set_call_back(g, args) | |
| 181 genericobject *g; | |
| 182 object *args; | |
| 183 { | |
| 184 if (args == NULL) { | |
| 185 XDECREF(g->ob_callback); | |
| 186 XDECREF(g->ob_callback_arg); | |
| 187 g->ob_callback = NULL; | |
| 188 g->ob_callback_arg = NULL; | |
| 189 } | |
| 190 else { | |
| 191 if (!is_tupleobject(args) || gettuplesize(args) != 2) { | |
| 192 err_badarg(); | |
| 193 return NULL; | |
| 194 } | |
| 195 XDECREF(g->ob_callback); | |
| 196 XDECREF(g->ob_callback_arg); | |
| 197 g->ob_callback = gettupleitem(args, 0); | |
| 198 INCREF(g->ob_callback); | |
| 199 g->ob_callback_arg = gettupleitem(args, 1); | |
| 200 INCREF(g->ob_callback_arg); | |
| 201 } | |
| 202 INCREF(None); | |
| 203 return None; | |
| 204 } | |
| 205 | |
| 206 static object * | |
| 207 generic_call(g, args, func) | |
| 208 genericobject *g; | |
| 209 object *args; | |
| 210 void (*func)(FL_OBJECT *); | |
| 211 { | |
| 212 if (!getnoarg(args)) | |
| 213 return NULL; | |
| 214 (*func)(g->ob_generic); | |
| 215 INCREF(None); | |
| 216 return None; | |
| 217 } | |
| 218 | |
| 219 static object * | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
220 generic_delete_object(g, args) |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
221 genericobject *g; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
222 object *args; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
223 { |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
224 object *res; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
225 res = generic_call(g, args, fl_delete_object); |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
226 if (res != NULL) |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
227 forgetgeneric(g); |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
228 return res; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
229 } |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
230 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
231 static object * |
| 328 | 232 generic_show_object(g, args) |
| 233 genericobject *g; | |
| 234 object *args; | |
| 235 { | |
| 236 return generic_call(g, args, fl_show_object); | |
| 237 } | |
| 238 | |
| 239 static object * | |
| 240 generic_hide_object(g, args) | |
| 241 genericobject *g; | |
| 242 object *args; | |
| 243 { | |
| 244 return generic_call(g, args, fl_hide_object); | |
| 245 } | |
| 246 | |
| 247 static object * | |
| 248 generic_redraw_object(g, args) | |
| 249 genericobject *g; | |
| 250 object *args; | |
| 251 { | |
| 252 return generic_call(g, args, fl_redraw_object); | |
| 253 } | |
| 254 | |
| 255 static object * | |
| 256 generic_freeze_object(g, args) | |
| 257 genericobject *g; | |
| 258 object *args; | |
| 259 { | |
| 260 return generic_call(g, args, fl_freeze_object); | |
| 261 } | |
| 262 | |
| 263 static object * | |
| 264 generic_unfreeze_object(g, args) | |
| 265 genericobject *g; | |
| 266 object *args; | |
| 267 { | |
| 268 return generic_call(g, args, fl_unfreeze_object); | |
| 269 } | |
| 270 | |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
271 static object * |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
272 generic_activate_object(g, args) |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
273 genericobject *g; |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
274 object *args; |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
275 { |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
276 return generic_call(g, args, fl_activate_object); |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
277 } |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
278 |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
279 static object * |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
280 generic_deactivate_object(g, args) |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
281 genericobject *g; |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
282 object *args; |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
283 { |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
284 return generic_call(g, args, fl_deactivate_object); |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
285 } |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
286 |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
287 static object * |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
288 generic_set_object_shortcut(g, args) |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
289 genericobject *g; |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
290 object *args; |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
291 { |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
292 char *str; |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
293 if (!getargs(args, "s", &str)) |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
294 return NULL; |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
295 fl_set_object_shortcut(g->ob_generic, str); |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
296 INCREF(None); |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
297 return None; |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
298 } |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
299 |
| 328 | 300 static struct methodlist generic_methods[] = { |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
301 {"set_call_back", (method)generic_set_call_back}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
302 {"delete_object", (method)generic_delete_object}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
303 {"show_object", (method)generic_show_object}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
304 {"hide_object", (method)generic_hide_object}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
305 {"redraw_object", (method)generic_redraw_object}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
306 {"freeze_object", (method)generic_freeze_object}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
307 {"unfreeze_object", (method)generic_unfreeze_object}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
308 {"activate_object", (method)generic_activate_object}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
309 {"deactivate_object", (method)generic_deactivate_object}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
310 {"set_object_shortcut", (method)generic_set_object_shortcut}, |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
311 {NULL, NULL} /* sentinel */ |
| 328 | 312 }; |
| 313 | |
| 314 static void | |
| 315 generic_dealloc(g) | |
| 316 genericobject *g; | |
| 317 { | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
318 fl_free_object(g->ob_generic); |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
319 XDECREF(g->ob_callback); |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
320 XDECREF(g->ob_callback_arg); |
| 328 | 321 DEL(g); |
| 322 } | |
| 323 | |
| 324 #define OFF(x) offsetof(FL_OBJECT, x) | |
| 325 | |
| 326 static struct memberlist generic_memberlist[] = { | |
| 327 {"objclass", T_INT, OFF(objclass), RO}, | |
| 328 {"type", T_INT, OFF(type), RO}, | |
| 329 {"boxtype", T_INT, OFF(boxtype)}, | |
| 330 {"x", T_FLOAT, OFF(x)}, | |
| 331 {"y", T_FLOAT, OFF(y)}, | |
| 332 {"w", T_FLOAT, OFF(w)}, | |
| 333 {"h", T_FLOAT, OFF(h)}, | |
| 334 {"col1", T_INT, OFF(col1)}, | |
| 335 {"col2", T_INT, OFF(col2)}, | |
| 336 {"align", T_INT, OFF(align)}, | |
| 337 {"lcol", T_INT, OFF(lcol)}, | |
| 338 {"lsize", T_FLOAT, OFF(lsize)}, | |
| 339 /* "label" is treated specially! */ | |
| 340 {"lstyle", T_INT, OFF(lstyle)}, | |
| 341 {"pushed", T_INT, OFF(pushed), RO}, | |
| 342 {"focus", T_INT, OFF(focus), RO}, | |
| 343 {"belowmouse", T_INT, OFF(belowmouse),RO}, | |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
344 /* {"frozen", T_INT, OFF(frozen), RO}, */ |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
345 {"active", T_INT, OFF(active)}, |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
346 {"input", T_INT, OFF(input)}, |
| 328 | 347 {"visible", T_INT, OFF(visible), RO}, |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
348 {"radio", T_INT, OFF(radio)}, |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
349 {"automatic", T_INT, OFF(automatic)}, |
| 328 | 350 {NULL} /* Sentinel */ |
| 351 }; | |
| 352 | |
|
442
17f4cdf28959
Fixed duplicate use of OFF macro.
Guido van Rossum <guido@python.org>
parents:
437
diff
changeset
|
353 #undef OFF |
|
17f4cdf28959
Fixed duplicate use of OFF macro.
Guido van Rossum <guido@python.org>
parents:
437
diff
changeset
|
354 |
| 328 | 355 static object * |
| 356 generic_getattr(g, name) | |
| 357 genericobject *g; | |
| 358 char *name; | |
| 359 { | |
| 360 object *meth; | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
361 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
362 /* XXX Ought to special-case name "__methods__" */ |
| 328 | 363 if (g-> ob_methods) { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
364 meth = findmethod(g->ob_methods, (object *)g, name); |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
365 if (meth != NULL) return meth; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
366 err_clear(); |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
367 } |
| 328 | 368 |
| 369 meth = findmethod(generic_methods, (object *)g, name); | |
| 370 if (meth != NULL) | |
| 371 return meth; | |
| 372 err_clear(); | |
| 373 | |
| 374 /* "label" is an exception, getmember only works for char pointers, | |
| 375 not for char arrays */ | |
| 376 if (strcmp(name, "label") == 0) | |
| 377 return newstringobject(g->ob_generic->label); | |
| 378 | |
| 379 return getmember((char *)g->ob_generic, generic_memberlist, name); | |
| 380 } | |
| 381 | |
| 382 static int | |
| 383 generic_setattr(g, name, v) | |
| 384 genericobject *g; | |
| 385 char *name; | |
| 386 object *v; | |
| 387 { | |
| 388 int ret; | |
| 389 | |
| 390 if (v == NULL) { | |
| 391 err_setstr(TypeError, "can't delete forms object attributes"); | |
|
890
b3d639ad666d
fixed bugs in generic_setattr (returned NULL instead of
Guido van Rossum <guido@python.org>
parents:
812
diff
changeset
|
392 return -1; |
| 328 | 393 } |
| 394 | |
| 395 /* "label" is an exception: setmember doesn't set strings; | |
| 396 and FORMS wants you to call a function to set the label */ | |
| 397 if (strcmp(name, "label") == 0) { | |
| 398 if (!is_stringobject(v)) { | |
| 399 err_setstr(TypeError, "label attr must be string"); | |
|
890
b3d639ad666d
fixed bugs in generic_setattr (returned NULL instead of
Guido van Rossum <guido@python.org>
parents:
812
diff
changeset
|
400 return -1; |
| 328 | 401 } |
| 402 fl_set_object_label(g->ob_generic, getstringvalue(v)); | |
| 403 return 0; | |
| 404 } | |
| 405 | |
| 406 ret = setmember((char *)g->ob_generic, generic_memberlist, name, v); | |
| 407 | |
| 408 /* Rather than calling all the various set_object_* functions, | |
| 409 we call fl_redraw_object here. This is sometimes redundant | |
| 410 but I doubt that's a big problem */ | |
| 411 if (ret == 0) | |
| 412 fl_redraw_object(g->ob_generic); | |
| 413 | |
| 414 return ret; | |
| 415 } | |
| 416 | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
417 static object * |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
418 generic_repr(g) |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
419 genericobject *g; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
420 { |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
421 char buf[100]; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
422 sprintf(buf, "<FORMS_object at %lx, objclass=%d>", |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
423 (long)g, g->ob_generic->objclass); |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
424 return newstringobject(buf); |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
425 } |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
426 |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
427 static typeobject GenericObjecttype = { |
| 328 | 428 OB_HEAD_INIT(&Typetype) |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
429 0, /*ob_size*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
430 "FORMS_object", /*tp_name*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
431 sizeof(genericobject), /*tp_size*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
432 0, /*tp_itemsize*/ |
| 328 | 433 /* methods */ |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
434 (destructor)generic_dealloc, /*tp_dealloc*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
435 0, /*tp_print*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
436 (getattrfunc)generic_getattr, /*tp_getattr*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
437 (setattrfunc)generic_setattr, /*tp_setattr*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
438 0, /*tp_compare*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
439 (reprfunc)generic_repr, /*tp_repr*/ |
| 328 | 440 }; |
| 441 | |
| 442 static object * | |
| 443 newgenericobject(generic, methods) | |
| 444 FL_OBJECT *generic; | |
| 445 struct methodlist *methods; | |
| 446 { | |
| 447 genericobject *g; | |
| 448 g = NEWOBJ(genericobject, &GenericObjecttype); | |
| 449 if (g == NULL) | |
| 450 return NULL; | |
| 451 g-> ob_generic = generic; | |
| 452 g->ob_methods = methods; | |
| 453 g->ob_callback = NULL; | |
| 454 g->ob_callback_arg = NULL; | |
| 455 knowgeneric(g); | |
| 456 return (object *)g; | |
| 457 } | |
| 458 | |
| 459 /**********************************************************************/ | |
| 460 /* Some common calling sequences */ | |
| 461 | |
| 462 /* void func (object, float) */ | |
| 463 static object * | |
| 464 call_forms_INf (func, obj, args) | |
|
331
21c266f7eca1
Fixed almost all list errors.
Guido van Rossum <guido@python.org>
parents:
330
diff
changeset
|
465 void (*func)(FL_OBJECT *, float); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
466 FL_OBJECT *obj; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
467 object *args; |
| 328 | 468 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
469 float parameter; |
| 328 | 470 |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
471 if (!getargs(args, "f", ¶meter)) return NULL; |
| 328 | 472 |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
473 (*func) (obj, parameter); |
| 328 | 474 |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
475 INCREF(None); |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
476 return None; |
| 328 | 477 } |
| 478 | |
| 479 /* void func (object, float) */ | |
| 480 static object * | |
| 481 call_forms_INfINf (func, obj, args) | |
|
331
21c266f7eca1
Fixed almost all list errors.
Guido van Rossum <guido@python.org>
parents:
330
diff
changeset
|
482 void (*func)(FL_OBJECT *, float, float); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
483 FL_OBJECT *obj; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
484 object *args; |
| 328 | 485 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
486 float par1, par2; |
| 328 | 487 |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
488 if (!getargs(args, "(ff)", &par1, &par2)) return NULL; |
| 328 | 489 |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
490 (*func) (obj, par1, par2); |
| 328 | 491 |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
492 INCREF(None); |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
493 return None; |
| 328 | 494 } |
| 495 | |
| 496 /* void func (object, int) */ | |
| 497 static object * | |
| 498 call_forms_INi (func, obj, args) | |
|
331
21c266f7eca1
Fixed almost all list errors.
Guido van Rossum <guido@python.org>
parents:
330
diff
changeset
|
499 void (*func)(FL_OBJECT *, int); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
500 FL_OBJECT *obj; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
501 object *args; |
| 328 | 502 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
503 int parameter; |
| 328 | 504 |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
505 if (!getintarg(args, ¶meter)) return NULL; |
| 328 | 506 |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
507 (*func) (obj, parameter); |
| 328 | 508 |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
509 INCREF(None); |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
510 return None; |
| 328 | 511 } |
| 512 | |
| 469 | 513 /* void func (object, char) */ |
| 514 static object * | |
| 515 call_forms_INc (func, obj, args) | |
| 516 void (*func)(FL_OBJECT *, int); | |
| 517 FL_OBJECT *obj; | |
| 518 object *args; | |
| 519 { | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
520 char *a; |
| 469 | 521 |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
522 if (!getstrarg(args, &a)) return NULL; |
| 469 | 523 |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
524 (*func) (obj, a[0]); |
| 469 | 525 |
| 526 INCREF(None); | |
| 527 return None; | |
| 528 } | |
| 529 | |
| 328 | 530 /* void func (object, string) */ |
| 531 static object * | |
| 532 call_forms_INstr (func, obj, args) | |
|
331
21c266f7eca1
Fixed almost all list errors.
Guido van Rossum <guido@python.org>
parents:
330
diff
changeset
|
533 void (*func)(FL_OBJECT *, char *); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
534 FL_OBJECT *obj; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
535 object *args; |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
536 { |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
537 char *a; |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
538 |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
539 if (!getstrarg(args, &a)) return NULL; |
| 328 | 540 |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
541 (*func) (obj, a); |
| 328 | 542 |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
543 INCREF(None); |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
544 return None; |
| 328 | 545 } |
| 546 | |
| 547 | |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
548 /* void func (object, int, string) */ |
| 328 | 549 static object * |
| 550 call_forms_INiINstr (func, obj, args) | |
|
331
21c266f7eca1
Fixed almost all list errors.
Guido van Rossum <guido@python.org>
parents:
330
diff
changeset
|
551 void (*func)(FL_OBJECT *, int, char *); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
552 FL_OBJECT *obj; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
553 object *args; |
| 328 | 554 { |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
555 char *b; |
|
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
556 int a; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
557 |
|
1313
6ee380349c84
* Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.
Guido van Rossum <guido@python.org>
parents:
1262
diff
changeset
|
558 if (!getargs(args, "(is)", &a, &b)) return NULL; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
559 |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
560 (*func) (obj, a, b); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
561 |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
562 INCREF(None); |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
563 return None; |
| 328 | 564 } |
| 565 | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
566 #ifdef UNUSED |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
567 /* void func (object, int, int) */ |
| 328 | 568 static object * |
| 569 call_forms_INiINi (func, obj, args) | |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
570 void (*func)(FL_OBJECT *, int, int); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
571 FL_OBJECT *obj; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
572 object *args; |
| 328 | 573 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
574 int par1, par2; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
575 |
|
1313
6ee380349c84
* Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.
Guido van Rossum <guido@python.org>
parents:
1262
diff
changeset
|
576 if (!getargs(args, "(ii)", &par1, &par2)) return NULL; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
577 |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
578 (*func) (obj, par1, par2); |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
579 |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
580 INCREF(None); |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
581 return None; |
| 328 | 582 } |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
583 #endif |
| 328 | 584 |
| 585 /* int func (object) */ | |
| 586 static object * | |
| 587 call_forms_Ri (func, obj, args) | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
588 int (*func)(FL_OBJECT *); |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
589 FL_OBJECT *obj; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
590 object *args; |
| 328 | 591 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
592 int retval; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
593 |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
594 if (!getnoarg(args)) return NULL; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
595 |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
596 retval = (*func) (obj); |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
597 |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
598 return newintobject ((long) retval); |
| 328 | 599 } |
| 600 | |
| 601 /* char * func (object) */ | |
| 602 static object * | |
| 603 call_forms_Rstr (func, obj, args) | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
604 char * (*func)(FL_OBJECT *); |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
605 FL_OBJECT *obj; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
606 object *args; |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
607 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
608 char *str; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
609 |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
610 if (!getnoarg(args)) return NULL; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
611 |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
612 str = (*func) (obj); |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
613 |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
614 if (str == NULL) { |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
615 INCREF(None); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
616 return None; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
617 } |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
618 return newstringobject (str); |
| 328 | 619 } |
| 620 | |
| 621 /* int func (object) */ | |
| 622 static object * | |
| 623 call_forms_Rf (func, obj, args) | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
624 float (*func)(FL_OBJECT *); |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
625 FL_OBJECT *obj; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
626 object *args; |
| 328 | 627 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
628 float retval; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
629 |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
630 if (!getnoarg(args)) return NULL; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
631 |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
632 retval = (*func) (obj); |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
633 |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
634 return newfloatobject (retval); |
| 328 | 635 } |
| 636 | |
| 637 static object * | |
| 638 call_forms_OUTfOUTf (func, obj, args) | |
|
331
21c266f7eca1
Fixed almost all list errors.
Guido van Rossum <guido@python.org>
parents:
330
diff
changeset
|
639 void (*func)(FL_OBJECT *, float *, float *); |
| 328 | 640 FL_OBJECT *obj; |
| 641 object *args; | |
| 642 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
643 float f1, f2; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
644 |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
645 if (!getnoarg(args)) return NULL; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
646 |
| 328 | 647 (*func) (obj, &f1, &f2); |
| 648 | |
|
1252
c4cd0d9d8281
* Changed many files to use mkvalue() instead of newtupleobject().
Guido van Rossum <guido@python.org>
parents:
1079
diff
changeset
|
649 return mkvalue("(ff)", f1, f2); |
| 328 | 650 } |
| 651 | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
652 #ifdef UNUSED |
| 328 | 653 static object * |
| 654 call_forms_OUTf (func, obj, args) | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
655 void (*func)(FL_OBJECT *, float *); |
| 328 | 656 FL_OBJECT *obj; |
| 657 object *args; | |
| 658 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
659 float f; |
| 328 | 660 |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
661 if (!getnoarg(args)) return NULL; |
| 328 | 662 |
| 663 (*func) (obj, &f); | |
| 664 | |
| 665 return newfloatobject (f); | |
| 666 } | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
667 #endif |
| 328 | 668 |
| 669 /**********************************************************************/ | |
| 670 /* Class : browser */ | |
| 671 | |
| 672 static object * | |
| 673 set_browser_topline(g, args) | |
| 674 genericobject *g; | |
| 675 object *args; | |
| 676 { | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
677 return call_forms_INi (fl_set_browser_topline, g-> ob_generic, args); |
| 328 | 678 } |
| 679 | |
| 680 static object * | |
| 681 clear_browser(g, args) | |
| 682 genericobject *g; | |
| 683 object *args; | |
| 684 { | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
685 return generic_call (g, args, fl_clear_browser); |
| 328 | 686 } |
| 687 | |
| 688 static object * | |
| 689 add_browser_line (g, args) | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
690 genericobject *g; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
691 object *args; |
| 328 | 692 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
693 return call_forms_INstr (fl_add_browser_line, g-> ob_generic, args); |
| 328 | 694 } |
| 695 | |
| 696 static object * | |
| 697 addto_browser (g, args) | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
698 genericobject *g; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
699 object *args; |
| 328 | 700 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
701 return call_forms_INstr (fl_addto_browser, g-> ob_generic, args); |
| 328 | 702 } |
| 703 | |
| 704 static object * | |
| 705 insert_browser_line (g, args) | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
706 genericobject *g; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
707 object *args; |
| 328 | 708 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
709 return call_forms_INiINstr (fl_insert_browser_line, |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
710 g-> ob_generic, args); |
| 328 | 711 } |
| 712 | |
| 713 static object * | |
| 714 delete_browser_line (g, args) | |
| 715 genericobject *g; | |
| 716 object *args; | |
| 717 { | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
718 return call_forms_INi (fl_delete_browser_line, g-> ob_generic, args); |
| 328 | 719 } |
| 720 | |
| 721 static object * | |
| 722 replace_browser_line (g, args) | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
723 genericobject *g; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
724 object *args; |
| 328 | 725 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
726 return call_forms_INiINstr (fl_replace_browser_line, |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
727 g-> ob_generic, args); |
| 328 | 728 } |
| 729 | |
| 730 static object * | |
| 731 get_browser_line(g, args) | |
| 732 genericobject *g; | |
| 733 object *args; | |
| 734 { | |
| 735 int i; | |
| 736 char *str; | |
| 737 | |
| 738 if (!getintarg(args, &i)) | |
| 739 return NULL; | |
| 740 | |
| 741 str = fl_get_browser_line (g->ob_generic, i); | |
| 742 | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
743 if (str == NULL) { |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
744 INCREF(None); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
745 return None; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
746 } |
| 328 | 747 return newstringobject (str); |
| 748 } | |
| 749 | |
| 750 static object * | |
| 751 load_browser (g, args) | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
752 genericobject *g; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
753 object *args; |
| 328 | 754 { |
|
331
21c266f7eca1
Fixed almost all list errors.
Guido van Rossum <guido@python.org>
parents:
330
diff
changeset
|
755 /* XXX strictly speaking this is wrong since fl_load_browser |
|
21c266f7eca1
Fixed almost all list errors.
Guido van Rossum <guido@python.org>
parents:
330
diff
changeset
|
756 XXX returns int, not void */ |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
757 return call_forms_INstr (fl_load_browser, g-> ob_generic, args); |
| 328 | 758 } |
| 759 | |
| 760 static object * | |
| 761 get_browser_maxline(g, args) | |
| 762 genericobject *g; | |
| 763 object *args; | |
| 764 { | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
765 return call_forms_Ri (fl_get_browser_maxline, g-> ob_generic, args); |
| 328 | 766 } |
| 767 | |
| 768 static object * | |
| 769 select_browser_line (g, args) | |
| 770 genericobject *g; | |
| 771 object *args; | |
| 772 { | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
773 return call_forms_INi (fl_select_browser_line, g-> ob_generic, args); |
| 328 | 774 } |
| 775 | |
| 776 static object * | |
| 777 deselect_browser_line (g, args) | |
| 778 genericobject *g; | |
| 779 object *args; | |
| 780 { | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
781 return call_forms_INi (fl_deselect_browser_line, g-> ob_generic, args); |
| 328 | 782 } |
| 783 | |
| 784 static object * | |
| 785 deselect_browser (g, args) | |
| 786 genericobject *g; | |
| 787 object *args; | |
| 788 { | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
789 return generic_call (g, args, fl_deselect_browser); |
| 328 | 790 } |
| 791 | |
| 792 static object * | |
| 793 isselected_browser_line (g, args) | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
794 genericobject *g; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
795 object *args; |
| 328 | 796 { |
| 797 int i, j; | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
798 |
| 328 | 799 if (!getintarg(args, &i)) |
| 800 return NULL; | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
801 |
| 328 | 802 j = fl_isselected_browser_line (g->ob_generic, i); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
803 |
| 328 | 804 return newintobject (j); |
| 805 } | |
| 806 | |
| 807 static object * | |
| 808 get_browser (g, args) | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
809 genericobject *g; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
810 object *args; |
| 328 | 811 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
812 return call_forms_Ri (fl_get_browser, g-> ob_generic, args); |
| 328 | 813 } |
| 814 | |
| 815 static object * | |
| 816 set_browser_fontsize (g, args) | |
| 817 genericobject *g; | |
| 818 object *args; | |
| 819 { | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
820 return call_forms_INf (fl_set_browser_fontsize, g-> ob_generic, args); |
| 328 | 821 } |
| 822 | |
| 823 static object * | |
| 824 set_browser_fontstyle (g, args) | |
| 825 genericobject *g; | |
| 826 object *args; | |
| 827 { | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
828 return call_forms_INi (fl_set_browser_fontstyle, g-> ob_generic, args); |
| 328 | 829 } |
| 830 | |
| 469 | 831 static object * |
| 832 set_browser_specialkey (g, args) | |
| 833 genericobject *g; | |
| 834 object *args; | |
| 835 { | |
| 836 return call_forms_INc(fl_set_browser_specialkey, g-> ob_generic, args); | |
| 837 } | |
| 838 | |
| 328 | 839 static struct methodlist browser_methods[] = { |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
840 {"set_browser_topline", (method)set_browser_topline}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
841 {"clear_browser", (method)clear_browser}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
842 {"add_browser_line", (method)add_browser_line}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
843 {"addto_browser", (method)addto_browser}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
844 {"insert_browser_line", (method)insert_browser_line}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
845 {"delete_browser_line", (method)delete_browser_line}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
846 {"replace_browser_line", (method)replace_browser_line}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
847 {"get_browser_line", (method)get_browser_line}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
848 {"load_browser", (method)load_browser}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
849 {"get_browser_maxline", (method)get_browser_maxline}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
850 {"select_browser_line", (method)select_browser_line}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
851 {"deselect_browser_line", (method)deselect_browser_line}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
852 {"deselect_browser", (method)deselect_browser}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
853 {"isselected_browser_line", (method)isselected_browser_line}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
854 {"get_browser", (method)get_browser}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
855 {"set_browser_fontsize", (method)set_browser_fontsize}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
856 {"set_browser_fontstyle", (method)set_browser_fontstyle}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
857 {"set_browser_specialkey", (method)set_browser_specialkey}, |
| 469 | 858 {NULL, NULL} /* sentinel */ |
| 328 | 859 }; |
| 860 | |
| 861 /* Class: button */ | |
| 862 | |
| 863 static object * | |
| 864 set_button(g, args) | |
| 865 genericobject *g; | |
| 866 object *args; | |
| 867 { | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
868 return call_forms_INi (fl_set_button, g-> ob_generic, args); |
| 328 | 869 } |
| 870 | |
| 871 static object * | |
| 872 get_button(g, args) | |
| 873 genericobject *g; | |
| 874 object *args; | |
| 875 { | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
876 return call_forms_Ri (fl_get_button, g-> ob_generic, args); |
| 328 | 877 } |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
878 |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
879 static object * |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
880 get_button_numb(g, args) |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
881 genericobject *g; |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
882 object *args; |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
883 { |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
884 return call_forms_Ri (fl_get_button_numb, g-> ob_generic, args); |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
885 } |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
886 |
| 469 | 887 static object * |
| 888 set_button_shortcut(g, args) | |
| 889 genericobject *g; | |
| 890 object *args; | |
| 891 { | |
| 892 return call_forms_INstr (fl_set_button_shortcut, g-> ob_generic, args); | |
| 893 } | |
| 328 | 894 |
| 895 static struct methodlist button_methods[] = { | |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
896 {"set_button", (method)set_button}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
897 {"get_button", (method)get_button}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
898 {"get_button_numb", (method)get_button_numb}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
899 {"set_button_shortcut", (method)set_button_shortcut}, |
| 328 | 900 {NULL, NULL} /* sentinel */ |
| 901 }; | |
| 902 | |
| 903 /* Class: choice */ | |
| 904 | |
| 905 static object * | |
| 906 set_choice(g, args) | |
| 907 genericobject *g; | |
| 908 object *args; | |
| 909 { | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
910 return call_forms_INi (fl_set_choice, g-> ob_generic, args); |
| 328 | 911 } |
| 912 | |
| 913 static object * | |
| 914 get_choice(g, args) | |
| 915 genericobject *g; | |
| 916 object *args; | |
| 917 { | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
918 return call_forms_Ri (fl_get_choice, g-> ob_generic, args); |
| 328 | 919 } |
| 920 | |
| 921 static object * | |
| 922 clear_choice (g, args) | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
923 genericobject *g; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
924 object *args; |
| 328 | 925 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
926 return generic_call (g, args, fl_clear_choice); |
| 328 | 927 } |
| 928 | |
| 929 static object * | |
| 930 addto_choice (g, args) | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
931 genericobject *g; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
932 object *args; |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
933 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
934 return call_forms_INstr (fl_addto_choice, g-> ob_generic, args); |
| 328 | 935 } |
| 936 | |
| 937 static object * | |
| 938 replace_choice (g, args) | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
939 genericobject *g; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
940 object *args; |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
941 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
942 return call_forms_INiINstr (fl_replace_choice, g-> ob_generic, args); |
| 328 | 943 } |
| 944 | |
| 945 static object * | |
| 946 delete_choice (g, args) | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
947 genericobject *g; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
948 object *args; |
| 328 | 949 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
950 return call_forms_INi (fl_delete_choice, g-> ob_generic, args); |
| 328 | 951 } |
| 952 | |
| 953 static object * | |
| 954 get_choice_text (g, args) | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
955 genericobject *g; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
956 object *args; |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
957 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
958 return call_forms_Rstr (fl_get_choice_text, g-> ob_generic, args); |
| 328 | 959 } |
| 960 | |
| 961 static object * | |
| 962 set_choice_fontsize (g, args) | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
963 genericobject *g; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
964 object *args; |
| 328 | 965 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
966 return call_forms_INf (fl_set_choice_fontsize, g-> ob_generic, args); |
| 328 | 967 } |
| 968 | |
| 969 static object * | |
| 970 set_choice_fontstyle (g, args) | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
971 genericobject *g; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
972 object *args; |
| 328 | 973 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
974 return call_forms_INi (fl_set_choice_fontstyle, g-> ob_generic, args); |
| 328 | 975 } |
| 976 | |
| 977 static struct methodlist choice_methods[] = { | |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
978 {"set_choice", (method)set_choice}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
979 {"get_choice", (method)get_choice}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
980 {"clear_choice", (method)clear_choice}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
981 {"addto_choice", (method)addto_choice}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
982 {"replace_choice", (method)replace_choice}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
983 {"delete_choice", (method)delete_choice}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
984 {"get_choice_text", (method)get_choice_text}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
985 {"set_choice_fontsize", (method)set_choice_fontsize}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
986 {"set_choice_fontstyle",(method)set_choice_fontstyle}, |
| 328 | 987 {NULL, NULL} /* sentinel */ |
| 988 }; | |
| 989 | |
| 990 /* Class : Clock */ | |
| 991 | |
| 992 static object * | |
| 993 get_clock(g, args) | |
| 994 genericobject *g; | |
| 995 object *args; | |
| 996 { | |
| 997 int i0, i1, i2; | |
| 998 | |
| 999 if (!getnoarg(args)) | |
| 1000 return NULL; | |
| 1001 | |
| 1002 fl_get_clock (g->ob_generic, &i0, &i1, &i2); | |
| 1003 | |
|
1252
c4cd0d9d8281
* Changed many files to use mkvalue() instead of newtupleobject().
Guido van Rossum <guido@python.org>
parents:
1079
diff
changeset
|
1004 return mkvalue("(iii)", i0, i1, i2); |
| 328 | 1005 } |
| 1006 | |
| 1007 static struct methodlist clock_methods[] = { | |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1008 {"get_clock", (method)get_clock}, |
| 328 | 1009 {NULL, NULL} /* sentinel */ |
| 1010 }; | |
| 1011 | |
| 1012 /* CLass : Counters */ | |
| 1013 | |
| 1014 static object * | |
| 1015 get_counter_value(g, args) | |
| 1016 genericobject *g; | |
| 1017 object *args; | |
| 1018 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1019 return call_forms_Rf (fl_get_counter_value, g-> ob_generic, args); |
| 328 | 1020 } |
| 1021 | |
| 1022 static object * | |
| 1023 set_counter_value (g, args) | |
| 1024 genericobject *g; | |
| 1025 object *args; | |
| 1026 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1027 return call_forms_INf (fl_set_counter_value, g-> ob_generic, args); |
| 328 | 1028 } |
| 1029 | |
| 1030 static object * | |
| 1031 set_counter_precision (g, args) | |
| 1032 genericobject *g; | |
| 1033 object *args; | |
| 1034 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1035 return call_forms_INi (fl_set_counter_precision, g-> ob_generic, args); |
| 328 | 1036 } |
| 1037 | |
| 1038 static object * | |
| 1039 set_counter_bounds (g, args) | |
| 1040 genericobject *g; | |
| 1041 object *args; | |
| 1042 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1043 return call_forms_INfINf (fl_set_counter_bounds, g-> ob_generic, args); |
| 328 | 1044 } |
| 1045 | |
| 1046 static object * | |
| 1047 set_counter_step (g, args) | |
| 1048 genericobject *g; | |
| 1049 object *args; | |
| 1050 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1051 return call_forms_INfINf (fl_set_counter_step, g-> ob_generic, args); |
| 328 | 1052 } |
| 1053 | |
| 1054 static object * | |
| 1055 set_counter_return (g, args) | |
| 1056 genericobject *g; | |
| 1057 object *args; | |
| 1058 { | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1059 return call_forms_INi (fl_set_counter_return, g-> ob_generic, args); |
| 328 | 1060 } |
| 1061 | |
| 1062 static struct methodlist counter_methods[] = { | |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1063 {"set_counter_value", (method)set_counter_value}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1064 {"get_counter_value", (method)get_counter_value}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1065 {"set_counter_bounds", (method)set_counter_bounds}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1066 {"set_counter_step", (method)set_counter_step}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1067 {"set_counter_precision", (method)set_counter_precision}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1068 {"set_counter_return", (method)set_counter_return}, |
| 469 | 1069 {NULL, NULL} /* sentinel */ |
| 328 | 1070 }; |
| 1071 | |
| 1072 | |
| 1073 /* Class: Dials */ | |
| 1074 | |
| 1075 static object * | |
| 469 | 1076 get_dial_value(g, args) |
| 328 | 1077 genericobject *g; |
| 1078 object *args; | |
| 1079 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1080 return call_forms_Rf (fl_get_dial_value, g-> ob_generic, args); |
| 328 | 1081 } |
| 1082 | |
| 1083 static object * | |
| 1084 set_dial_value (g, args) | |
| 1085 genericobject *g; | |
| 1086 object *args; | |
| 1087 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1088 return call_forms_INf (fl_set_dial_value, g-> ob_generic, args); |
| 328 | 1089 } |
| 1090 | |
| 1091 static object * | |
| 1092 set_dial_bounds (g, args) | |
| 1093 genericobject *g; | |
| 1094 object *args; | |
| 1095 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1096 return call_forms_INfINf (fl_set_dial_bounds, g-> ob_generic, args); |
| 328 | 1097 } |
| 1098 | |
| 1099 static object * | |
| 1100 get_dial_bounds (g, args) | |
| 1101 genericobject *g; | |
| 1102 object *args; | |
| 1103 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1104 return call_forms_OUTfOUTf (fl_get_dial_bounds, g-> ob_generic, args); |
| 328 | 1105 } |
| 1106 | |
| 469 | 1107 static object * |
| 1108 set_dial_step (g, args) | |
| 1109 genericobject *g; | |
| 1110 object *args; | |
| 1111 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1112 return call_forms_INf (fl_set_dial_step, g-> ob_generic, args); |
| 469 | 1113 } |
| 1114 | |
| 328 | 1115 static struct methodlist dial_methods[] = { |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1116 {"set_dial_value", (method)set_dial_value}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1117 {"get_dial_value", (method)get_dial_value}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1118 {"set_dial_bounds", (method)set_dial_bounds}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1119 {"get_dial_bounds", (method)get_dial_bounds}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1120 {"set_dial_step", (method)set_dial_step}, |
| 328 | 1121 {NULL, NULL} /* sentinel */ |
| 1122 }; | |
| 1123 | |
| 1124 /* Class : Input */ | |
| 1125 | |
| 1126 static object * | |
| 1127 set_input (g, args) | |
| 1128 genericobject *g; | |
| 1129 object *args; | |
| 1130 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1131 return call_forms_INstr (fl_set_input, g-> ob_generic, args); |
| 328 | 1132 } |
| 1133 | |
| 1134 static object * | |
| 1135 get_input (g, args) | |
| 1136 genericobject *g; | |
| 1137 object *args; | |
| 1138 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1139 return call_forms_Rstr (fl_get_input, g-> ob_generic, args); |
| 328 | 1140 } |
| 1141 | |
| 1142 static object * | |
| 1143 set_input_color (g, args) | |
| 1144 genericobject *g; | |
| 1145 object *args; | |
| 1146 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1147 return call_forms_INfINf (fl_set_input_color, g-> ob_generic, args); |
| 328 | 1148 } |
| 1149 | |
| 469 | 1150 static object * |
| 1151 set_input_return (g, args) | |
| 1152 genericobject *g; | |
| 1153 object *args; | |
| 1154 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1155 return call_forms_INi (fl_set_input_return, g-> ob_generic, args); |
| 469 | 1156 } |
| 1157 | |
| 328 | 1158 static struct methodlist input_methods[] = { |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1159 {"set_input", (method)set_input}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1160 {"get_input", (method)get_input}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1161 {"set_input_color", (method)set_input_color}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1162 {"set_input_return", (method)set_input_return}, |
| 328 | 1163 {NULL, NULL} /* sentinel */ |
| 1164 }; | |
| 1165 | |
| 1166 | |
| 1167 /* Class : Menu */ | |
| 1168 | |
| 1169 static object * | |
| 1170 set_menu (g, args) | |
| 1171 genericobject *g; | |
| 1172 object *args; | |
| 1173 { | |
|
331
21c266f7eca1
Fixed almost all list errors.
Guido van Rossum <guido@python.org>
parents:
330
diff
changeset
|
1174 return call_forms_INstr (fl_set_menu, g-> ob_generic, args); |
| 328 | 1175 } |
| 1176 | |
| 1177 static object * | |
| 1178 get_menu (g, args) | |
| 1179 genericobject *g; | |
| 1180 object *args; | |
| 1181 { | |
|
331
21c266f7eca1
Fixed almost all list errors.
Guido van Rossum <guido@python.org>
parents:
330
diff
changeset
|
1182 /* XXX strictly speaking this is wrong since fl_get_menu |
|
21c266f7eca1
Fixed almost all list errors.
Guido van Rossum <guido@python.org>
parents:
330
diff
changeset
|
1183 XXX returns long, not int */ |
|
21c266f7eca1
Fixed almost all list errors.
Guido van Rossum <guido@python.org>
parents:
330
diff
changeset
|
1184 return call_forms_Ri (fl_get_menu, g-> ob_generic, args); |
| 328 | 1185 } |
| 1186 | |
| 1187 static object * | |
|
1262
f820e6917f07
Changes to speed up local variables enormously, by avoiding dictionary
Guido van Rossum <guido@python.org>
parents:
1252
diff
changeset
|
1188 get_menu_text (g, args) |
|
f820e6917f07
Changes to speed up local variables enormously, by avoiding dictionary
Guido van Rossum <guido@python.org>
parents:
1252
diff
changeset
|
1189 genericobject *g; |
|
f820e6917f07
Changes to speed up local variables enormously, by avoiding dictionary
Guido van Rossum <guido@python.org>
parents:
1252
diff
changeset
|
1190 object *args; |
|
f820e6917f07
Changes to speed up local variables enormously, by avoiding dictionary
Guido van Rossum <guido@python.org>
parents:
1252
diff
changeset
|
1191 { |
|
f820e6917f07
Changes to speed up local variables enormously, by avoiding dictionary
Guido van Rossum <guido@python.org>
parents:
1252
diff
changeset
|
1192 return call_forms_Rstr (fl_get_menu_text, g-> ob_generic, args); |
|
f820e6917f07
Changes to speed up local variables enormously, by avoiding dictionary
Guido van Rossum <guido@python.org>
parents:
1252
diff
changeset
|
1193 } |
|
f820e6917f07
Changes to speed up local variables enormously, by avoiding dictionary
Guido van Rossum <guido@python.org>
parents:
1252
diff
changeset
|
1194 |
|
f820e6917f07
Changes to speed up local variables enormously, by avoiding dictionary
Guido van Rossum <guido@python.org>
parents:
1252
diff
changeset
|
1195 static object * |
| 328 | 1196 addto_menu (g, args) |
| 1197 genericobject *g; | |
| 1198 object *args; | |
| 1199 { | |
|
331
21c266f7eca1
Fixed almost all list errors.
Guido van Rossum <guido@python.org>
parents:
330
diff
changeset
|
1200 return call_forms_INstr (fl_addto_menu, g-> ob_generic, args); |
| 328 | 1201 } |
| 1202 | |
| 1203 static struct methodlist menu_methods[] = { | |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1204 {"set_menu", (method)set_menu}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1205 {"get_menu", (method)get_menu}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1206 {"get_menu_text", (method)get_menu_text}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1207 {"addto_menu", (method)addto_menu}, |
| 328 | 1208 {NULL, NULL} /* sentinel */ |
| 1209 }; | |
| 1210 | |
| 1211 | |
| 1212 /* Class: Sliders */ | |
| 1213 | |
| 1214 static object * | |
| 469 | 1215 get_slider_value(g, args) |
| 328 | 1216 genericobject *g; |
| 1217 object *args; | |
| 1218 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1219 return call_forms_Rf (fl_get_slider_value, g-> ob_generic, args); |
| 328 | 1220 } |
| 1221 | |
| 1222 static object * | |
| 1223 set_slider_value (g, args) | |
| 1224 genericobject *g; | |
| 1225 object *args; | |
| 1226 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1227 return call_forms_INf (fl_set_slider_value, g-> ob_generic, args); |
| 328 | 1228 } |
| 1229 | |
| 1230 static object * | |
| 1231 set_slider_bounds (g, args) | |
| 1232 genericobject *g; | |
| 1233 object *args; | |
| 1234 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1235 return call_forms_INfINf (fl_set_slider_bounds, g-> ob_generic, args); |
| 328 | 1236 } |
| 1237 | |
| 1238 static object * | |
| 1239 get_slider_bounds (g, args) | |
| 1240 genericobject *g; | |
| 1241 object *args; | |
| 1242 { | |
| 1243 return call_forms_OUTfOUTf(fl_get_slider_bounds, g-> ob_generic, args); | |
| 1244 } | |
| 1245 | |
| 1246 static object * | |
| 1247 set_slider_return (g, args) | |
| 1248 genericobject *g; | |
| 1249 object *args; | |
| 1250 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1251 return call_forms_INf (fl_set_slider_return, g-> ob_generic, args); |
| 328 | 1252 } |
| 1253 | |
| 1254 static object * | |
| 1255 set_slider_size (g, args) | |
| 1256 genericobject *g; | |
| 1257 object *args; | |
| 1258 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1259 return call_forms_INf (fl_set_slider_size, g-> ob_generic, args); |
| 328 | 1260 } |
| 1261 | |
| 1262 static object * | |
| 1263 set_slider_precision (g, args) | |
| 1264 genericobject *g; | |
| 1265 object *args; | |
| 1266 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1267 return call_forms_INi (fl_set_slider_precision, g-> ob_generic, args); |
| 328 | 1268 } |
| 1269 | |
| 469 | 1270 static object * |
| 1271 set_slider_step (g, args) | |
| 1272 genericobject *g; | |
| 1273 object *args; | |
| 1274 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1275 return call_forms_INf (fl_set_slider_step, g-> ob_generic, args); |
| 469 | 1276 } |
| 1277 | |
| 1278 | |
| 328 | 1279 static struct methodlist slider_methods[] = { |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1280 {"set_slider_value", (method)set_slider_value}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1281 {"get_slider_value", (method)get_slider_value}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1282 {"set_slider_bounds", (method)set_slider_bounds}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1283 {"get_slider_bounds", (method)get_slider_bounds}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1284 {"set_slider_return", (method)set_slider_return}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1285 {"set_slider_size", (method)set_slider_size}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1286 {"set_slider_precision",(method)set_slider_precision}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1287 {"set_slider_step", (method)set_slider_step}, |
| 328 | 1288 {NULL, NULL} /* sentinel */ |
| 1289 }; | |
| 1290 | |
| 1291 static object * | |
| 1292 set_positioner_xvalue (g, args) | |
| 1293 genericobject *g; | |
| 1294 object *args; | |
| 1295 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1296 return call_forms_INf (fl_set_positioner_xvalue, g-> ob_generic, args); |
| 328 | 1297 } |
| 1298 | |
| 1299 static object * | |
| 1300 set_positioner_xbounds (g, args) | |
| 1301 genericobject *g; | |
| 1302 object *args; | |
| 1303 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1304 return call_forms_INfINf (fl_set_positioner_xbounds, |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1305 g-> ob_generic, args); |
| 328 | 1306 } |
| 1307 | |
| 1308 static object * | |
| 1309 set_positioner_yvalue (g, args) | |
| 1310 genericobject *g; | |
| 1311 object *args; | |
| 1312 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1313 return call_forms_INf (fl_set_positioner_yvalue, g-> ob_generic, args); |
| 328 | 1314 } |
| 1315 | |
| 1316 static object * | |
| 1317 set_positioner_ybounds (g, args) | |
| 1318 genericobject *g; | |
| 1319 object *args; | |
| 1320 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1321 return call_forms_INfINf (fl_set_positioner_ybounds, |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1322 g-> ob_generic, args); |
| 328 | 1323 } |
| 1324 | |
| 1325 static object * | |
| 1326 get_positioner_xvalue (g, args) | |
| 1327 genericobject *g; | |
| 1328 object *args; | |
| 1329 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1330 return call_forms_Rf (fl_get_positioner_xvalue, g-> ob_generic, args); |
| 328 | 1331 } |
| 1332 | |
| 1333 static object * | |
| 1334 get_positioner_xbounds (g, args) | |
| 1335 genericobject *g; | |
| 1336 object *args; | |
| 1337 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1338 return call_forms_OUTfOUTf (fl_get_positioner_xbounds, |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1339 g-> ob_generic, args); |
| 328 | 1340 } |
| 1341 | |
| 1342 static object * | |
| 1343 get_positioner_yvalue (g, args) | |
| 1344 genericobject *g; | |
| 1345 object *args; | |
| 1346 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1347 return call_forms_Rf (fl_get_positioner_yvalue, g-> ob_generic, args); |
| 328 | 1348 } |
| 1349 | |
| 1350 static object * | |
| 1351 get_positioner_ybounds (g, args) | |
| 1352 genericobject *g; | |
| 1353 object *args; | |
| 1354 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1355 return call_forms_OUTfOUTf (fl_get_positioner_ybounds, |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1356 g-> ob_generic, args); |
| 328 | 1357 } |
| 1358 | |
| 1359 static struct methodlist positioner_methods[] = { | |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1360 {"set_positioner_xvalue", (method)set_positioner_xvalue}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1361 {"set_positioner_yvalue", (method)set_positioner_yvalue}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1362 {"set_positioner_xbounds", (method)set_positioner_xbounds}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1363 {"set_positioner_ybounds", (method)set_positioner_ybounds}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1364 {"get_positioner_xvalue", (method)get_positioner_xvalue}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1365 {"get_positioner_yvalue", (method)get_positioner_yvalue}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1366 {"get_positioner_xbounds", (method)get_positioner_xbounds}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1367 {"get_positioner_ybounds", (method)get_positioner_ybounds}, |
| 328 | 1368 {NULL, NULL} /* sentinel */ |
| 1369 }; | |
| 1370 | |
| 1371 /* Class timer */ | |
| 1372 | |
| 1373 static object * | |
| 1374 set_timer (g, args) | |
| 1375 genericobject *g; | |
| 1376 object *args; | |
| 1377 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1378 return call_forms_INf (fl_set_timer, g-> ob_generic, args); |
| 328 | 1379 } |
| 1380 | |
| 1381 static object * | |
| 1382 get_timer (g, args) | |
| 1383 genericobject *g; | |
| 1384 object *args; | |
| 1385 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1386 return call_forms_Rf (fl_get_timer, g-> ob_generic, args); |
| 328 | 1387 } |
| 1388 | |
| 1389 static struct methodlist timer_methods[] = { | |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1390 {"set_timer", (method)set_timer}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1391 {"get_timer", (method)get_timer}, |
| 328 | 1392 {NULL, NULL} /* sentinel */ |
| 1393 }; | |
| 1394 | |
| 1395 /* Form objects */ | |
| 1396 | |
| 1397 typedef struct { | |
| 1398 OB_HEAD | |
| 1399 FL_FORM *ob_form; | |
| 1400 } formobject; | |
| 1401 | |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1402 staticforward typeobject Formtype; |
| 328 | 1403 |
| 1404 #define is_formobject(v) ((v)->ob_type == &Formtype) | |
| 1405 | |
| 1406 static object * | |
| 1407 form_show_form(f, args) | |
| 1408 formobject *f; | |
| 1409 object *args; | |
| 1410 { | |
| 1411 int place, border; | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
1412 char *name; |
|
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
1413 if (!getargs(args, "(iis)", &place, &border, &name)) |
| 328 | 1414 return NULL; |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
1415 fl_show_form(f->ob_form, place, border, name); |
| 328 | 1416 INCREF(None); |
| 1417 return None; | |
| 1418 } | |
| 1419 | |
| 1420 static object * | |
| 1421 form_call(func, f, args) | |
| 1422 FL_FORM *f; | |
| 1423 object *args; | |
| 1424 void (*func)(FL_FORM *); | |
| 1425 { | |
| 1426 if (!getnoarg(args)) return NULL; | |
| 1427 | |
| 1428 (*func)(f); | |
| 1429 | |
| 1430 INCREF(None); | |
| 1431 return None; | |
| 1432 } | |
| 1433 | |
| 1434 static object * | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1435 form_call_INiINi(func, f, args) |
| 328 | 1436 FL_FORM *f; |
| 1437 object *args; | |
| 1438 void (*func)(FL_FORM *, int, int); | |
| 1439 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1440 int a, b; |
| 328 | 1441 |
|
1313
6ee380349c84
* Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.
Guido van Rossum <guido@python.org>
parents:
1262
diff
changeset
|
1442 if (!getargs(args, "(ii)", &a, &b)) return NULL; |
| 328 | 1443 |
| 1444 (*func)(f, a, b); | |
| 1445 | |
| 1446 INCREF(None); | |
| 1447 return None; | |
| 1448 } | |
| 1449 | |
| 1450 static object * | |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1451 form_call_INfINf(func, f, args) |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1452 FL_FORM *f; |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1453 object *args; |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1454 void (*func)(FL_FORM *, float, float); |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1455 { |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1456 float a, b; |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1457 |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1458 if (!getargs(args, "(ff)", &a, &b)) return NULL; |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1459 |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1460 (*func)(f, a, b); |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1461 |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1462 INCREF(None); |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1463 return None; |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1464 } |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1465 |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1466 static object * |
| 328 | 1467 form_hide_form(f, args) |
| 1468 formobject *f; | |
| 1469 object *args; | |
| 1470 { | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1471 return form_call(fl_hide_form, f-> ob_form, args); |
| 328 | 1472 } |
| 1473 | |
| 1474 static object * | |
| 1475 form_redraw_form(f, args) | |
| 1476 formobject *f; | |
| 1477 object *args; | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1478 { |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1479 return form_call(fl_redraw_form, f-> ob_form, args); |
| 328 | 1480 } |
| 1481 | |
| 1482 static object * | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1483 form_add_object(f, args) |
| 328 | 1484 formobject *f; |
| 1485 object *args; | |
| 1486 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1487 genericobject *g; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1488 if (args == NULL || !is_genericobject(args)) { |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1489 err_badarg(); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1490 return NULL; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1491 } |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1492 g = (genericobject *)args; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1493 if (findgeneric(g->ob_generic) != NULL) { |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1494 err_setstr(RuntimeError, |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1495 "add_object of object already in a form"); |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1496 return NULL; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1497 } |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1498 fl_add_object(f->ob_form, g->ob_generic); |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1499 knowgeneric(g); |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1500 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1501 INCREF(None); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1502 return None; |
| 328 | 1503 } |
| 1504 | |
| 1505 static object * | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1506 form_set_form_position(f, args) |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1507 formobject *f; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1508 object *args; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1509 { |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1510 return form_call_INiINi(fl_set_form_position, f-> ob_form, args); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1511 } |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1512 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1513 static object * |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1514 form_set_form_size(f, args) |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1515 formobject *f; |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1516 object *args; |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1517 { |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1518 return form_call_INiINi(fl_set_form_size, f-> ob_form, args); |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1519 } |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1520 |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1521 static object * |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1522 form_scale_form(f, args) |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1523 formobject *f; |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1524 object *args; |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1525 { |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1526 return form_call_INfINf(fl_scale_form, f-> ob_form, args); |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1527 } |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1528 |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1529 static object * |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1530 generic_add_object(f, args, func, internal_methods) |
| 328 | 1531 formobject *f; |
| 1532 object *args; | |
| 1533 FL_OBJECT *(*func)(int, float, float, float, float, char*); | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1534 struct methodlist *internal_methods; |
| 328 | 1535 { |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1536 int type; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1537 float x, y, w, h; |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
1538 char *name; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1539 FL_OBJECT *obj; |
| 328 | 1540 |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
1541 if (!getargs(args,"(iffffs)", &type,&x,&y,&w,&h,&name)) |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1542 return NULL; |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1543 |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1544 fl_addto_form (f-> ob_form); |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1545 |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
1546 obj = (*func) (type, x, y, w, h, name); |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1547 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1548 fl_end_form(); |
| 328 | 1549 |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1550 if (obj == NULL) { |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1551 err_nomem(); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1552 return NULL; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1553 } |
| 328 | 1554 |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1555 return newgenericobject (obj, internal_methods); |
| 328 | 1556 } |
| 1557 | |
| 1558 static object * | |
| 1559 form_add_button(f, args) | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1560 formobject *f; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1561 object *args; |
| 328 | 1562 { |
| 1563 return generic_add_object(f, args, fl_add_button, button_methods); | |
| 1564 } | |
| 1565 | |
| 1566 static object * | |
| 1567 form_add_lightbutton(f, args) | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1568 formobject *f; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1569 object *args; |
| 328 | 1570 { |
| 1571 return generic_add_object(f, args, fl_add_lightbutton, button_methods); | |
| 1572 } | |
| 1573 | |
| 1574 static object * | |
| 1575 form_add_roundbutton(f, args) | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1576 formobject *f; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1577 object *args; |
| 328 | 1578 { |
| 1579 return generic_add_object(f, args, fl_add_roundbutton, button_methods); | |
| 1580 } | |
| 1581 | |
| 1582 static object * | |
| 1583 form_add_menu (f, args) | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1584 formobject *f; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1585 object *args; |
| 328 | 1586 { |
| 1587 return generic_add_object(f, args, fl_add_menu, menu_methods); | |
| 1588 } | |
| 1589 | |
| 1590 static object * | |
| 1591 form_add_slider(f, args) | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1592 formobject *f; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1593 object *args; |
| 328 | 1594 { |
| 1595 return generic_add_object(f, args, fl_add_slider, slider_methods); | |
| 1596 } | |
| 1597 | |
| 1598 static object * | |
| 1599 form_add_valslider(f, args) | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1600 formobject *f; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1601 object *args; |
| 328 | 1602 { |
| 1603 return generic_add_object(f, args, fl_add_valslider, slider_methods); | |
| 1604 } | |
| 1605 | |
| 1606 static object * | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1607 form_add_dial(f, args) |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1608 formobject *f; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1609 object *args; |
| 328 | 1610 { |
| 1611 return generic_add_object(f, args, fl_add_dial, dial_methods); | |
| 1612 } | |
| 1613 | |
| 1614 static object * | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1615 form_add_counter(f, args) |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1616 formobject *f; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1617 object *args; |
| 328 | 1618 { |
| 1619 return generic_add_object(f, args, fl_add_counter, counter_methods); | |
| 1620 } | |
| 1621 | |
| 1622 static object * | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1623 form_add_clock(f, args) |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1624 formobject *f; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1625 object *args; |
| 328 | 1626 { |
| 1627 return generic_add_object(f, args, fl_add_clock, clock_methods); | |
| 1628 } | |
| 1629 | |
| 1630 static object * | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1631 form_add_box(f, args) |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1632 formobject *f; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1633 object *args; |
| 328 | 1634 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1635 return generic_add_object(f, args, fl_add_box, |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1636 (struct methodlist *)NULL); |
| 328 | 1637 } |
| 1638 | |
| 1639 static object * | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1640 form_add_choice(f, args) |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1641 formobject *f; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1642 object *args; |
| 328 | 1643 { |
| 1644 return generic_add_object(f, args, fl_add_choice, choice_methods); | |
| 1645 } | |
| 1646 | |
| 1647 static object * | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1648 form_add_browser(f, args) |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1649 formobject *f; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1650 object *args; |
| 328 | 1651 { |
| 1652 return generic_add_object(f, args, fl_add_browser, browser_methods); | |
| 1653 } | |
| 1654 | |
| 1655 static object * | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1656 form_add_positioner(f, args) |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1657 formobject *f; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1658 object *args; |
| 328 | 1659 { |
| 1660 return generic_add_object(f, args, fl_add_positioner, positioner_methods); | |
| 1661 } | |
| 1662 | |
| 1663 static object * | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1664 form_add_input(f, args) |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1665 formobject *f; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1666 object *args; |
| 328 | 1667 { |
| 1668 return generic_add_object(f, args, fl_add_input, input_methods); | |
| 1669 } | |
| 1670 | |
| 1671 static object * | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1672 form_add_text(f, args) |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1673 formobject *f; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1674 object *args; |
| 328 | 1675 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1676 return generic_add_object(f, args, fl_add_text, |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1677 (struct methodlist *)NULL); |
| 328 | 1678 } |
| 1679 | |
| 1680 static object * | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1681 form_add_timer(f, args) |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1682 formobject *f; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1683 object *args; |
| 328 | 1684 { |
| 1685 return generic_add_object(f, args, fl_add_timer, timer_methods); | |
| 1686 } | |
| 1687 | |
| 1688 static object * | |
| 1689 form_freeze_form(f, args) | |
| 1690 formobject *f; | |
| 1691 object *args; | |
| 1692 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1693 return form_call(fl_freeze_form, f-> ob_form, args); |
| 328 | 1694 } |
| 1695 | |
| 1696 static object * | |
| 1697 form_unfreeze_form(f, args) | |
| 1698 formobject *f; | |
| 1699 object *args; | |
| 1700 { | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1701 return form_call(fl_unfreeze_form, f-> ob_form, args); |
| 328 | 1702 } |
| 1703 | |
| 1704 static object * | |
| 1705 form_activate_form(f, args) | |
| 1706 formobject *f; | |
| 1707 object *args; | |
| 1708 { | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1709 return form_call(fl_activate_form, f-> ob_form, args); |
| 328 | 1710 } |
| 1711 | |
| 1712 static object * | |
| 1713 form_deactivate_form(f, args) | |
| 1714 formobject *f; | |
| 1715 object *args; | |
| 1716 { | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1717 return form_call(fl_deactivate_form, f-> ob_form, args); |
| 328 | 1718 } |
| 1719 | |
|
329
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1720 static object * |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1721 form_bgn_group(f, args) |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1722 formobject *f; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1723 object *args; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1724 { |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1725 FL_OBJECT *obj; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1726 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1727 fl_addto_form(f-> ob_form); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1728 obj = fl_bgn_group(); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1729 fl_end_form(); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1730 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1731 if (obj == NULL) { |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1732 err_nomem(); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1733 return NULL; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1734 } |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1735 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1736 return newgenericobject (obj, (struct methodlist *) NULL); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1737 } |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1738 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1739 static object * |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1740 form_end_group(f, args) |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1741 formobject *f; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1742 object *args; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1743 { |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1744 fl_addto_form(f-> ob_form); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1745 fl_end_group(); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1746 fl_end_form(); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1747 INCREF(None); |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1748 return None; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1749 } |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1750 |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1751 static object * |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1752 forms_find_first_or_last(func, f, args) |
|
329
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1753 FL_OBJECT *(*func)(FL_FORM *, int, float, float); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1754 formobject *f; |
|
329
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1755 object *args; |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1756 { |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1757 int type; |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1758 float mx, my; |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1759 FL_OBJECT *generic; |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1760 genericobject *g; |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1761 |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
1762 if (!getargs(args, "(iff)", &type, &mx, &my)) return NULL; |
|
329
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1763 |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1764 generic = (*func) (f-> ob_form, type, mx, my); |
|
329
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1765 |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1766 if (generic == NULL) |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1767 { |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1768 INCREF(None); |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1769 return None; |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1770 } |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1771 |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1772 g = findgeneric(generic); |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1773 if (g == NULL) { |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1774 err_setstr(RuntimeError, |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1775 "forms_find_{first|last} returns unknown object"); |
|
329
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1776 return NULL; |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1777 } |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1778 INCREF(g); |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1779 return (object *) g; |
|
329
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1780 } |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1781 |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1782 static object * |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1783 form_find_first(f, args) |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1784 formobject *f; |
|
329
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1785 object *args; |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1786 { |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1787 return forms_find_first_or_last(fl_find_first, f, args); |
|
329
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1788 } |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1789 |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1790 static object * |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1791 form_find_last(f, args) |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1792 formobject *f; |
|
329
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1793 object *args; |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1794 { |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1795 return forms_find_first_or_last(fl_find_last, f, args); |
|
329
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1796 } |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1797 |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1798 static object * |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1799 form_set_object_focus(f, args) |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1800 formobject *f; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1801 object *args; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1802 { |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1803 genericobject *g; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1804 if (args == NULL || !is_genericobject(args)) { |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1805 err_badarg(); |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1806 return NULL; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1807 } |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1808 g = (genericobject *)args; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1809 fl_set_object_focus(f->ob_form, g->ob_generic); |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1810 INCREF(None); |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1811 return None; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1812 } |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1813 |
| 328 | 1814 static struct methodlist form_methods[] = { |
| 1815 /* adm */ | |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1816 {"show_form", (method)form_show_form}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1817 {"hide_form", (method)form_hide_form}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1818 {"redraw_form", (method)form_redraw_form}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1819 {"set_form_position", (method)form_set_form_position}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1820 {"set_form_size", (method)form_set_form_size}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1821 {"scale_form", (method)form_scale_form}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1822 {"freeze_form", (method)form_freeze_form}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1823 {"unfreeze_form", (method)form_unfreeze_form}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1824 {"activate_form", (method)form_activate_form}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1825 {"deactivate_form", (method)form_deactivate_form}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1826 {"bgn_group", (method)form_bgn_group}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1827 {"end_group", (method)form_end_group}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1828 {"find_first", (method)form_find_first}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1829 {"find_last", (method)form_find_last}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1830 {"set_object_focus", (method)form_set_object_focus}, |
| 328 | 1831 |
| 1832 /* basic objects */ | |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1833 {"add_button", (method)form_add_button}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1834 /* {"add_bitmap", (method)form_add_bitmap}, */ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1835 {"add_lightbutton", (method)form_add_lightbutton}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1836 {"add_roundbutton", (method)form_add_roundbutton}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1837 {"add_menu", (method)form_add_menu}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1838 {"add_slider", (method)form_add_slider}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1839 {"add_positioner", (method)form_add_positioner}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1840 {"add_valslider", (method)form_add_valslider}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1841 {"add_dial", (method)form_add_dial}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1842 {"add_counter", (method)form_add_counter}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1843 {"add_box", (method)form_add_box}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1844 {"add_clock", (method)form_add_clock}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1845 {"add_choice", (method)form_add_choice}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1846 {"add_browser", (method)form_add_browser}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1847 {"add_input", (method)form_add_input}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1848 {"add_timer", (method)form_add_timer}, |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1849 {"add_text", (method)form_add_text}, |
| 328 | 1850 {NULL, NULL} /* sentinel */ |
| 1851 }; | |
| 1852 | |
| 1853 static void | |
| 1854 form_dealloc(f) | |
| 1855 formobject *f; | |
| 1856 { | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1857 releaseobjects(f->ob_form); |
|
812
94ea6ea7f7d5
in form_dealloc, only hide the form if it's visible
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
1858 if (f->ob_form->visible) |
|
94ea6ea7f7d5
in form_dealloc, only hide the form if it's visible
Guido van Rossum <guido@python.org>
parents:
795
diff
changeset
|
1859 fl_hide_form(f->ob_form); |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1860 fl_free_form(f->ob_form); |
| 328 | 1861 DEL(f); |
| 1862 } | |
| 1863 | |
|
442
17f4cdf28959
Fixed duplicate use of OFF macro.
Guido van Rossum <guido@python.org>
parents:
437
diff
changeset
|
1864 #define OFF(x) offsetof(FL_FORM, x) |
|
17f4cdf28959
Fixed duplicate use of OFF macro.
Guido van Rossum <guido@python.org>
parents:
437
diff
changeset
|
1865 |
|
437
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1866 static struct memberlist form_memberlist[] = { |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1867 {"window", T_LONG, OFF(window), RO}, |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1868 {"w", T_FLOAT, OFF(w)}, |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1869 {"h", T_FLOAT, OFF(h)}, |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1870 {"x", T_FLOAT, OFF(x), RO}, |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1871 {"y", T_FLOAT, OFF(y), RO}, |
|
437
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1872 {"deactivated", T_INT, OFF(deactivated)}, |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1873 {"visible", T_INT, OFF(visible), RO}, |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1874 {"frozen", T_INT, OFF(frozen), RO}, |
|
437
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1875 {"doublebuf", T_INT, OFF(doublebuf)}, |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1876 {NULL} /* Sentinel */ |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1877 }; |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1878 |
|
442
17f4cdf28959
Fixed duplicate use of OFF macro.
Guido van Rossum <guido@python.org>
parents:
437
diff
changeset
|
1879 #undef OFF |
|
17f4cdf28959
Fixed duplicate use of OFF macro.
Guido van Rossum <guido@python.org>
parents:
437
diff
changeset
|
1880 |
| 328 | 1881 static object * |
| 1882 form_getattr(f, name) | |
| 1883 formobject *f; | |
| 1884 char *name; | |
| 1885 { | |
|
437
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1886 object *meth; |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1887 |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1888 meth = findmethod(form_methods, (object *)f, name); |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1889 if (meth != NULL) |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1890 return meth; |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1891 err_clear(); |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1892 return getmember((char *)f->ob_form, form_memberlist, name); |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1893 } |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1894 |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1895 static int |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1896 form_setattr(f, name, v) |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1897 formobject *f; |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1898 char *name; |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1899 object *v; |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1900 { |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1901 int ret; |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1902 |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1903 if (v == NULL) { |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1904 err_setstr(TypeError, "can't delete form attributes"); |
|
1482
b5b1f38befa4
One NULL should have been 0.
Sjoerd Mullender <sjoerd@acm.org>
parents:
1328
diff
changeset
|
1905 return 0; |
|
437
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1906 } |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1907 |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1908 return setmember((char *)f->ob_form, form_memberlist, name, v); |
| 328 | 1909 } |
| 1910 | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1911 static object * |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1912 form_repr(f) |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1913 formobject *f; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1914 { |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1915 char buf[100]; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1916 sprintf(buf, "<FORMS_form at %lx, window=%ld>", |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1917 (long)f, f->ob_form->window); |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1918 return newstringobject(buf); |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1919 } |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1920 |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1921 static typeobject Formtype = { |
| 328 | 1922 OB_HEAD_INIT(&Typetype) |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1923 0, /*ob_size*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1924 "FORMS_form", /*tp_name*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1925 sizeof(formobject), /*tp_size*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1926 0, /*tp_itemsize*/ |
| 328 | 1927 /* methods */ |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1928 (destructor)form_dealloc, /*tp_dealloc*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1929 0, /*tp_print*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1930 (getattrfunc)form_getattr, /*tp_getattr*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1931 (setattrfunc)form_setattr, /*tp_setattr*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1932 0, /*tp_compare*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1933 (reprfunc)form_repr, /*tp_repr*/ |
| 328 | 1934 }; |
| 1935 | |
| 1936 static object * | |
| 1937 newformobject(form) | |
| 1938 FL_FORM *form; | |
| 1939 { | |
| 1940 formobject *f; | |
| 1941 f = NEWOBJ(formobject, &Formtype); | |
| 1942 if (f == NULL) | |
| 1943 return NULL; | |
| 1944 f->ob_form = form; | |
| 1945 return (object *)f; | |
| 1946 } | |
| 1947 | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1948 |
| 328 | 1949 /* The "fl" module */ |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1950 |
| 328 | 1951 static object * |
| 1952 forms_make_form(dummy, args) | |
| 1953 object *dummy; | |
| 1954 object *args; | |
| 1955 { | |
| 1956 int type; | |
| 1957 float w, h; | |
| 1958 FL_FORM *form; | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
1959 if (!getargs(args, "(iff)", &type, &w, &h)) |
| 328 | 1960 return NULL; |
| 1961 form = fl_bgn_form(type, w, h); | |
| 1962 if (form == NULL) { | |
| 1963 /* XXX Actually, cannot happen! */ | |
| 1964 err_nomem(); | |
| 1965 return NULL; | |
| 1966 } | |
| 1967 fl_end_form(); | |
| 1968 return newformobject(form); | |
| 1969 } | |
| 1970 | |
|
726
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1971 static object * |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1972 forms_activate_all_forms(f, args) |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1973 object *f; |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1974 object *args; |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1975 { |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1976 fl_activate_all_forms(); |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1977 INCREF(None); |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1978 return None; |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1979 } |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1980 |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1981 static object * |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1982 forms_deactivate_all_forms(f, args) |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1983 object *f; |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1984 object *args; |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1985 { |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1986 fl_deactivate_all_forms(); |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1987 INCREF(None); |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1988 return None; |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1989 } |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1990 |
| 328 | 1991 static object *my_event_callback = NULL; |
| 1992 | |
| 1993 static object * | |
| 1994 forms_set_event_call_back(dummy, args) | |
| 1995 object *dummy; | |
| 1996 object *args; | |
| 1997 { | |
|
1328
e2deca983008
forms_set_event_call_back: argument of None resets event callback to NULL.
Guido van Rossum <guido@python.org>
parents:
1319
diff
changeset
|
1998 if (args == None) |
|
e2deca983008
forms_set_event_call_back: argument of None resets event callback to NULL.
Guido van Rossum <guido@python.org>
parents:
1319
diff
changeset
|
1999 args = NULL; |
| 328 | 2000 my_event_callback = args; |
| 2001 XINCREF(args); | |
| 2002 INCREF(None); | |
| 2003 return None; | |
| 2004 } | |
| 2005 | |
| 2006 static object * | |
| 2007 forms_do_or_check_forms(dummy, args, func) | |
| 2008 object *dummy; | |
| 2009 object *args; | |
| 2010 FL_OBJECT *(*func)(); | |
| 2011 { | |
| 2012 FL_OBJECT *generic; | |
| 2013 genericobject *g; | |
| 2014 object *arg, *res; | |
| 2015 | |
| 2016 if (!getnoarg(args)) | |
| 2017 return NULL; | |
| 2018 | |
| 2019 for (;;) { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2020 BGN_SAVE |
| 328 | 2021 generic = (*func)(); |
|
947
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
2022 END_SAVE |
| 328 | 2023 if (generic == NULL) { |
| 2024 INCREF(None); | |
| 2025 return None; | |
| 2026 } | |
| 2027 if (generic == FL_EVENT) { | |
| 2028 int dev; | |
| 2029 short val; | |
| 2030 if (my_event_callback == NULL) | |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2031 return newintobject(-1L); |
| 328 | 2032 dev = fl_qread(&val); |
|
1252
c4cd0d9d8281
* Changed many files to use mkvalue() instead of newtupleobject().
Guido van Rossum <guido@python.org>
parents:
1079
diff
changeset
|
2033 arg = mkvalue("(ih)", dev, val); |
| 328 | 2034 if (arg == NULL) |
| 2035 return NULL; | |
| 2036 res = call_object(my_event_callback, arg); | |
| 2037 XDECREF(res); | |
| 2038 DECREF(arg); | |
| 2039 if (res == NULL) | |
| 2040 return NULL; /* Callback raised exception */ | |
| 2041 continue; | |
| 2042 } | |
| 2043 g = findgeneric(generic); | |
| 2044 if (g == NULL) { | |
|
1079
e4c6a0dd5c2b
* bltinmodule.c: added built-in function cmp(a, b)
Guido van Rossum <guido@python.org>
parents:
1051
diff
changeset
|
2045 /* Object not known to us (some dialogs cause this) */ |
|
712
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2046 continue; /* Ignore it */ |
| 328 | 2047 } |
| 2048 if (g->ob_callback == NULL) { | |
| 2049 INCREF(g); | |
| 2050 return ((object *) g); | |
| 2051 } | |
|
1252
c4cd0d9d8281
* Changed many files to use mkvalue() instead of newtupleobject().
Guido van Rossum <guido@python.org>
parents:
1079
diff
changeset
|
2052 arg = mkvalue("(OO)", (object *)g, g->ob_callback_arg); |
|
c4cd0d9d8281
* Changed many files to use mkvalue() instead of newtupleobject().
Guido van Rossum <guido@python.org>
parents:
1079
diff
changeset
|
2053 if (arg == NULL) |
|
c4cd0d9d8281
* Changed many files to use mkvalue() instead of newtupleobject().
Guido van Rossum <guido@python.org>
parents:
1079
diff
changeset
|
2054 return NULL; |
| 328 | 2055 res = call_object(g->ob_callback, arg); |
| 2056 XDECREF(res); | |
| 2057 DECREF(arg); | |
| 2058 if (res == NULL) | |
| 2059 return NULL; /* Callback raised exception */ | |
| 2060 } | |
| 2061 } | |
| 2062 | |
| 2063 static object * | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2064 forms_do_forms(dummy, args) |
| 328 | 2065 object *dummy; |
| 2066 object *args; | |
| 2067 { | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2068 return forms_do_or_check_forms(dummy, args, fl_do_forms); |
| 328 | 2069 } |
| 2070 | |
| 2071 static object * | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2072 forms_check_forms(dummy, args) |
| 328 | 2073 object *dummy; |
| 2074 object *args; | |
| 2075 { | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2076 return forms_do_or_check_forms(dummy, args, fl_check_forms); |
| 328 | 2077 } |
| 2078 | |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2079 static object * |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2080 forms_do_only_forms(dummy, args) |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2081 object *dummy; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2082 object *args; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2083 { |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2084 return forms_do_or_check_forms(dummy, args, fl_do_only_forms); |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2085 } |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2086 |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2087 static object * |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2088 forms_check_only_forms(dummy, args) |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2089 object *dummy; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2090 object *args; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2091 { |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2092 return forms_do_or_check_forms(dummy, args, fl_check_only_forms); |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2093 } |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2094 |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2095 #ifdef UNUSED |
| 328 | 2096 static object * |
| 2097 fl_call(func, args) | |
| 2098 object *args; | |
| 2099 void (*func)(); | |
| 2100 { | |
| 2101 if (!getnoarg(args)) | |
| 2102 return NULL; | |
| 2103 (*func)(); | |
| 2104 INCREF(None); | |
| 2105 return None; | |
| 2106 } | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2107 #endif |
| 328 | 2108 |
| 469 | 2109 static object * |
| 2110 forms_set_graphics_mode(dummy, args) | |
| 2111 object *dummy; | |
| 2112 object *args; | |
| 2113 { | |
| 2114 int rgbmode, doublebuf; | |
| 2115 | |
|
1313
6ee380349c84
* Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.
Guido van Rossum <guido@python.org>
parents:
1262
diff
changeset
|
2116 if (!getargs(args, "(ii)", &rgbmode, &doublebuf)) |
| 469 | 2117 return NULL; |
| 2118 fl_set_graphics_mode(rgbmode,doublebuf); | |
| 2119 INCREF(None); | |
| 2120 return None; | |
| 2121 } | |
| 2122 | |
| 2123 static object * | |
| 2124 forms_get_rgbmode(dummy, args) | |
| 2125 object *dummy; | |
| 2126 object *args; | |
| 2127 { | |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2128 extern int fl_rgbmode; |
| 469 | 2129 |
| 2130 if (args != NULL) { | |
| 2131 err_badarg(); | |
| 2132 return NULL; | |
| 2133 } | |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2134 return newintobject((long)fl_rgbmode); |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2135 } |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2136 |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2137 static object * |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2138 forms_show_errors(dummy, args) |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2139 object *dummy; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2140 object *args; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2141 { |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2142 int show; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2143 if (!getargs(args, "i", &show)) |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2144 return NULL; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2145 fl_show_errors(show); |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2146 INCREF(None); |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2147 return None; |
| 469 | 2148 } |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2149 |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2150 static object * |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2151 forms_set_font_name(dummy, args) |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2152 object *dummy; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2153 object *args; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2154 { |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2155 int numb; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2156 char *name; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2157 if (!getargs(args, "(is)", &numb, &name)) |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2158 return NULL; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2159 fl_set_font_name(numb, name); |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2160 INCREF(None); |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2161 return None; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2162 } |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2163 |
| 469 | 2164 |
| 328 | 2165 static object * |
| 2166 forms_qdevice(self, args) | |
| 2167 object *self; | |
| 2168 object *args; | |
| 2169 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2170 short arg1; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2171 if (!getargs(args, "h", &arg1)) |
| 328 | 2172 return NULL; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2173 fl_qdevice(arg1); |
| 328 | 2174 INCREF(None); |
| 2175 return None; | |
| 2176 } | |
| 2177 | |
| 2178 static object * | |
| 2179 forms_unqdevice(self, args) | |
| 2180 object *self; | |
| 2181 object *args; | |
| 2182 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2183 short arg1; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2184 if (!getargs(args, "h", &arg1)) |
| 328 | 2185 return NULL; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2186 fl_unqdevice(arg1); |
| 328 | 2187 INCREF(None); |
| 2188 return None; | |
| 2189 } | |
| 2190 | |
| 2191 static object * | |
| 2192 forms_isqueued(self, args) | |
| 2193 object *self; | |
| 2194 object *args; | |
| 2195 { | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2196 long retval; |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2197 short arg1; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2198 if (!getargs(args, "h", &arg1)) |
| 328 | 2199 return NULL; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2200 retval = fl_isqueued(arg1); |
| 328 | 2201 |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2202 return newintobject(retval); |
| 328 | 2203 } |
| 2204 | |
| 2205 static object * | |
| 2206 forms_qtest(self, args) | |
| 2207 object *self; | |
| 2208 object *args; | |
| 2209 { | |
| 2210 long retval; | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2211 retval = fl_qtest(); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2212 return newintobject(retval); |
| 328 | 2213 } |
| 2214 | |
| 2215 | |
| 2216 static object * | |
| 2217 forms_qread(self, args) | |
| 2218 object *self; | |
| 2219 object *args; | |
| 2220 { | |
|
1252
c4cd0d9d8281
* Changed many files to use mkvalue() instead of newtupleobject().
Guido van Rossum <guido@python.org>
parents:
1079
diff
changeset
|
2221 int dev; |
|
c4cd0d9d8281
* Changed many files to use mkvalue() instead of newtupleobject().
Guido van Rossum <guido@python.org>
parents:
1079
diff
changeset
|
2222 short val; |
|
947
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
2223 BGN_SAVE |
|
1252
c4cd0d9d8281
* Changed many files to use mkvalue() instead of newtupleobject().
Guido van Rossum <guido@python.org>
parents:
1079
diff
changeset
|
2224 dev = fl_qread(&val); |
|
947
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
2225 END_SAVE |
|
1252
c4cd0d9d8281
* Changed many files to use mkvalue() instead of newtupleobject().
Guido van Rossum <guido@python.org>
parents:
1079
diff
changeset
|
2226 return mkvalue("(ih)", dev, val); |
| 328 | 2227 } |
| 2228 | |
| 2229 static object * | |
| 2230 forms_qreset(self, args) | |
| 2231 object *self; | |
| 2232 object *args; | |
| 2233 { | |
| 2234 if (!getnoarg(args)) return NULL; | |
| 2235 | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2236 fl_qreset(); |
| 328 | 2237 INCREF(None); |
| 2238 return None; | |
| 2239 } | |
| 2240 | |
| 2241 static object * | |
| 2242 forms_qenter(self, args) | |
| 2243 object *self; | |
| 2244 object *args; | |
| 2245 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2246 short arg1, arg2; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2247 if (!getargs(args, "(hh)", &arg1, &arg2)) |
| 328 | 2248 return NULL; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2249 fl_qenter(arg1, arg2); |
| 328 | 2250 INCREF(None); |
| 2251 return None; | |
| 2252 } | |
| 2253 | |
| 2254 static object * | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2255 forms_color(self, args) |
| 328 | 2256 object *self; |
| 2257 object *args; | |
| 2258 { | |
| 2259 int arg; | |
| 2260 | |
| 2261 if (!getintarg(args, &arg)) return NULL; | |
| 2262 | |
| 2263 fl_color((short) arg); | |
| 2264 | |
| 2265 INCREF(None); | |
| 2266 return None; | |
| 2267 } | |
| 2268 | |
| 2269 static object * | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2270 forms_mapcolor(self, args) |
| 328 | 2271 object *self; |
| 2272 object *args; | |
| 2273 { | |
| 2274 int arg0, arg1, arg2, arg3; | |
| 2275 | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
2276 if (!getargs(args, "(iiii)", &arg0, &arg1, &arg2, &arg3)) |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2277 return NULL; |
| 328 | 2278 |
| 2279 fl_mapcolor(arg0, (short) arg1, (short) arg2, (short) arg3); | |
| 2280 | |
| 2281 INCREF(None); | |
| 2282 return None; | |
| 2283 } | |
| 2284 | |
| 2285 static object * | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2286 forms_getmcolor(self, args) |
| 328 | 2287 object *self; |
| 2288 object *args; | |
| 2289 { | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2290 int arg; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2291 short r, g, b; |
| 328 | 2292 |
| 2293 if (!getintarg(args, &arg)) return NULL; | |
| 2294 | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2295 fl_getmcolor(arg, &r, &g, &b); |
| 328 | 2296 |
|
1252
c4cd0d9d8281
* Changed many files to use mkvalue() instead of newtupleobject().
Guido van Rossum <guido@python.org>
parents:
1079
diff
changeset
|
2297 return mkvalue("(hhh)", r, g, b); |
| 328 | 2298 } |
| 2299 | |
| 2300 static object * | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2301 forms_get_mouse(self, args) |
|
329
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
2302 object *self; |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
2303 object *args; |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
2304 { |
|
1252
c4cd0d9d8281
* Changed many files to use mkvalue() instead of newtupleobject().
Guido van Rossum <guido@python.org>
parents:
1079
diff
changeset
|
2305 float x, y; |
|
329
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
2306 |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
2307 if (!getnoarg(args)) return NULL; |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
2308 |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2309 fl_get_mouse(&x, &y); |
|
329
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
2310 |
|
1252
c4cd0d9d8281
* Changed many files to use mkvalue() instead of newtupleobject().
Guido van Rossum <guido@python.org>
parents:
1079
diff
changeset
|
2311 return mkvalue("(ff)", x, y); |
|
329
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
2312 } |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
2313 |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
2314 static object * |
| 328 | 2315 forms_tie(self, args) |
| 2316 object *self; | |
| 2317 object *args; | |
| 2318 { | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2319 short arg1, arg2, arg3; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2320 if (!getargs(args, "(hhh)", &arg1, &arg2, &arg3)) |
| 328 | 2321 return NULL; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2322 fl_tie(arg1, arg2, arg3); |
| 328 | 2323 INCREF(None); |
| 2324 return None; | |
| 2325 } | |
| 2326 | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2327 static object * |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2328 forms_show_message(f, args) |
|
726
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
2329 object *f; |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
2330 object *args; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2331 { |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
2332 char *a, *b, *c; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2333 |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2334 if (!getargs(args, "(sss)", &a, &b, &c)) return NULL; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2335 |
|
947
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
2336 BGN_SAVE |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
2337 fl_show_message(a, b, c); |
|
947
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
2338 END_SAVE |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2339 |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2340 INCREF(None); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2341 return None; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2342 } |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2343 |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2344 static object * |
|
712
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2345 forms_show_choice(f, args) |
|
726
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
2346 object *f; |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
2347 object *args; |
|
712
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2348 { |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2349 char *m1, *m2, *m3, *b1, *b2, *b3; |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2350 int nb; |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2351 char *format; |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2352 long rv; |
|
712
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2353 |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2354 if (args == NULL || !is_tupleobject(args)) { |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2355 err_badarg(); |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2356 return NULL; |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2357 } |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2358 nb = gettuplesize(args) - 3; |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2359 if (nb <= 0) { |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2360 err_setstr(TypeError, "need at least one button label"); |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2361 return NULL; |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2362 } |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2363 if (is_intobject(gettupleitem(args, 3))) { |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2364 err_setstr(TypeError, |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2365 "'number-of-buttons' argument not needed"); |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2366 return NULL; |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2367 } |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2368 switch (nb) { |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2369 case 1: format = "(ssss)"; break; |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2370 case 2: format = "(sssss)"; break; |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2371 case 3: format = "(ssssss)"; break; |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2372 default: |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2373 err_setstr(TypeError, "too many button labels"); |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2374 return NULL; |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2375 } |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2376 |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2377 if (!getargs(args, format, &m1, &m2, &m3, &b1, &b2, &b3)) |
|
712
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2378 return NULL; |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2379 |
|
947
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
2380 BGN_SAVE |
|
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
2381 rv = fl_show_choice(m1, m2, m3, nb, b1, b2, b3); |
|
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
2382 END_SAVE |
|
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
2383 return newintobject(rv); |
|
712
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2384 } |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2385 |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
2386 static object * |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2387 forms_show_question(f, args) |
|
726
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
2388 object *f; |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
2389 object *args; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2390 { |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
2391 int ret; |
|
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
2392 char *a, *b, *c; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2393 |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2394 if (!getargs(args, "(sss)", &a, &b, &c)) return NULL; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2395 |
|
947
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
2396 BGN_SAVE |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
2397 ret = fl_show_question(a, b, c); |
|
947
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
2398 END_SAVE |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2399 |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2400 return newintobject((long) ret); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2401 } |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2402 |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2403 static object * |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2404 forms_show_input(f, args) |
|
726
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
2405 object *f; |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
2406 object *args; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2407 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2408 char *str; |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
2409 char *a, *b; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2410 |
|
1313
6ee380349c84
* Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.
Guido van Rossum <guido@python.org>
parents:
1262
diff
changeset
|
2411 if (!getargs(args, "(ss)", &a, &b)) return NULL; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2412 |
|
947
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
2413 BGN_SAVE |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
2414 str = fl_show_input(a, b); |
|
947
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
2415 END_SAVE |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2416 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2417 if (str == NULL) { |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2418 INCREF(None); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2419 return None; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2420 } |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2421 return newstringobject(str); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2422 } |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2423 |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2424 static object * |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2425 forms_file_selector(f, args) |
|
726
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
2426 object *f; |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
2427 object *args; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2428 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2429 char *str; |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
2430 char *a, *b, *c, *d; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2431 |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2432 if (!getargs(args, "(ssss)", &a, &b, &c, &d)) return NULL; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2433 |
|
947
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
2434 BGN_SAVE |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
2435 str = fl_show_file_selector(a, b, c, d); |
|
947
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
2436 END_SAVE |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2437 |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2438 if (str == NULL) { |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2439 INCREF(None); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2440 return None; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2441 } |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2442 return newstringobject(str); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2443 } |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2444 |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2445 |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2446 static object * |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2447 forms_file_selector_func(args, func) |
|
726
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
2448 object *args; |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
2449 char *(*func)(); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2450 { |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2451 char *str; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2452 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2453 str = (*func) (); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2454 |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2455 if (str == NULL) { |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2456 INCREF(None); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2457 return None; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2458 } |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2459 return newstringobject(str); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2460 } |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2461 |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2462 static object * |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2463 forms_get_directory(f, args) |
|
726
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
2464 object *f; |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
2465 object *args; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2466 { |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2467 return forms_file_selector_func(args, fl_get_directory); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2468 } |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2469 |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2470 static object * |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2471 forms_get_pattern(f, args) |
|
726
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
2472 object *f; |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
2473 object *args; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2474 { |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2475 return forms_file_selector_func(args, fl_get_pattern); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2476 } |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2477 |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2478 static object * |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2479 forms_get_filename(f, args) |
|
726
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
2480 object *f; |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
2481 object *args; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2482 { |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2483 return forms_file_selector_func(args, fl_get_filename); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2484 } |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2485 |
| 328 | 2486 static struct methodlist forms_methods[] = { |
| 2487 /* adm */ | |
| 2488 {"make_form", forms_make_form}, | |
|
726
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
2489 {"activate_all_forms", forms_activate_all_forms}, |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
2490 {"deactivate_all_forms",forms_deactivate_all_forms}, |
| 328 | 2491 /* gl support wrappers */ |
| 2492 {"qdevice", forms_qdevice}, | |
| 2493 {"unqdevice", forms_unqdevice}, | |
| 2494 {"isqueued", forms_isqueued}, | |
| 2495 {"qtest", forms_qtest}, | |
| 2496 {"qread", forms_qread}, | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2497 /* {"blkqread", forms_blkqread}, */ |
| 328 | 2498 {"qreset", forms_qreset}, |
| 2499 {"qenter", forms_qenter}, | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2500 {"get_mouse", forms_get_mouse}, |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2501 {"tie", forms_tie}, |
| 328 | 2502 /* {"new_events", forms_new_events}, */ |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2503 {"color", forms_color}, |
| 328 | 2504 {"mapcolor", forms_mapcolor}, |
| 2505 {"getmcolor", forms_getmcolor}, | |
| 2506 /* interaction */ | |
| 2507 {"do_forms", forms_do_forms}, | |
|
1079
e4c6a0dd5c2b
* bltinmodule.c: added built-in function cmp(a, b)
Guido van Rossum <guido@python.org>
parents:
1051
diff
changeset
|
2508 {"do_only_forms", forms_do_only_forms}, |
| 328 | 2509 {"check_forms", forms_check_forms}, |
|
1079
e4c6a0dd5c2b
* bltinmodule.c: added built-in function cmp(a, b)
Guido van Rossum <guido@python.org>
parents:
1051
diff
changeset
|
2510 {"check_only_forms", forms_check_only_forms}, |
| 328 | 2511 {"set_event_call_back", forms_set_event_call_back}, |
| 2512 /* goodies */ | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2513 {"show_message", forms_show_message}, |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2514 {"show_question", forms_show_question}, |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2515 {"show_choice", forms_show_choice}, |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2516 {"show_input", forms_show_input}, |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2517 {"show_file_selector", forms_file_selector}, |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2518 {"file_selector", forms_file_selector}, /* BW compat */ |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2519 {"get_directory", forms_get_directory}, |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2520 {"get_pattern", forms_get_pattern}, |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2521 {"get_filename", forms_get_filename}, |
| 469 | 2522 {"set_graphics_mode", forms_set_graphics_mode}, |
| 2523 {"get_rgbmode", forms_get_rgbmode}, | |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2524 {"show_errors", forms_show_errors}, |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
2525 {"set_font_name", forms_set_font_name}, |
| 328 | 2526 {NULL, NULL} /* sentinel */ |
| 2527 }; | |
| 2528 | |
| 2529 void | |
| 2530 initfl() | |
| 2531 { | |
| 2532 initmodule("fl", forms_methods); | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2533 foreground(); |
| 469 | 2534 fl_init(); |
| 328 | 2535 } |
