GtkComponentPeer.java (requestFocus): Implement by calling gtkRequestFocus.
authorMark Wielaard <mark@klomp.org>
Mon, 31 May 2004 23:03:01 +0000 (23:03 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Mon, 31 May 2004 23:03:01 +0000 (23:03 +0000)
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

libjava/ChangeLog
libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c

index 35592a70db32602b3aed1ca6fb5cbbaa2ccd2a5f..aed49734797a799161c96feab9b2b0b54b3d4b9b 100644 (file)
@@ -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,
index fe52ef0a2dd4c1aa657f43d38c7beb3d63264a0e..15d3d5c4b02fc77226147b7bb8981d1164baa142 100644 (file)
@@ -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);
index e8a918f966671c935339cf4a63da99dd83dc7514..565484c824febfdfe73b3a121b0dbc5d679e22a5 100644 (file)
@@ -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)
 {
   /*
index 2d271ea8f2b18d6d20ec25174288ddeadfc8f44e..41718017c0ab67371ce87075393cc2525dec8e2a 100644 (file)
@@ -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)));