Commit d7d5ed49 authored by Jean-Paul Saman's avatar Jean-Paul Saman

xulrunner-1.9.1 patch by Dominique Leuenberger <dominique at leuenberger dot net>

Signed off: Jean-Paul Saman <jpsaman@videolan.org>
parent 6b31ed2e
...@@ -103,149 +103,242 @@ NPN_Version(int* plugin_major, int* plugin_minor, ...@@ -103,149 +103,242 @@ NPN_Version(int* plugin_major, int* plugin_minor,
NPError NPError
NPN_GetValue(NPP instance, NPNVariable variable, void *r_value) NPN_GetValue(NPP instance, NPNVariable variable, void *r_value)
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_GetValueProc(gNetscapeFuncs.getvalue, return CallNPN_GetValueProc(gNetscapeFuncs.getvalue,
instance, variable, r_value); instance, variable, r_value);
#else
return (*gNetscapeFuncs.getvalue)(instance, variable, r_value);
#endif
} }
NPError NPError
NPN_SetValue(NPP instance, NPPVariable variable, void *value) NPN_SetValue(NPP instance, NPPVariable variable, void *value)
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_SetValueProc(gNetscapeFuncs.setvalue, return CallNPN_SetValueProc(gNetscapeFuncs.setvalue,
instance, variable, value); instance, variable, value);
#else
return (*gNetscapeFuncs.setvalue)(instance, variable, value);
#endif
} }
NPError NPError
NPN_GetURL(NPP instance, const char* url, const char* window) NPN_GetURL(NPP instance, const char* url, const char* window)
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_GetURLProc(gNetscapeFuncs.geturl, instance, url, window); return CallNPN_GetURLProc(gNetscapeFuncs.geturl, instance, url, window);
#else
return (*gNetscapeFuncs.geturl)(instance, url, window);
#endif
} }
NPError NPError
NPN_GetURLNotify(NPP instance, const char* url, const char* window, void* notifyData) NPN_GetURLNotify(NPP instance, const char* url, const char* window, void* notifyData)
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_GetURLNotifyProc(gNetscapeFuncs.geturlnotify, instance, url, window, notifyData); return CallNPN_GetURLNotifyProc(gNetscapeFuncs.geturlnotify, instance, url, window, notifyData);
#else
return (*gNetscapeFuncs.geturlnotify)(instance, url, window, notifyData);
#endif
} }
NPError NPError
NPN_PostURL(NPP instance, const char* url, const char* window, NPN_PostURL(NPP instance, const char* url, const char* window,
uint32_t len, const char* buf, NPBool file) uint32_t len, const char* buf, NPBool file)
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_PostURLProc(gNetscapeFuncs.posturl, instance, return CallNPN_PostURLProc(gNetscapeFuncs.posturl, instance,
url, window, len, buf, file); url, window, len, buf, file);
#else
return (*gNetscapeFuncs.posturl)(instance, url, window, len, buf, file);
#endif
} }
NPError NPError
NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32_t len, NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32_t len,
const char* buf, NPBool file, void* notifyData) const char* buf, NPBool file, void* notifyData)
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_PostURLNotifyProc(gNetscapeFuncs.posturlnotify, return CallNPN_PostURLNotifyProc(gNetscapeFuncs.posturlnotify,
instance, url, window, len, buf, file, notifyData); instance, url, window, len, buf, file, notifyData);
#else
return (*gNetscapeFuncs.posturlnotify)(instance, url, window, len, buf, file, notifyData);
#endif
} }
NPError NPError
NPN_RequestRead(NPStream* stream, NPByteRange* rangeList) NPN_RequestRead(NPStream* stream, NPByteRange* rangeList)
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_RequestReadProc(gNetscapeFuncs.requestread, return CallNPN_RequestReadProc(gNetscapeFuncs.requestread,
stream, rangeList); stream, rangeList);
#else
return (*gNetscapeFuncs.requestread)(stream, rangeList);
#endif
} }
NPError NPError
NPN_NewStream(NPP instance, NPMIMEType type, const char *window, NPN_NewStream(NPP instance, NPMIMEType type, const char *window,
NPStream** stream_ptr) NPStream** stream_ptr)
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_NewStreamProc(gNetscapeFuncs.newstream, instance, return CallNPN_NewStreamProc(gNetscapeFuncs.newstream, instance,
type, window, stream_ptr); type, window, stream_ptr);
#else
return (*gNetscapeFuncs.newstream)(instance, type, window, stream_ptr);
#endif
} }
int32_t int32_t
NPN_Write(NPP instance, NPStream* stream, int32_t len, void* buffer) NPN_Write(NPP instance, NPStream* stream, int32_t len, void* buffer)
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_WriteProc(gNetscapeFuncs.write, instance, return CallNPN_WriteProc(gNetscapeFuncs.write, instance,
stream, len, buffer); stream, len, buffer);
#else
return (*gNetscapeFuncs.write)(instance, stream, len, buffer);
#endif
} }
NPError NPError
NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason) NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_DestroyStreamProc(gNetscapeFuncs.destroystream, return CallNPN_DestroyStreamProc(gNetscapeFuncs.destroystream,
instance, stream, reason); instance, stream, reason);
#else
return (*gNetscapeFuncs.destroystream)(instance, stream, reason);
#endif
} }
void void
NPN_Status(NPP instance, const char* message) NPN_Status(NPP instance, const char* message)
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_StatusProc(gNetscapeFuncs.status, instance, message); CallNPN_StatusProc(gNetscapeFuncs.status, instance, message);
#else
(*gNetscapeFuncs.status)(instance, message);
#endif
} }
const char* const char*
NPN_UserAgent(NPP instance) NPN_UserAgent(NPP instance)
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_UserAgentProc(gNetscapeFuncs.uagent, instance); return CallNPN_UserAgentProc(gNetscapeFuncs.uagent, instance);
#else
return (*gNetscapeFuncs.uagent)(instance);
#endif
} }
void *NPN_MemAlloc(uint32_t size) void *NPN_MemAlloc(uint32_t size)
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_MemAllocProc(gNetscapeFuncs.memalloc, size); return CallNPN_MemAllocProc(gNetscapeFuncs.memalloc, size);
#else
return (*gNetscapeFuncs.memalloc)(size);
#endif
} }
void NPN_MemFree(void* ptr) void NPN_MemFree(void* ptr)
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_MemFreeProc(gNetscapeFuncs.memfree, ptr); CallNPN_MemFreeProc(gNetscapeFuncs.memfree, ptr);
#else
(*gNetscapeFuncs.memfree)(ptr);
#endif
} }
uint32_t NPN_MemFlush(uint32_t size) uint32_t NPN_MemFlush(uint32_t size)
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_MemFlushProc(gNetscapeFuncs.memflush, size); return CallNPN_MemFlushProc(gNetscapeFuncs.memflush, size);
#else
return (*gNetscapeFuncs.memflush)(size);
#endif
} }
void NPN_ReloadPlugins(NPBool reloadPages) void NPN_ReloadPlugins(NPBool reloadPages)
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_ReloadPluginsProc(gNetscapeFuncs.reloadplugins, reloadPages); CallNPN_ReloadPluginsProc(gNetscapeFuncs.reloadplugins, reloadPages);
#else
(*gNetscapeFuncs.reloadplugins)(reloadPages);
#endif
} }
#ifdef OJI #ifdef OJI
JRIEnv* NPN_GetJavaEnv() JRIEnv* NPN_GetJavaEnv()
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_GetJavaEnvProc(gNetscapeFuncs.getJavaEnv); return CallNPN_GetJavaEnvProc(gNetscapeFuncs.getJavaEnv);
#else
return (*gNetscapeFuncs.getJavaEnv);
#endif
} }
jref NPN_GetJavaPeer(NPP instance) jref NPN_GetJavaPeer(NPP instance)
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_GetJavaPeerProc(gNetscapeFuncs.getJavaPeer, return CallNPN_GetJavaPeerProc(gNetscapeFuncs.getJavaPeer,
instance); instance);
#else
return (*gNetscapeFuncs.getJavaPeer)(instance);
#endif
} }
#endif #endif
void void
NPN_InvalidateRect(NPP instance, NPRect *invalidRect) NPN_InvalidateRect(NPP instance, NPRect *invalidRect)
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_InvalidateRectProc(gNetscapeFuncs.invalidaterect, instance, CallNPN_InvalidateRectProc(gNetscapeFuncs.invalidaterect, instance,
invalidRect); invalidRect);
#else
(*gNetscapeFuncs.invalidaterect)(instance, invalidRect);
#endif
} }
void void
NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion) NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion)
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_InvalidateRegionProc(gNetscapeFuncs.invalidateregion, instance, CallNPN_InvalidateRegionProc(gNetscapeFuncs.invalidateregion, instance,
invalidRegion); invalidRegion);
#else
(*gNetscapeFuncs.invalidateregion)(instance, invalidRegion);
#endif
} }
void void
NPN_ForceRedraw(NPP instance) NPN_ForceRedraw(NPP instance)
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_ForceRedrawProc(gNetscapeFuncs.forceredraw, instance); CallNPN_ForceRedrawProc(gNetscapeFuncs.forceredraw, instance);
#else
(*gNetscapeFuncs.forceredraw)(instance);
#endif
} }
void NPN_PushPopupsEnabledState(NPP instance, NPBool enabled) void NPN_PushPopupsEnabledState(NPP instance, NPBool enabled)
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_PushPopupsEnabledStateProc(gNetscapeFuncs.pushpopupsenabledstate, CallNPN_PushPopupsEnabledStateProc(gNetscapeFuncs.pushpopupsenabledstate,
instance, enabled); instance, enabled);
#else
(*gNetscapeFuncs.pushpopupsenabledstate)(instance, enabled);
#endif
} }
void NPN_PopPopupsEnabledState(NPP instance) void NPN_PopPopupsEnabledState(NPP instance)
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_PopPopupsEnabledStateProc(gNetscapeFuncs.poppopupsenabledstate, CallNPN_PopPopupsEnabledStateProc(gNetscapeFuncs.poppopupsenabledstate,
instance); instance);
#else
(*gNetscapeFuncs.poppopupsenabledstate)(instance);
#endif
} }
NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name) NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name)
...@@ -253,8 +346,12 @@ NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name) ...@@ -253,8 +346,12 @@ NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name)
int minor = gNetscapeFuncs.version & 0xFF; int minor = gNetscapeFuncs.version & 0xFF;
if( minor >= 14 ) if( minor >= 14 )
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_GetStringIdentifierProc( return CallNPN_GetStringIdentifierProc(
gNetscapeFuncs.getstringidentifier, name); gNetscapeFuncs.getstringidentifier, name);
#else
return (*gNetscapeFuncs.getstringidentifier)(name);
#endif
} }
return NULL; return NULL;
} }
...@@ -265,8 +362,12 @@ void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount, ...@@ -265,8 +362,12 @@ void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount,
int minor = gNetscapeFuncs.version & 0xFF; int minor = gNetscapeFuncs.version & 0xFF;
if( minor >= 14 ) if( minor >= 14 )
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_GetStringIdentifiersProc(gNetscapeFuncs.getstringidentifiers, CallNPN_GetStringIdentifiersProc(gNetscapeFuncs.getstringidentifiers,
names, nameCount, identifiers); names, nameCount, identifiers);
#else
(*gNetscapeFuncs.getstringidentifiers)(names, nameCount, identifiers);
#endif
} }
} }
...@@ -275,7 +376,11 @@ NPIdentifier NPN_GetIntIdentifier(int32_t intid) ...@@ -275,7 +376,11 @@ NPIdentifier NPN_GetIntIdentifier(int32_t intid)
int minor = gNetscapeFuncs.version & 0xFF; int minor = gNetscapeFuncs.version & 0xFF;
if( minor >= 14 ) if( minor >= 14 )
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_GetIntIdentifierProc(gNetscapeFuncs.getintidentifier, intid); return CallNPN_GetIntIdentifierProc(gNetscapeFuncs.getintidentifier, intid);
#else
return (*gNetscapeFuncs.getintidentifier)(intid);
#endif
} }
return NULL; return NULL;
} }
...@@ -285,9 +390,13 @@ bool NPN_IdentifierIsString(NPIdentifier identifier) ...@@ -285,9 +390,13 @@ bool NPN_IdentifierIsString(NPIdentifier identifier)
int minor = gNetscapeFuncs.version & 0xFF; int minor = gNetscapeFuncs.version & 0xFF;
if( minor >= 14 ) if( minor >= 14 )
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_IdentifierIsStringProc( return CallNPN_IdentifierIsStringProc(
gNetscapeFuncs.identifierisstring, gNetscapeFuncs.identifierisstring,
identifier); identifier);
#else
return (*gNetscapeFuncs.identifierisstring)(identifier);
#endif
} }
return false; return false;
} }
...@@ -297,9 +406,13 @@ NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier) ...@@ -297,9 +406,13 @@ NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier)
int minor = gNetscapeFuncs.version & 0xFF; int minor = gNetscapeFuncs.version & 0xFF;
if( minor >= 14 ) if( minor >= 14 )
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_UTF8FromIdentifierProc( return CallNPN_UTF8FromIdentifierProc(
gNetscapeFuncs.utf8fromidentifier, gNetscapeFuncs.utf8fromidentifier,
identifier); identifier);
#else
return (*gNetscapeFuncs.utf8fromidentifier)(identifier);
#endif
} }
return NULL; return NULL;
} }
...@@ -309,9 +422,13 @@ int32_t NPN_IntFromIdentifier(NPIdentifier identifier) ...@@ -309,9 +422,13 @@ int32_t NPN_IntFromIdentifier(NPIdentifier identifier)
int minor = gNetscapeFuncs.version & 0xFF; int minor = gNetscapeFuncs.version & 0xFF;
if( minor >= 14 ) if( minor >= 14 )
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_IntFromIdentifierProc( return CallNPN_IntFromIdentifierProc(
gNetscapeFuncs.intfromidentifier, gNetscapeFuncs.intfromidentifier,
identifier); identifier);
#else
return (*gNetscapeFuncs.intfromidentifier)(identifier);
#endif
} }
return 0; return 0;
} }
...@@ -320,7 +437,11 @@ NPObject *NPN_CreateObject(NPP npp, NPClass *aClass) ...@@ -320,7 +437,11 @@ NPObject *NPN_CreateObject(NPP npp, NPClass *aClass)
{ {
int minor = gNetscapeFuncs.version & 0xFF; int minor = gNetscapeFuncs.version & 0xFF;
if( minor >= 14 ) if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_CreateObjectProc(gNetscapeFuncs.createobject, npp, aClass); return CallNPN_CreateObjectProc(gNetscapeFuncs.createobject, npp, aClass);
#else
return (*gNetscapeFuncs.createobject)(npp, aClass);
#endif
return NULL; return NULL;
} }
...@@ -328,7 +449,11 @@ NPObject *NPN_RetainObject(NPObject *obj) ...@@ -328,7 +449,11 @@ NPObject *NPN_RetainObject(NPObject *obj)
{ {
int minor = gNetscapeFuncs.version & 0xFF; int minor = gNetscapeFuncs.version & 0xFF;
if( minor >= 14 ) if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_RetainObjectProc(gNetscapeFuncs.retainobject, obj); return CallNPN_RetainObjectProc(gNetscapeFuncs.retainobject, obj);
#else
return (*gNetscapeFuncs.retainobject)(obj);
#endif
return NULL; return NULL;
} }
...@@ -336,7 +461,11 @@ void NPN_ReleaseObject(NPObject *obj) ...@@ -336,7 +461,11 @@ void NPN_ReleaseObject(NPObject *obj)
{ {
int minor = gNetscapeFuncs.version & 0xFF; int minor = gNetscapeFuncs.version & 0xFF;
if( minor >= 14 ) if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_ReleaseObjectProc(gNetscapeFuncs.releaseobject, obj); CallNPN_ReleaseObjectProc(gNetscapeFuncs.releaseobject, obj);
#else
(*gNetscapeFuncs.releaseobject)(obj);
#endif
} }
bool NPN_Invoke(NPP npp, NPObject* obj, NPIdentifier methodName, bool NPN_Invoke(NPP npp, NPObject* obj, NPIdentifier methodName,
...@@ -344,8 +473,12 @@ bool NPN_Invoke(NPP npp, NPObject* obj, NPIdentifier methodName, ...@@ -344,8 +473,12 @@ bool NPN_Invoke(NPP npp, NPObject* obj, NPIdentifier methodName,
{ {
int minor = gNetscapeFuncs.version & 0xFF; int minor = gNetscapeFuncs.version & 0xFF;
if( minor >= 14 ) if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_InvokeProc(gNetscapeFuncs.invoke, npp, obj, methodName, return CallNPN_InvokeProc(gNetscapeFuncs.invoke, npp, obj, methodName,
args, argCount, result); args, argCount, result);
#else
return (*gNetscapeFuncs.invoke)(npp, obj, methodName, args, argCount, result);
#endif
return false; return false;
} }
...@@ -354,8 +487,12 @@ bool NPN_InvokeDefault(NPP npp, NPObject* obj, const NPVariant *args, ...@@ -354,8 +487,12 @@ bool NPN_InvokeDefault(NPP npp, NPObject* obj, const NPVariant *args,
{ {
int minor = gNetscapeFuncs.version & 0xFF; int minor = gNetscapeFuncs.version & 0xFF;
if( minor >= 14 ) if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_InvokeDefaultProc(gNetscapeFuncs.invokeDefault, npp, obj, return CallNPN_InvokeDefaultProc(gNetscapeFuncs.invokeDefault, npp, obj,
args, argCount, result); args, argCount, result);
#else
return (*gNetscapeFuncs.invokeDefault)(npp, obj, args, argCount, result);
#endif
return false; return false;
} }
...@@ -364,8 +501,12 @@ bool NPN_Evaluate(NPP npp, NPObject* obj, NPString *script, ...@@ -364,8 +501,12 @@ bool NPN_Evaluate(NPP npp, NPObject* obj, NPString *script,
{ {
int minor = gNetscapeFuncs.version & 0xFF; int minor = gNetscapeFuncs.version & 0xFF;
if( minor >= 14 ) if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_EvaluateProc(gNetscapeFuncs.evaluate, npp, obj, return CallNPN_EvaluateProc(gNetscapeFuncs.evaluate, npp, obj,
script, result); script, result);
#else
return (*gNetscapeFuncs.evaluate)(npp, obj, script, result);
#endif
return false; return false;
} }
...@@ -374,8 +515,12 @@ bool NPN_GetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName, ...@@ -374,8 +515,12 @@ bool NPN_GetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName,
{ {
int minor = gNetscapeFuncs.version & 0xFF; int minor = gNetscapeFuncs.version & 0xFF;
if( minor >= 14 ) if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_GetPropertyProc(gNetscapeFuncs.getproperty, npp, obj, return CallNPN_GetPropertyProc(gNetscapeFuncs.getproperty, npp, obj,
propertyName, result); propertyName, result);
#else
return (*gNetscapeFuncs.getproperty)(npp, obj, propertyName, result);
#endif
return false; return false;
} }
...@@ -384,8 +529,12 @@ bool NPN_SetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName, ...@@ -384,8 +529,12 @@ bool NPN_SetProperty(NPP npp, NPObject* obj, NPIdentifier propertyName,
{ {
int minor = gNetscapeFuncs.version & 0xFF; int minor = gNetscapeFuncs.version & 0xFF;
if( minor >= 14 ) if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_SetPropertyProc(gNetscapeFuncs.setproperty, npp, obj, return CallNPN_SetPropertyProc(gNetscapeFuncs.setproperty, npp, obj,
propertyName, value); propertyName, value);
#else
return (*gNetscapeFuncs.setproperty)(npp, obj, propertyName, value);
#endif
return false; return false;
} }
...@@ -393,8 +542,12 @@ bool NPN_RemoveProperty(NPP npp, NPObject* obj, NPIdentifier propertyName) ...@@ -393,8 +542,12 @@ bool NPN_RemoveProperty(NPP npp, NPObject* obj, NPIdentifier propertyName)
{ {
int minor = gNetscapeFuncs.version & 0xFF; int minor = gNetscapeFuncs.version & 0xFF;
if( minor >= 14 ) if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_RemovePropertyProc(gNetscapeFuncs.removeproperty, npp, obj, return CallNPN_RemovePropertyProc(gNetscapeFuncs.removeproperty, npp, obj,
propertyName); propertyName);
#else
return (*gNetscapeFuncs.removeproperty)(npp, obj, propertyName);
#endif
return false; return false;
} }
...@@ -402,8 +555,12 @@ bool NPN_HasProperty(NPP npp, NPObject* obj, NPIdentifier propertyName) ...@@ -402,8 +555,12 @@ bool NPN_HasProperty(NPP npp, NPObject* obj, NPIdentifier propertyName)
{ {
int minor = gNetscapeFuncs.version & 0xFF; int minor = gNetscapeFuncs.version & 0xFF;
if( minor >= 14 ) if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_HasPropertyProc(gNetscapeFuncs.hasproperty, npp, obj, return CallNPN_HasPropertyProc(gNetscapeFuncs.hasproperty, npp, obj,
propertyName); propertyName);
#else
return (*gNetscapeFuncs.hasproperty)(npp, obj, propertyName);
#endif
return false; return false;
} }
...@@ -411,8 +568,12 @@ bool NPN_HasMethod(NPP npp, NPObject* obj, NPIdentifier methodName) ...@@ -411,8 +568,12 @@ bool NPN_HasMethod(NPP npp, NPObject* obj, NPIdentifier methodName)
{ {
int minor = gNetscapeFuncs.version & 0xFF; int minor = gNetscapeFuncs.version & 0xFF;
if( minor >= 14 ) if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
return CallNPN_HasMethodProc(gNetscapeFuncs.hasmethod, npp, return CallNPN_HasMethodProc(gNetscapeFuncs.hasmethod, npp,
obj, methodName); obj, methodName);
#else
return (*gNetscapeFuncs.hasmethod)(npp, obj, methodName);
#endif
return false; return false;
} }
...@@ -420,14 +581,22 @@ void NPN_ReleaseVariantValue(NPVariant *variant) ...@@ -420,14 +581,22 @@ void NPN_ReleaseVariantValue(NPVariant *variant)
{ {
int minor = gNetscapeFuncs.version & 0xFF; int minor = gNetscapeFuncs.version & 0xFF;
if( minor >= 14 ) if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_ReleaseVariantValueProc(gNetscapeFuncs.releasevariantvalue, variant); CallNPN_ReleaseVariantValueProc(gNetscapeFuncs.releasevariantvalue, variant);
#else
(*gNetscapeFuncs.releasevariantvalue)(variant);
#endif
} }
void NPN_SetException(NPObject* obj, const NPUTF8 *message) void NPN_SetException(NPObject* obj, const NPUTF8 *message)
{ {
int minor = gNetscapeFuncs.version & 0xFF; int minor = gNetscapeFuncs.version & 0xFF;
if( minor >= 14 ) if( minor >= 14 )
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
CallNPN_SetExceptionProc(gNetscapeFuncs.setexception, obj, message); CallNPN_SetExceptionProc(gNetscapeFuncs.setexception, obj, message);
#else
(*gNetscapeFuncs.setexception)(obj, message);
#endif
} }
/*********************************************************************** /***********************************************************************
...@@ -766,6 +935,7 @@ NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs) ...@@ -766,6 +935,7 @@ NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
*/ */
pluginFuncs->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR; pluginFuncs->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR;
pluginFuncs->size = sizeof(NPPluginFuncs); pluginFuncs->size = sizeof(NPPluginFuncs);
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
pluginFuncs->newp = NewNPP_NewProc(Private_New); pluginFuncs->newp = NewNPP_NewProc(Private_New);
pluginFuncs->destroy = NewNPP_DestroyProc(Private_Destroy); pluginFuncs->destroy = NewNPP_DestroyProc(Private_Destroy);
pluginFuncs->setwindow = NewNPP_SetWindowProc(Private_SetWindow); pluginFuncs->setwindow = NewNPP_SetWindowProc(Private_SetWindow);
...@@ -777,11 +947,27 @@ NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs) ...@@ -777,11 +947,27 @@ NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
pluginFuncs->print = NewNPP_PrintProc(Private_Print); pluginFuncs->print = NewNPP_PrintProc(Private_Print);
pluginFuncs->getvalue = NewNPP_GetValueProc(Private_GetValue); pluginFuncs->getvalue = NewNPP_GetValueProc(Private_GetValue);
pluginFuncs->setvalue = NewNPP_SetValueProc(Private_SetValue); pluginFuncs->setvalue = NewNPP_SetValueProc(Private_SetValue);
#else
pluginFuncs->newp = (NPP_NewProcPtr)(Private_New);
pluginFuncs->destroy = (NPP_DestroyProcPtr)(Private_Destroy);
pluginFuncs->setwindow = (NPP_SetWindowProcPtr)(Private_SetWindow);
pluginFuncs->newstream = (NPP_NewStreamProcPtr)(Private_NewStream);
pluginFuncs->destroystream = (NPP_DestroyStreamProcPtr)(Private_DestroyStream);
pluginFuncs->asfile = (NPP_StreamAsFileProcPtr)(Private_StreamAsFile);
pluginFuncs->writeready = (NPP_WriteReadyProcPtr)(Private_WriteReady);
pluginFuncs->write = (NPP_WriteProcPtr)(Private_Write);
pluginFuncs->print = (NPP_PrintProcPtr)(Private_Print);
pluginFuncs->getvalue = (NPP_GetValueProcPtr)(Private_GetValue);
pluginFuncs->setvalue = (NPP_SetValueProcPtr)(Private_SetValue);
#endif
pluginFuncs->event = NULL; pluginFuncs->event = NULL;
if( minor >= NPVERS_HAS_NOTIFICATION ) if( minor >= NPVERS_HAS_NOTIFICATION )
{ {
#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
pluginFuncs->urlnotify = NewNPP_URLNotifyProc(Private_URLNotify); pluginFuncs->urlnotify = NewNPP_URLNotifyProc(Private_URLNotify);
#else
pluginFuncs->urlnotify = (NPP_URLNotifyProcPtr)(Private_URLNotify);
#endif
} }
#ifdef OJI #ifdef OJI
if( minor >= NPVERS_HAS_LIVECONNECT ) if( minor >= NPVERS_HAS_LIVECONNECT )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment