*
* The Original Code is Mozilla Communicator client code.
*
- * The Initial Developer of the Original Code is
+ * The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
// 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
//
////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
// 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
//
#endif
NP_GetEntryPoints(NPPluginFuncs* pFuncs)
{
- // trap a NULL ptr
+ // trap a NULL ptr
if(pFuncs == NULL)
return NPERR_INVALID_FUNCTABLE_ERROR;
// if the plugin's function table is smaller than the plugin expects,
- // then they are incompatible, and should return an error
+ // then they are incompatible, and should return an error
pFuncs->version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
pFuncs->newp = NPP_New;
pFuncs->writeready = NPP_WriteReady;
pFuncs->write = NPP_Write;
pFuncs->print = NPP_Print;
- pFuncs->event = 0; /// reserved
- pFuncs->getvalue = NPP_GetValue;
- //pFuncs->setvalue = NPP_SetValue;
+ pFuncs->event = 0; /// reserved
+ pFuncs->getvalue = NPP_GetValue;
+ pFuncs->setvalue = NPP_SetValue;
- g_pluginFuncs = pFuncs;
+ g_pluginFuncs = pFuncs;
return NPERR_NO_ERROR;
}
////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
// 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
#else
-NPError WINAPI NP_EXPORT
+NPError WINAPI NP_EXPORT
#endif
NP_Initialize(NPNetscapeFuncs* pFuncs)
{
- // trap a NULL ptr
+ // trap a NULL ptr
if(pFuncs == NULL)
return NPERR_INVALID_FUNCTABLE_ERROR;
- g_pNavigatorFuncs = pFuncs; // save it for future reference
+ g_pNavigatorFuncs = pFuncs; // save it for future reference
// if the plugin's major ver level is lower than the Navigator's,
- // then they are incompatible, and should return an error
+ // then they are incompatible, and should return an error
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();
}
////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
// 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
#else
-NPError WINAPI NP_EXPORT
+NPError WINAPI NP_EXPORT
#endif
NP_Shutdown()
{
return NPERR_NO_ERROR;
}
-// END - PLUGIN DLL entry points
+// END - PLUGIN DLL entry points
////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//.
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\.
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;
}
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;
}
/* Creates a new stream of data from the plug-in to be interpreted
by Netscape in the current window.
*/
-NPError NPN_NewStream(NPP instance, NPMIMEType type,
- const char* target, NPStream** stream)
+NPError NPN_NewStream(NPP instance, NPMIMEType type,
+ 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.
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.
+/* Closes a stream object.
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
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)
{
int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
if( navMinorVers >= 14 )
- {
- return g_pNavigatorFuncs->getstringidentifier(name);
+ {
+ return g_pNavigatorFuncs->getstringidentifier(name);
}
return NULL;
}
{
int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
if( navMinorVers >= 14 )
- {
- g_pNavigatorFuncs->getstringidentifiers(names, nameCount, identifiers);
+ {
+ g_pNavigatorFuncs->getstringidentifiers(names, nameCount, identifiers);
}
}
{
int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
if( navMinorVers >= 14 )
- {
- return g_pNavigatorFuncs->getintidentifier(intid);
+ {
+ return g_pNavigatorFuncs->getintidentifier(intid);
}
return NULL;
}
{
int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
if( navMinorVers >= 14 )
- {
- return g_pNavigatorFuncs->identifierisstring(identifier);
+ {
+ return g_pNavigatorFuncs->identifierisstring(identifier);
}
return false;
}
{
int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
if( navMinorVers >= 14 )
- {
- return g_pNavigatorFuncs->utf8fromidentifier(identifier);
+ {
+ return g_pNavigatorFuncs->utf8fromidentifier(identifier);
}
return NULL;
}
{
int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
if( navMinorVers >= 14 )
- {
- return g_pNavigatorFuncs->intfromidentifier(identifier);
+ {
+ return g_pNavigatorFuncs->intfromidentifier(identifier);
}
return 0;
}
{
int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
if( navMinorVers >= 14 )
- {
- return g_pNavigatorFuncs->createobject(instance, aClass);
+ {
+ return g_pNavigatorFuncs->createobject(instance, aClass);
}
return NULL;
}
{
int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
if( navMinorVers >= 14 )
- {
- return g_pNavigatorFuncs->retainobject(npobj);
+ {
+ return g_pNavigatorFuncs->retainobject(npobj);
}
return NULL;
}
{
int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
if( navMinorVers >= 14 )
- {
- g_pNavigatorFuncs->releaseobject(npobj);
+ {
+ g_pNavigatorFuncs->releaseobject(npobj);
}
}
{
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;
}
{
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;
}
{
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;
}
{
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;
}
{
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;
}
{
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;
}
{
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;
}
{
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;
}
{
int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
if( navMinorVers >= 14 )
- {
- g_pNavigatorFuncs->releasevariantvalue(variant);
+ {
+ g_pNavigatorFuncs->releasevariantvalue(variant);
}
}
{
int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
if( navMinorVers >= 14 )
- {
- g_pNavigatorFuncs->setexception(npobj, message);
+ {
+ g_pNavigatorFuncs->setexception(npobj, message);
}
}