#on: -> #onDevice:
authorClaus Gittinger <cg@exept.de>
Fri, 06 Jun 1997 12:57:25 +0200
changeset 1742 ca904d85a84c
parent 1741 b84a2f4317e9
child 1743 ad42ac21bc96
#on: -> #onDevice:
DevGC.st
DeviceGraphicsContext.st
--- a/DevGC.st	Thu Jun 05 21:08:55 1997 +0200
+++ b/DevGC.st	Fri Jun 06 12:57:25 1997 +0200
@@ -564,62 +564,62 @@
     |fgId bgId|
 
     ((fgColor ~~ paint) or:[bgColor ~~ bgPaint]) ifTrue:[
-	fgColor notNil ifTrue:[
-	    paint := fgColor
-	].
-	bgColor notNil ifTrue:[
-	    bgPaint := bgColor
-	].
-	gcId notNil ifTrue:[
-	    paint := paint on:device.
-	    paint isColor ifTrue:[
-		fgId := paint colorId.
-		fgId notNil ifTrue:[
-		    mask notNil ifTrue:[
-			mask := nil.
-			device setBitmapMask:nil in:gcId
-		    ]. 
-		    bgPaint := bgPaint on:device.
-		    bgPaint isColor ifTrue:[
-			bgId := bgPaint colorId.
-			bgId notNil ifTrue:[
-			    "the common case, both are real colors"
-			    (paint ~~ foreground) ifTrue:[
-				foreground := paint.
-				(bgPaint ~~ background) ifTrue:[
-				    background := bgPaint.
-				    device setForeground:fgId background:bgId in:gcId.
-				    ^ self
-				].
-				device setForeground:fgId in:gcId.
-				^ self
-			    ].
-			    (bgPaint ~~ background) ifTrue:[
-				background := bgPaint.
-				device setBackground:bgId in:gcId.
-			    ].
-			    ^ self
-			].
-			"bgPaint is dithered, setup paint here, leave bgPaint
-			 till next opaque draw comes around."
-
-			(paint ~~ foreground) ifTrue:[
-			    foreground := paint.
-			    device setForeground:fgId in:gcId
-			].
-			^ self
-		    ]
-		]
-	    ].
-	    "either paint or bgPaint (or both) are dithered colors,
-	     setup for paint, leave bg-problem till next opaque draw
-	     comes around.
-	    "
-	    self setGCForPaint.
-	]
+        fgColor notNil ifTrue:[
+            paint := fgColor
+        ].
+        bgColor notNil ifTrue:[
+            bgPaint := bgColor
+        ].
+        gcId notNil ifTrue:[
+            paint := paint on:device.
+            paint isColor ifTrue:[
+                fgId := paint colorId.
+                fgId notNil ifTrue:[
+                    mask notNil ifTrue:[
+                        mask := nil.
+                        device setBitmapMask:nil in:gcId
+                    ]. 
+                    bgPaint := bgPaint onDevice:device.
+                    bgPaint isColor ifTrue:[
+                        bgId := bgPaint colorId.
+                        bgId notNil ifTrue:[
+                            "the common case, both are real colors"
+                            (paint ~~ foreground) ifTrue:[
+                                foreground := paint.
+                                (bgPaint ~~ background) ifTrue:[
+                                    background := bgPaint.
+                                    device setForeground:fgId background:bgId in:gcId.
+                                    ^ self
+                                ].
+                                device setForeground:fgId in:gcId.
+                                ^ self
+                            ].
+                            (bgPaint ~~ background) ifTrue:[
+                                background := bgPaint.
+                                device setBackground:bgId in:gcId.
+                            ].
+                            ^ self
+                        ].
+                        "bgPaint is dithered, setup paint here, leave bgPaint
+                         till next opaque draw comes around."
+
+                        (paint ~~ foreground) ifTrue:[
+                            foreground := paint.
+                            device setForeground:fgId in:gcId
+                        ].
+                        ^ self
+                    ]
+                ]
+            ].
+            "either paint or bgPaint (or both) are dithered colors,
+             setup for paint, leave bg-problem till next opaque draw
+             comes around.
+            "
+            self setGCForPaint.
+        ]
     ]
 
-    "Modified: 16.5.1996 / 15:37:05 / cg"
+    "Modified: 6.6.1997 / 12:56:55 / cg"
 !
 
 paint:fgColor on:bgColor function:f
@@ -3576,65 +3576,65 @@
     |dither map pixelId p fg bg vOrg ditherDepth deviceDepth|
 
     gcId notNil ifTrue:[
-	(p := paint) isColor ifTrue:[
-	    paint := p := p on:device.
-	    pixelId := p colorId.
-	    pixelId notNil ifTrue:[
-		"
-		 a real (undithered) color
-		"
-		mask notNil ifTrue:[
-		    mask := nil.
-		    device setBitmapMask:nil in:gcId
-		]. 
-		(p ~~ foreground) ifTrue:[
-		    foreground := paint.
-		    device setForeground:pixelId in:gcId
-		].
-		^ self
-	    ].
-	    "a dithered color"
-	    dither := paint ditherForm.
-	] ifFalse:[
-	    "mhmh - seems to be some kind of form ..."
-	    paint := paint on:device.
-	    dither := paint
-	].
-	"
-	 a dithered color or image
-	"
-	(ditherDepth := dither depth) == 1 ifTrue:[
-	    "a simple 0/1 bitmap"
-	    map := dither colorMap.
-	    "temporary (kludgy) fix for destroyed paint"
-	    p := paint.
-	    map isNil ifTrue:[
-		fg := Color black.
-		bg := Color white.
-	    ] ifFalse:[
-		fg := map at:2.
-		bg := map at:1.
-	    ].
-	    self foreground:fg background:bg.
-	    paint := p
-	] ifFalse:[
-	    deviceDepth := device depth.
-	    (ditherDepth ~~ deviceDepth) ifTrue:[
-		dither := dither asFormOn:device.
-		ditherDepth := dither depth.
-		(dither isNil or:[ditherDepth ~~ deviceDepth]) ifTrue:[
-		    self error:'bad dither'.
-		    ^ self
-		]
-	    ]
-	].
-	self mask:dither.
-	vOrg := self viewOrigin.
-	self setMaskOriginX:vOrg x negated y:vOrg y negated.
+        (p := paint) isColor ifTrue:[
+            paint := p := p on:device.
+            pixelId := p colorId.
+            pixelId notNil ifTrue:[
+                "
+                 a real (undithered) color
+                "
+                mask notNil ifTrue:[
+                    mask := nil.
+                    device setBitmapMask:nil in:gcId
+                ]. 
+                (p ~~ foreground) ifTrue:[
+                    foreground := paint.
+                    device setForeground:pixelId in:gcId
+                ].
+                ^ self
+            ].
+            "a dithered color"
+            dither := paint ditherForm.
+        ] ifFalse:[
+            "mhmh - seems to be some kind of form ..."
+            paint := paint onDevice:device.
+            dither := paint
+        ].
+        "
+         a dithered color or image
+        "
+        (ditherDepth := dither depth) == 1 ifTrue:[
+            "a simple 0/1 bitmap"
+            map := dither colorMap.
+            "temporary (kludgy) fix for destroyed paint"
+            p := paint.
+            map isNil ifTrue:[
+                fg := Color black.
+                bg := Color white.
+            ] ifFalse:[
+                fg := map at:2.
+                bg := map at:1.
+            ].
+            self foreground:fg background:bg.
+            paint := p
+        ] ifFalse:[
+            deviceDepth := device depth.
+            (ditherDepth ~~ deviceDepth) ifTrue:[
+                dither := dither asFormOn:device.
+                ditherDepth := dither depth.
+                (dither isNil or:[ditherDepth ~~ deviceDepth]) ifTrue:[
+                    self error:'bad dither'.
+                    ^ self
+                ]
+            ]
+        ].
+        self mask:dither.
+        vOrg := self viewOrigin.
+        self setMaskOriginX:vOrg x negated y:vOrg y negated.
     ]
 
     "Created: 16.5.1996 / 15:35:51 / cg"
-    "Modified: 12.6.1996 / 12:49:07 / cg"
+    "Modified: 6.6.1997 / 12:55:38 / cg"
 ! !
 
 !DeviceGraphicsContext methodsFor:'queries'!
@@ -3698,6 +3698,6 @@
 !DeviceGraphicsContext class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Attic/DevGC.st,v 1.45 1997-06-05 19:08:31 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Attic/DevGC.st,v 1.46 1997-06-06 10:57:25 cg Exp $'
 ! !
 DeviceGraphicsContext initialize!
--- a/DeviceGraphicsContext.st	Thu Jun 05 21:08:55 1997 +0200
+++ b/DeviceGraphicsContext.st	Fri Jun 06 12:57:25 1997 +0200
@@ -564,62 +564,62 @@
     |fgId bgId|
 
     ((fgColor ~~ paint) or:[bgColor ~~ bgPaint]) ifTrue:[
-	fgColor notNil ifTrue:[
-	    paint := fgColor
-	].
-	bgColor notNil ifTrue:[
-	    bgPaint := bgColor
-	].
-	gcId notNil ifTrue:[
-	    paint := paint on:device.
-	    paint isColor ifTrue:[
-		fgId := paint colorId.
-		fgId notNil ifTrue:[
-		    mask notNil ifTrue:[
-			mask := nil.
-			device setBitmapMask:nil in:gcId
-		    ]. 
-		    bgPaint := bgPaint on:device.
-		    bgPaint isColor ifTrue:[
-			bgId := bgPaint colorId.
-			bgId notNil ifTrue:[
-			    "the common case, both are real colors"
-			    (paint ~~ foreground) ifTrue:[
-				foreground := paint.
-				(bgPaint ~~ background) ifTrue:[
-				    background := bgPaint.
-				    device setForeground:fgId background:bgId in:gcId.
-				    ^ self
-				].
-				device setForeground:fgId in:gcId.
-				^ self
-			    ].
-			    (bgPaint ~~ background) ifTrue:[
-				background := bgPaint.
-				device setBackground:bgId in:gcId.
-			    ].
-			    ^ self
-			].
-			"bgPaint is dithered, setup paint here, leave bgPaint
-			 till next opaque draw comes around."
-
-			(paint ~~ foreground) ifTrue:[
-			    foreground := paint.
-			    device setForeground:fgId in:gcId
-			].
-			^ self
-		    ]
-		]
-	    ].
-	    "either paint or bgPaint (or both) are dithered colors,
-	     setup for paint, leave bg-problem till next opaque draw
-	     comes around.
-	    "
-	    self setGCForPaint.
-	]
+        fgColor notNil ifTrue:[
+            paint := fgColor
+        ].
+        bgColor notNil ifTrue:[
+            bgPaint := bgColor
+        ].
+        gcId notNil ifTrue:[
+            paint := paint on:device.
+            paint isColor ifTrue:[
+                fgId := paint colorId.
+                fgId notNil ifTrue:[
+                    mask notNil ifTrue:[
+                        mask := nil.
+                        device setBitmapMask:nil in:gcId
+                    ]. 
+                    bgPaint := bgPaint onDevice:device.
+                    bgPaint isColor ifTrue:[
+                        bgId := bgPaint colorId.
+                        bgId notNil ifTrue:[
+                            "the common case, both are real colors"
+                            (paint ~~ foreground) ifTrue:[
+                                foreground := paint.
+                                (bgPaint ~~ background) ifTrue:[
+                                    background := bgPaint.
+                                    device setForeground:fgId background:bgId in:gcId.
+                                    ^ self
+                                ].
+                                device setForeground:fgId in:gcId.
+                                ^ self
+                            ].
+                            (bgPaint ~~ background) ifTrue:[
+                                background := bgPaint.
+                                device setBackground:bgId in:gcId.
+                            ].
+                            ^ self
+                        ].
+                        "bgPaint is dithered, setup paint here, leave bgPaint
+                         till next opaque draw comes around."
+
+                        (paint ~~ foreground) ifTrue:[
+                            foreground := paint.
+                            device setForeground:fgId in:gcId
+                        ].
+                        ^ self
+                    ]
+                ]
+            ].
+            "either paint or bgPaint (or both) are dithered colors,
+             setup for paint, leave bg-problem till next opaque draw
+             comes around.
+            "
+            self setGCForPaint.
+        ]
     ]
 
-    "Modified: 16.5.1996 / 15:37:05 / cg"
+    "Modified: 6.6.1997 / 12:56:55 / cg"
 !
 
 paint:fgColor on:bgColor function:f
@@ -3576,65 +3576,65 @@
     |dither map pixelId p fg bg vOrg ditherDepth deviceDepth|
 
     gcId notNil ifTrue:[
-	(p := paint) isColor ifTrue:[
-	    paint := p := p on:device.
-	    pixelId := p colorId.
-	    pixelId notNil ifTrue:[
-		"
-		 a real (undithered) color
-		"
-		mask notNil ifTrue:[
-		    mask := nil.
-		    device setBitmapMask:nil in:gcId
-		]. 
-		(p ~~ foreground) ifTrue:[
-		    foreground := paint.
-		    device setForeground:pixelId in:gcId
-		].
-		^ self
-	    ].
-	    "a dithered color"
-	    dither := paint ditherForm.
-	] ifFalse:[
-	    "mhmh - seems to be some kind of form ..."
-	    paint := paint on:device.
-	    dither := paint
-	].
-	"
-	 a dithered color or image
-	"
-	(ditherDepth := dither depth) == 1 ifTrue:[
-	    "a simple 0/1 bitmap"
-	    map := dither colorMap.
-	    "temporary (kludgy) fix for destroyed paint"
-	    p := paint.
-	    map isNil ifTrue:[
-		fg := Color black.
-		bg := Color white.
-	    ] ifFalse:[
-		fg := map at:2.
-		bg := map at:1.
-	    ].
-	    self foreground:fg background:bg.
-	    paint := p
-	] ifFalse:[
-	    deviceDepth := device depth.
-	    (ditherDepth ~~ deviceDepth) ifTrue:[
-		dither := dither asFormOn:device.
-		ditherDepth := dither depth.
-		(dither isNil or:[ditherDepth ~~ deviceDepth]) ifTrue:[
-		    self error:'bad dither'.
-		    ^ self
-		]
-	    ]
-	].
-	self mask:dither.
-	vOrg := self viewOrigin.
-	self setMaskOriginX:vOrg x negated y:vOrg y negated.
+        (p := paint) isColor ifTrue:[
+            paint := p := p on:device.
+            pixelId := p colorId.
+            pixelId notNil ifTrue:[
+                "
+                 a real (undithered) color
+                "
+                mask notNil ifTrue:[
+                    mask := nil.
+                    device setBitmapMask:nil in:gcId
+                ]. 
+                (p ~~ foreground) ifTrue:[
+                    foreground := paint.
+                    device setForeground:pixelId in:gcId
+                ].
+                ^ self
+            ].
+            "a dithered color"
+            dither := paint ditherForm.
+        ] ifFalse:[
+            "mhmh - seems to be some kind of form ..."
+            paint := paint onDevice:device.
+            dither := paint
+        ].
+        "
+         a dithered color or image
+        "
+        (ditherDepth := dither depth) == 1 ifTrue:[
+            "a simple 0/1 bitmap"
+            map := dither colorMap.
+            "temporary (kludgy) fix for destroyed paint"
+            p := paint.
+            map isNil ifTrue:[
+                fg := Color black.
+                bg := Color white.
+            ] ifFalse:[
+                fg := map at:2.
+                bg := map at:1.
+            ].
+            self foreground:fg background:bg.
+            paint := p
+        ] ifFalse:[
+            deviceDepth := device depth.
+            (ditherDepth ~~ deviceDepth) ifTrue:[
+                dither := dither asFormOn:device.
+                ditherDepth := dither depth.
+                (dither isNil or:[ditherDepth ~~ deviceDepth]) ifTrue:[
+                    self error:'bad dither'.
+                    ^ self
+                ]
+            ]
+        ].
+        self mask:dither.
+        vOrg := self viewOrigin.
+        self setMaskOriginX:vOrg x negated y:vOrg y negated.
     ]
 
     "Created: 16.5.1996 / 15:35:51 / cg"
-    "Modified: 12.6.1996 / 12:49:07 / cg"
+    "Modified: 6.6.1997 / 12:55:38 / cg"
 ! !
 
 !DeviceGraphicsContext methodsFor:'queries'!
@@ -3698,6 +3698,6 @@
 !DeviceGraphicsContext class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/DeviceGraphicsContext.st,v 1.45 1997-06-05 19:08:31 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/DeviceGraphicsContext.st,v 1.46 1997-06-06 10:57:25 cg Exp $'
 ! !
 DeviceGraphicsContext initialize!