diff options
| author | Berke Güzel <berke.guzel@gdh.digital> | 2026-10-14 09:38:31 +0300 |
|---|---|---|
| committer | Berke Güzel <berke.guzel@gdh.digital> | 2026-10-14 09:38:31 +0300 |
| commit | 5ef6ca21ab9e1cf4f69254234d190a634b777d52 (patch) | |
| tree | 974d3797a6d9487e54a811e224bf78a3f52dda85 /src/common | |
| parent | 563b23a33726289387193b85d90fb569631ee05f (diff) | |
Remove deprecated Cocoa OpenGL and private compatibility APIs
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/backend.c | 32 | ||||
| -rw-r--r-- | src/common/backend.h | 9 | ||||
| -rw-r--r-- | src/common/events.c | 56 | ||||
| -rw-r--r-- | src/common/surface.c | 6 | ||||
| -rw-r--r-- | src/common/types.h | 106 |
5 files changed, 25 insertions, 184 deletions
diff --git a/src/common/backend.c b/src/common/backend.c index 8d20f67..939ec71 100644 --- a/src/common/backend.c +++ b/src/common/backend.c @@ -34,7 +34,6 @@ static struct yasl_private_display *open_backend(enum yasl_private_backend backe struct yasl_private_display *d = ops->display_open(loop, spec); if (!d && !errno) errno = ENODEV; if (d) { - d->callback_ud = spec ? spec->ud : NULL; if (!yasl_private_events_open(d)) { int error = errno; ops->display_close(d); @@ -132,26 +131,6 @@ int yasl_private_display_double_click_ms(const struct yasl_private_display *d) return ms > 0 && ms <= 10000 ? ms : YASL_PRIVATE_DOUBLE_CLICK_MS_DEFAULT; } -void yasl_private_display_copy(struct yasl_private_display *d, enum yasl_private_selection sel, const char *text) -{ - if (!d || !d->ops->display_copy || !text || - (sel != YASL_PRIVATE_CLIPBOARD && sel != YASL_PRIVATE_PRIMARY) || - (sel == YASL_PRIVATE_PRIMARY && !(yasl_private_display_caps(d) & YASL_PRIVATE_CAP_PRIMARY_SELECTION))) - return; - d->ops->display_copy(d, sel, text); -} - -void yasl_private_display_paste(struct yasl_private_display *d, enum yasl_private_selection sel, struct yasl_surface *target) -{ - if (!d || !d->ops->display_paste || - (sel != YASL_PRIVATE_CLIPBOARD && sel != YASL_PRIVATE_PRIMARY) || - (sel == YASL_PRIVATE_PRIMARY && !(yasl_private_display_caps(d) & YASL_PRIVATE_CAP_PRIMARY_SELECTION))) - return; - if (!target || target->display != d) - return; - d->ops->display_paste(d, sel, target); -} - bool yasl_private_display_drag_start(struct yasl_private_display *d, struct yasl_surface *origin, const struct yasl_private_drag_image *image, const struct yasl_private_drag_listener *l, void *ud) { if (!d || !d->ops->display_drag_start) @@ -336,17 +315,6 @@ bool yasl_private_surface_present(struct yasl_surface *s, const struct yasl_priv return s->display->ops->surface_present(s, fb, &clipped); } -bool yasl_private_surface_poll_event(struct yasl_surface *s, struct yasl_private_event *ev) -{ - if (!s || !ev) - return false; - if (s->display && s->display->events) - return yasl_private_events_poll_surface(s, ev); - if (s->display && s->display->ops && s->display->ops->surface_poll_event) - return s->display->ops->surface_poll_event(s, ev); - return input_queue_pop(&s->input, ev); -} - bool yasl_private_surface_read_pixels(struct yasl_surface *s, uint32_t *out, size_t cap, struct yasl_private_vector2i *size) { diff --git a/src/common/backend.h b/src/common/backend.h index bf6815a..6eefbb3 100644 --- a/src/common/backend.h +++ b/src/common/backend.h @@ -17,11 +17,9 @@ struct yasl_private_display { const struct yasl_private_backend_ops *ops; void *native_handle; bool offline; /* Connection lost; native handles are unusable until it is restored. */ - struct yasl_private_display_cbs callbacks; struct yasl_private_loop *loop; /* Backend's copy of yasl_private_display_spec.app_id, or NULL; for desktop services. */ const char *app_id; - void *callback_ud; struct yasl_private_event_state *events; struct yasl_surface *surfaces; }; @@ -82,7 +80,6 @@ bool yasl_private_events_register(struct yasl_surface *s); void yasl_private_events_unregister(struct yasl_surface *s); bool yasl_private_events_push(struct yasl_private_display *d, struct yasl_surface *queue_owner, const struct yasl_private_event *event); -bool yasl_private_events_poll_surface(struct yasl_surface *s, struct yasl_private_event *event); void yasl_private_surface_notify_configure(struct yasl_surface *s, struct yasl_private_geometry geometry); void yasl_private_surface_notify_refresh(struct yasl_surface *s); void yasl_private_surface_notify_close(struct yasl_surface *s); @@ -136,8 +133,6 @@ struct yasl_private_backend_ops { int (*display_modifiers)(const struct yasl_private_display *d); /* Optional; returns zero or less when the system reports no interval. */ int (*display_double_click_ms)(const struct yasl_private_display *d); - void (*display_copy)(struct yasl_private_display *d, enum yasl_private_selection sel, const char *text); - void (*display_paste)(struct yasl_private_display *d, enum yasl_private_selection sel, struct yasl_surface *target); bool (*display_copy_text)(struct yasl_private_display *d, enum yasl_private_selection sel, const char *text); bool (*display_request_paste)(struct yasl_private_display *d, enum yasl_private_selection sel, struct yasl_surface *target, uint64_t request_id); @@ -150,7 +145,7 @@ struct yasl_private_backend_ops { bool (*surface_popup_reposition)(struct yasl_surface *popup, const struct yasl_private_popup_spec *spec); void (*surface_destroy)(struct yasl_surface *s); struct input_queue *(*surface_input_queue)(struct yasl_surface *s); - bool (*surface_set_size)(struct yasl_surface *s, struct yasl_private_vector2i size_logical); + bool (*surface_set_size)(struct yasl_surface *s, struct yasl_private_vector2i size); bool (*surface_set_fullscreen)(struct yasl_surface *s, bool enabled); bool (*surface_set_maximized)(struct yasl_surface *s, bool enabled); bool (*surface_minimize)(struct yasl_surface *s); @@ -160,8 +155,6 @@ struct yasl_private_backend_ops { void (*surface_set_title)(struct yasl_surface *s, const char *title); void (*surface_schedule_redraw)(struct yasl_surface *s); bool (*surface_present)(struct yasl_surface *s, const struct yasl_private_framebuffer *fb, const struct yasl_private_damage_list *damage); - /* Optional; NULL means the common input queue is drained. */ - bool (*surface_poll_event)(struct yasl_surface *s, struct yasl_private_event *ev); /* Optional; NULL means only YASL_PRIVATE_POINTER_NORMAL is supported. Backends that * implement RELATIVE push POINTER_MOTION with delta set and pos frozen. */ bool (*surface_set_pointer_mode)(struct yasl_surface *s, enum yasl_private_pointer_mode mode); diff --git a/src/common/events.c b/src/common/events.c index ba78d77..9245050 100644 --- a/src/common/events.c +++ b/src/common/events.c @@ -228,46 +228,18 @@ bool yasl_private_display_post(struct yasl_private_display *d, const struct yasl return true; } -static bool poll_event(struct yasl_private_display *d, uint64_t queue_id, struct yasl_private_event *event) +bool yasl_private_display_poll_event(struct yasl_private_display *d, struct yasl_private_event *event) { if (!d || !d->events || !event) return false; struct yasl_private_event_state *state = d->events; yasl_private_mutex_lock(&state->mutex); - struct event_node *discarded = NULL; - struct event_node **entry = &state->head; - struct event_node *previous = NULL; - if (queue_id) { - /* The input-only migration adapter uses legacy callbacks for lifecycle. - * Retaining those notifications would keep dispatch permanently ready. - * Mixing this adapter with display polling is deliberately unsupported. */ - while (*entry) { - struct event_node *candidate = *entry; - if (candidate->event.type < YASL_PRIVATE_EVENT_KEY || - candidate->event.type > YASL_PRIVATE_EVENT_INPUT_RESET) { - *entry = candidate->next; - if (state->tail == candidate) state->tail = previous; - candidate->next = discarded; - discarded = candidate; - } else { - previous = candidate; - entry = &candidate->next; - } - } - entry = &state->head; - previous = NULL; - while (*entry && (*entry)->queue_id != queue_id) { - previous = *entry; - entry = &(*entry)->next; - } - } - struct event_node *node = *entry; + struct event_node *node = state->head; if (!node) { yasl_private_mutex_unlock(&state->mutex); - dispose_list(discarded); return false; } - *entry = node->next; - if (state->tail == node) state->tail = previous; + state->head = node->next; + if (state->tail == node) state->tail = NULL; node->next = NULL; if (node->event.surface_id) node->event.surface = yasl_private_events_find(d, node->event.surface_id); @@ -276,20 +248,9 @@ static bool poll_event(struct yasl_private_display *d, uint64_t queue_id, struct *event = node->event; yasl_private_mutex_unlock(&state->mutex); dispose(last); - dispose_list(discarded); return true; } -bool yasl_private_display_poll_event(struct yasl_private_display *d, struct yasl_private_event *event) -{ - return poll_event(d, 0, event); -} - -bool yasl_private_events_poll_surface(struct yasl_surface *s, struct yasl_private_event *event) -{ - return s && s->id ? poll_event(s->display, s->id, event) : false; -} - uint64_t yasl_private_events_request_id(struct yasl_private_display *d) { if (!d->events || d->events->request == UINT64_MAX) { errno = EOVERFLOW; return 0; } @@ -310,14 +271,12 @@ void yasl_private_surface_notify_configure(struct yasl_surface *s, struct yasl_p .resize = {.geometry = geometry, .scale_changed = previous_scale != geometry.scale_120}}; yasl_private_events_push(s->display, s, &event); if (s->display) yasl_private_surface_request_frame(s); - if (s->callbacks.configure) s->callbacks.configure(s, geometry, s->ud); } void yasl_private_surface_notify_close(struct yasl_surface *s) { struct yasl_private_event event = {.type = YASL_PRIVATE_EVENT_WINDOW_CLOSE, .surface = s}; yasl_private_events_push(s->display, s, &event); - if (s->callbacks.close) s->callbacks.close(s, s->ud); } void yasl_private_surface_notify_state(struct yasl_surface *s, uint32_t flags) @@ -325,21 +284,18 @@ void yasl_private_surface_notify_state(struct yasl_surface *s, uint32_t flags) s->state = flags; struct yasl_private_event event = {.type = YASL_PRIVATE_EVENT_WINDOW_STATE, .surface = s, .state.flags = flags}; yasl_private_events_push(s->display, s, &event); - if (s->callbacks.state) s->callbacks.state(s, flags, s->ud); } void yasl_private_surface_notify_drag(struct yasl_surface *s, enum yasl_private_drag_event action, struct yasl_private_vector2i pos) { struct yasl_private_event event = {.type = YASL_PRIVATE_EVENT_DRAG, .surface = s, .drag = {action, pos}}; yasl_private_events_push(s->display, s, &event); - if (s->callbacks.drag) s->callbacks.drag(s, action, pos, s->ud); } void yasl_private_surface_notify_drop(struct yasl_surface *s, enum yasl_private_drop_event action, struct yasl_private_vector2i pos) { struct yasl_private_event event = {.type = YASL_PRIVATE_EVENT_DROP_HOVER, .surface = s, .drop = {action, pos}}; yasl_private_events_push(s->display, s, &event); - if (s->callbacks.drop) s->callbacks.drop(s, action, pos, s->ud); } void yasl_private_surface_notify_composition(struct yasl_surface *s, const char *text, int begin, int end) @@ -367,8 +323,4 @@ void yasl_private_display_notify_event(struct yasl_private_display *d, enum yasl { struct yasl_private_event event = {.type = type}; yasl_private_events_push(d, NULL, &event); - void (*callback)(void *) = type == YASL_PRIVATE_EVENT_DISPLAY_QUIT ? d->callbacks.quit - : type == YASL_PRIVATE_EVENT_DISPLAY_REOPEN ? d->callbacks.reopen - : type == YASL_PRIVATE_EVENT_DISPLAY_LOST ? d->callbacks.lost : NULL; - if (callback) callback(d->callback_ud); } diff --git a/src/common/surface.c b/src/common/surface.c index 9b4a8ad..b47fea7 100644 --- a/src/common/surface.c +++ b/src/common/surface.c @@ -119,7 +119,7 @@ yasl_surface *yasl_surface_create(const char *title,int width,int height,unsigne if(!creation_valid(width,height,flags)) return NULL; bool fresh=!display; if(!initialize()) return NULL; - struct yasl_private_window_spec spec={.title=title,.size_logical={width,height}, + struct yasl_private_window_spec spec={.title=title,.size={width,height}, .flags=flags,.external_gpu=!(flags&YASL_SURFACE_CPU)}; yasl_surface *s=yasl_private_surface_create_toplevel(display,&spec); if(!s) { @@ -446,7 +446,7 @@ static bool trigger_valid(yasl_surface *s,const yasl_event *e) static bool popup_spec(yasl_surface *s,int w,int h,double x,double y,double aw,double ah,enum yasl_popup_edge anchor,enum yasl_popup_edge gravity,unsigned constraints,struct yasl_private_popup_spec *out) { if(w<=0||h<=0 || (unsigned)anchor>8 || (unsigned)gravity>8 || (constraints&~63u))return yasl_public_fail(EINVAL); - *out=(struct yasl_private_popup_spec){.size={yasl_private_scale_to_device(w,s->scale_120),yasl_private_scale_to_device(h,s->scale_120)},.anchor_edges=anchor,.gravity=gravity,.constraints=constraints,.positioner_explicit=true}; + *out=(struct yasl_private_popup_spec){.size={yasl_private_scale_to_device(w,s->scale_120),yasl_private_scale_to_device(h,s->scale_120)},.anchor_edges=anchor,.gravity=gravity,.constraints=constraints}; return logical_rect(s,x,y,aw,ah,&out->anchor); } yasl_surface *yasl_popup_create(yasl_surface *parent,int w,int h,double x,double y,double aw,double ah,enum yasl_popup_edge anchor,enum yasl_popup_edge gravity,unsigned constraints,const yasl_event *trigger) @@ -494,7 +494,7 @@ yasl_surface *yasl_gl_surface_create(const char *title,int w,int h,unsigned flag bool fresh=!display;if(!initialize())return NULL; if(share && (share->display!=display || share->presenter!=YASL_PRIVATE_PRESENTER_GL)) {yasl_public_fail(EINVAL);return NULL;} if(!display->ops->surface_create_gl) {if(fresh)yasl_shutdown();yasl_public_fail(ENOTSUP);return NULL;} - struct yasl_private_window_spec spec={.title=title,.size_logical={w,h},.flags=flags,.external_gpu=true}; + struct yasl_private_window_spec spec={.title=title,.size={w,h},.flags=flags,.external_gpu=true}; yasl_surface *s=display->ops->surface_create_gl(display,&spec,attrs,share); if(!s){int error=errno;if(fresh)yasl_shutdown();yasl_public_fail(error);return NULL;} if(!yasl_private_events_register(s)){int error=errno;display->ops->surface_destroy(s);if(fresh)yasl_shutdown();yasl_public_fail(error);return NULL;} diff --git a/src/common/types.h b/src/common/types.h index 40c502f..8b9bbba 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -22,7 +22,7 @@ * Coordinates have their origin at the upper left; x grows right and y grows down. * Scale is an integer ratio with YASL_PRIVATE_SCALE_UNIT (120) representing 1x. * See the application guide for the display-wide dispatch/poll/flush cycle - * and backend limits. Legacy surface polling is an input-only filtered adapter. + * and backend limits. */ #ifndef YASL_PRIVATE_H #define YASL_PRIVATE_H @@ -145,7 +145,7 @@ enum yasl_private_surface_state : uint32_t { YASL_PRIVATE_STATE_TILED = 1 << 5, /**< At least one edge is tiled; currently reported by Wayland. */ }; -/** System cursor shapes. HIDDEN preserves pointer input; NONE is its compatibility alias. */ +/** System cursor shapes. HIDDEN preserves pointer input. */ enum yasl_private_cursor { YASL_PRIVATE_CURSOR_ARROW, /**< Default arrow. */ YASL_PRIVATE_CURSOR_TEXT, /**< Text insertion. */ @@ -157,7 +157,6 @@ enum yasl_private_cursor { YASL_PRIVATE_CURSOR_RESIZE_EW, /**< Horizontal resize. */ YASL_PRIVATE_CURSOR_RESIZE_NS, /**< Vertical resize. */ YASL_PRIVATE_CURSOR_HIDDEN, /**< Hidden system cursor; pointer input continues. */ - YASL_PRIVATE_CURSOR_NONE = YASL_PRIVATE_CURSOR_HIDDEN, /**< Compatibility alias for HIDDEN. */ }; /** Valid interactive resize edges; combinations are restricted to the named values. */ @@ -328,7 +327,7 @@ struct yasl_private_pointer_pen { enum yasl_private_event_type { YASL_PRIVATE_EVENT_NONE = 0, - /* Input: produced by backends, returned by yasl_private_surface_poll_event(). */ + /* Input: produced by backends and consumed from the display FIFO. */ YASL_PRIVATE_EVENT_KEY, /**< .key */ YASL_PRIVATE_EVENT_TEXT, /**< .text — committed UTF-8; insert this, not key codepoints. */ YASL_PRIVATE_EVENT_POINTER_DOWN, /**< .pointer — button/tip pressed; button valid. */ @@ -337,12 +336,11 @@ enum yasl_private_event_type { YASL_PRIVATE_EVENT_POINTER_SCROLL, /**< .pointer — scroll valid. */ YASL_PRIVATE_EVENT_POINTER_LEAVE, /**< .pointer — last known pos/device; cancel hover state. */ YASL_PRIVATE_EVENT_FOCUS, /**< .focus — keyboard focus changed; cancel held state on loss. */ - YASL_PRIVATE_EVENT_PASTE, /**< .text — UTF-8 from yasl_private_display_paste(). */ + YASL_PRIVATE_EVENT_PASTE, /**< .paste — clipboard request completion. */ YASL_PRIVATE_EVENT_DROP, /**< .text — dropped text/uri-list: CRLF-separated file URLs, not paths. */ YASL_PRIVATE_EVENT_INPUT_RESET, /**< No payload. Input stream interrupted; clear held keys, buttons, strokes, IME. */ - /* Window and application: part of the display FIFO, as well as runner delivery. - * Legacy window callbacks also receive matching native notifications. */ + /* Window and application notifications in the display FIFO. */ YASL_PRIVATE_EVENT_WINDOW_RESIZE, /**< .resize — size and/or scale changed; reallocate and redraw. */ YASL_PRIVATE_EVENT_WINDOW_CLOSE, /**< No payload. User asked to close the window. */ YASL_PRIVATE_EVENT_USER, /**< .user — posted application message. */ @@ -414,7 +412,7 @@ struct yasl_private_pointer_event { /** Borrowed NUL-terminated UTF-8, shared by TEXT, PASTE and DROP. */ struct yasl_private_text_event { - /** Borrowed NUL-terminated bytes; see yasl_private_surface_poll_event() for lifetime. */ + /** Borrowed NUL-terminated bytes; valid until the next successful display poll or display close. */ const char *data; /** Length in bytes excluding the terminating NUL. */ size_t len; @@ -427,11 +425,11 @@ enum yasl_private_transfer_status { YASL_PRIVATE_TRANSFER_FAILED, /**< Transfer or decoding failed. */ }; -/** Clipboard completion; data/len alias the legacy text payload. */ +/** Clipboard completion; data/len share the text payload layout. */ struct yasl_private_paste_event { const char *data; /**< Borrowed NUL-terminated UTF-8; empty on failure. */ size_t len; /**< Byte length excluding NUL. */ - uint64_t request_id; /**< Zero for a legacy paste request. */ + uint64_t request_id; /**< Nonzero clipboard request identity. */ enum yasl_private_transfer_status status; /**< Completion outcome. */ }; @@ -511,7 +509,7 @@ struct yasl_private_event { struct { const char *data; size_t len; uint64_t revision, generation; size_t begin, end; } text_edit; struct yasl_private_key_event key; /**< KEY */ struct yasl_private_pointer_event pointer; /**< POINTER_* */ - struct yasl_private_text_event text; /**< TEXT, legacy PASTE, DROP */ + struct yasl_private_text_event text; /**< TEXT, DROP */ struct yasl_private_paste_event paste; /**< PASTE */ struct yasl_private_composition_event composition; /**< COMPOSITION */ struct yasl_private_state_event state; /**< WINDOW_STATE */ @@ -534,35 +532,9 @@ struct yasl_private_event { */ /* Callbacks */ -/** Optional display notifications. NULL callback members are ignored. */ -struct yasl_private_display_cbs { - /** Application quit request; arrange orderly shutdown after dispatch returns. */ - void (*quit)(void *ud); - /** Application reopen/activation request, currently Cocoa. */ - void (*reopen)(void *ud); - /** Display connection lost; arrange cleanup after dispatch returns. */ - void (*lost)(void *ud); -}; - -/** Optional window/popup notifications, copied from yasl_private_window_spec.cbs or by -yasl_private_surface_set_callbacks(). -Callbacks may destroy their surface. They must then return without further use -of the surface or draw target. NULL members are ignored. */ +/** Internal CPU presenter callback, copied on installation. */ struct yasl_private_window_cbs { - /** Initialize the entire target and optionally present. Requested through schedule_redraw/flush. */ void (*draw)(struct yasl_surface *s, struct yasl_private_frame *frame, void *ud); - /** Configured size/scale changed; reallocate application content and request a redraw. */ - void (*configure)(struct yasl_surface *s, struct yasl_private_geometry geometry, void *ud); - /** Window/popup close request; application is responsible for destruction. */ - void (*close)(struct yasl_surface *s, void *ud); - /** Reported yasl_private_surface_state bitmask changed; matches yasl_private_surface_state(s). */ - void (*state)(struct yasl_surface *s, uint32_t state, void *ud); - /** YASL surface-drag target hover, leave, or drop; pos is in device pixels. */ - void (*drag)(struct yasl_surface *s, enum yasl_private_drag_event ev, - struct yasl_private_vector2i pos, void *ud); - /** External data-drag hover or leave; pos is in device pixels. */ - void (*drop)(struct yasl_surface *s, enum yasl_private_drop_event ev, - struct yasl_private_vector2i pos, void *ud); }; /* Display Lifecycle */ @@ -578,10 +550,6 @@ enum yasl_private_backend { struct yasl_private_display_spec { /** Copied application identifier, conventionally a reverse-domain UTF-8 string; NULL uses backend defaults. */ const char *app_id; - /** Copied optional display callbacks; NULL disables them. */ - const struct yasl_private_display_cbs *cbs; - /** Borrowed display callback userdata. */ - void *ud; /** Zero/AUTO chooses native backend; explicit choices never fall back. */ enum yasl_private_backend backend; @@ -661,26 +629,6 @@ int yasl_private_display_modifiers(const struct yasl_private_display *d); * rather than on every click. */ int yasl_private_display_double_click_ms(const struct yasl_private_display *d); -/* Unsupported/invalid selections are no-ops, never clipboard aliases. */ -/** - * Offer a copy of a NUL-terminated UTF-8 string as a selection. - * @param d Display, or NULL for no action. - * @param sel YASL_PRIVATE_CLIPBOARD or YASL_PRIVATE_PRIMARY. - * @param text Text copied during this call; NULL does nothing. - * Unsupported selections do nothing. The void return does not confirm that the - * system accepted the offer; Wayland may require a recent input serial. - */ -void yasl_private_display_copy(struct yasl_private_display *d, enum yasl_private_selection sel, const char *text); -/** - * Request text delivery to a particular surface. - * @param d Display that owns target. - * @param sel YASL_PRIVATE_CLIPBOARD or YASL_PRIVATE_PRIMARY. - * @param target Destination surface; NULL or a surface on another display does nothing. - * Results arrive as YASL_PRIVATE_EVENT_PASTE, possibly during a later dispatch. No result - * is promised for unavailable data or a failed transfer. Destroying target cancels - * delivery. Unsupported selections do nothing. - */ -void yasl_private_display_paste(struct yasl_private_display *d, enum yasl_private_selection sel, struct yasl_surface *target); /* A successful drag invokes the copied listener's non-NULL end once, including * cancel and display close. Failed starts do not invoke it. */ @@ -714,19 +662,16 @@ struct yasl_private_window_spec { /** Copied UTF-8 title; NULL uses backend defaults. */ const char *title; /** Requested logical-pixel width and height; both must be positive. */ - union { - struct yasl_private_vector2i size_logical; /**< Requested logical-pixel extent. */ - struct yasl_private_vector2i size; /**< Migration alias for size_logical. */ - }; + struct yasl_private_vector2i size; /** Request initial fullscreen; actual state is reported asynchronously. */ bool fullscreen; /** Permit unpaced presentation where supported; a hint, not a guarantee. */ bool tearing; /** Copied optional window callbacks; NULL disables them. */ const struct yasl_private_window_cbs *cbs; - /** Borrowed window callback userdata; ignored by the runner. */ + /** Borrowed CPU presenter userdata. */ void *ud; - /** Borrowed application data, independent of callbacks and available in either loop style. */ + /** Borrowed application data, independent of the CPU presenter. */ void *userdata; }; @@ -738,13 +683,10 @@ Dimensions must be positive, at most 32767, and fit an INT32_MAX-byte buffer; backends may impose further limits after scaling or resolving placement. */ struct yasl_private_popup_spec { unsigned anchor_edges, gravity, constraints; - bool positioner_explicit; /** Full popup framebuffer extent in device pixels, including transparent margins. */ struct yasl_private_vector2i size; /** Rectangle in parent framebuffer coordinates, in device pixels. */ struct yasl_private_rect2i anchor; - /** true prefers right of anchor; false prefers below. Placement may flip/slide. */ - bool beside; /** Top-left content offset within the popup, in device pixels. */ struct yasl_private_vector2i content_offset; /** Content extent; zero per axis extends to the corresponding size edge. */ @@ -761,10 +703,8 @@ struct yasl_private_popup_spec { * size may differ from the request. The callback table in spec->cbs is copied; * spec->ud stays borrowed until callbacks are replaced or the surface is destroyed. * This window's callbacks cannot run before creation returns. Use - * yasl_private_surface_geometry() for initial geometry; an initial configure callback - * is not guaranteed. Schedule an initial redraw after setting up application state. - * On a display owned by yasl_private_run(), the runner installs its own callbacks instead; - * use yasl_private_app_desc.event and yasl_private_app_desc.frame for application notifications. + * yasl_private_surface_geometry() for initial geometry. Schedule an initial redraw + * after setting up the CPU presenter. Lifecycle notifications arrive in the display FIFO. */ struct yasl_surface *yasl_private_surface_create_toplevel(struct yasl_private_display *d, const struct yasl_private_window_spec *spec); @@ -809,7 +749,7 @@ struct yasl_private_display *yasl_private_surface_display(const struct yasl_surf * @param s Surface. * @param cbs Table copied by value; NULL removes all callbacks. NULL members are ignored. * @param ud Borrowed userdata passed to the installed callbacks. - * @return true if replaced; false with EINVAL for NULL, EBUSY on a runner-owned surface. + * @return true if replaced; false with EINVAL for NULL. * This call only replaces callbacks; it does not invoke them. * Use yasl_private_surface_geometry() to read current geometry; do not rely on receiving * an initial configure callback when registering. @@ -849,18 +789,6 @@ void yasl_private_surface_schedule_redraw(struct yasl_surface *s); bool yasl_private_surface_present(struct yasl_surface *s, const struct yasl_private_framebuffer *fb, const struct yasl_private_damage_list *damage); /** - * Migration adapter: consume one input event for a surface from the display FIFO. - * Popup input can belong to the root queue; inspect ev->surface. Returns false - * for empty/invalid arguments, leaving ev unchanged. Strings remain borrowed - * until the next successful display or surface poll, or display close. Pending - * recipient events are canceled on destruction. Prefer yasl_private_display_poll_event() - * to receive window, composition, and display events as well as input. This - * input-only adapter discards pending non-input events across the display - * (legacy callbacks already delivered lifecycle changes). Do not mix - * the two polling styles in one application. Use the display thread. - */ -bool yasl_private_surface_poll_event(struct yasl_surface *s, struct yasl_private_event *ev); -/** * Decode the next local file path from a YASL_PRIVATE_EVENT_DROP payload. * @param cursor Required in/out position in the NUL-terminated list. Start it * at event.text.data; a NULL *cursor returns zero. @@ -958,7 +886,7 @@ void yasl_private_surface_request_frame(struct yasl_surface *s); bool yasl_private_surface_set_pacing(struct yasl_surface *s, yasl_private_pacing_mode mode); /** Request a positive logical-pixel size. Success means issued, not configured. */ -bool yasl_private_surface_set_size(struct yasl_surface *s, struct yasl_private_vector2i size_logical); +bool yasl_private_surface_set_size(struct yasl_surface *s, struct yasl_private_vector2i size); /** Request fullscreen state; returns acceptance, not confirmation. */ bool yasl_private_surface_set_fullscreen(struct yasl_surface *s, bool enabled); /** Request maximized state; returns acceptance, not confirmation. */ |
