From 25d27834af94c13e8c4e6b4cf369cdfc3ec8a687 Mon Sep 17 00:00:00 2001 From: "ashuk%eng.sun.com" Date: Thu, 29 Jun 2000 23:59:12 +0000 Subject: [PATCH] The current webclient only works with M13, and the old webclient, in classes and src, works with pre M13. This change removes the old webclient. git-svn-id: svn://10.0.0.236/trunk@73561 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/java/webclient/Makefile.win | 6 - mozilla/java/webclient/classes/Makefile.in | 66 - mozilla/java/webclient/classes/Makefile.unix | 24 - mozilla/java/webclient/classes/Makefile.win | 64 - .../org/mozilla/webclient/BrowserControl.java | 48 - .../webclient/BrowserControlCanvas.java | 254 --- .../mozilla/webclient/BrowserControlCore.java | 72 - .../webclient/BrowserControlExtended.java | 68 - .../webclient/BrowserControlFactory.java | 218 --- .../mozilla/webclient/BrowserControlImpl.java | 290 --- .../webclient/BrowserControlNativeShim.java | 430 ----- .../org/mozilla/webclient/DocListener.java | 7 - .../webclient/DocumentLoadListener.java | 7 - .../mozilla/webclient/EventRegistration.java | 8 - .../motif/MotifBrowserControlCanvas.java | 142 -- .../webclient/motif/NativeEventThread.java | 98 - .../webclient/test/EmbeddedMozilla.java | 218 --- .../webclient/test/swing/BackAction.java | 22 - .../webclient/test/swing/CommandPanel.java | 93 - .../webclient/test/swing/ForwardAction.java | 22 - .../webclient/test/swing/RefreshAction.java | 22 - .../webclient/test/swing/StatusTextField.java | 32 - .../webclient/test/swing/StopAction.java | 22 - .../test/swing/SwingEmbeddedMozilla.java | 251 --- .../win32/Win32BrowserControlCanvas.java | 73 - .../src/BrowserControlNativeShim.cpp | 1660 ----------------- .../java/webclient/src/DocumentObserver.cpp | 144 -- mozilla/java/webclient/src/DocumentObserver.h | 92 - mozilla/java/webclient/src/Makefile.in | 101 - mozilla/java/webclient/src/Makefile.solaris | 83 - mozilla/java/webclient/src/Makefile.unix | 72 - mozilla/java/webclient/src/Makefile.win | 90 - mozilla/java/webclient/src/jni_util.c | 107 -- mozilla/java/webclient/src/jni_util.h | 48 - .../motif/BrowserControlNativeShimStub.cpp | 578 ------ .../src/motif/BrowserControlNativeShimStub.h | 43 - mozilla/java/webclient/src/motif/Makefile.in | 103 - .../src/motif/MotifBrowserControlCanvas.cpp | 169 -- .../motif/MotifBrowserControlCanvasStub.cpp | 147 -- .../java/webclient/src/motif/gtkmozilla.cpp | 131 -- mozilla/java/webclient/src/motif/gtkmozilla.h | 64 - mozilla/java/webclient/src/nsActions.cpp | 664 ------- mozilla/java/webclient/src/nsActions.h | 263 --- mozilla/java/webclient/src/runem.solaris | 39 - mozilla/java/webclient/src/runem.unix | 37 - 45 files changed, 7192 deletions(-) delete mode 100644 mozilla/java/webclient/classes/Makefile.in delete mode 100644 mozilla/java/webclient/classes/Makefile.unix delete mode 100644 mozilla/java/webclient/classes/Makefile.win delete mode 100644 mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControl.java delete mode 100644 mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlCanvas.java delete mode 100644 mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlCore.java delete mode 100644 mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlExtended.java delete mode 100644 mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlFactory.java delete mode 100644 mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlImpl.java delete mode 100644 mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlNativeShim.java delete mode 100644 mozilla/java/webclient/classes/org/mozilla/webclient/DocListener.java delete mode 100644 mozilla/java/webclient/classes/org/mozilla/webclient/DocumentLoadListener.java delete mode 100644 mozilla/java/webclient/classes/org/mozilla/webclient/EventRegistration.java delete mode 100644 mozilla/java/webclient/classes/org/mozilla/webclient/motif/MotifBrowserControlCanvas.java delete mode 100644 mozilla/java/webclient/classes/org/mozilla/webclient/motif/NativeEventThread.java delete mode 100644 mozilla/java/webclient/classes/org/mozilla/webclient/test/EmbeddedMozilla.java delete mode 100644 mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/BackAction.java delete mode 100644 mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/CommandPanel.java delete mode 100644 mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/ForwardAction.java delete mode 100644 mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/RefreshAction.java delete mode 100644 mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/StatusTextField.java delete mode 100644 mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/StopAction.java delete mode 100644 mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/SwingEmbeddedMozilla.java delete mode 100644 mozilla/java/webclient/classes/org/mozilla/webclient/win32/Win32BrowserControlCanvas.java delete mode 100644 mozilla/java/webclient/src/BrowserControlNativeShim.cpp delete mode 100644 mozilla/java/webclient/src/DocumentObserver.cpp delete mode 100644 mozilla/java/webclient/src/DocumentObserver.h delete mode 100644 mozilla/java/webclient/src/Makefile.in delete mode 100644 mozilla/java/webclient/src/Makefile.solaris delete mode 100644 mozilla/java/webclient/src/Makefile.unix delete mode 100644 mozilla/java/webclient/src/Makefile.win delete mode 100644 mozilla/java/webclient/src/jni_util.c delete mode 100644 mozilla/java/webclient/src/jni_util.h delete mode 100644 mozilla/java/webclient/src/motif/BrowserControlNativeShimStub.cpp delete mode 100644 mozilla/java/webclient/src/motif/BrowserControlNativeShimStub.h delete mode 100644 mozilla/java/webclient/src/motif/Makefile.in delete mode 100644 mozilla/java/webclient/src/motif/MotifBrowserControlCanvas.cpp delete mode 100644 mozilla/java/webclient/src/motif/MotifBrowserControlCanvasStub.cpp delete mode 100644 mozilla/java/webclient/src/motif/gtkmozilla.cpp delete mode 100644 mozilla/java/webclient/src/motif/gtkmozilla.h delete mode 100644 mozilla/java/webclient/src/nsActions.cpp delete mode 100644 mozilla/java/webclient/src/nsActions.h delete mode 100755 mozilla/java/webclient/src/runem.solaris delete mode 100755 mozilla/java/webclient/src/runem.unix diff --git a/mozilla/java/webclient/Makefile.win b/mozilla/java/webclient/Makefile.win index 14555b46627..de510f4ac1b 100644 --- a/mozilla/java/webclient/Makefile.win +++ b/mozilla/java/webclient/Makefile.win @@ -35,15 +35,9 @@ IGNORE_MANIFEST=1 #//------------------------------------------------------------------------ DEPTH = ..\.. -!if defined(WEBCLIENT_PRE_SPEC) -DIRS = classes \ - src \ - $(NULL) -!else DIRS = classes_spec \ src_moz \ $(NULL) -!endif !if defined(BAL_INTERFACE) DIRS = classes_spec \ diff --git a/mozilla/java/webclient/classes/Makefile.in b/mozilla/java/webclient/classes/Makefile.in deleted file mode 100644 index cbdb8bc16d4..00000000000 --- a/mozilla/java/webclient/classes/Makefile.in +++ /dev/null @@ -1,66 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. - - - -DEPTH = ../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = java-util - -JMODS = org/mozilla/webclient org/mozilla/webclient/test org/mozilla/webclient/motif - -# -# JDIRS is dependant on JAVA_DESTPATH in config/rules.m[a]k. -# Be sure to touch that directory if you add a new directory to -# JDIRS, or else it will not build. FIXME -# -JDIRS = $(JMODS) - -JAR_JSJ = jsj10.jar -JAR_JSJ_CLASSES = $(JMODS) - -# -# jars to build at install time -# -JARS = $(JAR_JSJ) - -JAVA_OR_NSJVM = 1 - -include $(topsrcdir)/config/rules.mk - -JAVA_SOURCEPATH = $(topsrcdir)/java/webclient/classes - -doc:: - $(JAVADOC) -d $(DIST)/doc org.mozilla.util - -natives_list:: FORCE - rm -rf $@ - find . -name "*.class" -print | sed 's@\./\(.*\)\.class$$@\1@' | \ - sed 's@/@.@g' | xargs $(JVH) -natives | sort > $@ - -check_natives:: natives_list - rm -f found_natives - nm -B ../$(OBJDIR)/*.o \ - | egrep "Java.*_stub" | awk '{ print $$3; }' | sort > found_natives - diff found_natives natives_list - -FORCE: diff --git a/mozilla/java/webclient/classes/Makefile.unix b/mozilla/java/webclient/classes/Makefile.unix deleted file mode 100644 index 2ee167b6379..00000000000 --- a/mozilla/java/webclient/classes/Makefile.unix +++ /dev/null @@ -1,24 +0,0 @@ -# PENDING(mark): I need to make this makefile a little smarter. Right now -# it javac's all the java files each time you do a 'make' -# -# If you're using JDK 1.2 -JDK_LOCATION = ${JDKHOME} -JAVAC = ${JDK_LOCATION}/bin/javac -JAVAH = ${JDK_LOCATION}/bin/javah -OUTPUT_DIR = ../../../dist/classes -# If you're using JDK 1.2 -CLASSES = ${OUTPUT_DIR}:${JDK_LOCATION}/lib/tools.jar:${JDK_LOCATION}/lib/rt.jar -JAVA_FILES = ./org/mozilla/webclient/*.java ./org/mozilla/webclient/motif/*.java ./org/mozilla/webclient/test/*.java -JAVAH_OUTPUT_DIR = ../src -CP = cp -MKDIR = mkdir -p - -all: - ${MKDIR} ${OUTPUT_DIR} - ${JAVAC} -g -classpath ${CLASSES} -d ${OUTPUT_DIR} ${JAVA_FILES} - ${JAVAH} -jni -classpath ${CLASSES} \ - -o ${JAVAH_OUTPUT_DIR}/motif/MotifBrowserControlCanvas.h org.mozilla.webclient.motif.MotifBrowserControlCanvas - ${JAVAH} -jni -classpath ${CLASSES} \ - -o ${JAVAH_OUTPUT_DIR}/motif/NativeEventThread.h org.mozilla.webclient.motif.NativeEventThread - ${JAVAH} -jni -classpath ${CLASSES} \ - -o ${JAVAH_OUTPUT_DIR}/BrowserControlNativeShim.h org.mozilla.webclient.BrowserControlNativeShim diff --git a/mozilla/java/webclient/classes/Makefile.win b/mozilla/java/webclient/classes/Makefile.win deleted file mode 100644 index 9b0e284a4b2..00000000000 --- a/mozilla/java/webclient/classes/Makefile.win +++ /dev/null @@ -1,64 +0,0 @@ -#!nmake -# -# 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): - -IGNORE_MANIFEST=1 -#//------------------------------------------------------------------------ -#// -#// Makefile to build the java portion of the java wrapper to mozilla -#// -#//------------------------------------------------------------------------ - - -#//------------------------------------------------------------------------ -#// -#// Specify the depth of the current directory relative to the -#// root of NS -#// -#//------------------------------------------------------------------------ -DEPTH= ..\..\.. - -# PENDING(edburns): find out where this should really get defined -JAVA_OR_NSJVM=1 -NO_CAFE=1 - -include <$(DEPTH)\config\config.mak> - -# for compatibility -include <$(DEPTH)\java\config\localdefs.mak> - -JAR_WEBCLIENT_CLASSES = org\mozilla\webclient \ - org\mozilla\webclient\test org\mozilla\webclient\win32 org\mozilla\webclient\test\swing - -!ifdef JAVA_OR_NSJVM -JDIRS = $(JAR_WEBCLIENT_CLASSES) -!endif - -WEBCLIENT_JAR_NAME=webclient(VERSION_NUMBER).jar - -JAVAC_PROG=$(JDKHOME)\bin\javac - -export:: - @echo +++ Checking that org.mozilla.util classes have been built... - if not exist $(MOZ_SRC)\mozilla\dist\classes\org\mozilla\util\Assert.class \ - stopbuild.exe - -include <$(DEPTH)\config\rules.mak> - diff --git a/mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControl.java b/mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControl.java deleted file mode 100644 index af3f3ed91bd..00000000000 --- a/mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControl.java +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- 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 RaptorCanvas. - * - * The Initial Developer of the Original Code is Kirk Baker and - * Ian Wilkinson. Portions created by Kirk Baker and Ian Wilkinson are - * Copyright (C) 1999 Kirk Baker and Ian Wilkinson. All - * Rights Reserved. - * - * Contributor(s): Kirk Baker - * Ian Wilkinson - * Ann Sunhachawee - */ - -package org.mozilla.webclient; - -// BrowserControl.java - -/** - * - - * BrowserControl simply declares the composition of the core and extended - * interfaces. - - * - * @version $Id: BrowserControl.java,v 1.3 1999-11-06 02:24:16 dmose%mozilla.org Exp $ - * - * @see org.mozilla.webclient.BrowserControlCore - * @see org.mozilla.webclient.BrowserControlExtended - * - */ - -public interface BrowserControl extends BrowserControlCore, BrowserControlExtended -{ - -public EventRegistration getEventRegistration(); - -} // end of interface BrowserControl diff --git a/mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlCanvas.java b/mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlCanvas.java deleted file mode 100644 index c82b02e691c..00000000000 --- a/mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlCanvas.java +++ /dev/null @@ -1,254 +0,0 @@ -/* -*- 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 RaptorCanvas. - * - * The Initial Developer of the Original Code is Kirk Baker and - * Ian Wilkinson. Portions created by Kirk Baker and Ian Wilkinson are - * Copyright (C) 1999 Kirk Baker and Ian Wilkinson. All - * Rights Reserved. - * - * Contributor(s): Kirk Baker - * Ian Wilkinson - * Mark Lin - * Ed Burns - */ - -package org.mozilla.webclient; - -// BrowserControlCanvas.java - -import org.mozilla.util.Assert; -import org.mozilla.util.Log; -import org.mozilla.util.ParameterCheck; - -import java.awt.*; - -/** - * - * BrowserControlCanvas is the principal class for embedding - * the Mozilla WebShell into the Java framework. - * This component represents the proxy for the native - * WebShell class as provided by the nsIWebShell - * interface. - * - * @see org.mozilla.webclient.BrowserControl - * - * @author Kirk Baker - * @author Ian Wilkinson - - *

- - * Lifetime And Scope

- - * See concrete subclasses for scope info. - - * @version $Id: BrowserControlCanvas.java,v 1.6 1999-12-06 23:42:13 edburns%acm.org Exp $ - - * @see org.mozilla.webclient.win32.Win32BrowserControlCanvas - - * @see org.mozilla.webclient.motif.MotifBrowserControlCanvas - - */ - -import java.awt.*; -import java.awt.Canvas; -import java.awt.event.*; -import sun.awt.*; - -public abstract class BrowserControlCanvas extends Canvas -{ - -// -// Class Variables -// - -private static int webShellCount = 0; - -// -// Instance Variables -// - -// Attribute Instance Variables - -private boolean initializeOK; -private boolean boundsValid; -private boolean hasFocus; - -// Relationship Instance Variables - - -private BrowserControl webShell; -private int nativeWindow; -private Rectangle windowRelativeBounds; - -// PENDING(edburns): Is this needed: // private BrowserControlIdleThread idleThread; - -// -// Constructors and Initializers -// - -/** - - * just initialize all the ivars. the initialize() method must be called - * before an instance of this class can be used. Instances are created - * in BrowserControlFactory.newBrowserControl(). - - */ -protected BrowserControlCanvas () -{ - nativeWindow = 0; - webShell = null; - initializeOK = false; - boundsValid = false; - hasFocus = false; - -} // BrowserControlCanvas() ctor - -protected void initialize(BrowserControl controlImpl) -{ - ParameterCheck.nonNull(controlImpl); - webShell = controlImpl; -} - -/** - * Obtain the native window handle for this component's - * peer. - */ - -abstract protected int getWindow(DrawingSurfaceInfo dsi); - -// -// Methods from Canvas -// - - -/** - * Instantiate the Mozilla WebShell container. - */ -public void addNotify () -{ - super.addNotify(); - - DrawingSurface ds = (DrawingSurface)this.getPeer(); - DrawingSurfaceInfo dsi = ds.getDrawingSurfaceInfo(); - - windowRelativeBounds = new Rectangle(); - - // We must lock() the DrawingSurfaceInfo before - // accessing its native window handle. - dsi.lock(); - nativeWindow = getWindow(dsi); - - try { - Rectangle r = new Rectangle(getBoundsRelativeToWindow()); - Assert.assert(null != webShell); - webShell.createWindow(nativeWindow, r); - } catch (Exception e) { - dsi.unlock(); - System.out.println(e.toString()); - return; - } - - dsi.unlock(); - - initializeOK = true; - webShellCount++; - - /* - requestFocus(); - */ -} // addNotify() - -public BrowserControl getWebShell () -{ - return webShell; -} // getWebShell() - -protected Point getEventCoordsLocalToWindow(MouseEvent evt) -{ - Rectangle localBounds = getBoundsRelativeToWindow(); - int windowLocalX = evt.getX() + localBounds.x; - int windowLocalY = evt.getY() + localBounds.y; - - return new Point(windowLocalX, windowLocalY); -} // getEventCoordsLocalToWindow() - -protected Rectangle getWindowBounds () -{// Throw an Exception? - Container parent = getParent(); - - if (parent != null) { - do { - // if the parent is a window, then return its bounds - if (parent instanceof Window == true) { - return parent.getBounds(); - } - parent = parent.getParent(); - } while (parent != null); - } - - return new Rectangle(); -} // getWindowBounds() - -protected Rectangle getBoundsRelativeToWindow () -{ - if (boundsValid) { - return windowRelativeBounds; - } - - Container parent = getParent(); - Point ourLoc = getLocation(); - Rectangle ourBounds = getBounds(); - - if (parent != null) { - do { - // if the parent is a window, then don't adjust to its offset - // and look no further - if (parent instanceof Window == true) { - break; - } - - Point parentLoc = parent.getLocation(); - ourLoc.translate(-parentLoc.x, -parentLoc.y); - parent = parent.getParent(); - } while (parent != null); - } - - windowRelativeBounds.setBounds(-ourLoc.x, -ourLoc.y, ourBounds.width, ourBounds.height); - boundsValid = true; - - return windowRelativeBounds; -} // getBoundsRelativeToWindow() - -public void setBounds(int x, int y, int w, int h) -{ - super.setBounds(x, y, w, h); - if (webShell != null) { - System.out.println("in BrowserControlCanvas setBounds: x = " + x + " y = " + y + " w = " + w + " h = " + h); - try { - webShell.setBounds(new Rectangle(0, 0, w - 1, h - 1)); - } - catch(Exception ex) { - } - } -} - -public void setBounds(Rectangle rect) -{ - super.setBounds(rect); -} - -} // class BrowserControlCanvas - - -// EOF diff --git a/mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlCore.java b/mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlCore.java deleted file mode 100644 index ae8da45c5d8..00000000000 --- a/mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlCore.java +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- 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 RaptorCanvas. - * - * The Initial Developer of the Original Code is Kirk Baker and - * Ian Wilkinson. Portions created by Kirk Baker and Ian Wilkinson are - * Copyright (C) 1999 Kirk Baker and Ian Wilkinson. All - * Rights Reserved. - * - * Contributor(s): Kirk Baker - * Ian Wilkinson - * Mark Goddard - * Ed Burns - */ - -package org.mozilla.webclient; - -// BrowserControlCore.java - -import java.awt.Canvas; -import java.awt.Rectangle; - -/** - * - * BrowserControlCore Defines the core methods for browsing - * - - * @version $Id: BrowserControlCore.java,v 1.4 1999-12-03 01:55:28 edburns%acm.org Exp $ - * - - * @see org.mozilla.webclient.BrowserControlExtended - * @see org.mozilla.webclient.BrowserControl - * - */ - -public interface BrowserControlCore -{ - -public void loadURL(String urlString) throws Exception; - -public void stop() throws Exception; - -public boolean canBack() throws Exception; - -public boolean canForward() throws Exception; - -public boolean back() throws Exception; - -public boolean forward() throws Exception; - -// added by Mark Goddard OTMP 9/2/1999 -public boolean refresh() throws Exception; - -public int getNativeWebShell(); - -public void createWindow(int windowPtr, Rectangle bounds) throws Exception; - -public Canvas getCanvas(); - -} // end of interface BrowserControlCore - - diff --git a/mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlExtended.java b/mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlExtended.java deleted file mode 100644 index 07f4ac16509..00000000000 --- a/mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlExtended.java +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- 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 RaptorCanvas. - * - * The Initial Developer of the Original Code is Kirk Baker and - * Ian Wilkinson. Portions created by Kirk Baker and Ian Wilkinson are - * Copyright (C) 1999 Kirk Baker and Ian Wilkinson. All - * Rights Reserved. - * - * Contributor(s): Kirk Baker - * Ian Wilkinson - */ - -package org.mozilla.webclient; - -// BrowserControlExtended.java - -import java.awt.Rectangle; - -/** - * - - * BrowserControlExtended defines the interface for extended browser - * functionality - - * - * @version $Id: BrowserControlExtended.java,v 1.2 1999-11-06 02:24:17 dmose%mozilla.org Exp $ - * - * @see org.mozilla.webclient.BrowserControlCore - - * */ - -public interface BrowserControlExtended -{ - -public void show () throws Exception; - -public void hide () throws Exception; - -public void setBounds (Rectangle bounds) throws Exception; - -public void moveTo (int x, int y) throws Exception; - -public void setFocus () throws Exception; - -public void removeFocus () throws Exception; - -public void repaint (boolean forceRepaint) throws Exception; - -public boolean goTo (int historyIndex) throws Exception; - -public int getHistoryLength () throws Exception; - -public int getHistoryIndex () throws Exception; - -public String getURL (int historyIndex) throws Exception; - -} // end of interface BrowserControlExtended diff --git a/mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlFactory.java b/mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlFactory.java deleted file mode 100644 index fa5c0cecd36..00000000000 --- a/mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlFactory.java +++ /dev/null @@ -1,218 +0,0 @@ -/* -*- 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 RaptorCanvas. - * - * The Initial Developer of the Original Code is Kirk Baker and - * Ian Wilkinson. Portions created by Kirk Baker and Ian Wilkinson are - * Copyright (C) 1999 Kirk Baker and Ian Wilkinson. All - * Rights Reserved. - * - * Contributor(s): Kirk Baker - * Ian Wilkinson - * Mark Lin - * Ed Burns - */ - -package org.mozilla.webclient; - -// BrowserControlFactory.java - -import org.mozilla.util.Assert; -import org.mozilla.util.Log; -import org.mozilla.util.ParameterCheck; - -import java.io.File; -import java.io.FileNotFoundException; - -/** - * - * BrowserControlFactory creates concrete instances of BrowserControl - - * Lifetime And Scope

- - * This is a static class, it is neven instantiated. - - * - * @version $Id: BrowserControlFactory.java,v 1.3 1999-12-23 04:09:27 edburns%acm.org Exp $ - * - * @see org.mozilla.webclient.test.EmbeddedMozilla - - */ - -public class BrowserControlFactory extends Object -{ -// -// Protected Constants -// - -// -// Class Variables -// - - private static boolean appDataHasBeenSet = false; - private static Class browserControlCanvasClass = null; - private static String platformCanvasClassName = null; - -// -// Instance Variables -// - -// Attribute Instance Variables - -// Relationship Instance Variables - -// -// Constructors and Initializers -// - -public BrowserControlFactory() -{ - Assert.assert(false, "This class shouldn't be constructed."); -} - -// -// Class methods -// - - /** - - * This method is used to set per-application instance data, such as - * the location of the browser binary. - - * @param absolutePathToNativeBrowserBinDir the path to the bin dir - * of the native browser, including the bin. ie: - * "D:\Projects\mozilla\dist\win32_d.obj\bin" - - */ - -public static void setAppData(String absolutePathToNativeBrowserBinDir) throws FileNotFoundException, ClassNotFoundException -{ - if (!appDataHasBeenSet) { - ParameterCheck.nonNull(absolutePathToNativeBrowserBinDir); - - // verify that the directory exists: - File binDir = new File(absolutePathToNativeBrowserBinDir); - if (!binDir.exists()) { - throw new FileNotFoundException("Directory " + absolutePathToNativeBrowserBinDir + " is not found."); - } - - // cause the native library to be loaded - // PENDING(edburns): do some magic to determine the right kind of - // MozWebShellCanvas to instantiate - - // How about this: - // I try loading sun.awt.windows.WDrawingSurfaceInfo. If it doesn't - // load, then I try loading sun.awt.motif.MDrawingSufaceInfo. If - // none loads, then I return a error message. - // If you think up of a better way, let me know. - // -- Mark - - Class win32DrawingSurfaceInfoClass; - - try { - win32DrawingSurfaceInfoClass = - Class.forName("sun.awt.windows.WDrawingSurfaceInfo"); - } - catch (Exception e) { - win32DrawingSurfaceInfoClass = null; - } - - if (win32DrawingSurfaceInfoClass != null) { - platformCanvasClassName = "org.mozilla.webclient.win32.Win32BrowserControlCanvas"; - } - - if (null == platformCanvasClassName) { - Class motifDrawingSurfaceInfoClass; - try { - motifDrawingSurfaceInfoClass = - Class.forName("sun.awt.motif.MDrawingSurfaceInfo"); - } - catch (Exception e) { - motifDrawingSurfaceInfoClass = null; - } - - if (motifDrawingSurfaceInfoClass != null) { - platformCanvasClassName = "org.mozilla.webclient.motif.MotifBrowserControlCanvas"; - } - } - if (platformCanvasClassName != null) { - browserControlCanvasClass = Class.forName(platformCanvasClassName); - } - else { - throw new ClassNotFoundException("Could not determine WebShellCanvas class to load\n"); - } - - try { - BrowserControlNativeShim.initialize(absolutePathToNativeBrowserBinDir); - } - catch (Exception e) { - throw new ClassNotFoundException("Can't initialize native browser: " + - e.getMessage()); - } - appDataHasBeenSet = true; - } -} - -public static BrowserControl newBrowserControl() throws InstantiationException, IllegalAccessException, IllegalStateException -{ - if (!appDataHasBeenSet) { - throw new IllegalStateException("Can't create BrowserControlCanvasInstance: setAppData() has not been called."); - } - Assert.assert(null != browserControlCanvasClass); - - BrowserControlCanvas newCanvas = null; - BrowserControl result = null; - newCanvas = (BrowserControlCanvas) browserControlCanvasClass.newInstance(); - if (null != newCanvas && - null != (result = new BrowserControlImpl(newCanvas))) { - newCanvas.initialize(result); - } - - return result; -} - -// -// General Methods -// - -// ----UNIT_TEST_START - -// -// Test methods -// - -public static void main(String [] args) -{ - System.out.println("doing asserts"); - Assert.setEnabled(true); - Log.setApplicationName("BrowserControlFactory"); - Log.setApplicationVersion("0.0"); - Log.setApplicationVersionDate("$Id: BrowserControlFactory.java,v 1.3 1999-12-23 04:09:27 edburns%acm.org Exp $"); - - java.awt.Canvas canvas = null; - BrowserControl control = null; - try { - BrowserControlFactory.setAppData(args[0]); - control = BrowserControlFactory.newBrowserControl(); - Assert.assert(control != null); - canvas = control.getCanvas(); - Assert.assert(canvas != null); - } - catch (Exception e) { - System.out.println(e.getMessage()); - } -} - -// ----UNIT_TEST_END - -} // end of class BrowserControlFactory diff --git a/mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlImpl.java b/mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlImpl.java deleted file mode 100644 index 57790fc7d8f..00000000000 --- a/mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlImpl.java +++ /dev/null @@ -1,290 +0,0 @@ -/* -*- 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 RaptorCanvas. - * - * The Initial Developer of the Original Code is Kirk Baker and - * Ian Wilkinson. Portions created by Kirk Baker and Ian Wilkinson are - * Copyright (C) 1999 Kirk Baker and Ian Wilkinson. All - * Rights Reserved. - * - * Contributor(s): Kirk Baker - * Ian Wilkinson - * Mark Goddard - * Ed Burns - * Ann Sunhachawee - */ - -package org.mozilla.webclient; - -// BrowserControlImpl.java - -import org.mozilla.util.Assert; -import org.mozilla.util.Log; -import org.mozilla.util.ParameterCheck; - -import java.awt.Rectangle; -import java.awt.Canvas; - -/** - * - * BrowserControlImpl provides the implementation for BrowserControl - * - * Lifetime And Scope

- * - * @version $Id: BrowserControlImpl.java,v 1.9 2000-02-18 19:32:22 edburns%acm.org Exp $ - * - * @see org.mozilla.webclient.BrowserControl - * - */ - -public class BrowserControlImpl extends Object implements BrowserControl, EventRegistration -{ -// -// Protected Constants -// - -// -// Class Variables -// - -// -// Instance Variables -// - -// Attribute Instance Variables - -// Relationship Instance Variables - - /** - - * a handle to the actual mozilla webShell - - */ - - private int nativeWebShell; - private Canvas myCanvas; - -// -// Constructors and Initializers -// - -protected BrowserControlImpl(Canvas yourCanvas) -{ - ParameterCheck.nonNull(yourCanvas); - myCanvas = yourCanvas; -} - -// -// Class methods -// - -// -// General Methods -// - -// -// Methods from BrowserControl -// - -public void createWindow(int windowPtr, Rectangle bounds) throws Exception -{ - nativeWebShell = BrowserControlNativeShim.webShellCreate(windowPtr, bounds, this); -} - -public Canvas getCanvas() -{ - return myCanvas; -} - -public void loadURL(String urlString) throws Exception -{ - BrowserControlNativeShim.webShellLoadURL(nativeWebShell, urlString); -} - -public void stop() throws Exception -{ - BrowserControlNativeShim.webShellStop(nativeWebShell); -} - -public void show () throws Exception -{ - BrowserControlNativeShim.webShellShow(nativeWebShell); -} - -public void hide () throws Exception -{ - BrowserControlNativeShim.webShellHide(nativeWebShell); -} - -public void setBounds (Rectangle bounds) throws Exception -{ - BrowserControlNativeShim.webShellSetBounds(nativeWebShell, bounds); -} - -public void moveTo (int x, int y) throws Exception -{ - BrowserControlNativeShim.webShellMoveTo(nativeWebShell, x, y); -} - -/** - * - */ -public void setFocus () throws Exception -{ - BrowserControlNativeShim.webShellSetFocus(nativeWebShell); -} - -/** - * - */ -public void removeFocus () throws Exception -{ - BrowserControlNativeShim.webShellRemoveFocus(nativeWebShell); -} - -/** - * - */ -public void repaint (boolean forceRepaint) throws Exception -{ - BrowserControlNativeShim.webShellRepaint(nativeWebShell, forceRepaint); -} - -/** - * - */ -public boolean canBack () throws Exception -{ - return BrowserControlNativeShim.webShellCanBack(nativeWebShell); -} - -/** - * - */ -public boolean canForward () throws Exception -{ - return BrowserControlNativeShim.webShellCanForward(nativeWebShell); -} - -/** - * - */ -public boolean back () throws Exception -{ - return BrowserControlNativeShim.webShellBack(nativeWebShell); -} - -/** - * - */ -public boolean forward () throws Exception -{ - return BrowserControlNativeShim.webShellForward(nativeWebShell); -} - -/** - * - */ -public boolean goTo (int historyIndex) throws Exception -{ - return BrowserControlNativeShim.webShellGoTo(nativeWebShell, historyIndex); -} - -/** - * - */ -public int getHistoryLength () throws Exception -{ - return BrowserControlNativeShim.webShellGetHistoryLength(nativeWebShell); -} - -/** - * - */ -public int getHistoryIndex () throws Exception -{ - return BrowserControlNativeShim.webShellGetHistoryIndex(nativeWebShell); -} - -/** - * - */ -public String getURL (int historyIndex) throws Exception -{ - return BrowserControlNativeShim.webShellGetURL(nativeWebShell, historyIndex); -} - -/** - * Added by Mark Goddard OTMP 9/2/1999 - */ -public boolean refresh() throws Exception -{ - return BrowserControlNativeShim.webShellRefresh(nativeWebShell); -} - -/** - * get EventRegistration object - */ - -public EventRegistration getEventRegistration() { - return this; -} - -/** - * add document load event listener - */ -public boolean addDocumentLoadListener(DocumentLoadListener dll) throws Exception { - return BrowserControlNativeShim.webShellAddDocListener(nativeWebShell, dll); -} - -/** - * - */ -public int getNativeWebShell () -{ - return nativeWebShell; -} - -/** - * - */ -public void finalize () -{ - try { - BrowserControlNativeShim.webShellDelete(nativeWebShell); - } - catch (Exception ex) { - System.out.println(ex.toString()); - } - nativeWebShell = 0; -} - -// ----UNIT_TEST_START - -// -// Test methods -// - -public static void main(String [] args) -{ - Assert.setEnabled(true); - // BrowserControlImpl me = new BrowserControlImpl(); - Log.setApplicationName("BrowserControlImpl"); - Log.setApplicationVersion("0.0"); - Log.setApplicationVersionDate("$Id: BrowserControlImpl.java,v 1.9 2000-02-18 19:32:22 edburns%acm.org Exp $"); - -} - -// ----UNIT_TEST_END - -} // end of class BrowserControlImpl diff --git a/mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlNativeShim.java b/mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlNativeShim.java deleted file mode 100644 index 3a4597e3d8f..00000000000 --- a/mozilla/java/webclient/classes/org/mozilla/webclient/BrowserControlNativeShim.java +++ /dev/null @@ -1,430 +0,0 @@ -/* -*- 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 RaptorCanvas. - * - * The Initial Developer of the Original Code is Kirk Baker and - * Ian Wilkinson. Portions created by Kirk Baker and Ian Wilkinson are - * Copyright (C) 1999 Kirk Baker and Ian Wilkinson. All - * Rights Reserved. - * - * Contributor(s): Kirk Baker - * Ian Wilkinson - * Mark Lin - * Ed Burns - * Mark Goddard - * Ann Sunhachawee - */ - -package org.mozilla.webclient; - -// MWebShellMozillaShim.java - -import org.mozilla.util.Assert; -import org.mozilla.util.Log; -import org.mozilla.util.ParameterCheck; - -import java.awt.*; - -/** - * - - * MWebShellMozillaShim is a class with native methods that - * provides the glue between MWebShell and nsIWebShell.

- - * WAS: instance

- - * Lifetime And Scope

- - * There is one instance of this class and all of the exposed methods - * are static. - - * @version $Id: BrowserControlNativeShim.java,v 1.2 2000-02-18 19:16:26 edburns%acm.org Exp $ - * - * @see org.mozilla.webclient.BrowserControlImpl - - * - - */ - -public class BrowserControlNativeShim extends Object -{ -// -// Protected Constants -// - -// -// Class Variables -// - -private static boolean initialized = false; - -private static BrowserControlNativeShim instance = null; - -private static Object lock = null; - - //private static int myGtkwinptr; - - -// -// Instance Variables -// - -// Attribute Instance Variables - -// Relationship Instance Variables - -// -// Constructors and Initializers -// - -public BrowserControlNativeShim() -{ - super(); - lock = new Object(); -} - -// -// Class methods -// - - /** - - * it is safe to call this method multiple times, it is guaranteed - * to only actually do something once. - - */ - -public static void initialize(String verifiedBinDirAbsolutePath) throws Exception -{ - if (!initialized) { - instance = new BrowserControlNativeShim(); - - instance.nativeInitialize(verifiedBinDirAbsolutePath); - initialized = true; - } -} - -public static void terminate () throws Exception -{ - synchronized(lock) { - if (initialized) { - instance.nativeTerminate(); - initialized = false; - } - } -} - -// -// WebShell methods -// - -public static int webShellCreate (int windowPtr, - Rectangle bounds, BrowserControlImpl abrowsercontrolimpl) throws Exception -{ - synchronized(lock) { - if (initialized) { - return(instance.nativeWebShellCreate(windowPtr, - bounds.x, bounds.y, - bounds.width + 1, - bounds.height + 1, - abrowsercontrolimpl)); - } - else { - throw new Exception("Error: unable to create native nsIWebShell"); - } - } -} - -public static void webShellDelete (int webShellPtr) throws Exception -{ - synchronized(lock) { - if (initialized) { - instance.nativeWebShellDelete(webShellPtr); - } - } -} - -public static boolean webShellAddDocListener(int webShellPtr, DocumentLoadListener dl) throws Exception -{ - synchronized(lock) { - if (initialized) { - return instance.nativeWebShellAddDocListener(webShellPtr, dl); - } else { - throw new Exception ("instance is not initialized"); - } - } -} - -public static void webShellLoadURL (int webShellPtr, - String urlString) throws Exception -{ - synchronized(lock) { - if (initialized) { - instance.nativeWebShellLoadURL(webShellPtr, urlString); - } - } -} - -public static void webShellStop (int webShellPtr) throws Exception -{ - synchronized(lock) { - if (initialized) { - instance.nativeWebShellStop(webShellPtr); - } - } -} - -public static void webShellShow (int webShellPtr) throws Exception -{ - synchronized(lock) { - if (initialized) { - instance.nativeWebShellShow(webShellPtr); - } - } -} - -public static void webShellHide (int webShellPtr) throws Exception -{ - synchronized(lock) { - if (initialized) { - instance.nativeWebShellHide(webShellPtr); - } - } -} - -public static void webShellSetBounds (int webShellPtr, - Rectangle bounds) throws Exception -{ - synchronized(lock) { - if (initialized) { - instance.nativeWebShellSetBounds(webShellPtr, bounds.x, bounds.y, bounds.width + 1, bounds.height + 1); - } - } -} - -public static void webShellMoveTo (int webShellPtr, - int x, int y) throws Exception -{ - synchronized(lock) { - if (initialized) { - instance.nativeWebShellMoveTo(webShellPtr, x, y); - } - } -} - -public static void webShellSetFocus (int webShellPtr) throws Exception -{ - synchronized(lock) { - if (initialized) { - instance.nativeWebShellSetFocus(webShellPtr); - } - } -} - -public static void webShellRemoveFocus (int webShellPtr) throws Exception -{ - synchronized(lock) { - if (initialized) { - instance.nativeWebShellRemoveFocus(webShellPtr); - } - } -} - -public static void webShellRepaint (int webShellPtr, - boolean forceRepaint) throws Exception -{ - synchronized(lock) { - if (initialized) { - instance.nativeWebShellRepaint(webShellPtr, forceRepaint); - } - } -} - -public static boolean webShellCanBack (int webShellPtr) throws Exception -{ - synchronized(lock) { - if (initialized) { - return instance.nativeWebShellCanBack(webShellPtr); - } - else { - throw new Exception("instance is not initialized."); - } - } -} - -public static boolean webShellCanForward (int webShellPtr) throws Exception -{ - synchronized(lock) { - if (initialized) { - return instance.nativeWebShellCanForward(webShellPtr); - } - else { - throw new Exception("instance is not initialized."); - } - } -} - -public static boolean webShellBack (int webShellPtr) throws Exception -{ - synchronized(lock) { - if (initialized) { - return instance.nativeWebShellBack(webShellPtr); - } - else { - throw new Exception("instance is not initialized."); - } - } -} - -public static boolean webShellForward (int webShellPtr) throws Exception -{ - synchronized(lock) { - if (initialized) { - return instance.nativeWebShellForward(webShellPtr); - } - else { - throw new Exception("instance is not initialized."); - } - } -} - -public static boolean webShellGoTo (int webShellPtr, - int historyIndex) throws Exception -{ - synchronized(lock) { - if (initialized) { - return instance.nativeWebShellGoTo(webShellPtr, historyIndex); - } - else { - throw new Exception("instance is not initialized."); - } - } -} - -public static int webShellGetHistoryLength (int webShellPtr) throws Exception -{ - synchronized(lock) { - if (initialized) { - return instance.nativeWebShellGetHistoryLength(webShellPtr); - } - else { - throw new Exception("instance is not initialized."); - } - } -} - -public static int webShellGetHistoryIndex (int webShellPtr) throws Exception -{ - synchronized(lock) { - if (initialized) { - return instance.nativeWebShellGetHistoryIndex(webShellPtr); - } - else { - throw new Exception("instance is not initialized."); - } - } -} - -public static String webShellGetURL(int webShellPtr, - int historyIndex) throws Exception -{ - synchronized(lock) { - if (initialized) { - return instance.nativeWebShellGetURL(webShellPtr, historyIndex); - } - else { - throw new Exception("instance is not initialized."); - } - } -} - -/** - * Added by Mark Goddard OTMP 9/2/1999 - */ - -public static boolean webShellRefresh(int webShellPtr) throws Exception -{ - synchronized(lock) { - if (initialized) { - return instance.nativeWebShellRefresh(webShellPtr); - } - else { - throw new Exception("instance is not initialized."); - } - } -} -// -// Native interfaces -// - -private native void nativeInitialize (String verifiedBinDirAbsolutePath) throws Exception; -private native void nativeTerminate () throws Exception; - -// -// WebShell interface -// - -private native void nativeDummy (BrowserControlNativeShim testShim); - -private native int nativeWebShellCreate (int windowPtr, - int x, int y, int width, int height, BrowserControlImpl abrowsercontrolimpl) throws Exception; -private native void nativeWebShellDelete (int webShellPtr) throws Exception; -private native void nativeWebShellLoadURL (int webShellPtr, String urlString) throws Exception; -private native void nativeWebShellStop (int webShellPtr) throws Exception; -private native void nativeWebShellShow (int webShellPtr) throws Exception; -private native void nativeWebShellHide (int webShellPtr) throws Exception; -private native void nativeWebShellSetBounds (int webShellPtr, int x, int y, int width, int height) throws Exception; -private native void nativeWebShellMoveTo (int webShellPtr, int x, int y) throws Exception; -private native void nativeWebShellSetFocus (int webShellPtr) throws Exception; -private native void nativeWebShellRemoveFocus (int webShellPtr) throws Exception; -private native void nativeWebShellRepaint (int webShellPtr, boolean forceRepaint) throws Exception; -private native boolean nativeWebShellCanBack (int webShellPtr) throws Exception; -private native boolean nativeWebShellCanForward (int webShellPtr) throws Exception; -private native boolean nativeWebShellBack (int webShellPtr) throws Exception; -private native boolean nativeWebShellForward (int webShellPtr) throws Exception; -private native boolean nativeWebShellGoTo (int webShellPtr, int aHistoryIndex) throws Exception; -private native int nativeWebShellGetHistoryLength (int webShellPtr) throws Exception; -private native int nativeWebShellGetHistoryIndex (int webShellPtr) throws Exception; -private native String nativeWebShellGetURL (int webShellPtr, int aHistoryIndex) throws Exception; - -/** - * Added by Mark Goddard OTMP 9/2/1999 - */ -private native boolean nativeWebShellRefresh (int webShellPtr) throws Exception; -private native boolean nativeWebShellAddDocListener(int webShellPtr, DocumentLoadListener dl); - -public static native void nativeDebugBreak(String fileName, int lineNumber); - -// -// General Methods -// - -// ----UNIT_TEST_START - -// -// Test methods -// - -public static void main(String [] args) -{ - Assert.setEnabled(true); - BrowserControlNativeShim me = new BrowserControlNativeShim(); - Log.setApplicationName("BrowserControlNativeShim"); - Log.setApplicationVersion("0.0"); - Log.setApplicationVersionDate("$Id: BrowserControlNativeShim.java,v 1.2 2000-02-18 19:16:26 edburns%acm.org Exp $"); - -} - -// ----UNIT_TEST_END - -} // end of class BrowserControlNativeShim diff --git a/mozilla/java/webclient/classes/org/mozilla/webclient/DocListener.java b/mozilla/java/webclient/classes/org/mozilla/webclient/DocListener.java deleted file mode 100644 index 48aeb1c2158..00000000000 --- a/mozilla/java/webclient/classes/org/mozilla/webclient/DocListener.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.mozilla.webclient; - -public interface DocListener { - - public void handleDocLoaderEvent(); - -} diff --git a/mozilla/java/webclient/classes/org/mozilla/webclient/DocumentLoadListener.java b/mozilla/java/webclient/classes/org/mozilla/webclient/DocumentLoadListener.java deleted file mode 100644 index 1fe6b065178..00000000000 --- a/mozilla/java/webclient/classes/org/mozilla/webclient/DocumentLoadListener.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.mozilla.webclient; - -public interface DocumentLoadListener { - public void docEventPerformed(String event); - - -} diff --git a/mozilla/java/webclient/classes/org/mozilla/webclient/EventRegistration.java b/mozilla/java/webclient/classes/org/mozilla/webclient/EventRegistration.java deleted file mode 100644 index 686d8c67376..00000000000 --- a/mozilla/java/webclient/classes/org/mozilla/webclient/EventRegistration.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.mozilla.webclient; - -public interface EventRegistration { - - public boolean addDocumentLoadListener(DocumentLoadListener dll) throws Exception; - - -} diff --git a/mozilla/java/webclient/classes/org/mozilla/webclient/motif/MotifBrowserControlCanvas.java b/mozilla/java/webclient/classes/org/mozilla/webclient/motif/MotifBrowserControlCanvas.java deleted file mode 100644 index 0563a8f9f0b..00000000000 --- a/mozilla/java/webclient/classes/org/mozilla/webclient/motif/MotifBrowserControlCanvas.java +++ /dev/null @@ -1,142 +0,0 @@ -/* -*- 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): - */ -package org.mozilla.webclient.motif; - -// MotifBrowserControlCanvas.java - -import org.mozilla.util.Assert; -import org.mozilla.util.Log; -import org.mozilla.util.ParameterCheck; - -/** - - * MotifBrowserControlCanvas provides a concrete realization - * of the RaptorCanvas for Motif. - - * Lifetime And Scope

- - * There is one instance of the WebShellCanvas per top level awt Frame. - - * @version $Id: MotifBrowserControlCanvas.java,v 1.6 1999-12-23 04:09:30 edburns%acm.org Exp $ - * - * @see org.mozilla.webclient.BrowserControlCanvasFactory - * - - */ - -import sun.awt.*; -import sun.awt.motif.*; -import java.awt.*; - -import org.mozilla.webclient.*; - -/** - * MotifBrowserControlCanvas provides a concrete realization - * of the RaptorCanvas. - */ -public class MotifBrowserControlCanvas extends BrowserControlCanvas /* implements ActionListener*/ { - - static { - System.loadLibrary("webclientstub"); - MotifBrowserControlCanvas.loadMainDll(); - } - - static private boolean firstTime = true; - private int gtkWinID; - private int gtkTopWindow; - private int canvasWinID; - private int gtkWinPtr; - private MDrawingSurfaceInfo drawingSurfaceInfo; - - static private native void loadMainDll(); - private native int createTopLevelWindow(); - private native int createContainerWindow(int parent, int width, int height); - private native int getGTKWinID(int gtkWinPtr); - private native void reparentWindow(int child, int parent); - private native void processEvents(); - private native void setGTKWindowSize(int gtkWinPtr, int width, int height); - - public MotifBrowserControlCanvas() { - super(); - - this.gtkWinID = 0; - this.canvasWinID = 0; - this.gtkWinPtr = 0; - this.drawingSurfaceInfo = null; - - } - - public void paint(Graphics g) { - super.paint(g); - - if (firstTime) { - synchronized(getTreeLock()) { - canvasWinID = this.drawingSurfaceInfo.getDrawable(); - this.reparentWindow(this.gtkWinID, this.canvasWinID); - - firstTime = false; - } - } - } - - public void setBounds(int x, int y, int width, int height) { - super.setBounds(x, y, width, height); - - synchronized(getTreeLock()) { - this.setGTKWindowSize(this.gtkTopWindow, width, height); - } - } - - /** - * Needed for the hashtable look up of gtkwinid <-> WebShellInitContexts - */ - public int getGTKWinPtr() { - return this.gtkWinPtr; - } - - /** - * Obtain the native window handle for this - * component's peer. - * - * @returns The native window handle. - */ - protected int getWindow(DrawingSurfaceInfo dsi) { - synchronized(getTreeLock()) { - this.drawingSurfaceInfo = (MDrawingSurfaceInfo) dsi; - - this.gtkTopWindow = this.createTopLevelWindow(); - Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); - - this.gtkWinPtr = - this.createContainerWindow(this.gtkTopWindow, screenSize.width, - screenSize.height); - - this.gtkWinID = this.getGTKWinID(gtkWinPtr); - - Thread nativeEventThread = new NativeEventThread(this); - nativeEventThread.start(); - } - - return this.gtkWinPtr; - } -} - diff --git a/mozilla/java/webclient/classes/org/mozilla/webclient/motif/NativeEventThread.java b/mozilla/java/webclient/classes/org/mozilla/webclient/motif/NativeEventThread.java deleted file mode 100644 index 615e0e9173d..00000000000 --- a/mozilla/java/webclient/classes/org/mozilla/webclient/motif/NativeEventThread.java +++ /dev/null @@ -1,98 +0,0 @@ -/* -*- 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): - */ -package org.mozilla.webclient.motif; - - -/** - * This is NativeEventThread. It's job is to process any pending mozilla events - * which have been queued up. - * - * It also contains a private static hashtable mapping of GTK window to - * WebShellInitContexts (see BrowserControllMozillaShim.cpp). It needs this - * because in order to process any GTK / Mozilla events, it needs a pointer - * to the native event queue, the native web shell, as well as native pointers - * to other things which it can't readily access. - * So what we do is when the WebShellInitContext for a GTK Window first gets - * created, it gets stored in the webShellContextMapping hashtable below. Then - * we can now easily lookup the appropriate WebShellInitContext when it is needed. - * - * Lifetime And Scope

- * There will be one of these per BrowserControlCanvas (but hasn't been tested yet) - * - * @version $Id: NativeEventThread.java,v 1.1 1999-12-23 04:09:31 edburns%acm.org Exp $ - * @see org.mozilla.webclient.motif.NativeEventThread - * - */ - -import java.util.*; - -public class NativeEventThread extends Thread { - - static private int eventQueueCount = 0; - // A mapping of gtkWindowID <-> WebShellInitContext structs - static private Hashtable webShellContextMapping = null; - - protected MotifBrowserControlCanvas browserCanvas; - - // Calling this will process any GTK / Mozilla events which have been pending - public native void processNativeEventQueue(int nativeWebShellContext); - - public static void storeContext(int gtkWinID, int nativeWebShellContext) { - if (webShellContextMapping == null) { - webShellContextMapping = new Hashtable(); - } - - webShellContextMapping.put(new Integer(gtkWinID), new Integer(nativeWebShellContext)); - } - - public static int getContext(int gtkWinID) { - Integer result = (Integer) webShellContextMapping.get(new Integer(gtkWinID)); - - if (result != null) { - return result.intValue(); - } - - System.out.println("Requested invalid NativeWebShellInitContext!\n"); - return 0; - } - - public NativeEventThread(MotifBrowserControlCanvas canvas) { - super("Mozilla-Event-Thread-" + eventQueueCount); - - this.browserCanvas = canvas; - eventQueueCount++; - this.setPriority(Thread.MAX_PRIORITY); - } - - public void run() { - // Infinite loop to eternity. - while (true) { - // PENDING(mark): Do we need to yield? - // Thread.currentThread().yield(); - - synchronized(this.browserCanvas.getTreeLock()) { - this.processNativeEventQueue(getContext(this.browserCanvas.getGTKWinPtr())); - } - } - } - -} diff --git a/mozilla/java/webclient/classes/org/mozilla/webclient/test/EmbeddedMozilla.java b/mozilla/java/webclient/classes/org/mozilla/webclient/test/EmbeddedMozilla.java deleted file mode 100644 index 764f3b55e24..00000000000 --- a/mozilla/java/webclient/classes/org/mozilla/webclient/test/EmbeddedMozilla.java +++ /dev/null @@ -1,218 +0,0 @@ -/* -*- 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 RaptorCanvas. - * - * The Initial Developer of the Original Code is Kirk Baker and - * Ian Wilkinson. Portions created by Kirk Baker and Ian Wilkinson are - * Copyright (C) 1999 Kirk Baker and Ian Wilkinson. All - * Rights Reserved. - * - * Contributor(s): Kirk Baker - * Ian Wilkinson - * Mark Goddard - * Ed Burns - */ - -package org.mozilla.webclient.test; - -/* - * EmbeddedMozilla.java - */ - -import java.awt.*; -import java.awt.event.*; - -import org.mozilla.webclient.*; -import org.mozilla.util.Assert; - -/** - * - - * This is a test application for using the BrowserControl. - - * - * @version $Id: EmbeddedMozilla.java,v 1.6 1999-12-06 23:31:06 edburns%acm.org Exp $ - * - * @see org.mozilla.webclient.BrowserControlFactory - - */ - -public class EmbeddedMozilla extends Frame implements ActionListener { - static final int defaultWidth = 640; - static final int defaultHeight = 480; - - private TextField urlField; - private BrowserControl browserControl; - private Panel controlPanel; - private Panel buttonsPanel; - -public static void printUsage() -{ - System.out.println("usage: java org.mozilla.webclient.test.EmbeddedMozilla [url]"); - System.out.println(" is the absolute path to the native browser bin directory, "); - System.out.println(" including the bin."); -} - - - public static void main (String[] arg) { - if (1 > arg.length) { - printUsage(); - System.exit(-1); - } - String urlArg =(2 == arg.length) ? arg[1] : "http://www.mozilla.org/"; - - EmbeddedMozilla gecko = - new EmbeddedMozilla("Embedded Mozilla", arg[0], urlArg); - } // main() - - public EmbeddedMozilla (String title, String binDir, String url) { - super(title); - System.out.println("constructed with binDir: " + binDir + " url: " + - url); - - addWindowListener(new WindowAdapter() { - public void windowClosing(WindowEvent e) { - dispose(); - // should close the BrowserControlCanvas - } - - public void windowClosed(WindowEvent e) { - System.exit(0); - } - }); - - setSize(defaultWidth, defaultHeight); - - // Create the URL field - urlField = new TextField("", 30); - urlField.addActionListener(this); - - // Create the buttons sub panel - buttonsPanel = new Panel(); - buttonsPanel.setLayout(new GridBagLayout()); - - // Add the buttons - makeItem(buttonsPanel, "Back", 0, 0, 1, 1, 0.0, 0.0); - makeItem(buttonsPanel, "Forward", 1, 0, 1, 1, 0.0, 0.0); - makeItem(buttonsPanel, "Stop", 2, 0, 1, 1, 0.0, 0.0); - makeItem(buttonsPanel, "Refresh", 3, 0, 1, 1, 0.0, 0.0); - - // Create the control panel - controlPanel = new Panel(); - controlPanel.setLayout(new BorderLayout()); - - // Add the URL field, and the buttons panel - controlPanel.add(urlField, BorderLayout.CENTER); - controlPanel.add(buttonsPanel, BorderLayout.WEST); - - // Create the browser - Canvas browserCanvas = null; - - try { - BrowserControlFactory.setAppData(binDir); - browserControl = BrowserControlFactory.newBrowserControl(); - } - catch(Exception e) { - System.out.println("Can't create BrowserControl: " + - e.getMessage()); - } - browserCanvas = browserControl.getCanvas(); - Assert.assert(null != browserCanvas); - browserCanvas.setSize(defaultWidth, defaultHeight); - - // Add the control panel and the browserCanvas - add(controlPanel, BorderLayout.NORTH); - add(browserCanvas, BorderLayout.CENTER); - - pack(); - show(); - toFront(); - - try { - browserControl.loadURL(url); - urlField.setText(url); - } - catch (Exception e) { - System.out.println(e.toString()); - } - } // EmbeddedMozilla() ctor - - - public void actionPerformed (ActionEvent evt) { - String command = evt.getActionCommand(); - - try { - if (command.equals("Back")) { - if (browserControl.canBack()) { - browserControl.back(); - int index = browserControl.getHistoryIndex(); - String newURL = browserControl.getURL(index); - - System.out.println(newURL); - - urlField.setText(newURL); - } - } - else if (command.equals("Forward")) { - if (browserControl.canForward()) { - browserControl.forward(); - int index = browserControl.getHistoryIndex(); - String newURL = browserControl.getURL(index); - - System.out.println(newURL); - - urlField.setText(newURL); - } - } - else if (command.equals("Stop")) { - browserControl.stop(); - } - else if (command.equals("Refresh")) { - browserControl.refresh(); - } - else { - browserControl.loadURL(urlField.getText()); - } - } - catch (Exception e) { - System.out.println(e.toString()); - } - } // actionPerformed() - - - private void makeItem (Panel p, Object arg, int x, int y, int w, int h, double weightx, double weighty) { - GridBagLayout gbl = (GridBagLayout) p.getLayout(); - GridBagConstraints c = new GridBagConstraints(); - Component comp; - - c.fill = GridBagConstraints.BOTH; - c.gridx = x; - c.gridy = y; - c.gridwidth = w; - c.gridheight = h; - c.weightx = weightx; - c.weighty = weighty; - if (arg instanceof String) { - Button b; - - comp = b = new Button((String) arg); - b.addActionListener(this); - - p.add(comp); - gbl.setConstraints(comp, c); - } - } // makeItem() - -} - -// EOF diff --git a/mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/BackAction.java b/mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/BackAction.java deleted file mode 100644 index 498b3f7847c..00000000000 --- a/mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/BackAction.java +++ /dev/null @@ -1,22 +0,0 @@ - -package org.mozilla.webclient.test.swing; -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; - -import org.mozilla.webclient.*; - -class BackAction extends AbstractAction { - private SwingEmbeddedMozilla em; - - public BackAction(SwingEmbeddedMozilla em) { - super ("Back"); - this.em = em; - } - - public void actionPerformed(ActionEvent evt) { - System.out.println("Back was pressed!!"); - em.back(); - - } - } diff --git a/mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/CommandPanel.java b/mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/CommandPanel.java deleted file mode 100644 index a8618c97f52..00000000000 --- a/mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/CommandPanel.java +++ /dev/null @@ -1,93 +0,0 @@ -package org.mozilla.webclient.test.swing; -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; - -import org.mozilla.webclient.*; - -public class CommandPanel extends JPanel implements ActionListener { - private JToolBar urltool; - private JToolBar navtool; - private JTextField urlfield; - private JComboBox cb; - private SwingEmbeddedMozilla em; - - public CommandPanel(SwingEmbeddedMozilla em) { - super(); - GridBagLayout gbl = new GridBagLayout(); - GridBagConstraints gbc = new GridBagConstraints(); - setLayout(gbl); - this.em = em; - - navtool = createNavToolBar(); - urltool = createURLToolBar(); - - // Layout of the toolbars. - gbc.anchor = GridBagConstraints.NORTHWEST; - add(navtool, gbc); - - gbc.gridwidth = GridBagConstraints.REMAINDER; - gbc.weightx = 1.0; - add(Box.createHorizontalGlue(), gbc); - - gbc.gridwidth = 1; - add(urltool, gbc); - } - - private JButton makeButton(String arg) { - JButton button = new JButton(arg); - return button; - } - - private JToolBar createURLToolBar() { - JToolBar tb = new JToolBar(); - // Ann - commented out the combobox for demo purposes. 9/20/99 - // String temp[] = {"Fee", "Fi", "Fo", "Fum"}; - //cb = new JComboBox(temp); - //cb.setEditable(true); - //cb.setLightWeightPopupEnabled(false); - urlfield = new JTextField(25); - - tb.add(urlfield); - //tb.add(cb); - //cb.addActionListener(this); - urlfield.addActionListener(this); - return tb; - } - - - - - private JToolBar createNavToolBar() { - JToolBar tb = new JToolBar(); - - tb.add(new BackAction(em)); - tb.add(new ForwardAction(em)); - tb.add(new StopAction(em)); - tb.add(new RefreshAction(em)); - tb.putClientProperty("JToolBar.isRollover", Boolean.TRUE); - return tb; - } - - - public JTextField getURLField() { - return urlfield; - } - - public JToolBar getNavToolBar() { - return navtool; - } - - public void actionPerformed (ActionEvent evt) { - String command = evt.getActionCommand(); - String url = null; - System.out.println( "ActionComand is "+ command); - if ("comboBoxChanged".equals(command)) { - url = (String) cb.getSelectedItem(); - } else { - url = urlfield.getText(); - } - em.loadURL(url); - } - -} diff --git a/mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/ForwardAction.java b/mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/ForwardAction.java deleted file mode 100644 index a45874baa91..00000000000 --- a/mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/ForwardAction.java +++ /dev/null @@ -1,22 +0,0 @@ - -package org.mozilla.webclient.test.swing; -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; - -import org.mozilla.webclient.*; - -class ForwardAction extends AbstractAction { - private SwingEmbeddedMozilla em; - - public ForwardAction(SwingEmbeddedMozilla em) { - super ("Forward"); - this.em = em; - } - - public void actionPerformed(ActionEvent evt) { - System.out.println("Forwardwas pressed!!"); - em.forward(); - - } - } diff --git a/mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/RefreshAction.java b/mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/RefreshAction.java deleted file mode 100644 index 97ce9d7e0fe..00000000000 --- a/mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/RefreshAction.java +++ /dev/null @@ -1,22 +0,0 @@ - -package org.mozilla.webclient.test.swing; -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; - -import org.mozilla.webclient.*; - -class RefreshAction extends AbstractAction { - private SwingEmbeddedMozilla em; - - public RefreshAction(SwingEmbeddedMozilla em) { - super ("Refresh"); - this.em = em; - } - - public void actionPerformed(ActionEvent evt) { - System.out.println("Refresh was pressed!!"); - em.refresh(); - - } - } diff --git a/mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/StatusTextField.java b/mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/StatusTextField.java deleted file mode 100644 index c2c3825b63b..00000000000 --- a/mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/StatusTextField.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.mozilla.webclient.test.swing; -/* - * StatusPanel.java - */ - -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; -import org.mozilla.webclient.*; - -public class StatusTextField extends JTextField implements DocumentLoadListener { - - public StatusTextField(BrowserControl bc) { - super(); - setEditable(false); - try { - bc.getEventRegistration().addDocumentLoadListener(this); - } catch (Exception ex) { - System.out.println(ex.toString()); - } - - } - public void docEventPerformed(String event) { - if (event.equals("startdocumentload")) { - this.setText("Loading document..."); - } else if (event.equals("enddocumentload")) { - this.setText("Finished loading document."); - } - - } - -} diff --git a/mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/StopAction.java b/mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/StopAction.java deleted file mode 100644 index bdbf635c2f9..00000000000 --- a/mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/StopAction.java +++ /dev/null @@ -1,22 +0,0 @@ - -package org.mozilla.webclient.test.swing; -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; - -import org.mozilla.webclient.*; - -class StopAction extends AbstractAction { - private SwingEmbeddedMozilla em; - - public StopAction(SwingEmbeddedMozilla em) { - super ("Stop"); - this.em = em; - } - - public void actionPerformed(ActionEvent evt) { - System.out.println("Stop was pressed!!"); - em.stop(); - - } - } diff --git a/mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/SwingEmbeddedMozilla.java b/mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/SwingEmbeddedMozilla.java deleted file mode 100644 index 72a3d90147d..00000000000 --- a/mozilla/java/webclient/classes/org/mozilla/webclient/test/swing/SwingEmbeddedMozilla.java +++ /dev/null @@ -1,251 +0,0 @@ -/* -*- 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 RaptorCanvas. - * - * The Initial Developer of the Original Code is Kirk Baker and - * Ian Wilkinson. Portions created by Kirk Baker and Ian Wilkinson are - * Copyright (C) 1999 Kirk Baker and Ian Wilkinson. All - * Rights Reserved. - * - * Contributor(s): Kirk Baker - * Ian Wilkinson - * Ann Sunhachawee - */ - -package org.mozilla.webclient.test.swing; - -/* - * SwingEmbeddedMozilla.java - */ - -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; - -import org.mozilla.webclient.*; -import org.mozilla.util.Assert; - -/** - * - - * This is a test application for using the BrowserControl. - - * - * @version $Id: SwingEmbeddedMozilla.java,v 1.3 1999-12-03 01:55:31 edburns%acm.org Exp $ - * - * @see org.mozilla.webclient.BrowserControlFactory - - */ - -public class SwingEmbeddedMozilla extends JFrame -{ - static final int defaultWidth = 640; - static final int defaultHeight = 480; - static String binDir = null; - - private TextField urlField; - private BrowserControl browserControl; - private CommandPanel controlPanel; - -public static void printUsage() -{ - System.out.println("usage: java org.mozilla.webclient.test.SwingEmbeddedMozilla [url]"); - System.out.println(" is the absolute path to the native browser bin directory, "); - System.out.println(" including the bin."); -} - - - public static void main (String[] arg) { - if (1 > arg.length) { - printUsage(); - System.exit(-1); - } - String urlArg =(2 == arg.length) ? arg[1] : "http://www.mozilla.org/"; - - SwingEmbeddedMozilla.binDir = arg[0]; - - SwingEmbeddedMozilla gecko = - new SwingEmbeddedMozilla("Embedded Mozilla", arg[0], urlArg); - } // main() - -public SwingEmbeddedMozilla (String title, String binDir, String url) -{ - super(title); - - Container contentPane = getContentPane(); - JMenuBar menubar = createMenuBar(); - - System.out.println("constructed with " + url); - - addWindowListener(new WindowAdapter() { - public void windowClosing(WindowEvent e) { - dispose(); - // should close the BrowserControlCanvas - } - - public void windowClosed(WindowEvent e) { - System.exit(0); - } - }); - - setSize(defaultWidth, defaultHeight); - - // Create the browser - Canvas browserCanvas = null; - - try { - BrowserControlFactory.setAppData(binDir); - browserControl = BrowserControlFactory.newBrowserControl(); - } - catch(Exception e) { - System.out.println("Can't create BrowserControlCanvas: " + - e.getMessage()); - } - browserCanvas = browserControl.getCanvas(); - Assert.assert(null != browserCanvas); - browserCanvas.setSize(defaultWidth, defaultHeight); - - // Add the control panel and the browser - contentPane.add(browserCanvas, BorderLayout.CENTER); - - - controlPanel = new CommandPanel(this); - contentPane.add(controlPanel, BorderLayout.NORTH); - - - getRootPane().setMenuBar(menubar); - - pack(); - show(); - toFront(); - - // DocumentLoadListener dll; - try { - // dll = new DocumentLoadListener(); - // browserControl.getEventRegistration().addDocumentLoadListener(dll); - contentPane.add(new StatusTextField(browserControl), BorderLayout.SOUTH); - - } catch (Exception ex) { - System.out.println(ex.toString()); - } - - - try { - browserControl.loadURL(url); - controlPanel.getURLField().setText(url); - } - catch (Exception e) { - System.out.println(e.toString()); - } -} // SwingEmbeddedMozilla() ctor - -private JMenuBar createMenuBar() -{ - JMenuBar menubar = new JMenuBar(); - JMenu menu = new JMenu("File"); - JMenuItem exitItem = new JMenuItem("Exit"); - JMenuItem newItem = new JMenuItem("New Window"); - - KeyStroke ks = KeyStroke.getKeyStroke(KeyEvent.VK_Q, Event.CTRL_MASK); - KeyStroke ks_new = KeyStroke.getKeyStroke(KeyEvent.VK_N, Event.CTRL_MASK); - - menu.getPopupMenu().setLightWeightPopupEnabled(false); - newItem.setAccelerator(ks_new); - newItem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - new SwingEmbeddedMozilla("New Window", SwingEmbeddedMozilla.binDir, - controlPanel.getURLField().getText()); - } - }); - - exitItem.setAccelerator(ks); - exitItem.addActionListener( new ActionListener() { - public void actionPerformed(ActionEvent e) { - System.exit(0); - } - }); - menu.setMnemonic('F'); - exitItem.setMnemonic(KeyEvent.VK_X); - newItem.setMnemonic(KeyEvent.VK_N); - menu.add(newItem); - menu.add(exitItem); - - menubar.add(menu); - return menubar; -} - -public void back() -{ - try { - if (browserControl.canBack()) { - browserControl.back(); - int index = browserControl.getHistoryIndex(); - String newURL = browserControl.getURL(index); - - System.out.println(newURL); - - controlPanel.getURLField().setText(newURL); - } - } catch (Exception e) { - System.out.println( "anns: exception in back "+ e.toString()); - } -} - -public void forward() -{ - try { - if (browserControl.canForward()) { - browserControl.forward(); - int index = browserControl.getHistoryIndex(); - String newURL = browserControl.getURL(index); - - System.out.println(newURL); - - controlPanel.getURLField().setText(newURL); - } - } catch (Exception e) { - System.out.println( "anns: exception in forward "+ e.toString()); - } -} - -public void stop() -{ - try { - browserControl.stop(); - } catch (Exception e) { - System.out.println("anns: exception in stop "+ e.toString()); - } -} - -public void refresh() -{ - try { - browserControl.refresh(); - } catch (Exception e) { - System.out.println("anns: exception in refresh" + e.toString()); - } -} - -public void loadURL(String url) -{ - try { - browserControl.loadURL(url); - } catch (Exception e) { - System.out.println("anns: exception in load "+ e.toString()); - } - -} - -} - -// EOF diff --git a/mozilla/java/webclient/classes/org/mozilla/webclient/win32/Win32BrowserControlCanvas.java b/mozilla/java/webclient/classes/org/mozilla/webclient/win32/Win32BrowserControlCanvas.java deleted file mode 100644 index 488189357c6..00000000000 --- a/mozilla/java/webclient/classes/org/mozilla/webclient/win32/Win32BrowserControlCanvas.java +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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): - */ - -package org.mozilla.webclient.win32; - -// Win32BrowserControlCanvas.java - -import org.mozilla.util.Assert; -import org.mozilla.util.Log; -import org.mozilla.util.ParameterCheck; - -/** - - * Win32RaptorCanvas provides a concrete realization - * of the RaptorCanvas. - - * Lifetime And Scope

- - * There is one instance of the BrowserControlCanvas per top level awt Frame. - - * @version $Id: Win32BrowserControlCanvas.java,v 1.2 1999-11-06 02:24:19 dmose%mozilla.org Exp $ - * - * @see org.mozilla.webclient.BrowserControlCanvasFactory - * - - */ - -import sun.awt.*; -import sun.awt.windows.*; - -import org.mozilla.webclient.*; - -/** - * Win32BrowserControlCanvas provides a concrete realization - * of the RaptorCanvas. - */ -public class Win32BrowserControlCanvas extends BrowserControlCanvas { - - static { - System.loadLibrary("webclient"); - } - - - /** - * Obtain the native window handle for this - * component's peer. - * - * @returns The native window handle. - */ - protected int getWindow(DrawingSurfaceInfo dsi) { - WDrawingSurfaceInfo ds = (WDrawingSurfaceInfo)dsi; - return ds.getHWnd(); - } -} diff --git a/mozilla/java/webclient/src/BrowserControlNativeShim.cpp b/mozilla/java/webclient/src/BrowserControlNativeShim.cpp deleted file mode 100644 index 25f035bc5e2..00000000000 --- a/mozilla/java/webclient/src/BrowserControlNativeShim.cpp +++ /dev/null @@ -1,1660 +0,0 @@ -/* -*- 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 RaptorCanvas. - * - * The Initial Developer of the Original Code is Kirk Baker and - * Ian Wilkinson. Portions created by Kirk Baker and Ian Wilkinson are - * Copyright (C) 1999 Kirk Baker and Ian Wilkinson. All - * Rights Reserved. - * - * Contributor(s): Kirk Baker - * Ian Wilkinson - * Mark Lin - * Mark Goddard - * Ed Burns - * Ann Sunhachawee - */ - -/* - * BrowserControlNativeShim.cpp - */ - -#include -#include "BrowserControlNativeShim.h" - -#ifdef XP_PC -#include -#endif - -// Raptor includes -#include -#include "nsIWidget.h" -#include "nsIWebShell.h" -#include "nsISessionHistory.h" -#include "nsAppShellCIDs.h" -#include "nsWidgetsCID.h" -#include "nsIGlobalHistory.h" -#include "nsIComponentManager.h" -#include "nsIThread.h" -#include "nsString.h" -#include "nsRepository.h" -#ifdef NECKO -#include "nsNetUtil.h" -#else -#include "nsINetService.h" -#endif -#include "nsIServiceManager.h" -#include "nsIEventQueueService.h" - -#include "prmem.h" - -#ifdef XP_MAC -#include "nsMacMessageSink.h" -#include "nsRepeater.h" - -nsMacMessageSink gMessageSink; - -#endif - -#ifdef XP_UNIX -#include -#include "motif/NativeEventThread.h" -#endif - -#include "nsActions.h" - -#include "nsIRegistry.h" -#include "nsIServiceManager.h" -#include "nsIPref.h" -#include "DocumentObserver.h" -#include "nsIDocumentLoader.h" - -#include "nsCOMPtr.h" -#include "nsIBaseWindow.h" - -#ifdef XP_UNIX -#include -#include "gdksuperwin.h" -#include "gtkmozarea.h" -#endif - - -#ifdef XP_PC - -#define APPSHELL_DLL "appshell.dll" -#define BROWSER_DLL "nsbrowser.dll" -#define EDITOR_DLL "ender.dll" - -#else - -#ifdef XP_MAC - -#define APPSHELL_DLL "APPSHELL_DLL" -#define EDITOR_DLL "ENDER_DLL" - -#else - -// XP_UNIX || XP_BEOS -#define APPSHELL_DLL "libnsappshell"MOZ_DLL_SUFFIX -#define APPCORES_DLL "libappcores"MOZ_DLL_SUFFIX -#define EDITOR_DLL "libender"MOZ_DLL_SUFFIX - -#endif // XP_MAC - -#endif // XP_PC - -#define DEBUG_RAPTOR_CANVAS 1 - -static NS_DEFINE_IID(kWindowCID, NS_WINDOW_CID); // PENDING(edburns): should this be NS_DEFINE_CID? -static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID); -static NS_DEFINE_IID(kISessionHistoryIID, NS_ISESSIONHISTORY_IID); -static NS_DEFINE_CID(kSessionHistoryCID, NS_SESSIONHISTORY_CID); - -static NS_DEFINE_IID(kWebShellCID, NS_WEB_SHELL_CID); -static NS_DEFINE_IID(kIWebShellIID, NS_IWEB_SHELL_IID); - -static NS_DEFINE_IID(kIEventQueueServiceIID, NS_IEVENTQUEUESERVICE_IID); -static NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); -static NS_DEFINE_CID(kPrefCID, NS_PREF_CID); - -extern "C" void NS_SetupRegistry(); -extern nsresult NS_AutoregisterComponents(); - -static nsFileSpec gBinDir; -static nsISessionHistory *gHistory; - -struct WebShellInitContext { -#ifdef XP_UNIX - GtkWidget * parentHWnd; -#else - // PENDING(mark): Don't we need something for Mac? - HWND parentHWnd; -#endif - nsIWebShell * webShell; - PLEventQueue * actionQueue; - PRThread * embeddedThread; - JNIEnv * env; - int stopThread; - int initComplete; - int initFailCode; - int x; - int y; - int w; - int h; - int gtkPtr; -}; - -void PostEvent (WebShellInitContext * initContext, PLEvent * event); -void * PostSynchronousEvent (WebShellInitContext * initContext, PLEvent * event); - -static void -ThrowExceptionToJava (JNIEnv * env, const char * message) -{ - if (env->ExceptionOccurred()) - env->ExceptionClear(); - jclass excCls = env->FindClass("java/lang/Exception"); - - if (excCls == 0) { // Unable to find the exception class, give up. - if (env->ExceptionOccurred()) - env->ExceptionClear(); - return; - } - - // Throw the exception with the error code and description - jmethodID jID = env->GetMethodID(excCls, "", "(Ljava/lang/String;)V"); // void Exception(String) - - if (jID != NULL) { - jstring exceptionString = env->NewStringUTF(message); - jthrowable newException = (jthrowable) env->NewObject(excCls, jID, exceptionString); - - if (newException != NULL) { - env->Throw(newException); - } - else { - if (env->ExceptionOccurred()) - env->ExceptionClear(); - } - } else { - if (env->ExceptionOccurred()) - env->ExceptionClear(); - } -} // ThrowExceptionToJava() - - -enum { - kEventQueueError = 1, - kCreateWebShellError, - kInitWebShellError, - kShowWebShellError, - kHistoryWebShellError -}; - - -char * errorMessages[] = { - "No Error", - "Could not obtain the event queue service.", - "Unable to create the WebShell instance.", - "Unable to initialize the WebShell instance.", - "Unable to show the WebShell." -}; - - -int processEventLoop(WebShellInitContext * initContext) { -#ifdef XP_UNIX - while(gtk_events_pending()) { - gtk_main_iteration(); - } -#else - // PENDING(mark): Does this work on the Mac? - MSG msg; - - if (::PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) { - if (::GetMessage(&msg, NULL, 0, 0)) { - ::TranslateMessage(&msg); - ::DispatchMessage(&msg); - } - } -#endif - ::PR_Sleep(PR_INTERVAL_NO_WAIT); - - if ((initContext->initComplete) && (initContext->actionQueue)) { - - PL_ENTER_EVENT_QUEUE_MONITOR(initContext->actionQueue); - - if (::PL_EventAvailable(initContext->actionQueue)) { - - PLEvent * event = ::PL_GetEvent(initContext->actionQueue); - - if (event != NULL) { - ::PL_HandleEvent(event); - } - } - - PL_EXIT_EVENT_QUEUE_MONITOR(initContext->actionQueue); - - } - if (initContext->stopThread) { - initContext->stopThread++; - - return 0; - } - return 1; -} - -#ifdef XP_UNIX -static void event_processor_callback(gpointer data, - gint source, - GdkInputCondition condition) { -#if DEBUG_RAPTOR_CANVAS - printf("EventHandler: event_processor_callback()\n"); -#endif - nsIEventQueue *eventQueue = (nsIEventQueue*)data; - eventQueue->ProcessPendingEvents(); -#if DEBUG_RAPTOR_CANVAS - printf("EventHandler: Done processing pending events\n"); -#endif -} -#endif - -void -EmbeddedEventHandler (void * arg) { - WebShellInitContext * initContext = (WebShellInitContext *) arg; - nsIEventQueueService * aEventQService = nsnull; - nsresult rv; - PRBool allowPlugins = PR_FALSE; - - //TODO Add tracing from nspr. - -#if DEBUG_RAPTOR_CANVAS - printf("EmbeddedEventHandler(%lx): Create the Event Queue for the UI thread...\n", initContext); -#endif - - // Create the Event Queue for the UI thread... - rv = nsServiceManager::GetService(kEventQueueServiceCID, - kIEventQueueServiceIID, - (nsISupports **) &aEventQService); - - if (NS_FAILED(rv)) { - initContext->initFailCode = kEventQueueError; - return; - } - - // Create the event queue. - rv = aEventQService->CreateThreadEventQueue(); - -#ifndef NECKO - NS_InitINetService(); -#endif - // HACK(mark): On Unix, embeddedThread isn't set until after this method returns!! - initContext->embeddedThread = PR_GetCurrentThread(); - - // Create the action queue - if (initContext->embeddedThread) { - -#if DEBUG_RAPTOR_CANVAS - printf("EmbeddedEventHandler(%lx): embeddedThread != NULL\n", initContext); -#endif - if (initContext->actionQueue == NULL) { -#if DEBUG_RAPTOR_CANVAS - printf("EmbeddedEventHandler(%lx): Create the action queue\n", initContext); -#endif -#ifdef XP_UNIX - // We need to do something different for Unix - nsIEventQueue * EQueue = nsnull; - - rv = aEventQService->GetThreadEventQueue(PR_GetCurrentThread(), &EQueue); - gdk_input_add(EQueue->GetEventQueueSelectFD(), - GDK_INPUT_READ, - event_processor_callback, - EQueue); - - PLEventQueue * plEventQueue = nsnull; - - EQueue->GetPLEventQueue(&plEventQueue); - initContext->actionQueue = plEventQueue; -#else - initContext->actionQueue = ::PL_CreateMonitoredEventQueue("Action Queue", initContext->embeddedThread); -#endif - } - } - -#if DEBUG_RAPTOR_CANVAS - printf("EmbeddedEventHandler(%lx): Create the WebShell...\n", initContext); -#endif - // Create the WebShell. - rv = nsRepository::CreateInstance(kWebShellCID, nsnull, kIWebShellIID, (void**)&initContext->webShell); - if (NS_FAILED(rv)) { - initContext->initFailCode = kCreateWebShellError; - return; - } - -#if DEBUG_RAPTOR_CANVAS - printf("EmbeddedEventHandler(%lx): Init the WebShell...%p\n", initContext, initContext->env); -#endif - -#ifdef XP_UNIX - GdkSuperWin * superwin; - GtkMozArea * mozarea; - mozarea = (GtkMozArea *) initContext->gtkPtr; - superwin = mozarea->superwin; - rv = initContext->webShell->Init((nsNativeWidget *)superwin, initContext->x, initContext->y, initContext->w, initContext->h); -#else - rv = initContext->webShell->Init((nsNativeWidget *)initContext->parentHWnd, - initContext->x, initContext->y, initContext->w, initContext->h); -#endif - - if (NS_FAILED(rv)) { - initContext->initFailCode = kInitWebShellError; - return; - } - -#if DEBUG_RAPTOR_CANVAS - printf("EmbeddedEventHandler(%lx): Install Prefs in the Webshell...\n", initContext); -#endif - - nsIPref *prefs; - - rv = nsServiceManager::GetService(kPrefCID, - nsIPref::GetIID(), - (nsISupports **)&prefs); - if (NS_SUCCEEDED(rv)) { - // Set the prefs in the outermost webshell. - initContext->webShell->SetPrefs(prefs); - nsServiceManager::ReleaseService(kPrefCID, prefs); - } - - rv = nsComponentManager::CreateInstance(kSessionHistoryCID, nsnull, kISessionHistoryIID, - (void**)&gHistory); - if (NS_FAILED(rv)) { - initContext->initFailCode = kHistoryWebShellError; - return; - } - - initContext->webShell->SetSessionHistory(gHistory); - - -#if DEBUG_RAPTOR_CANVAS - printf("EmbeddedEventHandler(%lx): Show the WebShell...\n", initContext); -#endif - - nsCOMPtr baseWindow; - - rv = initContext->webShell->QueryInterface(NS_GET_IID(nsIBaseWindow), - getter_AddRefs(baseWindow)); - - if (NS_FAILED(rv)) { - initContext->initFailCode = kShowWebShellError; - return; - } - rv = baseWindow->SetVisibility(PR_TRUE); - if (NS_FAILED(rv)) { - initContext->initFailCode = kShowWebShellError; - return; - } - - initContext->initComplete = TRUE; - -#if DEBUG_RAPTOR_CANVAS - printf("EmbeddedEventHandler(%lx): enter event loop\n", initContext); -#endif - - // Don't loop here. The looping will be handled by a Java Thread - // (see org.mozilla.webclient.motif.NativeEventThread). -#ifndef XP_UNIX - do { - if (!processEventLoop(initContext)) { - break; - } - } while (PR_TRUE); -#else - // Just need to loop once for Unix - processEventLoop(initContext); -#endif -} - -// It appears the current thread (belonging to Java) is assumed to be -// the "main GUI thread." (Creation story given below.) Hence the -// RunPump() of the nsToolkit conflicting with the Java event dispatching. -// -// I'm unsure whether threads created PR_LOCAL_THREAD have -// a one-to-one correspondence with the threads appearing -// on Win32. Changed the "main GUI thread" to be -// a global thread, rather than a local thread. -// -// Creation story... -// nsWebShell::Init() [ webshell/src/nsWebShell.cpp ] calling -// nsWindow::StandardWindowCreate() [ widget/src/windows/nsWindow.cpp ] calling -// nsBaseWidget::BaseCreate() [ widget/src/xpwidgets/nsBaseWidget.cpp ] calling -// nsToolkit::Init() [ widget/src/windows/nsToolkit.cpp ] -// -void -InitEmbeddedEventHandler (WebShellInitContext* initContext) -{ -#if DEBUG_RAPTOR_CANVAS - printf("InitEmbeddedEventHandler(%lx): Creating embedded thread...\n", initContext); -#endif - // Don't create a NSPR Thread on Unix, because we will use a Java Thread instead. - // (see org.mozilla.webclient.motif.NativeEventThread). -#ifndef XP_UNIX - initContext->embeddedThread = ::PR_CreateThread(PR_SYSTEM_THREAD, - EmbeddedEventHandler, - (void*)initContext, - PR_PRIORITY_NORMAL, - PR_GLOBAL_THREAD, - PR_UNJOINABLE_THREAD, - 0); -#else - EmbeddedEventHandler((void *) initContext); -#endif -#if DEBUG_RAPTOR_CANVAS - printf("InitEmbeddedEventHandler(%lx): Embedded Thread created...\n", initContext); -#endif - while (initContext->initComplete == FALSE) { - - ::PR_Sleep(PR_INTERVAL_NO_WAIT); - - if (initContext->initFailCode != 0) { - ::ThrowExceptionToJava(initContext->env, errorMessages[initContext->initFailCode]); - return; - } - } -} - -static nsEventStatus PR_CALLBACK -HandleRaptorEvent (nsGUIEvent *) -{ - nsEventStatus result = nsEventStatus_eIgnore; - return result; -} // HandleRaptorEvent() - - -static void -DispatchEvent (nsGUIEvent* eventPtr, nsIWidget* widgetPtr) -{ - // PENDING(mark): DO I NEED TO DO ANYTHING SPECIAL HERE FOR UNIX????????? -#ifdef XP_MAC - // Enable Raptor background activity - // Note: This will be moved to nsMacMessageSink very soon. - // The application will not have to do it anymore. - - EventRecord * macEventPtr = (EventRecord *) eventPtr->nativeMsg; - - gMessageSink.DispatchOSEvent(*macEventPtr, FrontWindow()); - Repeater::DoRepeaters(*macEventPtr); - - if (macEventPtr->what == nullEvent) - Repeater::DoIdlers(*macEventPtr); - -#else - nsEventStatus aStatus = nsEventStatus_eIgnore; - - widgetPtr->DispatchEvent(eventPtr, aStatus); -#endif -} // DispatchEvent() - - -const jint SHIFT_MASK = 1 << 0; -const jint CTRL_MASK = 1 << 1; -const jint META_MASK = 1 << 2; -const jint ALT_MASK = 1 << 3; -const jint BUTTON1_MASK = 1 << 4; -const jint BUTTON2_MASK = ALT_MASK; -const jint BUTTON3_MASK = META_MASK; - -#ifdef XP_MAC - -static unsigned short -ConvertModifiersToMacModifiers (jint modifiers) -{ - unsigned short convertedModifiers = 0; - - if (modifiers & META_MASK) - convertedModifiers |= cmdKey; - if (modifiers & SHIFT_MASK) - convertedModifiers |= shiftKey; - if (modifiers & ALT_MASK) - convertedModifiers |= optionKey; - if (modifiers & CTRL_MASK) - convertedModifiers |= controlKey; - if (modifiers & BUTTON1_MASK) - convertedModifiers |= btnState; - - // KAB alphaLock would be nice too... - return convertedModifiers; -} // ConvertModifiersToMacModifiers() - - -static void -ConvertMouseCoordsToMacMouseCoords (jint windowPtr, jint x, jint y, Point& pt) -{ - GrafPtr savePort; - - pt.h = (short) x; - pt.v = (short) y; - GetPort(&savePort); - SetPort((WindowPtr) windowPtr); - LocalToGlobal(&pt); - SetPort(savePort); -} // ConvertMouseCoordsToMacMouseCoords() - -#endif // ifdef XP_MAC - - -static void -ConvertModifiersTo_nsInputEvent (jint modifiers, nsInputEvent& event) -{ - event.isShift = (modifiers & SHIFT_MASK) ? PR_TRUE : PR_FALSE; - event.isControl = (modifiers & CTRL_MASK) ? PR_TRUE : PR_FALSE; - event.isAlt = (modifiers & ALT_MASK) ? PR_TRUE : PR_FALSE; -#ifdef XP_MAC - event.isCommand = (modifiers & META_MASK) ? PR_TRUE : PR_FALSE; -#endif -} // ConvertModifiersTo_nsInputEvent() - - - -static unsigned long -ConvertKeys (jchar keyChar, jint keyCode) -{ - return 0; -} // ConvertKeys() - - - -const jint MOUSE_FIRST = 500; -const jint MOUSE_CLICKED = MOUSE_FIRST; -const jint MOUSE_PRESSED = 1 + MOUSE_FIRST; // Event.MOUSE_DOWN -const jint MOUSE_RELEASED = 2 + MOUSE_FIRST; // Event.MOUSE_UP -const jint RAPTOR_MOUSE_MOVED = 3 + MOUSE_FIRST; // Event.MOUSE_MOVE -const jint MOUSE_ENTERED = 4 + MOUSE_FIRST; //Event.MOUSE_ENTER -const jint MOUSE_EXITED = 5 + MOUSE_FIRST; //Event.MOUSE_EXIT -const jint MOUSE_DRAGGED = 6 + MOUSE_FIRST; //Event.MOUSE_DRAG - - - -static PRUint32 -ConvertMouseMessageTo_nsMouseMessage (jint message, jint modifiers, jint numClicks) -{ - if (RAPTOR_MOUSE_MOVED == message) - { - return NS_MOUSE_MOVE; - } - else if (MOUSE_CLICKED == message) - { - PRBool doubleClick = (numClicks & 1) ? PR_FALSE : PR_TRUE; - - if (modifiers & BUTTON1_MASK) - { - if (doubleClick) - return NS_MOUSE_LEFT_DOUBLECLICK; - return NS_MOUSE_LEFT_CLICK; - } - else if (modifiers & BUTTON2_MASK) - { - if (doubleClick) - return NS_MOUSE_MIDDLE_DOUBLECLICK; - return NS_MOUSE_MIDDLE_CLICK; - } - else if (modifiers & BUTTON3_MASK) - { - if (doubleClick) - return NS_MOUSE_RIGHT_DOUBLECLICK; - return NS_MOUSE_RIGHT_CLICK; - } - } - else if ((MOUSE_PRESSED == message) || (MOUSE_DRAGGED == message)) - { - if (modifiers & BUTTON1_MASK) - { - return NS_MOUSE_LEFT_BUTTON_DOWN; - } - else if (modifiers & BUTTON2_MASK) - { - return NS_MOUSE_MIDDLE_BUTTON_DOWN; - } - else if (modifiers & BUTTON3_MASK) - { - return NS_MOUSE_RIGHT_BUTTON_DOWN; - } - } - else if (MOUSE_RELEASED == message) - { - if (modifiers & BUTTON1_MASK) - { - return NS_MOUSE_LEFT_BUTTON_UP; - } - else if (modifiers & BUTTON2_MASK) - { - return NS_MOUSE_MIDDLE_BUTTON_UP; - } - else if (modifiers & BUTTON3_MASK) - { - return NS_MOUSE_RIGHT_BUTTON_UP; - } - } - else if (MOUSE_ENTERED == message) - { - return NS_MOUSE_ENTER; - } - else if (MOUSE_EXITED == message) - { - return NS_MOUSE_EXIT; - } - return NS_MOUSE_MOVE; -} // ConvertMouseMessageTo_nsMouseMessage() - - -#ifdef XP_MAC -static unsigned short -ConvertMouseMessageToMacMouseEvent (jint message) -{ - if (RAPTOR_MOUSE_MOVED == message) - { - return nullEvent; - } - else if (MOUSE_CLICKED == message) - { - return nullEvent; - } - else if ((MOUSE_PRESSED == message) || (MOUSE_DRAGGED == message)) - { - return mouseDown; - } - else if (MOUSE_RELEASED == message) - { - return mouseUp; - } - return nullEvent; -} // ConvertMouseMessageToMacMouseEvent() -#endif - - -/* - * JNI interfaces - */ - -// I need this extern "C" for reasons I won't go into right now.... -// - Mark -#ifdef XP_UNIX -extern "C" { -#endif - -/* - * Class: BrowserControlNativeShim - * Method: raptorInitialize - * Signature: (Ljava/lang/String;)V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeInitialize( - JNIEnv *env, - jobject obj, - jstring verifiedBinDirAbsolutePath) -{ - JNIEnv * pEnv = env; - jobject jobj = obj; - static PRBool gFirstTime = PR_TRUE; - if (gFirstTime) - { - const char *nativePath = (const char *) env->GetStringUTFChars(verifiedBinDirAbsolutePath, 0); - gBinDir = nativePath; - - NS_InitXPCOM(NULL, &gBinDir); - NS_SetupRegistry(); - nsComponentManager::RegisterComponentLib(kSessionHistoryCID, NULL, - NULL, APPSHELL_DLL, - PR_FALSE, PR_FALSE); - NS_AutoregisterComponents(); - gFirstTime = PR_FALSE; - } -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeInitialize() - - -/* - * Class: BrowserControlNativeShim - * Method: raptorTerminate - * Signature: ()V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeTerminate ( - JNIEnv * env, - jobject obj) -{ - JNIEnv * pEnv = env; - jobject jobj = obj; - -#if DEBUG_RAPTOR_CANVAS - printf("raptorTerminate() called\n"); -#endif - -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeTerminate() - - -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeDummy ( - JNIEnv * env, - jobject obj, - jobject shimObj) -{ - printf("Inside C++ - before GetObjectClass call\n"); - jclass cls = env->GetObjectClass(shimObj); - jfieldID fid = env->GetFieldID(cls, "initialized", "Z"); - jboolean ans = env->GetBooleanField(cls, fid); - printf("Inside C++ - value of Initialized is %b\n", ans); - return; -} - - - -/* - * Class: BrowserControlNativeShim - * Method: raptorWebShellCreate - * Signature: (IIIIII)I - */ -JNIEXPORT jint JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellCreate ( - JNIEnv * env, - jobject obj, - jint windowPtr, - jint x, - jint y, - jint width, - jint height, - jobject implObj) -{ - jobject jobj = obj; -#ifdef XP_MAC - WindowPtr pWindow = (WindowPtr) windowPtr; - Rect webRect = pWindow->portRect; - // nsIWidget * pWidget = (nsIWidget *) widgetPtr; -#elif defined(XP_PC) - // elif defined(XP_WIN) - HWND parentHWnd = (HWND)windowPtr; -#elif defined(XP_UNIX) - GtkWidget * parentHWnd = (GtkWidget *) windowPtr; -#endif - - if (parentHWnd == nsnull) { - ::ThrowExceptionToJava(env, "Exception: null window handle passed to raptorWebShellCreate"); - return (jint) 0; - } - WebShellInitContext* initContext = new WebShellInitContext; - - initContext->initComplete = FALSE; - initContext->initFailCode = 0; - initContext->parentHWnd = parentHWnd; - initContext->webShell = NULL; - initContext->embeddedThread = NULL; - initContext->actionQueue = NULL; - initContext->env = env; - initContext->stopThread = FALSE; - initContext->x = x; - initContext->y = y; - initContext->w = width; - initContext->h = height; - -#ifdef XP_UNIX - jclass cls = env->GetObjectClass(implObj); // Get Class for BrowserControlImpl object - // Get myCanvas IVar - jfieldID fid = env->GetFieldID(cls, "myCanvas", "Ljava/awt/Canvas;"); - if (NULL == fid) { - ::ThrowExceptionToJava(env, "Exception: field myCanvas not found in the jobject for BrowserControlImpl"); - return (jint) 0; - } - jobject canvasObj = env->GetObjectField(implObj, fid); - jclass canvasCls = env->GetObjectClass(canvasObj); - if (NULL == canvasCls) { - ::ThrowExceptionToJava(env, "Exception: "); - return (jint) 0; - } - jfieldID gtkfid = env->GetFieldID(canvasCls, "gtkWinPtr", "I"); - if (NULL == gtkfid) { - ::ThrowExceptionToJava(env, "Exception: field gtkWinPtr not found in the jobject for BrowserControlCanvas"); - return (jint) 0; - } - jint mozPtr = env->GetIntField(canvasObj, gtkfid); - initContext->gtkPtr = (int) mozPtr; -#else - initContext->gtkPtr = NULL; -#endif - - -#ifdef XP_UNIX - // This probably needs some explaining... - // On Unix, instead of using a NSPR thread to manage our Mozilla event loop, we - // use a Java Thread (for reasons I won't go into now, see - // org.mozilla.webclient.motif.NativeEventThread for more details). This java thread will - // process any pending native events in - // org.mozilla.webclient.motif.NativeEventThread.processNativeEventQueue() - // (see below). However, when processNativeEventQueue() gets called, it needs access to it's associated - // WebShellInitContext structure in order to process any GTK / Mozilla related events. So what we - // do is we keep a static Hashtable inside the class NativeEventThread to store mappings of - // gtkWindowID's to WebShellInitContext's (since there is one WebShellInitContext to one GTK Window). - // This is what this part of the code does: - // - // 1) It first accesses the class org.mozilla.webclient.motif.NativeEventThread - // 2) It then accesses a static method in this class called "storeContext()" which takes as - // arguments, a GTK window pointer and a WebShellInitContext pointer - // 3) Then it invokes the method - // 4) Inside NativeEventThread.run(), you can see the code which fetches the appropriate - // WebShellInitContext and then calls processNativeEventQueue() with it below. - - // PENDING(mark): Should we cache this? Probably.... - jclass mozillaEventThreadClass = env->FindClass("org/mozilla/webclient/motif/NativeEventThread"); - - if (mozillaEventThreadClass == NULL) { - printf("Error: Cannot find class org.mozilla.webclient.motif.NativeEventThread!\n"); - - ThrowExceptionToJava(env, "Error: Cannot find class org.mozilla.webclient.motif.NativeEventThread!"); - return 0; - } - - jmethodID storeMethodID = env->GetStaticMethodID(mozillaEventThreadClass, "storeContext", "(II)V"); - - if (storeMethodID == NULL) { - printf("Error: Cannot get static method storeContext(int, int) from NativeEventThread!\n"); - - ThrowExceptionToJava(env, "Error: Cannot get static method storeContext(int, int) from NativeEventThread!"); - return 0; - } - - // PENDING(mark): How do I catch this if there's an exception? - env->CallStaticVoidMethod(mozillaEventThreadClass, storeMethodID, windowPtr, (int) initContext); -#else - InitEmbeddedEventHandler(initContext); -#endif - - return (jint) initContext; -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellCreate() - - -/* - * Class: BrowserControlNativeShim - * Method: raptorWebShellDelete - * Signature: (I)V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellDelete ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - JNIEnv * pEnv = env; - jobject jobj = obj; - - if (webShellPtr) - { - WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr; - - // stop the event thread - initContext->stopThread = 1; - while (initContext->stopThread <= 1) { - ; // TODO there's got to be a better way than this. ::PR_Interrupt()? - } - - delete (initContext->webShell); - // TODO delete the other things too (thread, action queue, etc.) - delete initContext; - } - else { - ::ThrowExceptionToJava(env, "Exception: null webShellPtr passed to raptorWebShellDelete"); - } - -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellDelete() - - -/* - * Class: BrowserControlNativeShim - * Method: raptorWebShellLoadURL - * Signature: (ILjava/lang/String;)V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellLoadURL ( - JNIEnv * env, - jobject obj, - jint webShellPtr, - jstring urlString) -{ - jobject jobj = obj; - const char * urlChars = (char *) env->GetStringUTFChars(urlString, 0); - - printf("Native URL = \"%s\"\n", urlChars); - env->ReleaseStringUTFChars(urlString, urlChars); - - PRUnichar * urlStringChars = (PRUnichar *) env->GetStringChars(urlString, 0); - - if (env->ExceptionOccurred()) - { - ::ThrowExceptionToJava(env, "raptorWebShellLoadURL Exception: unable to extract Java string"); - if (urlStringChars != NULL) - env->ReleaseStringChars(urlString, urlStringChars); - return; - } - - WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr; - - if (initContext == nsnull) { - ::ThrowExceptionToJava(env, "Exception: null webShellPtr passed to raptorWebShellLoadURL"); - if (urlStringChars != NULL) - env->ReleaseStringChars(urlString, urlStringChars); - return; - } - - if (initContext->initComplete) { - wsLoadURLEvent * actionEvent = new wsLoadURLEvent(initContext->webShell, urlStringChars); - PLEvent * event = (PLEvent*) *actionEvent; - - ::PostEvent(initContext, event); - } - - env->ReleaseStringChars(urlString, urlStringChars); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellLoadURL() - - -/* - * Class: BrowserControlNativeShim - * Method: raptorWebShellStop - * Signature: (I)V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellStop ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - JNIEnv * pEnv = env; - jobject jobj = obj; - - WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr; - - if (initContext == nsnull) { - ::ThrowExceptionToJava(env, "Exception: null webShellPtr passed to raptorWebShellStop"); - return; - } - - if (initContext->initComplete) { - wsStopEvent * actionEvent = new wsStopEvent(initContext->webShell); - PLEvent * event = (PLEvent*) *actionEvent; - - ::PostEvent(initContext, event); - } -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellStop() - - -/* - * Class: BrowserControlNativeShim - * Method: raptorWebShellShow - * Signature: (I)V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellShow ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - JNIEnv * pEnv = env; - jobject jobj = obj; - - WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr; - - if (initContext == nsnull) { - ::ThrowExceptionToJava(env, "Exception: null webShellPtr passed to raptorWebShellShow"); - return; - } - - if (initContext->initComplete) { - wsShowEvent * actionEvent = new wsShowEvent(initContext->webShell); - PLEvent * event = (PLEvent*) *actionEvent; - - ::PostEvent(initContext, event); - } -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellShow() - - -/* - * Class: BrowserControlNativeShim - * Method: raptorWebShellHide - * Signature: (I)V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellHide ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - JNIEnv * pEnv = env; - jobject jobj = obj; - - WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr; - - if (initContext == nsnull) { - ::ThrowExceptionToJava(env, "Exception: null webShellPtr passed to raptorWebShellHide"); - return; - } - - if (initContext->initComplete) { - wsHideEvent * actionEvent = new wsHideEvent(initContext->webShell); - PLEvent * event = (PLEvent*) *actionEvent; - - ::PostEvent(initContext, event); - } - -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellHide() - - -/* - * Class: BrowserControlNativeShim - * Method: raptorWebShellSetBounds - * Signature: (IIIII)V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellSetBounds ( - JNIEnv * env, - jobject obj, - jint webShellPtr, - jint x, - jint y, - jint width, - jint height) -{ - JNIEnv * pEnv = env; - jobject jobj = obj; - - WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr; - - if (initContext == nsnull) { - ::ThrowExceptionToJava(env, "Exception: null webShellPtr passed to raptorWebShellSetBounds"); - return; - } - - if (initContext->initComplete) { - wsResizeEvent * actionEvent = new wsResizeEvent(initContext->webShell, x, y, width, height); - PLEvent * event = (PLEvent*) *actionEvent; - - ::PostEvent(initContext, event); - } - -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellSetBounds() - - -/* - * Class: BrowserControlNativeShim - * Method: raptorWebShellMoveTo - * Signature: (III)V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellMoveTo ( - JNIEnv * env, - jobject obj, - jint webShellPtr, - jint x, - jint y) -{ - JNIEnv * pEnv = env; - jobject jobj = obj; - - WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr; - - if (initContext == nsnull) { - ::ThrowExceptionToJava(env, "Exception: null webShellPtr passed to raptorWebShellMoveTo"); - return; - } - - if (initContext->initComplete) { - wsMoveToEvent * actionEvent = new wsMoveToEvent(initContext->webShell, x, y); - PLEvent * event = (PLEvent*) *actionEvent; - - ::PostEvent(initContext, event); - } - -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellMoveTo() - - -/* - * Class: BrowserControlNativeShim - * Method: raptorWebShellSetFocus - * Signature: (I)V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellSetFocus ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - JNIEnv * pEnv = env; - jobject jobj = obj; - - WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr; - - if (initContext == nsnull) { - ::ThrowExceptionToJava(env, "Exception: null webShellPtr passed to raptorWebShellSetFocus"); - return; - } - - if (initContext->initComplete) { - wsSetFocusEvent * actionEvent = new wsSetFocusEvent(initContext->webShell); - PLEvent * event = (PLEvent*) *actionEvent; - - ::PostEvent(initContext, event); - } - -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellSetFocus() - - -/* - * Class: BrowserControlNativeShim - * Method: raptorWebShellRemoveFocus - * Signature: (I)V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellRemoveFocus ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - JNIEnv * pEnv = env; - jobject jobj = obj; - - WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr; - - if (initContext == nsnull) { - ::ThrowExceptionToJava(env, "Exception: null webShellPtr passed to raptorWebShellRemoveFocus"); - return; - } - - if (initContext->initComplete) { - wsRemoveFocusEvent * actionEvent = new wsRemoveFocusEvent(initContext->webShell); - PLEvent * event = (PLEvent*) *actionEvent; - - ::PostEvent(initContext, event); - } - -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellRemoveFocus() - - -/* - * Class: BrowserControlNativeShim - * Method: raptorWebShellRepaint - * Signature: (IZ)V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellRepaint ( - JNIEnv * env, - jobject obj, - jint webShellPtr, - jboolean forceRepaint) -{ - JNIEnv * pEnv = env; - jobject jobj = obj; - - WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr; - - if (initContext == nsnull) { - ::ThrowExceptionToJava(env, "Exception: null webShellPtr passed to raptorWebShellRepaint"); - return; - } - - if (initContext->initComplete) { - wsRepaintEvent * actionEvent = new wsRepaintEvent(initContext->webShell, (PRBool) forceRepaint); - PLEvent * event = (PLEvent*) *actionEvent; - - ::PostEvent(initContext, event); - } - -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellRepaint() - - -/* - * Class: BrowserControlNativeShim - * Method: raptorWebShellCanBack - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellCanBack ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - JNIEnv * pEnv = env; - jobject jobj = obj; - void * voidResult = nsnull; - - WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr; - - if (initContext == nsnull) { - ::ThrowExceptionToJava(env, "Exception: null webShellPtr passed to raptorWebShellCanBack"); - return JNI_FALSE; - } - - if (initContext->initComplete) { - wsCanBackEvent * actionEvent = new wsCanBackEvent(initContext->webShell); - PLEvent * event = (PLEvent*) *actionEvent; - - voidResult = ::PostSynchronousEvent(initContext, event); - - return (NS_FAILED((nsresult) voidResult)) ? JNI_FALSE : JNI_TRUE; - } - - return JNI_FALSE; -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellCanBack() - - -/* - * Class: BrowserControlNativeShim - * Method: raptorWebShellCanForward - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellCanForward ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - JNIEnv * pEnv = env; - jobject jobj = obj; - void * voidResult = nsnull; - - WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr; - - if (initContext == nsnull) { - ::ThrowExceptionToJava(env, "Exception: null webShellPtr passed to raptorWebShellCanForward"); - return JNI_FALSE; - } - - if (initContext->initComplete) { - wsCanForwardEvent * actionEvent = new wsCanForwardEvent(initContext->webShell); - PLEvent * event = (PLEvent*) *actionEvent; - - voidResult = ::PostSynchronousEvent(initContext, event); - - return (NS_FAILED((nsresult) voidResult)) ? JNI_FALSE : JNI_TRUE; - } - - return JNI_FALSE; -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellCanForward() - - -/* - * Class: BrowserControlNativeShim - * Method: raptorWebShellBack - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellBack ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - JNIEnv * pEnv = env; - jobject jobj = obj; - void * voidResult = nsnull; - - WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr; - - if (initContext == nsnull) { - ::ThrowExceptionToJava(env, "Exception: null webShellPtr passed to raptorWebShellBack"); - return JNI_FALSE; - } - - if (initContext->initComplete) { - wsBackEvent * actionEvent = new wsBackEvent(initContext->webShell); - PLEvent * event = (PLEvent*) *actionEvent; - - voidResult = ::PostSynchronousEvent(initContext, event); - - return (NS_FAILED((nsresult) voidResult)) ? JNI_FALSE : JNI_TRUE; - } - - return JNI_FALSE; -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellBack() - -JNIEXPORT jboolean JNICALL - Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellAddDocListener - (JNIEnv *env, - jobject obj, - jint webShellPtr, - jobject doclistener) -{ - - // need to pass in the environment to the addition of c doclistener, so - // that it can call into the java stuff again - DocumentObserver * documentObserver = new DocumentObserver(env, obj, webShellPtr, doclistener); - - WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr; - - if (initContext == nsnull) { - ::ThrowExceptionToJava(env, "Exception: null webShellPtr passed to raptorWebShellAddDocListener"); - return JNI_FALSE; - } - - if (initContext->initComplete) { - nsIDocumentLoader *docloader; - initContext->webShell->GetDocumentLoader(docloader ); - if (docloader != nsnull) { - docloader->AddObserver((nsIDocumentLoaderObserver *) documentObserver); - } - - } - return JNI_TRUE; -} - -/* - * Class: BrowserControlNativeShim - * Method: raptorWebShellForward - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellForward ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - JNIEnv * pEnv = env; - jobject jobj = obj; - void * voidResult = nsnull; - - WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr; - - if (initContext == nsnull) { - ::ThrowExceptionToJava(env, "Exception: null webShellPtr passed to raptorWebShellForward"); - return JNI_FALSE; - } - - if (initContext->initComplete) { - wsForwardEvent * actionEvent = new wsForwardEvent(initContext->webShell); - PLEvent * event = (PLEvent*) *actionEvent; - - voidResult = ::PostSynchronousEvent(initContext, event); - - return (NS_FAILED((nsresult) voidResult)) ? JNI_FALSE : JNI_TRUE; - } - - return JNI_FALSE; -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellForward() - - -/* - * Class: BrowserControlNativeShim - * Method: raptorWebShellGoTo - * Signature: (II)Z - */ -JNIEXPORT jboolean JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellGoTo ( - JNIEnv * env, - jobject obj, - jint webShellPtr, - jint historyIndex) -{ - JNIEnv * pEnv = env; - jobject jobj = obj; - void * voidResult = nsnull; - - WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr; - - if (initContext == nsnull) { - ::ThrowExceptionToJava(env, "Exception: null webShellPtr passed to raptorWebShellGoTo"); - return JNI_FALSE; - } - - if (initContext->initComplete) { - wsGoToEvent * actionEvent = new wsGoToEvent(initContext->webShell, historyIndex); - PLEvent * event = (PLEvent*) *actionEvent; - - voidResult = ::PostSynchronousEvent(initContext, event); - - return (NS_FAILED((nsresult) voidResult)) ? JNI_FALSE : JNI_TRUE; - } - - return JNI_FALSE; -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellGoTo() - - -/* - * Class: BrowserControlNativeShim - * Method: raptorWebShellGetHistoryLength - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellGetHistoryLength ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - JNIEnv * pEnv = env; - jobject jobj = obj; - void * voidResult = nsnull; - - WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr; - - if (initContext == nsnull) { - ::ThrowExceptionToJava(env, "Exception: null webShellPtr passed to raptorWebShellGetHistoryLength"); - return 0; - } - - if (initContext->initComplete) { - wsGetHistoryLengthEvent * actionEvent = new wsGetHistoryLengthEvent(initContext->webShell); - PLEvent * event = (PLEvent*) *actionEvent; - - voidResult = ::PostSynchronousEvent(initContext, event); - - return ((jint) voidResult); - } - - return 0; -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellGetHistoryLength() - - -/* - * Class: BrowserControlNativeShim - * Method: raptorWebShellGetHistoryIndex - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellGetHistoryIndex ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - JNIEnv * pEnv = env; - jobject jobj = obj; - void * voidResult = nsnull; - - WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr; - - if (initContext == nsnull) { - ::ThrowExceptionToJava(env, "Exception: null webShellPtr passed to raptorWebShellGetHistoryIndex"); - return 0; - } - - if (initContext->initComplete) { - wsGetHistoryIndexEvent * actionEvent = new wsGetHistoryIndexEvent(initContext->webShell); - PLEvent * event = (PLEvent*) *actionEvent; - - voidResult = ::PostSynchronousEvent(initContext, event); - - return ((jint) voidResult); - } - - return 0; -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellGetHistoryIndex() - - -/* - * Class: BrowserControlNativeShim - * Method: raptorWebShellGetURL - * Signature: (II)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellGetURL ( - JNIEnv * env, - jobject obj, - jint webShellPtr, - jint historyIndex) -{ - JNIEnv * pEnv = env; - jobject jobj = obj; - void * voidResult = nsnull; - jstring urlString = nsnull; - - WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr; - - if (initContext == nsnull) { - ::ThrowExceptionToJava(env, "Exception: null webShellPtr passed to raptorWebShellGetURL"); - return nsnull; - } - - if (initContext->initComplete) { - wsGetURLEvent * actionEvent = new wsGetURLEvent(initContext->webShell, historyIndex); - PLEvent * event = (PLEvent*) *actionEvent; - - voidResult = ::PostSynchronousEvent(initContext, event); - - if (voidResult != nsnull) { - -#ifdef NECKO - nsString * string = new nsString((PRUnichar *) voidResult); -#else - nsString1 * string = new nsString1((PRUnichar *) voidResult); -#endif - if (string == nsnull) { - ::ThrowExceptionToJava(env, "raptorWebShellGetURL Exception: unable to create Java string"); - return nsnull; - } - - int length = string->Length(); - - delete string; - - urlString = env->NewString((PRUnichar *) voidResult, length); - - if (env->ExceptionOccurred()) - { - ::ThrowExceptionToJava(env, "raptorWebShellGetURL Exception: unable to create Java string"); - return nsnull; - } - } - else { - ::ThrowExceptionToJava(env, "raptorWebShellGetURL Exception: GetURL() returned NULL"); - return nsnull; - } - } - - return urlString; -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellGetURL() - -// added my Mark Goddard OTMP 9/2/1999 -/* - * Class: org_mozilla_webclient_BrowserControlNativeShim - * Method: nativeWebShellRefresh - * Signature: (I)V - */ -JNIEXPORT jboolean JNICALL - Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellRefresh ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - JNIEnv * pEnv = env; - jobject jobj = obj; - void * voidResult = nsnull; - - WebShellInitContext* initContext = (WebShellInitContext *) webShellPtr; - - if (initContext == nsnull) { - ::ThrowExceptionToJava(env, "Exception: null webShellPtr passed to raptorWebShellRefresh"); - return JNI_FALSE; - } - - if (initContext->initComplete) { - wsRefreshEvent * actionEvent = new wsRefreshEvent(initContext->webShell); - PLEvent * event = (PLEvent*) *actionEvent; - - voidResult = ::PostSynchronousEvent(initContext, event); - - return (NS_FAILED((nsresult) voidResult)) ? JNI_FALSE : JNI_TRUE; - } - - return JNI_FALSE; -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellBack() - - -#ifdef XP_UNIX -/* - * Class: org_mozilla_webclient_motif_MotifMozillaEventQueue - * Method: processNativeEventQueue - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_org_mozilla_webclient_motif_NativeEventThread_processNativeEventQueue - (JNIEnv * env, jobject obj, jint webShellInitContextPtr) { - // Given a WebShellInitContext pointer, process any pending Mozilla / GTK events - WebShellInitContext * initContext = (WebShellInitContext *) webShellInitContextPtr; - - // Initialize the WebShellInitContext if it's hasn't been already - if (initContext->initComplete == FALSE) { - InitEmbeddedEventHandler(initContext); - } - - // Process any pending events... - processEventLoop(initContext); -} -#endif - -/* - * Class: org_mozilla_webclient_BrowserControlNativeShim - * Method: nativeDebugBreak - * Signature: (Ljava/lang/String;I)V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeDebugBreak(JNIEnv *jEnv, - jclass myClass, - jstring fileName, - jint lineNumber) -{ - const char *charFileName = (char *) jEnv->GetStringUTFChars(fileName, 0); - nsDebug::Break(charFileName, lineNumber); -} - - -#ifdef XP_UNIX -}// End extern "C" -#endif - - -void -PostEvent (WebShellInitContext * initContext, PLEvent * event) -{ - PL_ENTER_EVENT_QUEUE_MONITOR(initContext->actionQueue); - - ::PL_PostEvent(initContext->actionQueue, event); - - PL_EXIT_EVENT_QUEUE_MONITOR(initContext->actionQueue); -} // PostEvent() - - -void * -PostSynchronousEvent (WebShellInitContext * initContext, PLEvent * event) -{ - void * voidResult = nsnull; - - PL_ENTER_EVENT_QUEUE_MONITOR(initContext->actionQueue); - - voidResult = ::PL_PostSynchronousEvent(initContext->actionQueue, event); - - PL_EXIT_EVENT_QUEUE_MONITOR(initContext->actionQueue); - - return voidResult; -} // PostSynchronousEvent() - - - -// EOF - diff --git a/mozilla/java/webclient/src/DocumentObserver.cpp b/mozilla/java/webclient/src/DocumentObserver.cpp deleted file mode 100644 index 94838f828de..00000000000 --- a/mozilla/java/webclient/src/DocumentObserver.cpp +++ /dev/null @@ -1,144 +0,0 @@ -#include "nsString.h" -#include "DocumentObserver.h" -#include "nsIDocumentLoaderObserver.h" -#include "nsISupportsUtils.h" -#include -#include "jni_util.h" -#include - -void fireDocumentLoadEvent(char *); - -static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); -static NS_DEFINE_IID(kIDocumentLoaderObserverIID, NS_IDOCUMENT_LOADER_OBSERVER_IID); - - -NS_IMPL_ADDREF(DocumentObserver); -NS_IMPL_RELEASE(DocumentObserver); - -jobject peer; -JavaVM *vm = NULL; - -DocumentObserver::DocumentObserver(){ -} - -DocumentObserver::DocumentObserver(JNIEnv *env, jobject obj, - jint webShellPtr, - jobject doclistener) { - env->GetJavaVM(&vm); // save this vm reference away for the callback! - peer = env->NewGlobalRef(doclistener); -} - -NS_IMETHODIMP DocumentObserver::QueryInterface(REFNSIID aIID, void** aInstance) -{ - if (NULL == aInstance) - return NS_ERROR_NULL_POINTER; - - *aInstance = NULL; - - - if (aIID.Equals(kIDocumentLoaderObserverIID)) { - *aInstance = (void*) ((nsIDocumentLoaderObserver*)this); - NS_ADDREF_THIS(); - return NS_OK; - } - - - return NS_NOINTERFACE; -} - - /* nsIDocumentLoaderObserver methods */ - NS_IMETHODIMP DocumentObserver::OnStartDocumentLoad(nsIDocumentLoader* loader, - nsIURI* aURL, - const char* aCommand) -{ - printf("DocumentObserver.cpp: OnStartDocumentLoad\n"); - fireDocumentLoadEvent("startdocumentload"); - - return NS_OK; -} - - NS_IMETHODIMP DocumentObserver::OnEndDocumentLoad(nsIDocumentLoader* loader, - nsIChannel* channel, - nsresult aStatus) { - printf("!!DocumentObserver.cpp: OnEndDocumentLoad\n"); - fireDocumentLoadEvent("enddocumentload"); - - return NS_OK; - } - -void fireDocumentLoadEvent(char *eventname) { - JNIEnv *env = (JNIEnv *) JNU_GetEnv(vm, JNI_VERSION_1_2); - - if (env == NULL) { - return; - } - - jclass clazz = env->GetObjectClass(peer); - jmethodID mid = env->GetMethodID(clazz, "docEventPerformed", "(Ljava/lang/String;)V"); - jstring testmsg = env->NewStringUTF(eventname); - if ( mid != NULL) { - env->CallVoidMethod(peer, mid, testmsg); - } else { - printf("cannot call the Java Method!\n"); - } -} - - NS_IMETHODIMP DocumentObserver::OnStartURLLoad(nsIDocumentLoader* loader, - nsIChannel* channel) { - printf("!DocumentObserver: OnStartURLLoad\n"); - fireDocumentLoadEvent("startURLload"); - - return NS_OK;} - - NS_IMETHODIMP DocumentObserver::OnProgressURLLoad(nsIDocumentLoader* loader, -#ifdef NECKO - nsIChannel* channel, -#else - nsIURI* aURL, -#endif - PRUint32 aProgress, - PRUint32 aProgressMax) { - printf("!DocumentObserver: OnProgressURLLoad\n"); - fireDocumentLoadEvent("progressURLload"); - - return NS_OK;} - - NS_IMETHODIMP DocumentObserver::OnStatusURLLoad(nsIDocumentLoader* loader, -#ifdef NECKO - nsIChannel* channel, -#else - nsIURI* aURL, -#endif - nsString& aMsg) { - printf("!DocumentObserver: OnStatusURLLoad\n"); - fireDocumentLoadEvent("statusURLload"); - - return NS_OK;} - NS_IMETHODIMP DocumentObserver::OnEndURLLoad(nsIDocumentLoader* loader, -#ifdef NECKO - nsIChannel* channel, - nsresult aStatus) { - printf("!DocumentObserver: OnEndURLLoad\n"); - fireDocumentLoadEvent("onendURLload"); - - return NS_OK;} -#else - nsIURI* aURL, - PRInt32 aStatus) {return NS_OK;} -#endif - - NS_IMETHODIMP DocumentObserver::HandleUnknownContentType(nsIDocumentLoader* loader, -#ifdef NECKO - nsIChannel* channel, -#else - nsIURI* aURL, -#endif - const char *aContentType, - const char *aCommand) { - printf("!DocumentObserver: HandleUnknownContentType\n"); -fireDocumentLoadEvent("handleunknown content"); - -return NS_OK;} - - - diff --git a/mozilla/java/webclient/src/DocumentObserver.h b/mozilla/java/webclient/src/DocumentObserver.h deleted file mode 100644 index 1712cc285c1..00000000000 --- a/mozilla/java/webclient/src/DocumentObserver.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - 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 "nsISupports.h" -#include "nsISupportsUtils.h" -#include "nsString.h" -#include "nsIDocumentLoaderObserver.h" -#include "jni.h" - -class nsIURI; - - -class DocumentObserver : public nsIDocumentLoaderObserver { - NS_DECL_ISUPPORTS - public: - - DocumentObserver::DocumentObserver(JNIEnv *env, jobject obj, - jint webShellPtr, - jobject doclistener); - - DocumentObserver::DocumentObserver(); - - /* nsIDocumentLoaderObserver methods */ - NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, - nsIURI* aURL, - const char* aCommand); - - NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, - nsIChannel* channel, - nsresult aStatus); - - NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, - nsIChannel* channel); - - NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader, -#ifdef NECKO - nsIChannel* channel, -#else - nsIURI* aURL, -#endif - PRUint32 aProgress, - PRUint32 aProgressMax); - - NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, -#ifdef NECKO - nsIChannel* channel, -#else - nsIURI* aURL, -#endif - nsString& aMsg); - - NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, -#ifdef NECKO - nsIChannel* channel, - nsresult aStatus); -#else - nsIURI* aURL, - PRInt32 aStatus); -#endif - - NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader, -#ifdef NECKO - nsIChannel* channel, -#else - nsIURI* aURL, -#endif - const char *aContentType, - const char *aCommand); - -}; - - - diff --git a/mozilla/java/webclient/src/Makefile.in b/mozilla/java/webclient/src/Makefile.in deleted file mode 100644 index dd381ef6d2a..00000000000 --- a/mozilla/java/webclient/src/Makefile.in +++ /dev/null @@ -1,101 +0,0 @@ -#//------------------------------------------------------------------------ -#// -#// Makefile to build the native portion of webclient -#// -#//------------------------------------------------------------------------ - -DEPTH = ../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -#//------------------------------------------------------------------------ -#// -#// Specify any "command" targets. (ie. DIRS, INSTALL_FILES, ...) -#// (these must come before the common makefiles are included) -#// -#// DIRS - There are subdirectories to process -#// -#//------------------------------------------------------------------------ -DIRS= motif - - -include $(topsrcdir)/config/config.mk - -MODULE = webclient -LIBRARY_NAME = webclient - -NO_LD_ARCHIVE_FLAGS = 1 - -CPPSRCS = nsActions.cpp \ - BrowserControlNativeShim.cpp - -ifeq ($(OS_TARGET),SunOS) -JDK_PLATFORM_PATH=jre/lib/sparc -else -JDK_PLATFORM_PATH=jre/lib/i386 -endif - -GTKLIBS = -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk -lgmodule -lglib -ldl -lXext -lX11 -lm -JAVALIBS = -L${JDKHOME}/$(JDK_PLATFORM_PATH) -L${JDKHOME}/$(JDK_PLATFORM_PATH)/classic -L${JDKHOME}/$(JDK_PLATFORM_PATH)/native_threads -ljava - -EXTRA_DSO_LDOPTS = \ - $(GTKLIBS) \ - $(JAVALIBS) \ - $(NULL) - -EXTRA_LIBS = \ - raptorgfx \ - expat \ - xmltok \ - jsurl \ - mozdbm \ - mozjs \ - secfree \ - mozutil \ - nspr3 \ - xp \ - jpeg \ - png \ - z \ - pthread \ - xpcom \ - img \ - plds3 \ - gfx_gtk \ - raptorwebwidget \ - raptorhtmlpars \ - raptorplugin \ - pref \ - jsdom \ - timer_gtk_s \ - $(DEPTH)/xpfe/bootstrap/nsSetupRegistry.o \ - $(NULL) - -SHARED_LIBRARY_LIBS = $(DIST)/lib/libwebclient_motif.a - -ifeq ($(NSPR_INCLUDE_DIR),) -INCLUDES += -I$(DIST)/include/private -else -INCLUDES += -I$(NSPR_INCLUDE_DIR)/private -endif - -include $(topsrcdir)/config/rules.mk - -#ifndef MOZ_MONOLITHIC_TOOLKIT -CXXFLAGS += $(MOZ_GTK_CFLAGS) -CFLAGS += $(MOZ_GTK_CFLAGS) -#else -CXXFLAGS += $(TK_CFLAGS) -CFLAGS += $(TK_CFLAGS) -#endif - -DEFINES += -D_REENTRANT -DNECKO -DXP_UNIX -DDEBUG_RAPTOR_CANVAS - -export:: BrowserControlNativeShim.h - -BrowserControlMozillaShim.h: - @echo Assuming class org.mozilla.webclient.BrowserControlNativeShim is in $(JAVAH_FLAGS) - $(JAVAH) $(JAVAH_FLAGS) -o $@ org.mozilla.webclient.BrowserControlNativeShim diff --git a/mozilla/java/webclient/src/Makefile.solaris b/mozilla/java/webclient/src/Makefile.solaris deleted file mode 100644 index 0fa7664458b..00000000000 --- a/mozilla/java/webclient/src/Makefile.solaris +++ /dev/null @@ -1,83 +0,0 @@ -# -# PENDING(mark): I need to use gtk-config to find the libraries and -# include files -# For JDK1.2 -JAVADIR = ${JDKHOME} -DLLNAME = libwebclient.so -DLLNAMESTUB = libwebclientstub.so -MOZILLA_TOP = ../../.. -DIST = ${MOZILLA_TOP}/dist -LIBDIR = ${DIST}/lib -CC = gcc -g -MKSHLIB = cc -G -# WARNING: YOU NEED TO RUN 'gtk-config --cflags' and stick it in here -GTKINCLUDES = -I/usr/openwin/include -I/opt/local/lib/glib/include -I/opt/local/include -# WARNING: YOU NEED TO RUN 'gtk-config --libs' and stick it in here -GTKLIBS = -L/opt/local/lib -L/usr/openwin/lib -R/usr/openwin/lib -lgtk -lgdk -lgmodule -lglib -ldl -lintl -lXext -lX11 -lsocket -lnsl -lm -L/usr/dt/lib -JAVAINCLUDE = -I${JAVADIR}/include -I${JAVADIR}/include/solaris -# For JDK1.2 -# For Solaris -JAVALIBS = -L${JAVADIR}/jre/lib/sparc -ljava -INCLUDE = ${JAVAINCLUDE} -I${DIST}/include -I${MOZILLA_TOP}/widget/src/gtk ${GTKINCLUDES} ${GTKMOZILLAINCLUDE} -DEFINES = -D_REENTRANT -DNECKO -DXP_UNIX -DNS_DEBUG -DDEBUG_RAPTOR_CANVAS -DMOZ_DLL_SUFFIX=\".so\" -STUBDEFINES = -D_REENTRANT -STUBINCLUDE = ${JAVAINCLUDE} -STUBLIBS = ${JAVALIBS} /usr/lib/libC.so.5 -# For the latest mozilla build -LIBS = ${GTKLIBS} ${JAVALIBS} \ --L${DIST}/bin -L${LIBDIR} -lraptorgfx -lexpat_s -lxmltok_s -lmozjs -lmozutil_s -lnspr3 -ljpeg -lpng -lzlib -lpthread -lXm -lXt -L${DIST}/lib -lxpcom -limg_s -lplds3 -lgfx_gtk -lraptorwebwidget -lraptorplugin -lgtksuperwin -lwidget_gtk -lplds3 -lplc3 -ljsdom -L${DIST}/lib -ltimer_s /usr/lib/libC.so.5 - -#-L${DIST}/bin -L${LIBDIR} -lraptorgfx -lexpat_s -lxmltok_s -ljsurl -lmozdbm -lmozjs -lmozutil_s -lnspr3 -lxp -ljpeg -lpng -lz -lpthread -lXm -lXt -L${DIST}/lib -lxpcom -limg -lplds3 -lgfx_gtk -lgkwebwidget -lgkhtmlpars -lgkplugin -lpref -lplds3 -lplc3 -ljsdom -L${DIST}/lib -ltimer_gtk_s /usr/lib/libC.so.5 -LN = ln -f -s - -all: libwebclientstub.so libwebclient.so copy - -copy: - cp libwebclient*.so ${DIST}/bin - -# component.reg components - -component.reg: - ${LN} ${DIST}/bin/component.reg - -components: - ${LN} ${DIST}/bin/components - -libwebclientstub.so: BrowserControlNativeShimStub.o MotifBrowserControlCanvasStub.o - ${MKSHLIB} -o ${DLLNAMESTUB} BrowserControlNativeShimStub.o MotifBrowserControlCanvasStub.o ${STUBLIBS} - -libwebclient.so: BrowserControlNativeShim.o MotifBrowserControlCanvas.o gtkmozilla.o nsActions.o nsSetupRegistry.o DocumentObserver.o - ${MKSHLIB} -o ${DLLNAME} BrowserControlNativeShim.o MotifBrowserControlCanvas.o gtkmozilla.o nsActions.o nsSetupRegistry.o DocumentObserver.o ${LIBS} - -gtkmozilla.o: motif/gtkmozilla.cpp - ${CC} ${DEFINES} ${INCLUDE} -c motif/gtkmozilla.cpp - -MotifBrowserControlCanvasStub.o: motif/MotifBrowserControlCanvasStub.cpp - ${CC} ${STUBDEFINES} ${STUBINCLUDE} -c motif/MotifBrowserControlCanvasStub.cpp - -MotifBrowserControlCanvas.o: motif/MotifBrowserControlCanvas.cpp - ${CC} ${DEFINES} ${INCLUDE} -c motif/MotifBrowserControlCanvas.cpp - -BrowserControlNativeShimStub.o: motif/BrowserControlNativeShimStub.cpp - ${CC} ${STUBDEFINES} ${STUBINCLUDE} -c motif/BrowserControlNativeShimStub.cpp - -BrowserControlNativeShim.o: BrowserControlNativeShim.cpp - ${CC} ${DEFINES} ${INCLUDE} -c BrowserControlNativeShim.cpp - -motif/nsSetupRegistry.cpp: - cd motif - ${LN} ${MOZILLA_TOP}/../xpfe/bootstrap/nsSetupRegistry.cpp motif/nsSetupRegistry.cpp - cd .. - -#PENDING(mark): I think we should use this for the Win32 version as well... -nsSetupRegistry.o: motif/nsSetupRegistry.cpp - ${CC} ${DEFINES} ${INCLUDE} -c motif/nsSetupRegistry.cpp - -nsActions.o: nsActions.cpp - ${CC} ${DEFINES} ${INCLUDE} -c nsActions.cpp - -DocumentObserver.o: DocumentObserver.cpp - ${CC} ${DEFINES} ${INCLUDE} -c DocumentObserver.cpp - -clean: - rm -f component.reg components *.o *.so *~ motif/*~ motif/nsSetupRegistry.cpp diff --git a/mozilla/java/webclient/src/Makefile.unix b/mozilla/java/webclient/src/Makefile.unix deleted file mode 100644 index 31f7868d575..00000000000 --- a/mozilla/java/webclient/src/Makefile.unix +++ /dev/null @@ -1,72 +0,0 @@ -# -# PENDING(mark): I need to use gtk-config to find the libraries and -# include files -# For JDK1.2 -JAVADIR = ${JDKHOME} -DLLNAME = libwebclient.so -DLLNAMESTUB = libwebclientstub.so -MOZILLA_TOP = ../../.. -DIST = ${MOZILLA_TOP}/dist -LIBDIR = ${DIST}/lib -# WARNING: YOU NEED TO RUN 'gtk-config --cflags' and stick it in here -GTKINCLUDES = -I/usr/X11R6/include -I/usr/lib/glib/include -# WARNING: YOU NEED TO RUN 'gtk-config --libs' and stick it in here -GTKLIBS = -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk -rdynamic -lgmodule -lglib -ldl -lXext -lX11 -lm -JAVAINCLUDE = -I${JAVADIR}/include -I${JAVADIR}/include/genunix -I${JAVADIR}/include/linux -# For JDK1.2 -# Native threads -JAVALIBS = -L${JAVADIR}/jre/lib/i386 -L${JAVADIR}/jre/lib/i386/classic -L${JAVADIR}/jre/lib/i386/native_threads -ljava -INCLUDE = ${JAVAINCLUDE} -I${DIST}/include ${GTKINCLUDES} ${GTKMOZILLAINCLUDE} -DEFINES = -D_REENTRANT -DNECKO -DXP_UNIX -DDEBUG_RAPTOR_CANVAS -DMOZ_DLL_SUFFIX=\".so\" -STUBDEFINES = -D_REENTRANT -STUBINCLUDE = ${JAVAINCLUDE} -STUBLIBS = ${JAVALIBS} -# For the latest mozilla build -LIBS = ${GTKLIBS} ${JAVALIBS} \ --L${DIST}/bin -lraptorgfx -lmozjs -lsecfree -lnspr3 -ljpeg -lpng -lz -lpthread -lXm -lXt -L${DIST}/lib -lxpcom -lplds3 -lgfx_gtk -lraptorwebwidget -lraptorhtmlpars -lraptorplugin -lpref -lplds3 -lplc3 -ljsdom -L${DIST}/lib -ltimer_s - -LN = ln -f -s - -all: libwebclientstub.so libwebclient.so component.reg components - -component.reg: - ${LN} ${DIST}/bin/component.reg - -components: - ${LN} ${DIST}/bin/components - -libwebclientstub.so: BrowserControlMozillaShimStub.o MotifBrowserControlCanvasStub.o - g++ -shared -Wl,-h -Wl,${DLLNAMESTUB} -o ${DLLNAMESTUB} BrowserControlMozillaShimStub.o MotifBrowserControlCanvasStub.o -Wl,--whole-archive ${STUBLIBS} -Wl,--no-whole-archive - -libwebclient.so: BrowserControlMozillaShim.o MotifBrowserControlCanvas.o gtkmozilla.o nsActions.o nsSetupRegistry.o - g++ -shared -Wl,-h -Wl,${DLLNAME} -o ${DLLNAME} BrowserControlMozillaShim.o MotifBrowserControlCanvas.o gtkmozilla.o nsActions.o nsSetupRegistry.o -Wl,--whole-archive ${LIBS} -Wl,--no-whole-archive - -gtkmozilla.o: motif/gtkmozilla.cpp - g++ ${DEFINES} ${INCLUDE} -c motif/gtkmozilla.cpp - -MotifBrowserControlCanvasStub.o: motif/MotifBrowserControlCanvasStub.cpp - g++ ${STUBDEFINES} ${STUBINCLUDE} -c motif/MotifBrowserControlCanvasStub.cpp - -MotifBrowserControlCanvas.o: motif/MotifBrowserControlCanvas.cpp - g++ ${DEFINES} ${INCLUDE} -c motif/MotifBrowserControlCanvas.cpp - -BrowserControlMozillaShimStub.o: motif/BrowserControlMozillaShimStub.cpp - g++ ${STUBDEFINES} ${STUBINCLUDE} -c motif/BrowserControlMozillaShimStub.cpp - -BrowserControlMozillaShim.o: BrowserControlMozillaShim.cpp - g++ ${DEFINES} ${INCLUDE} -c BrowserControlMozillaShim.cpp - -motif/nsSetupRegistry.cpp: - cd motif - ${LN} ${MOZILLA_TOP}/../webshell/tests/viewer/nsSetupRegistry.cpp motif/nsSetupRegistry.cpp - cd .. - -#PENDING(mark): I think we should use this for the Win32 version as well... -nsSetupRegistry.o: motif/nsSetupRegistry.cpp - g++ ${DEFINES} ${INCLUDE} -c motif/nsSetupRegistry.cpp - -nsActions.o: nsActions.cpp - g++ ${DEFINES} ${INCLUDE} -c nsActions.cpp - -clean: - rm -f component.reg components *.o *.so *~ motif/*~ motif/nsSetupRegistry.cpp diff --git a/mozilla/java/webclient/src/Makefile.win b/mozilla/java/webclient/src/Makefile.win deleted file mode 100644 index d6d3811153c..00000000000 --- a/mozilla/java/webclient/src/Makefile.win +++ /dev/null @@ -1,90 +0,0 @@ -#!nmake -# -# 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): - -DEPTH=..\..\.. -IGNORE_MANIFEST=1 - -MAKE_OBJ_TYPE = DLL -DLLNAME = webclient -DLL=.\$(OBJDIR)\$(DLLNAME).dll - -MODULE=webclient - -OBJS = \ - .\$(OBJDIR)\nsActions.obj \ - .\$(OBJDIR)\BrowserControlNativeShim.obj \ - .\$(OBJDIR)\DocumentObserver.obj \ - .\$(OBJDIR)\jni_util.obj \ - $(NULL) - -LINCS = \ - -I$(JDKHOME)\include \ - -I$(JDKHOME)\include\win32 \ - $(NULL) - - -LCFLAGS = \ - $(NULL) - -LLIBS = \ - $(DIST)\lib\gkweb.lib \ - $(DIST)\lib\raptorbasewidget_s.lib \ - $(DIST)\lib\gkwidget.lib \ - $(DIST)\lib\xpcom.lib \ - $(DIST)\lib\gkgfxwin.lib \ - $(DIST)\lib\nsreg.lib \ - $(DIST)\lib\nspr3.lib \ - $(DIST)\lib\plds3.lib \ - $(DEPTH)\xpfe\bootstrap\$(OBJDIR)\nsSetupRegistry.obj \ - $(NULL) - -WIN_LIBS = \ - version.lib - -include <$(DEPTH)\config\rules.mak> - -include <$(DEPTH)\java\config\localdefs.mak> - -!CMDSWITCHES -S - -# generate the jni header -export:: BrowserControlNativeShim.h - -BrowserControlNativeShim.h: - @echo Assuming class org.mozilla.webclient.BrowserControlNativeShim is in $(JAVAH_FLAGS) - $(JAVAH) $(JAVAH_FLAGS) -o $@ org.mozilla.webclient.BrowserControlNativeShim - -install:: $(DLL) - $(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin - @echo +++ Creating $(MOZ_SRC)\mozilla\java\webclient\src\$(OBJDIR)\runem.bat. Use this to run the test browser. - @echo set PATH=$(MOZ_SRC)\mozilla\dist\$(OBJDIR)\bin;$(PATH) > .\$(OBJDIR)\runem.bat - @echo $(JAVA) -Djava.library.path=$(MOZ_SRC)\mozilla\dist\$(OBJDIR)\bin -classpath $(JAVAC_CLASSPATH) org.mozilla.webclient.test.EmbeddedMozilla $(MOZ_SRC)\mozilla\dist\$(OBJDIR)\bin %1% >> .\$(OBJDIR)\runem.bat - @echo +++ Creating $(MOZ_SRC)\mozilla\java\webclient\src\$(OBJDIR)\swingem.bat. Use this to run the swing based test browser. - @echo set PATH=$(MOZ_SRC)\mozilla\dist\$(OBJDIR)\bin;$(PATH) > .\$(OBJDIR)\swingem.bat - @echo $(JAVA) -Djava.library.path=$(MOZ_SRC)\mozilla\dist\$(OBJDIR)\bin -classpath $(JAVAC_CLASSPATH) org.mozilla.webclient.test.swing.SwingEmbeddedMozilla $(MOZ_SRC)\mozilla\dist\$(OBJDIR)\bin %1% >> .\$(OBJDIR)\swingem.bat - -clobber_all:: clobber - -clobber:: - rm -f $(DIST)\bin\$(DLLNAME).dll - rm -f BrowserControlNativeShim.h - rm -f .\$(OBJDIR)\runem.bat - rm -f .\$(OBJDIR)\swingem.bat diff --git a/mozilla/java/webclient/src/jni_util.c b/mozilla/java/webclient/src/jni_util.c deleted file mode 100644 index 2dd3a55cd9f..00000000000 --- a/mozilla/java/webclient/src/jni_util.c +++ /dev/null @@ -1,107 +0,0 @@ -#include -#include - -#include "jni.h" -#include "jni_util.h" - - -JNIEXPORT jvalue JNICALL -JNU_CallMethodByName(JNIEnv *env, - jboolean *hasException, - jobject obj, - const char *name, - const char *signature, - ...) -{ - jvalue result; - va_list args; - - va_start(args, signature); - result = JNU_CallMethodByNameV(env, hasException, obj, name, signature, - args); - va_end(args); - - return result; -} - -JNIEXPORT jvalue JNICALL -JNU_CallMethodByNameV(JNIEnv *env, - jboolean *hasException, - jobject obj, - const char *name, - const char *signature, - va_list args) -{ - jclass clazz; - jmethodID mid; - jvalue result; - const char *p = signature; - printf("jni_util: call method by name if 0"); - /* find out the return type */ - while (*p && *p != ')') - p++; - p++; - - result.i = 0; - - if ((*env)->EnsureLocalCapacity(env, 3) < 0) - goto done2; - printf("jni_util: call method by name if 1"); - clazz = (*env)->GetObjectClass(env, obj); - printf("jni_util: call method by name 2"); - mid = (*env)->GetMethodID(env, clazz, name, signature); - printf("jni_util: call method by name 3"); - if (mid == 0) - goto done1; - printf("jni_util: call method by name if 4"); - switch (*p) { - case 'V': - (*env)->CallVoidMethodV(env, obj, mid, args); - break; - case '[': - case 'L': - result.l = (*env)->CallObjectMethodV(env, obj, mid, args); - break; - case 'Z': - result.z = (*env)->CallBooleanMethodV(env, obj, mid, args); - break; - case 'B': - result.b = (*env)->CallByteMethodV(env, obj, mid, args); - break; - case 'C': - result.c = (*env)->CallCharMethodV(env, obj, mid, args); - break; - case 'S': - result.s = (*env)->CallShortMethodV(env, obj, mid, args); - break; - case 'I': - result.i = (*env)->CallIntMethodV(env, obj, mid, args); - break; - case 'J': - result.j = (*env)->CallLongMethodV(env, obj, mid, args); - break; - case 'F': - result.f = (*env)->CallFloatMethodV(env, obj, mid, args); - break; - case 'D': - result.d = (*env)->CallDoubleMethodV(env, obj, mid, args); - break; - default: - (*env)->FatalError(env, "JNU_CallMethodByNameV: illegal signature"); - } - done1: - (*env)->DeleteLocalRef(env, clazz); - done2: - if (hasException) { - *hasException = (*env)->ExceptionCheck(env); - } - return result; -} - -JNIEXPORT void * JNICALL -JNU_GetEnv(JavaVM *vm, jint version) -{ - void *env; - (*vm)->GetEnv(vm, &env, version); - return env; -} diff --git a/mozilla/java/webclient/src/jni_util.h b/mozilla/java/webclient/src/jni_util.h deleted file mode 100644 index 427a6f083a2..00000000000 --- a/mozilla/java/webclient/src/jni_util.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * @(#)jni_util.h 1.24 98/09/02 - * - * Copyright 1997, 1998 by Sun Microsystems, Inc., - * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. - * All rights reserved. - * - * This software is the confidential and proprietary information - * of Sun Microsystems, Inc. ("Confidential Information"). You - * shall not disclose such Confidential Information and shall use - * it only in accordance with the terms of the license agreement - * you entered into with Sun. - */ - -#ifndef JNI_UTIL_H -#define JNI_UTIL_H - -#ifdef __cplusplus -extern "C" { -#endif - - -/* Invoke an instance method by name. - */ -JNIEXPORT jvalue JNICALL -JNU_CallMethodByName(JNIEnv *env, - jboolean *hasException, - jobject obj, - const char *name, - const char *signature, - ...); - -JNIEXPORT jvalue JNICALL -JNU_CallMethodByNameV(JNIEnv *env, - jboolean *hasException, - jobject obj, - const char *name, - const char *signature, - va_list args); - -JNIEXPORT void * JNICALL -JNU_GetEnv(JavaVM *vm, jint version); - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - -#endif /* JNI_UTIL_H */ diff --git a/mozilla/java/webclient/src/motif/BrowserControlNativeShimStub.cpp b/mozilla/java/webclient/src/motif/BrowserControlNativeShimStub.cpp deleted file mode 100644 index acbbac1fd19..00000000000 --- a/mozilla/java/webclient/src/motif/BrowserControlNativeShimStub.cpp +++ /dev/null @@ -1,578 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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): - */ - -/* - * BrowserControlNativeShimStub.cpp - */ - -// PENDING(mark): I suppose this is where I need to go into my explaination of why -// this file is needed... - -// For loading DLL -#include -// JNI...yada, yada, yada -#include -// JNI Header -#include "../BrowserControlNativeShim.h" -// JNI Header -#include "NativeEventThread.h" - -// allow code in webclientstub.so to load us -#include "BrowserControlNativeShimStub.h" - -// Global reference to webclient dll -void * webClientDll; - -extern void locateMotifBrowserControlStubFunctions(void *); - -void (* nativeDummy) (JNIEnv *, jobject, jobject); -void (* nativeInitialize) (JNIEnv *, jobject, jstring); -void (* nativeTerminate) (JNIEnv *, jobject); -jint (* nativeWebShellCreate) (JNIEnv *, jobject, jint, jint, jint, jint, jint, jobject); -void (* nativeWebShellDelete) (JNIEnv *, jobject, jint); -void (* nativeWebShellLoadURL) (JNIEnv *, jobject, jint, jstring); -void (* nativeWebShellStop) (JNIEnv *, jobject, jint); -void (* nativeWebShellShow) (JNIEnv *, jobject, jint); -void (* nativeWebShellHide) (JNIEnv *, jobject, jint); -void (* nativeWebShellSetBounds) (JNIEnv *, jobject, jint, jint, jint, jint, jint); -void (* nativeWebShellMoveTo) (JNIEnv *, jobject, jint, jint, jint); -void (* nativeWebShellSetFocus) (JNIEnv *, jobject, jint); -void (* nativeWebShellRemoveFocus) (JNIEnv *, jobject, jint); -void (* nativeWebShellRepaint) (JNIEnv *, jobject, jint, jboolean); -jboolean (* nativeWebShellCanBack) (JNIEnv *, jobject, jint); -jboolean (* nativeWebShellCanForward) (JNIEnv *, jobject, jint); -jboolean (* nativeWebShellBack) (JNIEnv *, jobject, jint); -jboolean (* nativeWebShellForward) (JNIEnv *, jobject, jint); -jboolean (* nativeWebShellGoTo) (JNIEnv *, jobject, jint, jint); -jint (* nativeWebShellGetHistoryLength) (JNIEnv *, jobject, jint); -jint (* nativeWebShellGetHistoryIndex) (JNIEnv *, jobject, jint); -jstring (* nativeWebShellGetURL) (JNIEnv *, jobject, jint, jint); -// added by Mark Goddard OTMP 9/2/1999 -jboolean (* nativeWebShellRefresh)(JNIEnv *, jobject, jint); -jboolean (* nativeWebShellAddDocListener) (JNIEnv *, jobject, jint, jobject); -void (* processNativeEventQueue) (JNIEnv *, jobject, jint); - - -void locateBrowserControlStubFunctions(void * dll) { - nativeDummy = (void (*) (JNIEnv *, jobject, jobject)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeDummy"); - if (!nativeDummy) { - printf("got dlsym error %s\n", dlerror()); - } - nativeInitialize = (void (*) (JNIEnv *, jobject, jstring)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeInitialize"); - if (!nativeInitialize) { - printf("got dlsym error %s\n", dlerror()); - } - nativeTerminate = (void (*) (JNIEnv *, jobject)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeTerminate"); - if (!nativeTerminate) { - printf("got dlsym error %s\n", dlerror()); - } - nativeWebShellCreate = (jint (*) (JNIEnv *, jobject, jint, jint, jint, jint, jint, jobject)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellCreate"); - if (!nativeWebShellCreate) { - printf("got dlsym error %s\n", dlerror()); - } - nativeWebShellDelete = (void (*) (JNIEnv *, jobject, jint)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellDelete"); - if (!nativeWebShellDelete) { - printf("got dlsym error %s\n", dlerror()); - } - nativeWebShellLoadURL = (void (*) (JNIEnv *, jobject, jint, jstring)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellLoadURL"); - if (!nativeWebShellLoadURL) { - printf("got dlsym error %s\n", dlerror()); - } - nativeWebShellStop = (void (*) (JNIEnv *, jobject, jint)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellStop"); - if (!nativeWebShellStop) { - printf("got dlsym error %s\n", dlerror()); - } - nativeWebShellShow = (void (*) (JNIEnv *, jobject, jint)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellShow"); - if (!nativeWebShellShow) { - printf("got dlsym error %s\n", dlerror()); - } - nativeWebShellHide = (void (*) (JNIEnv *, jobject, jint)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellHide"); - if (!nativeWebShellHide) { - printf("got dlsym error %s\n", dlerror()); - } - nativeWebShellSetBounds = (void (*) (JNIEnv *, jobject, jint, jint, jint, jint, jint)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellSetBounds"); - if (!nativeWebShellSetBounds) { - printf("got dlsym error %s\n", dlerror()); - } - nativeWebShellMoveTo = (void (*) (JNIEnv *, jobject, jint, jint, jint)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellMoveTo"); - if (!nativeWebShellMoveTo) { - printf("got dlsym error %s\n", dlerror()); - } - nativeWebShellSetFocus = (void (*) (JNIEnv *, jobject, jint)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellSetFocus"); - if (!nativeWebShellSetFocus) { - printf("got dlsym error %s\n", dlerror()); - } - nativeWebShellRemoveFocus = (void (*) (JNIEnv *, jobject, jint)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellRemoveFocus"); - if (!nativeWebShellRemoveFocus) { - printf("got dlsym error %s\n", dlerror()); - } - nativeWebShellRepaint = (void (*) (JNIEnv *, jobject, jint, jboolean)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellRepaint"); - if (!nativeWebShellRepaint) { - printf("got dlsym error %s\n", dlerror()); - } - nativeWebShellCanBack = (jboolean (*) (JNIEnv *, jobject, jint)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellCanBack"); - if (!nativeWebShellCanBack) { - printf("got dlsym error %s\n", dlerror()); - } - nativeWebShellCanForward = (jboolean (*) (JNIEnv *, jobject, jint)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellCanForward"); - if (!nativeWebShellCanForward) { - printf("got dlsym error %s\n", dlerror()); - } - nativeWebShellBack = (jboolean (*) (JNIEnv *, jobject, jint)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellBack"); - if (!nativeWebShellBack) { - printf("got dlsym error %s\n", dlerror()); - } - nativeWebShellForward = (jboolean (*) (JNIEnv *, jobject, jint)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellForward"); - if (!nativeWebShellForward) { - printf("got dlsym error %s\n", dlerror()); - } - nativeWebShellGoTo = (jboolean (*) (JNIEnv *, jobject, jint, jint)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellGoTo"); - if (!nativeWebShellGoTo) { - printf("got dlsym error %s\n", dlerror()); - } - nativeWebShellGetHistoryLength = (jint (*) (JNIEnv *, jobject, jint)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellGetHistoryLength"); - if (!nativeWebShellGetHistoryLength) { - printf("got dlsym error %s\n", dlerror()); - } - nativeWebShellGetHistoryIndex = (jint (*) (JNIEnv *, jobject, jint)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellGetHistoryIndex"); - if (!nativeWebShellGetHistoryIndex) { - printf("got dlsym error %s\n", dlerror()); - } - nativeWebShellGetURL = (jstring (*) (JNIEnv *, jobject, jint, jint)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellGetURL"); - if (!nativeWebShellGetURL) { - printf("got dlsym error %s\n", dlerror()); - } - - // added by Mark Goddard OTMP 9/2/1999 - nativeWebShellRefresh = (jboolean (*) (JNIEnv *, jobject, jint)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellRefresh"); - if (!nativeWebShellRefresh) { - printf("got dlsym error %s\n", dlerror()); - } - - nativeWebShellAddDocListener = (jboolean (*) (JNIEnv *, jobject, jint, jobject)) dlsym(dll, "Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellAddDocListener"); - if (!nativeWebShellAddDocListener) { - printf("got dlsym error %s\n", dlerror()); - } - - - processNativeEventQueue = (void (*) (JNIEnv *, jobject, jint)) dlsym(dll, "Java_org_mozilla_webclient_motif_NativeEventThread_processNativeEventQueue"); - if (!processNativeEventQueue) { - printf("got dlsym error %s\n", dlerror()); - } -} - - -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeDummy ( - JNIEnv * env, - jobject obj, - jobject shimObj) -{ - (* nativeDummy) (env, obj, shimObj); -} - - - -/* - * Class: org_mozilla_webclient_motif_MotifNativeEventQueue - * Method: processNativeEventQueue - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_org_mozilla_webclient_motif_NativeEventThread_processNativeEventQueue - (JNIEnv * env, jobject obj, jint gtkWinPtr) { - (* processNativeEventQueue) (env, obj, gtkWinPtr); -} - -void loadMainDll(void) -{ - webClientDll = dlopen("libwebclient.so", RTLD_LAZY | RTLD_GLOBAL); - - if (webClientDll) { - locateBrowserControlStubFunctions(webClientDll); - locateMotifBrowserControlStubFunctions(webClientDll); - } else { - printf("Got Error: %s\n", dlerror()); - } -} - - - -/* - * Class: MozWebShellNativeShim - * Method: raptorInitialize - * Signature: ()V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeInitialize ( - JNIEnv * env, - jobject obj, jstring verifiedBinDirAbsolutePath) -{ - (* nativeInitialize) (env, obj, verifiedBinDirAbsolutePath); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeInitialize() - - - -/* - * Class: MozWebShellNativeShim - * Method: raptorTerminate - * Signature: ()V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeTerminate ( - JNIEnv * env, - jobject obj) -{ - (* nativeTerminate) (env, obj); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeTerminate() - -/* - * Class: MozWebShellNativeShim - * Method: raptorWebShellCreate - * Signature: (IIIIII)I - */ -JNIEXPORT jint JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellCreate ( - JNIEnv * env, - jobject obj, - jint windowPtr, - jint x, - jint y, - jint width, - jint height, - jobject abrowsercontrolimpl) -{ - return (* nativeWebShellCreate) (env, obj, windowPtr, x, y, width, height, abrowsercontrolimpl); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellCreate() - - -/* - * Class: MozWebShellNativeShim - * Method: raptorWebShellDelete - * Signature: (I)V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellDelete ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - (* nativeWebShellDelete) (env, obj, webShellPtr); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellDelete() - - -/* - * Class: MozWebShellNativeShim - * Method: raptorWebShellLoadURL - * Signature: (ILjava/lang/String;)V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellLoadURL ( - JNIEnv * env, - jobject obj, - jint webShellPtr, - jstring urlString) -{ - (* nativeWebShellLoadURL) (env, obj, webShellPtr, urlString); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellLoadURL() - - -/* - * Class: MozWebShellNativeShim - * Method: raptorWebShellStop - * Signature: (I)V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellStop ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - (* nativeWebShellStop) (env, obj, webShellPtr); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellStop() - - -/* - * Class: MozWebShellNativeShim - * Method: raptorWebShellShow - * Signature: (I)V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellShow ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - (* nativeWebShellShow) (env, obj, webShellPtr); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellShow() - - -/* - * Class: MozWebShellNativeShim - * Method: raptorWebShellHide - * Signature: (I)V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellHide ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - (* nativeWebShellHide) (env, obj, webShellPtr); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellHide() - - -/* - * Class: MozWebShellNativeShim - * Method: raptorWebShellSetBounds - * Signature: (IIIII)V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellSetBounds ( - JNIEnv * env, - jobject obj, - jint webShellPtr, - jint x, - jint y, - jint width, - jint height) -{ - (* nativeWebShellSetBounds) (env, obj, webShellPtr, x, y, width, height); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellSetBounds() - - -/* - * Class: MozWebShellNativeShim - * Method: raptorWebShellMoveTo - * Signature: (III)V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellMoveTo ( - JNIEnv * env, - jobject obj, - jint webShellPtr, - jint x, - jint y) -{ - (* nativeWebShellMoveTo) (env, obj, webShellPtr, x, y); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellMoveTo() - - -/* - * Class: MozWebShellNativeShim - * Method: raptorWebShellSetFocus - * Signature: (I)V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellSetFocus ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - (* nativeWebShellSetFocus) (env, obj, webShellPtr); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellSetFocus() - - -/* - * Class: MozWebShellNativeShim - * Method: raptorWebShellRemoveFocus - * Signature: (I)V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellRemoveFocus ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - (* nativeWebShellRemoveFocus) (env, obj, webShellPtr); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellRemoveFocus() - - -/* - * Class: MozWebShellNativeShim - * Method: raptorWebShellRepaint - * Signature: (IZ)V - */ -JNIEXPORT void JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellRepaint ( - JNIEnv * env, - jobject obj, - jint webShellPtr, - jboolean forceRepaint) -{ - (* nativeWebShellRepaint) (env, obj, webShellPtr, forceRepaint); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellRepaint() - - -/* - * Class: MozWebShellNativeShim - * Method: raptorWebShellCanBack - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellCanBack ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - return (* nativeWebShellCanBack) (env, obj, webShellPtr); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellCanBack() - - -/* - * Class: MozWebShellNativeShim - * Method: raptorWebShellCanForward - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellCanForward ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - return (* nativeWebShellCanForward) (env, obj, webShellPtr); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellCanForward() - - -/* - * Class: MozWebShellNativeShim - * Method: raptorWebShellBack - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellBack ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - return (* nativeWebShellBack) (env, obj, webShellPtr); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellBack() - - -/* - * Class: MozWebShellNativeShim - * Method: raptorWebShellForward - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellForward ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - return (* nativeWebShellForward) (env, obj, webShellPtr); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellForward() - - -/* - * Class: MozWebShellNativeShim - * Method: raptorWebShellGoTo - * Signature: (II)Z - */ -JNIEXPORT jboolean JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellGoTo ( - JNIEnv * env, - jobject obj, - jint webShellPtr, - jint historyIndex) -{ - return (* nativeWebShellGoTo) (env, obj, webShellPtr, historyIndex); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellGoTo() - - -/* - * Class: MozWebShellNativeShim - * Method: raptorWebShellGetHistoryLength - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellGetHistoryLength ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - return (* nativeWebShellGetHistoryLength) (env, obj, webShellPtr); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellGetHistoryLength() - - -/* - * Class: MozWebShellNativeShim - * Method: raptorWebShellGetHistoryIndex - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellGetHistoryIndex ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - return (* nativeWebShellGetHistoryIndex) (env, obj, webShellPtr); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellGetHistoryIndex() - - -/* - * Class: MozWebShellNativeShim - * Method: raptorWebShellGetURL - * Signature: (II)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellGetURL ( - JNIEnv * env, - jobject obj, - jint webShellPtr, - jint historyIndex) -{ - return (* nativeWebShellGetURL) (env, obj, webShellPtr, historyIndex); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellGetURL() - -// added by Mark Goddard OTMP 9/2/1999 -/* - * Class: MozWebShellNativeShim - * Method: raptorWebShellRefresh - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellRefresh ( - JNIEnv * env, - jobject obj, - jint webShellPtr) -{ - return (* nativeWebShellRefresh) (env, obj, webShellPtr); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellRefresh() - - -/* - * Class: BrowserControlNativeShimStub - * Method: nativeWebShellAddDocListener - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL -Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellAddDocListener ( - JNIEnv * env, - jobject obj, - jint webShellPtr, - jobject listener) -{ - return (* nativeWebShellAddDocListener) (env, obj, webShellPtr, listener); -} // Java_org_mozilla_webclient_BrowserControlNativeShim_nativeWebShellAddDocListener() - - -// EOF diff --git a/mozilla/java/webclient/src/motif/BrowserControlNativeShimStub.h b/mozilla/java/webclient/src/motif/BrowserControlNativeShimStub.h deleted file mode 100644 index b01cb5d6089..00000000000 --- a/mozilla/java/webclient/src/motif/BrowserControlNativeShimStub.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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): - */ - -/* - * BrowserControlNativeShimStub.h - */ - -/* - - * This file exports a function that allows the code in - * MotifBrowserControlCanvasStub to load the real webclient dll. - - */ - -/** - - * Called by loadMainDll() in MotifBrowserControlCanvasStub.cpp - - * simply loads the webclient dll and copies all the right function - * pointers. - - */ - -void loadMainDll(void); diff --git a/mozilla/java/webclient/src/motif/Makefile.in b/mozilla/java/webclient/src/motif/Makefile.in deleted file mode 100644 index b7b56bc09f9..00000000000 --- a/mozilla/java/webclient/src/motif/Makefile.in +++ /dev/null @@ -1,103 +0,0 @@ -#//------------------------------------------------------------------------ -#// -#// Makefile to build the motif part of the native version of webclient -#// -#//------------------------------------------------------------------------ - -DEPTH = ../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -include $(topsrcdir)/config/config.mk - -MODULE = webclient_motif -LIBRARY_NAME = webclient_motif - -STUB_LIBRARY_NAME = webclientstub - -# we don't want the shared lib, but we want to force the creation of a -# static lib. -override NO_SHARED_LIB=1 -override NO_STATIC_LIB= - -CPPSRCS = \ - BrowserControlNativeShimStub.cpp \ - MotifBrowserControlCanvas.cpp \ - MotifBrowserControlCanvasStub.cpp \ - gtkmozilla.cpp \ - nsSetupRegistry.cpp \ - $(NULL) - -# files that go into lib$(STUB_LIBRARY_NAME).so -STUBOBJS = \ - BrowserControlNativeShimStub.o \ - MotifBrowserControlCanvasStub.o \ - $(NULL) - -# files that go into lib$(LIBRARY_NAME).a -SHAREOBJS = \ - MotifBrowserControlCanvas.o \ - gtkmozilla.o \ - nsSetupRegistry.o \ - $(NULL) - -include $(topsrcdir)/config/rules.mk - -#ifeq ($(NSPR_INCLUDE_DIR),) -INCLUDES += -I$(DIST)/include/private -#else -INCLUDES += -I$(NSPR_INCLUDE_DIR)/private -#endif - -ifndef MOZ_MONOLITHIC_TOOLKIT -CXXFLAGS += $(MOZ_GTK_CFLAGS) -CFLAGS += $(MOZ_GTK_CFLAGS) -else -CXXFLAGS += $(TK_CFLAGS) -CFLAGS += $(TK_CFLAGS) -endif - -# include mozilla/widget/src/gtk/nsGtkEventHandler.h -INCLUDES += -I$(topsrcdir)/widget/src/gtk - -# START section might end up in a file that gets included from this Makefile -STUB_LIBRARY := lib$(STUB_LIBRARY_NAME).so - -# take the controls for creating the libraries -$(LIBRARY): $(LOBJS) $(SHAREOBJS) $(STUB_LIBRARY) Makefile Makefile.in - $(AR) -o $@ $(SHAREOBJS) $(LOBJS) $(SUB_LOBJS) - $(RANLIB) $@ - @rm -f foodummyfilefoo $(SUB_LOBJS) - -$(STUB_LIBRARY): $(STUBOBJS) Makefile Makefile.in - $(MKSHLIB) -o $@ $(STUBOBJS) $(LOBJS) $(EXTRA_DSO_LDOPTS) - -install:: - $(INSTALL) -m 444 $(LIBRARY) $(DIST)/lib - $(INSTALL) -m 444 $(STUB_LIBRARY) $(DIST)/lib $(DIST)/bin - -# END possible include section - - - -# force everything to be done in the export phase -export:: MotifBrowserControlCanvas.h NativeEventThread.h nsSetupRegistry.cpp ../BrowserControlNativeShim.h libs install - - -nsSetupRegistry.cpp: - ln $(DEPTH)/webshell/tests/viewer/nsSetupRegistry.cpp nsSetupRegistry.cpp - -MotifBrowserControlCanvas.h: - @echo Assuming class org.mozilla.webclient.motif.MotifBrowserControlCanvas is in $(JAVAH_FLAGS) - $(JAVAH) $(JAVAH_FLAGS) -o $@ org.mozilla.webclient.motif.MotifBrowserControlCanvas - -NativeEventThread.h: - @echo Assuming class org.mozilla.webclient.motif.NativeEventThread is in $(JAVAH_FLAGS) - $(JAVAH) $(JAVAH_FLAGS) -o $@ org.mozilla.webclient.motif.NativeEventThread - -../BrowserControlNativeShim.h: - @echo Assuming class org.mozilla.webclient.BrowserControlNativeShim is in $(JAVAH_FLAGS) - $(JAVAH) $(JAVAH_FLAGS) -o $@ org.mozilla.webclient.BrowserControlNativeShim diff --git a/mozilla/java/webclient/src/motif/MotifBrowserControlCanvas.cpp b/mozilla/java/webclient/src/motif/MotifBrowserControlCanvas.cpp deleted file mode 100644 index 0bf303e8d9c..00000000000 --- a/mozilla/java/webclient/src/motif/MotifBrowserControlCanvas.cpp +++ /dev/null @@ -1,169 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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): - */ - - -/* - * MotifBrowserControlCanvas.cpp - */ - -#include -#include "MotifBrowserControlCanvas.h" - -#include - -#include -#include -#include "gtkmozilla.h" -#include "gtkmozarea.h" - -#include "nsIDOMDocument.h" -#include "nsGtkEventHandler.h" - -#include - -extern "C" void NS_SetupRegistry(); - -extern "C" { - -/* - * Class: org_mozilla_webclient_motif_MotifBrowserControlCanvas - * Method: createTopLevelWindow - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_org_mozilla_webclient_motif_MotifBrowserControlCanvas_createTopLevelWindow -(JNIEnv * env, jobject obj) { - static GtkWidget *mShell = NULL; - - /* Initialise GTK */ - gtk_set_locale (); - - gtk_init (0, NULL); - - gdk_event_handler_set (handle_gdk_event, NULL, NULL); - - gdk_rgb_init(); - - mShell = gtk_window_new (GTK_WINDOW_POPUP); - gtk_window_set_default_size(GTK_WINDOW(mShell), 300, 300); - gtk_window_set_title(GTK_WINDOW(mShell), "Simple browser"); - - return (jint) mShell; -} - -/* - * Class: org_mozilla_webclient_motif_MotifBrowserControlCanvas - * Method: createContainerWindow - * Signature: (III)I - */ -JNIEXPORT jint JNICALL Java_org_mozilla_webclient_motif_MotifBrowserControlCanvas_createContainerWindow - (JNIEnv * env, jobject obj, jint parent, jint screenWidth, jint screenHeight) { - GtkWidget * window = (GtkWidget *) parent; - GtkWidget *mMozArea = NULL; - - mMozArea = gtk_mozarea_new(); - gtk_container_add(GTK_CONTAINER(window), mMozArea); - gtk_widget_realize(GTK_WIDGET(mMozArea)); - - // HACK: javaMake sure this window doesn't appear onscreen!!!! - gtk_widget_set_uposition(window, screenWidth + 20, screenHeight + 20); - gtk_widget_show(mMozArea); - - gtk_widget_show(window); - - //gtk_main(); - - return (jint) mMozArea; -} - -int getWinID(GtkWidget * gtkWidgetPtr) { - //GdkWindow * gdkWindow = gtk_widget_get_parent_window(gtkWidgetPtr); - GdkWindow * gdkWindow = gtkWidgetPtr->window; - int gtkwinid = GDK_WINDOW_XWINDOW(gdkWindow); - - return gtkwinid; -} - -/* - * Class: org_mozilla_webclient_motif_MotifBrowserControlCanvas - * Method: getGTKWinID - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_mozilla_webclient_motif_MotifBrowserControlCanvas_getGTKWinID -(JNIEnv * env, jobject obj, jint gtkWinPtr) { - GtkWidget * gtkWidgetPtr = (GtkWidget *) gtkWinPtr; - - return getWinID(gtkWidgetPtr); -} - - -/* - * Class: org_mozilla_webclient_motif_MotifBrowserControlCanvas - * Method: reparentWindow - * Signature: (II)V - */ -JNIEXPORT void JNICALL Java_org_mozilla_webclient_motif_MotifBrowserControlCanvas_reparentWindow (JNIEnv * env, jobject obj, jint childID, jint parentID) { - XReparentWindow(GDK_DISPLAY(), childID, parentID, 0, 0); -} - -/* - * Class: org_mozilla_webclient_motif_MotifBrowserControlCanvas - * Method: processEvents - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_org_mozilla_webclient_motif_MotifBrowserControlCanvas_processEvents - (JNIEnv * env, jobject obj) { - //printf("process events....\n"); - //processEventLoopIntelligently(); -} - -/* - * Class: org_mozilla_webclient_motif_MotifBrowserControlCanvas - * Method: setGTKWindowSize - * Signature: (III)V - */ -JNIEXPORT void JNICALL Java_org_mozilla_webclient_motif_MotifBrowserControlCanvas_setGTKWindowSize - (JNIEnv * env, jobject obj, jint gtkWinPtr, jint width, jint height) { - if (gtkWinPtr != 0) { - GtkWidget * gtkWidgetPtr = (GtkWidget *) gtkWinPtr; - - if (gtkWidgetPtr) { - gtk_widget_set_usize(gtkWidgetPtr, width, height); - } - } -} - -/* - * Class: org_mozilla_webclient_motif_MotifBrowserControlCanvas - * Method: loadMainDll - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_org_mozilla_webclient_motif_MotifBrowserControlCanvas_loadMainDll - (JNIEnv *, jclass) -{ - printf("incorrect loadMainDll called\n\n"); - fflush(stdout); -} - - - -} // End extern "C" - diff --git a/mozilla/java/webclient/src/motif/MotifBrowserControlCanvasStub.cpp b/mozilla/java/webclient/src/motif/MotifBrowserControlCanvasStub.cpp deleted file mode 100644 index 5ab1011b0c9..00000000000 --- a/mozilla/java/webclient/src/motif/MotifBrowserControlCanvasStub.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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): - */ - - -/* - * MotifBrowserControlCanvasStub.cpp - */ - -// PENDING(mark): I suppose this is where I need to go into my explaination of why -// this file is needed... - -#include -#include "MotifBrowserControlCanvas.h" - -#include "BrowserControlNativeShimStub.h" - -#include - -extern void locateBrowserControlStubFunctions(void *); - -jint (* createTopLevelWindow) (JNIEnv *, jobject); -jint (* createContainerWindow) (JNIEnv *, jobject, jint, jint, jint); -jint (* getGTKWinID) (JNIEnv *, jobject, jint); -void (* reparentWindow) (JNIEnv *, jobject, jint, jint); -void (* processEvents) (JNIEnv *, jobject); -void (* setGTKWindowSize) (JNIEnv *, jobject, jint, jint, jint); - -void locateMotifBrowserControlStubFunctions(void * dll) { - createTopLevelWindow = (jint (*) (JNIEnv *, jobject)) dlsym(dll, "Java_org_mozilla_webclient_motif_MotifBrowserControlCanvas_createTopLevelWindow"); - if (!createTopLevelWindow) { - printf("got dlsym error %s\n", dlerror()); - } - - createContainerWindow = (jint (*) (JNIEnv *, jobject, jint, jint, jint)) dlsym(dll, "Java_org_mozilla_webclient_motif_MotifBrowserControlCanvas_createContainerWindow"); - if (!createContainerWindow) { - printf("got dlsym error %s\n", dlerror()); - } - - reparentWindow = (void (*) (JNIEnv *, jobject, jint, jint)) dlsym(dll, "Java_org_mozilla_webclient_motif_MotifBrowserControlCanvas_reparentWindow"); - if (!reparentWindow) { - printf("got dlsym error %s\n", dlerror()); - } - - processEvents = (void (*) (JNIEnv *, jobject)) dlsym(dll, "Java_org_mozilla_webclient_motif_MotifBrowserControlCanvas_processEvents"); - if (!processEvents) { - printf("got dlsym error %s\n", dlerror()); - } - - setGTKWindowSize = (void (*) (JNIEnv *, jobject, jint, jint, jint)) dlsym(dll, "Java_org_mozilla_webclient_motif_MotifBrowserControlCanvas_setGTKWindowSize"); - if (!setGTKWindowSize) { - printf("got dlsym error %s\n", dlerror()); - } - - getGTKWinID = (jint (*) (JNIEnv *, jobject, jint)) dlsym(dll, "Java_org_mozilla_webclient_motif_MotifBrowserControlCanvas_getGTKWinID"); - if (!getGTKWinID) { - printf("got dlsym error %s\n", dlerror()); - } -} - -/* - * Class: org_mozilla_webclient_motif_MotifBrowserControlCanvas - * Method: createTopLevelWindow - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_org_mozilla_webclient_motif_MotifBrowserControlCanvas_createTopLevelWindow (JNIEnv * env, jobject obj) { - return (* createTopLevelWindow) (env, obj); -} - -/* - * Class: org_mozilla_webclient_motif_MotifBrowserControlCanvas - * Method: createContainerWindow - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_org_mozilla_webclient_motif_MotifBrowserControlCanvas_createContainerWindow (JNIEnv * env, jobject obj, jint parent, jint width, jint height) { - return (* createContainerWindow) (env, obj, parent, width, height); -} - -/* - * Class: org_mozilla_webclient_motif_MotifBrowserControlCanvas - * Method: getGTKWinID - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_mozilla_webclient_motif_MotifBrowserControlCanvas_getGTKWinID -(JNIEnv * env, jobject obj, jint gtkWinPtr) { - return (* getGTKWinID) (env, obj, gtkWinPtr); -} - -/* - * Class: org_mozilla_webclient_motif_MotifBrowserControlCanvas - * Method: reparentWindow - * Signature: (II)V - */ -JNIEXPORT void JNICALL Java_org_mozilla_webclient_motif_MotifBrowserControlCanvas_reparentWindow -(JNIEnv * env, jobject obj, jint childID, jint parentID) { - (* reparentWindow) (env, obj, childID, parentID); -} - -/* - * Class: org_mozilla_webclient_motif_MotifBrowserControlCanvas - * Method: processEvents - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_org_mozilla_webclient_motif_MotifBrowserControlCanvas_processEvents - (JNIEnv * env, jobject obj) { - (* processEvents) (env, obj); -} - - -/* - * Class: org_mozilla_webclient_motif_MotifBrowserControlCanvas - * Method: setGTKWindowSize - * Signature: (III)V - */ -JNIEXPORT void JNICALL Java_org_mozilla_webclient_motif_MotifBrowserControlCanvas_setGTKWindowSize - (JNIEnv * env, jobject obj, jint xwinID, jint width, jint height) { - (* setGTKWindowSize) (env, obj, xwinID, width, height); -} - -/* - * Class: org_mozilla_webclient_motif_MotifBrowserControlCanvas - * Method: loadMainDll - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_org_mozilla_webclient_motif_MotifBrowserControlCanvas_loadMainDll - (JNIEnv *, jclass) -{ - loadMainDll(); -} diff --git a/mozilla/java/webclient/src/motif/gtkmozilla.cpp b/mozilla/java/webclient/src/motif/gtkmozilla.cpp deleted file mode 100644 index 74f125229c2..00000000000 --- a/mozilla/java/webclient/src/motif/gtkmozilla.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Mozilla Public License - * Version 1.1 (the "MPL"); you may not use this file except in - * compliance with the MPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of the Original Code is Alexander. Portions - * created by Alexander Larsson are Copyright (C) 1999 - * Alexander Larsson. All Rights Reserved. - */ - - -/* - * gtkmozilla.cpp - */ - -#include -#include "gtkmozilla.h" - -static void gtk_mozilla_realize(GtkWidget *widget); -static void gtk_mozilla_finalize (GtkObject *object); - -typedef gboolean (*GtkSignal_BOOL__POINTER_INT) (GtkObject * object, - gpointer arg1, - gint arg2, - gpointer user_data); - -extern "C" void -gtk_mozilla_marshal_BOOL__POINTER_INT (GtkObject * object, - GtkSignalFunc func, - gpointer func_data, - GtkArg * args) -{ - GtkSignal_BOOL__POINTER_INT rfunc; - gboolean *return_val; - return_val = GTK_RETLOC_BOOL (args[2]); - rfunc = (GtkSignal_BOOL__POINTER_INT) func; - *return_val = (*rfunc) (object, - GTK_VALUE_POINTER (args[0]), - GTK_VALUE_INT (args[1]), - func_data); -} - -static GtkLayoutClass *parent_class = 0; - -static void -gtk_mozilla_class_init (GtkMozillaClass *klass) -{ - GtkObjectClass *object_class; - GtkWidgetClass *widget_class; - - object_class = (GtkObjectClass*) klass; - widget_class = (GtkWidgetClass*) klass; - - parent_class = (GtkLayoutClass *)gtk_type_class (GTK_TYPE_LAYOUT); - - object_class->finalize = gtk_mozilla_finalize; - widget_class->realize = gtk_mozilla_realize; - -} - -static void -gtk_mozilla_realize (GtkWidget *widget) -{ - //printf("gtk_mozilla_realize()\n"); - GtkMozilla *moz = GTK_MOZILLA(widget); - - if (GTK_WIDGET_CLASS (parent_class)->realize) - (* GTK_WIDGET_CLASS (parent_class)->realize) (widget); -} - -static void -gtk_mozilla_init (GtkMozilla *moz) -{ - //printf("gtk_mozilla_init()\n"); - - gtk_layout_set_hadjustment (GTK_LAYOUT (moz), 0); - gtk_layout_set_vadjustment (GTK_LAYOUT (moz), 0); - - GTK_WIDGET_SET_FLAGS (GTK_WIDGET(moz), GTK_CAN_FOCUS); -} - -GtkType -gtk_mozilla_get_type (void) -{ - static GtkType mozilla_type = 0; - - if (!mozilla_type) { - static const GtkTypeInfo mozilla_info = { - "GtkMozilla", - sizeof (GtkMozilla), - sizeof (GtkMozillaClass), - (GtkClassInitFunc) gtk_mozilla_class_init, - (GtkObjectInitFunc) gtk_mozilla_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, - }; - mozilla_type = gtk_type_unique (GTK_TYPE_LAYOUT, &mozilla_info); - } - - return mozilla_type; -} - -GtkWidget* -gtk_mozilla_new (void) -{ - GtkMozilla *moz; - - moz = GTK_MOZILLA(gtk_type_new(GTK_TYPE_MOZILLA)); - - return GTK_WIDGET (moz); -} - -static void -gtk_mozilla_finalize (GtkObject *object) -{ - GtkMozilla *moz; - - g_return_if_fail(object != NULL); - g_return_if_fail(GTK_IS_MOZILLA(object)); - - moz = GTK_MOZILLA(object); - - GTK_OBJECT_CLASS(parent_class)->finalize (object); -} diff --git a/mozilla/java/webclient/src/motif/gtkmozilla.h b/mozilla/java/webclient/src/motif/gtkmozilla.h deleted file mode 100644 index c9d1688008e..00000000000 --- a/mozilla/java/webclient/src/motif/gtkmozilla.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * 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 Alexander - * Larsson. Portions created by Alexander Larsson are - * Copyright (C) 1999 Alexander Larsson. All - * Rights Reserved. - * - * Contributor(s): - */ - -/* - * gtkmozilla.h - */ - -#ifndef GTKMOZILLA_H -#define GTKMOZILLA_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include - -#define GTK_TYPE_MOZILLA (gtk_mozilla_get_type ()) -#define GTK_MOZILLA(obj) GTK_CHECK_CAST ((obj), GTK_TYPE_MOZILLA, GtkMozilla) -#define GTK_MOZILLA_CLASS(klass) GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_MOZILLA, GtkMozillaClass) -#define GTK_IS_MOZILLA(obj) GTK_CHECK_TYPE ((obj), GTK_TYPE_MOZILLA) -#define GTK_IS_MOZILLA_CLASS(klass) GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MOZILLA) - - -typedef struct _GtkMozilla GtkMozilla; -typedef struct _GtkMozillaClass GtkMozillaClass; - -struct _GtkMozilla -{ - GtkLayout layout; -}; - -struct _GtkMozillaClass -{ - GtkLayoutClass parent_class; -}; - -extern GtkType gtk_mozilla_get_type(void); -extern GtkWidget* gtk_mozilla_new(void); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - - -#endif /* GTKMOZILLA_H */ diff --git a/mozilla/java/webclient/src/nsActions.cpp b/mozilla/java/webclient/src/nsActions.cpp deleted file mode 100644 index b384dcab915..00000000000 --- a/mozilla/java/webclient/src/nsActions.cpp +++ /dev/null @@ -1,664 +0,0 @@ -/* -*- 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 RaptorCanvas. - * - * The Initial Developer of the Original Code is Kirk Baker and - * Ian Wilkinson. Portions created by Kirk Baker and Ian Wilkinson are - * Copyright (C) 1999 Kirk Baker and Ian Wilkinson. All - * Rights Reserved. - * - * Contributor(s): Kirk Baker - * Ian Wilkinson - * Mark Lin - * Mark Goddard - * Ed Burns - */ - -/* - * nsActions.cpp - */ - -#include "nsActions.h" -#include "nsCOMPtr.h" -#include "nsIContentViewer.h" -#include "nsIBaseWindow.h" - - -void * handleEvent (PLEvent * event); -void destroyEvent (PLEvent * event); - - -void * -handleEvent (PLEvent * event) -{ - nsActionEvent * actionEvent = (nsActionEvent*) event->owner; - void * result = nsnull; - - result = actionEvent->handleEvent(); - - return result; -} // handleEvent() - - -void -destroyEvent (PLEvent * event) -{ - nsActionEvent * actionEvent = (nsActionEvent*) event->owner; - - if (actionEvent != NULL) { - actionEvent->destroyEvent(); - } -} // destroyEvent() - - - -/* - * nsActionEvent - */ - -nsActionEvent::nsActionEvent () -{ - PL_InitEvent(&mEvent, this, - (PLHandleEventProc ) ::handleEvent, - (PLDestroyEventProc) ::destroyEvent); -} - - - -/* - * wsResizeEvent - */ - -wsResizeEvent::wsResizeEvent(nsIWebShell* webShell, PRInt32 x, PRInt32 y, PRInt32 w, PRInt32 h) : - nsActionEvent(), - mWebShell(webShell), - mLeft(x), - mBottom(y), - mWidth(w), - mHeight(h) -{ -} - - -void * -wsResizeEvent::handleEvent () -{ - nsresult rv = NS_ERROR_FAILURE; - if (mWebShell) { - - printf("handleEvent(resize(x = %d y = %d w = %d h = %d))\n", mLeft, mBottom, mWidth, mHeight); - nsCOMPtr baseWindow; - - rv = mWebShell->QueryInterface(NS_GET_IID(nsIBaseWindow), - getter_AddRefs(baseWindow)); - - if (NS_FAILED(rv)) { - return NULL; - } - rv = baseWindow->SetPositionAndSize(mLeft, mBottom, mWidth, mHeight, - PR_TRUE); - - printf("result = %lx\n", rv); - - return (void *) rv; - } - return NULL; -} // handleEvent() - - - - -/* - * wsLoadURLEvent - */ - -wsLoadURLEvent::wsLoadURLEvent(nsIWebShell* webShell, PRUnichar * urlString) : - nsActionEvent(), - mWebShell(webShell), - mURL(nsnull) -{ - mURL = new nsString(urlString); -} - - -void * -wsLoadURLEvent::handleEvent () -{ - if (mWebShell && mURL) { - - printf("handleEvent(loadURL))\n"); - - nsresult rv = mWebShell->LoadURL(mURL->GetUnicode()); - - printf("result = %lx\n", rv); - } - return NULL; -} // handleEvent() - - -wsLoadURLEvent::~wsLoadURLEvent () -{ - if (mURL != nsnull) - delete mURL; -} - - - -/* - * wsStopEvent - */ - -wsStopEvent::wsStopEvent(nsIWebShell* webShell) : - nsActionEvent(), - mWebShell(webShell) -{ -} - - -void * -wsStopEvent::handleEvent () -{ - if (mWebShell) { - - printf("handleEvent(Stop))\n"); - - nsresult rv = mWebShell->Stop(); - - printf("result = %lx\n", rv); - } - return NULL; -} // handleEvent() - - - -/* - * wsShowEvent - */ - -wsShowEvent::wsShowEvent(nsIWebShell* webShell) : - nsActionEvent(), - mWebShell(webShell) -{ -} - - -void * -wsShowEvent::handleEvent () -{ - if (mWebShell) { - - printf("handleEvent(Show))\n"); - - nsresult rv; - nsCOMPtr baseWindow; - - rv = mWebShell->QueryInterface(NS_GET_IID(nsIBaseWindow), - getter_AddRefs(baseWindow)); - - if (NS_FAILED(rv)) { - return NULL; - } - baseWindow->SetVisibility(PR_TRUE); - - printf("result = %lx\n", rv); - } - return NULL; -} // handleEvent() - - - -/* - * wsHideEvent - */ - -wsHideEvent::wsHideEvent(nsIWebShell* webShell) : - nsActionEvent(), - mWebShell(webShell) -{ -} - - -void * -wsHideEvent::handleEvent () -{ - if (mWebShell) { - - printf("handleEvent(Hide))\n"); - - nsresult rv; - nsCOMPtr baseWindow; - - rv = mWebShell->QueryInterface(NS_GET_IID(nsIBaseWindow), - getter_AddRefs(baseWindow)); - - if (NS_FAILED(rv)) { - return NULL; - } - baseWindow->SetVisibility(PR_FALSE); - - printf("result = %lx\n", rv); - } - return NULL; -} // handleEvent() - - - -/* - * wsMoveToEvent - */ - -wsMoveToEvent::wsMoveToEvent(nsIWebShell* webShell, PRInt32 x, PRInt32 y) : - nsActionEvent(), - mWebShell(webShell), - mX(x), - mY(y) -{ -} - - -void * -wsMoveToEvent::handleEvent () -{ - if (mWebShell) { - - printf("handleEvent(MoveTo(%ld, %ld))\n", mX, mY); - - nsresult rv; - nsCOMPtr baseWindow; - - rv = mWebShell->QueryInterface(NS_GET_IID(nsIBaseWindow), - getter_AddRefs(baseWindow)); - - if (NS_FAILED(rv)) { - return NULL; - } - rv = baseWindow->SetPosition(mX, mY); - - printf("result = %lx\n", rv); - } - return NULL; -} // handleEvent() - - -/* - * wsSetFocusEvent - */ - -wsSetFocusEvent::wsSetFocusEvent(nsIWebShell* webShell) : - nsActionEvent(), - mWebShell(webShell) -{ -} - - -void * -wsSetFocusEvent::handleEvent () -{ - if (mWebShell) { - - printf("handleEvent(SetFocus())\n"); - - nsresult rv; - nsCOMPtr baseWindow; - - rv = mWebShell->QueryInterface(NS_GET_IID(nsIBaseWindow), - getter_AddRefs(baseWindow)); - - if (NS_FAILED(rv)) { - return NULL; - } - rv = baseWindow->SetFocus(); - - printf("result = %lx\n", rv); - } - return NULL; -} // handleEvent() - - - -/* - * wsRemoveFocusEvent - */ - -wsRemoveFocusEvent::wsRemoveFocusEvent(nsIWebShell* webShell) : - nsActionEvent(), - mWebShell(webShell) -{ -} - - -void * -wsRemoveFocusEvent::handleEvent () -{ - if (mWebShell) { - - printf("handleEvent(RemoveFocus())\n"); - - nsresult rv = mWebShell->RemoveFocus(); - - printf("result = %lx\n", rv); - } - return NULL; -} // handleEvent() - - - -/* - * wsRepaintEvent - */ - -wsRepaintEvent::wsRepaintEvent(nsIWebShell* webShell, PRBool forceRepaint) : - nsActionEvent(), - mWebShell(webShell), - mForceRepaint(forceRepaint) -{ -} - - -void * -wsRepaintEvent::handleEvent () -{ - if (mWebShell) { - - printf("handleEvent(Repaint(%d))\n", mForceRepaint); - - nsresult rv; - nsCOMPtr baseWindow; - - rv = mWebShell->QueryInterface(NS_GET_IID(nsIBaseWindow), - getter_AddRefs(baseWindow)); - - if (NS_FAILED(rv)) { - return NULL; - } - rv = baseWindow->Repaint(mForceRepaint); - - printf("result = %lx\n", rv); - } - return NULL; -} // handleEvent() - - - -/* - * wsCanBackEvent - */ - -wsCanBackEvent::wsCanBackEvent(nsIWebShell* webShell) : - nsActionEvent(), - mWebShell(webShell) -{ -} - - -void * -wsCanBackEvent::handleEvent () -{ - if (mWebShell) { - - printf("handleEvent(CanBack())\n"); - - nsresult rv = mWebShell->CanBack(); - - printf("result = %lx\n", rv); - - return (void *) rv; - } - return NULL; -} // handleEvent() - - - -/* - * wsCanForwardEvent - */ - -wsCanForwardEvent::wsCanForwardEvent(nsIWebShell* webShell) : - nsActionEvent(), - mWebShell(webShell) -{ -} - - -void * -wsCanForwardEvent::handleEvent () -{ - if (mWebShell) { - - printf("handleEvent(CanForward())\n"); - - nsresult rv = mWebShell->CanForward(); - - printf("result = %lx\n", rv); - - return (void *) rv; - } - return NULL; -} // handleEvent() - - - -/* - * wsBackEvent - */ - -wsBackEvent::wsBackEvent(nsIWebShell* webShell) : - nsActionEvent(), - mWebShell(webShell) -{ -} - - -void * -wsBackEvent::handleEvent () -{ - if (mWebShell) { - - printf("handleEvent(Back())\n"); - - nsresult rv = mWebShell->Back(); - - printf("result = %lx\n", rv); - - return (void *) rv; - } - return NULL; -} // handleEvent() - - - -/* - * wsForwardEvent - */ - -wsForwardEvent::wsForwardEvent(nsIWebShell* webShell) : - nsActionEvent(), - mWebShell(webShell) -{ -} - - -void * -wsForwardEvent::handleEvent () -{ - if (mWebShell) { - - printf("handleEvent(Forward())\n"); - - nsresult rv = mWebShell->Forward(); - - printf("result = %lx\n", rv); - - return (void *) rv; - } - return NULL; -} // handleEvent() - - - -/* - * wsGoToEvent - */ - -wsGoToEvent::wsGoToEvent(nsIWebShell* webShell, PRInt32 historyIndex) : - nsActionEvent(), - mWebShell(webShell), - mHistoryIndex(historyIndex) -{ -} - - -void * -wsGoToEvent::handleEvent () -{ - if (mWebShell) { - - printf("handleEvent(GoTo(%ld))\n", mHistoryIndex); - - nsresult rv = mWebShell->GoTo(mHistoryIndex); - - printf("result = %lx\n", rv); - - return (void *) rv; - } - return NULL; -} // handleEvent() - - - -/* - * wsGetHistoryLengthEvent - */ - -wsGetHistoryLengthEvent::wsGetHistoryLengthEvent(nsIWebShell* webShell) : - nsActionEvent(), - mWebShell(webShell) -{ -} - - -void * -wsGetHistoryLengthEvent::handleEvent () -{ - if (mWebShell) { - - printf("handleEvent(wsGetHistoryLengthEvent())\n"); - - PRInt32 historyLength = 0; - - nsresult rv = mWebShell->GetHistoryLength(historyLength); - - printf("result = %lx\n", rv); - - return (void *) historyLength; - } - return NULL; -} // handleEvent() - - - -/* - * wsGetHistoryIndexEvent - */ - -wsGetHistoryIndexEvent::wsGetHistoryIndexEvent(nsIWebShell* webShell) : - nsActionEvent(), - mWebShell(webShell) -{ -} - - -void * -wsGetHistoryIndexEvent::handleEvent () -{ - if (mWebShell) { - - printf("handleEvent(wsGetHistoryIndexEvent())\n"); - - PRInt32 historyIndex = 0; - - nsresult rv = mWebShell->GetHistoryIndex(historyIndex); - - printf("result = %lx\n", rv); - - return (void *) historyIndex; - } - return NULL; -} // handleEvent() - - - -/* - * wsGetURLEvent - */ - -wsGetURLEvent::wsGetURLEvent(nsIWebShell* webShell, PRInt32 historyIndex) : - nsActionEvent(), - mWebShell(webShell), - mHistoryIndex(historyIndex) -{ -} - - -void * -wsGetURLEvent::handleEvent () -{ - if (mWebShell) { - - printf("handleEvent(wsGetURLEvent(%ld))\n", mHistoryIndex); - - const PRUnichar * url = nsnull; - - // returns PRUninchar * URL in . No need to delete. References internal buffer of an nsString - nsresult rv = mWebShell->GetURL(mHistoryIndex, &url); - - printf("result = %lx, url = %lx\n", rv, url); - - return (void *) url; - } - return NULL; -} // handleEvent() - -// Added by Mark Goddard OTMP 9/2/1999 - -/* - * wsRefreshEvent - */ - -wsRefreshEvent::wsRefreshEvent(nsIWebShell* webShell) : - nsActionEvent(), - mWebShell(webShell) -{ -} - - -void * -wsRefreshEvent::handleEvent () -{ - if (mWebShell) { - - printf("handleEvent(Refresh())\n"); - - nsresult rv = mWebShell->Reload(nsIChannel::LOAD_NORMAL); - - printf("result = %lx\n", rv); - - return (void *) rv; - } - return NULL; -} // handleEvent() - - - -// EOF - diff --git a/mozilla/java/webclient/src/nsActions.h b/mozilla/java/webclient/src/nsActions.h deleted file mode 100644 index 82dbf87c058..00000000000 --- a/mozilla/java/webclient/src/nsActions.h +++ /dev/null @@ -1,263 +0,0 @@ -/* -*- 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 RaptorCanvas. - * - * The Initial Developer of the Original Code is Kirk Baker and - * Ian Wilkinson. Portions created by Kirk Baker and Ian Wilkinson are - * Copyright (C) 1999 Kirk Baker and Ian Wilkinson. All - * Rights Reserved. - * - * Contributor(s): Kirk Baker - * Ian Wilkinson - * Mark Lin - * Mark Goddard - * Ed Burns - */ - -/* - * nsActions.h - */ - -#ifndef nsActions_h___ -#define nsActions_h___ - -#ifndef XP_UNIX -#include -#endif -#include "nsIWebShell.h" -#include "nsString.h" -#include "plevent.h" - - -class nsActionEvent { -public: - nsActionEvent (); - virtual ~nsActionEvent () {}; - virtual void * handleEvent (void) { return NULL;}; - void destroyEvent (void) { delete this; }; - operator PLEvent* () { return &mEvent; }; - -protected: - PLEvent mEvent; -}; - - -class wsResizeEvent : public nsActionEvent { -public: - wsResizeEvent (nsIWebShell* webShell, PRInt32 x, PRInt32 y, PRInt32 w, PRInt32 h); - void * handleEvent (void); - -protected: - nsIWebShell * mWebShell; - PRInt32 mLeft; - PRInt32 mBottom; - PRInt32 mWidth; - PRInt32 mHeight; -}; - - -class wsLoadURLEvent : public nsActionEvent { -public: - wsLoadURLEvent (nsIWebShell* webShell, PRUnichar * urlString); - ~wsLoadURLEvent (); - void * handleEvent (void); - -protected: - nsIWebShell * mWebShell; - nsString * mURL; -}; - - -class wsStopEvent : public nsActionEvent { -public: - wsStopEvent (nsIWebShell* webShell); - void * handleEvent (void); - -protected: - nsIWebShell * mWebShell; -}; - - - -class wsShowEvent : public nsActionEvent { -public: - wsShowEvent (nsIWebShell* webShell); - void * handleEvent (void); - -protected: - nsIWebShell * mWebShell; -}; - - - -class wsHideEvent : public nsActionEvent { -public: - wsHideEvent (nsIWebShell* webShell); - void * handleEvent (void); - -protected: - nsIWebShell * mWebShell; -}; - - - -class wsMoveToEvent : public nsActionEvent { -public: - wsMoveToEvent (nsIWebShell* webShell, PRInt32 x, PRInt32 y); - void * handleEvent (void); - -protected: - nsIWebShell * mWebShell; - PRInt32 mX; - PRInt32 mY; -}; - - - -class wsSetFocusEvent : public nsActionEvent { -public: - wsSetFocusEvent(nsIWebShell* webShell); - void * handleEvent (void); - -protected: - nsIWebShell * mWebShell; -}; - - - -class wsRemoveFocusEvent : public nsActionEvent { -public: - wsRemoveFocusEvent(nsIWebShell* webShell); - void * handleEvent (void); - -protected: - nsIWebShell * mWebShell; -}; - - - -class wsRepaintEvent : public nsActionEvent { -public: - wsRepaintEvent (nsIWebShell* webShell, PRBool forceRepaint); - void * handleEvent (void); - -protected: - nsIWebShell * mWebShell; - PRBool mForceRepaint; -}; - - - -class wsCanBackEvent : public nsActionEvent { -public: - wsCanBackEvent (nsIWebShell* webShell); - void * handleEvent (void); - -protected: - nsIWebShell * mWebShell; -}; - - - -class wsCanForwardEvent : public nsActionEvent { -public: - wsCanForwardEvent(nsIWebShell* webShell); - void * handleEvent (void); - -protected: - nsIWebShell * mWebShell; -}; - - - -class wsBackEvent : public nsActionEvent { -public: - wsBackEvent (nsIWebShell* webShell); - void * handleEvent (void); - -protected: - nsIWebShell * mWebShell; -}; - - - -class wsForwardEvent : public nsActionEvent { -public: - wsForwardEvent (nsIWebShell* webShell); - void * handleEvent (void); - -protected: - nsIWebShell * mWebShell; -}; - - - -class wsGoToEvent : public nsActionEvent { -public: - wsGoToEvent (nsIWebShell* webShell, PRInt32 historyIndex); - void * handleEvent (void); - -protected: - nsIWebShell * mWebShell; - PRInt32 mHistoryIndex; -}; - - - -class wsGetHistoryLengthEvent : public nsActionEvent { -public: - wsGetHistoryLengthEvent(nsIWebShell* webShell); - void * handleEvent (void); - -protected: - nsIWebShell * mWebShell; -}; - - - -class wsGetHistoryIndexEvent : public nsActionEvent { -public: - wsGetHistoryIndexEvent (nsIWebShell* webShell); - void * handleEvent (void); - -protected: - nsIWebShell * mWebShell; -}; - - - -class wsGetURLEvent : public nsActionEvent { -public: - wsGetURLEvent (nsIWebShell* webShell, PRInt32 historyIndex); - void * handleEvent (void); - -protected: - nsIWebShell * mWebShell; - PRInt32 mHistoryIndex; -}; - -// added by Mark Goddard OTMP 9/2/1999 -class wsRefreshEvent : public nsActionEvent { -public: - wsRefreshEvent (nsIWebShell* webShell); - void * handleEvent (void); - -protected: - nsIWebShell * mWebShell; -}; - - -#endif /* nsActions_h___ */ - - -// EOF diff --git a/mozilla/java/webclient/src/runem.solaris b/mozilla/java/webclient/src/runem.solaris deleted file mode 100755 index 708f729acfb..00000000000 --- a/mozilla/java/webclient/src/runem.solaris +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -MOZILLA_TOP=${PWD}/../../.. -MOZILLA_DIST=${MOZILLA_TOP}/dist -MOZILLA_FIVE_HOME=${MOZILLA_DIST}/bin -export MOZILLA_FIVE_HOME - -# Standard JDK 1.2 location -JDK_LOCATION=${JDKHOME} -# WARNING: YOU NEED TO RUN 'gtk-config --libs' and stick in whatever library -# paths it gives you!!!! -GTKLIBS=/usr/local/X11R6/lib:/opt/local/lib:/usr/openwin/lib:/usr/dt/lib -# For Solaris -LD_LIBRARY_PATH=${JDK_LOCATION}/jre/lib/sparc:${JDK_LOCATION}/jre/lib/sparc/native_threads:${JDK_LOCATION}/jre/lib/sparc/classic:${MOZILLA_DIST}/bin:${GTKLIBS}:.:/usr/local/lib:/usr/lib:/lib -export LD_LIBRARY_PATH -JAVA=${JDK_LOCATION}/bin/java -OUTPUT_DIR=${MOZILLA_DIST}/classes -# JDK 1.2 CLASSES -CLASSES=${JDK_LOCATION}/lib/tools.jar:${JDK_LOCATION}/lib/rt.jar:${OUTPUT_DIR} -CLASSNAME=org.mozilla.webclient.test.EmbeddedMozilla - -echo -echo "====================================================================" -echo JDKHOME=${JDKHOME} -echo "====================================================================" -echo CLASSPATH=${CLASSES} -echo "====================================================================" -echo MOZILLA_FIVE_HOME=${MOZILLA_FIVE_HOME} -echo "====================================================================" -echo LD_LIBRARY_PATH=${LD_LIBRARY_PATH} -echo "====================================================================" -echo -# For debugging... -#${JAVA} -native -verbose:jni -Xcheck:jni -classpath ${CLASSES} ${CLASSNAME} ${MOZILLA_FIVE_HOME} $1 -echo ${JAVA} -native -classpath ${CLASSES} ${CLASSNAME} ${MOZILLA_FIVE_HOME} $1 $2 $3 $4 $5 -${JAVA} -native -classpath ${CLASSES} ${CLASSNAME} ${MOZILLA_FIVE_HOME} $1 $2 $3 $4 $5 - - - diff --git a/mozilla/java/webclient/src/runem.unix b/mozilla/java/webclient/src/runem.unix deleted file mode 100755 index 5c3193e10cf..00000000000 --- a/mozilla/java/webclient/src/runem.unix +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -MOZILLA_TOP=${PWD}/../../.. -MOZILLA_DIST=${MOZILLA_TOP}/dist -MOZILLA_FIVE_HOME=${MOZILLA_DIST}/bin -export MOZILLA_FIVE_HOME - -# Standard JDK 1.2 location -JDK_LOCATION=${JDKHOME} -# WARNING: YOU NEED TO RUN 'gtk-config --libs' and stick in whatever library -# paths it gives you!!!! -GTKLIBS=/usr/lib -LD_LIBRARY_PATH=${JDK_LOCATION}/jre/lib/i386:${JDK_LOCATION}/jre/lib/i386/classic:${JDK_LOCATION}/jre/lib/i386/native_threads:${MOZILLA_DIST}/bin:${GTKLIBS}:.:/usr/local/lib:/usr/lib:/lib -export LD_LIBRARY_PATH -JAVA=${JDK_LOCATION}/bin/java -OUTPUT_DIR=${MOZILLA_DIST}/classes -# JDK 1.2 CLASSES -CLASSES=${JDK_LOCATION}/lib/tools.jar:${JDK_LOCATION}/lib/rt.jar:${OUTPUT_DIR} -CLASSNAME=org.mozilla.webclient.test.EmbeddedMozilla - -echo -echo "====================================================================" -echo JDKHOME=${JDKHOME} -echo "====================================================================" -echo CLASSPATH=${CLASSES} -echo "====================================================================" -echo MOZILLA_FIVE_HOME=${MOZILLA_FIVE_HOME} -echo "====================================================================" -echo LD_LIBRARY_PATH=${LD_LIBRARY_PATH} -echo "====================================================================" -echo -# For debugging... -#${JAVA} -native -verbose:jni -Xcheck:jni -classpath ${CLASSES} ${CLASSNAME} $1 -${JAVA} -native -classpath ${CLASSES} ${CLASSNAME} $1 $2 $3 $4 $5 - - -