2004-01-20 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/awt/peer/gtk/GtkFramePeer.java (setResizable):
Override GtkWindowPeer's setResizable method to account for menu
bar height when setting the frame's size.
From-SVN: r76227
* java/awt/EventQueue.java (pop): Prevent racing condition to add
events to the queue out of order by acquiring locks in the proper
order and not by releasing one before acquiring the other.
From-SVN: r76161
2004-01-19 Kim Ho <kho@redhat.com>
* gnu/java/awt/peer/gtk/GtkFramePeer.java (getMenuBarHeight): Added
MenuBarPeer parameter.
(removeMenuBarPeer): New native method.
(setMenuBar): Call remove if menu bar is null. Adjust insets
appropriately.
(postSizeAllocateEvent): New method. Called when menu bar size is
allocated. Adjust insets and redo layout.
(GtkFramePeer): Set menu bar during frame creation.
(postConfigureEvent): Adjust position and size to accomodate
menu bar.
* java/awt/Frame.java (setMenuBar): addNotify to create menu bar.
* java/awt/Menu.java (addSeparator): Use peer's addSeparator.
(addNotify): Create the peer if it doesn't exist and call addNotify
for the menu's items.
* java/awt/MenuBar.java (addNotify): Create this menu bar's menus.
* java/awt/MenuItem.java (addNotify): Create the peer if it
doesn't exist.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
(removeMenuBarPeer): New method. Remove menu bar on the current
frame.
(setMenuBarPeer): Add the menu bar to the current frame and the
callback for size-allocate events on the menu bar.
(getMenuBarHeight): Add menu bar parameter.
(menubar_resize_cb): New callback method for postSizeAllocate events.
Also: Fix indentation on last ChangeLog entry.
From-SVN: r76149
2004-01-16 Kim Ho <kho@redhat.com>
* gnu/java/awt/peer/gtk/GtkComponentPeer.java (GtkComponentPeer): If
it is a FileDialog and has dimensions of 0 by 0, then the initial
size is set to size request plus insets.
* gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
(gtkWidgetGetDimensions): Override method.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
(gtkWidgetGetDimensions): Override method. Returns size request plus
insets.
From-SVN: r75993
* java/awt/EventDispatchThread.java (run): Stop running when
interrupted.
* java/awt/EventQueue.java (pop): Stop dispatch thread when done.
Reset the queue after transferring its contents.
(push): Start a new dispatch thread if none is running.
From-SVN: r75977
* gnu/java/awt/peer/gtk/GdkGraphics2D.java:
Implemented rendering hints related methods.
(getDefaultHints): New helper method. Returns
default rendering hints.
(walkPath): changed to normalize path if
the KEY_STROKE_CONTROL key is in "normalize" mode.
(draw3DRect): changed coordinates of rectangle by +0.5
if in "normalize" mode.
From-SVN: r75943
2004-01-13 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/awt/peer/gtk/GtkTextAreaPeer.java,
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
(native create): Add width and height parameters. Set text
view's size request according to new parameters.
(create): Calculate text view size based on current font's
metrics and number of rows and columns. Set TextArea's font if
not already set. Call native create.
(getMinimumSize): Call minimumSize.
(getPreferredSize): Call preferredSize.
(getHScrollbarHeight): New method.
(getVScrollbarWidth): New method.
(minimumSize): Calculate minimum size based on scrollbar
visibility, scrollbar sizes, font metrics and number of rows and
columns.
(preferredSize): Likewise for preferred size.
(gtkTextGetSize): Remove method.
From-SVN: r75817
* gnu/java/awt/peer/gtk/GtkContainerPeer.java
(setBackground): New method. Children with no explicitly-set
background will be repainted with the parent container's new
background color.
From-SVN: r75809
* gnu/java/awt/peer/gtk/TestAWT.java: Fix test program so that it does
not show modal dialogs twice and so that it allows showing a modal
dialog from another modal dialog.
From-SVN: r75803
* java/awt/Dialog.java (show): Enable blocking for all modal dialogs
and run secondary dispatch thread to process event queue while this
thread is blocked.
From-SVN: r75788
* gnu/java/lang/reflect/TypeSignature.java
(getEncodingOfClass): Documentation fixed.
(getClassForEncoding): Give class loader to Class.forName().
Documentation fixed.
From-SVN: r75675
2004-01-09 Andrew Haley <aph@redhat.com>
* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Resolve
a Utf8Const field before looking at its class.
From-SVN: r75591
* gnu/java/awt/peer/gtk/GtkFileDialogPeer.java (nativeSetFile):
New name for the former setFile native method.
(setFile): New method.
(setDirectory): Implemented.
(connectSignals): New native method.
(setFilenameFilter): Improve comment.
(getGraphics): Comment.
(gtkHideFileDialog): New method.
(gtkDisposeFileDialog): New method.
(gtkSetFilename): New method.
* java/awt/Dialog.java (show): Block on modal dialogs, but only
for FileDialog for now.
(hide): New method.
(dispose): New method.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
(Java_gnu_java_awt_peer_gtk_GtkFileDialog_create): Replace
deprecated creation functions. Make dialog modal. Add it to the
window group.
(Java_gnu_java_awt_peer_gtk_GtkFileDialog_connectSignals): New
function.
(Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_gtkFileSelectionSetFilename):
Rename to...
(Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_nativeSetFile): New
name.
(window_closed): New function.
(ok_clicked): New function.
(cancel_clicked): New function.
From-SVN: r75557
PR libgcj/13439:
* verify.cc (state::merge): Copy changed locals out of subroutine
in NO_STACK case.
(state::FLAG_CHANGED): New const.
(state::FLAG_UNUSED): Likewise.
(state::local_changed): Removed. Updated all users.
(state::flags): New field.
(state::merge): Added jsr_semantics argument, more logic.
(push_jump_merge): Added jsr_semantics argument.
(handle_jsr_insn): Set jsr_semantics on push_jump_merge when
merging through the jsr instruction.
From-SVN: r75533
* java/awt/Container.java
(update): Clear only the clipped region, instead of clearing the
entire Container.
(visitChildren): Visit children in descending order.
From-SVN: r75517
* java/text/CollationElementIterator.java
(textIndex): Renamed from index.
* java/text/CollationKey.java
(collator): New member.
(CollationKey): New argument for parent collator.
(equals): Check for same collator, source string and key array.
* java/text/RuleBasedCollator.java:
Reformated.
(RuleBasedCollator): Don't re-initialize frenchAccents with default
value.
(getCollationElementIterator): Rewritten.
(getCollationKey): Added new argument to CollationKey constructor.
From-SVN: r75510
* java/net/URLConnection.java
(contentHandler): Removed.
(locale): Removed.
(getHeaderFields): Return an empty map instead of null.
(getContent): Connect if needed, renamed "cType" to "type" and
"contentHandler" to "ch" and made it a local variable.
(getPermission): Don't use package in class name.
(setDefaultRequestProperty): Fixed typo in documentation.
(initializeDateFormats): Made locale a local variable.
From-SVN: r75466
* java/lang/Package.java
(getPackage): Get the current class loader directly.
* java/lang/SecurityManager.java
(currentLoadedClass): Dont iterate over class contexts.
(classLoaderDepth): Don't check class loaders if everything is allowed.
From-SVN: r75465
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
(pre_event_handler): Set all insets to 0 when a Configure event
is received for a GtkPlug.
* gnu/java/awt/EmbeddedWindow.java (window_id): Rename handle.
Make handle long, not int.
(EmbeddedWindow()): New constructor.
(EmbeddedWindow(int)): Rename window_id to handle. Make handle
long, not int.
(setHandle): New method.
(getHandle): Return long, not int.
* gnu/java/awt/peer/EmbeddedWindowPeer.java (embed): New method
declaration.
* gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java,
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c:
(create(long)): Take long parameter, not int. Cast gtk_plug_new
argument to GdkNativeWindow.
(construct): New method.
(embed): New method.
From-SVN: r75447
* gnu/java/awt/peer/gtk/GtkScrollPanePeer.java,
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c
(create(int, int)): New method.
(create): Call new create method.
(gtkScrolledWindowNew, gtkScrolledWindowSetSize): Remove
methods.
(childResized): Remove native implementation. Implement in
Java.
(getHScrollbarHeight, getVScrollbarWidth): Call
gtk_widget_size_request to get scrollbar dimensions.
* java/awt/ScrollPane.java (getViewportSize): Reimplement. Only
call getVScrollbarWidth and getHScrollbarHeight when vertical
and horizontal scrollbars respectively are needed.
(doLayout): Enlarge child if it is smaller than the viewport.
From-SVN: r75446
* java/awt/Dialog.java (constructor): Accept null title as per spec.
* java/awt/FileDialog.java (constructor): Throw exception on invalid
argument as per spec.
From-SVN: r75444
2004-01-05 Fernando Nasser <fnasser@redhat.com>
* java/awt/Choice.java (add): Leave posting of ItemEvents to peer.
(insert): Ditto.
(remove): Ditto. Also, Check for valid argument.
(removeAll): Use peer interface method.
* gnu/java/awt/peer/gtk/GtkChoicePeer.java (nativeAdd): New name for
native add function.
(nativeRemove): New name for native remove function.
(getHistory): New native function.
(constructor): Generate ItemEvent.
(add): Ditto, if selection is changed.
(remove): Ditto, ditto.
(removeAll): Add implementation.
(handleEvent): Remove. Dead code.
(choicePostItemEvent): Add comment.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
(Java_gnu_java_awt_peer_gtk_GtkChoicePeer_append): Add comments.
(Java_gnu_java_awt_peer_gtk_GtkChoicePeer_add): Rename to...
(Java_gnu_java_awt_peer_gtk_GtkChoicePeer_nativeAdd): New name. Add
comments and fix condition to change selection.
(Java_gnu_java_awt_peer_gtk_GtkChoicePeer_remove): Rename to...
(Java_gnu_java_awt_peer_gtk_GtkChoicePeer_nativeRemove): New name. Add
remove all capability.
(Java_gnu_java_awt_peer_gtk_GtkChoicePeer_getHistory): New function.
(item_activate): Add cast to remove compiler warning.
From-SVN: r75443
* gnu/java/net/protocol/http/Connection.java
(sendRequest): Dont encode output in default character encoding,
add correct version number to HTTP user agent string.
From-SVN: r75266
2003-12-30 Guilhem Lavaux <guilhem@kaffe.org>
* java/util/GregorianCalendar.java
(computeFields): Reported by Ito Kazumitsu <kaz@maczuka.gcd.org>.
Fixed the computation of DAY_OF_WEEK_IN_MONTH.
(computeTime): 12:00 midnight is AM and 12:00 noon is PM.
2003-12-30 Michael Koch <konqueror@gmx.de>
* testsuite/libjava.mauve/xfails: Removed the following testcase
because it passes now:
FAIL: gnu.testlet.java.text.SimpleDateFormat.Test: parse() strict
(number 1)
From-SVN: r75244
* gnu/java/net/protocol/http/Connection.java
(outputStream): New field.
(bufferedOutputStream): New field.
(connect): Initialize outputStream and bufferedOutputStream.
(sendRequest): Create PrintWriter object from outputStream,
support HTTP 1.1, send missing HTTP headers and buffered output data
for POST method.
(getOutputStream): Set request method to POST if output stream is
used, return bufferedOutputStream.
(setRequestMethod): Allow HEAD and POST methods.
This fixes libgcj PR/6302 and libgcj PR/7752.
From-SVN: r75233
* gnu/java/net/protocol/http/Connection.java
(requestProperties): New field.
(addRequestProperty): New method.
(getRequestProperty): New method.
(setRequestProperty): New method.
(getRequestProperties): New method.
From-SVN: r75228
* gnu/java/net/protocol/http/Connection.java
(inputStream): Made it a DataInputStream.
(requestProperties): Removed.
(hdrHash): Removed.
(hdrVec): Removed.
(headers): New field to store headers.
(connect): Initialize inputStream.
(receiveReply): Merged from classpath. The new algorithm is line based
instead of character based.
(getHeaderField): Use headers.
(getHeaderFields): Use headers.
(getKey): Removed.
(getField): Removed.
* gnu/java/net/HeaderFieldHelper.java: New file.
* Makefile.am (ordinary_java_source_files):
Added gnu/java/net/HeaderFieldHelper.java.
* Makefile.in: Regenerated.
From-SVN: r75183
* java/io/LineNumberReader.java
(mark): Improved error checking.
(read): Likewise.
(skip): Likewise. Skip is now really eating the specified number of
characters.
* java/io/CharArrayReader.java (read): It should throw
IndexOutOfBoundsException and not ArrayIndexOutOfBoundsException (see
mauve).
* java/io/BufferedReader.java (readLine): Make readLine() really block
until either EOF is reached or a true error happens.
From-SVN: r75180
* gnu/java/net/protocol/http/Connection.java
(connect): Call receiveReply().
(receiveReply): Renamed from getHttpHeaders().
(getOutputStream): Moved check on doOutput before check for connection
state.
From-SVN: r75172
2003-12-27 Guilhem Lavaux <guilhem@kaffe.org>
* java/rmi/Naming.java (lookup): Check if the first character of the
filename returned by URL.getFile() is a '/', only if it is the case
we cut this first character and call the registry with the good name.
(bind): Likewise.
(rebind): Likewise.
From-SVN: r75044
2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
Mark Wielaard <mark@klomp.org>
* java/io/BufferedReader.java (BufferedReader):
Throw IllegalArgumentException when size <= 0.
(mark): Document and better exception message for negative
readLimit IllegalArgumentException.
(read(char[],int,int)): Throw IndexOutOfBoundsException
if offset and count are not valid regarding buf.
(skip): Throw IllegalArgumentException when count is negative.
Co-Authored-By: Mark Wielaard <mark@klomp.org>
From-SVN: r75041
* java/io/FileInputStream.java
(FileInputStream(String)): Call FileInputStream(File).
(FileInputStream(File)): Check whether the argument is a directory.
From-SVN: r75039
Mark Wielaard <mark@klomp.org>
* gnu/java/rmi/server/UnicastConnectionManager.java
(startScavenger): Set the client connection manager to daemon
state because it may block clients until TIMEOUT is reached
when they are exiting.
* gnu/java/rmi/RMIVoidValue.java: New file for a class representing
a void return.
* gnu/java/rmi/server/UnicastRemoteCall.java
(DummyOutputStream): Add a boolean before each written field to
know whether it is a primitive.
(releaseOutputStream): Flush parameters at write time.
* gnu/java/rmi/server/UnicastServerRef.java
(incomingMessageCall): Return a RMIVoidValue if no value is to be
returned.
* gnu/java/rmi/server/UnicastServer.java
(incomingMessageCall): Do not write a returned object if it is
a RMIVoidValue.
Co-Authored-By: Mark Wielaard <mark@klomp.org>
From-SVN: r75033
2003-12-25 Michael Koch <konqueror@gmx.de>
* java/net/ServerSocket.java bind():
If InetSocketAddress.getAddress() returns "null" use "0.0.0.0" as
address to bind to.
From-SVN: r75023
* java/io/ObjectInputStream.java
(getField): Handle transient and non persistent fields.
(readClassDescriptor): Better error handling, use the right
class loader.
(readFields): Fields marked as not present in the stream
or not to be set are not read and set.
* java/io/ObjectInputStream.java
(readFields): Changed implementation of GetField.
(readClassDescriptor): Documented.
* java/io/ObjectOutputStream.java
(writeClassDescriptor): Added condition when to write class super
class information.
From-SVN: r74985
2003-12-22 Fernando Nasser <fnasser@redhat.com>
* gnu/java/awt/peer/gtk/GtkChoicePeer.java (postItemEvent): Rename to... (choicePostItemEvent): Change signature to more specific String object.
* java/awt/Choice.java (add): Generate ItemEvent for the first item
added.
(insert): Generate ItemEvent if insertion caused
selection to change.
(remove): Generate ItemEvent if removal cause selection to change.
(removeAll): Change algorithm to prevent generation of ItemEvents.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
(connect_choice_item_selectable_hook): Change argument type.
Fix argument value.
Make sure resources are feed by registering callback.
(Java_gnu_java_awt_peer_gtk_GtkChoicePeer_append): Adjust call to the
above function.
(Java_gnu_java_awt_peer_gtk_GtkChoicePeer_add): Ditto.
(item_activate): Ditto.
(Java_gnu_java_awt_peer_gtk_GtkChoicePeer_remove): Destroy removed
menuitem.
(item_removed): New function. Free resources.
* jni/gtk-peer/gtkpeer.h (item_event_hook_info): Change member type and
name.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
(Java_gnu_java_awt_peer_gtk_GtkMainThread_gtkInit): Obtain MethodID for
choicePostItemEvent.
From-SVN: r74979