#include <string.h>
#include <stdarg.h>
+#include "wx/cocoa/string.h"
+
+#import <Foundation/NSURL.h>
+#import <AppKit/NSWorkspace.h>
+
void wxDisplaySize(int *width, int *height)
{
// TODO
// TODO
}
+// Private helper method for wxLaunchDefaultBrowser
+bool wxCocoaLaunchDefaultBrowser(const wxString& url, int flags)
+{
+ // NOTE: We ignore the flags
+ return [[NSWorkspace sharedWorkspace] openURL: [NSURL URLWithString:wxNSStringWithWxString(url)]] != NO;
+}
+
#if 0
// DFE: These aren't even implemented by wxGTK, and no wxWidgets code calls
// them. If someone needs them, then they'll get a link error
// Launch default browser
// ----------------------------------------------------------------------------
+#ifdef __WXCOCOA__
+// Private method in Objective-C++ source file.
+bool wxCocoaLaunchDefaultBrowser(const wxString& url, int flags);
+#endif
+
bool wxLaunchDefaultBrowser(const wxString& urlOrig, int flags)
{
wxUnusedVar(flags);
#endif // __WXDEBUG__
return true;
}
+#elif defined(__WXCOCOA__)
+ // NOTE: We need to call the real implementation from src/cocoa/utils.mm
+ // because the code must use Objective-C features.
+ return wxCocoaLaunchDefaultBrowser(url, flags);
#elif defined(__WXMAC__)
OSStatus err;
ICInstance inst;