diff --git a/src/App/Application.h b/src/App/Application.h index c6abbe0197..4996f03aa6 100644 --- a/src/App/Application.h +++ b/src/App/Application.h @@ -291,41 +291,37 @@ private: //--------------------------------------------------------------------- // static python wrapper of the exported functions - static PyObject* sGetParam (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sSaveParameter (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sGetVersion (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sGetConfig (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sSetConfig (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sDumpConfig (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sTemplateAdd (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sTemplateDelete (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sTemplateGet (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sAddImportType (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sGetImportType (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sAddExportType (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sGetExportType (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sGetResourceDir (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sGetUserAppDataDir (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sGetUserMacroDir (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sGetHelpDir (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sGetHomePath (PyObject *self,PyObject *args,PyObject *kwd); + static PyObject* sGetParam (PyObject *self,PyObject *args); + static PyObject* sSaveParameter (PyObject *self,PyObject *args); + static PyObject* sGetVersion (PyObject *self,PyObject *args); + static PyObject* sGetConfig (PyObject *self,PyObject *args); + static PyObject* sSetConfig (PyObject *self,PyObject *args); + static PyObject* sDumpConfig (PyObject *self,PyObject *args); + static PyObject* sAddImportType (PyObject *self,PyObject *args); + static PyObject* sGetImportType (PyObject *self,PyObject *args); + static PyObject* sAddExportType (PyObject *self,PyObject *args); + static PyObject* sGetExportType (PyObject *self,PyObject *args); + static PyObject* sGetResourceDir (PyObject *self,PyObject *args); + static PyObject* sGetUserAppDataDir (PyObject *self,PyObject *args); + static PyObject* sGetUserMacroDir (PyObject *self,PyObject *args); + static PyObject* sGetHelpDir (PyObject *self,PyObject *args); + static PyObject* sGetHomePath (PyObject *self,PyObject *args); - static PyObject* sLoadFile (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sOpenDocument (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sSaveDocument (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sSaveDocumentAs (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sNewDocument (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sCloseDocument (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sActiveDocument (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sSetActiveDocument (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sGetDocument (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sListDocuments (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sAddDocObserver (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sRemoveDocObserver (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject* sTranslateUnit (PyObject *self,PyObject *args,PyObject *kwd); + static PyObject* sLoadFile (PyObject *self,PyObject *args); + static PyObject* sOpenDocument (PyObject *self,PyObject *args); + static PyObject* sSaveDocument (PyObject *self,PyObject *args); + static PyObject* sSaveDocumentAs (PyObject *self,PyObject *args); + static PyObject* sNewDocument (PyObject *self,PyObject *args); + static PyObject* sCloseDocument (PyObject *self,PyObject *args); + static PyObject* sActiveDocument (PyObject *self,PyObject *args); + static PyObject* sSetActiveDocument (PyObject *self,PyObject *args); + static PyObject* sGetDocument (PyObject *self,PyObject *args); + static PyObject* sListDocuments (PyObject *self,PyObject *args); + static PyObject* sAddDocObserver (PyObject *self,PyObject *args); + static PyObject* sRemoveDocObserver (PyObject *self,PyObject *args); - static PyObject *sSetLogLevel (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sGetLogLevel (PyObject *self,PyObject *args,PyObject *kwd); + static PyObject *sSetLogLevel (PyObject *self,PyObject *args); + static PyObject *sGetLogLevel (PyObject *self,PyObject *args); static PyMethodDef Methods[]; diff --git a/src/App/ApplicationPy.cpp b/src/App/ApplicationPy.cpp index c9ed160039..4b70a5fcad 100644 --- a/src/App/ApplicationPy.cpp +++ b/src/App/ApplicationPy.cpp @@ -56,97 +56,97 @@ using namespace App; // Application Methods // Methods structure PyMethodDef Application::Methods[] = { - {"ParamGet", (PyCFunction) Application::sGetParam, 1, + {"ParamGet", (PyCFunction) Application::sGetParam, METH_VARARGS, "Get parameters by path"}, - {"saveParameter", (PyCFunction) Application::sSaveParameter, 1, + {"saveParameter", (PyCFunction) Application::sSaveParameter, METH_VARARGS, "saveParameter(config='User parameter') -> None\n" "Save parameter set to file. The default set is 'User parameter'"}, - {"Version", (PyCFunction) Application::sGetVersion, 1, + {"Version", (PyCFunction) Application::sGetVersion, METH_VARARGS, "Print the version to the output."}, - {"ConfigGet", (PyCFunction) Application::sGetConfig, 1, + {"ConfigGet", (PyCFunction) Application::sGetConfig, METH_VARARGS, "ConfigGet(string) -- Get the value for the given key."}, - {"ConfigSet", (PyCFunction) Application::sSetConfig, 1, + {"ConfigSet", (PyCFunction) Application::sSetConfig, METH_VARARGS, "ConfigSet(string, string) -- Set the given key to the given value."}, - {"ConfigDump", (PyCFunction) Application::sDumpConfig, 1, + {"ConfigDump", (PyCFunction) Application::sDumpConfig, METH_VARARGS, "Dump the configuration to the output."}, - {"addImportType", (PyCFunction) Application::sAddImportType, 1, + {"addImportType", (PyCFunction) Application::sAddImportType, METH_VARARGS, "Register filetype for import"}, - {"getImportType", (PyCFunction) Application::sGetImportType, 1, + {"getImportType", (PyCFunction) Application::sGetImportType, METH_VARARGS, "Get the name of the module that can import the filetype"}, - {"EndingAdd", (PyCFunction) Application::sAddImportType ,1, // deprecated + {"EndingAdd", (PyCFunction) Application::sAddImportType, METH_VARARGS, // deprecated "deprecated -- use addImportType"}, - {"EndingGet", (PyCFunction) Application::sGetImportType ,1, // deprecated + {"EndingGet", (PyCFunction) Application::sGetImportType, METH_VARARGS, // deprecated "deprecated -- use getImportType"}, - {"addExportType", (PyCFunction) Application::sAddExportType ,1, + {"addExportType", (PyCFunction) Application::sAddExportType, METH_VARARGS, "Register filetype for export"}, - {"getExportType", (PyCFunction) Application::sGetExportType ,1, + {"getExportType", (PyCFunction) Application::sGetExportType, METH_VARARGS, "Get the name of the module that can export the filetype"}, - {"getResourceDir", (PyCFunction) Application::sGetResourceDir ,1, + {"getResourceDir", (PyCFunction) Application::sGetResourceDir, METH_VARARGS, "Get the root directory of all resources"}, - {"getUserAppDataDir", (PyCFunction) Application::sGetUserAppDataDir ,1, + {"getUserAppDataDir", (PyCFunction) Application::sGetUserAppDataDir, METH_VARARGS, "Get the root directory of user settings"}, - {"getUserMacroDir", (PyCFunction) Application::sGetUserMacroDir ,1, + {"getUserMacroDir", (PyCFunction) Application::sGetUserMacroDir, METH_VARARGS, "Get the directory of the user's macro directory"}, - {"getHelpDir", (PyCFunction) Application::sGetHelpDir ,1, + {"getHelpDir", (PyCFunction) Application::sGetHelpDir, METH_VARARGS, "Get the directory of the documentation"}, - {"getHomePath", (PyCFunction) Application::sGetHomePath ,1, + {"getHomePath", (PyCFunction) Application::sGetHomePath, METH_VARARGS, "Get the home path, i.e. the parent directory of the executable"}, - {"loadFile", (PyCFunction) Application::sLoadFile, 1, + {"loadFile", (PyCFunction) Application::sLoadFile, METH_VARARGS, "loadFile(string=filename,[string=module]) -> None\n\n" "Loads an arbitrary file by delegating to the given Python module:\n" "* If no module is given it will be determined by the file extension.\n" "* If more than one module can load a file the first one one will be taken.\n" "* If no module exists to load the file an exception will be raised."}, - {"open", (PyCFunction) Application::sOpenDocument, 1, + {"open", (PyCFunction) Application::sOpenDocument, METH_VARARGS, "See openDocument(string)"}, - {"openDocument", (PyCFunction) Application::sOpenDocument, 1, + {"openDocument", (PyCFunction) Application::sOpenDocument, METH_VARARGS, "openDocument(string) -> object\n\n" "Create a document and load the project file into the document.\n" "The string argument must point to an existing file. If the file doesn't exist\n" "or the file cannot be loaded an I/O exception is thrown. In this case the\n" "document is kept alive."}, -// {"saveDocument", (PyCFunction) Application::sSaveDocument, 1, +// {"saveDocument", (PyCFunction) Application::sSaveDocument, METH_VARARGS, // "saveDocument(string) -- Save the document to a file."}, -// {"saveDocumentAs", (PyCFunction) Application::sSaveDocumentAs, 1}, - {"newDocument", (PyCFunction) Application::sNewDocument, 1, +// {"saveDocumentAs", (PyCFunction) Application::sSaveDocumentAs, METH_VARARGS}, + {"newDocument", (PyCFunction) Application::sNewDocument, METH_VARARGS, "newDocument([string]) -> object\n\n" "Create a new document with a given name.\n" "The document name must be unique which\n" "is checked automatically."}, - {"closeDocument", (PyCFunction) Application::sCloseDocument, 1, + {"closeDocument", (PyCFunction) Application::sCloseDocument, METH_VARARGS, "closeDocument(string) -> None\n\n" "Close the document with a given name."}, - {"activeDocument", (PyCFunction) Application::sActiveDocument, 1, + {"activeDocument", (PyCFunction) Application::sActiveDocument, METH_VARARGS, "activeDocument() -> object or None\n\n" "Return the active document or None if there is no one."}, - {"setActiveDocument",(PyCFunction) Application::sSetActiveDocument, 1, + {"setActiveDocument",(PyCFunction) Application::sSetActiveDocument, METH_VARARGS, "setActiveDocement(string) -> None\n\n" "Set the active document by its name."}, - {"getDocument", (PyCFunction) Application::sGetDocument, 1, + {"getDocument", (PyCFunction) Application::sGetDocument, METH_VARARGS, "getDocument(string) -> object\n\n" "Get a document by its name or raise an exception\n" "if there is no document with the given name."}, - {"listDocuments", (PyCFunction) Application::sListDocuments ,1, + {"listDocuments", (PyCFunction) Application::sListDocuments, METH_VARARGS, "listDocuments() -> list\n\n" "Return a list of names of all documents."}, - {"addDocumentObserver", (PyCFunction) Application::sAddDocObserver ,1, + {"addDocumentObserver", (PyCFunction) Application::sAddDocObserver, METH_VARARGS, "addDocumentObserver() -> None\n\n" "Add an observer to get notified about changes on documents."}, - {"removeDocumentObserver", (PyCFunction) Application::sRemoveDocObserver ,1, + {"removeDocumentObserver", (PyCFunction) Application::sRemoveDocObserver, METH_VARARGS, "removeDocumentObserver() -> None\n\n" "Remove an added document observer."}, - {"setLogLevel", (PyCFunction) Application::sSetLogLevel, 1, + {"setLogLevel", (PyCFunction) Application::sSetLogLevel, METH_VARARGS, "setLogLevel(tag, level) -- Set the log level for a string tag.\n" "'level' can either be string 'Log', 'Msg', 'Wrn', 'Error', or an integer value"}, - {"getLogLevel", (PyCFunction) Application::sGetLogLevel, 1, + {"getLogLevel", (PyCFunction) Application::sGetLogLevel, METH_VARARGS, "getLogLevel(tag) -- Get the log level of a string tag"}, {NULL, NULL, 0, NULL} /* Sentinel */ }; -PyObject* Application::sLoadFile(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sLoadFile(PyObject * /*self*/, PyObject *args) { char *path, *doc="",*mod=""; if (!PyArg_ParseTuple(args, "s|ss", &path, &doc, &mod)) // convert args: Python->C @@ -191,7 +191,7 @@ PyObject* Application::sLoadFile(PyObject * /*self*/, PyObject *args,PyObject * } } -PyObject* Application::sOpenDocument(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sOpenDocument(PyObject * /*self*/, PyObject *args) { char* Name; if (!PyArg_ParseTuple(args, "et","utf-8",&Name)) @@ -213,7 +213,7 @@ PyObject* Application::sOpenDocument(PyObject * /*self*/, PyObject *args,PyObjec } } -PyObject* Application::sNewDocument(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sNewDocument(PyObject * /*self*/, PyObject *args) { char *docName = 0; char *usrName = 0; @@ -228,7 +228,7 @@ PyObject* Application::sNewDocument(PyObject * /*self*/, PyObject *args,PyObject }PY_CATCH; } -PyObject* Application::sSetActiveDocument(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sSetActiveDocument(PyObject * /*self*/, PyObject *args) { char *pstr = 0; if (!PyArg_ParseTuple(args, "s", &pstr)) // convert args: Python->C @@ -245,7 +245,7 @@ PyObject* Application::sSetActiveDocument(PyObject * /*self*/, PyObject *args,Py Py_Return; } -PyObject* Application::sCloseDocument(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sCloseDocument(PyObject * /*self*/, PyObject *args) { char *pstr = 0; if (!PyArg_ParseTuple(args, "s", &pstr)) // convert args: Python->C @@ -269,7 +269,7 @@ PyObject* Application::sCloseDocument(PyObject * /*self*/, PyObject *args,PyObje Py_Return; } -PyObject* Application::sSaveDocument(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sSaveDocument(PyObject * /*self*/, PyObject *args) { char *pDoc; if (!PyArg_ParseTuple(args, "s", &pDoc)) // convert args: Python->C @@ -290,7 +290,7 @@ PyObject* Application::sSaveDocument(PyObject * /*self*/, PyObject *args,PyObjec Py_Return; } #if 0 -PyObject* Application::sSaveDocumentAs(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sSaveDocumentAs(PyObject * /*self*/, PyObject *args) { char *pDoc, *pFileName; if (!PyArg_ParseTuple(args, "ss", &pDoc, &pFileName)) // convert args: Python->C @@ -308,7 +308,7 @@ PyObject* Application::sSaveDocumentAs(PyObject * /*self*/, PyObject *args,PyObj Py_Return; } #endif -PyObject* Application::sActiveDocument(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sActiveDocument(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) // convert args: Python->C return NULL; // NULL triggers exception @@ -323,7 +323,7 @@ PyObject* Application::sActiveDocument(PyObject * /*self*/, PyObject *args,PyObj } } -PyObject* Application::sGetDocument(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sGetDocument(PyObject * /*self*/, PyObject *args) { char *pstr=0; if (!PyArg_ParseTuple(args, "s", &pstr)) // convert args: Python->C @@ -338,7 +338,7 @@ PyObject* Application::sGetDocument(PyObject * /*self*/, PyObject *args,PyObject return doc->getPyObject(); } -PyObject* Application::sGetParam(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sGetParam(PyObject * /*self*/, PyObject *args) { char *pstr=0; if (!PyArg_ParseTuple(args, "s", &pstr)) // convert args: Python->C @@ -349,7 +349,7 @@ PyObject* Application::sGetParam(PyObject * /*self*/, PyObject *args,PyObject * }PY_CATCH; } -PyObject* Application::sSaveParameter(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sSaveParameter(PyObject * /*self*/, PyObject *args) { char *pstr = "User parameter"; if (!PyArg_ParseTuple(args, "|s", &pstr)) @@ -377,7 +377,7 @@ PyObject* Application::sSaveParameter(PyObject * /*self*/, PyObject *args,PyObje } -PyObject* Application::sGetConfig(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sGetConfig(PyObject * /*self*/, PyObject *args) { char *pstr; @@ -399,7 +399,7 @@ PyObject* Application::sGetConfig(PyObject * /*self*/, PyObject *args,PyObject * } } -PyObject* Application::sDumpConfig(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sDumpConfig(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "") ) // convert args: Python->C return NULL; // NULL triggers exception @@ -416,7 +416,7 @@ PyObject* Application::sDumpConfig(PyObject * /*self*/, PyObject *args,PyObject return dict; } -PyObject* Application::sSetConfig(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sSetConfig(PyObject * /*self*/, PyObject *args) { char *pstr,*pstr2; @@ -429,7 +429,7 @@ PyObject* Application::sSetConfig(PyObject * /*self*/, PyObject *args,PyObject * return Py_None; } -PyObject* Application::sGetVersion(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sGetVersion(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) // convert args: Python->C return NULL; // NULL triggers exception @@ -464,7 +464,7 @@ PyObject* Application::sGetVersion(PyObject * /*self*/, PyObject *args,PyObject return Py::new_reference_to(list); } -PyObject* Application::sAddImportType(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sAddImportType(PyObject * /*self*/, PyObject *args) { char *psKey,*psMod; @@ -476,7 +476,7 @@ PyObject* Application::sAddImportType(PyObject * /*self*/, PyObject *args,PyObje Py_Return; } -PyObject* Application::sGetImportType(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sGetImportType(PyObject * /*self*/, PyObject *args) { char* psKey=0; @@ -516,7 +516,7 @@ PyObject* Application::sGetImportType(PyObject * /*self*/, PyObject *args,PyObje } } -PyObject* Application::sAddExportType(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sAddExportType(PyObject * /*self*/, PyObject *args) { char *psKey,*psMod; @@ -528,7 +528,7 @@ PyObject* Application::sAddExportType(PyObject * /*self*/, PyObject *args,PyObje Py_Return; } -PyObject* Application::sGetExportType(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sGetExportType(PyObject * /*self*/, PyObject *args) { char* psKey=0; @@ -568,7 +568,7 @@ PyObject* Application::sGetExportType(PyObject * /*self*/, PyObject *args,PyObje } } -PyObject* Application::sGetResourceDir(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sGetResourceDir(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) // convert args: Python->C return NULL; // NULL triggers exception @@ -577,7 +577,7 @@ PyObject* Application::sGetResourceDir(PyObject * /*self*/, PyObject *args,PyObj return Py::new_reference_to(datadir); } -PyObject* Application::sGetUserAppDataDir(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sGetUserAppDataDir(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) // convert args: Python->C return NULL; // NULL triggers exception @@ -586,7 +586,7 @@ PyObject* Application::sGetUserAppDataDir(PyObject * /*self*/, PyObject *args,Py return Py::new_reference_to(user_data_dir); } -PyObject* Application::sGetUserMacroDir(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sGetUserMacroDir(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) // convert args: Python->C return NULL; // NULL triggers exception @@ -595,7 +595,7 @@ PyObject* Application::sGetUserMacroDir(PyObject * /*self*/, PyObject *args,PyOb return Py::new_reference_to(user_macro_dir); } -PyObject* Application::sGetHelpDir(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sGetHelpDir(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) // convert args: Python->C return NULL; // NULL triggers exception @@ -604,7 +604,7 @@ PyObject* Application::sGetHelpDir(PyObject * /*self*/, PyObject *args,PyObject return Py::new_reference_to(user_macro_dir); } -PyObject* Application::sGetHomePath(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sGetHomePath(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) // convert args: Python->C return NULL; // NULL triggers exception @@ -613,7 +613,7 @@ PyObject* Application::sGetHomePath(PyObject * /*self*/, PyObject *args,PyObject return Py::new_reference_to(homedir); } -PyObject* Application::sListDocuments(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sListDocuments(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) // convert args: Python->C return NULL; // NULL triggers exception @@ -640,7 +640,7 @@ PyObject* Application::sListDocuments(PyObject * /*self*/, PyObject *args,PyObje } PY_CATCH; } -PyObject* Application::sAddDocObserver(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sAddDocObserver(PyObject * /*self*/, PyObject *args) { PyObject* o; if (!PyArg_ParseTuple(args, "O",&o)) @@ -651,7 +651,7 @@ PyObject* Application::sAddDocObserver(PyObject * /*self*/, PyObject *args,PyObj } PY_CATCH; } -PyObject* Application::sRemoveDocObserver(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sRemoveDocObserver(PyObject * /*self*/, PyObject *args) { PyObject* o; if (!PyArg_ParseTuple(args, "O",&o)) @@ -662,7 +662,7 @@ PyObject* Application::sRemoveDocObserver(PyObject * /*self*/, PyObject *args,Py } PY_CATCH; } -PyObject *Application::sSetLogLevel(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *Application::sSetLogLevel(PyObject * /*self*/, PyObject *args) { char *tag; PyObject *pcObj; @@ -712,7 +712,7 @@ PyObject *Application::sSetLogLevel(PyObject * /*self*/, PyObject *args, PyObjec }PY_CATCH; } -PyObject *Application::sGetLogLevel(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *Application::sGetLogLevel(PyObject * /*self*/, PyObject *args) { char *tag; if (!PyArg_ParseTuple(args, "s", &tag)) diff --git a/src/Base/Console.cpp b/src/Base/Console.cpp index b36898f362..720b30e7b9 100644 --- a/src/Base/Console.cpp +++ b/src/Base/Console.cpp @@ -499,23 +499,23 @@ ConsoleSingleton & ConsoleSingleton::Instance(void) // ConsoleSingleton Methods // Methods structure PyMethodDef ConsoleSingleton::Methods[] = { - {"PrintMessage", (PyCFunction) ConsoleSingleton::sPyMessage, 1, + {"PrintMessage", (PyCFunction) ConsoleSingleton::sPyMessage, METH_VARARGS, "PrintMessage(string) -- Print a message to the output"}, - {"PrintLog", (PyCFunction) ConsoleSingleton::sPyLog, 1, + {"PrintLog", (PyCFunction) ConsoleSingleton::sPyLog, METH_VARARGS, "PrintLog(string) -- Print a log message to the output"}, - {"PrintError" , (PyCFunction) ConsoleSingleton::sPyError, 1, + {"PrintError" , (PyCFunction) ConsoleSingleton::sPyError, METH_VARARGS, "PrintError(string) -- Print an error message to the output"}, - {"PrintWarning", (PyCFunction) ConsoleSingleton::sPyWarning, 1, + {"PrintWarning", (PyCFunction) ConsoleSingleton::sPyWarning, METH_VARARGS, "PrintWarning -- Print a warning to the output"}, - {"SetStatus", (PyCFunction) ConsoleSingleton::sPySetStatus, 1, + {"SetStatus", (PyCFunction) ConsoleSingleton::sPySetStatus, METH_VARARGS, "Set the status for either Log, Msg, Wrn or Error for an observer"}, - {"GetStatus", (PyCFunction) ConsoleSingleton::sPyGetStatus, 1, + {"GetStatus", (PyCFunction) ConsoleSingleton::sPyGetStatus, METH_VARARGS, "Get the status for either Log, Msg, Wrn or Error for an observer"}, {NULL, NULL, 0, NULL} /* Sentinel */ }; -PyObject *ConsoleSingleton::sPyMessage(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *ConsoleSingleton::sPyMessage(PyObject * /*self*/, PyObject *args) { PyObject *output; if (!PyArg_ParseTuple(args, "O", &output)) @@ -561,7 +561,7 @@ PyObject *ConsoleSingleton::sPyMessage(PyObject * /*self*/, PyObject *args, PyOb return Py_None; } -PyObject *ConsoleSingleton::sPyWarning(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *ConsoleSingleton::sPyWarning(PyObject * /*self*/, PyObject *args) { PyObject *output; if (!PyArg_ParseTuple(args, "O", &output)) @@ -607,7 +607,7 @@ PyObject *ConsoleSingleton::sPyWarning(PyObject * /*self*/, PyObject *args, PyOb return Py_None; } -PyObject *ConsoleSingleton::sPyError(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *ConsoleSingleton::sPyError(PyObject * /*self*/, PyObject *args) { PyObject *output; if (!PyArg_ParseTuple(args, "O", &output)) @@ -653,7 +653,7 @@ PyObject *ConsoleSingleton::sPyError(PyObject * /*self*/, PyObject *args, PyObje return Py_None; } -PyObject *ConsoleSingleton::sPyLog(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *ConsoleSingleton::sPyLog(PyObject * /*self*/, PyObject *args) { PyObject *output; if (!PyArg_ParseTuple(args, "O", &output)) @@ -699,7 +699,7 @@ PyObject *ConsoleSingleton::sPyLog(PyObject * /*self*/, PyObject *args, PyObject return Py_None; } -PyObject *ConsoleSingleton::sPyGetStatus(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *ConsoleSingleton::sPyGetStatus(PyObject * /*self*/, PyObject *args) { char *pstr1; char *pstr2; @@ -728,7 +728,7 @@ PyObject *ConsoleSingleton::sPyGetStatus(PyObject * /*self*/, PyObject *args, Py }PY_CATCH; } -PyObject *ConsoleSingleton::sPySetStatus(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *ConsoleSingleton::sPySetStatus(PyObject * /*self*/, PyObject *args) { char *pstr1; char *pstr2; diff --git a/src/Base/Console.h b/src/Base/Console.h index a6b5969cd5..9c290b0f1e 100644 --- a/src/Base/Console.h +++ b/src/Base/Console.h @@ -562,12 +562,12 @@ public: protected: // python exports goes here +++++++++++++++++++++++++++++++++++++++++++ // static python wrapper of the exported functions - static PyObject *sPyLog (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sPyMessage (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sPyWarning (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sPyError (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sPySetStatus(PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sPyGetStatus(PyObject *self,PyObject *args,PyObject *kwd); + static PyObject *sPyLog (PyObject *self,PyObject *args); + static PyObject *sPyMessage (PyObject *self,PyObject *args); + static PyObject *sPyWarning (PyObject *self,PyObject *args); + static PyObject *sPyError (PyObject *self,PyObject *args); + static PyObject *sPySetStatus(PyObject *self,PyObject *args); + static PyObject *sPyGetStatus(PyObject *self,PyObject *args); bool _bVerbose; bool _bCanRefresh; diff --git a/src/Base/UnitsApi.h b/src/Base/UnitsApi.h index ff89d49630..0a4ac4eb1d 100644 --- a/src/Base/UnitsApi.h +++ b/src/Base/UnitsApi.h @@ -100,12 +100,12 @@ protected: //static double parse(const char*,bool &UsedUnit); protected: // the python API wrapper methods - //static PyObject *sTranslateUnit (PyObject *self,PyObject *args,PyObject *kwd); - //static PyObject *sGetWithPrefs (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sParseQuantity (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sListSchemas (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sGetSchema (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sSchemaTranslate (PyObject *self,PyObject *args,PyObject *kwd); + //static PyObject *sTranslateUnit (PyObject *self,PyObject *args); + //static PyObject *sGetWithPrefs (PyObject *self,PyObject *args); + static PyObject *sParseQuantity (PyObject *self,PyObject *args); + static PyObject *sListSchemas (PyObject *self,PyObject *args); + static PyObject *sGetSchema (PyObject *self,PyObject *args); + static PyObject *sSchemaTranslate (PyObject *self,PyObject *args); }; } // namespace Base diff --git a/src/Base/UnitsApiPy.cpp b/src/Base/UnitsApiPy.cpp index a0659efba4..feddc6bb39 100644 --- a/src/Base/UnitsApiPy.cpp +++ b/src/Base/UnitsApiPy.cpp @@ -43,7 +43,7 @@ using namespace Base; // UnitsApi Methods // Methods structure PyMethodDef UnitsApi::Methods[] = { - //{"translateUnit", (PyCFunction) UnitsApi::sTranslateUnit ,1, + //{"translateUnit", (PyCFunction) UnitsApi::sTranslateUnit, METH_VARARGS, // "translateUnit(string) -> double\n\n" // "calculate a mathematical expression with units to a number. \n" // "can be used for simple unit translation like: \n" @@ -51,7 +51,7 @@ PyMethodDef UnitsApi::Methods[] = { // " or for more complex espressions:\n" // " translateUnit('sin(pi)/50.0 m/s^2')\n" //}, - //{"getWithPrefs", (PyCFunction) UnitsApi::sGetWithPrefs ,1, + //{"getWithPrefs", (PyCFunction) UnitsApi::sGetWithPrefs, METH_VARARGS, // "getWithPrefs(type,[string|float|int]) -> double\n\n" // "Translation to internal regarding user prefs \n" // " That means if no unit is issued the user prefs are in \n" @@ -68,7 +68,7 @@ PyMethodDef UnitsApi::Methods[] = { // " Temperature \n" //}, - {"parseQuantity", (PyCFunction) UnitsApi::sParseQuantity ,1, + {"parseQuantity", (PyCFunction) UnitsApi::sParseQuantity, METH_VARARGS, "parseQuantity(string) -> Base.Quantity()\n\n" "calculate a mathematical expression with units to a quantity object. \n" "can be used for simple unit translation like: \n" @@ -76,15 +76,15 @@ PyMethodDef UnitsApi::Methods[] = { "or for more complex espressions:\n" "parseQuantity('sin(pi)/50.0 m/s^2')\n" }, - {"listSchemas", (PyCFunction) UnitsApi::sListSchemas ,1, + {"listSchemas", (PyCFunction) UnitsApi::sListSchemas, METH_VARARGS, "listSchemas() -> a tuple of schemas\n\n" "listSchemas(int) -> description of the given schema\n\n" }, - {"getSchema", (PyCFunction) UnitsApi::sGetSchema ,1, + {"getSchema", (PyCFunction) UnitsApi::sGetSchema, METH_VARARGS, "getSchema() -> int\n\n" "The int is the position of the tuple returned by listSchemas" }, - {"schemaTranslate", (PyCFunction) UnitsApi::sSchemaTranslate ,1, + {"schemaTranslate", (PyCFunction) UnitsApi::sSchemaTranslate, METH_VARARGS, "schemaTranslate(Quantity, int) -> tuple\n\n" "Translate a quantity to a given schema" }, @@ -92,7 +92,7 @@ PyMethodDef UnitsApi::Methods[] = { {NULL, NULL, 0, NULL} /* Sentinel */ }; -//PyObject* UnitsApi::sTranslateUnit(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +//PyObject* UnitsApi::sTranslateUnit(PyObject * /*self*/, PyObject *args) //{ // char *pstr; // if (!PyArg_ParseTuple(args, "s", &pstr)) // convert args: Python->C @@ -110,7 +110,7 @@ PyMethodDef UnitsApi::Methods[] = { // } //} // -//PyObject* UnitsApi::sGetWithPrefs(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +//PyObject* UnitsApi::sGetWithPrefs(PyObject * /*self*/, PyObject *args) //{ // char *type; // PyObject *obj; @@ -138,7 +138,7 @@ PyMethodDef UnitsApi::Methods[] = { // } //} -PyObject* UnitsApi::sParseQuantity(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* UnitsApi::sParseQuantity(PyObject * /*self*/, PyObject *args) { char *pstr; if (!PyArg_ParseTuple(args, "et", "utf-8", &pstr)) // convert args: Python->C @@ -162,7 +162,7 @@ PyObject* UnitsApi::sParseQuantity(PyObject * /*self*/, PyObject *args,PyObject return new QuantityPy(new Quantity(rtn)); } -PyObject* UnitsApi::sListSchemas(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* UnitsApi::sListSchemas(PyObject * /*self*/, PyObject *args) { if (PyArg_ParseTuple(args, "")) { int num = NumUnitSystemTypes; @@ -190,7 +190,7 @@ PyObject* UnitsApi::sListSchemas(PyObject * /*self*/, PyObject *args,PyObject * return 0; } -PyObject* UnitsApi::sGetSchema(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* UnitsApi::sGetSchema(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) return NULL; @@ -198,7 +198,7 @@ PyObject* UnitsApi::sGetSchema(PyObject * /*self*/, PyObject *args,PyObject * /* return Py_BuildValue("i", static_cast(actSystem)); } -PyObject* UnitsApi::sSchemaTranslate(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* UnitsApi::sSchemaTranslate(PyObject * /*self*/, PyObject *args) { PyObject* q; int index; diff --git a/src/Gui/Application.h b/src/Gui/Application.h index ce0b086be1..dd7ec21293 100644 --- a/src/Gui/Application.h +++ b/src/Gui/Application.h @@ -147,9 +147,9 @@ public: * If no such document exists 0 is returned. */ Gui::Document* getDocument(const App::Document* pDoc) const; - /// Getter for the active view of the active document or null - Gui::MDIView* activeView(void) const; - /// Shows the associated view provider of the given object + /// Getter for the active view of the active document or null + Gui::MDIView* activeView(void) const; + /// Shows the associated view provider of the given object void showViewProvider(const App::DocumentObject*); /// Hides the associated view provider of the given object void hideViewProvider(const App::DocumentObject*); @@ -197,56 +197,55 @@ public: // python exports goes here +++++++++++++++++++++++++++++++++++++++++++ //--------------------------------------------------------------------- // static python wrapper of the exported functions - PYFUNCDEF_S(sActivateWorkbenchHandler); // activates a workbench object - PYFUNCDEF_S(sAddWorkbenchHandler); // adds a new workbench handler to a list - PYFUNCDEF_S(sRemoveWorkbenchHandler); // removes a workbench handler from the list - PYFUNCDEF_S(sGetWorkbenchHandler); // retrieves the workbench handler - PYFUNCDEF_S(sListWorkbenchHandlers); // retrieves a list of all workbench handlers - PYFUNCDEF_S(sActiveWorkbenchHandler); // retrieves the active workbench object - PYFUNCDEF_S(sAddResPath); // adds a path where to find resources - PYFUNCDEF_S(sAddLangPath); // adds a path to a qm file - PYFUNCDEF_S(sAddIconPath); // adds a path to an icon file - PYFUNCDEF_S(sAddIcon); // adds an icon to the cache + static PyObject* sActivateWorkbenchHandler (PyObject *self,PyObject *args); // activates a workbench object + static PyObject* sAddWorkbenchHandler (PyObject *self,PyObject *args); // adds a new workbench handler to a list + static PyObject* sRemoveWorkbenchHandler (PyObject *self,PyObject *args); // removes a workbench handler from the list + static PyObject* sGetWorkbenchHandler (PyObject *self,PyObject *args); // retrieves the workbench handler + static PyObject* sListWorkbenchHandlers (PyObject *self,PyObject *args); // retrieves a list of all workbench handlers + static PyObject* sActiveWorkbenchHandler (PyObject *self,PyObject *args); // retrieves the active workbench object + static PyObject* sAddResPath (PyObject *self,PyObject *args); // adds a path where to find resources + static PyObject* sAddLangPath (PyObject *self,PyObject *args); // adds a path to a qm file + static PyObject* sAddIconPath (PyObject *self,PyObject *args); // adds a path to an icon file + static PyObject* sAddIcon (PyObject *self,PyObject *args); // adds an icon to the cache - PYFUNCDEF_S(sSendActiveView); + static PyObject* sSendActiveView (PyObject *self,PyObject *args); - PYFUNCDEF_S(sGetMainWindow); - PYFUNCDEF_S(sUpdateGui); - PYFUNCDEF_S(sUpdateLocale); - PYFUNCDEF_S(sGetLocale); - PYFUNCDEF_S(sSetLocale); - PYFUNCDEF_S(sSupportedLocales); - PYFUNCDEF_S(sCreateDialog); - PYFUNCDEF_S(sAddPreferencePage); + static PyObject* sGetMainWindow (PyObject *self,PyObject *args); + static PyObject* sUpdateGui (PyObject *self,PyObject *args); + static PyObject* sUpdateLocale (PyObject *self,PyObject *args); + static PyObject* sGetLocale (PyObject *self,PyObject *args); + static PyObject* sSetLocale (PyObject *self,PyObject *args); + static PyObject* sSupportedLocales (PyObject *self,PyObject *args); + static PyObject* sCreateDialog (PyObject *self,PyObject *args); + static PyObject* sAddPreferencePage (PyObject *self,PyObject *args); - PYFUNCDEF_S(sRunCommand); - PYFUNCDEF_S(sAddCommand); - PYFUNCDEF_S(sListCommands); + static PyObject* sRunCommand (PyObject *self,PyObject *args); + static PyObject* sAddCommand (PyObject *self,PyObject *args); + static PyObject* sListCommands (PyObject *self,PyObject *args); - PYFUNCDEF_S(sHide); // deprecated - PYFUNCDEF_S(sShow); // deprecated - PYFUNCDEF_S(sHideObject); // hide view provider object - PYFUNCDEF_S(sShowObject); // show view provider object + static PyObject* sHide (PyObject *self,PyObject *args); // deprecated + static PyObject* sShow (PyObject *self,PyObject *args); // deprecated + static PyObject* sHideObject (PyObject *self,PyObject *args); // hide view provider object + static PyObject* sShowObject (PyObject *self,PyObject *args); // hide view provider object - PYFUNCDEF_S(sOpen); // open Python scripts - PYFUNCDEF_S(sInsert); // open Python scripts - PYFUNCDEF_S(sExport); + static PyObject* sOpen (PyObject *self,PyObject *args); // open Python scripts + static PyObject* sInsert (PyObject *self,PyObject *args); // open Python scripts + static PyObject* sExport (PyObject *self,PyObject *args); - PYFUNCDEF_S(sActiveDocument); - PYFUNCDEF_S(sSetActiveDocument); - PYFUNCDEF_S(sActiveView); - PYFUNCDEF_S(sGetDocument); + static PyObject* sActiveDocument (PyObject *self,PyObject *args); + static PyObject* sSetActiveDocument (PyObject *self,PyObject *args); + static PyObject* sActiveView (PyObject *self,PyObject *args); + static PyObject* sGetDocument (PyObject *self,PyObject *args); - PYFUNCDEF_S(sDoCommand); - PYFUNCDEF_S(sDoCommandGui); - PYFUNCDEF_S(sAddModule); + static PyObject* sDoCommand (PyObject *self,PyObject *args); + static PyObject* sDoCommandGui (PyObject *self,PyObject *args); + static PyObject* sAddModule (PyObject *self,PyObject *args); - PYFUNCDEF_S(sShowDownloads); - PYFUNCDEF_S(sShowPreferences); + static PyObject* sShowDownloads (PyObject *self,PyObject *args); + static PyObject* sShowPreferences (PyObject *self,PyObject *args); - PYFUNCDEF_S(sCreateViewer); - - PYFUNCDEF_S(sGetMarkerIndex); + static PyObject* sCreateViewer (PyObject *self,PyObject *args); + static PyObject* sGetMarkerIndex (PyObject *self,PyObject *args); static PyMethodDef Methods[]; diff --git a/src/Gui/ApplicationPy.cpp b/src/Gui/ApplicationPy.cpp index 5a1dff2593..4efeb89cb8 100644 --- a/src/Gui/ApplicationPy.cpp +++ b/src/Gui/ApplicationPy.cpp @@ -69,127 +69,127 @@ using namespace Gui; // FCApplication Methods // Methods structure PyMethodDef Application::Methods[] = { - {"activateWorkbench",(PyCFunction) Application::sActivateWorkbenchHandler,1, + {"activateWorkbench",(PyCFunction) Application::sActivateWorkbenchHandler, METH_VARARGS, "activateWorkbench(string) -> None\n\n" "Activate the workbench by name"}, - {"addWorkbench", (PyCFunction) Application::sAddWorkbenchHandler, 1, + {"addWorkbench", (PyCFunction) Application::sAddWorkbenchHandler, METH_VARARGS, "addWorkbench(string, object) -> None\n\n" "Add a workbench under a defined name."}, - {"removeWorkbench", (PyCFunction) Application::sRemoveWorkbenchHandler, 1, + {"removeWorkbench", (PyCFunction) Application::sRemoveWorkbenchHandler, METH_VARARGS, "removeWorkbench(string) -> None\n\n" "Remove the workbench with name"}, - {"getWorkbench", (PyCFunction) Application::sGetWorkbenchHandler, 1, + {"getWorkbench", (PyCFunction) Application::sGetWorkbenchHandler, METH_VARARGS, "getWorkbench(string) -> object\n\n" "Get the workbench by its name"}, - {"listWorkbenches", (PyCFunction) Application::sListWorkbenchHandlers, 1, + {"listWorkbenches", (PyCFunction) Application::sListWorkbenchHandlers, METH_VARARGS, "listWorkbenches() -> list\n\n" "Show a list of all workbenches"}, - {"activeWorkbench", (PyCFunction) Application::sActiveWorkbenchHandler, 1, + {"activeWorkbench", (PyCFunction) Application::sActiveWorkbenchHandler, METH_VARARGS, "activeWorkbench() -> object\n\n" "Return the active workbench object"}, - {"addResourcePath", (PyCFunction) Application::sAddResPath, 1, + {"addResourcePath", (PyCFunction) Application::sAddResPath, METH_VARARGS, "addResourcePath(string) -> None\n\n" "Add a new path to the system where to find resource files\n" "like icons or localization files"}, - {"addLanguagePath", (PyCFunction) Application::sAddLangPath, 1, + {"addLanguagePath", (PyCFunction) Application::sAddLangPath, METH_VARARGS, "addLanguagePath(string) -> None\n\n" "Add a new path to the system where to find language files"}, - {"addIconPath", (PyCFunction) Application::sAddIconPath, 1, + {"addIconPath", (PyCFunction) Application::sAddIconPath, METH_VARARGS, "addIconPath(string) -> None\n\n" "Add a new path to the system where to find icon files"}, - {"addIcon", (PyCFunction) Application::sAddIcon, 1, + {"addIcon", (PyCFunction) Application::sAddIcon, METH_VARARGS, "addIcon(string, string or list) -> None\n\n" "Add an icon as file name or in XPM format to the system"}, - {"getMainWindow", (PyCFunction) Application::sGetMainWindow, 1, + {"getMainWindow", (PyCFunction) Application::sGetMainWindow, METH_VARARGS, "getMainWindow() -> QMainWindow\n\n" "Return the main window instance"}, - {"updateGui", (PyCFunction) Application::sUpdateGui, 1, + {"updateGui", (PyCFunction) Application::sUpdateGui, METH_VARARGS, "updateGui() -> None\n\n" "Update the main window and all its windows"}, - {"updateLocale", (PyCFunction) Application::sUpdateLocale, 1, + {"updateLocale", (PyCFunction) Application::sUpdateLocale, METH_VARARGS, "updateLocale() -> None\n\n" "Update the localization"}, - {"getLocale", (PyCFunction) Application::sGetLocale, 1, + {"getLocale", (PyCFunction) Application::sGetLocale, METH_VARARGS, "getLocale() -> string\n\n" "Returns the locale currently used by FreeCAD"}, - {"setLocale", (PyCFunction) Application::sSetLocale, 1, + {"setLocale", (PyCFunction) Application::sSetLocale, METH_VARARGS, "getLocale(string) -> None\n\n" "Sets the locale used by FreeCAD. You can set it by\n" "top-level domain (e.g. \"de\") or the language name (e.g. \"German\")"}, - {"supportedLocales", (PyCFunction) Application::sSupportedLocales, 1, + {"supportedLocales", (PyCFunction) Application::sSupportedLocales, METH_VARARGS, "supportedLocales() -> dict\n\n" "Returns a dict of all supported languages/top-level domains"}, - {"createDialog", (PyCFunction) Application::sCreateDialog, 1, + {"createDialog", (PyCFunction) Application::sCreateDialog, METH_VARARGS, "createDialog(string) -- Open a UI file"}, - {"addPreferencePage", (PyCFunction) Application::sAddPreferencePage,1, + {"addPreferencePage", (PyCFunction) Application::sAddPreferencePage, METH_VARARGS, "addPreferencePage(string,string) -- Add a UI form to the\n" "preferences dialog. The first argument specifies the file name" "and the second specifies the group name"}, - {"addCommand", (PyCFunction) Application::sAddCommand, 1, + {"addCommand", (PyCFunction) Application::sAddCommand, METH_VARARGS, "addCommand(string, object) -> None\n\n" "Add a command object"}, - {"runCommand", (PyCFunction) Application::sRunCommand, 1, + {"runCommand", (PyCFunction) Application::sRunCommand, METH_VARARGS, "runCommand(string) -> None\n\n" "Run command with name"}, - {"listCommands", (PyCFunction) Application::sListCommands,1, + {"listCommands", (PyCFunction) Application::sListCommands, METH_VARARGS, "listCommands() -> list of strings\n\n" "Returns a list of all commands known to FreeCAD."}, - {"SendMsgToActiveView", (PyCFunction) Application::sSendActiveView, 1, + {"SendMsgToActiveView", (PyCFunction) Application::sSendActiveView, METH_VARARGS, "deprecated -- use class View"}, - {"hide", (PyCFunction) Application::sHide, 1, + {"hide", (PyCFunction) Application::sHide, METH_VARARGS, "deprecated"}, - {"show", (PyCFunction) Application::sShow, 1, + {"show", (PyCFunction) Application::sShow, METH_VARARGS, "deprecated"}, - {"hideObject", (PyCFunction) Application::sHideObject, 1, + {"hideObject", (PyCFunction) Application::sHideObject, METH_VARARGS, "hideObject(object) -> None\n\n" "Hide the view provider to the given object"}, - {"showObject", (PyCFunction) Application::sShowObject, 1, + {"showObject", (PyCFunction) Application::sShowObject, METH_VARARGS, "showObject(object) -> None\n\n" "Show the view provider to the given object"}, - {"open", (PyCFunction) Application::sOpen, 1, + {"open", (PyCFunction) Application::sOpen, METH_VARARGS, "Open a macro, Inventor or VRML file"}, - {"insert", (PyCFunction) Application::sInsert, 1, + {"insert", (PyCFunction) Application::sInsert, METH_VARARGS, "Open a macro, Inventor or VRML file"}, - {"export", (PyCFunction) Application::sExport, 1, + {"export", (PyCFunction) Application::sExport, METH_VARARGS, "save scene to Inventor or VRML file"}, - {"activeDocument", (PyCFunction) Application::sActiveDocument, 1, + {"activeDocument", (PyCFunction) Application::sActiveDocument, METH_VARARGS, "activeDocument() -> object or None\n\n" "Return the active document or None if no one exists"}, - {"setActiveDocument", (PyCFunction) Application::sSetActiveDocument,1, + {"setActiveDocument", (PyCFunction) Application::sSetActiveDocument, METH_VARARGS, "setActiveDocument(string or App.Document) -> None\n\n" "Activate the specified document"}, - {"activeView", (PyCFunction)Application::sActiveView, 1, + {"activeView", (PyCFunction)Application::sActiveView, METH_VARARGS, "activeView() -> object or None\n\n" "Return the active view of the active document or None if no one exists"}, - {"getDocument", (PyCFunction) Application::sGetDocument, 1, + {"getDocument", (PyCFunction) Application::sGetDocument, METH_VARARGS, "getDocument(string) -> object\n\n" "Get a document by its name"}, - {"doCommand", (PyCFunction) Application::sDoCommand, 1, + {"doCommand", (PyCFunction) Application::sDoCommand, METH_VARARGS, "doCommand(string) -> None\n\n" "Prints the given string in the python console and runs it"}, - {"doCommandGui", (PyCFunction) Application::sDoCommandGui, 1, + {"doCommandGui", (PyCFunction) Application::sDoCommandGui, METH_VARARGS, "doCommandGui(string) -> None\n\n" "Prints the given string in the python console and runs it but doesn't record it in macros"}, - {"addModule", (PyCFunction) Application::sAddModule, 1, + {"addModule", (PyCFunction) Application::sAddModule, METH_VARARGS, "addModule(string) -> None\n\n" "Prints the given module import only once in the macro recording"}, - {"showDownloads", (PyCFunction) Application::sShowDownloads,1, + {"showDownloads", (PyCFunction) Application::sShowDownloads, METH_VARARGS, "showDownloads() -> None\n\n" "Shows the downloads manager window"}, - {"showPreferences", (PyCFunction) Application::sShowPreferences,1, + {"showPreferences", (PyCFunction) Application::sShowPreferences, METH_VARARGS, "showPreferences([string,int]) -> None\n\n" "Shows the preferences window. If string and int are provided, the given page index in the given group is shown."}, - {"createViewer", (PyCFunction) Application::sCreateViewer,1, + {"createViewer", (PyCFunction) Application::sCreateViewer, METH_VARARGS, "createViewer([int]) -> View3DInventor/SplitView3DInventor\n\n" "shows and returns a viewer. If the integer argument is given and > 1: -> splitViewer"}, - {"getMarkerIndex", (PyCFunction) Application::sGetMarkerIndex, 1, + {"getMarkerIndex", (PyCFunction) Application::sGetMarkerIndex, METH_VARARGS, "Get marker index according to marker size setting"}, {NULL, NULL, 0, NULL} /* Sentinel */ }; -PyObject* Gui::Application::sActiveDocument(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject* Gui::Application::sActiveDocument(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) return NULL; @@ -203,7 +203,7 @@ PyObject* Gui::Application::sActiveDocument(PyObject * /*self*/, PyObject *args, } } -PyObject* Gui::Application::sActiveView(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject* Gui::Application::sActiveView(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) return NULL; @@ -219,7 +219,7 @@ PyObject* Gui::Application::sActiveView(PyObject * /*self*/, PyObject *args, PyO Py_Return; } -PyObject* Gui::Application::sSetActiveDocument(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Gui::Application::sSetActiveDocument(PyObject * /*self*/, PyObject *args) { Document *pcDoc = 0; @@ -259,7 +259,7 @@ PyObject* Gui::Application::sSetActiveDocument(PyObject * /*self*/, PyObject *ar Py_Return; } -PyObject* Application::sGetDocument(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sGetDocument(PyObject * /*self*/, PyObject *args) { char *pstr=0; if (PyArg_ParseTuple(args, "s", &pstr)) { @@ -286,7 +286,7 @@ PyObject* Application::sGetDocument(PyObject * /*self*/, PyObject *args,PyObject return 0; } -PyObject* Application::sHide(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sHide(PyObject * /*self*/, PyObject *args) { char *psFeatStr; if (!PyArg_ParseTuple(args, "s;Name of the object to hide has to be given!",&psFeatStr)) @@ -300,7 +300,7 @@ PyObject* Application::sHide(PyObject * /*self*/, PyObject *args,PyObject * /*kw Py_Return; } -PyObject* Application::sShow(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sShow(PyObject * /*self*/, PyObject *args) { char *psFeatStr; if (!PyArg_ParseTuple(args, "s;Name of the object to show has to be given!",&psFeatStr)) @@ -314,7 +314,7 @@ PyObject* Application::sShow(PyObject * /*self*/, PyObject *args,PyObject * /*kw Py_Return; } -PyObject* Application::sHideObject(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sHideObject(PyObject * /*self*/, PyObject *args) { PyObject *object; if (!PyArg_ParseTuple(args, "O!",&(App::DocumentObjectPy::Type),&object)) @@ -326,7 +326,7 @@ PyObject* Application::sHideObject(PyObject * /*self*/, PyObject *args,PyObject Py_Return; } -PyObject* Application::sShowObject(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sShowObject(PyObject * /*self*/, PyObject *args) { PyObject *object; if (!PyArg_ParseTuple(args, "O!",&(App::DocumentObjectPy::Type),&object)) @@ -338,7 +338,7 @@ PyObject* Application::sShowObject(PyObject * /*self*/, PyObject *args,PyObject Py_Return; } -PyObject* Application::sOpen(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sOpen(PyObject * /*self*/, PyObject *args) { // only used to open Python files char* Name; @@ -408,7 +408,7 @@ PyObject* Application::sOpen(PyObject * /*self*/, PyObject *args,PyObject * /*kw Py_Return; } -PyObject* Application::sInsert(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sInsert(PyObject * /*self*/, PyObject *args) { char* Name; char* DocName=0; @@ -479,7 +479,7 @@ PyObject* Application::sInsert(PyObject * /*self*/, PyObject *args,PyObject * /* Py_Return; } -PyObject* Application::sExport(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sExport(PyObject * /*self*/, PyObject *args) { PyObject* object; char* Name; @@ -561,7 +561,7 @@ PyObject* Application::sExport(PyObject * /*self*/, PyObject *args,PyObject * /* Py_Return; } -PyObject* Application::sSendActiveView(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sSendActiveView(PyObject * /*self*/, PyObject *args) { char *psCommandStr; PyObject *suppress=Py_False; @@ -583,7 +583,7 @@ PyObject* Application::sSendActiveView(PyObject * /*self*/, PyObject *args,PyObj return Py_None; } -PyObject* Application::sGetMainWindow(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sGetMainWindow(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) return NULL; @@ -600,7 +600,7 @@ PyObject* Application::sGetMainWindow(PyObject * /*self*/, PyObject *args,PyObje } } -PyObject* Application::sUpdateGui(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sUpdateGui(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) return NULL; @@ -611,7 +611,7 @@ PyObject* Application::sUpdateGui(PyObject * /*self*/, PyObject *args,PyObject * return Py_None; } -PyObject* Application::sUpdateLocale(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sUpdateLocale(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) return NULL; @@ -622,7 +622,7 @@ PyObject* Application::sUpdateLocale(PyObject * /*self*/, PyObject *args,PyObjec return Py_None; } -PyObject* Application::sGetLocale(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sGetLocale(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) return NULL; @@ -635,7 +635,7 @@ PyObject* Application::sGetLocale(PyObject * /*self*/, PyObject *args,PyObject * #endif } -PyObject* Application::sSetLocale(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sSetLocale(PyObject * /*self*/, PyObject *args) { char* name; if (!PyArg_ParseTuple(args, "s", &name)) @@ -655,7 +655,7 @@ PyObject* Application::sSetLocale(PyObject * /*self*/, PyObject *args,PyObject * return Py_None; } -PyObject* Application::sSupportedLocales(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sSupportedLocales(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) return NULL; @@ -671,7 +671,7 @@ PyObject* Application::sSupportedLocales(PyObject * /*self*/, PyObject *args,PyO return Py::new_reference_to(dict); } -PyObject* Application::sCreateDialog(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sCreateDialog(PyObject * /*self*/, PyObject *args) { char* fn = 0; if (!PyArg_ParseTuple(args, "s", &fn)) @@ -690,7 +690,7 @@ PyObject* Application::sCreateDialog(PyObject * /*self*/, PyObject *args,PyObjec return pPyResource; } -PyObject* Application::sAddPreferencePage(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sAddPreferencePage(PyObject * /*self*/, PyObject *args) { char *fn, *grp; if (PyArg_ParseTuple(args, "ss", &fn,&grp)) { @@ -735,7 +735,7 @@ PyObject* Application::sAddPreferencePage(PyObject * /*self*/, PyObject *args,Py return 0; } -PyObject* Application::sActivateWorkbenchHandler(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sActivateWorkbenchHandler(PyObject * /*self*/, PyObject *args) { char* psKey; if (!PyArg_ParseTuple(args, "s", &psKey)) @@ -776,7 +776,7 @@ PyObject* Application::sActivateWorkbenchHandler(PyObject * /*self*/, PyObject * return Py_None; } -PyObject* Application::sAddWorkbenchHandler(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sAddWorkbenchHandler(PyObject * /*self*/, PyObject *args) { PyObject* pcObject; std::string item; @@ -834,7 +834,7 @@ PyObject* Application::sAddWorkbenchHandler(PyObject * /*self*/, PyObject *args, return Py_None; } -PyObject* Application::sRemoveWorkbenchHandler(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sRemoveWorkbenchHandler(PyObject * /*self*/, PyObject *args) { char* psKey; if (!PyArg_ParseTuple(args, "s", &psKey)) @@ -854,7 +854,7 @@ PyObject* Application::sRemoveWorkbenchHandler(PyObject * /*self*/, PyObject *ar return Py_None; } -PyObject* Application::sGetWorkbenchHandler(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sGetWorkbenchHandler(PyObject * /*self*/, PyObject *args) { char* psKey; if (!PyArg_ParseTuple(args, "s", &psKey)) @@ -871,7 +871,7 @@ PyObject* Application::sGetWorkbenchHandler(PyObject * /*self*/, PyObject *args, return pcWorkbench; } -PyObject* Application::sListWorkbenchHandlers(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject* Application::sListWorkbenchHandlers(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) return NULL; @@ -880,7 +880,7 @@ PyObject* Application::sListWorkbenchHandlers(PyObject * /*self*/, PyObject *arg return Instance->_pcWorkbenchDictionary; } -PyObject* Application::sActiveWorkbenchHandler(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sActiveWorkbenchHandler(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) return NULL; @@ -904,7 +904,7 @@ PyObject* Application::sActiveWorkbenchHandler(PyObject * /*self*/, PyObject *ar return pcWorkbench; } -PyObject* Application::sAddResPath(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sAddResPath(PyObject * /*self*/, PyObject *args) { char* filePath; if (!PyArg_ParseTuple(args, "et", "utf-8", &filePath)) @@ -923,7 +923,7 @@ PyObject* Application::sAddResPath(PyObject * /*self*/, PyObject *args,PyObject return Py_None; } -PyObject* Application::sAddLangPath(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sAddLangPath(PyObject * /*self*/, PyObject *args) { char* filePath; if (!PyArg_ParseTuple(args, "et", "utf-8", &filePath)) @@ -941,7 +941,7 @@ PyObject* Application::sAddLangPath(PyObject * /*self*/, PyObject *args,PyObject return Py_None; } -PyObject* Application::sAddIconPath(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sAddIconPath(PyObject * /*self*/, PyObject *args) { char* filePath; if (!PyArg_ParseTuple(args, "et", "utf-8", &filePath)) @@ -959,7 +959,7 @@ PyObject* Application::sAddIconPath(PyObject * /*self*/, PyObject *args,PyObject return Py_None; } -PyObject* Application::sAddIcon(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sAddIcon(PyObject * /*self*/, PyObject *args) { char *iconName; char *pixmap; @@ -996,7 +996,7 @@ PyObject* Application::sAddIcon(PyObject * /*self*/, PyObject *args,PyObject * / return Py_None; } -PyObject* Application::sAddCommand(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sAddCommand(PyObject * /*self*/, PyObject *args) { char* pName; char* pSource=0; @@ -1074,7 +1074,7 @@ PyObject* Application::sAddCommand(PyObject * /*self*/, PyObject *args,PyObject return Py_None; } -PyObject* Application::sRunCommand(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sRunCommand(PyObject * /*self*/, PyObject *args) { char* pName; int item = 0; @@ -1093,7 +1093,7 @@ PyObject* Application::sRunCommand(PyObject * /*self*/, PyObject *args,PyObject } } -PyObject* Application::sListCommands(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sListCommands(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) return NULL; @@ -1112,7 +1112,7 @@ PyObject* Application::sListCommands(PyObject * /*self*/, PyObject *args,PyObjec return pyList; } -PyObject* Application::sDoCommand(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject* Application::sDoCommand(PyObject * /*self*/, PyObject *args) { char *sCmd=0; if (!PyArg_ParseTuple(args, "s", &sCmd)) @@ -1133,7 +1133,7 @@ PyObject* Application::sDoCommand(PyObject * /*self*/, PyObject *args, PyObject return PyRun_String(sCmd, Py_file_input, dict, dict); } -PyObject* Application::sDoCommandGui(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject* Application::sDoCommandGui(PyObject * /*self*/, PyObject *args) { char *sCmd=0; if (!PyArg_ParseTuple(args, "s", &sCmd)) @@ -1154,7 +1154,7 @@ PyObject* Application::sDoCommandGui(PyObject * /*self*/, PyObject *args, PyObje return PyRun_String(sCmd, Py_file_input, dict, dict); } -PyObject* Application::sAddModule(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sAddModule(PyObject * /*self*/, PyObject *args) { char *pstr=0; if (!PyArg_ParseTuple(args, "s", &pstr)) @@ -1172,7 +1172,7 @@ PyObject* Application::sAddModule(PyObject * /*self*/, PyObject *args,PyObject * } } -PyObject* Application::sShowDownloads(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sShowDownloads(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) return NULL; @@ -1182,7 +1182,7 @@ PyObject* Application::sShowDownloads(PyObject * /*self*/, PyObject *args,PyObje return Py_None; } -PyObject* Application::sShowPreferences(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sShowPreferences(PyObject * /*self*/, PyObject *args) { char *pstr=0; int idx=0; @@ -1200,7 +1200,7 @@ PyObject* Application::sShowPreferences(PyObject * /*self*/, PyObject *args,PyOb return Py_None; } -PyObject* Application::sCreateViewer(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/) +PyObject* Application::sCreateViewer(PyObject * /*self*/, PyObject *args) { int num_of_views = 1; char* title = nullptr; @@ -1229,7 +1229,7 @@ PyObject* Application::sCreateViewer(PyObject * /*self*/, PyObject *args,PyObjec return Py_None; } -PyObject* Application::sGetMarkerIndex(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject* Application::sGetMarkerIndex(PyObject * /*self*/, PyObject *args) { char *pstr = 0; int defSize = 9; diff --git a/src/Gui/Selection.cpp b/src/Gui/Selection.cpp index 317ad2c6ce..6087cc9dbb 100644 --- a/src/Gui/Selection.cpp +++ b/src/Gui/Selection.cpp @@ -1066,7 +1066,7 @@ PyMethodDef SelectionSingleton::Methods[] = { {NULL, NULL, 0, NULL} /* Sentinel */ }; -PyObject *SelectionSingleton::sAddSelection(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *SelectionSingleton::sAddSelection(PyObject * /*self*/, PyObject *args) { PyObject *object; char* subname=0; @@ -1117,7 +1117,7 @@ PyObject *SelectionSingleton::sAddSelection(PyObject * /*self*/, PyObject *args, return 0; } -PyObject *SelectionSingleton::sRemoveSelection(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *SelectionSingleton::sRemoveSelection(PyObject * /*self*/, PyObject *args) { PyObject *object; char* subname=0; @@ -1138,7 +1138,7 @@ PyObject *SelectionSingleton::sRemoveSelection(PyObject * /*self*/, PyObject *ar Py_Return; } -PyObject *SelectionSingleton::sClearSelection(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *SelectionSingleton::sClearSelection(PyObject * /*self*/, PyObject *args) { char *documentName=0; if (!PyArg_ParseTuple(args, "|s", &documentName)) @@ -1147,7 +1147,7 @@ PyObject *SelectionSingleton::sClearSelection(PyObject * /*self*/, PyObject *arg Py_Return; } -PyObject *SelectionSingleton::sIsSelected(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *SelectionSingleton::sIsSelected(PyObject * /*self*/, PyObject *args) { PyObject *object; char* subname=0; @@ -1159,7 +1159,7 @@ PyObject *SelectionSingleton::sIsSelected(PyObject * /*self*/, PyObject *args, P return Py_BuildValue("O", (ok ? Py_True : Py_False)); } -PyObject *SelectionSingleton::sCountObjectsOfType(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *SelectionSingleton::sCountObjectsOfType(PyObject * /*self*/, PyObject *args) { char* objecttype; char* document=0; @@ -1174,7 +1174,7 @@ PyObject *SelectionSingleton::sCountObjectsOfType(PyObject * /*self*/, PyObject #endif } -PyObject *SelectionSingleton::sGetSelection(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *SelectionSingleton::sGetSelection(PyObject * /*self*/, PyObject *args) { char *documentName=0; if (!PyArg_ParseTuple(args, "|s", &documentName)) @@ -1195,7 +1195,7 @@ PyObject *SelectionSingleton::sGetSelection(PyObject * /*self*/, PyObject *args, } } -PyObject *SelectionSingleton::sGetPreselection(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *SelectionSingleton::sGetPreselection(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) return NULL; @@ -1205,7 +1205,7 @@ PyObject *SelectionSingleton::sGetPreselection(PyObject * /*self*/, PyObject *ar return obj.getPyObject(); } -PyObject *SelectionSingleton::sRemPreselection(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *SelectionSingleton::sRemPreselection(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) return NULL; @@ -1214,7 +1214,7 @@ PyObject *SelectionSingleton::sRemPreselection(PyObject * /*self*/, PyObject *ar Py_Return; } -PyObject *SelectionSingleton::sGetCompleteSelection(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *SelectionSingleton::sGetCompleteSelection(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) return NULL; @@ -1234,7 +1234,7 @@ PyObject *SelectionSingleton::sGetCompleteSelection(PyObject * /*self*/, PyObjec } } -PyObject *SelectionSingleton::sGetSelectionEx(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *SelectionSingleton::sGetSelectionEx(PyObject * /*self*/, PyObject *args) { char *documentName=0; if (!PyArg_ParseTuple(args, "|s", &documentName)) @@ -1255,7 +1255,7 @@ PyObject *SelectionSingleton::sGetSelectionEx(PyObject * /*self*/, PyObject *arg } } -PyObject *SelectionSingleton::sGetSelectionObject(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *SelectionSingleton::sGetSelectionObject(PyObject * /*self*/, PyObject *args) { char *docName, *objName, *subName; PyObject* tuple=0; @@ -1290,7 +1290,7 @@ PyObject *SelectionSingleton::sGetSelectionObject(PyObject * /*self*/, PyObject } } -PyObject *SelectionSingleton::sAddSelObserver(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *SelectionSingleton::sAddSelObserver(PyObject * /*self*/, PyObject *args) { PyObject* o; if (!PyArg_ParseTuple(args, "O",&o)) @@ -1301,7 +1301,7 @@ PyObject *SelectionSingleton::sAddSelObserver(PyObject * /*self*/, PyObject *arg } PY_CATCH; } -PyObject *SelectionSingleton::sRemSelObserver(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *SelectionSingleton::sRemSelObserver(PyObject * /*self*/, PyObject *args) { PyObject* o; if (!PyArg_ParseTuple(args, "O",&o)) @@ -1312,7 +1312,7 @@ PyObject *SelectionSingleton::sRemSelObserver(PyObject * /*self*/, PyObject *arg } PY_CATCH; } -PyObject *SelectionSingleton::sAddSelectionGate(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *SelectionSingleton::sAddSelectionGate(PyObject * /*self*/, PyObject *args) { char* filter; if (PyArg_ParseTuple(args, "s",&filter)) { @@ -1344,7 +1344,7 @@ PyObject *SelectionSingleton::sAddSelectionGate(PyObject * /*self*/, PyObject *a return 0; } -PyObject *SelectionSingleton::sRemoveSelectionGate(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject *SelectionSingleton::sRemoveSelectionGate(PyObject * /*self*/, PyObject *args) { if (!PyArg_ParseTuple(args, "")) return NULL; diff --git a/src/Gui/Selection.h b/src/Gui/Selection.h index bb09aafc97..dbd7005e94 100644 --- a/src/Gui/Selection.h +++ b/src/Gui/Selection.h @@ -330,21 +330,21 @@ public: static PyMethodDef Methods[]; protected: - static PyObject *sAddSelection (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sRemoveSelection (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sClearSelection (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sIsSelected (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sCountObjectsOfType (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sGetSelection (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sGetPreselection (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sRemPreselection (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sGetCompleteSelection(PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sGetSelectionEx (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sGetSelectionObject (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sAddSelObserver (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sRemSelObserver (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sAddSelectionGate (PyObject *self,PyObject *args,PyObject *kwd); - static PyObject *sRemoveSelectionGate (PyObject *self,PyObject *args,PyObject *kwd); + static PyObject *sAddSelection (PyObject *self,PyObject *args); + static PyObject *sRemoveSelection (PyObject *self,PyObject *args); + static PyObject *sClearSelection (PyObject *self,PyObject *args); + static PyObject *sIsSelected (PyObject *self,PyObject *args); + static PyObject *sCountObjectsOfType (PyObject *self,PyObject *args); + static PyObject *sGetSelection (PyObject *self,PyObject *args); + static PyObject *sGetPreselection (PyObject *self,PyObject *args); + static PyObject *sRemPreselection (PyObject *self,PyObject *args); + static PyObject *sGetCompleteSelection(PyObject *self,PyObject *args); + static PyObject *sGetSelectionEx (PyObject *self,PyObject *args); + static PyObject *sGetSelectionObject (PyObject *self,PyObject *args); + static PyObject *sAddSelObserver (PyObject *self,PyObject *args); + static PyObject *sRemSelObserver (PyObject *self,PyObject *args); + static PyObject *sAddSelectionGate (PyObject *self,PyObject *args); + static PyObject *sRemoveSelectionGate (PyObject *self,PyObject *args); protected: /// Construction diff --git a/src/Mod/Part/Gui/AttacherTexts.cpp b/src/Mod/Part/Gui/AttacherTexts.cpp index 1d620bb51e..be6d150154 100644 --- a/src/Mod/Part/Gui/AttacherTexts.cpp +++ b/src/Mod/Part/Gui/AttacherTexts.cpp @@ -369,7 +369,7 @@ QStringList getRefListForMode(AttachEngine &attacher, eMapMode mmode) // --------------------Py interface--------------------- -PyObject* AttacherGuiPy::sGetModeStrings(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject* AttacherGuiPy::sGetModeStrings(PyObject * /*self*/, PyObject *args) { int modeIndex = 0; char* attacherType; @@ -400,7 +400,7 @@ PyObject* AttacherGuiPy::sGetModeStrings(PyObject * /*self*/, PyObject *args, Py } } -PyObject* AttacherGuiPy::sGetRefTypeUserFriendlyName(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/) +PyObject* AttacherGuiPy::sGetRefTypeUserFriendlyName(PyObject * /*self*/, PyObject *args) { int refTypeIndex = 0; if (!PyArg_ParseTuple(args, "i", &refTypeIndex)) @@ -419,9 +419,9 @@ PyObject* AttacherGuiPy::sGetRefTypeUserFriendlyName(PyObject * /*self*/, PyObje PyMethodDef AttacherGuiPy::Methods[] = { - {"getModeStrings", (PyCFunction) AttacherGuiPy::sGetModeStrings, 1, + {"getModeStrings", (PyCFunction) AttacherGuiPy::sGetModeStrings, METH_VARARGS, "getModeStrings(attacher_type, mode_index) - gets mode user-friendly name and brief description."}, - {"getRefTypeUserFriendlyName", (PyCFunction) AttacherGuiPy::sGetRefTypeUserFriendlyName, 1, + {"getRefTypeUserFriendlyName", (PyCFunction) AttacherGuiPy::sGetRefTypeUserFriendlyName, METH_VARARGS, "getRefTypeUserFriendlyName(type_index) - gets user-friendly name of AttachEngine's shape type."}, {NULL, NULL, 0, NULL} /* Sentinel */ }; diff --git a/src/Mod/Part/Gui/AttacherTexts.h b/src/Mod/Part/Gui/AttacherTexts.h index 903f604b17..ec0dd9a885 100644 --- a/src/Mod/Part/Gui/AttacherTexts.h +++ b/src/Mod/Part/Gui/AttacherTexts.h @@ -61,8 +61,8 @@ QStringList PartGuiExport getRefListForMode(Attacher::AttachEngine &attacher, At class PartGuiExport AttacherGuiPy{ public: static PyMethodDef Methods[]; - static PyObject* sGetModeStrings(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/); - static PyObject* sGetRefTypeUserFriendlyName(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/); + static PyObject* sGetModeStrings(PyObject * /*self*/, PyObject *args); + static PyObject* sGetRefTypeUserFriendlyName(PyObject * /*self*/, PyObject *args); }; }