From 9913b7d590f46e59a475abbe85e70e02979d8d37 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Mon, 13 Apr 2026 16:16:25 -0400 Subject: Adjust window api, cleanup and update deps Signed-off-by: Andrew Opalach --- src/window.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/window.h') diff --git a/src/window.h b/src/window.h index f7f25e2..de18c83 100644 --- a/src/window.h +++ b/src/window.h @@ -44,6 +44,10 @@ #define STELA_MIN_HEIGHT 16u #endif +#ifdef STELA_WINDOW_WAYLAND +#define STELA_ICON_AT_RUNTIME +#endif + // Drag window by clicking anywhere with MOUSE2. #define STELA_MOUSE2_DRAG @@ -81,7 +85,7 @@ struct stl_window { bool fullscreen; u32 flags; // Methods. - bool (*create_window)(struct stl_window *, u32, u32, const char *, const char *, u32); + bool (*create_window)(struct stl_window *, u32, u32, u32, const char *, const char *, const char *); void (*resize_internal)(struct stl_window *, u32, u32); void (*resize)(struct stl_window *, u32, u32); void (*toggle_fullscreen)(struct stl_window *); @@ -127,8 +131,11 @@ struct stl_window { bool (*scroll_callback)(void *, f64); bool (*mouse_button_callback)(void *, u8, u8); bool (*key_callback)(void *, u8, u16); - // Always runs on the thread that received the key event. - void (*key_immediate_callback)(void *, u8, u16); + // Immediate: + // - Always runs on the thread that received the event. + // - Return value decides if the event should "pass through" or not. + // True = Consume, False = Passthrough. + bool (*key_immediate_callback)(void *, u8, u16); void (*should_close_callback)(void *); void *userdata; bool closed; @@ -189,6 +196,9 @@ extern s32 stl_platform_main(u32 argc, str *argv); f64 stl_scale_scroll(f64 v, f64 factor); void stl_set_output_discovered_callback(void (*output_discovered)(void *, struct stl_monitor *), void *userdata); +#ifdef STELA_ICON_AT_RUNTIME +void stl_set_icon_data(u8 *data, u32 size); +#endif bool stl_global_init(bool skip_graphics); s32 stl_global_get_poll_fd(void); @@ -205,7 +215,7 @@ void stl_window_send_scroll_event(struct stl_window *window, f64 y); void stl_window_send_mouse_button_event(struct stl_window *window, u8 state, u8 button); void stl_window_drop_mouse_buttons(struct stl_window *window); void stl_window_send_key_event(struct stl_window *window, u8 state, u16 button); -void stl_window_send_key_immediate_event(struct stl_window *window, u8 state, u16 button); +bool stl_window_send_key_immediate_event(struct stl_window *window, u8 state, u16 button); void stl_window_drop_modifiers(struct stl_window *window); void stl_window_send_should_close_event(struct stl_window *window); #ifdef STELA_EVENT_BUFFER -- cgit v1.2.3-101-g0448