summaryrefslogtreecommitdiffstats
path: root/libjava/gnu/java/awt/peer
diff options
context:
space:
mode:
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-27 19:04:42 +0000
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-27 19:04:42 +0000
commitc3d201dee6a1d42270bf2d1388faf42a4a5da8c4 (patch)
treefcc5d69edb5a39dceca0ff7cc2899f14dbba82ab /libjava/gnu/java/awt/peer
parent149a7f801f64efdc61c4194d8632c11989e12dcd (diff)
downloadppe42-gcc-c3d201dee6a1d42270bf2d1388faf42a4a5da8c4.tar.gz
ppe42-gcc-c3d201dee6a1d42270bf2d1388faf42a4a5da8c4.zip
2003-07-27 Thomas Fitzsimmons <fitzsim@redhat.com.h>
Michael Koch <konqueror@gmx.de> * gnu/java/awt/EmbeddedWindow.java (EmbeddedWindow): Extends Frame instead of Window. (window_id): New member variable to store the native window handle. (create): Removed. (EmbeddedWindow): New constructor. (addNotify): New method. (getHandler): Likewise. (setWindowPeer): New native method. * gnu/java/awt/EmbeddedWindowSupport.java (EmbeddedWindowSupport): Fixed documentation. (createEmbeddedWindow): Return EmbeddedWindowPeer instead of WindowPeer, give it an EmbeddedWindow instance instead of the raw window data. * gnu/java/awt/natEmbeddedWindow.cc (create): Removed. (setWindowPeer): New method. * gnu/java/awt/peer/EmbeddedWindowPeer.java, gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c: New files * gnu/java/awt/peer/gtk/GtkToolkit.java (GtkToolkit): Implements EmbeddedWindowSupport. (createEmbeddedWindow): New method. * java/awt/Window.java (Window): Removed. * Makefile.am (java_source_files): Added EmbeddedWindowPeer.java. (gtk_awt_peer_sources): Added GtkEmbeddedWindowPeer.java. (gtk_c_source_files): Added gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c. * Makefile.in: Regenerated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69859 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu/java/awt/peer')
-rw-r--r--libjava/gnu/java/awt/peer/EmbeddedWindowPeer.java46
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java55
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkToolkit.java11
3 files changed, 111 insertions, 1 deletions
diff --git a/libjava/gnu/java/awt/peer/EmbeddedWindowPeer.java b/libjava/gnu/java/awt/peer/EmbeddedWindowPeer.java
new file mode 100644
index 00000000000..a1787684505
--- /dev/null
+++ b/libjava/gnu/java/awt/peer/EmbeddedWindowPeer.java
@@ -0,0 +1,46 @@
+/* EmbeddedWindowPeer.java -- Interface for window peers that may be
+ embedded into other applications
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.awt.peer;
+
+import java.awt.peer.FramePeer;
+
+public interface EmbeddedWindowPeer extends FramePeer
+{
+}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java
new file mode 100644
index 00000000000..d17ff63e11e
--- /dev/null
+++ b/libjava/gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java
@@ -0,0 +1,55 @@
+/* GtkEmbeddedWindowPeer.java -- Implements FramePeer using a GtkPlug
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.awt.peer.gtk;
+
+import gnu.java.awt.EmbeddedWindow;
+import gnu.java.awt.peer.EmbeddedWindowPeer;
+
+public class GtkEmbeddedWindowPeer extends GtkFramePeer
+ implements EmbeddedWindowPeer
+{
+ native void create();
+ native void construct (int window_id);
+
+ public GtkEmbeddedWindowPeer (EmbeddedWindow w)
+ {
+ super (w);
+ construct (w.getHandle());
+ }
+}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java b/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java
index c998d1909e4..9f669ac5281 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java
@@ -52,6 +52,9 @@ import java.util.Hashtable;
import java.util.Map;
import java.util.MissingResourceException;
import java.util.Properties;
+import gnu.java.awt.EmbeddedWindow;
+import gnu.java.awt.EmbeddedWindowSupport;
+import gnu.java.awt.peer.EmbeddedWindowPeer;
import gnu.classpath.Configuration;
/* This class uses a deprecated method java.awt.peer.ComponentPeer.getPeer().
@@ -61,7 +64,8 @@ import gnu.classpath.Configuration;
this class. If getPeer() ever goes away, we can implement a hash table
that will keep up with every window's peer, but for now this is faster. */
-public class GtkToolkit extends java.awt.Toolkit
+public class GtkToolkit extends Toolkit
+ implements EmbeddedWindowSupport
{
GtkMainThread main;
Hashtable containers = new Hashtable();
@@ -299,6 +303,11 @@ public class GtkToolkit extends java.awt.Toolkit
return new GtkWindowPeer (w);
}
+ public EmbeddedWindowPeer createEmbeddedWindow (EmbeddedWindow w)
+ {
+ return new GtkEmbeddedWindowPeer (w);
+ }
+
protected FontPeer getFontPeer (String name, int style)
{
try {
OpenPOWER on IntegriCloud