--- a/DevWorkst.st Sun Jan 09 22:51:31 1994 +0100
+++ b/DevWorkst.st Sun Jan 09 22:54:12 1994 +0100
@@ -34,7 +34,7 @@
COPYRIGHT (c) 1993 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libview/Attic/DevWorkst.st,v 1.9 1994-01-08 17:12:29 claus Exp $
+$Header: /cvs/stx/stx/libview/Attic/DevWorkst.st,v 1.10 1994-01-09 21:53:00 claus Exp $
written jan 93 by claus
'!
@@ -1702,13 +1702,13 @@
^ self subclassResponsibility
!
-drawRectangleX:x y:y width:width height:height in:aDrawableId with:aGCId
+displayRectangleX:x y:y width:width height:height in:aDrawableId with:aGCId
"draw a rectangle"
^ self subclassResponsibility
!
-drawPolygon:aPolygon in:aDrawableId with:aGCId
+displayPolygon:aPolygon in:aDrawableId with:aGCId
"draw a polygon"
^ self subclassResponsibility
--- a/DeviceWorkstation.st Sun Jan 09 22:51:31 1994 +0100
+++ b/DeviceWorkstation.st Sun Jan 09 22:54:12 1994 +0100
@@ -34,7 +34,7 @@
COPYRIGHT (c) 1993 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.9 1994-01-08 17:12:29 claus Exp $
+$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.10 1994-01-09 21:53:00 claus Exp $
written jan 93 by claus
'!
@@ -1702,13 +1702,13 @@
^ self subclassResponsibility
!
-drawRectangleX:x y:y width:width height:height in:aDrawableId with:aGCId
+displayRectangleX:x y:y width:width height:height in:aDrawableId with:aGCId
"draw a rectangle"
^ self subclassResponsibility
!
-drawPolygon:aPolygon in:aDrawableId with:aGCId
+displayPolygon:aPolygon in:aDrawableId with:aGCId
"draw a polygon"
^ self subclassResponsibility
--- a/Form.st Sun Jan 09 22:51:31 1994 +0100
+++ b/Form.st Sun Jan 09 22:54:12 1994 +0100
@@ -27,7 +27,7 @@
COPYRIGHT (c) 1989 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libview/Form.st,v 1.6 1994-01-08 17:15:36 claus Exp $
+$Header: /cvs/stx/stx/libview/Form.st,v 1.7 1994-01-09 21:53:05 claus Exp $
written spring/summer 89 by claus
'!
@@ -341,13 +341,13 @@
!Form class methodsFor:'patterns'!
ditherBitsForXin64:x
- "return a dither pattern for x/64; x in 1..32"
+ "return a dither pattern for x/64; x in 1..63"
|sel|
DitherPatterns isNil ifTrue:[
- DitherPatterns := Array new:32.
- 1 to:32 do:[:i |
+ DitherPatterns := Array new:63.
+ 1 to:63 do:[:i |
sel := ('dither' , i printString , 'in64') asSymbol.
DitherPatterns at:i put:(self perform:sel)
]
@@ -771,6 +771,409 @@
2r01010101]
!
+dither33in64
+ "return a pattern for dithering"
+
+ ^ #[2r11101010
+ 2r01010101
+ 2r10101010
+ 2r01010101
+ 2r10101010
+ 2r01010101
+ 2r10101010
+ 2r01010101]
+!
+
+dither34in64
+ "return a pattern for dithering"
+
+ ^ #[2r11101010
+ 2r01010101
+ 2r10101010
+ 2r01010101
+ 2r10101110
+ 2r01010101
+ 2r10101010
+ 2r01010101]
+!
+
+dither35in64
+ "return a pattern for dithering"
+
+ ^ #[2r11101010
+ 2r01010101
+ 2r10101010
+ 2r01010101
+ 2r11101110
+ 2r01010101
+ 2r10101010
+ 2r01010101]
+!
+
+dither36in64
+ "return a pattern for dithering"
+
+ ^ #[2r11101110
+ 2r01010101
+ 2r10101010
+ 2r01010101
+ 2r11101110
+ 2r01010101
+ 2r10101010
+ 2r01010101]
+!
+
+dither37in64
+ "return a pattern for dithering"
+
+ ^ #[2r11101110
+ 2r01010101
+ 2r10101010
+ 2r01010101
+ 2r11101110
+ 2r01010101
+ 2r10101011
+ 2r01010101]
+!
+
+dither38in64
+ "return a pattern for dithering"
+
+ ^ #[2r11101110
+ 2r01010101
+ 2r10111010
+ 2r01010101
+ 2r11101110
+ 2r01010101
+ 2r10101011
+ 2r01010101]
+!
+
+dither39in64
+ "return a pattern for dithering"
+
+ ^ #[2r11101110
+ 2r01010101
+ 2r10111011
+ 2r01010101
+ 2r11101110
+ 2r01010101
+ 2r10101011
+ 2r01010101]
+!
+
+dither40in64
+ "return a pattern for dithering"
+
+ ^ #[2r11101110
+ 2r01010101
+ 2r10111011
+ 2r01010101
+ 2r11101110
+ 2r01010101
+ 2r10111011
+ 2r01010101]
+!
+
+dither41in64
+ "return a pattern for dithering"
+
+ ^ #[2r11101110
+ 2r01010101
+ 2r10111011
+ 2r01010101
+ 2r11101110
+ 2r01010101
+ 2r11111011
+ 2r01010101]
+!
+
+dither42in64
+ "return a pattern for dithering"
+
+ ^ #[2r11101110
+ 2r01010101
+ 2r10111111
+ 2r01010101
+ 2r11101110
+ 2r01010101
+ 2r11111011
+ 2r01010101]
+!
+
+dither43in64
+ "return a pattern for dithering"
+
+ ^ #[2r11101110
+ 2r01010101
+ 2r10111111
+ 2r01010101
+ 2r11101110
+ 2r01010101
+ 2r11111111
+ 2r01010101]
+!
+
+dither44in64
+ "return a pattern for dithering"
+
+ ^ #[2r11101110
+ 2r01010101
+ 2r11111111
+ 2r01010101
+ 2r11101110
+ 2r01010101
+ 2r11111111
+ 2r01010101]
+!
+
+dither45in64
+ "return a pattern for dithering"
+
+ ^ #[2r11101110
+ 2r01010101
+ 2r11111111
+ 2r01010101
+ 2r11111110
+ 2r01010101
+ 2r11111111
+ 2r01010101]
+!
+
+dither46in64
+ "return a pattern for dithering"
+
+ ^ #[2r11101111
+ 2r01010101
+ 2r11111111
+ 2r01010101
+ 2r11111110
+ 2r01010101
+ 2r11111111
+ 2r01010101]
+!
+
+dither47in64
+ "return a pattern for dithering"
+
+ ^ #[2r11101111
+ 2r01010101
+ 2r11111111
+ 2r01010101
+ 2r11111111
+ 2r01010101
+ 2r11111111
+ 2r01010101]
+!
+
+dither48in64
+ "return a pattern for dithering"
+
+ ^ #[2r11111111
+ 2r01010101
+ 2r11111111
+ 2r01010101
+ 2r11111111
+ 2r01010101
+ 2r11111111
+ 2r01010101]
+!
+
+dither49in64
+ "return a pattern for dithering"
+
+ ^ #[2r11111111
+ 2r01110101
+ 2r11111111
+ 2r01010101
+ 2r11111111
+ 2r01010101
+ 2r11111111
+ 2r01010101]
+!
+
+dither50in64
+ "return a pattern for dithering"
+
+ ^ #[2r11111111
+ 2r01110101
+ 2r11111111
+ 2r01010101
+ 2r11111111
+ 2r01010111
+ 2r11111111
+ 2r01010101]
+!
+
+dither51in64
+ "return a pattern for dithering"
+
+ ^ #[2r11111111
+ 2r01110101
+ 2r11111111
+ 2r01010101
+ 2r11111111
+ 2r01110111
+ 2r11111111
+ 2r01010101]
+!
+
+dither52in64
+ "return a pattern for dithering"
+
+ ^ #[2r11111111
+ 2r01110111
+ 2r11111111
+ 2r01010101
+ 2r11111111
+ 2r01110111
+ 2r11111111
+ 2r01010101]
+!
+
+dither53in64
+ "return a pattern for dithering"
+
+ ^ #[2r11111111
+ 2r01110111
+ 2r11111111
+ 2r01010101
+ 2r11111111
+ 2r01110111
+ 2r11111111
+ 2r11010101]
+!
+
+dither54in64
+ "return a pattern for dithering"
+
+ ^ #[2r11111111
+ 2r01110111
+ 2r11111111
+ 2r01011101
+ 2r11111111
+ 2r01110111
+ 2r11111111
+ 2r11010101]
+!
+
+dither55in64
+ "return a pattern for dithering"
+
+ ^ #[2r11111111
+ 2r01110111
+ 2r11111111
+ 2r11011101
+ 2r11111111
+ 2r01110111
+ 2r11111111
+ 2r11010101]
+!
+
+dither56in64
+ "return a pattern for dithering"
+
+ ^ #[2r11111111
+ 2r01110111
+ 2r11111111
+ 2r11011101
+ 2r11111111
+ 2r01110111
+ 2r11111111
+ 2r11011101]
+!
+
+dither57in64
+ "return a pattern for dithering"
+
+ ^ #[2r11111111
+ 2r01110111
+ 2r11111111
+ 2r11011101
+ 2r11111111
+ 2r01110111
+ 2r11111111
+ 2r11111101]
+!
+
+dither58in64
+ "return a pattern for dithering"
+
+ ^ #[2r11111111
+ 2r01110111
+ 2r11111111
+ 2r11011111
+ 2r11111111
+ 2r01110111
+ 2r11111111
+ 2r11111101]
+!
+
+dither59in64
+ "return a pattern for dithering"
+
+ ^ #[2r11111111
+ 2r01110111
+ 2r11111111
+ 2r11011111
+ 2r11111111
+ 2r01110111
+ 2r11111111
+ 2r11111111]
+!
+
+dither60in64
+ "return a pattern for dithering"
+
+ ^ #[2r11111111
+ 2r01110111
+ 2r11111111
+ 2r11111111
+ 2r11111111
+ 2r01110111
+ 2r11111111
+ 2r11111111]
+!
+
+dither61in64
+ "return a pattern for dithering"
+
+ ^ #[2r11111111
+ 2r01110111
+ 2r11111111
+ 2r11111111
+ 2r11111111
+ 2r01111111
+ 2r11111111
+ 2r11111111]
+!
+
+dither62in64
+ "return a pattern for dithering"
+
+ ^ #[2r11111111
+ 2r11110111
+ 2r11111111
+ 2r11111111
+ 2r11111111
+ 2r01111111
+ 2r11111111
+ 2r11111111]
+!
+
+dither63in64
+ "return a pattern for dithering"
+
+ ^ #[2r11111111
+ 2r11110111
+ 2r11111111
+ 2r11111111
+ 2r11111111
+ 2r11111111
+ 2r11111111
+ 2r11111111]
+!
+
grey6Bits
"return a pattern with 6% grey, usable for dithering"
@@ -1105,7 +1508,7 @@
"draw in aGC.
Smalltalk-80 compatibility"
- aGC drawOpaqueForm:self x:aPoint x y:aPoint y
+ aGC displayOpaqueForm:self x:aPoint x y:aPoint y
! !
!Form methodsFor:'accessing'!
--- a/GC.st Sun Jan 09 22:51:31 1994 +0100
+++ b/GC.st Sun Jan 09 22:54:12 1994 +0100
@@ -43,7 +43,7 @@
implemented by subclasses (some subclasses also redefine the others for
more performance)
-$Header: /cvs/stx/stx/libview/Attic/GC.st,v 1.6 1994-01-08 17:15:42 claus Exp $
+$Header: /cvs/stx/stx/libview/Attic/GC.st,v 1.7 1994-01-09 21:53:08 claus Exp $
Instance variables:
@@ -406,7 +406,7 @@
displayRectangularBorder:aRectangle at:aPoint
"draw a rectangle - ST-80 compatibility"
- self drawRectangle:(aRectangle translateBy:aPoint)
+ self displayRectangle:(aRectangle translateBy:aPoint)
!
displayLineFrom:startPoint to:endPoint translateBy:anOffset
@@ -416,28 +416,13 @@
to:(endPoint + anOffset)
!
-displayRectangle:aRectangle
- "draw a rectangle - ST-80 compatibility"
-
- ^ self drawRectangle:aRectangle
-!
-
displayPolyline:aPolygon
"draw a polygon - ST-80 compatibility"
|p|
p := aPolygon collect:[:p | p x rounded @ p y rounded ].
- self drawPolygon:p
-!
-
-displayPolygon:aPolygon
- "draw a filled polygon - ST-80 compatibility"
-
- |p|
-
- p := aPolygon collect:[:p | p x rounded @ p y rounded ].
- self fillPolygon:p
+ self displayPolygon:p
! !
!GraphicsContext methodsFor:'bit-blitting'!
@@ -501,7 +486,7 @@
!GraphicsContext methodsFor:'basic drawing'!
-drawPolygon:aPolygon
+displayPolygon:aPolygon
"draw a polygon
- this could be recoded to draw using displayLine"
@@ -515,14 +500,14 @@
^ self subclassResponsibility
!
-drawRectangleX:x y:y width:w height:h
+displayRectangleX:x y:y width:w height:h
"draw a rectangle
- this could be recoded to draw using displayLine"
^ self subclassResponsibility
!
-drawForm:aForm x:x y:y
+displayForm:aForm x:x y:y
"draw a form at x/y; if the form has depth 1, 1's in the form are
drawn in current fg, 0's are ignored.
If the form has depth ~~ 1, the result is undefined"
@@ -534,17 +519,13 @@
f := function.
self foreground:(Color noColor) background:(Color allColor) function:#and.
- self drawOpaqueForm:aForm x:x y:y.
+ self displayOpaqueForm:aForm x:x y:y.
self foreground:fg background:(Color noColor) function:#or.
- self drawOpaqueForm:aForm x:x y:y.
+ self displayOpaqueForm:aForm x:x y:y.
self foreground:fg background:fg function:f.
-
-"
- ^ self subclassResponsibility
-"
!
-drawOpaqueForm:aForm x:x y:y
+displayOpaqueForm:aForm x:x y:y
"draw a form at x/y; if the form has depth 1, 1's in the form are
drawn in current fg, 0's in current bg color.
If the form has depth ~~ 1, it is copied as is onto the receiver"
@@ -609,31 +590,31 @@
toX:(point2 x) y:(point2 y)
!
-drawRectangle:aRectangle
+displayRectangle:aRectangle
"draw a rectangle"
- self drawRectangleX:(aRectangle left)
- y:(aRectangle top)
- width:(aRectangle width)
- height:(aRectangle height)
+ self displayRectangleX:(aRectangle left)
+ y:(aRectangle top)
+ width:(aRectangle width)
+ height:(aRectangle height)
!
-drawRectangleOrigin:origin corner:corner
+displayRectangleOrigin:origin corner:corner
"draw a rectangle"
|top left|
left := origin x.
top := origin y.
- self drawRectangleX:left y:top
- width:(corner x - left)
- height:(corner y - top)
+ self displayRectangleX:left y:top
+ width:(corner x - left)
+ height:(corner y - top)
!
-drawForm:aForm at:aPoint
+displayForm:aForm at:aPoint
"draw a form"
- self drawForm:aForm x:(aPoint x) y:(aPoint y)
+ self displayForm:aForm x:(aPoint x) y:(aPoint y)
!
displayArcIn:aRectangle from:startAngle angle:angle
--- a/GraphicsContext.st Sun Jan 09 22:51:31 1994 +0100
+++ b/GraphicsContext.st Sun Jan 09 22:54:12 1994 +0100
@@ -43,7 +43,7 @@
implemented by subclasses (some subclasses also redefine the others for
more performance)
-$Header: /cvs/stx/stx/libview/GraphicsContext.st,v 1.6 1994-01-08 17:15:42 claus Exp $
+$Header: /cvs/stx/stx/libview/GraphicsContext.st,v 1.7 1994-01-09 21:53:08 claus Exp $
Instance variables:
@@ -406,7 +406,7 @@
displayRectangularBorder:aRectangle at:aPoint
"draw a rectangle - ST-80 compatibility"
- self drawRectangle:(aRectangle translateBy:aPoint)
+ self displayRectangle:(aRectangle translateBy:aPoint)
!
displayLineFrom:startPoint to:endPoint translateBy:anOffset
@@ -416,28 +416,13 @@
to:(endPoint + anOffset)
!
-displayRectangle:aRectangle
- "draw a rectangle - ST-80 compatibility"
-
- ^ self drawRectangle:aRectangle
-!
-
displayPolyline:aPolygon
"draw a polygon - ST-80 compatibility"
|p|
p := aPolygon collect:[:p | p x rounded @ p y rounded ].
- self drawPolygon:p
-!
-
-displayPolygon:aPolygon
- "draw a filled polygon - ST-80 compatibility"
-
- |p|
-
- p := aPolygon collect:[:p | p x rounded @ p y rounded ].
- self fillPolygon:p
+ self displayPolygon:p
! !
!GraphicsContext methodsFor:'bit-blitting'!
@@ -501,7 +486,7 @@
!GraphicsContext methodsFor:'basic drawing'!
-drawPolygon:aPolygon
+displayPolygon:aPolygon
"draw a polygon
- this could be recoded to draw using displayLine"
@@ -515,14 +500,14 @@
^ self subclassResponsibility
!
-drawRectangleX:x y:y width:w height:h
+displayRectangleX:x y:y width:w height:h
"draw a rectangle
- this could be recoded to draw using displayLine"
^ self subclassResponsibility
!
-drawForm:aForm x:x y:y
+displayForm:aForm x:x y:y
"draw a form at x/y; if the form has depth 1, 1's in the form are
drawn in current fg, 0's are ignored.
If the form has depth ~~ 1, the result is undefined"
@@ -534,17 +519,13 @@
f := function.
self foreground:(Color noColor) background:(Color allColor) function:#and.
- self drawOpaqueForm:aForm x:x y:y.
+ self displayOpaqueForm:aForm x:x y:y.
self foreground:fg background:(Color noColor) function:#or.
- self drawOpaqueForm:aForm x:x y:y.
+ self displayOpaqueForm:aForm x:x y:y.
self foreground:fg background:fg function:f.
-
-"
- ^ self subclassResponsibility
-"
!
-drawOpaqueForm:aForm x:x y:y
+displayOpaqueForm:aForm x:x y:y
"draw a form at x/y; if the form has depth 1, 1's in the form are
drawn in current fg, 0's in current bg color.
If the form has depth ~~ 1, it is copied as is onto the receiver"
@@ -609,31 +590,31 @@
toX:(point2 x) y:(point2 y)
!
-drawRectangle:aRectangle
+displayRectangle:aRectangle
"draw a rectangle"
- self drawRectangleX:(aRectangle left)
- y:(aRectangle top)
- width:(aRectangle width)
- height:(aRectangle height)
+ self displayRectangleX:(aRectangle left)
+ y:(aRectangle top)
+ width:(aRectangle width)
+ height:(aRectangle height)
!
-drawRectangleOrigin:origin corner:corner
+displayRectangleOrigin:origin corner:corner
"draw a rectangle"
|top left|
left := origin x.
top := origin y.
- self drawRectangleX:left y:top
- width:(corner x - left)
- height:(corner y - top)
+ self displayRectangleX:left y:top
+ width:(corner x - left)
+ height:(corner y - top)
!
-drawForm:aForm at:aPoint
+displayForm:aForm at:aPoint
"draw a form"
- self drawForm:aForm x:(aPoint x) y:(aPoint y)
+ self displayForm:aForm x:(aPoint x) y:(aPoint y)
!
displayArcIn:aRectangle from:startAngle angle:angle
--- a/PseudoV.st Sun Jan 09 22:51:31 1994 +0100
+++ b/PseudoV.st Sun Jan 09 22:54:12 1994 +0100
@@ -35,7 +35,7 @@
delegate instead, if there is one. So you can change views behavior even if they
where not initially designed for it.
-$Header: /cvs/stx/stx/libview/Attic/PseudoV.st,v 1.7 1994-01-08 17:15:56 claus Exp $
+$Header: /cvs/stx/stx/libview/Attic/PseudoV.st,v 1.8 1994-01-09 21:54:12 claus Exp $
rewritten summer 92 by claus
'!
@@ -729,19 +729,33 @@
waitForExpose
"wait until an expose event arrives (to wait for scroll-finish)"
- self windowGroup isNil ifTrue:[
+ |wg|
+
+ wg := self windowGroup.
+ wg isNil ifTrue:[
+ "a pure event driven view: wait by doing a direct dispatch"
+
gotExpose := false.
[gotExpose] whileFalse:[
device dispatchExposeEventFor:drawableId
].
] ifFalse:[
- "add a wait for noExpose here"
+ true "wg ~~ WindowGroup activeGroup" ifTrue:[
+ "sent by another view/process;
+ dont wait on the sensor - need a direct dispatch loop"
+
+ wg sensor waitForExposeFor:self
+ ] ifFalse:[
+ "suspend on my sensor"
+ wg sensor suspendForExpose
+ ]
]
!
noExpose
"a no expose event after a scroll"
+'noExpose' printNewline.
exposePending := false.
gotExpose := true
!
--- a/WEvent.st Sun Jan 09 22:51:31 1994 +0100
+++ b/WEvent.st Sun Jan 09 22:54:12 1994 +0100
@@ -1,4 +1,14 @@
-'From Smalltalk/X, Version:2.8.2 on 29-nov-1993 at 15:23:00'!
+"
+ COPYRIGHT (c) 1993 by Claus Gittinger
+ All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice. This software may not
+ be provided or otherwise made available to, or used by, any
+ other person. No title to or ownership of the software is
+ hereby transferred.
+"
Object subclass:#WindowEvent
instanceVariableNames:'view type arguments'
--- a/WGroup.st Sun Jan 09 22:51:31 1994 +0100
+++ b/WGroup.st Sun Jan 09 22:54:12 1994 +0100
@@ -1,4 +1,14 @@
-'From Smalltalk/X, Version:2.8.2 on 29-nov-1993 at 15:22:58'!
+"
+ COPYRIGHT (c) 1993 by Claus Gittinger
+ All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice. This software may not
+ be provided or otherwise made available to, or used by, any
+ other person. No title to or ownership of the software is
+ hereby transferred.
+"
Object subclass:#WindowGroup
instanceVariableNames:'views topViews myProcess mySensor'
@@ -10,23 +20,41 @@
!WindowGroup class methodsFor:'instance creation'!
new
+ "create and return a new WindowGroup object"
+
^ self basicNew initialize
! !
+!WindowGroup class methodsFor:'accessing'!
+
+activeGroup
+ "return the currently active windowGroup"
+
+ ^ ActiveGroup
+! !
+
!WindowGroup methodsFor:'accessing'!
+sensor
+ "return the windowGroups sensor"
+
+ ^ mySensor
+!
+
addView:aView
+ "add aView to the windowGroup"
+
views isNil ifTrue:[
views := OrderedCollection new.
].
views add:aView
!
-sensor
- ^ mySensor
-!
+removeView:aView
+ "remove aView from the windowGroup;
+ if this was the last view in this group,
+ also shut down the corresponding process"
-removeView:aView
views notNil ifTrue:[
views remove:aView ifAbsent:[].
views isEmpty ifTrue:[
@@ -52,14 +80,20 @@
!
views
+ "return the views accociated to this windowGroup"
+
^ views
!
process
+ "return the windowGroups process"
+
^ myProcess
!
sensor:aSensor
+ "set the windowGroups sensor"
+
mySensor := aSensor
!
--- a/WSensor.st Sun Jan 09 22:51:31 1994 +0100
+++ b/WSensor.st Sun Jan 09 22:54:12 1994 +0100
@@ -1,4 +1,14 @@
-'From Smalltalk/X, Version:2.8.2 on 29-nov-1993 at 15:22:57'!
+"
+ COPYRIGHT (c) 1993 by Claus Gittinger
+ All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice. This software may not
+ be provided or otherwise made available to, or used by, any
+ other person. No title to or ownership of the software is
+ hereby transferred.
+"
Object subclass:#WindowSensor
instanceVariableNames:'eventSemaphore damage mouseAndKeyboard
@@ -89,6 +99,25 @@
^ mouseAndKeyboard removeFirst.
! !
+!WindowSensor methodsFor:'special'!
+
+suspendForExpose
+ "wait until a no expose arrives (after a scroll)"
+
+ exposeEventSemaphore := Semaphore new.
+ exposeEventSemaphore wait.
+ exposeEventSemaphore := nil
+!
+
+waitForExposeFor:aView
+ "dispatch until a no expose arrives (after a scroll)"
+
+ gotExpose := false.
+ [gotExpose] whileFalse:[
+ aView device dispatchExposeEventFor:aView id
+ ].
+! !
+
!WindowSensor methodsFor:'event processing'!
notifyEventArrival
@@ -121,8 +150,12 @@
noExposeView:aView
exposeEventSemaphore notNil ifTrue:[
+'noexpose sensor sema' printNewline.
exposeEventSemaphore signal
- ].
+ ] ifFalse:[
+'noexpose sensor flag' printNewline.
+ gotExpose := true
+ ]
"
self addDamage:nil view:aView.
self notifyEventArrival
--- a/WindowEvent.st Sun Jan 09 22:51:31 1994 +0100
+++ b/WindowEvent.st Sun Jan 09 22:54:12 1994 +0100
@@ -1,4 +1,14 @@
-'From Smalltalk/X, Version:2.8.2 on 29-nov-1993 at 15:23:00'!
+"
+ COPYRIGHT (c) 1993 by Claus Gittinger
+ All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice. This software may not
+ be provided or otherwise made available to, or used by, any
+ other person. No title to or ownership of the software is
+ hereby transferred.
+"
Object subclass:#WindowEvent
instanceVariableNames:'view type arguments'
--- a/WindowGroup.st Sun Jan 09 22:51:31 1994 +0100
+++ b/WindowGroup.st Sun Jan 09 22:54:12 1994 +0100
@@ -1,4 +1,14 @@
-'From Smalltalk/X, Version:2.8.2 on 29-nov-1993 at 15:22:58'!
+"
+ COPYRIGHT (c) 1993 by Claus Gittinger
+ All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice. This software may not
+ be provided or otherwise made available to, or used by, any
+ other person. No title to or ownership of the software is
+ hereby transferred.
+"
Object subclass:#WindowGroup
instanceVariableNames:'views topViews myProcess mySensor'
@@ -10,23 +20,41 @@
!WindowGroup class methodsFor:'instance creation'!
new
+ "create and return a new WindowGroup object"
+
^ self basicNew initialize
! !
+!WindowGroup class methodsFor:'accessing'!
+
+activeGroup
+ "return the currently active windowGroup"
+
+ ^ ActiveGroup
+! !
+
!WindowGroup methodsFor:'accessing'!
+sensor
+ "return the windowGroups sensor"
+
+ ^ mySensor
+!
+
addView:aView
+ "add aView to the windowGroup"
+
views isNil ifTrue:[
views := OrderedCollection new.
].
views add:aView
!
-sensor
- ^ mySensor
-!
+removeView:aView
+ "remove aView from the windowGroup;
+ if this was the last view in this group,
+ also shut down the corresponding process"
-removeView:aView
views notNil ifTrue:[
views remove:aView ifAbsent:[].
views isEmpty ifTrue:[
@@ -52,14 +80,20 @@
!
views
+ "return the views accociated to this windowGroup"
+
^ views
!
process
+ "return the windowGroups process"
+
^ myProcess
!
sensor:aSensor
+ "set the windowGroups sensor"
+
mySensor := aSensor
!
--- a/WindowSensor.st Sun Jan 09 22:51:31 1994 +0100
+++ b/WindowSensor.st Sun Jan 09 22:54:12 1994 +0100
@@ -1,4 +1,14 @@
-'From Smalltalk/X, Version:2.8.2 on 29-nov-1993 at 15:22:57'!
+"
+ COPYRIGHT (c) 1993 by Claus Gittinger
+ All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice. This software may not
+ be provided or otherwise made available to, or used by, any
+ other person. No title to or ownership of the software is
+ hereby transferred.
+"
Object subclass:#WindowSensor
instanceVariableNames:'eventSemaphore damage mouseAndKeyboard
@@ -89,6 +99,25 @@
^ mouseAndKeyboard removeFirst.
! !
+!WindowSensor methodsFor:'special'!
+
+suspendForExpose
+ "wait until a no expose arrives (after a scroll)"
+
+ exposeEventSemaphore := Semaphore new.
+ exposeEventSemaphore wait.
+ exposeEventSemaphore := nil
+!
+
+waitForExposeFor:aView
+ "dispatch until a no expose arrives (after a scroll)"
+
+ gotExpose := false.
+ [gotExpose] whileFalse:[
+ aView device dispatchExposeEventFor:aView id
+ ].
+! !
+
!WindowSensor methodsFor:'event processing'!
notifyEventArrival
@@ -121,8 +150,12 @@
noExposeView:aView
exposeEventSemaphore notNil ifTrue:[
+'noexpose sensor sema' printNewline.
exposeEventSemaphore signal
- ].
+ ] ifFalse:[
+'noexpose sensor flag' printNewline.
+ gotExpose := true
+ ]
"
self addDamage:nil view:aView.
self notifyEventArrival
--- a/XWorkstat.st Sun Jan 09 22:51:31 1994 +0100
+++ b/XWorkstat.st Sun Jan 09 22:54:12 1994 +0100
@@ -20,7 +20,7 @@
listOfXFonts eventRootX eventRootY buttonsPressed
displayName eventTrace
dispatchingExpose
- rgbVisual'
+ rgbVisual'
classVariableNames: 'KeyPressMask PointerMotionMask
ButtonPressMask ButtonReleaseMask ButtonMotionMask
ExposureMask FocusChangeMask StructureNotifyMask
@@ -37,7 +37,7 @@
this class provides the interface to X11
-$Header: /cvs/stx/stx/libview/Attic/XWorkstat.st,v 1.9 1994-01-08 17:08:48 claus Exp $
+$Header: /cvs/stx/stx/libview/Attic/XWorkstat.st,v 1.10 1994-01-09 21:53:14 claus Exp $
written spring/summer 89 by claus
'!
@@ -366,31 +366,31 @@
} else
_INST(hasSaveUnder) = true;
- /*
- * look for RGB visual
- */
+ /*
+ * look for RGB visual
+ */
nvi = 0;
viproto.screen = scr;
vip = XGetVisualInfo (dpy, VisualScreenMask, &viproto, &nvi);
- maxRGBDepth = 0;
- for (i = 0; i < nvi; i++) {
- switch (vip[i].class) {
- case TrueColor:
- if (vip[i].depth > maxRGBDepth) {
- maxRGBDepth = vip[i].depth;
- rgbRedMask = vip[i].red_mask;
- rgbGreenMask = vip[i].green_mask;
- rgbBlueMask = vip[i].blue_mask;
- rgbVisualID = vip[i].visualid;
- }
- break;
- }
- }
- if (vip) XFree ((char *) vip);
-
- if (maxRGBDepth) {
- _INST(rgbVisual) = _MKSMALLINT(rgbVisualID);
- }
+ maxRGBDepth = 0;
+ for (i = 0; i < nvi; i++) {
+ switch (vip[i].class) {
+ case TrueColor:
+ if (vip[i].depth > maxRGBDepth) {
+ maxRGBDepth = vip[i].depth;
+ rgbRedMask = vip[i].red_mask;
+ rgbGreenMask = vip[i].green_mask;
+ rgbBlueMask = vip[i].blue_mask;
+ rgbVisualID = vip[i].visualid;
+ }
+ break;
+ }
+ }
+ if (vip) XFree ((char *) vip);
+
+ if (maxRGBDepth) {
+ _INST(rgbVisual) = _MKSMALLINT(rgbVisualID);
+ }
visual = DefaultVisualOfScreen(DefaultScreenOfDisplay(dpy));
switch (visual->class) {
@@ -1291,31 +1291,31 @@
visual.visualid = CopyFromParent;
if (_isSmallInteger(preferedDepth)) {
- depth = _intVal(preferedDepth);
+ depth = _intVal(preferedDepth);
}
if (preferedVisual != nil) {
- XVisualInfo vi;
- int cls;
-
- if (preferedVisual == _StaticGray)
- cls = StaticGray;
- else if (preferedVisual == _GrayScale)
- cls = StaticGray;
- else if (preferedVisual == _StaticColor)
- cls = StaticColor;
- else if (preferedVisual == _PseudoColor)
- cls = PseudoColor;
- else if (preferedVisual == _TrueColor)
- cls = TrueColor;
- else if (preferedVisual == _DirectColor)
- cls = DirectColor;
- else
- cls = PseudoColor;
-
- if (XMatchVisualInfo(dpy, screen, depth, cls, &vi)) {
+ XVisualInfo vi;
+ int cls;
+
+ if (preferedVisual == _StaticGray)
+ cls = StaticGray;
+ else if (preferedVisual == _GrayScale)
+ cls = StaticGray;
+ else if (preferedVisual == _StaticColor)
+ cls = StaticColor;
+ else if (preferedVisual == _PseudoColor)
+ cls = PseudoColor;
+ else if (preferedVisual == _TrueColor)
+ cls = TrueColor;
+ else if (preferedVisual == _DirectColor)
+ cls = DirectColor;
+ else
+ cls = PseudoColor;
+
+ if (XMatchVisualInfo(dpy, screen, depth, cls, &vi)) {
visual.visualid = vi.visualid;
printf("visualId=%x\n", vi.visualid);
- }
+ }
}
BLOCKINTERRUPTS();
@@ -3329,7 +3329,7 @@
%{
Window win = _WindowVal(aDrawableId);
XImage *img;
- OBJ retVal;
+ int ret;
int xpos, ypos;
if (_isSmallInteger(aDrawableId)
@@ -3340,9 +3340,9 @@
RETURN ( _MKSMALLINT(0) );
}
img = XGetImage(myDpy, win, xpos, ypos, 1, 1, (unsigned)~0, ZPixmap);
- retVal = _MKSMALLINT(XGetPixel(img, 0, 0));
+ ret = XGetPixel(img, 0, 0);
XDestroyImage(img);
- RETURN ( retVal );
+ RETURN ( _MKSMALLINT(ret) );
}
%}
.
@@ -3790,10 +3790,10 @@
}
%}
.
- self drawRoundedPointX:x rounded y:y rounded in:aDrawableId with:aGCId
+ self displayRoundedPointX:x rounded y:y rounded in:aDrawableId with:aGCId
!
-drawRoundedPointX:x y:y in:aDrawableId with:aGCId
+displayRoundedPointX:x y:y in:aDrawableId with:aGCId
"draw a point"
%{ /* NOCONTEXT */
@@ -3851,7 +3851,7 @@
self primitiveFailed
!
-drawRectangleX:x y:y width:width height:height in:aDrawableId with:aGCId
+displayRectangleX:x y:y width:width height:height in:aDrawableId with:aGCId
"draw a rectangle"
%{ /* NOCONTEXT */
@@ -3875,10 +3875,10 @@
}
%}
.
- self drawRoundedRectangleX:x rounded y:y rounded width:width rounded height:height rounded in:aDrawableId with:aGCId
+ self displayRoundedRectangleX:x rounded y:y rounded width:width rounded height:height rounded in:aDrawableId with:aGCId
!
-drawRoundedRectangleX:x y:y width:width height:height in:aDrawableId with:aGCId
+displayRoundedRectangleX:x y:y width:width height:height in:aDrawableId with:aGCId
"draw a rectangle; the coordinates have already been rounded to integers"
%{ /* NOCONTEXT */
@@ -3905,7 +3905,7 @@
self primitiveFailed
!
-drawPolygon:aPolygon in:aDrawableId with:aGCId
+displayPolygon:aPolygon in:aDrawableId with:aGCId
"draw a polygon"
|numberOfPoints index|
@@ -3930,6 +3930,7 @@
points = (XPoint *)malloc(sizeof(XPoint) * num);
else
points = qPoints;
+
for (i=0; i<num; i++) {
point = _AT_(aPolygon COMMA_CON, _MKSMALLINT(i+1));
if (! _isPoint(point)) goto fail;
@@ -4484,7 +4485,8 @@
"{ Symbol: sensor } "
"{ Symbol: delegate } "
- |theView controller sensor delegate|
+ |theView controller sensor delegate keyButtonReceiver exposeReceiver
+ sym symS arg butt|
%{ /* STACK: 8000 */
# define ANYBUTTON (Button1MotionMask | Button2MotionMask | Button3MotionMask)
@@ -4507,8 +4509,6 @@
char keySymStringBuffer[32];
static unsigned multiClickTime = 0;
unsigned nextMultiClickTime;
- OBJ sym, symS, arg, button;
- OBJ keyButtonReceiver, exposeReceiver;
struct inlineCache *ip, *ipS;
static struct inlineCache vid = _ILC1;
static struct inlineCache exp = _ILC4;
@@ -4575,6 +4575,10 @@
* key, button and pointer events are sent to the sensor,
* or (if there is none) to the delegate.
* or (if there is none) to the view.
+ *
+ * expose events are sent to the sensor,
+ * or (if there is none) to the view
+ *
* sensor and delegate get view as additional argument
*/
keyButtonReceiver = nil;
@@ -4720,29 +4724,29 @@
/* fall into */
sendButtonEvent:
- button = _MKSMALLINT(be->button);
+ butt = _MKSMALLINT(be->button);
#ifdef NOTDEF
/*
* this allows operation with single button mouses: meta-click is always Button 2
*/
if (_INST(metaDown) == true)
- button = _MKSMALLINT(2);
+ butt = _MKSMALLINT(2);
else
#endif
- button = _AT_(DeviceWorkstation_ButtonTranslation, button);
+ butt = _AT_(DeviceWorkstation_ButtonTranslation, butt);
if (keyButtonReceiver != nil) {
(*(*ipS).ilc_func)(keyButtonReceiver, symS
COMMA_CON, nil, ipS,
- button,
+ butt,
_MKSMALLINT(ke->x), _MKSMALLINT(ke->y),
theView);
break;
}
(*(*ip).ilc_func)(theView, sym COMMA_CON, nil, ip,
- button,
+ butt,
_MKSMALLINT(be->x), _MKSMALLINT(be->y));
break;
--- a/XWorkstation.st Sun Jan 09 22:51:31 1994 +0100
+++ b/XWorkstation.st Sun Jan 09 22:54:12 1994 +0100
@@ -20,7 +20,7 @@
listOfXFonts eventRootX eventRootY buttonsPressed
displayName eventTrace
dispatchingExpose
- rgbVisual'
+ rgbVisual'
classVariableNames: 'KeyPressMask PointerMotionMask
ButtonPressMask ButtonReleaseMask ButtonMotionMask
ExposureMask FocusChangeMask StructureNotifyMask
@@ -37,7 +37,7 @@
this class provides the interface to X11
-$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.9 1994-01-08 17:08:48 claus Exp $
+$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.10 1994-01-09 21:53:14 claus Exp $
written spring/summer 89 by claus
'!
@@ -366,31 +366,31 @@
} else
_INST(hasSaveUnder) = true;
- /*
- * look for RGB visual
- */
+ /*
+ * look for RGB visual
+ */
nvi = 0;
viproto.screen = scr;
vip = XGetVisualInfo (dpy, VisualScreenMask, &viproto, &nvi);
- maxRGBDepth = 0;
- for (i = 0; i < nvi; i++) {
- switch (vip[i].class) {
- case TrueColor:
- if (vip[i].depth > maxRGBDepth) {
- maxRGBDepth = vip[i].depth;
- rgbRedMask = vip[i].red_mask;
- rgbGreenMask = vip[i].green_mask;
- rgbBlueMask = vip[i].blue_mask;
- rgbVisualID = vip[i].visualid;
- }
- break;
- }
- }
- if (vip) XFree ((char *) vip);
-
- if (maxRGBDepth) {
- _INST(rgbVisual) = _MKSMALLINT(rgbVisualID);
- }
+ maxRGBDepth = 0;
+ for (i = 0; i < nvi; i++) {
+ switch (vip[i].class) {
+ case TrueColor:
+ if (vip[i].depth > maxRGBDepth) {
+ maxRGBDepth = vip[i].depth;
+ rgbRedMask = vip[i].red_mask;
+ rgbGreenMask = vip[i].green_mask;
+ rgbBlueMask = vip[i].blue_mask;
+ rgbVisualID = vip[i].visualid;
+ }
+ break;
+ }
+ }
+ if (vip) XFree ((char *) vip);
+
+ if (maxRGBDepth) {
+ _INST(rgbVisual) = _MKSMALLINT(rgbVisualID);
+ }
visual = DefaultVisualOfScreen(DefaultScreenOfDisplay(dpy));
switch (visual->class) {
@@ -1291,31 +1291,31 @@
visual.visualid = CopyFromParent;
if (_isSmallInteger(preferedDepth)) {
- depth = _intVal(preferedDepth);
+ depth = _intVal(preferedDepth);
}
if (preferedVisual != nil) {
- XVisualInfo vi;
- int cls;
-
- if (preferedVisual == _StaticGray)
- cls = StaticGray;
- else if (preferedVisual == _GrayScale)
- cls = StaticGray;
- else if (preferedVisual == _StaticColor)
- cls = StaticColor;
- else if (preferedVisual == _PseudoColor)
- cls = PseudoColor;
- else if (preferedVisual == _TrueColor)
- cls = TrueColor;
- else if (preferedVisual == _DirectColor)
- cls = DirectColor;
- else
- cls = PseudoColor;
-
- if (XMatchVisualInfo(dpy, screen, depth, cls, &vi)) {
+ XVisualInfo vi;
+ int cls;
+
+ if (preferedVisual == _StaticGray)
+ cls = StaticGray;
+ else if (preferedVisual == _GrayScale)
+ cls = StaticGray;
+ else if (preferedVisual == _StaticColor)
+ cls = StaticColor;
+ else if (preferedVisual == _PseudoColor)
+ cls = PseudoColor;
+ else if (preferedVisual == _TrueColor)
+ cls = TrueColor;
+ else if (preferedVisual == _DirectColor)
+ cls = DirectColor;
+ else
+ cls = PseudoColor;
+
+ if (XMatchVisualInfo(dpy, screen, depth, cls, &vi)) {
visual.visualid = vi.visualid;
printf("visualId=%x\n", vi.visualid);
- }
+ }
}
BLOCKINTERRUPTS();
@@ -3329,7 +3329,7 @@
%{
Window win = _WindowVal(aDrawableId);
XImage *img;
- OBJ retVal;
+ int ret;
int xpos, ypos;
if (_isSmallInteger(aDrawableId)
@@ -3340,9 +3340,9 @@
RETURN ( _MKSMALLINT(0) );
}
img = XGetImage(myDpy, win, xpos, ypos, 1, 1, (unsigned)~0, ZPixmap);
- retVal = _MKSMALLINT(XGetPixel(img, 0, 0));
+ ret = XGetPixel(img, 0, 0);
XDestroyImage(img);
- RETURN ( retVal );
+ RETURN ( _MKSMALLINT(ret) );
}
%}
.
@@ -3790,10 +3790,10 @@
}
%}
.
- self drawRoundedPointX:x rounded y:y rounded in:aDrawableId with:aGCId
+ self displayRoundedPointX:x rounded y:y rounded in:aDrawableId with:aGCId
!
-drawRoundedPointX:x y:y in:aDrawableId with:aGCId
+displayRoundedPointX:x y:y in:aDrawableId with:aGCId
"draw a point"
%{ /* NOCONTEXT */
@@ -3851,7 +3851,7 @@
self primitiveFailed
!
-drawRectangleX:x y:y width:width height:height in:aDrawableId with:aGCId
+displayRectangleX:x y:y width:width height:height in:aDrawableId with:aGCId
"draw a rectangle"
%{ /* NOCONTEXT */
@@ -3875,10 +3875,10 @@
}
%}
.
- self drawRoundedRectangleX:x rounded y:y rounded width:width rounded height:height rounded in:aDrawableId with:aGCId
+ self displayRoundedRectangleX:x rounded y:y rounded width:width rounded height:height rounded in:aDrawableId with:aGCId
!
-drawRoundedRectangleX:x y:y width:width height:height in:aDrawableId with:aGCId
+displayRoundedRectangleX:x y:y width:width height:height in:aDrawableId with:aGCId
"draw a rectangle; the coordinates have already been rounded to integers"
%{ /* NOCONTEXT */
@@ -3905,7 +3905,7 @@
self primitiveFailed
!
-drawPolygon:aPolygon in:aDrawableId with:aGCId
+displayPolygon:aPolygon in:aDrawableId with:aGCId
"draw a polygon"
|numberOfPoints index|
@@ -3930,6 +3930,7 @@
points = (XPoint *)malloc(sizeof(XPoint) * num);
else
points = qPoints;
+
for (i=0; i<num; i++) {
point = _AT_(aPolygon COMMA_CON, _MKSMALLINT(i+1));
if (! _isPoint(point)) goto fail;
@@ -4484,7 +4485,8 @@
"{ Symbol: sensor } "
"{ Symbol: delegate } "
- |theView controller sensor delegate|
+ |theView controller sensor delegate keyButtonReceiver exposeReceiver
+ sym symS arg butt|
%{ /* STACK: 8000 */
# define ANYBUTTON (Button1MotionMask | Button2MotionMask | Button3MotionMask)
@@ -4507,8 +4509,6 @@
char keySymStringBuffer[32];
static unsigned multiClickTime = 0;
unsigned nextMultiClickTime;
- OBJ sym, symS, arg, button;
- OBJ keyButtonReceiver, exposeReceiver;
struct inlineCache *ip, *ipS;
static struct inlineCache vid = _ILC1;
static struct inlineCache exp = _ILC4;
@@ -4575,6 +4575,10 @@
* key, button and pointer events are sent to the sensor,
* or (if there is none) to the delegate.
* or (if there is none) to the view.
+ *
+ * expose events are sent to the sensor,
+ * or (if there is none) to the view
+ *
* sensor and delegate get view as additional argument
*/
keyButtonReceiver = nil;
@@ -4720,29 +4724,29 @@
/* fall into */
sendButtonEvent:
- button = _MKSMALLINT(be->button);
+ butt = _MKSMALLINT(be->button);
#ifdef NOTDEF
/*
* this allows operation with single button mouses: meta-click is always Button 2
*/
if (_INST(metaDown) == true)
- button = _MKSMALLINT(2);
+ butt = _MKSMALLINT(2);
else
#endif
- button = _AT_(DeviceWorkstation_ButtonTranslation, button);
+ butt = _AT_(DeviceWorkstation_ButtonTranslation, butt);
if (keyButtonReceiver != nil) {
(*(*ipS).ilc_func)(keyButtonReceiver, symS
COMMA_CON, nil, ipS,
- button,
+ butt,
_MKSMALLINT(ke->x), _MKSMALLINT(ke->y),
theView);
break;
}
(*(*ip).ilc_func)(theView, sym COMMA_CON, nil, ip,
- button,
+ butt,
_MKSMALLINT(be->x), _MKSMALLINT(be->y));
break;