Wed, 27 May 2026 15:04:53 +0200
add ui_open_uri (Cocoa)
| ui/cocoa/toolkit.m | file | annotate | diff | comparison | revisions | |
| ui/common/wrapper.c | file | annotate | diff | comparison | revisions |
--- a/ui/cocoa/toolkit.m Tue May 26 21:05:47 2026 +0200 +++ b/ui/cocoa/toolkit.m Wed May 27 15:04:53 2026 +0200 @@ -130,6 +130,9 @@ void ui_main(void) { NSApplicationMain(app_argc, app_argv); + //[NSApp finishLaunching]; + //[NSApp activateIgnoringOtherApps:YES]; + //[NSApp run]; if(exit_on_shutdown) { exit(0); } @@ -147,6 +150,12 @@ [[NSApplication sharedApplication] terminate:nil]; } +void ui_open_uri(const char *uri) { + NSString *urlString = [NSString stringWithUTF8String:uri]; + NSURL *url = [NSURL URLWithString:urlString]; + [[NSWorkspace sharedWorkspace] openURL:url]; +} + /* ------------------- Window Visibility functions ------------------- */ void ui_show(UiObject *obj) {
--- a/ui/common/wrapper.c Tue May 26 21:05:47 2026 +0200 +++ b/ui/common/wrapper.c Wed May 27 15:04:53 2026 +0200 @@ -52,6 +52,7 @@ static int obj_unref(void *ptr) { ui_object_unref(ptr); + return 0; } void ui_mainthread_object_unref(UiObject *obj) { @@ -62,6 +63,7 @@ static int doc_unref(void *ptr) { ui_document_unref(ptr); + return 0; } void ui_mainthread_document_unref(void *doc) {