libs-back/Headers/wayland/WaylandServer.h

113 lines
2.2 KiB
C
Raw Normal View History

2016-02-16 22:30:32 +00:00
/* <title>WaylandServer</title>
<abstract>Backend server using Wayland.</abstract>
Copyright (C) 2016 Sergio L. Pascual <slp@sinrega.org>
*/
#ifndef _WaylandServer_h_INCLUDE
#define _WaylandServer_h_INCLUDE
#include "config.h"
#include <GNUstepGUI/GSDisplayServer.h>
#include <wayland-client.h>
#include <cairo/cairo.h>
#include <xkbcommon/xkbcommon.h>
#include "cairo/WaylandCairoSurface.h"
#include "wayland/xdg-shell-client-protocol.h"
2016-02-16 22:30:32 +00:00
struct pointer {
struct wl_pointer *wlpointer;
float x;
float y;
uint32_t last_click_button;
uint32_t last_click_time;
float last_click_x;
float last_click_y;
uint32_t serial;
struct window *focus;
};
typedef struct _WaylandConfig {
struct wl_display *display;
struct wl_registry *registry;
struct wl_compositor *compositor;
struct wl_shell *shell;
struct wl_shm *shm;
struct wl_seat *seat;
struct wl_keyboard *keyboard;
2019-12-29 17:30:48 +00:00
struct xdg_wm_base *wm_base;
2016-02-16 22:30:32 +00:00
struct wl_list output_list;
int output_count;
struct wl_list window_list;
int window_count;
int last_window_id;
struct pointer pointer;
struct xkb_context *xkb_context;
struct {
struct xkb_keymap *keymap;
struct xkb_state *state;
xkb_mod_mask_t control_mask;
xkb_mod_mask_t alt_mask;
xkb_mod_mask_t shift_mask;
} xkb;
int modifiers;
int seat_version;
} WaylandConfig;
struct output {
WaylandConfig *wlconfig;
struct wl_output *output;
uint32_t server_output_id;
struct wl_list link;
int alloc_x;
int alloc_y;
int width;
int height;
int transform;
int scale;
char *make;
char *model;
void *user_data;
};
struct window {
WaylandConfig *wlconfig;
id instance;
int window_id;
struct wl_list link;
float pos_x;
float pos_y;
float width;
float height;
float saved_pos_x;
float saved_pos_y;
int is_out;
unsigned char *data;
struct wl_buffer *buffer;
2019-12-29 17:30:48 +00:00
struct wl_surface *surface;
2016-02-16 22:30:32 +00:00
struct xdg_surface *xdg_surface;
2019-12-29 17:30:48 +00:00
struct xdg_toplevel *toplevel;
2016-02-16 22:30:32 +00:00
struct output *output;
WaylandCairoSurface *wcs;
};
@interface WaylandServer : GSDisplayServer
{
WaylandConfig *wlconfig;
}
@end
#endif /* _XGServer_h_INCLUDE */