This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
FYI: committed --enable-gtk-cairo patch
- From: graydon hoare <graydon at redhat dot com>
- To: java-patches at gcc dot gnu dot org
- Date: Wed, 31 Dec 2003 04:11:53 -0500
- Subject: FYI: committed --enable-gtk-cairo patch
Hi,
I've just committed this (slightly revised) version of the
--enable-gtk-cairo patch I posted for comments a couple weeks back. The
changes mostly have to do with configury: now it uses PKG_CHECK_MODULES
(hence pkg-config) to find cairo/libpixman, and work out its link flags.
Otherwise just minor typos fixed as suggested.
-graydon
2003-12-16 Graydon Hoare <graydon@redhat.com>
* configure.in: Add --enable-gtk-cairo check.
* configure: Regenerate.
* Makefile.am: Conditionally link against cairo.
* Makefile.in: Regenerate.
* acinclude.m4: Include PKG_CHECK_MODULES.
* aclocal.m4: Regenerate.
* gnu/java/awt/peer/gtk/GtkToolkit.java (useGraphics2D): New method.
(getFontMetrics, getClasspathFontPeer):
* gnu/java/awt/peer/gtk/GtkCanvasPeer.java (getGraphics):
* gnu/java/awt/peer/gtk/GtkComponentPeer.java (createImage):
* gnu/java/awt/peer/gtk/GtkContainerPeer.java (getGraphics):
* gnu/java/awt/peer/gtk/GtkFramePeer.java (getGraphics):
Switch behavior depending on GtkToolkit.useGraphics2D().
* gnu/java/awt/peer/gtk/GtkFontPeer.java: Extend ClasspathFontPeer.
* java/awt/Font.java: Switch to peer model.
* jni/gtk-peer/gtkcairopeer.h: Definitions of cairo stuff.
* jni/gtk-peer/gdkfont.h: Include gtkcairopeer.h.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c: Include
gtkcairopeer.h.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeerMetrics.c:
Un-include gtkpeer.h.
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libjava/configure.in,v
retrieving revision 1.176
diff -u -b -w -r1.176 configure.in
--- configure.in 2 Dec 2003 22:26:45 -0000 1.176
+++ configure.in 31 Dec 2003 08:57:51 -0000
@@ -405,6 +405,18 @@
AM_CONDITIONAL(XLIB_AWT, test "$use_xlib_awt" = yes)
AM_CONDITIONAL(GTK_AWT, test "$use_gtk_awt" = yes)
+dnl determine whether to enable the cairo GTK Graphics2D backend
+AC_ARG_ENABLE(gtk-cairo, [ --enable-gtk-cairo build the cairo Graphics2D implementation on GTK])
+AM_CONDITIONAL(GTK_CAIRO, test "x${enable_gtk_cairo}" = xyes)
+if test "x${enable_gtk_cairo}" = xyes
+then
+ PKG_CHECK_MODULES(CAIRO, cairo)
+ PKG_CHECK_MODULES(PANGOFT2, pangoft2)
+fi
+AC_SUBST(CAIRO_LIBS)
+AC_SUBST(CAIRO_CFLAGS)
+AC_SUBST(PANGOFT2_LIBS)
+AC_SUBST(PANGOFT2_CFLAGS)
dnl FIXME: this should be _libs on some hosts.
libsubdir=.libs
Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Makefile.am,v
retrieving revision 1.349
diff -u -b -w -r1.349 Makefile.am
--- Makefile.am 28 Dec 2003 21:30:44 -0000 1.349
+++ Makefile.am 31 Dec 2003 08:57:53 -0000
@@ -168,8 +168,20 @@
-version-info `grep -v '^\#' $(srcdir)/libtool-version`
libgcj_la_LINK = $(LIBLINK)
+# Gtk/Cairo JNI sources.
+if GTK_CAIRO
+gtk_cairo_c_source_files = \
+jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeer.c \
+jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeerMetrics.c \
+jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c \
+jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
+else
+gtk_cairo_c_source_files =
+endif
+
## Gtk JNI sources.
gtk_c_source_files = \
+$(gtk_cairo_c_source_files) \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c \
@@ -207,8 +219,12 @@
## Java sources for Gtk peers.
gtk_awt_peer_sources = \
+gnu/java/awt/peer/gtk/GdkClasspathFontPeer.java \
+gnu/java/awt/peer/gtk/GdkClasspathFontPeerMetrics.java \
gnu/java/awt/peer/gtk/GdkFontMetrics.java \
+gnu/java/awt/peer/gtk/GdkGlyphVector.java \
gnu/java/awt/peer/gtk/GdkGraphics.java \
+gnu/java/awt/peer/gtk/GdkGraphics2D.java \
gnu/java/awt/peer/gtk/GdkPixbufDecoder.java \
gnu/java/awt/peer/gtk/GtkArg.java \
gnu/java/awt/peer/gtk/GtkArgList.java \
@@ -264,7 +280,7 @@
jni/classpath/native_state.h \
jni/classpath/primlib.h
-lib_gnu_java_awt_peer_gtk_la_LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(LIBART_LIBS)
+lib_gnu_java_awt_peer_gtk_la_LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(LIBART_LIBS) $(CAIRO_LIBS) $(PANGOFT2_LIBS)
lib_org_w3c_dom_la_SOURCES = org/w3c/dom/Attr.java \
org/w3c/dom/CDATASection.java \
@@ -430,7 +446,8 @@
## FIXME: see above
$(gtk_c_files): %.lo: %.c
- $(LTCOMPILE) -c -Ijniinclude -I$(srcdir)/jni/classpath -I$(srcdir)/jni/gtk-peer $(GTK_CFLAGS) $(LIBART_CFLAGS) -o $@ $<
+ $(LTCOMPILE) -c -Ijniinclude -I$(srcdir)/jni/classpath -I$(srcdir)/jni/gtk-peer \
+ $(GTK_CFLAGS) $(LIBART_CFLAGS) $(CAIRO_LIBS) $(PANGOFT2_LIBS) -o $@ $<
$(gtk_c_files): $(gtk_c_headers)
@@ -604,7 +621,6 @@
$(INSTALL_DATA) 'java/lang/reflect/Proxy$$ProxyType.h' $(DESTDIR)$(includedir)/java/lang/reflect/
$(INSTALL_DATA) 'gnu/java/net/PlainSocketImpl$$SocketInputStream.h' $(DESTDIR)$(includedir)/gnu/java/net/
$(INSTALL_DATA) 'gnu/java/net/PlainSocketImpl$$SocketOutputStream.h' $(DESTDIR)$(includedir)/gnu/java/net/
-
$(INSTALL_DATA) $(srcdir)/java/util/logging/logging.properties $(DESTDIR)$(propdir)/logging.properties
## ################################################################
@@ -833,6 +849,7 @@
gnu/java/awt/BitMaskExtent.java \
gnu/java/awt/Buffers.java \
gnu/java/awt/ComponentDataBlitOp.java \
+gnu/java/awt/ClasspathToolkit.java \
gnu/java/awt/EmbeddedWindow.java \
gnu/java/awt/EmbeddedWindowSupport.java \
gnu/java/awt/EventModifier.java \
@@ -840,6 +857,7 @@
gnu/java/awt/image/XBMDecoder.java \
gnu/java/awt/peer/EmbeddedWindowPeer.java \
gnu/java/awt/peer/GLightweightPeer.java \
+gnu/java/awt/peer/ClasspathFontPeer.java \
gnu/java/beans/editors/ColorEditor.java \
gnu/java/beans/editors/FontEditor.java \
gnu/java/beans/editors/NativeBooleanEditor.java \
Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libjava/acinclude.m4,v
retrieving revision 1.25
diff -u -b -w -r1.25 acinclude.m4
--- acinclude.m4 24 Sep 2003 05:39:23 -0000 1.25
+++ acinclude.m4 31 Dec 2003 08:57:54 -0000
@@ -268,3 +268,60 @@
[Indicate that linker is not able to 8-byte align static data])
fi[]dnl
])# CHECK_FOR_BROKEN_MINGW_LD
+
+dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
+dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
+dnl also defines GSTUFF_PKG_ERRORS on error
+AC_DEFUN(PKG_CHECK_MODULES, [
+ succeeded=no
+
+ if test -z "$PKG_CONFIG"; then
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+ fi
+
+ if test "$PKG_CONFIG" = "no" ; then
+ echo "*** The pkg-config script could not be found. Make sure it is"
+ echo "*** in your path, or set the PKG_CONFIG environment variable"
+ echo "*** to the full path to pkg-config."
+ echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
+ else
+ PKG_CONFIG_MIN_VERSION=0.9.0
+ if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
+ AC_MSG_CHECKING(for $2)
+
+ if $PKG_CONFIG --exists "$2" ; then
+ AC_MSG_RESULT(yes)
+ succeeded=yes
+
+ AC_MSG_CHECKING($1_CFLAGS)
+ $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
+ AC_MSG_RESULT($$1_CFLAGS)
+
+ AC_MSG_CHECKING($1_LIBS)
+ $1_LIBS=`$PKG_CONFIG --libs "$2"`
+ AC_MSG_RESULT($$1_LIBS)
+ else
+ $1_CFLAGS=""
+ $1_LIBS=""
+ ## If we have a custom action on failure, don't print errors, but
+ ## do set a variable so people can do so.
+ $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+ ifelse([$4], ,echo $$1_PKG_ERRORS,)
+ fi
+
+ AC_SUBST($1_CFLAGS)
+ AC_SUBST($1_LIBS)
+ else
+ echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
+ echo "*** See http://www.freedesktop.org/software/pkgconfig"
+ fi
+ fi
+
+ if test $succeeded = yes; then
+ ifelse([$3], , :, [$3])
+ else
+ ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
+ fi
+])
+
+
Index: gnu/java/awt/peer/gtk/GtkToolkit.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java,v
retrieving revision 1.5
diff -u -b -w -r1.5 GtkToolkit.java
--- gnu/java/awt/peer/gtk/GtkToolkit.java 12 Nov 2003 22:03:49 -0000 1.5
+++ gnu/java/awt/peer/gtk/GtkToolkit.java 31 Dec 2003 08:57:54 -0000
@@ -42,6 +42,7 @@
import java.awt.datatransfer.Clipboard;
import java.awt.dnd.DragGestureEvent;
import java.awt.dnd.peer.DragSourceContextPeer;
+import java.awt.font.TextAttribute;
import java.awt.im.InputMethodHighlight;
import java.awt.image.ColorModel;
import java.awt.image.ImageObserver;
@@ -55,6 +56,7 @@
import gnu.java.awt.EmbeddedWindow;
import gnu.java.awt.EmbeddedWindowSupport;
import gnu.java.awt.peer.EmbeddedWindowPeer;
+import gnu.java.awt.peer.ClasspathFontPeer;
import gnu.classpath.Configuration;
import gnu.java.awt.peer.gtk.GdkPixbufDecoder;
@@ -65,7 +67,15 @@
this class. If getPeer() ever goes away, we can implement a hash table
that will keep up with every window's peer, but for now this is faster. */
-public class GtkToolkit extends Toolkit
+/**
+ * This class accesses a system property called
+ * <tt>gnu.java.awt.peer.gtk.Graphics</tt>. If the property is defined and
+ * equal to "Graphics2D", the cairo-based GdkGraphics2D will be used in
+ * drawing contexts. Any other value will cause the older GdkGraphics
+ * object to be used.
+ */
+
+public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
implements EmbeddedWindowSupport
{
GtkMainThread main;
@@ -73,6 +83,19 @@
static EventQueue q = new EventQueue();
static Clipboard systemClipboard;
+ static boolean useGraphics2dSet;
+ static boolean useGraphics2d;
+
+ public static boolean useGraphics2D()
+ {
+ if (useGraphics2dSet)
+ return useGraphics2d;
+ useGraphics2d = System.getProperty("gnu.java.awt.peer.gtk.Graphics",
+ "Graphics").equals("Graphics2D");
+ useGraphics2dSet = true;
+ return useGraphics2d;
+ }
+
static
{
if (Configuration.INIT_LOAD_LIBRARY)
@@ -135,6 +158,9 @@
public FontMetrics getFontMetrics (Font font)
{
+ if (useGraphics2D())
+ return new GdkClasspathFontPeerMetrics (font);
+ else
return new GdkFontMetrics (font);
}
@@ -322,6 +348,11 @@
return new GtkEmbeddedWindowPeer (w);
}
+ /**
+ * @deprecated part of the older "logical font" system in earlier AWT
+ * implementations. Our newer Font class uses getClasspathFontPeer.
+ */
+
protected FontPeer getFontPeer (String name, int style)
{
try {
@@ -332,6 +363,38 @@
}
}
+ /**
+ * Newer method to produce a peer for a Font object, even though Sun's
+ * design claims Font should now be peerless, we do not agree with this
+ * model, hence "ClasspathFontPeer".
+ */
+
+ public ClasspathFontPeer getClasspathFontPeer (String name, Map attrs)
+ {
+ if (useGraphics2D())
+ return new GdkClasspathFontPeer (name, attrs);
+ else
+ {
+ int style = Font.PLAIN;
+
+ if (attrs.containsKey (TextAttribute.WEIGHT))
+ {
+ Float weight = (Float) attrs.get (TextAttribute.WEIGHT);
+ if (weight.floatValue () >= TextAttribute.WEIGHT_BOLD.floatValue ())
+ style += Font.BOLD;
+ }
+
+ if (attrs.containsKey (TextAttribute.POSTURE))
+ {
+ Float posture = (Float) attrs.get (TextAttribute.POSTURE);
+ if (posture.floatValue () >= TextAttribute.POSTURE_OBLIQUE.floatValue ())
+ style += Font.ITALIC;
+ }
+
+ return (ClasspathFontPeer) this.getFontPeer (name, style);
+ }
+ }
+
protected EventQueue getSystemEventQueueImpl()
{
return q;
@@ -350,4 +413,18 @@
{
throw new Error("not implemented");
}
+
+ // ClasspathToolkit methods
+
+ public GraphicsEnvironment getLocalGraphicsEnvironment()
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ public Font createFont(int format, java.io.InputStream stream)
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+
} // class GtkToolkit
Index: gnu/java/awt/peer/gtk/GtkCanvasPeer.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/awt/peer/gtk/GtkCanvasPeer.java,v
retrieving revision 1.2
diff -u -b -w -r1.2 GtkCanvasPeer.java
--- gnu/java/awt/peer/gtk/GtkCanvasPeer.java 13 Jul 2003 15:09:20 -0000 1.2
+++ gnu/java/awt/peer/gtk/GtkCanvasPeer.java 31 Dec 2003 08:57:54 -0000
@@ -56,6 +56,9 @@
public Graphics getGraphics ()
{
+ if (GtkToolkit.useGraphics2D ())
+ return new GdkGraphics2D (this);
+ else
return new GdkGraphics (this);
}
Index: gnu/java/awt/peer/gtk/GtkComponentPeer.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java,v
retrieving revision 1.10
diff -u -b -w -r1.10 GtkComponentPeer.java
--- gnu/java/awt/peer/gtk/GtkComponentPeer.java 11 Dec 2003 13:50:50 -0000 1.10
+++ gnu/java/awt/peer/gtk/GtkComponentPeer.java 31 Dec 2003 08:57:54 -0000
@@ -48,6 +48,7 @@
import java.awt.FontMetrics;
import java.awt.Frame;
import java.awt.Graphics;
+import java.awt.Graphics2D;
import java.awt.GraphicsConfiguration;
import java.awt.Image;
import java.awt.Insets;
@@ -148,7 +149,16 @@
public Image createImage (int width, int height)
{
- GdkGraphics g = new GdkGraphics (width, height);
+ Graphics g;
+ if (GtkToolkit.useGraphics2D ())
+ {
+ Graphics2D g2 = new GdkGraphics2D (width, height);
+ g2.setBackground (getBackground ());
+ g = g2;
+ }
+ else
+ g = new GdkGraphics (width, height);
+
return new GtkOffScreenImage (null, g, width, height);
}
Index: gnu/java/awt/peer/gtk/GtkContainerPeer.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java,v
retrieving revision 1.5
diff -u -b -w -r1.5 GtkContainerPeer.java
--- gnu/java/awt/peer/gtk/GtkContainerPeer.java 17 Dec 2003 17:20:00 -0000 1.5
+++ gnu/java/awt/peer/gtk/GtkContainerPeer.java 31 Dec 2003 08:57:54 -0000
@@ -92,6 +92,9 @@
public Graphics getGraphics ()
{
+ if (GtkToolkit.useGraphics2D ())
+ return new GdkGraphics2D (this);
+ else
return new GdkGraphics (this);
}
Index: gnu/java/awt/peer/gtk/GtkFramePeer.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java,v
retrieving revision 1.6
diff -u -b -w -r1.6 GtkFramePeer.java
--- gnu/java/awt/peer/gtk/GtkFramePeer.java 9 Oct 2003 00:26:29 -0000 1.6
+++ gnu/java/awt/peer/gtk/GtkFramePeer.java 31 Dec 2003 08:57:54 -0000
@@ -41,6 +41,7 @@
import java.awt.Component;
import java.awt.Frame;
import java.awt.Graphics;
+import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Insets;
import java.awt.MenuBar;
@@ -109,8 +110,12 @@
public Graphics getGraphics ()
{
- GdkGraphics g = new GdkGraphics (this);
- g.translateNative (-insets.left, -insets.top);
+ Graphics g;
+ if (GtkToolkit.useGraphics2D ())
+ g = new GdkGraphics2D (this);
+ else
+ g = new GdkGraphics (this);
+ g.translate (-insets.left, -insets.top);
return g;
}
Index: gnu/java/awt/peer/gtk/GtkFontPeer.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java,v
retrieving revision 1.2
diff -u -b -w -r1.2 GtkFontPeer.java
--- gnu/java/awt/peer/gtk/GtkFontPeer.java 19 Feb 2003 00:35:35 -0000 1.2
+++ gnu/java/awt/peer/gtk/GtkFontPeer.java 31 Dec 2003 08:57:54 -0000
@@ -38,10 +38,15 @@
package gnu.java.awt.peer.gtk;
import java.awt.peer.FontPeer;
-import java.awt.Font;
+import java.awt.*;
+import java.awt.geom.*;
+import java.awt.font.*;
+import java.util.Locale;
import java.util.ResourceBundle;
+import java.text.*;
+import gnu.java.awt.peer.ClasspathFontPeer;
-public class GtkFontPeer implements FontPeer
+public class GtkFontPeer extends ClasspathFontPeer
{
private static ResourceBundle bundle;
@@ -61,6 +66,8 @@
public GtkFontPeer (String name, int style)
{
+ super(name, style, 12 /* kludge */);
+
if (bundle != null)
Xname = bundle.getString (name.toLowerCase () + "." + style);
else
@@ -90,5 +97,105 @@
public String getXLFD ()
{
return Xname;
+ }
+
+
+ /* remaining methods are for static compatibility with the newer
+ ClasspathFontPeer superclass; none of these methods ever existed or
+ worked on the older FontPeer interface, but we need to pretend to
+ support them anyways. */
+
+ public boolean canDisplay (Font font, char c)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public int canDisplayUpTo (Font font, CharacterIterator i, int start, int limit)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getSubFamilyName (Font font, Locale locale)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getPostScriptName (Font font)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public int getNumGlyphs (Font font)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public int getMissingGlyphCode (Font font)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public byte getBaselineFor (Font font, char c)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getGlyphName (Font font, int glyphIndex)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public GlyphVector createGlyphVector (Font font,
+ FontRenderContext frc,
+ CharacterIterator ci)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public GlyphVector createGlyphVector (Font font,
+ FontRenderContext ctx,
+ int[] glyphCodes)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public GlyphVector layoutGlyphVector (Font font,
+ FontRenderContext frc,
+ char[] chars, int start,
+ int limit, int flags)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public FontMetrics getFontMetrics (Font font)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean hasUniformLineMetrics (Font font)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public LineMetrics getLineMetrics (Font font,
+ CharacterIterator ci,
+ int begin, int limit,
+ FontRenderContext rc)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Rectangle2D getMaxCharBounds (Font font,
+ FontRenderContext rc)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Rectangle2D getStringBounds (Font font,
+ CharacterIterator ci,
+ int begin, int limit,
+ FontRenderContext frc)
+ {
+ throw new UnsupportedOperationException();
}
}
Index: java/awt/Font.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/Font.java,v
retrieving revision 1.15
diff -u -b -w -r1.15 Font.java
--- java/awt/Font.java 11 Nov 2003 12:22:18 -0000 1.15
+++ java/awt/Font.java 31 Dec 2003 08:57:54 -0000
@@ -42,6 +42,7 @@
import java.awt.font.GlyphVector;
import java.awt.font.LineMetrics;
import java.awt.font.TextAttribute;
+import java.awt.font.TransformAttribute;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import java.awt.peer.FontPeer;
@@ -50,15 +51,21 @@
import java.io.Serializable;
import java.util.Locale;
import java.util.Map;
+import java.util.HashMap;
import java.util.StringTokenizer;
import java.text.CharacterIterator;
import java.text.AttributedCharacterIterator;
+import java.text.StringCharacterIterator;
+
+import gnu.java.awt.ClasspathToolkit;
+import gnu.java.awt.peer.ClasspathFontPeer;
/**
* This class represents a windowing system font.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
* @author Warren Levy <warrenl@cygnus.com>
+ * @author Graydon Hoare <graydon@redhat.com>
*/
public class Font implements Serializable
{
@@ -160,32 +167,9 @@
// Serialization constant
private static final long serialVersionUID = -4206021311591459213L;
-/*************************************************************************/
-
-/*
- * Instance Variables
- */
-
-/**
- * The name of this font
- */
-protected String name;
-
-/**
- * The font style, which is a combination (by summing, not OR-ing) of
- * the font style constants in this class.
- */
-protected int style;
-
-/**
- * The font point size.
- */
-protected int size;
-
-protected float pointSize;
-// The native peer for this font
-private FontPeer peer;
+ // The ClasspathToolkit-provided peer which implements this font
+ private ClasspathFontPeer peer;
/*************************************************************************/
@@ -208,8 +192,7 @@
* style if none is specified is PLAIN. The default size if none
* is specified is 12.
*/
-public static Font
-decode(String fontspec)
+ public static Font decode (String fontspec)
{
String name = null;
int style = PLAIN;
@@ -237,7 +220,7 @@
}
if (token.toUpperCase().equals("BOLDITALIC"))
{
- style = BOLD + ITALIC;
+ style = BOLD | ITALIC;
continue;
}
@@ -252,9 +235,46 @@
size = tokenval;
}
- return(new Font(name, style, size));
+ return getFontFromToolkit (name, attrsToMap (style, size));
}
+ /* These methods delegate to the toolkit. */
+
+ protected static ClasspathToolkit tk ()
+ {
+ return (ClasspathToolkit)(Toolkit.getDefaultToolkit ());
+ }
+
+ protected static Map attrsToMap(int style, int size)
+ {
+ Map attrs = new HashMap();
+ attrs.put (TextAttribute.SIZE, new Float ((float)size));
+
+ if ((style & BOLD) == BOLD)
+ attrs.put (TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD);
+ else
+ attrs.put (TextAttribute.WEIGHT, TextAttribute.WEIGHT_REGULAR);
+
+ if ((style & ITALIC) == ITALIC)
+ attrs.put (TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE);
+ else
+ attrs.put (TextAttribute.POSTURE, TextAttribute.POSTURE_REGULAR);
+ return attrs;
+ }
+
+ /* Every factory method in Font should eventually call this. */
+ protected static Font getFontFromToolkit (String name, Map attribs)
+ {
+ return tk ().getFont (name, attribs);
+ }
+
+ /* Every Font constructor should eventually call this. */
+ protected static ClasspathFontPeer getPeerFromToolkit (String name, Map attrs)
+ {
+ return tk ().getClasspathFontPeer (name, attrs);
+ }
+
+
/*************************************************************************/
/**
@@ -266,14 +286,12 @@
* @return The requested font, or <code>default</code> if the property
* not exist or is malformed.
*/
-public static Font
-getFont(String propname, Font defval)
+ public static Font getFont (String propname, Font defval)
{
String propval = System.getProperty(propname);
if (propval != null)
- return(decode(propval));
-
- return(defval);
+ return decode (propval);
+ return defval;
}
/*************************************************************************/
@@ -286,10 +304,9 @@
* @return The requested font, or <code>null</code> if the property
* not exist or is malformed.
*/
-public static Font
-getFont(String propname)
+ public static Font getFont (String propname)
{
- return(getFont(propname, null));
+ return getFont (propname, (Font)null);
}
/*************************************************************************/
@@ -306,19 +323,22 @@
* @param style The font style.
* @param size The font point size.
*/
-public
-Font(String name, int style, int size)
+
+ public Font (String name, int style, int size)
{
- this.name = name;
- this.style = style;
- this.size = size;
- this.pointSize = size;
+ this.peer = getPeerFromToolkit (name, attrsToMap (style, size));
}
-public
-Font(Map attributes)
+ public Font (Map attrs)
{
- throw new UnsupportedOperationException();
+ this.peer = getPeerFromToolkit (null, attrs);
+}
+
+ /* This extra constructor is here to permit ClasspathToolkit and to build
+ a font with a "logical name" as well as attrs. */
+ public Font (String name, Map attrs)
+{
+ this.peer = getPeerFromToolkit (name, attrs);
}
/*************************************************************************/
@@ -328,20 +348,19 @@
*/
/**
- * Returns the logical name of the font. A logical name describes a very
- * general typographic style (such as Sans Serif). It is less specific
- * than both a font family name (such as Helvetica) and a font face name
- * (such as Helvetica Bold).
+ * Returns the logical name of the font. A logical name is the name the
+ * font was constructed with. It may be the name of a logical font (one
+ * of 6 required names in all java environments) or it may be a face
+ * name.
*
* @return The logical name of the font.
*
* @see getFamily()
* @see getFontName()
*/
-public String
-getName()
+ public String getName ()
{
- return(name);
+ return peer.getName (this);
}
/*************************************************************************/
@@ -351,16 +370,14 @@
*
* @return The font style.
*/
-public int
-getSize()
+ public int getSize ()
{
- return(size);
+ return (int) peer.getSize (this);
}
-public float
-getSize2D()
+ public float getSize2D ()
{
- return pointSize;
+ return peer.getSize (this);
}
/*************************************************************************/
@@ -372,13 +389,9 @@
* @return <code>true</code> if this is a plain font, <code>false</code>
* otherwise.
*/
-public boolean
-isPlain()
+ public boolean isPlain ()
{
- if (style == PLAIN)
- return(true);
- else
- return(false);
+ return peer.isPlain (this);
}
/*************************************************************************/
@@ -389,13 +402,9 @@
* @return <code>true</code> if this font is bold, <code>false</code>
* otherwise.
*/
-public boolean
-isBold()
+ public boolean isBold ()
{
- if ((style == BOLD) || (style == (BOLD+ITALIC)))
- return(true);
- else
- return(false);
+ return peer.isBold (this);
}
/*************************************************************************/
@@ -406,22 +415,17 @@
* @return <code>true</code> if this font is italic, <code>false</code>
* otherwise.
*/
-public boolean
-isItalic()
+ public boolean isItalic ()
{
- if ((style == ITALIC) || (style == (BOLD+ITALIC)))
- return(true);
- else
- return(false);
+ return peer.isItalic (this);
}
/*************************************************************************/
/**
- * Returns the family name of this font. A family name describes a
- * typographic style (such as Helvetica or Palatino). It is more specific
- * than a logical font name (such as Sans Serif) but less specific than a
- * font face name (such as Helvetica Bold).
+ * Returns the family name of this font. A family name describes a design
+ * or "brand name" (such as Helvetica or Palatino). It is less specific
+ * than a font face name (such as Helvetica Bold).
*
* @return A string containing the font family name.
*
@@ -431,11 +435,9 @@
* @see getFontName()
* @see GraphicsEnvironment.getAvailableFontFamilyNames()
*/
-public String
-getFamily()
+ public String getFamily ()
{
- // FIXME: How do I implement this?
- return(name);
+ return peer.getFamily (this);
}
/**
@@ -448,10 +450,9 @@
* @see isBold()
* @see isItalic()
*/
-public int
-getStyle()
+ public int getStyle ()
{
- return style;
+ return peer.getStyle (this);
}
/**
@@ -463,10 +464,9 @@
*
* @since 1.2
*/
-public boolean
-canDisplay(char c)
+ public boolean canDisplay (char c)
{
- throw new UnsupportedOperationException ();
+ return peer.canDisplay (this, c);
}
/**
@@ -481,10 +481,10 @@
*
* @since 1.2
*/
-public int
-canDisplayUpTo(String s)
+ public int canDisplayUpTo (String s)
{
- throw new UnsupportedOperationException ();
+ return peer.canDisplayUpTo (this, new StringCharacterIterator (s),
+ 0, s.length () - 1);
}
/**
@@ -504,10 +504,10 @@
* @throws IndexOutOfBoundsException if the range [start, limit] is
* invalid in <code>text</code>.
*/
-public int
-canDisplayUpTo(char[] text, int start, int limit)
+ public int canDisplayUpTo (char[] text, int start, int limit)
{
- throw new UnsupportedOperationException ();
+ return peer.canDisplayUpTo
+ (this, new StringCharacterIterator (new String (text)), start, limit);
}
/**
@@ -527,10 +527,9 @@
* @throws IndexOutOfBoundsException if the range [start, limit] is
* invalid in <code>i</code>.
*/
-public int
-canDisplayUpTo(CharacterIterator i, int start, int limit)
+ public int canDisplayUpTo (CharacterIterator i, int start, int limit)
{
- throw new UnsupportedOperationException ();
+ return peer.canDisplayUpTo (this, i, start, limit);
}
/**
@@ -554,11 +553,10 @@
*
* @since 1.3
*/
-public static Font
-createFont(int fontFormat, InputStream is)
+ public static Font createFont (int fontFormat, InputStream is)
throws FontFormatException, IOException
{
- throw new UnsupportedOperationException ();
+ return tk().createFont (fontFormat, is);
}
/**
@@ -576,10 +574,9 @@
*
* @see layoutGlyphVector()
*/
-public GlyphVector
-createGlyphVector(FontRenderContext ctx, String str)
+ public GlyphVector createGlyphVector (FontRenderContext ctx, String str)
{
- throw new UnsupportedOperationException ();
+ return peer.createGlyphVector (this, ctx, new StringCharacterIterator (str));
}
/**
@@ -597,10 +594,9 @@
*
* @see layoutGlyphVector()
*/
-public GlyphVector
-createGlyphVector(FontRenderContext ctx, CharacterIterator i)
+ public GlyphVector createGlyphVector (FontRenderContext ctx, CharacterIterator i)
{
- throw new UnsupportedOperationException ();
+ return peer.createGlyphVector (this, ctx, i);
}
/**
@@ -618,10 +614,10 @@
*
* @see layoutGlyphVector()
*/
-public GlyphVector
-createGlyphVector(FontRenderContext ctx, char[] chars)
+ public GlyphVector createGlyphVector (FontRenderContext ctx, char[] chars)
{
- throw new UnsupportedOperationException ();
+ return peer.createGlyphVector
+ (this, ctx, new StringCharacterIterator (new String (chars)));
}
/**
@@ -642,10 +638,10 @@
* purpose was to transport character codes inside integers. I assume it
* is mis-documented in the Sun documentation.
*/
-public GlyphVector
-createGlyphVector(FontRenderContext ctx, int[] glyphCodes)
+
+ public GlyphVector createGlyphVector (FontRenderContext ctx, int[] glyphCodes)
{
- throw new UnsupportedOperationException ();
+ return peer.createGlyphVector (this, ctx, glyphCodes);
}
/**
@@ -658,10 +654,9 @@
*
* @since 1.2
*/
-public Font
-deriveFont(float size)
+ public Font deriveFont (float size)
{
- throw new UnsupportedOperationException ();
+ return peer.deriveFont (this, size);
}
/**
@@ -674,10 +669,9 @@
*
* @since 1.2
*/
-public Font
-deriveFont(int style)
+ public Font deriveFont (int style)
{
- throw new UnsupportedOperationException ();
+ return peer.deriveFont (this, style);
}
/**
@@ -695,10 +689,12 @@
*
* @since 1.2
*/
-public Font
-deriveFont(int style, AffineTransform a)
+ public Font deriveFont (int style, AffineTransform a)
{
- throw new UnsupportedOperationException ();
+ if (a == null)
+ throw new IllegalArgumentException ("Affine transformation is null");
+
+ return peer.deriveFont (this, style, a);
}
/**
@@ -711,10 +707,9 @@
*
* @since 1.2
*/
-public Font
-deriveFont(Map attributes)
+ public Font deriveFont (Map attributes)
{
- throw new UnsupportedOperationException ();
+ return peer.deriveFont (this, attributes);
}
/**
@@ -726,10 +721,9 @@
* @see java.text.AttributedCharacterIterator.Attribute
* @see java.awt.font.TextAttribute
*/
-public Map
-getAttributes()
+ public Map getAttributes ()
{
- throw new UnsupportedOperationException ();
+ return peer.getAttributes (this);
}
/**
@@ -741,10 +735,9 @@
* @see java.text.AttributedCharacterIterator.Attribute
* @see java.awt.font.TextAttribute
*/
-public AttributedCharacterIterator.Attribute[]
-getAvailableAttributes()
+ public AttributedCharacterIterator.Attribute[] getAvailableAttributes()
{
- throw new UnsupportedOperationException ();
+ return peer.getAvailableAttributes (this);
}
/**
@@ -768,10 +761,9 @@
*
* @see LineMetrics.getBaselineOffsets()
*/
-public byte
-getBaselineFor(char c)
+ public byte getBaselineFor (char c)
{
- throw new UnsupportedOperationException ();
+ return peer.getBaselineFor (this, c);
}
/**
@@ -792,10 +784,9 @@
* @see GraphicsEnvironment.getAvailableFontFamilyNames()
* @see Locale
*/
-public String
-getFamily(Locale lc)
+ public String getFamily (Locale lc)
{
- throw new UnsupportedOperationException ();
+ return peer.getFamily (this, lc);
}
/**
@@ -809,10 +800,9 @@
*
* @see TextAttribure
*/
-public static Font
-getFont(Map attributes)
+ public static Font getFont (Map attributes)
{
- throw new UnsupportedOperationException ();
+ return getFontFromToolkit (null, attributes);
}
/**
@@ -828,17 +818,15 @@
* @see getName()
* @see getFamily()
*/
-public String
-getFontName()
+ public String getFontName ()
{
- throw new UnsupportedOperationException ();
+ return peer.getFontName (this);
}
/**
* Returns the font face name of the font. A font face name describes a
* specific variant of a font family (such as Helvetica Bold). It is more
- * specific than both a font family name (such as Helvetica) and a logical
- * font name (such as Sans Serif).
+ * specific than both a font family name (such as Helvetica).
*
* @param lc The locale in which to describe the name of the font face.
*
@@ -850,10 +838,9 @@
* @see getName()
* @see getFamily()
*/
-public String
-getFontName(Locale lc)
+ public String getFontName (Locale lc)
{
- throw new UnsupportedOperationException ();
+ return peer.getFontName (this, lc);
}
/**
@@ -865,10 +852,9 @@
*
* @see TextAttribute.POSTURE
*/
-public float
-getItalicAngle()
+ public float getItalicAngle ()
{
- throw new UnsupportedOperationException ();
+ return peer.getItalicAngle (this);
}
/**
@@ -885,10 +871,11 @@
* @throws IndexOutOfBoundsException if the range [begin, limit] is
* invalid in <code>text</code>.
*/
-public LineMetrics
-getLineMetrics(String text, int begin, int limit, FontRenderContext rc)
+ public LineMetrics getLineMetrics(String text, int begin,
+ int limit, FontRenderContext rc)
{
- throw new UnsupportedOperationException ();
+ return peer.getLineMetrics (this, new StringCharacterIterator (text),
+ begin, limit, rc);
}
/**
@@ -905,10 +892,11 @@
* @throws IndexOutOfBoundsException if the range [begin, limit] is
* invalid in <code>chars</code>.
*/
-public LineMetrics
-getLineMetrics(char[] chars, int begin, int limit, FontRenderContext rc)
+ public LineMetrics getLineMetrics(char[] chars, int begin,
+ int limit, FontRenderContext rc)
{
- throw new UnsupportedOperationException ();
+ return peer.getLineMetrics (this, new StringCharacterIterator (new String(chars)),
+ begin, limit, rc);
}
/**
@@ -925,10 +913,10 @@
* @throws IndexOutOfBoundsException if the range [begin, limit] is
* invalid in <code>ci</code>.
*/
-public LineMetrics
-getLineMetrics(CharacterIterator ci, int begin, int limit, FontRenderContext rc)
+ public LineMetrics getLineMetrics (CharacterIterator ci, int begin,
+ int limit, FontRenderContext rc)
{
- throw new UnsupportedOperationException ();
+ return peer.getLineMetrics (this, ci, begin, limit, rc);
}
/**
@@ -940,10 +928,9 @@
*
* @return The maximal bounding box.
*/
-public Rectangle2D
-getMaxCharBounds(FontRenderContext rc)
+ public Rectangle2D getMaxCharBounds (FontRenderContext rc)
{
- throw new UnsupportedOperationException ();
+ return peer.getMaxCharBounds (this, rc);
}
/**
@@ -955,10 +942,9 @@
*
* @since 1.2
*/
-public int
-getMissingGlyphCode()
+ public int getMissingGlyphCode ()
{
- throw new UnsupportedOperationException ();
+ return peer.getMissingGlyphCode (this);
}
/**
@@ -971,10 +957,9 @@
*
* @since 1.2
*/
-public int
-getNumGlyphs()
+ public int getNumGlyphs ()
{
- throw new UnsupportedOperationException ();
+ return peer.getMissingGlyphCode (this);
}
/**
@@ -988,10 +973,9 @@
* @see getFamily()
* @see getFontName()
*/
-public String
-getPSName()
+ public String getPSName ()
{
- throw new UnsupportedOperationException ();
+ return peer.getPostScriptName (this);
}
/**
@@ -1009,10 +993,9 @@
*
* @see createGlyphVector()
*/
-public Rectangle2D
-getStringBounds(String str, FontRenderContext frc)
+ public Rectangle2D getStringBounds (String str, FontRenderContext frc)
{
- throw new UnsupportedOperationException ();
+ return getStringBounds (str, 0, str.length () - 1, frc);
}
/**
@@ -1037,10 +1020,10 @@
*
* @see createGlyphVector()
*/
-public Rectangle2D
-getStringBounds(String str, int begin, int limit, FontRenderContext frc)
+ public Rectangle2D getStringBounds (String str, int begin,
+ int limit, FontRenderContext frc)
{
- throw new UnsupportedOperationException ();
+ return peer.getStringBounds (this, new StringCharacterIterator(str), begin, limit, frc);
}
/**
@@ -1065,10 +1048,10 @@
*
* @see createGlyphVector()
*/
-public Rectangle2D
-getStringBounds(CharacterIterator ci, int begin, int limit, FontRenderContext frc)
+ public Rectangle2D getStringBounds (CharacterIterator ci, int begin,
+ int limit, FontRenderContext frc)
{
- throw new UnsupportedOperationException ();
+ return peer.getStringBounds (this, ci, begin, limit, frc);
}
/**
@@ -1093,10 +1076,11 @@
*
* @see createGlyphVector()
*/
-public Rectangle2D
-getStringBounds(char[] chars, int begin, int limit, FontRenderContext frc)
+ public Rectangle2D getStringBounds (char[] chars, int begin,
+ int limit, FontRenderContext frc)
{
- throw new UnsupportedOperationException ();
+ return peer.getStringBounds (this, new StringCharacterIterator (new String (chars)),
+ begin, limit, frc);
}
/**
@@ -1105,10 +1089,9 @@
*
* @return The current transformation.
*/
-public AffineTransform
-getTransform()
+ public AffineTransform getTransform ()
{
- throw new UnsupportedOperationException ();
+ return peer.getTransform (this);
}
/**
@@ -1123,10 +1106,9 @@
* @see LineMetrics
* @see getLineMetrics()
*/
-public boolean
-hasUniformLineMetrics()
+ public boolean hasUniformLineMetrics ()
{
- throw new UnsupportedOperationException ();
+ return peer.hasUniformLineMetrics (this);
}
/**
@@ -1136,10 +1118,9 @@
* @return <code>true</code> iff the font has a non-identity affine
* transformation applied to it.
*/
-public boolean
-isTransformed()
+ public boolean isTransformed ()
{
- throw new UnsupportedOperationException ();
+ return peer.isTransformed (this);
}
/**
@@ -1169,15 +1150,14 @@
* @throws IndexOutOfBoundsException if the range [begin, limit] is
* invalid in <code>chars</code>.
*/
-public GlyphVector
-layoutGlyphVector(FontRenderContext frc, char[] chars, int start, int limit, int flags)
+ public GlyphVector layoutGlyphVector (FontRenderContext frc,
+ char[] chars, int start,
+ int limit, int flags)
{
- throw new UnsupportedOperationException ();
+ return peer.layoutGlyphVector (this, frc, chars, start, limit, flags);
}
-/*************************************************************************/
-
/**
* Returns a native peer object for this font.
*
@@ -1185,30 +1165,22 @@
*
* @deprecated
*/
-public FontPeer
-getPeer()
+ public FontPeer getPeer ()
{
- if (peer != null)
- return(peer);
-
- peer = Toolkit.getDefaultToolkit().getFontPeer(name, style);
- return(peer);
+ return peer;
}
-/*************************************************************************/
/**
* Returns a hash value for this font.
*
* @return A hash for this font.
*/
-public int
-hashCode()
+ public int hashCode()
{
- return((new String(name + size + style)).hashCode());
+ return this.toString().hashCode();
}
-/*************************************************************************/
/**
* Tests whether or not the specified object is equal to this font. This
@@ -1217,7 +1189,7 @@
* <ul>
* <li>The object is not <code>null</code>.
* <li>The object is an instance of <code>Font</code>.
- * <li>The object has the same name, style, and size as this object.
+ * <li>The object has the same names, style, size, and transform as this object.
* </ul>
*
* @return <code>true</code> if the specified object is equal to this
@@ -1226,21 +1198,20 @@
public boolean
equals(Object obj)
{
- if (!(obj instanceof Font))
- return(false);
-
- Font f = (Font)obj;
-
- if (!f.name.equals(name))
+ if (obj == null)
return(false);
- if (f.size != size)
+ if (!(obj instanceof Font))
return(false);
- if (f.style != style)
- return(false);
+ Font f = (Font)obj;
- return(true);
+ return (f.getName ().equals (this.getName ()) &&
+ f.getFamily ().equals (this.getFamily ()) &&
+ f.getFontName ().equals (this.getFontName ()) &&
+ f.getTransform ().equals (this.getTransform ()) &&
+ f.getSize() == this.getSize() &&
+ f.getStyle() == this.getStyle());
}
/*************************************************************************/
@@ -1253,8 +1224,13 @@
public String
toString()
{
- return(getClass().getName() + "(name=" + name + ",style=" + style +
- ",size=" + size + ")");
+ return(getClass().getName()
+ + "(logical=" + getName ()
+ + ",family=" + getFamily ()
+ + ",face=" + getFontName ()
+ + ",style=" + getStyle ()
+ + ",size=" + getSize ()
+ + ",transform=" + getTransform () + ")");
}
@@ -1278,7 +1254,8 @@
*/
public LineMetrics getLineMetrics(String str, FontRenderContext frc)
{
- throw new UnsupportedOperationException(); // FIXME
+ return getLineMetrics (str, 0, str.length () - 1, frc);
}
+
} // class Font
Index: jni/gtk-peer/gdkfont.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/jni/gtk-peer/gdkfont.h,v
retrieving revision 1.1
diff -u -b -w -r1.1 gdkfont.h
--- jni/gtk-peer/gdkfont.h 15 Dec 2003 19:15:23 -0000 1.1
+++ jni/gtk-peer/gdkfont.h 31 Dec 2003 08:57:54 -0000
@@ -38,7 +38,7 @@
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
-#include "gtkpeer.h"
+#include "gtkcairopeer.h"
#include <pango/pango.h>
#include <pango/pango-context.h>
Index: jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
===================================================================
RCS file: /cvs/gcc/gcc/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c,v
retrieving revision 1.4
diff -u -b -w -r1.4 gnu_java_awt_peer_gtk_GdkGraphics2D.c
--- jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c 15 Dec 2003 19:15:23 -0000 1.4
+++ jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c 31 Dec 2003 08:57:54 -0000
@@ -35,7 +35,7 @@
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
-#include "gtkpeer.h"
+#include "gtkcairopeer.h"
#include "gdkfont.h"
#include "gnu_java_awt_peer_gtk_GdkGraphics2D.h"
#include <gdk/gdktypes.h>
Index: jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeerMetrics.c
===================================================================
RCS file: /cvs/gcc/gcc/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeerMetrics.c,v
retrieving revision 1.1
diff -u -b -w -r1.1 gnu_java_awt_peer_gtk_GdkClasspathFontPeerMetrics.c
--- jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeerMetrics.c 20 Nov 2003 22:44:01 -0000 1.1
+++ jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeerMetrics.c 31 Dec 2003 08:57:54 -0000
@@ -37,7 +37,6 @@
#include <math.h>
-#include "gtkpeer.h"
#include "gdkfont.h"
#include "gnu_java_awt_peer_gtk_GdkClasspathFontPeerMetrics.h"