--- a/DisplayRootView.st Fri Apr 11 19:53:35 2003 +0200
+++ b/DisplayRootView.st Tue Apr 15 13:58:09 2003 +0200
@@ -122,9 +122,9 @@
!
sensor
- "return nil, since I have no sensor"
+ "return a SynchronousWindowSensor, since I have no windoe group"
- ^ nil
+ ^ SynchronousWindowSensor new
!
subViews
@@ -228,5 +228,5 @@
!DisplayRootView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/DisplayRootView.st,v 1.27 2002-07-25 10:11:51 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/DisplayRootView.st,v 1.28 2003-04-15 11:57:46 stefan Exp $'
! !
--- a/DisplaySurface.st Fri Apr 11 19:53:35 2003 +0200
+++ b/DisplaySurface.st Tue Apr 15 13:58:09 2003 +0200
@@ -981,11 +981,7 @@
Compression makes almost always sense, except when
doing things like freehand drawing"
- |s|
-
- (s := self sensor) notNil ifTrue:[
- s compressMotionEvents:aBoolean
- ]
+ self sensor compressMotionEvents:aBoolean
!
disableButtonEvents
@@ -2064,9 +2060,7 @@
exposeEventPending
"return true, if an expose event is pending."
- |sensor|
-
- ((sensor := self sensor) notNil and:[sensor hasExposeEventFor:self]) ifTrue:[^ true].
+ (self sensor hasExposeEventFor:self) ifTrue:[^ true].
^ device eventPending:#expose for:drawableId
"Modified: / 15.9.1998 / 23:18:16 / cg"
@@ -2192,22 +2186,23 @@
getTextSelection:selectionBufferSymbol
"return the text selection - either the local one, or one of the displays
clipBoard buffers determined by selectionBufferSymbol, which should be one of:
- #clipBard
+ #clipboard
or:
#selecion.
Return aString or nil if there is no selection or
- the selection is returned asynchronously"
-
- |sel|
-
- sel := device getCopyBuffer.
- sel isNil ifTrue:[
- sel := device getTextSelection:selectionBufferSymbol for:drawableId.
+ the selectionString is returned asynchronously"
+
+ |selectionString|
+
+ selectionString := device getCopyBuffer.
+ selectionString isNil ifTrue:[
+ selectionString := device getTextSelection:selectionBufferSymbol for:drawableId.
+ selectionString isNil ifTrue:[
+ "selection is received asynchronous. Wait for result"
+ ].
].
- ^ sel
-
- "Modified: 13.2.1997 / 13:19:26 / cg"
+ ^ selectionString
!
pasteFromClipBoard:aString
@@ -2330,7 +2325,7 @@
!DisplaySurface class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/DisplaySurface.st,v 1.99 2003-03-25 21:11:28 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/DisplaySurface.st,v 1.100 2003-04-15 11:56:58 stefan Exp $'
! !
DisplaySurface initialize!
--- a/SimpleView.st Fri Apr 11 19:53:35 2003 +0200
+++ b/SimpleView.st Tue Apr 15 13:58:09 2003 +0200
@@ -3461,9 +3461,12 @@
"return the views sensor"
windowGroup notNil ifTrue:[
- ^ windowGroup sensor.
- ].
- ^ nil
+ ^ windowGroup sensor.
+ ].
+
+ "there is now window group. Deliver events synchronously"
+
+ ^ SynchronousWindowSensor new.
"Modified: 10.1.1997 / 19:47:13 / cg"
!
@@ -4954,6 +4957,10 @@
|leftEdge topEdge rightEdge botEdge anyEdge nx ny nw nh dx dy dw dh old oldPaint|
+ shown ifFalse:[
+ ^ self
+ ].
+
nw := dw := w.
nh := dh := h.
nx := dx := x.
@@ -4965,118 +4972,118 @@
check if there is a need to draw an edge (i.e. if margin is hit)
"
(margin ~~ 0) ifTrue:[
- leftEdge := false.
- topEdge := false.
- rightEdge := false.
- botEdge := false.
- transformation notNil ifTrue:[
- "
- need device coordinates for this test
- "
- nx := transformation applyToX:nx.
- ny := transformation applyToY:ny.
- nw := transformation applyScaleX:nw.
- nh := transformation applyScaleY:nh.
- ].
- "
- adjust expose rectangle, to exclude the margin.
- Care for rounding errors ...
- "
- (nx isMemberOf:SmallInteger) ifFalse:[
- old := nx.
- nx := nx truncated.
- nw := nw + (nx - old).
- ].
- (ny isMemberOf:SmallInteger) ifFalse:[
- old := ny.
- ny := ny truncated.
- nh := nh + (ny - old).
- ].
- (nw isMemberOf:SmallInteger) ifFalse:[
- nw := nw truncated + 1
- ].
- (nh isMemberOf:SmallInteger) ifFalse:[
- nh := nh truncated + 1
- ].
-
- dx := nx.
- dy := ny.
- dw := nw.
- dh := nh.
-
- (nx < margin) ifTrue:[
- old := nx.
- nx := margin.
- nw := nw - (nx - old).
- leftEdge := anyEdge := true.
- ].
- ((nx + nw - 1) >= (width - margin)) ifTrue:[
- nw := (width - margin - nx).
- rightEdge := anyEdge := true.
- ].
- (ny < margin) ifTrue:[
- old := ny.
- ny := margin.
- nh := nh - (ny - old).
- topEdge := anyEdge := true.
- ].
- ((ny + nh - 1) >= (height - margin)) ifTrue:[
- nh := (height - margin - ny).
- botEdge := anyEdge := true.
- ].
- transformation notNil ifTrue:[
- "
- need logical coordinates for redraw
- "
- nx := transformation applyInverseToX:nx.
- ny := transformation applyInverseToY:ny.
- nw := transformation applyInverseScaleX:nw.
- nh := transformation applyInverseScaleY:nh.
- ].
+ leftEdge := false.
+ topEdge := false.
+ rightEdge := false.
+ botEdge := false.
+ transformation notNil ifTrue:[
+ "
+ need device coordinates for this test
+ "
+ nx := transformation applyToX:nx.
+ ny := transformation applyToY:ny.
+ nw := transformation applyScaleX:nw.
+ nh := transformation applyScaleY:nh.
+ ].
+ "
+ adjust expose rectangle, to exclude the margin.
+ Care for rounding errors ...
+ "
+ (nx isMemberOf:SmallInteger) ifFalse:[
+ old := nx.
+ nx := nx truncated.
+ nw := nw + (nx - old).
+ ].
+ (ny isMemberOf:SmallInteger) ifFalse:[
+ old := ny.
+ ny := ny truncated.
+ nh := nh + (ny - old).
+ ].
+ (nw isMemberOf:SmallInteger) ifFalse:[
+ nw := nw truncated + 1
+ ].
+ (nh isMemberOf:SmallInteger) ifFalse:[
+ nh := nh truncated + 1
+ ].
+
+ dx := nx.
+ dy := ny.
+ dw := nw.
+ dh := nh.
+
+ (nx < margin) ifTrue:[
+ old := nx.
+ nx := margin.
+ nw := nw - (nx - old).
+ leftEdge := anyEdge := true.
+ ].
+ ((nx + nw - 1) >= (width - margin)) ifTrue:[
+ nw := (width - margin - nx).
+ rightEdge := anyEdge := true.
+ ].
+ (ny < margin) ifTrue:[
+ old := ny.
+ ny := margin.
+ nh := nh - (ny - old).
+ topEdge := anyEdge := true.
+ ].
+ ((ny + nh - 1) >= (height - margin)) ifTrue:[
+ nh := (height - margin - ny).
+ botEdge := anyEdge := true.
+ ].
+ transformation notNil ifTrue:[
+ "
+ need logical coordinates for redraw
+ "
+ nx := transformation applyInverseToX:nx.
+ ny := transformation applyInverseToY:ny.
+ nw := transformation applyInverseScaleX:nw.
+ nh := transformation applyInverseScaleY:nh.
+ ].
].
(nw > 0 and:[nh > 0]) ifTrue:[
- "
- redraw inside area
- "
- self clippingRectangle:(Rectangle left:nx top:ny width:nw height:nh).
-
- device supportsAnyViewBackgroundPixmaps ifFalse:[
- "/ workaround: non-existing bg-pixmap support (win95)
-
- viewBackground isImageOrForm ifTrue:[
- (device supportsViewBackgroundPixmap:viewBackground) ifFalse:[
- self fillRectangleWithViewBackgroundX:nx y:ny width:nw height:nh
- ]
- ].
- ].
-
- self redrawX:nx y:ny width:nw height:nh.
+ "
+ redraw inside area
+ "
+ self clippingRectangle:(Rectangle left:nx top:ny width:nw height:nh).
+
+ device supportsAnyViewBackgroundPixmaps ifFalse:[
+ "/ workaround: non-existing bg-pixmap support (win95)
+
+ viewBackground isImageOrForm ifTrue:[
+ (device supportsViewBackgroundPixmap:viewBackground) ifFalse:[
+ self fillRectangleWithViewBackgroundX:nx y:ny width:nw height:nh
+ ]
+ ].
+ ].
+
+ self redrawX:nx y:ny width:nw height:nh.
].
"
redraw edge(s)
"
anyEdge ifTrue:[
- self deviceClippingRectangle:nil.
- oldPaint := paint.
- (topEdge and:[leftEdge and:[botEdge and:[rightEdge]]]) ifTrue:[
- self drawEdges
- ] ifFalse:[
- topEdge ifTrue:[
- self drawTopEdge
- ].
- leftEdge ifTrue:[
- self drawLeftEdge
- ].
- botEdge ifTrue:[
- self drawBottomEdge
- ].
- rightEdge ifTrue:[
- self drawRightEdge
- ]
- ].
- self paint:oldPaint.
+ self deviceClippingRectangle:nil.
+ oldPaint := paint.
+ (topEdge and:[leftEdge and:[botEdge and:[rightEdge]]]) ifTrue:[
+ self drawEdges
+ ] ifFalse:[
+ topEdge ifTrue:[
+ self drawTopEdge
+ ].
+ leftEdge ifTrue:[
+ self drawLeftEdge
+ ].
+ botEdge ifTrue:[
+ self drawBottomEdge
+ ].
+ rightEdge ifTrue:[
+ self drawRightEdge
+ ]
+ ].
+ self paint:oldPaint.
].
self deviceClippingRectangle:innerClipRect.
@@ -5240,34 +5247,33 @@
amountToScroll := self verticalScrollStep.
pageScroll := false.
- (sensor := self sensor) notNil ifTrue:[
- sensor ctrlDown ifTrue:[
- pageScroll := true
- ]
+ sensor := self sensor.
+ sensor ctrlDown ifTrue:[
+ pageScroll := true
].
pageScroll ifFalse:[
- (sensor isNil or:[sensor shiftDown]) ifFalse:[
- hCont := self heightOfContents.
- hCont > (self innerHeight * 3) ifTrue:[
- factor := (hCont // self innerHeight) min:4.
- amountToScroll := amountToScroll * factor.
- ]
- ]
+ sensor shiftDown ifFalse:[
+ hCont := self heightOfContents.
+ hCont > (self innerHeight * 3) ifTrue:[
+ factor := (hCont // self innerHeight) min:4.
+ amountToScroll := amountToScroll * factor.
+ ]
+ ]
].
amount > 0 ifTrue:[
- pageScroll ifTrue:[
- self pageUp
- ] ifFalse:[
- self scrollUp:amountToScroll
- ]
+ pageScroll ifTrue:[
+ self pageUp
+ ] ifFalse:[
+ self scrollUp:amountToScroll
+ ]
] ifFalse:[
- pageScroll ifTrue:[
- self pageDown
- ] ifFalse:[
- self scrollDown:amountToScroll
- ]
+ pageScroll ifTrue:[
+ self pageDown
+ ] ifFalse:[
+ self scrollDown:amountToScroll
+ ]
].
"Modified: / 21.5.1999 / 19:58:42 / cg"
@@ -5490,13 +5496,7 @@
to handle events (useful to update low-prio views from
a higher prio process, to avoid blocking in the high prio one)"
- |sensor|
-
- (sensor := self sensor) notNil ifTrue:[
- sensor pushUserEvent:aSelector for:self withArguments:args
- ] ifFalse:[
- self perform:aSelector withArguments:args
- ]
+ self sensor pushUserEvent:aSelector for:self withArguments:args
"
|v|
@@ -8206,22 +8206,15 @@
damaged areas right now.
The given rectangle is in logical coordinate space."
- |sensor r|
-
- (sensor := self sensor) notNil ifTrue:[
- r := aRectangle.
- transformation notNil ifTrue:[
- r := transformation applyTo:r.
- ].
- sensor addDamage:r copy view:self.
- (shown and:[doRepair]) ifTrue:[
- self repairDamage
- ]
- ] ifFalse:[
- shown ifTrue:[
- self redrawX:aRectangle left y:aRectangle top
- width:aRectangle width height:aRectangle height
- ].
+ |r|
+
+ r := aRectangle.
+ transformation notNil ifTrue:[
+ r := transformation applyTo:r.
+ ].
+ self sensor addDamage:r copy view:self.
+ (shown and:[doRepair]) ifTrue:[
+ self repairDamage
]
"Modified: / 10.11.1998 / 01:55:03 / cg"
@@ -8233,18 +8226,9 @@
damaged areas right now.
The given rectangle is in device coordinate space."
- |sensor|
-
- (sensor := self sensor) notNil ifTrue:[
- sensor addDamage:aRectangle copy view:self.
- (shown and:[doRepair]) ifTrue:[
- self repairDamage
- ]
- ] ifFalse:[
- shown ifTrue:[
- self redrawDeviceX:aRectangle left y:aRectangle top
- width:aRectangle width height:aRectangle height
- ].
+ self sensor addDamage:aRectangle copy view:self.
+ (shown and:[doRepair]) ifTrue:[
+ self repairDamage
]
"Modified: / 10.11.1998 / 01:55:03 / cg"
@@ -9383,7 +9367,7 @@
!SimpleView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.470 2003-04-03 18:01:25 penk Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.471 2003-04-15 11:57:58 stefan Exp $'
! !
SimpleView initialize!
--- a/WindowEvent.st Fri Apr 11 19:53:35 2003 +0200
+++ b/WindowEvent.st Tue Apr 15 13:58:09 2003 +0200
@@ -401,6 +401,12 @@
arguments:(Array with:key with:x with:y)
!
+keyboardFocus:arg view:aView
+
+ ^ KeyboardFocusEvent
+ for:aView type:#hasKeyboardFocus: arguments:(Array with:arg).
+!
+
mappedView:aView
^ WindowMapUnmapEvent
for:aView
@@ -472,86 +478,20 @@
type:#unmapped
! !
-!WindowEvent class methodsFor:'event class access'!
-
-buttonEvent
- "return the class used to represent buttonEvents"
-
-self obsoleteMethodWarning:'use explicit event creation message'.
- ^ ButtonEvent
-
- "Created: / 4.4.1997 / 13:45:04 / cg"
- "Modified: / 6.6.1998 / 21:00:29 / cg"
-!
-
-clientEvent
- "return the class used to represent clientEvents"
-
-self obsoleteMethodWarning:'use explicit event creation message'.
- ^ ClientEvent
-
- "Created: / 4.4.1997 / 13:58:25 / cg"
- "Modified: / 6.6.1998 / 21:00:36 / cg"
-!
-
-focusEvent
- "return the class used to represent focusEvents"
-
-self obsoleteMethodWarning:'use explicit event creation message'.
- ^ FocusEvent
-
- "Modified: / 6.6.1998 / 21:00:50 / cg"
- "Created: / 21.5.1999 / 19:45:25 / cg"
-!
-
-inputEvent
- "return the class used to represent inputEvents"
-
-self obsoleteMethodWarning:'use explicit event creation message'.
- ^ InputEvent
-
- "Created: / 13.8.1997 / 23:03:02 / cg"
- "Modified: / 6.6.1998 / 21:00:43 / cg"
-!
-
-keyboardEvent
- "return the class used to represent keyboardEvents"
-
-self obsoleteMethodWarning:'use explicit event creation message'.
- ^ KeyboardEvent
-
- "Created: / 4.4.1997 / 13:41:44 / cg"
- "Modified: / 6.6.1998 / 21:00:50 / cg"
-!
-
-messageSendEvent
- "return the class used to represent arbitrary messageSend-Events"
-
-self obsoleteMethodWarning:'use explicit event creation message'.
- ^ MessageSendEvent
-!
-
-userEvent
- "return the class used to represent userEvents"
-
-self obsoleteMethodWarning:'use explicit event creation message'.
- ^ UserEvent
-! !
-
!WindowEvent class methodsFor:'instance creation basic'!
for:aView type:aSymbol
"create and return a new windowEvent for sending
aSymbol-message with no arguments to aView"
- ^ (self new) for:aView type:aSymbol
+ ^ self new for:aView type:aSymbol
!
for:aView type:aSymbol arguments:argArray
"create and return a new windowEvent for sending
aSymbol-message with arguments to aView"
- ^ (self new) for:aView type:aSymbol arguments:argArray
+ ^ self new for:aView type:aSymbol arguments:argArray
!
new
@@ -1440,7 +1380,7 @@
!WindowEvent class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/WindowEvent.st,v 1.75 2002-11-26 09:14:13 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/WindowEvent.st,v 1.76 2003-04-15 11:58:09 stefan Exp $'
! !
WindowEvent::InputEvent initialize!
--- a/XWorkstation.st Fri Apr 11 19:53:35 2003 +0200
+++ b/XWorkstation.st Tue Apr 15 13:58:09 2003 +0200
@@ -4249,17 +4249,6 @@
self buttonRelease:logicalButton x:x y:y view:view
!
-circulateNotify:aView place:aSymbol
- "sent, when the stacking order changes.
- ignored for now."
-
-!
-
-circulateRequest:aView place:aSymbol
- "sent, when the stacking order is about to change.
- ignored for now."
-!
-
clientMessage:targetView type:typeAtom format:format data:data
|sensor|
@@ -4283,19 +4272,6 @@
"Modified: 4.4.1997 / 18:00:18 / cg"
!
-colorMapNotify:aView state:aBoolean
- "sent, when another colormap is installed.
- This is a very X-specific mechanism."
-
- aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
- ].
- "/ not yet implemented
- "/ aView colorMapChange
-
-!
-
configure:view x:x y:y width:w height:h above:above
"forward a size-change event for some view"
@@ -4309,14 +4285,6 @@
].
!
-configureRequest:view x:x y:y width:w height:h above:above detail:detail
- "ignored for now"
-
- "/ view configureRequest
-
-
-!
-
dndMessage:event data:data view:targetView
"handle a DND drag&drop protocol message"
@@ -4328,12 +4296,13 @@
dropType := (self dndDropTypes) at:dropType+1 ifAbsent:#DndNotDnd.
self
- getProperty:(self atomIDOf:#DndSelection)
- from:rootId
- into:[:type :value |
- t := type.
- dropValue := value
- ].
+ getProperty:(self atomIDOf:#DndSelection)
+ from:rootId
+ delete:false
+ into:[:type :value |
+ t := type.
+ dropValue := value
+ ].
"/ preconvert into a collection
"/ of fileNames, string or byteArray
@@ -4344,83 +4313,83 @@
"/ in the default dropMessage handling of SimpleView.
dropType == #DndFiles ifTrue:[
- "/ actually, a list of fileNames
- t ~~ stringAtom ifTrue:[
- 'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
- ^ self
- ].
-
- names := OrderedCollection new.
- i1 := 1.
- [i1 ~~ 0] whileTrue:[
- i2 := dropValue indexOf:(Character value:0) startingAt:i1.
- i2 ~~ 0 ifTrue:[
- names add:(dropValue copyFrom:i1 to:(i2-1)).
- i1 := i2 + 1.
- ] ifFalse:[
- i1 := i2
- ].
- ].
- dropValue := names.
- dropValue := dropValue collect:[:nm | nm asFilename].
- dropType := #files.
+ "/ actually, a list of fileNames
+ t ~~ stringAtom ifTrue:[
+ 'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
+ ^ self
+ ].
+
+ names := OrderedCollection new.
+ i1 := 1.
+ [i1 ~~ 0] whileTrue:[
+ i2 := dropValue indexOf:(Character value:0) startingAt:i1.
+ i2 ~~ 0 ifTrue:[
+ names add:(dropValue copyFrom:i1 to:(i2-1)).
+ i1 := i2 + 1.
+ ] ifFalse:[
+ i1 := i2
+ ].
+ ].
+ dropValue := names.
+ dropValue := dropValue collect:[:nm | nm asFilename].
+ dropType := #files.
] ifFalse:[ (dropType == #DndFile) ifTrue:[
- t ~~ stringAtom ifTrue:[
- 'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
- ^ self
- ].
-
- dropValue := dropValue asFilename.
- dropType := #file.
+ t ~~ stringAtom ifTrue:[
+ 'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
+ ^ self
+ ].
+
+ dropValue := dropValue asFilename.
+ dropType := #file.
] ifFalse:[ (dropType == #DndDir) ifTrue:[
- t ~~ stringAtom ifTrue:[
- 'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
- ^ self
- ].
-
- dropValue := dropValue asFilename.
- dropType := #directory.
+ t ~~ stringAtom ifTrue:[
+ 'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
+ ^ self
+ ].
+
+ dropValue := dropValue asFilename.
+ dropType := #directory.
] ifFalse:[ (dropType == #DndText) ifTrue:[
- t ~~ stringAtom ifTrue:[
- 'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
- ^ self
- ].
-
- dropValue := dropValue.
- dropType := #text.
+ t ~~ stringAtom ifTrue:[
+ 'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
+ ^ self
+ ].
+
+ dropValue := dropValue.
+ dropType := #text.
] ifFalse:[ (dropType == #DndExe) ifTrue:[
- t ~~ stringAtom ifTrue:[
- 'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
- ^ self
- ].
-
- dropValue := dropValue.
- dropType := #executable.
+ t ~~ stringAtom ifTrue:[
+ 'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
+ ^ self
+ ].
+
+ dropValue := dropValue.
+ dropType := #executable.
] ifFalse:[ (dropType == #DndLink) ifTrue:[
- t ~~ stringAtom ifTrue:[
- 'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
- ^ self
- ].
-
- dropValue := dropValue.
- dropType := #link.
+ t ~~ stringAtom ifTrue:[
+ 'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
+ ^ self
+ ].
+
+ dropValue := dropValue.
+ dropType := #link.
] ifFalse:[ (dropType == #DndRawData) ifTrue:[
- dropValue := dropValue.
- dropType := #rawData.
+ dropValue := dropValue.
+ dropType := #rawData.
] ifFalse:[
- 'XWorkstation [info]: unsupported dropType: ' infoPrint. dropType infoPrintCR.
- 'XWorkstation [info]: data: ' infoPrint. dropValue infoPrintCR.
-
- dropValue := dropValue.
- dropType := #unknown.
+ 'XWorkstation [info]: unsupported dropType: ' infoPrint. dropType infoPrintCR.
+ 'XWorkstation [info]: data: ' infoPrint. dropValue infoPrintCR.
+
+ dropValue := dropValue.
+ dropType := #unknown.
]]]]]]].
(sensor := targetView sensor) notNil ifTrue:[
- sensor dropMessage:dropType data:dropValue view:targetView
+ sensor dropMessage:dropType data:dropValue view:targetView
] ifFalse:[
- "
- not posted, if there is no sensor ...
- "
+ "
+ not posted, if there is no sensor ...
+ "
]
"Created: 4.4.1997 / 17:59:37 / cg"
@@ -4459,12 +4428,6 @@
!
-gravityNotify:aView x:x y:y
- "ignored for now"
-
- "/ aView gravityNotify
-!
-
keyPress:view key:key code:keyCode state:state x:x y:y rootX:rX rootY:rY time:time
"forward a key-press event for some view"
@@ -4507,20 +4470,6 @@
!
-keymapNotify:aView
- "ignore for now"
-
-!
-
-mapRequest:aView
- "ignored for now"
-
- "/ aView mapRequest
-
-
-
-!
-
mappingNotify:view request:what event:eB
"One of Keyboard-, Modifier- or PointerMap has changed, probably by xmodmap.
Tell xlib about the fact."
@@ -4564,22 +4513,10 @@
This is a very X-specific mechanism."
aView isNil ifTrue:[
- "/ event arrived, after I destroyed it myself
- ^ self
- ].
- aView propertyChange
-!
-
-reparentedView:aView
- "ignored for now"
-
- "/ aView reparented
-!
-
-resizeRequest:aView width:width height:height
- "ignored for now"
-
- "/ aView resizeRequest
+ "/ event arrived, after I destroyed it myself
+ ^ self
+ ].
+"/ aView propertyChange:atom state:aSymbol.
!
selectionClear:aView atom:selectionID time:time
@@ -4602,37 +4539,23 @@
"sent when the server returns an answer from a request for a selection.
This is a very X-specific mechanism."
- |s sensor|
+ |clipBoardContents|
targetID == (self atomIDOf:#STRING) ifTrue:[
- "
- a returned string
- "
- s := self getTextProperty:propertyID from:requestorID.
- s notNil ifTrue:[
- (s endsWith:Character cr) ifTrue:[
- s := s asStringCollection copyWith:''
- ]
- ]
+ "a returned string"
+ clipBoardContents := self getTextProperty:propertyID from:requestorID.
+ clipBoardContents notNil ifTrue:[
+ (clipBoardContents endsWith:Character cr) ifTrue:[
+ clipBoardContents := clipBoardContents asStringCollection copyWith:''
+ ]
+ ]
] ifFalse:[
- "
- a returned object
- "
- s := self getObjectProperty:propertyID from:requestorID.
- ].
-
- "free the space in the server"
- self deleteProperty:propertyID for:requestorID.
-
- s notNil ifTrue:[
- (sensor := aView sensor) notNil ifTrue:[
- sensor pasteFromClipBoard:s view:aView
- ] ifFalse:[
- "
- if there is no sensor ...
- "
- aView pasteFromClipBoard:s
- ]
+ "a returned object"
+ clipBoardContents := self getObjectProperty:propertyID from:requestorID.
+ ].
+
+ clipBoardContents notNil ifTrue:[
+ aView sensor pasteFromClipBoard:clipBoardContents view:aView
]
!
@@ -4678,10 +4601,76 @@
!
visibilityNotify:aView state:how
+
aView notNil ifTrue:[
- aView visibilityChange:how
+ aView visibilityChange:how
]
-
+! !
+
+!XWorkstation methodsFor:'event forwarding - ignored events'!
+
+circulateNotify:aView place:aSymbol
+ "sent, when the stacking order changes.
+ ignored for now."
+
+!
+
+circulateRequest:aView place:aSymbol
+ "sent, when the stacking order is about to change.
+ ignored for now."
+!
+
+colorMapNotify:aView state:aBoolean
+ "sent, when another colormap is installed.
+ This is a very X-specific mechanism."
+
+ aView isNil ifTrue:[
+ "/ event arrived, after I destroyed it myself
+ ^ self
+ ].
+ "/ not yet implemented
+ "/ aView colorMapChange
+
+!
+
+configureRequest:view x:x y:y width:w height:h above:above detail:detail
+ "ignored for now"
+
+ "/ view configureRequest
+
+
+!
+
+gravityNotify:aView x:x y:y
+ "ignored for now"
+
+ "/ aView gravityNotify
+!
+
+keymapNotify:aView
+ "ignore for now"
+
+!
+
+mapRequest:aView
+ "ignored for now"
+
+ "/ aView mapRequest
+
+
+
+!
+
+reparentedView:aView
+ "ignored for now"
+
+ "/ aView reparented
+!
+
+resizeRequest:aView width:width height:height
+ "ignored for now"
+
+ "/ aView resizeRequest
! !
!XWorkstation methodsFor:'event handling'!
@@ -4691,10 +4680,11 @@
%{ /* NOCONTEXT */
RETURN (__MKSMALLINT( ExposureMask | StructureNotifyMask |
- KeyPressMask | KeyReleaseMask |
- PointerMotionMask |
- EnterWindowMask | LeaveWindowMask |
- ButtonPressMask | ButtonMotionMask | ButtonReleaseMask ));
+ KeyPressMask | KeyReleaseMask |
+ PointerMotionMask |
+ EnterWindowMask | LeaveWindowMask |
+ ButtonPressMask | ButtonMotionMask | ButtonReleaseMask |
+ PropertyChangeMask ));
%}
!
@@ -8933,20 +8923,20 @@
getObjectProperty:propertyID from:aWindowID
"get an object property from the server; return object or nil"
- self getProperty:propertyID from:aWindowID into:[:type :value |
- type == stringAtom ifTrue:[
- ^ value
- ].
- (value isMemberOf:ByteArray) ifTrue:[
- ^ (Object readBinaryFrom:(ReadStream on:value) onError:[nil])
- ]
+ self getProperty:propertyID from:aWindowID delete:true into:[:type :value |
+ type == stringAtom ifTrue:[
+ ^ value
+ ].
+ (value isMemberOf:ByteArray) ifTrue:[
+ ^ (Object readBinaryFrom:(ReadStream on:value) onError:[nil])
+ ]
].
^ nil
"Modified: 6.4.1997 / 13:27:07 / cg"
!
-getProperty:propertySymbolOrID from:aWindowID into:aTwoArgBlock
+getProperty:propertySymbolOrID from:aWindowID delete:doDelete into:aTwoArgBlock
"get a property, evaluate aTwoArgBlock with typeID and value"
<context: #return>
@@ -8954,9 +8944,9 @@
|val typeID propertyID|
propertySymbolOrID isString ifTrue:[
- propertyID := self atomIDOf:propertySymbolOrID create:false.
+ propertyID := self atomIDOf:propertySymbolOrID create:false.
] ifFalse:[
- propertyID := propertySymbolOrID.
+ propertyID := propertySymbolOrID.
].
%{
@@ -8971,73 +8961,74 @@
# define PROP_SIZE 2048
if (ISCONNECTED) {
- Display *dpy = myDpy;
-
- if (__isAtomID(propertyID)) {
- property = __AtomVal(propertyID);
- if (__isExternalAddress(aWindowID)) {
- window = __WindowVal(aWindowID);
- } else if (aWindowID == nil) {
- window = DefaultRootWindow(dpy);
- } else
- goto fail;
-
- nread = 0;
- cp = 0;
+ Display *dpy = myDpy;
+
+ if (__isAtomID(propertyID)) {
+ property = __AtomVal(propertyID);
+ if (__isExternalAddress(aWindowID)) {
+ window = __WindowVal(aWindowID);
+ } else if (aWindowID == nil) {
+ window = DefaultRootWindow(dpy);
+ } else
+ goto fail;
+
+ nread = 0;
+ cp = 0;
/*
- fprintf(stderr, "getProperty: ");
+ fprintf(stderr, "getProperty: ");
*/
- do {
- int retVal;
-
- ENTER_XLIB();
- retVal = XGetWindowProperty(dpy, window, property, nread/4, PROP_SIZE, False,
- AnyPropertyType, &actual_type, &actual_format,
- &nitems, &bytes_after, (unsigned char **)&data);
- LEAVE_XLIB();
- if (retVal != Success) {
- ok = 0;
- break;
- }
- typeID = __MKATOMOBJ(actual_type);
- if (! cp) {
- cp = cp2 = (char *)malloc(nitems+1);
- } else {
- cp = (char *)realloc(cp, nread + nitems + 1);
- cp2 = cp + nread;
- }
- if (! cp) {
- XFree(data);
- goto fail;
- }
+ do {
+ int retVal;
+
+ ENTER_XLIB();
+ retVal = XGetWindowProperty(dpy, window, property, nread/4, PROP_SIZE,
+ doDelete == true,
+ AnyPropertyType, &actual_type, &actual_format,
+ &nitems, &bytes_after, (unsigned char **)&data);
+ LEAVE_XLIB();
+ if (retVal != Success) {
+ ok = 0;
+ break;
+ }
+ typeID = __MKATOMOBJ(actual_type);
+ if (! cp) {
+ cp = cp2 = (char *)malloc(nitems+1);
+ } else {
+ cp = (char *)realloc(cp, nread + nitems + 1);
+ cp2 = cp + nread;
+ }
+ if (! cp) {
+ XFree(data);
+ goto fail;
+ }
- nread += nitems;
- bcopy(data, cp2, nitems);
- XFree(data);
+ nread += nitems;
+ bcopy(data, cp2, nitems);
+ XFree(data);
/*
- fprintf(stderr, "<nitems:%d bytes_after:%d>", nitems, bytes_after);
+ fprintf(stderr, "<nitems:%d bytes_after:%d>", nitems, bytes_after);
*/
- } while (bytes_after > 0);
+ } while (bytes_after > 0);
/*
- fprintf(stderr, "\n");
+ fprintf(stderr, "\n");
*/
- if (ok) {
- if (actual_type == XA_STRING) {
- cp[nread] = '\0';
- val = __MKSTRING_L(cp, nread);
- } else {
- val = __MKBYTEARRAY(cp, nread);
- }
- }
- if (cp)
- free(cp);
- }
+ if (ok) {
+ if (actual_type == XA_STRING) {
+ cp[nread] = '\0';
+ val = __MKSTRING_L(cp, nread);
+ } else {
+ val = __MKBYTEARRAY(cp, nread);
+ }
+ }
+ if (cp)
+ free(cp);
+ }
}
fail: ;
%}.
typeID isNil ifTrue:[
- ^ false
+ ^ false
].
aTwoArgBlock value:typeID value:val.
^ true
@@ -9048,17 +9039,21 @@
|stringClass|
- self getProperty:propertyID from:aWindowID into:[:type :value |
- type == stringAtom ifTrue:[
- clipBoardEncoding notNil ifTrue:[
- stringClass := (CharacterArray classForEncoding:clipBoardEncoding).
- stringClass ~~ String ifTrue:[
- ^ stringClass fromBytes:(value asByteArray)
- ].
- ^ value decodeFrom:clipBoardEncoding
- ].
- ^ value
- ]
+ self getProperty:propertyID from:aWindowID delete:true into:[:type :value |
+ type == stringAtom ifTrue:[
+ clipBoardEncoding notNil ifTrue:[
+ stringClass := (CharacterArray classForEncoding:clipBoardEncoding).
+ stringClass ~~ String ifTrue:[
+ ^ stringClass fromBytes:(value asByteArray)
+ ].
+ ^ value decodeFrom:clipBoardEncoding
+ ].
+ ^ value
+ ].
+ type == (self atomIDOf:#INCR) ifTrue:[
+type printCR.
+value printCR.
+ ].
].
^ nil
@@ -11001,7 +10996,7 @@
!XWorkstation class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.429 2003-03-02 18:37:17 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.430 2003-04-15 11:57:25 stefan Exp $'
! !
XWorkstation initialize!