/*
 * Module code.
 *
 * Generated by SIP 6.14.0
 *
 * Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
 * 
 * This file is part of PyQt5.
 * 
 * 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 "sipAPIQtX11Extras.h"

#line 30 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtX11Extras/qx11info_x11.sip"
#include <qx11info_x11.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.11/build/QtX11Extras/sipQtX11Extrascmodule.cpp"

/* Define the strings used by this module. */
const char sipStrings_QtX11Extras[] = {
    'P', 'y', 'Q', 't', '5', '.', 'Q', 't', 'X', '1', '1', 'E', 'x', 't', 'r', 'a', 's', 0,
    's', 'i', 'p', '.', 's', 'i', 'm', 'p', 'l', 'e', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 0,
    's', 'e', 't', 'N', 'e', 'x', 't', 'S', 't', 'a', 'r', 't', 'u', 'p', 'I', 'd', 0,
    'x', 'c', 'b', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 't', 0,
    's', 'e', 't', 'A', 'p', 'p', 'U', 's', 'e', 'r', 'T', 'i', 'm', 'e', 0,
    'a', 'p', 'p', 'R', 'o', 'o', 't', 'W', 'i', 'n', 'd', 'o', 'w', 0,
    'i', 's', 'P', 'l', 'a', 't', 'f', 'o', 'r', 'm', 'X', '1', '1', 0,
    'n', 'e', 'x', 't', 'S', 't', 'a', 'r', 't', 'u', 'p', 'I', 'd', 0,
    'g', 'e', 't', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 0,
    'a', 'p', 'p', 'U', 's', 'e', 'r', 'T', 'i', 'm', 'e', 0,
    'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 0,
    's', 'e', 't', 'A', 'p', 'p', 'T', 'i', 'm', 'e', 0,
    'a', 'p', 'p', 'S', 'c', 'r', 'e', 'e', 'n', 0,
    'Q', 'X', '1', '1', 'I', 'n', 'f', 'o', 0,
    'D', 'i', 's', 'p', 'l', 'a', 'y', 0,
    'a', 'p', 'p', 'D', 'p', 'i', 'X', 0,
    'a', 'p', 'p', 'D', 'p', 'i', 'Y', 0,
    'a', 'p', 'p', 'T', 'i', 'm', 'e', 0,
    'd', 'i', 's', 'p', 'l', 'a', 'y', 0,
    's', 'c', 'r', 'e', 'e', 'n', 0,
};


/*
 * This defines each type in this module.
 */
sipTypeDef *sipExportedTypes_QtX11Extras[] = {
    &sipTypeDef_QtX11Extras_Display.ctd_base,
    &sipTypeDef_QtX11Extras_QX11Info.ctd_base,
    &sipTypeDef_QtX11Extras_xcb_connection_t.ctd_base,
};


/* This defines the types that this module needs to import from QtCore. */
sipImportedTypeDef sipImportedTypes_QtX11Extras_QtCore[] = {
    {"QByteArray"},
    {SIP_NULLPTR}
};


/* This defines the modules that this module needs to import. */
static sipImportedModuleDef importsTable[] = {
    {"PyQt5.QtCore", sipImportedTypes_QtX11Extras_QtCore, SIP_NULLPTR, SIP_NULLPTR},
    {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR}
};


/* This defines this module. */
sipExportedModuleDef sipModuleAPI_QtX11Extras = {
    SIP_NULLPTR,
    15,
    sipNameNr_PyQt5_QtX11Extras,
    0,
    sipStrings_QtX11Extras,
    importsTable,
    SIP_NULLPTR,
    3,
    sipExportedTypes_QtX11Extras,
    SIP_NULLPTR,
    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, SIP_NULLPTR, SIP_NULLPTR},
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
};


/* The SIP API and the APIs of any imported modules. */
const sipAPIDef *sipAPI_QtX11Extras;

sip_qt_metaobject_func sip_QtX11Extras_qt_metaobject;
sip_qt_metacall_func sip_QtX11Extras_qt_metacall;
sip_qt_metacast_func sip_QtX11Extras_qt_metacast;


/* The Python module initialisation function. */
#if defined(SIP_STATIC_MODULE)
extern "C" PyObject *PyInit_QtX11Extras()
#else
PyMODINIT_FUNC PyInit_QtX11Extras()
#endif
{
    static PyMethodDef sip_methods[] = {
        {SIP_NULLPTR, SIP_NULLPTR, 0, SIP_NULLPTR}
    };
    static PyModuleDef sip_module_def = {
        PyModuleDef_HEAD_INIT,
        "PyQt5.QtX11Extras",
        SIP_NULLPTR,
        -1,
        sip_methods,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_NULLPTR
    };

    PyObject *sipModule, *sipModuleDict;
    PyObject *sip_sipmod, *sip_capiobj;

    /* Initialise the module and get it's dictionary. */
    if ((sipModule = PyModule_Create(&sip_module_def)) == SIP_NULLPTR)
        return SIP_NULLPTR;

    sipModuleDict = PyModule_GetDict(sipModule);

    /* Get the SIP module's API. */
    if ((sip_sipmod = PyImport_ImportModule("PyQt5.sip")) == SIP_NULLPTR)
    {
        Py_DECREF(sipModule);
        return SIP_NULLPTR;
    }

    sip_capiobj = PyDict_GetItemString(PyModule_GetDict(sip_sipmod), "_C_API");
    Py_DECREF(sip_sipmod);

    if (sip_capiobj == SIP_NULLPTR || !PyCapsule_CheckExact(sip_capiobj))
    {
        PyErr_SetString(PyExc_AttributeError, "PyQt5.sip._C_API is missing or has the wrong type");
        Py_DECREF(sipModule);
        return SIP_NULLPTR;
    }

    sipAPI_QtX11Extras = reinterpret_cast<const sipAPIDef *>(PyCapsule_GetPointer(sip_capiobj, "PyQt5.sip._C_API"));

    if (sipAPI_QtX11Extras == SIP_NULLPTR)
    {
        Py_DECREF(sipModule);
        return SIP_NULLPTR;
    }

    /* Export the module and publish it's API. */
    if (sipExportModule(&sipModuleAPI_QtX11Extras, 12, 15, 0) < 0)
    {
        Py_DECREF(sipModule);
        return SIP_NULLPTR;
    }


    sip_QtX11Extras_qt_metaobject = (sip_qt_metaobject_func)sipImportSymbol("qtcore_qt_metaobject");
    sip_QtX11Extras_qt_metacall = (sip_qt_metacall_func)sipImportSymbol("qtcore_qt_metacall");
    sip_QtX11Extras_qt_metacast = (sip_qt_metacast_func)sipImportSymbol("qtcore_qt_metacast");

    if (!sip_QtX11Extras_qt_metacast)
        Py_FatalError("Unable to import qtcore_qt_metacast");

    /* Initialise the module now all its dependencies have been set up. */
    if (sipInitModule(&sipModuleAPI_QtX11Extras, sipModuleDict) < 0)
    {
        Py_DECREF(sipModule);
        return SIP_NULLPTR;
    }

    return sipModule;
}
