FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
np_x11main.cpp
1 /**********************************************************\
2  Default auto-generated np_x11main.cpp
3 
4  This file contains the entrypoints for a *nix NPAPI
5  plugin. Don't change this unless you know what you're
6  doing!
7 \**********************************************************/
8 
9 #include "global/config.h"
10 #include "NpapiTypes.h"
11 #include "NpapiPluginModule.h"
12 
13 using namespace FB::Npapi;
14 
15 void initPluginModule()
16 {
17 }
18 
19 extern "C" char * NP_GetPluginVersion()
20 {
21  return (char *)FBSTRING_PLUGIN_VERSION;
22 }
23 
24 extern "C" const char * NP_GetMIMEDescription()
25 {
26  return (char *)FBSTRING_X11MIMEType;
27 }
28 
29 extern "C" NPError NP_GetValue(void *future, NPPVariable variable, void *value)
30 {
31  NpapiPluginModule module;
32  return module.NPP_GetValue((NPP_t *)future, variable, value);
33 }
34 
35 extern "C" NPError NP_Initialize(NPNetscapeFuncs* pFuncs
36  , NPPluginFuncs *pluginFuncs)
37 {
38  /* can't use FBLOG_XXX before GetModule returns, as it calls InitLogging */
39  initPluginModule();
40  NpapiPluginModule *module = NpapiPluginModule::GetModule(0);
41  module->getPluginFuncs(pluginFuncs);
42  module->setNetscapeFuncs(pFuncs);
43 
44  FBLOG_INFO("NPAPI", "Initialization done");
45  return NPERR_NO_ERROR;
46 }
47 
48 extern "C" NPError NP_Shutdown()
49 {
50  FBLOG_INFO("NPAPI", "");
51  NpapiPluginModule::ReleaseModule(0);
52  return NPERR_NO_ERROR;
53 }
54