#REFACTORING by cg
authorClaus Gittinger <cg@exept.de>
Thu, 25 Jan 2018 21:33:06 +0100
changeset 8267 93d0af7d74c3
parent 8266 55f8a8196020
child 8268 42d68d6aeab2
#REFACTORING by cg class: GraphicsMedium changed:46 methods avoid duplicate code - all forwared to my GC
GraphicsMedium.st
--- a/GraphicsMedium.st	Thu Jan 25 19:07:48 2018 +0100
+++ b/GraphicsMedium.st	Thu Jan 25 21:33:06 2018 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
@@ -179,13 +181,9 @@
 displayArc:origin radius:radius from:startAngle angle:angle
     "draw an arc around a point"
 
-    self
-	displayArcX:(origin x - radius)
-		  y:(origin y - radius)
-	      width:(radius * 2)
-	     height:(radius * 2)
-	       from:startAngle
-	      angle:angle
+    gc displayArcX:(origin x - radius) y:(origin y - radius)
+       width:(radius * 2) height:(radius * 2)
+       from:startAngle angle:angle
 
     "Modified: 8.5.1996 / 08:34:43 / cg"
 !
@@ -193,12 +191,9 @@
 displayArcBoundedBy:boundingBox startAngle:startAngle sweepAngle:sweepAngle
    "draw an arc/circle/ellipse - ST-80 compatibility"
 
-   ^ self displayArcX:(boundingBox left)
-		    y:(boundingBox top)
-		width:(boundingBox width)
-	       height:(boundingBox height)
-		 from:startAngle
-		angle:sweepAngle
+   gc displayArcX:(boundingBox left) y:(boundingBox top)
+      width:(boundingBox width) height:(boundingBox height)
+      from:startAngle angle:sweepAngle
 
     "Created: / 14.11.1997 / 21:04:19 / cg"
 !
@@ -206,48 +201,41 @@
 displayArcBoundedBy:boundingBox startAngle:startAngle sweepAngle:sweepAngle at:origin
    "draw an arc/circle/ellipse - ST-80 compatibility"
 
-   ^ self displayArcX:(boundingBox left + origin x)
-		    y:(boundingBox top + origin y)
-		width:(boundingBox width)
-	       height:(boundingBox height)
-		 from:startAngle
-		angle:sweepAngle
+   gc displayArcX:(boundingBox left + origin x) y:(boundingBox top + origin y)
+      width:(boundingBox width) height:(boundingBox height)
+      from:startAngle angle:sweepAngle
 !
 
 displayLineFrom:startPoint to:endPoint translateBy:anOffset
     "draw a line - ST-80 compatibility"
 
-    self displayLineFrom:(startPoint + anOffset)
-		      to:(endPoint + anOffset)
+    gc displayLineFrom:(startPoint + anOffset) to:(endPoint + anOffset)
 !
 
 displayPolyline:aPolygon
     "draw a polygon - ST-80 compatibility"
 
-    ^ self displayPolygon:aPolygon
+    gc displayPolygon:aPolygon
 !
 
 displayRectangularBorder:aRectangle
     "draw a rectangle - ST-80 compatibility"
 
-    self displayRectangle:aRectangle
+    gc displayRectangle:aRectangle
 !
 
 displayRectangularBorder:aRectangle at:aPoint
     "draw a rectangle - ST-80 compatibility"
 
-    self displayRectangle:(aRectangle translateBy:aPoint)
+    gc displayRectangle:(aRectangle translateBy:aPoint)
 !
 
 displayWedgeBoundedBy:boundingBox startAngle:startAngle sweepAngle:sweepAngle
    "fill an arc/circle/ellipse - ST-80 compatibility"
 
-   ^ self fillArcX:(boundingBox left)
-		 y:(boundingBox top)
-	     width:(boundingBox width)
-	    height:(boundingBox height)
-	      from:startAngle
-	     angle:sweepAngle
+   gc fillArcX:(boundingBox left) y:(boundingBox top)
+      width:(boundingBox width) height:(boundingBox height)
+      from:startAngle angle:sweepAngle
 
     "Created: 27.1.1997 / 15:50:14 / cg"
 !
@@ -255,12 +243,9 @@
 displayWedgeBoundedBy:boundingBox startAngle:startAngle sweepAngle:sweepAngle at:origin
    "fill an arc/circle/ellipse - ST-80 compatibility"
 
-   ^ self fillArcX:(boundingBox left + origin x)
-		 y:(boundingBox top + origin y)
-	     width:(boundingBox width)
-	    height:(boundingBox height)
-	      from:startAngle
-	     angle:sweepAngle
+   gc fillArcX:(boundingBox left + origin x) y:(boundingBox top + origin y)
+      width:(boundingBox width) height:(boundingBox height)
+      from:startAngle angle:sweepAngle
 !
 
 findFont:aFontDescription
@@ -1353,7 +1338,7 @@
 displayString:aString from:index1 to:index2 x:x y:y opaque:opaque
     "draw part of a string with both fg and bg at x/y in current font"
 
-    self displayString:aString from:index1 to:index2 x:x y:y opaque:opaque maxWidth:self width.
+    gc displayString:aString from:index1 to:index2 x:x y:y opaque:opaque maxWidth:self width.
 !
 
 displayString:aString from:index1 to:index2 x:x y:y opaque:opaque maxWidth:maxWidth
@@ -1498,13 +1483,9 @@
 displayArcIn:aRectangle from:startAngle angle:angle
     "draw an arc in a box"
 
-    self
-	displayArcX:(aRectangle left)
-		  y:(aRectangle top)
-	      width:(aRectangle width)
-	     height:(aRectangle height)
-	       from:startAngle
-	      angle:angle
+    gc displayArcX:(aRectangle left) y:(aRectangle top)
+       width:(aRectangle width) height:(aRectangle height)
+       from:startAngle angle:angle
 !
 
 displayArcOrigin:origin corner:corner from:startAngle angle:angle
@@ -1516,13 +1497,9 @@
     top := origin y.
     right := corner x.
     bot := corner y.
-    self
-	displayArcX:left
-		  y:top
-	      width:(right - left + 1)
-	     height:(bot - top + 1)
-	       from:startAngle
-	      angle:angle
+    gc displayArcX:left y:top
+       width:(right - left + 1) height:(bot - top + 1)
+       from:startAngle angle:angle
 
     "Modified: 8.5.1996 / 08:35:25 / cg"
 !
@@ -1533,7 +1510,7 @@
     <resource:#obsolete>
 
     self obsoleteMethodWarning:'use #displayArcX:y:width:height:from:angle:'.
-    self displayArcX:x y:y width:w height:h from:startAngle angle:angle
+    gc displayArcX:x y:y width:w height:h from:startAngle angle:angle
 
     "Modified: 8.5.1996 / 08:46:56 / cg"
 !
@@ -1547,13 +1524,10 @@
 displayCircleIn:aRectangle
     "draw a circle in a box"
 
-    self
-	displayArcX:(aRectangle left)
-		  y:(aRectangle top)
-	      width:(aRectangle width)
-	     height:(aRectangle height)
-	       from:0
-	      angle:360
+    gc
+        displayArcX:(aRectangle left) y:(aRectangle top)
+        width:(aRectangle width) height:(aRectangle height)
+        from:0 angle:360
 
     "Modified: 8.5.1996 / 08:35:40 / cg"
 !
@@ -1562,14 +1536,12 @@
     "draw a circle around a center point"
 
     |d|
+
     d := 2 * r.
-    self
-	displayArcX:(x - r)
-		  y:(y - r)
-	      width:d
-	     height:d
-	       from:0
-	      angle:360
+    gc
+        displayArcX:(x - r) y:(y - r)
+        width:d height:d
+        from:0 angle:360
 
     "Modified: 8.5.1996 / 08:36:03 / cg"
 !
@@ -1616,9 +1588,9 @@
      If the form has depth ~~ 1, the current fg color setting is ignored."
 
     opaque ifTrue:[
-	self displayOpaqueForm:aFormOrImage x:x y:y
+        gc displayOpaqueForm:aFormOrImage x:x y:y
     ] ifFalse:[
-	self displayForm:aFormOrImage x:x y:y
+        gc displayForm:aFormOrImage x:x y:y
     ].
 !
 
@@ -1654,7 +1626,7 @@
     "draw a line"
 
     gc displayLineFromX:(point1 x) y:(point1 y)
-                      toX:(point2 x) y:(point2 y)
+                    toX:(point2 x) y:(point2 y)
 !
 
 displayLineFromX:xStart y:yStart toX:xEnd y:yEnd brush:aForm
@@ -1662,86 +1634,7 @@
      Here, a slow fallback is used, drawing into a
      temporary bitmap first, which is then displayed"
 
-    |deltaX deltaY dx dy px py destX destY p tempForm
-     xMin xMax yMin yMax x1 x2 y1 y2|
-
-    xStart < xEnd ifTrue:[
-	xMin := xStart.
-	xMax := xEnd.
-    ] ifFalse:[
-	xMin := xEnd.
-	xMax := xStart
-    ].
-    yStart < yEnd ifTrue:[
-	yMin := yStart.
-	yMax := yEnd.
-    ] ifFalse:[
-	yMin := yEnd.
-	yMax := yStart
-    ].
-
-    tempForm := Form width:(xMax-xMin+1+aForm width)
-		     height:(yMax-yMin+1+aForm height)
-		     depth:aForm depth
-		     onDevice:self graphicsDevice.
-    tempForm clear.
-    tempForm paint:(Color colorId:1) on:(Color colorId:0).
-    tempForm function:#or.
-
-    ((yStart = yEnd and:[xStart < xEnd])
-    or: [yStart < yEnd]) ifTrue:[
-	x1 := xStart. y1 := yStart.
-	x2 := xEnd. y2 := yEnd.
-    ] ifFalse:[
-	x1 := xEnd. y1 := yEnd.
-	x2 := xStart. y2 := yStart.
-    ].
-
-    x1 := x1 - xMin.  x2 := x2 - xMin.
-    y1 := y1 - yMin.  y2 := y2 - yMin.
-
-    destX := x1.
-    destY := y1.
-
-    "/ bresenham ...
-
-    deltaX := x2 - x1.
-    deltaY := y2 - y1.
-
-    dx := deltaX sign.
-    dy := deltaY sign.
-    px := deltaY abs.
-    py := deltaX abs.
-
-    tempForm displayForm:aForm x:destX y:destY.
-
-    py > px ifTrue:[
-	"horizontal"
-	p := py // 2.
-	py timesRepeat:[
-	    destX := destX + dx.
-	    (p := p - px) < 0 ifTrue:[
-		destY := destY + dy.
-		p := p + py
-	    ].
-	    tempForm displayForm:aForm x:destX y:destY.
-	]
-    ] ifFalse:[
-	"vertical"
-	p := px // 2.
-	px timesRepeat:[
-	    destY := destY + dy.
-	    (p := p - py) < 0 ifTrue:[
-		destX := destX + dx.
-		p := p + px
-	    ].
-	    tempForm displayForm:aForm x:destX y:destY
-	]
-    ].
-    self displayForm:tempForm
-		   x:xMin-aForm offset x
-		   y:yMin-aForm offset y.
-    tempForm close
+    gc displayLineFromX:xStart y:yStart toX:xEnd y:yEnd brush:aForm.
 
     "Modified: 1.4.1997 / 21:29:06 / cg"
 !
@@ -1833,69 +1726,18 @@
 
     left := origin x.
     top := origin y.
-    self displayRectangleX:left y:top width:(corner x - left) height:(corner y - top)
+    gc displayRectangleX:left y:top width:(corner x - left) height:(corner y - top)
 !
 
 displayRectangleOrigin:origin extent:extent
     "draw a rectangle"
 
-    self displayRectangleX:(origin x) y:(origin y)
-		     width:(extent x)
-		    height:(extent y)
+    gc displayRectangleX:(origin x) y:(origin y)
+       width:(extent x) height:(extent y)
 !
 
 displayRoundRectangleX:left y:top width:width height:height wCorner:wCorn hCorner:hCorn
-    |right bottom wC hC wHalf hHalf isWin32|
-
-    "/ BIG KLUDGE WARNING HERE: the code below looks "good" on windows displays;
-    "/ (if you change anything under Unix, make it X-platform specific.
-    "/ (there seem to be drawing incompatibilities between Win- and XWorkstation)
-
-    isWin32 := self device isWindowsPlatform.
-
-    right := left + width-1.
-    bottom := top + height-1.
-
-    wC := wCorn.
-    hC := hCorn.
-
-    self scale = 1 ifTrue:[
-	wHalf := wC // 2.
-	hHalf := hC // 2.
-    ] ifFalse:[
-	wHalf := wC / 2.
-	hHalf := hC / 2.
-    ].
-
-    "top left arc"
-    self displayArcX:left y:top width:wC height:hC from:90 angle:90.
-
-    "top right arc"
-    self displayArcX:(right - wC) y:top width:wC height:hC from:0 angle:90.
-
-    "bottom right arc"
-    (isWin32 and:[self scale = 1]) ifTrue:[
-	self displayArcX:(right - wC+1) y:(bottom - hC+1) width:wC height:hC from:270 angle:90.
-    ] ifFalse:[
-	self displayArcX:(right - wC) y:(bottom - hC) width:wC height:hC from:270 angle:90.
-    ].
-
-    "bottom left arc"
-    self displayArcX:left y:(bottom - hC) width:wC height:hC from:180 angle:90.
-
-    "top line"
-    self displayLineFromX:(left + wHalf) y:top toX:(right - wHalf-1) y:top.
-
-    "left line"
-    self displayLineFromX:left y:(top + hHalf - 1) toX:left y:(bottom - hHalf - 2).
-
-    "bottom line"
-    self displayLineFromX:(left + wHalf-1) y:bottom
-		      toX:(right - wHalf ) y:bottom.
-
-    "right line"
-    self displayLineFromX:right y:(top + hHalf) toX:right y:(bottom - hHalf).
-
+    gc displayRoundRectangleX:left y:top width:width height:height wCorner:wCorn hCorner:hCorn
 
     "
      |v|
@@ -1908,13 +1750,13 @@
 displayString:aString at:aPoint
     "draw a string - drawing fg only"
 
-    self displayString:aString x:aPoint x y:aPoint y
+    gc displayString:aString x:aPoint x y:aPoint y
 !
 
 displayString:aString centeredAt:aPoint
     "draw a string - drawing fg only"
 
-    self displayString:aString centeredAtX:aPoint x y:aPoint y
+    gc displayString:aString centeredAtX:aPoint x y:aPoint y
 !
 
 displayString:aString centeredAtX:x y:y
@@ -1924,13 +1766,13 @@
 
     w := aString widthOn:self.
     h := aString heightOn:self.
-    self displayString:aString x:x-(w/2) y:y-(h/2)
+    gc displayString:aString x:x-(w/2) y:y-(h/2)
 !
 
 displayString:aString from:start to:stop at:aPoint
     "draw part of a string - drawing fg only"
 
-    ^ self displayString:aString from:start to:stop x:aPoint x y:aPoint y
+    gc displayString:aString from:start to:stop x:aPoint x y:aPoint y
 !
 
 displayString:aString x:x y:y
@@ -1939,7 +1781,7 @@
      leaving background as-is. If the transformation involves scaling,
      the fonts point-size is scaled as appropriate."
 
-    self displayString:aString from:1 to:aString size x:x y:y opaque:false maxWidth:self width.
+    gc displayString:aString from:1 to:aString size x:x y:y opaque:false maxWidth:self width.
 !
 
 displayString:aString x:x y:y angle:drawAngle
@@ -1949,10 +1791,9 @@
      Drawing is done by first drawing the string into a temporary bitmap,
      which is rotated and finally drawn as usual.
      NOTICE: due to the rotation of the temporary bitmap, this is a slow
-	     operation - not to be used with cillions of strings ..."
-
-    self
-	displayString:aString x:x y:y angle:drawAngle opaque:false
+             operation - not to be used with cillions of strings ..."
+
+    gc displayString:aString x:x y:y angle:drawAngle opaque:false
 
     "
      |v|
@@ -1961,8 +1802,8 @@
      v extent:300@200.
      v openAndWait.
      0 to:360 by:90 do:[:a |
-	 v paint:Color black.
-	 v displayString:'hello world' x:100 y:100 angle:a.
+         v paint:Color black.
+         v displayString:'hello world' x:100 y:100 angle:a.
      ].
     "
     "
@@ -1972,8 +1813,8 @@
      v extent:400@400.
      v openAndWait.
      0 to:360 by:5 do:[:a |
-	 v paint:Color black.
-	 v displayString:'.........hello' x:200 y:200 angle:a.
+         v paint:Color black.
+         v displayString:'.........hello' x:200 y:200 angle:a.
      ].
     "
     "
@@ -2138,7 +1979,7 @@
      the case where paint and/or bgPaint are dithered colors.
      No translation or scaling is done."
 
-    self displayDeviceOpaqueString:aString from:index1 to:index2 in:self font x:x y:y
+    gc displayDeviceOpaqueString:aString from:index1 to:index2 in:self font x:x y:y
 !
 
 displayDeviceOpaqueString:aString x:x y:y
@@ -2146,7 +1987,7 @@
      paint-color and background pixels in bgPaint-color.
      No translation or scaling is done"
 
-    self displayDeviceOpaqueString:aString from:1 to:(aString size) in:self font x:x y:y
+    gc displayDeviceOpaqueString:aString from:1 to:(aString size) in:self font x:x y:y
 !
 
 displayDeviceRectangleX:x y:y width:w height:h
@@ -2168,7 +2009,7 @@
      draw foreground-pixels only (in current paint-color), leaving background as-is.
      No translation or scaling is done"
 
-    self displayDeviceString:aString from:index1 to:index2 in:self font x:x y:y
+    gc displayDeviceString:aString from:index1 to:index2 in:self font x:x y:y
 !
 
 displayDeviceString:aString x:x y:y
@@ -2176,7 +2017,7 @@
      draw foreground-pixels only (in current paint-color), leaving background as-is.
      No translation or scaling is done"
 
-    self displayDeviceString:aString from:1 to:(aString size) in:self font x:x y:y
+    gc displayDeviceString:aString from:1 to:(aString size) in:self font x:x y:y
 !
 
 fillDeviceRectangleX:x y:y width:w height:h
@@ -2189,125 +2030,25 @@
 
 drawEdgesForX:x y:y width:w height:h level:l
     "draw 3D edges into a rectangle"
-    self
-	drawEdgesForX:x y:y width:w height:h level:l
-	shadow:self blackColor light:self whiteColor
-	halfShadow:nil halfLight:nil
-	style:nil
+
+    gc
+        drawEdgesForX:x y:y width:w height:h level:l
+        shadow:self blackColor light:self whiteColor
+        halfShadow:nil halfLight:nil
+        style:nil
 !
 
 drawEdgesForX:x y:y width:w height:h level:l
-		shadow:shadowColor light:lightColor
-		halfShadow:halfShadowColor halfLight:halfLightColor
-		style:edgeStyle
+                shadow:shadowColor light:lightColor
+                halfShadow:halfShadowColor halfLight:halfLightColor
+                style:edgeStyle
 
     "draw 3D edges into a rectangle"
 
-    |topLeftFg botRightFg topLeftHalfFg botRightHalfFg
-     count "{ Class: SmallInteger }"
-     r
-     b
-     xi    "{ Class: SmallInteger }"
-     yi    "{ Class: SmallInteger }"
-     run paint|
-
-    count := l.
-    (count < 0) ifTrue:[
-	topLeftFg := shadowColor.
-	botRightFg := lightColor.
-	topLeftHalfFg := halfShadowColor.
-	botRightHalfFg := halfLightColor.
-	count := count negated
-    ] ifFalse:[
-	topLeftFg := lightColor.
-	botRightFg := shadowColor.
-	topLeftHalfFg := halfLightColor.
-	botRightHalfFg := halfShadowColor.
-    ].
-    topLeftHalfFg isNil ifTrue:[
-	topLeftHalfFg := topLeftFg
-    ].
-    botRightHalfFg isNil ifTrue:[
-	botRightHalfFg := botRightFg
-    ].
-
-    r := x + w - 1. "right"
-    b := y + h - 1. "bottom"
-
-    self lineWidth:0.
-
-    "top and left edges"
-    ((edgeStyle == #soft or:[edgeStyle == #softWin95]) and:["l" count > 0]) ifTrue:[
-	paint := topLeftHalfFg
-    ] ifFalse:[
-	paint := topLeftFg
-    ].
-    self paint:paint.
-
-    0 to:(count - 1) do:[:i |
-	run := y + i.
-	run < b ifTrue:[
-	    self displayDeviceLineFromX:x y:run toX:r y:run. "top"
-	].
-	run := x + i.
-	self displayDeviceLineFromX:run y:y toX:run y:b  "left"
-    ].
-    (edgeStyle == #soft or:[edgeStyle == #softWin95]) ifTrue:[
-"
-	self paint:topLeftFg.
-	self displayDeviceLineFromX:x y:y toX:r y:y.
-	self displayDeviceLineFromX:x y:y toX:x y:b
-"
-	(l > 1) ifTrue:[
-	    edgeStyle == #softWin95 ifTrue:[
-		self paint:(Color veryLightGrey).
-	    ] ifFalse:[
-		(l > 2 and:[edgeStyle == #soft]) ifTrue:[
-		    self paint:(self device blackColor).
-		] ifFalse:[
-		    self paint:halfLightColor.
-		]
-	    ].
-	    self displayDeviceLineFromX:x y:y toX:r y:y.
-	    self displayDeviceLineFromX:x y:y toX:x y:b.
-	]
-    ].
-
-    xi := x + 1.
-    yi := y + 1.
-
-"/ does not look good
-"/ style == #st80 iftrue:[
-"/  yi := yi + 1
-"/ ].
-
-    "bottom and right edges"
-    ((edgeStyle == #soft or:[edgeStyle == #softWin95])
-    "new:" and:[count > 1]) ifTrue:[
-	paint := botRightHalfFg
-    ] ifFalse:[
-	paint := botRightFg
-    ].
-
-    self paint:paint.
-    0 to:(count - 1) do:[:i |
-	run := b - i.
-	run > y ifTrue:[
-	    self displayDeviceLineFromX:xi-1 y:run toX:r y:run. "bottom"
-	].
-	run := r - i.
-	self displayDeviceLineFromX:run y:yi-1 toX:run y:b.  "right"
-	xi := xi + 1.
-	yi := yi + 1
-    ].
-    ((edgeStyle == #soft or:[edgeStyle == #softWin95])
-    and:[l > 1]) ifTrue:[
-	self paint:(self device blackColor) "shadowColor".
-	self displayDeviceLineFromX:x y:b toX:r y:b.
-	self displayDeviceLineFromX:r y:y toX:r y:b
-    ].
-
-    self edgeDrawn:#all
+    gc drawEdgesForX:x y:y width:w height:h level:l
+       shadow:shadowColor light:lightColor
+       halfShadow:halfShadowColor halfLight:halfLightColor
+       style:edgeStyle
 
     "Modified: / 24.8.1998 / 18:23:02 / cg"
 !
@@ -2414,7 +2155,7 @@
 clearInside
     "clear the receiver with background - ST-80 compatibility"
 
-    ^ self clear
+    self clear
 !
 
 clearRectangle:aRectangle
@@ -2437,7 +2178,7 @@
 "/    gc transformation isNil ifTrue:[
 "/        self clearRectangleX:0 y:0 width:width height:height
 "/    ] ifFalse:[
-        self clearDeviceRectangleX:0 y:0 width:width height:height
+        gc clearDeviceRectangleX:0 y:0 width:width height:height
 "/    ]
 !
 
@@ -2453,13 +2194,13 @@
 
     |d|
     d := 2 * r.
-    self
-	fillArcX:(origin x - r)
-	       y:(origin y - r)
-	   width:d
-	  height:d
-	    from:startAngle
-	   angle:angle
+    gc
+        fillArcX:(origin x - r)
+               y:(origin y - r)
+           width:d
+          height:d
+            from:startAngle
+           angle:angle
 
     "Modified: 8.5.1996 / 08:41:54 / cg"
 !
@@ -2467,13 +2208,13 @@
 fillArcIn:aRectangle from:startAngle angle:angle
     "draw a filled arc in a box"
 
-    self
-	fillArcX:(aRectangle left)
-	       y:(aRectangle top)
-	   width:(aRectangle width)
-	  height:(aRectangle height)
-	    from:startAngle
-	   angle:angle
+    gc
+        fillArcX:(aRectangle left)
+               y:(aRectangle top)
+           width:(aRectangle width)
+          height:(aRectangle height)
+            from:startAngle
+           angle:angle
 
     "Created: 13.4.1996 / 20:56:03 / cg"
     "Modified: 8.5.1996 / 08:42:13 / cg"
@@ -2488,13 +2229,13 @@
     top := origin y.
     right := corner x.
     bot := corner y.
-    self
-	fillArcX:left
-	y:top
-	width:(right - left + 1)
-	height:(bot - top + 1)
-	from:startAngle
-	angle:angle
+    gc
+        fillArcX:left
+        y:top
+        width:(right - left + 1)
+        height:(bot - top + 1)
+        from:startAngle
+        angle:angle
 
     "Created: 13.4.1996 / 20:56:56 / cg"
     "Modified: 8.5.1996 / 08:42:23 / cg"
@@ -2506,7 +2247,7 @@
     <resource:#obsolete>
 
     self obsoleteMethodWarning:'use #fillArcX:y:width:height:from:angle:'.
-    self fillArcX:x y:y width:w height:h from:startAngle angle:angle
+    gc fillArcX:x y:y width:w height:h from:startAngle angle:angle
 
     "Modified: 8.5.1996 / 08:47:52 / cg"
 !
@@ -2514,13 +2255,10 @@
 fillArcX:x y:y width:w height:h from:startAngle to:endAngle
     "draw a filled arc in a box, given startAngle and endAngle."
 
-    self
-	fillArcX:x
-	       y:y
-	   width:w
-	  height:h
-	    from:startAngle
-	   angle:(endAngle - startAngle)
+    gc
+        fillArcX:x y:y
+        width:w height:h
+        from:startAngle angle:(endAngle - startAngle)
 
     "Created: 8.5.1996 / 08:52:41 / cg"
 !
@@ -2528,19 +2266,16 @@
 fillCircle:aPoint radius:aNumber
     "draw a filled circle around aPoint"
 
-    self fillCircleX:(aPoint x) y:(aPoint y) radius:aNumber
+    gc fillCircleX:(aPoint x) y:(aPoint y) radius:aNumber
 !
 
 fillCircleIn:aRectangle
     "draw a filled circle in a box"
 
-    self
-	fillArcX:(aRectangle left)
-	       y:(aRectangle top)
-	   width:(aRectangle width)
-	  height:(aRectangle height)
-	    from:0
-	   angle:360
+    gc
+        fillArcX:(aRectangle left) y:(aRectangle top)
+        width:(aRectangle width) height:(aRectangle height)
+        from:0 angle:360
 
     "Created: 13.4.1996 / 20:57:41 / cg"
     "Modified: 8.5.1996 / 08:42:38 / cg"
@@ -2552,13 +2287,10 @@
     |d|
 
     d := 2 * r.
-    self
-	fillArcX:(x - r)
-	y:(y - r)
-	width:d
-	height:d
-	from:0
-	angle:360
+    gc
+        fillArcX:(x - r) y:(y - r)
+        width:d height:d
+        from:0 angle:360
 
     "Modified: 8.5.1996 / 08:43:02 / cg"
 !
@@ -2566,17 +2298,15 @@
 fillRectangle:aRectangle
     "fill a rectangle with current paint color"
 
-    self fillRectangleX:(aRectangle left)
-		      y:(aRectangle top)
-		  width:(aRectangle width)
-		 height:(aRectangle height)
+    gc fillRectangleX:(aRectangle left) y:(aRectangle top)
+       width:(aRectangle width) height:(aRectangle height)
 !
 
 fillRectangleLeft:left top:top right:cornerX bottom:cornerY
     "draw a filled rectangle.
      Notice: the cornerPoint itself is NOT included"
 
-    self fillRectangleX:left y:top width:(cornerX - left) height:(cornerY - top)
+    gc fillRectangleX:left y:top width:(cornerX - left) height:(cornerY - top)
 !
 
 fillRectangleOrigin:origin corner:corner
@@ -2587,7 +2317,7 @@
 
     left := origin x.
     top := origin y.
-    self fillRectangleX:left y:top width:(corner x - left) height:(corner y - top)
+    gc fillRectangleX:left y:top width:(corner x - left) height:(corner y - top)
 
     "Created: 13.4.1996 / 20:58:16 / cg"
 !
@@ -2596,56 +2326,11 @@
     "draw a filled rectangle.
      Notice: the cornerPoint itself is NOT included"
 
-    self fillRectangleX:(origin x) y:(origin y) width:(extent x) height:(extent y)
+    gc fillRectangleX:(origin x) y:(origin y) width:(extent x) height:(extent y)
 !
 
 fillRoundRectangleX:left y:top width:width height:height wCorner:wCorn hCorner:hCorn
-    |right bottom wC hC wHalf hHalf|
-
-    right := left + width.
-    bottom := top + height.
-
-    wC := wCorn.
-    hC := hCorn.
-
-    wHalf := wC / 2.
-    hHalf := hC / 2.
-
-    self device isWindowsPlatform ifTrue:[
-	"/ bug workaround
-	"top left arc"
-	self fillArcX:left y:top width:wC height:hC from:90 angle:90.
-	"top right arc"
-	self fillArcX:(right - wC - 1) y:top width:wC height:hC from:0 angle:90.
-	"bottom right arc"
-	self fillArcX:(right - wC - 1) y:(bottom - hC - 1) width:wC height:hC from:270 angle:90.
-	"bottom left arc"
-	self fillArcX:left y:(bottom - hC) width:wC height:hC-1 from:180 angle:90.
-
-	"center rectangle"
-	self fillRectangleX:(left + wHalf) y:top width:(width - wHalf - wHalf+1) height:height-1.
-	"left partial rectangle"
-	self fillRectangleX:left y:top+hHalf width:wHalf height:(height-hHalf-hHalf).
-	"right partial rectangle"
-	self fillRectangleX:right-wHalf y:top+hHalf width:wHalf-1 height:(height-hHalf-hHalf).
-    ] ifFalse:[
-	"top left arc"
-	self fillArcX:left y:top width:wC height:hC from:90 angle:90.
-	"top right arc"
-	self fillArcX:(right - wC) y:top width:wC height:hC from:0 angle:90.
-	"bottom right arc"
-	self fillArcX:(right - wC - 1) y:(bottom - hC) width:wC height:hC from:270 angle:90.
-	"bottom left arc"
-	self fillArcX:left y:(bottom - hC) width:wC height:hC from:180 angle:90.
-
-	"center rectangle"
-	self fillRectangleX:(left + wHalf) y:top width:(width - wHalf - wHalf+1) height:height.
-	"left partial rectangle"
-	self fillRectangleX:left y:top+hHalf width:wHalf height:(height-hHalf-hHalf).
-	"right partial rectangle"
-	self fillRectangleX:right-wHalf y:top+hHalf width:wHalf height:(height-hHalf-hHalf).
-    ].
-
+    gc fillRoundRectangleX:left y:top width:width height:height wCorner:wCorn hCorner:hCorn
 
     "
      |v|