# HG changeset patch # User Frank Benoit # Date 1200937099 -3600 # Node ID 116d23207a866a8ccae535f8877dd07bd5164630 # Parent 14bc18df0c2541b45407f0356af29a69652240ab changed PNG loader to use internal inflating diff -r 14bc18df0c25 -r 116d23207a86 dsss.conf --- a/dsss.conf Mon Jan 21 15:42:00 2008 +0100 +++ b/dsss.conf Mon Jan 21 18:38:19 2008 +0100 @@ -96,6 +96,7 @@ buildflags+=-L-lglib-2.0 buildflags+=-L-lcairo buildflags+=-g -gc +buildflags+=-I/home/frank/jive buildflags+=-Jdwtexamples/controlexample diff -r 14bc18df0c25 -r 116d23207a86 dwt/dwthelper/InflaterInputStream.d --- a/dwt/dwthelper/InflaterInputStream.d Mon Jan 21 15:42:00 2008 +0100 +++ b/dwt/dwthelper/InflaterInputStream.d Mon Jan 21 18:38:19 2008 +0100 @@ -6,6 +6,7 @@ public import dwt.dwthelper.InputStream; import dwt.dwthelper.utils; import tango.io.Stdout; +import tango.io.compress.ZlibStream; class InputStreamWrapper : tango.io.model.IConduit.InputStream { @@ -16,8 +17,7 @@ } uint read (void[] dst){ - int res = istr.read( cast(byte[])dst, 0, dst.length ); - //Stdout.formatln( "read {}/{}", dst.length, res ); + int res = istr.read( cast(byte[])dst ); return res; } @@ -48,16 +48,16 @@ protected int len; package bool usesDefaultInflater = false; - InputStreamWrapper tangoIstr; + ZlibInput tangoIstr; public this ( dwt.dwthelper.InputStream.InputStream istr ){ - tangoIstr = new InputStreamWrapper(istr ); + tangoIstr = new ZlibInput( new InputStreamWrapper(istr )); } public int read(){ ubyte[1] data; uint res = tangoIstr.read( data ); - if( res !is tango.io.model.IConduit.IOStream.Eof ){ + if( res !is 1 ){ return data[0] & 0xFF; } return -1; diff -r 14bc18df0c25 -r 116d23207a86 dwt/internal/image/FileFormat.d --- a/dwt/internal/image/FileFormat.d Mon Jan 21 15:42:00 2008 +0100 +++ b/dwt/internal/image/FileFormat.d Mon Jan 21 18:38:19 2008 +0100 @@ -1,4 +1,4 @@ -/******************************************************************************* +/******************************************************************************* * Copyright (c) 2000, 2006 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff -r 14bc18df0c25 -r 116d23207a86 dwt/internal/image/PNGFileFormat.d --- a/dwt/internal/image/PNGFileFormat.d Mon Jan 21 15:42:00 2008 +0100 +++ b/dwt/internal/image/PNGFileFormat.d Mon Jan 21 18:38:19 2008 +0100 @@ -1,4 +1,4 @@ -/******************************************************************************* +/******************************************************************************* * Copyright (c) 2000, 2006 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff -r 14bc18df0c25 -r 116d23207a86 dwt/internal/image/PngChunk.d --- a/dwt/internal/image/PngChunk.d Mon Jan 21 15:42:00 2008 +0100 +++ b/dwt/internal/image/PngChunk.d Mon Jan 21 18:38:19 2008 +0100 @@ -1,4 +1,4 @@ -/******************************************************************************* +/******************************************************************************* * Copyright (c) 2000, 2006 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -312,6 +312,7 @@ int chunkLength = tempChunk.getSize(); byte[] chunk = new byte[chunkLength]; + result = stream.read(chunk, 0, chunkLength); if (result !is chunkLength) return null; diff -r 14bc18df0c25 -r 116d23207a86 dwt/internal/image/PngIendChunk.d --- a/dwt/internal/image/PngIendChunk.d Mon Jan 21 15:42:00 2008 +0100 +++ b/dwt/internal/image/PngIendChunk.d Mon Jan 21 18:38:19 2008 +0100 @@ -1,4 +1,4 @@ -/******************************************************************************* +/******************************************************************************* * Copyright (c) 2000, 2006 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -37,7 +37,7 @@ /** * Answer whether the chunk is a valid IEND chunk. */ -void validate(PngFileReadState readState, PngIhdrChunk headerChunk) { +override void validate(PngFileReadState readState, PngIhdrChunk headerChunk) { // An IEND chunk is invalid if no IHDR has been read. // Or if a palette is required and has not been read. // Or if no IDAT chunk has been read. diff -r 14bc18df0c25 -r 116d23207a86 dwtexamples/controlexample/ControlExample.d --- a/dwtexamples/controlexample/ControlExample.d Mon Jan 21 15:42:00 2008 +0100 +++ b/dwtexamples/controlexample/ControlExample.d Mon Jan 21 18:38:19 2008 +0100 @@ -80,6 +80,8 @@ import tango.util.PathUtil; /*** Linker workaround end ***/ +import jive.stacktrace; + void main(){ ControlExample.main( null ); }