diff options
author | Michael Koch <konqueror@gmx.de> | 2004-05-06 10:25:02 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2004-05-06 10:25:02 +0000 |
commit | 45505d4d0cc1f5b9d9e734c4b413e2b13cd84652 (patch) | |
tree | 322d164bda1a2ff14a911853620017e9fac9edc5 /libjava/jni/gtk-peer | |
parent | 615ccdd3581c6702e259e045380878dd60c56123 (diff) | |
download | gcc-45505d4d0cc1f5b9d9e734c4b413e2b13cd84652.zip gcc-45505d4d0cc1f5b9d9e734c4b413e2b13cd84652.tar.gz gcc-45505d4d0cc1f5b9d9e734c4b413e2b13cd84652.tar.bz2 |
gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c, [...]: New files.
2004-05-06 Michael Koch <konqueror@gmx.de>
* 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
Diffstat (limited to 'libjava/jni/gtk-peer')
9 files changed, 139 insertions, 105 deletions
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 0000000..f88e2e8 --- /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 71600c0..153b17f 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 88821ae..b4654bb 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 1d56c5c..b1c28c9 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 0000000..7b8babe --- /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 889cc3b..e6a8851 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 97213c4..ee12a7f 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 80d9d5b..619b48d 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 @@ -284,28 +284,6 @@ Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectSignals } /* - * 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 b21a80c..3dd5596 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 () { - -} |