Files
will.anderson 58753a88d7
El SDK Release / build-and-release (pull_request) Failing after 17s
feat(ui): native vessel, HTML vessel update, native hello examples, profile card, UI tools
el-native vessel: El-level wrappers around __widget_* C builtins, exposing
vstack, label, button, text_field, etc. as clean El functions for application code.

el-html/main.elh: updated extern declarations for the HTML vessel's codegen API.

native-hello: cross-platform desktop example (AppKit/GTK4/Win32/SDL2) with
build scripts, Dockerfiles for Linux/Pi, and Win32 cross-compile support.

native-hello-android: Gradle project with ElBridge integration and build script.

native-hello-ios: Xcode project for the iOS UIKit target.

profile-card: manifest.el for a styling/layout/i18n example app that exercises
el-style, el-layout, el-i18n, el-config, and el-secrets vessels.

ui/tools/native-codegen: Python codegen pass (el_ui_native_codegen.py) that
lowers el-ui component DSL to el-native vessel calls, plus build script and
test fixtures.
2026-06-29 12:40:37 -05:00

49 lines
1.8 KiB
Objective-C

/*
* main.m — entry point for native-hello-ios.
*
* iOS UIKit lifecycle:
* UIApplicationMain never returns. The compiled el program's boot body
* (native_init → window_from_manifest → app_build → window_show) must
* run inside applicationDidFinishLaunchingWithOptions on the main thread.
*
* How it works:
* 1. el_uikit_set_args() forwards argc/argv to UIApplicationMain.
* 2. el_main_entry_fn is set to el_app_boot (defined below) before
* UIApplicationMain is entered.
* 3. ElAppDelegate.didFinishLaunchingWithOptions calls el_main_entry_fn(),
* which runs the el program's widget setup at the correct lifecycle point.
* 4. __native_run_loop() inside the compiled el main is a no-op on iOS —
* UIApplicationMain already owns the run loop.
*
* The generated native_hello.c exports el_app_main() (renamed from main by
* the gen step in build.sh). We call it from el_app_boot so it runs after
* UIApplicationMain sets up the application object.
*
* Compile with -fno-objc-arc (required by el_uikit.m).
*/
#import <UIKit/UIKit.h>
/* From el_uikit.m */
void el_uikit_set_args(int argc, char **argv);
extern void (*el_main_entry_fn)(void);
/* Forward declaration of the renamed compiled el main. */
int el_app_main(int argc, char **argv);
/* Boot function registered as el_main_entry_fn. Called by ElAppDelegate
* inside didFinishLaunchingWithOptions on the main thread. */
static void el_app_boot(void) {
char *argv[] = {"el-app", NULL};
el_app_main(1, argv);
}
int main(int argc, char *argv[]) {
el_uikit_set_args(argc, argv);
/* Register the boot function so ElAppDelegate can call it. */
el_main_entry_fn = el_app_boot;
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, @"ElAppDelegate");
}
}