DisplaySurface.st
author Claus Gittinger <cg@exept.de>
Sun, 10 Jan 1999 18:03:56 +0100
changeset 2421 037f43af3b0e
parent 2398 bc2e3e470efe
child 2427 d03456c66c8c
permissions -rw-r--r--
checkin from browser
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
        gcId notNil ifTrue:[
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   715
            org := self viewOrigin.
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   716
            device setMaskOriginX:org x rounded negated
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   717
                                y:org y rounded negated
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   718
                               in:gcId
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   719
        ].
2356
4efd761cc439 change mask origin first, then do manual fill if
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   720
        device supportsMaskedDrawing ifFalse:[
4efd761cc439 change mask origin first, then do manual fill if
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   721
            self fillWithViewBackgroundX:x y:y width:w height:h.
4efd761cc439 change mask origin first, then do manual fill if
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   722
            ^ self.
4efd761cc439 change mask origin first, then do manual fill if
Claus Gittinger <cg@exept.de>
parents: 2352
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
2356
4efd761cc439 change mask origin first, then do manual fill if
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   734
    "Modified: / 11.9.1998 / 23:23:56 / 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
2393
247e70febb7d oops - clearDeviceRectangle may not be invoked with floats.
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   756
    pX := pX rounded.
247e70febb7d oops - clearDeviceRectangle may not be invoked with floats.
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   757
    pY := pY rounded.
247e70febb7d oops - clearDeviceRectangle may not be invoked with floats.
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   758
    pW := pW rounded.
247e70febb7d oops - clearDeviceRectangle may not be invoked with floats.
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   759
    pH := pH rounded.
247e70febb7d oops - clearDeviceRectangle may not be invoked with floats.
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   760
2341
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   761
    ^ 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
   762
2393
247e70febb7d oops - clearDeviceRectangle may not be invoked with floats.
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   763
    "Modified: / 30.10.1998 / 15:00:37 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   764
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   765
2398
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   766
fillWithViewBackgroundX:xIn y:yIn width:wIn height:hIn
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   767
    "fill a rectangular area with the viewBackground.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   768
     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
   769
     (i.e. win32 screens).
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   770
     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
   771
2398
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   772
    |r b pW pH xR yR oldFg oldBg oldClip fg bg x y w h|
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   773
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   774
    x := xIn max:0.
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   775
    y := yIn max:0.
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   776
    r := (xIn + wIn - 1) min:(self width - 1).
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   777
    b := (yIn + hIn - 1) min:(self height - 1).
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   778
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   779
    pW := viewBackground width.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   780
    pH := viewBackground height.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   781
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   782
    oldFg := foreground.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   783
    oldBg := background.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   784
    oldClip := self clippingRectangleOrNil.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   785
2398
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   786
    oldClip notNil ifTrue:[
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   787
        x := x max:oldClip left.
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   788
        y := y max:oldClip top.
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   789
        r := r min:oldClip right.
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   790
        b := b min:oldClip bottom.
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   791
    ].
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   792
    w := r-x+1.
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   793
    h := b-y+1.
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   794
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   795
    viewBackground depth == 1 ifTrue:[
2342
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   796
        viewBackground colorMap notNil ifTrue:[
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   797
            bg := viewBackground colorMap at:1.
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   798
            fg := viewBackground colorMap at:2.
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   799
        ] ifFalse:[
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   800
            bg := Color white.
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   801
            fg := Color black.
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   802
        ].
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   803
        self foreground:fg.
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   804
        self background:bg.
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   805
    ].
2342
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   806
    self deviceClippingRectangle:(x@y extent:w@h).
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   807
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   808
    yR := (y // pH) * pH.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   809
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   810
    [yR < (y+h)] whileTrue:[
2342
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   811
        xR := (x // pW) * pW.
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   812
        [xR < (x+w)] whileTrue:[
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   813
            self
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   814
                copyFrom:viewBackground 
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   815
                x:0 y:0 
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   816
                toX:xR y:yR 
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   817
                width:pW height:pH 
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   818
                async:false.
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   819
            xR := xR + pW.
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   820
        ].
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   821
        yR := yR + pH.
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   822
    ].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   823
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   824
    self foreground:oldFg.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   825
    self background:oldBg.
2342
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   826
    self deviceClippingRectangle:oldClip.
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   827
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   828
    "Created: / 6.9.1998 / 14:00:50 / cg"
2398
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   829
    "Modified: / 11.11.1998 / 15:35:34 / cg"
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   830
!
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   831
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   832
redraw
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   833
    "nothing done here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   834
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   835
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   836
! !
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
!DisplaySurface methodsFor:'enable/disable events'!
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
compressMotionEvents:aBoolean
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   841
    "enable/disable motion event compression
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   842
     (i.e. replacing all motion events by the last one).
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   843
     Compression makes almost always sense, except when
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   844
     doing things like freehand drawing"
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
    |s|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   847
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   848
    (s := self sensor) notNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   849
	s compressMotionEvents:aBoolean
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   850
    ]
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
disableButtonEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   854
    "disable all button 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:#buttonPress; 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
    "Modified: 29.4.1996 / 11:09:25 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   859
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   860
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   861
disableButtonMotionEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   862
    "disable button motion-while-button-is-pressed events"
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
    self disableEvent:#buttonMotion
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
disableButtonPressEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   868
    "disable button press events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   869
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   870
    self disableEvent:#buttonPress
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   873
disableButtonReleaseEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   874
    "disable button release events"
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
    self disableEvent:#buttonRelease
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   879
disableEnterLeaveEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   880
    "disable both mouse-pointer enter and leave events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   881
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   882
    self disableEvent:#enter; disableEvent:#leave
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
    "Modified: 29.4.1996 / 11:09:37 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   885
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   886
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   887
disableEvent:anEventSymbol
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   888
    "disable an event -
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   889
     this is a private (internal) method not to be used externally.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   890
     for a list of allowed event symbols see Workstation class"
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
    eventMask := eventMask bitAnd:(device eventMaskFor:anEventSymbol) bitInvert.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   893
    drawableId notNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   894
	device setEventMask:eventMask in:drawableId
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   895
    ]
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   898
disableMotionEvents
1332
624bcfb69025 commentary
ca
parents: 1317
diff changeset
   899
    "disable mouse-pointer motion events"
624bcfb69025 commentary
ca
parents: 1317
diff changeset
   900
    
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   901
    self disableEvent:#pointerMotion
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   902
!
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
enableButtonEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   905
    "enable both mouse button press and release events.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   906
     These are enabled by default anyway."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   907
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   908
    self enableEvent:#buttonPress; enableEvent:#buttonRelease
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   909
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   910
    "Modified: 29.4.1996 / 11:09:46 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   911
!
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
enableButtonMotionEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   914
    "enable mouse-pointer motion-while-button-is-pressed events.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   915
     These are enabled by default anyway."
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:#buttonMotion
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
enableButtonPressEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   921
    "enable mouse button press events.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   922
     These are enabled by default anyway."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   923
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   924
    self enableEvent:#buttonPress
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   925
!
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
enableButtonReleaseEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   928
    "enable mouse button release events.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   929
     These are enabled by default anyway."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   930
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   931
    self enableEvent:#buttonRelease
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   934
enableEnterEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   935
    "enable mouse-pointer enter events"
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
    self enableEvent:#enter
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   940
enableEnterLeaveEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   941
    "enable both mouse-pointer enter and leave events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   942
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   943
    self enableEvent:#enter; enableEvent:#leave
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
    "Modified: 29.4.1996 / 11:09:55 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   946
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   947
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   948
enableEvent:anEventSymbol
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   949
    "enable an event -
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   950
     this is a private (internal) method not to be used externally.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   951
     for a list of allowed event symbols see Workstation class"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   952
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   953
    eventMask := eventMask bitOr:(device eventMaskFor:anEventSymbol).
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   954
    drawableId notNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   955
	device setEventMask:eventMask in:drawableId
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
enableFocusEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   960
    "enable keyboard focus change 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:#focusChange
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
enableKeyEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   966
    "this is a compatibility leftover - 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   967
     starting with 2.10.3, keyPress is always enabled to allow 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   968
     ^C processing."
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   972
enableKeyPressEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   973
    "this is a compatibility leftover - 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   974
     starting with 2.10.3, keyPress is always enabled to allow 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   975
     ^C processing."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   976
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   977
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   978
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   979
enableKeyReleaseEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   980
    "enable key release events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   981
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   982
    self enableEvent:#keyRelease
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   983
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   984
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   985
enableLeaveEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   986
    "enable mouse-pointer leave events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   987
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   988
    self enableEvent:#leave
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   989
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   990
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   991
enableMotionEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   992
    "enable mouse-pointer motion events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   993
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   994
    self enableEvent:#pointerMotion
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   995
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   996
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
   997
!DisplaySurface methodsFor:'event dispatching'!
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
   998
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
   999
dispatchEvent:event
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1000
    "dispatch the event"
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1001
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1002
    self 
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1003
	dispatchEvent:event type
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1004
	arguments:(event arguments)
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1005
	withFocusOn:nil
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1006
	delegate:true
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1007
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1008
    "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
  1009
!
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1010
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1011
dispatchEvent:type arguments:arguments
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1012
    ^ self 
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1013
	dispatchEvent:type 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1014
	arguments:arguments 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1015
	withFocusOn:nil 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1016
	delegate:true
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1017
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1018
    "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
  1019
!
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1020
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1021
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
  1022
    "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
  1023
     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
  1024
     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
  1025
     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
  1026
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1027
     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
  1028
     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
  1029
     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
  1030
     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
  1031
     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
  1032
     before.
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1033
     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
  1034
     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
  1035
     forwarding."
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1036
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1037
    |delegate selector delegateMessage delegateQuery 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1038
     eventReceiver controller deviceMessage
2129
530cc6e1b3b9 oops - uninitialized var used
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
  1039
     isKeyEvent isButtonEvent isPointerEvent 
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1040
     rect x y w h|
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1041
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1042
    isKeyEvent := isButtonEvent := isPointerEvent := false.
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1043
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1044
    type == #damage ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1045
	self shown ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1046
	    rect := argArray.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1047
	    x := rect left.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1048
	    y := rect top.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1049
	    w := rect width.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1050
	    h := rect height.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1051
	    transformation notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1052
		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
  1053
	    ] ifFalse:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1054
		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
  1055
	    ]
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1056
	].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1057
	^ self
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1058
    ].
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1059
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1060
    (type == #'keyPress:x:y:') ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1061
	isKeyEvent := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1062
	deviceMessage := #'deviceKeyPress:x:y:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1063
	delegateMessage := #'keyPress:x:y:view:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1064
	delegateQuery := #'handlesKeyPress:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1065
    ] ifFalse:[ (type == #'keyRelease:x:y:') ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1066
	isKeyEvent := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1067
	deviceMessage := #'deviceKeyRelease:x:y:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1068
	delegateMessage := #'keyRelease:x:y:view:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1069
	delegateQuery := #'handlesKeyRelease:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1070
    ] ifFalse:[ (type == #'buttonMotion: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 := #'deviceButtonMotion:x:y:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1073
	delegateMessage := #'buttonMotion:x:y:view:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1074
	delegateQuery := #'handlesButtonMotion:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1075
    ] ifFalse:[ (type == #'buttonPress:x:y:') ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1076
	isButtonEvent := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1077
	deviceMessage := #'deviceButtonPress:x:y:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1078
	delegateMessage := #'buttonPress:x:y:view:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1079
	delegateQuery := #'handlesButtonPress:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1080
    ] ifFalse:[ (type == #'buttonRelease:x:y:') ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1081
	isButtonEvent := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1082
	deviceMessage := #'deviceButtonRelease:x:y:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1083
	delegateMessage := #'buttonRelease:x:y:view:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1084
	delegateQuery := #'handlesButtonRelease:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1085
    ] ifFalse:[ (type == #'buttonShiftPress:x:y:') ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1086
	isButtonEvent := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1087
	deviceMessage := #'deviceButtonShiftPress:x:y:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1088
	delegateMessage := #'buttonShiftPress:x:y:view:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1089
	delegateQuery := #'handlesButtonShiftPress:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1090
    ] ifFalse:[ (type == #'buttonMultiPress:x:y:') ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1091
	isButtonEvent := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1092
	deviceMessage := #'deviceButtonMultiPress:x:y:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1093
	delegateMessage := #'buttonMultiPress:x:y:view:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1094
	delegateQuery := #'handlesButtonMultiPress:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1095
    ] ifFalse:[ (type == #'pointerEnter:x:y:') ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1096
	isPointerEvent := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1097
	deviceMessage := #'devicePointerEnter:x:y:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1098
	delegateMessage := #'pointerEnter:x:y:view:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1099
	delegateQuery := #'handlesPointerEnter:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1100
    ] ifFalse:[ (type == #'pointerLeave:') ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1101
	isPointerEvent := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1102
	deviceMessage := type.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1103
	delegateMessage := #'pointerLeave:view:'.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1104
	delegateQuery := #'handlesPointerLeave:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1105
    ] 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
  1106
	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
  1107
    ] 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
  1108
	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
  1109
    ]]]]]]]]]]].
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1110
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1111
    "
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1112
     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
  1113
     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
  1114
     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
  1115
     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
  1116
    "
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1117
    (focusView notNil 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1118
    and:[isKeyEvent]) ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1119
	focusView 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1120
	    dispatchEvent:type 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1121
	    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
  1122
	    withFocusOn:nil
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1123
	    delegate:doDelegate.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1124
	^ self
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1125
    ].
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1127
    doDelegate ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1128
	"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1129
	 handle delegated messages
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1130
	"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1131
	(isKeyEvent 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1132
	 or:[isButtonEvent 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1133
	 or:[isPointerEvent]]) ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1134
	    delegate := self delegate.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1135
2300
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
	     what a kludge - sending to delegate requires
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1138
	     another selector and an additional argument ...
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1139
	    "
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1140
	    (delegate notNil
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1141
	    and:[delegate respondsTo:delegateMessage]) ifTrue:[
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
		 is the delegate interested in that event ?
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1144
		 (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
  1145
		  we assume: NO)
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1146
		"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1147
		((delegate respondsTo:delegateQuery) 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1148
		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
  1149
		    "
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1150
		     mhmh ... have to convert to logical coordinates
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1151
		    "        
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1152
		    transformation notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1153
			argArray size > 2 ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1154
			    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
  1155
			    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
  1156
			].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1157
		    ].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1158
		    argArray isNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1159
			delegate perform:delegateMessage with:self
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1160
		    ] ifFalse:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1161
			delegate perform:delegateMessage withArguments:(argArray copyWith:self)
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1162
		    ].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1163
		    ^ self
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1164
		]
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1165
	    ].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1166
	].
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1167
    ].
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1168
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1169
    (isKeyEvent 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1170
     or:[isButtonEvent 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1171
     or:[isPointerEvent]]) ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1172
	realized ifFalse:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1173
	    ^ self
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1174
	]
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1175
    ].
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1176
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1177
    "
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1178
     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
  1179
    "
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1180
    eventReceiver := self.
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1181
    (controller := self controller) notNil ifTrue:[  
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1182
	(isKeyEvent 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1183
	 or:[isButtonEvent 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1184
	 or:[isPointerEvent
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1185
	 or:[(type == #focusIn)
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1186
	 or:[(type == #focusOut)]]]]) ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1187
	    eventReceiver := controller.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1188
	]
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1189
    ].
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1190
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
     finally, another one:
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1193
     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
  1194
     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
  1195
     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
  1196
     in DisplaySurface translates and resends).
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1197
     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
  1198
     (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
  1199
     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
  1200
    "
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1201
    selector := type.
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1202
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1203
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1204
	(isKeyEvent
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1205
	 or:[isButtonEvent
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1206
	 or:[isPointerEvent
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1207
	 or:[(type == #'exposeX:y:width:height:')
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1208
	 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
  1209
	    selector := deviceMessage
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1210
	]        
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1211
    ].
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1212
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1213
    eventReceiver perform:selector withArguments:argArray
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1214
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1215
    "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
  1216
    "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
  1217
! !
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1218
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1219
!DisplaySurface methodsFor:'event handling'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1220
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1221
activateMenu
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1222
    "if there is a menu, show it."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1223
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1224
    middleButtonMenu notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1225
	middleButtonMenu showAtPointer
727
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1228
    "Created: 1.3.1996 / 13:24:55 / cg"
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
buttonMotion:state x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1232
    "mouse was moved while button is pressed - do nothing here"
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
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1235
!
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
buttonMultiPress:button x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1238
    "button was pressed fast after previous press - default to press-again"
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
    ^ self buttonPress:button x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1241
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1242
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1243
buttonPress:button x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1244
    "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
  1245
     show it."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1246
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1247
    ((button == 2) or:[button == #menu]) ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1248
	self activateMenu.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1249
    ]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1250
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1251
    "Modified: 1.3.1996 / 13:25:07 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1252
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1253
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1254
buttonRelease:button x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1255
    "button was released - do nothing here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1256
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1257
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1258
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1259
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1260
catchExpose
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1261
    "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
  1262
     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
  1263
     Sometime after the bit-blt, waitForExpose should be sent, to finally
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1264
     suspend until the expose/noExpose event arrives. 
1332
624bcfb69025 commentary
ca
parents: 1317
diff changeset
  1265
     This is an X speciality - for devices which do not need this kind of 
624bcfb69025 commentary
ca
parents: 1317
diff changeset
  1266
     asynchronous bit-blt confirmation, this is a noop.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1267
    "
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1268
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1269
    |wg|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1270
1027
0ba82862ca8d fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
  1271
    device scrollsAsynchronous ifFalse:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1272
	gotExpose := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1273
	^ self
1027
0ba82862ca8d fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
  1274
    ].
0ba82862ca8d fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
  1275
1295
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1276
    self setGraphicsExposures:true.
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1277
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1278
    gotExpose := false.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1279
    wg := self windowGroup.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1280
    wg notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1281
	"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1282
	 must process eny pending expose events, since
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1283
	 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
  1284
	 expose events coordinates are invalid 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1285
	"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1286
	wg processRealExposeEventsFor:self.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1287
	wg sensor catchExposeFor:self
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1288
    ]
1245
4a4e15a3e4fd pass the view as argument to the catchExpose method
Claus Gittinger <cg@exept.de>
parents: 1236
diff changeset
  1289
1851
6a6225647696 fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1290
    "Modified: 6.8.1997 / 19:50:15 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1291
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1292
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1293
deviceButtonMotion:state x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1294
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1295
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1296
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1297
     and send a #buttonMotion with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1298
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1299
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1300
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1301
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1302
     should redefine #buttonMotion:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1303
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1304
    |lx ly|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1305
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1306
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1307
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1308
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1309
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1310
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1311
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1312
	].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1313
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1314
    self buttonMotion:state x:lx y:ly
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1315
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1316
    "Modified: 20.5.1996 / 17:45:25 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1317
    "Modified: 14.10.1996 / 22:25:12 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1318
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1319
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1320
deviceButtonMultiPress:butt x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1321
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1322
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1323
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1324
     and send a buttonMultiPress with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1325
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1326
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1327
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1328
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1329
     should redefine #buttonMultiPress:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1330
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1331
    |lx ly|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1332
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1333
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1334
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1335
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1336
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1337
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1338
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1339
	].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1340
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1341
    self buttonMultiPress:butt x:lx y:ly
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1342
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1343
    "Modified: 20.5.1996 / 17:45:22 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1344
    "Modified: 14.10.1996 / 22:25:22 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1345
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1346
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1347
deviceButtonPress:butt x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1348
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1349
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1350
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1351
     and send a buttonPress with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1352
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1353
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1354
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1355
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1356
     should redefine #buttonPress:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1357
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1358
    |lx ly|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1359
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1360
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1361
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1362
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1363
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1364
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1365
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1366
	].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1367
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1368
    self buttonPress:butt x:lx y:ly
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1369
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1370
    "Modified: 20.5.1996 / 17:45:18 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1371
    "Modified: 14.10.1996 / 22:25:30 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1372
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1373
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1374
deviceButtonRelease:butt x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1375
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1376
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1377
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1378
     and send a buttonRelease with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1379
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1380
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1381
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1382
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1383
     should redefine #buttonRelease:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1384
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1385
    |lx ly|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1386
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1387
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1388
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1389
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1390
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1391
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1392
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1393
	].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1394
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1395
    self buttonRelease:butt x:lx y:ly
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1396
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1397
    "Modified: 20.5.1996 / 17:45:14 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1398
    "Modified: 14.10.1996 / 22:25:37 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1399
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1400
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1401
deviceButtonShiftPress:butt x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1402
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1403
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1404
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1405
     and send a buttonShiftPress with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1406
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1407
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1408
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1409
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1410
     should redefine #buttonShiftPress:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1411
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1412
    |lx ly|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1413
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1414
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1415
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1416
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1417
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1418
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1419
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1420
	].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1421
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1422
    self buttonShiftPress:butt x:lx y:ly
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1423
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1424
    "Modified: 20.5.1996 / 17:45:09 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1425
    "Modified: 14.10.1996 / 22:25:49 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1426
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1427
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1428
deviceExposeX:x y:y width:w height:h
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1429
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1430
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1431
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1432
     and send an expose with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1433
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1434
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1435
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1436
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1437
     should redefine #exposeX:x:y:width:height:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1438
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1439
    |lx ly lw lh|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1440
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1441
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1442
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1443
    lw := w.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1444
    lh := h.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1445
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1446
	lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1447
	ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1448
	lw := transformation applyInverseScaleX:lw.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1449
	lh := transformation applyInverseScaleY:lh.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1450
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1451
    self exposeX:lx y:ly width:lw height:lh
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1452
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1453
    "Modified: 13.5.1996 / 11:31:44 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1454
    "Modified: 14.10.1996 / 22:26:00 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1455
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1456
1295
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1457
deviceGraphicsExposeX:x y:y width:w height:h final:final
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1458
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1459
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1460
     If there is a transformation, apply the inverse
1295
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1461
     and send a graphicsExpose with the logical coordinates.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1462
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1463
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1464
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1465
     those which are interested in logical coordinates
1295
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1466
     should redefine #graphicsExposeX:x:y:width:height:"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1467
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1468
    |lx ly lw lh|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1469
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1470
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1471
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1472
    lw := w.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1473
    lh := h.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1474
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1475
	lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1476
	ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1477
	lw := transformation applyInverseScaleX:lw.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1478
	lh := transformation applyInverseScaleY:lh.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1479
    ].
1295
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1480
    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
  1481
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1482
    "Modified: 13.5.1996 / 11:31:54 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1483
    "Modified: 14.10.1996 / 22:26:08 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1484
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1485
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1486
deviceKeyPress:key x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1487
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1488
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1489
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1490
     and send a keyPress with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1491
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1492
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1493
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1494
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1495
     should redefine #keyPress:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1496
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1497
    |lx ly|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1498
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1499
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1500
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1501
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1502
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1503
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1504
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1505
	]
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1506
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1507
    self keyPress:key x:lx y:ly
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1508
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1509
    "Modified: 20.5.1996 / 17:44:59 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1510
    "Modified: 14.10.1996 / 22:26:17 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1511
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1512
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1513
deviceKeyRelease:key x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1514
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1515
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1516
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1517
     and send a keyRelease with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1518
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1519
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1520
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1521
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1522
     should redefine #keyRelease:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1523
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1524
    |lx ly|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1525
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1526
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1527
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1528
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1529
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1530
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1531
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1532
	]
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1533
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1534
    self keyRelease:key x:lx y:ly
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1535
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1536
    "Modified: 20.5.1996 / 17:44:42 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1537
    "Modified: 14.10.1996 / 22:26:28 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1538
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1539
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1540
devicePointerEnter:state x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1541
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1542
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1543
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1544
     and send a pointerEnter with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1545
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1546
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1547
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1548
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1549
     should redefine #pointerEnter:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1550
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1551
    |lx ly|
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
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1554
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1555
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1556
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1557
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1558
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1559
	]
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1560
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1561
    self pointerEnter:state x:lx y:ly
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1562
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1563
    "Modified: 20.5.1996 / 17:44:54 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1564
    "Modified: 14.10.1996 / 22:26:35 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1565
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1566
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1567
exposeX:x y:y width:w height:h
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1568
    "an expose event - nothing done here"
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
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1571
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1572
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1573
focusIn
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1574
    "got keyboard focus - do nothing here"
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
    ^ self
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1579
focusOut
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1580
    "lost keyboard focus - do nothing here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1581
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1582
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1583
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1584
1295
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1585
graphicsExposeX:x y:y width:w height:h final:final
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1586
    "an expose event after a scroll - do normal redraw processing"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1587
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1588
    self exposeX:x y:y width:w height:h
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1589
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1590
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1591
keyPress:key x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1592
    "a key was pressed in this view.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1593
     Here only keyCommands are handled - more action has to
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1594
     be implemented by redefining this method"
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
    |action|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1597
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1598
    keyCommands notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1599
	action := keyCommands at:key ifAbsent:[nil].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1600
	action notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1601
	    action value
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1602
	]
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1603
    ].
1105
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1604
    key isSymbol ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1605
	(key startsWith:#Basic) ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1606
	    "/ an unhandled BasicFoo key;
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1607
	    "/ retry as Foo
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1608
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1609
	    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
  1610
	].
1105
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1611
    ].
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1612
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1613
    "Modified: 6.11.1996 / 17:51:15 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1614
!
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
keyRelease:key x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1617
    "default action is to do nothing"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1618
    
1105
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1619
    key isSymbol ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1620
	(key startsWith:#Basic) ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1621
	    "/ an unhandled BasicFoo key;
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1622
	    "/ retry as Foo
1105
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1623
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1624
	    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
  1625
	].
1105
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1626
    ].
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1627
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1628
    ^ self
1105
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1629
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1630
    "Modified: 6.11.1996 / 17:51:20 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1631
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1632
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1633
noExpose
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1634
    "a no expose event after a scroll (event-mode only)"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1635
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1636
    gotExpose := true
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1637
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1638
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1639
pointerEnter:state x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1640
    "mouse cursor entered view - do nothing here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1641
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1642
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1643
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1644
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1645
pointerLeave:state
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1646
    "mouse cursor left view - do nothing here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1647
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1648
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1649
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1650
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1651
resizeRequest
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1652
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1653
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1654
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1655
waitForExpose
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1656
    "wait until an expose event arrives (to wait for scroll-finish)"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1657
2421
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1658
    |wg endPollTime pollDelay|
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1659
1027
0ba82862ca8d fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
  1660
    device scrollsAsynchronous ifFalse:[
2421
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1661
        gotExpose := true.
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1662
        ^ self
1027
0ba82862ca8d fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
  1663
    ].
0ba82862ca8d fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
  1664
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1665
    wg := self windowGroup.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1666
    wg notNil ifTrue:[
2421
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1667
        "/
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1668
        "/ a normal (suspendable) view.
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1669
        "/ wait by doing a real wait
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1670
        "/
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1671
         wg waitForExposeFor:self
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1672
    ] ifFalse:[
2421
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1673
        "/
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1674
        "/ a pure event driven view.
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1675
        "/ wait by doing a direct dispatch loop until the event arrives.
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1676
        "/ i.e. poll for the event
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1677
        "/
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1678
        device platformName = 'WIN32' ifTrue:[
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1679
            pollDelay := 1.
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1680
        ] ifFalse:[
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1681
            pollDelay := 3.
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1682
        ].
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1683
        endPollTime := AbsoluteTime now addSeconds:pollDelay.
1872
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1851
diff changeset
  1684
2421
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1685
        [gotExpose] whileFalse:[
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1686
            realized ifTrue:[
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1687
                (device exposeEventPendingFor:drawableId withSync:true) ifTrue:[
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1688
                    device dispatchExposeEventFor:drawableId.
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1689
                ].
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1690
            ].
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1691
            realized ifFalse:[
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1692
                gotExpose := true.
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1693
                ^ self
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1694
            ].
1872
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1851
diff changeset
  1695
2421
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1696
            "/ 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
  1697
2421
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1698
            AbsoluteTime now > endPollTime ifTrue:[
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1699
                'DisplaySurface [warning]: lost expose event' errorPrintCR.
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1700
                gotExpose := true.
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1701
                ^ self
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1702
            ].
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1703
            Processor yield.
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1704
        ].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1705
    ]
1129
2a3eaf218500 destroy while waiting for expose.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1706
2421
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1707
    "Modified: / 9.1.1999 / 01:58:09 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1708
! !
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
!DisplaySurface methodsFor:'initialize / release'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1711
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1712
destroy
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1713
    "view is about to be destroyed -
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1714
     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
  1715
     then the view is physically destroyed."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1716
     
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1717
    middleButtonMenu notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1718
	middleButtonMenu destroy.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1719
	middleButtonMenu := nil
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1720
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1721
    keyCommands := nil.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1722
    gcId notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1723
	device destroyGC:gcId.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1724
	gcId := nil
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1725
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1726
    drawableId notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1727
	device destroyView:self withId:drawableId.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1728
	drawableId := nil.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1729
	realized := false.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1730
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1731
    Lobby unregister:self.
1129
2a3eaf218500 destroy while waiting for expose.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1732
1317
e1bd3b4aee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
  1733
    "Modified: 8.2.1997 / 15:50:04 / cg"
727
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
destroyed
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1737
    "view has been destroyed by someone else"
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
    drawableId notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1740
	device removeKnownView:self withId:drawableId.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1741
	drawableId := nil.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1742
	realized := false. 
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1743
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1744
    self destroy
1481
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1745
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1746
    "Modified: 22.3.1997 / 14:56:34 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1747
!
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
initCursor
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1750
    "default cursor for all views"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1751
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1752
    cursor := Cursor arrow
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1753
!
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
initStyle
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1756
    "nothing done here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1757
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1758
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1759
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1760
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1761
initialize
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1762
    "initialize defaults"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1763
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1764
    super initialize.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1765
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1766
    eventMask := Display defaultEventMask.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1767
    viewBackground := background.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1768
    backed := false.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1769
    saveUnder := false.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1770
    self initCursor
1252
fccb14086649 exposePending is no longer used
Claus Gittinger <cg@exept.de>
parents: 1245
diff changeset
  1771
fccb14086649 exposePending is no longer used
Claus Gittinger <cg@exept.de>
parents: 1245
diff changeset
  1772
    "Modified: 18.1.1997 / 18:09:41 / cg"
727
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1775
reAdjustGeometry
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1776
    "sent late during snapin processing, nothing done here"
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
    ^ self
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1781
recreate
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1782
    "recreate (i.e. tell X about me) after a snapin"
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
    viewBackground isColor ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1785
	viewBackground := viewBackground on:device
727
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
    super recreate.
1494
4faf11deec70 cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1788
    cursor := cursor onDevice:device.
1252
fccb14086649 exposePending is no longer used
Claus Gittinger <cg@exept.de>
parents: 1245
diff changeset
  1789
1494
4faf11deec70 cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1790
    "Modified: 28.3.1997 / 13:48:06 / cg"
727
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1793
reinitStyle
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1794
    "nothing done here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1795
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1796
    ^ self
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1799
shallowCopyForFinalization
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1800
    "redefined for faster creation of finalization copies
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1801
     (only device, gcId and drawableId are needed)"
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
    |aCopy|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1804
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1805
    aCopy := DeviceViewHandle basicNew.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1806
    aCopy setDevice:device id:drawableId gcId:gcId.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1807
    ^ aCopy
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1808
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1809
    "Created: 3.5.1996 / 15:35:13 / stefan"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1810
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1811
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1812
!DisplaySurface methodsFor:'keyboard commands'!
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
addActionForKey:aKey action:aBlock
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1815
    "define a keyboard command function"
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
    keyCommands isNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1818
	keyCommands := IdentityDictionary new
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1819
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1820
    keyCommands at:aKey put:aBlock
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1821
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1822
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1823
removeActionForKey:aKey
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1824
    keyCommands notNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1825
	keyCommands removeKey:aKey ifAbsent:[]
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1829
!DisplaySurface methodsFor:'queries'!
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
buttonMotionEventPending
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1832
    "return true, if a button motion event is pending.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1833
     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
  1834
     (not even for mouse-tracking).
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1835
     Dont use it, since it does not honor the windowGroup, but
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1836
     goes directly to the device instead.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1837
     Actually, its a historical leftover"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1838
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1839
    device flush.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1840
    ^ device eventPending:#buttonMotion for:drawableId
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1841
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1842
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1843
buttonReleaseEventPending
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1844
    "return true, if a button release event is pending.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1845
     Dont use it, since it does not honor the windowGroup, but
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1846
     goes directly to the device instead.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1847
     Actually, its a historical leftover"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1848
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1849
    device flush.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1850
    ^ device eventPending:#buttonRelease for:drawableId
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1851
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1852
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1853
exposeEventPending
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1854
    "return true, if an expose event is pending."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1855
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1856
    |sensor|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1857
2352
548f567b1454 fixed #exposeEventPending
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  1858
    ((sensor := self sensor) notNil and:[sensor hasExposeEventFor:self]) ifTrue:[^ true].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1859
    ^ device eventPending:#expose for:drawableId
2352
548f567b1454 fixed #exposeEventPending
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  1860
548f567b1454 fixed #exposeEventPending
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  1861
    "Modified: / 15.9.1998 / 23:18:16 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1862
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1863
2010
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  1864
isPopUpView
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  1865
    "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
  1866
     usually this is true for alertBoxes etc."
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  1867
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  1868
    ^ false
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  1869
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  1870
    "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
  1871
!
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  1872
920
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1873
isRootView
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1874
    "return true, if the receiver is a root view
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1875
     false is returned here, this is only redefined in DisplayRootView."
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1876
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1877
    ^ false
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1878
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1879
    "Modified: 28.5.1996 / 19:27:34 / cg"
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1880
    "Created: 5.7.1996 / 14:58:55 / cg"
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1881
!
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1882
1481
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1883
isTopView
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1884
    "return true, if the receiver is some kind of topview;
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1885
     false is returned here; redefined in some subclasses."
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1886
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1887
    ^ false
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1888
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1889
    "Modified: 28.5.1996 / 19:27:34 / cg"
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1890
    "Created: 22.3.1997 / 14:45:29 / cg"
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1891
!
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1892
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1893
isView
734
1a778cedbbf5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1894
    "return true, if the receiver is some kind of view;
1a778cedbbf5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1895
     true is returned here."
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1896
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1897
    ^ true
734
1a778cedbbf5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1898
1a778cedbbf5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  1899
    "Modified: 28.5.1996 / 19:27:34 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1900
!
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
isXtWidget
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1903
    ^ false
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1906
redrawsFull
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1907
    ^ false
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1908
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1909
    "Created: 4.3.1996 / 14:17:22 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1910
! !
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
!DisplaySurface methodsFor:'queries-contents'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1913
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1914
heightOfContents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1915
    "return the height of the contents in pixels.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1916
     Since we dont know here, just return the views size.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1917
     This will make your scrollbars show 100%-visible.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1918
     Must be redefined in subviews to make scrollbars really work."
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
    ^ self height
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1921
!
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
widthOfContents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1924
    "return the width of the contents in pixels.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1925
     Since we dont know here, just return the views size.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1926
     This will make your scrollbars show 100%-visible.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1927
     Must be redefined in subviews to make scrollbars really work."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1928
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1929
    ^ self width
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1930
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1931
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1932
xOriginOfContents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1933
    "return the x-origin of the contents in pixels.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1934
     Since we dont know here, just return 0 for left.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1935
     Must be redefined in subviews to make scrollbars really work."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1936
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1937
    ^ 0
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1940
yOriginOfContents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1941
    "return the y-origin of the contents in pixels.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1942
     Since we dont know here, just return 0 for top.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1943
     Must be redefined in subviews to make scrollbars really work."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1944
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1945
    ^ 0
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1946
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1947
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1948
!DisplaySurface methodsFor:'selection handling '!
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
getSelection
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1951
    "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
  1952
     clipBoard buffer."
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
    |sel|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1955
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1956
    sel := device getCopyBuffer.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1957
    sel isNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1958
	sel := device getSelectionFor:drawableId.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1959
	sel isNil ifTrue:[^ nil].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1960
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1961
    ^ sel
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1962
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  1963
    "Modified: 13.2.1997 / 13:18:50 / cg"
727
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1966
getTextSelection
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1967
    "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
  1968
     clipBoard buffer."
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1969
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1970
    |sel|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1971
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1972
    sel := device getCopyBuffer.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1973
    sel isNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1974
	sel := device getTextSelectionFor:drawableId.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1975
	sel isNil ifTrue:[^ nil].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1976
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1977
    ^ sel
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1978
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  1979
    "Modified: 13.2.1997 / 13:19:26 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1980
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1981
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  1982
pasteFromClipBoard:aString
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1983
    "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
  1984
     selection. The view should be prepared to paste the received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1985
     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
  1986
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  1987
    self paste:aString
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1988
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  1989
    "Created: 13.2.1997 / 13:06:11 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1990
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1991
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1992
setSelection:something
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1993
    "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
  1994
     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
  1995
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1996
    device setLastCopyBuffer:nil.
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  1997
    device setCopyBuffer:something.
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  1998
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1999
    (device setSelection:something owner:drawableId) ifFalse:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2000
	'DisplaySurface [warning]: could not copy selection to clipBoard' errorPrintCR
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2001
    ]
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  2002
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  2003
    "Modified: 13.2.1997 / 13:19:51 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2004
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2005
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2006
setTextSelection:something
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2007
    "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
  2008
     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
  2009
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2010
    |s|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2011
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  2012
    device setLastCopyBuffer:nil.
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  2013
    device setCopyBuffer:something.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2014
    s := something.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2015
    s isString ifFalse:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2016
	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
  2017
    ].
2196
f78bbe9789b0 always copy strings to the clipBoard.
Claus Gittinger <cg@exept.de>
parents: 2175
diff changeset
  2018
f78bbe9789b0 always copy strings to the clipBoard.
Claus Gittinger <cg@exept.de>
parents: 2175
diff changeset
  2019
    "/ 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
  2020
    s := s string.
f78bbe9789b0 always copy strings to the clipBoard.
Claus Gittinger <cg@exept.de>
parents: 2175
diff changeset
  2021
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2022
    (device setTextSelection:s owner:drawableId) ifFalse:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2023
	'DisplaySurface [warning]: could not copy selection to clipBoard' errorPrintCR.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2024
    ]
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  2025
2196
f78bbe9789b0 always copy strings to the clipBoard.
Claus Gittinger <cg@exept.de>
parents: 2175
diff changeset
  2026
    "Modified: / 16.7.1998 / 21:38:55 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2027
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2028
1093
18ea3ccf5d2f category rename
Claus Gittinger <cg@exept.de>
parents: 1074
diff changeset
  2029
!DisplaySurface methodsFor:'user notification'!
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2030
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2031
beep
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2032
    "output an audible beep or bell on my screen device"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2033
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2034
    device beep; flush
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2035
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2036
    "Created: 28.5.1996 / 16:16:13 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2037
    "Modified: 28.5.1996 / 16:58:25 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2038
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2039
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2040
showActivity:aMessage
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2041
    "this is sent indirectly by the activityNotification mechanism.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2042
     Defined here as a fallback, if ever sent to non topviews."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2043
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2044
    Transcript showCR:aMessage
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2045
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2046
    "Modified: 18.5.1996 / 15:44:33 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2047
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2048
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2049
!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
  2050
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2051
documentation
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2052
"
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2053
    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
  2054
    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
  2055
    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
  2056
    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
  2057
    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
  2058
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2059
    [see also:]
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2060
	DisplaySurface
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2061
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2062
    [author:]
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2063
	Claus Gittinger
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2064
"
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2065
! !
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2066
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2067
!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
  2068
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2069
disposed
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2070
    "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
  2071
     - release system resources"
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2072
2096
f3f0d358239f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2010
diff changeset
  2073
    |v id|
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2074
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2075
    drawableId notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2076
	(id := gcId) notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2077
	    gcId := nil.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2078
	    device destroyGC:id.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2079
	].
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2080
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2081
	"/ care for lost-view trouble:
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2082
	"/ if the windowID is still registered,
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2083
	"/ 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
  2084
	"/ 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
  2085
	"/ (X recycles window handles.)
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2086
	"/ 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
  2087
	"/ 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
  2088
	"/ 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
  2089
	"/ 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
  2090
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2091
	(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
  2092
"/ '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
  2093
"/ drawableId displayString infoPrintCR.
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2094
	    drawableId := nil.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2095
	] ifFalse:[
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2096
"/ '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
  2097
"/ device checkKnownViewId:drawableId.
2096
f3f0d358239f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2010
diff changeset
  2098
	    id := drawableId.
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2099
	    drawableId := nil.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2100
	    device destroyView:nil withId:id.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2101
	]
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2102
    ].
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2103
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2104
    "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
  2105
    "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
  2106
! !
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2107
1093
18ea3ccf5d2f category rename
Claus Gittinger <cg@exept.de>
parents: 1074
diff changeset
  2108
!DisplaySurface class methodsFor:'documentation'!
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2109
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2110
version
2421
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  2111
    ^ '$Header: /cvs/stx/stx/libview/DisplaySurface.st,v 1.50 1999-01-10 17:03:24 cg Exp $'
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2112
! !