Imported GNU Classpath 0.19 + gcj-import-20051115.

* sources.am: Regenerated.
       * Makefile.in: Likewise.
       * scripts/makemake.tcl: Use glob -nocomplain.

From-SVN: r107049
This commit is contained in:
Mark Wielaard
2005-11-15 23:20:01 +00:00
parent 02e549bfaa
commit 8f523f3a10
1241 changed files with 97711 additions and 25284 deletions
@@ -1,5 +1,5 @@
/* GdkFontMetrics.java
Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc.
Copyright (C) 1999, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -62,15 +62,28 @@ public class GdkFontMetrics extends FontMetrics
static final int TEXT_METRICS_HEIGHT = 3;
static final int TEXT_METRICS_X_ADVANCE = 4;
static final int TEXT_METRICS_Y_ADVANCE = 5;
/**
* Makes sure to return a Font based on the given Font that has as
* peer a GdkFontPeer. Used in the initializer.
*/
private static Font initFont(Font font)
{
if (font == null)
return new Font("Dialog", Font.PLAIN, 12);
else if (font.getPeer() instanceof GdkFontPeer)
return font;
else
{
ClasspathToolkit toolkit;
toolkit = (ClasspathToolkit) Toolkit.getDefaultToolkit();
return toolkit.getFont(font.getName(), font.getAttributes());
}
}
public GdkFontMetrics (Font font)
{
super (font.getPeer() instanceof GdkFontPeer
? font
: ((ClasspathToolkit)(Toolkit.getDefaultToolkit ()))
.getFont (font.getName(), font.getAttributes ()));
super(initFont(font));
peer = (GdkFontPeer) this.font.getPeer();
font_metrics = new int[5];
@@ -68,7 +68,7 @@ public class GdkGraphics extends Graphics
Color color, xorColor;
GtkComponentPeer component;
Font font;
Font font = new Font ("Dialog", Font.PLAIN, 12);
Rectangle clip;
GtkImage image;
@@ -88,6 +88,8 @@ public class GdkGraphics extends Graphics
color = g.color;
xorColor = g.xorColor;
font = g.font;
if (font == null)
font = new Font ("Dialog", Font.PLAIN, 12);
clip = new Rectangle (g.clip);
component = g.component;
@@ -115,7 +117,6 @@ public class GdkGraphics extends Graphics
GdkGraphics (GtkComponentPeer component)
{
this.component = component;
font = component.awtComponent.getFont ();
color = Color.black;
if (component.isRealized ())
@@ -128,6 +129,8 @@ public class GdkGraphics extends Graphics
{
initState (component);
color = component.awtComponent.getForeground ();
if (color == null)
color = Color.BLACK;
Dimension d = component.awtComponent.getSize ();
clip = new Rectangle (0, 0, d.width, d.height);
}
@@ -137,6 +140,8 @@ public class GdkGraphics extends Graphics
{
initStateUnlocked (component);
color = component.awtComponent.getForeground ();
if (color == null)
color = Color.BLACK;
Dimension d = component.awtComponent.getSize ();
clip = new Rectangle (0, 0, d.width, d.height);
}
@@ -378,7 +383,8 @@ public class GdkGraphics extends Graphics
public void setFont (Font font)
{
this.font = font;
if (font != null)
this.font = font;
}
native void setFunction (int gdk_func);
@@ -101,7 +101,7 @@ public class GdkGraphics2D extends Graphics2D
static
{
if (! Configuration.GTK_CAIRO_ENABLED)
throw new Error("Grahics2D not implemented. "
throw new Error("Graphics2D not implemented. "
+ "Cairo was not found or disabled at configure time");
if (Configuration.INIT_LOAD_LIBRARY)
@@ -154,11 +154,22 @@ public class GdkGraphics2D extends Graphics2D
public Graphics create(int x, int y, int width, int height)
{
return new GdkGraphics2D(width, height);
return new GdkGraphics2D(this, x, y, width, height);
}
private void fail_g2d ()
{
System.err.println ("Attempted to instantiate GdkGraphics2D"
+ " but Graphics2D not enabled. Try again with"
+ " -Dgnu.java.awt.peer.gtk.Graphics=Graphics2D");
System.exit (1);
}
GdkGraphics2D(GdkGraphics2D g)
{
if (!GtkToolkit.useGraphics2D ())
fail_g2d ();
paint = g.paint;
stroke = g.stroke;
setRenderingHints(g.hints);
@@ -198,8 +209,18 @@ public class GdkGraphics2D extends Graphics2D
stateStack = new Stack();
}
GdkGraphics2D(GdkGraphics2D g, int x, int y, int widht, int height)
{
this(g);
translate(x, y);
clipRect(0, 0, widht, height);
}
GdkGraphics2D(int width, int height)
{
if (!GtkToolkit.useGraphics2D ())
fail_g2d ();
initState(width, height);
setColor(Color.black);
@@ -215,6 +236,9 @@ public class GdkGraphics2D extends Graphics2D
GdkGraphics2D(GtkComponentPeer component)
{
if (!GtkToolkit.useGraphics2D ())
fail_g2d ();
this.component = component;
if (component.isRealized())
@@ -949,7 +973,10 @@ public class GdkGraphics2D extends Graphics2D
public Shape getClip()
{
return clip.getBounds2D(); //getClipInDevSpace();
if (clip == null)
return null;
else
return clip.getBounds2D(); //getClipInDevSpace();
}
public Rectangle getClipBounds()
@@ -992,8 +1019,11 @@ public class GdkGraphics2D extends Graphics2D
if (clip == null)
{
// Reset clipping.
Dimension d = component.awtComponent.getSize();
setClip(0, 0, d.width, d.height);
if (component != null)
{
Dimension d = component.awtComponent.getSize();
setClip(0, 0, d.width, d.height);
}
}
else
{
@@ -1045,8 +1075,9 @@ public class GdkGraphics2D extends Graphics2D
public void clearRect(int x, int y, int width, int height)
{
cairoSetRGBAColor(bg.getRed() / 255.0, bg.getGreen() / 255.0,
bg.getBlue() / 255.0, 1.0);
if (bg != null)
cairoSetRGBAColor(bg.getRed() / 255.0, bg.getGreen() / 255.0,
bg.getBlue() / 255.0, 1.0);
cairoNewPath();
cairoRectangle(x, y, width, height);
cairoFill();
@@ -1371,7 +1402,8 @@ public class GdkGraphics2D extends Graphics2D
public void copyArea(int x, int y, int width, int height, int dx, int dy)
{
throw new java.lang.UnsupportedOperationException();
GdkGraphics2D g = (GdkGraphics2D) create(x, y, width, height);
gdkDrawDrawable(g, x + dx, y + dy);
}
public void drawArc(int x, int y, int width, int height, int startAngle,
@@ -1604,6 +1636,11 @@ public class GdkGraphics2D extends Graphics2D
public void setFont(Font f)
{
// Sun's JDK does not throw NPEs, instead it leaves the current setting
// unchanged. So do we.
if (f == null)
return;
if (f.getPeer() instanceof GdkFontPeer)
font = f;
else
@@ -388,10 +388,7 @@ public class GdkTextLayout
throw new Error("not implemented");
}
public Shape getOutline (AffineTransform tx)
{
throw new Error("not implemented");
}
public native Shape getOutline (AffineTransform tx);
public Shape getVisualHighlightShape (TextHitInfo firstEndpoint,
TextHitInfo secondEndpoint,
@@ -131,9 +131,6 @@ public class GtkChoicePeer extends GtkComponentPeer
protected void postChoiceItemEvent (String label, int stateChange)
{
// Must set our state before notifying listeners
if (stateChange == ItemEvent.SELECTED)
((Choice) awtComponent).select (label);
postItemEvent (label, stateChange);
}
}
@@ -71,6 +71,7 @@ import java.awt.image.ImageProducer;
import java.awt.image.VolatileImage;
import java.awt.peer.ComponentPeer;
import java.awt.peer.ContainerPeer;
import java.awt.peer.WindowPeer;
import java.util.Timer;
import java.util.TimerTask;
@@ -98,6 +99,7 @@ public class GtkComponentPeer extends GtkGenericPeer
native int[] gtkWidgetGetBackground ();
native void gtkWidgetGetDimensions (int[] dim);
native void gtkWidgetGetPreferredDimensions (int[] dim);
native void gtkWindowGetLocationOnScreen (int[] point);
native void gtkWidgetGetLocationOnScreen (int[] point);
native void gtkWidgetSetCursor (int type);
native void gtkWidgetSetCursorUnlocked (int type);
@@ -270,7 +272,10 @@ public class GtkComponentPeer extends GtkGenericPeer
public Point getLocationOnScreen ()
{
int point[] = new int[2];
gtkWidgetGetLocationOnScreen (point);
if( this instanceof WindowPeer )
gtkWindowGetLocationOnScreen (point);
else
gtkWidgetGetLocationOnScreen (point);
return new Point (point[0], point[1]);
}
@@ -44,6 +44,10 @@ import java.awt.Rectangle;
import java.awt.event.PaintEvent;
import java.awt.peer.DialogPeer;
import javax.swing.JDialog;
import javax.swing.JPopupMenu;
import javax.swing.JToolTip;
public class GtkDialogPeer extends GtkWindowPeer
implements DialogPeer
{
@@ -82,10 +86,28 @@ public class GtkDialogPeer extends GtkWindowPeer
void create ()
{
// Create a decorated dialog window.
create (GDK_WINDOW_TYPE_HINT_DIALOG, true);
Dialog dialog = (Dialog) awtComponent;
int type = GDK_WINDOW_TYPE_HINT_DIALOG;
if (dialog instanceof JDialog)
{
Class heavyWeightClass;
try
{
heavyWeightClass = Class.forName("javax.swing.Popup$JWindowPopup");
}
catch (ClassNotFoundException e)
{
throw new AssertionError(e);
}
if (dialog.getClass() == heavyWeightClass
|| ((JDialog) dialog).getContentPane() instanceof JToolTip)
type = GDK_WINDOW_TYPE_HINT_MENU;
}
// Create a decorated dialog window.
create (type, !((Dialog) awtComponent).isUndecorated ());
gtkWindowSetModal (dialog.isModal ());
setTitle (dialog.getTitle ());
@@ -168,7 +168,8 @@ public class GtkFramePeer extends GtkWindowPeer
void create ()
{
// Create a normal decorated window.
create (GDK_WINDOW_TYPE_HINT_NORMAL, true);
create (GDK_WINDOW_TYPE_HINT_NORMAL,
!((Frame) awtComponent).isUndecorated ());
Frame frame = (Frame) awtComponent;
@@ -37,6 +37,7 @@ exception statement from your version. */
package gnu.java.awt.peer.qt;
import gnu.classpath.Configuration;
import gnu.java.awt.EmbeddedWindow;
import gnu.java.awt.peer.ClasspathFontPeer;
import gnu.java.awt.peer.EmbeddedWindowPeer;
@@ -135,7 +136,8 @@ public class QtToolkit extends ClasspathToolkit
{
eventQueue = new EventQueue();
repaintThread = new QtRepaintThread();
System.loadLibrary("qtpeer");
if (Configuration.INIT_LOAD_LIBRARY)
System.loadLibrary("qtpeer");
String theme = null;
try