-
Notifications
You must be signed in to change notification settings - Fork 289
/
np_x11main.cpp
56 lines (45 loc) · 1.32 KB
/
np_x11main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**********************************************************\
Default auto-generated np_x11main.cpp
This file contains the entrypoints for a *nix NPAPI
plugin. Don't change this unless you know what you're
doing!
\**********************************************************/
#include "global/config.h"
#include "NpapiTypes.h"
#include "NpapiPluginModule.h"
using namespace FB::Npapi;
FB::Npapi::NpapiPluginModule *module = NULL;
void initPluginModule()
{
if (module == NULL) {
module = new NpapiPluginModule();
NpapiPluginModule::Default = module;
}
}
extern "C" char * NP_GetPluginVersion()
{
return (char *)FBSTRING_PLUGIN_VERSION;
}
extern "C" char * NP_GetMIMEDescription()
{
return (char *)FBSTRING_X11MIMEType;
}
extern "C" NPError NP_GetValue(void *future, NPPVariable variable, void *value)
{
initPluginModule();
return module->NPP_GetValue((NPP_t *)future, variable, value);
}
extern "C" NPError NP_Initialize(NPNetscapeFuncs* pFuncs
, NPPluginFuncs *pluginFuncs)
{
initPluginModule();
module->getPluginFuncs(pluginFuncs);
module->setNetscapeFuncs(pFuncs);
return NPERR_NO_ERROR;
}
extern "C" NPError NP_Shutdown()
{
delete module;
module = NULL;
return NPERR_NO_ERROR;
}