1 /*[clinic input]
2 preserve
3 [clinic start generated code]*/
4
5 PyDoc_STRVAR(_tkinter_tkapp_eval__doc__,
6 "eval($self, script, /)\n"
7 "--\n"
8 "\n");
9
10 #define _TKINTER_TKAPP_EVAL_METHODDEF \
11 {"eval", (PyCFunction)_tkinter_tkapp_eval, METH_O, _tkinter_tkapp_eval__doc__},
12
13 static PyObject *
14 _tkinter_tkapp_eval_impl(TkappObject *self, const char *script);
15
16 static PyObject *
_tkinter_tkapp_eval(TkappObject * self,PyObject * arg)17 _tkinter_tkapp_eval(TkappObject *self, PyObject *arg)
18 {
19 PyObject *return_value = NULL;
20 const char *script;
21
22 if (!PyUnicode_Check(arg)) {
23 _PyArg_BadArgument("eval", "argument", "str", arg);
24 goto exit;
25 }
26 Py_ssize_t script_length;
27 script = PyUnicode_AsUTF8AndSize(arg, &script_length);
28 if (script == NULL) {
29 goto exit;
30 }
31 if (strlen(script) != (size_t)script_length) {
32 PyErr_SetString(PyExc_ValueError, "embedded null character");
33 goto exit;
34 }
35 return_value = _tkinter_tkapp_eval_impl(self, script);
36
37 exit:
38 return return_value;
39 }
40
41 PyDoc_STRVAR(_tkinter_tkapp_evalfile__doc__,
42 "evalfile($self, fileName, /)\n"
43 "--\n"
44 "\n");
45
46 #define _TKINTER_TKAPP_EVALFILE_METHODDEF \
47 {"evalfile", (PyCFunction)_tkinter_tkapp_evalfile, METH_O, _tkinter_tkapp_evalfile__doc__},
48
49 static PyObject *
50 _tkinter_tkapp_evalfile_impl(TkappObject *self, const char *fileName);
51
52 static PyObject *
_tkinter_tkapp_evalfile(TkappObject * self,PyObject * arg)53 _tkinter_tkapp_evalfile(TkappObject *self, PyObject *arg)
54 {
55 PyObject *return_value = NULL;
56 const char *fileName;
57
58 if (!PyUnicode_Check(arg)) {
59 _PyArg_BadArgument("evalfile", "argument", "str", arg);
60 goto exit;
61 }
62 Py_ssize_t fileName_length;
63 fileName = PyUnicode_AsUTF8AndSize(arg, &fileName_length);
64 if (fileName == NULL) {
65 goto exit;
66 }
67 if (strlen(fileName) != (size_t)fileName_length) {
68 PyErr_SetString(PyExc_ValueError, "embedded null character");
69 goto exit;
70 }
71 return_value = _tkinter_tkapp_evalfile_impl(self, fileName);
72
73 exit:
74 return return_value;
75 }
76
77 PyDoc_STRVAR(_tkinter_tkapp_record__doc__,
78 "record($self, script, /)\n"
79 "--\n"
80 "\n");
81
82 #define _TKINTER_TKAPP_RECORD_METHODDEF \
83 {"record", (PyCFunction)_tkinter_tkapp_record, METH_O, _tkinter_tkapp_record__doc__},
84
85 static PyObject *
86 _tkinter_tkapp_record_impl(TkappObject *self, const char *script);
87
88 static PyObject *
_tkinter_tkapp_record(TkappObject * self,PyObject * arg)89 _tkinter_tkapp_record(TkappObject *self, PyObject *arg)
90 {
91 PyObject *return_value = NULL;
92 const char *script;
93
94 if (!PyUnicode_Check(arg)) {
95 _PyArg_BadArgument("record", "argument", "str", arg);
96 goto exit;
97 }
98 Py_ssize_t script_length;
99 script = PyUnicode_AsUTF8AndSize(arg, &script_length);
100 if (script == NULL) {
101 goto exit;
102 }
103 if (strlen(script) != (size_t)script_length) {
104 PyErr_SetString(PyExc_ValueError, "embedded null character");
105 goto exit;
106 }
107 return_value = _tkinter_tkapp_record_impl(self, script);
108
109 exit:
110 return return_value;
111 }
112
113 PyDoc_STRVAR(_tkinter_tkapp_adderrorinfo__doc__,
114 "adderrorinfo($self, msg, /)\n"
115 "--\n"
116 "\n");
117
118 #define _TKINTER_TKAPP_ADDERRORINFO_METHODDEF \
119 {"adderrorinfo", (PyCFunction)_tkinter_tkapp_adderrorinfo, METH_O, _tkinter_tkapp_adderrorinfo__doc__},
120
121 static PyObject *
122 _tkinter_tkapp_adderrorinfo_impl(TkappObject *self, const char *msg);
123
124 static PyObject *
_tkinter_tkapp_adderrorinfo(TkappObject * self,PyObject * arg)125 _tkinter_tkapp_adderrorinfo(TkappObject *self, PyObject *arg)
126 {
127 PyObject *return_value = NULL;
128 const char *msg;
129
130 if (!PyUnicode_Check(arg)) {
131 _PyArg_BadArgument("adderrorinfo", "argument", "str", arg);
132 goto exit;
133 }
134 Py_ssize_t msg_length;
135 msg = PyUnicode_AsUTF8AndSize(arg, &msg_length);
136 if (msg == NULL) {
137 goto exit;
138 }
139 if (strlen(msg) != (size_t)msg_length) {
140 PyErr_SetString(PyExc_ValueError, "embedded null character");
141 goto exit;
142 }
143 return_value = _tkinter_tkapp_adderrorinfo_impl(self, msg);
144
145 exit:
146 return return_value;
147 }
148
149 PyDoc_STRVAR(_tkinter_tkapp_getint__doc__,
150 "getint($self, arg, /)\n"
151 "--\n"
152 "\n");
153
154 #define _TKINTER_TKAPP_GETINT_METHODDEF \
155 {"getint", (PyCFunction)_tkinter_tkapp_getint, METH_O, _tkinter_tkapp_getint__doc__},
156
157 PyDoc_STRVAR(_tkinter_tkapp_getdouble__doc__,
158 "getdouble($self, arg, /)\n"
159 "--\n"
160 "\n");
161
162 #define _TKINTER_TKAPP_GETDOUBLE_METHODDEF \
163 {"getdouble", (PyCFunction)_tkinter_tkapp_getdouble, METH_O, _tkinter_tkapp_getdouble__doc__},
164
165 PyDoc_STRVAR(_tkinter_tkapp_getboolean__doc__,
166 "getboolean($self, arg, /)\n"
167 "--\n"
168 "\n");
169
170 #define _TKINTER_TKAPP_GETBOOLEAN_METHODDEF \
171 {"getboolean", (PyCFunction)_tkinter_tkapp_getboolean, METH_O, _tkinter_tkapp_getboolean__doc__},
172
173 PyDoc_STRVAR(_tkinter_tkapp_exprstring__doc__,
174 "exprstring($self, s, /)\n"
175 "--\n"
176 "\n");
177
178 #define _TKINTER_TKAPP_EXPRSTRING_METHODDEF \
179 {"exprstring", (PyCFunction)_tkinter_tkapp_exprstring, METH_O, _tkinter_tkapp_exprstring__doc__},
180
181 static PyObject *
182 _tkinter_tkapp_exprstring_impl(TkappObject *self, const char *s);
183
184 static PyObject *
_tkinter_tkapp_exprstring(TkappObject * self,PyObject * arg)185 _tkinter_tkapp_exprstring(TkappObject *self, PyObject *arg)
186 {
187 PyObject *return_value = NULL;
188 const char *s;
189
190 if (!PyUnicode_Check(arg)) {
191 _PyArg_BadArgument("exprstring", "argument", "str", arg);
192 goto exit;
193 }
194 Py_ssize_t s_length;
195 s = PyUnicode_AsUTF8AndSize(arg, &s_length);
196 if (s == NULL) {
197 goto exit;
198 }
199 if (strlen(s) != (size_t)s_length) {
200 PyErr_SetString(PyExc_ValueError, "embedded null character");
201 goto exit;
202 }
203 return_value = _tkinter_tkapp_exprstring_impl(self, s);
204
205 exit:
206 return return_value;
207 }
208
209 PyDoc_STRVAR(_tkinter_tkapp_exprlong__doc__,
210 "exprlong($self, s, /)\n"
211 "--\n"
212 "\n");
213
214 #define _TKINTER_TKAPP_EXPRLONG_METHODDEF \
215 {"exprlong", (PyCFunction)_tkinter_tkapp_exprlong, METH_O, _tkinter_tkapp_exprlong__doc__},
216
217 static PyObject *
218 _tkinter_tkapp_exprlong_impl(TkappObject *self, const char *s);
219
220 static PyObject *
_tkinter_tkapp_exprlong(TkappObject * self,PyObject * arg)221 _tkinter_tkapp_exprlong(TkappObject *self, PyObject *arg)
222 {
223 PyObject *return_value = NULL;
224 const char *s;
225
226 if (!PyUnicode_Check(arg)) {
227 _PyArg_BadArgument("exprlong", "argument", "str", arg);
228 goto exit;
229 }
230 Py_ssize_t s_length;
231 s = PyUnicode_AsUTF8AndSize(arg, &s_length);
232 if (s == NULL) {
233 goto exit;
234 }
235 if (strlen(s) != (size_t)s_length) {
236 PyErr_SetString(PyExc_ValueError, "embedded null character");
237 goto exit;
238 }
239 return_value = _tkinter_tkapp_exprlong_impl(self, s);
240
241 exit:
242 return return_value;
243 }
244
245 PyDoc_STRVAR(_tkinter_tkapp_exprdouble__doc__,
246 "exprdouble($self, s, /)\n"
247 "--\n"
248 "\n");
249
250 #define _TKINTER_TKAPP_EXPRDOUBLE_METHODDEF \
251 {"exprdouble", (PyCFunction)_tkinter_tkapp_exprdouble, METH_O, _tkinter_tkapp_exprdouble__doc__},
252
253 static PyObject *
254 _tkinter_tkapp_exprdouble_impl(TkappObject *self, const char *s);
255
256 static PyObject *
_tkinter_tkapp_exprdouble(TkappObject * self,PyObject * arg)257 _tkinter_tkapp_exprdouble(TkappObject *self, PyObject *arg)
258 {
259 PyObject *return_value = NULL;
260 const char *s;
261
262 if (!PyUnicode_Check(arg)) {
263 _PyArg_BadArgument("exprdouble", "argument", "str", arg);
264 goto exit;
265 }
266 Py_ssize_t s_length;
267 s = PyUnicode_AsUTF8AndSize(arg, &s_length);
268 if (s == NULL) {
269 goto exit;
270 }
271 if (strlen(s) != (size_t)s_length) {
272 PyErr_SetString(PyExc_ValueError, "embedded null character");
273 goto exit;
274 }
275 return_value = _tkinter_tkapp_exprdouble_impl(self, s);
276
277 exit:
278 return return_value;
279 }
280
281 PyDoc_STRVAR(_tkinter_tkapp_exprboolean__doc__,
282 "exprboolean($self, s, /)\n"
283 "--\n"
284 "\n");
285
286 #define _TKINTER_TKAPP_EXPRBOOLEAN_METHODDEF \
287 {"exprboolean", (PyCFunction)_tkinter_tkapp_exprboolean, METH_O, _tkinter_tkapp_exprboolean__doc__},
288
289 static PyObject *
290 _tkinter_tkapp_exprboolean_impl(TkappObject *self, const char *s);
291
292 static PyObject *
_tkinter_tkapp_exprboolean(TkappObject * self,PyObject * arg)293 _tkinter_tkapp_exprboolean(TkappObject *self, PyObject *arg)
294 {
295 PyObject *return_value = NULL;
296 const char *s;
297
298 if (!PyUnicode_Check(arg)) {
299 _PyArg_BadArgument("exprboolean", "argument", "str", arg);
300 goto exit;
301 }
302 Py_ssize_t s_length;
303 s = PyUnicode_AsUTF8AndSize(arg, &s_length);
304 if (s == NULL) {
305 goto exit;
306 }
307 if (strlen(s) != (size_t)s_length) {
308 PyErr_SetString(PyExc_ValueError, "embedded null character");
309 goto exit;
310 }
311 return_value = _tkinter_tkapp_exprboolean_impl(self, s);
312
313 exit:
314 return return_value;
315 }
316
317 PyDoc_STRVAR(_tkinter_tkapp_splitlist__doc__,
318 "splitlist($self, arg, /)\n"
319 "--\n"
320 "\n");
321
322 #define _TKINTER_TKAPP_SPLITLIST_METHODDEF \
323 {"splitlist", (PyCFunction)_tkinter_tkapp_splitlist, METH_O, _tkinter_tkapp_splitlist__doc__},
324
325 PyDoc_STRVAR(_tkinter_tkapp_split__doc__,
326 "split($self, arg, /)\n"
327 "--\n"
328 "\n");
329
330 #define _TKINTER_TKAPP_SPLIT_METHODDEF \
331 {"split", (PyCFunction)_tkinter_tkapp_split, METH_O, _tkinter_tkapp_split__doc__},
332
333 PyDoc_STRVAR(_tkinter_tkapp_createcommand__doc__,
334 "createcommand($self, name, func, /)\n"
335 "--\n"
336 "\n");
337
338 #define _TKINTER_TKAPP_CREATECOMMAND_METHODDEF \
339 {"createcommand", (PyCFunction)(void(*)(void))_tkinter_tkapp_createcommand, METH_FASTCALL, _tkinter_tkapp_createcommand__doc__},
340
341 static PyObject *
342 _tkinter_tkapp_createcommand_impl(TkappObject *self, const char *name,
343 PyObject *func);
344
345 static PyObject *
_tkinter_tkapp_createcommand(TkappObject * self,PyObject * const * args,Py_ssize_t nargs)346 _tkinter_tkapp_createcommand(TkappObject *self, PyObject *const *args, Py_ssize_t nargs)
347 {
348 PyObject *return_value = NULL;
349 const char *name;
350 PyObject *func;
351
352 if (!_PyArg_CheckPositional("createcommand", nargs, 2, 2)) {
353 goto exit;
354 }
355 if (!PyUnicode_Check(args[0])) {
356 _PyArg_BadArgument("createcommand", "argument 1", "str", args[0]);
357 goto exit;
358 }
359 Py_ssize_t name_length;
360 name = PyUnicode_AsUTF8AndSize(args[0], &name_length);
361 if (name == NULL) {
362 goto exit;
363 }
364 if (strlen(name) != (size_t)name_length) {
365 PyErr_SetString(PyExc_ValueError, "embedded null character");
366 goto exit;
367 }
368 func = args[1];
369 return_value = _tkinter_tkapp_createcommand_impl(self, name, func);
370
371 exit:
372 return return_value;
373 }
374
375 PyDoc_STRVAR(_tkinter_tkapp_deletecommand__doc__,
376 "deletecommand($self, name, /)\n"
377 "--\n"
378 "\n");
379
380 #define _TKINTER_TKAPP_DELETECOMMAND_METHODDEF \
381 {"deletecommand", (PyCFunction)_tkinter_tkapp_deletecommand, METH_O, _tkinter_tkapp_deletecommand__doc__},
382
383 static PyObject *
384 _tkinter_tkapp_deletecommand_impl(TkappObject *self, const char *name);
385
386 static PyObject *
_tkinter_tkapp_deletecommand(TkappObject * self,PyObject * arg)387 _tkinter_tkapp_deletecommand(TkappObject *self, PyObject *arg)
388 {
389 PyObject *return_value = NULL;
390 const char *name;
391
392 if (!PyUnicode_Check(arg)) {
393 _PyArg_BadArgument("deletecommand", "argument", "str", arg);
394 goto exit;
395 }
396 Py_ssize_t name_length;
397 name = PyUnicode_AsUTF8AndSize(arg, &name_length);
398 if (name == NULL) {
399 goto exit;
400 }
401 if (strlen(name) != (size_t)name_length) {
402 PyErr_SetString(PyExc_ValueError, "embedded null character");
403 goto exit;
404 }
405 return_value = _tkinter_tkapp_deletecommand_impl(self, name);
406
407 exit:
408 return return_value;
409 }
410
411 #if defined(HAVE_CREATEFILEHANDLER)
412
413 PyDoc_STRVAR(_tkinter_tkapp_createfilehandler__doc__,
414 "createfilehandler($self, file, mask, func, /)\n"
415 "--\n"
416 "\n");
417
418 #define _TKINTER_TKAPP_CREATEFILEHANDLER_METHODDEF \
419 {"createfilehandler", (PyCFunction)(void(*)(void))_tkinter_tkapp_createfilehandler, METH_FASTCALL, _tkinter_tkapp_createfilehandler__doc__},
420
421 static PyObject *
422 _tkinter_tkapp_createfilehandler_impl(TkappObject *self, PyObject *file,
423 int mask, PyObject *func);
424
425 static PyObject *
_tkinter_tkapp_createfilehandler(TkappObject * self,PyObject * const * args,Py_ssize_t nargs)426 _tkinter_tkapp_createfilehandler(TkappObject *self, PyObject *const *args, Py_ssize_t nargs)
427 {
428 PyObject *return_value = NULL;
429 PyObject *file;
430 int mask;
431 PyObject *func;
432
433 if (!_PyArg_CheckPositional("createfilehandler", nargs, 3, 3)) {
434 goto exit;
435 }
436 file = args[0];
437 mask = _PyLong_AsInt(args[1]);
438 if (mask == -1 && PyErr_Occurred()) {
439 goto exit;
440 }
441 func = args[2];
442 return_value = _tkinter_tkapp_createfilehandler_impl(self, file, mask, func);
443
444 exit:
445 return return_value;
446 }
447
448 #endif /* defined(HAVE_CREATEFILEHANDLER) */
449
450 #if defined(HAVE_CREATEFILEHANDLER)
451
452 PyDoc_STRVAR(_tkinter_tkapp_deletefilehandler__doc__,
453 "deletefilehandler($self, file, /)\n"
454 "--\n"
455 "\n");
456
457 #define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF \
458 {"deletefilehandler", (PyCFunction)_tkinter_tkapp_deletefilehandler, METH_O, _tkinter_tkapp_deletefilehandler__doc__},
459
460 #endif /* defined(HAVE_CREATEFILEHANDLER) */
461
462 PyDoc_STRVAR(_tkinter_tktimertoken_deletetimerhandler__doc__,
463 "deletetimerhandler($self, /)\n"
464 "--\n"
465 "\n");
466
467 #define _TKINTER_TKTIMERTOKEN_DELETETIMERHANDLER_METHODDEF \
468 {"deletetimerhandler", (PyCFunction)_tkinter_tktimertoken_deletetimerhandler, METH_NOARGS, _tkinter_tktimertoken_deletetimerhandler__doc__},
469
470 static PyObject *
471 _tkinter_tktimertoken_deletetimerhandler_impl(TkttObject *self);
472
473 static PyObject *
_tkinter_tktimertoken_deletetimerhandler(TkttObject * self,PyObject * Py_UNUSED (ignored))474 _tkinter_tktimertoken_deletetimerhandler(TkttObject *self, PyObject *Py_UNUSED(ignored))
475 {
476 return _tkinter_tktimertoken_deletetimerhandler_impl(self);
477 }
478
479 PyDoc_STRVAR(_tkinter_tkapp_createtimerhandler__doc__,
480 "createtimerhandler($self, milliseconds, func, /)\n"
481 "--\n"
482 "\n");
483
484 #define _TKINTER_TKAPP_CREATETIMERHANDLER_METHODDEF \
485 {"createtimerhandler", (PyCFunction)(void(*)(void))_tkinter_tkapp_createtimerhandler, METH_FASTCALL, _tkinter_tkapp_createtimerhandler__doc__},
486
487 static PyObject *
488 _tkinter_tkapp_createtimerhandler_impl(TkappObject *self, int milliseconds,
489 PyObject *func);
490
491 static PyObject *
_tkinter_tkapp_createtimerhandler(TkappObject * self,PyObject * const * args,Py_ssize_t nargs)492 _tkinter_tkapp_createtimerhandler(TkappObject *self, PyObject *const *args, Py_ssize_t nargs)
493 {
494 PyObject *return_value = NULL;
495 int milliseconds;
496 PyObject *func;
497
498 if (!_PyArg_CheckPositional("createtimerhandler", nargs, 2, 2)) {
499 goto exit;
500 }
501 milliseconds = _PyLong_AsInt(args[0]);
502 if (milliseconds == -1 && PyErr_Occurred()) {
503 goto exit;
504 }
505 func = args[1];
506 return_value = _tkinter_tkapp_createtimerhandler_impl(self, milliseconds, func);
507
508 exit:
509 return return_value;
510 }
511
512 PyDoc_STRVAR(_tkinter_tkapp_mainloop__doc__,
513 "mainloop($self, threshold=0, /)\n"
514 "--\n"
515 "\n");
516
517 #define _TKINTER_TKAPP_MAINLOOP_METHODDEF \
518 {"mainloop", (PyCFunction)(void(*)(void))_tkinter_tkapp_mainloop, METH_FASTCALL, _tkinter_tkapp_mainloop__doc__},
519
520 static PyObject *
521 _tkinter_tkapp_mainloop_impl(TkappObject *self, int threshold);
522
523 static PyObject *
_tkinter_tkapp_mainloop(TkappObject * self,PyObject * const * args,Py_ssize_t nargs)524 _tkinter_tkapp_mainloop(TkappObject *self, PyObject *const *args, Py_ssize_t nargs)
525 {
526 PyObject *return_value = NULL;
527 int threshold = 0;
528
529 if (!_PyArg_CheckPositional("mainloop", nargs, 0, 1)) {
530 goto exit;
531 }
532 if (nargs < 1) {
533 goto skip_optional;
534 }
535 threshold = _PyLong_AsInt(args[0]);
536 if (threshold == -1 && PyErr_Occurred()) {
537 goto exit;
538 }
539 skip_optional:
540 return_value = _tkinter_tkapp_mainloop_impl(self, threshold);
541
542 exit:
543 return return_value;
544 }
545
546 PyDoc_STRVAR(_tkinter_tkapp_dooneevent__doc__,
547 "dooneevent($self, flags=0, /)\n"
548 "--\n"
549 "\n");
550
551 #define _TKINTER_TKAPP_DOONEEVENT_METHODDEF \
552 {"dooneevent", (PyCFunction)(void(*)(void))_tkinter_tkapp_dooneevent, METH_FASTCALL, _tkinter_tkapp_dooneevent__doc__},
553
554 static PyObject *
555 _tkinter_tkapp_dooneevent_impl(TkappObject *self, int flags);
556
557 static PyObject *
_tkinter_tkapp_dooneevent(TkappObject * self,PyObject * const * args,Py_ssize_t nargs)558 _tkinter_tkapp_dooneevent(TkappObject *self, PyObject *const *args, Py_ssize_t nargs)
559 {
560 PyObject *return_value = NULL;
561 int flags = 0;
562
563 if (!_PyArg_CheckPositional("dooneevent", nargs, 0, 1)) {
564 goto exit;
565 }
566 if (nargs < 1) {
567 goto skip_optional;
568 }
569 flags = _PyLong_AsInt(args[0]);
570 if (flags == -1 && PyErr_Occurred()) {
571 goto exit;
572 }
573 skip_optional:
574 return_value = _tkinter_tkapp_dooneevent_impl(self, flags);
575
576 exit:
577 return return_value;
578 }
579
580 PyDoc_STRVAR(_tkinter_tkapp_quit__doc__,
581 "quit($self, /)\n"
582 "--\n"
583 "\n");
584
585 #define _TKINTER_TKAPP_QUIT_METHODDEF \
586 {"quit", (PyCFunction)_tkinter_tkapp_quit, METH_NOARGS, _tkinter_tkapp_quit__doc__},
587
588 static PyObject *
589 _tkinter_tkapp_quit_impl(TkappObject *self);
590
591 static PyObject *
_tkinter_tkapp_quit(TkappObject * self,PyObject * Py_UNUSED (ignored))592 _tkinter_tkapp_quit(TkappObject *self, PyObject *Py_UNUSED(ignored))
593 {
594 return _tkinter_tkapp_quit_impl(self);
595 }
596
597 PyDoc_STRVAR(_tkinter_tkapp_interpaddr__doc__,
598 "interpaddr($self, /)\n"
599 "--\n"
600 "\n");
601
602 #define _TKINTER_TKAPP_INTERPADDR_METHODDEF \
603 {"interpaddr", (PyCFunction)_tkinter_tkapp_interpaddr, METH_NOARGS, _tkinter_tkapp_interpaddr__doc__},
604
605 static PyObject *
606 _tkinter_tkapp_interpaddr_impl(TkappObject *self);
607
608 static PyObject *
_tkinter_tkapp_interpaddr(TkappObject * self,PyObject * Py_UNUSED (ignored))609 _tkinter_tkapp_interpaddr(TkappObject *self, PyObject *Py_UNUSED(ignored))
610 {
611 return _tkinter_tkapp_interpaddr_impl(self);
612 }
613
614 PyDoc_STRVAR(_tkinter_tkapp_loadtk__doc__,
615 "loadtk($self, /)\n"
616 "--\n"
617 "\n");
618
619 #define _TKINTER_TKAPP_LOADTK_METHODDEF \
620 {"loadtk", (PyCFunction)_tkinter_tkapp_loadtk, METH_NOARGS, _tkinter_tkapp_loadtk__doc__},
621
622 static PyObject *
623 _tkinter_tkapp_loadtk_impl(TkappObject *self);
624
625 static PyObject *
_tkinter_tkapp_loadtk(TkappObject * self,PyObject * Py_UNUSED (ignored))626 _tkinter_tkapp_loadtk(TkappObject *self, PyObject *Py_UNUSED(ignored))
627 {
628 return _tkinter_tkapp_loadtk_impl(self);
629 }
630
631 PyDoc_STRVAR(_tkinter_tkapp_willdispatch__doc__,
632 "willdispatch($self, /)\n"
633 "--\n"
634 "\n");
635
636 #define _TKINTER_TKAPP_WILLDISPATCH_METHODDEF \
637 {"willdispatch", (PyCFunction)_tkinter_tkapp_willdispatch, METH_NOARGS, _tkinter_tkapp_willdispatch__doc__},
638
639 static PyObject *
640 _tkinter_tkapp_willdispatch_impl(TkappObject *self);
641
642 static PyObject *
_tkinter_tkapp_willdispatch(TkappObject * self,PyObject * Py_UNUSED (ignored))643 _tkinter_tkapp_willdispatch(TkappObject *self, PyObject *Py_UNUSED(ignored))
644 {
645 return _tkinter_tkapp_willdispatch_impl(self);
646 }
647
648 PyDoc_STRVAR(_tkinter__flatten__doc__,
649 "_flatten($module, item, /)\n"
650 "--\n"
651 "\n");
652
653 #define _TKINTER__FLATTEN_METHODDEF \
654 {"_flatten", (PyCFunction)_tkinter__flatten, METH_O, _tkinter__flatten__doc__},
655
656 PyDoc_STRVAR(_tkinter_create__doc__,
657 "create($module, screenName=None, baseName=\'\', className=\'Tk\',\n"
658 " interactive=False, wantobjects=False, wantTk=True, sync=False,\n"
659 " use=None, /)\n"
660 "--\n"
661 "\n"
662 "\n"
663 "\n"
664 " wantTk\n"
665 " if false, then Tk_Init() doesn\'t get called\n"
666 " sync\n"
667 " if true, then pass -sync to wish\n"
668 " use\n"
669 " if not None, then pass -use to wish");
670
671 #define _TKINTER_CREATE_METHODDEF \
672 {"create", (PyCFunction)(void(*)(void))_tkinter_create, METH_FASTCALL, _tkinter_create__doc__},
673
674 static PyObject *
675 _tkinter_create_impl(PyObject *module, const char *screenName,
676 const char *baseName, const char *className,
677 int interactive, int wantobjects, int wantTk, int sync,
678 const char *use);
679
680 static PyObject *
_tkinter_create(PyObject * module,PyObject * const * args,Py_ssize_t nargs)681 _tkinter_create(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
682 {
683 PyObject *return_value = NULL;
684 const char *screenName = NULL;
685 const char *baseName = "";
686 const char *className = "Tk";
687 int interactive = 0;
688 int wantobjects = 0;
689 int wantTk = 1;
690 int sync = 0;
691 const char *use = NULL;
692
693 if (!_PyArg_CheckPositional("create", nargs, 0, 8)) {
694 goto exit;
695 }
696 if (nargs < 1) {
697 goto skip_optional;
698 }
699 if (args[0] == Py_None) {
700 screenName = NULL;
701 }
702 else if (PyUnicode_Check(args[0])) {
703 Py_ssize_t screenName_length;
704 screenName = PyUnicode_AsUTF8AndSize(args[0], &screenName_length);
705 if (screenName == NULL) {
706 goto exit;
707 }
708 if (strlen(screenName) != (size_t)screenName_length) {
709 PyErr_SetString(PyExc_ValueError, "embedded null character");
710 goto exit;
711 }
712 }
713 else {
714 _PyArg_BadArgument("create", "argument 1", "str or None", args[0]);
715 goto exit;
716 }
717 if (nargs < 2) {
718 goto skip_optional;
719 }
720 if (!PyUnicode_Check(args[1])) {
721 _PyArg_BadArgument("create", "argument 2", "str", args[1]);
722 goto exit;
723 }
724 Py_ssize_t baseName_length;
725 baseName = PyUnicode_AsUTF8AndSize(args[1], &baseName_length);
726 if (baseName == NULL) {
727 goto exit;
728 }
729 if (strlen(baseName) != (size_t)baseName_length) {
730 PyErr_SetString(PyExc_ValueError, "embedded null character");
731 goto exit;
732 }
733 if (nargs < 3) {
734 goto skip_optional;
735 }
736 if (!PyUnicode_Check(args[2])) {
737 _PyArg_BadArgument("create", "argument 3", "str", args[2]);
738 goto exit;
739 }
740 Py_ssize_t className_length;
741 className = PyUnicode_AsUTF8AndSize(args[2], &className_length);
742 if (className == NULL) {
743 goto exit;
744 }
745 if (strlen(className) != (size_t)className_length) {
746 PyErr_SetString(PyExc_ValueError, "embedded null character");
747 goto exit;
748 }
749 if (nargs < 4) {
750 goto skip_optional;
751 }
752 interactive = _PyLong_AsInt(args[3]);
753 if (interactive == -1 && PyErr_Occurred()) {
754 goto exit;
755 }
756 if (nargs < 5) {
757 goto skip_optional;
758 }
759 wantobjects = _PyLong_AsInt(args[4]);
760 if (wantobjects == -1 && PyErr_Occurred()) {
761 goto exit;
762 }
763 if (nargs < 6) {
764 goto skip_optional;
765 }
766 wantTk = _PyLong_AsInt(args[5]);
767 if (wantTk == -1 && PyErr_Occurred()) {
768 goto exit;
769 }
770 if (nargs < 7) {
771 goto skip_optional;
772 }
773 sync = _PyLong_AsInt(args[6]);
774 if (sync == -1 && PyErr_Occurred()) {
775 goto exit;
776 }
777 if (nargs < 8) {
778 goto skip_optional;
779 }
780 if (args[7] == Py_None) {
781 use = NULL;
782 }
783 else if (PyUnicode_Check(args[7])) {
784 Py_ssize_t use_length;
785 use = PyUnicode_AsUTF8AndSize(args[7], &use_length);
786 if (use == NULL) {
787 goto exit;
788 }
789 if (strlen(use) != (size_t)use_length) {
790 PyErr_SetString(PyExc_ValueError, "embedded null character");
791 goto exit;
792 }
793 }
794 else {
795 _PyArg_BadArgument("create", "argument 8", "str or None", args[7]);
796 goto exit;
797 }
798 skip_optional:
799 return_value = _tkinter_create_impl(module, screenName, baseName, className, interactive, wantobjects, wantTk, sync, use);
800
801 exit:
802 return return_value;
803 }
804
805 PyDoc_STRVAR(_tkinter_setbusywaitinterval__doc__,
806 "setbusywaitinterval($module, new_val, /)\n"
807 "--\n"
808 "\n"
809 "Set the busy-wait interval in milliseconds between successive calls to Tcl_DoOneEvent in a threaded Python interpreter.\n"
810 "\n"
811 "It should be set to a divisor of the maximum time between frames in an animation.");
812
813 #define _TKINTER_SETBUSYWAITINTERVAL_METHODDEF \
814 {"setbusywaitinterval", (PyCFunction)_tkinter_setbusywaitinterval, METH_O, _tkinter_setbusywaitinterval__doc__},
815
816 static PyObject *
817 _tkinter_setbusywaitinterval_impl(PyObject *module, int new_val);
818
819 static PyObject *
_tkinter_setbusywaitinterval(PyObject * module,PyObject * arg)820 _tkinter_setbusywaitinterval(PyObject *module, PyObject *arg)
821 {
822 PyObject *return_value = NULL;
823 int new_val;
824
825 new_val = _PyLong_AsInt(arg);
826 if (new_val == -1 && PyErr_Occurred()) {
827 goto exit;
828 }
829 return_value = _tkinter_setbusywaitinterval_impl(module, new_val);
830
831 exit:
832 return return_value;
833 }
834
835 PyDoc_STRVAR(_tkinter_getbusywaitinterval__doc__,
836 "getbusywaitinterval($module, /)\n"
837 "--\n"
838 "\n"
839 "Return the current busy-wait interval between successive calls to Tcl_DoOneEvent in a threaded Python interpreter.");
840
841 #define _TKINTER_GETBUSYWAITINTERVAL_METHODDEF \
842 {"getbusywaitinterval", (PyCFunction)_tkinter_getbusywaitinterval, METH_NOARGS, _tkinter_getbusywaitinterval__doc__},
843
844 static int
845 _tkinter_getbusywaitinterval_impl(PyObject *module);
846
847 static PyObject *
_tkinter_getbusywaitinterval(PyObject * module,PyObject * Py_UNUSED (ignored))848 _tkinter_getbusywaitinterval(PyObject *module, PyObject *Py_UNUSED(ignored))
849 {
850 PyObject *return_value = NULL;
851 int _return_value;
852
853 _return_value = _tkinter_getbusywaitinterval_impl(module);
854 if ((_return_value == -1) && PyErr_Occurred()) {
855 goto exit;
856 }
857 return_value = PyLong_FromLong((long)_return_value);
858
859 exit:
860 return return_value;
861 }
862
863 #ifndef _TKINTER_TKAPP_CREATEFILEHANDLER_METHODDEF
864 #define _TKINTER_TKAPP_CREATEFILEHANDLER_METHODDEF
865 #endif /* !defined(_TKINTER_TKAPP_CREATEFILEHANDLER_METHODDEF) */
866
867 #ifndef _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF
868 #define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF
869 #endif /* !defined(_TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF) */
870 /*[clinic end generated code: output=ab311480dd044fe4 input=a9049054013a1b77]*/
871