I am making a plugin for safari on mac. I am stuck at how to create a window over browser's window upon which a video can be displayed.
Earlier, we were using Cocoa Event model under which window pointer received in NPWindow
in NPP_SetWindow
function is null. Then we switched to Carbon Event model and we got pointer to NP_CGContext
via window pointer present in NPWindow struct, using which we got pointer to WindowRef and got a pointer to NSWindow as following:
NP_CGContext* npContext = (NP_CGContext*)npWindow->window;
WindowRef window = npContext->window;
NSWindow* browserWindow = [[[NSWindow alloc] initWithWindowRef:window] autorelease];
Our streaming engine accepts the pointer to NSWindow
. We don't know how to create a window in our browser space.
So any help regarding the window creation would be appreciated.