diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-13 13:44:13 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-13 13:44:13 +0300 |
| commit | c059e3aa7f93da470f052a5cd8ee0d8dc969e679 (patch) | |
| tree | 63ffa378287ed2c606eda2e940501b9edc3d2b8b /src/wayland/backend.c | |
| parent | 87d0bc50d53dc216efb2b04495f090616318bc5c (diff) | |
rename and simplification
Diffstat (limited to 'src/wayland/backend.c')
| -rw-r--r-- | src/wayland/backend.c | 226 |
1 files changed, 0 insertions, 226 deletions
diff --git a/src/wayland/backend.c b/src/wayland/backend.c deleted file mode 100644 index 5c34def..0000000 --- a/src/wayland/backend.c +++ /dev/null @@ -1,226 +0,0 @@ -#include "wayland/internal.h" - -static struct yasl_display *impl_display_open(struct yasl_loop *loop, const struct yasl_display_spec *spec) -{ - struct wayland_display *result = wayland_display_open(loop, spec); - return result ? &result->base : NULL; -} - -static void impl_display_close(struct yasl_display *d) -{ - wayland_display_close((struct wayland_display *)d); -} - -static uint32_t impl_display_caps(const struct yasl_display *d) -{ - return wayland_display_caps((const struct wayland_display *)d); -} - -static int impl_display_dispatch_timeout(struct yasl_display *d, int timeout_ms) -{ - return wayland_display_dispatch_timeout((struct wayland_display *)d, timeout_ms); -} - -static void impl_display_flush(struct yasl_display *d) -{ - wayland_display_flush((struct wayland_display *)d); -} - -static int impl_display_modifiers(const struct yasl_display *d) -{ - return wayland_display_modifiers((const struct wayland_display *)d); -} - -static void impl_display_copy(struct yasl_display *d, enum yasl_selection sel, const char *text) -{ - wayland_display_copy((struct wayland_display *)d, sel, text); -} - -static void impl_display_paste(struct yasl_display *d, enum yasl_selection sel, struct yasl_surface *target) -{ - wayland_display_paste((struct wayland_display *)d, sel, (struct wayland_surface *)target); -} - -static bool impl_display_drag_start(struct yasl_display *d, struct yasl_surface *origin, const struct yasl_drag_image *image, const struct yasl_drag_listener *l, void *ud) -{ - return wayland_display_drag_start((struct wayland_display *)d, (struct wayland_surface *)origin, image, l, ud); -} - -static void impl_display_drag_cancel(struct yasl_display *d) -{ - wayland_display_drag_cancel((struct wayland_display *)d); -} - -static struct yasl_surface *impl_surface_create_toplevel(struct yasl_display *d, - const struct yasl_surface_spec *spec, void *graphics_device) -{ - struct wayland_surface *result = wayland_surface_create_toplevel((struct wayland_display *)d, spec, graphics_device); - return result ? &result->base : NULL; -} - -static struct yasl_surface *impl_surface_create_popup(struct yasl_surface *parent, const struct yasl_popup_spec *spec) -{ - struct wayland_surface *result = wayland_surface_create_popup((struct wayland_surface *)parent, spec); - return result ? &result->base : NULL; -} - -static bool impl_surface_popup_reposition(struct yasl_surface *popup, const struct yasl_popup_spec *spec) -{ - return wayland_surface_popup_reposition((struct wayland_surface *)popup, spec); -} - -static void impl_surface_destroy(struct yasl_surface *s) -{ - wayland_surface_destroy((struct wayland_surface *)s); -} - -static struct yasl_display *impl_surface_display(const struct yasl_surface *s) -{ - struct wayland_display *result = wayland_surface_display((const struct wayland_surface *)s); - return result ? &result->base : NULL; -} - -static void impl_surface_set_callbacks(struct yasl_surface *s, const struct yasl_surface_cbs *cbs, void *ud) -{ - wayland_surface_set_callbacks((struct wayland_surface *)s, cbs, ud); -} - -static void impl_surface_set_title(struct yasl_surface *s, const char *title) -{ - wayland_surface_set_title((struct wayland_surface *)s, title); -} - -static void impl_surface_schedule_redraw(struct yasl_surface *s) -{ - wayland_surface_schedule_redraw((struct wayland_surface *)s); -} - -static bool impl_surface_present(struct yasl_surface *s, const struct yasl_framebuffer *fb, const struct yasl_damage_list *damage) -{ - return wayland_surface_present((struct wayland_surface *)s, fb, damage); -} - -static bool impl_surface_input_poll(struct yasl_surface *s, struct yasl_input_event *ev) -{ - return wayland_surface_input_poll((struct wayland_surface *)s, ev); -} - -static struct yasl_geometry impl_surface_geometry(const struct yasl_surface *s) -{ - return wayland_surface_geometry((const struct wayland_surface *)s); -} - -static uint32_t impl_surface_state(const struct yasl_surface *s) -{ - return wayland_surface_state((const struct wayland_surface *)s); -} - -static struct yasl_timing impl_surface_timing(const struct yasl_surface *s) -{ - return wayland_surface_timing((const struct wayland_surface *)s); -} - -static uint64_t impl_surface_frame_time_ns(struct yasl_surface *s, uint64_t now) -{ - return wayland_surface_frame_time_ns((struct wayland_surface *)s, now); -} - -static void impl_surface_set_cursor(struct yasl_surface *s, enum yasl_cursor cursor) -{ - wayland_surface_set_cursor((struct wayland_surface *)s, cursor); -} - -static void impl_surface_set_background_color(struct yasl_surface *s, uint32_t bg) -{ - wayland_surface_set_background_color((struct wayland_surface *)s, bg); -} - -static const char *impl_surface_ime_preedit(const struct yasl_surface *s) -{ - return wayland_surface_ime_preedit((const struct wayland_surface *)s); -} - -static bool impl_surface_ime_preedit_cursor(const struct yasl_surface *s, int *begin, int *end) -{ - return wayland_surface_ime_preedit_cursor((const struct wayland_surface *)s, begin, end); -} - -static void impl_surface_set_ime_caret(struct yasl_surface *s, struct yasl_rect2i caret) -{ - wayland_surface_set_ime_caret((struct wayland_surface *)s, caret); -} - -static bool impl_surface_start_interactive_move(struct yasl_surface *s) -{ - return wayland_surface_start_interactive_move((struct wayland_surface *)s); -} - -static bool impl_surface_start_interactive_resize(struct yasl_surface *s, enum yasl_resize_edge edge) -{ - return wayland_surface_start_interactive_resize((struct wayland_surface *)s, edge); -} - -static bool impl_surface_show_window_menu(struct yasl_surface *s, struct yasl_vector2i pos) -{ - return wayland_surface_show_window_menu((struct wayland_surface *)s, pos); -} - -static bool impl_surface_drag_carry(struct yasl_surface *s, struct yasl_vector2i offset) -{ - return wayland_surface_drag_carry((struct wayland_surface *)s, offset); -} - -static bool impl_surface_place_under_pointer(struct yasl_surface *s, struct yasl_vector2i at) -{ - return wayland_surface_place_under_pointer((struct wayland_surface *)s, at); -} - -static void *impl_display_get_native_handle(struct yasl_display *d) -{ - return wayland_display_get_native_handle((struct wayland_display *)d); -} - -static void *impl_surface_get_native_handle(struct yasl_surface *s) -{ - return wayland_surface_get_native_handle((struct wayland_surface *)s); -} - -const struct yasl_backend_ops yasl_wayland_backend = { - .type = YASL_BACKEND_WAYLAND, - .display_open = impl_display_open, - .display_close = impl_display_close, - .display_caps = impl_display_caps, - .display_dispatch_timeout = impl_display_dispatch_timeout, - .display_flush = impl_display_flush, - .display_modifiers = impl_display_modifiers, - .display_copy = impl_display_copy, - .display_paste = impl_display_paste, - .display_drag_start = impl_display_drag_start, - .display_drag_cancel = impl_display_drag_cancel, - .surface_create_toplevel = impl_surface_create_toplevel, - .surface_create_popup = impl_surface_create_popup, - .surface_popup_reposition = impl_surface_popup_reposition, - .surface_destroy = impl_surface_destroy, - .surface_display = impl_surface_display, - .surface_set_callbacks = impl_surface_set_callbacks, - .surface_set_title = impl_surface_set_title, - .surface_schedule_redraw = impl_surface_schedule_redraw, - .surface_present = impl_surface_present, - .surface_input_poll = impl_surface_input_poll, - .surface_geometry = impl_surface_geometry, - .surface_state = impl_surface_state, - .surface_timing = impl_surface_timing, - .surface_frame_time_ns = impl_surface_frame_time_ns, - .surface_set_cursor = impl_surface_set_cursor, - .surface_set_background_color = impl_surface_set_background_color, - .surface_ime_preedit = impl_surface_ime_preedit, - .surface_ime_preedit_cursor = impl_surface_ime_preedit_cursor, - .surface_set_ime_caret = impl_surface_set_ime_caret, - .surface_start_interactive_move = impl_surface_start_interactive_move, - .surface_start_interactive_resize = impl_surface_start_interactive_resize, - .surface_show_window_menu = impl_surface_show_window_menu, - .surface_drag_carry = impl_surface_drag_carry, - .surface_place_under_pointer = impl_surface_place_under_pointer, - .display_get_native_handle = impl_display_get_native_handle, - .surface_get_native_handle = impl_surface_get_native_handle, -}; |
