| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| |
|
| | #ifndef APP_DOCUMENTOBSERVERPYTHON_H
|
| | #define APP_DOCUMENTOBSERVERPYTHON_H
|
| |
|
| | #include <FCGlobal.h>
|
| | #include <fastsignals/signal.h>
|
| | #include <CXX/Objects.hxx>
|
| | #include <string>
|
| | #include <vector>
|
| |
|
| | namespace App
|
| | {
|
| |
|
| | class Document;
|
| | class DocumentObject;
|
| | class ExtensionContainer;
|
| | class Property;
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | class AppExport DocumentObserverPython
|
| | {
|
| |
|
| | public:
|
| |
|
| | DocumentObserverPython(const Py::Object& obj);
|
| | virtual ~DocumentObserverPython();
|
| |
|
| | static void addObserver(const Py::Object& obj);
|
| | static void removeObserver(const Py::Object& obj);
|
| |
|
| | private:
|
| |
|
| | void slotCreatedDocument(const App::Document& Doc);
|
| |
|
| | void slotDeletedDocument(const App::Document& Doc);
|
| |
|
| | void slotRelabelDocument(const App::Document& Doc);
|
| |
|
| | void slotActivateDocument(const App::Document& Doc);
|
| |
|
| | void slotBeforeChangeDocument(const App::Document& Obj, const App::Property& Prop);
|
| |
|
| | void slotChangedDocument(const App::Document& Obj, const App::Property& Prop);
|
| |
|
| | void slotCreatedObject(const App::DocumentObject& Obj);
|
| |
|
| | void slotDeletedObject(const App::DocumentObject& Obj);
|
| |
|
| | void slotBeforeChangeObject(const App::DocumentObject& Obj, const App::Property& Prop);
|
| |
|
| | void slotChangedObject(const App::DocumentObject& Obj, const App::Property& Prop);
|
| |
|
| | void slotUndoDocument(const App::Document& Doc);
|
| |
|
| | void slotRedoDocument(const App::Document& Doc);
|
| |
|
| | void slotRecomputedObject(const App::DocumentObject& Obj);
|
| |
|
| | void slotBeforeRecomputeDocument(const App::Document& Doc);
|
| |
|
| | void slotRecomputedDocument(const App::Document& Doc);
|
| |
|
| | void slotOpenTransaction(const App::Document& Doc, std::string str);
|
| |
|
| | void slotCommitTransaction(const App::Document& Doc);
|
| |
|
| | void slotAbortTransaction(const App::Document& Doc);
|
| |
|
| | void slotUndo();
|
| |
|
| | void slotRedo();
|
| |
|
| | void slotBeforeCloseTransaction(bool abort);
|
| |
|
| | void slotCloseTransaction(bool abort);
|
| |
|
| | void slotAppendDynamicProperty(const App::Property& Prop);
|
| |
|
| | void slotRemoveDynamicProperty(const App::Property& Prop);
|
| |
|
| | void slotChangePropertyEditor(const App::Document& Doc, const App::Property& Prop);
|
| |
|
| | void slotStartSaveDocument(const App::Document&, const std::string&);
|
| |
|
| | void slotFinishSaveDocument(const App::Document&, const std::string&);
|
| |
|
| | void slotBeforeAddingDynamicExtension(const App::ExtensionContainer&, std::string extension);
|
| |
|
| | void slotAddedDynamicExtension(const App::ExtensionContainer&, std::string extension);
|
| |
|
| |
|
| | private:
|
| | Py::Object inst;
|
| | static std::vector<DocumentObserverPython*> _instances;
|
| |
|
| | using Connection = struct PythonObject
|
| | {
|
| | fastsignals::scoped_connection slot;
|
| | Py::Object py;
|
| | PyObject* ptr()
|
| | {
|
| | return py.ptr();
|
| | }
|
| | };
|
| |
|
| | Connection pyCreatedDocument;
|
| | Connection pyDeletedDocument;
|
| | Connection pyRelabelDocument;
|
| | Connection pyActivateDocument;
|
| | Connection pyUndoDocument;
|
| | Connection pyRedoDocument;
|
| | Connection pyBeforeChangeDocument;
|
| | Connection pyChangedDocument;
|
| | Connection pyCreatedObject;
|
| | Connection pyDeletedObject;
|
| | Connection pyBeforeChangeObject;
|
| | Connection pyChangedObject;
|
| | Connection pyRecomputedObject;
|
| | Connection pyBeforeRecomputeDocument;
|
| | Connection pyRecomputedDocument;
|
| | Connection pyOpenTransaction;
|
| | Connection pyCommitTransaction;
|
| | Connection pyAbortTransaction;
|
| | Connection pyUndo;
|
| | Connection pyRedo;
|
| | Connection pyBeforeCloseTransaction;
|
| | Connection pyCloseTransaction;
|
| | Connection pyStartSaveDocument;
|
| | Connection pyFinishSaveDocument;
|
| | Connection pyAppendDynamicProperty;
|
| | Connection pyRemoveDynamicProperty;
|
| | Connection pyChangePropertyEditor;
|
| | Connection pyBeforeAddingDynamicExtension;
|
| | Connection pyAddedDynamicExtension;
|
| | };
|
| |
|
| | }
|
| |
|
| | #endif
|
| |
|