2022-06-07 09:17:12 +00:00
|
|
|
/*
|
|
|
|
* Wayland driver
|
|
|
|
*
|
|
|
|
* Copyright 2020 Alexandros 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
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_WAYLANDDRV_H
|
|
|
|
#define __WINE_WAYLANDDRV_H
|
|
|
|
|
|
|
|
#ifndef __WINE_CONFIG_H
|
|
|
|
# error You must include config.h to use this header
|
|
|
|
#endif
|
|
|
|
|
2023-04-26 07:38:04 +00:00
|
|
|
#include <pthread.h>
|
2021-08-31 13:21:21 +00:00
|
|
|
#include <wayland-client.h>
|
2023-03-07 11:42:07 +00:00
|
|
|
#include "xdg-output-unstable-v1-client-protocol.h"
|
2021-08-31 13:21:21 +00:00
|
|
|
|
2023-03-07 11:21:38 +00:00
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "wine/gdi_driver.h"
|
2023-03-10 15:57:38 +00:00
|
|
|
#include "wine/rbtree.h"
|
2023-03-07 11:21:38 +00:00
|
|
|
|
2022-06-07 09:17:12 +00:00
|
|
|
#include "unixlib.h"
|
|
|
|
|
2021-08-31 13:21:21 +00:00
|
|
|
/**********************************************************************
|
|
|
|
* Globals
|
|
|
|
*/
|
|
|
|
|
2023-05-02 08:34:49 +00:00
|
|
|
extern struct wayland process_wayland DECLSPEC_HIDDEN;
|
2023-03-07 11:21:38 +00:00
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* Definitions for wayland types
|
|
|
|
*/
|
|
|
|
|
2023-04-24 14:29:43 +00:00
|
|
|
enum wayland_window_message
|
|
|
|
{
|
|
|
|
WM_WAYLAND_INIT_DISPLAY_DEVICES = 0x80001000
|
|
|
|
};
|
|
|
|
|
2023-03-07 11:21:38 +00:00
|
|
|
struct wayland
|
|
|
|
{
|
2023-04-24 12:48:00 +00:00
|
|
|
BOOL initialized;
|
2023-05-02 08:34:49 +00:00
|
|
|
struct wl_display *wl_display;
|
2023-03-07 11:21:38 +00:00
|
|
|
struct wl_event_queue *wl_event_queue;
|
|
|
|
struct wl_registry *wl_registry;
|
2023-03-07 11:42:07 +00:00
|
|
|
struct zxdg_output_manager_v1 *zxdg_output_manager_v1;
|
2023-03-07 11:21:38 +00:00
|
|
|
struct wl_list output_list;
|
2023-04-26 07:38:04 +00:00
|
|
|
/* Protects the output_list and the wayland_output.current states. */
|
|
|
|
pthread_mutex_t output_mutex;
|
2023-03-07 11:21:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct wayland_output_mode
|
|
|
|
{
|
2023-03-10 15:57:38 +00:00
|
|
|
struct rb_entry entry;
|
2023-03-07 11:21:38 +00:00
|
|
|
int32_t width;
|
|
|
|
int32_t height;
|
|
|
|
int32_t refresh;
|
|
|
|
};
|
|
|
|
|
2023-04-26 07:38:04 +00:00
|
|
|
struct wayland_output_state
|
2023-03-07 11:21:38 +00:00
|
|
|
{
|
2023-03-10 15:57:38 +00:00
|
|
|
struct rb_tree modes;
|
|
|
|
struct wayland_output_mode *current_mode;
|
2023-03-07 11:42:07 +00:00
|
|
|
char *name;
|
2023-04-11 14:47:56 +00:00
|
|
|
int logical_x, logical_y;
|
2023-03-07 11:36:02 +00:00
|
|
|
int logical_w, logical_h;
|
2023-04-26 07:38:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct wayland_output
|
|
|
|
{
|
|
|
|
struct wl_list link;
|
|
|
|
struct wl_output *wl_output;
|
|
|
|
struct zxdg_output_v1 *zxdg_output_v1;
|
2023-03-07 11:21:38 +00:00
|
|
|
uint32_t global_id;
|
2023-04-26 07:38:04 +00:00
|
|
|
unsigned int pending_flags;
|
|
|
|
struct wayland_output_state pending;
|
|
|
|
struct wayland_output_state current;
|
2023-03-07 11:21:38 +00:00
|
|
|
};
|
2021-08-31 13:21:21 +00:00
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* Wayland initialization
|
|
|
|
*/
|
|
|
|
|
|
|
|
BOOL wayland_process_init(void) DECLSPEC_HIDDEN;
|
2023-04-24 12:48:00 +00:00
|
|
|
void wayland_init_display_devices(BOOL force) DECLSPEC_HIDDEN;
|
2023-03-07 11:21:38 +00:00
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* Wayland output
|
|
|
|
*/
|
|
|
|
|
|
|
|
BOOL wayland_output_create(uint32_t id, uint32_t version) DECLSPEC_HIDDEN;
|
|
|
|
void wayland_output_destroy(struct wayland_output *output) DECLSPEC_HIDDEN;
|
2023-03-07 11:42:07 +00:00
|
|
|
void wayland_output_use_xdg_extension(struct wayland_output *output) DECLSPEC_HIDDEN;
|
2023-03-07 11:21:38 +00:00
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* USER driver functions
|
|
|
|
*/
|
|
|
|
|
2023-04-26 12:58:43 +00:00
|
|
|
LRESULT WAYLAND_DesktopWindowProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) DECLSPEC_HIDDEN;
|
2023-03-07 11:21:38 +00:00
|
|
|
BOOL WAYLAND_UpdateDisplayDevices(const struct gdi_device_manager *device_manager,
|
|
|
|
BOOL force, void *param) DECLSPEC_HIDDEN;
|
2023-04-24 14:29:43 +00:00
|
|
|
LRESULT WAYLAND_WindowMessage(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) DECLSPEC_HIDDEN;
|
2021-08-31 13:21:21 +00:00
|
|
|
|
2022-06-07 09:17:12 +00:00
|
|
|
#endif /* __WINE_WAYLANDDRV_H */
|