From 1ea63ef8be1cc54dd0de9d82c684713a1dcf1e06 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 23 Sep 2005 21:31:04 +0000 Subject: Imported Classpath 0.18. * sources.am, Makefile.in: Updated. * Makefile.am (nat_source_files): Removed natProxy.cc. * java/lang/reflect/natProxy.cc: Removed. * gnu/classpath/jdwp/VMFrame.java, gnu/classpath/jdwp/VMIdManager.java, gnu/classpath/jdwp/VMVirtualMachine.java, java/lang/reflect/VMProxy.java: New files. 2005-09-23 Thomas Fitzsimmons * scripts/makemake.tcl (verbose): Add gnu/java/awt/peer/qt to BC list. 2005-09-23 Thomas Fitzsimmons * gnu/java/net/DefaultContentHandlerFactory.java (getContent): Remove ClasspathToolkit references. 2005-09-23 Thomas Fitzsimmons * gnu/awt/xlib/XCanvasPeer.java: Add new peer methods. * gnu/awt/xlib/XFramePeer.java: Likewise. * gnu/awt/xlib/XGraphicsConfiguration.java: Likewise. 2005-09-23 Thomas Fitzsimmons * Makefile.am (libgcjawt_la_SOURCES): Remove jawt.c. Add classpath/native/jawt/jawt.c. * Makefile.in: Regenerate. * jawt.c: Remove file. * include/Makefile.am (tool_include__HEADERS): Remove jawt.h and jawt_md.h. Add ../classpath/include/jawt.h and ../classpath/include/jawt_md.h. * include/Makefile.in: Regenerate. * include/jawt.h: Regenerate. * include/jawt_md.h: Regenerate. From-SVN: r104586 --- .../gnu/java/awt/peer/gtk/GtkFileDialogPeer.java | 28 ++++++++++++++-------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'libjava/classpath/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java') diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java b/libjava/classpath/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java index bd1f0775a92..333407b247f 100644 --- a/libjava/classpath/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java +++ b/libjava/classpath/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java @@ -42,6 +42,7 @@ import java.awt.Dialog; import java.awt.FileDialog; import java.awt.Graphics; import java.awt.Window; +import java.awt.event.ComponentEvent; import java.awt.peer.FileDialogPeer; import java.io.File; import java.io.FilenameFilter; @@ -54,7 +55,7 @@ public class GtkFileDialogPeer extends GtkDialogPeer implements FileDialogPeer private String currentDirectory = null; private FilenameFilter filter; - native void create (GtkContainerPeer parent); + native void create (GtkContainerPeer parent, int mode); native void connectSignals (); native void nativeSetFile (String file); public native String nativeGetDirectory(); @@ -63,7 +64,8 @@ public class GtkFileDialogPeer extends GtkDialogPeer implements FileDialogPeer public void create() { - create((GtkContainerPeer) awtComponent.getParent().getPeer()); + create((GtkContainerPeer) awtComponent.getParent().getPeer(), + ((FileDialog) awtComponent).getMode()); FileDialog fd = (FileDialog) awtComponent; @@ -87,10 +89,10 @@ public class GtkFileDialogPeer extends GtkDialogPeer implements FileDialogPeer { int[] dims = new int[2]; gtkWidgetGetPreferredDimensions (dims); - ((GtkFileDialogPeer) this).setBoundsCallback ((Window) awtComponent, - awtComponent.getX (), - awtComponent.getY (), - dims[0], dims[1]); + + if (dims[0] != awtComponent.getWidth() + || dims[1] != awtComponent.getHeight()) + awtComponent.setSize(dims[0], dims[1]); } super.setComponentBounds (); } @@ -155,6 +157,7 @@ public class GtkFileDialogPeer extends GtkDialogPeer implements FileDialogPeer GtkFileFilterInfo object and send it to this method, which will in turn call the filter's accept() method and give back the return value. */ + // called back by native side: filename_filter_cb boolean filenameFilterCallback (String fullname) { String filename = fullname.substring(fullname.lastIndexOf(FS) + 1); String dirname = fullname.substring(0, fullname.lastIndexOf(FS)); @@ -167,20 +170,25 @@ public class GtkFileDialogPeer extends GtkDialogPeer implements FileDialogPeer // GtkFileDialog will repaint by itself return null; } - + + // called back by native side: handle_response_cb + // only called from the GTK thread void gtkHideFileDialog () { + // hide calls back the peer's setVisible method, so locking is a + // problem. ((Dialog) awtComponent).hide(); } + // called back by native side: handle_response_cb void gtkDisposeFileDialog () { ((Dialog) awtComponent).dispose(); } - /* Callback to set the file and directory values when the user is finished - * with the dialog. - */ + // Callback to set the file and directory values when the user is finished + // with the dialog. + // called back by native side: handle_response_cb void gtkSetFilename (String fileName) { FileDialog fd = (FileDialog) awtWidget; -- cgit v1.2.3