diff options
author | Michael Koch <konqueror@gmx.de> | 2004-07-17 08:37:22 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2004-07-17 08:37:22 +0000 |
commit | 316a1df4f4108959bdc5720e45818eb53bed6347 (patch) | |
tree | 3574e5e329368fbc3591baf62c3a75ce8a0e6cc0 /libjava | |
parent | 508a1c9c6d5d84df1207ff6d1e849e104b41694b (diff) | |
download | gcc-316a1df4f4108959bdc5720e45818eb53bed6347.zip gcc-316a1df4f4108959bdc5720e45818eb53bed6347.tar.gz gcc-316a1df4f4108959bdc5720e45818eb53bed6347.tar.bz2 |
2004-07-17 Michael Koch <konqueror@gmx.de>
* gnu/java/awt/EmbeddedWindow.java
(static): Removed.
(addNotify): Set peer via reflection.
(setWindowPeer): Removed.
* gnu/java/awt/natEmbeddedWindow.cc: Removed.
* Makefile.am (nat_source_files):
Removed gnu/java/awt/natEmbeddedWindow.cc.
* Makefile.in: Regenerated.
From-SVN: r84854
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 11 | ||||
-rw-r--r-- | libjava/Makefile.am | 1 | ||||
-rw-r--r-- | libjava/Makefile.in | 5 | ||||
-rw-r--r-- | libjava/gnu/java/awt/EmbeddedWindow.java | 32 | ||||
-rw-r--r-- | libjava/gnu/java/awt/natEmbeddedWindow.cc | 18 |
5 files changed, 32 insertions, 35 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index fea13dd..c634be8 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,14 @@ +2004-07-17 Michael Koch <konqueror@gmx.de> + + * gnu/java/awt/EmbeddedWindow.java + (static): Removed. + (addNotify): Set peer via reflection. + (setWindowPeer): Removed. + * gnu/java/awt/natEmbeddedWindow.cc: Removed. + * Makefile.am (nat_source_files): + Removed gnu/java/awt/natEmbeddedWindow.cc. + * Makefile.in: Regenerated. + 2004-07-17 Richard Earnshaw <rearnsha@arm.com> * configure.in(ZIP, GCJH): Remove white space around '=' in variable diff --git a/libjava/Makefile.am b/libjava/Makefile.am index a7e79b4..5b1d3a6 100644 --- a/libjava/Makefile.am +++ b/libjava/Makefile.am @@ -2943,7 +2943,6 @@ gnu/gcj/runtime/natSharedLibLoader.cc \ gnu/gcj/runtime/natStackTrace.cc \ gnu/gcj/runtime/natStringBuffer.cc \ gnu/gcj/runtime/natVMClassLoader.cc \ -gnu/java/awt/natEmbeddedWindow.cc \ gnu/java/lang/natMainThread.cc \ gnu/java/net/natPlainDatagramSocketImpl.cc \ gnu/java/net/natPlainSocketImpl.cc \ diff --git a/libjava/Makefile.in b/libjava/Makefile.in index 0505da1..b667423 100644 --- a/libjava/Makefile.in +++ b/libjava/Makefile.in @@ -2625,7 +2625,6 @@ gnu/gcj/runtime/natSharedLibLoader.cc \ gnu/gcj/runtime/natStackTrace.cc \ gnu/gcj/runtime/natStringBuffer.cc \ gnu/gcj/runtime/natVMClassLoader.cc \ -gnu/java/awt/natEmbeddedWindow.cc \ gnu/java/lang/natMainThread.cc \ gnu/java/net/natPlainDatagramSocketImpl.cc \ gnu/java/net/natPlainSocketImpl.cc \ @@ -2806,8 +2805,7 @@ gnu/gcj/convert/natOutput_SJIS.lo gnu/gcj/io/natSimpleSHSStream.lo \ gnu/gcj/io/shs.lo gnu/gcj/runtime/natFinalizerThread.lo \ gnu/gcj/runtime/natNameFinder.lo gnu/gcj/runtime/natSharedLibLoader.lo \ gnu/gcj/runtime/natStackTrace.lo gnu/gcj/runtime/natStringBuffer.lo \ -gnu/gcj/runtime/natVMClassLoader.lo gnu/java/awt/natEmbeddedWindow.lo \ -gnu/java/lang/natMainThread.lo \ +gnu/gcj/runtime/natVMClassLoader.lo gnu/java/lang/natMainThread.lo \ gnu/java/net/natPlainDatagramSocketImpl.lo \ gnu/java/net/natPlainSocketImpl.lo \ gnu/java/net/protocol/core/natCoreInputStream.lo \ @@ -3171,7 +3169,6 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \ .deps/gnu/java/awt/EventModifier.P \ .deps/gnu/java/awt/image/ImageDecoder.P \ .deps/gnu/java/awt/image/XBMDecoder.P \ -.deps/gnu/java/awt/natEmbeddedWindow.P \ .deps/gnu/java/awt/peer/ClasspathFontPeer.P \ .deps/gnu/java/awt/peer/EmbeddedWindowPeer.P \ .deps/gnu/java/awt/peer/GLightweightPeer.P \ diff --git a/libjava/gnu/java/awt/EmbeddedWindow.java b/libjava/gnu/java/awt/EmbeddedWindow.java index f938f55..5f1d71a 100644 --- a/libjava/gnu/java/awt/EmbeddedWindow.java +++ b/libjava/gnu/java/awt/EmbeddedWindow.java @@ -40,23 +40,20 @@ package gnu.java.awt; import gnu.classpath.Configuration; import gnu.java.awt.peer.EmbeddedWindowPeer; + +import java.awt.Component; import java.awt.Frame; import java.awt.Toolkit; +import java.lang.reflect.Field; /** * Represents an AWT window that can be embedded into another * application. * - * @author Michael Koch <konqueror@gmx.de> + * @author Michael Koch (konqueror@gmx.de) */ public class EmbeddedWindow extends Frame { - static - { - if (Configuration.INIT_LOAD_LIBRARY) - System.loadLibrary("javaawt"); - } - private long handle; /** @@ -93,14 +90,25 @@ public class EmbeddedWindow extends Frame throw new UnsupportedOperationException ("Embedded windows are not supported by the current peers: " + tk.getClass()); - setWindowPeer (((EmbeddedWindowSupport) tk).createEmbeddedWindow (this)); + // Circumvent the package-privateness of the AWT internal + // java.awt.Component.peer member variable. + try + { + Field peerField = Component.class.getDeclaredField("peer"); + peerField.set(this, ((EmbeddedWindowSupport) tk).createEmbeddedWindow (this)); + } + catch (IllegalAccessException e) + { + // This should never happen. + } + catch (NoSuchFieldException e) + { + // This should never happen. + } + super.addNotify(); } - // This method is only made native to circumvent the package-privateness of - // an AWT internal java.awt.Component.peer member variable. - native void setWindowPeer (EmbeddedWindowPeer peer); - /** * If the native peer for this embedded window has been created, * then setHandle will embed the window. If not, setHandle tells diff --git a/libjava/gnu/java/awt/natEmbeddedWindow.cc b/libjava/gnu/java/awt/natEmbeddedWindow.cc deleted file mode 100644 index 79cdd67..0000000 --- a/libjava/gnu/java/awt/natEmbeddedWindow.cc +++ /dev/null @@ -1,18 +0,0 @@ -/* Copyright (C) 2003 Free Software Foundation - - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ - -#include <gnu/java/awt/EmbeddedWindow.h> -#include <gnu/java/awt/peer/EmbeddedWindowPeer.h> -#include <java/awt/peer/ComponentPeer.h> - -void -gnu::java::awt::EmbeddedWindow::setWindowPeer (gnu::java::awt::peer::EmbeddedWindowPeer* w) -{ - if (!peer) - peer = reinterpret_cast< ::java::awt::peer::ComponentPeer *> (w); -} |