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

View file

@ -592,9 +592,12 @@ public class AWTUtilities
if (destination == null)
destination = getRoot(source);
convertPointToScreen(pt, source);
convertPointFromScreen(pt, destination);
if (source.isShowing() && destination.isShowing())
{
convertPointToScreen(pt, source);
convertPointFromScreen(pt, destination);
}
return pt;
}

View file

@ -98,13 +98,11 @@ public class EmbeddedWindow extends Frame
}
catch (IllegalAccessException e)
{
throw new RuntimeException
("couldn't set java.awt.Component.peer field");
throw new AssertionError (e);
}
catch (NoSuchFieldException e)
{
throw new RuntimeException
("couldn't set java.awt.Component.peer field");
throw new AssertionError (e);
}
super.addNotify();

View file

@ -1,52 +0,0 @@
/* FocusManager.java -- Provide Swing FocusManager API compatibility
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.awt;
/**
* This is a subclass of the otherwise abstract class
* {@link javax.swing.FocusManager}. Its sole purpose is to make the Swing
* FocusManager usable as a FocusManager in AWT, so that we can provide both
* the new (1.4) KeyboardFocusManager API and still support the older
* Swing FocusManager.
*
* @author Roman Kennke
*/
public class FocusManager
extends javax.swing.FocusManager
{
}

View file

@ -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];

View file

@ -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);

View file

@ -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

View file

@ -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,

View file

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

View file

@ -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]);
}

View file

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

View file

@ -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;

View file

@ -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