GtkButtonPeer.java: Call getName rather than getXLFD.
authorThomas Fitzsimmons <fitzsim@redhat.com>
Tue, 29 Jul 2003 19:42:37 +0000 (19:42 +0000)
committerThomas Fitzsimmons <fitzsim@gcc.gnu.org>
Tue, 29 Jul 2003 19:42:37 +0000 (19:42 +0000)
2003-07-29  Thomas Fitzsimmons  <fitzsim@redhat.com>

* gnu/java/awt/peer/gtk/GtkButtonPeer.java: Call getName rather
than getXLFD.
* gnu/java/awt/peer/gtk/GtkTextFieldPeer.java: Likewise.
* gnu/java/awt/peer/gtk/GtkTextAreaPeer.java: Likewise.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
(gtkSetFont): Scale size parameter by PANGO_SCALE.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c:
Likewise.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c:
Likewise.

From-SVN: r69936

libjava/ChangeLog
libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java
libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java
libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java
libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c

index ea7d7c7e6c5c1c6f661f7d97a6e3c6610ce1ef3e..51626bd0cbb8edddcbc1dcdd043d356814a996d5 100644 (file)
@@ -1,3 +1,16 @@
+2003-07-29  Thomas Fitzsimmons  <fitzsim@redhat.com>
+
+       * gnu/java/awt/peer/gtk/GtkButtonPeer.java: Call getName rather
+       than getXLFD.
+       * gnu/java/awt/peer/gtk/GtkTextFieldPeer.java: Likewise.
+       * gnu/java/awt/peer/gtk/GtkTextAreaPeer.java: Likewise.
+       * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
+       (gtkSetFont): Scale size parameter by PANGO_SCALE.
+       * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c:
+       Likewise.
+       * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c:
+       Likewise.
+
 2003-07-29  Tom Tromey  <tromey@redhat.com>
 
        * defineclass.cc (handleField): Throw exception if field name is
index 0aa42f5307a33c4f897adcc270dae38b1be9a856..830b9f08f8b498658e41ca3713423488b45f2769 100644 (file)
@@ -95,6 +95,6 @@ public class GtkButtonPeer extends GtkComponentPeer
 
   public void setFont (Font f)
   {
-    gtkSetFont(((GtkFontPeer)f.getPeer()).getXLFD(), f.getSize());
+    gtkSetFont(f.getName(), f.getSize());
   }
 }
index 7fdbac0aa99cd1936a3754914b0167abb82dfa07..b8973fdca9554c69b541470bf82cf4c19d796b79 100644 (file)
@@ -107,6 +107,6 @@ public class GtkTextAreaPeer extends GtkTextComponentPeer
 
   public void setFont (Font f)
   {
-    gtkSetFont(((GtkFontPeer)f.getPeer()).getXLFD(), f.getSize());
+    gtkSetFont(f.getName(), f.getSize());
   }
 }
index efc3ff7c58a6511bf1ec076ec6c454e3bd2f2765..20f61aa81e0a0f3cd6c2767e9e4112c6799f6acd 100644 (file)
@@ -104,7 +104,7 @@ public class GtkTextFieldPeer extends GtkTextComponentPeer
 
   public void setFont (Font f)
   {
-    gtkSetFont(((GtkFontPeer)f.getPeer()).getXLFD(), f.getSize());
+    gtkSetFont(f.getName(), f.getSize());
   }
 
   public void handleEvent (AWTEvent e)
index e87a9c4d7f08da34c524e62175f6f1d3902862e7..110b01974d9437a3c2e0ae3ab37a6d17af50c8a4 100644 (file)
@@ -42,11 +42,11 @@ exception statement from your version. */
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkButtonPeer_create
   (JNIEnv *env, jobject obj)
 {
-  GtkButton *button;
+  GtkWidget *button;
 
   gdk_threads_enter ();
   button = gtk_button_new();
-  gtk_widget_show (GTK_WIDGET(button));
+  gtk_widget_show (button);
   gdk_threads_leave ();
   NSA_SET_PTR (env, obj, button);
 }
@@ -74,8 +74,10 @@ Java_gnu_java_awt_peer_gtk_GtkButtonPeer_gtkSetFont
   gdk_threads_enter();
 
   font_desc = pango_font_description_from_string (font_name);
-  pango_font_description_set_size (font_desc, size);
+  pango_font_description_set_size (font_desc, size * PANGO_SCALE);
+
   gtk_widget_modify_font (GTK_WIDGET(label), font_desc);
+
   pango_font_description_free (font_desc);
 
   gdk_threads_leave();
index 103ddd22a9ae82bbaa538c495ef33034f49009b9..3ebe2ab28494a2478f023e9f14755864e54735ac 100644 (file)
@@ -170,18 +170,19 @@ Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_gtkSetFont
 
   ptr = NSA_GET_PTR (env, obj);
   text = GTK_WIDGET (TEXT_FROM_SW (ptr));
-  
+
   font_name = (*env)->GetStringUTFChars (env, jname, NULL);
 
   gdk_threads_enter();
 
   font_desc = pango_font_description_from_string (font_name);
-  pango_font_description_set_size (font_desc, size);
+  pango_font_description_set_size (font_desc, size * PANGO_SCALE);
+
   gtk_widget_modify_font (GTK_WIDGET(text), font_desc);
+
   pango_font_description_free (font_desc);
-  
+
   gdk_threads_leave();
 
   (*env)->ReleaseStringUTFChars (env, jname, font_name);
-
 }
index 7836bb34a6349335fa3a5e09e07d6c51adde5c37..d08934842ef8d0f1072e9e898231c23a7e1ac98a 100644 (file)
@@ -110,15 +110,17 @@ Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_gtkSetFont
   PangoFontDescription *font_desc;
 
   ptr = NSA_GET_PTR (env, obj);
-  
+
   entry = GTK_WIDGET (ptr);
   font_name = (*env)->GetStringUTFChars (env, jname, NULL);
 
   gdk_threads_enter();
 
   font_desc = pango_font_description_from_string (font_name);
-  pango_font_description_set_size (font_desc, size);
+  pango_font_description_set_size (font_desc, size * PANGO_SCALE);
+
   gtk_widget_modify_font (GTK_WIDGET(entry), font_desc);
+
   pango_font_description_free (font_desc);
 
   gdk_threads_leave();