Mercurial > cpython-lru_cache-weakref
annotate Modules/flmodule.c @ 49955:878d40468c4e legacy-trunk
Issue #4384: Added logging integration with warnings module using captureWarnings(). This change includes a NullHandler which does nothing; it will be of use to library developers who want to avoid the "No handlers could be found for logger XXX" message which can appear if the library user doesn't configure logging.
| author | Vinay Sajip <vinay_sajip@yahoo.co.uk> |
|---|---|
| date | Wed, 03 Dec 2008 23:22:58 +0000 |
| parents | 52294af4b663 |
| children | 1e92fe593916 |
| rev | line source |
|---|---|
| 328 | 1 /* FL module -- interface to Mark Overmars' FORMS Library. */ |
| 2 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
3 /* This code works with FORMS version 2.2 (if you defined |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
4 OBSOLETE_FORMS_CALLS), and 2.3. |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
5 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
|
6 /pub/SGI/FORMS. */ |
| 469 | 7 |
|
947
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
8 /* 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
|
9 * 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
|
10 * 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
|
11 * 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
|
12 * 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
|
13 * 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
|
14 * this module at any time). This will have to be fixed some time. |
|
13620
5b727ab37092
Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in either
Thomas Wouters <thomas@python.org>
parents:
13572
diff
changeset
|
15 * (A fix will probably also have to synchronize with the gl module). |
|
947
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
16 */ |
|
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
17 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
18 #include "Python.h" |
| 328 | 19 #include "forms.h" |
| 20 #include "structmember.h" | |
| 21 | |
| 22 /* Generic Forms Objects */ | |
| 23 | |
| 24 typedef struct { | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
25 PyObject_HEAD |
| 328 | 26 FL_OBJECT *ob_generic; |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
27 PyMethodDef *ob_methods; |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
28 PyObject *ob_callback; |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
29 PyObject *ob_callback_arg; |
| 328 | 30 } genericobject; |
| 31 | |
|
24280
1598a1e473e2
staticforward bites the dust.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
22712
diff
changeset
|
32 static PyTypeObject GenericObjecttype; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
33 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
34 #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
|
35 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
36 /* List of all objects (XXX this should be a hash table on address...) */ |
| 328 | 37 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
38 static PyObject *allgenerics = NULL; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
39 static int nfreeslots = 0; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
40 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
41 /* Add an object to the list of known objects */ |
| 328 | 42 |
| 43 static void | |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
44 knowgeneric(genericobject *g) |
| 328 | 45 { |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
46 int i, n; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
47 /* Create the list if it doesn't already exist */ |
| 328 | 48 if (allgenerics == NULL) { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
49 allgenerics = PyList_New(0); |
| 328 | 50 if (allgenerics == NULL) { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
51 PyErr_Clear(); |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
52 return; /* Too bad, live without allgenerics... */ |
| 328 | 53 } |
| 54 } | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
55 if (nfreeslots > 0) { |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
56 /* 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
|
57 /* XXX This can be made faster! */ |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
58 n = PyList_Size(allgenerics); |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
59 for (i = 0; i < n; i++) { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
60 if (PyList_GetItem(allgenerics, i) == NULL) { |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
61 Py_INCREF(g); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
62 PyList_SetItem(allgenerics, i, (PyObject *)g); |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
63 nfreeslots--; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
64 return; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
65 } |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
66 } |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
67 /* Strange... no free slots found... */ |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
68 nfreeslots = 0; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
69 } |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
70 /* No free entries, append new item to the end */ |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
71 PyList_Append(allgenerics, (PyObject *)g); |
| 328 | 72 } |
| 73 | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
74 /* 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
|
75 |
| 328 | 76 static genericobject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
77 findgeneric(FL_OBJECT *generic) |
| 328 | 78 { |
| 79 int i, n; | |
| 80 genericobject *g; | |
| 81 | |
| 82 if (allgenerics == NULL) | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
83 return NULL; /* No objects known yet */ |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
84 n = PyList_Size(allgenerics); |
| 328 | 85 for (i = 0; i < n; i++) { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
86 g = (genericobject *)PyList_GetItem(allgenerics, i); |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
87 if (g != NULL && g->ob_generic == generic) |
| 328 | 88 return g; |
| 89 } | |
| 90 return NULL; /* Unknown object */ | |
| 91 } | |
| 92 | |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
93 /* 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
|
94 |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
95 static void |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
96 forgetgeneric(genericobject *g) |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
97 { |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
98 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
|
99 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
100 Py_XDECREF(g->ob_callback); |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
101 g->ob_callback = NULL; |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
102 Py_XDECREF(g->ob_callback_arg); |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
103 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
|
104 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
|
105 return; /* No objects known yet */ |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
106 n = PyList_Size(allgenerics); |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
107 for (i = 0; i < n; i++) { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
108 if (g == (genericobject *)PyList_GetItem(allgenerics, i)) { |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
109 PyList_SetItem(allgenerics, i, (PyObject *)NULL); |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
110 nfreeslots++; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
111 break; |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
112 } |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
113 } |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
114 } |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
115 |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
116 /* 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
|
117 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
|
118 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
119 static void |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
120 releaseobjects(FL_FORM *form) |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
121 { |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
122 int i, n; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
123 genericobject *g; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
124 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
125 if (allgenerics == NULL) |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
126 return; /* No objects known yet */ |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
127 n = PyList_Size(allgenerics); |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
128 for (i = 0; i < n; i++) { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
129 g = (genericobject *)PyList_GetItem(allgenerics, i); |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
130 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
|
131 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
|
132 /* 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
|
133 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
|
134 delete it from the list of known objects */ |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
135 Py_XDECREF(g->ob_callback); |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
136 g->ob_callback = NULL; |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
137 Py_XDECREF(g->ob_callback_arg); |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
138 g->ob_callback_arg = NULL; |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
139 PyList_SetItem(allgenerics, i, (PyObject *)NULL); |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
140 nfreeslots++; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
141 } |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
142 } |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
143 } |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
144 |
| 328 | 145 |
| 146 /* Methods of generic objects */ | |
| 147 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
148 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
149 generic_set_call_back(genericobject *g, PyObject *args) |
| 328 | 150 { |
|
38490
a5298f371be7
Convert more modules to METH_VARARGS.
Georg Brandl <georg@python.org>
parents:
36324
diff
changeset
|
151 if (PyTuple_GET_SIZE(args) == 0) { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
152 Py_XDECREF(g->ob_callback); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
153 Py_XDECREF(g->ob_callback_arg); |
| 328 | 154 g->ob_callback = NULL; |
| 155 g->ob_callback_arg = NULL; | |
| 156 } | |
| 157 else { | |
|
38490
a5298f371be7
Convert more modules to METH_VARARGS.
Georg Brandl <georg@python.org>
parents:
36324
diff
changeset
|
158 PyObject *a, *b; |
|
a5298f371be7
Convert more modules to METH_VARARGS.
Georg Brandl <georg@python.org>
parents:
36324
diff
changeset
|
159 if (!PyArg_UnpackTuple(args, "set_call_back", 2, 2, &a, &b) |
|
a5298f371be7
Convert more modules to METH_VARARGS.
Georg Brandl <georg@python.org>
parents:
36324
diff
changeset
|
160 return NULL; |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
161 Py_XDECREF(g->ob_callback); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
162 Py_XDECREF(g->ob_callback_arg); |
|
38490
a5298f371be7
Convert more modules to METH_VARARGS.
Georg Brandl <georg@python.org>
parents:
36324
diff
changeset
|
163 g->ob_callback = a; |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
164 Py_INCREF(g->ob_callback); |
|
38490
a5298f371be7
Convert more modules to METH_VARARGS.
Georg Brandl <georg@python.org>
parents:
36324
diff
changeset
|
165 g->ob_callback_arg = b; |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
166 Py_INCREF(g->ob_callback_arg); |
| 328 | 167 } |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
168 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
169 return Py_None; |
| 328 | 170 } |
| 171 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
172 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
173 generic_call(genericobject *g, void (*func)(FL_OBJECT *)) |
| 328 | 174 { |
| 175 (*func)(g->ob_generic); | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
176 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
177 return Py_None; |
| 328 | 178 } |
| 179 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
180 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
181 generic_delete_object(genericobject *g) |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
182 { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
183 PyObject *res; |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
184 res = generic_call(g, 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
|
185 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
|
186 forgetgeneric(g); |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
187 return res; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
188 } |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
189 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
190 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
191 generic_show_object(genericobject *g) |
| 328 | 192 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
193 return generic_call(g, fl_show_object); |
| 328 | 194 } |
| 195 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
196 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
197 generic_hide_object(genericobject *g) |
| 328 | 198 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
199 return generic_call(g, fl_hide_object); |
| 328 | 200 } |
| 201 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
202 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
203 generic_redraw_object(genericobject *g) |
| 328 | 204 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
205 return generic_call(g, fl_redraw_object); |
| 328 | 206 } |
| 207 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
208 #ifdef OBSOLETE_FORMS_CALLS |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
209 |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
210 /* (un)freeze_object() are obsolete in FORMS 2.2 and unsupported |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
211 in 2.3. Since there's no foolproof way to tell which version we're |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
212 using, we omit them unconditionally. */ |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
213 |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
214 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
215 generic_freeze_object(genericobject *g) |
| 328 | 216 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
217 return generic_call(g, fl_freeze_object); |
| 328 | 218 } |
| 219 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
220 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
221 generic_unfreeze_object(genericobject *g) |
| 328 | 222 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
223 return generic_call(g, fl_unfreeze_object); |
| 328 | 224 } |
| 225 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
226 #endif /* OBSOLETE_FORMS_CALLS */ |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
227 |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
228 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
229 generic_activate_object(genericobject *g) |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
230 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
231 return generic_call(g, fl_activate_object); |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
232 } |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
233 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
234 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
235 generic_deactivate_object(genericobject *g) |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
236 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
237 return generic_call(g, fl_deactivate_object); |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
238 } |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
239 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
240 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
241 generic_set_object_shortcut(genericobject *g, PyObject *args) |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
242 { |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
243 char *str; |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
244 if (!PyArg_ParseTuple(args, "s:set_object_shortcut", &str)) |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
245 return NULL; |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
246 fl_set_object_shortcut(g->ob_generic, str); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
247 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
248 return Py_None; |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
249 } |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
250 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
251 static PyMethodDef generic_methods[] = { |
|
38490
a5298f371be7
Convert more modules to METH_VARARGS.
Georg Brandl <georg@python.org>
parents:
36324
diff
changeset
|
252 {"set_call_back", (PyCFunction)generic_set_call_back, METH_VARARGS}, |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
253 {"delete_object", (PyCFunction)generic_delete_object, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
254 {"show_object", (PyCFunction)generic_show_object, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
255 {"hide_object", (PyCFunction)generic_hide_object, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
256 {"redraw_object", (PyCFunction)generic_redraw_object, METH_NOARGS}, |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
257 #ifdef OBSOLETE_FORMS_CALLS |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
258 {"freeze_object", (PyCFunction)generic_freeze_object, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
259 {"unfreeze_object", (PyCFunction)generic_unfreeze_object, METH_NOARGS}, |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
260 #endif |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
261 {"activate_object", (PyCFunction)generic_activate_object, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
262 {"deactivate_object", (PyCFunction)generic_deactivate_object, METH_NOARGS}, |
|
38490
a5298f371be7
Convert more modules to METH_VARARGS.
Georg Brandl <georg@python.org>
parents:
36324
diff
changeset
|
263 {"set_object_shortcut", (PyCFunction)generic_set_object_shortcut, METH_VARARGS}, |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
264 {NULL, NULL} /* sentinel */ |
| 328 | 265 }; |
| 266 | |
| 267 static void | |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
268 generic_dealloc(genericobject *g) |
| 328 | 269 { |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
270 fl_free_object(g->ob_generic); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
271 Py_XDECREF(g->ob_callback); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
272 Py_XDECREF(g->ob_callback_arg); |
|
12576
1c7c2dd1beb1
Vladimir Marangozov's long-awaited malloc restructuring.
Guido van Rossum <guido@python.org>
parents:
9588
diff
changeset
|
273 PyObject_Del(g); |
| 328 | 274 } |
| 275 | |
| 276 #define OFF(x) offsetof(FL_OBJECT, x) | |
| 277 | |
| 278 static struct memberlist generic_memberlist[] = { | |
| 279 {"objclass", T_INT, OFF(objclass), RO}, | |
| 280 {"type", T_INT, OFF(type), RO}, | |
| 281 {"boxtype", T_INT, OFF(boxtype)}, | |
| 282 {"x", T_FLOAT, OFF(x)}, | |
| 283 {"y", T_FLOAT, OFF(y)}, | |
| 284 {"w", T_FLOAT, OFF(w)}, | |
| 285 {"h", T_FLOAT, OFF(h)}, | |
| 286 {"col1", T_INT, OFF(col1)}, | |
| 287 {"col2", T_INT, OFF(col2)}, | |
| 288 {"align", T_INT, OFF(align)}, | |
| 289 {"lcol", T_INT, OFF(lcol)}, | |
| 290 {"lsize", T_FLOAT, OFF(lsize)}, | |
| 291 /* "label" is treated specially! */ | |
| 292 {"lstyle", T_INT, OFF(lstyle)}, | |
| 293 {"pushed", T_INT, OFF(pushed), RO}, | |
| 294 {"focus", T_INT, OFF(focus), RO}, | |
| 295 {"belowmouse", T_INT, OFF(belowmouse),RO}, | |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
296 /* {"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
|
297 {"active", T_INT, OFF(active)}, |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
298 {"input", T_INT, OFF(input)}, |
| 328 | 299 {"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
|
300 {"radio", T_INT, OFF(radio)}, |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
301 {"automatic", T_INT, OFF(automatic)}, |
| 328 | 302 {NULL} /* Sentinel */ |
| 303 }; | |
| 304 | |
|
442
17f4cdf28959
Fixed duplicate use of OFF macro.
Guido van Rossum <guido@python.org>
parents:
437
diff
changeset
|
305 #undef OFF |
|
17f4cdf28959
Fixed duplicate use of OFF macro.
Guido van Rossum <guido@python.org>
parents:
437
diff
changeset
|
306 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
307 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
308 generic_getattr(genericobject *g, char *name) |
| 328 | 309 { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
310 PyObject *meth; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
311 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
312 /* XXX Ought to special-case name "__methods__" */ |
| 328 | 313 if (g-> ob_methods) { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
314 meth = Py_FindMethod(g->ob_methods, (PyObject *)g, name); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
315 if (meth != NULL) return meth; |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
316 PyErr_Clear(); |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
317 } |
| 328 | 318 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
319 meth = Py_FindMethod(generic_methods, (PyObject *)g, name); |
| 328 | 320 if (meth != NULL) |
| 321 return meth; | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
322 PyErr_Clear(); |
| 328 | 323 |
| 324 /* "label" is an exception, getmember only works for char pointers, | |
| 325 not for char arrays */ | |
| 326 if (strcmp(name, "label") == 0) | |
|
47527
52294af4b663
This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents:
47294
diff
changeset
|
327 return PyString_FromString(g->ob_generic->label); |
| 328 | 328 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
329 return PyMember_Get((char *)g->ob_generic, generic_memberlist, name); |
| 328 | 330 } |
| 331 | |
| 332 static int | |
|
13572
e417d9528fd6
Fixed up some ANSIfications.
Sjoerd Mullender <sjoerd@acm.org>
parents:
13514
diff
changeset
|
333 generic_setattr(genericobject *g, char *name, PyObject *v) |
| 328 | 334 { |
| 335 int ret; | |
| 336 | |
| 337 if (v == NULL) { | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
338 PyErr_SetString(PyExc_TypeError, |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
339 "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
|
340 return -1; |
| 328 | 341 } |
| 342 | |
| 343 /* "label" is an exception: setmember doesn't set strings; | |
| 344 and FORMS wants you to call a function to set the label */ | |
| 345 if (strcmp(name, "label") == 0) { | |
|
47527
52294af4b663
This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents:
47294
diff
changeset
|
346 if (!PyString_Check(v)) { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
347 PyErr_SetString(PyExc_TypeError, |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
348 "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
|
349 return -1; |
| 328 | 350 } |
|
47527
52294af4b663
This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents:
47294
diff
changeset
|
351 fl_set_object_label(g->ob_generic, PyString_AsString(v)); |
| 328 | 352 return 0; |
| 353 } | |
| 354 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
355 ret = PyMember_Set((char *)g->ob_generic, generic_memberlist, name, v); |
| 328 | 356 |
| 357 /* Rather than calling all the various set_object_* functions, | |
| 358 we call fl_redraw_object here. This is sometimes redundant | |
| 359 but I doubt that's a big problem */ | |
| 360 if (ret == 0) | |
| 361 fl_redraw_object(g->ob_generic); | |
| 362 | |
| 363 return ret; | |
| 364 } | |
| 365 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
366 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
367 generic_repr(genericobject *g) |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
368 { |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
369 char buf[100]; |
|
21073
304b34023876
sprintf -> PyOS_snprintf in some "obviously safe" cases.
Tim Peters <tim.peters@gmail.com>
parents:
14375
diff
changeset
|
370 PyOS_snprintf(buf, sizeof(buf), "<FORMS_object at %p, objclass=%d>", |
|
304b34023876
sprintf -> PyOS_snprintf in some "obviously safe" cases.
Tim Peters <tim.peters@gmail.com>
parents:
14375
diff
changeset
|
371 g, g->ob_generic->objclass); |
|
47527
52294af4b663
This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents:
47294
diff
changeset
|
372 return PyString_FromString(buf); |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
373 } |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
374 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
375 static PyTypeObject GenericObjecttype = { |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
376 PyObject_HEAD_INIT(&PyType_Type) |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
377 0, /*ob_size*/ |
|
21313
91dd223829c6
Patch supplied by Burton Radons for his own SF bug #487390: Modifying
Guido van Rossum <guido@python.org>
parents:
21073
diff
changeset
|
378 "fl.FORMS_object", /*tp_name*/ |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
379 sizeof(genericobject), /*tp_size*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
380 0, /*tp_itemsize*/ |
| 328 | 381 /* methods */ |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
382 (destructor)generic_dealloc, /*tp_dealloc*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
383 0, /*tp_print*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
384 (getattrfunc)generic_getattr, /*tp_getattr*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
385 (setattrfunc)generic_setattr, /*tp_setattr*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
386 0, /*tp_compare*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
387 (reprfunc)generic_repr, /*tp_repr*/ |
| 328 | 388 }; |
| 389 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
390 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
391 newgenericobject(FL_OBJECT *generic, PyMethodDef *methods) |
| 328 | 392 { |
| 393 genericobject *g; | |
|
12576
1c7c2dd1beb1
Vladimir Marangozov's long-awaited malloc restructuring.
Guido van Rossum <guido@python.org>
parents:
9588
diff
changeset
|
394 g = PyObject_New(genericobject, &GenericObjecttype); |
| 328 | 395 if (g == NULL) |
| 396 return NULL; | |
| 397 g-> ob_generic = generic; | |
| 398 g->ob_methods = methods; | |
| 399 g->ob_callback = NULL; | |
| 400 g->ob_callback_arg = NULL; | |
| 401 knowgeneric(g); | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
402 return (PyObject *)g; |
| 328 | 403 } |
| 404 | |
| 405 /**********************************************************************/ | |
| 406 /* Some common calling sequences */ | |
| 407 | |
| 408 /* void func (object, float) */ | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
409 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
410 call_forms_INf (void (*func)(FL_OBJECT *, float), FL_OBJECT *obj, PyObject *args) |
| 328 | 411 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
412 float parameter; |
| 328 | 413 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
414 if (!PyArg_Parse(args, "f", ¶meter)) return NULL; |
| 328 | 415 |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
416 (*func) (obj, parameter); |
| 328 | 417 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
418 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
419 return Py_None; |
| 328 | 420 } |
| 421 | |
| 422 /* void func (object, float) */ | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
423 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
424 call_forms_INfINf (void (*func)(FL_OBJECT *, float, float), FL_OBJECT *obj, PyObject *args) |
| 328 | 425 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
426 float par1, par2; |
| 328 | 427 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
428 if (!PyArg_Parse(args, "(ff)", &par1, &par2)) return NULL; |
| 328 | 429 |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
430 (*func) (obj, par1, par2); |
| 328 | 431 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
432 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
433 return Py_None; |
| 328 | 434 } |
| 435 | |
| 436 /* void func (object, int) */ | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
437 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
438 call_forms_INi (void (*func)(FL_OBJECT *, int), FL_OBJECT *obj, PyObject *args) |
| 328 | 439 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
440 int parameter; |
| 328 | 441 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
442 if (!PyArg_Parse(args, "i", ¶meter)) return NULL; |
| 328 | 443 |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
444 (*func) (obj, parameter); |
| 328 | 445 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
446 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
447 return Py_None; |
| 328 | 448 } |
| 449 | |
| 469 | 450 /* void func (object, char) */ |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
451 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
452 call_forms_INc (void (*func)(FL_OBJECT *, int), FL_OBJECT *obj, PyObject *args) |
| 469 | 453 { |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
454 char *a; |
| 469 | 455 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
456 if (!PyArg_Parse(args, "s", &a)) return NULL; |
| 469 | 457 |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
458 (*func) (obj, a[0]); |
| 469 | 459 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
460 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
461 return Py_None; |
| 469 | 462 } |
| 463 | |
| 328 | 464 /* void func (object, string) */ |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
465 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
466 call_forms_INstr (void (*func)(FL_OBJECT *, char *), FL_OBJECT *obj, PyObject *args) |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
467 { |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
468 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
|
469 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
470 if (!PyArg_Parse(args, "s", &a)) return NULL; |
| 328 | 471 |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
472 (*func) (obj, a); |
| 328 | 473 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
474 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
475 return Py_None; |
| 328 | 476 } |
| 477 | |
| 478 | |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
479 /* void func (object, int, string) */ |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
480 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
481 call_forms_INiINstr (void (*func)(FL_OBJECT *, int, char *), FL_OBJECT *obj, PyObject *args) |
| 328 | 482 { |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
483 char *b; |
|
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
484 int a; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
485 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
486 if (!PyArg_Parse(args, "(is)", &a, &b)) return NULL; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
487 |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
488 (*func) (obj, a, b); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
489 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
490 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
491 return Py_None; |
| 328 | 492 } |
| 493 | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
494 #ifdef UNUSED |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
495 /* void func (object, int, int) */ |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
496 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
497 call_forms_INiINi (void (*func)(FL_OBJECT *, int, int), FL_OBJECT *obj, PyObject *args) |
| 328 | 498 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
499 int par1, par2; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
500 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
501 if (!PyArg_Parse(args, "(ii)", &par1, &par2)) return NULL; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
502 |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
503 (*func) (obj, par1, par2); |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
504 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
505 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
506 return Py_None; |
| 328 | 507 } |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
508 #endif |
| 328 | 509 |
| 510 /* int func (object) */ | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
511 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
512 call_forms_Ri (int (*func)(FL_OBJECT *), FL_OBJECT *obj) |
| 328 | 513 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
514 int retval; |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
515 |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
516 retval = (*func) (obj); |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
517 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
518 return PyInt_FromLong ((long) retval); |
| 328 | 519 } |
| 520 | |
| 521 /* char * func (object) */ | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
522 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
523 call_forms_Rstr (char * (*func)(FL_OBJECT *), FL_OBJECT *obj) |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
524 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
525 char *str; |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
526 |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
527 str = (*func) (obj); |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
528 |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
529 if (str == NULL) { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
530 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
531 return Py_None; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
532 } |
|
47527
52294af4b663
This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents:
47294
diff
changeset
|
533 return PyString_FromString (str); |
| 328 | 534 } |
| 535 | |
| 536 /* int func (object) */ | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
537 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
538 call_forms_Rf (float (*func)(FL_OBJECT *), FL_OBJECT *obj) |
| 328 | 539 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
540 float retval; |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
541 |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
542 retval = (*func) (obj); |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
543 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
544 return PyFloat_FromDouble (retval); |
| 328 | 545 } |
| 546 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
547 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
548 call_forms_OUTfOUTf (void (*func)(FL_OBJECT *, float *, float *), FL_OBJECT *obj) |
| 328 | 549 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
550 float f1, f2; |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
551 |
| 328 | 552 (*func) (obj, &f1, &f2); |
| 553 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
554 return Py_BuildValue("(ff)", f1, f2); |
| 328 | 555 } |
| 556 | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
557 #ifdef UNUSED |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
558 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
559 call_forms_OUTf (void (*func)(FL_OBJECT *, float *), FL_OBJECT *obj) |
| 328 | 560 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
561 float f; |
| 328 | 562 |
| 563 (*func) (obj, &f); | |
| 564 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
565 return PyFloat_FromDouble (f); |
| 328 | 566 } |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
567 #endif |
| 328 | 568 |
| 569 /**********************************************************************/ | |
| 570 /* Class : browser */ | |
| 571 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
572 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
573 set_browser_topline(genericobject *g, PyObject *args) |
| 328 | 574 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
575 return call_forms_INi (fl_set_browser_topline, g-> ob_generic, args); |
| 328 | 576 } |
| 577 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
578 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
579 clear_browser(genericobject *g) |
| 328 | 580 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
581 return generic_call (g, fl_clear_browser); |
| 328 | 582 } |
| 583 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
584 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
585 add_browser_line (genericobject *g, PyObject *args) |
| 328 | 586 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
587 return call_forms_INstr (fl_add_browser_line, g-> ob_generic, args); |
| 328 | 588 } |
| 589 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
590 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
591 addto_browser (genericobject *g, PyObject *args) |
| 328 | 592 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
593 return call_forms_INstr (fl_addto_browser, g-> ob_generic, args); |
| 328 | 594 } |
| 595 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
596 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
597 insert_browser_line (genericobject *g, PyObject *args) |
| 328 | 598 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
599 return call_forms_INiINstr (fl_insert_browser_line, |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
600 g-> ob_generic, args); |
| 328 | 601 } |
| 602 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
603 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
604 delete_browser_line (genericobject *g, PyObject *args) |
| 328 | 605 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
606 return call_forms_INi (fl_delete_browser_line, g-> ob_generic, args); |
| 328 | 607 } |
| 608 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
609 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
610 replace_browser_line (genericobject *g, PyObject *args) |
| 328 | 611 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
612 return call_forms_INiINstr (fl_replace_browser_line, |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
613 g-> ob_generic, args); |
| 328 | 614 } |
| 615 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
616 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
617 get_browser_line(genericobject *g, PyObject *args) |
| 328 | 618 { |
| 619 int i; | |
| 620 char *str; | |
| 621 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
622 if (!PyArg_Parse(args, "i", &i)) |
| 328 | 623 return NULL; |
| 624 | |
| 625 str = fl_get_browser_line (g->ob_generic, i); | |
| 626 | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
627 if (str == NULL) { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
628 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
629 return Py_None; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
630 } |
|
47527
52294af4b663
This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents:
47294
diff
changeset
|
631 return PyString_FromString (str); |
| 328 | 632 } |
| 633 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
634 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
635 load_browser (genericobject *g, PyObject *args) |
| 328 | 636 { |
|
331
21c266f7eca1
Fixed almost all list errors.
Guido van Rossum <guido@python.org>
parents:
330
diff
changeset
|
637 /* 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
|
638 XXX returns int, not void */ |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
639 return call_forms_INstr (fl_load_browser, g-> ob_generic, args); |
| 328 | 640 } |
| 641 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
642 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
643 get_browser_maxline(genericobject *g) |
| 328 | 644 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
645 return call_forms_Ri (fl_get_browser_maxline, g-> ob_generic); |
| 328 | 646 } |
| 647 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
648 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
649 select_browser_line (genericobject *g, PyObject *args) |
| 328 | 650 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
651 return call_forms_INi (fl_select_browser_line, g-> ob_generic, args); |
| 328 | 652 } |
| 653 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
654 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
655 deselect_browser_line (genericobject *g, PyObject *args) |
| 328 | 656 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
657 return call_forms_INi (fl_deselect_browser_line, g-> ob_generic, args); |
| 328 | 658 } |
| 659 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
660 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
661 deselect_browser (genericobject *g) |
| 328 | 662 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
663 return generic_call (g, fl_deselect_browser); |
| 328 | 664 } |
| 665 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
666 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
667 isselected_browser_line (genericobject *g, PyObject *args) |
| 328 | 668 { |
| 669 int i, j; | |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
670 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
671 if (!PyArg_Parse(args, "i", &i)) |
| 328 | 672 return NULL; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
673 |
| 328 | 674 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
|
675 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
676 return PyInt_FromLong (j); |
| 328 | 677 } |
| 678 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
679 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
680 get_browser (genericobject *g) |
| 328 | 681 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
682 return call_forms_Ri (fl_get_browser, g-> ob_generic); |
| 328 | 683 } |
| 684 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
685 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
686 set_browser_fontsize (genericobject *g, PyObject *args) |
| 328 | 687 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
688 return call_forms_INf (fl_set_browser_fontsize, g-> ob_generic, args); |
| 328 | 689 } |
| 690 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
691 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
692 set_browser_fontstyle (genericobject *g, PyObject *args) |
| 328 | 693 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
694 return call_forms_INi (fl_set_browser_fontstyle, g-> ob_generic, args); |
| 328 | 695 } |
| 696 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
697 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
698 set_browser_specialkey (genericobject *g, PyObject *args) |
| 469 | 699 { |
| 700 return call_forms_INc(fl_set_browser_specialkey, g-> ob_generic, args); | |
| 701 } | |
| 702 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
703 static PyMethodDef browser_methods[] = { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
704 {"set_browser_topline", (PyCFunction)set_browser_topline, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
705 METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
706 {"clear_browser", (PyCFunction)clear_browser, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
707 METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
708 {"add_browser_line", (PyCFunction)add_browser_line, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
709 METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
710 {"addto_browser", (PyCFunction)addto_browser, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
711 METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
712 {"insert_browser_line", (PyCFunction)insert_browser_line, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
713 METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
714 {"delete_browser_line", (PyCFunction)delete_browser_line, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
715 METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
716 {"replace_browser_line", (PyCFunction)replace_browser_line, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
717 METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
718 {"get_browser_line", (PyCFunction)get_browser_line, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
719 METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
720 {"load_browser", (PyCFunction)load_browser, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
721 METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
722 {"get_browser_maxline", (PyCFunction)get_browser_maxline, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
723 METH_NOARGS,} |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
724 {"select_browser_line", (PyCFunction)select_browser_line, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
725 METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
726 {"deselect_browser_line", (PyCFunction)deselect_browser_line, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
727 METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
728 {"deselect_browser", (PyCFunction)deselect_browser, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
729 METH_NOARGS,} |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
730 {"isselected_browser_line", (PyCFunction)isselected_browser_line, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
731 METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
732 {"get_browser", (PyCFunction)get_browser, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
733 METH_NOARGS,} |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
734 {"set_browser_fontsize", (PyCFunction)set_browser_fontsize, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
735 METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
736 {"set_browser_fontstyle", (PyCFunction)set_browser_fontstyle, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
737 METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
738 {"set_browser_specialkey", (PyCFunction)set_browser_specialkey, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
739 METH_OLDARGS}, |
| 469 | 740 {NULL, NULL} /* sentinel */ |
| 328 | 741 }; |
| 742 | |
| 743 /* Class: button */ | |
| 744 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
745 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
746 set_button(genericobject *g, PyObject *args) |
| 328 | 747 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
748 return call_forms_INi (fl_set_button, g-> ob_generic, args); |
| 328 | 749 } |
| 750 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
751 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
752 get_button(genericobject *g) |
| 328 | 753 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
754 return call_forms_Ri (fl_get_button, g-> ob_generic); |
| 328 | 755 } |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
756 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
757 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
758 get_button_numb(genericobject *g) |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
759 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
760 return call_forms_Ri (fl_get_button_numb, g-> ob_generic); |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
761 } |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
762 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
763 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
764 set_button_shortcut(genericobject *g, PyObject *args) |
| 469 | 765 { |
| 766 return call_forms_INstr (fl_set_button_shortcut, g-> ob_generic, args); | |
| 767 } | |
| 328 | 768 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
769 static PyMethodDef button_methods[] = { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
770 {"set_button", (PyCFunction)set_button, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
771 {"get_button", (PyCFunction)get_button, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
772 {"get_button_numb", (PyCFunction)get_button_numb, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
773 {"set_button_shortcut", (PyCFunction)set_button_shortcut, METH_OLDARGS}, |
| 328 | 774 {NULL, NULL} /* sentinel */ |
| 775 }; | |
| 776 | |
| 777 /* Class: choice */ | |
| 778 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
779 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
780 set_choice(genericobject *g, PyObject *args) |
| 328 | 781 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
782 return call_forms_INi (fl_set_choice, g-> ob_generic, args); |
| 328 | 783 } |
| 784 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
785 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
786 get_choice(genericobject *g) |
| 328 | 787 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
788 return call_forms_Ri (fl_get_choice, g-> ob_generic); |
| 328 | 789 } |
| 790 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
791 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
792 clear_choice (genericobject *g) |
| 328 | 793 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
794 return generic_call (g, fl_clear_choice); |
| 328 | 795 } |
| 796 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
797 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
798 addto_choice (genericobject *g, PyObject *args) |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
799 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
800 return call_forms_INstr (fl_addto_choice, g-> ob_generic, args); |
| 328 | 801 } |
| 802 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
803 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
804 replace_choice (genericobject *g, PyObject *args) |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
805 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
806 return call_forms_INiINstr (fl_replace_choice, g-> ob_generic, args); |
| 328 | 807 } |
| 808 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
809 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
810 delete_choice (genericobject *g, PyObject *args) |
| 328 | 811 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
812 return call_forms_INi (fl_delete_choice, g-> ob_generic, args); |
| 328 | 813 } |
| 814 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
815 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
816 get_choice_text (genericobject *g) |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
817 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
818 return call_forms_Rstr (fl_get_choice_text, g-> ob_generic); |
| 328 | 819 } |
| 820 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
821 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
822 set_choice_fontsize (genericobject *g, PyObject *args) |
| 328 | 823 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
824 return call_forms_INf (fl_set_choice_fontsize, g-> ob_generic, args); |
| 328 | 825 } |
| 826 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
827 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
828 set_choice_fontstyle (genericobject *g, PyObject *args) |
| 328 | 829 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
830 return call_forms_INi (fl_set_choice_fontstyle, g-> ob_generic, args); |
| 328 | 831 } |
| 832 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
833 static PyMethodDef choice_methods[] = { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
834 {"set_choice", (PyCFunction)set_choice, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
835 {"get_choice", (PyCFunction)get_choice, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
836 {"clear_choice", (PyCFunction)clear_choice, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
837 {"addto_choice", (PyCFunction)addto_choice, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
838 {"replace_choice", (PyCFunction)replace_choice, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
839 {"delete_choice", (PyCFunction)delete_choice, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
840 {"get_choice_text", (PyCFunction)get_choice_text, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
841 {"set_choice_fontsize", (PyCFunction)set_choice_fontsize, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
842 {"set_choice_fontstyle",(PyCFunction)set_choice_fontstyle, METH_OLDARGS}, |
| 328 | 843 {NULL, NULL} /* sentinel */ |
| 844 }; | |
| 845 | |
| 846 /* Class : Clock */ | |
| 847 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
848 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
849 get_clock(genericobject *g) |
| 328 | 850 { |
| 851 int i0, i1, i2; | |
| 852 | |
| 853 fl_get_clock (g->ob_generic, &i0, &i1, &i2); | |
| 854 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
855 return Py_BuildValue("(iii)", i0, i1, i2); |
| 328 | 856 } |
| 857 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
858 static PyMethodDef clock_methods[] = { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
859 {"get_clock", (PyCFunction)get_clock, METH_NOARGS}, |
| 328 | 860 {NULL, NULL} /* sentinel */ |
| 861 }; | |
| 862 | |
| 863 /* CLass : Counters */ | |
| 864 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
865 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
866 get_counter_value(genericobject *g) |
| 328 | 867 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
868 return call_forms_Rf (fl_get_counter_value, g-> ob_generic); |
| 328 | 869 } |
| 870 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
871 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
872 set_counter_value (genericobject *g, PyObject *args) |
| 328 | 873 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
874 return call_forms_INf (fl_set_counter_value, g-> ob_generic, args); |
| 328 | 875 } |
| 876 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
877 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
878 set_counter_precision (genericobject *g, PyObject *args) |
| 328 | 879 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
880 return call_forms_INi (fl_set_counter_precision, g-> ob_generic, args); |
| 328 | 881 } |
| 882 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
883 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
884 set_counter_bounds (genericobject *g, PyObject *args) |
| 328 | 885 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
886 return call_forms_INfINf (fl_set_counter_bounds, g-> ob_generic, args); |
| 328 | 887 } |
| 888 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
889 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
890 set_counter_step (genericobject *g, PyObject *args) |
| 328 | 891 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
892 return call_forms_INfINf (fl_set_counter_step, g-> ob_generic, args); |
| 328 | 893 } |
| 894 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
895 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
896 set_counter_return (genericobject *g, PyObject *args) |
| 328 | 897 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
898 return call_forms_INi (fl_set_counter_return, g-> ob_generic, args); |
| 328 | 899 } |
| 900 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
901 static PyMethodDef counter_methods[] = { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
902 {"set_counter_value", (PyCFunction)set_counter_value, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
903 METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
904 {"get_counter_value", (PyCFunction)get_counter_value, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
905 METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
906 {"set_counter_bounds", (PyCFunction)set_counter_bounds, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
907 METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
908 {"set_counter_step", (PyCFunction)set_counter_step, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
909 METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
910 {"set_counter_precision", (PyCFunction)set_counter_precision, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
911 METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
912 {"set_counter_return", (PyCFunction)set_counter_return, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
913 METH_OLDARGS}, |
| 469 | 914 {NULL, NULL} /* sentinel */ |
| 328 | 915 }; |
| 916 | |
| 917 | |
| 918 /* Class: Dials */ | |
| 919 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
920 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
921 get_dial_value(genericobject *g) |
| 328 | 922 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
923 return call_forms_Rf (fl_get_dial_value, g-> ob_generic); |
| 328 | 924 } |
| 925 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
926 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
927 set_dial_value (genericobject *g, PyObject *args) |
| 328 | 928 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
929 return call_forms_INf (fl_set_dial_value, g-> ob_generic, args); |
| 328 | 930 } |
| 931 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
932 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
933 set_dial_bounds (genericobject *g, PyObject *args) |
| 328 | 934 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
935 return call_forms_INfINf (fl_set_dial_bounds, g-> ob_generic, args); |
| 328 | 936 } |
| 937 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
938 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
939 get_dial_bounds (genericobject *g) |
| 328 | 940 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
941 return call_forms_OUTfOUTf (fl_get_dial_bounds, g-> ob_generic); |
| 328 | 942 } |
| 943 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
944 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
945 set_dial_step (genericobject *g, PyObject *args) |
| 469 | 946 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
947 return call_forms_INf (fl_set_dial_step, g-> ob_generic, args); |
| 469 | 948 } |
| 949 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
950 static PyMethodDef dial_methods[] = { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
951 {"set_dial_value", (PyCFunction)set_dial_value, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
952 {"get_dial_value", (PyCFunction)get_dial_value, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
953 {"set_dial_bounds", (PyCFunction)set_dial_bounds, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
954 {"get_dial_bounds", (PyCFunction)get_dial_bounds, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
955 {"set_dial_step", (PyCFunction)set_dial_step, METH_OLDARGS}, |
| 328 | 956 {NULL, NULL} /* sentinel */ |
| 957 }; | |
| 958 | |
| 959 /* Class : Input */ | |
| 960 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
961 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
962 set_input (genericobject *g, PyObject *args) |
| 328 | 963 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
964 return call_forms_INstr (fl_set_input, g-> ob_generic, args); |
| 328 | 965 } |
| 966 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
967 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
968 get_input (genericobject *g) |
| 328 | 969 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
970 return call_forms_Rstr (fl_get_input, g-> ob_generic); |
| 328 | 971 } |
| 972 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
973 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
974 set_input_color (genericobject *g, PyObject *args) |
| 328 | 975 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
976 return call_forms_INfINf (fl_set_input_color, g-> ob_generic, args); |
| 328 | 977 } |
| 978 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
979 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
980 set_input_return (genericobject *g, PyObject *args) |
| 469 | 981 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
982 return call_forms_INi (fl_set_input_return, g-> ob_generic, args); |
| 469 | 983 } |
| 984 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
985 static PyMethodDef input_methods[] = { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
986 {"set_input", (PyCFunction)set_input, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
987 {"get_input", (PyCFunction)get_input, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
988 {"set_input_color", (PyCFunction)set_input_color, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
989 {"set_input_return", (PyCFunction)set_input_return, METH_OLDARGS}, |
| 328 | 990 {NULL, NULL} /* sentinel */ |
| 991 }; | |
| 992 | |
| 993 | |
| 994 /* Class : Menu */ | |
| 995 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
996 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
997 set_menu (genericobject *g, PyObject *args) |
| 328 | 998 { |
|
331
21c266f7eca1
Fixed almost all list errors.
Guido van Rossum <guido@python.org>
parents:
330
diff
changeset
|
999 return call_forms_INstr (fl_set_menu, g-> ob_generic, args); |
| 328 | 1000 } |
| 1001 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1002 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1003 get_menu (genericobject *g) |
| 328 | 1004 { |
|
331
21c266f7eca1
Fixed almost all list errors.
Guido van Rossum <guido@python.org>
parents:
330
diff
changeset
|
1005 /* 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
|
1006 XXX returns long, not int */ |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1007 return call_forms_Ri (fl_get_menu, g-> ob_generic); |
| 328 | 1008 } |
| 1009 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1010 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1011 get_menu_text (genericobject *g) |
|
1262
f820e6917f07
Changes to speed up local variables enormously, by avoiding dictionary
Guido van Rossum <guido@python.org>
parents:
1252
diff
changeset
|
1012 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1013 return call_forms_Rstr (fl_get_menu_text, g-> ob_generic); |
|
1262
f820e6917f07
Changes to speed up local variables enormously, by avoiding dictionary
Guido van Rossum <guido@python.org>
parents:
1252
diff
changeset
|
1014 } |
|
f820e6917f07
Changes to speed up local variables enormously, by avoiding dictionary
Guido van Rossum <guido@python.org>
parents:
1252
diff
changeset
|
1015 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1016 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1017 addto_menu (genericobject *g, PyObject *args) |
| 328 | 1018 { |
|
331
21c266f7eca1
Fixed almost all list errors.
Guido van Rossum <guido@python.org>
parents:
330
diff
changeset
|
1019 return call_forms_INstr (fl_addto_menu, g-> ob_generic, args); |
| 328 | 1020 } |
| 1021 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1022 static PyMethodDef menu_methods[] = { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1023 {"set_menu", (PyCFunction)set_menu, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1024 {"get_menu", (PyCFunction)get_menu, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1025 {"get_menu_text", (PyCFunction)get_menu_text, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1026 {"addto_menu", (PyCFunction)addto_menu, METH_OLDARGS}, |
| 328 | 1027 {NULL, NULL} /* sentinel */ |
| 1028 }; | |
| 1029 | |
| 1030 | |
| 1031 /* Class: Sliders */ | |
| 1032 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1033 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1034 get_slider_value(genericobject *g) |
| 328 | 1035 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1036 return call_forms_Rf (fl_get_slider_value, g-> ob_generic); |
| 328 | 1037 } |
| 1038 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1039 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1040 set_slider_value (genericobject *g, PyObject *args) |
| 328 | 1041 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1042 return call_forms_INf (fl_set_slider_value, g-> ob_generic, args); |
| 328 | 1043 } |
| 1044 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1045 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1046 set_slider_bounds (genericobject *g, PyObject *args) |
| 328 | 1047 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1048 return call_forms_INfINf (fl_set_slider_bounds, g-> ob_generic, args); |
| 328 | 1049 } |
| 1050 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1051 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1052 get_slider_bounds (genericobject *g) |
| 328 | 1053 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1054 return call_forms_OUTfOUTf(fl_get_slider_bounds, g-> ob_generic); |
| 328 | 1055 } |
| 1056 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1057 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1058 set_slider_return (genericobject *g, PyObject *args) |
| 328 | 1059 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1060 return call_forms_INf (fl_set_slider_return, g-> ob_generic, args); |
| 328 | 1061 } |
| 1062 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1063 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1064 set_slider_size (genericobject *g, PyObject *args) |
| 328 | 1065 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1066 return call_forms_INf (fl_set_slider_size, g-> ob_generic, args); |
| 328 | 1067 } |
| 1068 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1069 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1070 set_slider_precision (genericobject *g, PyObject *args) |
| 328 | 1071 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1072 return call_forms_INi (fl_set_slider_precision, g-> ob_generic, args); |
| 328 | 1073 } |
| 1074 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1075 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1076 set_slider_step (genericobject *g, PyObject *args) |
| 469 | 1077 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1078 return call_forms_INf (fl_set_slider_step, g-> ob_generic, args); |
| 469 | 1079 } |
| 1080 | |
| 1081 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1082 static PyMethodDef slider_methods[] = { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1083 {"set_slider_value", (PyCFunction)set_slider_value, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1084 {"get_slider_value", (PyCFunction)get_slider_value, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1085 {"set_slider_bounds", (PyCFunction)set_slider_bounds, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1086 {"get_slider_bounds", (PyCFunction)get_slider_bounds, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1087 {"set_slider_return", (PyCFunction)set_slider_return, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1088 {"set_slider_size", (PyCFunction)set_slider_size, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1089 {"set_slider_precision",(PyCFunction)set_slider_precision, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1090 {"set_slider_step", (PyCFunction)set_slider_step, METH_OLDARGS}, |
| 328 | 1091 {NULL, NULL} /* sentinel */ |
| 1092 }; | |
| 1093 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1094 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1095 set_positioner_xvalue (genericobject *g, PyObject *args) |
| 328 | 1096 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1097 return call_forms_INf (fl_set_positioner_xvalue, g-> ob_generic, args); |
| 328 | 1098 } |
| 1099 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1100 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1101 set_positioner_xbounds (genericobject *g, PyObject *args) |
| 328 | 1102 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1103 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
|
1104 g-> ob_generic, args); |
| 328 | 1105 } |
| 1106 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1107 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1108 set_positioner_yvalue (genericobject *g, PyObject *args) |
| 328 | 1109 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1110 return call_forms_INf (fl_set_positioner_yvalue, g-> ob_generic, args); |
| 328 | 1111 } |
| 1112 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1113 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1114 set_positioner_ybounds (genericobject *g, PyObject *args) |
| 328 | 1115 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1116 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
|
1117 g-> ob_generic, args); |
| 328 | 1118 } |
| 1119 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1120 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1121 get_positioner_xvalue (genericobject *g) |
| 328 | 1122 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1123 return call_forms_Rf (fl_get_positioner_xvalue, g-> ob_generic); |
| 328 | 1124 } |
| 1125 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1126 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1127 get_positioner_xbounds (genericobject *g) |
| 328 | 1128 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1129 return call_forms_OUTfOUTf (fl_get_positioner_xbounds, g-> ob_generic); |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1130 } |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1131 |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1132 static PyObject * |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1133 get_positioner_yvalue (genericobject *g) |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1134 { |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1135 return call_forms_Rf (fl_get_positioner_yvalue, g-> ob_generic); |
| 328 | 1136 } |
| 1137 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1138 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1139 get_positioner_ybounds (genericobject *g) |
| 328 | 1140 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1141 return call_forms_OUTfOUTf (fl_get_positioner_ybounds, g-> ob_generic); |
| 328 | 1142 } |
| 1143 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1144 static PyMethodDef positioner_methods[] = { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1145 {"set_positioner_xvalue", (PyCFunction)set_positioner_xvalue, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1146 METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1147 {"set_positioner_yvalue", (PyCFunction)set_positioner_yvalue, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1148 METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1149 {"set_positioner_xbounds", (PyCFunction)set_positioner_xbounds, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1150 METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1151 {"set_positioner_ybounds", (PyCFunction)set_positioner_ybounds, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1152 METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1153 {"get_positioner_xvalue", (PyCFunction)get_positioner_xvalue, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1154 METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1155 {"get_positioner_yvalue", (PyCFunction)get_positioner_yvalue, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1156 METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1157 {"get_positioner_xbounds", (PyCFunction)get_positioner_xbounds, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1158 METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1159 {"get_positioner_ybounds", (PyCFunction)get_positioner_ybounds, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1160 METH_NOARGS}, |
| 328 | 1161 {NULL, NULL} /* sentinel */ |
| 1162 }; | |
| 1163 | |
| 1164 /* Class timer */ | |
| 1165 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1166 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1167 set_timer (genericobject *g, PyObject *args) |
| 328 | 1168 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1169 return call_forms_INf (fl_set_timer, g-> ob_generic, args); |
| 328 | 1170 } |
| 1171 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1172 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1173 get_timer (genericobject *g) |
| 328 | 1174 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1175 return call_forms_Rf (fl_get_timer, g-> ob_generic); |
| 328 | 1176 } |
| 1177 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1178 static PyMethodDef timer_methods[] = { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1179 {"set_timer", (PyCFunction)set_timer, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1180 {"get_timer", (PyCFunction)get_timer, METH_NOARGS}, |
| 328 | 1181 {NULL, NULL} /* sentinel */ |
| 1182 }; | |
| 1183 | |
| 1184 /* Form objects */ | |
| 1185 | |
| 1186 typedef struct { | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1187 PyObject_HEAD |
| 328 | 1188 FL_FORM *ob_form; |
| 1189 } formobject; | |
| 1190 | |
|
24280
1598a1e473e2
staticforward bites the dust.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
22712
diff
changeset
|
1191 static PyTypeObject Formtype; |
| 328 | 1192 |
| 1193 #define is_formobject(v) ((v)->ob_type == &Formtype) | |
| 1194 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1195 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1196 form_show_form(formobject *f, PyObject *args) |
| 328 | 1197 { |
| 1198 int place, border; | |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
1199 char *name; |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1200 if (!PyArg_Parse(args, "(iis)", &place, &border, &name)) |
| 328 | 1201 return NULL; |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
1202 fl_show_form(f->ob_form, place, border, name); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1203 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1204 return Py_None; |
| 328 | 1205 } |
| 1206 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1207 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1208 form_call(void (*func)(FL_FORM *), FL_FORM *f) |
| 328 | 1209 { |
| 1210 (*func)(f); | |
| 1211 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1212 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1213 return Py_None; |
| 328 | 1214 } |
| 1215 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1216 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1217 form_call_INiINi(void (*func)(FL_FORM *, int, int), FL_FORM *f, PyObject *args) |
| 328 | 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 int a, b; |
| 328 | 1220 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1221 if (!PyArg_Parse(args, "(ii)", &a, &b)) return NULL; |
| 328 | 1222 |
| 1223 (*func)(f, a, b); | |
| 1224 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1225 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1226 return Py_None; |
| 328 | 1227 } |
| 1228 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1229 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1230 form_call_INfINf(void (*func)(FL_FORM *, float, float), FL_FORM *f, PyObject *args) |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1231 { |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1232 float a, b; |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1233 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1234 if (!PyArg_Parse(args, "(ff)", &a, &b)) return NULL; |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1235 |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1236 (*func)(f, a, b); |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1237 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1238 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1239 return Py_None; |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1240 } |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1241 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1242 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1243 form_hide_form(formobject *f) |
| 328 | 1244 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1245 return form_call(fl_hide_form, f-> ob_form); |
| 328 | 1246 } |
| 1247 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1248 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1249 form_redraw_form(formobject *f) |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1250 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1251 return form_call(fl_redraw_form, f-> ob_form); |
| 328 | 1252 } |
| 1253 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1254 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1255 form_set_form_position(formobject *f, PyObject *args) |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1256 { |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1257 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
|
1258 } |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1259 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1260 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1261 form_set_form_size(formobject *f, PyObject *args) |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1262 { |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1263 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
|
1264 } |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1265 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1266 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1267 form_scale_form(formobject *f, PyObject *args) |
|
1319
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1268 { |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1269 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
|
1270 } |
|
cd397266dc1c
* Makefile: added all: and default: targets.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
1271 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1272 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1273 generic_add_object(formobject *f, PyObject *args, FL_OBJECT *(*func)(int, float, float, float, float, char*), PyMethodDef *internal_methods) |
| 328 | 1274 { |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1275 int type; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1276 float x, y, w, h; |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
1277 char *name; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1278 FL_OBJECT *obj; |
| 328 | 1279 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1280 if (!PyArg_Parse(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
|
1281 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
|
1282 |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1283 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
|
1284 |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
1285 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
|
1286 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1287 fl_end_form(); |
| 328 | 1288 |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1289 if (obj == NULL) { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1290 PyErr_NoMemory(); |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1291 return NULL; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1292 } |
| 328 | 1293 |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1294 return newgenericobject (obj, internal_methods); |
| 328 | 1295 } |
| 1296 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1297 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1298 form_add_button(formobject *f, PyObject *args) |
| 328 | 1299 { |
| 1300 return generic_add_object(f, args, fl_add_button, button_methods); | |
| 1301 } | |
| 1302 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1303 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1304 form_add_lightbutton(formobject *f, PyObject *args) |
| 328 | 1305 { |
| 1306 return generic_add_object(f, args, fl_add_lightbutton, button_methods); | |
| 1307 } | |
| 1308 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1309 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1310 form_add_roundbutton(formobject *f, PyObject *args) |
| 328 | 1311 { |
| 1312 return generic_add_object(f, args, fl_add_roundbutton, button_methods); | |
| 1313 } | |
| 1314 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1315 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1316 form_add_menu (formobject *f, PyObject *args) |
| 328 | 1317 { |
| 1318 return generic_add_object(f, args, fl_add_menu, menu_methods); | |
| 1319 } | |
| 1320 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1321 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1322 form_add_slider(formobject *f, PyObject *args) |
| 328 | 1323 { |
| 1324 return generic_add_object(f, args, fl_add_slider, slider_methods); | |
| 1325 } | |
| 1326 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1327 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1328 form_add_valslider(formobject *f, PyObject *args) |
| 328 | 1329 { |
| 1330 return generic_add_object(f, args, fl_add_valslider, slider_methods); | |
| 1331 } | |
| 1332 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1333 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1334 form_add_dial(formobject *f, PyObject *args) |
| 328 | 1335 { |
| 1336 return generic_add_object(f, args, fl_add_dial, dial_methods); | |
| 1337 } | |
| 1338 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1339 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1340 form_add_counter(formobject *f, PyObject *args) |
| 328 | 1341 { |
| 1342 return generic_add_object(f, args, fl_add_counter, counter_methods); | |
| 1343 } | |
| 1344 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1345 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1346 form_add_clock(formobject *f, PyObject *args) |
| 328 | 1347 { |
| 1348 return generic_add_object(f, args, fl_add_clock, clock_methods); | |
| 1349 } | |
| 1350 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1351 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1352 form_add_box(formobject *f, PyObject *args) |
| 328 | 1353 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1354 return generic_add_object(f, args, fl_add_box, |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1355 (PyMethodDef *)NULL); |
| 328 | 1356 } |
| 1357 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1358 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1359 form_add_choice(formobject *f, PyObject *args) |
| 328 | 1360 { |
| 1361 return generic_add_object(f, args, fl_add_choice, choice_methods); | |
| 1362 } | |
| 1363 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1364 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1365 form_add_browser(formobject *f, PyObject *args) |
| 328 | 1366 { |
| 1367 return generic_add_object(f, args, fl_add_browser, browser_methods); | |
| 1368 } | |
| 1369 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1370 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1371 form_add_positioner(formobject *f, PyObject *args) |
| 328 | 1372 { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1373 return generic_add_object(f, args, fl_add_positioner, |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1374 positioner_methods); |
| 328 | 1375 } |
| 1376 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1377 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1378 form_add_input(formobject *f, PyObject *args) |
| 328 | 1379 { |
| 1380 return generic_add_object(f, args, fl_add_input, input_methods); | |
| 1381 } | |
| 1382 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1383 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1384 form_add_text(formobject *f, PyObject *args) |
| 328 | 1385 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1386 return generic_add_object(f, args, fl_add_text, |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1387 (PyMethodDef *)NULL); |
| 328 | 1388 } |
| 1389 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1390 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1391 form_add_timer(formobject *f, PyObject *args) |
| 328 | 1392 { |
| 1393 return generic_add_object(f, args, fl_add_timer, timer_methods); | |
| 1394 } | |
| 1395 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1396 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1397 form_freeze_form(formobject *f) |
| 328 | 1398 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1399 return form_call(fl_freeze_form, f-> ob_form); |
| 328 | 1400 } |
| 1401 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1402 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1403 form_unfreeze_form(formobject *f) |
| 328 | 1404 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1405 return form_call(fl_unfreeze_form, f-> ob_form); |
| 328 | 1406 } |
| 1407 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1408 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1409 form_activate_form(formobject *f) |
| 328 | 1410 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1411 return form_call(fl_activate_form, f-> ob_form); |
| 328 | 1412 } |
| 1413 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1414 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1415 form_deactivate_form(formobject *f) |
| 328 | 1416 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1417 return form_call(fl_deactivate_form, f-> ob_form); |
| 328 | 1418 } |
| 1419 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1420 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1421 form_bgn_group(formobject *f, PyObject *args) |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1422 { |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1423 FL_OBJECT *obj; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1424 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1425 fl_addto_form(f-> ob_form); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1426 obj = fl_bgn_group(); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1427 fl_end_form(); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1428 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1429 if (obj == NULL) { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1430 PyErr_NoMemory(); |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1431 return NULL; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1432 } |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1433 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1434 return newgenericobject (obj, (PyMethodDef *) NULL); |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1435 } |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1436 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1437 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1438 form_end_group(formobject *f, PyObject *args) |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1439 { |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1440 fl_addto_form(f-> ob_form); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1441 fl_end_group(); |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1442 fl_end_form(); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1443 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1444 return Py_None; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1445 } |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1446 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1447 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1448 forms_find_first_or_last(FL_OBJECT *(*func)(FL_FORM *, int, float, float), formobject *f, PyObject *args) |
|
329
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1449 { |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1450 int type; |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1451 float mx, my; |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1452 FL_OBJECT *generic; |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1453 genericobject *g; |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1454 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1455 if (!PyArg_Parse(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
|
1456 |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1457 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
|
1458 |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1459 if (generic == NULL) |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1460 { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1461 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1462 return Py_None; |
|
329
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1463 } |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1464 |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1465 g = findgeneric(generic); |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1466 if (g == NULL) { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1467 PyErr_SetString(PyExc_RuntimeError, |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1468 "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
|
1469 return NULL; |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1470 } |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1471 Py_INCREF(g); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1472 return (PyObject *) g; |
|
329
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1473 } |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1474 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1475 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1476 form_find_first(formobject *f, PyObject *args) |
|
329
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1477 { |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1478 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
|
1479 } |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1480 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1481 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1482 form_find_last(formobject *f, PyObject *args) |
|
329
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1483 { |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1484 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
|
1485 } |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1486 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1487 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1488 form_set_object_focus(formobject *f, PyObject *args) |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1489 { |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1490 genericobject *g; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1491 if (args == NULL || !is_genericobject(args)) { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1492 PyErr_BadArgument(); |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1493 return NULL; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1494 } |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1495 g = (genericobject *)args; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1496 fl_set_object_focus(f->ob_form, g->ob_generic); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1497 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1498 return Py_None; |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1499 } |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1500 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1501 static PyMethodDef form_methods[] = { |
| 328 | 1502 /* adm */ |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1503 {"show_form", (PyCFunction)form_show_form, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1504 {"hide_form", (PyCFunction)form_hide_form, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1505 {"redraw_form", (PyCFunction)form_redraw_form, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1506 {"set_form_position", (PyCFunction)form_set_form_position, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1507 {"set_form_size", (PyCFunction)form_set_form_size, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1508 {"scale_form", (PyCFunction)form_scale_form, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1509 {"freeze_form", (PyCFunction)form_freeze_form, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1510 {"unfreeze_form", (PyCFunction)form_unfreeze_form, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1511 {"activate_form", (PyCFunction)form_activate_form, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1512 {"deactivate_form", (PyCFunction)form_deactivate_form, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1513 {"bgn_group", (PyCFunction)form_bgn_group, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1514 {"end_group", (PyCFunction)form_end_group, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1515 {"find_first", (PyCFunction)form_find_first, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1516 {"find_last", (PyCFunction)form_find_last, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1517 {"set_object_focus", (PyCFunction)form_set_object_focus, METH_OLDARGS}, |
| 328 | 1518 |
| 1519 /* basic objects */ | |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1520 {"add_button", (PyCFunction)form_add_button, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1521 /* {"add_bitmap", (method)form_add_bitmap, METH_OLDARGS}, */ |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1522 {"add_lightbutton", (PyCFunction)form_add_lightbutton, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1523 {"add_roundbutton", (PyCFunction)form_add_roundbutton, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1524 {"add_menu", (PyCFunction)form_add_menu, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1525 {"add_slider", (PyCFunction)form_add_slider, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1526 {"add_positioner", (PyCFunction)form_add_positioner, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1527 {"add_valslider", (PyCFunction)form_add_valslider, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1528 {"add_dial", (PyCFunction)form_add_dial, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1529 {"add_counter", (PyCFunction)form_add_counter, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1530 {"add_box", (PyCFunction)form_add_box, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1531 {"add_clock", (PyCFunction)form_add_clock, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1532 {"add_choice", (PyCFunction)form_add_choice, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1533 {"add_browser", (PyCFunction)form_add_browser, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1534 {"add_input", (PyCFunction)form_add_input, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1535 {"add_timer", (PyCFunction)form_add_timer, METH_OLDARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1536 {"add_text", (PyCFunction)form_add_text, METH_OLDARGS}, |
| 328 | 1537 {NULL, NULL} /* sentinel */ |
| 1538 }; | |
| 1539 | |
| 1540 static void | |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1541 form_dealloc(formobject *f) |
| 328 | 1542 { |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1543 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
|
1544 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
|
1545 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
|
1546 fl_free_form(f->ob_form); |
|
12576
1c7c2dd1beb1
Vladimir Marangozov's long-awaited malloc restructuring.
Guido van Rossum <guido@python.org>
parents:
9588
diff
changeset
|
1547 PyObject_Del(f); |
| 328 | 1548 } |
| 1549 | |
|
442
17f4cdf28959
Fixed duplicate use of OFF macro.
Guido van Rossum <guido@python.org>
parents:
437
diff
changeset
|
1550 #define OFF(x) offsetof(FL_FORM, x) |
|
17f4cdf28959
Fixed duplicate use of OFF macro.
Guido van Rossum <guido@python.org>
parents:
437
diff
changeset
|
1551 |
|
437
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1552 static struct memberlist form_memberlist[] = { |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1553 {"window", T_LONG, OFF(window), RO}, |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1554 {"w", T_FLOAT, OFF(w)}, |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1555 {"h", T_FLOAT, OFF(h)}, |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1556 {"x", T_FLOAT, OFF(x), RO}, |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1557 {"y", T_FLOAT, OFF(y), RO}, |
|
437
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1558 {"deactivated", T_INT, OFF(deactivated)}, |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1559 {"visible", T_INT, OFF(visible), RO}, |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1560 {"frozen", T_INT, OFF(frozen), RO}, |
|
437
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1561 {"doublebuf", T_INT, OFF(doublebuf)}, |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1562 {NULL} /* Sentinel */ |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1563 }; |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1564 |
|
442
17f4cdf28959
Fixed duplicate use of OFF macro.
Guido van Rossum <guido@python.org>
parents:
437
diff
changeset
|
1565 #undef OFF |
|
17f4cdf28959
Fixed duplicate use of OFF macro.
Guido van Rossum <guido@python.org>
parents:
437
diff
changeset
|
1566 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1567 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1568 form_getattr(formobject *f, char *name) |
| 328 | 1569 { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1570 PyObject *meth; |
|
437
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1571 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1572 meth = Py_FindMethod(form_methods, (PyObject *)f, name); |
|
437
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1573 if (meth != NULL) |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1574 return meth; |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1575 PyErr_Clear(); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1576 return PyMember_Get((char *)f->ob_form, form_memberlist, name); |
|
437
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1577 } |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1578 |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1579 static int |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1580 form_setattr(formobject *f, char *name, PyObject *v) |
|
437
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1581 { |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1582 if (v == NULL) { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1583 PyErr_SetString(PyExc_TypeError, |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1584 "can't delete form attributes"); |
|
4297
cf9a97bfc023
Correct typo: return -1 for error, not NULL
Guido van Rossum <guido@python.org>
parents:
2061
diff
changeset
|
1585 return -1; |
|
437
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1586 } |
|
402a59ad2493
Finally added form attributes.
Guido van Rossum <guido@python.org>
parents:
392
diff
changeset
|
1587 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1588 return PyMember_Set((char *)f->ob_form, form_memberlist, name, v); |
| 328 | 1589 } |
| 1590 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1591 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1592 form_repr(formobject *f) |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1593 { |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1594 char buf[100]; |
|
21073
304b34023876
sprintf -> PyOS_snprintf in some "obviously safe" cases.
Tim Peters <tim.peters@gmail.com>
parents:
14375
diff
changeset
|
1595 PyOS_snprintf(buf, sizeof(buf), "<FORMS_form at %p, window=%ld>", |
|
304b34023876
sprintf -> PyOS_snprintf in some "obviously safe" cases.
Tim Peters <tim.peters@gmail.com>
parents:
14375
diff
changeset
|
1596 f, f->ob_form->window); |
|
47527
52294af4b663
This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents:
47294
diff
changeset
|
1597 return PyString_FromString(buf); |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1598 } |
|
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1599 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1600 static PyTypeObject Formtype = { |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1601 PyObject_HEAD_INIT(&PyType_Type) |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1602 0, /*ob_size*/ |
|
21313
91dd223829c6
Patch supplied by Burton Radons for his own SF bug #487390: Modifying
Guido van Rossum <guido@python.org>
parents:
21073
diff
changeset
|
1603 "fl.FORMS_form", /*tp_name*/ |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1604 sizeof(formobject), /*tp_size*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1605 0, /*tp_itemsize*/ |
| 328 | 1606 /* methods */ |
|
1746
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1607 (destructor)form_dealloc, /*tp_dealloc*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1608 0, /*tp_print*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1609 (getattrfunc)form_getattr, /*tp_getattr*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1610 (setattrfunc)form_setattr, /*tp_setattr*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1611 0, /*tp_compare*/ |
|
1940892d2fe3
Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents:
1482
diff
changeset
|
1612 (reprfunc)form_repr, /*tp_repr*/ |
| 328 | 1613 }; |
| 1614 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1615 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1616 newformobject(FL_FORM *form) |
| 328 | 1617 { |
| 1618 formobject *f; | |
|
12576
1c7c2dd1beb1
Vladimir Marangozov's long-awaited malloc restructuring.
Guido van Rossum <guido@python.org>
parents:
9588
diff
changeset
|
1619 f = PyObject_New(formobject, &Formtype); |
| 328 | 1620 if (f == NULL) |
| 1621 return NULL; | |
| 1622 f->ob_form = form; | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1623 return (PyObject *)f; |
| 328 | 1624 } |
| 1625 | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1626 |
| 328 | 1627 /* The "fl" module */ |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1628 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1629 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1630 forms_make_form(PyObject *dummy, PyObject *args) |
| 328 | 1631 { |
| 1632 int type; | |
| 1633 float w, h; | |
| 1634 FL_FORM *form; | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1635 if (!PyArg_Parse(args, "(iff)", &type, &w, &h)) |
| 328 | 1636 return NULL; |
| 1637 form = fl_bgn_form(type, w, h); | |
| 1638 if (form == NULL) { | |
| 1639 /* XXX Actually, cannot happen! */ | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1640 PyErr_NoMemory(); |
| 328 | 1641 return NULL; |
| 1642 } | |
| 1643 fl_end_form(); | |
| 1644 return newformobject(form); | |
| 1645 } | |
| 1646 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1647 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1648 forms_activate_all_forms(PyObject *f, PyObject *args) |
|
726
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1649 { |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1650 fl_activate_all_forms(); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1651 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1652 return Py_None; |
|
726
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1653 } |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1654 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1655 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1656 forms_deactivate_all_forms(PyObject *f, PyObject *args) |
|
726
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1657 { |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1658 fl_deactivate_all_forms(); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1659 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1660 return Py_None; |
|
726
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1661 } |
|
e8c6fa9118eb
Added forms_(de)activate_all_forms functions; minor lay-out fixes.
Guido van Rossum <guido@python.org>
parents:
714
diff
changeset
|
1662 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1663 static PyObject *my_event_callback = NULL; |
| 328 | 1664 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1665 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1666 forms_set_event_call_back(PyObject *dummy, PyObject *args) |
| 328 | 1667 { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1668 if (args == Py_None) |
|
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
|
1669 args = NULL; |
| 328 | 1670 my_event_callback = args; |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1671 Py_XINCREF(args); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1672 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1673 return Py_None; |
| 328 | 1674 } |
| 1675 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1676 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1677 forms_do_or_check_forms(PyObject *dummy, FL_OBJECT *(*func)(void)) |
| 328 | 1678 { |
| 1679 FL_OBJECT *generic; | |
| 1680 genericobject *g; | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1681 PyObject *arg, *res; |
| 328 | 1682 |
| 1683 for (;;) { | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1684 Py_BEGIN_ALLOW_THREADS |
| 328 | 1685 generic = (*func)(); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1686 Py_END_ALLOW_THREADS |
| 328 | 1687 if (generic == NULL) { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1688 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1689 return Py_None; |
| 328 | 1690 } |
| 1691 if (generic == FL_EVENT) { | |
| 1692 int dev; | |
| 1693 short val; | |
| 1694 if (my_event_callback == NULL) | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1695 return PyInt_FromLong(-1L); |
| 328 | 1696 dev = fl_qread(&val); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1697 arg = Py_BuildValue("(ih)", dev, val); |
| 328 | 1698 if (arg == NULL) |
| 1699 return NULL; | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1700 res = PyEval_CallObject(my_event_callback, arg); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1701 Py_XDECREF(res); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1702 Py_DECREF(arg); |
| 328 | 1703 if (res == NULL) |
| 1704 return NULL; /* Callback raised exception */ | |
| 1705 continue; | |
| 1706 } | |
| 1707 g = findgeneric(generic); | |
| 1708 if (g == NULL) { | |
|
1079
e4c6a0dd5c2b
* bltinmodule.c: added built-in function cmp(a, b)
Guido van Rossum <guido@python.org>
parents:
1051
diff
changeset
|
1709 /* 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
|
1710 continue; /* Ignore it */ |
| 328 | 1711 } |
| 1712 if (g->ob_callback == NULL) { | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1713 Py_INCREF(g); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1714 return ((PyObject *) g); |
| 328 | 1715 } |
|
30683
3b59fa5d25b1
Simplify and speedup uses of Py_BuildValue():
Raymond Hettinger <python@rcn.com>
parents:
24471
diff
changeset
|
1716 arg = PyTuple_Pack(2, (PyObject *)g, g->ob_callback_arg); |
|
1252
c4cd0d9d8281
* Changed many files to use mkvalue() instead of newtupleobject().
Guido van Rossum <guido@python.org>
parents:
1079
diff
changeset
|
1717 if (arg == NULL) |
|
c4cd0d9d8281
* Changed many files to use mkvalue() instead of newtupleobject().
Guido van Rossum <guido@python.org>
parents:
1079
diff
changeset
|
1718 return NULL; |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1719 res = PyEval_CallObject(g->ob_callback, arg); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1720 Py_XDECREF(res); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1721 Py_DECREF(arg); |
| 328 | 1722 if (res == NULL) |
| 1723 return NULL; /* Callback raised exception */ | |
| 1724 } | |
| 1725 } | |
| 1726 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1727 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1728 forms_do_forms(PyObject *dummy) |
| 328 | 1729 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1730 return forms_do_or_check_forms(dummy, fl_do_forms); |
| 328 | 1731 } |
| 1732 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1733 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1734 forms_check_forms(PyObject *dummy) |
| 328 | 1735 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1736 return forms_do_or_check_forms(dummy, fl_check_forms); |
| 328 | 1737 } |
| 1738 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1739 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1740 forms_do_only_forms(PyObject *dummy) |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1741 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1742 return forms_do_or_check_forms(dummy, fl_do_only_forms); |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1743 } |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1744 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1745 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1746 forms_check_only_forms(PyObject *dummy) |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1747 { |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1748 return forms_do_or_check_forms(dummy, fl_check_only_forms); |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1749 } |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1750 |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1751 #ifdef UNUSED |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1752 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1753 fl_call(void (*func)(void)) |
| 328 | 1754 { |
| 1755 (*func)(); | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1756 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1757 return Py_None; |
| 328 | 1758 } |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1759 #endif |
| 328 | 1760 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1761 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1762 forms_set_graphics_mode(PyObject *dummy, PyObject *args) |
| 469 | 1763 { |
| 1764 int rgbmode, doublebuf; | |
| 1765 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1766 if (!PyArg_Parse(args, "(ii)", &rgbmode, &doublebuf)) |
| 469 | 1767 return NULL; |
| 1768 fl_set_graphics_mode(rgbmode,doublebuf); | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1769 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1770 return Py_None; |
| 469 | 1771 } |
| 1772 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1773 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1774 forms_get_rgbmode(PyObject *dummy, PyObject *args) |
| 469 | 1775 { |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1776 extern int fl_rgbmode; |
| 469 | 1777 |
| 1778 if (args != NULL) { | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1779 PyErr_BadArgument(); |
| 469 | 1780 return NULL; |
| 1781 } | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1782 return PyInt_FromLong((long)fl_rgbmode); |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1783 } |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1784 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1785 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1786 forms_show_errors(PyObject *dummy, PyObject *args) |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1787 { |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1788 int show; |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1789 if (!PyArg_Parse(args, "i", &show)) |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1790 return NULL; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1791 fl_show_errors(show); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1792 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1793 return Py_None; |
| 469 | 1794 } |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1795 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1796 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1797 forms_set_font_name(PyObject *dummy, PyObject *args) |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1798 { |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1799 int numb; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1800 char *name; |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1801 if (!PyArg_Parse(args, "(is)", &numb, &name)) |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1802 return NULL; |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1803 fl_set_font_name(numb, name); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1804 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1805 return Py_None; |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1806 } |
|
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1807 |
| 469 | 1808 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1809 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1810 forms_qdevice(PyObject *self, PyObject *args) |
| 328 | 1811 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1812 short arg1; |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1813 if (!PyArg_Parse(args, "h", &arg1)) |
| 328 | 1814 return NULL; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1815 fl_qdevice(arg1); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1816 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1817 return Py_None; |
| 328 | 1818 } |
| 1819 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1820 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1821 forms_unqdevice(PyObject *self, PyObject *args) |
| 328 | 1822 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1823 short arg1; |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1824 if (!PyArg_Parse(args, "h", &arg1)) |
| 328 | 1825 return NULL; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1826 fl_unqdevice(arg1); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1827 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1828 return Py_None; |
| 328 | 1829 } |
| 1830 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1831 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1832 forms_isqueued(PyObject *self, PyObject *args) |
| 328 | 1833 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1834 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
|
1835 short arg1; |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1836 if (!PyArg_Parse(args, "h", &arg1)) |
| 328 | 1837 return NULL; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1838 retval = fl_isqueued(arg1); |
| 328 | 1839 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1840 return PyInt_FromLong(retval); |
| 328 | 1841 } |
| 1842 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1843 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1844 forms_qtest(PyObject *self, PyObject *args) |
| 328 | 1845 { |
| 1846 long retval; | |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1847 retval = fl_qtest(); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1848 return PyInt_FromLong(retval); |
| 328 | 1849 } |
| 1850 | |
| 1851 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1852 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1853 forms_qread(PyObject *self, PyObject *args) |
| 328 | 1854 { |
|
1252
c4cd0d9d8281
* Changed many files to use mkvalue() instead of newtupleobject().
Guido van Rossum <guido@python.org>
parents:
1079
diff
changeset
|
1855 int dev; |
|
c4cd0d9d8281
* Changed many files to use mkvalue() instead of newtupleobject().
Guido van Rossum <guido@python.org>
parents:
1079
diff
changeset
|
1856 short val; |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1857 Py_BEGIN_ALLOW_THREADS |
|
1252
c4cd0d9d8281
* Changed many files to use mkvalue() instead of newtupleobject().
Guido van Rossum <guido@python.org>
parents:
1079
diff
changeset
|
1858 dev = fl_qread(&val); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1859 Py_END_ALLOW_THREADS |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1860 return Py_BuildValue("(ih)", dev, val); |
| 328 | 1861 } |
| 1862 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1863 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1864 forms_qreset(PyObject *self) |
| 328 | 1865 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1866 fl_qreset(); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1867 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1868 return Py_None; |
| 328 | 1869 } |
| 1870 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1871 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1872 forms_qenter(PyObject *self, PyObject *args) |
| 328 | 1873 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1874 short arg1, arg2; |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1875 if (!PyArg_Parse(args, "(hh)", &arg1, &arg2)) |
| 328 | 1876 return NULL; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1877 fl_qenter(arg1, arg2); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1878 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1879 return Py_None; |
| 328 | 1880 } |
| 1881 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1882 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1883 forms_color(PyObject *self, PyObject *args) |
| 328 | 1884 { |
| 1885 int arg; | |
| 1886 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1887 if (!PyArg_Parse(args, "i", &arg)) return NULL; |
| 328 | 1888 |
| 1889 fl_color((short) arg); | |
| 1890 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1891 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1892 return Py_None; |
| 328 | 1893 } |
| 1894 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1895 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1896 forms_mapcolor(PyObject *self, PyObject *args) |
| 328 | 1897 { |
| 1898 int arg0, arg1, arg2, arg3; | |
| 1899 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1900 if (!PyArg_Parse(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
|
1901 return NULL; |
| 328 | 1902 |
| 1903 fl_mapcolor(arg0, (short) arg1, (short) arg2, (short) arg3); | |
| 1904 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1905 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1906 return Py_None; |
| 328 | 1907 } |
| 1908 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1909 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1910 forms_getmcolor(PyObject *self, PyObject *args) |
| 328 | 1911 { |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1912 int arg; |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1913 short r, g, b; |
| 328 | 1914 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1915 if (!PyArg_Parse(args, "i", &arg)) return NULL; |
| 328 | 1916 |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1917 fl_getmcolor(arg, &r, &g, &b); |
| 328 | 1918 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1919 return Py_BuildValue("(hhh)", r, g, b); |
| 328 | 1920 } |
| 1921 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1922 static PyObject * |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
1923 forms_get_mouse(PyObject *self) |
|
329
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1924 { |
|
1252
c4cd0d9d8281
* Changed many files to use mkvalue() instead of newtupleobject().
Guido van Rossum <guido@python.org>
parents:
1079
diff
changeset
|
1925 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
|
1926 |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1927 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
|
1928 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1929 return Py_BuildValue("(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
|
1930 } |
|
f21cb7b53f6c
Adde get_mouse and find_first/find_last (by robertl)
Guido van Rossum <guido@python.org>
parents:
328
diff
changeset
|
1931 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1932 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1933 forms_tie(PyObject *self, PyObject *args) |
| 328 | 1934 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
1935 short arg1, arg2, arg3; |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1936 if (!PyArg_Parse(args, "(hhh)", &arg1, &arg2, &arg3)) |
| 328 | 1937 return NULL; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
1938 fl_tie(arg1, arg2, arg3); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1939 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1940 return Py_None; |
| 328 | 1941 } |
| 1942 | |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1943 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1944 forms_show_message(PyObject *f, PyObject *args) |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1945 { |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
1946 char *a, *b, *c; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1947 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1948 if (!PyArg_Parse(args, "(sss)", &a, &b, &c)) return NULL; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1949 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1950 Py_BEGIN_ALLOW_THREADS |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
1951 fl_show_message(a, b, c); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1952 Py_END_ALLOW_THREADS |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1953 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1954 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1955 return Py_None; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1956 } |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
1957 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1958 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
1959 forms_show_choice(PyObject *f, PyObject *args) |
|
712
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
1960 { |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
1961 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
|
1962 int nb; |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
1963 char *format; |
|
1051
f54e64c8b9b7
* Makefile: added IMGFILE; moved some stuff around.
Guido van Rossum <guido@python.org>
parents:
1020
diff
changeset
|
1964 long rv; |
|
712
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
1965 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1966 if (args == NULL || !PyTuple_Check(args)) { |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1967 PyErr_BadArgument(); |
|
712
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
1968 return NULL; |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
1969 } |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1970 nb = PyTuple_Size(args) - 3; |
|
712
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
1971 if (nb <= 0) { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1972 PyErr_SetString(PyExc_TypeError, |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1973 "need at least one button label"); |
|
712
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
1974 return NULL; |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
1975 } |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1976 if (PyInt_Check(PyTuple_GetItem(args, 3))) { |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1977 PyErr_SetString(PyExc_TypeError, |
|
712
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
1978 "'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
|
1979 return NULL; |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
1980 } |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
1981 switch (nb) { |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
1982 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
|
1983 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
|
1984 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
|
1985 default: |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1986 PyErr_SetString(PyExc_TypeError, "too many button labels"); |
|
712
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
1987 return NULL; |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
1988 } |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
1989 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1990 if (!PyArg_Parse(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
|
1991 return NULL; |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
1992 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1993 Py_BEGIN_ALLOW_THREADS |
|
947
260d96db112f
Modified to allow other threads to run in a multithreaded environment.
Jack Jansen <jack.jansen@cwi.nl>
parents:
926
diff
changeset
|
1994 rv = fl_show_choice(m1, m2, m3, nb, b1, b2, b3); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1995 Py_END_ALLOW_THREADS |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1996 return PyInt_FromLong(rv); |
|
712
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
1997 } |
|
00cdb8dedd6f
Implemented show_choice(); moved items around a little bit.
Guido van Rossum <guido@python.org>
parents:
635
diff
changeset
|
1998 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
1999 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
2000 forms_show_question(PyObject *f, PyObject *args) |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2001 { |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
2002 int ret; |
|
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
2003 char *a, *b, *c; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2004 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2005 if (!PyArg_Parse(args, "(sss)", &a, &b, &c)) return NULL; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2006 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2007 Py_BEGIN_ALLOW_THREADS |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
2008 ret = fl_show_question(a, b, c); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2009 Py_END_ALLOW_THREADS |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2010 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2011 return PyInt_FromLong((long) ret); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2012 } |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2013 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2014 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
2015 forms_show_input(PyObject *f, PyObject *args) |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2016 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2017 char *str; |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
2018 char *a, *b; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2019 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2020 if (!PyArg_Parse(args, "(ss)", &a, &b)) return NULL; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2021 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2022 Py_BEGIN_ALLOW_THREADS |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
2023 str = fl_show_input(a, b); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2024 Py_END_ALLOW_THREADS |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2025 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2026 if (str == NULL) { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2027 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2028 return Py_None; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2029 } |
|
47527
52294af4b663
This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents:
47294
diff
changeset
|
2030 return PyString_FromString(str); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2031 } |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2032 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2033 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
2034 forms_file_selector(PyObject *f, PyObject *args) |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2035 { |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2036 char *str; |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
2037 char *a, *b, *c, *d; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2038 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2039 if (!PyArg_Parse(args, "(ssss)", &a, &b, &c, &d)) return NULL; |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2040 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2041 Py_BEGIN_ALLOW_THREADS |
|
635
784a09a52375
Use getargs() function.
Guido van Rossum <guido@python.org>
parents:
486
diff
changeset
|
2042 str = fl_show_file_selector(a, b, c, d); |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2043 Py_END_ALLOW_THREADS |
|
1020
7442b20c43fd
Use getargs() everywhere now. Standardize lay-out yet more (an ongoing
Guido van Rossum <guido@python.org>
parents:
947
diff
changeset
|
2044 |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2045 if (str == NULL) { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2046 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2047 return Py_None; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2048 } |
|
47527
52294af4b663
This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents:
47294
diff
changeset
|
2049 return PyString_FromString(str); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2050 } |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2051 |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2052 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2053 static PyObject * |
|
13667
a6c7bfdd6777
Even more ANSIfication: fix as many function pointers and declarations as
Thomas Wouters <thomas@python.org>
parents:
13651
diff
changeset
|
2054 forms_file_selector_func(PyObject *args, char *(*func)(void)) |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2055 { |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2056 char *str; |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2057 |
|
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2058 str = (*func) (); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2059 |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2060 if (str == NULL) { |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2061 Py_INCREF(Py_None); |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2062 return Py_None; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2063 } |
|
47527
52294af4b663
This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents:
47294
diff
changeset
|
2064 return PyString_FromString(str); |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2065 } |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2066 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2067 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
2068 forms_get_directory(PyObject *f, PyObject *args) |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2069 { |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2070 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
|
2071 } |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2072 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2073 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
2074 forms_get_pattern(PyObject *f, PyObject *args) |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2075 { |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2076 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
|
2077 } |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2078 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2079 static PyObject * |
|
13514
5304b88fe3cc
ANSI-fication of the SGI modules (note that svmodule.c and sgimodule.c
Peter Schneider-Kamp <nowonder@nowonder.de>
parents:
13256
diff
changeset
|
2080 forms_get_filename(PyObject *f, PyObject *args) |
|
330
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2081 { |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2082 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
|
2083 } |
|
1807d60e6231
Lots of cosmetic changes.
Guido van Rossum <guido@python.org>
parents:
329
diff
changeset
|
2084 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2085 static PyMethodDef forms_methods[] = { |
| 328 | 2086 /* adm */ |
|
21757
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2087 {"make_form", forms_make_form, METH_OLDARGS}, |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2088 {"activate_all_forms", forms_activate_all_forms, METH_OLDARGS}, |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2089 {"deactivate_all_forms",forms_deactivate_all_forms, METH_OLDARGS}, |
| 328 | 2090 /* gl support wrappers */ |
|
21757
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2091 {"qdevice", forms_qdevice, METH_OLDARGS}, |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2092 {"unqdevice", forms_unqdevice, METH_OLDARGS}, |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2093 {"isqueued", forms_isqueued, METH_OLDARGS}, |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2094 {"qtest", forms_qtest, METH_OLDARGS}, |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2095 {"qread", forms_qread, METH_OLDARGS}, |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2096 /* {"blkqread", forms_blkqread, METH_OLDARGS}, */ |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
2097 {"qreset", forms_qreset, METH_NOARGS}, |
|
21757
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2098 {"qenter", forms_qenter, METH_OLDARGS}, |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
2099 {"get_mouse", forms_get_mouse, METH_NOARGS}, |
|
21757
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2100 {"tie", forms_tie, METH_OLDARGS}, |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2101 /* {"new_events", forms_new_events, METH_OLDARGS}, */ |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2102 {"color", forms_color, METH_OLDARGS}, |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2103 {"mapcolor", forms_mapcolor, METH_OLDARGS}, |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2104 {"getmcolor", forms_getmcolor, METH_OLDARGS}, |
| 328 | 2105 /* interaction */ |
|
22712
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
2106 {"do_forms", forms_do_forms, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
2107 {"do_only_forms", forms_do_only_forms, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
2108 {"check_forms", forms_check_forms, METH_NOARGS}, |
|
b383dfe36eee
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz <nnorwitz@gmail.com>
parents:
21757
diff
changeset
|
2109 {"check_only_forms", forms_check_only_forms, METH_NOARGS}, |
|
21757
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2110 {"set_event_call_back", forms_set_event_call_back, METH_OLDARGS}, |
| 328 | 2111 /* goodies */ |
|
21757
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2112 {"show_message", forms_show_message, METH_OLDARGS}, |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2113 {"show_question", forms_show_question, METH_OLDARGS}, |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2114 {"show_choice", forms_show_choice, METH_OLDARGS}, |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2115 {"show_input", forms_show_input, METH_OLDARGS}, |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2116 {"show_file_selector", forms_file_selector, METH_OLDARGS}, |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2117 {"file_selector", forms_file_selector, METH_OLDARGS}, /* BW compat */ |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2118 {"get_directory", forms_get_directory, METH_OLDARGS}, |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2119 {"get_pattern", forms_get_pattern, METH_OLDARGS}, |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2120 {"get_filename", forms_get_filename, METH_OLDARGS}, |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2121 {"set_graphics_mode", forms_set_graphics_mode, METH_OLDARGS}, |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2122 {"get_rgbmode", forms_get_rgbmode, METH_OLDARGS}, |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2123 {"show_errors", forms_show_errors, METH_OLDARGS}, |
|
40631ae74b17
Patch #477750: Use METH_ constants in Modules.
Martin v. Löwis <martin@v.loewis.de>
parents:
21313
diff
changeset
|
2124 {"set_font_name", forms_set_font_name, METH_OLDARGS}, |
| 328 | 2125 {NULL, NULL} /* sentinel */ |
| 2126 }; | |
| 2127 | |
|
24471
f66b3a3509c7
Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototype
Mark Hammond <mhammond@skippinet.com.au>
parents:
24280
diff
changeset
|
2128 PyMODINIT_FUNC |
|
13651
8a063423e0b7
Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)',
Thomas Wouters <thomas@python.org>
parents:
13620
diff
changeset
|
2129 initfl(void) |
| 328 | 2130 { |
|
47023
5e8932991adf
FL, flp, and fl from IRIX have been deprecated for removal in 3.0.
Brett Cannon <bcannon@gmail.com>
parents:
38490
diff
changeset
|
2131 |
|
5e8932991adf
FL, flp, and fl from IRIX have been deprecated for removal in 3.0.
Brett Cannon <bcannon@gmail.com>
parents:
38490
diff
changeset
|
2132 if (PyErr_WarnPy3k("the fl module has been removed in " |
|
5e8932991adf
FL, flp, and fl from IRIX have been deprecated for removal in 3.0.
Brett Cannon <bcannon@gmail.com>
parents:
38490
diff
changeset
|
2133 "Python 3.0", 2) < 0) |
|
5e8932991adf
FL, flp, and fl from IRIX have been deprecated for removal in 3.0.
Brett Cannon <bcannon@gmail.com>
parents:
38490
diff
changeset
|
2134 return; |
|
5e8932991adf
FL, flp, and fl from IRIX have been deprecated for removal in 3.0.
Brett Cannon <bcannon@gmail.com>
parents:
38490
diff
changeset
|
2135 |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2136 Py_InitModule("fl", forms_methods); |
|
36324
1af7f719ed28
Check return result from Py_InitModule*(). This API can fail.
Neal Norwitz <nnorwitz@gmail.com>
parents:
30683
diff
changeset
|
2137 if (m == NULL) |
|
1af7f719ed28
Check return result from Py_InitModule*(). This API can fail.
Neal Norwitz <nnorwitz@gmail.com>
parents:
30683
diff
changeset
|
2138 return; |
|
392
f33a3f69dfcb
Done a little bit about garbage collection.
Guido van Rossum <guido@python.org>
parents:
376
diff
changeset
|
2139 foreground(); |
| 469 | 2140 fl_init(); |
| 328 | 2141 } |
|
4884
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2142 |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2143 |
|
65cb261f7736
Renamed, but untested.
Roger E. Masse <rmasse@newcnri.cnri.reston.va.us>
parents:
4503
diff
changeset
|
2144 |
