2 * WAYLANDDRV initialization code
4 * Copyright 2020 Alexandre Frantzis for Collabora Ltd
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
28 #define WIN32_NO_STATUS
30 #include "waylanddrv.h"
32 static const struct user_driver_funcs waylanddrv_funcs
=
34 .pClipCursor
= WAYLAND_ClipCursor
,
35 .pDesktopWindowProc
= WAYLAND_DesktopWindowProc
,
36 .pDestroyWindow
= WAYLAND_DestroyWindow
,
37 .pKbdLayerDescriptor
= WAYLAND_KbdLayerDescriptor
,
38 .pReleaseKbdTables
= WAYLAND_ReleaseKbdTables
,
39 .pSetCursor
= WAYLAND_SetCursor
,
40 .pSysCommand
= WAYLAND_SysCommand
,
41 .pUpdateDisplayDevices
= WAYLAND_UpdateDisplayDevices
,
42 .pWindowMessage
= WAYLAND_WindowMessage
,
43 .pWindowPosChanged
= WAYLAND_WindowPosChanged
,
44 .pWindowPosChanging
= WAYLAND_WindowPosChanging
,
45 .pVulkanInit
= WAYLAND_VulkanInit
,
46 .pwine_get_wgl_driver
= WAYLAND_wine_get_wgl_driver
,
49 static NTSTATUS
waylanddrv_unix_init(void *arg
)
51 /* Set the user driver functions now so that they are available during
52 * our initialization. We clear them on error. */
53 __wine_set_user_driver(&waylanddrv_funcs
, WINE_GDI_DRIVER_VERSION
);
55 if (!wayland_process_init()) goto err
;
60 __wine_set_user_driver(NULL
, WINE_GDI_DRIVER_VERSION
);
61 return STATUS_UNSUCCESSFUL
;
64 static NTSTATUS
waylanddrv_unix_read_events(void *arg
)
66 while (wl_display_dispatch_queue(process_wayland
.wl_display
,
67 process_wayland
.wl_event_queue
) != -1)
69 /* This function only returns on a fatal error, e.g., if our connection
70 * to the Wayland server is lost. */
71 return STATUS_UNSUCCESSFUL
;
74 const unixlib_entry_t __wine_unix_call_funcs
[] =
77 waylanddrv_unix_read_events
,
80 C_ASSERT(ARRAYSIZE(__wine_unix_call_funcs
) == waylanddrv_unix_func_count
);
84 const unixlib_entry_t __wine_unix_call_wow64_funcs
[] =
87 waylanddrv_unix_read_events
,
90 C_ASSERT(ARRAYSIZE(__wine_unix_call_wow64_funcs
) == waylanddrv_unix_func_count
);