19465
Port pluglets to linux and Solaris (This is not part of the build) git-svn-id: svn://10.0.0.236/trunk@54082 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
70
mozilla/java/plugins/src/Makefile.in
Normal file
70
mozilla/java/plugins/src/Makefile.in
Normal file
@@ -0,0 +1,70 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# 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 Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
LIBRARY_NAME = pluglet
|
||||
MODULE = pluglet
|
||||
IS_COMPONENT = 1
|
||||
|
||||
CPPSRCS = \
|
||||
List.cpp \
|
||||
Pluglet.cpp \
|
||||
PlugletEngine.cpp \
|
||||
PlugletFactory.cpp \
|
||||
PlugletInputStream.cpp \
|
||||
PlugletLoader.cpp \
|
||||
PlugletManager.cpp \
|
||||
PlugletPeer.cpp \
|
||||
PlugletStreamInfo.cpp \
|
||||
PlugletStreamListener.cpp \
|
||||
PlugletsDir.cpp \
|
||||
Registry.cpp \
|
||||
PlugletViewMotif.cpp \
|
||||
PlugletViewFactory.cpp \
|
||||
$(NULL)
|
||||
|
||||
CXXFLAGS += $(MOZ_TOOLKIT_REGISTRY_CFLAGS) -D_REENTRANT -DOJI_DISABLE
|
||||
|
||||
DSO_LDOPTS += \
|
||||
-L$(JDKHOME)/jre/lib/$(HOSTTYPE)/ \
|
||||
-L$(JDKHOME)/jre/lib/$(HOSTTYPE)/classic \
|
||||
-ljava -ljvm -lawt \
|
||||
-lgdk
|
||||
|
||||
ifneq ($(OS_ARCH), Linux)
|
||||
DSO_LDOPTS += \
|
||||
-lthread -lXm -lX11 -lXt -lm
|
||||
endif
|
||||
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include "PlugletStreamListener.h"
|
||||
#include "PlugletPeer.h"
|
||||
#include "Registry.h"
|
||||
#include "PlugletViewFactory.h"
|
||||
|
||||
|
||||
jmethodID Pluglet::initializeMID = NULL;
|
||||
jmethodID Pluglet::startMID = NULL;
|
||||
@@ -41,7 +43,7 @@ Pluglet::Pluglet(jobject object) {
|
||||
jthis = PlugletEngine::GetJNIEnv()->NewGlobalRef(object);
|
||||
//nb check for null
|
||||
peer = NULL;
|
||||
view = new PlugletView();
|
||||
view = PlugletViewFactory::GetPlugletView();
|
||||
Registry::SetPeer(jthis,(jlong)this);
|
||||
}
|
||||
|
||||
@@ -111,12 +113,14 @@ NS_METHOD Pluglet::Initialize(nsIPluginInstancePeer* _peer) {
|
||||
}
|
||||
|
||||
NS_METHOD Pluglet::GetPeer(nsIPluginInstancePeer* *result) {
|
||||
printf("--Pluglet::GetPeer\n");
|
||||
peer->AddRef();
|
||||
*result = peer;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD Pluglet::Start(void) {
|
||||
printf("--Pluglet::Start\n");
|
||||
JNIEnv * env = PlugletEngine::GetJNIEnv();
|
||||
env->CallVoidMethod(jthis,startMID);
|
||||
if (env->ExceptionOccurred()) {
|
||||
@@ -126,6 +130,7 @@ NS_METHOD Pluglet::Start(void) {
|
||||
return NS_OK;
|
||||
}
|
||||
NS_METHOD Pluglet::Stop(void) {
|
||||
printf("--Pluglet::Stop\n");
|
||||
JNIEnv * env = PlugletEngine::GetJNIEnv();
|
||||
env->CallVoidMethod(jthis,stopMID);
|
||||
if (env->ExceptionOccurred()) {
|
||||
@@ -145,6 +150,7 @@ NS_METHOD Pluglet::Destroy(void) {
|
||||
}
|
||||
|
||||
NS_METHOD Pluglet::NewStream(nsIPluginStreamListener** listener) {
|
||||
printf("--Pluglet::NewStream \n");
|
||||
if(!listener) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
@@ -162,13 +168,19 @@ NS_METHOD Pluglet::NewStream(nsIPluginStreamListener** listener) {
|
||||
}
|
||||
|
||||
NS_METHOD Pluglet::GetValue(nsPluginInstanceVariable variable, void *value) {
|
||||
printf("--Pluglet::GetValue\n");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_METHOD Pluglet::SetWindow(nsPluginWindow* window) {
|
||||
JNIEnv *env = PlugletEngine::GetJNIEnv();
|
||||
if (view->SetWindow(window)) {
|
||||
env->CallVoidMethod(jthis,setWindowMID,view->GetJObject());
|
||||
printf("--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;
|
||||
}
|
||||
|
||||
@@ -175,11 +175,17 @@ void PlugletEngine::StartJVM(void) {
|
||||
sprintf(classpath, "%s%c%s",
|
||||
vm_args.classpath, PATH_SEPARATOR, PR_GetEnv("CLASSPATH"));
|
||||
printf("-- classpath %s\n",classpath);
|
||||
char **props = new char*[2];
|
||||
props[0]="java.compiler=NONE";
|
||||
props[1]=0;
|
||||
vm_args.properties = props;
|
||||
vm_args.classpath = classpath;
|
||||
/* Create the Java VM */
|
||||
res = JNI_CreateJavaVM(&jvm, &env, &vm_args);
|
||||
if(res < 0 ) {
|
||||
printf("--JNI_CreateJavaVM failed \n");
|
||||
} else {
|
||||
printf("--PlugletEngine::StartJVM() jvm was started \n");
|
||||
}
|
||||
}
|
||||
#endif /* OJI_DISABLE */
|
||||
@@ -208,6 +214,7 @@ JNIEnv * PlugletEngine::GetJNIEnv(void) {
|
||||
StartJVM();
|
||||
}
|
||||
jvm->AttachCurrentThread(&res,NULL);
|
||||
printf("--PluglgetEngine::GetJNIEnv after jvm->Attach \n");
|
||||
#endif /* OJI_DISABLE */
|
||||
return res;
|
||||
}
|
||||
@@ -230,7 +237,7 @@ jobject PlugletEngine::GetPlugletManager(void) {
|
||||
}
|
||||
|
||||
PlugletEngine * PlugletEngine::GetEngine(void) {
|
||||
return engine;
|
||||
return engine;
|
||||
}
|
||||
void PlugletEngine::IncObjectCount(void) {
|
||||
objectCount++;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "jni.h"
|
||||
#include "nsIPluginManager.h"
|
||||
#include "PlugletsDir.h"
|
||||
#include "nsComPtr.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
#ifndef OJI_DISABLE
|
||||
#include "nsJVMManager.h"
|
||||
|
||||
@@ -58,7 +58,7 @@ jobject PlugletStreamInfo::GetJObject(const nsIPluginStreamInfo *streamInfo) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
res = env->NewObject(clazz,initMID,*(jlong*)(void*)&streamInfo);
|
||||
res = env->NewObject(clazz,initMID,(jlong)streamInfo);
|
||||
if (env->ExceptionOccurred()) {
|
||||
env->ExceptionDescribe();
|
||||
res = NULL;
|
||||
|
||||
@@ -20,24 +20,15 @@
|
||||
*/
|
||||
#ifndef __PlugletView_h__
|
||||
#define __PlugletView_h__
|
||||
#include <windows.h>
|
||||
#include "nsplugindefs.h"
|
||||
#include "jni.h"
|
||||
|
||||
class PlugletView {
|
||||
public:
|
||||
PlugletView(void);
|
||||
jobject GetJObject(void);
|
||||
BOOLEAN SetWindow(nsPluginWindow* window);
|
||||
private:
|
||||
static void Initialize(void);
|
||||
static jclass clazz;
|
||||
static jmethodID initMID;
|
||||
HWND hWND;
|
||||
BOOL isCreated;
|
||||
jobject frame;
|
||||
virtual jobject GetJObject(void) = 0;
|
||||
virtual PRBool SetWindow(nsPluginWindow* window) = 0;
|
||||
};
|
||||
#endif /* __PlugletInstanceView_h__ */
|
||||
#endif /* __PlugletView_h__ */
|
||||
|
||||
|
||||
|
||||
|
||||
33
mozilla/java/plugins/src/PlugletViewFactory.cpp
Normal file
33
mozilla/java/plugins/src/PlugletViewFactory.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* 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 "PlugletViewFactory.h"
|
||||
#ifdef XP_PC
|
||||
#include "PlugletViewWindows.h"
|
||||
#define VIEW PlugletViewWindows
|
||||
#else /* XP_PC */
|
||||
#include "PlugletViewMotif.h"
|
||||
#define VIEW PlugletViewMotif
|
||||
#endif /* XP_PC */
|
||||
|
||||
PlugletView * PlugletViewFactory::GetPlugletView(void) {
|
||||
return new VIEW();
|
||||
}
|
||||
30
mozilla/java/plugins/src/PlugletViewFactory.h
Normal file
30
mozilla/java/plugins/src/PlugletViewFactory.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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):
|
||||
*/
|
||||
#ifndef __PlugletViewFactory_h__
|
||||
#define __PlugletViewFactory_h__
|
||||
#include "PlugletView.h"
|
||||
|
||||
class PlugletViewFactory {
|
||||
public:
|
||||
static PlugletView * GetPlugletView(void);
|
||||
};
|
||||
|
||||
#endif /* __PlugletViewFactory_h__ */
|
||||
166
mozilla/java/plugins/src/PlugletViewMotif.cpp
Normal file
166
mozilla/java/plugins/src/PlugletViewMotif.cpp
Normal file
@@ -0,0 +1,166 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
* 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 <X11/Xlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <X11/Shell.h>
|
||||
#include <Xm/VendorS.h>
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/PushB.h>
|
||||
#include <Xm/DrawingA.h>
|
||||
|
||||
#include <gdk/gdkx.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "PlugletViewMotif.h"
|
||||
#include "PlugletEngine.h"
|
||||
|
||||
|
||||
jclass PlugletViewMotif::clazz = NULL;
|
||||
jmethodID PlugletViewMotif::initMID = NULL;
|
||||
|
||||
PlugletViewMotif::PlugletViewMotif() {
|
||||
frame = NULL;
|
||||
WindowID = 0;
|
||||
}
|
||||
void PlugletViewMotif::Initialize() {
|
||||
JNIEnv *env = PlugletEngine::GetJNIEnv();
|
||||
clazz = env->FindClass("sun/awt/motif/MEmbeddedFrame");
|
||||
if (!clazz) {
|
||||
env->ExceptionDescribe();
|
||||
return;
|
||||
}
|
||||
initMID = env->GetMethodID(clazz, "<init>", "(J)V");
|
||||
if (!initMID) {
|
||||
env->ExceptionDescribe();
|
||||
clazz = NULL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#define AWT_LOCK() (env)->MonitorEnter(awt_lock)
|
||||
|
||||
#define AWT_UNLOCK() (env)->MonitorExit(awt_lock)
|
||||
|
||||
|
||||
|
||||
extern jobject awt_lock;
|
||||
extern Display *awt_display;
|
||||
|
||||
PRBool PlugletViewMotif::SetWindow(nsPluginWindow* win) {
|
||||
printf("--PlugletViewMotif::SetWindow \n");
|
||||
JNIEnv *env = PlugletEngine::GetJNIEnv();
|
||||
if(!clazz) {
|
||||
Initialize();
|
||||
if(!clazz) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
}
|
||||
if (!win
|
||||
|| !win->window) {
|
||||
if (win && !win->window) {
|
||||
printf("--PlugletViewMotif win->window = NULL. We have a bug in plugin module \n");
|
||||
}
|
||||
if (frame) {
|
||||
env->DeleteGlobalRef(frame);
|
||||
if (env->ExceptionOccurred()) {
|
||||
env->ExceptionDescribe();
|
||||
}
|
||||
frame = NULL;
|
||||
return PR_TRUE;
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
GtkWidget * containerWidget = (GtkWidget *) win->window;
|
||||
Window parentWindowID;
|
||||
Window rootWindowID;
|
||||
Window * childrenWindowIDs;
|
||||
unsigned int numberOfChildren;
|
||||
int containerWindowID = GDK_WINDOW_XWINDOW(containerWidget->window);
|
||||
Status status = XQueryTree(GDK_DISPLAY(), containerWindowID,
|
||||
&rootWindowID, &parentWindowID,
|
||||
&childrenWindowIDs, & numberOfChildren);
|
||||
if (numberOfChildren >= 1) {
|
||||
containerWindowID = childrenWindowIDs[0];
|
||||
}
|
||||
if (WindowID == containerWindowID) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
WindowID = containerWindowID;
|
||||
AWT_LOCK();
|
||||
XSync(awt_display, FALSE);
|
||||
Arg args[40];
|
||||
int argc = 0;
|
||||
XtSetArg(args[argc], XmNsaveUnder, False); argc++;
|
||||
XtSetArg(args[argc], XmNallowShellResize, False); argc++;
|
||||
XtSetArg(args[argc], XmNwidth, win->width); argc++;
|
||||
XtSetArg(args[argc], XmNheight, win->height); argc++;
|
||||
XtSetArg(args[argc], XmNx, 0); argc++;
|
||||
XtSetArg(args[argc], XmNy, 0); argc++;
|
||||
XtSetArg(args[argc],XmNmappedWhenManaged,False); argc++;
|
||||
Widget w = XtAppCreateShell("AWTapp", "XApplication",
|
||||
vendorShellWidgetClass,
|
||||
awt_display,
|
||||
args, argc);
|
||||
XtRealizeWidget(w);
|
||||
XFlush(awt_display);
|
||||
XSync(awt_display, True);
|
||||
Window child, parent;
|
||||
parent = (Window) containerWindowID;
|
||||
child = XtWindow(w);
|
||||
XReparentWindow(awt_display, child, parent, 0, 0);
|
||||
XFlush(awt_display);
|
||||
XSync(awt_display, True);
|
||||
|
||||
if (frame) {
|
||||
env->DeleteGlobalRef(frame);
|
||||
if (env->ExceptionOccurred()) {
|
||||
env->ExceptionDescribe();
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
}
|
||||
printf("--before new frame\n");
|
||||
frame = env->NewObject(clazz,initMID,(jlong)w);
|
||||
printf("--after new frame\n");
|
||||
if(frame) {
|
||||
frame = env->NewGlobalRef(frame);
|
||||
if (env->ExceptionOccurred()) {
|
||||
env->ExceptionDescribe();
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
}
|
||||
AWT_UNLOCK();
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
jobject PlugletViewMotif::GetJObject() {
|
||||
return frame;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
49
mozilla/java/plugins/src/PlugletViewMotif.h
Normal file
49
mozilla/java/plugins/src/PlugletViewMotif.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* 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):
|
||||
*/
|
||||
#ifndef __PlugletViewMotif_h__
|
||||
#define __PlugletViewMotif_h__
|
||||
#include "nsplugindefs.h"
|
||||
#include "jni.h"
|
||||
#include "PlugletView.h"
|
||||
|
||||
class PlugletViewMotif : public PlugletView {
|
||||
public:
|
||||
PlugletViewMotif(void);
|
||||
virtual jobject GetJObject(void);
|
||||
virtual PRBool SetWindow(nsPluginWindow* window);
|
||||
private:
|
||||
static void Initialize(void);
|
||||
static jclass clazz;
|
||||
static jmethodID initMID;
|
||||
int WindowID;
|
||||
jobject frame;
|
||||
};
|
||||
#endif /* __PlugletViewMotif_h__ */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -19,19 +19,19 @@
|
||||
* Contributor(s):
|
||||
*/
|
||||
#include <windows.h>
|
||||
#include "PlugletView.h"
|
||||
#include "PlugletViewWindows.h"
|
||||
#include "PlugletEngine.h"
|
||||
|
||||
|
||||
jclass PlugletView::clazz = NULL;
|
||||
jmethodID PlugletView::initMID = NULL;
|
||||
jclass PlugletViewWindows::clazz = NULL;
|
||||
jmethodID PlugletViewWindows::initMID = NULL;
|
||||
|
||||
PlugletView::PlugletView() {
|
||||
PlugletViewWindows::PlugletViewWindows() {
|
||||
hWND = NULL;
|
||||
frame = NULL;
|
||||
isCreated = FALSE;
|
||||
}
|
||||
void PlugletView::Initialize() {
|
||||
void PlugletViewWindows::Initialize() {
|
||||
JNIEnv *env = PlugletEngine::GetJNIEnv();
|
||||
clazz = env->FindClass("sun/awt/windows/WEmbeddedFrame");
|
||||
if (!clazz) {
|
||||
@@ -46,7 +46,7 @@ void PlugletView::Initialize() {
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN PlugletView::SetWindow(nsPluginWindow* window) {
|
||||
PRBool PlugletViewWindows::SetWindow(nsPluginWindow* window) {
|
||||
if (!window || !window->window) {
|
||||
if (isCreated) {
|
||||
isCreated = FALSE;
|
||||
@@ -56,7 +56,7 @@ BOOLEAN PlugletView::SetWindow(nsPluginWindow* window) {
|
||||
}
|
||||
}
|
||||
if (hWND == reinterpret_cast<HWND>(window->window) && isCreated) {
|
||||
return FALSE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
DWORD dwStyle = ::GetWindowLong(reinterpret_cast<HWND>(window->window), GWL_STYLE);
|
||||
@@ -65,7 +65,7 @@ BOOLEAN PlugletView::SetWindow(nsPluginWindow* window) {
|
||||
if(!clazz) {
|
||||
Initialize();
|
||||
if (!clazz) {
|
||||
return FALSE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
}
|
||||
JNIEnv *env = PlugletEngine::GetJNIEnv();
|
||||
@@ -75,10 +75,10 @@ BOOLEAN PlugletView::SetWindow(nsPluginWindow* window) {
|
||||
}
|
||||
hWND = (HWND) window->window;
|
||||
isCreated = TRUE;
|
||||
return TRUE;
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
jobject PlugletView::GetJObject() {
|
||||
jobject PlugletViewWindows::GetJObject() {
|
||||
return frame;
|
||||
}
|
||||
|
||||
51
mozilla/java/plugins/src/PlugletViewWindows.h
Normal file
51
mozilla/java/plugins/src/PlugletViewWindows.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* 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):
|
||||
*/
|
||||
#ifndef __PlugletViewWindows_h__
|
||||
#define __PlugletViewWindows_h__
|
||||
#include <windows.h>
|
||||
#include "nsplugindefs.h"
|
||||
#include "jni.h"
|
||||
#include "PlugletView.h"
|
||||
|
||||
class PlugletViewWindows : public PlugletView {
|
||||
public:
|
||||
PlugletViewWindows(void);
|
||||
virtual jobject GetJObject(void);
|
||||
virtual PRBool SetWindow(nsPluginWindow* window);
|
||||
private:
|
||||
static void Initialize(void);
|
||||
static jclass clazz;
|
||||
static jmethodID initMID;
|
||||
HWND hWND;
|
||||
BOOL isCreated;
|
||||
jobject frame;
|
||||
};
|
||||
#endif /* __PlugletViewWindows_h__ */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -50,7 +50,8 @@ OBJS = \
|
||||
.\$(OBJDIR)\PlugletPeer.obj \
|
||||
.\$(OBJDIR)\PlugletManager.obj \
|
||||
.\$(OBJDIR)\PlugletInputStream.obj \
|
||||
.\$(OBJDIR)\PlugletView.obj \
|
||||
.\$(OBJDIR)\PlugletViewFactory.obj \
|
||||
.\$(OBJDIR)\PlugletViewWindows.obj \
|
||||
!ifndef OJI_DISABLE
|
||||
.\$(OBJDIR)\PlugletSecurityContext.obj \
|
||||
!endif
|
||||
|
||||
Reference in New Issue
Block a user