mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-04 02:40:27 +08:00
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
This commit is contained in:
parent
508a1c9c6d
commit
316a1df4f4
@ -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
|
||||
|
@ -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 \
|
||||
|
@ -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 \
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user