# HG changeset patch # User claus # Date 776049390 -7200 # Node ID 6bc436eb4c4a61a0d9afa3a7de208435ff77b12f # Parent 11c422f6d825f0260d44bf9f2761e6f25cb83393 *** empty log message *** diff -r 11c422f6d825 -r 6bc436eb4c4a WinIconRdr.st --- a/WinIconRdr.st Fri Aug 05 03:15:13 1994 +0200 +++ b/WinIconRdr.st Fri Aug 05 03:16:30 1994 +0200 @@ -20,6 +20,8 @@ WindowsIconReader comment:' COPYRIGHT (c) 1993 by Claus Gittinger All Rights Reserved + +$Header: /cvs/stx/stx/libview2/Attic/WinIconRdr.st,v 1.7 1994-08-05 01:16:24 claus Exp $ '! !WindowsIconReader class methodsFor:'documentation'! @@ -40,7 +42,7 @@ version " -$Header: /cvs/stx/stx/libview2/Attic/WinIconRdr.st,v 1.6 1994-06-03 00:54:08 claus Exp $ +$Header: /cvs/stx/stx/libview2/Attic/WinIconRdr.st,v 1.7 1994-08-05 01:16:24 claus Exp $ " ! diff -r 11c422f6d825 -r 6bc436eb4c4a WindowsIconReader.st --- a/WindowsIconReader.st Fri Aug 05 03:15:13 1994 +0200 +++ b/WindowsIconReader.st Fri Aug 05 03:16:30 1994 +0200 @@ -20,6 +20,8 @@ WindowsIconReader comment:' COPYRIGHT (c) 1993 by Claus Gittinger All Rights Reserved + +$Header: /cvs/stx/stx/libview2/WindowsIconReader.st,v 1.7 1994-08-05 01:16:24 claus Exp $ '! !WindowsIconReader class methodsFor:'documentation'! @@ -40,7 +42,7 @@ version " -$Header: /cvs/stx/stx/libview2/WindowsIconReader.st,v 1.6 1994-06-03 00:54:08 claus Exp $ +$Header: /cvs/stx/stx/libview2/WindowsIconReader.st,v 1.7 1994-08-05 01:16:24 claus Exp $ " ! diff -r 11c422f6d825 -r 6bc436eb4c4a XBMReader.st --- a/XBMReader.st Fri Aug 05 03:15:13 1994 +0200 +++ b/XBMReader.st Fri Aug 05 03:16:30 1994 +0200 @@ -20,6 +20,8 @@ XBMReader comment:' COPYRIGHT (c) 1992 by Claus Gittinger All Rights Reserved + +$Header: /cvs/stx/stx/libview2/XBMReader.st,v 1.7 1994-08-05 01:16:28 claus Exp $ '! !XBMReader class methodsFor:'documentation'! @@ -40,7 +42,7 @@ version " -$Header: /cvs/stx/stx/libview2/XBMReader.st,v 1.6 1994-06-03 00:54:11 claus Exp $ +$Header: /cvs/stx/stx/libview2/XBMReader.st,v 1.7 1994-08-05 01:16:28 claus Exp $ " ! @@ -48,7 +50,9 @@ " this class provides methods for loading and saving x-bitmap-file images. These images can (for example) be created using the bitmap editor supplied - with X. Only monochrome images can be represented in thos format. + with X. + Only monochrome images can be represented in this format. + See also: XPMRreader, SunReader, WinIconReader, GIFReader and TIFFReader " ! ! diff -r 11c422f6d825 -r 6bc436eb4c4a XPMReader.st --- a/XPMReader.st Fri Aug 05 03:15:13 1994 +0200 +++ b/XPMReader.st Fri Aug 05 03:16:30 1994 +0200 @@ -20,6 +20,8 @@ XPMReader comment:' COPYRIGHT (c) 1994 by Claus Gittinger All Rights Reserved + +$Header: /cvs/stx/stx/libview2/XPMReader.st,v 1.2 1994-08-05 01:16:30 claus Exp $ '! !XPMReader class methodsFor:'documentation'! @@ -40,20 +42,25 @@ version " -$Header: /cvs/stx/stx/libview2/XPMReader.st,v 1.1 1994-06-03 00:54:13 claus Exp $ +$Header: /cvs/stx/stx/libview2/XPMReader.st,v 1.2 1994-08-05 01:16:30 claus Exp $ " ! documentation " this class provides methods for loading x-pixmap-file (xpm) images. - These images are used (in X) for palette images (see ctwm or hp-vue for a lot of them). - The code here is a hack - it may not work for all images (it works for the testfiles - I got here). - Limitations: only reads the full-color specification, ignoring monochrome - and greyscale info. - Can only handle single-character index. - Does not (currently) handle none-colors (i.e. for image-masks). + These images are used (in X) for palette images (see ctwm or hp-vue for a lot + of them). The code here is a hack - it may not work for all images (it works + for the testfiles I got here). + Limitations: + only reads the full-color specification, ignoring monochrome + and greyscale info. + + Can only handle single-character index. + + Does not (currently) handle none-colors (i.e. for image-masks). + + Save not supported Suggestions: adapt & use the XPM library here. " @@ -93,12 +100,13 @@ aStream peek == $# ifTrue:[ aStream next. s := '#'. - [aStream peek isAlphaNumeric] whileTrue:[ - s := s copyWith:aStream next - ]. - ^ s + ] ifFalse:[ + s := ''. ]. - ^ aStream upTo:$" + [aStream peek isAlphaNumeric] whileTrue:[ + s := s copyWith:aStream next + ]. + ^ s ! fromFile:aFileName @@ -171,6 +179,7 @@ inStream close. ^ nil ]. + s := ReadStream on:line. s next. "skip quote" index := s next asciiValue. @@ -220,8 +229,9 @@ colorName := self colorNameFrom:s. s skipSeparators. ] ifFalse:[ - 'XPM: expected ''c'',''m'',''g'' or ''s''' errorPrintNL. - s next. + 'XPM: format error (expected ''c'',''m'',''g'' or ''s'')' errorPrintNL. + inStream close. + ^ nil ]. ] ] @@ -273,7 +283,9 @@ samplesPerPixel := 1. bitsPerSample := Array with:bitsPerPixel. - "XPMReader fromFile:'bitmaps/magtape.xpm'" - "XPMReader fromFile:'bitmaps/pixmap.xpm'" - "XPMReader fromFile:'bitmaps/ljet.xpm'" + " + XPMReader fromFile:'../fileIn/bitmaps/magtape.xpm' + XPMReader fromFile:'../fileIn/bitmaps/pixmap.xpm' + XPMReader fromFile:'../fileIn/bitmaps/ljet.xpm' + " ! !