From: Mark Wielaard Date: Mon, 31 May 2004 23:03:01 +0000 (+0000) Subject: GtkComponentPeer.java (requestFocus): Implement by calling gtkRequestFocus. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1900c4c6bfaf703c107d5a28e55b9525bbd875fa;p=gcc.git GtkComponentPeer.java (requestFocus): Implement by calling gtkRequestFocus. 2004-06-01 Mark Wielaard * 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 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 35592a70db3..aed49734797 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,18 @@ +2004-06-01 Mark Wielaard + + * 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 * 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 fe52ef0a2dd..15d3d5c4b02 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 e8a918f9666..565484c824f 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 2d271ea8f2b..41718017c0a 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)));