edburns%acm.org 4cf929cbd3 This change-bundle starts the process of re-activating pluglets.
Next step is to figure out the best way to fix these unresolved symbols
at link time when building pluglet.dll

/cygdrive/d/Projects/mozilla/MOZILLA_NIH/FIREFOX_1_5_0_1/mozilla/./build/cygwin-wrapper link -NOLOGO -DLL -OUT:pluglet.dll -PDB:pluglet.pdb -SUBSYSTEM:WINDOWS  List.obj Pluglet.obj PlugletEngine.obj PlugletFactory.obj PlugletInputStream.obj PlugletLoader.obj PlugletManager.obj PlugletPeer.obj PlugletStreamInfo.obj PlugletStreamListener.obj PlugletsDir.obj Registry.obj PlugletViewFactory.obj   ./module.res   -DEBUG -DEBUGTYPE:CV         kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib D:\Files_2k\j2sdk1.4.2_03/lib/jvm.lib ../../../dist/lib/xpcom.lib ../../../dist/lib/xpcom_core.lib ../../../dist/lib/nspr4.lib ../../../dist/lib/plc4.lib ../../../dist/lib/plds4.lib
   Creating library pluglet.lib and object pluglet.exp
PlugletsDir.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall nsFileSpec::~nsFileSpec(void)" (__imp_??1nsFileSpec@@UAE@XZ)
PlugletsDir.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall nsDirectoryIterator::~nsDirectoryIterator(void)" (__imp_??1nsDirectoryIterator@@UAE@XZ)
PlugletsDir.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class nsDirectoryIterator & __thiscall nsDirectoryIterator::operator++(void)" (__imp_??EnsDirectoryIterator@@QAEAAV0@XZ)
PlugletsDir.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall nsDirectoryIterator::nsDirectoryIterator(class nsFileSpec const &,int)" (__imp_??0nsDirectoryIterator@@QAE@ABVnsFileSpec@@H@Z)
PlugletsDir.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall nsFileSpec::nsFileSpec(char const *,int)" (__imp_??0nsFileSpec@@QAE@PBDH@Z)
PlugletsDir.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall nsSpecialSystemDirectory::~nsSpecialSystemDirectory(void)" (__imp_??1nsSpecialSystemDirectory@@UAE@XZ)
PlugletsDir.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall nsFileSpec::operator+=(char const *)" (__imp_??YnsFileSpec@@QAEXPBD@Z)
PlugletsDir.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall nsSpecialSystemDirectory::nsSpecialSystemDirectory(enum nsSpecialSystemDirectory::SystemDirectories)" (__imp_??0nsSpecialSystemDirectory@@QAE@W4SystemDirectories@0@@Z)
PlugletsDir.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: char const * __thiscall nsFileSpec::GetCString(void)const " (__imp_?GetCString@nsFileSpec@@QBEPBDXZ)
PlugletViewFactory.obj : error LNK2001: unresolved external symbol "public: __thiscall PlugletViewWindows::PlugletViewWindows(void)" (??0PlugletViewWindows@@QAE@XZ)
pluglet.dll : fatal error LNK1120: 10 unresolved externals

M makefiles

+java/plugins/Makefile
+java/plugins/src/Makefile

Add generation of these Makefiles

M plugins/src/Makefile.in

- copy some content from webclient

M plugins/src/Pluglet.cpp
M plugins/src/PlugletEngine.cpp
M plugins/src/PlugletStreamListener.cpp

- Changes from John Sublet.


git-svn-id: svn://10.0.0.236/trunk@192678 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-21 03:25:34 +00:00

215 lines
6.2 KiB
C++

/*
* The contents of this file are subject to the Mozilla Public
* 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 Sun Microsystems,
* Inc. Portions created by Sun are
* Copyright (C) 1999 Sun Microsystems, Inc. All
* Rights Reserved.
*
* Contributor(s):
*/
#include "Pluglet.h"
#include "PlugletEngine.h"
#include "PlugletStreamListener.h"
#include "PlugletPeer.h"
#include "Registry.h"
#include "PlugletViewFactory.h"
#include "PlugletLog.h"
jmethodID Pluglet::initializeMID = NULL;
jmethodID Pluglet::startMID = NULL;
jmethodID Pluglet::stopMID = NULL;
jmethodID Pluglet::destroyMID = NULL;
jmethodID Pluglet::newStreamMID = NULL;
jmethodID Pluglet::setWindowMID = NULL;
jmethodID Pluglet::printMID = NULL;
static NS_DEFINE_IID(kIPluginInstanceIID, NS_IPLUGININSTANCE_IID);
NS_IMPL_ISUPPORTS1(Pluglet,nsIPluginInstance);
Pluglet::Pluglet(jobject object) {
jthis = PlugletEngine::GetJNIEnv()->NewGlobalRef(object);
//nb check for null
peer = NULL;
view = PlugletViewFactory::GetPlugletView();
Registry::SetPeer(jthis,(jlong)this);
}
Pluglet::~Pluglet() {
Registry::Remove(jthis);
PlugletEngine::GetJNIEnv()->DeleteGlobalRef(jthis);
NS_RELEASE(peer);
}
NS_METHOD Pluglet::HandleEvent(nsPluginEvent* event, PRBool* handled) {
PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
("Pluglet::HandleEvent; stub\n"));
//nb we do not need it under win32
return NS_OK;
}
NS_METHOD Pluglet::Initialize(nsIPluginInstancePeer* _peer) {
PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
("Pluglet::Initialize\n"));
JNIEnv *env = PlugletEngine::GetJNIEnv();
if (!printMID) {
jclass clazz = env->FindClass("org/mozilla/pluglet/Pluglet");
if (env->ExceptionOccurred()) {
env->ExceptionDescribe();
return NS_ERROR_FAILURE;
}
initializeMID = env->GetMethodID(clazz,"initialize","(Lorg/mozilla/pluglet/mozilla/PlugletPeer;)V");
if (env->ExceptionOccurred()) {
env->ExceptionDescribe();
return NS_ERROR_FAILURE;
}
startMID = env->GetMethodID(clazz,"start","()V");
if (env->ExceptionOccurred()) {
env->ExceptionDescribe();
return NS_ERROR_FAILURE;
}
stopMID = env->GetMethodID(clazz,"stop","()V");
if (env->ExceptionOccurred()) {
env->ExceptionDescribe();
return NS_ERROR_FAILURE;
}
destroyMID = env->GetMethodID(clazz,"destroy","()V");
if (env->ExceptionOccurred()) {
env->ExceptionDescribe();
return NS_ERROR_FAILURE;
}
newStreamMID = env->GetMethodID(clazz,"newStream","()Lorg/mozilla/pluglet/PlugletStreamListener;");
if (env->ExceptionOccurred()) {
env->ExceptionDescribe();
return NS_ERROR_FAILURE;
}
setWindowMID = env->GetMethodID(clazz,"setWindow","(Ljava/awt/Frame;)V");
if (env->ExceptionOccurred()) {
env->ExceptionDescribe();
return NS_ERROR_FAILURE;
}
printMID = env->GetMethodID(clazz,"print","(Ljava/awt/print/PrinterJob;)V");
if (env->ExceptionOccurred()) {
env->ExceptionDescribe();
return NS_ERROR_FAILURE;
}
}
peer = _peer;
peer->AddRef();
jobject obj = PlugletPeer::GetJObject(peer);
if (!obj) {
return NS_ERROR_FAILURE;
}
env->CallVoidMethod(jthis,initializeMID,obj);
return NS_OK;
}
NS_METHOD Pluglet::GetPeer(nsIPluginInstancePeer* *result) {
PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
("Pluglet::GetPeer\n"));
peer->AddRef();
*result = peer;
return NS_OK;
}
NS_METHOD Pluglet::Start(void) {
PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
("Pluglet::Start\n"));
JNIEnv * env = PlugletEngine::GetJNIEnv();
env->CallVoidMethod(jthis,startMID);
if (env->ExceptionOccurred()) {
env->ExceptionDescribe();
return NS_ERROR_FAILURE;
}
return NS_OK;
}
NS_METHOD Pluglet::Stop(void) {
PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
("Pluglet::Stop\n"));
JNIEnv * env = PlugletEngine::GetJNIEnv();
env->CallVoidMethod(jthis,stopMID);
if (env->ExceptionOccurred()) {
env->ExceptionDescribe();
return NS_ERROR_FAILURE;
}
return NS_OK;
}
NS_METHOD Pluglet::Destroy(void) {
PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
("Pluglet::Destroy\n"));
JNIEnv * env = PlugletEngine::GetJNIEnv();
env->CallVoidMethod(jthis,destroyMID);
if (env->ExceptionOccurred()) {
env->ExceptionDescribe();
return NS_ERROR_FAILURE;
}
return NS_OK;
}
NS_METHOD Pluglet::NewStream(nsIPluginStreamListener** listener) {
PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
("Pluglet::NewStream\n"));
if(!listener) {
return NS_ERROR_FAILURE;
}
JNIEnv * env = PlugletEngine::GetJNIEnv();
jobject obj = env->CallObjectMethod(jthis,newStreamMID);
if (env->ExceptionOccurred()) {
env->ExceptionDescribe();
return NS_ERROR_FAILURE;
}
if (obj) {
*listener = new PlugletStreamListener(obj);
(*listener)->AddRef();
}
return NS_OK;
}
NS_METHOD Pluglet::GetValue(nsPluginInstanceVariable variable, void *value) {
PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
("Pluglet::GetValue; stub\n"));
return NS_ERROR_FAILURE;
}
NS_METHOD Pluglet::SetWindow(nsPluginWindow* window) {
PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
("Pluglet::SetWindow\n"));
if (view->SetWindow(window) == PR_TRUE) {
JNIEnv *env = PlugletEngine::GetJNIEnv();
env->CallVoidMethod(jthis,setWindowMID,view->GetJObject());
if (env->ExceptionOccurred()) {
env->ExceptionDescribe();
return NS_ERROR_FAILURE;
}
}
return NS_OK;
}
NS_METHOD Pluglet::Print(nsPluginPrint* platformPrint) {
PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
("Pluglet::Print; stub\n"));
//nb
return NS_OK;
}