]> git.sesse.net Git - vlc/commitdiff
- mozilla: formatting, cleanup, and NPN_SetValue/NPP_SetValue support
authorDamien Fouilleul <damienf@videolan.org>
Tue, 20 Mar 2007 15:13:51 +0000 (15:13 +0000)
committerDamien Fouilleul <damienf@videolan.org>
Tue, 20 Mar 2007 15:13:51 +0000 (15:13 +0000)
mozilla/support/npmac.cpp
mozilla/support/npunix.c
mozilla/support/npwin.cpp
mozilla/vlcshell.cpp

index e02385a6bfc72997ff8dbafe5ed3e0d159225519..535e761af1fe95fcedaa75ff3dad5c5e79ae3eeb 100644 (file)
@@ -667,7 +667,7 @@ NPError Private_GetValue( NPP instance, NPPVariable variable, void *value )
     NPError err;
     EnterCodeResource();
     PLUGINDEBUGSTR("\pGetValue;g;");
-    err = NPP_GetValue( instance, variable, value);
+    err = NPP_GetValue(instance, variable, value);
     ExitCodeResource();
     return err;
 }
@@ -677,7 +677,7 @@ NPError Private_SetValue( NPP instance, NPNVariable variable, void *value )
     NPError err;
     EnterCodeResource();
     PLUGINDEBUGSTR("\pSetValue;g;");
-    err = NPERR_NO_ERROR; //NPP_SetValue( instance, variable, value);
+    err = NPP_SetValue(instance, variable, value);
     ExitCodeResource();
     return err;
 }
index bcf4e9bc1472c2c88d8a9d29a639b98e21f97775..31849101581ebf2b6d3ae963865ec8f0fecb0470 100644 (file)
@@ -230,7 +230,7 @@ NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name)
     int navMinorVers = gNetscapeFuncs.version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return CallNPN_GetStringIdentifierProc( gNetscapeFuncs.getstringidentifier, name);
+        return CallNPN_GetStringIdentifierProc( gNetscapeFuncs.getstringidentifier, name);
     }
     return NULL;
 }
@@ -240,7 +240,7 @@ void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount, NPIdentif
     int navMinorVers = gNetscapeFuncs.version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       CallNPN_GetStringIdentifiersProc( gNetscapeFuncs.getstringidentifiers, names, nameCount, identifiers);
+        CallNPN_GetStringIdentifiersProc( gNetscapeFuncs.getstringidentifiers, names, nameCount, identifiers);
     }
 }
 
@@ -249,7 +249,7 @@ NPIdentifier NPN_GetIntIdentifier(int32_t intid)
     int navMinorVers = gNetscapeFuncs.version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return CallNPN_GetIntIdentifierProc( gNetscapeFuncs.getintidentifier, intid);
+        return CallNPN_GetIntIdentifierProc( gNetscapeFuncs.getintidentifier, intid);
     }
     return NULL;
 }
@@ -259,7 +259,7 @@ bool NPN_IdentifierIsString(NPIdentifier identifier)
     int navMinorVers = gNetscapeFuncs.version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return CallNPN_IdentifierIsStringProc( gNetscapeFuncs.identifierisstring, identifier);
+        return CallNPN_IdentifierIsStringProc( gNetscapeFuncs.identifierisstring, identifier);
     }
     return false;
 }
@@ -269,7 +269,7 @@ NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier)
     int navMinorVers = gNetscapeFuncs.version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return CallNPN_UTF8FromIdentifierProc( gNetscapeFuncs.utf8fromidentifier, identifier);
+        return CallNPN_UTF8FromIdentifierProc( gNetscapeFuncs.utf8fromidentifier, identifier);
     }
     return NULL;
 }
@@ -279,7 +279,7 @@ int32_t NPN_IntFromIdentifier(NPIdentifier identifier)
     int navMinorVers = gNetscapeFuncs.version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return CallNPN_IntFromIdentifierProc( gNetscapeFuncs.intfromidentifier, identifier);
+        return CallNPN_IntFromIdentifierProc( gNetscapeFuncs.intfromidentifier, identifier);
     }
     return 0;
 }
@@ -289,7 +289,7 @@ NPObject *NPN_CreateObject(NPP instance, NPClass *aClass)
     int navMinorVers = gNetscapeFuncs.version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return CallNPN_CreateObjectProc( gNetscapeFuncs.createobject, instance, aClass);
+        return CallNPN_CreateObjectProc( gNetscapeFuncs.createobject, instance, aClass);
     }
     return NULL;
 }
@@ -299,7 +299,7 @@ NPObject *NPN_RetainObject(NPObject *npobj)
     int navMinorVers = gNetscapeFuncs.version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return CallNPN_RetainObjectProc( gNetscapeFuncs.retainobject, npobj);
+        return CallNPN_RetainObjectProc( gNetscapeFuncs.retainobject, npobj);
     }
     return NULL;
 }
@@ -309,7 +309,7 @@ void NPN_ReleaseObject(NPObject *npobj)
     int navMinorVers = gNetscapeFuncs.version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       CallNPN_ReleaseObjectProc( gNetscapeFuncs.releaseobject, npobj);
+        CallNPN_ReleaseObjectProc( gNetscapeFuncs.releaseobject, npobj);
     }
 }
 
@@ -318,7 +318,7 @@ bool NPN_Invoke(NPP instance, NPObject *npobj, NPIdentifier methodName, const NP
     int navMinorVers = gNetscapeFuncs.version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return CallNPN_InvokeProc( gNetscapeFuncs.invoke, instance, npobj, methodName, args, argCount, result);
+        return CallNPN_InvokeProc( gNetscapeFuncs.invoke, instance, npobj, methodName, args, argCount, result);
     }
     return false;
 }
@@ -328,7 +328,7 @@ bool NPN_InvokeDefault(NPP instance, NPObject *npobj, const NPVariant *args, uin
     int navMinorVers = gNetscapeFuncs.version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return CallNPN_InvokeDefaultProc( gNetscapeFuncs.invokeDefault, instance, npobj, args, argCount, result);
+        return CallNPN_InvokeDefaultProc( gNetscapeFuncs.invokeDefault, instance, npobj, args, argCount, result);
     }
     return false;
 }
@@ -338,7 +338,7 @@ bool NPN_Evaluate(NPP instance, NPObject *npobj, NPString *script, NPVariant *re
     int navMinorVers = gNetscapeFuncs.version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return CallNPN_EvaluateProc( gNetscapeFuncs.evaluate, instance, npobj, script, result);
+        return CallNPN_EvaluateProc( gNetscapeFuncs.evaluate, instance, npobj, script, result);
     }
     return false;
 }
@@ -348,7 +348,7 @@ bool NPN_GetProperty(NPP instance, NPObject *npobj, NPIdentifier propertyName, N
     int navMinorVers = gNetscapeFuncs.version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return CallNPN_GetPropertyProc( gNetscapeFuncs.getproperty, instance, npobj, propertyName, result);
+        return CallNPN_GetPropertyProc( gNetscapeFuncs.getproperty, instance, npobj, propertyName, result);
     }
     return false;
 }
@@ -358,7 +358,7 @@ bool NPN_SetProperty(NPP instance, NPObject *npobj, NPIdentifier propertyName, c
     int navMinorVers = gNetscapeFuncs.version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return CallNPN_SetPropertyProc( gNetscapeFuncs.setproperty, instance, npobj, propertyName, value);
+        return CallNPN_SetPropertyProc( gNetscapeFuncs.setproperty, instance, npobj, propertyName, value);
     }
     return false;
 }
@@ -368,7 +368,7 @@ bool NPN_RemoveProperty(NPP instance, NPObject *npobj, NPIdentifier propertyName
     int navMinorVers = gNetscapeFuncs.version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return CallNPN_RemovePropertyProc( gNetscapeFuncs.removeproperty, instance, npobj, propertyName);
+        return CallNPN_RemovePropertyProc( gNetscapeFuncs.removeproperty, instance, npobj, propertyName);
     }
     return false;
 }
@@ -378,7 +378,7 @@ bool NPN_HasProperty(NPP instance, NPObject *npobj, NPIdentifier propertyName)
     int navMinorVers = gNetscapeFuncs.version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return CallNPN_HasPropertyProc( gNetscapeFuncs.hasproperty, instance, npobj, propertyName);
+        return CallNPN_HasPropertyProc( gNetscapeFuncs.hasproperty, instance, npobj, propertyName);
     }
     return false;
 }
@@ -388,7 +388,7 @@ bool NPN_HasMethod(NPP instance, NPObject *npobj, NPIdentifier methodName)
     int navMinorVers = gNetscapeFuncs.version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return CallNPN_HasMethodProc( gNetscapeFuncs.hasmethod, instance, npobj, methodName);
+        return CallNPN_HasMethodProc( gNetscapeFuncs.hasmethod, instance, npobj, methodName);
     }
     return false;
 }
@@ -398,7 +398,7 @@ void NPN_ReleaseVariantValue(NPVariant *variant)
     int navMinorVers = gNetscapeFuncs.version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       CallNPN_ReleaseVariantValueProc( gNetscapeFuncs.releasevariantvalue, variant);
+        CallNPN_ReleaseVariantValueProc( gNetscapeFuncs.releasevariantvalue, variant);
     }
 }
 
@@ -407,7 +407,7 @@ void NPN_SetException(NPObject *npobj, const NPUTF8 *message)
     int navMinorVers = gNetscapeFuncs.version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       CallNPN_SetExceptionProc( gNetscapeFuncs.setexception, npobj, message);
+        CallNPN_SetExceptionProc( gNetscapeFuncs.setexception, npobj, message);
     }
 }
 
@@ -517,14 +517,14 @@ NPError
 Private_GetValue(NPP instance, NPPVariable variable, void *r_value)
 {
     PLUGINDEBUGSTR("GetValue");
-return NPP_GetValue(instance, variable, r_value);
+    return NPP_GetValue(instance, variable, r_value);
 }
 
 NPError
 Private_SetValue(NPP instance, NPPVariable variable, void *r_value)
 {
     PLUGINDEBUGSTR("SetValue");
-    return NPERR_NO_ERROR; //NPP_SetValue(instance, variable, r_value);
+    return NPP_SetValue(instance, variable, r_value);
 }
 
 JRIGlobalRef
@@ -532,8 +532,8 @@ Private_GetJavaClass(void)
 {
     jref clazz = NPP_GetJavaClass();
     if (clazz) {
-    JRIEnv* env = NPN_GetJavaEnv();
-    return JRI_NewGlobalRef(env, clazz);
+        JRIEnv* env = NPN_GetJavaEnv();
+        return JRI_NewGlobalRef(env, clazz);
     }
     return NULL;
 }
@@ -656,27 +656,27 @@ NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
         gNetscapeFuncs.forceredraw      = nsTable->forceredraw;
         if( navMinorVers >= 14 )
         {   
-           // NPRuntime support 
-           gNetscapeFuncs.getstringidentifier  = nsTable->getstringidentifier;
-           gNetscapeFuncs.getstringidentifiers = nsTable->getstringidentifiers;
-           gNetscapeFuncs.getintidentifier     = nsTable->getintidentifier;
-           gNetscapeFuncs.identifierisstring   = nsTable->identifierisstring;
-           gNetscapeFuncs.utf8fromidentifier   = nsTable->utf8fromidentifier;
-           gNetscapeFuncs.intfromidentifier    = nsTable->intfromidentifier;
-           gNetscapeFuncs.createobject         = nsTable->createobject;
-           gNetscapeFuncs.retainobject         = nsTable->retainobject;
-           gNetscapeFuncs.releaseobject        = nsTable->releaseobject;
-           gNetscapeFuncs.invoke               = nsTable->invoke;
-           gNetscapeFuncs.invokeDefault        = nsTable->invokeDefault;
-           gNetscapeFuncs.evaluate             = nsTable->evaluate;
-           gNetscapeFuncs.getproperty          = nsTable->getproperty;
-           gNetscapeFuncs.setproperty          = nsTable->setproperty;
-           gNetscapeFuncs.removeproperty       = nsTable->removeproperty;
-           gNetscapeFuncs.hasproperty          = nsTable->hasproperty;
-           gNetscapeFuncs.hasmethod            = nsTable->hasmethod;
-           gNetscapeFuncs.releasevariantvalue  = nsTable->releasevariantvalue;
-           gNetscapeFuncs.setexception         = nsTable->setexception;
-       }
+            // NPRuntime support 
+            gNetscapeFuncs.getstringidentifier  = nsTable->getstringidentifier;
+            gNetscapeFuncs.getstringidentifiers = nsTable->getstringidentifiers;
+            gNetscapeFuncs.getintidentifier     = nsTable->getintidentifier;
+            gNetscapeFuncs.identifierisstring   = nsTable->identifierisstring;
+            gNetscapeFuncs.utf8fromidentifier   = nsTable->utf8fromidentifier;
+            gNetscapeFuncs.intfromidentifier    = nsTable->intfromidentifier;
+            gNetscapeFuncs.createobject         = nsTable->createobject;
+            gNetscapeFuncs.retainobject         = nsTable->retainobject;
+            gNetscapeFuncs.releaseobject        = nsTable->releaseobject;
+            gNetscapeFuncs.invoke               = nsTable->invoke;
+            gNetscapeFuncs.invokeDefault        = nsTable->invokeDefault;
+            gNetscapeFuncs.evaluate             = nsTable->evaluate;
+            gNetscapeFuncs.getproperty          = nsTable->getproperty;
+            gNetscapeFuncs.setproperty          = nsTable->setproperty;
+            gNetscapeFuncs.removeproperty       = nsTable->removeproperty;
+            gNetscapeFuncs.hasproperty          = nsTable->hasproperty;
+            gNetscapeFuncs.hasmethod            = nsTable->hasmethod;
+            gNetscapeFuncs.releasevariantvalue  = nsTable->releasevariantvalue;
+            gNetscapeFuncs.setexception         = nsTable->setexception;
+        }
 
         /*
          * Set up the plugin function table that Netscape will use to
@@ -697,6 +697,7 @@ NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
         pluginFuncs->print      = NewNPP_PrintProc(Private_Print);
         pluginFuncs->event      = NULL;
         pluginFuncs->getvalue   = NewNPP_GetValueProc(Private_GetValue);
+        pluginFuncs->setvalue   = NewNPP_SetValueProc(Private_SetValue);
         if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
         {   
             pluginFuncs->urlnotify = NewNPP_URLNotifyProc(Private_URLNotify);           
index 81fa7f11fe9aee03439bd08a0116994fc14c3323..b1eb666d9cd1bc0162744f705ddd31c143584f50 100644 (file)
@@ -56,23 +56,23 @@ JRIGlobalRef Private_GetJavaClass(void);
 ////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
 // Private_GetJavaClass (global function)
 //
-//     Given a Java class reference (thru NPP_GetJavaClass) inform JRT
-//     of this class existence
+//      Given a Java class reference (thru NPP_GetJavaClass) inform JRT
+//      of this class existence
 //
 JRIGlobalRef
 Private_GetJavaClass(void)
 {
     jref clazz = NPP_GetJavaClass();
     if (clazz) {
-               JRIEnv* env = NPN_GetJavaEnv();
-               return JRI_NewGlobalRef(env, clazz);
+        JRIEnv* env = NPN_GetJavaEnv();
+        return JRI_NewGlobalRef(env, clazz);
     }
     return NULL;
 }
 
 //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\.
 ////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
-//                                             PLUGIN DLL entry points   
+//                                              PLUGIN DLL entry points   
 //
 // These are the Windows specific DLL entry points. They must be exoprted
 //
@@ -87,7 +87,7 @@ static NPPluginFuncs* g_pluginFuncs;
 ////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
 // NP_GetEntryPoints
 //
-//     fills in the func table used by Navigator to call entry points in
+//      fills in the func table used by Navigator to call entry points in
 //  plugin DLL.  Note that these entry points ensure that DS is loaded
 //  by using the NP_LOADDS macro, when compiling for Win16
 //
@@ -116,10 +116,10 @@ NP_GetEntryPoints(NPPluginFuncs* pFuncs)
     pFuncs->write         = NPP_Write;
     pFuncs->print         = NPP_Print;
     pFuncs->event         = 0;       /// reserved 
-    pFuncs->getvalue     = NPP_GetValue;
-    //pFuncs->setvalue   = NPP_SetValue;
+    pFuncs->getvalue      = NPP_GetValue;
+    pFuncs->setvalue      = NPP_SetValue;
 
-       g_pluginFuncs             = pFuncs;
+    g_pluginFuncs             = pFuncs;
 
     return NPERR_NO_ERROR;
 }
@@ -128,7 +128,7 @@ NP_GetEntryPoints(NPPluginFuncs* pFuncs)
 ////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
 // NP_Initialize
 //
-//     called immediately after the plugin DLL is loaded
+//      called immediately after the plugin DLL is loaded
 //
 #ifdef __MINGW32__
 extern "C" __declspec(dllexport) NPError WINAPI
@@ -148,18 +148,18 @@ NP_Initialize(NPNetscapeFuncs* pFuncs)
     if(HIBYTE(pFuncs->version) > NP_VERSION_MAJOR)
         return NPERR_INCOMPATIBLE_VERSION_ERROR;
 
-       // We have to defer these assignments until g_pNavigatorFuncs is set
+    // We have to defer these assignments until g_pNavigatorFuncs is set
     int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
 
-       if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) {
-               g_pluginFuncs->urlnotify = NPP_URLNotify;
-       }
-       
-       if( navMinorVers >= NPVERS_HAS_LIVECONNECT ) {
-               g_pluginFuncs->javaClass = Private_GetJavaClass();
-       }
+    if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) {
+        g_pluginFuncs->urlnotify = NPP_URLNotify;
+    }
+    
+    if( navMinorVers >= NPVERS_HAS_LIVECONNECT ) {
+        g_pluginFuncs->javaClass = Private_GetJavaClass();
+    }
 
-       // NPP_Initialize is a standard (cross-platform) initialize function.
+    // NPP_Initialize is a standard (cross-platform) initialize function.
     return NPP_Initialize();
 }
 
@@ -167,9 +167,9 @@ NP_Initialize(NPNetscapeFuncs* pFuncs)
 ////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
 // NP_Shutdown
 //
-//     called immediately before the plugin DLL is unloaded.
-//     This functio shuold check for some ref count on the dll to see if it is
-//     unloadable or it needs to stay in memory. 
+//      called immediately before the plugin DLL is unloaded.
+//      This functio shuold check for some ref count on the dll to see if it is
+//      unloadable or it needs to stay in memory. 
 //
 #ifdef __MINGW32__
 extern "C" __declspec(dllexport) NPError WINAPI
@@ -183,7 +183,7 @@ NP_Shutdown()
     return NPERR_NO_ERROR;
 }
 
-//                                             END - PLUGIN DLL entry points   
+//                                              END - PLUGIN DLL entry points   
 ////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
 //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\.
 
@@ -212,15 +212,15 @@ void NPN_Version(int* plugin_major, int* plugin_minor, int* netscape_major, int*
 NPError NPN_GetURLNotify(NPP instance, const char *url, const char *target, void* notifyData)
 
 {
-       int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
-       NPError err;
-       if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) {
-               err = g_pNavigatorFuncs->geturlnotify(instance, url, target, notifyData);
-       }
-       else {
-               err = NPERR_INCOMPATIBLE_VERSION_ERROR;
-       }
-       return err;
+    int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
+    NPError err;
+    if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) {
+        err = g_pNavigatorFuncs->geturlnotify(instance, url, target, notifyData);
+    }
+    else {
+        err = NPERR_INCOMPATIBLE_VERSION_ERROR;
+    }
+    return err;
 }
 
 
@@ -231,15 +231,15 @@ NPError NPN_GetURL(NPP instance, const char *url, const char *target)
 
 NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData)
 {
-       int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
-       NPError err;
-       if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) {
-               err = g_pNavigatorFuncs->posturlnotify(instance, url, window, len, buf, file, notifyData);
-       }
-       else {
-               err = NPERR_INCOMPATIBLE_VERSION_ERROR;
-       }
-       return err;
+    int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
+    NPError err;
+    if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) {
+        err = g_pNavigatorFuncs->posturlnotify(instance, url, window, len, buf, file, notifyData);
+    }
+    else {
+        err = NPERR_INCOMPATIBLE_VERSION_ERROR;
+    }
+    return err;
 }
 
 
@@ -261,18 +261,18 @@ NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList)
    by Netscape in the current window.
 */
 NPError NPN_NewStream(NPP instance, NPMIMEType type, 
-                                                               const char* target, NPStream** stream)
+                                                                const char* target, NPStream** stream)
 {
-       int navMinorVersion = g_pNavigatorFuncs->version & 0xFF;
-       NPError err;
+    int navMinorVersion = g_pNavigatorFuncs->version & 0xFF;
+    NPError err;
 
-       if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) {
-               err = g_pNavigatorFuncs->newstream(instance, type, target, stream);
-       }
-       else {
-               err = NPERR_INCOMPATIBLE_VERSION_ERROR;
-       }
-       return err;
+    if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) {
+        err = g_pNavigatorFuncs->newstream(instance, type, target, stream);
+    }
+    else {
+        err = NPERR_INCOMPATIBLE_VERSION_ERROR;
+    }
+    return err;
 }
 
 /* Provides len bytes of data.
@@ -280,16 +280,16 @@ NPError NPN_NewStream(NPP instance, NPMIMEType type,
 int32 NPN_Write(NPP instance, NPStream *stream,
                 int32 len, void *buffer)
 {
-       int navMinorVersion = g_pNavigatorFuncs->version & 0xFF;
-       int32 result;
+    int navMinorVersion = g_pNavigatorFuncs->version & 0xFF;
+    int32 result;
 
-       if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) {
-               result = g_pNavigatorFuncs->write(instance, stream, len, buffer);
-       }
-       else {
-               result = -1;
-       }
-       return result;
+    if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) {
+        result = g_pNavigatorFuncs->write(instance, stream, len, buffer);
+    }
+    else {
+        result = -1;
+    }
+    return result;
 }
 
 /* Closes a stream object.  
@@ -297,16 +297,16 @@ reason indicates why the stream was closed.
 */
 NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
 {
-       int navMinorVersion = g_pNavigatorFuncs->version & 0xFF;
-       NPError err;
+    int navMinorVersion = g_pNavigatorFuncs->version & 0xFF;
+    NPError err;
 
-       if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) {
-               err = g_pNavigatorFuncs->destroystream(instance, stream, reason);
-       }
-       else {
-               err = NPERR_INCOMPATIBLE_VERSION_ERROR;
-       }
-       return err;
+    if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) {
+        err = g_pNavigatorFuncs->destroystream(instance, stream, reason);
+    }
+    else {
+        err = NPERR_INCOMPATIBLE_VERSION_ERROR;
+    }
+    return err;
 }
 
 /* Provides a text status message in the Netscape client user interface
@@ -349,12 +349,12 @@ void NPN_ReloadPlugins(NPBool reloadPages)
 
 JRIEnv* NPN_GetJavaEnv(void)
 {
-       return g_pNavigatorFuncs->getJavaEnv();
+    return g_pNavigatorFuncs->getJavaEnv();
 }
 
 jref NPN_GetJavaPeer(NPP instance)
 {
-       return g_pNavigatorFuncs->getJavaPeer(instance);
+    return g_pNavigatorFuncs->getJavaPeer(instance);
 }
 
 NPError NPN_GetValue(NPP instance, NPNVariable variable, void *result)
@@ -387,7 +387,7 @@ NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name)
     int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return g_pNavigatorFuncs->getstringidentifier(name);
+        return g_pNavigatorFuncs->getstringidentifier(name);
     }
     return NULL;
 }
@@ -397,7 +397,7 @@ void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount, NPIdentif
     int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       g_pNavigatorFuncs->getstringidentifiers(names, nameCount, identifiers);
+        g_pNavigatorFuncs->getstringidentifiers(names, nameCount, identifiers);
     }
 }
 
@@ -406,7 +406,7 @@ NPIdentifier NPN_GetIntIdentifier(int32_t intid)
     int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return g_pNavigatorFuncs->getintidentifier(intid);
+        return g_pNavigatorFuncs->getintidentifier(intid);
     }
     return NULL;
 }
@@ -416,7 +416,7 @@ bool NPN_IdentifierIsString(NPIdentifier identifier)
     int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return g_pNavigatorFuncs->identifierisstring(identifier);
+        return g_pNavigatorFuncs->identifierisstring(identifier);
     }
     return false;
 }
@@ -426,7 +426,7 @@ NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier)
     int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return g_pNavigatorFuncs->utf8fromidentifier(identifier);
+        return g_pNavigatorFuncs->utf8fromidentifier(identifier);
     }
     return NULL;
 }
@@ -436,7 +436,7 @@ int32_t NPN_IntFromIdentifier(NPIdentifier identifier)
     int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return g_pNavigatorFuncs->intfromidentifier(identifier);
+        return g_pNavigatorFuncs->intfromidentifier(identifier);
     }
     return 0;
 }
@@ -446,7 +446,7 @@ NPObject *NPN_CreateObject(NPP instance, NPClass *aClass)
     int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return g_pNavigatorFuncs->createobject(instance, aClass);
+        return g_pNavigatorFuncs->createobject(instance, aClass);
     }
     return NULL;
 }
@@ -456,7 +456,7 @@ NPObject *NPN_RetainObject(NPObject *npobj)
     int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return g_pNavigatorFuncs->retainobject(npobj);
+        return g_pNavigatorFuncs->retainobject(npobj);
     }
     return NULL;
 }
@@ -466,7 +466,7 @@ void NPN_ReleaseObject(NPObject *npobj)
     int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       g_pNavigatorFuncs->releaseobject(npobj);
+        g_pNavigatorFuncs->releaseobject(npobj);
     }
 }
 
@@ -475,7 +475,7 @@ bool NPN_Invoke(NPP instance, NPObject *npobj, NPIdentifier methodName, const NP
     int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return g_pNavigatorFuncs->invoke(instance, npobj, methodName, args, argCount, result);
+        return g_pNavigatorFuncs->invoke(instance, npobj, methodName, args, argCount, result);
     }
     return false;
 }
@@ -485,7 +485,7 @@ bool NPN_InvokeDefault(NPP instance, NPObject *npobj, const NPVariant *args, uin
     int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return g_pNavigatorFuncs->invokeDefault(instance, npobj, args, argCount, result);
+        return g_pNavigatorFuncs->invokeDefault(instance, npobj, args, argCount, result);
     }
     return false;
 }
@@ -495,7 +495,7 @@ bool NPN_Evaluate(NPP instance, NPObject *npobj, NPString *script, NPVariant *re
     int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return g_pNavigatorFuncs->evaluate(instance, npobj, script, result);
+        return g_pNavigatorFuncs->evaluate(instance, npobj, script, result);
     }
     return false;
 }
@@ -505,7 +505,7 @@ bool NPN_GetProperty(NPP instance, NPObject *npobj, NPIdentifier propertyName, N
     int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return g_pNavigatorFuncs->getproperty(instance, npobj, propertyName, result);
+        return g_pNavigatorFuncs->getproperty(instance, npobj, propertyName, result);
     }
     return false;
 }
@@ -515,7 +515,7 @@ bool NPN_SetProperty(NPP instance, NPObject *npobj, NPIdentifier propertyName, c
     int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return g_pNavigatorFuncs->setproperty(instance, npobj, propertyName, value);
+        return g_pNavigatorFuncs->setproperty(instance, npobj, propertyName, value);
     }
     return false;
 }
@@ -525,7 +525,7 @@ bool NPN_RemoveProperty(NPP instance, NPObject *npobj, NPIdentifier propertyName
     int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return g_pNavigatorFuncs->removeproperty(instance, npobj, propertyName);
+        return g_pNavigatorFuncs->removeproperty(instance, npobj, propertyName);
     }
     return false;
 }
@@ -535,7 +535,7 @@ bool NPN_HasProperty(NPP instance, NPObject *npobj, NPIdentifier propertyName)
     int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return g_pNavigatorFuncs->hasproperty(instance, npobj, propertyName);
+        return g_pNavigatorFuncs->hasproperty(instance, npobj, propertyName);
     }
     return false;
 }
@@ -545,7 +545,7 @@ bool NPN_HasMethod(NPP instance, NPObject *npobj, NPIdentifier methodName)
     int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       return g_pNavigatorFuncs->hasmethod(instance, npobj, methodName);
+        return g_pNavigatorFuncs->hasmethod(instance, npobj, methodName);
     }
     return false;
 }
@@ -555,7 +555,7 @@ void NPN_ReleaseVariantValue(NPVariant *variant)
     int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       g_pNavigatorFuncs->releasevariantvalue(variant);
+        g_pNavigatorFuncs->releasevariantvalue(variant);
     }
 }
 
@@ -564,7 +564,7 @@ void NPN_SetException(NPObject *npobj, const NPUTF8 *message)
     int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
     if( navMinorVers >= 14 )
     {   
-       g_pNavigatorFuncs->setexception(npobj, message);
+        g_pNavigatorFuncs->setexception(npobj, message);
     }
 }
 
index e023fc494205a18d1206d204e8be3de87af07681..02c8a5f3e2b820411077e8e3b5ad3154f102c4b5 100644 (file)
@@ -133,6 +133,16 @@ NPError NPP_GetValue( NPP instance, NPPVariable variable, void *value )
     return NPERR_NO_ERROR;
 }
 
+/*
+ * there is some confusion in gecko headers regarding definition of this API
+ * NPPVariable is wrongly defined as NPNVariable, which sounds incorrect.
+ */
+
+NPError NPP_SetValue( NPP instance, NPNVariable variable, void *value )
+{
+    return NPERR_GENERIC_ERROR;
+}
+
 /******************************************************************************
  * Mac-only API calls
  *****************************************************************************/
@@ -287,10 +297,14 @@ NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
     }
 
     status = p_plugin->init(argc, argn, argv);
-    if( NPERR_NO_ERROR == status ) {
+    if( NPERR_NO_ERROR == status )
+    {
         instance->pdata = reinterpret_cast<void*>(p_plugin);
+        //NPN_SetValue(instance, NPPVpluginWindowBool, (void *)false);
+        NPN_SetValue(instance, NPPVpluginTransparentBool, (void *)false);
     }
-    else {
+    else
+    {
         delete p_plugin;
     }
     return status;