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