Browse Source

More osx testing

gh-pages
falkTX 11 years ago
parent
commit
ba41293627
2 changed files with 37 additions and 1 deletions
  1. +34
    -1
      dgl/src/pugl/pugl_osx.m
  2. +3
    -0
      dgl/src/pugl/pugl_osx_extended.m

+ 34
- 1
dgl/src/pugl/pugl_osx.m View File

@@ -55,12 +55,15 @@
[result setLevel: CGShieldingWindowLevel() + 1]; [result setLevel: CGShieldingWindowLevel() + 1];


return result; return result;

// unused
(void)aStyle; (void)bufferingType; (void)flag;
} }


- (void)setPuglview:(PuglView*)view - (void)setPuglview:(PuglView*)view
{ {
puglview = view; puglview = view;
[self setContentSize:NSMakeSize(view->width, view->height) ];
[self setContentSize:NSMakeSize(view->width, view->height)];
} }


- (BOOL)windowShouldClose:(id)sender - (BOOL)windowShouldClose:(id)sender
@@ -68,6 +71,9 @@
if (puglview->closeFunc) if (puglview->closeFunc)
puglview->closeFunc(puglview); puglview->closeFunc(puglview);
return YES; return YES;

// unused
(void)sender;
} }


@end @end
@@ -176,6 +182,9 @@ puglDisplay(PuglView* view)
puglDisplay(puglview); puglDisplay(puglview);
glFlush(); glFlush();
glSwapAPPLE(); glSwapAPPLE();

// unused
return; (void)rect;
} }


static unsigned static unsigned
@@ -213,10 +222,15 @@ getModifiers(PuglView* view, NSEvent* ev)
- (void)mouseEntered:(NSEvent*)theEvent - (void)mouseEntered:(NSEvent*)theEvent
{ {
[self updateTrackingAreas]; [self updateTrackingAreas];

// unused
return; (void)theEvent;
} }


- (void)mouseExited:(NSEvent*)theEvent - (void)mouseExited:(NSEvent*)theEvent
{ {
// unused
return; (void)theEvent;
} }


- (void) mouseMoved:(NSEvent*)event - (void) mouseMoved:(NSEvent*)event
@@ -358,7 +372,23 @@ puglCreate(PuglNativeWindow parent,
[NSAutoreleasePool new]; [NSAutoreleasePool new];
[NSApplication sharedApplication]; [NSApplication sharedApplication];


// TESTING!
#if 1
NSApplication* app = [NSApplication sharedApplication];

if ([app respondsToSelector: @selector(setActivationPolicy:)]) {

NSMethodSignature* method = [[app class] instanceMethodSignatureForSelector: @selector(setActivationPolicy:)];
NSInvocation* invocation = [NSInvocation invocationWithMethodSignature: method];
[invocation setTarget: app];
[invocation setSelector: @selector(setActivationPolicy:)];
NSInteger myNSApplicationActivationPolicyAccessory = 0;
[invocation setArgument: &myNSApplicationActivationPolicyAccessory atIndex: 2];
[invocation invoke];
}
#else
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
#endif
[NSApp finishLaunching]; [NSApp finishLaunching];


NSString* titleString = [[NSString alloc] NSString* titleString = [[NSString alloc]
@@ -386,6 +416,9 @@ puglCreate(PuglNativeWindow parent,
} }


return view; return view;

// unused
(void)parent; (void)resizable;
} }


void void


+ 3
- 0
dgl/src/pugl/pugl_osx_extended.m View File

@@ -76,6 +76,9 @@ void puglImplSetSize(PuglView* view, unsigned int width, unsigned int height, bo
// } else { // } else {
[window setFrame:frame display:YES animate:NO]; [window setFrame:frame display:YES animate:NO];
// } // }

// unused
return; (void)forced;
} }


void puglImplSetTitle(PuglView* view, const char* title) void puglImplSetTitle(PuglView* view, const char* title)


Loading…
Cancel
Save