Makefile.am: Add GdkPixbufDecoder.java and gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
2003-11-11 Thomas Fitzsimmons <fitzsim@redhat.com> * Makefile.am: Add GdkPixbufDecoder.java and gnu_java_awt_peer_gtk_GdkPixbufDecoder.c * Makefile.in: Regenerate. * gnu/java/awt/image/ImageDecoder.java (ImageDecoder(byte[],int,int)): New constructor. (startProduction): Create ByteArrayInputStream when url and filename are null. (produce): Declare stream parameter as InputStream. * gnu/java/awt/image/XBMDecoder.java (produce): Declare stream parameter as InputStream. * gnu/java/awt/peer/gtk/GdkPixbufDecoder.java (GdkPixbufDecoder(byte[],int,int)): New constructor. (produce): Declare stream parameter as InputStream. * gnu/java/awt/peer/gtk/GtkComponentPeer.java (prepareImage): Throw NPE if image is null. Set image's observer before running PrepareImage thread. Pass image to startProduction. * gnu/java/awt/peer/gtk/GtkImage.java: Add null checks before calls to source's member functions. (observer): New field. (setObserver): New method. (setDimensions, setPixels, imageComplete): Call observer's imageUpdate. * gnu/java/awt/peer/gtk/GtkToolkit.java (checkImage, getImage): Return new GtkImage. (prepareImage): Implement. * java/awt/Component.java: Add static fields incrementalDraw and redrawRate. (imageUpdate): Implement. (createImage): Call Toolkit's createImage if peer is null. (prepareImage): Throw NPE if image is null. * java/awt/MediaTracker.java: Fix return value. From-SVN: r73476
This commit is contained in:
parent
c754c6f131
commit
a5966c9ef9
11 changed files with 207 additions and 47 deletions
|
@ -41,6 +41,7 @@ package gnu.java.awt.peer.gtk;
|
|||
import java.awt.image.*;
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.Vector;
|
||||
|
@ -85,6 +86,12 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
|
|||
initState ();
|
||||
}
|
||||
|
||||
public GdkPixbufDecoder (byte[] imagedata, int imageoffset, int imagelength)
|
||||
{
|
||||
super (imagedata, imageoffset, imagelength);
|
||||
initState ();
|
||||
}
|
||||
|
||||
// called back by native side
|
||||
void areaPrepared (int width, int height)
|
||||
{
|
||||
|
@ -122,7 +129,7 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
|
|||
// this object, feeding back decoded pixel blocks, which we pass to each
|
||||
// of the ImageConsumers in the provided Vector.
|
||||
|
||||
void produce (Vector v, FileInputStream is) throws IOException
|
||||
public void produce (Vector v, InputStream is) throws IOException
|
||||
{
|
||||
curr = v;
|
||||
|
||||
|
@ -213,5 +220,4 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
|
|||
dec.startProduction (bb);
|
||||
return bb.getBufferedImage ();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue