/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt for Python.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/

//workaround to access protected functions
#define protected public

// default includes
#include <shiboken.h>
#ifndef QT_NO_VERSION_TAGGING
#  define QT_NO_VERSION_TAGGING
#endif
#include <QDebug>
#include <pysidesignal.h>
#include <pysideproperty.h>
#include <pyside.h>
#include <pysideqenum.h>
#include <feature_select.h>
QT_WARNING_DISABLE_DEPRECATED

#include <typeinfo>
#include <iterator>

// module include
#include "pyside6_qtgui_python.h"

// main header
#include "qpagedpaintdevice_wrapper.h"

// inner classes

#include <cctype>
#include <cstring>



template <class T>
static const char *typeNameOf(const T &t)
{
    const char *typeName =  typeid(t).name();
    auto size = std::strlen(typeName);
#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64"
    if (auto lastStar = strchr(typeName, '*')) {
        // MSVC: "class QPaintDevice * __ptr64"
        while (*--lastStar == ' ') {
        }
        size = lastStar - typeName + 1;
    }
#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice"
    if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) {
        ++typeName;
        --size;
    }
#endif
    char *result = new char[size + 1];
    result[size] = '\0';
    memcpy(result, typeName, size);
    return result;
}

// Native ---------------------------------------------------------

void QPagedPaintDeviceWrapper::resetPyMethodCache()
{
    std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false);
}

int QPagedPaintDeviceWrapper::devType() const
{
    if (m_PyMethodCache[0])
        return this->::QPaintDevice::devType();
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return 0;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "devType";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[0] = true;
        return this->::QPaintDevice::devType();
    }

    Shiboken::AutoDecRef pyArgs(PyTuple_New(0));

    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
    if (pyResult.isNull()) {
        // An error happened in python code!
        PyErr_Print();
        return 0;
    }
    // Check return type
    Shiboken::Conversions::PythonToCppConversion pythonToCpp =
        Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), pyResult);
    if (!pythonToCpp) {
        Shiboken::warning(PyExc_RuntimeWarning, 2,
            "Invalid return value in function %s, expected %s, got %s.",
            "QPagedPaintDevice.devType",
            "int",
            Py_TYPE(pyResult)->tp_name);
        return 0;
    }
    int cppResult;
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

void QPagedPaintDeviceWrapper::initPainter(QPainter * painter) const
{
    if (m_PyMethodCache[1]) {
        return this->::QPaintDevice::initPainter(painter);
    }
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "initPainter";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[1] = true;
        return this->::QPaintDevice::initPainter(painter);
    }

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)",
        Shiboken::Conversions::pointerToPython(SbkPySide6_QtGuiTypes[SBK_QPAINTER_IDX], painter)
    ));

    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
    if (pyResult.isNull()) {
        // An error happened in python code!
        PyErr_Print();
        return;
    }
}

int QPagedPaintDeviceWrapper::metric(QPaintDevice::PaintDeviceMetric metric) const
{
    if (m_PyMethodCache[2])
        return this->::QPaintDevice::metric(metric);
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return 0;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "metric";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[2] = true;
        return this->::QPaintDevice::metric(metric);
    }

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)",
        Shiboken::Conversions::copyToPython(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtGuiTypes[SBK_QPAINTDEVICE_PAINTDEVICEMETRIC_IDX]))->converter, &metric)
    ));

    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
    if (pyResult.isNull()) {
        // An error happened in python code!
        PyErr_Print();
        return 0;
    }
    // Check return type
    Shiboken::Conversions::PythonToCppConversion pythonToCpp =
        Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), pyResult);
    if (!pythonToCpp) {
        Shiboken::warning(PyExc_RuntimeWarning, 2,
            "Invalid return value in function %s, expected %s, got %s.",
            "QPagedPaintDevice.metric",
            "int",
            Py_TYPE(pyResult)->tp_name);
        return 0;
    }
    int cppResult;
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

bool QPagedPaintDeviceWrapper::newPage()
{
    if (m_PyMethodCache[3]) {
        PyErr_SetString(PyExc_NotImplementedError, "pure virtual method 'QPagedPaintDevice.newPage()' not implemented.");
        return false;
    }
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return false;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "newPage";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[3] = true;
        PyErr_SetString(PyExc_NotImplementedError, "pure virtual method 'QPagedPaintDevice.newPage()' not implemented.");
        return false;
    }

    Shiboken::AutoDecRef pyArgs(PyTuple_New(0));

    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
    if (pyResult.isNull()) {
        // An error happened in python code!
        PyErr_Print();
        return false;
    }
    // Check return type
    Shiboken::Conversions::PythonToCppConversion pythonToCpp =
        Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), pyResult);
    if (!pythonToCpp) {
        Shiboken::warning(PyExc_RuntimeWarning, 2,
            "Invalid return value in function %s, expected %s, got %s.",
            "QPagedPaintDevice.newPage",
            "bool",
            Py_TYPE(pyResult)->tp_name);
        return false;
    }
    bool cppResult;
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

QPaintEngine * QPagedPaintDeviceWrapper::paintEngine() const
{
    if (m_PyMethodCache[4]) {
        PyErr_SetString(PyExc_NotImplementedError, "pure virtual method 'QPagedPaintDevice.paintEngine()' not implemented.");
        return nullptr;
    }
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return nullptr;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "paintEngine";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[4] = true;
        PyErr_SetString(PyExc_NotImplementedError, "pure virtual method 'QPagedPaintDevice.paintEngine()' not implemented.");
        return nullptr;
    }

    Shiboken::AutoDecRef pyArgs(PyTuple_New(0));

    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
    if (pyResult.isNull()) {
        // An error happened in python code!
        PyErr_Print();
        return nullptr;
    }
    // Check return type
    Shiboken::Conversions::PythonToCppConversion pythonToCpp =
        Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtGuiTypes[SBK_QPAINTENGINE_IDX], pyResult);
    if (!pythonToCpp) {
        Shiboken::warning(PyExc_RuntimeWarning, 2,
            "Invalid return value in function %s, expected %s, got %s.",
            "QPagedPaintDevice.paintEngine",
            reinterpret_cast<PyTypeObject *>(Shiboken::SbkType< QPaintEngine >())->tp_name,
            Py_TYPE(pyResult)->tp_name);
        return nullptr;
    }
    ::QPaintEngine *cppResult;
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

QPaintDevice * QPagedPaintDeviceWrapper::redirected(QPoint * offset) const
{
    if (m_PyMethodCache[5])
        return this->::QPaintDevice::redirected(offset);
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return nullptr;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "redirected";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[5] = true;
        return this->::QPaintDevice::redirected(offset);
    }

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)",
        Shiboken::Conversions::pointerToPython(SbkPySide6_QtCoreTypes[SBK_QPOINT_IDX], offset)
    ));

    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
    if (pyResult.isNull()) {
        // An error happened in python code!
        PyErr_Print();
        return nullptr;
    }
    // Check return type
    Shiboken::Conversions::PythonToCppConversion pythonToCpp =
        Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtGuiTypes[SBK_QPAINTDEVICE_IDX], pyResult);
    if (!pythonToCpp) {
        Shiboken::warning(PyExc_RuntimeWarning, 2,
            "Invalid return value in function %s, expected %s, got %s.",
            "QPagedPaintDevice.redirected",
            reinterpret_cast<PyTypeObject *>(Shiboken::SbkType< QPaintDevice >())->tp_name,
            Py_TYPE(pyResult)->tp_name);
        return nullptr;
    }
    ::QPaintDevice *cppResult;
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

bool QPagedPaintDeviceWrapper::setPageLayout(const QPageLayout & pageLayout)
{
    if (m_PyMethodCache[6])
        return this->::QPagedPaintDevice::setPageLayout(pageLayout);
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return false;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "setPageLayout";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[6] = true;
        return this->::QPagedPaintDevice::setPageLayout(pageLayout);
    }

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)",
        Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QPAGELAYOUT_IDX], &pageLayout)
    ));

    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
    if (pyResult.isNull()) {
        // An error happened in python code!
        PyErr_Print();
        return false;
    }
    // Check return type
    Shiboken::Conversions::PythonToCppConversion pythonToCpp =
        Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), pyResult);
    if (!pythonToCpp) {
        Shiboken::warning(PyExc_RuntimeWarning, 2,
            "Invalid return value in function %s, expected %s, got %s.",
            "QPagedPaintDevice.setPageLayout",
            "bool",
            Py_TYPE(pyResult)->tp_name);
        return false;
    }
    bool cppResult;
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

bool QPagedPaintDeviceWrapper::setPageMargins(const QMarginsF & margins, QPageLayout::Unit units)
{
    if (m_PyMethodCache[7])
        return this->::QPagedPaintDevice::setPageMargins(margins, units);
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return false;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "setPageMargins";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[7] = true;
        return this->::QPagedPaintDevice::setPageMargins(margins, units);
    }

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(NN)",
        Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypes[SBK_QMARGINSF_IDX], &margins),
        Shiboken::Conversions::copyToPython(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtGuiTypes[SBK_QPAGELAYOUT_UNIT_IDX]))->converter, &units)
    ));

    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
    if (pyResult.isNull()) {
        // An error happened in python code!
        PyErr_Print();
        return false;
    }
    // Check return type
    Shiboken::Conversions::PythonToCppConversion pythonToCpp =
        Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), pyResult);
    if (!pythonToCpp) {
        Shiboken::warning(PyExc_RuntimeWarning, 2,
            "Invalid return value in function %s, expected %s, got %s.",
            "QPagedPaintDevice.setPageMargins",
            "bool",
            Py_TYPE(pyResult)->tp_name);
        return false;
    }
    bool cppResult;
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

bool QPagedPaintDeviceWrapper::setPageOrientation(QPageLayout::Orientation orientation)
{
    if (m_PyMethodCache[8])
        return this->::QPagedPaintDevice::setPageOrientation(orientation);
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return false;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "setPageOrientation";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[8] = true;
        return this->::QPagedPaintDevice::setPageOrientation(orientation);
    }

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)",
        Shiboken::Conversions::copyToPython(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtGuiTypes[SBK_QPAGELAYOUT_ORIENTATION_IDX]))->converter, &orientation)
    ));

    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
    if (pyResult.isNull()) {
        // An error happened in python code!
        PyErr_Print();
        return false;
    }
    // Check return type
    Shiboken::Conversions::PythonToCppConversion pythonToCpp =
        Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), pyResult);
    if (!pythonToCpp) {
        Shiboken::warning(PyExc_RuntimeWarning, 2,
            "Invalid return value in function %s, expected %s, got %s.",
            "QPagedPaintDevice.setPageOrientation",
            "bool",
            Py_TYPE(pyResult)->tp_name);
        return false;
    }
    bool cppResult;
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

void QPagedPaintDeviceWrapper::setPageRanges(const QPageRanges & ranges)
{
    if (m_PyMethodCache[9]) {
        return this->::QPagedPaintDevice::setPageRanges(ranges);
    }
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "setPageRanges";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[9] = true;
        return this->::QPagedPaintDevice::setPageRanges(ranges);
    }

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)",
        Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QPAGERANGES_IDX], &ranges)
    ));

    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
    if (pyResult.isNull()) {
        // An error happened in python code!
        PyErr_Print();
        return;
    }
}

bool QPagedPaintDeviceWrapper::setPageSize(const QPageSize & pageSize)
{
    if (m_PyMethodCache[10])
        return this->::QPagedPaintDevice::setPageSize(pageSize);
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return false;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "setPageSize";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[10] = true;
        return this->::QPagedPaintDevice::setPageSize(pageSize);
    }

    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)",
        Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QPAGESIZE_IDX], &pageSize)
    ));

    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
    if (pyResult.isNull()) {
        // An error happened in python code!
        PyErr_Print();
        return false;
    }
    // Check return type
    Shiboken::Conversions::PythonToCppConversion pythonToCpp =
        Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), pyResult);
    if (!pythonToCpp) {
        Shiboken::warning(PyExc_RuntimeWarning, 2,
            "Invalid return value in function %s, expected %s, got %s.",
            "QPagedPaintDevice.setPageSize",
            "bool",
            Py_TYPE(pyResult)->tp_name);
        return false;
    }
    bool cppResult;
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

QPainter * QPagedPaintDeviceWrapper::sharedPainter() const
{
    if (m_PyMethodCache[11])
        return this->::QPaintDevice::sharedPainter();
    Shiboken::GilState gil;
    if (PyErr_Occurred())
        return nullptr;
    static PyObject *nameCache[2] = {};
    static const char *funcName = "sharedPainter";
    Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName));
    if (pyOverride.isNull()) {
        gil.release();
        m_PyMethodCache[11] = true;
        return this->::QPaintDevice::sharedPainter();
    }

    Shiboken::AutoDecRef pyArgs(PyTuple_New(0));

    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
    if (pyResult.isNull()) {
        // An error happened in python code!
        PyErr_Print();
        return nullptr;
    }
    // Check return type
    Shiboken::Conversions::PythonToCppConversion pythonToCpp =
        Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtGuiTypes[SBK_QPAINTER_IDX], pyResult);
    if (!pythonToCpp) {
        Shiboken::warning(PyExc_RuntimeWarning, 2,
            "Invalid return value in function %s, expected %s, got %s.",
            "QPagedPaintDevice.sharedPainter",
            reinterpret_cast<PyTypeObject *>(Shiboken::SbkType< QPainter >())->tp_name,
            Py_TYPE(pyResult)->tp_name);
        return nullptr;
    }
    ::QPainter *cppResult;
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

QPagedPaintDeviceWrapper::~QPagedPaintDeviceWrapper()
{
    SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this);
    Shiboken::Object::destroy(wrapper, this);
}

// Target ---------------------------------------------------------

extern "C" {
static PyObject *Sbk_QPagedPaintDeviceFunc_newPage(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QPagedPaintDevice *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QPAGEDPAINTDEVICE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QPagedPaintDevice.newPage";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // newPage()
            if (Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))) {
                PyErr_SetString(PyExc_NotImplementedError, "pure virtual method 'QPagedPaintDevice.newPage()' not implemented.");
                return {};
            }
            bool cppResult = cppSelf->newPage();
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QPagedPaintDeviceFunc_pageLayout(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QPagedPaintDevice *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QPAGEDPAINTDEVICE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QPagedPaintDevice.pageLayout";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // pageLayout()const
            QPageLayout cppResult = const_cast<const ::QPagedPaintDevice *>(cppSelf)->pageLayout();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QPAGELAYOUT_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QPagedPaintDeviceFunc_pageRanges(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QPagedPaintDevice *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QPAGEDPAINTDEVICE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QPagedPaintDevice.pageRanges";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // pageRanges()const
            QPageRanges cppResult = const_cast<const ::QPagedPaintDevice *>(cppSelf)->pageRanges();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtGuiTypes[SBK_QPAGERANGES_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QPagedPaintDeviceFunc_setPageLayout(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QPagedPaintDevice *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QPAGEDPAINTDEVICE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QPagedPaintDevice.setPageLayout";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QPagedPaintDevice::setPageLayout(QPageLayout)->bool
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QPAGELAYOUT_IDX], (pyArg)))) {
        overloadId = 0; // setPageLayout(QPageLayout)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QPagedPaintDeviceFunc_setPageLayout_TypeError;

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::QPageLayout cppArg0_local;
        ::QPageLayout *cppArg0 = &cppArg0_local;
        if (pythonToCpp.isValue())
            pythonToCpp(pyArg, &cppArg0_local);
        else
            pythonToCpp(pyArg, &cppArg0);


        if (!PyErr_Occurred()) {
            // setPageLayout(QPageLayout)
            bool cppResult = Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
                ? cppSelf->::QPagedPaintDevice::setPageLayout(*cppArg0)
                : cppSelf->setPageLayout(*cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QPagedPaintDeviceFunc_setPageLayout_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QPagedPaintDeviceFunc_setPageMargins(PyObject *self, PyObject *args, PyObject *kwds)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QPagedPaintDevice *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QPAGEDPAINTDEVICE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QPagedPaintDevice.setPageMargins";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp[2];
    SBK_UNUSED(pythonToCpp)
    const Py_ssize_t numArgs = PyTuple_GET_SIZE(args);
    SBK_UNUSED(numArgs)
    PyObject *pyArgs[] = {0, 0};

    // invalid argument lengths
    if (numArgs > 2) {
        static PyObject *const too_many = Shiboken::String::createStaticString(">");
        errInfo.reset(too_many);
        Py_INCREF(errInfo.object());
        goto Sbk_QPagedPaintDeviceFunc_setPageMargins_TypeError;
    } else if (numArgs < 1) {
        static PyObject *const too_few = Shiboken::String::createStaticString("<");
        errInfo.reset(too_few);
        Py_INCREF(errInfo.object());
        goto Sbk_QPagedPaintDeviceFunc_setPageMargins_TypeError;
    }

    if (!PyArg_ParseTuple(args, "|OO:setPageMargins", &(pyArgs[0]), &(pyArgs[1])))
        return {};


    // Overloaded function decisor
    // 0: QPagedPaintDevice::setPageMargins(QMarginsF,QPageLayout::Unit)->bool
    if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtCoreTypes[SBK_QMARGINSF_IDX], (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 0; // setPageMargins(QMarginsF,QPageLayout::Unit)
        } else if (numArgs >= 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtGuiTypes[SBK_QPAGELAYOUT_UNIT_IDX]))->converter, (pyArgs[1])))) {
            overloadId = 0; // setPageMargins(QMarginsF,QPageLayout::Unit)
        }
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QPagedPaintDeviceFunc_setPageMargins_TypeError;

    // Call function/method
    {
        if (kwds && PyDict_Size(kwds) > 0) {
            PyObject *value{};
            Shiboken::AutoDecRef kwds_dup(PyDict_Copy(kwds));
            static PyObject *const key_units = Shiboken::String::createStaticString("units");
            if (PyDict_Contains(kwds, key_units)) {
                value = PyDict_GetItem(kwds, key_units);
                if (value && pyArgs[1]) {
                    errInfo.reset(key_units);
                    Py_INCREF(errInfo.object());
                    goto Sbk_QPagedPaintDeviceFunc_setPageMargins_TypeError;
                }
                if (value) {
                    pyArgs[1] = value;
                    if (!(pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtGuiTypes[SBK_QPAGELAYOUT_UNIT_IDX]))->converter, (pyArgs[1]))))
                        goto Sbk_QPagedPaintDeviceFunc_setPageMargins_TypeError;
                }
                PyDict_DelItem(kwds_dup, key_units);
            }
            if (PyDict_Size(kwds_dup) > 0) {
                errInfo.reset(kwds_dup.release());
                goto Sbk_QPagedPaintDeviceFunc_setPageMargins_TypeError;
            }
        }
        if (!Shiboken::Object::isValid(pyArgs[0]))
            return {};
        ::QMarginsF cppArg0_local;
        ::QMarginsF *cppArg0 = &cppArg0_local;
        if (pythonToCpp[0].isValue())
            pythonToCpp[0](pyArgs[0], &cppArg0_local);
        else
            pythonToCpp[0](pyArgs[0], &cppArg0);

        ::QPageLayout::Unit cppArg1(QPageLayout::Millimeter);
        if (pythonToCpp[1])
            pythonToCpp[1](pyArgs[1], &cppArg1);

        if (!PyErr_Occurred()) {
            // setPageMargins(QMarginsF,QPageLayout::Unit)
            bool cppResult = Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
                ? cppSelf->::QPagedPaintDevice::setPageMargins(*cppArg0, cppArg1)
                : cppSelf->setPageMargins(*cppArg0, cppArg1);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QPagedPaintDeviceFunc_setPageMargins_TypeError:
        Shiboken::setErrorAboutWrongArguments(args, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QPagedPaintDeviceFunc_setPageOrientation(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QPagedPaintDevice *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QPAGEDPAINTDEVICE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QPagedPaintDevice.setPageOrientation";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QPagedPaintDevice::setPageOrientation(QPageLayout::Orientation)->bool
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtGuiTypes[SBK_QPAGELAYOUT_ORIENTATION_IDX]))->converter, (pyArg)))) {
        overloadId = 0; // setPageOrientation(QPageLayout::Orientation)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QPagedPaintDeviceFunc_setPageOrientation_TypeError;

    // Call function/method
    {
        ::QPageLayout::Orientation cppArg0{QPageLayout::Portrait};
        pythonToCpp(pyArg, &cppArg0);

        if (!PyErr_Occurred()) {
            // setPageOrientation(QPageLayout::Orientation)
            bool cppResult = Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
                ? cppSelf->::QPagedPaintDevice::setPageOrientation(cppArg0)
                : cppSelf->setPageOrientation(cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QPagedPaintDeviceFunc_setPageOrientation_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QPagedPaintDeviceFunc_setPageRanges(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QPagedPaintDevice *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QPAGEDPAINTDEVICE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QPagedPaintDevice.setPageRanges";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QPagedPaintDevice::setPageRanges(QPageRanges)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QPAGERANGES_IDX], (pyArg)))) {
        overloadId = 0; // setPageRanges(QPageRanges)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QPagedPaintDeviceFunc_setPageRanges_TypeError;

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::QPageRanges cppArg0_local;
        ::QPageRanges *cppArg0 = &cppArg0_local;
        if (pythonToCpp.isValue())
            pythonToCpp(pyArg, &cppArg0_local);
        else
            pythonToCpp(pyArg, &cppArg0);


        if (!PyErr_Occurred()) {
            // setPageRanges(QPageRanges)
            Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
                ? cppSelf->::QPagedPaintDevice::setPageRanges(*cppArg0)
                : cppSelf->setPageRanges(*cppArg0);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QPagedPaintDeviceFunc_setPageRanges_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QPagedPaintDeviceFunc_setPageSize(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QPagedPaintDevice *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QPAGEDPAINTDEVICE_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtGui.QPagedPaintDevice.setPageSize";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QPagedPaintDevice::setPageSize(QPageSize)->bool
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtGuiTypes[SBK_QPAGESIZE_IDX], (pyArg)))) {
        overloadId = 0; // setPageSize(QPageSize)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QPagedPaintDeviceFunc_setPageSize_TypeError;

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::QPageSize cppArg0_local;
        ::QPageSize *cppArg0 = &cppArg0_local;
        if (pythonToCpp.isValue())
            pythonToCpp(pyArg, &cppArg0_local);
        else
            pythonToCpp(pyArg, &cppArg0);


        if (!PyErr_Occurred()) {
            // setPageSize(QPageSize)
            bool cppResult = Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
                ? cppSelf->::QPagedPaintDevice::setPageSize(*cppArg0)
                : cppSelf->setPageSize(*cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;

    Sbk_QPagedPaintDeviceFunc_setPageSize_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}


static const char *Sbk_QPagedPaintDevice_PropertyStrings[] = {
    nullptr // Sentinel
};

static PyMethodDef Sbk_QPagedPaintDevice_methods[] = {
    {"newPage", reinterpret_cast<PyCFunction>(Sbk_QPagedPaintDeviceFunc_newPage), METH_NOARGS},
    {"pageLayout", reinterpret_cast<PyCFunction>(Sbk_QPagedPaintDeviceFunc_pageLayout), METH_NOARGS},
    {"pageRanges", reinterpret_cast<PyCFunction>(Sbk_QPagedPaintDeviceFunc_pageRanges), METH_NOARGS},
    {"setPageLayout", reinterpret_cast<PyCFunction>(Sbk_QPagedPaintDeviceFunc_setPageLayout), METH_O},
    {"setPageMargins", reinterpret_cast<PyCFunction>(Sbk_QPagedPaintDeviceFunc_setPageMargins), METH_VARARGS|METH_KEYWORDS},
    {"setPageOrientation", reinterpret_cast<PyCFunction>(Sbk_QPagedPaintDeviceFunc_setPageOrientation), METH_O},
    {"setPageRanges", reinterpret_cast<PyCFunction>(Sbk_QPagedPaintDeviceFunc_setPageRanges), METH_O},
    {"setPageSize", reinterpret_cast<PyCFunction>(Sbk_QPagedPaintDeviceFunc_setPageSize), METH_O},

    {nullptr, nullptr} // Sentinel
};

static int Sbk_QPagedPaintDevice_setattro(PyObject *self, PyObject *name, PyObject *value)
{
    PySide::Feature::Select(self);
    if (value && PyCallable_Check(value)) {
        auto plain_inst = reinterpret_cast< ::QPagedPaintDevice *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtGuiTypes[SBK_QPAGEDPAINTDEVICE_IDX], reinterpret_cast<SbkObject *>(self)));
        auto inst = dynamic_cast<QPagedPaintDeviceWrapper *>(plain_inst);
        if (inst)
            inst->resetPyMethodCache();
    }
    return PyObject_GenericSetAttr(self, name, value);
}

} // extern "C"

static int Sbk_QPagedPaintDevice_traverse(PyObject *self, visitproc visit, void *arg)
{
    return SbkObject_TypeF()->tp_traverse(self, visit, arg);
}
static int Sbk_QPagedPaintDevice_clear(PyObject *self)
{
    return reinterpret_cast<PyTypeObject *>(SbkObject_TypeF())->tp_clear(self);
}
// Class Definition -----------------------------------------------
extern "C" {
static PyTypeObject *_Sbk_QPagedPaintDevice_Type = nullptr;
static PyTypeObject *Sbk_QPagedPaintDevice_TypeF(void)
{
    return _Sbk_QPagedPaintDevice_Type;
}

static PyType_Slot Sbk_QPagedPaintDevice_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(&SbkDeallocWrapper)},
    {Py_tp_repr,        nullptr},
    {Py_tp_hash,        nullptr},
    {Py_tp_call,        nullptr},
    {Py_tp_str,         nullptr},
    {Py_tp_getattro,    nullptr},
    {Py_tp_setattro,    reinterpret_cast<void *>(Sbk_QPagedPaintDevice_setattro)},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_QPagedPaintDevice_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_QPagedPaintDevice_clear)},
    {Py_tp_richcompare, nullptr},
    {Py_tp_iter,        nullptr},
    {Py_tp_iternext,    nullptr},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_QPagedPaintDevice_methods)},
    {Py_tp_getset,      nullptr},
    {Py_tp_init,        nullptr},
    {Py_tp_new,         reinterpret_cast<void *>(SbkObjectTpNew)},
    {0, nullptr}
};
static PyType_Spec Sbk_QPagedPaintDevice_spec = {
    "2:PySide6.QtGui.QPagedPaintDevice",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_QPagedPaintDevice_slots
};

} //extern "C"

static void *Sbk_QPagedPaintDevice_typeDiscovery(void *cptr, PyTypeObject *instanceType)
{
    if (instanceType == Shiboken::SbkType< ::QPaintDevice >())
        return dynamic_cast< ::QPagedPaintDevice *>(reinterpret_cast< ::QPaintDevice *>(cptr));
    return {};
}


// Type conversion functions.

// Python to C++ enum conversion.
static void QPagedPaintDevice_PdfVersion_PythonToCpp_QPagedPaintDevice_PdfVersion(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QPagedPaintDevice::PdfVersion *>(cppOut) =
        static_cast<::QPagedPaintDevice::PdfVersion>(Shiboken::Enum::getValue(pyIn));

}
static PythonToCppFunc is_QPagedPaintDevice_PdfVersion_PythonToCpp_QPagedPaintDevice_PdfVersion_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, SbkPySide6_QtGuiTypes[SBK_QPAGEDPAINTDEVICE_PDFVERSION_IDX]))
        return QPagedPaintDevice_PdfVersion_PythonToCpp_QPagedPaintDevice_PdfVersion;
    return {};
}
static PyObject *QPagedPaintDevice_PdfVersion_CppToPython_QPagedPaintDevice_PdfVersion(const void *cppIn)
{
    const int castCppIn = int(*reinterpret_cast<const ::QPagedPaintDevice::PdfVersion *>(cppIn));
    return Shiboken::Enum::newItem(SbkPySide6_QtGuiTypes[SBK_QPAGEDPAINTDEVICE_PDFVERSION_IDX], castCppIn);

}

// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity).
static void QPagedPaintDevice_PythonToCpp_QPagedPaintDevice_PTR(PyObject *pyIn, void *cppOut)
{
    Shiboken::Conversions::pythonToCppPointer(Sbk_QPagedPaintDevice_TypeF(), pyIn, cppOut);
}
static PythonToCppFunc is_QPagedPaintDevice_PythonToCpp_QPagedPaintDevice_PTR_Convertible(PyObject *pyIn)
{
    if (pyIn == Py_None)
        return Shiboken::Conversions::nonePythonToCppNullPtr;
    if (PyObject_TypeCheck(pyIn, reinterpret_cast<PyTypeObject *>(Sbk_QPagedPaintDevice_TypeF())))
        return QPagedPaintDevice_PythonToCpp_QPagedPaintDevice_PTR;
    return {};
}

// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity).
static PyObject *QPagedPaintDevice_PTR_CppToPython_QPagedPaintDevice(const void *cppIn)
{
    auto pyOut = reinterpret_cast<PyObject *>(Shiboken::BindingManager::instance().retrieveWrapper(cppIn));
    if (pyOut) {
        Py_INCREF(pyOut);
        return pyOut;
    }
    bool changedTypeName = false;
    auto tCppIn = reinterpret_cast<const ::QPagedPaintDevice *>(cppIn);
    const char *typeName = typeid(*tCppIn).name();
    auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName);
    if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) {
        typeName = typeNameOf(tCppIn);
        changedTypeName = true;
    }
    PyObject *result = Shiboken::Object::newObject(Sbk_QPagedPaintDevice_TypeF(), const_cast<void *>(cppIn), false, /* exactType */ changedTypeName, typeName);
    if (changedTypeName)
        delete [] typeName;
    return result;
}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
static const char *QPagedPaintDevice_SignatureStrings[] = {
    "PySide6.QtGui.QPagedPaintDevice.newPage(self)->bool",
    "PySide6.QtGui.QPagedPaintDevice.pageLayout(self)->PySide6.QtGui.QPageLayout",
    "PySide6.QtGui.QPagedPaintDevice.pageRanges(self)->PySide6.QtGui.QPageRanges",
    "PySide6.QtGui.QPagedPaintDevice.setPageLayout(self,pageLayout:PySide6.QtGui.QPageLayout)->bool",
    "PySide6.QtGui.QPagedPaintDevice.setPageMargins(self,margins:typing.Union[PySide6.QtCore.QMarginsF, PySide6.QtCore.QMargins],units:PySide6.QtGui.QPageLayout.Unit=QPageLayout.Millimeter)->bool",
    "PySide6.QtGui.QPagedPaintDevice.setPageOrientation(self,orientation:PySide6.QtGui.QPageLayout.Orientation)->bool",
    "PySide6.QtGui.QPagedPaintDevice.setPageRanges(self,ranges:PySide6.QtGui.QPageRanges)",
    "PySide6.QtGui.QPagedPaintDevice.setPageSize(self,pageSize:typing.Union[PySide6.QtGui.QPageSize, PySide6.QtGui.QPageSize.PageSizeId, PySide6.QtCore.QSize])->bool",
    nullptr}; // Sentinel

void init_QPagedPaintDevice(PyObject *module)
{
    _Sbk_QPagedPaintDevice_Type = Shiboken::ObjectType::introduceWrapperType(
        module,
        "QPagedPaintDevice",
        "QPagedPaintDevice*",
        &Sbk_QPagedPaintDevice_spec,
        &Shiboken::callCppDestructor< ::QPagedPaintDevice >,
        SbkPySide6_QtGuiTypes[SBK_QPAINTDEVICE_IDX],
        0,
        0);
    auto *pyType = Sbk_QPagedPaintDevice_TypeF(); // references _Sbk_QPagedPaintDevice_Type
    InitSignatureStrings(pyType, QPagedPaintDevice_SignatureStrings);
    SbkObjectType_SetPropertyStrings(reinterpret_cast<PyTypeObject *>(_Sbk_QPagedPaintDevice_Type), Sbk_QPagedPaintDevice_PropertyStrings);
    SbkPySide6_QtGuiTypes[SBK_QPAGEDPAINTDEVICE_IDX]
        = Sbk_QPagedPaintDevice_TypeF();

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_QPagedPaintDevice_TypeF(),
        QPagedPaintDevice_PythonToCpp_QPagedPaintDevice_PTR,
        is_QPagedPaintDevice_PythonToCpp_QPagedPaintDevice_PTR_Convertible,
        QPagedPaintDevice_PTR_CppToPython_QPagedPaintDevice);

    Shiboken::Conversions::registerConverterName(converter, "QPagedPaintDevice");
    Shiboken::Conversions::registerConverterName(converter, "QPagedPaintDevice*");
    Shiboken::Conversions::registerConverterName(converter, "QPagedPaintDevice&");
    Shiboken::Conversions::registerConverterName(converter, typeid(::QPagedPaintDevice).name());
    Shiboken::Conversions::registerConverterName(converter, typeid(::QPagedPaintDeviceWrapper).name());


    Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_QPagedPaintDevice_TypeF(), &Sbk_QPagedPaintDevice_typeDiscovery);

    // Initialization of enums.

    // Initialization of enum 'PdfVersion'.
    SbkPySide6_QtGuiTypes[SBK_QPAGEDPAINTDEVICE_PDFVERSION_IDX] = Shiboken::Enum::createScopedEnum(Sbk_QPagedPaintDevice_TypeF(),
        "PdfVersion",
        "2:PySide6.QtGui.QPagedPaintDevice.PdfVersion",
        "QPagedPaintDevice::PdfVersion");
    if (!SbkPySide6_QtGuiTypes[SBK_QPAGEDPAINTDEVICE_PDFVERSION_IDX])
        return;

    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtGuiTypes[SBK_QPAGEDPAINTDEVICE_PDFVERSION_IDX],
        Sbk_QPagedPaintDevice_TypeF(), "PdfVersion_1_4", (long) QPagedPaintDevice::PdfVersion::PdfVersion_1_4))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtGuiTypes[SBK_QPAGEDPAINTDEVICE_PDFVERSION_IDX],
        Sbk_QPagedPaintDevice_TypeF(), "PdfVersion_A1b", (long) QPagedPaintDevice::PdfVersion::PdfVersion_A1b))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtGuiTypes[SBK_QPAGEDPAINTDEVICE_PDFVERSION_IDX],
        Sbk_QPagedPaintDevice_TypeF(), "PdfVersion_1_6", (long) QPagedPaintDevice::PdfVersion::PdfVersion_1_6))
        return;
    // Register converter for enum 'QPagedPaintDevice::PdfVersion'.
    {
        SbkConverter *converter = Shiboken::Conversions::createConverter(SbkPySide6_QtGuiTypes[SBK_QPAGEDPAINTDEVICE_PDFVERSION_IDX],
            QPagedPaintDevice_PdfVersion_CppToPython_QPagedPaintDevice_PdfVersion);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            QPagedPaintDevice_PdfVersion_PythonToCpp_QPagedPaintDevice_PdfVersion,
            is_QPagedPaintDevice_PdfVersion_PythonToCpp_QPagedPaintDevice_PdfVersion_Convertible);
        Shiboken::Enum::setTypeConverter(SbkPySide6_QtGuiTypes[SBK_QPAGEDPAINTDEVICE_PDFVERSION_IDX], converter, false);
        Shiboken::Conversions::registerConverterName(converter, "QPagedPaintDevice::PdfVersion");
        Shiboken::Conversions::registerConverterName(converter, "PdfVersion");
    }
    // End of 'PdfVersion' enum.

    qRegisterMetaType< ::QPagedPaintDevice::PdfVersion >("QPagedPaintDevice::PdfVersion");
}
