|
From: <br...@us...> - 2009-06-19 12:29:43
|
Revision: 3920
http://openvrml.svn.sourceforge.net/openvrml/?rev=3920&view=rev
Author: braden
Date: 2009-06-18 05:20:18 +0000 (Thu, 18 Jun 2009)
Log Message:
-----------
Build the Mozilla plug-in with XULRunner 1.9.1. Removed the NPN_* function implementations in favor of directly using the function pointers provided by the browser.
Modified Paths:
--------------
trunk/ChangeLog
trunk/configure.ac
trunk/src/mozilla-plugin/openvrml.cpp
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2009-06-18 04:26:38 UTC (rev 3919)
+++ trunk/ChangeLog 2009-06-18 05:20:18 UTC (rev 3920)
@@ -1,5 +1,70 @@
2009-06-18 Braden McDaniel <br...@en...>
+ Build the Mozilla plug-in with XULRunner 1.9.1. Removed the NPN_*
+ function implementations in favor of directly using the function
+ pointers provided by the browser.
+
+ * configure.ac: Require mozilla-plugin.pc version 1.9.1.
+ * src/mozilla-plugin/openvrml.cpp
+ (openvrml_np_browser_host_get_url(OpenvrmlNpBrowserHost *, const
+ char *, GError **)): Call mozillaFuncs.geturl directly.
+ (NP_Initialize(NPNetscapeFuncs *, NPPluginFuncs *)): Call
+ mozillaFuncs.getvalue directly.
+ (NPP_GetValue(NPP, NPPVariable, void *)): Call
+ mozillaFuncs.retainobject directly.
+ (NPN_Version(int *, int *, int *, int *)): Removed.
+ (NPN_GetURLNotify(NPP, const char *, const char *, void *)):
+ Removed.
+ (NPN_GetURL(NPP, const char *, const char *)): Removed.
+ (NPN_PostURLNotify(NPP, const char *, const char *, uint32, const
+ char *, NPBool, void *)): Removed.
+ (NPN_PostURL(NPP, const char *, const char *, uint32, const
+ char *, NPBool)): Removed.
+ (NPN_RequestRead(NPStream *, NPByteRange *)): Removed.
+ (NPN_NewStream(NPP, NPMIMEType, const char *, NPStream **)):
+ Removed.
+ (NPN_Write(NPP, NPStream *, int32, void *)): Removed.
+ (NPN_DestryStream(NPP, NPStream *, NPError)): Removed.
+ (NPN_Status(NPP, const char *)): Removed.
+ (NPN_UserAgent(NPP)): Removed.
+ (NPN_MemAlloc(uint32)): Removed.
+ (NPN_MemFree(void *)): Removed.
+ (NPN_MemFlush(uint32)): Removed.
+ (NPN_ReloadPlugins(NPBool)): Removed.
+ (NPN_GetJavaEnv()): Removed.
+ (NPN_GetJavaPeer(NPP)): Removed.
+ (NPN_GetValue(NPP, NPNVariable, void *)): Removed.
+ (NPN_SetValue(NPP, NPPVariable, void *)): Removed.
+ (NPN_InvalidateRect(NPP, NPRect *)): Removed.
+ (NPN_InvalidateRegion(NPP, NPRegion)): Removed.
+ (NPN_ForceRedraw(NPP)): Removed.
+ (NPN_ReleaseVariantValue(NPVariant *)): Removed.
+ (NPN_GetStringIdentifier(const NPUTF8 *)): Removed.
+ (NPN_GetStringIdentifiers(const NPUTF8 **, int32_t,
+ NPIdentifier *)): Removed.
+ (NPN_GetIdentifier(int32_t)): Removed.
+ (NPN_IdentifierIsString(NPIdentifier *)): Removed.
+ (NPN_UTF8FromIdentifier(NPIdentifier)): Removed.
+ (NPN_IntFromIdentifier(NPIdentifier)): Removed.
+ (NPN_CreateObject(NPP, NPClass *)): Removed.
+ (NPN_RetainObject(NPObject *)): Removed.
+ (NPN_ReleaseObject(NPObject *)): Removed.
+ (NPN_Invoke(NPP, NPObject *, NPIdentifier, const NPVariant *,
+ uint32_t, NPVariant *)): Removed.
+ (NPN_InvokeDefault(NPP, NPObject *, const NPVariant *, uint32_t,
+ NPVariant *)): Removed.
+ (NPN_Evaluate(NPP, NPObject *, NPString *, NPVariant *)): Removed.
+ (NPN_GetProperty(NPP, NPObject *, NPIdentifier, NPVariant *)):
+ Removed.
+ (NPN_SetProperty(NPP, NPObject *, NPIdentifier, const
+ NPVariant *)): Removed.
+ (NPN_RemoveProperty(NPP, NPObject *, NPIdentifier)): Removed.
+ (NPN_HasProperty(NPP, NPObject *, NPIdentifier)): Removed.
+ (NPN_HasMethod(NPP, NPObject *, NPIdentifier)): Removed.
+ (NPN_SetException(NPObject *, const NPUTF8 *)): Removed.
+
+2009-06-18 Braden McDaniel <br...@en...>
+
Conditionally apply "const" when using the JNI functions
SetFloatArrayRegion and SetDoubleArrayRegion.
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2009-06-18 04:26:38 UTC (rev 3919)
+++ trunk/configure.ac 2009-06-18 05:20:18 UTC (rev 3920)
@@ -201,15 +201,13 @@
PKG_CHECK_MODULES([GNOMEUI], [libgnomeui-2.0 libgnome-2.0 >= 2.14], ,
[have_gnomeui=no])
PKG_CHECK_MODULES([CURL], [libcurl], , [have_libcurl=no])
-PKG_CHECK_MODULES([MOZILLA_PLUGIN], [xulrunner-plugin],
- [mozilla_plugin_pkg=xulrunner-plugin],
- [PKG_CHECK_MODULES([MOZILLA_PLUGIN], [firefox-plugin],
- [mozilla_plugin_pkg=firefox-plugin],
- [PKG_CHECK_MODULES([MOZILLA_PLUGIN], [seamonkey-plugin],
- [mozilla_plugin_pkg=seamonkey-plugin],
- [PKG_CHECK_MODULES([MOZILLA_PLUGIN], [mozilla-plugin >= 1.6],
- [mozilla_plugin_pkg=mozilla-plugin],
- [have_mozilla_plugin=no])])])])
+#
+# The Mozilla plug-in uses the npfunctions.h header introduced in
+# XULRunner 1.9.1.
+#
+PKG_CHECK_MODULES([MOZILLA_PLUGIN], [mozilla-plugin >= 1.9.1],
+ [have_mozilla_plugin=yes],
+ [have_mozilla_plugin=no])
AC_PATH_XTRA
AX_CHECK_GLU
@@ -460,7 +458,7 @@
AS_IF([test X$enable_mozilla_plugin != Xno],
[AS_IF([test X$enable_xembed = Xno],
[AC_MSG_FAILURE([the Mozilla plug-in cannot be built without the XEmbed control])])
- AS_IF([test "X$have_mozilla_plugin" = "Xno"],
+ AS_IF([test X$have_mozilla_plugin = Xno],
[AC_MSG_FAILURE([Mozilla plug-in development headers are required to build the Mozilla plug-in.])])
AS_IF([test "X$have_dbus_glib" = "Xno"],
[AC_MSG_FAILURE([The D-Bus GLib binding is required to build the Mozilla plug-in])])])
Modified: trunk/src/mozilla-plugin/openvrml.cpp
===================================================================
--- trunk/src/mozilla-plugin/openvrml.cpp 2009-06-18 04:26:38 UTC (rev 3919)
+++ trunk/src/mozilla-plugin/openvrml.cpp 2009-06-18 05:20:18 UTC (rev 3920)
@@ -31,7 +31,7 @@
# include <boost/noncopyable.hpp>
# include <boost/ref.hpp>
# include <boost/scoped_ptr.hpp>
-# include <npupp.h>
+# include <npfunctions.h>
# if defined MOZ_X11
# include <dbus/dbus-glib-bindings.h>
# else
@@ -149,6 +149,8 @@
}
namespace {
+ NPNetscapeFuncs mozillaFuncs;
+
enum np_host_signal_id {
shutdown_id,
last_signal_id
@@ -207,7 +209,7 @@
const char * const url,
GError ** /* error */)
{
- return NPN_GetURL(host->npp, url, 0);
+ return mozillaFuncs.geturl(host->npp, url, 0);
}
void openvrml_np_browser_host_set_world_url(OpenvrmlNpBrowserHost * /* host */,
@@ -221,10 +223,6 @@
return NPP_GetMIMEDescription();
}
-namespace {
- NPNetscapeFuncs mozillaFuncs;
-}
-
/**
* @brief Provides global initialization for a plug-in.
*
@@ -340,10 +338,7 @@
// Make sure the browser supports XEmbed plug-ins.
//
PRBool supportsXEmbed = PR_FALSE;
- err = CallNPN_GetValueProc(mozillaFuncs.getvalue,
- 0,
- NPNVSupportsXEmbedBool,
- &supportsXEmbed);
+ err = mozillaFuncs.getvalue(0, NPNVSupportsXEmbedBool, &supportsXEmbed);
if (err != NPERR_NO_ERROR || !supportsXEmbed) {
return NPERR_INCOMPATIBLE_VERSION_ERROR;
@@ -353,10 +348,7 @@
// Make sure the browser tookit is Gtk2.
//
NPNToolkitType toolkit = NPNToolkitType();
- err = CallNPN_GetValueProc(mozillaFuncs.getvalue,
- 0,
- NPNVToolkit,
- &toolkit);
+ err = mozillaFuncs.getvalue(0, NPNVToolkit, &toolkit);
if (err != NPERR_NO_ERROR || toolkit != NPNVGtk2) {
return NPERR_INCOMPATIBLE_VERSION_ERROR;
@@ -692,7 +684,7 @@
case NPPVpluginScriptableNPObject:
assert(npp->pdata);
instance = static_cast<plugin_instance *>(npp->pdata);
- NPN_RetainObject(instance->npobj);
+ mozillaFuncs.retainobject(instance->npobj);
*static_cast<NPObject **>(value) = instance->npobj;
break;
default:
@@ -706,307 +698,6 @@
return NPERR_NO_ERROR;
}
-void NPN_Version(int * plugin_major,
- int * plugin_minor,
- int * mozilla_major,
- int * mozilla_minor)
-{
- *plugin_major = NP_VERSION_MAJOR;
- *plugin_minor = NP_VERSION_MINOR;
- *mozilla_major = mozillaFuncs.version >> 8;
- *mozilla_minor = mozillaFuncs.version & 0xff;
-}
-
-NPError NPN_GetURLNotify(NPP instance,
- const char * url,
- const char * target,
- void * notifyData)
-{
- const int navMinorVers = mozillaFuncs.version & 0xFF;
- return (navMinorVers >= NPVERS_HAS_NOTIFICATION)
- ? CallNPN_GetURLNotifyProc(mozillaFuncs.geturlnotify,
- instance,
- url,
- target,
- notifyData)
- : NPERR_INCOMPATIBLE_VERSION_ERROR;
-}
-
-NPError NPN_GetURL(NPP instance, const char * url, const char * target)
-{
- return CallNPN_GetURLProc(mozillaFuncs.geturl, instance, url, target);
-}
-
-NPError NPN_PostURLNotify(NPP instance,
- const char * url,
- const char * window,
- uint32 len,
- const char * buf,
- NPBool file,
- void * notifyData)
-{
- const int navMinorVers = mozillaFuncs.version & 0xFF;
- return (navMinorVers >= NPVERS_HAS_NOTIFICATION)
- ? CallNPN_PostURLNotifyProc(mozillaFuncs.posturlnotify,
- instance,
- url,
- window,
- len,
- buf,
- file,
- notifyData)
- : NPERR_INCOMPATIBLE_VERSION_ERROR;
-}
-
-NPError NPN_PostURL(NPP instance,
- const char * url,
- const char * window,
- uint32 len,
- const char * buf,
- NPBool file)
-{
- return CallNPN_PostURLProc(mozillaFuncs.posturl,
- instance,
- url,
- window,
- len,
- buf,
- file);
-}
-
-NPError NPN_RequestRead(NPStream * stream, NPByteRange * rangeList)
-{
- return CallNPN_RequestReadProc(mozillaFuncs.requestread,
- stream,
- rangeList);
-}
-
-NPError NPN_NewStream(NPP instance,
- NPMIMEType type,
- const char * target,
- NPStream ** stream)
-{
- const int navMinorVersion = mozillaFuncs.version & 0xFF;
- return (navMinorVersion >= NPVERS_HAS_STREAMOUTPUT)
- ? CallNPN_NewStreamProc(mozillaFuncs.newstream,
- instance,
- type,
- target,
- stream)
- : NPERR_INCOMPATIBLE_VERSION_ERROR;
-}
-
-int32 NPN_Write(NPP instance, NPStream * stream, int32 len, void * buffer)
-{
- const int navMinorVersion = mozillaFuncs.version & 0xFF;
- return (navMinorVersion >= NPVERS_HAS_STREAMOUTPUT)
- ? CallNPN_WriteProc(mozillaFuncs.write, instance, stream, len, buffer)
- : -1;
-}
-
-NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
-{
- const int navMinorVersion = mozillaFuncs.version & 0xFF;
- return (navMinorVersion >= NPVERS_HAS_STREAMOUTPUT)
- ? CallNPN_DestroyStreamProc(mozillaFuncs.destroystream,
- instance,
- stream,
- reason)
- : NPERR_INCOMPATIBLE_VERSION_ERROR;
-}
-
-void NPN_Status(NPP instance, const char * message)
-{
- CallNPN_StatusProc(mozillaFuncs.status, instance, message);
-}
-
-const char * NPN_UserAgent(NPP instance)
-{
- return CallNPN_UserAgentProc(mozillaFuncs.uagent, instance);
-}
-
-void * NPN_MemAlloc(uint32 size)
-{
- return CallNPN_MemAllocProc(mozillaFuncs.memalloc, size);
-}
-
-void NPN_MemFree(void * ptr)
-{
- CallNPN_MemFreeProc(mozillaFuncs.memfree, ptr);
-}
-
-uint32 NPN_MemFlush(uint32 size)
-{
- return CallNPN_MemFlushProc(mozillaFuncs.memflush, size);
-}
-
-void NPN_ReloadPlugins(NPBool reloadPages)
-{
- CallNPN_ReloadPluginsProc(mozillaFuncs.reloadplugins, reloadPages);
-}
-
-JRIEnv * NPN_GetJavaEnv()
-{
- return CallNPN_GetJavaEnvProc(mozillaFuncs.getJavaEnv);
-}
-
-jref NPN_GetJavaPeer(NPP instance)
-{
- return CallNPN_GetJavaPeerProc(mozillaFuncs.getJavaPeer, instance);
-}
-
-NPError NPN_GetValue(NPP instance, NPNVariable variable, void * value)
-{
- return CallNPN_GetValueProc(mozillaFuncs.getvalue,
- instance,
- variable,
- value);
-}
-
-NPError NPN_SetValue(NPP instance, NPPVariable variable, void * value)
-{
- return CallNPN_SetValueProc(mozillaFuncs.setvalue,
- instance,
- variable,
- value);
-}
-
-void NPN_InvalidateRect(NPP instance, NPRect * invalidRect)
-{
- CallNPN_InvalidateRectProc(mozillaFuncs.invalidaterect,
- instance,
- invalidRect);
-}
-
-void NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion)
-{
- CallNPN_InvalidateRegionProc(mozillaFuncs.invalidateregion,
- instance,
- invalidRegion);
-}
-
-void NPN_ForceRedraw(NPP instance)
-{
- CallNPN_ForceRedrawProc(mozillaFuncs.forceredraw, instance);
-}
-
-void NPN_ReleaseVariantValue(NPVariant * variant)
-{
- CallNPN_ReleaseVariantValueProc(mozillaFuncs.releasevariantvalue, variant);
-}
-
-NPIdentifier NPN_GetStringIdentifier(const NPUTF8 * name)
-{
- return CallNPN_GetStringIdentifierProc(mozillaFuncs.getstringidentifier,
- name);
-}
-
-void NPN_GetStringIdentifiers(const NPUTF8 ** names,
- int32_t nameCount,
- NPIdentifier * identifiers)
-{
- CallNPN_GetStringIdentifiersProc(mozillaFuncs.getstringidentifiers,
- names,
- nameCount,
- identifiers);
-}
-
-NPIdentifier NPN_GetIntIdentifier(int32_t intid)
-{
- return CallNPN_GetIntIdentifierProc(mozillaFuncs.getintidentifier, intid);
-}
-
-bool NPN_IdentifierIsString(NPIdentifier * identifier)
-{
- return CallNPN_IdentifierIsStringProc(mozillaFuncs.identifierisstring,
- identifier);
-}
-
-NPUTF8 * NPN_UTF8FromIdentifier(NPIdentifier identifier)
-{
- return CallNPN_UTF8FromIdentifierProc(mozillaFuncs.utf8fromidentifier,
- identifier);
-}
-
-int32_t NPN_IntFromIdentifier(NPIdentifier identifier)
-{
- return CallNPN_IntFromIdentifierProc(mozillaFuncs.intfromidentifier,
- identifier);
-}
-
-NPObject * NPN_CreateObject(NPP npp, NPClass * aClass)
-{
- return CallNPN_CreateObjectProc(mozillaFuncs.createobject, npp, aClass);
-}
-
-NPObject * NPN_RetainObject(NPObject * npobj)
-{
- return CallNPN_RetainObjectProc(mozillaFuncs.retainobject, npobj);
-}
-
-void NPN_ReleaseObject(NPObject * npobj)
-{
- CallNPN_ReleaseObjectProc(mozillaFuncs.releaseobject, npobj);
-}
-
-bool NPN_Invoke(NPP npp, NPObject * npobj, NPIdentifier methodName,
- const NPVariant * args, uint32_t argCount, NPVariant * result)
-{
- return CallNPN_InvokeProc(mozillaFuncs.invoke,
- npp, npobj, methodName, args, argCount, result);
-}
-
-bool NPN_InvokeDefault(NPP npp, NPObject * npobj, const NPVariant * args,
- uint32_t argCount, NPVariant * result)
-{
- return CallNPN_InvokeDefaultProc(mozillaFuncs.invokeDefault,
- npp, npobj, args, argCount, result);
-}
-
-bool NPN_Evaluate(NPP npp, NPObject * npobj, NPString * script,
- NPVariant * result)
-{
- return CallNPN_EvaluateProc(mozillaFuncs.evaluate, npp, npobj, script,
- result);
-}
-
-bool NPN_GetProperty(NPP npp, NPObject * npobj, NPIdentifier propertyName,
- NPVariant * result)
-{
- return CallNPN_GetPropertyProc(mozillaFuncs.getproperty,
- npp, npobj, propertyName, result);
-}
-
-bool NPN_SetProperty(NPP npp, NPObject * npobj, NPIdentifier propertyName,
- const NPVariant * result)
-{
- return CallNPN_SetPropertyProc(mozillaFuncs.setproperty,
- npp, npobj, propertyName, result);
-}
-
-bool NPN_RemoveProperty(NPP npp, NPObject * npobj, NPIdentifier propertyName)
-{
- return CallNPN_RemovePropertyProc(mozillaFuncs.removeproperty,
- npp, npobj, propertyName);
-}
-
-bool NPN_HasProperty(NPP npp, NPObject * npobj, NPIdentifier propertyName)
-{
- return CallNPN_HasPropertyProc(mozillaFuncs.hasproperty,
- npp, npobj, propertyName);
-}
-
-bool NPN_HasMethod(NPP npp, NPObject * npobj, NPIdentifier methodName)
-{
- return CallNPN_HasMethodProc(mozillaFuncs.hasmethod,
- npp, npobj, methodName);
-}
-
-void NPN_SetException(NPObject * npobj, const NPUTF8 * message)
-{
- return CallNPN_SetExceptionProc(mozillaFuncs.setexception, npobj, message);
-}
-
namespace {
boost::scoped_ptr<const script_callback_map> script_callback_map::instance_;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|