1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-05 17:28:47 +00:00
wine/dlls/winewayland.drv/waylanddrv_main.c

85 lines
2.4 KiB
C
Raw Normal View History

/*
* WAYLANDDRV initialization code
*
* Copyright 2020 Alexandre Frantzis for Collabora Ltd
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#include "config.h"
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "waylanddrv.h"
static const struct user_driver_funcs waylanddrv_funcs =
{
.pDesktopWindowProc = WAYLAND_DesktopWindowProc,
.pDestroyWindow = WAYLAND_DestroyWindow,
.pUpdateDisplayDevices = WAYLAND_UpdateDisplayDevices,
.pWindowMessage = WAYLAND_WindowMessage,
.pWindowPosChanging = WAYLAND_WindowPosChanging
};
static NTSTATUS waylanddrv_unix_init(void *arg)
{
/* Set the user driver functions now so that they are available during
* our initialization. We clear them on error. */
__wine_set_user_driver(&waylanddrv_funcs, WINE_GDI_DRIVER_VERSION);
if (!wayland_process_init()) goto err;
return 0;
err:
__wine_set_user_driver(NULL, WINE_GDI_DRIVER_VERSION);
return STATUS_UNSUCCESSFUL;
}
static NTSTATUS waylanddrv_unix_read_events(void *arg)
{
while (wl_display_dispatch_queue(process_wayland.wl_display,
process_wayland.wl_event_queue) != -1)
continue;
/* This function only returns on a fatal error, e.g., if our connection
* to the Wayland server is lost. */
return STATUS_UNSUCCESSFUL;
}
const unixlib_entry_t __wine_unix_call_funcs[] =
{
waylanddrv_unix_init,
waylanddrv_unix_read_events,
};
C_ASSERT(ARRAYSIZE(__wine_unix_call_funcs) == waylanddrv_unix_func_count);
#ifdef _WIN64
const unixlib_entry_t __wine_unix_call_wow64_funcs[] =
{
waylanddrv_unix_init,
waylanddrv_unix_read_events,
};
C_ASSERT(ARRAYSIZE(__wine_unix_call_wow64_funcs) == waylanddrv_unix_func_count);
#endif /* _WIN64 */