summaryrefslogtreecommitdiff
path: root/include/yasl
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-13 15:43:04 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-13 15:43:04 +0300
commite24b8a8cef001e1c7e50ab12b739486f59b2a850 (patch)
treef4678f9c7081c2bfd2dad56c8ca456c01447a116 /include/yasl
parent38533c81e7b7ebfc5f281c2523188aeaa38d09c3 (diff)
Let yasl_app_desc describe its initial window
A new optional yasl_app_desc.window spec makes yasl_run() create that toplevel and request its first frame before init(), which is now optional too. If creation fails, yasl_run() closes the display and returns an error without calling init(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'include/yasl')
-rw-r--r--include/yasl/app.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/yasl/app.h b/include/yasl/app.h
index f067d5b..79b2519 100644
--- a/include/yasl/app.h
+++ b/include/yasl/app.h
@@ -148,10 +148,16 @@ struct yasl_app_desc {
enum yasl_backend backend;
/** User data passed to all callbacks. */
void *userdata;
+ /**
+ * Optional toplevel created before init(), with its first frame requested.
+ * Borrowed for the call; spec cbs and ud are ignored as for any runner window.
+ * yasl_run() returns an error without calling init() if creation fails.
+ */
+ const struct yasl_window_spec *window;
/**
- * Called once after display and event machinery initialization.
- * Use this to create windows and initialize application resources.
+ * Optional; called once after display and event machinery initialization.
+ * Use this to create further windows and initialize application resources.
* Return YASL_APP_CONTINUE or YASL_APP_QUIT.
*/
enum yasl_app_result (*init)(void *ud, struct yasl_display *d);