1 /*[clinic input]
2 preserve
3 [clinic start generated code]*/
4
5 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
6 # include "pycore_gc.h" // PyGC_Head
7 # include "pycore_runtime.h" // _Py_ID()
8 #endif
9
10
11 PyDoc_STRVAR(_curses_panel_panel_bottom__doc__,
12 "bottom($self, /)\n"
13 "--\n"
14 "\n"
15 "Push the panel to the bottom of the stack.");
16
17 #define _CURSES_PANEL_PANEL_BOTTOM_METHODDEF \
18 {"bottom", _PyCFunction_CAST(_curses_panel_panel_bottom), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _curses_panel_panel_bottom__doc__},
19
20 static PyObject *
21 _curses_panel_panel_bottom_impl(PyCursesPanelObject *self, PyTypeObject *cls);
22
23 static PyObject *
24 _curses_panel_panel_bottom(PyCursesPanelObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
25 {
26 if (nargs) {
27 PyErr_SetString(PyExc_TypeError, "bottom() takes no arguments");
28 return NULL;
29 }
30 return _curses_panel_panel_bottom_impl(self, cls);
31 }
32
33 PyDoc_STRVAR(_curses_panel_panel_hide__doc__,
34 "hide($self, /)\n"
35 "--\n"
36 "\n"
37 "Hide the panel.\n"
38 "\n"
39 "This does not delete the object, it just makes the window on screen invisible.");
40
41 #define _CURSES_PANEL_PANEL_HIDE_METHODDEF \
42 {"hide", _PyCFunction_CAST(_curses_panel_panel_hide), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _curses_panel_panel_hide__doc__},
43
44 static PyObject *
45 _curses_panel_panel_hide_impl(PyCursesPanelObject *self, PyTypeObject *cls);
46
47 static PyObject *
48 _curses_panel_panel_hide(PyCursesPanelObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
49 {
50 if (nargs) {
51 PyErr_SetString(PyExc_TypeError, "hide() takes no arguments");
52 return NULL;
53 }
54 return _curses_panel_panel_hide_impl(self, cls);
55 }
56
57 PyDoc_STRVAR(_curses_panel_panel_show__doc__,
58 "show($self, /)\n"
59 "--\n"
60 "\n"
61 "Display the panel (which might have been hidden).");
62
63 #define _CURSES_PANEL_PANEL_SHOW_METHODDEF \
64 {"show", _PyCFunction_CAST(_curses_panel_panel_show), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _curses_panel_panel_show__doc__},
65
66 static PyObject *
67 _curses_panel_panel_show_impl(PyCursesPanelObject *self, PyTypeObject *cls);
68
69 static PyObject *
70 _curses_panel_panel_show(PyCursesPanelObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
71 {
72 if (nargs) {
73 PyErr_SetString(PyExc_TypeError, "show() takes no arguments");
74 return NULL;
75 }
76 return _curses_panel_panel_show_impl(self, cls);
77 }
78
79 PyDoc_STRVAR(_curses_panel_panel_top__doc__,
80 "top($self, /)\n"
81 "--\n"
82 "\n"
83 "Push panel to the top of the stack.");
84
85 #define _CURSES_PANEL_PANEL_TOP_METHODDEF \
86 {"top", _PyCFunction_CAST(_curses_panel_panel_top), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _curses_panel_panel_top__doc__},
87
88 static PyObject *
89 _curses_panel_panel_top_impl(PyCursesPanelObject *self, PyTypeObject *cls);
90
91 static PyObject *
92 _curses_panel_panel_top(PyCursesPanelObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
93 {
94 if (nargs) {
95 PyErr_SetString(PyExc_TypeError, "top() takes no arguments");
96 return NULL;
97 }
98 return _curses_panel_panel_top_impl(self, cls);
99 }
100
101 PyDoc_STRVAR(_curses_panel_panel_above__doc__,
102 "above($self, /)\n"
103 "--\n"
104 "\n"
105 "Return the panel above the current panel.");
106
107 #define _CURSES_PANEL_PANEL_ABOVE_METHODDEF \
108 {"above", (PyCFunction)_curses_panel_panel_above, METH_NOARGS, _curses_panel_panel_above__doc__},
109
110 static PyObject *
111 _curses_panel_panel_above_impl(PyCursesPanelObject *self);
112
113 static PyObject *
114 _curses_panel_panel_above(PyCursesPanelObject *self, PyObject *Py_UNUSED(ignored))
115 {
116 return _curses_panel_panel_above_impl(self);
117 }
118
119 PyDoc_STRVAR(_curses_panel_panel_below__doc__,
120 "below($self, /)\n"
121 "--\n"
122 "\n"
123 "Return the panel below the current panel.");
124
125 #define _CURSES_PANEL_PANEL_BELOW_METHODDEF \
126 {"below", (PyCFunction)_curses_panel_panel_below, METH_NOARGS, _curses_panel_panel_below__doc__},
127
128 static PyObject *
129 _curses_panel_panel_below_impl(PyCursesPanelObject *self);
130
131 static PyObject *
132 _curses_panel_panel_below(PyCursesPanelObject *self, PyObject *Py_UNUSED(ignored))
133 {
134 return _curses_panel_panel_below_impl(self);
135 }
136
137 PyDoc_STRVAR(_curses_panel_panel_hidden__doc__,
138 "hidden($self, /)\n"
139 "--\n"
140 "\n"
141 "Return True if the panel is hidden (not visible), False otherwise.");
142
143 #define _CURSES_PANEL_PANEL_HIDDEN_METHODDEF \
144 {"hidden", (PyCFunction)_curses_panel_panel_hidden, METH_NOARGS, _curses_panel_panel_hidden__doc__},
145
146 static PyObject *
147 _curses_panel_panel_hidden_impl(PyCursesPanelObject *self);
148
149 static PyObject *
150 _curses_panel_panel_hidden(PyCursesPanelObject *self, PyObject *Py_UNUSED(ignored))
151 {
152 return _curses_panel_panel_hidden_impl(self);
153 }
154
155 PyDoc_STRVAR(_curses_panel_panel_move__doc__,
156 "move($self, y, x, /)\n"
157 "--\n"
158 "\n"
159 "Move the panel to the screen coordinates (y, x).");
160
161 #define _CURSES_PANEL_PANEL_MOVE_METHODDEF \
162 {"move", _PyCFunction_CAST(_curses_panel_panel_move), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _curses_panel_panel_move__doc__},
163
164 static PyObject *
165 _curses_panel_panel_move_impl(PyCursesPanelObject *self, PyTypeObject *cls,
166 int y, int x);
167
168 static PyObject *
169 _curses_panel_panel_move(PyCursesPanelObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
170 {
171 PyObject *return_value = NULL;
172 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
173 # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
174 #else
175 # define KWTUPLE NULL
176 #endif
177
178 static const char * const _keywords[] = {"", "", NULL};
179 static _PyArg_Parser _parser = {
180 .keywords = _keywords,
181 .fname = "move",
182 .kwtuple = KWTUPLE,
183 };
184 #undef KWTUPLE
185 PyObject *argsbuf[2];
186 int y;
187 int x;
188
189 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
190 if (!args) {
191 goto exit;
192 }
193 y = _PyLong_AsInt(args[0]);
194 if (y == -1 && PyErr_Occurred()) {
195 goto exit;
196 }
197 x = _PyLong_AsInt(args[1]);
198 if (x == -1 && PyErr_Occurred()) {
199 goto exit;
200 }
201 return_value = _curses_panel_panel_move_impl(self, cls, y, x);
202
203 exit:
204 return return_value;
205 }
206
207 PyDoc_STRVAR(_curses_panel_panel_window__doc__,
208 "window($self, /)\n"
209 "--\n"
210 "\n"
211 "Return the window object associated with the panel.");
212
213 #define _CURSES_PANEL_PANEL_WINDOW_METHODDEF \
214 {"window", (PyCFunction)_curses_panel_panel_window, METH_NOARGS, _curses_panel_panel_window__doc__},
215
216 static PyObject *
217 _curses_panel_panel_window_impl(PyCursesPanelObject *self);
218
219 static PyObject *
220 _curses_panel_panel_window(PyCursesPanelObject *self, PyObject *Py_UNUSED(ignored))
221 {
222 return _curses_panel_panel_window_impl(self);
223 }
224
225 PyDoc_STRVAR(_curses_panel_panel_replace__doc__,
226 "replace($self, win, /)\n"
227 "--\n"
228 "\n"
229 "Change the window associated with the panel to the window win.");
230
231 #define _CURSES_PANEL_PANEL_REPLACE_METHODDEF \
232 {"replace", _PyCFunction_CAST(_curses_panel_panel_replace), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _curses_panel_panel_replace__doc__},
233
234 static PyObject *
235 _curses_panel_panel_replace_impl(PyCursesPanelObject *self,
236 PyTypeObject *cls,
237 PyCursesWindowObject *win);
238
239 static PyObject *
240 _curses_panel_panel_replace(PyCursesPanelObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
241 {
242 PyObject *return_value = NULL;
243 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
244 # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
245 #else
246 # define KWTUPLE NULL
247 #endif
248
249 static const char * const _keywords[] = {"", NULL};
250 static _PyArg_Parser _parser = {
251 .keywords = _keywords,
252 .fname = "replace",
253 .kwtuple = KWTUPLE,
254 };
255 #undef KWTUPLE
256 PyObject *argsbuf[1];
257 PyCursesWindowObject *win;
258
259 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
260 if (!args) {
261 goto exit;
262 }
263 if (!PyObject_TypeCheck(args[0], &PyCursesWindow_Type)) {
264 _PyArg_BadArgument("replace", "argument 1", (&PyCursesWindow_Type)->tp_name, args[0]);
265 goto exit;
266 }
267 win = (PyCursesWindowObject *)args[0];
268 return_value = _curses_panel_panel_replace_impl(self, cls, win);
269
270 exit:
271 return return_value;
272 }
273
274 PyDoc_STRVAR(_curses_panel_panel_set_userptr__doc__,
275 "set_userptr($self, obj, /)\n"
276 "--\n"
277 "\n"
278 "Set the panel\'s user pointer to obj.");
279
280 #define _CURSES_PANEL_PANEL_SET_USERPTR_METHODDEF \
281 {"set_userptr", _PyCFunction_CAST(_curses_panel_panel_set_userptr), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _curses_panel_panel_set_userptr__doc__},
282
283 static PyObject *
284 _curses_panel_panel_set_userptr_impl(PyCursesPanelObject *self,
285 PyTypeObject *cls, PyObject *obj);
286
287 static PyObject *
288 _curses_panel_panel_set_userptr(PyCursesPanelObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
289 {
290 PyObject *return_value = NULL;
291 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
292 # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
293 #else
294 # define KWTUPLE NULL
295 #endif
296
297 static const char * const _keywords[] = {"", NULL};
298 static _PyArg_Parser _parser = {
299 .keywords = _keywords,
300 .fname = "set_userptr",
301 .kwtuple = KWTUPLE,
302 };
303 #undef KWTUPLE
304 PyObject *argsbuf[1];
305 PyObject *obj;
306
307 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
308 if (!args) {
309 goto exit;
310 }
311 obj = args[0];
312 return_value = _curses_panel_panel_set_userptr_impl(self, cls, obj);
313
314 exit:
315 return return_value;
316 }
317
318 PyDoc_STRVAR(_curses_panel_panel_userptr__doc__,
319 "userptr($self, /)\n"
320 "--\n"
321 "\n"
322 "Return the user pointer for the panel.");
323
324 #define _CURSES_PANEL_PANEL_USERPTR_METHODDEF \
325 {"userptr", _PyCFunction_CAST(_curses_panel_panel_userptr), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _curses_panel_panel_userptr__doc__},
326
327 static PyObject *
328 _curses_panel_panel_userptr_impl(PyCursesPanelObject *self,
329 PyTypeObject *cls);
330
331 static PyObject *
332 _curses_panel_panel_userptr(PyCursesPanelObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
333 {
334 if (nargs) {
335 PyErr_SetString(PyExc_TypeError, "userptr() takes no arguments");
336 return NULL;
337 }
338 return _curses_panel_panel_userptr_impl(self, cls);
339 }
340
341 PyDoc_STRVAR(_curses_panel_bottom_panel__doc__,
342 "bottom_panel($module, /)\n"
343 "--\n"
344 "\n"
345 "Return the bottom panel in the panel stack.");
346
347 #define _CURSES_PANEL_BOTTOM_PANEL_METHODDEF \
348 {"bottom_panel", (PyCFunction)_curses_panel_bottom_panel, METH_NOARGS, _curses_panel_bottom_panel__doc__},
349
350 static PyObject *
351 _curses_panel_bottom_panel_impl(PyObject *module);
352
353 static PyObject *
354 _curses_panel_bottom_panel(PyObject *module, PyObject *Py_UNUSED(ignored))
355 {
356 return _curses_panel_bottom_panel_impl(module);
357 }
358
359 PyDoc_STRVAR(_curses_panel_new_panel__doc__,
360 "new_panel($module, win, /)\n"
361 "--\n"
362 "\n"
363 "Return a panel object, associating it with the given window win.");
364
365 #define _CURSES_PANEL_NEW_PANEL_METHODDEF \
366 {"new_panel", (PyCFunction)_curses_panel_new_panel, METH_O, _curses_panel_new_panel__doc__},
367
368 static PyObject *
369 _curses_panel_new_panel_impl(PyObject *module, PyCursesWindowObject *win);
370
371 static PyObject *
372 _curses_panel_new_panel(PyObject *module, PyObject *arg)
373 {
374 PyObject *return_value = NULL;
375 PyCursesWindowObject *win;
376
377 if (!PyObject_TypeCheck(arg, &PyCursesWindow_Type)) {
378 _PyArg_BadArgument("new_panel", "argument", (&PyCursesWindow_Type)->tp_name, arg);
379 goto exit;
380 }
381 win = (PyCursesWindowObject *)arg;
382 return_value = _curses_panel_new_panel_impl(module, win);
383
384 exit:
385 return return_value;
386 }
387
388 PyDoc_STRVAR(_curses_panel_top_panel__doc__,
389 "top_panel($module, /)\n"
390 "--\n"
391 "\n"
392 "Return the top panel in the panel stack.");
393
394 #define _CURSES_PANEL_TOP_PANEL_METHODDEF \
395 {"top_panel", (PyCFunction)_curses_panel_top_panel, METH_NOARGS, _curses_panel_top_panel__doc__},
396
397 static PyObject *
398 _curses_panel_top_panel_impl(PyObject *module);
399
400 static PyObject *
401 _curses_panel_top_panel(PyObject *module, PyObject *Py_UNUSED(ignored))
402 {
403 return _curses_panel_top_panel_impl(module);
404 }
405
406 PyDoc_STRVAR(_curses_panel_update_panels__doc__,
407 "update_panels($module, /)\n"
408 "--\n"
409 "\n"
410 "Updates the virtual screen after changes in the panel stack.\n"
411 "\n"
412 "This does not call curses.doupdate(), so you\'ll have to do this yourself.");
413
414 #define _CURSES_PANEL_UPDATE_PANELS_METHODDEF \
415 {"update_panels", (PyCFunction)_curses_panel_update_panels, METH_NOARGS, _curses_panel_update_panels__doc__},
416
417 static PyObject *
418 _curses_panel_update_panels_impl(PyObject *module);
419
420 static PyObject *
421 _curses_panel_update_panels(PyObject *module, PyObject *Py_UNUSED(ignored))
422 {
423 return _curses_panel_update_panels_impl(module);
424 }
425 /*[clinic end generated code: output=8d0533681891523c input=a9049054013a1b77]*/