[TechDraw] Add 'getPage' Python API ; returns page from view

This commit is contained in:
0penBrain
2021-06-09 17:38:25 +02:00
parent 555c2e5a0d
commit bfc17a764d
5 changed files with 86 additions and 1 deletions

View File

@@ -0,0 +1,43 @@
#include "PreCompiled.h"
#include "Mod/TechDraw/Gui/MDIViewPage.h"
// inclusion of the generated files (generated out of MDIViewPagePy.xml)
#include "MDIViewPagePy.h"
#include "MDIViewPagePy.cpp"
#include <Mod/TechDraw/App/DrawPagePy.h>
using namespace TechDrawGui;
// returns a string which represents the object e.g. when printed in python
std::string MDIViewPagePy::representation() const
{
return std::string("<TechDrawView object>");
}
PyObject* MDIViewPagePy::getPage(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return nullptr;
return new TechDraw::DrawPagePy(getMDIViewPagePtr()->getPage());
}
PyObject *MDIViewPagePy::getCustomAttributes(const char* /*attr*/) const
{
return nullptr;
}
int MDIViewPagePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
{
return 0;
}