From: Michael Koch Date: Thu, 6 May 2004 10:25:02 +0000 (+0000) Subject: gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c, [...]: New files. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=45505d4d0cc1f5b9d9e734c4b413e2b13cd84652;p=gcc.git gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c, [...]: New files. 2004-05-06 Michael Koch * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c, jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c: New files. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c: Include gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.h. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c: Moved GtkCheckboxGroupPeer_dispose and GtkCheckboxGroupPeer_remove to their own source file. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c: Moved GtkGenericPeer_dispose and GtkComponentPeer_requestFocus to their own source file. Removed GtkComponentPeer_gtkWidgetSetUsize. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c (create): Define variable on top of function. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c (menu_pos): Prototyped. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c (setTitle): Removed. * jni/gtk-peer/gthread-jni.c (gdk_threads_wake): Removed. * Makefile.am (gtk_c_source_files): Added new files jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c and jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c. * Makefile.in: Regenerated. From-SVN: r81558 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index e5c1323f67f..ee8c36bfa58 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,29 @@ +2004-05-06 Michael Koch + + * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c, + jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c: + New files. + * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c: + Include gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.h. + * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c: + Moved GtkCheckboxGroupPeer_dispose and GtkCheckboxGroupPeer_remove to + their own source file. + * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c: + Moved GtkGenericPeer_dispose and GtkComponentPeer_requestFocus to + their own source file. Removed GtkComponentPeer_gtkWidgetSetUsize. + * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c + (create): Define variable on top of function. + * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c + (menu_pos): Prototyped. + * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c + (setTitle): Removed. + * jni/gtk-peer/gthread-jni.c + (gdk_threads_wake): Removed. + * Makefile.am (gtk_c_source_files): Added new files + jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c and + jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c. + * Makefile.in: Regenerated. + 2004-05-05 Bryce McKinlay * testsuite/libjava.jni/pr11951.java: Add missing System.loadLibrary() diff --git a/libjava/Makefile.am b/libjava/Makefile.am index 0acbb884c8a..ef8a49ddeb7 100644 --- a/libjava/Makefile.am +++ b/libjava/Makefile.am @@ -191,6 +191,7 @@ jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c \ +jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c \ @@ -199,6 +200,7 @@ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c \ +jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c \ diff --git a/libjava/Makefile.in b/libjava/Makefile.in index 1605cbf09af..1afe8dc27f6 100644 --- a/libjava/Makefile.in +++ b/libjava/Makefile.in @@ -282,6 +282,7 @@ jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c \ +jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c \ @@ -290,6 +291,7 @@ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c \ +jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c \ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c \ @@ -2859,6 +2861,7 @@ lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES = @GTK_CAIRO_FALSE@jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.lo \ @GTK_CAIRO_FALSE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.lo \ @GTK_CAIRO_FALSE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.lo \ +@GTK_CAIRO_FALSE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.lo \ @GTK_CAIRO_FALSE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.lo \ @GTK_CAIRO_FALSE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.lo \ @GTK_CAIRO_FALSE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.lo \ @@ -2867,6 +2870,7 @@ lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES = @GTK_CAIRO_FALSE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.lo \ @GTK_CAIRO_FALSE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.lo \ @GTK_CAIRO_FALSE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.lo \ +@GTK_CAIRO_FALSE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.lo \ @GTK_CAIRO_FALSE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.lo \ @GTK_CAIRO_FALSE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.lo \ @GTK_CAIRO_FALSE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.lo \ @@ -2941,6 +2945,7 @@ lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES = @GTK_CAIRO_TRUE@jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.lo \ @GTK_CAIRO_TRUE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.lo \ @GTK_CAIRO_TRUE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.lo \ +@GTK_CAIRO_TRUE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.lo \ @GTK_CAIRO_TRUE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.lo \ @GTK_CAIRO_TRUE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.lo \ @GTK_CAIRO_TRUE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.lo \ @@ -2949,6 +2954,7 @@ lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES = @GTK_CAIRO_TRUE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.lo \ @GTK_CAIRO_TRUE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.lo \ @GTK_CAIRO_TRUE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.lo \ +@GTK_CAIRO_TRUE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.lo \ @GTK_CAIRO_TRUE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.lo \ @GTK_CAIRO_TRUE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.lo \ @GTK_CAIRO_TRUE@jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.lo \ @@ -4697,6 +4703,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \ .deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.P \ .deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.P \ .deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.P \ +.deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.P \ .deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.P \ .deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.P \ .deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.P \ @@ -4705,6 +4712,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \ .deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.P \ .deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.P \ .deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.P \ +.deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.P \ .deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.P \ .deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.P \ .deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.P \ diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c new file mode 100644 index 00000000000..f88e2e8bcc3 --- /dev/null +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c @@ -0,0 +1,75 @@ +/* gtkcheckboxgrouppeer.c -- Native implementation of GtkCheckboxGroupPeer + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +#include "gtkpeer.h" +#include "gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.h" + +JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer_dispose + (JNIEnv *env, jobject obj) +{ + /* The actual underlying widget is owned by a different class. So + we just clean up the hash table here. */ + NSA_DEL_PTR (env, obj); +} + +JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer_remove + (JNIEnv *env, jobject obj, jobject checkbox) +{ + GtkRadioButton *button; + void *ptr; + GSList *list; + + ptr = NSA_GET_PTR (env, checkbox); + gdk_threads_enter (); + button = GTK_RADIO_BUTTON (ptr); + + /* Update the group to point to some other widget in the group. We + have to do this because Gtk doesn't have a separate object to + represent a radio button's group. */ + for (list = gtk_radio_button_group (button); list != NULL; + list = list->next) + { + if (list->data != button) + break; + } + + gdk_threads_leave (); + + NSA_SET_PTR (env, obj, list ? list->data : NULL); +} + diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c index 71600c082ca..153b17fe333 100644 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c @@ -37,7 +37,7 @@ exception statement from your version. */ #include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkMenuItemPeer.h" +#include "gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.h" JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer_create diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c index 88821ae9a48..b4654bb2e29 100644 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c @@ -42,40 +42,6 @@ exception statement from your version. */ static void item_toggled (GtkToggleButton *item, jobject peer); -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer_dispose - (JNIEnv *env, jobject obj) -{ - /* The actual underlying widget is owned by a different class. So - we just clean up the hash table here. */ - NSA_DEL_PTR (env, obj); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer_remove - (JNIEnv *env, jobject obj, jobject checkbox) -{ - GtkRadioButton *button; - void *ptr; - GSList *list; - - ptr = NSA_GET_PTR (env, checkbox); - gdk_threads_enter (); - button = GTK_RADIO_BUTTON (ptr); - - /* Update the group to point to some other widget in the group. We - have to do this because Gtk doesn't have a separate object to - represent a radio button's group. */ - for (list = gtk_radio_button_group (button); list != NULL; - list = list->next) - { - if (list->data != button) - break; - } - - gdk_threads_leave (); - - NSA_SET_PTR (env, obj, list ? list->data : NULL); -} - JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_nativeCreate (JNIEnv *env, jobject obj, jobject group, jboolean state) 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 1d56c5cfe2c..b1c28c9c84a 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 @@ -43,23 +43,6 @@ exception statement from your version. */ static GtkWidget *find_fg_color_widget (GtkWidget *widget); static GtkWidget *find_bg_color_widget (GtkWidget *widget); -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkGenericPeer_dispose - (JNIEnv *env, jobject obj) -{ - void *ptr; - - /* Remove entries from state tables */ - NSA_DEL_GLOBAL_REF (env, obj); - ptr = NSA_DEL_PTR (env, obj); - - gdk_threads_enter (); - - /* For now the native state for any object must be a widget. - However, a subclass could override dispose() if required. */ - gtk_widget_destroy (GTK_WIDGET (ptr)); - - gdk_threads_leave (); -} JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetCursor @@ -128,18 +111,6 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetCursor gdk_threads_leave (); } -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_requestFocus - (JNIEnv *env, jobject obj) -{ - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - /* XXX gtk_widget_grab_focus (GTK_WIDGET (ptr)); */ - gdk_threads_leave (); -} - /* * Find the origin of a widget's window. */ @@ -234,19 +205,6 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetGetPreferredDimensions (*env)->ReleaseIntArrayElements (env, jdims, dims, 0); } -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetUsize (JNIEnv *env, - jobject obj, jint w, jint h) -{ - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gtk_widget_set_usize (GTK_WIDGET (ptr), w, h); - gdk_threads_leave (); -} - JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_setNativeBounds (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height) { diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c new file mode 100644 index 00000000000..7b8babeb839 --- /dev/null +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c @@ -0,0 +1,59 @@ +/* gtkgenericpeer.c -- Native implementation of GtkGenericPeer + Copyright (C) 1998, 1999, 2002, 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +#include "gtkpeer.h" +#include "gnu_java_awt_peer_gtk_GtkGenericPeer.h" + +JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkGenericPeer_dispose + (JNIEnv *env, jobject obj) +{ + void *ptr; + + /* Remove entries from state tables */ + NSA_DEL_GLOBAL_REF (env, obj); + ptr = NSA_DEL_PTR (env, obj); + + gdk_threads_enter (); + + /* For now the native state for any object must be a widget. + However, a subclass could override dispose() if required. */ + gtk_widget_destroy (GTK_WIDGET (ptr)); + + gdk_threads_leave (); +} + diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c index 889cc3b4c71..e6a8851fcf2 100644 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c @@ -89,7 +89,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuPeer_setupAccelGroup JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuPeer_create (JNIEnv *env, jobject obj, jstring label) { - GtkWidget *menu_title, *menu; + GtkWidget *menu_title, *menu, *toplevel; const char *str; /* Create global reference and save it for future use */ @@ -109,7 +109,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuPeer_create gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_title), menu); /* Allow this menu to grab the pointer. */ - GtkWidget *toplevel = gtk_widget_get_toplevel (menu); + toplevel = gtk_widget_get_toplevel (menu); if (GTK_IS_WINDOW (toplevel)) { gtk_window_group_add_window (global_gtk_window_group, 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 97213c45db2..ee12a7f77b1 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,6 +39,8 @@ 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; diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c index 80d9d5bfb1b..619b48d593a 100644 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c @@ -283,28 +283,6 @@ Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectSignals Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals (env, obj); } -/* - * Set a frame's title - */ - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkWindowPeer_setTitle - (JNIEnv *env, jobject obj, jstring title) -{ - void *ptr; - const char *str; - - ptr = NSA_GET_PTR (env, obj); - - str = (*env)->GetStringUTFChars (env, title, NULL); - - gdk_threads_enter (); - gtk_window_set_title (GTK_WINDOW (ptr), str); - gdk_threads_leave (); - - (*env)->ReleaseStringUTFChars (env, title, str); -} - /* * Lower the z-level of a window. */ diff --git a/libjava/jni/gtk-peer/gthread-jni.c b/libjava/jni/gtk-peer/gthread-jni.c index b21a80c8843..3dd5596b4bc 100644 --- a/libjava/jni/gtk-peer/gthread-jni.c +++ b/libjava/jni/gtk-peer/gthread-jni.c @@ -505,7 +505,3 @@ GThreadFunctions g_thread_jni_functions = NULL }; -/* ??? */ -void gdk_threads_wake () { - -}