| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| |
|
| | #include <Base/Console.h>
|
| | #include <Base/Interpreter.h>
|
| | #include <Base/PyObjectBase.h>
|
| | #include <Gui/Application.h>
|
| | #include <Gui/Language/Translator.h>
|
| |
|
| | #include "Workbench.h"
|
| |
|
| |
|
| |
|
| | void CreateReverseEngineeringCommands();
|
| |
|
| | void loadReverseEngineeringResource()
|
| | {
|
| |
|
| | Q_INIT_RESOURCE(ReverseEngineering);
|
| | Q_INIT_RESOURCE(ReverseEngineering_translation);
|
| | Gui::Translator::instance()->refresh();
|
| | }
|
| |
|
| | namespace ReverseEngineeringGui
|
| | {
|
| | class Module: public Py::ExtensionModule<Module>
|
| | {
|
| | public:
|
| | Module()
|
| | : Py::ExtensionModule<Module>("ReverseEngineeringGui")
|
| | {
|
| | initialize("This module is the ReverseEngineeringGui module.");
|
| | }
|
| |
|
| | private:
|
| | };
|
| |
|
| | PyObject* initModule()
|
| | {
|
| | return Base::Interpreter().addModule(new Module);
|
| | }
|
| |
|
| | }
|
| |
|
| |
|
| |
|
| | PyMOD_INIT_FUNC(ReverseEngineeringGui)
|
| | {
|
| | if (!Gui::Application::Instance) {
|
| | PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
|
| | PyMOD_Return(nullptr);
|
| | }
|
| |
|
| |
|
| | try {
|
| | Base::Interpreter().loadModule("MeshGui");
|
| | }
|
| | catch (const Base::Exception& e) {
|
| | PyErr_SetString(PyExc_ImportError, e.what());
|
| | PyMOD_Return(nullptr);
|
| | }
|
| |
|
| | PyObject* mod = ReverseEngineeringGui::initModule();
|
| | Base::Console().log("Loading GUI of ReverseEngineering module… done\n");
|
| |
|
| |
|
| | CreateReverseEngineeringCommands();
|
| | ReverseEngineeringGui::Workbench::init();
|
| |
|
| |
|
| | loadReverseEngineeringResource();
|
| | PyMOD_Return(mod);
|
| | }
|
| |
|