/*
 * Interface wrapper code.
 *
 * Generated by SIP 4.19.3
 */

#include "sipAPIKConfigCore.h"

#include <kconfig.h>

#include <kconfig.h>


extern "C" {static long slot_KConfig_OpenFlags___hash__(PyObject *);}
static long slot_KConfig_OpenFlags___hash__(PyObject *sipSelf)
{
     ::KConfig::OpenFlags *sipCpp = reinterpret_cast< ::KConfig::OpenFlags *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_KConfig_OpenFlags));

    if (!sipCpp)
        return 0;


    {
        {
            long sipRes = 0;

        sipRes = sipCpp->operator KConfig::OpenFlags::Int();

            return sipRes;
        }
    }

    return 0;
}


extern "C" {static int slot_KConfig_OpenFlags___bool__(PyObject *);}
static int slot_KConfig_OpenFlags___bool__(PyObject *sipSelf)
{
     ::KConfig::OpenFlags *sipCpp = reinterpret_cast< ::KConfig::OpenFlags *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_KConfig_OpenFlags));

    if (!sipCpp)
        return -1;


    {
        {
            int sipRes = 0;

        sipRes = (sipCpp->operator KConfig::OpenFlags::Int() != 0);

            return sipRes;
        }
    }

    return 0;
}


extern "C" {static PyObject *slot_KConfig_OpenFlags___ne__(PyObject *,PyObject *);}
static PyObject *slot_KConfig_OpenFlags___ne__(PyObject *sipSelf,PyObject *sipArg)
{
     ::KConfig::OpenFlags *sipCpp = reinterpret_cast< ::KConfig::OpenFlags *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_KConfig_OpenFlags));

    if (!sipCpp)
        return 0;

    PyObject *sipParseErr = NULL;

    {
        const  ::KConfig::OpenFlags* a0;
        int a0State = 0;

        if (sipParseArgs(&sipParseErr, sipArg, "1J1", sipType_KConfig_OpenFlags, &a0, &a0State))
        {
            bool sipRes = 0;

        sipRes = (sipCpp->operator KConfig::OpenFlags::Int() != a0->operator KConfig::OpenFlags::Int());
            sipReleaseType(const_cast< ::KConfig::OpenFlags *>(a0),sipType_KConfig_OpenFlags,a0State);

            return PyBool_FromLong(sipRes);
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return NULL;

    return sipPySlotExtend(&sipModuleAPI_KConfigCore, ne_slot, sipType_KConfig_OpenFlags, sipSelf, sipArg);
}


extern "C" {static PyObject *slot_KConfig_OpenFlags___eq__(PyObject *,PyObject *);}
static PyObject *slot_KConfig_OpenFlags___eq__(PyObject *sipSelf,PyObject *sipArg)
{
     ::KConfig::OpenFlags *sipCpp = reinterpret_cast< ::KConfig::OpenFlags *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_KConfig_OpenFlags));

    if (!sipCpp)
        return 0;

    PyObject *sipParseErr = NULL;

    {
        const  ::KConfig::OpenFlags* a0;
        int a0State = 0;

        if (sipParseArgs(&sipParseErr, sipArg, "1J1", sipType_KConfig_OpenFlags, &a0, &a0State))
        {
            bool sipRes = 0;

        sipRes = (sipCpp->operator KConfig::OpenFlags::Int() == a0->operator KConfig::OpenFlags::Int());
            sipReleaseType(const_cast< ::KConfig::OpenFlags *>(a0),sipType_KConfig_OpenFlags,a0State);

            return PyBool_FromLong(sipRes);
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return NULL;

    return sipPySlotExtend(&sipModuleAPI_KConfigCore, eq_slot, sipType_KConfig_OpenFlags, sipSelf, sipArg);
}


extern "C" {static PyObject *slot_KConfig_OpenFlags___ixor__(PyObject *,PyObject *);}
static PyObject *slot_KConfig_OpenFlags___ixor__(PyObject *sipSelf,PyObject *sipArg)
{
    if (!PyObject_TypeCheck(sipSelf, sipTypeAsPyTypeObject(sipType_KConfig_OpenFlags)))
    {
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    }

     ::KConfig::OpenFlags *sipCpp = reinterpret_cast< ::KConfig::OpenFlags *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_KConfig_OpenFlags));

    if (!sipCpp)
        return 0;

    PyObject *sipParseErr = NULL;

    {
        int a0;

        if (sipParseArgs(&sipParseErr, sipArg, "1i", &a0))
        {
        *sipCpp = KConfig::OpenFlags(*sipCpp ^ a0);

            Py_INCREF(sipSelf);
            return sipSelf;
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return NULL;

    PyErr_Clear();

    Py_INCREF(Py_NotImplemented);
    return Py_NotImplemented;
}


extern "C" {static PyObject *slot_KConfig_OpenFlags___xor__(PyObject *,PyObject *);}
static PyObject *slot_KConfig_OpenFlags___xor__(PyObject *sipArg0,PyObject *sipArg1)
{
    PyObject *sipParseErr = NULL;

    {
         ::KConfig::OpenFlags* a0;
        int a0State = 0;
        int a1;

        if (sipParsePair(&sipParseErr, sipArg0, sipArg1, "J1i", sipType_KConfig_OpenFlags, &a0, &a0State, &a1))
        {
             ::KConfig::OpenFlags*sipRes;

            sipRes = new  ::KConfig::OpenFlags((*a0 ^ a1));
            sipReleaseType(a0,sipType_KConfig_OpenFlags,a0State);

            return sipConvertFromNewType(sipRes,sipType_KConfig_OpenFlags,NULL);
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return NULL;

    return sipPySlotExtend(&sipModuleAPI_KConfigCore, xor_slot, NULL, sipArg0, sipArg1);
}


extern "C" {static PyObject *slot_KConfig_OpenFlags___ior__(PyObject *,PyObject *);}
static PyObject *slot_KConfig_OpenFlags___ior__(PyObject *sipSelf,PyObject *sipArg)
{
    if (!PyObject_TypeCheck(sipSelf, sipTypeAsPyTypeObject(sipType_KConfig_OpenFlags)))
    {
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    }

     ::KConfig::OpenFlags *sipCpp = reinterpret_cast< ::KConfig::OpenFlags *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_KConfig_OpenFlags));

    if (!sipCpp)
        return 0;

    PyObject *sipParseErr = NULL;

    {
        int a0;

        if (sipParseArgs(&sipParseErr, sipArg, "1i", &a0))
        {
        *sipCpp = KConfig::OpenFlags(*sipCpp | a0);

            Py_INCREF(sipSelf);
            return sipSelf;
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return NULL;

    PyErr_Clear();

    Py_INCREF(Py_NotImplemented);
    return Py_NotImplemented;
}


extern "C" {static PyObject *slot_KConfig_OpenFlags___or__(PyObject *,PyObject *);}
static PyObject *slot_KConfig_OpenFlags___or__(PyObject *sipArg0,PyObject *sipArg1)
{
    PyObject *sipParseErr = NULL;

    {
         ::KConfig::OpenFlags* a0;
        int a0State = 0;
        int a1;

        if (sipParsePair(&sipParseErr, sipArg0, sipArg1, "J1i", sipType_KConfig_OpenFlags, &a0, &a0State, &a1))
        {
             ::KConfig::OpenFlags*sipRes;

            sipRes = new  ::KConfig::OpenFlags((*a0 | a1));
            sipReleaseType(a0,sipType_KConfig_OpenFlags,a0State);

            return sipConvertFromNewType(sipRes,sipType_KConfig_OpenFlags,NULL);
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return NULL;

    return sipPySlotExtend(&sipModuleAPI_KConfigCore, or_slot, NULL, sipArg0, sipArg1);
}


extern "C" {static PyObject *slot_KConfig_OpenFlags___iand__(PyObject *,PyObject *);}
static PyObject *slot_KConfig_OpenFlags___iand__(PyObject *sipSelf,PyObject *sipArg)
{
    if (!PyObject_TypeCheck(sipSelf, sipTypeAsPyTypeObject(sipType_KConfig_OpenFlags)))
    {
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    }

     ::KConfig::OpenFlags *sipCpp = reinterpret_cast< ::KConfig::OpenFlags *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_KConfig_OpenFlags));

    if (!sipCpp)
        return 0;

    PyObject *sipParseErr = NULL;

    {
        int a0;

        if (sipParseArgs(&sipParseErr, sipArg, "1i", &a0))
        {
            sipCpp-> ::KConfig::OpenFlags::operator&=(a0);

            Py_INCREF(sipSelf);
            return sipSelf;
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return NULL;

    PyErr_Clear();

    Py_INCREF(Py_NotImplemented);
    return Py_NotImplemented;
}


extern "C" {static PyObject *slot_KConfig_OpenFlags___and__(PyObject *,PyObject *);}
static PyObject *slot_KConfig_OpenFlags___and__(PyObject *sipArg0,PyObject *sipArg1)
{
    PyObject *sipParseErr = NULL;

    {
         ::KConfig::OpenFlags* a0;
        int a0State = 0;
        int a1;

        if (sipParsePair(&sipParseErr, sipArg0, sipArg1, "J1i", sipType_KConfig_OpenFlags, &a0, &a0State, &a1))
        {
             ::KConfig::OpenFlags*sipRes;

            sipRes = new  ::KConfig::OpenFlags((*a0 & a1));
            sipReleaseType(a0,sipType_KConfig_OpenFlags,a0State);

            return sipConvertFromNewType(sipRes,sipType_KConfig_OpenFlags,NULL);
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return NULL;

    return sipPySlotExtend(&sipModuleAPI_KConfigCore, and_slot, NULL, sipArg0, sipArg1);
}


extern "C" {static PyObject *slot_KConfig_OpenFlags___invert__(PyObject *);}
static PyObject *slot_KConfig_OpenFlags___invert__(PyObject *sipSelf)
{
     ::KConfig::OpenFlags *sipCpp = reinterpret_cast< ::KConfig::OpenFlags *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_KConfig_OpenFlags));

    if (!sipCpp)
        return 0;


    {
        {
             ::KConfig::OpenFlags*sipRes;

            sipRes = new  ::KConfig::OpenFlags(~(*sipCpp));

            return sipConvertFromNewType(sipRes,sipType_KConfig_OpenFlags,NULL);
        }
    }

    return 0;
}


extern "C" {static PyObject *slot_KConfig_OpenFlags___int__(PyObject *);}
static PyObject *slot_KConfig_OpenFlags___int__(PyObject *sipSelf)
{
     ::KConfig::OpenFlags *sipCpp = reinterpret_cast< ::KConfig::OpenFlags *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_KConfig_OpenFlags));

    if (!sipCpp)
        return 0;


    {
        {
            int sipRes;

            sipRes = *sipCpp;

            return SIPLong_FromLong(sipRes);
        }
    }

    return 0;
}


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


extern "C" {static void assign_KConfig_OpenFlags(void *, SIP_SSIZE_T, const void *);}
static void assign_KConfig_OpenFlags(void *sipDst, SIP_SSIZE_T sipDstIdx, const void *sipSrc)
{
    reinterpret_cast< ::KConfig::OpenFlags *>(sipDst)[sipDstIdx] = *reinterpret_cast<const  ::KConfig::OpenFlags *>(sipSrc);
}


extern "C" {static void *array_KConfig_OpenFlags(SIP_SSIZE_T);}
static void *array_KConfig_OpenFlags(SIP_SSIZE_T sipNrElem)
{
    return new  ::KConfig::OpenFlags[sipNrElem];
}


extern "C" {static void *copy_KConfig_OpenFlags(const void *, SIP_SSIZE_T);}
static void *copy_KConfig_OpenFlags(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
{
    return new  ::KConfig::OpenFlags(reinterpret_cast<const  ::KConfig::OpenFlags *>(sipSrc)[sipSrcIdx]);
}


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


extern "C" {static void *init_type_KConfig_OpenFlags(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_KConfig_OpenFlags(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
     ::KConfig::OpenFlags *sipCpp = 0;

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, NULL, sipUnused, ""))
        {
            sipCpp = new  ::KConfig::OpenFlags();

            return sipCpp;
        }
    }

    {
        int a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, NULL, sipUnused, "i", &a0))
        {
            sipCpp = new  ::KConfig::OpenFlags(a0);

            return sipCpp;
        }
    }

    {
        const  ::KConfig::OpenFlags* a0;
        int a0State = 0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, NULL, sipUnused, "J1", sipType_KConfig_OpenFlags, &a0, &a0State))
        {
            sipCpp = new  ::KConfig::OpenFlags(*a0);
            sipReleaseType(const_cast< ::KConfig::OpenFlags *>(a0),sipType_KConfig_OpenFlags,a0State);

            return sipCpp;
        }
    }

    return NULL;
}


extern "C" {static int convertTo_KConfig_OpenFlags(PyObject *, void **, int *, PyObject *);}
static int convertTo_KConfig_OpenFlags(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
{
     ::KConfig::OpenFlags **sipCppPtr = reinterpret_cast< ::KConfig::OpenFlags **>(sipCppPtrV);

// Allow an instance of the base enum whenever a KConfig::OpenFlags is expected.

if (sipIsErr == NULL)
    return (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_KConfig_OpenFlag)) ||
            sipCanConvertToType(sipPy, sipType_KConfig_OpenFlags, SIP_NO_CONVERTORS));

if (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_KConfig_OpenFlag)))
{
    *sipCppPtr = new KConfig::OpenFlags(int(SIPLong_AsLong(sipPy)));

    return sipGetState(sipTransferObj);
}

*sipCppPtr = reinterpret_cast<KConfig::OpenFlags *>(sipConvertToType(sipPy, sipType_KConfig_OpenFlags, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));

return 0;
}


/* Define this type's Python slots. */
static sipPySlotDef slots_KConfig_OpenFlags[] = {
    {(void *)slot_KConfig_OpenFlags___hash__, hash_slot},
    {(void *)slot_KConfig_OpenFlags___bool__, bool_slot},
    {(void *)slot_KConfig_OpenFlags___ne__, ne_slot},
    {(void *)slot_KConfig_OpenFlags___eq__, eq_slot},
    {(void *)slot_KConfig_OpenFlags___ixor__, ixor_slot},
    {(void *)slot_KConfig_OpenFlags___xor__, xor_slot},
    {(void *)slot_KConfig_OpenFlags___ior__, ior_slot},
    {(void *)slot_KConfig_OpenFlags___or__, or_slot},
    {(void *)slot_KConfig_OpenFlags___iand__, iand_slot},
    {(void *)slot_KConfig_OpenFlags___and__, and_slot},
    {(void *)slot_KConfig_OpenFlags___invert__, invert_slot},
    {(void *)slot_KConfig_OpenFlags___int__, int_slot},
    {0, (sipPySlotType)0}
};


static pyqt5ClassPluginDef plugin_KConfig_OpenFlags = {
    0,
    1,
    0,
    0
};


sipClassTypeDef sipTypeDef_KConfigCore_KConfig_OpenFlags = {
    {
        -1,
        0,
        0,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_CLASS,
        sipNameNr_KConfig__OpenFlags,
        {0},
        &plugin_KConfig_OpenFlags
    },
    {
        sipNameNr_OpenFlags,
        {2, 255, 0},
        0, 0,
        0, 0,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    },
    0,
    -1,
    -1,
    0,
    slots_KConfig_OpenFlags,
    init_type_KConfig_OpenFlags,
    0,
    0,
#if PY_MAJOR_VERSION >= 3
    0,
    0,
#else
    0,
    0,
    0,
    0,
#endif
    dealloc_KConfig_OpenFlags,
    assign_KConfig_OpenFlags,
    array_KConfig_OpenFlags,
    copy_KConfig_OpenFlags,
    release_KConfig_OpenFlags,
    0,
    convertTo_KConfig_OpenFlags,
    0,
    0,
    0,
    0,
    0
};
