/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.6.2
 *
 * Copyright (c) 2022 Riverbank Computing Limited <info@riverbankcomputing.com>
 * 
 * This file is part of PyQt5.
 * 
 * This file may be used under the terms of the GNU General Public License
 * version 3.0 as published by the Free Software Foundation and appearing in
 * the file LICENSE included in the packaging of this file.  Please review the
 * following information to ensure the GNU General Public License version 3.0
 * requirements will be met: http://www.gnu.org/copyleft/gpl.html.
 * 
 * If you do not wish to use this file under the terms of the GPL version 3.0
 * then you may purchase a commercial license.  For more information contact
 * info@riverbankcomputing.com.
 * 
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#include "sipAPIQtGui.h"

#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtGui/qsurface.sip"
#include <qsurface.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.7/build/QtGui/sipQtGuiQSurface.cpp"

#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qsize.sip"
#include <qsize.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.7/build/QtGui/sipQtGuiQSurface.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtGui/qsurfaceformat.sip"
#include <qsurfaceformat.h>
#line 36 "/build/pyqt5/src/PyQt5-5.15.7/build/QtGui/sipQtGuiQSurface.cpp"


PyDoc_STRVAR(doc_QSurface_surfaceClass, "surfaceClass(self) -> QSurface.SurfaceClass");

extern "C" {static PyObject *meth_QSurface_surfaceClass(PyObject *, PyObject *);}
static PyObject *meth_QSurface_surfaceClass(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QSurface *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QSurface, &sipCpp))
        {
             ::QSurface::SurfaceClass sipRes;

            sipRes = sipCpp->surfaceClass();

            return sipConvertFromEnum(static_cast<int>(sipRes), sipType_QSurface_SurfaceClass);
        }
    }

    sipNoMethod(sipParseErr, sipName_QSurface, sipName_surfaceClass, doc_QSurface_surfaceClass);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSurface_format, "format(self) -> QSurfaceFormat");

extern "C" {static PyObject *meth_QSurface_format(PyObject *, PyObject *);}
static PyObject *meth_QSurface_format(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    PyObject *sipOrigSelf = sipSelf;

    {
        const  ::QSurface *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QSurface, &sipCpp))
        {
             ::QSurfaceFormat*sipRes;

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_QSurface, sipName_format);
                return SIP_NULLPTR;
            }

            sipRes = new  ::QSurfaceFormat(sipCpp->format());

            return sipConvertFromNewType(sipRes,sipType_QSurfaceFormat,SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QSurface, sipName_format, doc_QSurface_format);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSurface_surfaceType, "surfaceType(self) -> QSurface.SurfaceType");

extern "C" {static PyObject *meth_QSurface_surfaceType(PyObject *, PyObject *);}
static PyObject *meth_QSurface_surfaceType(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    PyObject *sipOrigSelf = sipSelf;

    {
        const  ::QSurface *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QSurface, &sipCpp))
        {
             ::QSurface::SurfaceType sipRes;

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_QSurface, sipName_surfaceType);
                return SIP_NULLPTR;
            }

            sipRes = sipCpp->surfaceType();

            return sipConvertFromEnum(static_cast<int>(sipRes), sipType_QSurface_SurfaceType);
        }
    }

    sipNoMethod(sipParseErr, sipName_QSurface, sipName_surfaceType, doc_QSurface_surfaceType);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSurface_size, "size(self) -> QSize");

extern "C" {static PyObject *meth_QSurface_size(PyObject *, PyObject *);}
static PyObject *meth_QSurface_size(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    PyObject *sipOrigSelf = sipSelf;

    {
        const  ::QSurface *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QSurface, &sipCpp))
        {
             ::QSize*sipRes;

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_QSurface, sipName_size);
                return SIP_NULLPTR;
            }

            sipRes = new  ::QSize(sipCpp->size());

            return sipConvertFromNewType(sipRes,sipType_QSize,SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QSurface, sipName_size, doc_QSurface_size);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QSurface_supportsOpenGL, "supportsOpenGL(self) -> bool");

extern "C" {static PyObject *meth_QSurface_supportsOpenGL(PyObject *, PyObject *);}
static PyObject *meth_QSurface_supportsOpenGL(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QSurface *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QSurface, &sipCpp))
        {
            bool sipRes;

            sipRes = sipCpp->supportsOpenGL();

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QSurface, sipName_supportsOpenGL, doc_QSurface_supportsOpenGL);

    return SIP_NULLPTR;
}


/* Call the instance's destructor. */
extern "C" {static void release_QSurface(void *, int);}
static void release_QSurface(void *sipCppV, int)
{
    delete reinterpret_cast< ::QSurface *>(sipCppV);
}


extern "C" {static void dealloc_QSurface(sipSimpleWrapper *);}
static void dealloc_QSurface(sipSimpleWrapper *sipSelf)
{
    if (sipIsOwnedByPython(sipSelf))
    {
        release_QSurface(sipGetAddress(sipSelf), 0);
    }
}


static PyMethodDef methods_QSurface[] = {
    {sipName_format, meth_QSurface_format, METH_VARARGS, doc_QSurface_format},
    {sipName_size, meth_QSurface_size, METH_VARARGS, doc_QSurface_size},
    {sipName_supportsOpenGL, meth_QSurface_supportsOpenGL, METH_VARARGS, doc_QSurface_supportsOpenGL},
    {sipName_surfaceClass, meth_QSurface_surfaceClass, METH_VARARGS, doc_QSurface_surfaceClass},
    {sipName_surfaceType, meth_QSurface_surfaceType, METH_VARARGS, doc_QSurface_surfaceType}
};

static sipEnumMemberDef enummembers_QSurface[] = {
    {sipName_MetalSurface, static_cast<int>( ::QSurface::MetalSurface), 279},
    {sipName_Offscreen, static_cast<int>( ::QSurface::Offscreen), 278},
    {sipName_OpenGLSurface, static_cast<int>( ::QSurface::OpenGLSurface), 279},
    {sipName_OpenVGSurface, static_cast<int>( ::QSurface::OpenVGSurface), 279},
    {sipName_RasterGLSurface, static_cast<int>( ::QSurface::RasterGLSurface), 279},
    {sipName_RasterSurface, static_cast<int>( ::QSurface::RasterSurface), 279},
    {sipName_VulkanSurface, static_cast<int>( ::QSurface::VulkanSurface), 279},
    {sipName_Window, static_cast<int>( ::QSurface::Window), 278},
};


static pyqt5ClassPluginDef plugin_QSurface = {
    SIP_NULLPTR,
    0,
    SIP_NULLPTR,
    SIP_NULLPTR
};


sipClassTypeDef sipTypeDef_QtGui_QSurface = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_ABSTRACT|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QSurface,
        SIP_NULLPTR,
        &plugin_QSurface
    },
    {
        sipNameNr_QSurface,
        {0, 0, 1},
        5, methods_QSurface,
        8, enummembers_QSurface,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    SIP_NULLPTR,
    -1,
    sipNameNr_sip_simplewrapper,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QSurface,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_QSurface,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    0,
};
