[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: fixes for size requests in AWT backend

Kaffe CVS cvs-commits at kaffe.org
Sat Oct 16 10:28:07 PDT 2004


PatchSet 5303 
Date: 2004/10/16 17:24:16
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: fixes for size requests in AWT backend

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

        * 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_GtkComponentPeer.c,
        libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c,
        libraries/javalib/gnu/java/awt/peer/gtk/GtkButtonPeer.java,
        libraries/javalib/gnu/java/awt/peer/gtk/GtkComponentPeer.java,
        libraries/javalib/gnu/java/awt/peer/gtk/GtkLabelPeer.java:
        Resynced with GNU Classpath.

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

        * gnu/java/awt/peer/gtk/GtkButtonPeer.java,
        jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
        (setNativeBounds): Set GtkEventBox, GtkButton and GtkLabel size
        requests.
        * gnu/java/awt/peer/gtk/GtkComponentPeer.java,
        jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
        (setNativeBounds): Make package private.  Set size request even
        if GTK parent is NULL.
        * gnu/java/awt/peer/gtk/GtkLabelPeer.java,
        jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c
        (setNativeBounds): Set GtkEventBox and GtkLabel size requests.

Members: 
	ChangeLog:1.2855->1.2856 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c:1.4->1.5 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c:1.5->1.6 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c:1.2->1.3 
	libraries/javalib/gnu/java/awt/peer/gtk/GtkButtonPeer.java:1.5->1.6 
	libraries/javalib/gnu/java/awt/peer/gtk/GtkComponentPeer.java:1.5->1.6 
	libraries/javalib/gnu/java/awt/peer/gtk/GtkLabelPeer.java:1.2->1.3 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2855 kaffe/ChangeLog:1.2856
--- kaffe/ChangeLog:1.2855	Sat Oct 16 16:06:49 2004
+++ kaffe/ChangeLog	Sat Oct 16 17:24:16 2004
@@ -1,5 +1,29 @@
 2004-10-16  Dalibor Topic <robilad at kaffe.org>
 
+	* 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_GtkComponentPeer.c,
+	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c,
+	libraries/javalib/gnu/java/awt/peer/gtk/GtkButtonPeer.java,
+	libraries/javalib/gnu/java/awt/peer/gtk/GtkComponentPeer.java,
+	libraries/javalib/gnu/java/awt/peer/gtk/GtkLabelPeer.java:
+	Resynced with GNU Classpath.
+
+	2004-10-16  Thomas Fitzsimmons  <fitzsim at redhat.com>
+
+        * gnu/java/awt/peer/gtk/GtkButtonPeer.java,
+        jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
+        (setNativeBounds): Set GtkEventBox, GtkButton and GtkLabel size
+        requests.
+        * gnu/java/awt/peer/gtk/GtkComponentPeer.java,
+        jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
+        (setNativeBounds): Make package private.  Set size request even
+        if GTK parent is NULL.
+        * gnu/java/awt/peer/gtk/GtkLabelPeer.java,
+        jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c
+        (setNativeBounds): Set GtkEventBox and GtkLabel size requests.
+
+2004-10-16  Dalibor Topic <robilad at kaffe.org>
+
 	* libraries/javalib/java/rmi/RMISecurityManager.java:
 	Replaced by implementation from GNU Classpath.
 
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.4 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.4	Sat Oct  9 22:18:26 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c	Sat Oct 16 17:24:18 2004
@@ -275,6 +275,41 @@
   gdk_threads_leave ();
 }
 
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkButtonPeer_setNativeBounds
+  (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height)
+{
+  GtkWidget *widget;
+  void *ptr;
+
+  ptr = NSA_GET_PTR (env, obj);
+
+  gdk_threads_enter ();
+
+  widget = GTK_WIDGET (ptr);
+
+  /* We assume that -1 is a width or height and not a request for the
+     widget's natural size. */
+  width = width < 0 ? 0 : width;
+  height = height < 0 ? 0 : height;
+
+  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);
+      /* ...and the label's size request. */
+      gtk_widget_set_size_request (gtk_bin_get_child (gtk_bin_get_child (GTK_BIN (widget))),
+                                                      width, height);
+      if (widget->parent != NULL)
+        gtk_fixed_move (GTK_FIXED (widget->parent), widget, x, y);
+    }
+
+  gdk_threads_leave ();
+}
+
 static gboolean
 focus_in_cb (GtkWidget *widget __attribute((unused)),
              GdkEventFocus *event __attribute((unused)),
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c:1.5 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c:1.6
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c:1.5	Sat Oct  9 22:18:26 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c	Sat Oct 16 17:24:18 2004
@@ -794,19 +794,18 @@
   width = width < 0 ? 0 : width;
   height = height < 0 ? 0 : height;
 
-  if (widget->parent != NULL)
+  if (GTK_IS_VIEWPORT (widget->parent))
+    gtk_widget_set_size_request (widget, width, height);
+  else
     {
-      if (GTK_IS_VIEWPORT (widget->parent))
-        gtk_widget_set_size_request (widget, width, height);
-      else
+      if (!(width == 0 && height == 0))
         {
-          if (!(width == 0 && height == 0))
-            {
-              gtk_widget_set_size_request (widget, width, height);
-              gtk_fixed_move (GTK_FIXED (widget->parent), widget, x, y);
-            }
+          gtk_widget_set_size_request (widget, width, height);
+          if (widget->parent != NULL)
+            gtk_fixed_move (GTK_FIXED (widget->parent), widget, x, y);
         }
     }
+
   gdk_threads_leave ();
 }
 
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c:1.2 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c:1.3
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c:1.2	Mon Sep 27 17:40:58 2004
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c	Sat Oct 16 17:24:18 2004
@@ -144,3 +144,36 @@
 
   gdk_threads_leave ();
 }
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkLabelPeer_setNativeBounds
+  (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height)
+{
+  GtkWidget *widget;
+  void *ptr;
+
+  ptr = NSA_GET_PTR (env, obj);
+
+  gdk_threads_enter ();
+
+  widget = GTK_WIDGET (ptr);
+
+  /* We assume that -1 is a width or height and not a request for the
+     widget's natural size. */
+  width = width < 0 ? 0 : width;
+  height = height < 0 ? 0 : height;
+
+  if (!(width == 0 && height == 0))
+    {
+      /* Set the event box's size request... */
+      gtk_widget_set_size_request (widget, width, height);
+      /* ...and the label's size request. */
+      gtk_widget_set_size_request (gtk_bin_get_child (GTK_BIN (widget)),
+                                   width, height);
+
+      if (widget->parent != NULL)
+        gtk_fixed_move (GTK_FIXED (widget->parent), widget, x, y);
+    }
+
+  gdk_threads_leave ();
+}
Index: kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkButtonPeer.java
diff -u kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkButtonPeer.java:1.5 kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkButtonPeer.java:1.6
--- kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkButtonPeer.java:1.5	Sat Oct  9 22:18:50 2004
+++ kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkButtonPeer.java	Sat Oct 16 17:24:18 2004
@@ -60,6 +60,7 @@
   native void gtkWidgetSetBackground (int red, int green, int blue);
   native void gtkActivate ();
   native void gtkWidgetRequestFocus ();
+  native void setNativeBounds (int x, int y, int width, int height);
 
   public GtkButtonPeer (Button b)
   {
Index: kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkComponentPeer.java
diff -u kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkComponentPeer.java:1.5 kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkComponentPeer.java:1.6
--- kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkComponentPeer.java:1.5	Sat Oct  9 22:18:50 2004
+++ kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkComponentPeer.java	Sat Oct 16 17:24:18 2004
@@ -403,7 +403,7 @@
     gtkWidgetSetBackground (c.getRed(), c.getGreen(), c.getBlue());
   }
 
-  native public void setNativeBounds (int x, int y, int width, int height);
+  native void setNativeBounds (int x, int y, int width, int height);
 
   public void setBounds (int x, int y, int width, int height)
   {
Index: kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkLabelPeer.java
diff -u kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkLabelPeer.java:1.2 kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkLabelPeer.java:1.3
--- kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkLabelPeer.java:1.2	Mon Sep 27 17:41:04 2004
+++ kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkLabelPeer.java	Sat Oct 16 17:24:19 2004
@@ -51,6 +51,7 @@
   native void nativeSetAlignment (float alignment);
 
   native public void setText (String text);
+  native void setNativeBounds (int x, int y, int width, int height);
 
   void create ()
   {




More information about the kaffe mailing list