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];

return result;

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

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

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

// unused
(void)sender;
}

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

// unused
return; (void)rect;
}

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

// unused
return; (void)theEvent;
}

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

- (void) mouseMoved:(NSEvent*)event
@@ -358,7 +372,23 @@ puglCreate(PuglNativeWindow parent,
[NSAutoreleasePool new];
[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];
#endif
[NSApp finishLaunching];

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

return view;

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

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 {
[window setFrame:frame display:YES animate:NO];
// }

// unused
return; (void)forced;
}

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


Loading…
Cancel
Save