/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.7.0
 *
 * 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 "sipAPIQtSensors.h"

#line 42 "/build/pyqt6/src/PyQt6-6.4.0/sip/QtSensors/qirproximitysensor.sip"
#include <qirproximitysensor.h>
#line 29 "/build/pyqt6/src/PyQt6-6.4.0/build/QtSensors/sipQtSensorsQIRProximityFilter.cpp"

#line 28 "/build/pyqt6/src/PyQt6-6.4.0/sip/QtSensors/qirproximitysensor.sip"
#include <qirproximitysensor.h>
#line 33 "/build/pyqt6/src/PyQt6-6.4.0/build/QtSensors/sipQtSensorsQIRProximityFilter.cpp"


class sipQIRProximityFilter : public  ::QIRProximityFilter
{
public:
    sipQIRProximityFilter();
    sipQIRProximityFilter(const  ::QIRProximityFilter&);
    virtual ~sipQIRProximityFilter();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    bool filter( ::QIRProximityReading*) SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipQIRProximityFilter(const sipQIRProximityFilter &);
    sipQIRProximityFilter &operator = (const sipQIRProximityFilter &);

    char sipPyMethods[1];
};

sipQIRProximityFilter::sipQIRProximityFilter():  ::QIRProximityFilter(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipQIRProximityFilter::sipQIRProximityFilter(const  ::QIRProximityFilter& a0):  ::QIRProximityFilter(a0), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipQIRProximityFilter::~sipQIRProximityFilter()
{
    sipInstanceDestroyedEx(&sipPySelf);
}

bool sipQIRProximityFilter::filter( ::QIRProximityReading*a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[0], &sipPySelf, sipName_QIRProximityFilter, sipName_filter);

    if (!sipMeth)
        return 0;

    extern bool sipVH_QtSensors_13(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::QIRProximityReading*);

    return sipVH_QtSensors_13(sipGILState, sipImportedVirtErrorHandlers_QtSensors_QtCore[0].iveh_handler, sipPySelf, sipMeth, a0);
}


PyDoc_STRVAR(doc_QIRProximityFilter_filter, "filter(self, QIRProximityReading) -> bool");

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

    {
         ::QIRProximityReading* a0;
         ::QIRProximityFilter *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ8", &sipSelf, sipType_QIRProximityFilter, &sipCpp, sipType_QIRProximityReading, &a0))
        {
            bool sipRes;

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_QIRProximityFilter, sipName_filter);
                return SIP_NULLPTR;
            }

            sipRes = sipCpp->filter(a0);

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QIRProximityFilter, sipName_filter, doc_QIRProximityFilter_filter);

    return SIP_NULLPTR;
}


/* Cast a pointer to a type somewhere in its inheritance hierarchy. */
extern "C" {static void *cast_QIRProximityFilter(void *, const sipTypeDef *);}
static void *cast_QIRProximityFilter(void *sipCppV, const sipTypeDef *targetType)
{
     ::QIRProximityFilter *sipCpp = reinterpret_cast< ::QIRProximityFilter *>(sipCppV);

    if (targetType == sipType_QIRProximityFilter)
        return sipCppV;

    if (targetType == sipType_QSensorFilter)
        return static_cast< ::QSensorFilter *>(sipCpp);

    return SIP_NULLPTR;
}


/* Call the instance's destructor. */
extern "C" {static void release_QIRProximityFilter(void *, int);}
static void release_QIRProximityFilter(void *sipCppV, int sipState)
{
    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipQIRProximityFilter *>(sipCppV);
    else
        delete reinterpret_cast< ::QIRProximityFilter *>(sipCppV);
}


extern "C" {static void dealloc_QIRProximityFilter(sipSimpleWrapper *);}
static void dealloc_QIRProximityFilter(sipSimpleWrapper *sipSelf)
{
    if (sipIsDerivedClass(sipSelf))
        reinterpret_cast<sipQIRProximityFilter *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;

    if (sipIsOwnedByPython(sipSelf))
    {
        release_QIRProximityFilter(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
    }
}


extern "C" {static void *init_type_QIRProximityFilter(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_QIRProximityFilter(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
    sipQIRProximityFilter *sipCpp = SIP_NULLPTR;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::QIRProximityFilter* a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_QIRProximityFilter, &a0))
        {
            sipCpp = new sipQIRProximityFilter(*a0);

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's super-types. */
static sipEncodedTypeDef supers_QIRProximityFilter[] = {{50, 255, 1}};


static PyMethodDef methods_QIRProximityFilter[] = {
    {sipName_filter, meth_QIRProximityFilter_filter, METH_VARARGS, doc_QIRProximityFilter_filter}
};

PyDoc_STRVAR(doc_QIRProximityFilter, "\1QIRProximityFilter()\n"
"QIRProximityFilter(QIRProximityFilter)");


sipClassTypeDef sipTypeDef_QtSensors_QIRProximityFilter = {
    {
        SIP_NULLPTR,
        SIP_TYPE_ABSTRACT|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QIRProximityFilter,
        SIP_NULLPTR,
        SIP_NULLPTR
    },
    {
        sipNameNr_QIRProximityFilter,
        {0, 0, 1},
        1, methods_QIRProximityFilter,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QIRProximityFilter,
    -1,
    -1,
    supers_QIRProximityFilter,
    SIP_NULLPTR,
    init_type_QIRProximityFilter,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QIRProximityFilter,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_QIRProximityFilter,
    cast_QIRProximityFilter,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof ( ::QIRProximityFilter),
};
