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
This commit is contained in:
Michael Koch 2004-05-06 10:25:02 +00:00 committed by Michael Koch
parent 615ccdd358
commit 45505d4d0c
12 changed files with 175 additions and 105 deletions

View File

@ -1,3 +1,29 @@
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.
2004-05-05 Bryce McKinlay <mckinlay@redhat.com>
* testsuite/libjava.jni/pr11951.java: Add missing System.loadLibrary()

View File

@ -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 \

View File

@ -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 \

View File

@ -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);
}

View File

@ -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

View File

@ -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)

View File

@ -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)
{

View File

@ -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 ();
}

View File

@ -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,

View File

@ -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;

View File

@ -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.
*/

View File

@ -505,7 +505,3 @@ GThreadFunctions g_thread_jni_functions =
NULL
};
/* ??? */
void gdk_threads_wake () {
}