[kaffe] CVS kaffe (robilad): Ressynced with GNU Classpath: qt peers updated, awt, swing fixes
Kaffe CVS
cvs-commits at kaffe.org
Wed Aug 17 15:55:08 PDT 2005
PatchSet 6836
Date: 2005/08/17 22:38:17
Author: robilad
Branch: HEAD
Tag: (none)
Log:
Ressynced with GNU Classpath: qt peers updated, awt, swing fixes
Members:
ChangeLog:1.4360->1.4361
include/Makefile.am:1.110->1.111
include/Makefile.in:1.239->1.240
kaffe/kaffevm/boehm-gc/boehm/acinclude.m4:1.2->1.3
libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c:1.6->1.7
libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c:1.8->1.9
libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c:1.7->1.8
libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c:1.7->1.8
libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c:1.14->1.15
libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c:1.22->1.23
libraries/clib/awt/classpath-qt/Makefile.am:1.2->1.3
libraries/clib/awt/classpath-qt/Makefile.in:1.2->1.3
libraries/clib/awt/classpath-qt/eventmethods.cpp:1.1->1.2(DEAD)
libraries/clib/awt/classpath-qt/eventmethods.h:INITIAL->1.1
libraries/clib/awt/classpath-qt/keybindings.cpp:1.1->1.2
libraries/clib/awt/classpath-qt/keybindings.h:1.1->1.2
libraries/clib/awt/classpath-qt/qtbuttonpeer.cpp:1.1->1.2
libraries/clib/awt/classpath-qt/qtcanvaspeer.cpp:1.1->1.2
libraries/clib/awt/classpath-qt/qtcheckboxpeer.cpp:1.1->1.2
libraries/clib/awt/classpath-qt/qtchoicepeer.cpp:1.1->1.2
libraries/clib/awt/classpath-qt/qtcomponent.cpp:1.1->1.2
libraries/clib/awt/classpath-qt/qtcomponentpeer.cpp:1.1->1.2
libraries/clib/awt/classpath-qt/qtdialogpeer.cpp:1.1->1.2
libraries/clib/awt/classpath-qt/qtembeddedwindowpeer.cpp:INITIAL->1.1
libraries/clib/awt/classpath-qt/qtframepeer.cpp:1.1->1.2
libraries/clib/awt/classpath-qt/qtgraphics.cpp:1.1->1.2
libraries/clib/awt/classpath-qt/qtimage.cpp:1.1->1.2
libraries/clib/awt/classpath-qt/qtlabelpeer.cpp:1.1->1.2
libraries/clib/awt/classpath-qt/qtlistpeer.cpp:1.1->1.2
libraries/clib/awt/classpath-qt/qtmenupeer.cpp:1.1->1.2
libraries/clib/awt/classpath-qt/qtpanelpeer.cpp:1.1->1.2
libraries/clib/awt/classpath-qt/qtscrollbarpeer.cpp:1.1->1.2
libraries/clib/awt/classpath-qt/qtscrollpanepeer.cpp:1.1->1.2
libraries/clib/awt/classpath-qt/qttextareapeer.cpp:1.1->1.2
libraries/clib/awt/classpath-qt/qttextfieldpeer.cpp:1.1->1.2
libraries/clib/awt/classpath-qt/qtwindowpeer.cpp:1.1->1.2
libraries/clib/awt/classpath-qt/slotcallbacks.cpp:1.2->1.3
libraries/clib/awt/classpath-qt/slotcallbacks.h:1.1->1.2
libraries/javalib/Makefile.am:1.382->1.383
libraries/javalib/Makefile.in:1.472->1.473
libraries/javalib/all.files:1.152->1.153
libraries/javalib/gnu/java/awt/ClasspathToolkit.java:1.12->1.13
libraries/javalib/gnu/java/awt/peer/gtk/GtkClipboard.java:1.5->1.6
libraries/javalib/gnu/java/awt/peer/gtk/GtkClipboardNotifier.java:INITIAL->1.1
libraries/javalib/gnu/java/awt/peer/gtk/GtkContainerPeer.java:1.6->1.7
libraries/javalib/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java:1.9->1.10
libraries/javalib/gnu/java/awt/peer/gtk/GtkFramePeer.java:1.11->1.12
libraries/javalib/gnu/java/awt/peer/gtk/GtkImage.java:1.10->1.11
libraries/javalib/gnu/java/awt/peer/gtk/GtkSelection.java:INITIAL->1.1
libraries/javalib/gnu/java/awt/peer/gtk/GtkToolkit.java:1.20->1.21
libraries/javalib/gnu/java/awt/peer/gtk/GtkWindowPeer.java:1.11->1.12
libraries/javalib/gnu/java/awt/peer/qt/QtButtonPeer.java:1.1->1.2
libraries/javalib/gnu/java/awt/peer/qt/QtCheckboxPeer.java:1.1->1.2
libraries/javalib/gnu/java/awt/peer/qt/QtChoicePeer.java:1.1->1.2
libraries/javalib/gnu/java/awt/peer/qt/QtComponentGraphics.java:1.1->1.2
libraries/javalib/gnu/java/awt/peer/qt/QtComponentPeer.java:1.1->1.2
libraries/javalib/gnu/java/awt/peer/qt/QtContainerPeer.java:1.1->1.2
libraries/javalib/gnu/java/awt/peer/qt/QtDialogPeer.java:1.1->1.2
libraries/javalib/gnu/java/awt/peer/qt/QtEmbeddedWindowPeer.java:INITIAL->1.1
libraries/javalib/gnu/java/awt/peer/qt/QtFontPeer.java:1.1->1.2
libraries/javalib/gnu/java/awt/peer/qt/QtFramePeer.java:1.1->1.2
libraries/javalib/gnu/java/awt/peer/qt/QtGraphics.java:1.1->1.2
libraries/javalib/gnu/java/awt/peer/qt/QtImage.java:1.1->1.2
libraries/javalib/gnu/java/awt/peer/qt/QtImageGraphics.java:1.1->1.2
libraries/javalib/gnu/java/awt/peer/qt/QtListPeer.java:1.1->1.2
libraries/javalib/gnu/java/awt/peer/qt/QtMenuBarPeer.java:1.1->1.2
libraries/javalib/gnu/java/awt/peer/qt/QtMenuItemPeer.java:1.1->1.2
libraries/javalib/gnu/java/awt/peer/qt/QtMenuPeer.java:1.1->1.2
libraries/javalib/gnu/java/awt/peer/qt/QtScrollbarPeer.java:1.1->1.2
libraries/javalib/gnu/java/awt/peer/qt/QtTextAreaPeer.java:1.1->1.2
libraries/javalib/gnu/java/awt/peer/qt/QtTextFieldPeer.java:1.1->1.2
libraries/javalib/gnu/java/awt/peer/qt/QtToolkit.java:1.1->1.2
libraries/javalib/gnu/java/awt/peer/qt/QtWindowPeer.java:1.1->1.2
libraries/javalib/java/awt/Component.java:1.58->1.59
libraries/javalib/java/awt/Container.java:1.40->1.41
libraries/javalib/java/awt/EventQueue.java:1.18->1.19
libraries/javalib/java/awt/FontMetrics.java:1.18->1.19
libraries/javalib/java/awt/Frame.java:1.28->1.29
libraries/javalib/java/awt/TextComponent.java:1.7->1.8
libraries/javalib/java/awt/Window.java:1.35->1.36
libraries/javalib/java/lang/Character.java:1.26->1.27
libraries/javalib/javax/swing/JComponent.java:1.27->1.28
libraries/javalib/javax/swing/JList.java:1.13->1.14
libraries/javalib/javax/swing/JPasswordField.java:1.7->1.8
libraries/javalib/javax/swing/JTree.java:1.26->1.27
libraries/javalib/javax/swing/plaf/basic/BasicLabelUI.java:1.7->1.8
libraries/javalib/javax/swing/plaf/basic/BasicLookAndFeel.java:1.22->1.23
libraries/javalib/javax/swing/plaf/basic/BasicTableUI.java:1.13->1.14
libraries/javalib/javax/swing/plaf/basic/BasicTextUI.java:1.18->1.19
libraries/javalib/javax/swing/plaf/basic/BasicTreeUI.java:1.17->1.18
libraries/javalib/javax/swing/text/BoxView.java:1.1->1.2
libraries/javalib/javax/swing/text/ComponentView.java:1.3->1.4
libraries/javalib/javax/swing/text/CompositeView.java:1.1->1.2
libraries/javalib/javax/swing/text/GlyphView.java:1.1->1.2
libraries/javalib/javax/swing/text/IconView.java:1.1->1.2
libraries/javalib/javax/swing/text/PasswordView.java:1.4->1.5
libraries/javalib/javax/swing/text/PlainView.java:1.9->1.10
libraries/javalib/javax/swing/text/View.java:1.11->1.12
libraries/javalib/javax/swing/tree/DefaultTreeCellRenderer.java:1.10->1.11
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4360 kaffe/ChangeLog:1.4361
--- kaffe/ChangeLog:1.4360 Wed Aug 17 00:17:34 2005
+++ kaffe/ChangeLog Wed Aug 17 22:38:17 2005
@@ -1,3 +1,329 @@
+2005-08-18 Dalibor Topic <robilad at kaffe.org>
+
+ Resynced with GNU Classpath.
+
+ 2005-08-17 Anthony Balkissoon <abalkiss at redhat.com>
+
+ * javax/swing/JList.java:
+ (indexToLocation): Implemented.
+ (getLastVisibleIndex): If the last index in the list is showing and
+ there is extra room at the bottom, return the last index, not -1.
+
+ 2005-08-17 Lillian Angel <langel at redhat.com>
+
+ * javax/swing/plaf/basic/BasicTreeUI.java
+ (getCellLocation): Added in check if node is a leaf.
+ Shouldnt call getChildCount if a leaf. May cause NPE.
+ (paintRecursive): Likewise.
+ (paintControlIcons): Likewise.
+ (findNode): Likewise.
+ (getNextNode): Likewise.
+ (getPreviousNode): Likewise.
+ (getNextSibling): Likewise.
+ (getPreviousSibling): Likewise.
+
+ 2005-08-17 Lillian Angel <langel at redhat.com>
+
+ * javax/swing/tree/DefaultTreeCellRenderer.java
+ (paint): paints the background and border of cell.
+
+ 2005-08-17 Roman Kennke <roman at kennke.org>
+
+ Reported by Ingo Proetel <proetel at aicas.com>
+ * java/awt/image/DirectColorModel.java
+ (createCompatibleWritableRaster): Added argument check.
+
+ 2005-08-17 Roman Kennke <roman at kennke.org>
+
+ * java/awt/FontMetrics.java
+ (charWidth(int)): Correctly map Unicode indices to char[] here.
+
+ 2005-08-17 Roman Kennke <roman at kennke.org>
+
+ * java/lang/Character.java
+ (toChars(int)): New JDK1.5 method.
+ (toChars(int, char[], int)): New JDK1.5 method.
+ (charCount): New JDK1.5 method.
+ (isSupplementaryCodePoint): New JDK1.5 method.
+ (isValidCodePoint): New JDK1.5 method.
+
+ 2005-08-17 Lillian Angel <langel at redhat.com>
+
+ * java/awt/FontMetrics.java
+ (charWidth): Reversed Roman's patch, was not compiling.
+ * javax/swing/tree/DefaultTreeCellRenderer.java
+ (getTreeCellRendererComponent): Set Opaque to true for
+ painting reasons.
+
+ 2005-08-17 Mark Wielaard <mark at klomp.org>
+
+ * gnu/java/awt/peer/qt/QtFramePeer.java (setIcon): Mark non-native
+ and add FIXME.
+ (setMaximizedBounds): Likewise.
+ * include/gnu_java_awt_peer_qt_QtFramePeer.h: Regenerated.
+ * native/jni/qt-peer/.cvsignore: New file.
+ * native/jni/qt-peer/Makefile.am (libqtpeer_la_SOURCES):
+ Remove eventmethods.h.
+
+ 2005-08-17 Roman Kennke <roman at kennke.org>
+
+ * javax/swing/plaf/basic/BasicLabelUI.java
+ (paint): Don't paint the border here. If there is a border to
+ be painted, this is usually performed in JComponent.paint().
+
+ 2005-08-17 Roman Kennke <roman at kennke.org>
+
+ * java/awt/FontMetrics.java
+ (charWidth(int)): Correctly map Unicode indices to char[] here.
+
+ 2005-08-17 Roman Kennke <roman at kennke.org>
+
+ * java/awt/Component.java
+ This applies to various variants of the repaint() methods:
+ (repaint): If the component is not showing, forward repaint
+ request to the parent.
+
+ 2005-08-17 Roman Kennke <roman at kennke.org>
+
+ * javax/swing/plaf/basic/BasicLabelUI.java
+ (paint): Don't fill the background here. If the label is opaque
+ then the background is filled in ComponentUI.update(), otherwise
+ it must not be touched.
+
+ 2005-08-17 Thomas Fitzsimmons <fitzsim at redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
+ (setComponentBounds): Don't post COMPONENT_RESIZED event.
+
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
+ (setBoundsCallbackID): Remove variable.
+ (cp_gtk_window_init_jni): Don't initialize setBoundsCallbackID.
+ (setBoundsCallback): Remove method.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c
+ (setMenuBarPeer): Check if menubar is NULL.
+ (setMenuBarWidth): Likewise.
+ * java/awt/Window.java (dispatchEventImpl): Validate upon
+ receiving a COMPONENT_RESIZED event.
+ (setBoundsCallback): Remove method.
+ * include/gnu_java_awt_peer_gtk_GtkWindowPeer.h: Regenerate.
+ * gnu/java/awt/peer/gtk/GtkWindowPeer.java (setBoundsCallback):
+ Remove method declaration.
+ (postConfigureEvent): Separate handling of resizes and moves.
+ Call setSize and post COMPONENT_RESIZED event.
+ * gnu/java/awt/peer/gtk/GtkFramePeer.java (postConfigureEvent):
+ Separate handling of resizes and moves. Call setSize.
+ * gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
+ (setComponentBounds): Call setSize and post COMPONENT_RESIZED
+ event.
+ * gnu/java/awt/peer/gtk/GtkContainerPeer.java (isValidating):
+ Remove field.
+
+ 2005-08-16 Sven de Marothy <sven at physto.se>
+
+ * gnu/java/awt/peer/qt/QtButtonPeer.java
+ * gnu/java/awt/peer/qt/QtCheckboxPeer.java
+ * gnu/java/awt/peer/qt/QtChoicePeer.java
+ * gnu/java/awt/peer/qt/QtComponentGraphics.java
+ * gnu/java/awt/peer/qt/QtComponentPeer.java
+ * gnu/java/awt/peer/qt/QtContainerPeer.java
+ * gnu/java/awt/peer/qt/QtDialogPeer.java
+ * gnu/java/awt/peer/qt/QtFontPeer.java
+ * gnu/java/awt/peer/qt/QtFramePeer.java
+ * gnu/java/awt/peer/qt/QtGraphics.java
+ * gnu/java/awt/peer/qt/QtImage.java
+ * gnu/java/awt/peer/qt/QtImageGraphics.java
+ * gnu/java/awt/peer/qt/QtListPeer.java
+ * gnu/java/awt/peer/qt/QtMenuBarPeer.java
+ * gnu/java/awt/peer/qt/QtMenuItemPeer.java
+ * gnu/java/awt/peer/qt/QtMenuPeer.java
+ * gnu/java/awt/peer/qt/QtScrollbarPeer.java
+ * gnu/java/awt/peer/qt/QtTextAreaPeer.java
+ * gnu/java/awt/peer/qt/QtTextFieldPeer.java
+ * gnu/java/awt/peer/qt/QtToolkit.java
+ * gnu/java/awt/peer/qt/QtWindowPeer.java
+ * native/jni/qt-peer/keybindings.cpp
+ * native/jni/qt-peer/keybindings.h
+ * native/jni/qt-peer/qtbuttonpeer.cpp
+ * native/jni/qt-peer/qtcanvaspeer.cpp
+ * native/jni/qt-peer/qtcheckboxpeer.cpp
+ * native/jni/qt-peer/qtchoicepeer.cpp
+ * native/jni/qt-peer/qtcomponent.cpp
+ * native/jni/qt-peer/qtcomponentpeer.cpp
+ * native/jni/qt-peer/qtdialogpeer.cpp
+ * native/jni/qt-peer/qtframepeer.cpp
+ * native/jni/qt-peer/qtgraphics.cpp
+ * native/jni/qt-peer/qtimage.cpp
+ * native/jni/qt-peer/qtlabelpeer.cpp
+ * native/jni/qt-peer/qtlistpeer.cpp
+ * native/jni/qt-peer/qtmenupeer.cpp
+ * native/jni/qt-peer/qtpanelpeer.cpp
+ * native/jni/qt-peer/qtscrollbarpeer.cpp
+ * native/jni/qt-peer/qtscrollpanepeer.cpp
+ * native/jni/qt-peer/qttextareapeer.cpp
+ * native/jni/qt-peer/qttextfieldpeer.cpp
+ * native/jni/qt-peer/qtwindowpeer.cpp
+ * native/jni/qt-peer/slotcallbacks.cpp
+ * native/jni/qt-peer/slotcallbacks.h
+ Reindented, Transmogrified and Wielaardituded.
+ * gnu/java/awt/peer/qt/QtEmbeddedWindowPeer.java
+ * native/jni/qt-peer/eventmethods.h
+ * native/jni/qt-peer/qtembeddedwindowpeer.cpp
+ * native/jni/qt-peer/slotcallbacks.moc.h
+ New files
+ * native/jni/qt-peer/eventmethods.cpp
+ * native/jni/qt-peer/slotcallbacks.moc
+ Removed.
+
+ 2005-08-16 Lillian Angel <langel at redhat.com>
+
+ * javax/swing/text/PasswordView.java
+ (drawUnselectedText): Fixed so the password is drawn correctly
+ in the text box and no * characters are drawn before anything
+ was typed.
+
+ 2005-08-16 Mark Wielaard <mark at klomp.org>
+
+ * gnu/java/awt/peer/gtk/GtkClipboard.java: Reimplemented.
+ * gnu/java/awt/peer/gtk/GtkClipboardNotifier.java: New class.
+ * gnu/java/awt/peer/gtk/GtkSelection.java: New class.
+ * gnu/java/awt/peer/gtk/GtkImage.java (GtkImage(Pointer)): New
+ constructor.
+ (createFromPixbuf): New private native method.
+ * gnu/java/awt/peer/gtk/GtkToolkit.java (systemClipboard): Removed.
+ (getSystemClipboard): Do security check and return
+ GtkClipboard.getInstance().
+ * include/Makefile.am: Add gnu_java_awt_peer_gtk_GtkSelection.h.
+ * include/gnu_java_awt_peer_gtk_GtkClipboard.h: Regenerated.
+ * include/gnu_java_awt_peer_gtk_GtkImage.h: Regenerated.
+ * include/gnu_java_awt_peer_gtk_GtkSelection.h: New header file.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c:
+ Reimplemented.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c
+ (Java_gnu_java_awt_peer_gtk_GtkImage_createFromPixbuf): New
+
+ 2005-08-16 Anthony Balkissoon <abalkiss at redhat.com>
+
+ * javax/swing/plaf/basic/BasicTableUI.java:
+ (ActionListenerProxy): Replaced type TableAction with parent type
+ ActionListener to avoid Semantic errors.
+
+ 2005-08-16 Anthony Balkissoon <abalkiss at redhat.com>
+
+ * javax/swing/plaf/basic/BasicLookAndFeel.java:
+ (initComponentDefaults): Fixed typo.
+ * javax/swing/plaf/basic/BasicTableUI.java:
+ (installKeyboardActions): Replaced calls to registerKeyboardAction with
+ additions to an explicit InputMap-ActionMap pair and then set this
+ pair as the parent pair to the JTable's. This matches the JDK where
+ the UI Input-Action pairs are the parents of the component's.
+ (ActionListenerProxy): New class.
+
+ 2005-08-16 Mark Wielaard <mark at klomp.org>
+
+ * examples/gnu/classpath/examples/datatransfer/Demo.java:
+ Document and implement ItemListener and FlavorListener.
+ (flavors): New field.
+ (details): New field.
+ (Demo): Add more space, add the flavors panel and flavor listener.
+ (createTextPanel): Smaller and wider.
+ (createFlavorsPanel): New private method.
+ (flavorsChanged): New public method.
+ (itemStateChanged): Likewise.
+ (ImageComponent.ImageComponent): Smaller default.
+ (ObjectComponent.ObjectComponent): Make wider.
+ (FlavorsComponent): New static class.
+ (FlavorDetailsComponent): Likewise.
+
+ 2005-08-16 Lillian Angel <langel at redhat.com>
+
+ * javax/swing/plaf/basic/BasicLookAndFeel.java:
+ Changed font for PasswordField because textbox was
+ being drawn at an awkward height.
+ * javax/swing/text/PasswordView.java
+ (getPreferredSpan): Implemented
+ (modelToView): likewise.
+ (viewToModel): partially implemented.
+
+ 2005-08-16 Jeroen Frijters <jeroen at frijters.net>
+
+ * java/awt/Component.java
+ (dispatchEventImpl): Always call peer.handleEvent().
+
+ 2005-08-16 Jeroen Frijters <jeroen at frijters.net>
+
+ * java/awt/Container.java
+ (addImpl, remove): Only repaint if the container is showing.
+
+ 2005-08-16 Mark Wielaard <mark at klomp.org>
+
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c
+ (Java_gnu_java_awt_peer_gtk_GtkToolkit_nativeQueueEmpty): Removed.
+
+ 2005-08-15 Lillian Angel <langel at redhat.com>
+
+ * javax/swing/JPasswordField.java
+ (getText): Fixed the length of the string to retrieve.
+
+ 2005-08-15 Sven de Marothy <sven at physto.se>
+
+ * java/awt/TextComponent.java
+ (select): Fix typo.
+
+ 2005-08-15 Anthony Balkissoon <abalkiss at redhat.com>
+
+ * javax/swing/JComponent.java:
+ (processKeyEvent): Added functionality for processing key events in
+ non-focused components using the WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
+ field.
+ * javax/swing/plaf/basic/BasicTableUI.java:
+ (installKeyboardActions): Changed key bindings to be registered as
+ WHEN_ANCESTOR_OF_FOCUSED_COMPONENT rather than as WHEN_FOCUSED.
+ (TableAction.actionPerformed): If the key action is anything besides
+ "start editing" then we stop editing if we are doing so. Repaint the
+ table at the end of this method.
+
+ 2005-08-15 Lillian Angel <langel at redhat.com>
+
+ * javax/swing/JPasswordField.java
+ (echoCharIsSet): Fixed this to work according to API.
+ (getText): Implemented
+ (getText): Implemented
+ (getPassword): Implemented
+ (paramString): Implemented
+
+ 2005-08-15 Thomas Fitzsimmons <fitzsim at redhat.com>
+
+ * gnu/java/awt/ClasspathToolkit.java (nativeQueueEmpty): Remove
+ method.
+ (wakeNativeQueue): Likewise.
+ (iterateNativeQueue): Likewise.
+ * gnu/java/awt/peer/gtk/GtkToolkit.java (static): Start GTK main
+ thread.
+ (nativeQueueEmpty): Remove method.
+ (wakeNativeQueue): Likewise.
+ (iterateNativeQueue): Likewise.
+ (gtkMain): New method.
+ * include/gnu_java_awt_peer_gtk_GtkToolkit.h: Regenerate.
+ * java/awt/EventQueue.java: Remove references to ClasspathToolkit.
+ * java/awt/Frame.java (fireDummyEvent): Remove method.
+ Remove calls to fireDummyEvent.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c
+ (dispose): Don't wake up main thread.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c: Remove
+ single-thread code.
+
+ 2005-08-15 Lillian Angel <langel at redhat.com>
+
+ * javax/swing/JTree.java
+ (expandPath): called fireTreeWillExpand and fireTreeExpanded
+ since it is not required that the calling class fires these
+ events.
+ (collapsePath): Likewise.
+ * javax/swing/plaf/basic/BasicTreeUI.java
+ (mouseClicked): Took out code that called fireTreeWillExpand/
+ fireTreeWillCollapse and fireTreeExpanded/fireTreeCollapsed.
+ (keyPressed): Likewise.
+
2005-08-17 Andreas Tobler <a.tobler at schweiz.ch>
* m4/acx_pthread.m4: Detect -pthreads first. Fixes
Index: kaffe/include/Makefile.am
diff -u kaffe/include/Makefile.am:1.110 kaffe/include/Makefile.am:1.111
--- kaffe/include/Makefile.am:1.110 Sat Aug 13 15:38:52 2005
+++ kaffe/include/Makefile.am Wed Aug 17 22:38:20 2005
@@ -177,6 +177,7 @@
gnu_java_awt_peer_gtk_GtkPopupMenuPeer.h \
gnu_java_awt_peer_gtk_GtkScrollbarPeer.h \
gnu_java_awt_peer_gtk_GtkScrollPanePeer.h \
+ gnu_java_awt_peer_gtk_GtkSelection.h \
gnu_java_awt_peer_gtk_GtkTextAreaPeer.h \
gnu_java_awt_peer_gtk_GtkTextFieldPeer.h \
gnu_java_awt_peer_gtk_GtkToolkit.h \
@@ -198,6 +199,7 @@
gnu_java_awt_peer_qt_QtComponentPeer.h \
gnu_java_awt_peer_qt_QtContainerPeer.h \
gnu_java_awt_peer_qt_QtDialogPeer.h \
+ gnu_java_awt_peer_qt_QtEmbeddedWindowPeer.h \
gnu_java_awt_peer_qt_QtFileDialogPeer.h \
gnu_java_awt_peer_qt_QtFontMetrics.h \
gnu_java_awt_peer_qt_QtFontPeer.h \
Index: kaffe/include/Makefile.in
diff -u kaffe/include/Makefile.in:1.239 kaffe/include/Makefile.in:1.240
--- kaffe/include/Makefile.in:1.239 Sat Aug 13 15:38:52 2005
+++ kaffe/include/Makefile.in Wed Aug 17 22:38:22 2005
@@ -541,6 +541,7 @@
gnu_java_awt_peer_gtk_GtkPopupMenuPeer.h \
gnu_java_awt_peer_gtk_GtkScrollbarPeer.h \
gnu_java_awt_peer_gtk_GtkScrollPanePeer.h \
+ gnu_java_awt_peer_gtk_GtkSelection.h \
gnu_java_awt_peer_gtk_GtkTextAreaPeer.h \
gnu_java_awt_peer_gtk_GtkTextFieldPeer.h \
gnu_java_awt_peer_gtk_GtkToolkit.h \
@@ -562,6 +563,7 @@
gnu_java_awt_peer_qt_QtComponentPeer.h \
gnu_java_awt_peer_qt_QtContainerPeer.h \
gnu_java_awt_peer_qt_QtDialogPeer.h \
+ gnu_java_awt_peer_qt_QtEmbeddedWindowPeer.h \
gnu_java_awt_peer_qt_QtFileDialogPeer.h \
gnu_java_awt_peer_qt_QtFontMetrics.h \
gnu_java_awt_peer_qt_QtFontPeer.h \
Index: kaffe/kaffe/kaffevm/boehm-gc/boehm/acinclude.m4
diff -u kaffe/kaffe/kaffevm/boehm-gc/boehm/acinclude.m4:1.2 kaffe/kaffe/kaffevm/boehm-gc/boehm/acinclude.m4:1.3
--- kaffe/kaffe/kaffevm/boehm-gc/boehm/acinclude.m4:1.2 Tue Aug 24 17:59:44 2004
+++ kaffe/kaffe/kaffevm/boehm-gc/boehm/acinclude.m4 Wed Aug 17 22:38:23 2005
@@ -17,7 +17,7 @@
# [0-9]+[.][0-9]+(alpha[0.9]+)?
# in lex syntax; if there is no alpha number, GC_ALPHA_VERSION is empty
#
-AC_DEFUN(GC_SET_VERSION, [
+AC_DEFUN([GC_SET_VERSION], [
AC_MSG_CHECKING(GC version numbers)
GC_VERSION_MAJOR=`echo $PACKAGE_VERSION | sed 's/^\([[0-9]][[0-9]]*\)[[.]].*$/\1/g'`
GC_VERSION_MINOR=`echo $PACKAGE_VERSION | sed 's/^[[^.]]*[[.]]\([[0-9]][[0-9]]*\).*$/\1/g'`
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c:1.6 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c:1.7
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c:1.6 Tue Jul 26 16:22:02 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c Wed Aug 17 22:38:23 2005
@@ -1,5 +1,5 @@
/* gtkclipboard.c
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -36,169 +36,739 @@
exception statement from your version. */
+#include "jcl.h"
#include "gtkpeer.h"
#include "gnu_java_awt_peer_gtk_GtkClipboard.h"
+#include "gnu_java_awt_peer_gtk_GtkSelection.h"
-static jmethodID stringSelectionReceivedID;
-static jmethodID stringSelectionHandlerID;
-static jmethodID selectionClearID;
-
-static void selection_received_cb (GtkWidget *, GtkSelectionData *,
- guint, gpointer);
-static void selection_get_cb (GtkWidget *, GtkSelectionData *, guint,
- guint, gpointer);
-static gint selection_clear_cb (GtkWidget *, GdkEventSelection *);
+#define OBJECT_TARGET 1
+#define TEXT_TARGET 2
+#define IMAGE_TARGET 3
+#define URI_TARGET 4
-static GtkWidget *clipboard;
-static jobject cb_obj;
+static GtkClipboard *clipboard;
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkClipboard_initNativeState (JNIEnv *env,
- jobject obj)
+/* Simple id to keep track of the selection we are currently managing. */
+static int current_selection = 0;
+
+/* Whether we "own" the clipboard. And may clear it. */
+static int owner = 0;
+
+static jclass gtk_clipboard_class;
+static jmethodID setSystemContentsID;
+
+static jobject gtk_clipboard_instance = NULL;
+static jmethodID provideContentID;
+static jmethodID provideTextID;
+static jmethodID provideImageID;
+static jmethodID provideURIsID;
+
+static jstring stringTarget;
+static jstring imageTarget;
+static jstring filesTarget;
+
+static void
+cp_gtk_clipboard_owner_change (GtkClipboard *clipboard __attribute__((unused)),
+ GdkEvent *event __attribute__((unused)),
+ gpointer user_data __attribute__((unused)))
{
+ /* These are only interesting when we are not the owner. Otherwise
+ we will have the set and clear functions doing the updating. */
+ JNIEnv *env = cp_gtk_gdk_env ();
+ if (!owner)
+ (*env)->CallStaticVoidMethod (env, gtk_clipboard_class,
+ setSystemContentsID);
+}
+
+JNIEXPORT jboolean JNICALL
+Java_gnu_java_awt_peer_gtk_GtkClipboard_initNativeState (JNIEnv *env,
+ jclass gtkclipboard,
+ jstring string,
+ jstring image,
+ jstring files)
+{
+ GdkDisplay* display;
+ jboolean can_cache;
+
+ gtk_clipboard_class = gtkclipboard;
+ setSystemContentsID = (*env)->GetStaticMethodID (env, gtk_clipboard_class,
+ "setSystemContents",
+ "()V");
+ if (setSystemContentsID == NULL)
+ return JNI_FALSE;
+
+ stringTarget = (*env)->NewGlobalRef(env, string);
+ imageTarget = (*env)->NewGlobalRef(env, image);
+ filesTarget = (*env)->NewGlobalRef(env, files);
+
gdk_threads_enter ();
+ clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
- if (!stringSelectionReceivedID)
+ display = gtk_clipboard_get_display (clipboard);
+ if (gdk_display_supports_selection_notification (display))
{
- jclass gtkclipboard;
-
- gtkclipboard = (*env)->FindClass (env,
- "gnu/java/awt/peer/gtk/GtkClipboard");
- stringSelectionReceivedID = (*env)->GetMethodID (env, gtkclipboard,
- "stringSelectionReceived",
- "(Ljava/lang/String;)V");
- stringSelectionHandlerID = (*env)->GetMethodID (env, gtkclipboard,
- "stringSelectionHandler",
- "()Ljava/lang/String;");
- selectionClearID = (*env)->GetMethodID (env, gtkclipboard,
- "selectionClear", "()V");
+ g_signal_connect (clipboard, "owner-change",
+ G_CALLBACK (cp_gtk_clipboard_owner_change), NULL);
+ gdk_display_request_selection_notification (display,
+ GDK_SELECTION_CLIPBOARD);
+ can_cache = JNI_TRUE;
}
+ else
+ can_cache = JNI_FALSE;
+ gdk_threads_leave ();
- cb_obj = (*env)->NewGlobalRef (env, obj);
-
- clipboard = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ return can_cache;
+}
- g_signal_connect (G_OBJECT(clipboard), "selection_received",
- G_CALLBACK (selection_received_cb), NULL);
+static void
+cp_gtk_clipboard_get_func (GtkClipboard *clipboard __attribute__((unused)),
+ GtkSelectionData *selection,
+ guint info,
+ gpointer user_data __attribute__((unused)))
+{
+ JNIEnv *env = cp_gtk_gdk_env ();
+
+ if (info == OBJECT_TARGET)
+ {
+ const gchar *target_name;
+ jstring target_string;
+ jbyteArray bytes;
+ jint len;
+ jbyte *barray;
+
+ target_name = gdk_atom_name (selection->target);
+ if (target_name == NULL)
+ return;
+ target_string = (*env)->NewStringUTF (env, target_name);
+ if (target_string == NULL)
+ return;
+ bytes = (*env)->CallObjectMethod(env,
+ gtk_clipboard_instance,
+ provideContentID,
+ target_string);
+ if (bytes == NULL)
+ return;
+ len = (*env)->GetArrayLength(env, bytes);
+ if (len <= 0)
+ return;
+ barray = (*env)->GetByteArrayElements(env, bytes, NULL);
+ if (barray == NULL)
+ return;
+ gtk_selection_data_set (selection, selection->target, 8,
+ (guchar *) barray, len);
- g_signal_connect (G_OBJECT(clipboard), "selection_clear_event",
- G_CALLBACK (selection_clear_cb), NULL);
+ (*env)->ReleaseByteArrayElements(env, bytes, barray, 0);
- gtk_selection_add_target (clipboard, GDK_SELECTION_PRIMARY,
- GDK_TARGET_STRING, 0);
+ }
+ else if (info == TEXT_TARGET)
+ {
+ jstring string;
+ const gchar *text;
+ int len;
+ string = (*env)->CallObjectMethod(env,
+ gtk_clipboard_instance,
+ provideTextID);
+ if (string == NULL)
+ return;
+ len = (*env)->GetStringUTFLength (env, string);
+ if (len == -1)
+ return;
+ text = (*env)->GetStringUTFChars (env, string, NULL);
+ if (text == NULL)
+ return;
- g_signal_connect (G_OBJECT(clipboard), "selection_get",
- G_CALLBACK (selection_get_cb), NULL);
+ gtk_selection_data_set_text (selection, text, len);
+ (*env)->ReleaseStringUTFChars (env, string, text);
+ }
+ else if (info == IMAGE_TARGET)
+ {
+ jobject gtkimage;
+ GdkPixbuf *pixbuf = NULL;
+
+ gtkimage = (*env)->CallObjectMethod(env,
+ gtk_clipboard_instance,
+ provideImageID);
+ if (gtkimage == NULL)
+ return;
+
+ pixbuf = cp_gtk_image_get_pixbuf (env, gtkimage);
+ if (pixbuf != NULL)
+ {
+ gtk_selection_data_set_pixbuf (selection, pixbuf);
+
+ /* if the GtkImage is offscreen, this is a temporary pixbuf
+ which should be thrown out. */
+ if(cp_gtk_image_is_offscreen (env, gtkimage) == JNI_TRUE)
+ gdk_pixbuf_unref (pixbuf);
+ }
+ }
+ else if (info == URI_TARGET)
+ {
+ jobjectArray uris;
+ jint count;
+ int i;
+ gchar **list;
+
+ uris = (*env)->CallObjectMethod(env,
+ gtk_clipboard_instance,
+ provideURIsID);
+ if (uris == NULL)
+ return;
+ count = (*env)->GetArrayLength (env, uris);
+ if (count <= 0)
+ return;
+
+ list = (gchar **) JCL_malloc (env, (count + 1) * sizeof (gchar *));
+ for (i = 0; i < count; i++)
+ {
+ const char *text;
+ jstring uri;
+
+ /* Mark NULL in so case of some error we can find the end. */
+ list[i] = NULL;
+ uri = (*env)->GetObjectArrayElement (env, uris, i);
+ if (uri == NULL)
+ break;
+ text = (*env)->GetStringUTFChars (env, uri, NULL);
+ if (text == NULL)
+ break;
+ list[i] = strdup (text);
+ (*env)->ReleaseStringUTFChars (env, uri, text);
+ }
+
+ if (i == count)
+ {
+ list[count] = NULL;
+ gtk_selection_data_set_uris (selection, list);
+ }
+
+ for (i = 0; list[i] != NULL; i++)
+ free (list[i]);
+ JCL_free (env, list);
+ }
+}
- gdk_threads_leave ();
+static void
+cp_gtk_clipboard_clear_func (GtkClipboard *clipboard __attribute__((unused)),
+ gpointer user_data)
+{
+ if (owner && (int) user_data == current_selection)
+ {
+ JNIEnv *env = cp_gtk_gdk_env();
+ owner = 0;
+ (*env)->CallStaticVoidMethod (env, gtk_clipboard_class,
+ setSystemContentsID);
+ }
}
JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkClipboard_requestStringConversion
- (JNIEnv *env __attribute__((unused)), jclass clazz __attribute__((unused)))
+Java_gnu_java_awt_peer_gtk_GtkClipboard_advertiseContent
+(JNIEnv *env,
+ jobject instance,
+ jobjectArray mime_array,
+ jboolean add_text,
+ jboolean add_images __attribute__((unused)),
+ jboolean add_uris __attribute__((unused)))
{
+ GtkTargetList *target_list;
+ GList *list;
+ GtkTargetEntry *targets;
+ gint n, i;
+
gdk_threads_enter ();
+ target_list = gtk_target_list_new (NULL, 0);
+
+ if (mime_array != NULL)
+ {
+ n = (*env)->GetArrayLength (env, mime_array);
+ for (i = 0; i < n; i++)
+ {
+ const char *text;
+ jstring target;
+ GdkAtom atom;
+
+ target = (*env)->GetObjectArrayElement (env, mime_array, i);
+ if (target == NULL)
+ break;
+ text = (*env)->GetStringUTFChars (env, target, NULL);
+ if (text == NULL)
+ break;
- gtk_selection_convert (clipboard, GDK_SELECTION_PRIMARY,
- GDK_TARGET_STRING, GDK_CURRENT_TIME);
+ atom = gdk_atom_intern (text, FALSE);
+ gtk_target_list_add (target_list, atom, 0, OBJECT_TARGET);
+ (*env)->ReleaseStringUTFChars (env, target, text);
+ }
+ }
+
+ /* Add extra targets that gtk+ can provide/translate for us. */
+ if (add_text)
+ gtk_target_list_add_text_targets (target_list, TEXT_TARGET);
+ if (add_images)
+ gtk_target_list_add_image_targets (target_list, IMAGE_TARGET, TRUE);
+ if (add_uris)
+ gtk_target_list_add_uri_targets (target_list, URI_TARGET);
+
+ /* Turn list into a target table. */
+ n = g_list_length (target_list->list);
+ if (n > 0)
+ {
+ targets = g_new (GtkTargetEntry, n);
+ for (list = target_list->list, i = 0;
+ list != NULL;
+ list = list->next, i++)
+ {
+ GtkTargetPair *pair = (GtkTargetPair *) list->data;
+ targets[i].target = gdk_atom_name (pair->target);
+ targets[i].flags = pair->flags;
+ targets[i].info = pair->info;
+ }
+
+ /* Set the targets plus callback functions and ask for the clipboard
+ to be stored when the application exists. */
+ current_selection++;
+ if (gtk_clipboard_set_with_data (clipboard, targets, n,
+ cp_gtk_clipboard_get_func,
+ cp_gtk_clipboard_clear_func,
+ (gpointer) current_selection))
+ {
+ owner = 1;
+ if (gtk_clipboard_instance == NULL)
+ {
+ JNIEnv *env = cp_gtk_gdk_env ();
+ gtk_clipboard_instance = (*env)->NewGlobalRef(env, instance);
+
+ provideContentID
+ = (*env)->GetMethodID (env, gtk_clipboard_class,
+ "provideContent",
+ "(Ljava/lang/String;)[B");
+ if (provideContentID == NULL)
+ return;
+
+ provideTextID
+ = (*env)->GetMethodID (env, gtk_clipboard_class,
+ "provideText", "()Ljava/lang/String;");
+ if (provideTextID == NULL)
+ return;
+
+ provideImageID
+ = (*env)->GetMethodID (env, gtk_clipboard_class,
+ "provideImage",
+ "()Lgnu/java/awt/peer/gtk/GtkImage;");
+ if (provideImageID == NULL)
+ return;
+
+ provideURIsID
+ = (*env)->GetMethodID (env, gtk_clipboard_class,
+ "provideURIs",
+ "()[Ljava/lang/String;");
+ if (provideURIsID == NULL)
+ return;
+ }
+ gtk_clipboard_set_can_store (clipboard, NULL, 0);
+ }
+ else
+ {
+ owner = 0;
+ (*env)->CallStaticVoidMethod (env, gtk_clipboard_class,
+ setSystemContentsID);
+ }
+
+ for (i = 0; i < n; i++)
+ g_free (targets[i].target);
+ g_free (targets);
+ }
+ else if (owner)
+ {
+ gtk_clipboard_clear (clipboard);
+ owner = 0;
+ }
+
+ gtk_target_list_unref (target_list);
gdk_threads_leave ();
}
+
+/* GtkSelection native methods. Put here for convenience since they
+ need access to the current clipboard. */
+
+static jmethodID mimeTypesAvailableID;
+
+/* Note this is actually just a GtkClipboardReceivedFunc, not a real
+ GtkClipboardTargetsReceivedFunc, see requestMimeTypes. */
static void
-selection_received_cb (GtkWidget *widget __attribute__((unused)),
- GtkSelectionData *selection_data __attribute__((unused)),
- guint time __attribute__((unused)),
- gpointer data __attribute__((unused)))
+cp_gtk_clipboard_targets_received (GtkClipboard *clipboard
+ __attribute__((unused)),
+ GtkSelectionData *target_data,
+ gpointer selection)
{
- /* Check to see if retrieval succeeded */
- if (selection_data->length < 0
- || selection_data->type != GDK_SELECTION_TYPE_STRING)
+ GdkAtom *targets = NULL;
+ gint targets_len = 0;
+ gchar **target_strings = NULL;
+ jobjectArray strings = NULL;
+ int strings_len = 0;
+ gboolean include_text = FALSE;
+ gboolean include_image = FALSE;
+ gboolean include_uris = FALSE;
+ jobject selection_obj = (jobject) selection;
+ JNIEnv *env = cp_gtk_gdk_env ();
+
+ if (target_data != NULL && target_data->length > 0)
{
- gdk_threads_leave ();
+ include_text = gtk_selection_data_targets_include_text (target_data);
+ include_image = gtk_selection_data_targets_include_image (target_data,
+ TRUE);
+ if (gtk_selection_data_get_targets (target_data, &targets, &targets_len))
+ {
+ int i;
+ GdkAtom uri_list_atom = gdk_atom_intern ("text/uri-list", FALSE);
+ target_strings = g_new (gchar*, targets_len);
+ if (target_strings != NULL)
+ for (i = 0; i < targets_len; i++)
+ {
+ gchar *name = gdk_atom_name (targets[i]);
+ if (strchr (name, '/') != NULL)
+ {
+ target_strings[i] = name;
+ strings_len++;
+ if (! include_uris && targets[i] == uri_list_atom)
+ include_uris = TRUE;
+ }
+ else
+ target_strings[i] = NULL;
+ }
+ }
+
+ if (target_strings != NULL)
+ {
+ int i = 0, j = 0;
+ jclass stringClass;
+
+ if (include_text)
+ strings_len++;
+ if (include_image)
+ strings_len++;
+ if (include_uris)
+ strings_len++;
+
+ stringClass = (*env)->FindClass (env, "java/lang/String");
+ strings = (*env)->NewObjectArray (env, strings_len, stringClass,
+ NULL);
+ if (strings != NULL)
+ {
+ if (include_text)
+ (*env)->SetObjectArrayElement (env, strings, i++,
+ stringTarget);
+ if (include_image)
+ (*env)->SetObjectArrayElement (env, strings, i++,
+ imageTarget);
+ if (include_uris)
+ (*env)->SetObjectArrayElement (env, strings, i++,
+ filesTarget);
+
+ while(i < strings_len)
+ {
+ if (target_strings[j] == NULL)
+ j++;
+ else
+ {
+ jstring string;
+ string = (*env)->NewStringUTF (env,
*** Patch too long, truncated ***
More information about the kaffe
mailing list