]> git.sesse.net Git - vlc/blobdiff - mozilla/support/npunix.c
Removes trailing spaces. Removes tabs.
[vlc] / mozilla / support / npunix.c
index bcf4e9bc1472c2c88d8a9d29a639b98e21f97775..dc8ae8bf5cab9ab67076d71dac8cc82d0459cc77 100644 (file)
@@ -4,12 +4,12 @@
  * License Version 1.1 (the "License"); you may not use this file
  * except in compliance with the License. You may obtain a copy of
  * the License at http://www.mozilla.org/MPL/
- * 
+ *
  * Software distributed under the License is distributed on an "AS
  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  * implied. See the License for the specific language governing
  * rights and limitations under the License.
- * 
+ *
  * The Original Code is mozilla.org code.
  *
  * The Initial Developer of the Original Code is Netscape
@@ -17,7 +17,7 @@
  * Copyright (C) 1998 Netscape Communications Corporation. All
  * Rights Reserved.
  *
- * Contributor(s): 
+ * Contributor(s):
  * Stephen Mak <smak@sun.com>
  */
 
@@ -229,8 +229,8 @@ 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;
 }
@@ -239,8 +239,8 @@ 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);
     }
 }
 
@@ -248,8 +248,8 @@ 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;
 }
@@ -258,8 +258,8 @@ 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;
 }
@@ -268,8 +268,8 @@ 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;
 }
@@ -278,8 +278,8 @@ 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;
 }
@@ -288,8 +288,8 @@ 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;
 }
@@ -298,8 +298,8 @@ 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;
 }
@@ -308,8 +308,8 @@ void NPN_ReleaseObject(NPObject *npobj)
 {
     int navMinorVers = gNetscapeFuncs.version & 0xFF;
     if( navMinorVers >= 14 )
-    {   
-       CallNPN_ReleaseObjectProc( gNetscapeFuncs.releaseobject, npobj);
+    {
+        CallNPN_ReleaseObjectProc( gNetscapeFuncs.releaseobject, npobj);
     }
 }
 
@@ -317,8 +317,8 @@ 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;
 }
@@ -327,8 +327,8 @@ 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;
 }
@@ -337,8 +337,8 @@ 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;
 }
@@ -347,8 +347,8 @@ 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;
 }
@@ -357,8 +357,8 @@ 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;
 }
@@ -367,8 +367,8 @@ 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;
 }
@@ -377,8 +377,8 @@ 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;
 }
@@ -387,8 +387,8 @@ 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;
 }
@@ -397,8 +397,8 @@ void NPN_ReleaseVariantValue(NPVariant *variant)
 {
     int navMinorVers = gNetscapeFuncs.version & 0xFF;
     if( navMinorVers >= 14 )
-    {   
-       CallNPN_ReleaseVariantValueProc( gNetscapeFuncs.releasevariantvalue, variant);
+    {
+        CallNPN_ReleaseVariantValueProc( gNetscapeFuncs.releasevariantvalue, variant);
     }
 }
 
@@ -406,8 +406,8 @@ 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);
     }
 }
 
@@ -417,7 +417,7 @@ void NPN_SetException(NPObject *npobj, const NPUTF8 *message)
  * Wrapper functions : Netscape Navigator -> plugin
  *
  * These functions let the plugin developer just create the APIs
- * as documented and defined in npapi.h, without needing to 
+ * as documented and defined in npapi.h, without needing to
  * install those functions in the function table or worry about
  * setting up globals for 68K plugins.
  *
@@ -430,7 +430,7 @@ Private_New(NPMIMEType pluginType, NPP instance, uint16 mode,
     NPError ret;
     PLUGINDEBUGSTR("New");
     ret = NPP_New(pluginType, instance, mode, argc, argn, argv, saved);
-    return ret; 
+    return ret;
 }
 
 NPError
@@ -498,7 +498,7 @@ Private_DestroyStream(NPP instance, NPStream* stream, NPError reason)
 void
 Private_URLNotify(NPP instance, const char* url,
                 NPReason reason, void* notifyData)
-                
 {
     PLUGINDEBUGSTR("URLNotify");
     NPP_URLNotify(instance, url, reason, notifyData);
@@ -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,13 +532,13 @@ 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;
 }
 
-/*********************************************************************** 
+/***********************************************************************
  *
  * These functions are located automagically by netscape.
  *
@@ -591,12 +591,12 @@ NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
     NPError err = NPERR_NO_ERROR;
 
     PLUGINDEBUGSTR("NP_Initialize");
-    
     /* validate input parameters */
 
     if ((nsTable == NULL) || (pluginFuncs == NULL))
         err = NPERR_INVALID_FUNCTABLE_ERROR;
-    
     /*
      * Check the major version passed in Netscape's function table.
      * We won't load if the major version is newer than what we expect.
@@ -611,10 +611,10 @@ NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
             err = NPERR_INCOMPATIBLE_VERSION_ERROR;
         if (nsTable->size < sizeof(NPNetscapeFuncs))
             err = NPERR_INVALID_FUNCTABLE_ERROR;
-        if (pluginFuncs->size < sizeof(NPPluginFuncs))      
+        if (pluginFuncs->size < sizeof(NPPluginFuncs))
             err = NPERR_INVALID_FUNCTABLE_ERROR;
     }
-    
     if (err == NPERR_NO_ERROR) {
         /*
          * Copy all the fields of Netscape function table into our
@@ -645,7 +645,7 @@ NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
             gNetscapeFuncs.getJavaPeer  = nsTable->getJavaPeer;
         }
         if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
-        {   
+        {
             gNetscapeFuncs.geturlnotify  = nsTable->geturlnotify;
             gNetscapeFuncs.posturlnotify = nsTable->posturlnotify;
         }
@@ -655,28 +655,28 @@ NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
         gNetscapeFuncs.invalidateregion = nsTable->invalidateregion;
         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,9 +697,10 @@ 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);           
+        {
+            pluginFuncs->urlnotify = NewNPP_URLNotifyProc(Private_URLNotify);
         }
 #ifdef OJI
         if( navMinorVers >= NPVERS_HAS_LIVECONNECT )
@@ -709,10 +710,10 @@ NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
 #else
         pluginFuncs->javaClass = NULL;
 #endif
-        
         err = NPP_Initialize();
     }
-    
     return err;
 }