DisplaySurface.st
author Claus Gittinger <cg@exept.de>
Mon, 14 Sep 1998 18:28:42 +0200
changeset 2341 a7dc2588d6dc
parent 2300 87306f56da51
child 2342 48d850a7844c
permissions -rw-r--r--
clearRectangle with pattern (viewBackgroundPixmap) for win95
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 1992 by Claus Gittinger
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
	      All Rights Reserved
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
GraphicsMedium subclass:#DisplaySurface
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
	instanceVariableNames:'viewBackground cursor eventMask middleButtonMenu keyCommands
1253
04bd9de0cac4 exposePending removed
Claus Gittinger <cg@exept.de>
parents: 1252
diff changeset
    15
		gotExpose backed saveUnder delegate'
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'Graphics-Support'
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
    21
DeviceHandle subclass:#DeviceViewHandle
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
    22
	instanceVariableNames:''
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
    23
	classVariableNames:''
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
    24
	poolDictionaries:''
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
    25
	privateIn:DisplaySurface
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
    26
!
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
    27
1093
18ea3ccf5d2f category rename
Claus Gittinger <cg@exept.de>
parents: 1074
diff changeset
    28
!DisplaySurface class methodsFor:'documentation'!
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
copyright
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 COPYRIGHT (c) 1992 by Claus Gittinger
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
	      All Rights Reserved
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 This software is furnished under a license and may be used
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 only in accordance with the terms of that license and with the
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
 inclusion of the above copyright notice.   This software may not
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
 be provided or otherwise made available to, or used by, any
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
 other person.  No title to or ownership of the software is
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
 hereby transferred.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
documentation
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    this abstract class describes stuff common to any Window on a display 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    device. i.e. RootWindow, TopWindows, PopUps and Subwindows.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    That is, they have a viewBackground, cursor etc. and especially events.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    A special feature is the delegate field, which allows key- and button 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    events to be stolen from a view. 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    If the delegate is non-nil, these events will be sent to it instead.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    So you can change a views behavior even if it was not initially designed 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    for it. Also, controller functionality could be simulated using delegates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
    [instance variables:]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
    57
	viewBackground  <Color|Form|Image>      the views background
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
    59
	cursor          <Cursor>                the cursor
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
    61
	eventMask                               mask specifying the enabled
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
    62
						events.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
    64
	middleButtonMenu                        a popup menu for the middle
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
    65
						button.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
    67
	keyCommands                             not yet supported
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
    69
	gotExpose                               for exposure handling after
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
    70
	exposePending                           after a scroll
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
    72
	backed                                  true if backing store for that
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
    73
						view is enabled
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
    75
	saveUnder                               true if saveunder store for 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
    76
						that view is enabled
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
    78
	delegate                                for event delegation
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
    [see also:]
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
    81
	DeviceWorkstation
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
    82
	WindowGroup
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
    83
	StandardSYstemView SimpleView View
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
    [author:]
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
    86
	Claus Gittinger
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
!DisplaySurface methodsFor:'accessing'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
depth
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
    "return the depth in pixels of the view.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
     Notice, that this is currently the devices depth, 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
     but support for mixed depth views is being prepared.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
     (especially useful on SGI, with 24bit view)"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
    ^ device depth
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
insideColor:aColor
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
    "set the views background color - ST-80 compatibility"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
    self viewBackground:aColor.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
    self background:aColor
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
2142
200b8ac20fa5 return devices standard keyboardMap as default when asked.
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   108
keyboardMap
200b8ac20fa5 return devices standard keyboardMap as default when asked.
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   109
    "by default, use my devices standard mapping.
200b8ac20fa5 return devices standard keyboardMap as default when asked.
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   110
     However, subclasses may redefine this, to return their own
200b8ac20fa5 return devices standard keyboardMap as default when asked.
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   111
     keyboard map (for example a terminalView may want treat CTRL-C as regular key)"
200b8ac20fa5 return devices standard keyboardMap as default when asked.
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   112
200b8ac20fa5 return devices standard keyboardMap as default when asked.
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   113
    ^ device keyboardMap
200b8ac20fa5 return devices standard keyboardMap as default when asked.
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   114
!
200b8ac20fa5 return devices standard keyboardMap as default when asked.
Claus Gittinger <cg@exept.de>
parents: 2129
diff changeset
   115
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
setViewBackground
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
    "install the viewBackground for the receiver on the device"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
1236
ad9f2cefaa95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1216
diff changeset
   119
    |id devBgPixmap bgPixmap w h colorMap 
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   120
     pixmapDepth deviceDepth defBG|
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
    drawableId notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   123
	viewBackground isColor ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   124
	    viewBackground := viewBackground onDevice:device.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   125
	    id := viewBackground colorId.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   126
	    "
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   127
	     a real color (i.e. one supported by the device) ?
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   128
	    "
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   129
	    id notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   130
		device setWindowBackground:id in:drawableId.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   131
		^ self
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   132
	    ].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   133
	    "
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   134
	     no, a dithered one - must have a dither-pattern
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   135
	     (which is ready for the device, since viewBackground
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   136
	      is already assigned to the device)
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   137
	    "
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   138
	    bgPixmap := viewBackground ditherForm.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   139
	] ifFalse:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   140
	    "
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   141
	     assume, it can convert itself to a form
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   142
	    "
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   143
	    bgPixmap := viewBackground asFormOn:device
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   144
	].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   146
	"/ if the device does not support background pixmaps,
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   147
	"/ set the backgroundColor to the default background.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   148
	"/ this will avoid flicker in win32 systems,
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   149
	"/ since that background is drawn directly in the
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   150
	"/ devices expose event handling.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   151
	"/ (in contrast, the pixmap filling is done by the
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   152
	"/ window itself in its expose event handler)
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   154
	device supportsViewBackgroundPixmaps ifFalse:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   155
	    defBG := View defaultViewBackgroundColor.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   156
	    defBG isColor ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   157
		defBG := defBG onDevice:device.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   158
		id := defBG colorId.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   159
		id notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   160
		    device setWindowBackground:id in:drawableId.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   161
		].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   162
	    ].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   163
	].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   165
	"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   166
	 must now have:
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   167
	 a dithered color or bitmap or pixmap
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   168
	"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   169
	bgPixmap isNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   170
	    'DisplaySurface [warning]: background not convertable - ignored' errorPrintCR.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   171
	    ^ self
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   172
	].
1236
ad9f2cefaa95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1216
diff changeset
   173
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   174
	w := bgPixmap width.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   175
	h := bgPixmap height.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   176
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   177
	deviceDepth := device depth.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   178
	pixmapDepth := bgPixmap depth.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   179
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   180
	(pixmapDepth ~~ deviceDepth) ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   181
	    (pixmapDepth ~~ 1) ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   182
		self error:'bad dither depth (must be one or devices depth)'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   183
		^ self
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   184
	    ].
1236
ad9f2cefaa95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1216
diff changeset
   185
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   186
	    "
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   187
	     convert it into a deep form
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   188
	    "
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   189
	    colorMap := bgPixmap colorMap.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   190
	    devBgPixmap := Form width:w height:h depth:deviceDepth on:device.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   191
	    devBgPixmap isNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   192
		'DisplaySurface [warning]: could not create a device form for viewBackground' infoPrintCR.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   193
		^ self
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   194
	    ].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   195
	    devBgPixmap paint:(colorMap at:1).
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   196
	    devBgPixmap fillRectangleX:0 y:0 width:w height:h.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   197
	    devBgPixmap foreground:(colorMap at:2) background:(colorMap at:1).
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   198
	    devBgPixmap copyPlaneFrom:bgPixmap x:0 y:0 toX:0 y:0 width:w height:h.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   199
	    bgPixmap := devBgPixmap.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   200
	] ifFalse:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   201
	    (pixmapDepth == 1) ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   202
		"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   203
		 although depth matches,
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   204
		 values in the dither are to be interpreted via the ditherForms
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   205
		 colormap, which is not always the same as blackpixel/whitepixel ...
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   206
		"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   207
		colorMap := bgPixmap colorMap.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   208
		(colorMap at:1) colorId == device whitepixel ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   209
		    (colorMap at:2) colorId == device blackpixel ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   210
			"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   211
			 ok, can use it
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   212
			"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   213
			device setWindowBackgroundPixmap:(bgPixmap id) in:drawableId.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   214
			^ self
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   215
		    ]
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   216
		].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   218
		"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   219
		 no, must invert it
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   220
		"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   221
		devBgPixmap := Form width:w height:h depth:deviceDepth on:device.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   222
		devBgPixmap paint:(colorMap at:2) on:(colorMap at:1).
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   223
		devBgPixmap copyPlaneFrom:bgPixmap x:0 y:0 toX:0 y:0 width:w height:h.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   224
		bgPixmap := devBgPixmap.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   225
	    ]
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   226
	].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   227
	device setWindowBackgroundPixmap:(bgPixmap id) in:drawableId.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
    ]
1134
520b75563476 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   229
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   230
    "Modified: / 6.9.1998 / 14:19:23 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
viewBackground
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
    "return the viewBackground"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
    ^ viewBackground
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
viewBackground:something
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
    "set the viewBackground to something, a color, image or form.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
     The viewBackground is the color or pattern with which exposed
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
     regions are filled - do not confuse this with the drawing background
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
     color, which is used with opaque drawing."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
    viewBackground ~~ something ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
	viewBackground := something.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
	drawableId notNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
	    self setViewBackground
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
	]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
    ]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
viewBackgroundAndClear:something
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
    "set the viewBackground to something, a color, image or form.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
     and clear the View.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
     The viewBackground is the color or pattern with which exposed
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
     regions are filled - do not confuse this with the drawing background
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
     color, which is used with opaque drawing."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
    self viewBackground:something.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
    self clear.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
    "Created: 27.4.1996 / 14:09:08 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
viewGravity
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
    "return the views gravity"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
    ^ #NorthWest
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
viewOrigin
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
    "0@0 here, since by default we cannot be scrolled"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
    ^ 0 @ 0
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
widget
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
    "ST-80 compatibility"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
!DisplaySurface methodsFor:'accessing-cursor'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
cursor
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
    "return the views cursor"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
    ^ cursor
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
cursor:aCursor
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
    "set the views cursor. This cursor will be automatically displayed whenever 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
     the mouse-pointer enters the receiver. 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
     Cursors are typically set at view creation time and left as installed."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
    self cursor:aCursor now:true
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
    "
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
     |v|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
     v := View new.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
     v cursor:(Cursor wait).
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
     v open.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
     [v shown] whileFalse:[Processor yield].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
     [v shown] whileTrue:[   
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
	(Delay forSeconds:1) wait.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
	v cursor:(Cursor normal).
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
	(Delay forSeconds:1) wait.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
	v cursor:(Cursor wait).
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
     ]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
    "
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
    "Modified: 14.12.1995 / 21:28:14 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
cursor:aCursor now:showImmediately
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
    "set the views cursor. This cursor will be automatically displayed whenever 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
     the mouse-pointer enters the receiver. 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
     Cursors are typically set at view creation time and left as installed."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
    aCursor notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   323
	(aCursor ~~ cursor) ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   324
	    cursor := aCursor.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   325
	    drawableId notNil ifTrue:[
1960
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   326
		self setCursor.
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   327
		(showImmediately and:[realized]) ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   328
		    "flush, to make cursor immediately visible"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   329
		    device flush
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   330
		]
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   331
	    ]
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   332
	]
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   333
    ]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   334
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   335
    "
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   336
     |v|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   337
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   338
     v := View new.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   339
     v cursor:(Cursor wait).
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   340
     v open.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   341
     [v shown] whileFalse:[Processor yield].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   342
     [v shown] whileTrue:[   
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   343
	(Delay forSeconds:1) wait.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   344
	v cursor:(Cursor normal).
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   345
	(Delay forSeconds:1) wait.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   346
	v cursor:(Cursor wait).
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   347
     ]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   348
    "
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   349
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   350
    "Created: 14.12.1995 / 21:28:00 / cg"
1494
4faf11deec70 cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
   351
    "Modified: 28.3.1997 / 13:47:58 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   352
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   353
1960
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   354
setCursor
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   355
    |id|
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   356
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   357
    drawableId notNil ifTrue:[
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   358
	cursor := cursor onDevice:device.
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   359
	cursor isNil ifTrue:[ ^ self].
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   360
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   361
	id := cursor id.
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   362
	id isNil ifTrue:[
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   363
	    'DisplaySurface [warning]: nil cursorId ignored; shape=' errorPrint. 
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   364
	    cursor shape errorPrintCR.
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   365
	    ^ self.
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   366
	].
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   367
	device setCursor:id in:drawableId.
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   368
    ]
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   369
!
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   370
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   371
withCursor:aCursor do:aBlock
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   372
    "evaluate aBlock showing aCursor until ready; then restore the old cursor
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   373
     and return the value as returned by aBlock.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   374
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   375
     Notice, that this method only changes the cursor for a SINGLE (sub-)view.
1337
00e2cfdfd7bc commentary
Claus Gittinger <cg@exept.de>
parents: 1332
diff changeset
   376
     Most applications want to have the cursor changed in all of its views.
00e2cfdfd7bc commentary
Claus Gittinger <cg@exept.de>
parents: 1332
diff changeset
   377
     Use 'aView windowGroup withCursor:do:' or 'aView topView withCursor:do:'
00e2cfdfd7bc commentary
Claus Gittinger <cg@exept.de>
parents: 1332
diff changeset
   378
     to acomplish this."
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   379
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   380
    |savedCursor|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   381
1388
ba20e718d36f withCursor:do: - better behavior if change has no effect
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
   382
    cursor == aCursor ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   383
	^ aBlock value
1388
ba20e718d36f withCursor:do: - better behavior if change has no effect
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
   384
    ].
ba20e718d36f withCursor:do: - better behavior if change has no effect
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
   385
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   386
    savedCursor := cursor.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   387
    self cursor:aCursor.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   388
    ^ aBlock valueNowOrOnUnwindDo:[self cursor:savedCursor]
1337
00e2cfdfd7bc commentary
Claus Gittinger <cg@exept.de>
parents: 1332
diff changeset
   389
1388
ba20e718d36f withCursor:do: - better behavior if change has no effect
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
   390
    "Modified: 27.2.1997 / 17:20:43 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   391
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   392
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   393
withExecuteCursorDo:aBlock
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   394
    "evaluate aBlock while showing an execute cursor in all my views.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   395
     Return the value as returned by aBlock."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   396
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   397
    ^ self withCursor:(Cursor execute) do:aBlock
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   398
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   399
    "Created: 10.1.1996 / 13:53:03 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   400
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   401
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   402
withReadCursorDo:aBlock
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   403
    "evaluate aBlock while showing a readCursor in all my views.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   404
     Return the value as returned by aBlock."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   405
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   406
    ^ self withCursor:(Cursor read) do:aBlock
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   407
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   408
    "Modified: 14.12.1995 / 20:57:40 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   409
    "Created: 10.1.1996 / 13:52:52 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   410
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   411
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   412
withWaitCursorDo:aBlock
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   413
    "evaluate aBlock while showing a waitCursor in all my views.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   414
     Return the value as returned by aBlock."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   415
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   416
    ^ self withCursor:(Cursor wait) do:aBlock
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   417
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   418
    "Created: 10.1.1996 / 13:51:08 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   419
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   420
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   421
!DisplaySurface methodsFor:'accessing-hierarchy'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   422
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   423
delegate
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   424
    "return the delegate - thats the one getting keyboard and button events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   425
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   426
    ^ delegate
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   427
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   428
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   429
delegate:someOne
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   430
    "set the delegate - keyboard- and button events will be forwarded to
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   431
     that object if it is interested in them.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   432
     See the sendEvent... method in WindowEvent."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   433
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   434
    delegate := someOne
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   435
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   436
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   437
superView
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   438
    "return the superView - nil here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   439
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   440
    ^ nil
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   441
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   442
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   443
topComponent
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   444
    "return the topView - that the one with no superview"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   445
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   446
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   447
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   448
    "Created: 9.5.1996 / 01:39:43 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   449
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   450
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   451
topView
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   452
    "return the topView - that the one with no superview"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   453
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   454
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   455
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   456
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   457
!DisplaySurface methodsFor:'accessing-limits'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   458
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   459
maxExtent
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   460
    "return the views maximum extent - this is nil here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   461
     Only standardSystemViews support this."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   462
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   463
    ^ nil
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   464
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   465
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   466
maxExtent:extent
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   467
    "set the views maximum extent - ignored here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   468
     Only standardSystemViews support this."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   469
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   470
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   471
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   472
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   473
minExtent
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   474
    "return the views minimum extent - this is nil here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   475
     Only standardSystemViews support this."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   476
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   477
    ^ nil
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   478
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   479
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   480
minExtent:extent
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   481
    "set the views minimum extent - ignored here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   482
     Only standardSystemViews support this."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   483
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   484
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   485
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   486
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   487
!DisplaySurface methodsFor:'accessing-misc'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   488
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   489
backingStore:how
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   490
    "turn on/off backingStore (saving my pixels)
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   491
     how may true/false, but also #always, #whenMapped or #never."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   492
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   493
    how ~~ backed ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   494
	backed := how.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   495
	drawableId notNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   496
	    device setBackingStore:how in:drawableId
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   497
	]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   498
    ]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   499
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   500
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   501
eventMask
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   502
    "return a (numeric) mask of allowed events -
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   503
     this is X-specific and will be removed / replaced by symbolic values)"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   504
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   505
    ^ eventMask
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   506
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   507
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   508
eventMask:aMask
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   509
    "set a (numeric) mask of allowed events -
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   510
     this is X-specific and will be removed / replaced by symbolic values)"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   511
     
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   512
    eventMask := aMask
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   513
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   514
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   515
getKeyboardFocus
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   516
    "tell the Display to assign keyboard focus to the receiver"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   517
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   518
    drawableId notNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   519
	self shown ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   520
	    device setInputFocusTo:drawableId
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   521
	]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   522
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   523
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   524
781
6a02db3a260a renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents: 734
diff changeset
   525
isInputOnly
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   526
    "return true, if the receiver is an input only view - that is: 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   527
     the view will realize as a transparent view, into which you cannot
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   528
     draw, but get events as usual. Thich can be used to catch events away from 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   529
     others, which where never meant to work in such a setup.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   530
     (for example, if you want to manipulate views in some DrawTool-like manner).
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   531
     This uses a special X feature, which might not be supported in the near future
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   532
     or on other plattforms."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   533
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   534
    ^ false
781
6a02db3a260a renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents: 734
diff changeset
   535
6a02db3a260a renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents: 734
diff changeset
   536
    "Created: 1.6.1996 / 13:21:51 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   537
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   538
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   539
preferredDepth
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   540
    "return a non nil integer, if a specific depth is wanted in this view.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   541
     Return nil if we do not care (i.e. the displays default is wanted).
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   542
     This is experimental and may change/vanish - do not use it."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   543
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   544
    ^ nil
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   545
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   546
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   547
preferredVisual
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   548
    "return a non nil id, if a specific visual is wanted in this view.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   549
     Return nil if we do not care (i.e. the displays default is wanted). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   550
     This is experimental and may change/vanish - do not use it."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   551
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   552
    ^ nil
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   553
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   554
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   555
saveUnder:aBoolean
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   556
    "turn on/off saveUnder (saving pixels under myself)
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   557
     - used for temporary views (i.e. PopUps and ModalBoxes)"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   558
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   559
    saveUnder := aBoolean.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   560
    drawableId notNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   561
	device setSaveUnder:aBoolean in:drawableId
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   562
    ]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   563
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   564
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   565
!DisplaySurface methodsFor:'accessing-names'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   566
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   567
icon
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   568
    "return the views icon - this is nil here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   569
     Only standardSystemViews support labels and icons."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   570
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   571
    ^ nil
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   572
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   573
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   574
icon:aBitmap
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   575
    "set the views icon - ignored here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   576
     Only standardSystemViews support labels and icons."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   577
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   578
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   579
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   580
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   581
iconLabel
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   582
    "return the views icon label - this is nil here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   583
     Only standardSystemViews support labels and icons."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   584
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   585
    ^ nil
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   586
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   587
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   588
iconLabel:aLabel
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   589
    "set the views icon label - ignored here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   590
     Only standardSystemViews support labels and icons."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   591
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   592
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   593
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   594
1481
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
   595
iconMask
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
   596
    "return the views iconMask - this is nil here.
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
   597
     Only standardSystemViews may support labels and icons."
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
   598
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
   599
    ^ nil
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
   600
!
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
   601
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   602
iconView
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   603
    "return the views iconView - this is nil here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   604
     Only standardSystemViews support labels and icons."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   605
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   606
    ^ nil
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   607
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   608
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   609
iconView:aView
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   610
    "set the views icon view - ignored here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   611
     Only standardSystemViews support labels and icons."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   612
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   613
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   614
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   615
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   616
label
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   617
    "return the views label - this is nil here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   618
     Only standardSystemViews support labels and icons."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   619
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   620
    ^ nil
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   621
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   622
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   623
label:aLabel
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   624
    "set the views label - ignored here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   625
     Only standardSystemViews support labels and icons."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   626
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   627
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   628
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   629
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   630
!DisplaySurface methodsFor:'binary storage'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   631
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   632
readBinaryContentsFrom: stream manager: manager
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   633
    "tell the newly restored View to recreate itself.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   634
     Bug: does not work correctly yet.
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   635
	  (restored view looses its position & wg process)"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   636
1216
c01819586102 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
   637
    |wasRealized|
c01819586102 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
   638
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   639
    super readBinaryContentsFrom: stream manager: manager.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   640
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   641
    gcId := nil.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   642
    drawableId := nil.
1216
c01819586102 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
   643
    wasRealized := realized.
c01819586102 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
   644
    realized := false.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   645
    self recreate.
1216
c01819586102 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
   646
    wasRealized ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   647
	self remap
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   648
    ]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   649
1216
c01819586102 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
   650
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   651
    "
1216
c01819586102 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
   652
     |s l|
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   653
     s := 'storedLabel.boss' asFilename writeStream binary.
1216
c01819586102 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
   654
     l := (Label label:'hello there') realize.
c01819586102 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
   655
     Delay waitForSeconds:1.
c01819586102 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
   656
     l storeBinaryOn:s.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   657
     s close.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   658
    "
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   659
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   660
    "
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   661
     |s l|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   662
     s := 'storedLabel.boss' asFilename writeStream binary.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   663
     (l := Label label:'hello there') open.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   664
     (Delay forSeconds:10) wait.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   665
     l storeBinaryOn:s.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   666
     s close.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   667
     l destroy.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   668
    "
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   669
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   670
    "
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   671
     |s|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   672
     s := 'storedLabel.boss' asFilename readStream binary.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   673
     (Object readBinaryFrom:s)
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   674
    "
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   675
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   676
    "Modified: 3.5.1996 / 23:59:38 / stefan"
1216
c01819586102 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
   677
    "Modified: 14.2.1997 / 15:42:55 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   678
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   679
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   680
!DisplaySurface methodsFor:'button menus'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   681
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   682
middleButtonMenu
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   683
    "return the menu associated with the middle mouse button"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   684
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   685
    ^ middleButtonMenu
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   686
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   687
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   688
middleButtonMenu:aMenu
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   689
    "associate aMenu with the middle mouse button"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   690
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   691
    middleButtonMenu notNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   692
	middleButtonMenu destroy
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   693
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   694
    middleButtonMenu := aMenu
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   695
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   696
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   697
setMiddleButtonMenu:aMenu
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   698
    "associate aMenu with the middle mouse button.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   699
     Do not destroy old menu if any"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   700
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   701
    middleButtonMenu := aMenu
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   702
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   703
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   704
!DisplaySurface methodsFor:'drawing'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   705
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   706
clearDeviceRectangleX:x y:y width:w height:h
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   707
    "clear a rectangular area to viewBackground -
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   708
     redefined since GraphicsMedium fills with background
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   709
     - not viewBackground as we want here."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   710
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   711
    |oldPaint org|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   712
2341
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   713
    viewBackground isColor ifFalse:[
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   714
        device supportsMaskedDrawing ifFalse:[
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   715
            ^ self fillWithViewBackgroundX:x y:y width:w height:h.
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   716
        ].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   717
2341
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   718
        gcId notNil ifTrue:[
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   719
            org := self viewOrigin.
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   720
            device setMaskOriginX:org x rounded negated
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   721
                                y:org y rounded negated
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   722
                               in:gcId
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   723
        ].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   724
    ].
2341
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   725
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   726
    "
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   727
     fill in device coordinates - not logical coordinates
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   728
    "
2341
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   729
    oldPaint := paint.
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   730
    self paint:viewBackground.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   731
    self fillDeviceRectangleX:x y:y width:w height:h "with:viewBackground".
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   732
    self paint:oldPaint
2341
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   733
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   734
    "Modified: / 14.9.1998 / 17:32:16 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   735
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   736
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   737
clearRectangleX:x y:y width:w height:h
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   738
    "clear a rectangular area to viewBackground -
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   739
     redefined since GraphicsMedium fills with background
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   740
     - not viewBackground as we want here."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   741
2341
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   742
    |pX pY pW pH|
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   743
2341
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   744
    transformation notNil ifTrue:[
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   745
        pX := transformation applyToX:x.
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   746
        pY := transformation applyToY:y.
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   747
        pW := transformation applyScaleX:w.
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   748
        pH := transformation applyScaleY:h.
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   749
    ] ifFalse:[
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   750
        pX := x.
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   751
        pY := y.
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   752
        pW := w.
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   753
        pH := h.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   754
    ].
2341
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   755
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   756
    ^ self clearDeviceRectangleX:pX y:pY width:pW height:pH.
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   757
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   758
    "Modified: / 14.9.1998 / 17:29:58 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   759
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   760
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   761
fillWithViewBackgroundX:x y:y width:w height:h
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   762
    "fill a rectangular area with the viewBackground.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   763
     A helper for devices which do not support background pixmaps
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   764
     (i.e. win32 screens).
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   765
     Caller must ensure that viewBackground is really a form"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   766
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   767
    |pW pH xR yR oldFg oldBg oldClip fg bg|
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   768
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   769
    pW := viewBackground width.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   770
    pH := viewBackground height.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   771
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   772
    oldFg := foreground.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   773
    oldBg := background.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   774
    oldClip := self clippingRectangleOrNil.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   775
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   776
    viewBackground depth == 1 ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   777
	viewBackground colorMap notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   778
	    bg := viewBackground colorMap at:1.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   779
	    fg := viewBackground colorMap at:2.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   780
	] ifFalse:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   781
	    bg := Color white.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   782
	    fg := Color black.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   783
	].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   784
	self foreground:fg.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   785
	self background:bg.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   786
    ].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   787
    self clippingRectangle:(x@y extent:w@h).
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   788
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   789
    yR := (y // pH) * pH.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   790
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   791
    [yR < (y+h)] whileTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   792
	xR := (x // pW) * pW.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   793
	[xR < (x+w)] whileTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   794
	    self
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   795
		copyFrom:viewBackground 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   796
		x:0 y:0 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   797
		toX:xR y:yR 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   798
		width:pW height:pH 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   799
		async:false.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   800
	    xR := xR + pW.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   801
	].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   802
	yR := yR + pH.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   803
    ].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   804
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   805
    self foreground:oldFg.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   806
    self background:oldBg.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   807
    self clippingRectangle:oldClip.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   808
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   809
    "Created: / 6.9.1998 / 14:00:50 / cg"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   810
!
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   811
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   812
redraw
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   813
    "nothing done here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   814
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   815
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   816
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   817
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   818
!DisplaySurface methodsFor:'enable/disable events'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   819
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   820
compressMotionEvents:aBoolean
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   821
    "enable/disable motion event compression
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   822
     (i.e. replacing all motion events by the last one).
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   823
     Compression makes almost always sense, except when
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   824
     doing things like freehand drawing"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   825
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   826
    |s|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   827
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   828
    (s := self sensor) notNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   829
	s compressMotionEvents:aBoolean
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   830
    ]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   831
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   832
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   833
disableButtonEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   834
    "disable all button events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   835
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   836
    self disableEvent:#buttonPress; disableEvent:#buttonRelease
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   837
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   838
    "Modified: 29.4.1996 / 11:09:25 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   839
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   840
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   841
disableButtonMotionEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   842
    "disable button motion-while-button-is-pressed events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   843
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   844
    self disableEvent:#buttonMotion
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   845
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   846
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   847
disableButtonPressEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   848
    "disable button press events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   849
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   850
    self disableEvent:#buttonPress
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   851
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   852
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   853
disableButtonReleaseEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   854
    "disable button release events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   855
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   856
    self disableEvent:#buttonRelease
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   857
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   858
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   859
disableEnterLeaveEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   860
    "disable both mouse-pointer enter and leave events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   861
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   862
    self disableEvent:#enter; disableEvent:#leave
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   863
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   864
    "Modified: 29.4.1996 / 11:09:37 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   865
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   866
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   867
disableEvent:anEventSymbol
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   868
    "disable an event -
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   869
     this is a private (internal) method not to be used externally.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   870
     for a list of allowed event symbols see Workstation class"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   871
     
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   872
    eventMask := eventMask bitAnd:(device eventMaskFor:anEventSymbol) bitInvert.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   873
    drawableId notNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   874
	device setEventMask:eventMask in:drawableId
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   875
    ]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   876
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   877
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   878
disableMotionEvents
1332
624bcfb69025 commentary
ca
parents: 1317
diff changeset
   879
    "disable mouse-pointer motion events"
624bcfb69025 commentary
ca
parents: 1317
diff changeset
   880
    
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   881
    self disableEvent:#pointerMotion
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   882
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   883
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   884
enableButtonEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   885
    "enable both mouse button press and release events.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   886
     These are enabled by default anyway."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   887
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   888
    self enableEvent:#buttonPress; enableEvent:#buttonRelease
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   889
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   890
    "Modified: 29.4.1996 / 11:09:46 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   891
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   892
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   893
enableButtonMotionEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   894
    "enable mouse-pointer motion-while-button-is-pressed events.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   895
     These are enabled by default anyway."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   896
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   897
    self enableEvent:#buttonMotion
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   898
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   899
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   900
enableButtonPressEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   901
    "enable mouse button press events.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   902
     These are enabled by default anyway."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   903
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   904
    self enableEvent:#buttonPress
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   905
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   906
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   907
enableButtonReleaseEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   908
    "enable mouse button release events.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   909
     These are enabled by default anyway."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   910
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   911
    self enableEvent:#buttonRelease
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   912
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   913
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   914
enableEnterEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   915
    "enable mouse-pointer enter events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   916
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   917
    self enableEvent:#enter
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   918
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   919
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   920
enableEnterLeaveEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   921
    "enable both mouse-pointer enter and leave events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   922
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   923
    self enableEvent:#enter; enableEvent:#leave
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   924
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   925
    "Modified: 29.4.1996 / 11:09:55 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   926
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   927
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   928
enableEvent:anEventSymbol
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   929
    "enable an event -
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   930
     this is a private (internal) method not to be used externally.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   931
     for a list of allowed event symbols see Workstation class"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   932
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   933
    eventMask := eventMask bitOr:(device eventMaskFor:anEventSymbol).
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   934
    drawableId notNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   935
	device setEventMask:eventMask in:drawableId
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   936
    ]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   937
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   938
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   939
enableFocusEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   940
    "enable keyboard focus change events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   941
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   942
    self enableEvent:#focusChange
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   943
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   944
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   945
enableKeyEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   946
    "this is a compatibility leftover - 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   947
     starting with 2.10.3, keyPress is always enabled to allow 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   948
     ^C processing."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   949
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   950
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   951
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   952
enableKeyPressEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   953
    "this is a compatibility leftover - 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   954
     starting with 2.10.3, keyPress is always enabled to allow 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   955
     ^C processing."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   956
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   957
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   958
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   959
enableKeyReleaseEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   960
    "enable key release events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   961
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   962
    self enableEvent:#keyRelease
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   963
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   964
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   965
enableLeaveEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   966
    "enable mouse-pointer leave events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   967
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   968
    self enableEvent:#leave
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   969
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   970
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   971
enableMotionEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   972
    "enable mouse-pointer motion events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   973
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   974
    self enableEvent:#pointerMotion
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   975
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   976
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
   977
!DisplaySurface methodsFor:'event dispatching'!
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
   978
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
   979
dispatchEvent:event
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
   980
    "dispatch the event"
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
   981
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
   982
    self 
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   983
	dispatchEvent:event type
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   984
	arguments:(event arguments)
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   985
	withFocusOn:nil
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   986
	delegate:true
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
   987
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
   988
    "Modified: / 20.5.1998 / 23:01:15 / cg"
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
   989
!
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
   990
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
   991
dispatchEvent:type arguments:arguments
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
   992
    ^ self 
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   993
	dispatchEvent:type 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   994
	arguments:arguments 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   995
	withFocusOn:nil 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   996
	delegate:true
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
   997
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
   998
    "Modified: / 20.5.1998 / 22:50:31 / cg"
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
   999
!
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1000
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1001
dispatchEvent:type arguments:argArray withFocusOn:focusView delegate:doDelegate
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1002
    "dispatch the event represented by type and arguments either to my delegate,
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1003
     or to my controller (which may be myself, if I implement the controller functionality myself). 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1004
     If focusView is nonNil, and it is a keyboard event, it is forwarded to this
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1005
     view (but not if there was a delegate in the first place).
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1006
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1007
     If doDelegate is true, keyboard and button events are forwarded to a
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1008
     delegate object (if non-nil). DoDelegate may be passed as true, to
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1009
     handle events which are already delegated.
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1010
     If there is a delegate, only messages which are understood by it are 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1011
     forwarded. Also, the delegate is asked if it is willing to handle the event
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1012
     before.
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1013
     Delegated messages get the original view as an extra argument.
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1014
     Delegation has higher priority than both controller or focusView 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1015
     forwarding."
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1016
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1017
    |delegate selector delegateMessage delegateQuery 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1018
     eventReceiver controller deviceMessage
2129
530cc6e1b3b9 oops - uninitialized var used
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
  1019
     isKeyEvent isButtonEvent isPointerEvent 
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1020
     rect x y w h|
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1021
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1022
    isKeyEvent := isButtonEvent := isPointerEvent := false.
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1023
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1024
    type == #damage ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1025
	self shown ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1026
	    rect := argArray.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1027
	    x := rect left.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1028
	    y := rect top.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1029
	    w := rect width.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1030
	    h := rect height.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1031
	    transformation notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1032
		self deviceExposeX:x y:y width:w height:h
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1033
	    ] ifFalse:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1034
		self exposeX:x y:y width:w height:h
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1035
	    ]
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1036
	].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1037
	^ self
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1038
    ].
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1039
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1040
    (type == #'keyPress:x:y:') ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1041
	isKeyEvent := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1042
	deviceMessage := #'deviceKeyPress:x:y:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1043
	delegateMessage := #'keyPress:x:y:view:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1044
	delegateQuery := #'handlesKeyPress:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1045
    ] ifFalse:[ (type == #'keyRelease:x:y:') ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1046
	isKeyEvent := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1047
	deviceMessage := #'deviceKeyRelease:x:y:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1048
	delegateMessage := #'keyRelease:x:y:view:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1049
	delegateQuery := #'handlesKeyRelease:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1050
    ] ifFalse:[ (type == #'buttonMotion:x:y:') ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1051
	isButtonEvent := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1052
	deviceMessage := #'deviceButtonMotion:x:y:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1053
	delegateMessage := #'buttonMotion:x:y:view:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1054
	delegateQuery := #'handlesButtonMotion:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1055
    ] ifFalse:[ (type == #'buttonPress:x:y:') ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1056
	isButtonEvent := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1057
	deviceMessage := #'deviceButtonPress:x:y:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1058
	delegateMessage := #'buttonPress:x:y:view:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1059
	delegateQuery := #'handlesButtonPress:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1060
    ] ifFalse:[ (type == #'buttonRelease:x:y:') ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1061
	isButtonEvent := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1062
	deviceMessage := #'deviceButtonRelease:x:y:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1063
	delegateMessage := #'buttonRelease:x:y:view:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1064
	delegateQuery := #'handlesButtonRelease:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1065
    ] ifFalse:[ (type == #'buttonShiftPress:x:y:') ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1066
	isButtonEvent := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1067
	deviceMessage := #'deviceButtonShiftPress:x:y:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1068
	delegateMessage := #'buttonShiftPress:x:y:view:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1069
	delegateQuery := #'handlesButtonShiftPress:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1070
    ] ifFalse:[ (type == #'buttonMultiPress:x:y:') ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1071
	isButtonEvent := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1072
	deviceMessage := #'deviceButtonMultiPress:x:y:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1073
	delegateMessage := #'buttonMultiPress:x:y:view:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1074
	delegateQuery := #'handlesButtonMultiPress:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1075
    ] ifFalse:[ (type == #'pointerEnter:x:y:') ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1076
	isPointerEvent := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1077
	deviceMessage := #'devicePointerEnter:x:y:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1078
	delegateMessage := #'pointerEnter:x:y:view:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1079
	delegateQuery := #'handlesPointerEnter:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1080
    ] ifFalse:[ (type == #'pointerLeave:') ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1081
	isPointerEvent := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1082
	deviceMessage := type.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1083
	delegateMessage := #'pointerLeave:view:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1084
	delegateQuery := #'handlesPointerLeave:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1085
    ] ifFalse:[ (type == #'exposeX:y:width:height:') ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1086
	deviceMessage := #'deviceExposeX:y:width:height:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1087
    ] ifFalse:[ (type == #'graphicsExposeX:y:width:height:final:') ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1088
	deviceMessage := #'deviceGraphicsExposeX:y:width:height:final:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1089
    ]]]]]]]]]]].
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1090
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1091
    "
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1092
     if there is a focusView, and its a keyboard event, pass it
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1093
     to that view (or its controller, or its delegate). 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1094
     In this case, a coordinate which is outside of
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1095
     the focusView (0 @ 0) is passed as x/y coordinates.
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1096
    "
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1097
    (focusView notNil 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1098
    and:[isKeyEvent]) ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1099
	focusView 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1100
	    dispatchEvent:type 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1101
	    arguments:(Array with:(argArray at:1) with:0 with:0)
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1102
	    withFocusOn:nil
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1103
	    delegate:doDelegate.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1104
	^ self
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1105
    ].
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1106
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1107
    doDelegate ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1108
	"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1109
	 handle delegated messages
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1110
	"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1111
	(isKeyEvent 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1112
	 or:[isButtonEvent 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1113
	 or:[isPointerEvent]]) ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1114
	    delegate := self delegate.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1115
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1116
	    "
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1117
	     what a kludge - sending to delegate requires
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1118
	     another selector and an additional argument ...
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1119
	    "
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1120
	    (delegate notNil
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1121
	    and:[delegate respondsTo:delegateMessage]) ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1122
		"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1123
		 is the delegate interested in that event ?
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1124
		 (if it does not respond to the handlesXXX message,
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1125
		  we assume: NO)
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1126
		"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1127
		((delegate respondsTo:delegateQuery) 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1128
		and:[delegate perform:delegateQuery with:(argArray at:1) with:self]) ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1129
		    "
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1130
		     mhmh ... have to convert to logical coordinates
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1131
		    "        
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1132
		    transformation notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1133
			argArray size > 2 ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1134
			    argArray at:2 put:(transformation applyInverseToX:(argArray at:2)).
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1135
			    argArray at:3 put:(transformation applyInverseToY:(argArray at:3)).
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1136
			].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1137
		    ].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1138
		    argArray isNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1139
			delegate perform:delegateMessage with:self
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1140
		    ] ifFalse:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1141
			delegate perform:delegateMessage withArguments:(argArray copyWith:self)
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1142
		    ].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1143
		    ^ self
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1144
		]
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1145
	    ].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1146
	].
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1147
    ].
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1148
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1149
    (isKeyEvent 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1150
     or:[isButtonEvent 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1151
     or:[isPointerEvent]]) ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1152
	realized ifFalse:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1153
	    ^ self
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1154
	]
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1155
    ].
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1156
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1157
    "
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1158
     if there is a controller, that one gets all user events
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1159
    "
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1160
    eventReceiver := self.
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1161
    (controller := self controller) notNil ifTrue:[  
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1162
	(isKeyEvent 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1163
	 or:[isButtonEvent 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1164
	 or:[isPointerEvent
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1165
	 or:[(type == #focusIn)
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1166
	 or:[(type == #focusOut)]]]]) ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1167
	    eventReceiver := controller.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1168
	]
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1169
    ].
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1170
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1171
    "
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1172
     finally, another one:
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1173
     if I have a transformation, edit the selector from #foo to #deviceFoo...
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1174
     This allows for the event to be handled either in device or
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1175
     logical coordinates. (since the deviceFoo-messages default implementation
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1176
     in DisplaySurface translates and resends).
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1177
     Actually, I could always send deviceXXX without speed penalty
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1178
     (event sending is no high frequency operation), but that just adds 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1179
     another context to any debuggers walkback, making things less clear.
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1180
    "
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1181
    selector := type.
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1182
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1183
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1184
	(isKeyEvent
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1185
	 or:[isButtonEvent
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1186
	 or:[isPointerEvent
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1187
	 or:[(type == #'exposeX:y:width:height:')
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1188
	 or:[(type == #'graphicsExposeX:y:width:height:final:')]]]]) ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1189
	    selector := deviceMessage
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1190
	]        
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1191
    ].
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1192
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1193
    eventReceiver perform:selector withArguments:argArray
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1194
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1195
    "Modified: / 31.10.1997 / 19:54:28 / cg"
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1196
    "Created: / 20.5.1998 / 22:46:25 / cg"
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1197
! !
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1198
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1199
!DisplaySurface methodsFor:'event handling'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1200
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1201
activateMenu
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1202
    "if there is a menu, show it."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1203
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1204
    middleButtonMenu notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1205
	middleButtonMenu showAtPointer
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1206
    ]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1207
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1208
    "Created: 1.3.1996 / 13:24:55 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1209
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1210
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1211
buttonMotion:state x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1212
    "mouse was moved while button is pressed - do nothing here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1213
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1214
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1215
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1216
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1217
buttonMultiPress:button x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1218
    "button was pressed fast after previous press - default to press-again"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1219
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1220
    ^ self buttonPress:button x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1221
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1222
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1223
buttonPress:button x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1224
    "button was pressed - if its middle button and there is a menu,
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1225
     show it."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1226
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1227
    ((button == 2) or:[button == #menu]) ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1228
	self activateMenu.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1229
    ]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1230
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1231
    "Modified: 1.3.1996 / 13:25:07 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1232
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1233
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1234
buttonRelease:button x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1235
    "button was released - do nothing here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1236
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1237
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1238
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1239
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1240
catchExpose
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1241
    "this MUST be sent BEFORE doing a bit-blt copy (i.e. copyFrom...), 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1242
     to tell the sensor that incoming expose events are to be remembered.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1243
     Sometime after the bit-blt, waitForExpose should be sent, to finally
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1244
     suspend until the expose/noExpose event arrives. 
1332
624bcfb69025 commentary
ca
parents: 1317
diff changeset
  1245
     This is an X speciality - for devices which do not need this kind of 
624bcfb69025 commentary
ca
parents: 1317
diff changeset
  1246
     asynchronous bit-blt confirmation, this is a noop.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1247
    "
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1248
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1249
    |wg|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1250
1027
0ba82862ca8d fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
  1251
    device scrollsAsynchronous ifFalse:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1252
	gotExpose := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1253
	^ self
1027
0ba82862ca8d fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
  1254
    ].
0ba82862ca8d fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
  1255
1295
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1256
    self setGraphicsExposures:true.
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1257
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1258
    gotExpose := false.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1259
    wg := self windowGroup.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1260
    wg notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1261
	"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1262
	 must process eny pending expose events, since
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1263
	 usually the origin is changed soon so that previous
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1264
	 expose events coordinates are invalid 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1265
	"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1266
	wg processRealExposeEventsFor:self.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1267
	wg sensor catchExposeFor:self
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1268
    ]
1245
4a4e15a3e4fd pass the view as argument to the catchExpose method
Claus Gittinger <cg@exept.de>
parents: 1236
diff changeset
  1269
1851
6a6225647696 fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1270
    "Modified: 6.8.1997 / 19:50:15 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1271
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1272
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1273
deviceButtonMotion:state x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1274
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1275
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1276
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1277
     and send a #buttonMotion with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1278
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1279
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1280
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1281
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1282
     should redefine #buttonMotion:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1283
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1284
    |lx ly|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1285
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1286
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1287
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1288
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1289
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1290
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1291
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1292
	].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1293
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1294
    self buttonMotion:state x:lx y:ly
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1295
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1296
    "Modified: 20.5.1996 / 17:45:25 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1297
    "Modified: 14.10.1996 / 22:25:12 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1298
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1299
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1300
deviceButtonMultiPress:butt x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1301
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1302
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1303
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1304
     and send a buttonMultiPress with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1305
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1306
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1307
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1308
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1309
     should redefine #buttonMultiPress:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1310
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1311
    |lx ly|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1312
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1313
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1314
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1315
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1316
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1317
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1318
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1319
	].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1320
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1321
    self buttonMultiPress:butt x:lx y:ly
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1322
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1323
    "Modified: 20.5.1996 / 17:45:22 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1324
    "Modified: 14.10.1996 / 22:25:22 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1325
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1326
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1327
deviceButtonPress:butt x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1328
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1329
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1330
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1331
     and send a buttonPress with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1332
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1333
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1334
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1335
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1336
     should redefine #buttonPress:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1337
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1338
    |lx ly|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1339
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1340
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1341
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1342
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1343
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1344
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1345
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1346
	].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1347
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1348
    self buttonPress:butt x:lx y:ly
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1349
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1350
    "Modified: 20.5.1996 / 17:45:18 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1351
    "Modified: 14.10.1996 / 22:25:30 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1352
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1353
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1354
deviceButtonRelease:butt x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1355
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1356
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1357
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1358
     and send a buttonRelease with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1359
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1360
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1361
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1362
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1363
     should redefine #buttonRelease:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1364
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1365
    |lx ly|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1366
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1367
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1368
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1369
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1370
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1371
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1372
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1373
	].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1374
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1375
    self buttonRelease:butt x:lx y:ly
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1376
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1377
    "Modified: 20.5.1996 / 17:45:14 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1378
    "Modified: 14.10.1996 / 22:25:37 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1379
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1380
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1381
deviceButtonShiftPress:butt x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1382
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1383
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1384
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1385
     and send a buttonShiftPress with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1386
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1387
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1388
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1389
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1390
     should redefine #buttonShiftPress:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1391
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1392
    |lx ly|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1393
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1394
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1395
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1396
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1397
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1398
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1399
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1400
	].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1401
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1402
    self buttonShiftPress:butt x:lx y:ly
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1403
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1404
    "Modified: 20.5.1996 / 17:45:09 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1405
    "Modified: 14.10.1996 / 22:25:49 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1406
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1407
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1408
deviceExposeX:x y:y width:w height:h
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1409
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1410
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1411
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1412
     and send an expose with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1413
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1414
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1415
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1416
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1417
     should redefine #exposeX:x:y:width:height:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1418
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1419
    |lx ly lw lh|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1420
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1421
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1422
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1423
    lw := w.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1424
    lh := h.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1425
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1426
	lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1427
	ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1428
	lw := transformation applyInverseScaleX:lw.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1429
	lh := transformation applyInverseScaleY:lh.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1430
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1431
    self exposeX:lx y:ly width:lw height:lh
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1432
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1433
    "Modified: 13.5.1996 / 11:31:44 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1434
    "Modified: 14.10.1996 / 22:26:00 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1435
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1436
1295
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1437
deviceGraphicsExposeX:x y:y width:w height:h final:final
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1438
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1439
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1440
     If there is a transformation, apply the inverse
1295
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1441
     and send a graphicsExpose with the logical coordinates.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1442
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1443
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1444
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1445
     those which are interested in logical coordinates
1295
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1446
     should redefine #graphicsExposeX:x:y:width:height:"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1447
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1448
    |lx ly lw lh|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1449
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1450
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1451
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1452
    lw := w.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1453
    lh := h.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1454
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1455
	lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1456
	ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1457
	lw := transformation applyInverseScaleX:lw.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1458
	lh := transformation applyInverseScaleY:lh.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1459
    ].
1295
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1460
    self graphicsExposeX:lx y:ly width:lw height:lh final:final
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1461
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1462
    "Modified: 13.5.1996 / 11:31:54 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1463
    "Modified: 14.10.1996 / 22:26:08 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1464
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1465
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1466
deviceKeyPress:key x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1467
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1468
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1469
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1470
     and send a keyPress with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1471
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1472
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1473
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1474
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1475
     should redefine #keyPress:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1476
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1477
    |lx ly|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1478
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1479
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1480
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1481
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1482
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1483
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1484
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1485
	]
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1486
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1487
    self keyPress:key x:lx y:ly
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1488
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1489
    "Modified: 20.5.1996 / 17:44:59 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1490
    "Modified: 14.10.1996 / 22:26:17 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1491
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1492
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1493
deviceKeyRelease:key x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1494
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1495
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1496
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1497
     and send a keyRelease with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1498
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1499
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1500
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1501
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1502
     should redefine #keyRelease:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1503
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1504
    |lx ly|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1505
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1506
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1507
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1508
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1509
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1510
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1511
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1512
	]
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1513
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1514
    self keyRelease:key x:lx y:ly
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1515
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1516
    "Modified: 20.5.1996 / 17:44:42 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1517
    "Modified: 14.10.1996 / 22:26:28 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1518
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1519
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1520
devicePointerEnter:state x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1521
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1522
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1523
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1524
     and send a pointerEnter with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1525
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1526
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1527
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1528
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1529
     should redefine #pointerEnter:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1530
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1531
    |lx ly|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1532
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1533
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1534
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1535
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1536
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1537
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1538
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1539
	]
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1540
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1541
    self pointerEnter:state x:lx y:ly
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1542
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1543
    "Modified: 20.5.1996 / 17:44:54 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1544
    "Modified: 14.10.1996 / 22:26:35 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1545
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1546
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1547
exposeX:x y:y width:w height:h
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1548
    "an expose event - nothing done here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1549
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1550
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1551
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1552
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1553
focusIn
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1554
    "got keyboard focus - do nothing here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1555
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1556
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1557
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1558
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1559
focusOut
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1560
    "lost keyboard focus - do nothing here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1561
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1562
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1563
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1564
1295
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1565
graphicsExposeX:x y:y width:w height:h final:final
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1566
    "an expose event after a scroll - do normal redraw processing"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1567
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1568
    self exposeX:x y:y width:w height:h
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1569
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1570
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1571
keyPress:key x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1572
    "a key was pressed in this view.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1573
     Here only keyCommands are handled - more action has to
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1574
     be implemented by redefining this method"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1575
      
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1576
    |action|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1577
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1578
    keyCommands notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1579
	action := keyCommands at:key ifAbsent:[nil].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1580
	action notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1581
	    action value
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1582
	]
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1583
    ].
1105
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1584
    key isSymbol ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1585
	(key startsWith:#Basic) ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1586
	    "/ an unhandled BasicFoo key;
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1587
	    "/ retry as Foo
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1588
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1589
	    self keyPress:(key copyFrom:#Basic size) asSymbol x:x y:y
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1590
	].
1105
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1591
    ].
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1592
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1593
    "Modified: 6.11.1996 / 17:51:15 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1594
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1595
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1596
keyRelease:key x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1597
    "default action is to do nothing"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1598
    
1105
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1599
    key isSymbol ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1600
	(key startsWith:#Basic) ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1601
	    "/ an unhandled BasicFoo key;
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1602
	    "/ retry as Foo
1105
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1603
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1604
	    self keyRelease:(key copyFrom:#Basic size) asSymbol x:x y:y
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1605
	].
1105
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1606
    ].
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1607
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1608
    ^ self
1105
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1609
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1610
    "Modified: 6.11.1996 / 17:51:20 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1611
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1612
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1613
noExpose
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1614
    "a no expose event after a scroll (event-mode only)"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1615
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1616
    gotExpose := true
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1617
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1618
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1619
pointerEnter:state x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1620
    "mouse cursor entered view - do nothing here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1621
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1622
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1623
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1624
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1625
pointerLeave:state
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1626
    "mouse cursor left view - do nothing here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1627
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1628
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1629
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1630
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1631
resizeRequest
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1632
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1633
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1634
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1635
waitForExpose
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1636
    "wait until an expose event arrives (to wait for scroll-finish)"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1637
1872
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1851
diff changeset
  1638
    |wg endPollTime|
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1639
1027
0ba82862ca8d fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
  1640
    device scrollsAsynchronous ifFalse:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1641
	gotExpose := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1642
	^ self
1027
0ba82862ca8d fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
  1643
    ].
0ba82862ca8d fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
  1644
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1645
    wg := self windowGroup.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1646
    wg notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1647
	"/
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1648
	"/ a normal (suspendable) view.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1649
	"/ wait by doing a real wait
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1650
	"/
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1651
	 wg waitForExposeFor:self
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1652
    ] ifFalse:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1653
	"/
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1654
	"/ a pure event driven view.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1655
	"/ wait by doing a direct dispatch loop until the event arrives.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1656
	"/ i.e. poll for the event
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1657
	"/
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1658
	endPollTime := AbsoluteTime now addSeconds:10.
1872
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1851
diff changeset
  1659
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1660
	[gotExpose] whileFalse:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1661
	    realized ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1662
		(device exposeEventPendingFor:drawableId withSync:true) ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1663
		    device dispatchExposeEventFor:drawableId.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1664
		].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1665
	    ].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1666
	    realized ifFalse:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1667
		gotExpose := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1668
		^ self
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1669
	    ].
1872
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1851
diff changeset
  1670
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1671
	    "/ break out of the poll after a while
1872
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1851
diff changeset
  1672
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1673
	    AbsoluteTime now > endPollTime ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1674
		'DisplaySurface [warning]: lost expose event' errorPrintCR.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1675
		gotExpose := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1676
		^ self
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1677
	    ].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1678
	    Processor yield.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1679
	].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1680
    ]
1129
2a3eaf218500 destroy while waiting for expose.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1681
1872
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1851
diff changeset
  1682
    "Modified: 19.8.1997 / 17:22:46 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1683
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1684
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1685
!DisplaySurface methodsFor:'initialize / release'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1686
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1687
destroy
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1688
    "view is about to be destroyed -
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1689
     first destroy menu if there is one and also destroy the GC.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1690
     then the view is physically destroyed."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1691
     
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1692
    middleButtonMenu notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1693
	middleButtonMenu destroy.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1694
	middleButtonMenu := nil
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1695
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1696
    keyCommands := nil.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1697
    gcId notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1698
	device destroyGC:gcId.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1699
	gcId := nil
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1700
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1701
    drawableId notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1702
	device destroyView:self withId:drawableId.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1703
	drawableId := nil.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1704
	realized := false.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1705
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1706
    Lobby unregister:self.
1129
2a3eaf218500 destroy while waiting for expose.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1707
1317
e1bd3b4aee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
  1708
    "Modified: 8.2.1997 / 15:50:04 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1709
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1710
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1711
destroyed
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1712
    "view has been destroyed by someone else"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1713
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1714
    drawableId notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1715
	device removeKnownView:self withId:drawableId.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1716
	drawableId := nil.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1717
	realized := false. 
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1718
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1719
    self destroy
1481
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1720
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1721
    "Modified: 22.3.1997 / 14:56:34 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1722
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1723
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1724
initCursor
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1725
    "default cursor for all views"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1726
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1727
    cursor := Cursor arrow
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1728
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1729
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1730
initStyle
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1731
    "nothing done here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1732
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1733
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1734
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1735
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1736
initialize
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1737
    "initialize defaults"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1738
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1739
    super initialize.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1740
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1741
    eventMask := Display defaultEventMask.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1742
    viewBackground := background.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1743
    backed := false.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1744
    saveUnder := false.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1745
    self initCursor
1252
fccb14086649 exposePending is no longer used
Claus Gittinger <cg@exept.de>
parents: 1245
diff changeset
  1746
fccb14086649 exposePending is no longer used
Claus Gittinger <cg@exept.de>
parents: 1245
diff changeset
  1747
    "Modified: 18.1.1997 / 18:09:41 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1748
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1749
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1750
reAdjustGeometry
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1751
    "sent late during snapin processing, nothing done here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1752
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1753
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1754
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1755
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1756
recreate
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1757
    "recreate (i.e. tell X about me) after a snapin"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1758
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1759
    viewBackground isColor ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1760
	viewBackground := viewBackground on:device
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1761
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1762
    super recreate.
1494
4faf11deec70 cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1763
    cursor := cursor onDevice:device.
1252
fccb14086649 exposePending is no longer used
Claus Gittinger <cg@exept.de>
parents: 1245
diff changeset
  1764
1494
4faf11deec70 cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1765
    "Modified: 28.3.1997 / 13:48:06 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1766
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1767
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1768
reinitStyle
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1769
    "nothing done here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1770
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1771
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1772
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1773
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1774
shallowCopyForFinalization
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1775
    "redefined for faster creation of finalization copies
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1776
     (only device, gcId and drawableId are needed)"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1777
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1778
    |aCopy|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1779
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1780
    aCopy := DeviceViewHandle basicNew.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1781
    aCopy setDevice:device id:drawableId gcId:gcId.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1782
    ^ aCopy
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1783
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1784
    "Created: 3.5.1996 / 15:35:13 / stefan"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1785
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1786
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1787
!DisplaySurface methodsFor:'keyboard commands'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1788
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1789
addActionForKey:aKey action:aBlock
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1790
    "define a keyboard command function"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1791
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1792
    keyCommands isNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1793
	keyCommands := IdentityDictionary new
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1794
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1795
    keyCommands at:aKey put:aBlock
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1796
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1797
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1798
removeActionForKey:aKey
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1799
    keyCommands notNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1800
	keyCommands removeKey:aKey ifAbsent:[]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1801
    ]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1802
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1803
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1804
!DisplaySurface methodsFor:'queries'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1805
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1806
buttonMotionEventPending
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1807
    "return true, if a button motion event is pending.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1808
     Normally, you dont want to use this, since no polling is needed
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1809
     (not even for mouse-tracking).
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1810
     Dont use it, since it does not honor the windowGroup, but
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1811
     goes directly to the device instead.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1812
     Actually, its a historical leftover"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1813
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1814
    device flush.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1815
    ^ device eventPending:#buttonMotion for:drawableId
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1816
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1817
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1818
buttonReleaseEventPending
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1819
    "return true, if a button release event is pending.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1820
     Dont use it, since it does not honor the windowGroup, but
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1821
     goes directly to the device instead.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1822
     Actually, its a historical leftover"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1823
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1824
    device flush.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1825
    ^ device eventPending:#buttonRelease for:drawableId
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1826
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1827
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1828
exposeEventPending
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1829
    "return true, if an expose event is pending."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1830
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1831
    |sensor|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1832
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1833
    ((sensor := self sensor) notNil and:[sensor hasDamageFor:self]) ifTrue:[^ true].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1834
    ^ device eventPending:#expose for:drawableId
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1835
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1836
2010
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  1837
isPopUpView
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  1838
    "return true, if this view should be put on top (raised) automatically.
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  1839
     usually this is true for alertBoxes etc."
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  1840
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  1841
    ^ false
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  1842
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  1843
    "Created: / 22.1.1998 / 15:01:32 / stefan"
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  1844
!
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  1845
920
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1846
isRootView
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1847
    "return true, if the receiver is a root view
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1848
     false is returned here, this is only redefined in DisplayRootView."
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1849
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1850
    ^ false
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1851
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1852
    "Modified: 28.5.1996 / 19:27:34 / cg"
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1853
    "Created: 5.7.1996 / 14:58:55 / cg"
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1854
!
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1855
1481
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1856
isTopView
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1857
    "return true, if the receiver is some kind of topview;
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1858
     false is returned here; redefined in some subclasses."
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1859
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1860
    ^ false
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1861
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1862
    "Modified: 28.5.1996 / 19:27:34 / cg"
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1863
    "Created: 22.3.1997 / 14:45:29 / cg"
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1864
!
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1865
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1866
isView
734
1a778cedbbf5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1867
    "return true, if the receiver is some kind of view;
1a778cedbbf5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1868
     true is returned here."
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1869
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1870
    ^ true
734
1a778cedbbf5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1871
1a778cedbbf5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1872
    "Modified: 28.5.1996 / 19:27:34 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1873
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1874
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1875
isXtWidget
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1876
    ^ false
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1877
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1878
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1879
redrawsFull
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1880
    ^ false
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1881
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1882
    "Created: 4.3.1996 / 14:17:22 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1883
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1884
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1885
!DisplaySurface methodsFor:'queries-contents'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1886
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1887
heightOfContents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1888
    "return the height of the contents in pixels.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1889
     Since we dont know here, just return the views size.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1890
     This will make your scrollbars show 100%-visible.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1891
     Must be redefined in subviews to make scrollbars really work."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1892
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1893
    ^ self height
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1894
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1895
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1896
widthOfContents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1897
    "return the width of the contents in pixels.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1898
     Since we dont know here, just return the views size.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1899
     This will make your scrollbars show 100%-visible.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1900
     Must be redefined in subviews to make scrollbars really work."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1901
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1902
    ^ self width
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1903
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1904
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1905
xOriginOfContents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1906
    "return the x-origin of the contents in pixels.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1907
     Since we dont know here, just return 0 for left.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1908
     Must be redefined in subviews to make scrollbars really work."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1909
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1910
    ^ 0
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1911
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1912
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1913
yOriginOfContents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1914
    "return the y-origin of the contents in pixels.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1915
     Since we dont know here, just return 0 for top.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1916
     Must be redefined in subviews to make scrollbars really work."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1917
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1918
    ^ 0
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1919
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1920
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1921
!DisplaySurface methodsFor:'selection handling '!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1922
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1923
getSelection
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1924
    "return the object selection - either the local one, or the displays
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  1925
     clipBoard buffer."
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1926
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1927
    |sel|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1928
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1929
    sel := device getCopyBuffer.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1930
    sel isNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1931
	sel := device getSelectionFor:drawableId.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1932
	sel isNil ifTrue:[^ nil].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1933
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1934
    ^ sel
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1935
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  1936
    "Modified: 13.2.1997 / 13:18:50 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1937
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1938
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1939
getTextSelection
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1940
    "return the text selection - either the local one, or the displays
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  1941
     clipBoard buffer."
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1942
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1943
    |sel|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1944
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1945
    sel := device getCopyBuffer.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1946
    sel isNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1947
	sel := device getTextSelectionFor:drawableId.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1948
	sel isNil ifTrue:[^ nil].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1949
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1950
    ^ sel
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1951
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  1952
    "Modified: 13.2.1997 / 13:19:26 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1953
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1954
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  1955
pasteFromClipBoard:aString
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1956
    "this is sent from the display as a reply to a request for a
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1957
     selection. The view should be prepared to paste the received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1958
     string (it asked for it so that should not be a problem)"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1959
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  1960
    self paste:aString
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1961
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  1962
    "Created: 13.2.1997 / 13:06:11 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1963
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1964
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1965
setSelection:something
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1966
    "set the object selection - both the local one, and tell the display
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  1967
     that we have changed it (i.e. place it into the clipBoard)."
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1968
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1969
    device setLastCopyBuffer:nil.
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1970
    device setCopyBuffer:something.
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  1971
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1972
    (device setSelection:something owner:drawableId) ifFalse:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1973
	'DisplaySurface [warning]: could not copy selection to clipBoard' errorPrintCR
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1974
    ]
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1975
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  1976
    "Modified: 13.2.1997 / 13:19:51 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1977
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1978
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1979
setTextSelection:something
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1980
    "set the text selection - both the local one, and tell the display
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  1981
     that we have changed it (i.e. place it into the clipBoard)."
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1982
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1983
    |s|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1984
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1985
    device setLastCopyBuffer:nil.
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1986
    device setCopyBuffer:something.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1987
    s := something.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1988
    s isString ifFalse:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1989
	s := s asStringWithCRsFrom:1 to:(s size) compressTabs:false withCR:false
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1990
    ].
2196
f78bbe9789b0 always copy strings to the clipBoard.
Claus Gittinger <cg@exept.de>
parents: 2175
diff changeset
  1991
f78bbe9789b0 always copy strings to the clipBoard.
Claus Gittinger <cg@exept.de>
parents: 2175
diff changeset
  1992
    "/ for now - should add support to pass emphasis information too
f78bbe9789b0 always copy strings to the clipBoard.
Claus Gittinger <cg@exept.de>
parents: 2175
diff changeset
  1993
    s := s string.
f78bbe9789b0 always copy strings to the clipBoard.
Claus Gittinger <cg@exept.de>
parents: 2175
diff changeset
  1994
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1995
    (device setTextSelection:s owner:drawableId) ifFalse:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1996
	'DisplaySurface [warning]: could not copy selection to clipBoard' errorPrintCR.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1997
    ]
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1998
2196
f78bbe9789b0 always copy strings to the clipBoard.
Claus Gittinger <cg@exept.de>
parents: 2175
diff changeset
  1999
    "Modified: / 16.7.1998 / 21:38:55 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2000
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2001
1093
18ea3ccf5d2f category rename
Claus Gittinger <cg@exept.de>
parents: 1074
diff changeset
  2002
!DisplaySurface methodsFor:'user notification'!
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2003
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2004
beep
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2005
    "output an audible beep or bell on my screen device"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2006
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2007
    device beep; flush
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2008
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2009
    "Created: 28.5.1996 / 16:16:13 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2010
    "Modified: 28.5.1996 / 16:58:25 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2011
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2012
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2013
showActivity:aMessage
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2014
    "this is sent indirectly by the activityNotification mechanism.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2015
     Defined here as a fallback, if ever sent to non topviews."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2016
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2017
    Transcript showCR:aMessage
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2018
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2019
    "Modified: 18.5.1996 / 15:44:33 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2020
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2021
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2022
!DisplaySurface::DeviceViewHandle class methodsFor:'documentation'!
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2023
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2024
documentation
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2025
"
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2026
    This is used as a finalization handle for views - in previous systems,
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2027
    a shallowCopy of a view was responsible to destroy the underlying
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2028
    devices view. To make the memory requirements smaller and to speed up
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2029
    view creation a bit, this lightweight class is used now, which only
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2030
    keeps the device handle for finalization.
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2031
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2032
    [see also:]
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2033
	DisplaySurface
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2034
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2035
    [author:]
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2036
	Claus Gittinger
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2037
"
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2038
! !
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2039
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2040
!DisplaySurface::DeviceViewHandle methodsFor:'finalization'!
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2041
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2042
disposed
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2043
    "the view for which I am a handle was collected 
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2044
     - release system resources"
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2045
2096
f3f0d358239f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2010
diff changeset
  2046
    |v id|
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2047
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2048
    drawableId notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2049
	(id := gcId) notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2050
	    gcId := nil.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2051
	    device destroyGC:id.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2052
	].
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2053
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2054
	"/ care for lost-view trouble:
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2055
	"/ if the windowID is still registered,
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2056
	"/ this may be due to a not-yet-reclaimed
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2057
	"/ subview of a view which has already been destroyed
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2058
	"/ (X recycles window handles.)
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2059
	"/ In this case, we arrive here with a nil-view argument,
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2060
	"/ and a windowId, which is already reused for some other view.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2061
	"/ The situation is detected by finding a non-nil (and non-zero)
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2062
	"/ view in the devices id<->view table for the given windowId.
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2063
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2064
	(device viewIdKnown:drawableId) ifTrue:[
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2065
"/ 'Display [info]: recycled view (' infoPrint. v infoPrint. ') not destroyed: ' infoPrint.
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2066
"/ drawableId displayString infoPrintCR.
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2067
	    drawableId := nil.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2068
	] ifFalse:[
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2069
"/ 'GC destroy: ' print. drawableId displayString printCR.
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2070
"/ device checkKnownViewId:drawableId.
2096
f3f0d358239f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2010
diff changeset
  2071
	    id := drawableId.
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2072
	    drawableId := nil.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2073
	    device destroyView:nil withId:id.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2074
	]
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2075
    ].
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2076
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2077
    "Modified: 4.4.1997 / 11:01:48 / cg"
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2078
    "Created: 25.9.1997 / 10:01:46 / stefan"
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2079
! !
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2080
1093
18ea3ccf5d2f category rename
Claus Gittinger <cg@exept.de>
parents: 1074
diff changeset
  2081
!DisplaySurface class methodsFor:'documentation'!
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2082
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2083
version
2341
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
  2084
    ^ '$Header: /cvs/stx/stx/libview/DisplaySurface.st,v 1.44 1998-09-14 16:28:42 cg Exp $'
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2085
! !