X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=macos.c;h=4c856ce03717b652d9a7ae54cfe17809d07c05f5;hb=565736a471e9ba66cbc68ce76c90d5e0c2fa57cf;hp=b48f20d8707562951ecbd7268f34d99b47ee2993;hpb=290ce56d0181c0c7e7d6e1af3eb27d3015cffca7;p=ext%2Fsubsurface.git diff --git a/macos.c b/macos.c index b48f20d..4c856ce 100644 --- a/macos.c +++ b/macos.c @@ -2,6 +2,7 @@ /* implements Mac OS X specific functions */ #include "display-gtk.h" #include +#include static CFURLRef fileURL; static CFPropertyListRef propertyList; @@ -89,3 +90,28 @@ void subsurface_close_conf(void) CFRelease(xmlData); CFRelease(propertyList); } + +const char *subsurface_USB_name() +{ + return "/dev/tty.SLAB_USBtoUART"; +} + +#define REL_ICON_PATH "Resources/Subsurface.icns" +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"; +}