aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2004-05-31 23:03:01 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2004-05-31 23:03:01 +0000
commit1900c4c6bfaf703c107d5a28e55b9525bbd875fa (patch)
treefeed0a2b7afb4720064d544589b45b59cab8561a /libjava
parente17b3578a3b043e0ee9a8493224287e79f9bb2c9 (diff)
downloadgcc-1900c4c6bfaf703c107d5a28e55b9525bbd875fa.zip
gcc-1900c4c6bfaf703c107d5a28e55b9525bbd875fa.tar.gz
gcc-1900c4c6bfaf703c107d5a28e55b9525bbd875fa.tar.bz2
GtkComponentPeer.java (requestFocus): Implement by calling gtkRequestFocus.
2004-06-01 Mark Wielaard <mark@klomp.org> * gnu/java/awt/peer/gtk/GtkComponentPeer.java (requestFocus): Implement by calling gtkRequestFocus. (gtkRequestFocus): New native method. * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_requestFocus__): Renamed to ... (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkRequestFocus): New function name. (filter_expose_event_handler): Mark static. * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c (menu_pos): Mark static. From-SVN: r82517
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog15
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java8
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c4
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c7
4 files changed, 26 insertions, 8 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 35592a7..aed4973 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,18 @@
+2004-06-01 Mark Wielaard <mark@klomp.org>
+
+ * gnu/java/awt/peer/gtk/GtkComponentPeer.java (requestFocus):
+ Implement by calling gtkRequestFocus.
+ (gtkRequestFocus): New native method.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_requestFocus__):
+ Renamed to ...
+ (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkRequestFocus):
+ New function name.
+ (filter_expose_event_handler):
+ Mark static.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c
+ (menu_pos): Mark static.
+
2004-06-01 Michael Koch <konqueror@gmx.de>
* java/text/CollationElementIterator.java,
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
index fe52ef0..15d3d5c 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
@@ -353,10 +353,14 @@ public class GtkComponentPeer extends GtkGenericPeer
public void requestFocus ()
{
- gtkWidgetRequestFocus ();
- postFocusEvent (FocusEvent.FOCUS_GAINED, false);
+ gtkRequestFocus();
}
+ // Called from requestFocus, we don't want to make requestFocus itself
+ // native since several JNI header generators have difficulties with
+ // overridden and/or miranda methods. (Bug in gcjh < 3.5.)
+ native private void gtkRequestFocus ();
+
public void reshape (int x, int y, int width, int height)
{
setBounds (x, y, width, height);
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
index e8a918f..565484c 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
@@ -472,7 +472,7 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetCursor
}
JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetRequestFocus
+Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkRequestFocus
(JNIEnv *env, jobject obj)
{
void *ptr;
@@ -1056,7 +1056,7 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_set__Ljava_lang_String_2Ljava_lang_O
(*env)->ReleaseStringUTFChars (env, jname, name);
}
-gboolean
+static gboolean
filter_expose_event_handler (GtkWidget *widget, GdkEvent *event, jobject peer)
{
/*
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c
index 2d271ea..4171801 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c
@@ -39,15 +39,13 @@ exception statement from your version. */
#include "gtkpeer.h"
#include "gnu_java_awt_peer_gtk_GtkPopupMenuPeer.h"
-void menu_pos (GtkMenu *, gint *, gint *, gboolean *, gpointer);
-
struct pos
{
gint x;
gint y;
};
-void
+static void
menu_pos (GtkMenu *menu __attribute__((unused)),
gint *x, gint *y,
gboolean *push_in,
@@ -93,7 +91,8 @@ Java_gnu_java_awt_peer_gtk_GtkPopupMenuPeer_setupAccelGroup
gdk_threads_enter ();
menu = GTK_MENU (GTK_MENU_ITEM (ptr1)->submenu);
gtk_menu_set_accel_group (menu, gtk_accel_group_new ());
- /* FIXME: update this to use GTK-2.4 GtkActions. */
+ /* FIXME: _gtk_accel_group_attach is a GTK-private function, so
+ we'll need a different approach here: */
#if 0
_gtk_accel_group_attach (gtk_menu_get_accel_group (menu),
G_OBJECT (gtk_widget_get_toplevel (ptr2)));