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