summaryrefslogtreecommitdiff
path: root/include/yasl/yasl.h
diff options
context:
space:
mode:
authorBerke Güzel <berke.guzel@gdh.digital>2026-10-14 09:38:31 +0300
committerBerke Güzel <berke.guzel@gdh.digital>2026-10-14 09:38:31 +0300
commit5ef6ca21ab9e1cf4f69254234d190a634b777d52 (patch)
tree974d3797a6d9487e54a811e224bf78a3f52dda85 /include/yasl/yasl.h
parent563b23a33726289387193b85d90fb569631ee05f (diff)
Remove deprecated Cocoa OpenGL and private compatibility APIs
Diffstat (limited to 'include/yasl/yasl.h')
-rw-r--r--include/yasl/yasl.h38
1 files changed, 25 insertions, 13 deletions
diff --git a/include/yasl/yasl.h b/include/yasl/yasl.h
index 38c5b88..c0ebb75 100644
--- a/include/yasl/yasl.h
+++ b/include/yasl/yasl.h
@@ -55,6 +55,20 @@ enum yasl_event_type { YASL_EVENT_NONE, YASL_EVENT_CLOSE, YASL_EVENT_QUIT, YASL_
YASL_EVENT_DRAG, YASL_EVENT_DISPLAY_LOST, YASL_EVENT_DISPLAY_RESTORED };
enum yasl_drop_action { YASL_DROP_OVER, YASL_DROP_LEAVE, YASL_DROP_DATA };
enum yasl_drag_action { YASL_DRAG_OVER, YASL_DRAG_LEAVE, YASL_DRAG_DROP };
+struct yasl_window_payload { int width,height,pixel_width,pixel_height; double scale; unsigned state; };
+struct yasl_key_payload { enum yasl_key key; enum yasl_key_action action; unsigned mods;
+ uint32_t codepoint, shifted, native_code; };
+struct yasl_text_payload { const char *data; size_t length; };
+struct yasl_pointer_payload { double x,y,dx,dy; enum yasl_pointer_action action; unsigned button,buttons,mods; };
+struct yasl_scroll_payload { double x,y,lines_x,lines_y,pixels_x,pixels_y; unsigned valid,source,phase,mods; bool momentum; };
+struct yasl_pen_payload { uint64_t device_id,tool_id; double x,y,pressure,tilt_x,tilt_y,rotation,distance,tangential,wheel_degrees;
+ unsigned axes_valid,axes_changed,buttons,changed_button,tool,action; bool in_contact; };
+struct yasl_composition_payload { const char *data; size_t length; int begin,end; bool active; uint64_t revision,generation; };
+struct yasl_text_edit_payload { const char *data; size_t length,begin,end; uint64_t revision,generation; };
+struct yasl_clipboard_payload { const char *data; size_t length; uint64_t request_id; enum yasl_transfer_status status; };
+struct yasl_drop_payload { enum yasl_drop_action action; double x,y; const char *data; size_t length; };
+struct yasl_drag_payload { enum yasl_drag_action action; double x,y; };
+
/** Read the union member named by type. Strings stay valid until the next wait.
* CLOSE: the user closed this window. QUIT: the system asked the app to quit.
* WINDOW: size, scale or state changed. REFRESH: draw now; sent once the window
@@ -70,20 +84,18 @@ struct yasl_event {
yasl_surface *surface;
uint64_t time_ns;
union {
- struct { int width,height,pixel_width,pixel_height; double scale; unsigned state; } window;
- struct { enum yasl_key key; enum yasl_key_action action; unsigned mods;
- uint32_t codepoint, shifted, native_code; } key;
- struct { const char *data; size_t length; } text;
- struct { double x,y,dx,dy; enum yasl_pointer_action action; unsigned button,buttons,mods; } pointer;
- struct { double x,y,lines_x,lines_y,pixels_x,pixels_y; unsigned valid,source,phase,mods; bool momentum; } scroll;
- struct { uint64_t device_id,tool_id; double x,y,pressure,tilt_x,tilt_y,rotation,distance,tangential,wheel_degrees;
- unsigned axes_valid,axes_changed,buttons,changed_button,tool,action; bool in_contact; } pen;
- struct { const char *data; size_t length; int begin,end; bool active; uint64_t revision,generation; } composition;
- struct { const char *data; size_t length,begin,end; uint64_t revision,generation; } text_edit;
- struct { const char *data; size_t length; uint64_t request_id; enum yasl_transfer_status status; } clipboard;
+ struct yasl_window_payload window;
+ struct yasl_key_payload key;
+ struct yasl_text_payload text;
+ struct yasl_pointer_payload pointer;
+ struct yasl_scroll_payload scroll;
+ struct yasl_pen_payload pen;
+ struct yasl_composition_payload composition;
+ struct yasl_text_edit_payload text_edit;
+ struct yasl_clipboard_payload clipboard;
/** DATA carries a text/uri-list for yasl_drop_next_path; x/y are set for OVER. */
- struct { enum yasl_drop_action action; double x,y; const char *data; size_t length; } drop;
- struct { enum yasl_drag_action action; double x,y; } drag;
+ struct yasl_drop_payload drop;
+ struct yasl_drag_payload drag;
};
};
/** Last error on this thread; success does not clear it. */