checkin from browser
authorClaus Gittinger <cg@exept.de>
Sat, 01 Mar 1997 22:54:52 +0100
changeset 470 4709c3f524cd
parent 469 7b58a1bf581c
child 471 350583677b5b
checkin from browser
XPMReader.st
--- a/XPMReader.st	Sat Mar 01 21:34:32 1997 +0100
+++ b/XPMReader.st	Sat Mar 01 22:54:52 1997 +0100
@@ -143,7 +143,7 @@
     |line 
      srcIndex "{ Class: SmallInteger }"
      dstIndex "{ Class: SmallInteger }"
-     colorName monoName greyName symbolicName colorMapSize redMap greenMap blueMap
+     colorName monoName greyName grey4Name symbolicName colorMapSize redMap greenMap blueMap
      charsPerPixel xlation s bitsPerPixel char lineDone maskPixelValue
      state|
 
@@ -233,32 +233,40 @@
                             "/ grey data
                             state := $g. greyName := ''.
                         ] ifFalse:[
-                            word = 'c' ifTrue:[
-                                "/ color data
-                                state := $c. colorName := ''.
+                            word = 'g4' ifTrue:[
+                                "/ grey data
+                                state := $G. grey4Name := ''.
                             ] ifFalse:[
-                                "/ append to name
-                                state isNil ifTrue:[
-                                    'XPM: format error got: ' errorPrint.
-                                    word errorPrint. 
-                                     ' (expected ''c'',''m'',''g'' or ''s'')' errorPrintNL.
-                                    ^ nil
-                                ].
+                                word = 'c' ifTrue:[
+                                    "/ color data
+                                    state := $c. colorName := ''.
+                                ] ifFalse:[
+                                    "/ append to name
+                                    state isNil ifTrue:[
+                                        'XPM: format error got: ' errorPrint.
+                                        word errorPrint. 
+                                         ' (expected ''c'',''m'',''g'' or ''s'')' errorPrintNL.
+                                        ^ nil
+                                    ].
 
-                                state == $m ifTrue:[
-                                    monoName := monoName , ' ' , word.
-                                ].
-                                state == $g ifTrue:[
-                                    greyName := greyName , ' ' , word.
-                                ].
-                                state == $c ifTrue:[
-                                    colorName := colorName , ' ' , word.
-                                ].
-                                state == $s ifTrue:[
-                                    symbolicName := symbolicName , ' ' , word.
-                                ].
-                                (word startsWith:'#') ifTrue:[
-                                    state := nil.
+                                    state == $m ifTrue:[
+                                        monoName := monoName , ' ' , word.
+                                    ].
+                                    state == $g ifTrue:[
+                                        greyName := greyName , ' ' , word.
+                                    ].
+                                    state == $G ifTrue:[
+                                        grey4Name := grey4Name , ' ' , word.
+                                    ].
+                                    state == $c ifTrue:[
+                                        colorName := colorName , ' ' , word.
+                                    ].
+                                    state == $s ifTrue:[
+                                        symbolicName := symbolicName , ' ' , word.
+                                    ].
+                                    (word startsWith:'#') ifTrue:[
+                                        state := nil.
+                                    ]
                                 ]
                             ]
                         ]
@@ -276,6 +284,9 @@
         greyName notNil ifTrue:[
             greyName := greyName withoutSeparators
         ].
+        grey4Name notNil ifTrue:[
+            grey4Name := grey4Name withoutSeparators
+        ].
         symbolicName notNil ifTrue:[
             symbolicName := symbolicName withoutSeparators
         ].
@@ -291,7 +302,9 @@
             ]
         ].
 
-        ((colorName = 'none') or:[colorName = 'None']) ifTrue:[
+        ((colorName = 'none') 
+        or:[colorName = 'None'
+        or:[colorName = 'NONE']]) ifTrue:[
             color := Color noColor. "/ white
             redMap at:colorIndex put:0.
             greenMap at:colorIndex put:0.
@@ -352,7 +365,7 @@
     "Created: 24.9.1995 / 06:20:06 / claus"
     "Modified: 24.9.1995 / 07:07:33 / claus"
     "Modified: 5.7.1996 / 17:27:59 / stefan"
-    "Modified: 24.1.1997 / 14:45:02 / cg"
+    "Modified: 1.3.1997 / 22:22:53 / cg"
 ! !
 
 !XPMReader methodsFor:'writing to a file'!
@@ -468,6 +481,6 @@
 !XPMReader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/XPMReader.st,v 1.25 1997-03-01 20:34:32 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/XPMReader.st,v 1.26 1997-03-01 21:54:52 cg Exp $'
 ! !
 XPMReader initialize!