more code to check in before moving in a different direction; ignoring more editor...
[gssweb.git] / npapi / npapiplugin.cpp
1 /*
2  * Copyright (c) 2013 <copyright holder> <email>
3  * 
4  * For license details, see the LICENSE file in the root of this project.
5  * 
6  */
7
8 #include "npapiplugin.h"
9
10
11 NPAPIPlugin::NPAPIPlugin(NPNetscapeFuncs *aNPNFuncs, NPPluginFuncs *pFuncs)
12 {
13   /*
14    * Setup - Ensure a sane environment
15    */  
16   if( pFuncs == NULL || 
17       pFuncs->size < sizeof(NPNetscapeFuncs) )
18     return NPERR_INVALID_FUNCTABLE_ERROR;
19
20   if(HIBYTE(pFuncs->version) > NP_VERSION_MAJOR)
21     return NPERR_INCOMPATIBLE_VERSION_ERROR;
22
23   /*
24    * Main body:
25    *   Tell the browser about the API functions we implement
26    */
27   pFuncs->newp = NPP_New;
28   pFuncs->destroy = NPP_Destroy;
29   pFuncs->getvalue = NPP_GetValue;
30
31   return NPERR_NO_ERROR;
32
33 }
34
35 NPAPIPlugin::~NPAPIPlugin(NPP instance, NPSavedData **save)
36 {
37
38 }
39
40
41 /*
42  * Create and destroy an instance of the plugin
43  */
44 NPError NPAPIPlugin::NPP_New(NPMIMEType    pluginType,
45                 NPP instance, uint16_t mode,
46                 int16_t argc, char *argn[],
47                 char *argv[], NPSavedData *saved)
48 {
49   return(NPERR_NO_ERROR);
50 }
51
52 NPError NPAPIPlugin::NPP_Destroy(NPP instance, NPSavedData **save)
53 {
54   return(NPERR_NO_ERROR);
55 }
56
57 NPError NPAPIPlugin::NPP_GetValue(NPP instance,
58                      NPPVariable variable,
59                      void *value)
60 {
61   switch(variable)
62   {
63     case NPPVpluginScriptableNPObject:
64       cerr << "Received the scriptable object call!\n";
65       //value = NPN_CreateObject(instance, )
66       break;
67   }
68   cerr << "Called NPP_GetValue with " << variable << ".\n";
69   return NPERR_NO_ERROR;
70 }