Commit ec22cdf1 by Thomas Fitzsimmons Committed by Thomas Fitzsimmons

GtkImage.java (setDimensions, [...]): Check that io is not null before calling io.imageUpdate.

2003-12-01  Thomas Fitzsimmons  <fitzsim@redhat.com>

	* gnu/java/awt/peer/gtk/GtkImage.java (setDimensions,
	setProperties): Check that io is not null before calling
	io.imageUpdate.
	* java/awt/image/ImageConsumer.java (setPixels, imageComplete):
	Update javadocs.
	* java/awt/image/PixelGrabber.java: Fix implementation and
	update javadocs.

From-SVN: r74103
parent a1ff4c64
2003-12-01 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/awt/peer/gtk/GtkImage.java (setDimensions,
setProperties): Check that io is not null before calling
io.imageUpdate.
* java/awt/image/ImageConsumer.java (setPixels, imageComplete):
Update javadocs.
* java/awt/image/PixelGrabber.java: Fix implementation and
update javadocs.
2003-12-01 Michael Koch <konqueror@gmx.de>
* gnu/java/net/natPlainSocketImplPosix.cc
......@@ -572,7 +582,7 @@
attributes for character.
(quoteChar): Likewise.
2003-11-14 Tom Fitzsimmons <fitzsim@redhat.com>
2003-11-14 Thomas Fitzsimmons <fitzsim@redhat.com>
* java/awt/GridBagLayout.java (getLayoutDimensions): Return array of two
zero-length int arrays when layoutInfo is null.
......@@ -606,7 +616,7 @@
(helper_put_filedescriptors): Change to static linkage.
(helper_get_filedescriptors): Likewise.
2003-11-12 Tom Fitzsimmons <fitzsim@redhat.com>
2003-11-12 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/awt/peer/gtk/GtkComponentPeer.java (prepareImage): Remove
null check.
......
/* GtkImage.java
Copyright (C) 1999, 2002 Free Software Foundation, Inc.
Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
......@@ -168,13 +168,15 @@ public class GtkImage extends Image implements ImageConsumer
for (int i = 0; i < widthObservers.size (); i++)
{
ImageObserver io = (ImageObserver) widthObservers.elementAt (i);
io.imageUpdate (this, ImageObserver.WIDTH, -1, -1, width, height);
if (io != null)
io.imageUpdate (this, ImageObserver.WIDTH, -1, -1, width, height);
}
for (int i = 0; i < heightObservers.size (); i++)
{
ImageObserver io = (ImageObserver) heightObservers.elementAt (i);
io.imageUpdate (this, ImageObserver.HEIGHT, -1, -1, width, height);
if (io != null)
io.imageUpdate (this, ImageObserver.HEIGHT, -1, -1, width, height);
}
if (observer != null)
......@@ -192,7 +194,8 @@ public class GtkImage extends Image implements ImageConsumer
for (int i = 0; i < propertyObservers.size (); i++)
{
ImageObserver io = (ImageObserver) propertyObservers.elementAt (i);
io.imageUpdate (this, ImageObserver.PROPERTIES, -1, -1, width, height);
if (io != null)
io.imageUpdate (this, ImageObserver.PROPERTIES, -1, -1, width, height);
}
}
......
/* ImageConsumer.java -- Java interface for image consumption
Copyright (C) 1999 Free Software Foundation, Inc.
Copyright (C) 1999, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
......@@ -160,17 +160,45 @@ public interface ImageConsumer
void setHints(int flags);
/**
* This function delivers a rectangle of pixels where any
* pixel(m,n) is stored in the array as a <code>byte</code> at
* index (n * scansize + m + offset).
* Deliver a subset of an ImageProducer's pixels to this ImageConsumer.
*
* Each element of the pixels array represents one pixel. The
* pixel data is formatted according to the color model model.
* The x and y parameters are the coordinates of the block of
* pixels being delivered to this ImageConsumer. They are
* specified relative to the top left corner of the image being
* produced. Likewise, w and h are the pixel block's dimensions.
*
* @param x x coordinate of pixel block
* @param y y coordinate of pixel block
* @param w width of pixel block
* @param h height of pixel block
* @param model color model used to interpret pixel data
* @param pixels pixel block data
* @param offset offset into pixels array
* @param scansize width of one row in the pixel block
*/
void setPixels(int x, int y, int w, int h,
ColorModel model, byte[] pixels, int offset, int scansize);
/**
* This function delivers a rectangle of pixels where any
* pixel(m,n) is stored in the array as an <code>int</code> at
* index (n * scansize + m + offset).
* Deliver a subset of an ImageProducer's pixels to this ImageConsumer.
*
* Each element of the pixels array represents one pixel. The
* pixel data is formatted according to the color model model.
* The x and y parameters are the coordinates of the rectangular
* region of pixels being delivered to this ImageConsumer,
* specified relative to the top left corner of the image being
* produced. Likewise, w and h are the pixel region's dimensions.
*
* @param x x coordinate of pixel block
* @param y y coordinate of pixel block
* @param w width of pixel block
* @param h height of pixel block
* @param model color model used to interpret pixel data
* @param pixels pixel block data
* @param offset offset into pixels array
* @param scansize width of one row in the pixel block
*/
void setPixels(int x, int y, int w, int h,
ColorModel model, int[] pixels, int offset, int scansize);
......@@ -180,7 +208,9 @@ public interface ImageConsumer
* single frame or the entire image is complete. The method is
* also used to indicate an error in loading or producing the
* image.
*
* @param status the status of image production, represented by a
* bitwise OR of ImageConsumer flags
*/
void imageComplete(int status);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment