/*
 * 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/translation.h>



class sipwxFileTranslationsLoader : public ::wxFileTranslationsLoader
{
public:
    sipwxFileTranslationsLoader();
    sipwxFileTranslationsLoader(const ::wxFileTranslationsLoader&);
    virtual ~sipwxFileTranslationsLoader();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    ::wxMsgCatalog* LoadCatalog(const ::wxString&, const ::wxString&) SIP_OVERRIDE;
    ::wxArrayString GetAvailableTranslations(const ::wxString&) const SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[2];
};

sipwxFileTranslationsLoader::sipwxFileTranslationsLoader(): ::wxFileTranslationsLoader(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

::wxMsgCatalog* sipwxFileTranslationsLoader::LoadCatalog(const ::wxString& domain, const ::wxString& lang)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return ::wxFileTranslationsLoader::LoadCatalog(domain, lang);

    extern ::wxMsgCatalog* sipVH__core_0(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const ::wxString&, const ::wxString&);

    return sipVH__core_0(sipGILState, 0, sipPySelf, sipMeth, domain, lang);
}

::wxArrayString sipwxFileTranslationsLoader::GetAvailableTranslations(const ::wxString& domain) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[1]), const_cast<sipSimpleWrapper **>(&sipPySelf), SIP_NULLPTR, sipName_GetAvailableTranslations);

    if (!sipMeth)
        return ::wxFileTranslationsLoader::GetAvailableTranslations(domain);

    extern ::wxArrayString sipVH__core_1(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const ::wxString&);

    return sipVH__core_1(sipGILState, 0, sipPySelf, sipMeth, domain);
}


PyDoc_STRVAR(doc_wxFileTranslationsLoader_AddCatalogLookupPathPrefix, "AddCatalogLookupPathPrefix(prefix) -> None\n"
"\n"
"Add a prefix to the catalog lookup path: the message catalog files\n"
"will be looked up under prefix/lang/LC_MESSAGES and prefix/lang\n"
"directories (in this order).");

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

    {
        const ::wxString* prefix;
        int prefixState = 0;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "J1", sipType_wxString, &prefix, &prefixState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            ::wxFileTranslationsLoader::AddCatalogLookupPathPrefix(*prefix);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(prefix), sipType_wxString, prefixState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_FileTranslationsLoader, sipName_AddCatalogLookupPathPrefix, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxFileTranslationsLoader_LoadCatalog, "LoadCatalog(self, domain: Any, lang: Any) -> MsgCatalog|None");

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

    {
        const ::wxString* domain;
        int domainState = 0;
        const ::wxString* lang;
        int langState = 0;
        ::wxFileTranslationsLoader *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1J1", &sipSelf, sipType_wxFileTranslationsLoader, &sipCpp, sipType_wxString, &domain, &domainState, sipType_wxString, &lang, &langState))
        {
            ::wxMsgCatalog*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp->::wxFileTranslationsLoader::LoadCatalog(*domain, *lang) : sipCpp->LoadCatalog(*domain, *lang));
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(domain), sipType_wxString, domainState);
            sipReleaseType(const_cast< ::wxString *>(lang), sipType_wxString, langState);

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromType(sipRes, sipType_wxMsgCatalog, SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_FileTranslationsLoader, sipName_LoadCatalog, doc_wxFileTranslationsLoader_LoadCatalog);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxFileTranslationsLoader_GetAvailableTranslations, "GetAvailableTranslations(self, domain: Any) -> Any");

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

    {
        const ::wxString* domain;
        int domainState = 0;
        const ::wxFileTranslationsLoader *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxFileTranslationsLoader, &sipCpp, sipType_wxString, &domain, &domainState))
        {
            ::wxArrayString*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxArrayString((sipSelfWasArg ? sipCpp->::wxFileTranslationsLoader::GetAvailableTranslations(*domain) : sipCpp->GetAvailableTranslations(*domain)));
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(domain), sipType_wxString, domainState);

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_FileTranslationsLoader, sipName_GetAvailableTranslations, doc_wxFileTranslationsLoader_GetAvailableTranslations);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxFileTranslationsLoader)
        return sipCppV;

    if (targetType == sipType_wxTranslationsLoader)
        return static_cast< ::wxTranslationsLoader *>(sipCpp);

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxFileTranslationsLoader *>(sipCppV);
    else
        delete reinterpret_cast< ::wxFileTranslationsLoader *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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


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


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


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


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

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


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

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxFileTranslationsLoader* a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_wxFileTranslationsLoader, &a0))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxFileTranslationsLoader(*a0);
            Py_END_ALLOW_THREADS

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxFileTranslationsLoader[] = {
    {sipName_AddCatalogLookupPathPrefix, SIP_MLMETH_CAST(meth_wxFileTranslationsLoader_AddCatalogLookupPathPrefix), METH_VARARGS|METH_KEYWORDS, doc_wxFileTranslationsLoader_AddCatalogLookupPathPrefix},
    {sipName_GetAvailableTranslations, SIP_MLMETH_CAST(meth_wxFileTranslationsLoader_GetAvailableTranslations), METH_VARARGS|METH_KEYWORDS, doc_wxFileTranslationsLoader_GetAvailableTranslations},
    {sipName_LoadCatalog, SIP_MLMETH_CAST(meth_wxFileTranslationsLoader_LoadCatalog), METH_VARARGS|METH_KEYWORDS, doc_wxFileTranslationsLoader_LoadCatalog}
};

PyDoc_STRVAR(doc_wxFileTranslationsLoader, "Standard wxTranslationsLoader implementation.");


sipClassTypeDef sipTypeDef__core_wxFileTranslationsLoader = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxFileTranslationsLoader,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_FileTranslationsLoader,
        {0, 0, 1},
        3, methods_wxFileTranslationsLoader,
        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_wxFileTranslationsLoader,
    -1,
    -1,
    supers_wxFileTranslationsLoader,
    SIP_NULLPTR,
    init_type_wxFileTranslationsLoader,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxFileTranslationsLoader,
    assign_wxFileTranslationsLoader,
    array_wxFileTranslationsLoader,
    copy_wxFileTranslationsLoader,
    release_wxFileTranslationsLoader,
    cast_wxFileTranslationsLoader,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_wxFileTranslationsLoader,
    sizeof (::wxFileTranslationsLoader),
};
