Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 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 * |
| 17 | _tkinter_tkapp_eval(TkappObject *self, PyObject *arg) |
| 18 | { |
| 19 | PyObject *return_value = NULL; |
| 20 | const char *script; |
| 21 | |
Serhiy Storchaka | 32d96a2 | 2018-12-25 13:23:47 +0200 | [diff] [blame^] | 22 | if (!PyUnicode_Check(arg)) { |
| 23 | _PyArg_BadArgument("eval", "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"); |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 33 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 34 | } |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 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 * |
| 53 | _tkinter_tkapp_evalfile(TkappObject *self, PyObject *arg) |
| 54 | { |
| 55 | PyObject *return_value = NULL; |
| 56 | const char *fileName; |
| 57 | |
Serhiy Storchaka | 32d96a2 | 2018-12-25 13:23:47 +0200 | [diff] [blame^] | 58 | if (!PyUnicode_Check(arg)) { |
| 59 | _PyArg_BadArgument("evalfile", "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"); |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 69 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 70 | } |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 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 * |
| 89 | _tkinter_tkapp_record(TkappObject *self, PyObject *arg) |
| 90 | { |
| 91 | PyObject *return_value = NULL; |
| 92 | const char *script; |
| 93 | |
Serhiy Storchaka | 32d96a2 | 2018-12-25 13:23:47 +0200 | [diff] [blame^] | 94 | if (!PyUnicode_Check(arg)) { |
| 95 | _PyArg_BadArgument("record", "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"); |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 105 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 106 | } |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 107 | return_value = _tkinter_tkapp_record_impl(self, script); |
| 108 | |
| 109 | exit: |
| 110 | return return_value; |
| 111 | } |
| 112 | |
Serhiy Storchaka | 929b40a | 2017-10-03 21:37:22 +0300 | [diff] [blame] | 113 | PyDoc_STRVAR(_tkinter_tkapp_adderrorinfo__doc__, |
| 114 | "adderrorinfo($self, msg, /)\n" |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 115 | "--\n" |
| 116 | "\n"); |
| 117 | |
Serhiy Storchaka | 929b40a | 2017-10-03 21:37:22 +0300 | [diff] [blame] | 118 | #define _TKINTER_TKAPP_ADDERRORINFO_METHODDEF \ |
| 119 | {"adderrorinfo", (PyCFunction)_tkinter_tkapp_adderrorinfo, METH_O, _tkinter_tkapp_adderrorinfo__doc__}, |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 120 | |
| 121 | static PyObject * |
Serhiy Storchaka | 929b40a | 2017-10-03 21:37:22 +0300 | [diff] [blame] | 122 | _tkinter_tkapp_adderrorinfo_impl(TkappObject *self, const char *msg); |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 123 | |
| 124 | static PyObject * |
Serhiy Storchaka | 929b40a | 2017-10-03 21:37:22 +0300 | [diff] [blame] | 125 | _tkinter_tkapp_adderrorinfo(TkappObject *self, PyObject *arg) |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 126 | { |
| 127 | PyObject *return_value = NULL; |
| 128 | const char *msg; |
| 129 | |
Serhiy Storchaka | 32d96a2 | 2018-12-25 13:23:47 +0200 | [diff] [blame^] | 130 | if (!PyUnicode_Check(arg)) { |
| 131 | _PyArg_BadArgument("adderrorinfo", "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"); |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 141 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 142 | } |
Serhiy Storchaka | 929b40a | 2017-10-03 21:37:22 +0300 | [diff] [blame] | 143 | return_value = _tkinter_tkapp_adderrorinfo_impl(self, msg); |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 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 * |
| 185 | _tkinter_tkapp_exprstring(TkappObject *self, PyObject *arg) |
| 186 | { |
| 187 | PyObject *return_value = NULL; |
| 188 | const char *s; |
| 189 | |
Serhiy Storchaka | 32d96a2 | 2018-12-25 13:23:47 +0200 | [diff] [blame^] | 190 | if (!PyUnicode_Check(arg)) { |
| 191 | _PyArg_BadArgument("exprstring", "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"); |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 201 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 202 | } |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 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 * |
| 221 | _tkinter_tkapp_exprlong(TkappObject *self, PyObject *arg) |
| 222 | { |
| 223 | PyObject *return_value = NULL; |
| 224 | const char *s; |
| 225 | |
Serhiy Storchaka | 32d96a2 | 2018-12-25 13:23:47 +0200 | [diff] [blame^] | 226 | if (!PyUnicode_Check(arg)) { |
| 227 | _PyArg_BadArgument("exprlong", "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"); |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 237 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 238 | } |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 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 * |
| 257 | _tkinter_tkapp_exprdouble(TkappObject *self, PyObject *arg) |
| 258 | { |
| 259 | PyObject *return_value = NULL; |
| 260 | const char *s; |
| 261 | |
Serhiy Storchaka | 32d96a2 | 2018-12-25 13:23:47 +0200 | [diff] [blame^] | 262 | if (!PyUnicode_Check(arg)) { |
| 263 | _PyArg_BadArgument("exprdouble", "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"); |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 273 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 274 | } |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 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 * |
| 293 | _tkinter_tkapp_exprboolean(TkappObject *self, PyObject *arg) |
| 294 | { |
| 295 | PyObject *return_value = NULL; |
| 296 | const char *s; |
| 297 | |
Serhiy Storchaka | 32d96a2 | 2018-12-25 13:23:47 +0200 | [diff] [blame^] | 298 | if (!PyUnicode_Check(arg)) { |
| 299 | _PyArg_BadArgument("exprboolean", "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"); |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 309 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 310 | } |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 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 \ |
Serhiy Storchaka | 4a934d4 | 2018-11-27 11:27:36 +0200 | [diff] [blame] | 339 | {"createcommand", (PyCFunction)(void(*)(void))_tkinter_tkapp_createcommand, METH_FASTCALL, _tkinter_tkapp_createcommand__doc__}, |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 340 | |
| 341 | static PyObject * |
| 342 | _tkinter_tkapp_createcommand_impl(TkappObject *self, const char *name, |
| 343 | PyObject *func); |
| 344 | |
| 345 | static PyObject * |
Serhiy Storchaka | a5552f0 | 2017-12-15 13:11:11 +0200 | [diff] [blame] | 346 | _tkinter_tkapp_createcommand(TkappObject *self, PyObject *const *args, Py_ssize_t nargs) |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 347 | { |
| 348 | PyObject *return_value = NULL; |
| 349 | const char *name; |
| 350 | PyObject *func; |
| 351 | |
Sylvain | 7445381 | 2017-06-10 06:51:48 +0200 | [diff] [blame] | 352 | if (!_PyArg_ParseStack(args, nargs, "sO:createcommand", |
| 353 | &name, &func)) { |
Victor Stinner | 259f0e4 | 2017-01-17 01:35:17 +0100 | [diff] [blame] | 354 | goto exit; |
| 355 | } |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 356 | return_value = _tkinter_tkapp_createcommand_impl(self, name, func); |
| 357 | |
| 358 | exit: |
| 359 | return return_value; |
| 360 | } |
| 361 | |
| 362 | PyDoc_STRVAR(_tkinter_tkapp_deletecommand__doc__, |
| 363 | "deletecommand($self, name, /)\n" |
| 364 | "--\n" |
| 365 | "\n"); |
| 366 | |
| 367 | #define _TKINTER_TKAPP_DELETECOMMAND_METHODDEF \ |
| 368 | {"deletecommand", (PyCFunction)_tkinter_tkapp_deletecommand, METH_O, _tkinter_tkapp_deletecommand__doc__}, |
| 369 | |
| 370 | static PyObject * |
| 371 | _tkinter_tkapp_deletecommand_impl(TkappObject *self, const char *name); |
| 372 | |
| 373 | static PyObject * |
| 374 | _tkinter_tkapp_deletecommand(TkappObject *self, PyObject *arg) |
| 375 | { |
| 376 | PyObject *return_value = NULL; |
| 377 | const char *name; |
| 378 | |
Serhiy Storchaka | 32d96a2 | 2018-12-25 13:23:47 +0200 | [diff] [blame^] | 379 | if (!PyUnicode_Check(arg)) { |
| 380 | _PyArg_BadArgument("deletecommand", "str", arg); |
| 381 | goto exit; |
| 382 | } |
| 383 | Py_ssize_t name_length; |
| 384 | name = PyUnicode_AsUTF8AndSize(arg, &name_length); |
| 385 | if (name == NULL) { |
| 386 | goto exit; |
| 387 | } |
| 388 | if (strlen(name) != (size_t)name_length) { |
| 389 | PyErr_SetString(PyExc_ValueError, "embedded null character"); |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 390 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 391 | } |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 392 | return_value = _tkinter_tkapp_deletecommand_impl(self, name); |
| 393 | |
| 394 | exit: |
| 395 | return return_value; |
| 396 | } |
| 397 | |
| 398 | #if defined(HAVE_CREATEFILEHANDLER) |
| 399 | |
| 400 | PyDoc_STRVAR(_tkinter_tkapp_createfilehandler__doc__, |
| 401 | "createfilehandler($self, file, mask, func, /)\n" |
| 402 | "--\n" |
| 403 | "\n"); |
| 404 | |
| 405 | #define _TKINTER_TKAPP_CREATEFILEHANDLER_METHODDEF \ |
Serhiy Storchaka | 4a934d4 | 2018-11-27 11:27:36 +0200 | [diff] [blame] | 406 | {"createfilehandler", (PyCFunction)(void(*)(void))_tkinter_tkapp_createfilehandler, METH_FASTCALL, _tkinter_tkapp_createfilehandler__doc__}, |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 407 | |
| 408 | static PyObject * |
| 409 | _tkinter_tkapp_createfilehandler_impl(TkappObject *self, PyObject *file, |
| 410 | int mask, PyObject *func); |
| 411 | |
| 412 | static PyObject * |
Serhiy Storchaka | a5552f0 | 2017-12-15 13:11:11 +0200 | [diff] [blame] | 413 | _tkinter_tkapp_createfilehandler(TkappObject *self, PyObject *const *args, Py_ssize_t nargs) |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 414 | { |
| 415 | PyObject *return_value = NULL; |
| 416 | PyObject *file; |
| 417 | int mask; |
| 418 | PyObject *func; |
| 419 | |
Sylvain | 7445381 | 2017-06-10 06:51:48 +0200 | [diff] [blame] | 420 | if (!_PyArg_ParseStack(args, nargs, "OiO:createfilehandler", |
| 421 | &file, &mask, &func)) { |
Victor Stinner | 259f0e4 | 2017-01-17 01:35:17 +0100 | [diff] [blame] | 422 | goto exit; |
| 423 | } |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 424 | return_value = _tkinter_tkapp_createfilehandler_impl(self, file, mask, func); |
| 425 | |
| 426 | exit: |
| 427 | return return_value; |
| 428 | } |
| 429 | |
| 430 | #endif /* defined(HAVE_CREATEFILEHANDLER) */ |
| 431 | |
| 432 | #if defined(HAVE_CREATEFILEHANDLER) |
| 433 | |
| 434 | PyDoc_STRVAR(_tkinter_tkapp_deletefilehandler__doc__, |
| 435 | "deletefilehandler($self, file, /)\n" |
| 436 | "--\n" |
| 437 | "\n"); |
| 438 | |
| 439 | #define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF \ |
| 440 | {"deletefilehandler", (PyCFunction)_tkinter_tkapp_deletefilehandler, METH_O, _tkinter_tkapp_deletefilehandler__doc__}, |
| 441 | |
| 442 | #endif /* defined(HAVE_CREATEFILEHANDLER) */ |
| 443 | |
| 444 | PyDoc_STRVAR(_tkinter_tktimertoken_deletetimerhandler__doc__, |
| 445 | "deletetimerhandler($self, /)\n" |
| 446 | "--\n" |
| 447 | "\n"); |
| 448 | |
| 449 | #define _TKINTER_TKTIMERTOKEN_DELETETIMERHANDLER_METHODDEF \ |
| 450 | {"deletetimerhandler", (PyCFunction)_tkinter_tktimertoken_deletetimerhandler, METH_NOARGS, _tkinter_tktimertoken_deletetimerhandler__doc__}, |
| 451 | |
| 452 | static PyObject * |
| 453 | _tkinter_tktimertoken_deletetimerhandler_impl(TkttObject *self); |
| 454 | |
| 455 | static PyObject * |
| 456 | _tkinter_tktimertoken_deletetimerhandler(TkttObject *self, PyObject *Py_UNUSED(ignored)) |
| 457 | { |
| 458 | return _tkinter_tktimertoken_deletetimerhandler_impl(self); |
| 459 | } |
| 460 | |
| 461 | PyDoc_STRVAR(_tkinter_tkapp_createtimerhandler__doc__, |
| 462 | "createtimerhandler($self, milliseconds, func, /)\n" |
| 463 | "--\n" |
| 464 | "\n"); |
| 465 | |
| 466 | #define _TKINTER_TKAPP_CREATETIMERHANDLER_METHODDEF \ |
Serhiy Storchaka | 4a934d4 | 2018-11-27 11:27:36 +0200 | [diff] [blame] | 467 | {"createtimerhandler", (PyCFunction)(void(*)(void))_tkinter_tkapp_createtimerhandler, METH_FASTCALL, _tkinter_tkapp_createtimerhandler__doc__}, |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 468 | |
| 469 | static PyObject * |
| 470 | _tkinter_tkapp_createtimerhandler_impl(TkappObject *self, int milliseconds, |
| 471 | PyObject *func); |
| 472 | |
| 473 | static PyObject * |
Serhiy Storchaka | a5552f0 | 2017-12-15 13:11:11 +0200 | [diff] [blame] | 474 | _tkinter_tkapp_createtimerhandler(TkappObject *self, PyObject *const *args, Py_ssize_t nargs) |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 475 | { |
| 476 | PyObject *return_value = NULL; |
| 477 | int milliseconds; |
| 478 | PyObject *func; |
| 479 | |
Sylvain | 7445381 | 2017-06-10 06:51:48 +0200 | [diff] [blame] | 480 | if (!_PyArg_ParseStack(args, nargs, "iO:createtimerhandler", |
| 481 | &milliseconds, &func)) { |
Victor Stinner | 259f0e4 | 2017-01-17 01:35:17 +0100 | [diff] [blame] | 482 | goto exit; |
| 483 | } |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 484 | return_value = _tkinter_tkapp_createtimerhandler_impl(self, milliseconds, func); |
| 485 | |
| 486 | exit: |
| 487 | return return_value; |
| 488 | } |
| 489 | |
| 490 | PyDoc_STRVAR(_tkinter_tkapp_mainloop__doc__, |
| 491 | "mainloop($self, threshold=0, /)\n" |
| 492 | "--\n" |
| 493 | "\n"); |
| 494 | |
| 495 | #define _TKINTER_TKAPP_MAINLOOP_METHODDEF \ |
Serhiy Storchaka | 4a934d4 | 2018-11-27 11:27:36 +0200 | [diff] [blame] | 496 | {"mainloop", (PyCFunction)(void(*)(void))_tkinter_tkapp_mainloop, METH_FASTCALL, _tkinter_tkapp_mainloop__doc__}, |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 497 | |
| 498 | static PyObject * |
| 499 | _tkinter_tkapp_mainloop_impl(TkappObject *self, int threshold); |
| 500 | |
| 501 | static PyObject * |
Serhiy Storchaka | a5552f0 | 2017-12-15 13:11:11 +0200 | [diff] [blame] | 502 | _tkinter_tkapp_mainloop(TkappObject *self, PyObject *const *args, Py_ssize_t nargs) |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 503 | { |
| 504 | PyObject *return_value = NULL; |
| 505 | int threshold = 0; |
| 506 | |
Sylvain | 7445381 | 2017-06-10 06:51:48 +0200 | [diff] [blame] | 507 | if (!_PyArg_ParseStack(args, nargs, "|i:mainloop", |
| 508 | &threshold)) { |
Victor Stinner | 259f0e4 | 2017-01-17 01:35:17 +0100 | [diff] [blame] | 509 | goto exit; |
| 510 | } |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 511 | return_value = _tkinter_tkapp_mainloop_impl(self, threshold); |
| 512 | |
| 513 | exit: |
| 514 | return return_value; |
| 515 | } |
| 516 | |
| 517 | PyDoc_STRVAR(_tkinter_tkapp_dooneevent__doc__, |
| 518 | "dooneevent($self, flags=0, /)\n" |
| 519 | "--\n" |
| 520 | "\n"); |
| 521 | |
| 522 | #define _TKINTER_TKAPP_DOONEEVENT_METHODDEF \ |
Serhiy Storchaka | 4a934d4 | 2018-11-27 11:27:36 +0200 | [diff] [blame] | 523 | {"dooneevent", (PyCFunction)(void(*)(void))_tkinter_tkapp_dooneevent, METH_FASTCALL, _tkinter_tkapp_dooneevent__doc__}, |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 524 | |
| 525 | static PyObject * |
| 526 | _tkinter_tkapp_dooneevent_impl(TkappObject *self, int flags); |
| 527 | |
| 528 | static PyObject * |
Serhiy Storchaka | a5552f0 | 2017-12-15 13:11:11 +0200 | [diff] [blame] | 529 | _tkinter_tkapp_dooneevent(TkappObject *self, PyObject *const *args, Py_ssize_t nargs) |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 530 | { |
| 531 | PyObject *return_value = NULL; |
| 532 | int flags = 0; |
| 533 | |
Sylvain | 7445381 | 2017-06-10 06:51:48 +0200 | [diff] [blame] | 534 | if (!_PyArg_ParseStack(args, nargs, "|i:dooneevent", |
| 535 | &flags)) { |
Victor Stinner | 259f0e4 | 2017-01-17 01:35:17 +0100 | [diff] [blame] | 536 | goto exit; |
| 537 | } |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 538 | return_value = _tkinter_tkapp_dooneevent_impl(self, flags); |
| 539 | |
| 540 | exit: |
| 541 | return return_value; |
| 542 | } |
| 543 | |
| 544 | PyDoc_STRVAR(_tkinter_tkapp_quit__doc__, |
| 545 | "quit($self, /)\n" |
| 546 | "--\n" |
| 547 | "\n"); |
| 548 | |
| 549 | #define _TKINTER_TKAPP_QUIT_METHODDEF \ |
| 550 | {"quit", (PyCFunction)_tkinter_tkapp_quit, METH_NOARGS, _tkinter_tkapp_quit__doc__}, |
| 551 | |
| 552 | static PyObject * |
| 553 | _tkinter_tkapp_quit_impl(TkappObject *self); |
| 554 | |
| 555 | static PyObject * |
| 556 | _tkinter_tkapp_quit(TkappObject *self, PyObject *Py_UNUSED(ignored)) |
| 557 | { |
| 558 | return _tkinter_tkapp_quit_impl(self); |
| 559 | } |
| 560 | |
| 561 | PyDoc_STRVAR(_tkinter_tkapp_interpaddr__doc__, |
| 562 | "interpaddr($self, /)\n" |
| 563 | "--\n" |
| 564 | "\n"); |
| 565 | |
| 566 | #define _TKINTER_TKAPP_INTERPADDR_METHODDEF \ |
| 567 | {"interpaddr", (PyCFunction)_tkinter_tkapp_interpaddr, METH_NOARGS, _tkinter_tkapp_interpaddr__doc__}, |
| 568 | |
| 569 | static PyObject * |
| 570 | _tkinter_tkapp_interpaddr_impl(TkappObject *self); |
| 571 | |
| 572 | static PyObject * |
| 573 | _tkinter_tkapp_interpaddr(TkappObject *self, PyObject *Py_UNUSED(ignored)) |
| 574 | { |
| 575 | return _tkinter_tkapp_interpaddr_impl(self); |
| 576 | } |
| 577 | |
| 578 | PyDoc_STRVAR(_tkinter_tkapp_loadtk__doc__, |
| 579 | "loadtk($self, /)\n" |
| 580 | "--\n" |
| 581 | "\n"); |
| 582 | |
| 583 | #define _TKINTER_TKAPP_LOADTK_METHODDEF \ |
| 584 | {"loadtk", (PyCFunction)_tkinter_tkapp_loadtk, METH_NOARGS, _tkinter_tkapp_loadtk__doc__}, |
| 585 | |
| 586 | static PyObject * |
| 587 | _tkinter_tkapp_loadtk_impl(TkappObject *self); |
| 588 | |
| 589 | static PyObject * |
| 590 | _tkinter_tkapp_loadtk(TkappObject *self, PyObject *Py_UNUSED(ignored)) |
| 591 | { |
| 592 | return _tkinter_tkapp_loadtk_impl(self); |
| 593 | } |
| 594 | |
| 595 | PyDoc_STRVAR(_tkinter_tkapp_willdispatch__doc__, |
| 596 | "willdispatch($self, /)\n" |
| 597 | "--\n" |
| 598 | "\n"); |
| 599 | |
| 600 | #define _TKINTER_TKAPP_WILLDISPATCH_METHODDEF \ |
| 601 | {"willdispatch", (PyCFunction)_tkinter_tkapp_willdispatch, METH_NOARGS, _tkinter_tkapp_willdispatch__doc__}, |
| 602 | |
| 603 | static PyObject * |
| 604 | _tkinter_tkapp_willdispatch_impl(TkappObject *self); |
| 605 | |
| 606 | static PyObject * |
| 607 | _tkinter_tkapp_willdispatch(TkappObject *self, PyObject *Py_UNUSED(ignored)) |
| 608 | { |
| 609 | return _tkinter_tkapp_willdispatch_impl(self); |
| 610 | } |
| 611 | |
| 612 | PyDoc_STRVAR(_tkinter__flatten__doc__, |
| 613 | "_flatten($module, item, /)\n" |
| 614 | "--\n" |
| 615 | "\n"); |
| 616 | |
| 617 | #define _TKINTER__FLATTEN_METHODDEF \ |
| 618 | {"_flatten", (PyCFunction)_tkinter__flatten, METH_O, _tkinter__flatten__doc__}, |
| 619 | |
| 620 | PyDoc_STRVAR(_tkinter_create__doc__, |
| 621 | "create($module, screenName=None, baseName=None, className=\'Tk\',\n" |
| 622 | " interactive=False, wantobjects=False, wantTk=True, sync=False,\n" |
| 623 | " use=None, /)\n" |
| 624 | "--\n" |
| 625 | "\n" |
| 626 | "\n" |
| 627 | "\n" |
| 628 | " wantTk\n" |
| 629 | " if false, then Tk_Init() doesn\'t get called\n" |
| 630 | " sync\n" |
| 631 | " if true, then pass -sync to wish\n" |
| 632 | " use\n" |
| 633 | " if not None, then pass -use to wish"); |
| 634 | |
| 635 | #define _TKINTER_CREATE_METHODDEF \ |
Serhiy Storchaka | 4a934d4 | 2018-11-27 11:27:36 +0200 | [diff] [blame] | 636 | {"create", (PyCFunction)(void(*)(void))_tkinter_create, METH_FASTCALL, _tkinter_create__doc__}, |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 637 | |
| 638 | static PyObject * |
Serhiy Storchaka | 1a2b24f | 2016-07-07 17:35:15 +0300 | [diff] [blame] | 639 | _tkinter_create_impl(PyObject *module, const char *screenName, |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 640 | const char *baseName, const char *className, |
| 641 | int interactive, int wantobjects, int wantTk, int sync, |
| 642 | const char *use); |
| 643 | |
| 644 | static PyObject * |
Serhiy Storchaka | a5552f0 | 2017-12-15 13:11:11 +0200 | [diff] [blame] | 645 | _tkinter_create(PyObject *module, PyObject *const *args, Py_ssize_t nargs) |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 646 | { |
| 647 | PyObject *return_value = NULL; |
| 648 | const char *screenName = NULL; |
| 649 | const char *baseName = NULL; |
| 650 | const char *className = "Tk"; |
| 651 | int interactive = 0; |
| 652 | int wantobjects = 0; |
| 653 | int wantTk = 1; |
| 654 | int sync = 0; |
| 655 | const char *use = NULL; |
| 656 | |
Sylvain | 7445381 | 2017-06-10 06:51:48 +0200 | [diff] [blame] | 657 | if (!_PyArg_ParseStack(args, nargs, "|zssiiiiz:create", |
| 658 | &screenName, &baseName, &className, &interactive, &wantobjects, &wantTk, &sync, &use)) { |
Victor Stinner | 259f0e4 | 2017-01-17 01:35:17 +0100 | [diff] [blame] | 659 | goto exit; |
| 660 | } |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 661 | return_value = _tkinter_create_impl(module, screenName, baseName, className, interactive, wantobjects, wantTk, sync, use); |
| 662 | |
| 663 | exit: |
| 664 | return return_value; |
| 665 | } |
| 666 | |
| 667 | PyDoc_STRVAR(_tkinter_setbusywaitinterval__doc__, |
| 668 | "setbusywaitinterval($module, new_val, /)\n" |
| 669 | "--\n" |
| 670 | "\n" |
| 671 | "Set the busy-wait interval in milliseconds between successive calls to Tcl_DoOneEvent in a threaded Python interpreter.\n" |
| 672 | "\n" |
| 673 | "It should be set to a divisor of the maximum time between frames in an animation."); |
| 674 | |
| 675 | #define _TKINTER_SETBUSYWAITINTERVAL_METHODDEF \ |
| 676 | {"setbusywaitinterval", (PyCFunction)_tkinter_setbusywaitinterval, METH_O, _tkinter_setbusywaitinterval__doc__}, |
| 677 | |
| 678 | static PyObject * |
Serhiy Storchaka | 1a2b24f | 2016-07-07 17:35:15 +0300 | [diff] [blame] | 679 | _tkinter_setbusywaitinterval_impl(PyObject *module, int new_val); |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 680 | |
| 681 | static PyObject * |
Serhiy Storchaka | 1a2b24f | 2016-07-07 17:35:15 +0300 | [diff] [blame] | 682 | _tkinter_setbusywaitinterval(PyObject *module, PyObject *arg) |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 683 | { |
| 684 | PyObject *return_value = NULL; |
| 685 | int new_val; |
| 686 | |
Serhiy Storchaka | 32d96a2 | 2018-12-25 13:23:47 +0200 | [diff] [blame^] | 687 | if (PyFloat_Check(arg)) { |
| 688 | PyErr_SetString(PyExc_TypeError, |
| 689 | "integer argument expected, got float" ); |
| 690 | goto exit; |
| 691 | } |
| 692 | new_val = _PyLong_AsInt(arg); |
| 693 | if (new_val == -1 && PyErr_Occurred()) { |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 694 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 695 | } |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 696 | return_value = _tkinter_setbusywaitinterval_impl(module, new_val); |
| 697 | |
| 698 | exit: |
| 699 | return return_value; |
| 700 | } |
| 701 | |
| 702 | PyDoc_STRVAR(_tkinter_getbusywaitinterval__doc__, |
| 703 | "getbusywaitinterval($module, /)\n" |
| 704 | "--\n" |
| 705 | "\n" |
| 706 | "Return the current busy-wait interval between successive calls to Tcl_DoOneEvent in a threaded Python interpreter."); |
| 707 | |
| 708 | #define _TKINTER_GETBUSYWAITINTERVAL_METHODDEF \ |
| 709 | {"getbusywaitinterval", (PyCFunction)_tkinter_getbusywaitinterval, METH_NOARGS, _tkinter_getbusywaitinterval__doc__}, |
| 710 | |
| 711 | static int |
Serhiy Storchaka | 1a2b24f | 2016-07-07 17:35:15 +0300 | [diff] [blame] | 712 | _tkinter_getbusywaitinterval_impl(PyObject *module); |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 713 | |
| 714 | static PyObject * |
Serhiy Storchaka | 1a2b24f | 2016-07-07 17:35:15 +0300 | [diff] [blame] | 715 | _tkinter_getbusywaitinterval(PyObject *module, PyObject *Py_UNUSED(ignored)) |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 716 | { |
| 717 | PyObject *return_value = NULL; |
| 718 | int _return_value; |
| 719 | |
| 720 | _return_value = _tkinter_getbusywaitinterval_impl(module); |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 721 | if ((_return_value == -1) && PyErr_Occurred()) { |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 722 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 723 | } |
Serhiy Storchaka | 5abdf484 | 2015-05-03 15:49:47 +0300 | [diff] [blame] | 724 | return_value = PyLong_FromLong((long)_return_value); |
| 725 | |
| 726 | exit: |
| 727 | return return_value; |
| 728 | } |
| 729 | |
| 730 | #ifndef _TKINTER_TKAPP_CREATEFILEHANDLER_METHODDEF |
| 731 | #define _TKINTER_TKAPP_CREATEFILEHANDLER_METHODDEF |
| 732 | #endif /* !defined(_TKINTER_TKAPP_CREATEFILEHANDLER_METHODDEF) */ |
| 733 | |
| 734 | #ifndef _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF |
| 735 | #define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF |
| 736 | #endif /* !defined(_TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF) */ |
Serhiy Storchaka | 32d96a2 | 2018-12-25 13:23:47 +0200 | [diff] [blame^] | 737 | /*[clinic end generated code: output=d84b0e794824c511 input=a9049054013a1b77]*/ |