diff --git a/java/plugins/build.xml b/java/plugins/build.xml
index 7e13ff7f9ce..9b979b49aca 100644
--- a/java/plugins/build.xml
+++ b/java/plugins/build.xml
@@ -39,6 +39,8 @@
+
+
@@ -95,51 +97,69 @@
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
@@ -153,63 +173,65 @@
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/java/plugins/examples/MediaPlayer/JMPlayer.java b/java/plugins/examples/MediaPlayer/JMPlayer.java
index 3bb605d2e82..e69de29bb2d 100644
--- a/java/plugins/examples/MediaPlayer/JMPlayer.java
+++ b/java/plugins/examples/MediaPlayer/JMPlayer.java
@@ -1,134 +0,0 @@
-import javax.media.*;
-import javax.media.util.*;
-import javax.media.format.*;
-import javax.media.bean.playerbean.*;
-import javax.media.control.*;
-
-
-import org.mozilla.pluglet.*;
-import org.mozilla.pluglet.mozilla.*;
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.print.*;
-import java.io.*;
-import java.util.*;
-
-
-public class JMPlayer implements PlugletFactory {
- public JMPlayer() {
- }
- public Pluglet createPluglet(String mimeType) {
- Pluglet player = null;
- try {
- player = new Player();
- }
- catch (Throwable e) {
- e.printStackTrace();
- }
- return player;
- }
- public void initialize(String plugletPath, PlugletManager manager) {
- }
- public void shutdown() {
- }
-}
-
-class Player implements Pluglet, ControllerListener {
- Dimension defaultSize;
- Frame frm;
- int w, h;
- MediaPlayer player = null;
- Panel panel;
-
- public synchronized void controllerUpdate(ControllerEvent ce) {
- if(ce instanceof RealizeCompleteEvent) {
- player.prefetch();
- }
- if(ce instanceof PrefetchCompleteEvent) {
- Dimension dim = player.getPreferredSize();
- frm.pack();
- panel.setSize(dim);
- frm.setSize(defaultSize);
- player.start();
- frm.show();
- }
- }
- public Player() {
- }
- public void initialize(PlugletPeer peer) {
- PlugletTagInfo2 info = (PlugletTagInfo2)peer.getTagInfo();
- w = info.getWidth();
- h = info.getHeight();
- defaultSize = new Dimension(w, h);
- }
- public boolean playFile(String url) {
- player.setMediaLocator(new MediaLocator(url));
- if(player.getPlayer() == null) {
- return false;
- } else {
- player.addControllerListener(this);
- player.realize();
- }
- return true;
- }
- public void start() {
- player = new MediaPlayer();
- panel = new Panel();
- panel.add(player);
- }
- public void stop() {
- player.stop();
- player.close();
- }
- public void destroy() {
- }
- public PlugletStreamListener newStream() {
- JMPlayerStreamListener listener = new JMPlayerStreamListener();
- listener.setPlayer(this);
- return listener;
- }
- public void setWindow(Frame frame) {
- if(frame == null) {
- return;
- }
- frame.setSize(defaultSize);
- frame.setLayout(new BorderLayout());
- frame.add(panel);
- frm = frame;
- }
- public void print(PrinterJob printerJob) {
- }
-}
-
-class JMPlayerStreamListener implements PlugletStreamListener {
- Player jmp;
-
- public JMPlayerStreamListener() {
- }
- public void onStartBinding(PlugletStreamInfo streamInfo) {
- if(!jmp.playFile(streamInfo.getURL())) {
- System.out.println("Error starting player.");
- return;
- }
-
- }
- public void setPlayer(Player jmp) {
- this.jmp = jmp;
- }
- public void onDataAvailable(PlugletStreamInfo streamInfo, InputStream input,int length) {
- }
- public void onFileAvailable(PlugletStreamInfo plugletInfo, String fileName) {
- }
- public void onStopBinding(PlugletStreamInfo plugletInfo,int status) {
- }
- public int getStreamType() {
- return 1;
- }
-
-}
-
-
-
-
-
-
diff --git a/java/plugins/examples/MediaPlayer/build.xml b/java/plugins/examples/MediaPlayer/build.xml
index 0136f04b92c..7d5daf7d588 100644
--- a/java/plugins/examples/MediaPlayer/build.xml
+++ b/java/plugins/examples/MediaPlayer/build.xml
@@ -108,7 +108,7 @@
-
diff --git a/java/plugins/mozilla/Makefile.in b/java/plugins/mozilla/Makefile.in
index 1ee8b6cfce6..6922d229426 100644
--- a/java/plugins/mozilla/Makefile.in
+++ b/java/plugins/mozilla/Makefile.in
@@ -42,7 +42,9 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
-PLUGIN_SDK=$(DEPTH)/modules/plugin/tools/sdk
+PLUGIN_SDK_PATH=modules/plugin/tools/sdk
+PLUGIN_SDK_SRC=$(DEPTH)/../modules/plugin/tools/sdk
+PLUGIN_SDK_OBJDIR=$(DEPTH)/modules/plugin/tools/sdk
XPIDL_MODULE = nppluglet
LIBRARY_NAME = nppluglet
@@ -60,7 +62,7 @@ CPPSRCS = nsScriptablePeer.cpp \
XPIDLSRCS = nsISimplePlugin.idl
-SHARED_LIBRARY_LIBS = $(PLUGIN_SDK)/samples/common/$(LIB_PREFIX)plugingate_s.$(LIB_SUFFIX) ../src/$(LIB_PREFIX)pluglet.$(LIB_SUFFIX) $(XPCOM_LIBS) $(NSPR_LIBS)
+SHARED_LIBRARY_LIBS = $(PLUGIN_SDK_OBJDIR)/samples/common/$(LIB_PREFIX)plugingate_s.$(LIB_SUFFIX) ../src/$(LIB_PREFIX)pluglet.$(LIB_SUFFIX) $(XPCOM_LIBS) $(NSPR_LIBS)
ifeq ($(OS_ARCH),WINNT)
DEFFILE = $(win_srcdir)/nppluglet.def
@@ -73,12 +75,11 @@ ifeq ($(OS_ARCH),WINNT)
INCLUDES += \
-I$(MSVCDIR)/Include \
-I$(MSVCDIR)/ATL/SRC \
- -I../src \
+ -I$(DEPTH)/../java/plugins/src \
-I../src/_xpidlgen \
-I$(MOZILLA_FIVE_HOME)/../include/string \
-I$(MOZILLA_FIVE_HOME)/../include/xpcom_obsolete \
$(NULL)
-CXXFLAGS += /Zi /Yd
endif
CXXFLAGS += -DFORCE_PR_LOG
@@ -90,8 +91,8 @@ EXTRA_DSO_LDOPTS += $(XLDFLAGS) -rdynamic -lXi -lXext -lX11 -lm -lXt
endif
LOCAL_INCLUDES = -I./$(XPIDL_GEN_DIR) \
- -I$(PLUGIN_SDK)/samples/include \
- -I$(PLUGIN_SDK)/../../base/src \
+ -I$(PLUGIN_SDK_SRC)/samples/include \
+ -I$(PLUGIN_SDK_SRC)/../../base/src \
$(NULL)
install::
$(INSTALL) $(IFLAGS1) $(SHARED_LIBRARY) $(DIST)/bin/plugins
diff --git a/java/plugins/src/PlugletEngine.cpp b/java/plugins/src/PlugletEngine.cpp
index d53a359aa9c..d8a9e8cf358 100644
--- a/java/plugins/src/PlugletEngine.cpp
+++ b/java/plugins/src/PlugletEngine.cpp
@@ -205,8 +205,11 @@ void PlugletEngine::StartJVM() {
vm_args.nOptions = 1; // EDBURNS: Change to 3 for debugging
vm_args.ignoreUnrecognized = JNI_FALSE;
/* Create the Java VM */
+ PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
+ ("PlugletEngine::StartJVM about to start JVM with options %s %s %s\n",
+ options[0].optionString, options[1].optionString,
+ options[2].optionString));
res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
- printf("--bcJavaGlobal::StartJVM jvm started res %d\n",res);
PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
("PlugletEngine::StartJVM after CreateJavaVM res = %d\n",res));
}
diff --git a/java/plugins/src/PlugletFactory.cpp b/java/plugins/src/PlugletFactory.cpp
index 5aa48c95239..e2819f8c18b 100644
--- a/java/plugins/src/PlugletFactory.cpp
+++ b/java/plugins/src/PlugletFactory.cpp
@@ -155,8 +155,6 @@ nsresult PlugletFactory::Shutdown(void) {
}
nsresult PlugletFactory::GetMIMEDescription(const char* *result) {
- PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
- ("PlugletFactory::GetMimeDescription\n"));
if(!result) {
return NS_ERROR_FAILURE;
}
@@ -166,6 +164,10 @@ nsresult PlugletFactory::GetMIMEDescription(const char* *result) {
PlugletFactory::PlugletFactory(const char *inMimeDescription, const char *inPath) : jthis(nsnull), path(PL_strdup(inPath)), mimeDescription(PL_strdup(inMimeDescription))
{
+ PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
+ ("PlugletFactory::PlugletFactory: mimeDescription: %s, path: %s\n",
+ mimeDescription, path));
+
}
PlugletFactory::~PlugletFactory(void) {
@@ -203,7 +205,12 @@ PlugletFactory * PlugletFactory::Load(const char * path) {
char * mime = PlugletLoader::GetMIMEDescription(path);
PlugletFactory * result = nsnull;
if (mime) {
+ PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
+ ("PlugletFactory::Load: About to create PlugletFactory instance\n"));
result = new PlugletFactory(mime,path);
+ PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
+ ("PlugletFactory::Load: successfully created PlugletFactory instance\n"));
+
//delete[] mime; //nb we have a strange exception here
}
return result;
diff --git a/java/plugins/src/PlugletsDir.cpp b/java/plugins/src/PlugletsDir.cpp
index bcbd9dcc03d..ab855738d0d 100644
--- a/java/plugins/src/PlugletsDir.cpp
+++ b/java/plugins/src/PlugletsDir.cpp
@@ -94,7 +94,6 @@ nsresult PlugletsDir::LoadPluglets() {
for (nsDirectoryIterator iter(dir,PR_TRUE); iter.Exists(); iter++) {
const nsFileSpec& file = iter;
const char* name = file.GetCString();
- printf("debug: edburns: PlugletsDir::LoadPluglets: name: %s\n", name);
int length;
if((length = strlen(name)) <= 4 // if it's shorter than ".jar"
|| strcmp(name+length - 4,".jar") ) {
@@ -104,14 +103,17 @@ nsresult PlugletsDir::LoadPluglets() {
mimeType = nsnull;
rv = plugletFactory->GetMIMEDescription(&mimeType);
if (NS_SUCCEEDED(rv)) {
+ PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
+ ("PlugletsDir::LoadPluglets: got mime description: %s\n", mimeType));
+
const char *key = PL_strdup(mimeType);
- printf("debug: edburns: key: %s address: %p\n",
- key, key);
PLHashEntry *entry =
PL_HashTableAdd(mMimeTypeToPlugletFacoryHash,
(const void *) key,
plugletFactory);
rv = (nsnull != entry) ? NS_OK : NS_ERROR_FAILURE;
+ PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
+ ("PlugletsDir::LoadPluglets: adding to mimeTypeToPlugletFactoryHash. rv: %d\n", rv));
}
}
}