Working GridBagLayout and a few other small AWT patches

2003-07-23 Thread Jeroen Frijters
Hi,

I almost finished GridBagLayout. The only thing not implemented yet is
adjustForGravity, besides that everything else should work.

The patch also includes a few small AWT fixes (some of which I
previously posted to the list).

Change Log

* java/awt/Component.java
(getPreferredSize): Call preferredSize.
(preferredSize): Moved body of getPreferredSize here.
(getMinimumSize): Call minimumSize.
(minimumSize): Moved body of getMinimumSize here.
(prepareImage): Fall back on Toolkit.prepareImage if there is no peer
(checkImage(Image,ImageObserver)): Don't call getWidth/getHeight, but
pass -1

* java/awt/Container.java
(validate): Don't validate if there is no peer.

* java/awt/GridBagLayout.java
Completed the implementation and fixed several bugs.

* java/awt/MediaTracker.java
(MediaEntry.imageUpdate): Fixed typo.  instead of | was used to combine
flags.

* java/awt/Window.java
(Window): Don't call setVisible(false). Windows are invisible by default
and calling virtual methods from constructor causes compatibility
problems (e.g. subclasses may assume that the peer already exists).

Please commit to CVS.

Regards,
Jeroen


awt_20030723.patch
Description: awt_20030723.patch
___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


classpath 0.06?

2003-07-23 Thread David P Grove

There was some discussion a month or
so ago about making a classpath 0.06 distribution. Is there a chance
this could happen sometime relatively soon? We're thinking about
making the next release of Jikes RVM in 2-3 weeks and it would be great
to be able to get all the hard work done in classpath since 0.05 out to
our users. Almost all of them use classpath 0.05 instead of classpath
cvs head because the install process is easier. 

--dave___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


Patch: Regenerate JNI headers automatically

2003-07-23 Thread Thomas Fitzsimmons
Hello,

This patch adds a configure flag that enables automatic regeneration of
JNI headers.  The flag is disabled by default.

Each header is only rebuilt if its prerequisite .java file changes.  The
new automake file, include/Makefile.am, contains the list of header
targets.

Currently the list consists of AWT-related headers.  Could someone who
is more familiar with the other areas of classpath that require JNI
headers complete the list?  Some headers should probably be removed.

Mark Wielaard suggested that anyone checking in changes to these headers
should use gcjh, since it is free and produces clean output.  If people
agree with this, I will regenerate the AWT-headers and check them in.

Comments?

Tom

2003-07-23  Thomas Fitzsimmons  [EMAIL PROTECTED]

* Makefile.am (SUBDIRS): Add $(HEADER_DIR).
* configure.in: Add --enable-regen-headers flag.
(AC_OUTPUT): Add include/Makefile.
* include/Makefile.am: New file.

Index: Makefile.am
===
RCS file: /cvsroot/classpath/classpath/Makefile.am,v
retrieving revision 1.25
diff -u -b -B -r1.25 Makefile.am
--- Makefile.am	1 Feb 2003 12:54:05 -	1.25
+++ Makefile.am	23 Jul 2003 15:40:51 -
@@ -1,7 +1,7 @@
 ## Input file for automake to generate the Makefile.in used by configure
 
 # lib first, to compile .class files before native code
-SUBDIRS = lib doc gnu java javax native resource vm
+SUBDIRS = lib doc gnu java javax $(HEADER_DIR) native resource vm
 
 native: lib
 
Index: configure.in
===
RCS file: /cvsroot/classpath/classpath/configure.in,v
retrieving revision 1.127
diff -u -b -B -r1.127 configure.in
--- configure.in	16 Jul 2003 15:17:33 -	1.127
+++ configure.in	23 Jul 2003 15:40:51 -
@@ -75,6 +75,16 @@
 AM_CONDITIONAL(CREATE_CNI_LIBRARIES, test x${COMPILE_CNI} = xyes)
 AM_CONDITIONAL(CREATE_GTK_PEER_LIBRARIES, test x${COMPILE_GTK_PEER} = xyes)
 
+AC_ARG_ENABLE(regen-headers,
+[  --enable-regen-headers   automatically regenerate JNI headers [default=no]],
+[case ${enableval} in
+  yes) HEADER_DIR=include ;;
+  no) HEADER_DIR= ;;
+  *) HEADER_DIR= ;;
+esac],
+[HEADER_DIR=])
+AC_SUBST(HEADER_DIR)
+
 AC_PROG_LN_S
 AC_PROG_INSTALL
 
@@ -328,6 +338,7 @@
 gnu/javax/Makefile
 gnu/javax/rmi/Makefile
 gnu/javax/rmi/CORBA/Makefile
+include/Makefile
 include/jni.h
 java/Makefile
 java/applet/Makefile
Index: include/Makefile.am
===
RCS file: include/Makefile.am
diff -N include/Makefile.am
--- /dev/null	1 Jan 1970 00:00:00 -
+++ include/Makefile.am	23 Jul 2003 15:40:51 -
@@ -0,0 +1,100 @@
+USER_JAVAH = @USER_JAVAH@
+USER_CLASSLIB = @USER_CLASSLIB@
+ARG_JNI_JAVAH = -jni
+ARG_CLASSPATH_JAVAH = -classpath
+JAVAH = $(USER_JAVAH) $(ARG_JNI_JAVAH) $(ARG_CLASSPATH_JAVAH) ../lib:$(USER_CLASSLIB)
+
+H_FILES = \
+$(top_srcdir)/include/gnu_java_awt_image_GdkPixbufDecoder.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GdkFontMetrics.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GdkGraphics.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkButtonPeer.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkCanvasPeer.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkCheckboxPeer.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkChoicePeer.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkClipboard.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkComponentPeer.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkFileDialogPeer.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkFramePeer.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkGenericPeer.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkImagePainter.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkLabelPeer.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkListPeer.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkMainThread.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkMenuBarPeer.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkMenuItemPeer.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkMenuPeer.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkPanelPeer.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkScrollPanePeer.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkScrollbarPeer.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkTextAreaPeer.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkTextComponentPeer.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkTextFieldPeer.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkToolkit.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GtkWindowPeer.h
+
+all: $(H_FILES)
+
+$(top_srcdir)/include/gnu_java_awt_image_GdkPixbufDecoder.h: 

Re: classpath 0.06?

2003-07-23 Thread Brian Jones
David P Grove [EMAIL PROTECTED] writes:

 There was some discussion a month or so ago about making a classpath 0.06 
 distribution.  Is there a chance this could happen sometime relatively 
 soon?  We're thinking about making the next release of Jikes RVM in 2-3 
 weeks and it would be great to be able to get all the hard work done in 
 classpath since 0.05 out to our users.  Almost all of them use classpath 
 0.05 instead of classpath cvs head because the install process is easier. 

I can help to physically get it on the ftp server, etc. if Mark needs
it.

Brian
-- 
Brian Jones [EMAIL PROTECTED]


___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


Re: Patch: Regenerate JNI headers automatically

2003-07-23 Thread Tom Tromey
 Tom == Thomas Fitzsimmons [EMAIL PROTECTED] writes:

Tom Currently the list consists of AWT-related headers.  Could someone who
Tom is more familiar with the other areas of classpath that require JNI
Tom headers complete the list?  Some headers should probably be removed.

This will get you a list:

find . -name '*.[ch]' -print | xargs egrep -h '#include.*_' | grep -v target_ | grep 
-v native_state | grep -v libart_lgpl | sort -u

So it seems anyway.

Tom Mark Wielaard suggested that anyone checking in changes to these headers
Tom should use gcjh, since it is free and produces clean output.  If people
Tom agree with this, I will regenerate the AWT-headers and check them in.

I like this, but then I would.  One question is about gcjh version
dependency.  Older versions of gcjh don't print JNICALL and JNIEXPORT
stuff -- we want to make sure that everybody is using a new enough
version.

I don't think this is that big a deal, since the target is optional
and we're checking in the canonical headers.  It will only affect
people who need to rebuild the headers and don't want to be bothered
to find gcjh.  But if they just refrain from checking in their
modified versions they can use whatever tool they like...

Tom +[case ${enableval} in
Tom +  yes) HEADER_DIR=include ;;
Tom +  no) HEADER_DIR= ;;
Tom +  *) HEADER_DIR= ;;
Tom +esac],
Tom +[HEADER_DIR=])
Tom +AC_SUBST(HEADER_DIR)

It is somewhat more idiomatic to use an AM_CONDITIONAL and then just
wrap the rules in include/ with `if condition...'.  One reason to do
this is that otherwise other built files in include won't be correctly
rebuilt by a simple make in the non-header-regenerate case.  (E.g.,
if you touch jni.h.in, it should rebuild automatically...)

Tom +$(top_srcdir)/include/gnu_java_awt_image_GdkPixbufDecoder.h: 
$(top_srcdir)/gnu/java/awt/image/GdkPixbufDecoder.java
Tom +  $(JAVAH) -o $@ $(shell basename $@ .h | tr '_' '.')

$(shell...) is a GNU make-ism.  Chances are that nobody will notice,
but it is more portable to write out the name here.

Tom


___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


Re: Working GridBagLayout and a few other small AWT patches

2003-07-23 Thread Tom Tromey
 Jeroen == Jeroen Frijters [EMAIL PROTECTED] writes:

Jeroen I almost finished GridBagLayout. The only thing not
Jeroen implemented yet is adjustForGravity, besides that everything
Jeroen else should work.

Dude, very cool.

Jeroen The patch also includes a few small AWT fixes (some of which I
Jeroen previously posted to the list).

Also cool.

Jeroen Please commit to CVS.

I think you should have write access.

Tom


___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


Re: Patch

2003-07-23 Thread Tom Tromey
 Stuart == Stuart Ballard [EMAIL PROTECTED] writes:

Stuart Could whoever runs the Classpath Japize process try the
Stuart attached patch to Japize and see if it fixes things in the
Stuart next overnight run?

I haven't tried this yet.

Is it really necessary?  The fields in the .class file for the
interface are already marked properly, even though they aren't
explicitly marked in the source.  Here's the output from jcf-dump:

Fields (count: 2):
Field name:DECLARED public static final Signature: 6=int
Attribute ConstantValue, length:2, value: #7=Integer 1
Field name:PUBLIC public static final Signature: 6=int
Attribute ConstantValue, length:2, value: #10=Integer 0

Tom


___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


Re: Patch

2003-07-23 Thread Stuart Ballard
Tom Tromey wrote:
I haven't tried this yet.

Is it really necessary?  The fields in the .class file for the
interface are already marked properly, even though they aren't
explicitly marked in the source.  Here's the output from jcf-dump:
Fields (count: 2):
Field name:DECLARED public static final Signature: 6=int
Attribute ConstantValue, length:2, value: #7=Integer 1
Field name:PUBLIC public static final Signature: 6=int
Attribute ConstantValue, length:2, value: #10=Integer 0
How odd. That suggests a bug in Jode, although it must be an obscure one 
:( - unless jcf-dump is lying because *it* knows the modifiers are 
implied, which is possible, I guess, but I doubt it.

I'd still be curious to know if the patch fixes the problem, because it 
would hint as to whether the Jode problem lies in correctly identifying 
the modifiers, or in determining the ConstantValue attribute.

Stuart.

--
Stuart Ballard, Senior Web Developer
FASTNET - Web Solutions
(215) 283-2300, ext. 126
www.fast.net


___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


Re: Patch: Regenerate JNI headers automatically

2003-07-23 Thread Thomas Fitzsimmons
On Wed, 2003-07-23 at 13:23, Tom Tromey wrote:
  Tom == Thomas Fitzsimmons [EMAIL PROTECTED] writes:
 
 Tom Currently the list consists of AWT-related headers.  Could someone who
 Tom is more familiar with the other areas of classpath that require JNI
 Tom headers complete the list?  Some headers should probably be removed.
 
 This will get you a list:
 
 find . -name '*.[ch]' -print | xargs egrep -h '#include.*_' | grep -v target_ | grep 
 -v native_state | grep -v libart_lgpl | sort -u
 
 So it seems anyway.
 

Ok, I added the targets that were missing.

 Tom Mark Wielaard suggested that anyone checking in changes to these headers
 Tom should use gcjh, since it is free and produces clean output.  If people
 Tom agree with this, I will regenerate the AWT-headers and check them in.
 
 I like this, but then I would.  One question is about gcjh version
 dependency.  Older versions of gcjh don't print JNICALL and JNIEXPORT
 stuff -- we want to make sure that everybody is using a new enough
 version.
 
 I don't think this is that big a deal, since the target is optional
 and we're checking in the canonical headers.  It will only affect
 people who need to rebuild the headers and don't want to be bothered
 to find gcjh.  But if they just refrain from checking in their
 modified versions they can use whatever tool they like...
 
 Tom +[case ${enableval} in
 Tom +  yes) HEADER_DIR=include ;;
 Tom +  no) HEADER_DIR= ;;
 Tom +  *) HEADER_DIR= ;;
 Tom +esac],
 Tom +[HEADER_DIR=])
 Tom +AC_SUBST(HEADER_DIR)
 
 It is somewhat more idiomatic to use an AM_CONDITIONAL and then just
 wrap the rules in include/ with `if condition...'.  One reason to do
 this is that otherwise other built files in include won't be correctly
 rebuilt by a simple make in the non-header-regenerate case.  (E.g.,
 if you touch jni.h.in, it should rebuild automatically...)
 

Good point.  I used the existing CREATE_JNI_HEADERS (which was otherwise
unused).

 Tom +$(top_srcdir)/include/gnu_java_awt_image_GdkPixbufDecoder.h: 
 $(top_srcdir)/gnu/java/awt/image/GdkPixbufDecoder.java
 Tom +$(JAVAH) -o $@ $(shell basename $@ .h | tr '_' '.')
 
 $(shell...) is a GNU make-ism.  Chances are that nobody will notice,
 but it is more portable to write out the name here.
 

OK.

Thanks for the comments.

New patch attached,
Tom

2003-07-23  Thomas Fitzsimmons  [EMAIL PROTECTED]

* Makefile.am (SUBDIRS): Add include.
* configure.in: Add --enable-regen-headers flag.
(AC_OUTPUT): Add include/Makefile.
* include/Makefile.am: New file.

Index: Makefile.am
===
RCS file: /cvsroot/classpath/classpath/Makefile.am,v
retrieving revision 1.25
diff -u -b -B -r1.25 Makefile.am
--- Makefile.am	1 Feb 2003 12:54:05 -	1.25
+++ Makefile.am	23 Jul 2003 20:00:53 -
@@ -1,7 +1,7 @@
 ## Input file for automake to generate the Makefile.in used by configure
 
 # lib first, to compile .class files before native code
-SUBDIRS = lib doc gnu java javax native resource vm
+SUBDIRS = lib doc gnu java javax include native resource vm
 
 native: lib
 
Index: configure.in
===
RCS file: /cvsroot/classpath/classpath/configure.in,v
retrieving revision 1.127
diff -u -b -B -r1.127 configure.in
--- configure.in	16 Jul 2003 15:17:33 -	1.127
+++ configure.in	23 Jul 2003 20:00:54 -
@@ -70,11 +70,21 @@
 esac],
 [COMPILE_GTK_PEER=yes])
 
-AM_CONDITIONAL(CREATE_JNI_HEADERS, test x${COMPILE_JNI} = xyes) 
 AM_CONDITIONAL(CREATE_JNI_LIBRARIES, test x${COMPILE_JNI} = xyes)
 AM_CONDITIONAL(CREATE_CNI_LIBRARIES, test x${COMPILE_CNI} = xyes)
 AM_CONDITIONAL(CREATE_GTK_PEER_LIBRARIES, test x${COMPILE_GTK_PEER} = xyes)
 
+AC_ARG_ENABLE(regen-headers,
+[  --enable-regen-headers   automatically regenerate JNI headers [default=no]],
+[case ${enableval} in
+  yes) REGENERATE_JNI_HEADERS=yes ;;
+  no) REGENERATE_JNI_HEADERS=no ;;
+  *) REGENERATE_JNI_HEADERS=no ;;
+esac],
+[REGENERATE_JNI_HEADERS=no])
+
+AM_CONDITIONAL(CREATE_JNI_HEADERS, test x${REGENERATE_JNI_HEADERS} = xyes)
+
 AC_PROG_LN_S
 AC_PROG_INSTALL
 
@@ -328,6 +338,7 @@
 gnu/javax/Makefile
 gnu/javax/rmi/Makefile
 gnu/javax/rmi/CORBA/Makefile
+include/Makefile
 include/jni.h
 java/Makefile
 java/applet/Makefile
Index: include/Makefile.am
===
RCS file: include/Makefile.am
diff -N include/Makefile.am
--- /dev/null	1 Jan 1970 00:00:00 -
+++ include/Makefile.am	23 Jul 2003 20:00:54 -
@@ -0,0 +1,159 @@
+USER_JAVAH = @USER_JAVAH@
+USER_CLASSLIB = @USER_CLASSLIB@
+ARG_JNI_JAVAH = -jni
+ARG_CLASSPATH_JAVAH = -classpath
+JAVAH = $(USER_JAVAH) $(ARG_JNI_JAVAH) $(ARG_CLASSPATH_JAVAH) ../lib:$(USER_CLASSLIB)
+
+H_FILES = \
+$(top_srcdir)/include/gnu_java_awt_image_GdkPixbufDecoder.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GdkFontMetrics.h \
+$(top_srcdir)/include/gnu_java_awt_peer_gtk_GdkGraphics.h \

Re: Patch: Regenerate JNI headers automatically

2003-07-23 Thread Tom Tromey
 Tom == Thomas Fitzsimmons [EMAIL PROTECTED] writes:

Tom New patch attached,

Looks great.

Tom +USER_JAVAH = @USER_JAVAH@
Tom +USER_CLASSLIB = @USER_CLASSLIB@

FYI, automake automatically adds all AC_SUBST variables to Makefile.in,
so these two lines are redundant.

Tom +else
Tom +all-local:
Tom +endif # CREATE_JNI_HEADERS

The else part shouldn't be needed.

Tom


___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


Re: Patch: Regenerate JNI headers automatically

2003-07-23 Thread Brian Jones
Tom Tromey [EMAIL PROTECTED] writes:

  Tom == Thomas Fitzsimmons [EMAIL PROTECTED] writes:
 
 Tom New patch attached,
 
 Looks great.
 
 Tom +USER_JAVAH = @USER_JAVAH@
 Tom +USER_CLASSLIB = @USER_CLASSLIB@
 
 FYI, automake automatically adds all AC_SUBST variables to Makefile.in,
 so these two lines are redundant.
 
 Tom +else
 Tom +all-local:
 Tom +endif # CREATE_JNI_HEADERS
 
 The else part shouldn't be needed.
 
 Tom

Looks good here too.

Brian
-- 
Brian Jones [EMAIL PROTECTED]


___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


Re: Working GridBagLayout and a few other small AWT patches

2003-07-23 Thread Brian Jones
Tom Tromey [EMAIL PROTECTED] writes:

  Jeroen == Jeroen Frijters [EMAIL PROTECTED] writes:
 
 Jeroen I almost finished GridBagLayout. The only thing not
 Jeroen implemented yet is adjustForGravity, besides that everything
 Jeroen else should work.
 
 Dude, very cool.
 
 Jeroen The patch also includes a few small AWT fixes (some of which I
 Jeroen previously posted to the list).
 
 Also cool.
 
 Jeroen Please commit to CVS.
 
 I think you should have write access.

I tried back in March to get Jeroen into direct commits.  ;)  What
about it now Jeroen?  

Brian
-- 
Brian Jones [EMAIL PROTECTED]


___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath