Py::Object DocumentPy::getActiveView(void) const
{
    Gui::MDIView *view = getDocumentPtr()->getActiveView();
    if (view) {
        // already incremented in getPyObject().
        return Py::Object(view->getPyObject(), true);
    } else {
        return Py::None();
    }
}
PyObject* Gui::Application::sActiveView(PyObject * /*self*/, PyObject *args)
{
    if (!PyArg_ParseTuple(args, ""))
        return NULL;

    Gui::MDIView* mdiView = Instance->activeView();
    if (mdiView) {
        // already incremented in getPyObject().
        return mdiView->getPyObject();
    }

    Py_Return;
}
PyObject*  DocumentPy::activeView(PyObject *args)
{
    if (!PyArg_ParseTuple(args, ""))     // convert args: Python->C 
        return NULL;                             // NULL triggers exception 

    PY_TRY {
        Gui::MDIView  *pcView = getDocumentPtr()->getActiveView();
        if (pcView){
            // already incremented in getPyObject().
            return pcView->getPyObject();
        } else {
            Py_Return;
        }
    } PY_CATCH;
}
PyObject* Gui::Application::sActiveView(PyObject * /*self*/, PyObject *args)
{
    if (!PyArg_ParseTuple(args, ""))
        return NULL;

    Document *pcDoc = Instance->activeDocument();
    if (pcDoc) {
        Gui::MDIView *pcView = pcDoc->getActiveView();
        if (pcView)
            // already incremented in getPyObject().
            return pcView->getPyObject();
    }

    Py_Return;
}
Beispiel #5
0
PyObject* Gui::Application::sActiveView(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/)
{
	if (!PyArg_ParseTuple(args, ""))     // convert args: Python->C 
		return NULL;                       // NULL triggers exception 

	Document *pcDoc = Instance->activeDocument();
	if (pcDoc) {
		Gui::MDIView *pcView = pcDoc->getActiveView();
		if (pcView)
			// already incremented in getPyObject().
			return pcView->getPyObject();
	}

    Py_Return;
}