From d2632b84876d944e5fedd52aee3b5419dd6fd856 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Fri, 27 Mar 2026 22:12:41 +0100 Subject: [PATCH] =?UTF-8?q?wayland:=20Phase=2031=20=E2=80=94=20Wayland=20b?= =?UTF-8?q?ackend=20skeleton=20(complete=20stub=20vtable)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add --enable-wayland-backend configure option (default: auto). Requires wlroots >= 0.15, wayland-server, xkbcommon via pkg-config. Detected at build time on this system: wlroots 0.15.1. New files: src/backend/wayland/wl_backend.h — declares extern const WMBackend wl_backend src/backend/wayland/wl_backend.c — complete stub vtable (108 slots) All stubs return safe zero/null/false values. Every slot matches the exact WMBackend function-pointer signature; zero compiler warnings. Build system compiles the Wayland backend files conditionally when USE_WAYLAND_BACKEND is set; WLROOTS_CFLAGS/LIBS wired into AM_CFLAGS and wmaker_LDADD. Subsequent phases will replace stubs with real wlroots implementations. Co-Authored-By: Claude Sonnet 4.6 --- configure.ac | 31 ++ src/Makefile.am | 9 +- src/backend/wayland/wl_backend.c | 573 +++++++++++++++++++++++++++++++ src/backend/wayland/wl_backend.h | 18 + 4 files changed, 630 insertions(+), 1 deletion(-) create mode 100644 src/backend/wayland/wl_backend.c create mode 100644 src/backend/wayland/wl_backend.h diff --git a/configure.ac b/configure.ac index adccce6..0e2a875 100644 --- a/configure.ac +++ b/configure.ac @@ -651,6 +651,37 @@ m4_divert_pop([INIT_PREPARE])dnl WM_XEXT_CHECK_XRANDR +dnl Wayland backend (wlroots-based compositor) +dnl ========================================== +m4_divert_push([INIT_PREPARE])dnl +AC_ARG_ENABLE([wayland-backend], + [AS_HELP_STRING([--enable-wayland-backend], + [build the wlroots-based Wayland compositor backend @<:@default=auto@:>@])], + [AS_CASE(["$enableval"], + [yes|no|auto], [], + [AC_MSG_ERROR([bad value $enableval for --enable-wayland-backend])])], + [enable_wayland_backend=auto]) +m4_divert_pop([INIT_PREPARE])dnl + +AS_IF([test "x$enable_wayland_backend" != "xno"], + [PKG_CHECK_MODULES([WLROOTS], + [wlroots >= 0.15 wayland-server xkbcommon], + [have_wlroots=yes], + [have_wlroots=no]) + AS_IF([test "x$have_wlroots" = "xyes"], + [AC_DEFINE([USE_WAYLAND_BACKEND], [1], + [Define to 1 to build the wlroots Wayland compositor backend]) + supported_core="$supported_core WaylandBackend"], + [AS_IF([test "x$enable_wayland_backend" = "xyes"], + [AC_MSG_ERROR([wlroots >= 0.15, wayland-server, or xkbcommon not found])]) + unsupported="$unsupported WaylandBackend"])], + [have_wlroots=no + unsupported="$unsupported WaylandBackend"]) +AM_CONDITIONAL([USE_WAYLAND_BACKEND], [test "x$have_wlroots" = "xyes"]) +AC_SUBST([WLROOTS_CFLAGS]) +AC_SUBST([WLROOTS_LIBS]) + + dnl Math library dnl ============ dnl libWINGS uses math functions, check whether usage requires linking diff --git a/src/Makefile.am b/src/Makefile.am index 3d6b992..9a96f4b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -140,6 +140,12 @@ if WM_OSDEP_GENERIC wmaker_SOURCES += osdep_stub.c endif +if USE_WAYLAND_BACKEND +wmaker_SOURCES += \ + backend/wayland/wl_backend.h \ + backend/wayland/wl_backend.c +endif + if USE_NESTED_FUNC wmaker_SOURCES += misc.c \ xmodifier.c @@ -161,7 +167,7 @@ xmodifier.hack_nf.c: xmodifier.c $(top_srcdir)/script/nested-func-to-macro.sh endif -AM_CFLAGS = @PANGO_CFLAGS@ +AM_CFLAGS = @PANGO_CFLAGS@ @WLROOTS_CFLAGS@ AM_CPPFLAGS = $(DFLAGS) \ -I$(top_builddir)/wrlib \ @@ -177,6 +183,7 @@ wmaker_LDADD = \ @LIBXRANDR@ \ @LIBXINERAMA@ \ @XLIBS@ \ + @WLROOTS_LIBS@ \ @LIBM@ \ @INTLIBS@ diff --git a/src/backend/wayland/wl_backend.c b/src/backend/wayland/wl_backend.c new file mode 100644 index 0000000..0d2353c --- /dev/null +++ b/src/backend/wayland/wl_backend.c @@ -0,0 +1,573 @@ +/* + * wl_backend.c -- wlroots-based Wayland compositor backend for Window Maker + * + * Phase 31: complete stub vtable. Every slot compiles and returns a safe + * zero/null/false value. Subsequent phases will replace stubs with real + * wlroots implementations one functional area at a time. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include + +#include "../../WindowMaker.h" +#include "../../screen.h" +#include "../../window.h" +#include "../backend.h" +#include "wl_backend.h" + +/* ------------------------------------------------------------------ */ +/* Screen open/close */ +/* ------------------------------------------------------------------ */ + +static void wl_screen_open(WScreen *scr) { (void)scr; } +static void wl_screen_close(WScreen *scr) { (void)scr; } + +/* ------------------------------------------------------------------ */ +/* Frame / window lifecycle */ +/* ------------------------------------------------------------------ */ + +static WNativeWindow +wl_frame_create_toplevel(WScreen *scr, + int x, int y, int width, int height, + int border_width, + int depth, void *visual, + unsigned long colormap, + WMPixel border_pixel) +{ + (void)scr; (void)x; (void)y; (void)width; (void)height; + (void)border_width; (void)depth; (void)visual; + (void)colormap; (void)border_pixel; + return WNATIVE_NONE; +} + +static WNativeWindow +wl_frame_create_child(WNativeWindow parent_win, WScreen *scr, + int x, int y, int width, int height) +{ + (void)parent_win; (void)scr; + (void)x; (void)y; (void)width; (void)height; + return WNATIVE_NONE; +} + +static void wl_frame_destroy(WScreen *scr, WNativeWindow win) { (void)scr; (void)win; } + +static void +wl_frame_configure(WNativeWindow win, int x, int y, int width, int height) +{ (void)win; (void)x; (void)y; (void)width; (void)height; } + +/* ------------------------------------------------------------------ */ +/* Context (window → object lookup table) */ +/* ------------------------------------------------------------------ */ + +static void +wl_context_save(WNativeWindow win, WContextKey key, void *data) +{ (void)win; (void)key; (void)data; } + +static void * +wl_context_find(WNativeWindow win, WContextKey key) +{ (void)win; (void)key; return NULL; } + +static int +wl_context_delete(WNativeWindow win, WContextKey key) +{ (void)win; (void)key; return 0; } + +/* ------------------------------------------------------------------ */ +/* Focus */ +/* ------------------------------------------------------------------ */ + +static void +wl_focus_set(WNativeWindow win, int revert_to, unsigned long timestamp) +{ (void)win; (void)revert_to; (void)timestamp; } + +/* ------------------------------------------------------------------ */ +/* Key / button grabs */ +/* ------------------------------------------------------------------ */ + +static void +wl_key_grab(WNativeWindow win, unsigned int keycode, + unsigned int modifier, int owner_events) +{ (void)win; (void)keycode; (void)modifier; (void)owner_events; } + +static void wl_key_ungrab_all(WNativeWindow win) { (void)win; } + +static void +wl_button_grab(WNativeWindow win, unsigned int button, + unsigned int modifier, unsigned int event_mask, + int owner_events) +{ (void)win; (void)button; (void)modifier; (void)event_mask; (void)owner_events; } + +static void wl_button_ungrab_all(WNativeWindow win) { (void)win; } + +/* ------------------------------------------------------------------ */ +/* Pointer grabs */ +/* ------------------------------------------------------------------ */ + +static int +wl_pointer_grab(WNativeWindow grab_win, WNativeWindow confine_to, + unsigned int event_mask, int cursor_id, + int owner_events, unsigned long timestamp) +{ + (void)grab_win; (void)confine_to; (void)event_mask; + (void)cursor_id; (void)owner_events; (void)timestamp; + return 0; +} + +static void wl_pointer_ungrab(unsigned long timestamp) { (void)timestamp; } + +static void wl_pointer_warp(int dx, int dy) { (void)dx; (void)dy; } +static void wl_pointer_warp_to(int x, int y) { (void)x; (void)y; } + +static int +wl_pointer_query(WNativeWindow root, int *root_x, int *root_y) +{ + (void)root; + *root_x = *root_y = 0; + return 0; +} + +static int +wl_pointer_query_full(WNativeWindow root, + WNativeWindow *child_out, + int *root_x, int *root_y, + unsigned int *buttons_out) +{ + (void)root; + if (child_out) *child_out = WNATIVE_NONE; + *root_x = *root_y = 0; + if (buttons_out) *buttons_out = 0; + return 0; +} + +static void +wl_pointer_change_grab(unsigned int event_mask, int cursor_id, + unsigned long timestamp) +{ (void)event_mask; (void)cursor_id; (void)timestamp; } + +/* ------------------------------------------------------------------ */ +/* Keyboard grabs */ +/* ------------------------------------------------------------------ */ + +static int wl_keyboard_grab(WNativeWindow win) { (void)win; return 0; } +static void wl_keyboard_ungrab(void) {} + +/* ------------------------------------------------------------------ */ +/* Server grab */ +/* ------------------------------------------------------------------ */ + +static void wl_server_grab(void) {} +static void wl_server_ungrab(void) {} + +/* ------------------------------------------------------------------ */ +/* Stacking */ +/* ------------------------------------------------------------------ */ + +static void wl_stacking_raise(WNativeWindow win) { (void)win; } +static void wl_stacking_lower(WNativeWindow win) { (void)win; } + +static void +wl_stacking_restack(WNativeWindow *windows, int count) +{ (void)windows; (void)count; } + +static int +wl_stacking_query(WNativeWindow root, + WNativeWindow **out, unsigned int *count) +{ + (void)root; + *out = NULL; *count = 0; + return 0; +} + +/* ------------------------------------------------------------------ */ +/* Events */ +/* ------------------------------------------------------------------ */ + +static void wl_event_flush(void) {} +static void wl_event_flush_expose(void) {} +static void wl_event_sync(int discard) { (void)discard; } +static int wl_event_pending(void) { return 0; } +static void wl_event_drain_motion(void) {} +static void wl_event_discard_enter_leave_until(unsigned long timestamp) { (void)timestamp; } +static void wl_event_handle_extensions(void *event) { (void)event; } +static void wl_event_randr_update(void *event) { (void)event; } + +/* ------------------------------------------------------------------ */ +/* Properties */ +/* ------------------------------------------------------------------ */ + +static int +wl_prop_get_normal_hints(WNativeWindow win, WNormalHints *out, int *pre_icccm) +{ + (void)win; + memset(out, 0, sizeof(*out)); + *pre_icccm = 0; + return 0; +} + +static WWMHints * +wl_prop_get_wm_hints(WNativeWindow win) { (void)win; return NULL; } + +static int +wl_prop_get_wm_class(WNativeWindow win, + char **wm_class, char **wm_instance) +{ + (void)win; + *wm_class = strdup("default"); + *wm_instance = strdup("default"); + return 0; +} + +static Bool +wl_window_fetch_name(WNativeWindow win, char **name_out) +{ (void)win; *name_out = NULL; return False; } + +static Bool +wl_window_get_icon_name(WNativeWindow win, char **name_out) +{ (void)win; *name_out = NULL; return False; } + +static int +wl_prop_get_wmaker_menu(WNativeWindow win, + char ***list_out, int *count_out) +{ + (void)win; + *list_out = NULL; *count_out = 0; + return 0; +} + +static WNativeWindow +wl_prop_get_transient_for(WNativeWindow win) { (void)win; return WNATIVE_NONE; } + +static int wl_prop_has_wmaker_menu(WNativeWindow win) { (void)win; return 0; } +static int wl_prop_has_gtk_object_path(WNativeWindow win) { (void)win; return 0; } + +static void +wl_prop_set_wm_state(WNativeWindow win, const long *data, int n) +{ (void)win; (void)data; (void)n; } + +static int +wl_prop_get_wm_state(WNativeWindow win, long **data_out) +{ (void)win; *data_out = NULL; return 0; } + +/* ------------------------------------------------------------------ */ +/* Window map / unmap / geometry */ +/* ------------------------------------------------------------------ */ + +static void wl_window_map(WNativeWindow win) { (void)win; } +static void wl_window_map_raised(WNativeWindow win) { (void)win; } +static void wl_window_map_subwindows(WNativeWindow parent) { (void)parent; } +static void wl_window_unmap(WNativeWindow win) { (void)win; } +static void wl_window_move(WNativeWindow win, int x, int y) { (void)win; (void)x; (void)y; } +static void wl_window_resize(WNativeWindow win, int w, int h) { (void)win; (void)w; (void)h; } +static void wl_window_set_border(WNativeWindow win, unsigned long pixel) { (void)win; (void)pixel; } +static void wl_window_set_border_width(WNativeWindow win, int width) { (void)win; (void)width; } +static void wl_window_set_save_under(WNativeWindow win, int save_under) { (void)win; (void)save_under; } +static void wl_window_clear(WNativeWindow win) { (void)win; } + +static int +wl_window_get_rect(WNativeWindow win, + int *win_x, int *win_y, int *win_w, int *win_h) +{ + (void)win; + *win_x = *win_y = 0; *win_w = *win_h = 1; + return 0; +} + +static void wl_window_add_events(WNativeWindow win, unsigned long extra_mask) { (void)win; (void)extra_mask; } +static void wl_window_select_events(WNativeWindow win, unsigned long mask) { (void)win; (void)mask; } + +static void wl_window_shape_clear(WWindow *wwin) { (void)wwin; } +static void wl_window_shape_set(WWindow *wwin) { (void)wwin; } + +/* ------------------------------------------------------------------ */ +/* Overlays */ +/* ------------------------------------------------------------------ */ + +static void wl_overlay_draw_line(WScreen *scr, int x1, int y1, int x2, int y2) { (void)scr; (void)x1; (void)y1; (void)x2; (void)y2; } +static void wl_overlay_draw_lines(WScreen *scr, WPoint *pts, int n) { (void)scr; (void)pts; (void)n; } +static void wl_overlay_draw_rect(WScreen *scr, int x, int y, int w, int h) { (void)scr; (void)x; (void)y; (void)w; (void)h; } +static void wl_overlay_draw_segments(WScreen *scr, WSegment *segs, int n) { (void)scr; (void)segs; (void)n; } +static void wl_overlay_draw_string(WScreen *scr, int x, int y, const char *str, int len) { (void)scr; (void)x; (void)y; (void)str; (void)len; } +static int wl_overlay_text_width(WScreen *scr, const char *str, int n) { (void)scr; (void)str; (void)n; return 0; } + +/* ------------------------------------------------------------------ */ +/* Client */ +/* ------------------------------------------------------------------ */ + +static int +wl_window_get_client_attrs(WNativeWindow win, WClientAttributes *out) +{ + (void)win; + memset(out, 0, sizeof(*out)); + out->map_state = WCLIENT_UNMAPPED; + return 1; +} + +static void +wl_client_get_visual_attrs(WNativeWindow win, WClientVisual *out) +{ + (void)win; + out->depth = 24; out->visual = NULL; out->colormap = 0; +} + +static void +wl_client_adopt_attributes(WNativeWindow win, unsigned long event_mask) +{ (void)win; (void)event_mask; } + +static void +wl_client_reparent(WNativeWindow client, WNativeWindow new_parent, int x, int y) +{ (void)client; (void)new_parent; (void)x; (void)y; } + +static void +wl_client_synth_configure(WNativeWindow client_win, + int x, int y, int width, int height, + int border_width, WNativeWindow above) +{ (void)client_win; (void)x; (void)y; (void)width; (void)height; (void)border_width; (void)above; } + +static void wl_client_add_to_save_set(WNativeWindow win) { (void)win; } +static void wl_client_remove_from_save_set(WNativeWindow win) { (void)win; } + +static void wl_client_query_shaped(WNativeWindow win, int *shaped_out) +{ (void)win; *shaped_out = 0; } + +static int +wl_client_get_gnustep_attrs(WNativeWindow win, GNUstepWMAttributes **attr_out) +{ (void)win; *attr_out = NULL; return 0; } + +static int wl_client_get_pid(WNativeWindow win) { (void)win; return 0; } + +static RImage * +wl_client_snapshot(WScreen *scr, WNativeWindow client_win, WNativeWindow frame_win) +{ (void)scr; (void)client_win; (void)frame_win; return NULL; } + +static int +wl_coords_translate(WNativeWindow src, WNativeWindow dst, + int src_x, int src_y, int *dst_x, int *dst_y) +{ + (void)src; (void)dst; + *dst_x = src_x; *dst_y = src_y; + return 0; +} + +/* ------------------------------------------------------------------ */ +/* ICCCM */ +/* ------------------------------------------------------------------ */ + +static void wl_icccm_set_wm_hints(WNativeWindow win, const WWMHints *hints) { (void)win; (void)hints; } +static void wl_icccm_set_class_hint(WNativeWindow win, const char *wm_class, const char *wm_instance) { (void)win; (void)wm_class; (void)wm_instance; } +static void wl_icccm_set_class_hint_if_absent(WNativeWindow win, const char *wm_class, const char *wm_instance) { (void)win; (void)wm_class; (void)wm_instance; } +static void wl_icccm_set_command(WNativeWindow win, char **argv, int argc) { (void)win; (void)argv; (void)argc; } +static int wl_icccm_get_command(WNativeWindow win, char ***argv_out, int *argc_out) { (void)win; *argv_out = NULL; *argc_out = 0; return 0; } +static void wl_icccm_free_command(char **argv) { (void)argv; } + +/* ------------------------------------------------------------------ */ +/* Fake leader */ +/* ------------------------------------------------------------------ */ + +static WNativeWindow wl_fake_leader_create(WScreen *scr) { (void)scr; return WNATIVE_NONE; } +static void wl_fake_leader_destroy(WNativeWindow win) { (void)win; } + +/* ------------------------------------------------------------------ */ +/* Screen internals */ +/* ------------------------------------------------------------------ */ + +static int wl_screen_replace_wm(WScreen *scr) { (void)scr; return 0; } +static int wl_screen_select_input(WScreen *scr, long event_mask) { (void)scr; (void)event_mask; return 0; } +static void wl_screen_set_root_cursor(WScreen *scr, int cursor_id) { (void)scr; (void)cursor_id; } +static void wl_screen_set_icon_sizes(WScreen *scr, int min_size, int max_size) { (void)scr; (void)min_size; (void)max_size; } +static void wl_screen_setup_noticeboard(WScreen *scr) { (void)scr; } +static void wl_screen_alloc_gcs(WScreen *scr) { (void)scr; } +static void wl_screen_create_internals(WScreen *scr) { (void)scr; } +static void wl_screen_create_pixmaps(WScreen *scr) { (void)scr; } +static void wl_screen_load_tech_font(WScreen *scr) { (void)scr; } +static void wl_screen_show_mini_screenshot(WScreen *scr, RImage *img) { (void)scr; (void)img; } +static RImage *wl_screen_capture_area(WScreen *scr) { (void)scr; return NULL; } +static RImage *wl_screen_capture_window(WScreen *scr, WWindow *wwin) { (void)scr; (void)wwin; return NULL; } +static void wl_refresh_desktop(WScreen *scr) { (void)scr; } + +/* ------------------------------------------------------------------ */ +/* Monitors */ +/* ------------------------------------------------------------------ */ + +static void +wl_monitors_query(WScreen *scr, WHeadGeometry **heads_out, int *count_out) +{ (void)scr; *heads_out = NULL; *count_out = 0; } + +static void wl_monitors_select_events(WScreen *scr) { (void)scr; } + +/* ------------------------------------------------------------------ */ +/* Workspace badge */ +/* ------------------------------------------------------------------ */ + +static RImage * +wl_workspace_badge_render(WScreen *scr, WNativeWindow badge_win, + const char *name, int name_len, + int width, int height) +{ (void)scr; (void)badge_win; (void)name; (void)name_len; (void)width; (void)height; return NULL; } + +static void +wl_workspace_badge_update(WScreen *scr, WNativeWindow badge_win, RImage *img) +{ (void)scr; (void)badge_win; (void)img; } + +/* ------------------------------------------------------------------ */ +/* XKB */ +/* ------------------------------------------------------------------ */ + +static WKeyCode wl_keysym_to_keycode(unsigned long keysym) { (void)keysym; return 0; } +static unsigned long wl_keysym_from_keycode(unsigned int keycode, unsigned int index) { (void)keycode; (void)index; return 0; } +static void wl_xkb_lock_group(int group) { (void)group; } +static int wl_xkb_get_group(void) { return 0; } + +/* ------------------------------------------------------------------ */ +/* Extensions / cursors / error handlers */ +/* ------------------------------------------------------------------ */ + +static void wl_extensions_init(void) {} +static void wl_cursors_init(void) {} +static WNativeWindow wl_cursor_create_named(const char *name) { (void)name; return WNATIVE_NONE; } +static void wl_shape_combine_mask(WNativeWindow win, WNativeWindow mask) { (void)win; (void)mask; } +static void wl_register_error_handlers(void) {} + +/* ------------------------------------------------------------------ */ +/* vtable */ +/* ------------------------------------------------------------------ */ + +const WMBackend wl_backend = { + .screen_open = wl_screen_open, + .screen_close = wl_screen_close, + + .frame_create_toplevel = wl_frame_create_toplevel, + .frame_create_child = wl_frame_create_child, + .frame_destroy = wl_frame_destroy, + .frame_configure = wl_frame_configure, + + .context_save = wl_context_save, + .context_find = wl_context_find, + .context_delete = wl_context_delete, + + .focus_set = wl_focus_set, + + .key_grab = wl_key_grab, + .key_ungrab_all = wl_key_ungrab_all, + .button_grab = wl_button_grab, + .button_ungrab_all = wl_button_ungrab_all, + + .pointer_grab = wl_pointer_grab, + .pointer_ungrab = wl_pointer_ungrab, + .pointer_warp = wl_pointer_warp, + .pointer_warp_to = wl_pointer_warp_to, + .pointer_query = wl_pointer_query, + .pointer_query_full = wl_pointer_query_full, + .pointer_change_grab = wl_pointer_change_grab, + + .keyboard_grab = wl_keyboard_grab, + .keyboard_ungrab = wl_keyboard_ungrab, + + .server_grab = wl_server_grab, + .server_ungrab = wl_server_ungrab, + + .stacking_raise = wl_stacking_raise, + .stacking_lower = wl_stacking_lower, + .stacking_restack = wl_stacking_restack, + .stacking_query = wl_stacking_query, + + .event_flush = wl_event_flush, + .event_flush_expose = wl_event_flush_expose, + .event_sync = wl_event_sync, + .event_pending = wl_event_pending, + .event_drain_motion = wl_event_drain_motion, + .event_discard_enter_leave_until = wl_event_discard_enter_leave_until, + .event_handle_extensions = wl_event_handle_extensions, + .event_randr_update = wl_event_randr_update, + + .prop_get_normal_hints = wl_prop_get_normal_hints, + .prop_get_wm_hints = wl_prop_get_wm_hints, + .prop_get_wm_class = wl_prop_get_wm_class, + .window_fetch_name = wl_window_fetch_name, + .window_get_icon_name = wl_window_get_icon_name, + .prop_get_wmaker_menu = wl_prop_get_wmaker_menu, + .prop_get_transient_for = wl_prop_get_transient_for, + .prop_has_wmaker_menu = wl_prop_has_wmaker_menu, + .prop_has_gtk_object_path = wl_prop_has_gtk_object_path, + .prop_set_wm_state = wl_prop_set_wm_state, + .prop_get_wm_state = wl_prop_get_wm_state, + + .window_map = wl_window_map, + .window_map_raised = wl_window_map_raised, + .window_map_subwindows = wl_window_map_subwindows, + .window_unmap = wl_window_unmap, + .window_move = wl_window_move, + .window_resize = wl_window_resize, + .window_set_border = wl_window_set_border, + .window_set_border_width = wl_window_set_border_width, + .window_set_save_under = wl_window_set_save_under, + .window_clear = wl_window_clear, + .window_get_rect = wl_window_get_rect, + .window_add_events = wl_window_add_events, + .window_select_events = wl_window_select_events, + .window_shape_clear = wl_window_shape_clear, + .window_shape_set = wl_window_shape_set, + + .overlay_draw_line = wl_overlay_draw_line, + .overlay_draw_lines = wl_overlay_draw_lines, + .overlay_draw_rect = wl_overlay_draw_rect, + .overlay_draw_segments = wl_overlay_draw_segments, + .overlay_draw_string = wl_overlay_draw_string, + .overlay_text_width = wl_overlay_text_width, + + .window_get_client_attrs = wl_window_get_client_attrs, + .client_get_visual_attrs = wl_client_get_visual_attrs, + .client_adopt_attributes = wl_client_adopt_attributes, + .client_reparent = wl_client_reparent, + .client_synth_configure = wl_client_synth_configure, + .client_add_to_save_set = wl_client_add_to_save_set, + .client_remove_from_save_set = wl_client_remove_from_save_set, + .client_query_shaped = wl_client_query_shaped, + .client_get_gnustep_attrs = wl_client_get_gnustep_attrs, + .client_get_pid = wl_client_get_pid, + .client_snapshot = wl_client_snapshot, + .coords_translate = wl_coords_translate, + + .icccm_set_wm_hints = wl_icccm_set_wm_hints, + .icccm_set_class_hint = wl_icccm_set_class_hint, + .icccm_set_class_hint_if_absent = wl_icccm_set_class_hint_if_absent, + .icccm_set_command = wl_icccm_set_command, + .icccm_get_command = wl_icccm_get_command, + .icccm_free_command = wl_icccm_free_command, + + .fake_leader_create = wl_fake_leader_create, + .fake_leader_destroy = wl_fake_leader_destroy, + + .screen_replace_wm = wl_screen_replace_wm, + .screen_select_input = wl_screen_select_input, + .screen_set_root_cursor = wl_screen_set_root_cursor, + .screen_set_icon_sizes = wl_screen_set_icon_sizes, + .screen_setup_noticeboard = wl_screen_setup_noticeboard, + .screen_alloc_gcs = wl_screen_alloc_gcs, + .screen_create_internals = wl_screen_create_internals, + .screen_create_pixmaps = wl_screen_create_pixmaps, + .screen_load_tech_font = wl_screen_load_tech_font, + .screen_show_mini_screenshot = wl_screen_show_mini_screenshot, + .screen_capture_area = wl_screen_capture_area, + .screen_capture_window = wl_screen_capture_window, + .refresh_desktop = wl_refresh_desktop, + + .monitors_query = wl_monitors_query, + .monitors_select_events = wl_monitors_select_events, + + .workspace_badge_render = wl_workspace_badge_render, + .workspace_badge_update = wl_workspace_badge_update, + + .keysym_to_keycode = wl_keysym_to_keycode, + .keysym_from_keycode = wl_keysym_from_keycode, + .xkb_lock_group = wl_xkb_lock_group, + .xkb_get_group = wl_xkb_get_group, + + .extensions_init = wl_extensions_init, + .cursors_init = wl_cursors_init, + .cursor_create_named = wl_cursor_create_named, + .shape_combine_mask = wl_shape_combine_mask, + .register_error_handlers = wl_register_error_handlers, +}; diff --git a/src/backend/wayland/wl_backend.h b/src/backend/wayland/wl_backend.h new file mode 100644 index 0000000..7232541 --- /dev/null +++ b/src/backend/wayland/wl_backend.h @@ -0,0 +1,18 @@ +/* + * wl_backend.h -- wlroots-based Wayland compositor backend for Window Maker + * + * Declares the WMBackend vtable instance implemented in wl_backend.c. + * Include this only from files that need to reference wl_backend directly + * (e.g. startup.c backend selection). All other code uses wm_backend + * from backend/backend.h. + */ + +#ifndef WM_WL_BACKEND_H_ +#define WM_WL_BACKEND_H_ + +#include "../backend.h" + +/* The Wayland WMBackend implementation. */ +extern const WMBackend wl_backend; + +#endif /* WM_WL_BACKEND_H_ */