+ return "/dev/tty.SLAB_USBtoUART";
+}
+
+const char *subsurface_icon_name()
+{
+ static char path[1024];
+ char *ptr1, *ptr2;
+ uint32_t size = sizeof(path); /* need extra space to copy icon path */
+ if (_NSGetExecutablePath(path, &size) == 0) {
+ ptr1 = strcasestr(path,"MacOS/subsurface");
+ ptr2 = strcasestr(path,"Contents");
+ if (ptr1 && ptr2) {
+ /* we are running as installed app from a bundle */
+ if (ptr1 - path < size - strlen(REL_ICON_PATH)) {
+ strcpy(ptr1,REL_ICON_PATH);
+ return path;
+ }
+ }
+ }
+ return "packaging/macosx/Subsurface.icns";
+}
+
+void subsurface_ui_setup(GtkSettings *settings, GtkWidget *menubar,
+ GtkWidget *vbox)
+{
+ if (!divelist_font)
+ divelist_font = DIVELIST_MAC_DEFAULT_FONT;
+ g_object_set(G_OBJECT(settings), "gtk-font-name", UI_FONT, NULL);
+
+ theApp = g_object_new(GTK_TYPE_OSX_APPLICATION, NULL);
+ gtk_widget_hide (menubar);
+ gtk_osxapplication_set_menu_bar(theApp, GTK_MENU_SHELL(menubar));
+ gtk_osxapplication_set_use_quartz_accelerators(theApp, TRUE);
+ gtk_osxapplication_ready(theApp);
+