GtkButtonPeer.java: Call getName rather than getXLFD.

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
This commit is contained in:
Thomas Fitzsimmons 2003-07-29 19:42:37 +00:00 committed by Thomas Fitzsimmons
parent 52c0c542ae
commit 5596e92fd8
7 changed files with 30 additions and 12 deletions

View 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

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

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

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

View 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();

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

View 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();