1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

made the NPAPI browser wrapper able to compile in 64-bit mode

This commit is contained in:
Julian Storer 2009-09-17 13:47:47 +01:00
parent a90a65343c
commit d48a742061
2 changed files with 20 additions and 2 deletions

View file

@ -300,7 +300,6 @@
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
SDKROOT = macosx10.5;
};
name = Debug;
};

View file

@ -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)