[skip ci] fix more -Wgnu-zero-variadic-macro-arguments
This commit is contained in:
@@ -60,27 +60,36 @@ void DocumentObserverPython::removeObserver(const Py::Object& obj)
|
||||
|
||||
DocumentObserverPython::DocumentObserverPython(const Py::Object& obj) : inst(obj)
|
||||
{
|
||||
#define signalCreatedDocument signalNewDocument
|
||||
#define signalCreatedObject signalNewObject
|
||||
#define signalDeletedDocument signalDeleteDocument
|
||||
#define signalActivateDocument signalActiveDocument
|
||||
#define FC_PY_ELEMENT_ARG1(_name1, _name2) do {\
|
||||
FC_PY_GetCallable(obj.ptr(), "slot" #_name1, py##_name1.py);\
|
||||
if (!py##_name1.py.isNone())\
|
||||
py##_name1.slot = Application::Instance->signal##_name2.connect(\
|
||||
boost::bind(&DocumentObserverPython::slot##_name1, this, _1));\
|
||||
}\
|
||||
while(0);
|
||||
|
||||
#undef FC_PY_ELEMENT
|
||||
#define FC_PY_ELEMENT(_name,...) \
|
||||
FC_PY_GetCallable(obj.ptr(),"slot" #_name, py##_name);\
|
||||
if(!py##_name.isNone())\
|
||||
connect##_name = Application::Instance->signal##_name.connect(\
|
||||
boost::bind(&DocumentObserverPython::slot##_name, this, ## __VA_ARGS__));
|
||||
#define FC_PY_ELEMENT_ARG2(_name1, _name2) do {\
|
||||
FC_PY_GetCallable(obj.ptr(), "slot" #_name1, py##_name1.py);\
|
||||
if (!py##_name1.py.isNone())\
|
||||
py##_name1.slot = Application::Instance->signal##_name2.connect(\
|
||||
boost::bind(&DocumentObserverPython::slot##_name1, this, _1, _2));\
|
||||
}\
|
||||
while(0);
|
||||
|
||||
FC_PY_GDOC_OBSERVER
|
||||
FC_PY_ELEMENT_ARG1(CreatedDocument, NewDocument)
|
||||
FC_PY_ELEMENT_ARG1(DeletedDocument, DeleteDocument)
|
||||
FC_PY_ELEMENT_ARG1(RelabelDocument, RelabelDocument)
|
||||
FC_PY_ELEMENT_ARG1(RenameDocument, RenameDocument)
|
||||
FC_PY_ELEMENT_ARG1(ActivateDocument, ActiveDocument)
|
||||
FC_PY_ELEMENT_ARG1(CreatedObject, NewObject)
|
||||
FC_PY_ELEMENT_ARG1(DeletedObject, DeletedObject)
|
||||
FC_PY_ELEMENT_ARG2(ChangedObject, ChangedObject)
|
||||
FC_PY_ELEMENT_ARG1(InEdit, InEdit)
|
||||
FC_PY_ELEMENT_ARG1(ResetEdit, ResetEdit)
|
||||
}
|
||||
|
||||
DocumentObserverPython::~DocumentObserverPython()
|
||||
{
|
||||
#undef FC_PY_ELEMENT
|
||||
#define FC_PY_ELEMENT(_name,...) connect##_name.disconnect();
|
||||
|
||||
FC_PY_GDOC_OBSERVER
|
||||
}
|
||||
|
||||
void DocumentObserverPython::slotCreatedDocument(const Gui::Document& Doc)
|
||||
|
||||
Reference in New Issue
Block a user