2 #include "testnative.h"
4 #ifdef TEST_NATIVE_COCOA
6 #include <Cocoa/Cocoa.h>
8 static void *CreateWindowCocoa(int w, int h);
9 static void DestroyWindowCocoa(void *window);
11 NativeWindowFactory CocoaWindowFactory = {
17 static void *CreateWindowCocoa(int w, int h)
19 NSAutoreleasePool *pool;
24 pool = [[NSAutoreleasePool alloc] init];
30 rect.origin.y = CGDisplayPixelsHigh(kCGDirectMainDisplay) - rect.origin.y - rect.size.height;
32 style = (NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask);
34 nswindow = [[NSWindow alloc] initWithContentRect:rect styleMask:style backing:NSBackingStoreBuffered defer:FALSE];
35 [nswindow makeKeyAndOrderFront:nil];
42 static void DestroyWindowCocoa(void *window)
44 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
45 NSWindow *nswindow = (NSWindow *)window;