Debian Codegraph @

Modules/clinic/_curses_panel.c.h

raw
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_runtime.h" // _Py_SINGLETON()
7 #endif
8 #include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
9
10 PyDoc_STRVAR(_curses_panel_panel_bottom__doc__,
11 "bottom($self, /)\n"
12 "--\n"
13 "\n"
14 "Push the panel to the bottom of the stack.");
15
16 #define _CURSES_PANEL_PANEL_BOTTOM_METHODDEF \
17 {"bottom", _PyCFunction_CAST(_curses_panel_panel_bottom), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _curses_panel_panel_bottom__doc__},
18
19 static PyObject *
20 _curses_panel_panel_bottom_impl(PyCursesPanelObject *self, PyTypeObject *cls);
21
22 static PyObject *
23 _curses_panel_panel_bottom(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
24 {
25 if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
26 PyErr_SetString(PyExc_TypeError, "bottom() takes no arguments");
27 return NULL;
28 }
29 return _curses_panel_panel_bottom_impl((PyCursesPanelObject *)self, cls);
30 }
31
32 PyDoc_STRVAR(_curses_panel_panel_hide__doc__,
33 "hide($self, /)\n"
34 "--\n"
35 "\n"
36 "Hide the panel.\n"
37 "\n"
38 "This does not delete the object, it just makes the window on screen\n"
39 "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(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
49 {
50 if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
51 PyErr_SetString(PyExc_TypeError, "hide() takes no arguments");
52 return NULL;
53 }
54 return _curses_panel_panel_hide_impl((PyCursesPanelObject *)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(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
71 {
72 if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
73 PyErr_SetString(PyExc_TypeError, "show() takes no arguments");
74 return NULL;
75 }
76 return _curses_panel_panel_show_impl((PyCursesPanelObject *)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(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
93 {
94 if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
95 PyErr_SetString(PyExc_TypeError, "top() takes no arguments");
96 return NULL;
97 }
98 return _curses_panel_panel_top_impl((PyCursesPanelObject *)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(PyObject *self, PyObject *Py_UNUSED(ignored))
115 {
116 return _curses_panel_panel_above_impl((PyCursesPanelObject *)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(PyObject *self, PyObject *Py_UNUSED(ignored))
133 {
134 return _curses_panel_panel_below_impl((PyCursesPanelObject *)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(PyObject *self, PyObject *Py_UNUSED(ignored))
151 {
152 return _curses_panel_panel_hidden_impl((PyCursesPanelObject *)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(PyObject *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,
190 /*minpos*/ 2, /*maxpos*/ 2, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
191 if (!args) {
192 goto exit;
193 }
194 y = PyLong_AsInt(args[0]);
195 if (y == -1 && PyErr_Occurred()) {
196 goto exit;
197 }
198 x = PyLong_AsInt(args[1]);
199 if (x == -1 && PyErr_Occurred()) {
200 goto exit;
201 }
202 return_value = _curses_panel_panel_move_impl((PyCursesPanelObject *)self, cls, y, x);
203
204 exit:
205 return return_value;
206 }
207
208 PyDoc_STRVAR(_curses_panel_panel_window__doc__,
209 "window($self, /)\n"
210 "--\n"
211 "\n"
212 "Return the window object associated with the panel.");
213
214 #define _CURSES_PANEL_PANEL_WINDOW_METHODDEF \
215 {"window", (PyCFunction)_curses_panel_panel_window, METH_NOARGS, _curses_panel_panel_window__doc__},
216
217 static PyObject *
218 _curses_panel_panel_window_impl(PyCursesPanelObject *self);
219
220 static PyObject *
221 _curses_panel_panel_window(PyObject *self, PyObject *Py_UNUSED(ignored))
222 {
223 return _curses_panel_panel_window_impl((PyCursesPanelObject *)self);
224 }
225
226 PyDoc_STRVAR(_curses_panel_panel_replace__doc__,
227 "replace($self, win, /)\n"
228 "--\n"
229 "\n"
230 "Change the window associated with the panel to the window win.");
231
232 #define _CURSES_PANEL_PANEL_REPLACE_METHODDEF \
233 {"replace", _PyCFunction_CAST(_curses_panel_panel_replace), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _curses_panel_panel_replace__doc__},
234
235 static PyObject *
236 _curses_panel_panel_replace_impl(PyCursesPanelObject *self,
237 PyTypeObject *cls,
238 PyCursesWindowObject *win);
239
240 static PyObject *
241 _curses_panel_panel_replace(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
242 {
243 PyObject *return_value = NULL;
244 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
245 # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
246 #else
247 # define KWTUPLE NULL
248 #endif
249
250 static const char * const _keywords[] = {"", NULL};
251 static _PyArg_Parser _parser = {
252 .keywords = _keywords,
253 .fname = "replace",
254 .kwtuple = KWTUPLE,
255 };
256 #undef KWTUPLE
257 PyObject *argsbuf[1];
258 PyCursesWindowObject *win;
259
260 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
261 /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
262 if (!args) {
263 goto exit;
264 }
265 if (!PyObject_TypeCheck(args[0], &PyCursesWindow_Type)) {
266 _PyArg_BadArgument("replace", "argument 1", (&PyCursesWindow_Type)->tp_name, args[0]);
267 goto exit;
268 }
269 win = (PyCursesWindowObject *)args[0];
270 return_value = _curses_panel_panel_replace_impl((PyCursesPanelObject *)self, cls, win);
271
272 exit:
273 return return_value;
274 }
275
276 PyDoc_STRVAR(_curses_panel_panel_set_userptr__doc__,
277 "set_userptr($self, obj, /)\n"
278 "--\n"
279 "\n"
280 "Set the panel\'s user pointer to obj.");
281
282 #define _CURSES_PANEL_PANEL_SET_USERPTR_METHODDEF \
283 {"set_userptr", _PyCFunction_CAST(_curses_panel_panel_set_userptr), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _curses_panel_panel_set_userptr__doc__},
284
285 static PyObject *
286 _curses_panel_panel_set_userptr_impl(PyCursesPanelObject *self,
287 PyTypeObject *cls, PyObject *obj);
288
289 static PyObject *
290 _curses_panel_panel_set_userptr(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
291 {
292 PyObject *return_value = NULL;
293 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
294 # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
295 #else
296 # define KWTUPLE NULL
297 #endif
298
299 static const char * const _keywords[] = {"", NULL};
300 static _PyArg_Parser _parser = {
301 .keywords = _keywords,
302 .fname = "set_userptr",
303 .kwtuple = KWTUPLE,
304 };
305 #undef KWTUPLE
306 PyObject *argsbuf[1];
307 PyObject *obj;
308
309 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
310 /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
311 if (!args) {
312 goto exit;
313 }
314 obj = args[0];
315 return_value = _curses_panel_panel_set_userptr_impl((PyCursesPanelObject *)self, cls, obj);
316
317 exit:
318 return return_value;
319 }
320
321 PyDoc_STRVAR(_curses_panel_panel_userptr__doc__,
322 "userptr($self, /)\n"
323 "--\n"
324 "\n"
325 "Return the user pointer for the panel.");
326
327 #define _CURSES_PANEL_PANEL_USERPTR_METHODDEF \
328 {"userptr", _PyCFunction_CAST(_curses_panel_panel_userptr), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _curses_panel_panel_userptr__doc__},
329
330 static PyObject *
331 _curses_panel_panel_userptr_impl(PyCursesPanelObject *self,
332 PyTypeObject *cls);
333
334 static PyObject *
335 _curses_panel_panel_userptr(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
336 {
337 if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
338 PyErr_SetString(PyExc_TypeError, "userptr() takes no arguments");
339 return NULL;
340 }
341 return _curses_panel_panel_userptr_impl((PyCursesPanelObject *)self, cls);
342 }
343
344 PyDoc_STRVAR(_curses_panel_bottom_panel__doc__,
345 "bottom_panel($module, /)\n"
346 "--\n"
347 "\n"
348 "Return the bottom panel in the panel stack.");
349
350 #define _CURSES_PANEL_BOTTOM_PANEL_METHODDEF \
351 {"bottom_panel", (PyCFunction)_curses_panel_bottom_panel, METH_NOARGS, _curses_panel_bottom_panel__doc__},
352
353 static PyObject *
354 _curses_panel_bottom_panel_impl(PyObject *module);
355
356 static PyObject *
357 _curses_panel_bottom_panel(PyObject *module, PyObject *Py_UNUSED(ignored))
358 {
359 return _curses_panel_bottom_panel_impl(module);
360 }
361
362 PyDoc_STRVAR(_curses_panel_new_panel__doc__,
363 "new_panel($module, win, /)\n"
364 "--\n"
365 "\n"
366 "Return a panel object, associating it with the given window win.");
367
368 #define _CURSES_PANEL_NEW_PANEL_METHODDEF \
369 {"new_panel", (PyCFunction)_curses_panel_new_panel, METH_O, _curses_panel_new_panel__doc__},
370
371 static PyObject *
372 _curses_panel_new_panel_impl(PyObject *module, PyCursesWindowObject *win);
373
374 static PyObject *
375 _curses_panel_new_panel(PyObject *module, PyObject *arg)
376 {
377 PyObject *return_value = NULL;
378 PyCursesWindowObject *win;
379
380 if (!PyObject_TypeCheck(arg, &PyCursesWindow_Type)) {
381 _PyArg_BadArgument("new_panel", "argument", (&PyCursesWindow_Type)->tp_name, arg);
382 goto exit;
383 }
384 win = (PyCursesWindowObject *)arg;
385 return_value = _curses_panel_new_panel_impl(module, win);
386
387 exit:
388 return return_value;
389 }
390
391 PyDoc_STRVAR(_curses_panel_top_panel__doc__,
392 "top_panel($module, /)\n"
393 "--\n"
394 "\n"
395 "Return the top panel in the panel stack.");
396
397 #define _CURSES_PANEL_TOP_PANEL_METHODDEF \
398 {"top_panel", (PyCFunction)_curses_panel_top_panel, METH_NOARGS, _curses_panel_top_panel__doc__},
399
400 static PyObject *
401 _curses_panel_top_panel_impl(PyObject *module);
402
403 static PyObject *
404 _curses_panel_top_panel(PyObject *module, PyObject *Py_UNUSED(ignored))
405 {
406 return _curses_panel_top_panel_impl(module);
407 }
408
409 PyDoc_STRVAR(_curses_panel_update_panels__doc__,
410 "update_panels($module, /)\n"
411 "--\n"
412 "\n"
413 "Updates the virtual screen after changes in the panel stack.\n"
414 "\n"
415 "This does not call curses.doupdate(), so you\'ll have to do this\n"
416 "yourself.");
417
418 #define _CURSES_PANEL_UPDATE_PANELS_METHODDEF \
419 {"update_panels", (PyCFunction)_curses_panel_update_panels, METH_NOARGS, _curses_panel_update_panels__doc__},
420
421 static PyObject *
422 _curses_panel_update_panels_impl(PyObject *module);
423
424 static PyObject *
425 _curses_panel_update_panels(PyObject *module, PyObject *Py_UNUSED(ignored))
426 {
427 return _curses_panel_update_panels_impl(module);
428 }
429 /*[clinic end generated code: output=ef0da2e73543fd65 input=a9049054013a1b77]*/