2019-12-06 19:05:32 +01:00
|
|
|
#ifndef WAYLAND_TEST_CLIENT_UTILS_H
|
|
|
|
#define WAYLAND_TEST_CLIENT_UTILS_H
|
|
|
|
|
2022-05-11 23:41:32 +02:00
|
|
|
#include <glib-object.h>
|
2019-12-06 19:05:32 +01:00
|
|
|
#include <stdio.h>
|
2022-05-11 21:47:35 +02:00
|
|
|
#include <wayland-client.h>
|
|
|
|
|
|
|
|
#include "test-driver-client-protocol.h"
|
|
|
|
#include "xdg-shell-client-protocol.h"
|
|
|
|
|
|
|
|
typedef enum _WaylandDisplayCapabilities
|
|
|
|
{
|
2022-05-11 22:50:58 +02:00
|
|
|
WAYLAND_DISPLAY_CAPABILITY_NONE = 0,
|
2022-05-11 21:47:35 +02:00
|
|
|
WAYLAND_DISPLAY_CAPABILITY_TEST_DRIVER = 1 << 0,
|
2022-05-11 23:59:11 +02:00
|
|
|
WAYLAND_DISPLAY_CAPABILITY_XDG_SHELL_V4 = 1 << 1,
|
2022-05-11 21:47:35 +02:00
|
|
|
} WaylandDisplayCapabilities;
|
|
|
|
|
|
|
|
typedef struct _WaylandDisplay
|
|
|
|
{
|
2022-05-11 23:41:32 +02:00
|
|
|
GObject parent;
|
|
|
|
|
2022-05-11 21:47:35 +02:00
|
|
|
WaylandDisplayCapabilities capabilities;
|
|
|
|
|
|
|
|
struct wl_display *display;
|
|
|
|
struct wl_registry *registry;
|
|
|
|
struct wl_compositor *compositor;
|
|
|
|
struct wl_subcompositor *subcompositor;
|
|
|
|
struct xdg_wm_base *xdg_wm_base;
|
|
|
|
struct wl_shm *shm;
|
|
|
|
struct test_driver *test_driver;
|
2022-05-13 21:56:50 +02:00
|
|
|
|
|
|
|
GHashTable *properties;
|
2022-05-11 21:47:35 +02:00
|
|
|
} WaylandDisplay;
|
2019-12-06 19:05:32 +01:00
|
|
|
|
2022-05-11 23:41:32 +02:00
|
|
|
G_DECLARE_FINAL_TYPE (WaylandDisplay, wayland_display,
|
|
|
|
WAYLAND, DISPLAY,
|
|
|
|
GObject)
|
|
|
|
|
2019-12-06 19:05:32 +01:00
|
|
|
int create_anonymous_file (off_t size);
|
|
|
|
|
2022-05-11 21:47:35 +02:00
|
|
|
WaylandDisplay * wayland_display_new (WaylandDisplayCapabilities capabilities);
|
|
|
|
|
2022-05-23 11:05:10 +02:00
|
|
|
gboolean create_shm_buffer (WaylandDisplay *display,
|
|
|
|
int width,
|
|
|
|
int height,
|
|
|
|
struct wl_buffer **out_buffer,
|
|
|
|
void **out_data,
|
|
|
|
int *out_size);
|
|
|
|
|
2022-05-12 00:11:14 +02:00
|
|
|
void draw_surface (WaylandDisplay *display,
|
|
|
|
struct wl_surface *surface,
|
|
|
|
int width,
|
|
|
|
int height,
|
|
|
|
uint32_t color);
|
|
|
|
|
2022-05-13 21:56:50 +02:00
|
|
|
const char * lookup_property_value (WaylandDisplay *display,
|
|
|
|
const char *name);
|
|
|
|
|
2022-05-21 18:17:31 +02:00
|
|
|
void wait_for_effects_completed (WaylandDisplay *display,
|
|
|
|
struct wl_surface *surface);
|
|
|
|
|
|
|
|
void wait_for_view_verified (WaylandDisplay *display,
|
|
|
|
int sequence);
|
|
|
|
|
2019-12-06 19:05:32 +01:00
|
|
|
#endif /* WAYLAND_TEST_CLIENT_UTILS_H */
|