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 invisible.");
39
40 #define _CURSES_PANEL_PANEL_HIDE_METHODDEF \
41 {"hide", _PyCFunction_CAST(_curses_panel_panel_hide), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _curses_panel_panel_hide__doc__},
42
43 static PyObject *
44 _curses_panel_panel_hide_impl(PyCursesPanelObject *self, PyTypeObject *cls);
45
46 static PyObject *
47 _curses_panel_panel_hide(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
48 {
49 if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
50 PyErr_SetString(PyExc_TypeError, "hide() takes no arguments");
51 return NULL;
52 }
53 return _curses_panel_panel_hide_impl((PyCursesPanelObject *)self, cls);
54 }
55
56 PyDoc_STRVAR(_curses_panel_panel_show__doc__,
57 "show($self, /)\n"
58 "--\n"
59 "\n"
60 "Display the panel (which might have been hidden).");
61
62 #define _CURSES_PANEL_PANEL_SHOW_METHODDEF \
63 {"show", _PyCFunction_CAST(_curses_panel_panel_show), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _curses_panel_panel_show__doc__},
64
65 static PyObject *
66 _curses_panel_panel_show_impl(PyCursesPanelObject *self, PyTypeObject *cls);
67
68 static PyObject *
69 _curses_panel_panel_show(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
70 {
71 if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
72 PyErr_SetString(PyExc_TypeError, "show() takes no arguments");
73 return NULL;
74 }
75 return _curses_panel_panel_show_impl((PyCursesPanelObject *)self, cls);
76 }
77
78 PyDoc_STRVAR(_curses_panel_panel_top__doc__,
79 "top($self, /)\n"
80 "--\n"
81 "\n"
82 "Push panel to the top of the stack.");
83
84 #define _CURSES_PANEL_PANEL_TOP_METHODDEF \
85 {"top", _PyCFunction_CAST(_curses_panel_panel_top), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _curses_panel_panel_top__doc__},
86
87 static PyObject *
88 _curses_panel_panel_top_impl(PyCursesPanelObject *self, PyTypeObject *cls);
89
90 static PyObject *
91 _curses_panel_panel_top(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
92 {
93 if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
94 PyErr_SetString(PyExc_TypeError, "top() takes no arguments");
95 return NULL;
96 }
97 return _curses_panel_panel_top_impl((PyCursesPanelObject *)self, cls);
98 }
99
100 PyDoc_STRVAR(_curses_panel_panel_above__doc__,
101 "above($self, /)\n"
102 "--\n"
103 "\n"
104 "Return the panel above the current panel.");
105
106 #define _CURSES_PANEL_PANEL_ABOVE_METHODDEF \
107 {"above", (PyCFunction)_curses_panel_panel_above, METH_NOARGS, _curses_panel_panel_above__doc__},
108
109 static PyObject *
110 _curses_panel_panel_above_impl(PyCursesPanelObject *self);
111
112 static PyObject *
113 _curses_panel_panel_above(PyObject *self, PyObject *Py_UNUSED(ignored))
114 {
115 return _curses_panel_panel_above_impl((PyCursesPanelObject *)self);
116 }
117
118 PyDoc_STRVAR(_curses_panel_panel_below__doc__,
119 "below($self, /)\n"
120 "--\n"
121 "\n"
122 "Return the panel below the current panel.");
123
124 #define _CURSES_PANEL_PANEL_BELOW_METHODDEF \
125 {"below", (PyCFunction)_curses_panel_panel_below, METH_NOARGS, _curses_panel_panel_below__doc__},
126
127 static PyObject *
128 _curses_panel_panel_below_impl(PyCursesPanelObject *self);
129
130 static PyObject *
131 _curses_panel_panel_below(PyObject *self, PyObject *Py_UNUSED(ignored))
132 {
133 return _curses_panel_panel_below_impl((PyCursesPanelObject *)self);
134 }
135
136 PyDoc_STRVAR(_curses_panel_panel_hidden__doc__,
137 "hidden($self, /)\n"
138 "--\n"
139 "\n"
140 "Return True if the panel is hidden (not visible), False otherwise.");
141
142 #define _CURSES_PANEL_PANEL_HIDDEN_METHODDEF \
143 {"hidden", (PyCFunction)_curses_panel_panel_hidden, METH_NOARGS, _curses_panel_panel_hidden__doc__},
144
145 static PyObject *
146 _curses_panel_panel_hidden_impl(PyCursesPanelObject *self);
147
148 static PyObject *
149 _curses_panel_panel_hidden(PyObject *self, PyObject *Py_UNUSED(ignored))
150 {
151 return _curses_panel_panel_hidden_impl((PyCursesPanelObject *)self);
152 }
153
154 PyDoc_STRVAR(_curses_panel_panel_move__doc__,
155 "move($self, y, x, /)\n"
156 "--\n"
157 "\n"
158 "Move the panel to the screen coordinates (y, x).");
159
160 #define _CURSES_PANEL_PANEL_MOVE_METHODDEF \
161 {"move", _PyCFunction_CAST(_curses_panel_panel_move), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _curses_panel_panel_move__doc__},
162
163 static PyObject *
164 _curses_panel_panel_move_impl(PyCursesPanelObject *self, PyTypeObject *cls,
165 int y, int x);
166
167 static PyObject *
168 _curses_panel_panel_move(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
169 {
170 PyObject *return_value = NULL;
171 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
172 # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
173 #else
174 # define KWTUPLE NULL
175 #endif
176
177 static const char * const _keywords[] = {"", "", NULL};
178 static _PyArg_Parser _parser = {
179 .keywords = _keywords,
180 .fname = "move",
181 .kwtuple = KWTUPLE,
182 };
183 #undef KWTUPLE
184 PyObject *argsbuf[2];
185 int y;
186 int x;
187
188 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
189 /*minpos*/ 2, /*maxpos*/ 2, /*minkw*/ 0, /*varpos*/ 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((PyCursesPanelObject *)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(PyObject *self, PyObject *Py_UNUSED(ignored))
221 {
222 return _curses_panel_panel_window_impl((PyCursesPanelObject *)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(PyObject *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,
260 /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
261 if (!args) {
262 goto exit;
263 }
264 if (!PyObject_TypeCheck(args[0], &PyCursesWindow_Type)) {
265 _PyArg_BadArgument("replace", "argument 1", (&PyCursesWindow_Type)->tp_name, args[0]);
266 goto exit;
267 }
268 win = (PyCursesWindowObject *)args[0];
269 return_value = _curses_panel_panel_replace_impl((PyCursesPanelObject *)self, cls, win);
270
271 exit:
272 return return_value;
273 }
274
275 PyDoc_STRVAR(_curses_panel_panel_set_userptr__doc__,
276 "set_userptr($self, obj, /)\n"
277 "--\n"
278 "\n"
279 "Set the panel\'s user pointer to obj.");
280
281 #define _CURSES_PANEL_PANEL_SET_USERPTR_METHODDEF \
282 {"set_userptr", _PyCFunction_CAST(_curses_panel_panel_set_userptr), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _curses_panel_panel_set_userptr__doc__},
283
284 static PyObject *
285 _curses_panel_panel_set_userptr_impl(PyCursesPanelObject *self,
286 PyTypeObject *cls, PyObject *obj);
287
288 static PyObject *
289 _curses_panel_panel_set_userptr(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
290 {
291 PyObject *return_value = NULL;
292 #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
293 # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
294 #else
295 # define KWTUPLE NULL
296 #endif
297
298 static const char * const _keywords[] = {"", NULL};
299 static _PyArg_Parser _parser = {
300 .keywords = _keywords,
301 .fname = "set_userptr",
302 .kwtuple = KWTUPLE,
303 };
304 #undef KWTUPLE
305 PyObject *argsbuf[1];
306 PyObject *obj;
307
308 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
309 /*minpos*/ 1, /*maxpos*/ 1, /*minkw*/ 0, /*varpos*/ 0, argsbuf);
310 if (!args) {
311 goto exit;
312 }
313 obj = args[0];
314 return_value = _curses_panel_panel_set_userptr_impl((PyCursesPanelObject *)self, cls, obj);
315
316 exit:
317 return return_value;
318 }
319
320 PyDoc_STRVAR(_curses_panel_panel_userptr__doc__,
321 "userptr($self, /)\n"
322 "--\n"
323 "\n"
324 "Return the user pointer for the panel.");
325
326 #define _CURSES_PANEL_PANEL_USERPTR_METHODDEF \
327 {"userptr", _PyCFunction_CAST(_curses_panel_panel_userptr), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _curses_panel_panel_userptr__doc__},
328
329 static PyObject *
330 _curses_panel_panel_userptr_impl(PyCursesPanelObject *self,
331 PyTypeObject *cls);
332
333 static PyObject *
334 _curses_panel_panel_userptr(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
335 {
336 if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
337 PyErr_SetString(PyExc_TypeError, "userptr() takes no arguments");
338 return NULL;
339 }
340 return _curses_panel_panel_userptr_impl((PyCursesPanelObject *)self, cls);
341 }
342
343 PyDoc_STRVAR(_curses_panel_bottom_panel__doc__,
344 "bottom_panel($module, /)\n"
345 "--\n"
346 "\n"
347 "Return the bottom panel in the panel stack.");
348
349 #define _CURSES_PANEL_BOTTOM_PANEL_METHODDEF \
350 {"bottom_panel", (PyCFunction)_curses_panel_bottom_panel, METH_NOARGS, _curses_panel_bottom_panel__doc__},
351
352 static PyObject *
353 _curses_panel_bottom_panel_impl(PyObject *module);
354
355 static PyObject *
356 _curses_panel_bottom_panel(PyObject *module, PyObject *Py_UNUSED(ignored))
357 {
358 return _curses_panel_bottom_panel_impl(module);
359 }
360
361 PyDoc_STRVAR(_curses_panel_new_panel__doc__,
362 "new_panel($module, win, /)\n"
363 "--\n"
364 "\n"
365 "Return a panel object, associating it with the given window win.");
366
367 #define _CURSES_PANEL_NEW_PANEL_METHODDEF \
368 {"new_panel", (PyCFunction)_curses_panel_new_panel, METH_O, _curses_panel_new_panel__doc__},
369
370 static PyObject *
371 _curses_panel_new_panel_impl(PyObject *module, PyCursesWindowObject *win);
372
373 static PyObject *
374 _curses_panel_new_panel(PyObject *module, PyObject *arg)
375 {
376 PyObject *return_value = NULL;
377 PyCursesWindowObject *win;
378
379 if (!PyObject_TypeCheck(arg, &PyCursesWindow_Type)) {
380 _PyArg_BadArgument("new_panel", "argument", (&PyCursesWindow_Type)->tp_name, arg);
381 goto exit;
382 }
383 win = (PyCursesWindowObject *)arg;
384 return_value = _curses_panel_new_panel_impl(module, win);
385
386 exit:
387 return return_value;
388 }
389
390 PyDoc_STRVAR(_curses_panel_top_panel__doc__,
391 "top_panel($module, /)\n"
392 "--\n"
393 "\n"
394 "Return the top panel in the panel stack.");
395
396 #define _CURSES_PANEL_TOP_PANEL_METHODDEF \
397 {"top_panel", (PyCFunction)_curses_panel_top_panel, METH_NOARGS, _curses_panel_top_panel__doc__},
398
399 static PyObject *
400 _curses_panel_top_panel_impl(PyObject *module);
401
402 static PyObject *
403 _curses_panel_top_panel(PyObject *module, PyObject *Py_UNUSED(ignored))
404 {
405 return _curses_panel_top_panel_impl(module);
406 }
407
408 PyDoc_STRVAR(_curses_panel_update_panels__doc__,
409 "update_panels($module, /)\n"
410 "--\n"
411 "\n"
412 "Updates the virtual screen after changes in the panel stack.\n"
413 "\n"
414 "This does not call curses.doupdate(), so you\'ll have to do this yourself.");
415
416 #define _CURSES_PANEL_UPDATE_PANELS_METHODDEF \
417 {"update_panels", (PyCFunction)_curses_panel_update_panels, METH_NOARGS, _curses_panel_update_panels__doc__},
418
419 static PyObject *
420 _curses_panel_update_panels_impl(PyObject *module);
421
422 static PyObject *
423 _curses_panel_update_panels(PyObject *module, PyObject *Py_UNUSED(ignored))
424 {
425 return _curses_panel_update_panels_impl(module);
426 }
427 /*[clinic end generated code: output=36853ecb4a979814 input=a9049054013a1b77]*/