[kaffe] CVS kaffe (robilad): resynced with GNU Classpath: peer fixes and cleanups

Kaffe CVS cvs-commits at kaffe.org
Wed Oct 27 15:20:19 PDT 2004


PatchSet 5374 
Date: 2004/10/27 22:15:40
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
resynced with GNU Classpath: peer fixes and cleanups

2004-10-27  Dalibor Topic  <robilad at kaffe.org>

        * libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c,
        libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c,
        libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c,
        libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c,
        libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c,
        libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c,
        libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c,
        libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c,
        libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c,
        libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c,
        libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c,
        libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c,
        libraries/clib/awt/classpath-gtk/gtk-peer/gtkpeer.h:
        Resynced with GNU Classpath.

        2004-10-27  Mark Wielaard  <mark at klomp.org>

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c
        (Java_gnu_java_awt_peer_gtk_GdkTextLayout_setText): Installed and
        and renamed from Java_gnu_java_awt_peer_gtk_GdkGlyphVector_setText.

        2004-10-26  Mark Wielaard  <mark at klomp.org>

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c
        (Java_gnu_java_awt_peer_gtk_GdkGlyphVector_setText): Removed.
        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
        (init_dpi_conversion_factor): Correct prototype.

        2004-10-26  Thomas Fitzsimmons  <fitzsim at redhat.com>

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c
        (nativeSetIconImage): Rename to nativeSetIconImageFromDecoder.

        2004-10-26  Andreas Tobler  <a.tobler at schweiz.ch>

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c
        (Java_gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_nativeRun):
        Fix pointer warning.

        2004-10-26  Andreas Tobler  <a.tobler at schweiz.ch>

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
        (Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_nativeSetFilenameFilter):
        Fix pointer warning.

        * native/jni/gtk-peer/gtkpeer.h: Introduce widget_union to fix type
        punned warnings.
        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
        (Java_gnu_java_awt_peer_gtk_GdkGraphics_clearRect): Use widget_union
        to fix type punned pointer warning.
        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
        (pre_event_handler): Likewise.

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
        (window_get_new_state): Introduce unions to fix warnings as above.
        (window_property_changed_cb): Likewise.
        (window_active_state_change_cb): Mark unused variables unused.
        (window_focus_state_change_cb): Likewise.
        (window_focus_in_cb): Likewise.
        (window_focus_out_cb): Likewise.

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c
        (Java_gnu_java_awt_peer_gtk_GdkFontPeer_setFont): Convert
        PangoFontMap correctly with PANGO_FT2FONT_MAP macro.

        2004-10-26  Andreas Tobler  <a.tobler at schweiz.ch>

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
        (Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create): Use the
        GTK_TEXT_VIEW macro.

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
        (connect_awt_hook_cb): Mark unused variable unused.

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c
        (selection_get): Do the cast right.

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
        (Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create): According to
        the gtk API gtk_combo_box_new_text actually returns a GtkWidget.
        Remove unused var menu.
        (selection_changed): Remove unused value.

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
        (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_setNativeBounds): Fix pointer
        warning with using an intermediate variable.

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
        (area_updated): Fix unused var warning for BE archs.

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
        (Java_gnu_java_awt_peer_gtk_GdkGraphics_connectSignals): Remove unused
        var.
        (realize_cb): Mark unused variable unused.

        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c
        (seek_glyphstring_idx): Fix a C90 warning.

Members: 
	ChangeLog:1.2926->1.2927 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c:1.1->1.2 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c:1.5->1.6 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c:1.4->1.5 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c:1.2->1.3 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c:1.5->1.6 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c:1.2->1.3 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c:1.1->1.2 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c:1.4->1.5 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c:1.1->1.2 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c:1.4->1.5 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c:1.2->1.3 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c:1.7->1.8 
	libraries/clib/awt/classpath-gtk/gtk-peer/gtkpeer.h:1.5->1.6 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2926 kaffe/ChangeLog:1.2927
--- kaffe/ChangeLog:1.2926	Wed Oct 27 21:23:32 2004
+++ kaffe/ChangeLog	Wed Oct 27 22:15:40 2004
@@ -1,11 +1,70 @@
 2004-10-27  Dalibor Topic  <robilad at kaffe.org>
 
-	* libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c,
-	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c,
-	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c,
-	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c:
+	* libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c,
+	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c,
+	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c,
+	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c,
+	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c,
+	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c,
+	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c,
+	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c,
+	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c,
+	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c,
+	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c,
+	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c,
+	libraries/clib/awt/classpath-gtk/gtk-peer/gtkpeer.h:
 	Resynced with GNU Classpath.
 
+	2004-10-27  Mark Wielaard  <mark at klomp.org>
+
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c
+        (Java_gnu_java_awt_peer_gtk_GdkTextLayout_setText): Installed and
+        and renamed from Java_gnu_java_awt_peer_gtk_GdkGlyphVector_setText.
+
+	2004-10-26  Mark Wielaard  <mark at klomp.org>
+
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c
+        (Java_gnu_java_awt_peer_gtk_GdkGlyphVector_setText): Removed.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
+        (init_dpi_conversion_factor): Correct prototype.
+
+	2004-10-26  Thomas Fitzsimmons  <fitzsim at redhat.com>
+
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c
+        (nativeSetIconImage): Rename to nativeSetIconImageFromDecoder.
+
+	2004-10-26  Andreas Tobler  <a.tobler at schweiz.ch>
+
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c
+        (Java_gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_nativeRun):
+        Fix pointer warning.
+
+	2004-10-26  Andreas Tobler  <a.tobler at schweiz.ch>
+
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
+        (Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_nativeSetFilenameFilter):
+        Fix pointer warning.
+
+        * native/jni/gtk-peer/gtkpeer.h: Introduce widget_union to fix type
+        punned warnings.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
+        (Java_gnu_java_awt_peer_gtk_GdkGraphics_clearRect): Use widget_union
+        to fix type punned pointer warning.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
+        (pre_event_handler): Likewise.
+
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
+        (window_get_new_state): Introduce unions to fix warnings as above.
+        (window_property_changed_cb): Likewise.
+        (window_active_state_change_cb): Mark unused variables unused.
+        (window_focus_state_change_cb): Likewise.
+        (window_focus_in_cb): Likewise.
+        (window_focus_out_cb): Likewise.
+
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c
+        (Java_gnu_java_awt_peer_gtk_GdkFontPeer_setFont): Convert
+        PangoFontMap correctly with PANGO_FT2FONT_MAP macro.
+
 	2004-10-26  Andreas Tobler  <a.tobler at schweiz.ch>
 
         * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
@@ -38,6 +97,38 @@
 
         * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c
         (seek_glyphstring_idx): Fix a C90 warning.
+
+2004-10-27  Dalibor Topic  <robilad at kaffe.org>
+
+	* libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c,
+	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c,
+	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c,
+	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c:
+	Resynced with GNU Classpath.
+
+	2004-10-26  Andreas Tobler  <a.tobler at schweiz.ch>
+
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c
+        (Java_gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_nativeRun):
+        Mark unused arguments unused.
+
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c
+        (Java_gnu_java_awt_peer_gtk_GdkGlyphVector_initState),
+        (Java_gnu_java_awt_peer_gtk_GdkGlyphVector_setGlyphCodes),
+        (Java_gnu_java_awt_peer_gtk_GdkGlyphVector_glyphCharIndex),
+        (Java_gnu_java_awt_peer_gtk_GdkGlyphVector_glyphIsHorizontal):
+        Likewise.
+
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c
+        (Java_gnu_java_awt_peer_gtk_GdkFontMetrics_getPeerFontMetrics),
+        (Java_gnu_java_awt_peer_gtk_GdkFontMetrics_getPeerTextMetrics):
+        Likewise.
+
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
+        (Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_nativeSetFilenameFilter):
+        Likewise.
+        (filenameFilterCallback): Remove unused var.
+        (handle_response): Declare str_fileName and remove last else statement.
 
 2004-10-27  Dalibor Topic  <robilad at kaffe.org>
 
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c:1.1 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c:1.2
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c:1.1	Sat Oct  9 22:18:25 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c	Wed Oct 27 22:15:43 2004
@@ -114,6 +114,7 @@
   struct peerfont *pfont = NULL;
   char const *family_name = NULL;
   enum java_awt_font_style style;
+  PangoFT2FontMap *ft2_map;
 
   gdk_threads_enter ();
   style = (enum java_awt_font_style) style_int;
@@ -148,7 +149,10 @@
   if (useGraphics2D)
     {
       if (pfont->ctx == NULL)
-	pfont->ctx = pango_ft2_font_map_create_context (pango_ft2_font_map_for_display ());  
+	{
+	  ft2_map = PANGO_FT2_FONT_MAP(pango_ft2_font_map_for_display ());
+	  pfont->ctx = pango_ft2_font_map_create_context (ft2_map);
+	}
     }
   else
     {
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c:1.5 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c:1.6
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c:1.5	Sat Oct  9 22:18:25 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c	Wed Oct 27 22:15:43 2004
@@ -130,7 +130,6 @@
   (JNIEnv *env, jobject obj, jobject peer)
 {
   void *ptr;
-  jobject *gref;
 
   ptr = NSA_GET_PTR (env, peer);
 
@@ -420,13 +419,15 @@
   struct graphics *g;
   GdkGCValues saved;
   GtkWidget *widget;
+  union widget_union w;
 
   g = (struct graphics *) NSA_GET_PTR (env, obj);
 
   gdk_threads_enter ();
   if (GDK_IS_WINDOW (g->drawable))
     {
-      gdk_window_get_user_data (GDK_WINDOW (g->drawable), (void **) &widget);
+      w.widget = &widget;
+      gdk_window_get_user_data (GDK_WINDOW (g->drawable), w.void_widget);
       if (widget == NULL || !GTK_IS_EVENT_BOX (widget))
         gdk_window_clear_area ((GdkWindow *) g->drawable,
                                x + g->x_offset, y + g->y_offset,
@@ -642,7 +643,8 @@
   gdk_threads_leave ();
 }
 
-static void realize_cb (GtkWidget *widget, jobject peer)
+static void realize_cb (GtkWidget *widget __attribute__ ((unused)), 
+			jobject peer)
 {
   gdk_threads_leave ();
 
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c:1.4 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c:1.5
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c:1.4	Sat Oct  9 22:18:26 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c	Wed Oct 27 22:15:43 2004
@@ -99,14 +99,17 @@
   JNIEnv *env;
   union env_union e;
   jint stride_bytes, stride_pixels, n_channels, n_pixels;
-  int i;
   jintArray jpixels;  
   jint *java_pixels;
   guchar *gdk_pixels;
 
   GdkPixbuf *pixbuf_no_alpha = NULL;
   GdkPixbuf *pixbuf = NULL;
-  
+
+#ifndef WORDS_BIGENDIAN
+  int i;
+#endif
+
   pixbuf_no_alpha = gdk_pixbuf_loader_get_pixbuf (loader);
   if (pixbuf_no_alpha == NULL)
     return;
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c:1.2 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c:1.3
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c:1.2	Sun Oct 10 16:28:45 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c	Wed Oct 27 22:15:43 2004
@@ -65,7 +65,7 @@
   gdk_threads_leave ();
 }
 
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_setText
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkTextLayout_setText
   (JNIEnv *env, jobject self, jstring text)
 {
   struct textlayout *tl;
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c:1.5 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c:1.6
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c:1.5	Sat Oct 16 17:24:18 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c	Wed Oct 27 22:15:43 2004
@@ -279,7 +279,7 @@
 Java_gnu_java_awt_peer_gtk_GtkButtonPeer_setNativeBounds
   (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height)
 {
-  GtkWidget *widget;
+  GtkWidget *widget, *child;
   void *ptr;
 
   ptr = NSA_GET_PTR (env, obj);
@@ -292,17 +292,17 @@
      widget's natural size. */
   width = width < 0 ? 0 : width;
   height = height < 0 ? 0 : height;
+  child = gtk_bin_get_child (GTK_BIN (widget));
 
   if (!(width == 0 && height == 0))
     {
       /* Set the event box's size request... */
       gtk_widget_set_size_request (widget, width, height);
       /* ...and the button's size request... */
-      gtk_widget_set_size_request (gtk_bin_get_child (GTK_BIN (widget)),
-                                   width, height);
+      gtk_widget_set_size_request (child, width, height);
       /* ...and the label's size request. */
-      gtk_widget_set_size_request (gtk_bin_get_child (gtk_bin_get_child (GTK_BIN (widget))),
-                                                      width, height);
+      gtk_widget_set_size_request (gtk_bin_get_child (GTK_BIN (child)), width,
+						      height);
       if (widget->parent != NULL)
         gtk_fixed_move (GTK_FIXED (widget->parent), widget, x, y);
     }
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c:1.2 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c:1.3
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c:1.2	Sun Aug  8 19:45:47 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c	Wed Oct 27 22:15:43 2004
@@ -45,8 +45,7 @@
 Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create 
   (JNIEnv *env, jobject obj)
 {
-  GtkWidget *menu;
-  GtkComboBox *combobox;
+  GtkWidget *combobox;
 
   NSA_SET_GLOBAL_REF (env, obj);
 
@@ -181,7 +180,6 @@
   jstring label;
   GtkTreeModel *model;
   GtkTreeIter iter;
-  GValue value;
   gchar *selected;
   gint index;
 
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c:1.1 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c:1.2
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c:1.1	Thu Jul 22 19:04:01 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c	Wed Oct 27 22:15:43 2004
@@ -148,8 +148,8 @@
   utflen = (*gdk_env)->GetStringUTFLength (gdk_env, jstr);
   utf = (*gdk_env)->GetStringUTFChars (gdk_env, jstr, NULL);
 
-  gtk_selection_data_set (selection_data, GDK_TARGET_STRING, 8, 
-			  (char *)utf, utflen);
+  gtk_selection_data_set (selection_data, GDK_TARGET_STRING, 8,
+			  (const unsigned char*)utf, utflen);
 
   (*gdk_env)->ReleaseStringUTFChars (gdk_env, jstr, utf);
 }
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c:1.4 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c:1.5
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c:1.4	Sat Oct  9 22:18:26 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c	Wed Oct 27 22:15:43 2004
@@ -827,14 +827,16 @@
   static guint button_number = -1;
   static jint click_count = 1;
   static int hasBeenDragged;
+  union widget_union w;
 
   /* If it is not a focus change event, the widget must be realized already.
      If not, ignore the event (Gtk+ will do the same). */
   if (!(event->type == GDK_FOCUS_CHANGE || GTK_WIDGET_REALIZED(widget)))
     return FALSE;
-    
+
   /* Do not handle propagated events.  AWT has its own propagation rules */
-  gdk_window_get_user_data (event->any.window, (void **) &event_widget);
+  w.widget = &event_widget;
+  gdk_window_get_user_data (event->any.window, w.void_widget);
   if (event_widget != widget)
     return FALSE;
 
@@ -1128,7 +1130,8 @@
  * can be sure that widget->window is non-NULL, and so can have data
  * connected to it.
  */
-void connect_awt_hook_cb (GtkWidget *widget, jobject peer)
+void connect_awt_hook_cb (GtkWidget *widget __attribute__((unused)),
+			  jobject peer)
 {
   void *ptr;
 
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c:1.1 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c:1.2
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c:1.1	Mon Sep 27 17:40:58 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c	Wed Oct 27 22:15:43 2004
@@ -156,7 +156,7 @@
 }
 
 JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkFramePeer_nativeSetIconImage
+Java_gnu_java_awt_peer_gtk_GtkFramePeer_nativeSetIconImageFromDecoder
   (JNIEnv *env, jobject obj, jobject decoder)
 {
   void *ptr;
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c:1.4 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c:1.5
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c:1.4	Sat Oct  9 22:18:26 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c	Wed Oct 27 22:15:43 2004
@@ -39,7 +39,6 @@
 #include "gtkpeer.h"
 #include "gnu_java_awt_peer_gtk_GtkMainThread.h"
 #include "gthread-jni.h"
-#include "locale.h"
 
 #ifdef JVM_SUN
   struct state_table *native_state_table;
@@ -77,7 +76,7 @@
 
 double dpi_conversion_factor;
 
-static void init_dpi_conversion_factor ();
+static void init_dpi_conversion_factor (void);
 static void dpi_changed_cb (GtkSettings  *settings,
                             GParamSpec   *pspec);
 
@@ -124,7 +123,6 @@
   gdk_threads_init();
 
   gtk_init (&argc, &argv);
-  setlocale(LC_ALL, "C");
 
   gdk_rgb_init ();
   gtk_widget_set_default_colormap (gdk_rgb_get_cmap ());
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c:1.2 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c:1.3
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c:1.2	Mon Sep 27 17:40:59 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c	Wed Oct 27 22:15:43 2004
@@ -54,7 +54,7 @@
 
   text = gtk_text_view_new ();
   gtk_widget_set_size_request (text, textview_width, textview_height);
-  gtk_text_view_set_cursor_visible(text, TRUE);
+  gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW (text), TRUE);
 
   gtk_widget_show (text);
 
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c:1.7 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c:1.8
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c:1.7	Sat Oct  9 22:18:26 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c	Wed Oct 27 22:15:43 2004
@@ -1,5 +1,5 @@
 /* gtkwindowpeer.c -- Native implementation of GtkWindowPeer
-   Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2002, 2004 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -81,6 +81,19 @@
 					    GdkEventProperty *event,
 					    jobject peer);
 
+/* Union used for type punning. */
+union extents_union
+{
+  guchar **gu_extents;
+  unsigned long **extents;
+};
+
+union atom_list_union
+{
+  guchar **gu_extents;
+  Atom **atom_list;
+};
+
 JNIEXPORT void JNICALL 
 Java_gnu_java_awt_peer_gtk_GtkWindowPeer_create 
   (JNIEnv *env, jobject obj, jint type, jboolean decorated,
@@ -370,6 +383,7 @@
                           int *top, int *left, int *bottom, int *right)
 {
   unsigned long *extents = NULL;
+  union extents_union gu_ex;
 
   /* Guess frame extents in case _NET_FRAME_EXTENTS is not
      supported. */
@@ -383,6 +397,7 @@
   request_frame_extents (window);
 
   /* Attempt to retrieve window's frame extents. */
+  gu_ex.extents = &extents;
   if (gdk_property_get (window->window,
                         gdk_atom_intern ("_NET_FRAME_EXTENTS", FALSE),
                         gdk_atom_intern ("CARDINAL", FALSE),
@@ -392,7 +407,7 @@
                         NULL,
                         NULL,
                         NULL,
-                        (guchar **)&extents))
+                        gu_ex.gu_extents))
     {
       *left = extents [0];
       *right = extents [1];
@@ -413,7 +428,9 @@
 
   /* Check if the current window manager supports
      _NET_REQUEST_FRAME_EXTENTS. */
-  if (gdk_net_wm_supports (request_extents))
+  /* FIXME: The window->window != NULL check is a workaround for bug
+     http://bugzilla.gnome.org/show_bug.cgi?id=17952. */
+  if (gdk_net_wm_supports (request_extents) && window->window != NULL)
     {
       GdkDisplay *display = gtk_widget_get_display (window);
       Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
@@ -504,11 +521,12 @@
 }
 
 static void
-window_active_state_change_cb (GtkWidget *widget,
-                               GParamSpec *pspec,
-                               jobject peer)
+window_active_state_change_cb (GtkWidget *widget __attribute__((unused)),
+			       GParamSpec *pspec __attribute__((unused)),
+			       jobject peer __attribute__((unused)))
 {
   /* FIXME: not sure if this is needed or not. */
+  /* Remove the unused attributes if you fix the below.  */
 #if 0
   if (GTK_WINDOW (widget)->is_active)
     (*gdk_env)->CallVoidMethod (gdk_env, peer,
@@ -525,8 +543,8 @@
 
 static void
 window_focus_state_change_cb (GtkWidget *widget,
-                              GParamSpec *pspec,
-                              jobject peer)
+			      GParamSpec *pspec __attribute__((unused)),
+			      jobject peer)
 {
   if (GTK_WINDOW (widget)->has_toplevel_focus)
     (*gdk_env)->CallVoidMethod (gdk_env, peer,
@@ -541,9 +559,9 @@
 }
 
 static gboolean
-window_focus_in_cb (GtkWidget * widget,
-                   GdkEventFocus *event,
-                   jobject peer)
+window_focus_in_cb (GtkWidget * widget  __attribute__((unused)),
+		    GdkEventFocus *event  __attribute__((unused)),
+		    jobject peer)
 {
   (*gdk_env)->CallVoidMethod (gdk_env, peer,
                               postWindowEventID,
@@ -555,9 +573,9 @@
 }
 
 static gboolean
-window_focus_out_cb (GtkWidget * widget,
-                    GdkEventFocus *event,
-                    jobject peer)
+window_focus_out_cb (GtkWidget * widget __attribute__((unused)),
+		     GdkEventFocus *event __attribute__((unused)),
+		     jobject peer)
 {
   (*gdk_env)->CallVoidMethod (gdk_env, peer,
                               postWindowEventID,
@@ -623,12 +641,15 @@
   gulong atom_count;
   gulong bytes_after;
   Atom *atom_list = NULL;
+  union atom_list_union alu;
   gulong i;
 
-  XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (widget->window),
+  alu.atom_list = &atom_list;
+  XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), 
+		      GDK_WINDOW_XID (widget->window),
 		      gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"),
 		      0, G_MAXLONG, False, XA_ATOM, &type, &format, &atom_count,
-		      &bytes_after, (guchar **)&atom_list);
+		      &bytes_after, alu.gu_extents);
 
   if (type != None)
     {
@@ -657,6 +678,7 @@
                             jobject peer)
 {
   unsigned long *extents;
+  union extents_union gu_ex;
 
   static int id_set = 0;
   static jmethodID postInsetsChangedEventID;
@@ -671,7 +693,7 @@
 						      "(IIII)V");
       id_set = 1;
     }
-
+  gu_ex.extents = &extents;
   if (gdk_atom_intern ("_NET_FRAME_EXTENTS", FALSE) == event->atom
       && gdk_property_get (event->window,
                            gdk_atom_intern ("_NET_FRAME_EXTENTS", FALSE),
@@ -682,7 +704,7 @@
                            NULL,
                            NULL,
                            NULL,
-                           (guchar **)&extents))
+                           gu_ex.gu_extents))
     (*gdk_env)->CallVoidMethod (gdk_env, peer,
 				postInsetsChangedEventID,
 				(jint) extents[2],  /* top */
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gtkpeer.h
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gtkpeer.h:1.5 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gtkpeer.h:1.6
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gtkpeer.h:1.5	Sat Oct  9 22:18:26 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gtkpeer.h	Wed Oct 27 22:15:44 2004
@@ -486,6 +486,13 @@
   const char *label;
 };
 
+/* Union used for type punning. */
+union widget_union
+{
+  void **void_widget;
+  GtkWidget **widget;
+};
+
 #define DEBUG_LOCKING 0
 
 #if DEBUG_LOCKING




More information about the kaffe mailing list