// WARNING: Please don't edit this file. It was generated by Python/WinRT v1.0.0-beta.2

#include "pybase.h"
#include "py.Windows.Gaming.UI.h"

PyTypeObject* py::winrt_type<winrt::Windows::Gaming::UI::GameBar>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::Gaming::UI::GameChatOverlay>::python_type;

namespace py::cpp::Windows::Gaming::UI
{
    // ----- GameBar class --------------------
    constexpr const char* const _type_name_GameBar = "GameBar";

    static PyObject* _new_GameBar(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(_type_name_GameBar);
        return nullptr;
    }

    static PyObject* GameBar_get_IsInputRedirected(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(winrt::Windows::Gaming::UI::GameBar::IsInputRedirected());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* GameBar_get_Visible(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(winrt::Windows::Gaming::UI::GameBar::Visible());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* GameBar_add_IsInputRedirectedChanged(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable>>(arg);

            return py::convert(winrt::Windows::Gaming::UI::GameBar::IsInputRedirectedChanged(param0));
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* GameBar_remove_IsInputRedirectedChanged(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto param0 = py::convert_to<winrt::event_token>(arg);

            winrt::Windows::Gaming::UI::GameBar::IsInputRedirectedChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* GameBar_add_VisibilityChanged(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable>>(arg);

            return py::convert(winrt::Windows::Gaming::UI::GameBar::VisibilityChanged(param0));
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* GameBar_remove_VisibilityChanged(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto param0 = py::convert_to<winrt::event_token>(arg);

            winrt::Windows::Gaming::UI::GameBar::VisibilityChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_GameBar[] = {
        { "get_is_input_redirected", reinterpret_cast<PyCFunction>(GameBar_get_IsInputRedirected), METH_NOARGS | METH_STATIC, nullptr },
        { "get_visible", reinterpret_cast<PyCFunction>(GameBar_get_Visible), METH_NOARGS | METH_STATIC, nullptr },
        { "add_is_input_redirected_changed", reinterpret_cast<PyCFunction>(GameBar_add_IsInputRedirectedChanged), METH_O | METH_STATIC, nullptr },
        { "remove_is_input_redirected_changed", reinterpret_cast<PyCFunction>(GameBar_remove_IsInputRedirectedChanged), METH_O | METH_STATIC, nullptr },
        { "add_visibility_changed", reinterpret_cast<PyCFunction>(GameBar_add_VisibilityChanged), METH_O | METH_STATIC, nullptr },
        { "remove_visibility_changed", reinterpret_cast<PyCFunction>(GameBar_remove_VisibilityChanged), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_GameBar[] = {
        { }
    };

    static PyType_Slot _type_slots_GameBar[] = 
    {
        { Py_tp_new, _new_GameBar },
        { Py_tp_methods, _methods_GameBar },
        { Py_tp_getset, _getset_GameBar },
        { },
    };

    static PyType_Spec _type_spec_GameBar =
    {
        "_winsdk_Windows_Gaming_UI.GameBar",
        0,
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_GameBar
    };

    // ----- GameChatOverlay class --------------------
    constexpr const char* const _type_name_GameChatOverlay = "GameChatOverlay";

    static PyObject* _new_GameChatOverlay(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(_type_name_GameChatOverlay);
        return nullptr;
    }

    static void _dealloc_GameChatOverlay(py::wrapper::Windows::Gaming::UI::GameChatOverlay* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* GameChatOverlay_AddMessage(py::wrapper::Windows::Gaming::UI::GameChatOverlay* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 3)
        {
            try
            {
                auto param0 = py::convert_to<winrt::hstring>(args, 0);
                auto param1 = py::convert_to<winrt::hstring>(args, 1);
                auto param2 = py::convert_to<winrt::Windows::Gaming::UI::GameChatMessageOrigin>(args, 2);

                self->obj.AddMessage(param0, param1, param2);
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* GameChatOverlay_GetDefault(PyObject* /*unused*/, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            try
            {
                return py::convert(winrt::Windows::Gaming::UI::GameChatOverlay::GetDefault());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* GameChatOverlay_get_DesiredPosition(py::wrapper::Windows::Gaming::UI::GameChatOverlay* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.DesiredPosition());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int GameChatOverlay_put_DesiredPosition(py::wrapper::Windows::Gaming::UI::GameChatOverlay* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_TypeError, "property delete not supported");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Gaming::UI::GameChatOverlayPosition>(arg);

            self->obj.DesiredPosition(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* _from_GameChatOverlay(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Gaming::UI::GameChatOverlay>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_GameChatOverlay[] = {
        { "add_message", reinterpret_cast<PyCFunction>(GameChatOverlay_AddMessage), METH_VARARGS, nullptr },
        { "get_default", reinterpret_cast<PyCFunction>(GameChatOverlay_GetDefault), METH_VARARGS | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_GameChatOverlay), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_GameChatOverlay[] = {
        { "desired_position", reinterpret_cast<getter>(GameChatOverlay_get_DesiredPosition), reinterpret_cast<setter>(GameChatOverlay_put_DesiredPosition), nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_GameChatOverlay[] = 
    {
        { Py_tp_new, _new_GameChatOverlay },
        { Py_tp_dealloc, _dealloc_GameChatOverlay },
        { Py_tp_methods, _methods_GameChatOverlay },
        { Py_tp_getset, _getset_GameChatOverlay },
        { },
    };

    static PyType_Spec _type_spec_GameChatOverlay =
    {
        "_winsdk_Windows_Gaming_UI.GameChatOverlay",
        sizeof(py::wrapper::Windows::Gaming::UI::GameChatOverlay),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_GameChatOverlay
    };

    // ----- Windows.Gaming.UI Initialization --------------------
    static int module_exec(PyObject* module) noexcept
    {
        try
        {
            py::pyobj_handle bases { PyTuple_Pack(1, py::winrt_type<py::Object>::python_type) };

            py::winrt_type<winrt::Windows::Gaming::UI::GameBar>::python_type = py::register_python_type(module, _type_name_GameBar, &_type_spec_GameBar, nullptr);
            py::winrt_type<winrt::Windows::Gaming::UI::GameChatOverlay>::python_type = py::register_python_type(module, _type_name_GameChatOverlay, &_type_spec_GameChatOverlay, bases.get());

            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyModuleDef_Slot module_slots[] = {{Py_mod_exec, module_exec}, {}};

    PyDoc_STRVAR(module_doc, "Windows.Gaming.UI");

    static PyModuleDef module_def
        = {PyModuleDef_HEAD_INIT,
           "_winsdk_Windows_Gaming_UI",
           module_doc,
           0,
           nullptr,
           module_slots,
           nullptr,
           nullptr,
           nullptr};
} // py::cpp::Windows::Gaming::UI

PyMODINIT_FUNC
PyInit__winsdk_Windows_Gaming_UI (void) noexcept
{
    return PyModuleDef_Init(&py::cpp::Windows::Gaming::UI::module_def);
}
