From Gui/Application.cpp
Code: Select all
PyDoc_STRVAR(FreeCADGui_doc,
"The functions in the FreeCADGui module allow working with GUI documents,\n"
"view providers, views, workbenches and much more.\n\n"
"The FreeCADGui instance provides a list of references of GUI documents which\n"
"can be addressed by a string. These documents contain the view providers for\n"
"objects in the associated App document. An App and GUI document can be\n"
"accessed with the same name.\n\n"
"The FreeCADGui module also provides a set of functions to work with so called\n"
"workbenches."
);
#if PY_MAJOR_VERSION >= 3
// if this returns a valid pointer then the 'FreeCADGui' Python module was loaded,
// otherwise the executable was launched
PyObject* modules = PyImport_GetModuleDict();
PyObject* module = PyDict_GetItemString(modules, "FreeCADGui");
if (!module) {
static struct PyModuleDef FreeCADGuiModuleDef = {
PyModuleDef_HEAD_INIT,
"FreeCADGui", FreeCADGui_doc, -1,
Application::Methods,
NULL, NULL, NULL, NULL
};
module = PyModule_Create(&FreeCADGuiModuleDef);
PyDict_SetItemString(modules, "FreeCADGui", module);
}
else {
// extend the method list
PyModule_AddFunctions(module, Application::Methods);
}
Code: Select all
// if this returns a valid pointer then the 'FreeCADGui' Python module was loaded,
// otherwise the executable was launched
PyObject* modules = PyImport_GetModuleDict();
PyObject* module = PyDict_GetItemString(modules, "FreeCADGui");
The only other thing I can find is in Main/CMakeLists.txt
Code: Select all
SET(FreeCADGuiPy_SRCS
FreeCADGuiPy.cpp
)
add_library(FreeCADGuiPy SHARED ${FreeCADGuiPy_SRCS})
target_link_libraries(FreeCADGuiPy FreeCADGui)
SET_BIN_DIR(FreeCADGuiPy FreeCADGui)
SET_PYTHON_PREFIX_SUFFIX(FreeCADGuiPy)