#if defined(OS_MACOS) #include #include #include #include #include #include #include void openWebpageMacos(const char *url) { CFURLRef urlRef = CFURLCreateWithBytes(NULL, (uint8_t*)(url), strlen(url), kCFStringEncodingASCII, NULL); LSOpenCFURLRef(urlRef, NULL); CFRelease(urlRef); } bool isMacosSystemDarkModeEnabled(void) { NSString * appleInterfaceStyle = [[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"]; if (appleInterfaceStyle && [appleInterfaceStyle length] > 0) { return [[appleInterfaceStyle lowercaseString] containsString:@"dark"]; } else { return false; } } #endif