libjava/classpath/ChangeLog.gcj:

2007-05-31  Matthias Klose  <doko@ubuntu.com>

        * javax/management/NotificationBroadcasterSupport.java
        (getNotificationInfo): Add cast.
        * native/jni/qt-peer/Makefile.am (AM_CXXFLAGS): Add libstdc++ include
        directories.
        * native/jni/qt-peer/Makefile.in: Regenerate.

libjava/ChangeLog:

2007-06-03  Matthias Klose  <doko@ubuntu.com>

        * java/io/natFileWin32.cc (setFilePermissions): New (stub only).
        _access: Handle EXEC query, stub only.

2007-06-03  Matthias Klose  <doko@ubuntu.com>

        Merged from classpath:
        * gnu/java/nio/SelectorProviderImpl.java: Whitespace merge.
        * java/lang/System.java(inheritedChannel): New.
        * java/lang/Character.java: Remove stray`;'.
        * java/net/MulticastSocket.java: Merged.
        * java/text/DateFormatSymbols.java(getInstance): New, comment updates.
        * java/text/Collator.java(getInstance): Merged.
        * java/util/Calendar.java: New attributes ALL_STYLES, SHORT, LONG.
        getDisplayName, getDisplayNames: New.
        * java/util/logging/Logger.java: Merged.
        * Regenerate .class and .h files.

2007-06-03  Matthias Klose  <doko@ubuntu.com>

        * java/io/File.java: Merge with classpath-0.95, new method
        setFilePermissions, new attribute EXEC.
        * java/io/natFilePosix.cc (setFilePermissions): New.
        _access: Handle EXEC query.
        * classpath/lib/java/io/File.class, java/io/File.h: Regenerate.

2007-06-03  Matthias Klose  <doko@ubuntu.com>

        Imported GNU Classpath 0.95.

        * classpath/Makefile.in,
        classpath/native/jni/midi-dssi/Makefile.in,
        classpath/native/jni/classpath/Makefile.in,
        classpath/native/jni/Makefile.in,
        classpath/native/jni/gconf-peer/Makefile.in,
        classpath/native/jni/java-io/Makefile.in,
        classpath/native/jni/native-lib/Makefile.in,
        classpath/native/jni/java-util/Makefile.in,
        classpath/native/jni/midi-alsa/Makefile.in,
        classpath/native/jni/java-lang/Makefile.in,
        classpath/native/jni/java-nio/Makefile.in,
        classpath/native/jni/java-net/Makefile.in,
        classpath/native/jni/xmlj/Makefile.in,
        classpath/native/jni/qt-peer/Makefile.in,
        classpath/native/jni/gtk-peer/Makefile.in,
        classpath/native/Makefile.in, classpath/native/jawt/Makefile.in,
        classpath/native/fdlibm/Makefile.in,
        classpath/native/plugin/Makefile.in,
        classpath/resource/Makefile.in, classpath/scripts/Makefile.in,
        classpath/tools/Makefile.in, classpath/doc/Makefile.in,
        classpath/doc/api/Makefile.in, classpath/lib/Makefile.in,
        classpath/external/Makefile.in, classpath/external/jsr166/Makefile.in,
        classpath/external/sax/Makefile.in,
        classpath/external/w3c_dom/Makefile.in,
        classpath/external/relaxngDatatype/Makefile.in,
        classpath/include/Makefile.in,
        classpath/examples/Makefile.in: Regenerate.
        * classpath/config.guess, classpath/config.sub,
        classpath/ltmain.sh : Update.
        * classpath/configure, classpath/depcomp, classpath/missing,
        classpath/aclocal.m4, classpath/install-sh: Regenerate.

        * gnu/classpath/Configuration.java (CLASSPATH_VERSION): Now 0.95.
        * sources.am: Regenerate.
        * Makefile.in: Regenerate.

        * Update the .class files and generated CNI header files, add new
        .class and generated CNI header files.
        * Remove generated files for removed java source files:
        classpath/gnu/java/net/BASE64.java,
        classpath/gnu/java/security/util/Base64.java,
        classpath/gnu/java/awt/peer/gtk/GThreadMutex.java,
        classpath/gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java,
        classpath/gnu/java/awt/font/autofit/Scaler.java,
        classpath/gnu/classpath/jdwp/util/Value.java,
        classpath/gnu/javax/net/ssl/Base64.java.
        * Remove empty directories.

        * Makefile.am(nat_source_files): Add natVMOperatingSystemMXBeanImpl.cc.
        * java/lang/Class.java(setAccessible): Merge from classpath.
        * java/util/Locale.java: Remove.
        * gnu/java/lang/management/VMOperatingSystemMXBeanImpl.java,
        gnu/java/lang/management/natVMOperatingSystemMXBeanImpl.cc: New.
        * gcj/javaprims.h: Update class declarations.
        * scripts/classes.pl: Update usage.
        * HACKING: Mention to build all peers.

From-SVN: r125302
This commit is contained in:
Matthias Klose 2007-06-03 23:18:43 +00:00
parent af333b9a7f
commit e1bea0c068
2951 changed files with 80982 additions and 68583 deletions

View file

@ -39,7 +39,9 @@ exception statement from your version. */
package java.awt.image;
import gnu.java.awt.Buffers;
import gnu.java.awt.ClasspathGraphicsEnvironment;
import gnu.java.awt.ComponentDataBlitOp;
import gnu.java.awt.peer.gtk.CairoSurface;
import java.awt.Graphics;
import java.awt.Graphics2D;
@ -83,7 +85,7 @@ public class BufferedImage extends Image
/**
* Vector of TileObservers (or null)
*/
Vector tileObservers;
Vector<TileObserver> tileObservers;
/**
* The image's WritableRaster
@ -143,39 +145,39 @@ public class BufferedImage extends Image
{
SampleModel sm = null;
ColorModel cm = null;
boolean premultiplied = (type == BufferedImage.TYPE_INT_ARGB_PRE ||
type == BufferedImage.TYPE_4BYTE_ABGR_PRE);
boolean premultiplied = (type == BufferedImage.TYPE_INT_ARGB_PRE
|| type == BufferedImage.TYPE_4BYTE_ABGR_PRE);
switch( type )
{
case BufferedImage.TYPE_INT_RGB:
sm = new SinglePixelPackedSampleModel( DataBuffer.TYPE_INT,
width, height,
new int[]{ 0x00FF0000,
0x0000FF00,
0x000000FF } ) ;
cm = new DirectColorModel( 24, 0xff0000, 0xff00, 0xff );
break;
sm = new SinglePixelPackedSampleModel( DataBuffer.TYPE_INT,
width, height,
new int[]{ 0x00FF0000,
0x0000FF00,
0x000000FF } ) ;
cm = new DirectColorModel( 24, 0xff0000, 0xff00, 0xff );
break;
case BufferedImage.TYPE_3BYTE_BGR:
sm = new PixelInterleavedSampleModel( DataBuffer.TYPE_BYTE,
width, height,
3, width * 3,
new int[]{ 2, 1, 0 } );
cm = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
false, false,
BufferedImage.OPAQUE,
DataBuffer.TYPE_BYTE);
sm = new PixelInterleavedSampleModel( DataBuffer.TYPE_BYTE,
width, height,
3, width * 3,
new int[]{ 2, 1, 0 } );
cm = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
false, false,
BufferedImage.OPAQUE,
DataBuffer.TYPE_BYTE);
break;
case BufferedImage.TYPE_INT_ARGB:
case BufferedImage.TYPE_INT_ARGB_PRE:
sm = new SinglePixelPackedSampleModel( DataBuffer.TYPE_INT,
width, height,
new int[]{ 0x00FF0000,
0x0000FF00,
0x000000FF,
0xFF000000 } );
sm = new SinglePixelPackedSampleModel( DataBuffer.TYPE_INT,
width, height,
new int[]{ 0x00FF0000,
0x0000FF00,
0x000000FF,
0xFF000000 } );
if (premultiplied)
cm = new DirectColorModel( ColorSpace.getInstance(ColorSpace.CS_sRGB),
32, 0xff0000, 0xff00, 0xff, 0xff000000,
@ -183,7 +185,8 @@ public class BufferedImage extends Image
Buffers.smallestAppropriateTransferType(32));
else
cm = new DirectColorModel( 32, 0xff0000, 0xff00, 0xff, 0xff000000 );
break;
break;
case BufferedImage.TYPE_4BYTE_ABGR:
case BufferedImage.TYPE_4BYTE_ABGR_PRE:
@ -195,57 +198,58 @@ public class BufferedImage extends Image
true, premultiplied,
BufferedImage.TRANSLUCENT,
DataBuffer.TYPE_BYTE);
break;
break;
case BufferedImage.TYPE_INT_BGR:
sm = new SinglePixelPackedSampleModel( DataBuffer.TYPE_INT,
width, height,
new int[]{ 0x000000FF,
0x0000FF00,
0x00FF0000 } ) ;
cm = new DirectColorModel( 24, 0xff, 0xff00, 0xff0000 );
sm = new SinglePixelPackedSampleModel( DataBuffer.TYPE_INT,
width, height,
new int[]{ 0x000000FF,
0x0000FF00,
0x00FF0000 } ) ;
cm = new DirectColorModel( 24, 0xff, 0xff00, 0xff0000 );
break;
case BufferedImage.TYPE_USHORT_565_RGB:
sm = new SinglePixelPackedSampleModel( DataBuffer.TYPE_USHORT,
width, height,
new int[]{ 0xF800,
0x7E0,
0x1F } ) ;
cm = new DirectColorModel( 16, 0xF800, 0x7E0, 0x1F );
break;
sm = new SinglePixelPackedSampleModel( DataBuffer.TYPE_USHORT,
width, height,
new int[]{ 0xF800,
0x7E0,
0x1F } ) ;
cm = new DirectColorModel( 16, 0xF800, 0x7E0, 0x1F );
break;
case BufferedImage.TYPE_USHORT_555_RGB:
sm = new SinglePixelPackedSampleModel( DataBuffer.TYPE_USHORT,
width, height,
new int[]{ 0x7C00,
0x3E0,
0x1F } ) ;
cm = new DirectColorModel( 15, 0x7C00, 0x3E0, 0x1F );
break;
sm = new SinglePixelPackedSampleModel( DataBuffer.TYPE_USHORT,
width, height,
new int[]{ 0x7C00,
0x3E0,
0x1F } ) ;
cm = new DirectColorModel( 15, 0x7C00, 0x3E0, 0x1F );
break;
case BufferedImage.TYPE_BYTE_INDEXED:
cm = createDefaultIndexedColorModel( false );
cm = createDefaultIndexedColorModel( false );
case BufferedImage.TYPE_BYTE_GRAY:
sm = new PixelInterleavedSampleModel( DataBuffer.TYPE_BYTE,
width, height,
1, width, new int[]{ 0 } );
break;
sm = new PixelInterleavedSampleModel( DataBuffer.TYPE_BYTE,
width, height,
1, width, new int[]{ 0 } );
break;
case BufferedImage.TYPE_USHORT_GRAY:
sm = new PixelInterleavedSampleModel( DataBuffer.TYPE_USHORT,
width, height,
1, width, new int[]{ 0 } );
break;
sm = new PixelInterleavedSampleModel( DataBuffer.TYPE_USHORT,
width, height,
1, width, new int[]{ 0 } );
break;
case BufferedImage.TYPE_BYTE_BINARY:
cm = createDefaultIndexedColorModel( true );
sm = new MultiPixelPackedSampleModel(DataBuffer.TYPE_BYTE,
width, height, 1);
break;
cm = createDefaultIndexedColorModel( true );
sm = new MultiPixelPackedSampleModel(DataBuffer.TYPE_BYTE,
width, height, 1);
break;
default:
sm = null;
sm = null;
}
if( sm == null )
@ -253,33 +257,41 @@ public class BufferedImage extends Image
if( cm == null ) // only for the grayscale types
{
int buftype;
int[] bits = new int[1];
if( type == BufferedImage.TYPE_BYTE_GRAY )
{
buftype = DataBuffer.TYPE_BYTE;
bits[0] = 8;
}
else
{
buftype = DataBuffer.TYPE_USHORT;
bits[0] = 16;
}
ColorSpace graySpace = ColorSpace.getInstance( ColorSpace.CS_GRAY );
cm = new ComponentColorModel( graySpace, bits, false, false,
Transparency.OPAQUE, buftype );
int buftype;
int[] bits = new int[1];
if( type == BufferedImage.TYPE_BYTE_GRAY )
{
buftype = DataBuffer.TYPE_BYTE;
bits[0] = 8;
}
else
{
buftype = DataBuffer.TYPE_USHORT;
bits[0] = 16;
}
ColorSpace graySpace = ColorSpace.getInstance( ColorSpace.CS_GRAY );
cm = new ComponentColorModel( graySpace, bits, false, false,
Transparency.OPAQUE, buftype );
}
init( cm,
Raster.createWritableRaster(sm, new Point( 0, 0 ) ),
premultiplied,
null, // no properties
type );
WritableRaster rst = null;
// Attempt to create an accelerated backend for this image
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
if (env instanceof ClasspathGraphicsEnvironment)
rst = ((ClasspathGraphicsEnvironment)env).createRaster(cm, sm);
// Default to a standard Java raster & databuffer if needed
if (rst == null)
rst = Raster.createWritableRaster(sm, new Point( 0, 0 ) );
init(cm, rst, premultiplied,
null, // no properties
type );
}
public BufferedImage(int w, int h, int type,
IndexColorModel indexcolormodel)
public BufferedImage(int w, int h, int type, IndexColorModel indexcolormodel)
{
if ((type != TYPE_BYTE_BINARY) && (type != TYPE_BYTE_INDEXED))
throw new IllegalArgumentException("Type must be TYPE_BYTE_BINARY or TYPE_BYTE_INDEXED");
@ -289,27 +301,21 @@ public class BufferedImage extends Image
throw new IllegalArgumentException("Byte type cannot have a larger than 256-color palette.");
init( indexcolormodel,
indexcolormodel.createCompatibleWritableRaster(w, h),
indexcolormodel.isAlphaPremultiplied(),
null, // no properties
type );
indexcolormodel.createCompatibleWritableRaster(w, h),
indexcolormodel.isAlphaPremultiplied(),
null, // no properties
type );
}
public BufferedImage(ColorModel colormodel,
WritableRaster writableraster,
boolean premultiplied,
Hashtable<?,?> properties)
public BufferedImage(ColorModel colormodel, WritableRaster writableraster,
boolean premultiplied, Hashtable<?,?> properties)
{
init(colormodel, writableraster, premultiplied, properties,
TYPE_CUSTOM);
init(colormodel, writableraster, premultiplied, properties, TYPE_CUSTOM);
}
private void init(ColorModel cm,
WritableRaster writableraster,
boolean premultiplied,
Hashtable properties,
int type)
private void init(ColorModel cm, WritableRaster writableraster,
boolean premultiplied, Hashtable properties, int type)
{
raster = writableraster;
colorModel = cm;
@ -329,29 +335,32 @@ public class BufferedImage extends Image
{
if( binary )
{
byte[] t = new byte[]{ 0, (byte)255 };
return new IndexColorModel( 1, 2, t, t, t );
byte[] t = new byte[]{ 0, (byte)255 };
return new IndexColorModel( 1, 2, t, t, t );
}
byte[] r = new byte[256];
byte[] g = new byte[256];
byte[] b = new byte[256];
int index = 0;
for( int i = 0; i < 6; i++ )
for( int j = 0; j < 6; j++ )
for( int k = 0; k < 6; k++ )
{
r[ index ] = (byte)(i * 51);
g[ index ] = (byte)(j * 51);
b[ index ] = (byte)(k * 51);
index++;
}
for( int k = 0; k < 6; k++ )
{
r[ index ] = (byte)(i * 51);
g[ index ] = (byte)(j * 51);
b[ index ] = (byte)(k * 51);
index++;
}
while( index < 256 )
{
r[ index ] = g[ index ] = b[ index ] =
(byte)(18 + (index - 216) * 6);
index++;
r[ index ] = g[ index ] = b[ index ] =
(byte)(18 + (index - 216) * 6);
index++;
}
return new IndexColorModel( 8, 256, r, g, b );
}
@ -375,12 +384,13 @@ public class BufferedImage extends Image
// create a src child that has the right bounds...
WritableRaster src =
raster.createWritableChild(x, y, w, h, x, y,
null // same bands
);
null); // same bands
if (src.getSampleModel () instanceof ComponentSampleModel
&& dest.getSampleModel () instanceof ComponentSampleModel)
// Refer to ComponentDataBlitOp for optimized data blitting:
ComponentDataBlitOp.INSTANCE.filter(src, dest);
else
{
// slower path
@ -397,7 +407,8 @@ public class BufferedImage extends Image
return env.createGraphics (this);
}
public void flush() {
public void flush()
{
}
public WritableRaster getAlphaRaster()
@ -512,26 +523,24 @@ public class BufferedImage extends Image
public int getRGB(int x, int y)
{
Object rgbElem = raster.getDataElements(x, y,
null // create as needed
);
Object rgbElem = raster.getDataElements(x, y, null);
return colorModel.getRGB(rgbElem);
}
public int[] getRGB(int startX, int startY, int w, int h,
int[] rgbArray,
int offset, int scanlineStride)
public int[] getRGB(int startX, int startY, int w, int h, int[] rgbArray,
int offset, int scanlineStride)
{
if (rgbArray == null)
{
/*
000000000000000000
00000[#######----- [ = start
-----########----- ] = end
-----#######]00000
000000000000000000 */
int size = (h-1)*scanlineStride + w;
rgbArray = new int[size];
{
/*
000000000000000000
00000[#######----- [ = start
-----########----- ] = end
-----#######]00000
000000000000000000
*/
int size = (h-1)*scanlineStride + w;
rgbArray = new int[size];
}
int endX = startX + w;
@ -547,15 +556,15 @@ public class BufferedImage extends Image
Object rgbElem = null;
for (int y=startY; y<endY; y++)
{
int xoffset = offset;
for (int x=startX; x<endX; x++)
{
int rgb;
rgbElem = raster.getDataElements(x, y, rgbElem);
rgb = colorModel.getRGB(rgbElem);
rgbArray[xoffset++] = rgb;
}
offset += scanlineStride;
int xoffset = offset;
for (int x=startX; x<endX; x++)
{
int rgb;
rgbElem = raster.getDataElements(x, y, rgbElem);
rgb = colorModel.getRGB(rgbElem);
rgbArray[xoffset++] = rgb;
}
offset += scanlineStride;
}
return rgbArray;
}
@ -572,14 +581,14 @@ public class BufferedImage extends Image
public ImageProducer getSource()
{
return new ImageProducer() {
Vector consumers = new Vector();
return new ImageProducer()
{
Vector<ImageConsumer> consumers = new Vector<ImageConsumer>();
public void addConsumer(ImageConsumer ic)
{
if(!consumers.contains(ic))
consumers.add(ic);
if(!consumers.contains(ic))
consumers.add(ic);
}
public boolean isConsumer(ImageConsumer ic)
@ -589,7 +598,7 @@ public class BufferedImage extends Image
public void removeConsumer(ImageConsumer ic)
{
consumers.remove(ic);
consumers.remove(ic);
}
public void startProduction(ImageConsumer ic)
@ -610,9 +619,9 @@ public class BufferedImage extends Image
consumers.add(ic);
for(int i=0;i<consumers.size();i++)
for(int i = 0; i < consumers.size(); i++)
{
ImageConsumer c = (ImageConsumer) consumers.elementAt(i);
ImageConsumer c = consumers.elementAt(i);
c.setHints(ImageConsumer.SINGLEPASS);
c.setDimensions(getWidth(), getHeight());
c.setPixels(x, y, width, height, model, pixels, offset, stride);
@ -638,10 +647,8 @@ public class BufferedImage extends Image
WritableRaster subRaster =
getRaster().createWritableChild(x, y, w, h, 0, 0, null);
return new BufferedImage(getColorModel(),
subRaster,
isPremultiplied,
properties);
return new BufferedImage(getColorModel(), subRaster, isPremultiplied,
properties);
}
public Raster getTile(int tileX, int tileY)
@ -730,9 +737,7 @@ public class BufferedImage extends Image
// create a dest child that has the right bounds...
WritableRaster dest =
raster.createWritableChild(x, y, w, h, x, y,
null // same bands
);
raster.createWritableChild(x, y, w, h, x, y, null);
if (src.getSampleModel () instanceof ComponentSampleModel
&& dest.getSampleModel () instanceof ComponentSampleModel)
@ -762,14 +767,14 @@ public class BufferedImage extends Image
Object rgbElem = null;
for (int y=startY; y<endY; y++)
{
int xoffset = offset;
for (int x=startX; x<endX; x++)
{
int argb = argbArray[xoffset++];
rgbElem = colorModel.getDataElements(argb, rgbElem);
raster.setDataElements(x, y, rgbElem);
}
offset += scanlineStride;
int xoffset = offset;
for (int x=startX; x<endX; x++)
{
int argb = argbArray[xoffset++];
rgbElem = colorModel.getDataElements(argb, rgbElem);
raster.setDataElements(x, y, rgbElem);
}
offset += scanlineStride;
}
}
@ -800,7 +805,7 @@ public class BufferedImage extends Image
public void addTileObserver (TileObserver to)
{
if (tileObservers == null)
tileObservers = new Vector ();
tileObservers = new Vector<TileObserver>();
tileObservers.add (to);
}