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