/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.15.1
 *
 *     Copyright: (c) 2020 by Total Control Software
 *     License:   wxWindows License
 */

#include "sipAPI_core.h"
        #include <wx/fontenum.h>



class sipwxFontEnumerator : public ::wxFontEnumerator
{
public:
    sipwxFontEnumerator();
    virtual ~sipwxFontEnumerator();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    bool OnFontEncoding(const ::wxString&, const ::wxString&) SIP_OVERRIDE;
    bool OnFacename(const ::wxString&) SIP_OVERRIDE;
    bool EnumerateFacenames(::wxFontEncoding, bool) SIP_OVERRIDE;
    bool EnumerateEncodings(const ::wxString&) SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[4];
};

sipwxFontEnumerator::sipwxFontEnumerator(): ::wxFontEnumerator(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

bool sipwxFontEnumerator::OnFontEncoding(const ::wxString& font, const ::wxString& encoding)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[0], &sipPySelf, SIP_NULLPTR, sipName_OnFontEncoding);

    if (!sipMeth)
        return ::wxFontEnumerator::OnFontEncoding(font, encoding);

    extern bool sipVH__core_19(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const ::wxString&, const ::wxString&);

    return sipVH__core_19(sipGILState, 0, sipPySelf, sipMeth, font, encoding);
}

bool sipwxFontEnumerator::OnFacename(const ::wxString& font)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[1], &sipPySelf, SIP_NULLPTR, sipName_OnFacename);

    if (!sipMeth)
        return ::wxFontEnumerator::OnFacename(font);

    extern bool sipVH__core_9(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const ::wxString&);

    return sipVH__core_9(sipGILState, 0, sipPySelf, sipMeth, font);
}

bool sipwxFontEnumerator::EnumerateFacenames(::wxFontEncoding encoding, bool fixedWidthOnly)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[2], &sipPySelf, SIP_NULLPTR, sipName_EnumerateFacenames);

    if (!sipMeth)
        return ::wxFontEnumerator::EnumerateFacenames(encoding, fixedWidthOnly);

    extern bool sipVH__core_232(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxFontEncoding, bool);

    return sipVH__core_232(sipGILState, 0, sipPySelf, sipMeth, encoding, fixedWidthOnly);
}

bool sipwxFontEnumerator::EnumerateEncodings(const ::wxString& font)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[3], &sipPySelf, SIP_NULLPTR, sipName_EnumerateEncodings);

    if (!sipMeth)
        return ::wxFontEnumerator::EnumerateEncodings(font);

    extern bool sipVH__core_9(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const ::wxString&);

    return sipVH__core_9(sipGILState, 0, sipPySelf, sipMeth, font);
}


PyDoc_STRVAR(doc_wxFontEnumerator_EnumerateEncodings, "EnumerateEncodings(font='') -> bool\n"
"\n"
"Call OnFontEncoding() for each encoding supported by the given font -\n"
"or for each encoding supported by at least some font if font is not\n"
"specified.");

extern "C" {static PyObject *meth_wxFontEnumerator_EnumerateEncodings(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxFontEnumerator_EnumerateEncodings(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        const ::wxString& fontdef = wxEmptyString;
        const ::wxString* font = &fontdef;
        int fontState = 0;
        ::wxFontEnumerator *sipCpp;

        static const char *sipKwdList[] = {
            sipName_font,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|J1", &sipSelf, sipType_wxFontEnumerator, &sipCpp, sipType_wxString, &font, &fontState))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp->::wxFontEnumerator::EnumerateEncodings(*font) : sipCpp->EnumerateEncodings(*font));
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(font), sipType_wxString, fontState);

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_FontEnumerator, sipName_EnumerateEncodings, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxFontEnumerator_EnumerateFacenames, "EnumerateFacenames(encoding=FONTENCODING_SYSTEM, fixedWidthOnly=False) -> bool\n"
"\n"
"Call OnFacename() for each font which supports given encoding (only if\n"
"it is not wxFONTENCODING_SYSTEM) and is of fixed width (if\n"
"fixedWidthOnly is true).");

extern "C" {static PyObject *meth_wxFontEnumerator_EnumerateFacenames(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxFontEnumerator_EnumerateFacenames(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        ::wxFontEncoding encoding = wxFONTENCODING_SYSTEM;
        bool fixedWidthOnly = 0;
        ::wxFontEnumerator *sipCpp;

        static const char *sipKwdList[] = {
            sipName_encoding,
            sipName_fixedWidthOnly,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|Eb", &sipSelf, sipType_wxFontEnumerator, &sipCpp, sipType_wxFontEncoding, &encoding, &fixedWidthOnly))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp->::wxFontEnumerator::EnumerateFacenames(encoding, fixedWidthOnly) : sipCpp->EnumerateFacenames(encoding, fixedWidthOnly));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_FontEnumerator, sipName_EnumerateFacenames, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxFontEnumerator_OnFacename, "OnFacename(font) -> bool\n"
"\n"
"Called by EnumerateFacenames() for each match.");

extern "C" {static PyObject *meth_wxFontEnumerator_OnFacename(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxFontEnumerator_OnFacename(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        const ::wxString* font;
        int fontState = 0;
        ::wxFontEnumerator *sipCpp;

        static const char *sipKwdList[] = {
            sipName_font,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxFontEnumerator, &sipCpp, sipType_wxString, &font, &fontState))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp->::wxFontEnumerator::OnFacename(*font) : sipCpp->OnFacename(*font));
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(font), sipType_wxString, fontState);

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_FontEnumerator, sipName_OnFacename, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxFontEnumerator_OnFontEncoding, "OnFontEncoding(font, encoding) -> bool\n"
"\n"
"Called by EnumerateEncodings() for each match.");

extern "C" {static PyObject *meth_wxFontEnumerator_OnFontEncoding(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxFontEnumerator_OnFontEncoding(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        const ::wxString* font;
        int fontState = 0;
        const ::wxString* encoding;
        int encodingState = 0;
        ::wxFontEnumerator *sipCpp;

        static const char *sipKwdList[] = {
            sipName_font,
            sipName_encoding,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1J1", &sipSelf, sipType_wxFontEnumerator, &sipCpp, sipType_wxString, &font, &fontState, sipType_wxString, &encoding, &encodingState))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp->::wxFontEnumerator::OnFontEncoding(*font, *encoding) : sipCpp->OnFontEncoding(*font, *encoding));
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(font), sipType_wxString, fontState);
            sipReleaseType(const_cast< ::wxString *>(encoding), sipType_wxString, encodingState);

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_FontEnumerator, sipName_OnFontEncoding, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxFontEnumerator_GetEncodings, "GetEncodings(facename='') -> List[str]\n"
"\n"
"Return array of strings containing all encodings found by\n"
"EnumerateEncodings().");

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

    {
        const ::wxString& facenamedef = wxEmptyString;
        const ::wxString* facename = &facenamedef;
        int facenameState = 0;

        static const char *sipKwdList[] = {
            sipName_facename,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "|J1", sipType_wxString, &facename, &facenameState))
        {
            ::wxArrayString*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxArrayString(::wxFontEnumerator::GetEncodings(*facename));
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(facename), sipType_wxString, facenameState);

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_FontEnumerator, sipName_GetEncodings, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxFontEnumerator_GetFacenames, "GetFacenames(encoding=FONTENCODING_SYSTEM, fixedWidthOnly=False) -> List[str]\n"
"\n"
"Return array of strings containing all facenames found by\n"
"EnumerateFacenames().");

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

    {
        ::wxFontEncoding encoding = wxFONTENCODING_SYSTEM;
        bool fixedWidthOnly = 0;

        static const char *sipKwdList[] = {
            sipName_encoding,
            sipName_fixedWidthOnly,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "|Eb", sipType_wxFontEncoding, &encoding, &fixedWidthOnly))
        {
            ::wxArrayString*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxArrayString(::wxFontEnumerator::GetFacenames(encoding, fixedWidthOnly));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_FontEnumerator, sipName_GetFacenames, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxFontEnumerator_IsValidFacename, "IsValidFacename(facename) -> bool\n"
"\n"
"Returns true if the given string is valid face name, i.e.");

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

    {
        const ::wxString* facename;
        int facenameState = 0;

        static const char *sipKwdList[] = {
            sipName_facename,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "J1", sipType_wxString, &facename, &facenameState))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = ::wxFontEnumerator::IsValidFacename(*facename);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(facename), sipType_wxString, facenameState);

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_FontEnumerator, sipName_IsValidFacename, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxFontEnumerator_InvalidateCache, "InvalidateCache() -> None\n"
"\n"
"Invalidate cache used by some of the methods of this class internally.");

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

    {
        if (sipParseArgs(&sipParseErr, sipArgs, ""))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            ::wxFontEnumerator::InvalidateCache();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_FontEnumerator, sipName_InvalidateCache, SIP_NULLPTR);

    return SIP_NULLPTR;
}


/* Call the instance's destructor. */
extern "C" {static void release_wxFontEnumerator(void *, int);}
static void release_wxFontEnumerator(void *sipCppV, int sipState)
{
    Py_BEGIN_ALLOW_THREADS

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxFontEnumerator *>(sipCppV);
    else
        delete reinterpret_cast< ::wxFontEnumerator *>(sipCppV);

    Py_END_ALLOW_THREADS
}


extern "C" {static void *array_wxFontEnumerator(Py_ssize_t);}
static void *array_wxFontEnumerator(Py_ssize_t sipNrElem)
{
    return new ::wxFontEnumerator[sipNrElem];
}


extern "C" {static void array_delete_wxFontEnumerator(void *);}
static void array_delete_wxFontEnumerator(void *sipCpp)
{
    delete[] reinterpret_cast< ::wxFontEnumerator *>(sipCpp);
}


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

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


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

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxFontEnumerator();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
            {
                delete sipCpp;
                return SIP_NULLPTR;
            }

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_wxFontEnumerator[] = {
    {sipName_EnumerateEncodings, SIP_MLMETH_CAST(meth_wxFontEnumerator_EnumerateEncodings), METH_VARARGS|METH_KEYWORDS, doc_wxFontEnumerator_EnumerateEncodings},
    {sipName_EnumerateFacenames, SIP_MLMETH_CAST(meth_wxFontEnumerator_EnumerateFacenames), METH_VARARGS|METH_KEYWORDS, doc_wxFontEnumerator_EnumerateFacenames},
    {sipName_GetEncodings, SIP_MLMETH_CAST(meth_wxFontEnumerator_GetEncodings), METH_VARARGS|METH_KEYWORDS, doc_wxFontEnumerator_GetEncodings},
    {sipName_GetFacenames, SIP_MLMETH_CAST(meth_wxFontEnumerator_GetFacenames), METH_VARARGS|METH_KEYWORDS, doc_wxFontEnumerator_GetFacenames},
    {sipName_InvalidateCache, meth_wxFontEnumerator_InvalidateCache, METH_VARARGS, doc_wxFontEnumerator_InvalidateCache},
    {sipName_IsValidFacename, SIP_MLMETH_CAST(meth_wxFontEnumerator_IsValidFacename), METH_VARARGS|METH_KEYWORDS, doc_wxFontEnumerator_IsValidFacename},
    {sipName_OnFacename, SIP_MLMETH_CAST(meth_wxFontEnumerator_OnFacename), METH_VARARGS|METH_KEYWORDS, doc_wxFontEnumerator_OnFacename},
    {sipName_OnFontEncoding, SIP_MLMETH_CAST(meth_wxFontEnumerator_OnFontEncoding), METH_VARARGS|METH_KEYWORDS, doc_wxFontEnumerator_OnFontEncoding}
};

PyDoc_STRVAR(doc_wxFontEnumerator, "FontEnumerator() -> None\n"
"\n"
"wxFontEnumerator enumerates either all available fonts on the system\n"
"or only the ones with given attributes - either only fixed-width\n"
"(suited for use in programs such as terminal emulators and the like)\n"
"or the fonts available in the given encoding).");


sipClassTypeDef sipTypeDef__core_wxFontEnumerator = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxFontEnumerator,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_FontEnumerator,
        {0, 0, 1},
        8, methods_wxFontEnumerator,
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxFontEnumerator,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_wxFontEnumerator,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxFontEnumerator,
    SIP_NULLPTR,
    array_wxFontEnumerator,
    SIP_NULLPTR,
    release_wxFontEnumerator,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_wxFontEnumerator,
    sizeof (::wxFontEnumerator),
};
