/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.6.2
 *
 * Copyright (c) 2022 Riverbank Computing Limited <info@riverbankcomputing.com>
 * 
 * This file is part of PyQt6.
 * 
 * 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/pyqt6/src/PyQt6-6.3.1/sip/QtGui/qpageranges.sip"
#include <qpageranges.h>
#line 38 "/build/pyqt6/src/PyQt6-6.3.1/sip/QtGui/qpageranges.sip"
#include <qpageranges.h>
#line 31 "/build/pyqt6/src/PyQt6-6.3.1/build/QtGui/sipQtGuiQPageRangesRange.cpp"



PyDoc_STRVAR(doc_QPageRanges_Range_contains, "contains(self, int) -> bool");

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

    {
        int a0;
        const  ::QPageRanges::Range *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "Bi", &sipSelf, sipType_QPageRanges_Range, &sipCpp, &a0))
        {
            bool sipRes;

            sipRes = sipCpp->contains(a0);

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_Range, sipName_contains, doc_QPageRanges_Range_contains);

    return SIP_NULLPTR;
}


extern "C" {static PyObject *slot_QPageRanges_Range___ge__(PyObject *,PyObject *);}
static PyObject *slot_QPageRanges_Range___ge__(PyObject *sipSelf,PyObject *sipArg)
{
     ::QPageRanges::Range *sipCpp = reinterpret_cast< ::QPageRanges::Range *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_QPageRanges_Range));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::QPageRanges::Range* a0;

        if (sipParseArgs(&sipParseErr, sipArg, "1J9", sipType_QPageRanges_Range, &a0))
        {
            bool sipRes;

            sipRes = !operator<((*sipCpp), *a0);

            return PyBool_FromLong(sipRes);
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return SIP_NULLPTR;

    return sipPySlotExtend(&sipModuleAPI_QtGui, ge_slot, sipType_QPageRanges_Range, sipSelf, sipArg);
}


extern "C" {static PyObject *slot_QPageRanges_Range___eq__(PyObject *,PyObject *);}
static PyObject *slot_QPageRanges_Range___eq__(PyObject *sipSelf,PyObject *sipArg)
{
     ::QPageRanges::Range *sipCpp = reinterpret_cast< ::QPageRanges::Range *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_QPageRanges_Range));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::QPageRanges::Range* a0;

        if (sipParseArgs(&sipParseErr, sipArg, "1J9", sipType_QPageRanges_Range, &a0))
        {
            bool sipRes;

            sipRes = operator==((*sipCpp), *a0);

            return PyBool_FromLong(sipRes);
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return SIP_NULLPTR;

    return sipPySlotExtend(&sipModuleAPI_QtGui, eq_slot, sipType_QPageRanges_Range, sipSelf, sipArg);
}


extern "C" {static PyObject *slot_QPageRanges_Range___ne__(PyObject *,PyObject *);}
static PyObject *slot_QPageRanges_Range___ne__(PyObject *sipSelf,PyObject *sipArg)
{
     ::QPageRanges::Range *sipCpp = reinterpret_cast< ::QPageRanges::Range *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_QPageRanges_Range));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::QPageRanges::Range* a0;

        if (sipParseArgs(&sipParseErr, sipArg, "1J9", sipType_QPageRanges_Range, &a0))
        {
            bool sipRes;

            sipRes = operator!=((*sipCpp), *a0);

            return PyBool_FromLong(sipRes);
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return SIP_NULLPTR;

    return sipPySlotExtend(&sipModuleAPI_QtGui, ne_slot, sipType_QPageRanges_Range, sipSelf, sipArg);
}


extern "C" {static PyObject *slot_QPageRanges_Range___lt__(PyObject *,PyObject *);}
static PyObject *slot_QPageRanges_Range___lt__(PyObject *sipSelf,PyObject *sipArg)
{
     ::QPageRanges::Range *sipCpp = reinterpret_cast< ::QPageRanges::Range *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_QPageRanges_Range));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::QPageRanges::Range* a0;

        if (sipParseArgs(&sipParseErr, sipArg, "1J9", sipType_QPageRanges_Range, &a0))
        {
            bool sipRes;

            sipRes = operator<((*sipCpp), *a0);

            return PyBool_FromLong(sipRes);
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return SIP_NULLPTR;

    return sipPySlotExtend(&sipModuleAPI_QtGui, lt_slot, sipType_QPageRanges_Range, sipSelf, sipArg);
}


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


extern "C" {static void *array_QPageRanges_Range(Py_ssize_t);}
static void *array_QPageRanges_Range(Py_ssize_t sipNrElem)
{
    return new  ::QPageRanges::Range[sipNrElem];
}


extern "C" {static void array_delete_QPageRanges_Range(void *);}
static void array_delete_QPageRanges_Range(void *sipCpp)
{
    delete[] reinterpret_cast< ::QPageRanges::Range *>(sipCpp);
}


extern "C" {static void assign_QPageRanges_Range(void *, Py_ssize_t, void *);}
static void assign_QPageRanges_Range(void *sipDst, Py_ssize_t sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::QPageRanges::Range *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::QPageRanges::Range *>(sipSrc);
}


extern "C" {static void *copy_QPageRanges_Range(const void *, Py_ssize_t);}
static void *copy_QPageRanges_Range(const void *sipSrc, Py_ssize_t sipSrcIdx)
{
    return new  ::QPageRanges::Range(reinterpret_cast<const  ::QPageRanges::Range *>(sipSrc)[sipSrcIdx]);
}


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


extern "C" {static void *init_type_QPageRanges_Range(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_QPageRanges_Range(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
     ::QPageRanges::Range *sipCpp = SIP_NULLPTR;

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            sipCpp = new  ::QPageRanges::Range();

            return sipCpp;
        }
    }

    {
        const  ::QPageRanges::Range* a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_QPageRanges_Range, &a0))
        {
            sipCpp = new  ::QPageRanges::Range(*a0);

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's Python slots. */
static sipPySlotDef slots_QPageRanges_Range[] = {
    {(void *)slot_QPageRanges_Range___ge__, ge_slot},
    {(void *)slot_QPageRanges_Range___eq__, eq_slot},
    {(void *)slot_QPageRanges_Range___ne__, ne_slot},
    {(void *)slot_QPageRanges_Range___lt__, lt_slot},
    {0, (sipPySlotType)0}
};


static PyMethodDef methods_QPageRanges_Range[] = {
    {sipName_contains, meth_QPageRanges_Range_contains, METH_VARARGS, doc_QPageRanges_Range_contains}
};


extern "C" {static PyObject *varget_QPageRanges_Range_from(void *, PyObject *, PyObject *);}
static PyObject *varget_QPageRanges_Range_from(void *sipSelf, PyObject *, PyObject *)
{
    int sipVal;
     ::QPageRanges::Range *sipCpp = reinterpret_cast< ::QPageRanges::Range *>(sipSelf);

    sipVal = sipCpp->from;

    return PyLong_FromLong(sipVal);
}


extern "C" {static int varset_QPageRanges_Range_from(void *, PyObject *, PyObject *);}
static int varset_QPageRanges_Range_from(void *sipSelf, PyObject *sipPy, PyObject *)
{
    int sipVal;
     ::QPageRanges::Range *sipCpp = reinterpret_cast< ::QPageRanges::Range *>(sipSelf);

    sipVal = sipLong_AsInt(sipPy);

    if (PyErr_Occurred() != SIP_NULLPTR)
        return -1;

    sipCpp->from = sipVal;

    return 0;
}


extern "C" {static PyObject *varget_QPageRanges_Range_to(void *, PyObject *, PyObject *);}
static PyObject *varget_QPageRanges_Range_to(void *sipSelf, PyObject *, PyObject *)
{
    int sipVal;
     ::QPageRanges::Range *sipCpp = reinterpret_cast< ::QPageRanges::Range *>(sipSelf);

    sipVal = sipCpp->to;

    return PyLong_FromLong(sipVal);
}


extern "C" {static int varset_QPageRanges_Range_to(void *, PyObject *, PyObject *);}
static int varset_QPageRanges_Range_to(void *sipSelf, PyObject *sipPy, PyObject *)
{
    int sipVal;
     ::QPageRanges::Range *sipCpp = reinterpret_cast< ::QPageRanges::Range *>(sipSelf);

    sipVal = sipLong_AsInt(sipPy);

    if (PyErr_Occurred() != SIP_NULLPTR)
        return -1;

    sipCpp->to = sipVal;

    return 0;
}

sipVariableDef variables_QPageRanges_Range[] = {
    {InstanceVariable, sipName_from_, (PyMethodDef *)varget_QPageRanges_Range_from, (PyMethodDef *)varset_QPageRanges_Range_from, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_to, (PyMethodDef *)varget_QPageRanges_Range_to, (PyMethodDef *)varset_QPageRanges_Range_to, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_QPageRanges_Range, "\1QPageRanges.Range()\n"
"QPageRanges.Range(QPageRanges.Range)");


sipClassTypeDef sipTypeDef_QtGui_QPageRanges_Range = {
    {
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QPageRanges__Range,
        SIP_NULLPTR,
        SIP_NULLPTR
    },
    {
        sipNameNr_Range,
        {177, 255, 0},
        1, methods_QPageRanges_Range,
        2, variables_QPageRanges_Range,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QPageRanges_Range,
    -1,
    sipNameNr_PyQt6_sip_simplewrapper,
    SIP_NULLPTR,
    slots_QPageRanges_Range,
    init_type_QPageRanges_Range,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QPageRanges_Range,
    assign_QPageRanges_Range,
    array_QPageRanges_Range,
    copy_QPageRanges_Range,
    release_QPageRanges_Range,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QPageRanges_Range,
    sizeof ( ::QPageRanges::Range),
};
