|
|
|
@@ -459,12 +459,25 @@ public: |
|
|
|
{ |
|
|
|
const ScopedAutoReleasePool pool; |
|
|
|
|
|
|
|
log ("setWindow"); |
|
|
|
|
|
|
|
NSView* parentView = 0; |
|
|
|
WindowRef windowRef = window != 0 ? ((NP_CGContext*) window->window)->window : 0; |
|
|
|
NP_CGContext* const cgContext = (window != 0) ? (NP_CGContext*) window->window : 0; |
|
|
|
log ("NP_CGContext: " + String::toHexString ((pointer_sized_int) cgContext)); |
|
|
|
|
|
|
|
#ifndef __LP64__ |
|
|
|
WindowRef windowRef = cgContext != 0 ? (WindowRef) cgContext->window : 0; |
|
|
|
|
|
|
|
if (windowRef != 0) |
|
|
|
{ |
|
|
|
NSWindow* win = [[[NSWindow alloc] initWithWindowRef: windowRef] autorelease]; |
|
|
|
#else |
|
|
|
NSWindow* win = cgContext != 0 ? (NSWindow*) cgContext->window : 0; |
|
|
|
|
|
|
|
if (win != 0) |
|
|
|
{ |
|
|
|
#endif |
|
|
|
log ("window: " + nsStringToJuce ([win description])); |
|
|
|
|
|
|
|
const Rectangle clip (window->clipRect.left, window->clipRect.top, |
|
|
|
window->clipRect.right - window->clipRect.left, |
|
|
|
@@ -480,6 +493,7 @@ public: |
|
|
|
if (! intersection.isEmpty()) |
|
|
|
{ |
|
|
|
NSView* content = [win contentView]; |
|
|
|
log ("content: " + nsStringToJuce ([content description])); |
|
|
|
|
|
|
|
float wx = (float) intersection.getCentreX(); |
|
|
|
float wy = (float) intersection.getCentreY(); |
|
|
|
@@ -943,7 +957,12 @@ NPError NPP_New (NPMIMEType pluginType, NPP npp, ::uint16 mode, ::int16 argc, ch |
|
|
|
|
|
|
|
#if JUCE_MAC |
|
|
|
browser.setvalue (npp, (NPPVariable) NPNVpluginDrawingModel, (void*) NPDrawingModelCoreGraphics); |
|
|
|
|
|
|
|
#ifdef __LP64__ |
|
|
|
browser.setvalue (npp, (NPPVariable) 1001 /*NPPVpluginEventModel*/, (void*) 1 /*NPEventModelCocoa*/); |
|
|
|
#else |
|
|
|
browser.setvalue (npp, (NPPVariable) 1001 /*NPPVpluginEventModel*/, 0 /*NPEventModelCarbon*/); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
if (numPluginInstances++ == 0) |
|
|
|
|