diff -r 13254db884e9 Modules/_tkinter.c --- a/Modules/_tkinter.c Sun Jun 01 12:36:39 2014 +0300 +++ b/Modules/_tkinter.c Sun Jun 01 18:43:29 2014 +0300 @@ -274,7 +274,7 @@ static PyObject * -Tkinter_Error(PyObject *v) +Tkinter_Error(TkappObject *v) { PyErr_SetString(Tkinter_TclError, Tkapp_Result(v)); return NULL; @@ -511,6 +511,15 @@ } +/*[clinic input] +output preset file +module _tkinter +class _tkinter.tkapp "TkappObject *" "&Tkapp_Type_spec" +class _tkinter.Tcl_Obj "PyTclObject *" "&PyTclObject_Type_spec" +class _tkinter.tktimertoken "TkttObject *" "&Tktt_Type_spec" +[clinic start generated code]*/ +/*[clinic end generated code: output=da39a3ee5e6b4b0d input=5aea67be10b46f30]*/ + /**** Tkapp Object ****/ #ifndef WITH_APPINIT @@ -561,8 +570,8 @@ static void DisableEventHook(void); /* Forward */ static TkappObject * -Tkapp_New(char *screenName, char *className, - int interactive, int wantobjects, int wantTk, int sync, char *use) +Tkapp_New(const char *screenName, const char *className, + int interactive, int wantobjects, int wantTk, int sync, const char *use) { TkappObject *v; char *argv0; @@ -672,7 +681,7 @@ } if (Tcl_AppInit(v->interp) != TCL_OK) { - PyObject *result = Tkinter_Error((PyObject *)v); + PyObject *result = Tkinter_Error(v); #ifdef TKINTER_PROTECT_LOADTK if (wantTk) { const char *_tkinter_tk_failed; @@ -1033,7 +1042,7 @@ status = Tcl_ListObjLength(Tkapp_Interp(tkapp), value, &size); if (status == TCL_ERROR) - return Tkinter_Error(tkapp); + return Tkinter_Error(app); result = PyTuple_New(size); if (!result) return NULL; @@ -1042,7 +1051,7 @@ value, i, &tcl_elem); if (status == TCL_ERROR) { Py_DECREF(result); - return Tkinter_Error(tkapp); + return Tkinter_Error(app); } elem = FromObj(tkapp, tcl_elem); if (!elem) { @@ -1291,7 +1300,7 @@ ENTER_OVERLAP if (i == TCL_ERROR) - Tkinter_Error(selfptr); + Tkinter_Error(self); else res = Tkapp_CallResult(self); @@ -1303,16 +1312,21 @@ } +/*[clinic input] +_tkinter.tkapp.eval + + script: str + / + +[clinic start generated code]*/ + static PyObject * -Tkapp_Eval(PyObject *self, PyObject *args) +_tkinter_tkapp_eval_impl(TkappObject *self, const char *script) +/*[clinic end generated code: output=24b79831f700dea0 input=481484123a455f22]*/ { - char *script; PyObject *res = NULL; int err; - if (!PyArg_ParseTuple(args, "s:eval", &script)) - return NULL; - CHECK_STRING_LENGTH(script); CHECK_TCL_APPARTMENT; @@ -1327,16 +1341,21 @@ return res; } +/*[clinic input] +_tkinter.tkapp.evalfile + + fileName: str + / + +[clinic start generated code]*/ + static PyObject * -Tkapp_EvalFile(PyObject *self, PyObject *args) +_tkinter_tkapp_evalfile_impl(TkappObject *self, const char *fileName) +/*[clinic end generated code: output=63be88dcee4f11d3 input=873ab707e5e947e1]*/ { - char *fileName; PyObject *res = NULL; int err; - if (!PyArg_ParseTuple(args, "s:evalfile", &fileName)) - return NULL; - CHECK_STRING_LENGTH(fileName); CHECK_TCL_APPARTMENT; @@ -1351,16 +1370,21 @@ return res; } +/*[clinic input] +_tkinter.tkapp.record + + script: str + / + +[clinic start generated code]*/ + static PyObject * -Tkapp_Record(PyObject *self, PyObject *args) +_tkinter_tkapp_record_impl(TkappObject *self, const char *script) +/*[clinic end generated code: output=0ffe08a0061730df input=c0b0db5a21412cac]*/ { - char *script; PyObject *res = NULL; int err; - if (!PyArg_ParseTuple(args, "s:record", &script)) - return NULL; - CHECK_STRING_LENGTH(script); CHECK_TCL_APPARTMENT; @@ -1375,13 +1399,18 @@ return res; } +/*[clinic input] +_tkinter.tkapp.adderrinfo + + msg: str + / + +[clinic start generated code]*/ + static PyObject * -Tkapp_AddErrorInfo(PyObject *self, PyObject *args) +_tkinter_tkapp_adderrinfo_impl(TkappObject *self, const char *msg) +/*[clinic end generated code: output=0e222ee2050eb357 input=4971399317d4c136]*/ { - char *msg; - - if (!PyArg_ParseTuple(args, "s:adderrorinfo", &msg)) - return NULL; CHECK_STRING_LENGTH(msg); CHECK_TCL_APPARTMENT; @@ -1414,6 +1443,15 @@ } VarEvent; #endif +/*[python] + +class varname_converter(CConverter): + type = 'const char *' + converter = 'varname_converter' + +[python]*/ +/*[python checksum: da39a3ee5e6b4b0d3255bfef95601890afd80709]*/ + static int varname_converter(PyObject *in, void *_out) { @@ -1496,7 +1534,6 @@ #ifdef WITH_THREAD TkappObject *self = (TkappObject*)selfptr; if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) { - TkappObject *self = (TkappObject*)selfptr; VarEvent *ev; PyObject *res, *exc_type, *exc_val; Tcl_Condition cond = NULL; @@ -1555,7 +1592,7 @@ newval, flags); ENTER_OVERLAP if (!ok) - Tkinter_Error(self); + Tkinter_Error((TkappObject *)self); else { res = Py_None; Py_INCREF(res); @@ -1574,7 +1611,7 @@ ok = Tcl_SetVar2Ex(Tkapp_Interp(self), name1, name2, newval, flags); ENTER_OVERLAP if (!ok) - Tkinter_Error(self); + Tkinter_Error((TkappObject *)self); else { res = Py_None; Py_INCREF(res); @@ -1662,7 +1699,7 @@ code = Tcl_UnsetVar2(Tkapp_Interp(self), name1, name2, flags); ENTER_OVERLAP if (code == TCL_ERROR) - res = Tkinter_Error(self); + res = Tkinter_Error((TkappObject *)self); else { Py_INCREF(Py_None); res = Py_None; @@ -1705,7 +1742,7 @@ return NULL; CHECK_STRING_LENGTH(s); if (Tcl_GetInt(Tkapp_Interp(self), s, &v) == TCL_ERROR) - return Tkinter_Error(self); + return Tkinter_Error((TkappObject *)self); return Py_BuildValue("i", v); } @@ -1726,7 +1763,7 @@ return NULL; CHECK_STRING_LENGTH(s); if (Tcl_GetDouble(Tkapp_Interp(self), s, &v) == TCL_ERROR) - return Tkinter_Error(self); + return Tkinter_Error((TkappObject *)self); return Py_BuildValue("d", v); } @@ -1747,20 +1784,25 @@ return NULL; CHECK_STRING_LENGTH(s); if (Tcl_GetBoolean(Tkapp_Interp(self), s, &v) == TCL_ERROR) - return Tkinter_Error(self); + return Tkinter_Error((TkappObject *)self); return PyBool_FromLong(v); } +/*[clinic input] +_tkinter.tkapp.exprstring + + s: str + / + +[clinic start generated code]*/ + static PyObject * -Tkapp_ExprString(PyObject *self, PyObject *args) +_tkinter_tkapp_exprstring_impl(TkappObject *self, const char *s) +/*[clinic end generated code: output=beda323d3ed0abb1 input=fa78f751afb2f21b]*/ { - char *s; PyObject *res = NULL; int retval; - if (!PyArg_ParseTuple(args, "s:exprstring", &s)) - return NULL; - CHECK_STRING_LENGTH(s); CHECK_TCL_APPARTMENT; @@ -1775,17 +1817,22 @@ return res; } +/*[clinic input] +_tkinter.tkapp.exprlong + + s: str + / + +[clinic start generated code]*/ + static PyObject * -Tkapp_ExprLong(PyObject *self, PyObject *args) +_tkinter_tkapp_exprlong_impl(TkappObject *self, const char *s) +/*[clinic end generated code: output=5d6a46b63c6ebcf9 input=11bd7eee0c57b4dc]*/ { - char *s; PyObject *res = NULL; int retval; long v; - if (!PyArg_ParseTuple(args, "s:exprlong", &s)) - return NULL; - CHECK_STRING_LENGTH(s); CHECK_TCL_APPARTMENT; @@ -1800,16 +1847,22 @@ return res; } +/*[clinic input] +_tkinter.tkapp.exprdouble + + s: str + / + +[clinic start generated code]*/ + static PyObject * -Tkapp_ExprDouble(PyObject *self, PyObject *args) +_tkinter_tkapp_exprdouble_impl(TkappObject *self, const char *s) +/*[clinic end generated code: output=ff78df1081ea4158 input=ff02bc11798832d5]*/ { - char *s; PyObject *res = NULL; double v; int retval; - if (!PyArg_ParseTuple(args, "s:exprdouble", &s)) - return NULL; CHECK_STRING_LENGTH(s); CHECK_TCL_APPARTMENT; PyFPE_START_PROTECT("Tkapp_ExprDouble", return 0) @@ -1825,16 +1878,22 @@ return res; } +/*[clinic input] +_tkinter.tkapp.exprboolean + + s: str + / + +[clinic start generated code]*/ + static PyObject * -Tkapp_ExprBoolean(PyObject *self, PyObject *args) +_tkinter_tkapp_exprboolean_impl(TkappObject *self, const char *s) +/*[clinic end generated code: output=8b28038c22887311 input=c8c66022bdb8d5d3]*/ { - char *s; PyObject *res = NULL; int retval; int v; - if (!PyArg_ParseTuple(args, "s:exprboolean", &s)) - return NULL; CHECK_STRING_LENGTH(s); CHECK_TCL_APPARTMENT; ENTER_TCL @@ -1867,7 +1926,7 @@ if (Tcl_ListObjGetElements(Tkapp_Interp(self), ((PyTclObject*)arg)->value, &objc, &objv) == TCL_ERROR) { - return Tkinter_Error(self); + return Tkinter_Error((TkappObject *)self); } if (!(v = PyTuple_New(objc))) return NULL; @@ -1895,7 +1954,7 @@ if (Tcl_SplitList(Tkapp_Interp(self), list, &argc, &argv) == TCL_ERROR) { PyMem_Free(list); - return Tkinter_Error(self); + return Tkinter_Error((TkappObject *)self); } if (!(v = PyTuple_New(argc))) @@ -2051,7 +2110,7 @@ typedef struct CommandEvent{ Tcl_Event ev; Tcl_Interp* interp; - char *name; + const char *name; int create; int *status; ClientData *data; @@ -2074,18 +2133,24 @@ } #endif +/*[clinic input] +_tkinter.tkapp.createcommand + + self: self(type="TkappObject *") + name: str + func: object + / + +[clinic start generated code]*/ + static PyObject * -Tkapp_CreateCommand(PyObject *selfptr, PyObject *args) +_tkinter_tkapp_createcommand_impl(TkappObject *self, const char *name, PyObject *func) +/*[clinic end generated code: output=1af5a6afcfe428f9 input=2bc2c046a0914234]*/ { - TkappObject *self = (TkappObject*)selfptr; PythonCmd_ClientData *data; - char *cmdName; - PyObject *func; int err; - if (!PyArg_ParseTuple(args, "sO:createcommand", &cmdName, &func)) - return NULL; - CHECK_STRING_LENGTH(cmdName); + CHECK_STRING_LENGTH(name); if (!PyCallable_Check(func)) { PyErr_SetString(PyExc_TypeError, "command not callable"); return NULL; @@ -2102,7 +2167,7 @@ return PyErr_NoMemory(); Py_INCREF(self); Py_INCREF(func); - data->self = selfptr; + data->self = (PyObject *) self; data->func = func; #ifdef WITH_THREAD if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) { @@ -2111,7 +2176,7 @@ ev->ev.proc = (Tcl_EventProc*)Tkapp_CommandProc; ev->interp = self->interp; ev->create = 1; - ev->name = cmdName; + ev->name = name; ev->data = (ClientData)data; ev->status = &err; ev->done = &cond; @@ -2123,7 +2188,7 @@ { ENTER_TCL err = Tcl_CreateCommand( - Tkapp_Interp(self), cmdName, PythonCmd, + Tkapp_Interp(self), name, PythonCmd, (ClientData)data, PythonCmdDelete) == NULL; LEAVE_TCL } @@ -2138,16 +2203,22 @@ +/*[clinic input] +_tkinter.tkapp.deletecommand + + self: self(type="TkappObject *") + name: str + / + +[clinic start generated code]*/ + static PyObject * -Tkapp_DeleteCommand(PyObject *selfptr, PyObject *args) +_tkinter_tkapp_deletecommand_impl(TkappObject *self, const char *name) +/*[clinic end generated code: output=a67e8cb5845e0d2d input=b6306468f10b219c]*/ { - TkappObject *self = (TkappObject*)selfptr; - char *cmdName; int err; - if (!PyArg_ParseTuple(args, "s:deletecommand", &cmdName)) - return NULL; - CHECK_STRING_LENGTH(cmdName); + CHECK_STRING_LENGTH(name); #ifdef WITH_THREAD if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) { @@ -2157,7 +2228,7 @@ ev->ev.proc = (Tcl_EventProc*)Tkapp_CommandProc; ev->interp = self->interp; ev->create = 0; - ev->name = cmdName; + ev->name = name; ev->status = &err; ev->done = &cond; Tkapp_ThreadSend(self, (Tcl_Event*)ev, &cond, @@ -2168,7 +2239,7 @@ #endif { ENTER_TCL - err = Tcl_DeleteCommand(self->interp, cmdName); + err = Tcl_DeleteCommand(self->interp, name); LEAVE_TCL } if (err == -1) { @@ -2249,17 +2320,22 @@ LEAVE_PYTHON } +/*[clinic input] +_tkinter.tkapp.createfilehandler + + file: object + mask: int + func: object + / + +[clinic start generated code]*/ + static PyObject * -Tkapp_CreateFileHandler(PyObject *self, PyObject *args) - /* args is (file, mask, func) */ +_tkinter_tkapp_createfilehandler_impl(TkappObject *self, PyObject *file, int mask, PyObject *func) +/*[clinic end generated code: output=a79c0c28ba5dc82f input=84943a5286e47947]*/ { FileHandler_ClientData *data; - PyObject *file, *func; - int mask, tfile; - - if (!PyArg_ParseTuple(args, "OiO:createfilehandler", - &file, &mask, &func)) - return NULL; + int tfile; CHECK_TCL_APPARTMENT; @@ -2282,15 +2358,20 @@ Py_RETURN_NONE; } +/*[clinic input] +_tkinter.tkapp.deletefilehandler + + file: object + / + +[clinic start generated code]*/ + static PyObject * -Tkapp_DeleteFileHandler(PyObject *self, PyObject *args) +_tkinter_tkapp_deletefilehandler(TkappObject *self, PyObject *file) +/*[clinic end generated code: output=b53cc96ebf9476fd input=abbec19d66312e2a]*/ { - PyObject *file; int tfile; - if (!PyArg_ParseTuple(args, "O:deletefilehandler", &file)) - return NULL; - CHECK_TCL_APPARTMENT; tfile = PyObject_AsFileDescriptor(file); @@ -2318,14 +2399,20 @@ PyObject *func; } TkttObject; +/*[clinic input] +_tkinter.tktimertoken.deletetimerhandler + + self: self(type="TkttObject *") + +[clinic start generated code]*/ + static PyObject * -Tktt_DeleteTimerHandler(PyObject *self, PyObject *args) +_tkinter_tktimertoken_deletetimerhandler_impl(TkttObject *self) +/*[clinic end generated code: output=bd7fe17f328cfa55 input=25ba5dd594e52084]*/ { - TkttObject *v = (TkttObject *)self; + TkttObject *v = self; PyObject *func = v->func; - if (!PyArg_ParseTuple(args, ":deletetimerhandler")) - return NULL; if (v->token != NULL) { Tcl_DeleteTimerHandler(v->token); v->token = NULL; @@ -2338,11 +2425,7 @@ Py_RETURN_NONE; } -static PyMethodDef Tktt_methods[] = -{ - {"deletetimerhandler", Tktt_DeleteTimerHandler, METH_VARARGS}, - {NULL, NULL} -}; +static PyMethodDef Tktt_methods[]; static TkttObject * Tktt_New(PyObject *func) @@ -2393,7 +2476,7 @@ }; static PyType_Spec Tktt_Type_spec = { - "tktimertoken", + "_tkinter.tktimertoken", sizeof(TkttObject), 0, Py_TPFLAGS_DEFAULT, @@ -2431,16 +2514,21 @@ LEAVE_PYTHON } +/*[clinic input] +_tkinter.tkapp.createtimerhandler + + milliseconds: int + func: object + / + +[clinic start generated code]*/ + static PyObject * -Tkapp_CreateTimerHandler(PyObject *self, PyObject *args) +_tkinter_tkapp_createtimerhandler_impl(TkappObject *self, int milliseconds, PyObject *func) +/*[clinic end generated code: output=69eecb6400a7874e input=ba6729f32f0277a5]*/ { - int milliseconds; - PyObject *func; TkttObject *v; - if (!PyArg_ParseTuple(args, "iO:createtimerhandler", - &milliseconds, &func)) - return NULL; if (!PyCallable_Check(func)) { PyErr_SetString(PyExc_TypeError, "bad argument list"); return NULL; @@ -2460,18 +2548,23 @@ /** Event Loop **/ +/*[clinic input] +_tkinter.tkapp.mainloop + + self: self(type="TkappObject *") + threshold: int = 0 + / + +[clinic start generated code]*/ + static PyObject * -Tkapp_MainLoop(PyObject *selfptr, PyObject *args) +_tkinter_tkapp_mainloop_impl(TkappObject *self, int threshold) +/*[clinic end generated code: output=0ba8eabbe57841b0 input=ad57c9c1dd2b9470]*/ { - int threshold = 0; - TkappObject *self = (TkappObject*)selfptr; #ifdef WITH_THREAD PyThreadState *tstate = PyThreadState_Get(); #endif - if (!PyArg_ParseTuple(args, "|i:mainloop", &threshold)) - return NULL; - CHECK_TCL_APPARTMENT; self->dispatching = 1; @@ -2523,44 +2616,56 @@ Py_RETURN_NONE; } +/*[clinic input] +_tkinter.tkapp.dooneevent + + flags: int = 0 + / + +[clinic start generated code]*/ + static PyObject * -Tkapp_DoOneEvent(PyObject *self, PyObject *args) +_tkinter_tkapp_dooneevent_impl(TkappObject *self, int flags) +/*[clinic end generated code: output=27c6b2aa464cac29 input=6542b928e364b793]*/ { - int flags = 0; int rv; - if (!PyArg_ParseTuple(args, "|i:dooneevent", &flags)) - return NULL; - ENTER_TCL rv = Tcl_DoOneEvent(flags); LEAVE_TCL return Py_BuildValue("i", rv); } +/*[clinic input] +_tkinter.tkapp.quit +[clinic start generated code]*/ + static PyObject * -Tkapp_Quit(PyObject *self, PyObject *args) +_tkinter_tkapp_quit_impl(TkappObject *self) +/*[clinic end generated code: output=7f21eeff481f754f input=e03020dc38aff23c]*/ { - - if (!PyArg_ParseTuple(args, ":quit")) - return NULL; - quitMainLoop = 1; Py_RETURN_NONE; } +/*[clinic input] +_tkinter.tkapp.interpaddr +[clinic start generated code]*/ + static PyObject * -Tkapp_InterpAddr(PyObject *self, PyObject *args) +_tkinter_tkapp_interpaddr_impl(TkappObject *self) +/*[clinic end generated code: output=6caaae3273b3c95a input=2dd32cbddb55a111]*/ { - - if (!PyArg_ParseTuple(args, ":interpaddr")) - return NULL; - return PyLong_FromVoidPtr(Tkapp_Interp(self)); } +/*[clinic input] +_tkinter.tkapp.loadtk +[clinic start generated code]*/ + static PyObject * -Tkapp_TkInit(PyObject *self, PyObject *args) +_tkinter_tkapp_loadtk_impl(TkappObject *self) +/*[clinic end generated code: output=e9e10a954ce46d2a input=b5e82afedd6354f0]*/ { Tcl_Interp *interp = Tkapp_Interp(self); const char * _tk_exists = NULL; @@ -2607,25 +2712,41 @@ Py_RETURN_NONE; } +/*[clinic input] +_tkinter.tkapp.wantobjects + + self: self(type="TkappObject *") + [ + value: int + ] + / + +[clinic start generated code]*/ + static PyObject * -Tkapp_WantObjects(PyObject *self, PyObject *args) +_tkinter_tkapp_wantobjects_impl(TkappObject *self, int group_right_1, int value) +/*[clinic end generated code: output=5688ef1f675b716e input=efe5aa6b524787b2]*/ { - - int wantobjects = -1; - if (!PyArg_ParseTuple(args, "|i:wantobjects", &wantobjects)) - return NULL; - if (wantobjects == -1) - return PyBool_FromLong(((TkappObject*)self)->wantobjects); - ((TkappObject*)self)->wantobjects = wantobjects; + if (!group_right_1) + return PyBool_FromLong(self->wantobjects); + + self->wantobjects = value; Py_RETURN_NONE; } +/*[clinic input] +_tkinter.tkapp.willdispatch + + self: self(type="TkappObject *") + +[clinic start generated code]*/ + static PyObject * -Tkapp_WillDispatch(PyObject *self, PyObject *args) +_tkinter_tkapp_willdispatch_impl(TkappObject *self) +/*[clinic end generated code: output=0e3f46d244642155 input=2630699767808970]*/ { - - ((TkappObject*)self)->dispatching = 1; + self->dispatching = 1; Py_RETURN_NONE; } @@ -2633,45 +2754,7 @@ /**** Tkapp Method List ****/ -static PyMethodDef Tkapp_methods[] = -{ - {"willdispatch", Tkapp_WillDispatch, METH_NOARGS}, - {"wantobjects", Tkapp_WantObjects, METH_VARARGS}, - {"call", Tkapp_Call, METH_VARARGS}, - {"eval", Tkapp_Eval, METH_VARARGS}, - {"evalfile", Tkapp_EvalFile, METH_VARARGS}, - {"record", Tkapp_Record, METH_VARARGS}, - {"adderrorinfo", Tkapp_AddErrorInfo, METH_VARARGS}, - {"setvar", Tkapp_SetVar, METH_VARARGS}, - {"globalsetvar", Tkapp_GlobalSetVar, METH_VARARGS}, - {"getvar", Tkapp_GetVar, METH_VARARGS}, - {"globalgetvar", Tkapp_GlobalGetVar, METH_VARARGS}, - {"unsetvar", Tkapp_UnsetVar, METH_VARARGS}, - {"globalunsetvar", Tkapp_GlobalUnsetVar, METH_VARARGS}, - {"getint", Tkapp_GetInt, METH_VARARGS}, - {"getdouble", Tkapp_GetDouble, METH_VARARGS}, - {"getboolean", Tkapp_GetBoolean, METH_VARARGS}, - {"exprstring", Tkapp_ExprString, METH_VARARGS}, - {"exprlong", Tkapp_ExprLong, METH_VARARGS}, - {"exprdouble", Tkapp_ExprDouble, METH_VARARGS}, - {"exprboolean", Tkapp_ExprBoolean, METH_VARARGS}, - {"splitlist", Tkapp_SplitList, METH_VARARGS}, - {"split", Tkapp_Split, METH_VARARGS}, - {"createcommand", Tkapp_CreateCommand, METH_VARARGS}, - {"deletecommand", Tkapp_DeleteCommand, METH_VARARGS}, -#ifdef HAVE_CREATEFILEHANDLER - {"createfilehandler", Tkapp_CreateFileHandler, METH_VARARGS}, - {"deletefilehandler", Tkapp_DeleteFileHandler, METH_VARARGS}, -#endif - {"createtimerhandler", Tkapp_CreateTimerHandler, METH_VARARGS}, - {"mainloop", Tkapp_MainLoop, METH_VARARGS}, - {"dooneevent", Tkapp_DoOneEvent, METH_VARARGS}, - {"quit", Tkapp_Quit, METH_VARARGS}, - {"interpaddr", Tkapp_InterpAddr, METH_VARARGS}, - {"loadtk", Tkapp_TkInit, METH_NOARGS}, - {NULL, NULL} -}; - +static PyMethodDef Tkapp_methods[]; /**** Tkapp Type Methods ****/ @@ -2697,7 +2780,7 @@ static PyType_Spec Tkapp_Type_spec = { - "tkapp", + "_tkinter.tkapp", sizeof(TkappObject), 0, Py_TPFLAGS_DEFAULT, @@ -2769,14 +2852,19 @@ return 1; } +/*[clinic input] +_tkinter._flatten + + item: object + / + +[clinic start generated code]*/ + static PyObject * -Tkinter_Flatten(PyObject* self, PyObject* args) +_tkinter__flatten(PyModuleDef *module, PyObject *item) +/*[clinic end generated code: output=9505049ec74c3480 input=6b9c12260aa1157f]*/ { FlattenContext context; - PyObject* item; - - if (!PyArg_ParseTuple(args, "O:_flatten", &item)) - return NULL; context.maxsize = PySequence_Size(item); if (context.maxsize < 0) @@ -2799,26 +2887,30 @@ return context.tuple; } +/*[clinic input] +_tkinter.create + + screenName: str(nullable=True) = NULL + baseName: str = NULL + className: str = "Tk" + interactive: int(c_default="0") = False + wantobjects: int(c_default="0") = False + wantTk: int(c_default="1") = True + if false, then Tk_Init() doesn't get called + sync: int(c_default="0") = False + if true, then pass -sync to wish + use: str(nullable=True) = NULL + if not None, then pass -use to wish + / + +[clinic start generated code]*/ + static PyObject * -Tkinter_Create(PyObject *self, PyObject *args) +_tkinter_create_impl(PyModuleDef *module, const char *screenName, const char *baseName, const char *className, int interactive, int wantobjects, int wantTk, int sync, const char *use) +/*[clinic end generated code: output=1c7f02cd80bff352 input=c133c59a99dd0086]*/ { - char *screenName = NULL; - char *baseName = NULL; /* XXX this is not used anymore; - try getting rid of it. */ - char *className = NULL; - int interactive = 0; - int wantobjects = 1; - int wantTk = 1; /* If false, then Tk_Init() doesn't get called */ - int sync = 0; /* pass -sync to wish */ - char *use = NULL; /* pass -use to wish */ - - className = "Tk"; - - if (!PyArg_ParseTuple(args, "|zssiiiiz:create", - &screenName, &baseName, &className, - &interactive, &wantobjects, &wantTk, - &sync, &use)) - return NULL; + /* XXX baseName is not used anymore; + * try getting rid of it. */ CHECK_STRING_LENGTH(screenName); CHECK_STRING_LENGTH(baseName); CHECK_STRING_LENGTH(className); @@ -2829,12 +2921,21 @@ sync, use); } +/*[clinic input] +_tkinter.setbusywaitinterval + + new_val: int + / + +Set the busy-wait interval in milliseconds between successive calls to Tcl_DoOneEvent in a threaded Python interpreter. + +It should be set to a divisor of the maximum time between frames in an animation. +[clinic start generated code]*/ + static PyObject * -Tkinter_setbusywaitinterval(PyObject *self, PyObject *args) +_tkinter_setbusywaitinterval_impl(PyModuleDef *module, int new_val) +/*[clinic end generated code: output=0b9d7ef7940461ea input=deca1d6f9e6dae47]*/ { - int new_val; - if (!PyArg_ParseTuple(args, "i:setbusywaitinterval", &new_val)) - return NULL; if (new_val < 0) { PyErr_SetString(PyExc_ValueError, "busywaitinterval must be >= 0"); @@ -2844,34 +2945,72 @@ Py_RETURN_NONE; } -static char setbusywaitinterval_doc[] = -"setbusywaitinterval(n) -> None\n\ -\n\ -Set the busy-wait interval in milliseconds between successive\n\ -calls to Tcl_DoOneEvent in a threaded Python interpreter.\n\ -It should be set to a divisor of the maximum time between\n\ -frames in an animation."; - -static PyObject * -Tkinter_getbusywaitinterval(PyObject *self, PyObject *args) +/*[clinic input] +_tkinter.getbusywaitinterval -> int + +Return the current busy-wait interval between successive calls to Tcl_DoOneEvent in a threaded Python interpreter. +[clinic start generated code]*/ + +static int +_tkinter_getbusywaitinterval_impl(PyModuleDef *module) +/*[clinic end generated code: output=9d09eee026e96971 input=a695878d2d576a84]*/ { - return PyLong_FromLong(Tkinter_busywaitinterval); + return Tkinter_busywaitinterval; } -static char getbusywaitinterval_doc[] = -"getbusywaitinterval() -> int\n\ -\n\ -Return the current busy-wait interval between successive\n\ -calls to Tcl_DoOneEvent in a threaded Python interpreter."; +#include "clinic/_tkinter.c.h" + +static PyMethodDef Tktt_methods[] = +{ + _TKINTER_TKTIMERTOKEN_DELETETIMERHANDLER_METHODDEF + {NULL, NULL} +}; + +static PyMethodDef Tkapp_methods[] = +{ + _TKINTER_TKAPP_WILLDISPATCH_METHODDEF + _TKINTER_TKAPP_WANTOBJECTS_METHODDEF + {"call", Tkapp_Call, METH_VARARGS}, + _TKINTER_TKAPP_EVAL_METHODDEF + _TKINTER_TKAPP_EVALFILE_METHODDEF + _TKINTER_TKAPP_RECORD_METHODDEF + _TKINTER_TKAPP_ADDERRINFO_METHODDEF + {"setvar", Tkapp_SetVar, METH_VARARGS}, + {"globalsetvar", Tkapp_GlobalSetVar, METH_VARARGS}, + {"getvar", Tkapp_GetVar, METH_VARARGS}, + {"globalgetvar", Tkapp_GlobalGetVar, METH_VARARGS}, + {"unsetvar", Tkapp_UnsetVar, METH_VARARGS}, + {"globalunsetvar", Tkapp_GlobalUnsetVar, METH_VARARGS}, + {"getint", Tkapp_GetInt, METH_VARARGS}, + {"getdouble", Tkapp_GetDouble, METH_VARARGS}, + {"getboolean", Tkapp_GetBoolean, METH_VARARGS}, + _TKINTER_TKAPP_EXPRSTRING_METHODDEF + _TKINTER_TKAPP_EXPRLONG_METHODDEF + _TKINTER_TKAPP_EXPRDOUBLE_METHODDEF + _TKINTER_TKAPP_EXPRBOOLEAN_METHODDEF + {"splitlist", Tkapp_SplitList, METH_VARARGS}, + {"split", Tkapp_Split, METH_VARARGS}, + _TKINTER_TKAPP_CREATECOMMAND_METHODDEF + _TKINTER_TKAPP_DELETECOMMAND_METHODDEF +#ifdef HAVE_CREATEFILEHANDLER + _TKINTER_TKAPP_CREATEFILEHANDLER_METHODDEF + _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF +#endif + _TKINTER_TKAPP_CREATETIMERHANDLER_METHODDEF + _TKINTER_TKAPP_MAINLOOP_METHODDEF + _TKINTER_TKAPP_DOONEEVENT_METHODDEF + _TKINTER_TKAPP_QUIT_METHODDEF + _TKINTER_TKAPP_INTERPADDR_METHODDEF + _TKINTER_TKAPP_LOADTK_METHODDEF + {NULL, NULL} +}; static PyMethodDef moduleMethods[] = { - {"_flatten", Tkinter_Flatten, METH_VARARGS}, - {"create", Tkinter_Create, METH_VARARGS}, - {"setbusywaitinterval",Tkinter_setbusywaitinterval, METH_VARARGS, - setbusywaitinterval_doc}, - {"getbusywaitinterval",(PyCFunction)Tkinter_getbusywaitinterval, - METH_NOARGS, getbusywaitinterval_doc}, + _TKINTER__FLATTEN_METHODDEF + _TKINTER_CREATE_METHODDEF + _TKINTER_SETBUSYWAITINTERVAL_METHODDEF + _TKINTER_GETBUSYWAITINTERVAL_METHODDEF {NULL, NULL} }; diff -r 13254db884e9 Modules/clinic/_tkinter.c.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Modules/clinic/_tkinter.c.h Sun Jun 01 18:43:29 2014 +0300 @@ -0,0 +1,617 @@ +/*[clinic input] +preserve +[clinic start generated code]*/ + +PyDoc_STRVAR(_tkinter_tkapp_eval__doc__, +"eval($self, script, /)\n" +"--"); + +#define _TKINTER_TKAPP_EVAL_METHODDEF \ + {"eval", (PyCFunction)_tkinter_tkapp_eval, METH_VARARGS, _tkinter_tkapp_eval__doc__}, + +static PyObject * +_tkinter_tkapp_eval_impl(TkappObject *self, const char *script); + +static PyObject * +_tkinter_tkapp_eval(TkappObject *self, PyObject *args) +{ + PyObject *return_value = NULL; + const char *script; + + if (!PyArg_ParseTuple(args, + "s:eval", + &script)) + goto exit; + return_value = _tkinter_tkapp_eval_impl(self, script); + +exit: + return return_value; +} + +PyDoc_STRVAR(_tkinter_tkapp_evalfile__doc__, +"evalfile($self, fileName, /)\n" +"--"); + +#define _TKINTER_TKAPP_EVALFILE_METHODDEF \ + {"evalfile", (PyCFunction)_tkinter_tkapp_evalfile, METH_VARARGS, _tkinter_tkapp_evalfile__doc__}, + +static PyObject * +_tkinter_tkapp_evalfile_impl(TkappObject *self, const char *fileName); + +static PyObject * +_tkinter_tkapp_evalfile(TkappObject *self, PyObject *args) +{ + PyObject *return_value = NULL; + const char *fileName; + + if (!PyArg_ParseTuple(args, + "s:evalfile", + &fileName)) + goto exit; + return_value = _tkinter_tkapp_evalfile_impl(self, fileName); + +exit: + return return_value; +} + +PyDoc_STRVAR(_tkinter_tkapp_record__doc__, +"record($self, script, /)\n" +"--"); + +#define _TKINTER_TKAPP_RECORD_METHODDEF \ + {"record", (PyCFunction)_tkinter_tkapp_record, METH_VARARGS, _tkinter_tkapp_record__doc__}, + +static PyObject * +_tkinter_tkapp_record_impl(TkappObject *self, const char *script); + +static PyObject * +_tkinter_tkapp_record(TkappObject *self, PyObject *args) +{ + PyObject *return_value = NULL; + const char *script; + + if (!PyArg_ParseTuple(args, + "s:record", + &script)) + goto exit; + return_value = _tkinter_tkapp_record_impl(self, script); + +exit: + return return_value; +} + +PyDoc_STRVAR(_tkinter_tkapp_adderrinfo__doc__, +"adderrinfo($self, msg, /)\n" +"--"); + +#define _TKINTER_TKAPP_ADDERRINFO_METHODDEF \ + {"adderrinfo", (PyCFunction)_tkinter_tkapp_adderrinfo, METH_VARARGS, _tkinter_tkapp_adderrinfo__doc__}, + +static PyObject * +_tkinter_tkapp_adderrinfo_impl(TkappObject *self, const char *msg); + +static PyObject * +_tkinter_tkapp_adderrinfo(TkappObject *self, PyObject *args) +{ + PyObject *return_value = NULL; + const char *msg; + + if (!PyArg_ParseTuple(args, + "s:adderrinfo", + &msg)) + goto exit; + return_value = _tkinter_tkapp_adderrinfo_impl(self, msg); + +exit: + return return_value; +} + +PyDoc_STRVAR(_tkinter_tkapp_exprstring__doc__, +"exprstring($self, s, /)\n" +"--"); + +#define _TKINTER_TKAPP_EXPRSTRING_METHODDEF \ + {"exprstring", (PyCFunction)_tkinter_tkapp_exprstring, METH_VARARGS, _tkinter_tkapp_exprstring__doc__}, + +static PyObject * +_tkinter_tkapp_exprstring_impl(TkappObject *self, const char *s); + +static PyObject * +_tkinter_tkapp_exprstring(TkappObject *self, PyObject *args) +{ + PyObject *return_value = NULL; + const char *s; + + if (!PyArg_ParseTuple(args, + "s:exprstring", + &s)) + goto exit; + return_value = _tkinter_tkapp_exprstring_impl(self, s); + +exit: + return return_value; +} + +PyDoc_STRVAR(_tkinter_tkapp_exprlong__doc__, +"exprlong($self, s, /)\n" +"--"); + +#define _TKINTER_TKAPP_EXPRLONG_METHODDEF \ + {"exprlong", (PyCFunction)_tkinter_tkapp_exprlong, METH_VARARGS, _tkinter_tkapp_exprlong__doc__}, + +static PyObject * +_tkinter_tkapp_exprlong_impl(TkappObject *self, const char *s); + +static PyObject * +_tkinter_tkapp_exprlong(TkappObject *self, PyObject *args) +{ + PyObject *return_value = NULL; + const char *s; + + if (!PyArg_ParseTuple(args, + "s:exprlong", + &s)) + goto exit; + return_value = _tkinter_tkapp_exprlong_impl(self, s); + +exit: + return return_value; +} + +PyDoc_STRVAR(_tkinter_tkapp_exprdouble__doc__, +"exprdouble($self, s, /)\n" +"--"); + +#define _TKINTER_TKAPP_EXPRDOUBLE_METHODDEF \ + {"exprdouble", (PyCFunction)_tkinter_tkapp_exprdouble, METH_VARARGS, _tkinter_tkapp_exprdouble__doc__}, + +static PyObject * +_tkinter_tkapp_exprdouble_impl(TkappObject *self, const char *s); + +static PyObject * +_tkinter_tkapp_exprdouble(TkappObject *self, PyObject *args) +{ + PyObject *return_value = NULL; + const char *s; + + if (!PyArg_ParseTuple(args, + "s:exprdouble", + &s)) + goto exit; + return_value = _tkinter_tkapp_exprdouble_impl(self, s); + +exit: + return return_value; +} + +PyDoc_STRVAR(_tkinter_tkapp_exprboolean__doc__, +"exprboolean($self, s, /)\n" +"--"); + +#define _TKINTER_TKAPP_EXPRBOOLEAN_METHODDEF \ + {"exprboolean", (PyCFunction)_tkinter_tkapp_exprboolean, METH_VARARGS, _tkinter_tkapp_exprboolean__doc__}, + +static PyObject * +_tkinter_tkapp_exprboolean_impl(TkappObject *self, const char *s); + +static PyObject * +_tkinter_tkapp_exprboolean(TkappObject *self, PyObject *args) +{ + PyObject *return_value = NULL; + const char *s; + + if (!PyArg_ParseTuple(args, + "s:exprboolean", + &s)) + goto exit; + return_value = _tkinter_tkapp_exprboolean_impl(self, s); + +exit: + return return_value; +} + +PyDoc_STRVAR(_tkinter_tkapp_createcommand__doc__, +"createcommand($self, name, func, /)\n" +"--"); + +#define _TKINTER_TKAPP_CREATECOMMAND_METHODDEF \ + {"createcommand", (PyCFunction)_tkinter_tkapp_createcommand, METH_VARARGS, _tkinter_tkapp_createcommand__doc__}, + +static PyObject * +_tkinter_tkapp_createcommand_impl(TkappObject *self, const char *name, PyObject *func); + +static PyObject * +_tkinter_tkapp_createcommand(TkappObject *self, PyObject *args) +{ + PyObject *return_value = NULL; + const char *name; + PyObject *func; + + if (!PyArg_ParseTuple(args, + "sO:createcommand", + &name, &func)) + goto exit; + return_value = _tkinter_tkapp_createcommand_impl(self, name, func); + +exit: + return return_value; +} + +PyDoc_STRVAR(_tkinter_tkapp_deletecommand__doc__, +"deletecommand($self, name, /)\n" +"--"); + +#define _TKINTER_TKAPP_DELETECOMMAND_METHODDEF \ + {"deletecommand", (PyCFunction)_tkinter_tkapp_deletecommand, METH_VARARGS, _tkinter_tkapp_deletecommand__doc__}, + +static PyObject * +_tkinter_tkapp_deletecommand_impl(TkappObject *self, const char *name); + +static PyObject * +_tkinter_tkapp_deletecommand(TkappObject *self, PyObject *args) +{ + PyObject *return_value = NULL; + const char *name; + + if (!PyArg_ParseTuple(args, + "s:deletecommand", + &name)) + goto exit; + return_value = _tkinter_tkapp_deletecommand_impl(self, name); + +exit: + return return_value; +} + +#if defined(HAVE_CREATEFILEHANDLER) + +PyDoc_STRVAR(_tkinter_tkapp_createfilehandler__doc__, +"createfilehandler($self, file, mask, func, /)\n" +"--"); + +#define _TKINTER_TKAPP_CREATEFILEHANDLER_METHODDEF \ + {"createfilehandler", (PyCFunction)_tkinter_tkapp_createfilehandler, METH_VARARGS, _tkinter_tkapp_createfilehandler__doc__}, + +static PyObject * +_tkinter_tkapp_createfilehandler_impl(TkappObject *self, PyObject *file, int mask, PyObject *func); + +static PyObject * +_tkinter_tkapp_createfilehandler(TkappObject *self, PyObject *args) +{ + PyObject *return_value = NULL; + PyObject *file; + int mask; + PyObject *func; + + if (!PyArg_ParseTuple(args, + "OiO:createfilehandler", + &file, &mask, &func)) + goto exit; + return_value = _tkinter_tkapp_createfilehandler_impl(self, file, mask, func); + +exit: + return return_value; +} + +#endif /* defined(HAVE_CREATEFILEHANDLER) */ + +#ifndef _TKINTER_TKAPP_CREATEFILEHANDLER_METHODDEF + #define _TKINTER_TKAPP_CREATEFILEHANDLER_METHODDEF +#endif /* !defined(_TKINTER_TKAPP_CREATEFILEHANDLER_METHODDEF) */ + +#if defined(HAVE_CREATEFILEHANDLER) + +PyDoc_STRVAR(_tkinter_tkapp_deletefilehandler__doc__, +"deletefilehandler($self, file, /)\n" +"--"); + +#define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF \ + {"deletefilehandler", (PyCFunction)_tkinter_tkapp_deletefilehandler, METH_O, _tkinter_tkapp_deletefilehandler__doc__}, + +#endif /* defined(HAVE_CREATEFILEHANDLER) */ + +#ifndef _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF + #define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF +#endif /* !defined(_TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF) */ + +PyDoc_STRVAR(_tkinter_tktimertoken_deletetimerhandler__doc__, +"deletetimerhandler($self, /)\n" +"--"); + +#define _TKINTER_TKTIMERTOKEN_DELETETIMERHANDLER_METHODDEF \ + {"deletetimerhandler", (PyCFunction)_tkinter_tktimertoken_deletetimerhandler, METH_NOARGS, _tkinter_tktimertoken_deletetimerhandler__doc__}, + +static PyObject * +_tkinter_tktimertoken_deletetimerhandler_impl(TkttObject *self); + +static PyObject * +_tkinter_tktimertoken_deletetimerhandler(TkttObject *self, PyObject *Py_UNUSED(ignored)) +{ + return _tkinter_tktimertoken_deletetimerhandler_impl(self); +} + +PyDoc_STRVAR(_tkinter_tkapp_createtimerhandler__doc__, +"createtimerhandler($self, milliseconds, func, /)\n" +"--"); + +#define _TKINTER_TKAPP_CREATETIMERHANDLER_METHODDEF \ + {"createtimerhandler", (PyCFunction)_tkinter_tkapp_createtimerhandler, METH_VARARGS, _tkinter_tkapp_createtimerhandler__doc__}, + +static PyObject * +_tkinter_tkapp_createtimerhandler_impl(TkappObject *self, int milliseconds, PyObject *func); + +static PyObject * +_tkinter_tkapp_createtimerhandler(TkappObject *self, PyObject *args) +{ + PyObject *return_value = NULL; + int milliseconds; + PyObject *func; + + if (!PyArg_ParseTuple(args, + "iO:createtimerhandler", + &milliseconds, &func)) + goto exit; + return_value = _tkinter_tkapp_createtimerhandler_impl(self, milliseconds, func); + +exit: + return return_value; +} + +PyDoc_STRVAR(_tkinter_tkapp_mainloop__doc__, +"mainloop($self, threshold=0, /)\n" +"--"); + +#define _TKINTER_TKAPP_MAINLOOP_METHODDEF \ + {"mainloop", (PyCFunction)_tkinter_tkapp_mainloop, METH_VARARGS, _tkinter_tkapp_mainloop__doc__}, + +static PyObject * +_tkinter_tkapp_mainloop_impl(TkappObject *self, int threshold); + +static PyObject * +_tkinter_tkapp_mainloop(TkappObject *self, PyObject *args) +{ + PyObject *return_value = NULL; + int threshold = 0; + + if (!PyArg_ParseTuple(args, + "|i:mainloop", + &threshold)) + goto exit; + return_value = _tkinter_tkapp_mainloop_impl(self, threshold); + +exit: + return return_value; +} + +PyDoc_STRVAR(_tkinter_tkapp_dooneevent__doc__, +"dooneevent($self, flags=0, /)\n" +"--"); + +#define _TKINTER_TKAPP_DOONEEVENT_METHODDEF \ + {"dooneevent", (PyCFunction)_tkinter_tkapp_dooneevent, METH_VARARGS, _tkinter_tkapp_dooneevent__doc__}, + +static PyObject * +_tkinter_tkapp_dooneevent_impl(TkappObject *self, int flags); + +static PyObject * +_tkinter_tkapp_dooneevent(TkappObject *self, PyObject *args) +{ + PyObject *return_value = NULL; + int flags = 0; + + if (!PyArg_ParseTuple(args, + "|i:dooneevent", + &flags)) + goto exit; + return_value = _tkinter_tkapp_dooneevent_impl(self, flags); + +exit: + return return_value; +} + +PyDoc_STRVAR(_tkinter_tkapp_quit__doc__, +"quit($self, /)\n" +"--"); + +#define _TKINTER_TKAPP_QUIT_METHODDEF \ + {"quit", (PyCFunction)_tkinter_tkapp_quit, METH_NOARGS, _tkinter_tkapp_quit__doc__}, + +static PyObject * +_tkinter_tkapp_quit_impl(TkappObject *self); + +static PyObject * +_tkinter_tkapp_quit(TkappObject *self, PyObject *Py_UNUSED(ignored)) +{ + return _tkinter_tkapp_quit_impl(self); +} + +PyDoc_STRVAR(_tkinter_tkapp_interpaddr__doc__, +"interpaddr($self, /)\n" +"--"); + +#define _TKINTER_TKAPP_INTERPADDR_METHODDEF \ + {"interpaddr", (PyCFunction)_tkinter_tkapp_interpaddr, METH_NOARGS, _tkinter_tkapp_interpaddr__doc__}, + +static PyObject * +_tkinter_tkapp_interpaddr_impl(TkappObject *self); + +static PyObject * +_tkinter_tkapp_interpaddr(TkappObject *self, PyObject *Py_UNUSED(ignored)) +{ + return _tkinter_tkapp_interpaddr_impl(self); +} + +PyDoc_STRVAR(_tkinter_tkapp_loadtk__doc__, +"loadtk($self, /)\n" +"--"); + +#define _TKINTER_TKAPP_LOADTK_METHODDEF \ + {"loadtk", (PyCFunction)_tkinter_tkapp_loadtk, METH_NOARGS, _tkinter_tkapp_loadtk__doc__}, + +static PyObject * +_tkinter_tkapp_loadtk_impl(TkappObject *self); + +static PyObject * +_tkinter_tkapp_loadtk(TkappObject *self, PyObject *Py_UNUSED(ignored)) +{ + return _tkinter_tkapp_loadtk_impl(self); +} + +PyDoc_STRVAR(_tkinter_tkapp_wantobjects__doc__, +"wantobjects([value])"); + +#define _TKINTER_TKAPP_WANTOBJECTS_METHODDEF \ + {"wantobjects", (PyCFunction)_tkinter_tkapp_wantobjects, METH_VARARGS, _tkinter_tkapp_wantobjects__doc__}, + +static PyObject * +_tkinter_tkapp_wantobjects_impl(TkappObject *self, int group_right_1, int value); + +static PyObject * +_tkinter_tkapp_wantobjects(TkappObject *self, PyObject *args) +{ + PyObject *return_value = NULL; + int group_right_1 = 0; + int value = 0; + + switch (PyTuple_GET_SIZE(args)) { + case 0: + break; + case 1: + if (!PyArg_ParseTuple(args, "i:wantobjects", &value)) + goto exit; + group_right_1 = 1; + break; + default: + PyErr_SetString(PyExc_TypeError, "_tkinter.tkapp.wantobjects requires 0 to 1 arguments"); + goto exit; + } + return_value = _tkinter_tkapp_wantobjects_impl(self, group_right_1, value); + +exit: + return return_value; +} + +PyDoc_STRVAR(_tkinter_tkapp_willdispatch__doc__, +"willdispatch($self, /)\n" +"--"); + +#define _TKINTER_TKAPP_WILLDISPATCH_METHODDEF \ + {"willdispatch", (PyCFunction)_tkinter_tkapp_willdispatch, METH_NOARGS, _tkinter_tkapp_willdispatch__doc__}, + +static PyObject * +_tkinter_tkapp_willdispatch_impl(TkappObject *self); + +static PyObject * +_tkinter_tkapp_willdispatch(TkappObject *self, PyObject *Py_UNUSED(ignored)) +{ + return _tkinter_tkapp_willdispatch_impl(self); +} + +PyDoc_STRVAR(_tkinter__flatten__doc__, +"_flatten($module, item, /)\n" +"--"); + +#define _TKINTER__FLATTEN_METHODDEF \ + {"_flatten", (PyCFunction)_tkinter__flatten, METH_O, _tkinter__flatten__doc__}, + +PyDoc_STRVAR(_tkinter_create__doc__, +"create($module, screenName=None, baseName=None, className=\'Tk\',\n" +" interactive=False, wantobjects=False, wantTk=True, sync=False,\n" +" use=None, /)\n" +"--\n" +"\n" +"\n" +"\n" +" wantTk\n" +" if false, then Tk_Init() doesn\'t get called\n" +" sync\n" +" if true, then pass -sync to wish\n" +" use\n" +" if not None, then pass -use to wish"); + +#define _TKINTER_CREATE_METHODDEF \ + {"create", (PyCFunction)_tkinter_create, METH_VARARGS, _tkinter_create__doc__}, + +static PyObject * +_tkinter_create_impl(PyModuleDef *module, const char *screenName, const char *baseName, const char *className, int interactive, int wantobjects, int wantTk, int sync, const char *use); + +static PyObject * +_tkinter_create(PyModuleDef *module, PyObject *args) +{ + PyObject *return_value = NULL; + const char *screenName = NULL; + const char *baseName = NULL; + const char *className = "Tk"; + int interactive = 0; + int wantobjects = 0; + int wantTk = 1; + int sync = 0; + const char *use = NULL; + + if (!PyArg_ParseTuple(args, + "|zssiiiiz:create", + &screenName, &baseName, &className, &interactive, &wantobjects, &wantTk, &sync, &use)) + goto exit; + return_value = _tkinter_create_impl(module, screenName, baseName, className, interactive, wantobjects, wantTk, sync, use); + +exit: + return return_value; +} + +PyDoc_STRVAR(_tkinter_setbusywaitinterval__doc__, +"setbusywaitinterval($module, new_val, /)\n" +"--\n" +"\n" +"Set the busy-wait interval in milliseconds between successive calls to Tcl_DoOneEvent in a threaded Python interpreter.\n" +"\n" +"It should be set to a divisor of the maximum time between frames in an animation."); + +#define _TKINTER_SETBUSYWAITINTERVAL_METHODDEF \ + {"setbusywaitinterval", (PyCFunction)_tkinter_setbusywaitinterval, METH_VARARGS, _tkinter_setbusywaitinterval__doc__}, + +static PyObject * +_tkinter_setbusywaitinterval_impl(PyModuleDef *module, int new_val); + +static PyObject * +_tkinter_setbusywaitinterval(PyModuleDef *module, PyObject *args) +{ + PyObject *return_value = NULL; + int new_val; + + if (!PyArg_ParseTuple(args, + "i:setbusywaitinterval", + &new_val)) + goto exit; + return_value = _tkinter_setbusywaitinterval_impl(module, new_val); + +exit: + return return_value; +} + +PyDoc_STRVAR(_tkinter_getbusywaitinterval__doc__, +"getbusywaitinterval($module, /)\n" +"--\n" +"\n" +"Return the current busy-wait interval between successive calls to Tcl_DoOneEvent in a threaded Python interpreter."); + +#define _TKINTER_GETBUSYWAITINTERVAL_METHODDEF \ + {"getbusywaitinterval", (PyCFunction)_tkinter_getbusywaitinterval, METH_NOARGS, _tkinter_getbusywaitinterval__doc__}, + +static int +_tkinter_getbusywaitinterval_impl(PyModuleDef *module); + +static PyObject * +_tkinter_getbusywaitinterval(PyModuleDef *module, PyObject *Py_UNUSED(ignored)) +{ + PyObject *return_value = NULL; + int _return_value; + + _return_value = _tkinter_getbusywaitinterval_impl(module); + if ((_return_value == -1) && PyErr_Occurred()) + goto exit; + return_value = PyLong_FromLong((long)_return_value); + +exit: + return return_value; +} +/*[clinic end generated code: output=238b3a3fa1620437 input=a9049054013a1b77]*/