DSurface.st
author Claus Gittinger <cg@exept.de>
Fri, 21 May 1999 20:09:35 +0200
changeset 2708 855835147902
parent 2660 c6a707b38caa
child 2720 c1ab612afb4a
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
2443
926ca386749e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2427
diff changeset
    15
		gotExpose backed saveUnder delegate updateRegion'
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:[
2637
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   123
        viewBackground isColor ifTrue:[
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   124
            viewBackground := viewBackground onDevice:device.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   125
            id := viewBackground colorId.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   126
            "
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   127
             a real color (i.e. one supported by the device) ?
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   128
            "
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   129
            id notNil ifTrue:[
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   130
                device setWindowBackground:id in:drawableId.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   131
                ^ self
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   132
            ].
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   133
            "
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   134
             no, a dithered one - must have a dither-pattern
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   135
             (which is ready for the device, since viewBackground
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   136
              is already assigned to the device)
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   137
            "
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   138
            bgPixmap := viewBackground ditherForm.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   139
        ] ifFalse:[
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   140
            "
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   141
             assume, it can convert itself to a form
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   142
            "
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   143
            bgPixmap := viewBackground asFormOn:device
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   144
        ].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
2658
0d33cf3ae07f dont set the devices viewBackgroundPixmap, if
Claus Gittinger <cg@exept.de>
parents: 2657
diff changeset
   146
        "
0d33cf3ae07f dont set the devices viewBackgroundPixmap, if
Claus Gittinger <cg@exept.de>
parents: 2657
diff changeset
   147
         must now have:
0d33cf3ae07f dont set the devices viewBackgroundPixmap, if
Claus Gittinger <cg@exept.de>
parents: 2657
diff changeset
   148
         a dithered color or bitmap or pixmap
0d33cf3ae07f dont set the devices viewBackgroundPixmap, if
Claus Gittinger <cg@exept.de>
parents: 2657
diff changeset
   149
        "
0d33cf3ae07f dont set the devices viewBackgroundPixmap, if
Claus Gittinger <cg@exept.de>
parents: 2657
diff changeset
   150
        bgPixmap isNil ifTrue:[
0d33cf3ae07f dont set the devices viewBackgroundPixmap, if
Claus Gittinger <cg@exept.de>
parents: 2657
diff changeset
   151
            'DisplaySurface [warning]: background not convertable - ignored' errorPrintCR.
0d33cf3ae07f dont set the devices viewBackgroundPixmap, if
Claus Gittinger <cg@exept.de>
parents: 2657
diff changeset
   152
            ^ self
0d33cf3ae07f dont set the devices viewBackgroundPixmap, if
Claus Gittinger <cg@exept.de>
parents: 2657
diff changeset
   153
        ].
0d33cf3ae07f dont set the devices viewBackgroundPixmap, if
Claus Gittinger <cg@exept.de>
parents: 2657
diff changeset
   154
2637
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   155
        "/ if the device does not support background pixmaps,
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   156
        "/ set the backgroundColor to the default background.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   157
        "/ this will avoid flicker in win32 systems,
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   158
        "/ since that background is drawn directly in the
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   159
        "/ devices expose event handling.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   160
        "/ (in contrast, the pixmap filling is done by the
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   161
        "/ window itself in its expose event handler)
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
2637
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   163
        (device supportsViewBackgroundPixmap:bgPixmap) ifFalse:[
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   164
            defBG := View defaultViewBackgroundColor.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   165
            defBG isColor ifTrue:[
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   166
                defBG := defBG onDevice:device.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   167
                id := defBG colorId.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   168
                id notNil ifTrue:[
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   169
                    device setWindowBackground:id in:drawableId.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   170
                ].
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   171
            ].
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   172
            ^ self
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   173
        ].
1236
ad9f2cefaa95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1216
diff changeset
   174
2637
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   175
        w := bgPixmap width.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   176
        h := bgPixmap height.
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   177
2637
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   178
        deviceDepth := device depth.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   179
        pixmapDepth := bgPixmap depth.
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   180
2637
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   181
        (pixmapDepth ~~ deviceDepth) ifTrue:[
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   182
            (pixmapDepth ~~ 1) ifTrue:[
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   183
                self error:'bad dither depth (must be one or devices depth)'.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   184
                ^ self
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   185
            ].
1236
ad9f2cefaa95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1216
diff changeset
   186
2637
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   187
            "
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   188
             convert it into a deep form
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   189
            "
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   190
            colorMap := bgPixmap colorMap.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   191
            devBgPixmap := Form width:w height:h depth:deviceDepth on:device.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   192
            devBgPixmap isNil ifTrue:[
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   193
                'DisplaySurface [warning]: could not create a device form for viewBackground' infoPrintCR.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   194
                ^ self
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   195
            ].
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   196
            devBgPixmap paint:(colorMap at:1).
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   197
            devBgPixmap fillRectangleX:0 y:0 width:w height:h.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   198
            devBgPixmap foreground:(colorMap at:2) background:(colorMap at:1).
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   199
            devBgPixmap copyPlaneFrom:bgPixmap x:0 y:0 toX:0 y:0 width:w height:h.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   200
            bgPixmap := devBgPixmap.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   201
        ] ifFalse:[
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   202
            (pixmapDepth == 1) ifTrue:[
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   203
                "
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   204
                 although depth matches,
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   205
                 values in the dither are to be interpreted via the ditherForms
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   206
                 colormap, which is not always the same as blackpixel/whitepixel ...
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   207
                "
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   208
                colorMap := bgPixmap colorMap.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   209
                (colorMap at:1) colorId == device whitepixel ifTrue:[
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   210
                    (colorMap at:2) colorId == device blackpixel ifTrue:[
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   211
                        "
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   212
                         ok, can use it
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   213
                        "
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   214
                        device setWindowBackgroundPixmap:(bgPixmap id) in:drawableId.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   215
                        ^ self
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   216
                    ]
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   217
                ].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
2637
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   219
                "
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   220
                 no, must invert it
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   221
                "
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   222
                devBgPixmap := Form width:w height:h depth:deviceDepth on:device.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   223
                devBgPixmap paint:(colorMap at:2) on:(colorMap at:1).
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   224
                devBgPixmap copyPlaneFrom:bgPixmap x:0 y:0 toX:0 y:0 width:w height:h.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   225
                bgPixmap := devBgPixmap.
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   226
            ]
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   227
        ].
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   228
        device setWindowBackgroundPixmap:(bgPixmap id) in:drawableId.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
    ]
1134
520b75563476 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   230
2637
0741956eb752 pass a concrete pixmap, when asking if device supports
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   231
    "Modified: / 4.5.1999 / 18:42:22 / cg"
727
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
viewBackground
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
    "return the viewBackground"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
    ^ viewBackground
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
viewBackground:something
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
    "set the viewBackground to something, a color, image or form.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
     The viewBackground is the color or pattern with which exposed
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
     regions are filled - do not confuse this with the drawing background
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
     color, which is used with opaque drawing."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
    viewBackground ~~ something ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
	viewBackground := something.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
	drawableId notNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
	    self setViewBackground
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
viewBackgroundAndClear:something
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
    "set the viewBackground to something, a color, image or form.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
     and clear the View.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
     The viewBackground is the color or pattern with which exposed
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
     regions are filled - do not confuse this with the drawing background
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
     color, which is used with opaque drawing."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
    self viewBackground:something.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
    self clear.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
    "Created: 27.4.1996 / 14:09:08 / cg"
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
viewGravity
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
    "return the views gravity"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
    ^ #NorthWest
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
viewOrigin
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
    "0@0 here, since by default we cannot be scrolled"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
    ^ 0 @ 0
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
widget
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
    "ST-80 compatibility"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
    ^ self
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
!DisplaySurface methodsFor:'accessing-cursor'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
cursor
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
    "return the views cursor"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
    ^ cursor
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
cursor:aCursor
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
    "set the views cursor. This cursor will be automatically displayed whenever 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
     the mouse-pointer enters the receiver. 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
     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
   297
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
    self cursor:aCursor now:true
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
    "
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
     |v|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
     v := View new.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
     v cursor:(Cursor wait).
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
     v open.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
     [v shown] whileFalse:[Processor yield].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
     [v shown] whileTrue:[   
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
	(Delay forSeconds:1) wait.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
	v cursor:(Cursor normal).
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
	(Delay forSeconds:1) wait.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
	v cursor:(Cursor wait).
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
    "Modified: 14.12.1995 / 21:28:14 / cg"
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
cursor:aCursor now:showImmediately
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
    "set the views cursor. This cursor will be automatically displayed whenever 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
     the mouse-pointer enters the receiver. 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
     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
   322
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
    aCursor notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   324
	(aCursor ~~ cursor) ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   325
	    cursor := aCursor.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   326
	    drawableId notNil ifTrue:[
1960
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   327
		self setCursor.
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   328
		(showImmediately and:[realized]) ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   329
		    "flush, to make cursor immediately visible"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   330
		    device flush
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
	    ]
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   333
	]
727
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
    "
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   337
     |v|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   338
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   339
     v := View new.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   340
     v cursor:(Cursor wait).
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   341
     v open.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   342
     [v shown] whileFalse:[Processor yield].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   343
     [v shown] whileTrue:[   
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   344
	(Delay forSeconds:1) wait.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   345
	v cursor:(Cursor normal).
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   346
	(Delay forSeconds:1) wait.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   347
	v cursor:(Cursor wait).
727
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   351
    "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
   352
    "Modified: 28.3.1997 / 13:47:58 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   353
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   354
1960
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   355
setCursor
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   356
    |id|
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   357
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   358
    drawableId notNil ifTrue:[
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   359
	cursor := cursor onDevice:device.
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   360
	cursor isNil ifTrue:[ ^ self].
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   361
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   362
	id := cursor id.
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   363
	id isNil ifTrue:[
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   364
	    'DisplaySurface [warning]: nil cursorId ignored; shape=' errorPrint. 
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   365
	    cursor shape errorPrintCR.
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   366
	    ^ self.
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   367
	].
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   368
	device setCursor:id in:drawableId.
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
!
aa9ef6e21f15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1907
diff changeset
   371
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   372
withCursor:aCursor do:aBlock
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   373
    "evaluate aBlock showing aCursor until ready; then restore the old cursor
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   374
     and return the value as returned by aBlock.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   375
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   376
     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
   377
     Most applications want to have the cursor changed in all of its views.
00e2cfdfd7bc commentary
Claus Gittinger <cg@exept.de>
parents: 1332
diff changeset
   378
     Use 'aView windowGroup withCursor:do:' or 'aView topView withCursor:do:'
00e2cfdfd7bc commentary
Claus Gittinger <cg@exept.de>
parents: 1332
diff changeset
   379
     to acomplish this."
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   380
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   381
    |savedCursor|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   382
1388
ba20e718d36f withCursor:do: - better behavior if change has no effect
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
   383
    cursor == aCursor ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   384
	^ aBlock value
1388
ba20e718d36f withCursor:do: - better behavior if change has no effect
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
   385
    ].
ba20e718d36f withCursor:do: - better behavior if change has no effect
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
   386
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   387
    savedCursor := cursor.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   388
    self cursor:aCursor.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   389
    ^ aBlock valueNowOrOnUnwindDo:[self cursor:savedCursor]
1337
00e2cfdfd7bc commentary
Claus Gittinger <cg@exept.de>
parents: 1332
diff changeset
   390
1388
ba20e718d36f withCursor:do: - better behavior if change has no effect
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
   391
    "Modified: 27.2.1997 / 17:20:43 / cg"
727
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   394
withExecuteCursorDo:aBlock
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   395
    "evaluate aBlock while showing an execute cursor in all my views.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   396
     Return the value as returned by aBlock."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   397
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   398
    ^ self withCursor:(Cursor execute) do:aBlock
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   399
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   400
    "Created: 10.1.1996 / 13:53:03 / cg"
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   403
withReadCursorDo:aBlock
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   404
    "evaluate aBlock while showing a readCursor in all my views.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   405
     Return the value as returned by aBlock."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   406
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   407
    ^ self withCursor:(Cursor read) do:aBlock
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   408
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   409
    "Modified: 14.12.1995 / 20:57:40 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   410
    "Created: 10.1.1996 / 13:52:52 / cg"
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   413
withWaitCursorDo:aBlock
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   414
    "evaluate aBlock while showing a waitCursor in all my views.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   415
     Return the value as returned by aBlock."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   416
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   417
    ^ self withCursor:(Cursor wait) do:aBlock
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   418
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   419
    "Created: 10.1.1996 / 13:51:08 / cg"
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   422
!DisplaySurface methodsFor:'accessing-hierarchy'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   423
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   424
delegate
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   425
    "return the delegate - thats the one getting keyboard and button events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   426
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   427
    ^ delegate
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   430
delegate:someOne
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   431
    "set the delegate - keyboard- and button events will be forwarded to
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   432
     that object if it is interested in them.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   433
     See the sendEvent... method in WindowEvent."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   434
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   435
    delegate := someOne
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   438
superView
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   439
    "return the superView - nil here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   440
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   441
    ^ nil
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   444
topComponent
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   445
    "return the topView - that the one with no superview"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   446
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   447
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   448
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   449
    "Created: 9.5.1996 / 01:39:43 / cg"
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   452
topView
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   453
    "return the topView - that the one with no superview"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   454
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   455
    ^ self
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   458
!DisplaySurface methodsFor:'accessing-limits'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   459
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   460
maxExtent
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   461
    "return the views maximum extent - this is nil here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   462
     Only standardSystemViews support this."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   463
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   464
    ^ nil
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   467
maxExtent:extent
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   468
    "set the views maximum extent - ignored here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   469
     Only standardSystemViews support this."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   470
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   471
    ^ self
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   474
minExtent
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   475
    "return the views minimum extent - this is nil here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   476
     Only standardSystemViews support this."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   477
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   478
    ^ nil
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   481
minExtent:extent
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   482
    "set the views minimum extent - ignored here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   483
     Only standardSystemViews support this."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   484
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   485
    ^ self
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   488
!DisplaySurface methodsFor:'accessing-misc'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   489
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   490
backingStore:how
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   491
    "turn on/off backingStore (saving my pixels)
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   492
     how may true/false, but also #always, #whenMapped or #never."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   493
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   494
    how ~~ backed ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   495
	backed := how.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   496
	drawableId notNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   497
	    device setBackingStore:how in:drawableId
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   502
eventMask
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   503
    "return a (numeric) mask of allowed events -
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   504
     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
   505
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   506
    ^ eventMask
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   509
eventMask:aMask
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   510
    "set a (numeric) mask of allowed events -
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   511
     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
   512
     
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   513
    eventMask := aMask
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   516
getKeyboardFocus
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   517
    "tell the Display to assign keyboard focus to the receiver"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   518
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   519
    drawableId notNil ifTrue:[
2509
eacc9e287ecf change for new focus handling
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   520
        self shown ifTrue:[
2512
f7c7f082e65b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   521
"/            self requestFocus.
2509
eacc9e287ecf change for new focus handling
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   522
            device setInputFocusTo:drawableId.
eacc9e287ecf change for new focus handling
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   523
        ]
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   524
    ].
2512
f7c7f082e65b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   525
f7c7f082e65b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   526
    "Modified: / 15.3.1999 / 08:25:10 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   527
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   528
781
6a02db3a260a renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents: 734
diff changeset
   529
isInputOnly
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   530
    "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
   531
     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
   532
     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
   533
     others, which where never meant to work in such a setup.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   534
     (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
   535
     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
   536
     or on other plattforms."
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
    ^ false
781
6a02db3a260a renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents: 734
diff changeset
   539
6a02db3a260a renamed #inputOnly to #isInputOnly
Claus Gittinger <cg@exept.de>
parents: 734
diff changeset
   540
    "Created: 1.6.1996 / 13:21:51 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   541
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   542
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   543
preferredDepth
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   544
    "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
   545
     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
   546
     This is experimental and may change/vanish - do not use it."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   547
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   548
    ^ nil
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   549
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   550
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   551
preferredVisual
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   552
    "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
   553
     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
   554
     This is experimental and may change/vanish - do not use it."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   555
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   556
    ^ nil
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   557
!
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
    "turn on/off saveUnder (saving pixels under myself)
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   561
     - used for temporary views (i.e. PopUps and ModalBoxes)"
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
    saveUnder := aBoolean.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   564
    drawableId notNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   565
	device setSaveUnder:aBoolean in:drawableId
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
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   568
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   569
!DisplaySurface methodsFor:'accessing-names'!
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
icon
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   572
    "return the views icon - this is nil here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   573
     Only standardSystemViews support labels and icons."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   574
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   575
    ^ nil
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   576
!
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
icon:aBitmap
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   579
    "set the views icon - ignored here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   580
     Only standardSystemViews support labels and icons."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   581
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   582
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   583
!
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
iconLabel
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   586
    "return the views icon label - this is nil here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   587
     Only standardSystemViews support labels and icons."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   588
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   589
    ^ nil
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   590
!
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
iconLabel:aLabel
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   593
    "set the views icon label - ignored here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   594
     Only standardSystemViews support labels and icons."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   595
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   596
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   597
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   598
1481
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
   599
iconMask
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
   600
    "return the views iconMask - this is nil here.
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
   601
     Only standardSystemViews may support labels and icons."
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
   602
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
   603
    ^ nil
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
   604
!
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
   605
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   606
iconView
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   607
    "return the views iconView - this is nil here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   608
     Only standardSystemViews support labels and icons."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   609
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   610
    ^ nil
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   611
!
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
iconView:aView
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   614
    "set the views icon view - ignored here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   615
     Only standardSystemViews support labels and icons."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   616
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   617
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   618
!
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
label
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   621
    "return the views label - this is nil here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   622
     Only standardSystemViews support labels and icons."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   623
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   624
    ^ nil
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   625
!
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
label:aLabel
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   628
    "set the views label - ignored here.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   629
     Only standardSystemViews support labels and icons."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   630
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   631
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   632
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   633
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   634
!DisplaySurface methodsFor:'binary storage'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   635
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   636
readBinaryContentsFrom: stream manager: manager
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   637
    "tell the newly restored View to recreate itself.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   638
     Bug: does not work correctly yet.
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   639
	  (restored view looses its position & wg process)"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   640
1216
c01819586102 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
   641
    |wasRealized|
c01819586102 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
   642
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   643
    super readBinaryContentsFrom: stream manager: manager.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   644
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   645
    gcId := nil.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   646
    drawableId := nil.
1216
c01819586102 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
   647
    wasRealized := realized.
c01819586102 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
   648
    realized := false.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   649
    self recreate.
1216
c01819586102 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
   650
    wasRealized ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   651
	self remap
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   652
    ]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   653
1216
c01819586102 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
   654
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   655
    "
1216
c01819586102 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
   656
     |s l|
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   657
     s := 'storedLabel.boss' asFilename writeStream binary.
1216
c01819586102 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
   658
     l := (Label label:'hello there') realize.
c01819586102 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
   659
     Delay waitForSeconds:1.
c01819586102 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
   660
     l storeBinaryOn:s.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   661
     s close.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   662
    "
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   663
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   664
    "
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   665
     |s l|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   666
     s := 'storedLabel.boss' asFilename writeStream binary.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   667
     (l := Label label:'hello there') open.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   668
     (Delay forSeconds:10) wait.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   669
     l storeBinaryOn:s.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   670
     s close.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   671
     l destroy.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   672
    "
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   673
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
     |s|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   676
     s := 'storedLabel.boss' asFilename readStream binary.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   677
     (Object readBinaryFrom:s)
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
    "Modified: 3.5.1996 / 23:59:38 / stefan"
1216
c01819586102 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1177
diff changeset
   681
    "Modified: 14.2.1997 / 15:42:55 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   682
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   683
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   684
!DisplaySurface methodsFor:'button menus'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   685
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   686
middleButtonMenu
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   687
    "return the menu associated with the middle mouse button"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   688
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   689
    ^ middleButtonMenu
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   692
middleButtonMenu:aMenu
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   693
    "associate aMenu with the middle mouse button"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   694
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   695
    middleButtonMenu notNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   696
	middleButtonMenu destroy
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   697
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   698
    middleButtonMenu := aMenu
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   699
!
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
setMiddleButtonMenu:aMenu
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   702
    "associate aMenu with the middle mouse button.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   703
     Do not destroy old menu if any"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   704
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   705
    middleButtonMenu := aMenu
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   706
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   707
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   708
!DisplaySurface methodsFor:'drawing'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   709
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   710
clearDeviceRectangleX:x y:y width:w height:h
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   711
    "clear a rectangular area to viewBackground -
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   712
     redefined since GraphicsMedium fills with background
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   713
     - not viewBackground as we want here."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   714
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   715
    |oldPaint org|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   716
2341
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   717
    viewBackground isColor ifFalse:[
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   718
        gcId notNil ifTrue:[
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   719
            org := self viewOrigin.
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   720
            device setMaskOriginX:org x rounded negated
2632
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2525
diff changeset
   721
                                 y:org y rounded negated
2341
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   722
                               in:gcId
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   723
        ].
2632
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2525
diff changeset
   724
        (device supportsMaskedDrawingWith:viewBackground) ifFalse:[
2654
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   725
            self fillDeviceRectangleWithViewBackgroundX:x y:y width:w height:h.
2356
4efd761cc439 change mask origin first, then do manual fill if
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   726
            ^ self.
4efd761cc439 change mask origin first, then do manual fill if
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   727
        ]
727
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
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   730
    "
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   731
     fill in device coordinates - not logical coordinates
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   732
    "
2341
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   733
    oldPaint := paint.
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   734
    self paint:viewBackground.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   735
    self fillDeviceRectangleX:x y:y width:w height:h "with:viewBackground".
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   736
    self paint:oldPaint
2341
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   737
2632
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2525
diff changeset
   738
    "Modified: / 4.5.1999 / 13:00:34 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   739
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   740
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   741
clearRectangleX:x y:y width:w height:h
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   742
    "clear a rectangular area to viewBackground -
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   743
     redefined since GraphicsMedium fills with background
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   744
     - not viewBackground as we want here."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   745
2341
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   746
    |pX pY pW pH|
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   747
2341
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   748
    transformation notNil ifTrue:[
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   749
        pX := transformation applyToX:x.
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   750
        pY := transformation applyToY:y.
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   751
        pW := transformation applyScaleX:w.
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   752
        pH := transformation applyScaleY:h.
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   753
    ] ifFalse:[
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   754
        pX := x.
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   755
        pY := y.
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   756
        pW := w.
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   757
        pH := h.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   758
    ].
2341
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   759
2393
247e70febb7d oops - clearDeviceRectangle may not be invoked with floats.
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   760
    pX := pX rounded.
247e70febb7d oops - clearDeviceRectangle may not be invoked with floats.
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   761
    pY := pY rounded.
247e70febb7d oops - clearDeviceRectangle may not be invoked with floats.
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   762
    pW := pW rounded.
247e70febb7d oops - clearDeviceRectangle may not be invoked with floats.
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   763
    pH := pH rounded.
247e70febb7d oops - clearDeviceRectangle may not be invoked with floats.
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   764
2341
a7dc2588d6dc clearRectangle with pattern (viewBackgroundPixmap) for win95
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   765
    ^ 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
   766
2393
247e70febb7d oops - clearDeviceRectangle may not be invoked with floats.
Claus Gittinger <cg@exept.de>
parents: 2356
diff changeset
   767
    "Modified: / 30.10.1998 / 15:00:37 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   768
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   769
2660
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   770
fillDeviceRectangleWithPattern:aPixmap x:xIn y:yIn width:wIn height:hIn patternOffset:pattOffs
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   771
    "fill a rectangular area with some pattern.
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   772
     A helper for devices which do not support pixmap drawing
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   773
     (i.e. win95).
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   774
     This is never invoked with X11 or Win-NT systems.
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   775
     Caller must ensure that aPixmap is really a form"
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   776
2656
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   777
    |r b 
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   778
     pW "{ Class: SmallInteger }"
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   779
     pH "{ Class: SmallInteger }"
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   780
     xR0 
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   781
     xR "{ Class: SmallInteger }"
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   782
     yR "{ Class: SmallInteger }"
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   783
     xE "{ Class: SmallInteger }"
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   784
     yE "{ Class: SmallInteger }"
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   785
     oldFg oldBg oldClip x y w h fg bg clrMap
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   786
     offsX "{ Class: SmallInteger }"
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   787
     offsY "{ Class: SmallInteger }"
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   788
     oX "{ Class: SmallInteger }"
2660
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   789
     oY "{ Class: SmallInteger }"|
2398
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   790
2640
033824608132 oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
   791
    x := xIn.
033824608132 oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
   792
    y := yIn.
033824608132 oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
   793
    w := wIn.
033824608132 oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
   794
    h := hIn.
033824608132 oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
   795
033824608132 oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
   796
    x := x max:0.
033824608132 oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
   797
    y := y max:0.
2654
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   798
    r := (xIn + w - 1) min:(width - 1).
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   799
    b := (yIn + h - 1) min:(height - 1).
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   800
2660
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   801
    pW := aPixmap width.
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   802
    pH := aPixmap height.
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   803
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   804
    oldClip := self clippingRectangleOrNil.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   805
2398
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   806
    oldClip notNil ifTrue:[
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   807
        x := x max:oldClip left.
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   808
        y := y max:oldClip top.
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   809
        r := r min:oldClip right.
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   810
        b := b min:oldClip bottom.
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   811
    ].
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   812
    w := r-x+1.
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   813
    h := b-y+1.
bc2e3e470efe fixed background filling in case of huge rectangle argument.
Claus Gittinger <cg@exept.de>
parents: 2393
diff changeset
   814
2656
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   815
    yR := (y // pH) * pH.
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   816
    yE := y+h.
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   817
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   818
    yR >= yE ifTrue:[^ self].
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   819
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   820
    xR0 := (x // pW) * pW.
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   821
    xE := x+w.
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   822
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   823
    xR0 >= yE ifTrue:[^ self].
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   824
2660
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   825
    aPixmap depth == 1 ifTrue:[
2656
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   826
        oldFg := foreground.
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   827
        oldBg := background.
2660
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   828
        (clrMap := aPixmap colorMap) notNil ifTrue:[
2632
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2525
diff changeset
   829
            bg := clrMap at:1.
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2525
diff changeset
   830
            fg := clrMap at:2.
2342
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   831
        ] ifFalse:[
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   832
            bg := Color white.
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   833
            fg := Color black.
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   834
        ].
2632
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2525
diff changeset
   835
        self foreground:fg background:bg.
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   836
    ].
2342
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   837
    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
   838
2660
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   839
    offsX := xR0 + pattOffs x \\ pW.
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   840
    offsY := yR + pattOffs y \\ pH.
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   841
2656
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   842
    oY := offsY.
2632
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2525
diff changeset
   843
    [yR < yE] whileTrue:[
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2525
diff changeset
   844
        xR := xR0.
2656
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   845
        oX := offsX.
2632
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2525
diff changeset
   846
        [xR < xE] whileTrue:[
2342
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   847
            self
2660
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   848
                copyFrom:aPixmap 
2656
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   849
                x:oX y:oY 
2342
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   850
                toX:xR y:yR 
2656
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   851
                width:(pW - oX) height:(pH - oY) 
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   852
                async:true.
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   853
            xR := xR + pW - oX.
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   854
            oX := 0.
2342
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   855
        ].
2656
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   856
        yR := yR + pH - oY.
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   857
        oY := 0.
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   858
    ].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   859
2656
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   860
    oldFg notNil ifTrue:[
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   861
        self foreground:oldFg background:oldBg.
c21d19544e16 care for pixel-offset within mask.
Claus Gittinger <cg@exept.de>
parents: 2654
diff changeset
   862
    ].
2342
48d850a7844c care for clip when doing manual fills (win95)
Claus Gittinger <cg@exept.de>
parents: 2341
diff changeset
   863
    self deviceClippingRectangle:oldClip.
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   864
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   865
    "Created: / 6.9.1998 / 14:00:50 / cg"
2640
033824608132 oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
   866
    "Modified: / 4.5.1999 / 20:38:07 / ps"
033824608132 oops - care for viewOrigin when manually drawing viewBackground
Claus Gittinger <cg@exept.de>
parents: 2637
diff changeset
   867
    "Modified: / 4.5.1999 / 20:40:12 / cg"
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   868
!
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
   869
2660
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   870
fillDeviceRectangleWithViewBackgroundX:xIn y:yIn width:wIn height:hIn
2654
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   871
    "fill a rectangular area with the viewBackground.
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   872
     A helper for devices which do not support background pixmaps
2660
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   873
     (i.e. win95 screens).
2654
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   874
     This is never invoked with X or Win-NT systems.
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   875
     Caller must ensure that the viewBackground is really a form"
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   876
2660
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   877
    self
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   878
        fillDeviceRectangleWithPattern:viewBackground
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   879
        x:xIn y:yIn width:wIn height:hIn 
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   880
        patternOffset:self viewOrigin
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   881
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   882
!
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   883
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   884
fillRectangleWithPattern:aPixmap x:x y:y width:w height:h patternOffset:pattOffs
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   885
    "fill a rectangular area with aPixmap.
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   886
     A helper for devices which do not support pixmap filling
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   887
     (i.e. win95 screens). 
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   888
     This is never invoked with X11 or Win-NT systems.
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   889
     Caller must ensure that the aPixmap is really a form"
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   890
2654
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   891
    |pX pY nW nH|
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   892
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   893
    gcId isNil ifTrue:[
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   894
        self initGC
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   895
    ].
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   896
    transformation notNil ifTrue:[
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   897
        pX := transformation applyToX:x.
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   898
        pY := transformation applyToY:y.
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   899
        nW := transformation applyScaleX:w.
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   900
        nH := transformation applyScaleY:h.
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   901
        nW < 0 ifTrue:[
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   902
              nW := nW abs.  
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   903
              pX := pX - nW.
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   904
        ].
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   905
        nH < 0 ifTrue:[
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   906
              nH := nH abs.  
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   907
              pY := pY - nH.
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   908
        ].
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   909
    ] ifFalse:[
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   910
        pX := x.
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   911
        pY := y.
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   912
        nW := w.
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   913
        nH := h.
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   914
    ].
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   915
    pX := pX rounded.
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   916
    pY := pY rounded.
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   917
    nW := nW rounded.
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   918
    nH := nH rounded.
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   919
2660
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   920
    self 
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   921
        fillDeviceRectangleWithPattern:aPixmap
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   922
        x:pX y:pY width:nW height:nH
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   923
        patternOffset:pattOffs
2654
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   924
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   925
    "Modified: 4.6.1996 / 17:58:49 / cg"
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   926
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   927
!
f919ca08f450 fixed viewBackground filling for w95.
Claus Gittinger <cg@exept.de>
parents: 2640
diff changeset
   928
2660
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   929
fillRectangleWithViewBackgroundX:x y:y width:w height:h
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   930
    "fill a rectangular area with the viewBackground.
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   931
     A helper for devices which do not support background pixmaps
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   932
     (i.e. win95 screens). 
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   933
     This is never invoked with X or Win-NT systems.
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   934
     Caller must ensure that the viewBackground is really a form"
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   935
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   936
    self
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   937
        fillRectangleWithPattern:viewBackground
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   938
        x:x y:y width:w height:h 
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   939
        patternOffset:self viewOrigin
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   940
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   941
!
c6a707b38caa generalized pattern filling (for w95)
Claus Gittinger <cg@exept.de>
parents: 2658
diff changeset
   942
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   943
redraw
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   944
    "nothing done here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   945
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   946
    ^ self
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   949
!DisplaySurface methodsFor:'enable/disable events'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   950
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   951
compressMotionEvents:aBoolean
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   952
    "enable/disable motion event compression
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   953
     (i.e. replacing all motion events by the last one).
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   954
     Compression makes almost always sense, except when
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   955
     doing things like freehand drawing"
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
    |s|
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
    (s := self sensor) notNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   960
	s compressMotionEvents:aBoolean
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
!
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
disableButtonEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   965
    "disable all button events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   966
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   967
    self disableEvent:#buttonPress; disableEvent:#buttonRelease
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   968
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   969
    "Modified: 29.4.1996 / 11:09:25 / cg"
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
disableButtonMotionEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   973
    "disable button motion-while-button-is-pressed events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   974
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   975
    self disableEvent:#buttonMotion
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
disableButtonPressEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   979
    "disable button press events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   980
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   981
    self disableEvent:#buttonPress
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   982
!
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
disableButtonReleaseEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   985
    "disable button release events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   986
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   987
    self disableEvent:#buttonRelease
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   988
!
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
disableEnterLeaveEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   991
    "disable both mouse-pointer enter and leave events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   992
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   993
    self disableEvent:#enter; disableEvent:#leave
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   994
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   995
    "Modified: 29.4.1996 / 11:09:37 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   996
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   997
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   998
disableEvent:anEventSymbol
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   999
    "disable an event -
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1000
     this is a private (internal) method not to be used externally.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1001
     for a list of allowed event symbols see Workstation class"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1002
     
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1003
    eventMask := eventMask bitAnd:(device eventMaskFor:anEventSymbol) bitInvert.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1004
    drawableId notNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1005
	device setEventMask:eventMask in:drawableId
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1006
    ]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1007
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1008
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1009
disableMotionEvents
1332
624bcfb69025 commentary
ca
parents: 1317
diff changeset
  1010
    "disable mouse-pointer motion events"
624bcfb69025 commentary
ca
parents: 1317
diff changeset
  1011
    
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1012
    self disableEvent:#pointerMotion
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1013
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1014
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1015
enableButtonEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1016
    "enable both mouse button press and release events.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1017
     These are enabled by default anyway."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1018
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1019
    self enableEvent:#buttonPress; enableEvent:#buttonRelease
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1020
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1021
    "Modified: 29.4.1996 / 11:09:46 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1022
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1023
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1024
enableButtonMotionEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1025
    "enable mouse-pointer motion-while-button-is-pressed events.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1026
     These are enabled by default anyway."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1027
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1028
    self enableEvent:#buttonMotion
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1029
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1030
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1031
enableButtonPressEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1032
    "enable mouse button press events.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1033
     These are enabled by default anyway."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1034
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1035
    self enableEvent:#buttonPress
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1036
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1037
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1038
enableButtonReleaseEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1039
    "enable mouse button release events.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1040
     These are enabled by default anyway."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1041
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1042
    self enableEvent:#buttonRelease
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1043
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1044
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1045
enableEnterEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1046
    "enable mouse-pointer enter events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1047
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1048
    self enableEvent:#enter
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1049
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1050
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1051
enableEnterLeaveEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1052
    "enable both mouse-pointer enter and leave events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1053
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1054
    self enableEvent:#enter; enableEvent:#leave
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1055
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1056
    "Modified: 29.4.1996 / 11:09:55 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1057
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1058
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1059
enableEvent:anEventSymbol
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1060
    "enable an event -
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1061
     this is a private (internal) method not to be used externally.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1062
     for a list of allowed event symbols see Workstation class"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1063
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1064
    eventMask := eventMask bitOr:(device eventMaskFor:anEventSymbol).
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1065
    drawableId notNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1066
	device setEventMask:eventMask in:drawableId
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1067
    ]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1068
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1069
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1070
enableFocusEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1071
    "enable keyboard focus change events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1072
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1073
    self enableEvent:#focusChange
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1074
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1075
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1076
enableKeyEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1077
    "this is a compatibility leftover - 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1078
     starting with 2.10.3, keyPress is always enabled to allow 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1079
     ^C processing."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1080
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1081
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1082
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1083
enableKeyPressEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1084
    "this is a compatibility leftover - 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1085
     starting with 2.10.3, keyPress is always enabled to allow 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1086
     ^C processing."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1087
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1088
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1089
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1090
enableKeyReleaseEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1091
    "enable key release events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1092
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1093
    self enableEvent:#keyRelease
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1094
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1095
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1096
enableLeaveEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1097
    "enable mouse-pointer leave events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1098
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1099
    self enableEvent:#leave
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1100
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1101
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1102
enableMotionEvents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1103
    "enable mouse-pointer motion events"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1104
    
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1105
    self enableEvent:#pointerMotion
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1106
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1107
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1108
!DisplaySurface methodsFor:'event dispatching'!
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
dispatchEvent:event
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1111
    "dispatch the event"
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1112
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1113
    self 
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1114
	dispatchEvent:event type
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1115
	arguments:(event arguments)
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1116
	withFocusOn:nil
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1117
	delegate:true
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1118
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1119
    "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
  1120
!
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1121
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1122
dispatchEvent:type arguments:arguments
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1123
    ^ self 
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1124
	dispatchEvent:type 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1125
	arguments:arguments 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1126
	withFocusOn:nil 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1127
	delegate:true
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1128
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1129
    "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
  1130
!
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1131
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1132
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
  1133
    "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
  1134
     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
  1135
     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
  1136
     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
  1137
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1138
     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
  1139
     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
  1140
     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
  1141
     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
  1142
     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
  1143
     before.
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1144
     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
  1145
     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
  1146
     forwarding."
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1147
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1148
    |delegate selector delegateMessage delegateQuery 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1149
     eventReceiver controller deviceMessage
2129
530cc6e1b3b9 oops - uninitialized var used
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
  1150
     isKeyEvent isButtonEvent isPointerEvent 
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1151
     rect x y w h|
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1152
2498
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1153
    type == #damage ifTrue:[
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1154
        self shown ifTrue:[
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1155
            rect := argArray.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1156
            x := rect left.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1157
            y := rect top.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1158
            w := rect width.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1159
            h := rect height.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1160
            transformation notNil ifTrue:[
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1161
                self deviceExposeX:x y:y width:w height:h
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1162
            ] ifFalse:[
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1163
                self exposeX:x y:y width:w height:h
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1164
            ]
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1165
        ].
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1166
        ^ self
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1167
    ].
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1168
2498
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1169
    isKeyEvent := isButtonEvent := isPointerEvent := false.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1170
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1171
    (type == #'keyPress:x:y:') ifTrue:[
2498
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1172
        isKeyEvent := true.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1173
        deviceMessage := #'deviceKeyPress:x:y:'.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1174
        delegateMessage := #'keyPress:x:y:view:'.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1175
        delegateQuery := #'handlesKeyPress:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1176
    ] ifFalse:[ (type == #'keyRelease:x:y:') ifTrue:[
2498
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1177
        isKeyEvent := true.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1178
        deviceMessage := #'deviceKeyRelease:x:y:'.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1179
        delegateMessage := #'keyRelease:x:y:view:'.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1180
        delegateQuery := #'handlesKeyRelease:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1181
    ] ifFalse:[ (type == #'buttonMotion:x:y:') ifTrue:[
2498
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1182
        isButtonEvent := true.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1183
        deviceMessage := #'deviceButtonMotion:x:y:'.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1184
        delegateMessage := #'buttonMotion:x:y:view:'.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1185
        delegateQuery := #'handlesButtonMotion:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1186
    ] ifFalse:[ (type == #'buttonPress:x:y:') ifTrue:[
2498
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1187
        isButtonEvent := true.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1188
        deviceMessage := #'deviceButtonPress:x:y:'.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1189
        delegateMessage := #'buttonPress:x:y:view:'.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1190
        delegateQuery := #'handlesButtonPress:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1191
    ] ifFalse:[ (type == #'buttonRelease:x:y:') ifTrue:[
2498
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1192
        isButtonEvent := true.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1193
        deviceMessage := #'deviceButtonRelease:x:y:'.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1194
        delegateMessage := #'buttonRelease:x:y:view:'.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1195
        delegateQuery := #'handlesButtonRelease:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1196
    ] ifFalse:[ (type == #'buttonShiftPress:x:y:') ifTrue:[
2498
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1197
        isButtonEvent := true.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1198
        deviceMessage := #'deviceButtonShiftPress:x:y:'.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1199
        delegateMessage := #'buttonShiftPress:x:y:view:'.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1200
        delegateQuery := #'handlesButtonShiftPress:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1201
    ] ifFalse:[ (type == #'buttonMultiPress:x:y:') ifTrue:[
2498
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1202
        isButtonEvent := true.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1203
        deviceMessage := #'deviceButtonMultiPress:x:y:'.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1204
        delegateMessage := #'buttonMultiPress:x:y:view:'.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1205
        delegateQuery := #'handlesButtonMultiPress:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1206
    ] ifFalse:[ (type == #'pointerEnter:x:y:') ifTrue:[
2498
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1207
        isPointerEvent := true.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1208
        deviceMessage := #'devicePointerEnter:x:y:'.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1209
        delegateMessage := #'pointerEnter:x:y:view:'.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1210
        delegateQuery := #'handlesPointerEnter:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1211
    ] ifFalse:[ (type == #'pointerLeave:') ifTrue:[
2498
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1212
        isPointerEvent := true.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1213
        deviceMessage := type.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1214
        delegateMessage := #'pointerLeave:view:'.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1215
        delegateQuery := #'handlesPointerLeave:inView:'.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1216
    ] ifFalse:[ (type == #'exposeX:y:width:height:') ifTrue:[
2498
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1217
        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
  1218
    ] ifFalse:[ (type == #'graphicsExposeX:y:width:height:final:') ifTrue:[
2498
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1219
        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
  1220
    ]]]]]]]]]]].
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1221
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1222
    "
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1223
     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
  1224
     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
  1225
     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
  1226
     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
  1227
    "
2708
855835147902 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
  1228
    (focusView notNil and:[self ~~ focusView]) ifTrue:[
855835147902 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
  1229
        isKeyEvent ifTrue:[
855835147902 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
  1230
            focusView 
855835147902 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
  1231
                dispatchEvent:type 
855835147902 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
  1232
                arguments:(Array with:(argArray at:1) with:-1 with:-1)
855835147902 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
  1233
                withFocusOn:nil
855835147902 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
  1234
                delegate:doDelegate.
855835147902 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
  1235
            ^ self
855835147902 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
  1236
        ].
855835147902 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
  1237
        type == #mouseWheelMotion:state: ifTrue:[
855835147902 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
  1238
            focusView 
855835147902 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
  1239
                dispatchEvent:type 
855835147902 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
  1240
                arguments:argArray
855835147902 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
  1241
                withFocusOn:nil
855835147902 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
  1242
                delegate:doDelegate.
855835147902 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
  1243
            ^ self
855835147902 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
  1244
        ]
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1245
    ].
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1246
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1247
    doDelegate ifTrue:[
2498
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1248
        "
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1249
         handle delegated messages
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1250
        "
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1251
        (isKeyEvent 
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1252
         or:[isButtonEvent 
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1253
         or:[isPointerEvent]]) ifTrue:[
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1254
            delegate := self delegate.
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1255
2498
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1256
            "
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1257
             what a kludge - sending to delegate requires
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1258
             another selector and an additional argument ...
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1259
            "
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1260
            (delegate notNil
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1261
            and:[delegate respondsTo:delegateMessage]) ifTrue:[
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1262
                "
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1263
                 is the delegate interested in that event ?
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1264
                 (if it does not respond to the handlesXXX message,
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1265
                  we assume: NO)
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1266
                "
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1267
                ((delegate respondsTo:delegateQuery) 
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1268
                and:[delegate perform:delegateQuery with:(argArray at:1) with:self]) ifTrue:[
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1269
                    "
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1270
                     mhmh ... have to convert to logical coordinates
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1271
                    "        
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1272
                    transformation notNil ifTrue:[
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1273
                        argArray size > 2 ifTrue:[
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1274
                            argArray at:2 put:(transformation applyInverseToX:(argArray at:2)).
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1275
                            argArray at:3 put:(transformation applyInverseToY:(argArray at:3)).
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1276
                        ].
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1277
                    ].
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1278
                    argArray isNil ifTrue:[
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1279
                        delegate perform:delegateMessage with:self
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1280
                    ] ifFalse:[
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1281
                        delegate perform:delegateMessage withArguments:(argArray copyWith:self)
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1282
                    ].
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1283
                    ^ self
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1284
                ]
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1285
            ].
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1286
        ].
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1287
    ].
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1288
2708
855835147902 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
  1289
    "
855835147902 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
  1290
     if I am not shown, ignore input events
855835147902 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
  1291
    "
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1292
    (isKeyEvent 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1293
     or:[isButtonEvent 
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1294
     or:[isPointerEvent]]) ifTrue:[
2498
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1295
        realized ifFalse:[
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1296
            ^ self
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1297
        ]
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1298
    ].
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1299
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1300
    "
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1301
     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
  1302
    "
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1303
    eventReceiver := self.
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1304
    (controller := self controller) notNil ifTrue:[  
2498
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1305
        (isKeyEvent 
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1306
         or:[isButtonEvent 
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1307
         or:[isPointerEvent
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1308
         or:[(type == #focusIn)
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1309
         or:[(type == #focusOut)]]]]) ifTrue:[
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1310
            eventReceiver := controller.
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1311
        ]
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1312
    ].
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1313
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1314
    "
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1315
     finally, another one:
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1316
     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
  1317
     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
  1318
     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
  1319
     in DisplaySurface translates and resends).
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1320
     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
  1321
     (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
  1322
     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
  1323
    "
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1324
    selector := type.
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1325
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1326
    transformation notNil ifTrue:[
2498
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1327
        (isKeyEvent
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1328
         or:[isButtonEvent
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1329
         or:[isPointerEvent
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1330
         or:[(type == #'exposeX:y:width:height:')
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1331
         or:[(type == #'graphicsExposeX:y:width:height:final:')]]]]) ifTrue:[
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1332
            selector := deviceMessage
4b5e7a08917d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2453
diff changeset
  1333
        ]        
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1334
    ].
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1335
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1336
    eventReceiver perform:selector withArguments:argArray
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1337
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1338
    "Created: / 20.5.1998 / 22:46:25 / cg"
2708
855835147902 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
  1339
    "Modified: / 21.5.1999 / 19:55:31 / cg"
2126
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1340
! !
1f108c76dfdb moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents: 2096
diff changeset
  1341
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1342
!DisplaySurface methodsFor:'event handling'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1343
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1344
activateMenu
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1345
    "if there is a menu, show it."
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
    middleButtonMenu notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1348
	middleButtonMenu showAtPointer
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1349
    ]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1350
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1351
    "Created: 1.3.1996 / 13:24:55 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1352
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1353
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1354
buttonMotion:state x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1355
    "mouse was moved while button is pressed - do nothing here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1356
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1357
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1358
!
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
buttonMultiPress:button x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1361
    "button was pressed fast after previous press - default to press-again"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1362
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1363
    ^ self buttonPress:button x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1364
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1365
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1366
buttonPress:button x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1367
    "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
  1368
     show it."
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
    ((button == 2) or:[button == #menu]) ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1371
	self activateMenu.
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
    "Modified: 1.3.1996 / 13:25:07 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1375
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1376
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1377
buttonRelease:button x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1378
    "button was released - do nothing here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1379
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1380
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1381
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1382
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1383
catchExpose
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1384
    "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
  1385
     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
  1386
     Sometime after the bit-blt, waitForExpose should be sent, to finally
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1387
     suspend until the expose/noExpose event arrives. 
1332
624bcfb69025 commentary
ca
parents: 1317
diff changeset
  1388
     This is an X speciality - for devices which do not need this kind of 
624bcfb69025 commentary
ca
parents: 1317
diff changeset
  1389
     asynchronous bit-blt confirmation, this is a noop.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1390
    "
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1391
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1392
    |wg|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1393
1027
0ba82862ca8d fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
  1394
    device scrollsAsynchronous ifFalse:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1395
	gotExpose := true.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1396
	^ self
1027
0ba82862ca8d fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
  1397
    ].
0ba82862ca8d fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
  1398
1295
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1399
    self setGraphicsExposures:true.
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1400
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1401
    gotExpose := false.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1402
    wg := self windowGroup.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1403
    wg notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1404
	"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1405
	 must process eny pending expose events, since
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1406
	 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
  1407
	 expose events coordinates are invalid 
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1408
	"
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1409
	wg processRealExposeEventsFor:self.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1410
	wg sensor catchExposeFor:self
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1411
    ]
1245
4a4e15a3e4fd pass the view as argument to the catchExpose method
Claus Gittinger <cg@exept.de>
parents: 1236
diff changeset
  1412
1851
6a6225647696 fixes for expose-event-lost after re-map
Claus Gittinger <cg@exept.de>
parents: 1806
diff changeset
  1413
    "Modified: 6.8.1997 / 19:50:15 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1414
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1415
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1416
deviceButtonMotion:state x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1417
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1418
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1419
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1420
     and send a #buttonMotion with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1421
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1422
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1423
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1424
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1425
     should redefine #buttonMotion:x:y:"
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
    |lx ly|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1428
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1429
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1430
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1431
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1432
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1433
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1434
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1435
	].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1436
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1437
    self buttonMotion:state x:lx y:ly
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
    "Modified: 20.5.1996 / 17:45:25 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1440
    "Modified: 14.10.1996 / 22:25:12 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1441
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1442
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1443
deviceButtonMultiPress:butt x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1444
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1445
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1446
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1447
     and send a buttonMultiPress with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1448
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1449
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1450
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1451
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1452
     should redefine #buttonMultiPress:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1453
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1454
    |lx ly|
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
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1457
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1458
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1459
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1460
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1461
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1462
	].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1463
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1464
    self buttonMultiPress:butt x:lx y:ly
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1465
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1466
    "Modified: 20.5.1996 / 17:45:22 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1467
    "Modified: 14.10.1996 / 22:25:22 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1468
!
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
deviceButtonPress:butt x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1471
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1472
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1473
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1474
     and send a buttonPress with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1475
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1476
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1477
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1478
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1479
     should redefine #buttonPress:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1480
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1481
    |lx ly|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1482
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1483
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1484
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1485
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1486
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1487
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1488
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1489
	].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1490
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1491
    self buttonPress:butt x:lx y:ly
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1492
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1493
    "Modified: 20.5.1996 / 17:45:18 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1494
    "Modified: 14.10.1996 / 22:25:30 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1495
!
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
deviceButtonRelease:butt x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1498
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1499
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1500
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1501
     and send a buttonRelease with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1502
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1503
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1504
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1505
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1506
     should redefine #buttonRelease:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1507
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1508
    |lx ly|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1509
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1510
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1511
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1512
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1513
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1514
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1515
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1516
	].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1517
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1518
    self buttonRelease:butt x:lx y:ly
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1519
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1520
    "Modified: 20.5.1996 / 17:45:14 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1521
    "Modified: 14.10.1996 / 22:25:37 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1522
!
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
deviceButtonShiftPress:butt x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1525
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1526
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1527
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1528
     and send a buttonShiftPress with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1529
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1530
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1531
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1532
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1533
     should redefine #buttonShiftPress:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1534
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1535
    |lx ly|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1536
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1537
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1538
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1539
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1540
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1541
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1542
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1543
	].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1544
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1545
    self buttonShiftPress:butt x:lx y:ly
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1546
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1547
    "Modified: 20.5.1996 / 17:45:09 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1548
    "Modified: 14.10.1996 / 22:25:49 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1549
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1550
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1551
deviceExposeX:x y:y width:w height:h
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1552
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1553
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1554
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1555
     and send an expose with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1556
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1557
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1558
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1559
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1560
     should redefine #exposeX:x:y:width:height:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1561
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1562
    |lx ly lw lh|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1563
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1564
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1565
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1566
    lw := w.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1567
    lh := h.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1568
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1569
	lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1570
	ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1571
	lw := transformation applyInverseScaleX:lw.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1572
	lh := transformation applyInverseScaleY:lh.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1573
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1574
    self exposeX:lx y:ly width:lw height:lh
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
    "Modified: 13.5.1996 / 11:31:44 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1577
    "Modified: 14.10.1996 / 22:26:00 / stefan"
727
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
1295
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1580
deviceGraphicsExposeX:x y:y width:w height:h final:final
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1581
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1582
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1583
     If there is a transformation, apply the inverse
1295
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1584
     and send a graphicsExpose with the logical coordinates.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1585
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1586
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1587
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1588
     those which are interested in logical coordinates
1295
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1589
     should redefine #graphicsExposeX:x:y:width:height:"
727
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
    |lx ly lw lh|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1592
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1593
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1594
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1595
    lw := w.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1596
    lh := h.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1597
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1598
	lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1599
	ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1600
	lw := transformation applyInverseScaleX:lw.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1601
	lh := transformation applyInverseScaleY:lh.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1602
    ].
1295
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1603
    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
  1604
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1605
    "Modified: 13.5.1996 / 11:31:54 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1606
    "Modified: 14.10.1996 / 22:26:08 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1607
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1608
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1609
deviceKeyPress:key x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1610
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1611
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1612
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1613
     and send a keyPress with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1614
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1615
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1616
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1617
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1618
     should redefine #keyPress:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1619
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1620
    |lx ly|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1621
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1622
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1623
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1624
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1625
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1626
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1627
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1628
	]
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1629
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1630
    self keyPress:key x:lx y:ly
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
    "Modified: 20.5.1996 / 17:44:59 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1633
    "Modified: 14.10.1996 / 22:26:17 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1634
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1635
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1636
deviceKeyRelease:key x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1637
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1638
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1639
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1640
     and send a keyRelease with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1641
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1642
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1643
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1644
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1645
     should redefine #keyRelease:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1646
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1647
    |lx ly|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1648
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1649
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1650
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1651
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1652
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1653
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1654
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1655
	]
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1656
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1657
    self keyRelease:key x:lx y:ly
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1658
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1659
    "Modified: 20.5.1996 / 17:44:42 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1660
    "Modified: 14.10.1996 / 22:26:28 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1661
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1662
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1663
devicePointerEnter:state x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1664
    "this is the low-level (untransformed) event as received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1665
     from the device (i.e. coordinates are in device coordinates). 
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1666
     If there is a transformation, apply the inverse
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1667
     and send a pointerEnter with the logical coordinates.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1668
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1669
     Views which are interested in deviceCoordinates should
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1670
     redefine this method - 
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1671
     those which are interested in logical coordinates
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1672
     should redefine #pointerEnter:x:y:"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1673
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1674
    |lx ly|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1675
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1676
    lx := x.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1677
    ly := y.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1678
    transformation notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1679
	lx notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1680
	    lx := transformation applyInverseToX:lx.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1681
	    ly := transformation applyInverseToY:ly.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1682
	]
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1683
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1684
    self pointerEnter:state x:lx y:ly
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1685
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1686
    "Modified: 20.5.1996 / 17:44:54 / cg"
1074
da107006d4f6 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1027
diff changeset
  1687
    "Modified: 14.10.1996 / 22:26:35 / stefan"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1688
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1689
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1690
exposeX:x y:y width:w height:h
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1691
    "an expose event - nothing done here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1692
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1693
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1694
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1695
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1696
focusIn
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1697
    "got keyboard focus - do nothing here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1698
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1699
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1700
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1701
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1702
focusOut
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1703
    "lost keyboard focus - do nothing here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1704
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1705
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1706
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1707
1295
ef93ded3c030 renamed graphicExpose -> graphicsExpose;
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
  1708
graphicsExposeX:x y:y width:w height:h final:final
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1709
    "an expose event after a scroll - do normal redraw processing"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1710
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1711
    self exposeX:x y:y width:w height:h
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1712
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1713
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1714
keyPress:key x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1715
    "a key was pressed in this view.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1716
     Here only keyCommands are handled - more action has to
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1717
     be implemented by redefining this method"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1718
      
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1719
    |action|
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 notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1722
	action := keyCommands at:key ifAbsent:[nil].
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1723
	action notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1724
	    action value
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1725
	]
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1726
    ].
1105
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1727
    key isSymbol ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1728
	(key startsWith:#Basic) ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1729
	    "/ an unhandled BasicFoo key;
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1730
	    "/ retry as Foo
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1731
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1732
	    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
  1733
	].
1105
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1734
    ].
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1735
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1736
    "Modified: 6.11.1996 / 17:51:15 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1737
!
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
keyRelease:key x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1740
    "default action is to do nothing"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1741
    
1105
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1742
    key isSymbol ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1743
	(key startsWith:#Basic) ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1744
	    "/ an unhandled BasicFoo key;
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1745
	    "/ retry as Foo
1105
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1746
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1747
	    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
  1748
	].
1105
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1749
    ].
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1750
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1751
    ^ self
1105
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1752
76a76be62263 allow second chance for keys with Basic-prefix
Claus Gittinger <cg@exept.de>
parents: 1093
diff changeset
  1753
    "Modified: 6.11.1996 / 17:51:20 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1754
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1755
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1756
noExpose
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1757
    "a no expose event after a scroll (event-mode only)"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1758
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1759
    gotExpose := true
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1762
pointerEnter:state x:x y:y
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1763
    "mouse cursor entered view - do nothing here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1764
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1765
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1766
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1767
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1768
pointerLeave:state
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1769
    "mouse cursor left view - do nothing here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1770
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1771
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1772
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1773
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1774
resizeRequest
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1775
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1776
!
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
waitForExpose
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1779
    "wait until an expose event arrives (to wait for scroll-finish)"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1780
2421
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1781
    |wg endPollTime pollDelay|
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1782
1027
0ba82862ca8d fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
  1783
    device scrollsAsynchronous ifFalse:[
2421
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1784
        gotExpose := true.
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1785
        ^ self
1027
0ba82862ca8d fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
  1786
    ].
0ba82862ca8d fixes for synchronous scrolling (WINDOWS)
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
  1787
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1788
    wg := self windowGroup.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1789
    wg notNil ifTrue:[
2421
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1790
        "/
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1791
        "/ a normal (suspendable) view.
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1792
        "/ wait by doing a real wait
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1793
        "/
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1794
         wg waitForExposeFor:self
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1795
    ] ifFalse:[
2421
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1796
        "/
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1797
        "/ a pure event driven view.
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1798
        "/ wait by doing a direct dispatch loop until the event arrives.
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1799
        "/ i.e. poll for the event
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1800
        "/
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1801
        device platformName = 'WIN32' ifTrue:[
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1802
            pollDelay := 1.
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1803
        ] ifFalse:[
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1804
            pollDelay := 3.
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1805
        ].
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1806
        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
  1807
2421
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1808
        [gotExpose] whileFalse:[
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1809
            realized ifTrue:[
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1810
                (device exposeEventPendingFor:drawableId withSync:true) ifTrue:[
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1811
                    device dispatchExposeEventFor:drawableId.
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1812
                ].
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1813
            ].
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1814
            realized ifFalse:[
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1815
                gotExpose := true.
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1816
                ^ self
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1817
            ].
1872
2a10e693d93f break non-windowGroup expose-poll loop after a while (10 seconds)
Claus Gittinger <cg@exept.de>
parents: 1851
diff changeset
  1818
2421
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1819
            "/ 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
  1820
2421
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1821
            AbsoluteTime now > endPollTime ifTrue:[
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1822
                'DisplaySurface [warning]: lost expose event' errorPrintCR.
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1823
                gotExpose := true.
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1824
                ^ self
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1825
            ].
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1826
            Processor yield.
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1827
        ].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1828
    ]
1129
2a3eaf218500 destroy while waiting for expose.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1829
2421
037f43af3b0e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2398
diff changeset
  1830
    "Modified: / 9.1.1999 / 01:58:09 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1831
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1832
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1833
!DisplaySurface methodsFor:'initialize / release'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1834
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1835
destroy
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1836
    "view is about to be destroyed -
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1837
     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
  1838
     then the view is physically destroyed."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1839
     
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1840
    middleButtonMenu notNil ifTrue:[
2427
d03456c66c8c separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents: 2421
diff changeset
  1841
        middleButtonMenu destroy.
d03456c66c8c separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents: 2421
diff changeset
  1842
        middleButtonMenu := nil
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1843
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1844
    keyCommands := nil.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1845
    gcId notNil ifTrue:[
2427
d03456c66c8c separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents: 2421
diff changeset
  1846
        device destroyGC:gcId.
d03456c66c8c separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents: 2421
diff changeset
  1847
        gcId := nil
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1848
    ].
2427
d03456c66c8c separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents: 2421
diff changeset
  1849
    self destroyView.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1850
    Lobby unregister:self.
1129
2a3eaf218500 destroy while waiting for expose.
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1851
1317
e1bd3b4aee72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1295
diff changeset
  1852
    "Modified: 8.2.1997 / 15:50:04 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1853
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1854
2427
d03456c66c8c separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents: 2421
diff changeset
  1855
destroyView
d03456c66c8c separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents: 2421
diff changeset
  1856
    "physically destroy the view."
d03456c66c8c separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents: 2421
diff changeset
  1857
     
d03456c66c8c separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents: 2421
diff changeset
  1858
    drawableId notNil ifTrue:[
d03456c66c8c separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents: 2421
diff changeset
  1859
        device destroyView:self withId:drawableId.
d03456c66c8c separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents: 2421
diff changeset
  1860
        drawableId := nil.
d03456c66c8c separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents: 2421
diff changeset
  1861
        realized := false.
d03456c66c8c separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents: 2421
diff changeset
  1862
    ].
d03456c66c8c separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents: 2421
diff changeset
  1863
!
d03456c66c8c separated destroyView into extra method to be redefinable
Claus Gittinger <cg@exept.de>
parents: 2421
diff changeset
  1864
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1865
destroyed
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1866
    "view has been destroyed by someone else"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1867
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1868
    drawableId notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1869
	device removeKnownView:self withId:drawableId.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1870
	drawableId := nil.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1871
	realized := false. 
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1872
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1873
    self destroy
1481
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1874
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  1875
    "Modified: 22.3.1997 / 14:56:34 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1876
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1877
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1878
initCursor
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1879
    "default cursor for all views"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1880
2453
65f4faf478b0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2443
diff changeset
  1881
    cursor := Cursor normal
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1882
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1883
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1884
initStyle
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1885
    "nothing done here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1886
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1887
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1888
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1889
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1890
initialize
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1891
    "initialize defaults"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1892
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1893
    super initialize.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1894
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1895
    eventMask := Display defaultEventMask.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1896
    viewBackground := background.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1897
    backed := false.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1898
    saveUnder := false.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1899
    self initCursor
1252
fccb14086649 exposePending is no longer used
Claus Gittinger <cg@exept.de>
parents: 1245
diff changeset
  1900
fccb14086649 exposePending is no longer used
Claus Gittinger <cg@exept.de>
parents: 1245
diff changeset
  1901
    "Modified: 18.1.1997 / 18:09:41 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1902
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1903
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1904
reAdjustGeometry
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1905
    "sent late during snapin processing, nothing done here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1906
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1907
    ^ self
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1910
recreate
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1911
    "recreate (i.e. tell X about me) after a snapin"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1912
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1913
    viewBackground isColor ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  1914
	viewBackground := viewBackground on:device
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1915
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1916
    super recreate.
1494
4faf11deec70 cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1917
    cursor := cursor onDevice:device.
1252
fccb14086649 exposePending is no longer used
Claus Gittinger <cg@exept.de>
parents: 1245
diff changeset
  1918
1494
4faf11deec70 cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1919
    "Modified: 28.3.1997 / 13:48:06 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1920
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1921
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1922
reinitStyle
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1923
    "nothing done here"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1924
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1925
    ^ self
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1926
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1927
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1928
shallowCopyForFinalization
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1929
    "redefined for faster creation of finalization copies
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1930
     (only device, gcId and drawableId are needed)"
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
    |aCopy|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1933
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1934
    aCopy := DeviceViewHandle basicNew.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1935
    aCopy setDevice:device id:drawableId gcId:gcId.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1936
    ^ aCopy
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1937
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1938
    "Created: 3.5.1996 / 15:35:13 / stefan"
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1941
!DisplaySurface methodsFor:'keyboard commands'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1942
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1943
addActionForKey:aKey action:aBlock
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1944
    "define a keyboard command function"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1945
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1946
    keyCommands isNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1947
	keyCommands := IdentityDictionary new
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1948
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1949
    keyCommands at:aKey put:aBlock
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1950
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1951
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1952
removeActionForKey:aKey
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1953
    keyCommands notNil ifTrue:[
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1954
	keyCommands removeKey:aKey ifAbsent:[]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1955
    ]
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1956
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1957
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1958
!DisplaySurface methodsFor:'queries'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1959
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1960
buttonMotionEventPending
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1961
    "return true, if a button motion event is pending.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1962
     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
  1963
     (not even for mouse-tracking).
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1964
     Dont use it, since it does not honor the windowGroup, but
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1965
     goes directly to the device instead.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1966
     Actually, its a historical leftover"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1967
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1968
    device flush.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1969
    ^ device eventPending:#buttonMotion for:drawableId
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1970
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1971
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1972
buttonReleaseEventPending
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1973
    "return true, if a button release event is pending.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1974
     Dont use it, since it does not honor the windowGroup, but
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1975
     goes directly to the device instead.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1976
     Actually, its a historical leftover"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1977
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1978
    device flush.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1979
    ^ device eventPending:#buttonRelease for:drawableId
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1982
exposeEventPending
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1983
    "return true, if an expose event is pending."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1984
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1985
    |sensor|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1986
2352
548f567b1454 fixed #exposeEventPending
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  1987
    ((sensor := self sensor) notNil and:[sensor hasExposeEventFor:self]) ifTrue:[^ true].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1988
    ^ device eventPending:#expose for:drawableId
2352
548f567b1454 fixed #exposeEventPending
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  1989
548f567b1454 fixed #exposeEventPending
Claus Gittinger <cg@exept.de>
parents: 2342
diff changeset
  1990
    "Modified: / 15.9.1998 / 23:18:16 / cg"
727
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
2010
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  1993
isPopUpView
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  1994
    "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
  1995
     usually this is true for alertBoxes etc."
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  1996
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  1997
    ^ false
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  1998
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  1999
    "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
  2000
!
5ac34bc91075 Move #isPopUpView to DisplayService (where #isView lives).
Stefan Vogel <sv@exept.de>
parents: 1960
diff changeset
  2001
920
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  2002
isRootView
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  2003
    "return true, if the receiver is a root view
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  2004
     false is returned here, this is only redefined in DisplayRootView."
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  2005
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  2006
    ^ false
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  2007
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  2008
    "Modified: 28.5.1996 / 19:27:34 / cg"
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  2009
    "Created: 5.7.1996 / 14:58:55 / cg"
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  2010
!
7b596ce23e01 added #isRootView
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  2011
1481
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  2012
isTopView
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  2013
    "return true, if the receiver is some kind of topview;
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  2014
     false is returned here; redefined in some subclasses."
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  2015
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  2016
    ^ false
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  2017
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  2018
    "Modified: 28.5.1996 / 19:27:34 / cg"
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  2019
    "Created: 22.3.1997 / 14:45:29 / cg"
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  2020
!
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1425
diff changeset
  2021
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2022
isView
734
1a778cedbbf5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  2023
    "return true, if the receiver is some kind of view;
1a778cedbbf5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  2024
     true is returned here."
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2025
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2026
    ^ true
734
1a778cedbbf5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  2027
1a778cedbbf5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 727
diff changeset
  2028
    "Modified: 28.5.1996 / 19:27:34 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2029
!
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
isXtWidget
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2032
    ^ false
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2035
redrawsFull
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2036
    ^ false
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2037
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2038
    "Created: 4.3.1996 / 14:17:22 / cg"
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
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2041
!DisplaySurface methodsFor:'queries-contents'!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2042
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2043
heightOfContents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2044
    "return the height of the contents in pixels.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2045
     Since we dont know here, just return the views size.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2046
     This will make your scrollbars show 100%-visible.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2047
     Must be redefined in subviews to make scrollbars really work."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2048
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2049
    ^ self height
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2050
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2051
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2052
widthOfContents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2053
    "return the width of the contents in pixels.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2054
     Since we dont know here, just return the views size.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2055
     This will make your scrollbars show 100%-visible.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2056
     Must be redefined in subviews to make scrollbars really work."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2057
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2058
    ^ self width
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2059
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2060
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2061
xOriginOfContents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2062
    "return the x-origin of the contents in pixels.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2063
     Since we dont know here, just return 0 for left.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2064
     Must be redefined in subviews to make scrollbars really work."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2065
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2066
    ^ 0
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2067
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2068
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2069
yOriginOfContents
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2070
    "return the y-origin of the contents in pixels.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2071
     Since we dont know here, just return 0 for top.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2072
     Must be redefined in subviews to make scrollbars really work."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2073
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2074
    ^ 0
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2075
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2076
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2077
!DisplaySurface methodsFor:'selection handling '!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2078
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2079
getSelection
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2080
    "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
  2081
     clipBoard buffer."
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2082
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2083
    |sel|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2084
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  2085
    sel := device getCopyBuffer.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2086
    sel isNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2087
	sel := device getSelectionFor:drawableId.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2088
	sel isNil ifTrue:[^ nil].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2089
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2090
    ^ sel
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  2091
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  2092
    "Modified: 13.2.1997 / 13:18:50 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2093
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2094
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2095
getTextSelection
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2096
    "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
  2097
     clipBoard buffer."
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2098
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2099
    |sel|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2100
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  2101
    sel := device getCopyBuffer.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2102
    sel isNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2103
	sel := device getTextSelectionFor:drawableId.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2104
	sel isNil ifTrue:[^ nil].
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2105
    ].
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2106
    ^ sel
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  2107
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  2108
    "Modified: 13.2.1997 / 13:19:26 / cg"
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
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  2111
pasteFromClipBoard:aString
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2112
    "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
  2113
     selection. The view should be prepared to paste the received
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2114
     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
  2115
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  2116
    self paste:aString
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2117
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  2118
    "Created: 13.2.1997 / 13:06:11 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2119
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2120
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2121
setSelection:something
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2122
    "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
  2123
     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
  2124
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  2125
    device setLastCopyBuffer:nil.
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  2126
    device setCopyBuffer:something.
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  2127
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2128
    (device setSelection:something owner:drawableId) ifFalse:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2129
	'DisplaySurface [warning]: could not copy selection to clipBoard' errorPrintCR
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2130
    ]
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  2131
1342
d2bcd2e582aa most clipBoard stuff moved to the device
Claus Gittinger <cg@exept.de>
parents: 1337
diff changeset
  2132
    "Modified: 13.2.1997 / 13:19:51 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2133
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2134
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2135
setTextSelection:something
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2136
    "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
  2137
     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
  2138
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2139
    |s|
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2140
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  2141
    device setLastCopyBuffer:nil.
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  2142
    device setCopyBuffer:something.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2143
    s := something.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2144
    s isString ifFalse:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2145
	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
  2146
    ].
2196
f78bbe9789b0 always copy strings to the clipBoard.
Claus Gittinger <cg@exept.de>
parents: 2175
diff changeset
  2147
f78bbe9789b0 always copy strings to the clipBoard.
Claus Gittinger <cg@exept.de>
parents: 2175
diff changeset
  2148
    "/ 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
  2149
    s := s string.
f78bbe9789b0 always copy strings to the clipBoard.
Claus Gittinger <cg@exept.de>
parents: 2175
diff changeset
  2150
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2151
    (device setTextSelection:s owner:drawableId) ifFalse:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2152
	'DisplaySurface [warning]: could not copy selection to clipBoard' errorPrintCR.
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2153
    ]
1133
a90be1f2c699 per-display copyBuffer
Claus Gittinger <cg@exept.de>
parents: 1129
diff changeset
  2154
2196
f78bbe9789b0 always copy strings to the clipBoard.
Claus Gittinger <cg@exept.de>
parents: 2175
diff changeset
  2155
    "Modified: / 16.7.1998 / 21:38:55 / cg"
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2156
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2157
1093
18ea3ccf5d2f category rename
Claus Gittinger <cg@exept.de>
parents: 1074
diff changeset
  2158
!DisplaySurface methodsFor:'user notification'!
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2159
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2160
beep
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2161
    "output an audible beep or bell on my screen device"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2162
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2163
    device beep; flush
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2164
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2165
    "Created: 28.5.1996 / 16:16:13 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2166
    "Modified: 28.5.1996 / 16:58:25 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2167
!
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2168
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2169
showActivity:aMessage
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2170
    "this is sent indirectly by the activityNotification mechanism.
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2171
     Defined here as a fallback, if ever sent to non topviews."
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2172
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2173
    Transcript showCR:aMessage
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2174
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2175
    "Modified: 18.5.1996 / 15:44:33 / cg"
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2176
! !
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2177
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2178
!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
  2179
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2180
documentation
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2181
"
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2182
    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
  2183
    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
  2184
    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
  2185
    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
  2186
    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
  2187
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2188
    [see also:]
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2189
	DisplaySurface
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2190
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2191
    [author:]
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2192
	Claus Gittinger
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2193
"
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2194
! !
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2195
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2196
!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
  2197
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2198
disposed
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2199
    "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
  2200
     - release system resources"
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2201
2096
f3f0d358239f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2010
diff changeset
  2202
    |v id|
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2203
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2204
    drawableId notNil ifTrue:[
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2205
	(id := gcId) notNil ifTrue:[
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2206
	    gcId := nil.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2207
	    device destroyGC:id.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2208
	].
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2209
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2210
	"/ care for lost-view trouble:
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2211
	"/ if the windowID is still registered,
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2212
	"/ 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
  2213
	"/ 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
  2214
	"/ (X recycles window handles.)
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2215
	"/ 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
  2216
	"/ 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
  2217
	"/ 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
  2218
	"/ 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
  2219
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2220
	(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
  2221
"/ '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
  2222
"/ drawableId displayString infoPrintCR.
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2223
	    drawableId := nil.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2224
	] ifFalse:[
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2225
"/ '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
  2226
"/ device checkKnownViewId:drawableId.
2096
f3f0d358239f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2010
diff changeset
  2227
	    id := drawableId.
2300
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2228
	    drawableId := nil.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2229
	    device destroyView:nil withId:id.
87306f56da51 ask device if bg-pixmaps are supported;
Claus Gittinger <cg@exept.de>
parents: 2196
diff changeset
  2230
	]
1907
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2231
    ].
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2232
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2233
    "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
  2234
    "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
  2235
! !
61fdff318175 Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents: 1884
diff changeset
  2236
1093
18ea3ccf5d2f category rename
Claus Gittinger <cg@exept.de>
parents: 1074
diff changeset
  2237
!DisplaySurface class methodsFor:'documentation'!
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2238
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2239
version
2708
855835147902 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2660
diff changeset
  2240
    ^ '$Header: /cvs/stx/stx/libview/Attic/DSurface.st,v 1.66 1999-05-21 18:09:35 cg Exp $'
727
bf23a306b6f2 renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2241
! !