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.

Co-Authored-By: Michael Koch <konqueror@gmx.de>

From-SVN: r69859
This commit is contained in:
Thomas Fitzsimmons 2003-07-27 19:04:42 +00:00 committed by Michael Koch
parent b7a78333b1
commit 0963808165
10 changed files with 286 additions and 26 deletions

View file

@ -38,25 +38,59 @@ exception statement from your version. */
package gnu.java.awt;
import java.awt.Window;
import gnu.java.awt.peer.EmbeddedWindowPeer;
import java.awt.Frame;
import java.awt.Toolkit;
/**
* This class represents an AWT window embedded into another graphical
* toolkit or anther application.
* Represents an AWT window that can be embedded into another
* application.
*
* @author Michael Koch <konqueror@gmx.de>
*/
public class EmbeddedWindow extends Window
public class EmbeddedWindow extends Frame
{
private int window_id;
/**
* Creates an window embedded into another application of graphical toolkit.
* Creates an window to be embedded into another application.
*
* @param window_id The native handle to the screen area where the AWT window
* should be embedded.
* @param width The width of the screen area.
* @param height The height of the screen area.
*/
public EmbeddedWindow (int window_id)
{
super();
this.window_id = window_id;
}
/**
* Creates the native peer for this embedded window.
*/
public void addNotify()
{
Toolkit tk = getToolkit();
if (! (tk instanceof EmbeddedWindowSupport))
throw new UnsupportedOperationException
("Embedded windows are not supported by the current peers: " + tk.getClass());
setWindowPeer (((EmbeddedWindowSupport) tk).createEmbeddedWindow (this));
super.addNotify();
}
// This method is only made native to circumvent the package-privateness of
// an internal java.awt.Window constructor.
public static native Window create (int window_id, int width, int height);
// an AWT internal java.awt.Component.peer member variable.
native void setWindowPeer (EmbeddedWindowPeer peer);
/**
* Gets the native handle of the screen area where the window will
* be embedded.
*
* @return The native handle that was passed to the constructor.
*/
public int getHandle()
{
return window_id;
}
}