osx-yosemitenpapibrowser-pluginwindowlesswindowed

Can a plugin(for safari on mac) be made windowed or windowless programmatically?


We are making a plugin for safari browser on mac.

After browsing over internet, i found that generally plugins on mac are windowless but i want a windowed plugin. Even in function NPP_SetWindow i tried to print the value of variable type(which is of type NPWindowType) as following:

NPError NPP_SetWindow(NPP instance, NPWindow * pNPWindow)
{
...
printf("....: %d",pNPWindow->type);
...
}

It prints 2 i.e its value is NPWindowTypeDrawable means windowless.

Moreover, I read the following code somewhere:

NPError NPP_New(NPMIMEType pluginType,
        NPP instance, uint16 mode,
        int16 argc, char *argn[],
        char *argv[], NPSavedData *saved)
{
 ...
 NPError result = NPN_SetValue(instance, NPPVpluginWindowBool, (void*)false);
}

Here it says that a plugin can be made windowless by passing value for NPPVpluginWindowBool as false in NPN_SetValue function call. If a plugin does not make this call, it is considered a windowed plugin. But then it also says that " Plug-ins on Mac OS X are always windowless ". I haven't been sured about this yet.

My question is, will passing true value for NPPVpluginWindowBool here make plugin windowed? I haven't tried it yet.

Please suggest how to make it a windowed plugin whether programmatically or any other way around so that pNPWindow->type(in first code snippet) would also print 1 i.e NPWindowTypeWindow means windowed plugin.

Thanks.


Solution

  • There are no windowed plugins on Mac; there were at one time, but there aren't anymore.

    Now you just have drawing models, and there are three:

    The first two are the only ones that work on Safari. There is no way to get a window object on Mac. There used to be a couple of hacks you could use with Quartz and QuickDraw, possibly also with Carbon and CoreGraphics, but those models are long gone now.

    See also: