0
|
1 |
"
|
6
|
2 |
COPYRIGHT (c) 1992 by Claus Gittinger
|
80
|
3 |
All Rights Reserved
|
0
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
|
13 |
Object subclass:#Cursor
|
577
|
14 |
instanceVariableNames:'shape sourceForm maskForm hotX hotY device cursorId'
|
|
15 |
classVariableNames:'Lobby DefaultFgColor DefaultBgColor NormalCursor HandCursor
|
|
16 |
ArrowCursor WaitCursor CrossHairCursor OriginCursor CornerCursor
|
|
17 |
SquareCursor FourWayCursor UpDownArrowCursor LeftRightArrowCursor
|
|
18 |
ThumbsUpCursor ThumbsDownCursor ReadCursor WriteCursor XeqCursor
|
|
19 |
StopCursor EyeCursor BlankCursor MarkerCursor UpCursor DownCursor
|
|
20 |
LeftCursor RightCursor XMarkerCursor CaretCursor'
|
|
21 |
poolDictionaries:''
|
|
22 |
category:'Graphics-Support'
|
0
|
23 |
!
|
|
24 |
|
|
25 |
!Cursor class methodsFor:'documentation'!
|
|
26 |
|
46
|
27 |
copyright
|
|
28 |
"
|
|
29 |
COPYRIGHT (c) 1992 by Claus Gittinger
|
80
|
30 |
All Rights Reserved
|
46
|
31 |
|
|
32 |
This software is furnished under a license and may be used
|
|
33 |
only in accordance with the terms of that license and with the
|
|
34 |
inclusion of the above copyright notice. This software may not
|
|
35 |
be provided or otherwise made available to, or used by, any
|
|
36 |
other person. No title to or ownership of the software is
|
|
37 |
hereby transferred.
|
|
38 |
"
|
|
39 |
!
|
|
40 |
|
0
|
41 |
documentation
|
38
|
42 |
"
|
|
43 |
I represents cursors in a device independent manner.
|
144
|
44 |
Normally, cursors are defined at view creation time,
|
601
|
45 |
via
|
|
46 |
'aView cursor:aCursor'.
|
|
47 |
|
|
48 |
[Instance variables:]
|
0
|
49 |
|
601
|
50 |
shape <Symbol> a shape (i.e. #arrow, #hand, ...) or nil
|
|
51 |
sourceForm <Form> if shape is nil, the source bits
|
|
52 |
maskForm <Form> if shape is nil, the mask bits
|
|
53 |
hotX <SmallInteger> if shape is nil, the hotSpot x of the cursor
|
|
54 |
hotY <SmallInteger> if shape is nil, the hotSpot y of the cursor
|
|
55 |
device <aDevice> the device, if associated to one
|
|
56 |
cursorId <anObject> the device-specific id if device is nonNil
|
0
|
57 |
|
601
|
58 |
[class variables:]
|
|
59 |
|
|
60 |
Lobby <Registry> keeps track of known device cursors
|
|
61 |
|
|
62 |
DefaultFgColor <Color> default foreground color for cursors (usually black)
|
|
63 |
DefaultBgColor <Color> default background color for cursors (usually white)
|
0
|
64 |
|
601
|
65 |
NormalCursor <Cursor> cached instance of normal (arrow) cursor
|
|
66 |
...
|
0
|
67 |
|
601
|
68 |
[see also:]
|
|
69 |
DeviceWorkstation
|
|
70 |
PseudoView
|
|
71 |
Font Cursor Color
|
38
|
72 |
"
|
144
|
73 |
!
|
|
74 |
|
|
75 |
examples
|
|
76 |
"
|
|
77 |
get a standard cursor:
|
|
78 |
|
|
79 |
Cursor wait
|
|
80 |
Cursor stop
|
|
81 |
Cursor normal
|
|
82 |
|
|
83 |
create a custom cursor:
|
|
84 |
|
|
85 |
Cursor extent:16@16
|
|
86 |
fromArray:#[ 2r00000000 2r00000000
|
|
87 |
2r00000000 2r00000000
|
|
88 |
2r00000000 2r00000000
|
|
89 |
2r11111111 2r11111111
|
|
90 |
2r11111111 2r11111111
|
|
91 |
2r00000000 2r00000000
|
|
92 |
2r00000000 2r00000000
|
|
93 |
2r11111111 2r11111111
|
|
94 |
2r11111111 2r11111111
|
|
95 |
2r00000000 2r00000000
|
|
96 |
2r00000000 2r00000000
|
|
97 |
2r11111111 2r11111111
|
|
98 |
2r11111111 2r11111111
|
|
99 |
2r00000000 2r00000000
|
|
100 |
2r00000000 2r00000000
|
|
101 |
2r00000000 2r00000000]
|
|
102 |
offset:-8@-8
|
|
103 |
|
|
104 |
define a cursor for a view:
|
|
105 |
|
|
106 |
|v|
|
|
107 |
|
|
108 |
v := View new.
|
|
109 |
v cursor:Cursor stop.
|
|
110 |
v open.
|
|
111 |
|
|
112 |
with above custom cursor:
|
|
113 |
|
|
114 |
|v|
|
|
115 |
|
|
116 |
v := View new.
|
|
117 |
v cursor:(
|
|
118 |
Cursor extent:16@16
|
|
119 |
fromArray:#[ 2r00000000 2r00000000
|
|
120 |
2r00000000 2r00000000
|
|
121 |
2r00000000 2r00000000
|
|
122 |
2r11111111 2r11111111
|
|
123 |
2r11111111 2r11111111
|
|
124 |
2r00000000 2r00000000
|
|
125 |
2r00000000 2r00000000
|
|
126 |
2r11111111 2r11111111
|
|
127 |
2r11111111 2r11111111
|
|
128 |
2r00000000 2r00000000
|
|
129 |
2r00000000 2r00000000
|
|
130 |
2r11111111 2r11111111
|
|
131 |
2r11111111 2r11111111
|
|
132 |
2r00000000 2r00000000
|
|
133 |
2r00000000 2r00000000
|
|
134 |
2r00000000 2r00000000]
|
|
135 |
offset:-8@-8).
|
|
136 |
v open.
|
|
137 |
|
|
138 |
with multiple views:
|
|
139 |
|
|
140 |
|v1 v2 top|
|
|
141 |
|
|
142 |
top := StandardSystemView new.
|
|
143 |
top extent:300@300.
|
|
144 |
v1 := View origin:0.0@0.0 corner:1.0@0.5 in:top.
|
|
145 |
v1 viewBackground:(Color grey:75).
|
|
146 |
v1 cursor:Cursor thumbsUp.
|
|
147 |
v2 := View origin:0.0@0.5 corner:1.0@1.0 in:top.
|
|
148 |
v2 viewBackground:(Color white).
|
|
149 |
v2 cursor:Cursor wait.
|
|
150 |
top open.
|
|
151 |
|
|
152 |
|
|
153 |
show a cursor in ALL ST/X views for a while:
|
|
154 |
|
|
155 |
Cursor wait
|
|
156 |
showWhile:[
|
|
157 |
(Delay forSeconds:5) wait
|
|
158 |
]
|
|
159 |
|
|
160 |
|
151
|
161 |
show a cursor in all views belonging to a windowGroup:
|
|
162 |
(have to wait until top is visible to access windowGroup)
|
|
163 |
|
|
164 |
|v1 v2 top|
|
|
165 |
|
|
166 |
top := StandardSystemView new.
|
|
167 |
top extent:300@300.
|
|
168 |
v1 := View origin:0.0@0.0 corner:1.0@0.5 in:top.
|
|
169 |
v1 viewBackground:(Color grey:75).
|
|
170 |
v2 := View origin:0.0@0.5 corner:1.0@1.0 in:top.
|
|
171 |
v2 viewBackground:(Color white).
|
|
172 |
top open.
|
|
173 |
|
|
174 |
[top shown] whileFalse:[Processor yield].
|
|
175 |
|
|
176 |
top windowGroup
|
|
177 |
withCursor:Cursor wait
|
|
178 |
do:[
|
|
179 |
(Delay forSeconds:10) wait
|
|
180 |
]
|
|
181 |
|
|
182 |
|
144
|
183 |
show a cursor in a single view for a while:
|
|
184 |
|
|
185 |
|v1 v2 top|
|
|
186 |
|
|
187 |
top := StandardSystemView new.
|
|
188 |
top extent:300@300.
|
|
189 |
v1 := View origin:0.0@0.0 corner:1.0@0.5 in:top.
|
|
190 |
v1 viewBackground:(Color grey:75).
|
|
191 |
v2 := View origin:0.0@0.5 corner:1.0@1.0 in:top.
|
|
192 |
v2 viewBackground:(Color white).
|
|
193 |
top open.
|
|
194 |
|
|
195 |
v1 withCursor:Cursor wait
|
|
196 |
do:[
|
|
197 |
(Delay forSeconds:10) wait
|
|
198 |
]
|
|
199 |
"
|
0
|
200 |
! !
|
|
201 |
|
|
202 |
!Cursor class methodsFor:'initialization'!
|
|
203 |
|
|
204 |
flushDeviceCursors
|
|
205 |
"unassign all cursors from their device"
|
|
206 |
|
223
|
207 |
Lobby notNil ifTrue:[
|
499
|
208 |
Lobby do:[:aCursor |
|
223
|
209 |
aCursor restored.
|
|
210 |
Lobby registerChange:aCursor
|
499
|
211 |
]
|
0
|
212 |
]
|
|
213 |
!
|
|
214 |
|
577
|
215 |
initialize
|
|
216 |
Lobby isNil ifTrue:[
|
|
217 |
Lobby := Registry new.
|
|
218 |
|
|
219 |
"want to be informed when returning from snapshot"
|
|
220 |
ObjectMemory addDependent:self
|
|
221 |
]
|
|
222 |
!
|
|
223 |
|
0
|
224 |
update:something
|
|
225 |
"sent when restarted after a snapIn"
|
|
226 |
|
|
227 |
(something == #restarted) ifTrue:[
|
80
|
228 |
self flushDeviceCursors
|
0
|
229 |
]
|
|
230 |
! !
|
|
231 |
|
|
232 |
!Cursor class methodsFor:'instance creation'!
|
|
233 |
|
|
234 |
extent:extent fromArray:array offset:offset
|
|
235 |
"create a new bitmap cursor from bits in the array argument
|
|
236 |
- ST-80 compatibility"
|
|
237 |
|
|
238 |
|sourceForm|
|
|
239 |
|
|
240 |
sourceForm := Form extent:extent fromArray:array offset:offset.
|
|
241 |
^ self sourceForm:sourceForm maskForm:sourceForm hotSpot:(offset negated)
|
|
242 |
!
|
|
243 |
|
|
244 |
extent:extent sourceArray:sourceArray maskArray:maskArray offset:offset
|
|
245 |
"create a new bitmap cursor with mask from bits in sourceArray and
|
|
246 |
maskArray"
|
|
247 |
|
|
248 |
|sourceForm maskForm|
|
|
249 |
|
|
250 |
sourceForm := Form extent:extent fromArray:sourceArray offset:offset.
|
|
251 |
maskForm := Form extent:extent fromArray:maskArray offset:offset.
|
|
252 |
^ self sourceForm:sourceForm maskForm:maskForm hotSpot:(offset negated)
|
|
253 |
!
|
|
254 |
|
577
|
255 |
fileCursorNamed:cursorName
|
|
256 |
"return a cursor read from the files 'cursorName_bits.bit' and
|
|
257 |
'cursorName_mask.bit' - return nil if file does not exist"
|
|
258 |
|
|
259 |
|cursorBits maskBits|
|
|
260 |
|
|
261 |
cursorBits := Form fromFile:(cursorName , '_bits.bit').
|
|
262 |
cursorBits notNil ifTrue:[
|
|
263 |
maskBits := Form fromFile:(cursorName , '_mask.bit').
|
|
264 |
maskBits notNil ifTrue:[
|
|
265 |
^ self sourceForm:cursorBits maskForm:maskBits
|
|
266 |
]
|
|
267 |
].
|
|
268 |
^ nil
|
|
269 |
!
|
|
270 |
|
|
271 |
imageArray:imageBits maskArray:maskBits
|
|
272 |
"ST-80 compatible cursor creation - the extent is fixed to 16@16"
|
|
273 |
|
|
274 |
"name is ignored ..."
|
|
275 |
|
|
276 |
^ self imageArray:imageBits maskArray:maskBits hotSpot:8@8
|
|
277 |
!
|
|
278 |
|
|
279 |
imageArray:imageBits maskArray:maskBits hotSpot:hot
|
|
280 |
"ST-80 compatible cursor creation - the extent is fixed to 16@16"
|
|
281 |
|
|
282 |
^ self
|
|
283 |
extent:16@16
|
|
284 |
sourceArray:imageBits
|
|
285 |
maskArray:maskBits
|
|
286 |
offset:hot negated
|
|
287 |
|
|
288 |
"
|
|
289 |
|cursor|
|
|
290 |
|
|
291 |
cursor := Cursor
|
|
292 |
imageArray: #(
|
|
293 |
2r0000000000000000
|
|
294 |
2r0000000100001110
|
|
295 |
2r0000000100001110
|
|
296 |
2r0000000100001110
|
|
297 |
2r0000000100000000
|
|
298 |
2r0000000100000000
|
|
299 |
2r0000000100000000
|
|
300 |
2r0111111111111110
|
|
301 |
2r0000000100000000
|
|
302 |
2r0000000100000000
|
|
303 |
2r0000000100000000
|
|
304 |
2r0000000100000000
|
|
305 |
2r0000000100000000
|
|
306 |
2r0000000100000000
|
|
307 |
2r0000000100000000
|
|
308 |
2r0000000000000000)
|
|
309 |
maskArray: #(
|
|
310 |
2r0000001110011111
|
|
311 |
2r0000001110011111
|
|
312 |
2r0000001110011111
|
|
313 |
2r0000001110011111
|
|
314 |
2r0000001110011111
|
|
315 |
2r0000001110000000
|
|
316 |
2r1111111111111111
|
|
317 |
2r1111111111111111
|
|
318 |
2r1111111111111111
|
|
319 |
2r0000001110000000
|
|
320 |
2r0000001110000000
|
|
321 |
2r0000001110000000
|
|
322 |
2r0000001110000000
|
|
323 |
2r0000001110000000
|
|
324 |
2r0000001110000000
|
|
325 |
2r0000001110000000)
|
|
326 |
hotSpot: 8@8.
|
|
327 |
|
|
328 |
WindowGroup activeGroup
|
|
329 |
withCursor:cursor
|
|
330 |
do:[(Delay forSeconds:10)wait]
|
|
331 |
"
|
|
332 |
!
|
|
333 |
|
|
334 |
imageArray:imageBits maskArray:maskBits hotSpot:hot name:aString
|
|
335 |
"ST-80 compatible cursor creation - the extent is fixed to 16@16"
|
|
336 |
|
|
337 |
"name is ignored ..."
|
|
338 |
|
|
339 |
^ self imageArray:imageBits maskArray:maskBits hotSpot:hot
|
|
340 |
!
|
|
341 |
|
|
342 |
shape:aShape
|
|
343 |
"return one of the standard cursors.
|
|
344 |
Each display may offer different shapes - see for example XWorkstation
|
|
345 |
for details (however a basic minimum set should be supported by all)"
|
|
346 |
|
|
347 |
|newCursor|
|
|
348 |
|
|
349 |
"first look if not already known"
|
|
350 |
Lobby isNil ifTrue:[
|
|
351 |
self initialize
|
|
352 |
].
|
|
353 |
Lobby do:[:aCursor |
|
|
354 |
(aCursor shape == aShape) ifTrue:[
|
|
355 |
^ aCursor
|
|
356 |
]
|
|
357 |
].
|
|
358 |
newCursor := self basicNew setShape:aShape.
|
|
359 |
Lobby register:newCursor.
|
|
360 |
^ newCursor
|
|
361 |
!
|
|
362 |
|
|
363 |
shape:aShape on:aDevice
|
|
364 |
"return one of the standard cursors already associated to aDevice.
|
|
365 |
This is the same as '(Cursor shape:aShape) on:aDevice' but somwehat faster."
|
|
366 |
|
|
367 |
|newCursor oldCursor|
|
|
368 |
|
|
369 |
"first look if not already known"
|
|
370 |
Lobby isNil ifTrue:[
|
|
371 |
self initialize
|
|
372 |
].
|
|
373 |
Lobby do:[:aCursor |
|
|
374 |
(aCursor shape == aShape) ifTrue:[
|
|
375 |
(aCursor device == aDevice) ifTrue:[^ aCursor].
|
|
376 |
oldCursor := aCursor
|
|
377 |
].
|
|
378 |
].
|
|
379 |
|
|
380 |
"found one with same shape, but different device"
|
|
381 |
oldCursor notNil ifTrue:[
|
|
382 |
^ oldCursor newOn:aDevice
|
|
383 |
].
|
|
384 |
|
|
385 |
newCursor := self basicNew setShape:aShape.
|
|
386 |
Lobby register:newCursor.
|
|
387 |
^ newCursor
|
|
388 |
!
|
|
389 |
|
0
|
390 |
sourceForm:aForm
|
|
391 |
"return a new cursor.
|
|
392 |
Source- and mask-Bits are taken from aForm; hotSpot is center"
|
|
393 |
|
|
394 |
^ self sourceForm:aForm
|
80
|
395 |
maskForm:aForm
|
|
396 |
hotX:(aForm width // 2)
|
|
397 |
hotY:(aForm height // 2)
|
0
|
398 |
!
|
|
399 |
|
|
400 |
sourceForm:sourceForm maskForm:maskForm
|
|
401 |
"return a new cursor. hotSpot is center"
|
|
402 |
|
|
403 |
^ self sourceForm:sourceForm
|
80
|
404 |
maskForm:maskForm
|
|
405 |
hotX:(sourceForm width // 2)
|
|
406 |
hotY:(sourceForm height // 2)
|
0
|
407 |
!
|
|
408 |
|
|
409 |
sourceForm:sourceForm maskForm:maskForm hotSpot:aPoint
|
|
410 |
"return a new cursor"
|
|
411 |
|
|
412 |
^ self sourceForm:sourceForm
|
80
|
413 |
maskForm:maskForm
|
|
414 |
hotX:(aPoint x)
|
|
415 |
hotY:(aPoint y)
|
0
|
416 |
!
|
|
417 |
|
|
418 |
sourceForm:sourceForm maskForm:maskForm hotX:hotX hotY:hotY
|
|
419 |
"return a new cursor"
|
|
420 |
|
|
421 |
|newCursor|
|
|
422 |
|
|
423 |
"first look if not already known"
|
223
|
424 |
Lobby isNil ifTrue:[
|
499
|
425 |
self initialize
|
223
|
426 |
].
|
115
|
427 |
Lobby do:[:aCursor |
|
80
|
428 |
(aCursor sourceForm == sourceForm) ifTrue:[
|
|
429 |
(aCursor maskForm == maskForm) ifTrue:[
|
|
430 |
(aCursor hotX == hotX) ifTrue:[
|
|
431 |
(aCursor hotY == hotY) ifTrue:[
|
|
432 |
^ aCursor
|
|
433 |
]
|
|
434 |
]
|
|
435 |
]
|
|
436 |
]
|
0
|
437 |
].
|
35
|
438 |
(sourceForm isNil or:[maskForm isNil]) ifTrue:[^ nil].
|
|
439 |
|
2
|
440 |
newCursor := self basicNew setSourceForm:sourceForm
|
80
|
441 |
maskForm:maskForm
|
|
442 |
hotX:hotX
|
|
443 |
hotY:hotY.
|
23
|
444 |
Lobby register:newCursor.
|
0
|
445 |
^ newCursor
|
577
|
446 |
! !
|
|
447 |
|
|
448 |
!Cursor class methodsFor:'class initialization'!
|
|
449 |
|
|
450 |
initializeNewCursors
|
|
451 |
"Create the new cursors
|
|
452 |
Cursor blank
|
|
453 |
Cursor down
|
|
454 |
Cursor execute
|
|
455 |
Cursor left
|
|
456 |
Cursor marker
|
|
457 |
Cursor normal
|
|
458 |
Cursor read
|
|
459 |
Cursor right
|
|
460 |
Cursor square
|
|
461 |
Cursor up
|
|
462 |
Cursor wait
|
|
463 |
Cursor write
|
|
464 |
Cursor thumbsUp
|
|
465 |
Cursor thumbsDown
|
|
466 |
Cursor xMarker
|
|
467 |
Cursor caret
|
|
468 |
Cursor stop
|
|
469 |
Cursor eye"
|
|
470 |
|
|
471 |
|device|
|
|
472 |
|
|
473 |
" claus: already there in ST/X"
|
|
474 |
|
|
475 |
"/ OriginCursor :=
|
|
476 |
"/ (Cursor
|
|
477 |
"/ extent: 16@16
|
|
478 |
"/ fromArray: #(
|
|
479 |
"/ 2r1111111111111111
|
|
480 |
"/ 2r1111111111111111
|
|
481 |
"/ 2r1100000000000000
|
|
482 |
"/ 2r1100000000000000
|
|
483 |
"/ 2r1100000000000000
|
|
484 |
"/ 2r1100000000000000
|
|
485 |
"/ 2r1100000000000000
|
|
486 |
"/ 2r1100000000000000
|
|
487 |
"/ 2r1100000000000000
|
|
488 |
"/ 2r1100000000000000
|
|
489 |
"/ 2r1100000000000000
|
|
490 |
"/ 2r1100000000000000
|
|
491 |
"/ 2r1100000000000000
|
|
492 |
"/ 2r1100000000000000
|
|
493 |
"/ 2r1100000000000000
|
|
494 |
"/ 2r1100000000000000)
|
|
495 |
"/ offset: -2@-2).
|
|
496 |
"/
|
|
497 |
|
|
498 |
" claus: already there in ST/X"
|
0
|
499 |
|
577
|
500 |
"/ CornerCursor :=
|
|
501 |
"/ (Cursor
|
|
502 |
"/ extent: 16@16
|
|
503 |
"/ fromArray: #(
|
|
504 |
"/ 2r0000000000000011
|
|
505 |
"/ 2r0000000000000011
|
|
506 |
"/ 2r0000000000000011
|
|
507 |
"/ 2r0000000000000011
|
|
508 |
"/ 2r0000000000000011
|
|
509 |
"/ 2r0000000000000011
|
|
510 |
"/ 2r0000000000000011
|
|
511 |
"/ 2r0000000000000011
|
|
512 |
"/ 2r0000000000000011
|
|
513 |
"/ 2r0000000000000011
|
|
514 |
"/ 2r0000000000000011
|
|
515 |
"/ 2r0000000000000011
|
|
516 |
"/ 2r0000000000000011
|
|
517 |
"/ 2r0000000000000011
|
|
518 |
"/ 2r1111111111111111
|
|
519 |
"/ 2r1111111111111111)
|
|
520 |
"/ offset: -14@-14).
|
|
521 |
|
|
522 |
|
|
523 |
"original from SMACK:"
|
151
|
524 |
|
577
|
525 |
"/ ReadCursor :=
|
|
526 |
"/ (Cursor
|
|
527 |
"/ extent: 16@16
|
|
528 |
"/ fromArray: #(
|
|
529 |
"/ 2r0000110000000110
|
|
530 |
"/ 2r0001001000001001
|
|
531 |
"/ 2r0001001000001001
|
|
532 |
"/ 2r0010000000010000
|
|
533 |
"/ 2r0100000000100000
|
|
534 |
"/ 2r1111101111100000
|
|
535 |
"/ 2r1000010000100000
|
|
536 |
"/ 2r1000010000100000
|
|
537 |
"/ 2r1011010110100000
|
|
538 |
"/ 2r0111101111000000
|
|
539 |
"/ 2r0000000000000000
|
|
540 |
"/ 2r0000000000000000
|
|
541 |
"/ 2r0000000000000000
|
|
542 |
"/ 2r0000000000000000
|
|
543 |
"/ 2r0000000000000000
|
|
544 |
"/ 2r0000000000000000)
|
|
545 |
"/ offset: 0@0).
|
|
546 |
|
|
547 |
|
|
548 |
"claus: added mask"
|
|
549 |
|
|
550 |
ReadCursor := (Cursor
|
|
551 |
extent: 16@16
|
|
552 |
sourceArray: #(
|
|
553 |
2r0
|
|
554 |
2r0000110000000110
|
|
555 |
2r0001001000001001
|
|
556 |
2r0001001000001001
|
|
557 |
2r0010000000010000
|
|
558 |
2r0100000000100000
|
|
559 |
2r1111101111100000
|
|
560 |
2r1000010000100000
|
|
561 |
2r1000010000100000
|
|
562 |
2r1011010110100000
|
|
563 |
2r0111101111000000
|
|
564 |
2r0000000000000000
|
|
565 |
2r0000000000000000
|
|
566 |
2r0000000000000000
|
|
567 |
2r0000000000000000
|
|
568 |
2r0000000000000000)
|
|
569 |
maskArray: #(
|
|
570 |
2r0001111000001111
|
|
571 |
2r0001111000011111
|
|
572 |
2r0011111000011111
|
|
573 |
2r0011100000111100
|
|
574 |
2r0111000000111000
|
|
575 |
2r1111111111110000
|
|
576 |
2r1111111111110000
|
|
577 |
2r1111111111110000
|
|
578 |
2r1111111111110000
|
|
579 |
2r1111111111110000
|
|
580 |
2r1111111111100000
|
|
581 |
2r0111111111000000
|
|
582 |
2r0000000000000000
|
|
583 |
2r0000000000000000
|
|
584 |
2r0000000000000000
|
|
585 |
2r0000000000000000)
|
|
586 |
offset: -5@-7).
|
|
587 |
|
|
588 |
"original from SMACK:"
|
151
|
589 |
|
577
|
590 |
"/ WriteCursor := (Cursor
|
|
591 |
"/ extent: 16@16
|
|
592 |
"/ fromArray: #(
|
|
593 |
"/ 2r0000000000000110
|
|
594 |
"/ 2r0000000000001111
|
|
595 |
"/ 2r0000000000010110
|
|
596 |
"/ 2r0000000000100100
|
|
597 |
"/ 2r0000000001001000
|
|
598 |
"/ 2r0000000010010000
|
|
599 |
"/ 2r0000000100100000
|
|
600 |
"/ 2r0000001001000011
|
|
601 |
"/ 2r0000010010000010
|
|
602 |
"/ 2r0000100100000110
|
|
603 |
"/ 2r0001001000001000
|
|
604 |
"/ 2r0010010000001000
|
|
605 |
"/ 2r0111100001001000
|
|
606 |
"/ 2r0101000010111000
|
|
607 |
"/ 2r0110000110000000
|
|
608 |
"/ 2r1111111100000000)
|
|
609 |
"/ offset: 0@0).
|
|
610 |
|
|
611 |
"claus: added mask"
|
|
612 |
|
|
613 |
WriteCursor := (Cursor
|
|
614 |
extent: 16@16
|
|
615 |
sourceArray: #(
|
|
616 |
2r0000000000000110
|
|
617 |
2r0000000000001111
|
|
618 |
2r0000000000010110
|
|
619 |
2r0000000000100100
|
|
620 |
2r0000000001001000
|
|
621 |
2r0000000010010000
|
|
622 |
2r0000000100100000
|
|
623 |
2r0000001001000011
|
|
624 |
2r0000010010000010
|
|
625 |
2r0000100100000110
|
|
626 |
2r0001001000001000
|
|
627 |
2r0010010000001000
|
|
628 |
2r0111100001001000
|
|
629 |
2r0101000010111000
|
|
630 |
2r0110000110000000
|
|
631 |
2r1111111100000000)
|
|
632 |
maskArray: #(
|
|
633 |
2r0000000000000111
|
|
634 |
2r0000000000001111
|
|
635 |
2r0000000000011110
|
|
636 |
2r0000000000111100
|
|
637 |
2r0000000001111000
|
|
638 |
2r0000000011110000
|
|
639 |
2r0000000111100001
|
|
640 |
2r0000001111000110
|
|
641 |
2r0000011110000110
|
|
642 |
2r0000111100001110
|
|
643 |
2r0001111000001100
|
|
644 |
2r0011110001001100
|
|
645 |
2r0111100011111000
|
|
646 |
2r0111000110111000
|
|
647 |
2r0111111110000000
|
|
648 |
2r1111111100000000)
|
|
649 |
offset: 0@-15).
|
|
650 |
|
|
651 |
"original from SMACK:"
|
151
|
652 |
|
577
|
653 |
"/ WaitCursor :=
|
|
654 |
"/ (Cursor
|
|
655 |
"/ extent: 16@16
|
|
656 |
"/ fromArray: #(
|
|
657 |
"/ 2r1111111111111111
|
|
658 |
"/ 2r1000000000000001
|
|
659 |
"/ 2r0100000000000010
|
|
660 |
"/ 2r0010000000000100
|
|
661 |
"/ 2r0001110000111000
|
|
662 |
"/ 2r0000111101110000
|
|
663 |
"/ 2r0000011011100000
|
|
664 |
"/ 2r0000001111000000
|
|
665 |
"/ 2r0000001111000000
|
|
666 |
"/ 2r0000010110100000
|
|
667 |
"/ 2r0000100010010000
|
|
668 |
"/ 2r0001000110001000
|
|
669 |
"/ 2r0010001101000100
|
|
670 |
"/ 2r0100111111110010
|
|
671 |
"/ 2r1011111111111101
|
|
672 |
"/ 2r1111111111111111)
|
|
673 |
"/ offset: -8@-8).
|
|
674 |
|
|
675 |
"claus: added mask"
|
151
|
676 |
|
577
|
677 |
WaitCursor :=
|
|
678 |
(Cursor
|
|
679 |
extent: 16@16
|
|
680 |
sourceArray: #(
|
|
681 |
2r1111111111111111
|
|
682 |
2r1000000000000001
|
|
683 |
2r0100000000000010
|
|
684 |
2r0010000000000100
|
|
685 |
2r0001110000111000
|
|
686 |
2r0000111101110000
|
|
687 |
2r0000011011100000
|
|
688 |
2r0000001111000000
|
|
689 |
2r0000001111000000
|
|
690 |
2r0000010110100000
|
|
691 |
2r0000100010010000
|
|
692 |
2r0001000110001000
|
|
693 |
2r0010001101000100
|
|
694 |
2r0100111111110010
|
|
695 |
2r1011111111111101
|
|
696 |
2r1111111111111111)
|
|
697 |
maskArray: #(
|
|
698 |
2r1111111111111111
|
|
699 |
2r1111111111111111
|
|
700 |
2r1111111111111111
|
|
701 |
2r0111111111111110
|
|
702 |
2r0011111111111100
|
|
703 |
2r0001111111111000
|
|
704 |
2r0000111111110000
|
|
705 |
2r0000011111100000
|
|
706 |
2r0000011111100000
|
|
707 |
2r0000111111110000
|
|
708 |
2r0001111111111000
|
|
709 |
2r0011111111111100
|
|
710 |
2r0111111111111110
|
|
711 |
2r1111111111111111
|
|
712 |
2r1111111111111111
|
|
713 |
2r1111111111111111)
|
|
714 |
offset: -8@-8).
|
151
|
715 |
|
577
|
716 |
BlankCursor := Cursor new.
|
|
717 |
|
|
718 |
"original from SMACK:"
|
|
719 |
|
|
720 |
"/ XeqCursor :=
|
|
721 |
"/ (Cursor
|
|
722 |
"/ extent: 16@16
|
|
723 |
"/ fromArray: #(
|
|
724 |
"/ 2r1000000000010000
|
|
725 |
"/ 2r1100000000010000
|
|
726 |
"/ 2r1110000000111000
|
|
727 |
"/ 2r1111000111111111
|
|
728 |
"/ 2r1111100011000110
|
|
729 |
"/ 2r1111110001000100
|
|
730 |
"/ 2r1111111001111100
|
|
731 |
"/ 2r1111000001101100
|
|
732 |
"/ 2r1101100011000110
|
|
733 |
"/ 2r1001100010000010
|
|
734 |
"/ 2r0000110000000000
|
|
735 |
"/ 2r0000110000000000
|
|
736 |
"/ 2r0000011000000000
|
|
737 |
"/ 2r0000011000000000
|
|
738 |
"/ 2r0000001100000000
|
|
739 |
"/ 2r0000001100000000)
|
|
740 |
"/ offset: 0@0).
|
|
741 |
|
|
742 |
"claus: added mask"
|
151
|
743 |
|
577
|
744 |
XeqCursor :=
|
|
745 |
(Cursor
|
|
746 |
extent: 16@16
|
|
747 |
sourceArray: #(
|
|
748 |
2r1000000000010000
|
|
749 |
2r1100000000010000
|
|
750 |
2r1110000000111000
|
|
751 |
2r1111000111111111
|
|
752 |
2r1111100011000110
|
|
753 |
2r1111110001000100
|
|
754 |
2r1111111001111100
|
|
755 |
2r1111000001101100
|
|
756 |
2r1101100011000110
|
|
757 |
2r1001100010000010
|
|
758 |
2r0000110000000000
|
|
759 |
2r0000110000000000
|
|
760 |
2r0000011000000000
|
|
761 |
2r0000011000000000
|
|
762 |
2r0000001100000000
|
|
763 |
2r0000001100000000)
|
|
764 |
maskArray: #(
|
|
765 |
2r1100000000111000
|
|
766 |
2r1110000000111000
|
|
767 |
2r1111000111111111
|
|
768 |
2r1111100111111111
|
|
769 |
2r1111110011111111
|
|
770 |
2r1111111001111110
|
|
771 |
2r1111111101111100
|
|
772 |
2r1111100001111110
|
|
773 |
2r1101110011100111
|
|
774 |
2r1001110011000010
|
|
775 |
2r0000111000000000
|
|
776 |
2r0000111000000000
|
|
777 |
2r0000011100000000
|
|
778 |
2r0000011100000000
|
|
779 |
2r0000001110000000
|
|
780 |
2r0000001110000000)
|
|
781 |
offset: 0@0).
|
|
782 |
|
|
783 |
"claus: already there in ST/X"
|
|
784 |
|
|
785 |
"/ SquareCursor :=
|
|
786 |
"/ (Cursor
|
|
787 |
"/ extent: 16@16
|
|
788 |
"/ fromArray: #(
|
|
789 |
"/ 2r0000000000000000
|
|
790 |
"/ 2r0000000000000000
|
|
791 |
"/ 2r0000000000000000
|
|
792 |
"/ 2r0000000000000000
|
|
793 |
"/ 2r0000000000000000
|
|
794 |
"/ 2r0000001111000000
|
|
795 |
"/ 2r0000001111000000
|
|
796 |
"/ 2r0000001111000000
|
|
797 |
"/ 2r0000001111000000
|
|
798 |
"/ 2r0000000000000000
|
|
799 |
"/ 2r0000000000000000
|
|
800 |
"/ 2r0000000000000000
|
|
801 |
"/ 2r0000000000000000
|
|
802 |
"/ 2r0000000000000000
|
|
803 |
"/ 2r0000000000000000
|
|
804 |
"/ 2r0000000000000000)
|
|
805 |
"/ offset: -8@-8).
|
|
806 |
|
|
807 |
|
|
808 |
"original from SMACK:"
|
151
|
809 |
|
577
|
810 |
"/ NormalCursor :=
|
|
811 |
"/ (Cursor
|
|
812 |
"/ extent: 16@16
|
|
813 |
"/ fromArray: #(
|
|
814 |
"/ 2r1000000000000000
|
|
815 |
"/ 2r1100000000000000
|
|
816 |
"/ 2r1110000000000000
|
|
817 |
"/ 2r1111000000000000
|
|
818 |
"/ 2r1111100000000000
|
|
819 |
"/ 2r1111110000000000
|
|
820 |
"/ 2r1111111000000000
|
|
821 |
"/ 2r1111100000000000
|
|
822 |
"/ 2r1111100000000000
|
|
823 |
"/ 2r1001100000000000
|
|
824 |
"/ 2r0000110000000000
|
|
825 |
"/ 2r0000110000000000
|
|
826 |
"/ 2r0000011000000000
|
|
827 |
"/ 2r0000011000000000
|
|
828 |
"/ 2r0000001100000000
|
|
829 |
"/ 2r0000001100000000)
|
|
830 |
"/ offset: 0@0).
|
|
831 |
|
|
832 |
"claus: added mask"
|
|
833 |
|
|
834 |
NormalCursor :=
|
|
835 |
(Cursor
|
|
836 |
extent: 16@16
|
|
837 |
sourceArray: #(
|
|
838 |
2r1000000000000000
|
|
839 |
2r1100000000000000
|
|
840 |
2r1110000000000000
|
|
841 |
2r1111000000000000
|
|
842 |
2r1111100000000000
|
|
843 |
2r1111110000000000
|
|
844 |
2r1111111000000000
|
|
845 |
2r1111100000000000
|
|
846 |
2r1111100000000000
|
|
847 |
2r1001100000000000
|
|
848 |
2r0000110000000000
|
|
849 |
2r0000110000000000
|
|
850 |
2r0000011000000000
|
|
851 |
2r0000011000000000
|
|
852 |
2r0000001100000000
|
|
853 |
2r0000001100000000)
|
|
854 |
maskArray: #(
|
|
855 |
2r1100000000000000
|
|
856 |
2r1110000000000000
|
|
857 |
2r1111000000000000
|
|
858 |
2r1111100000000000
|
|
859 |
2r1111110000000000
|
|
860 |
2r1111111000000000
|
|
861 |
2r1111111100000000
|
|
862 |
2r1111110000000000
|
|
863 |
2r1111110000000000
|
|
864 |
2r1001110000000000
|
|
865 |
2r0000111000000000
|
|
866 |
2r0000111000000000
|
|
867 |
2r0000011100000000
|
|
868 |
2r0000011100000000
|
|
869 |
2r0000001110000000
|
|
870 |
2r0000001110000000)
|
|
871 |
offset: 0@0).
|
|
872 |
|
|
873 |
"original from SMACK:"
|
|
874 |
|
|
875 |
"/ CrossHairCursor :=
|
|
876 |
"/ (Cursor
|
|
877 |
"/ extent: 16@16
|
|
878 |
"/ fromArray: #(
|
|
879 |
"/ 2r0000000100000000
|
|
880 |
"/ 2r0000000100000000
|
|
881 |
"/ 2r0000000100000000
|
|
882 |
"/ 2r0000000100000000
|
|
883 |
"/ 2r0000000100000000
|
|
884 |
"/ 2r0000000100000000
|
|
885 |
"/ 2r0000000100000000
|
|
886 |
"/ 2r1111111111111110
|
|
887 |
"/ 2r0000000100000000
|
|
888 |
"/ 2r0000000100000000
|
|
889 |
"/ 2r0000000100000000
|
|
890 |
"/ 2r0000000100000000
|
|
891 |
"/ 2r0000000100000000
|
|
892 |
"/ 2r0000000100000000
|
|
893 |
"/ 2r0000000100000000
|
|
894 |
"/ 2r0)
|
|
895 |
"/ offset: -7@-7).
|
|
896 |
|
|
897 |
"claus: added mask"
|
151
|
898 |
|
577
|
899 |
"no: already there in ST/X"
|
|
900 |
|
|
901 |
"/ CrossHairCursor :=
|
|
902 |
"/ (Cursor
|
|
903 |
"/ extent: 16@16
|
|
904 |
"/ sourceArray: #(
|
|
905 |
"/ 2r0000000100000000
|
|
906 |
"/ 2r0000000100000000
|
|
907 |
"/ 2r0000000100000000
|
|
908 |
"/ 2r0000000100000000
|
|
909 |
"/ 2r0000000100000000
|
|
910 |
"/ 2r0000000100000000
|
|
911 |
"/ 2r0000000100000000
|
|
912 |
"/ 2r1111111111111110
|
|
913 |
"/ 2r0000000100000000
|
|
914 |
"/ 2r0000000100000000
|
|
915 |
"/ 2r0000000100000000
|
|
916 |
"/ 2r0000000100000000
|
|
917 |
"/ 2r0000000100000000
|
|
918 |
"/ 2r0000000100000000
|
|
919 |
"/ 2r0000000100000000
|
|
920 |
"/ 2r0)
|
|
921 |
"/ maskArray: #(
|
|
922 |
"/ 2r0000000110000000
|
|
923 |
"/ 2r0000000110000000
|
|
924 |
"/ 2r0000000110000000
|
|
925 |
"/ 2r0000000110000000
|
|
926 |
"/ 2r0000000110000000
|
|
927 |
"/ 2r0000000110000000
|
|
928 |
"/ 2r0000000110000000
|
|
929 |
"/ 2r1111111111111110
|
|
930 |
"/ 2r1111111111111110
|
|
931 |
"/ 2r0000000110000000
|
|
932 |
"/ 2r0000000110000000
|
|
933 |
"/ 2r0000000110000000
|
|
934 |
"/ 2r0000000110000000
|
|
935 |
"/ 2r0000000110000000
|
|
936 |
"/ 2r0000000110000000
|
|
937 |
"/ 2r0)
|
|
938 |
"/ offset: -7@-7).
|
|
939 |
|
|
940 |
MarkerCursor :=
|
|
941 |
Cursor
|
|
942 |
extent: 16@16
|
|
943 |
fromArray: #(
|
|
944 |
2r0000000000000000
|
|
945 |
2r0000000000000000
|
|
946 |
2r0000000000000000
|
|
947 |
2r0000001000000000
|
|
948 |
2r0000001110000000
|
|
949 |
2r0000001111100000
|
|
950 |
2r1111111111111000
|
|
951 |
2r1111111111111110
|
|
952 |
2r1111111111111000
|
|
953 |
2r0000001111100000
|
|
954 |
2r0000001110000000
|
|
955 |
2r0000001000000000
|
|
956 |
2r0000000000000000
|
|
957 |
2r0000000000000000
|
|
958 |
2r0000000000000000
|
|
959 |
2r0000000000000000)
|
|
960 |
offset: -7@-7.
|
151
|
961 |
|
577
|
962 |
UpCursor :=
|
|
963 |
Cursor
|
|
964 |
extent: 16@16
|
|
965 |
fromArray: #(
|
|
966 |
2r1000000000000000
|
|
967 |
2r1100000000000000
|
|
968 |
2r1110000000000000
|
|
969 |
2r1111000000000000
|
|
970 |
2r1111100000000000
|
|
971 |
2r1111110000000000
|
|
972 |
2r1100000000000000
|
|
973 |
2r1100000000000000
|
|
974 |
2r1100000000000000
|
|
975 |
2r1100000000000000
|
|
976 |
2r1100000000000000
|
|
977 |
2r1100000000000000
|
|
978 |
2r1100000000000000
|
|
979 |
2r1100000000000000
|
|
980 |
2r1100000000000000
|
|
981 |
2r1100000000000000)
|
|
982 |
offset: 0@-7.
|
|
983 |
|
|
984 |
DownCursor :=
|
|
985 |
Cursor
|
|
986 |
extent: 16@16
|
|
987 |
fromArray: #(
|
|
988 |
2r0000110000000000
|
|
989 |
2r0000110000000000
|
|
990 |
2r0000110000000000
|
|
991 |
2r0000110000000000
|
|
992 |
2r0000110000000000
|
|
993 |
2r0000110000000000
|
|
994 |
2r0000110000000000
|
|
995 |
2r0000110000000000
|
|
996 |
2r0000110000000000
|
|
997 |
2r0000110000000000
|
|
998 |
2r1111110000000000
|
|
999 |
2r0111110000000000
|
|
1000 |
2r0011110000000000
|
|
1001 |
2r0001110000000000
|
|
1002 |
2r0000110000000000
|
|
1003 |
2r0000010000000000)
|
|
1004 |
offset: -5@-7.
|
|
1005 |
|
|
1006 |
LeftCursor :=
|
|
1007 |
Cursor
|
|
1008 |
extent: 16@16
|
|
1009 |
fromArray: #(
|
|
1010 |
2r1111111111111111
|
|
1011 |
2r0111111111111111
|
|
1012 |
2r0011110000000000
|
|
1013 |
2r0001110000000000
|
|
1014 |
2r0000110000000000
|
|
1015 |
2r0000010000000000
|
151
|
1016 |
2r0000000000000000
|
577
|
1017 |
2r0000000000000000
|
|
1018 |
2r0000000000000000
|
|
1019 |
2r0000000000000000
|
|
1020 |
2r0000000000000000
|
|
1021 |
2r0000000000000000
|
|
1022 |
2r0000000000000000
|
|
1023 |
2r0000000000000000
|
|
1024 |
2r0000000000000000
|
|
1025 |
2r0000000000000000)
|
|
1026 |
offset: -7@0.
|
|
1027 |
|
|
1028 |
RightCursor :=
|
|
1029 |
Cursor
|
|
1030 |
extent: 16@16
|
|
1031 |
fromArray: #(
|
|
1032 |
2r0000000000100000
|
|
1033 |
2r0000000000110000
|
|
1034 |
2r0000000000111000
|
|
1035 |
2r0000000000111100
|
|
1036 |
2r1111111111111110
|
|
1037 |
2r1111111111111111
|
|
1038 |
2r0000000000000000
|
|
1039 |
2r0000000000000000
|
|
1040 |
2r0000000000000000
|
|
1041 |
2r0000000000000000
|
|
1042 |
2r0000000000000000
|
|
1043 |
2r0000000000000000
|
|
1044 |
2r0000000000000000
|
|
1045 |
2r0000000000000000
|
|
1046 |
2r0000000000000000
|
|
1047 |
2r0000000000000000)
|
|
1048 |
offset: -7@-5.
|
|
1049 |
XMarkerCursor :=
|
|
1050 |
Cursor
|
|
1051 |
extent: 16@16
|
|
1052 |
fromArray: #(
|
|
1053 |
2r0
|
151
|
1054 |
2r0000000100000000
|
|
1055 |
2r0000000100000000
|
577
|
1056 |
2r0000001110000000
|
151
|
1057 |
2r0000001110000000
|
577
|
1058 |
2r0000011111000000
|
|
1059 |
2r0000011111000000
|
|
1060 |
2r0000111111100000
|
|
1061 |
2r0000111111100000
|
|
1062 |
2r0001111111110000
|
151
|
1063 |
2r0000001110000000
|
|
1064 |
2r0000001110000000
|
|
1065 |
2r0000001110000000
|
|
1066 |
2r0000001110000000
|
|
1067 |
2r0000001110000000
|
|
1068 |
2r0000001110000000)
|
577
|
1069 |
offset: -7@-7.
|
|
1070 |
|
|
1071 |
"original from SMACK:"
|
151
|
1072 |
|
577
|
1073 |
"/ FourWayCursor :=
|
|
1074 |
"/ Cursor
|
|
1075 |
"/ extent: 16@16
|
|
1076 |
"/ fromArray: #(
|
|
1077 |
"/ 2r0000000100000000
|
|
1078 |
"/ 2r0000001110000000
|
|
1079 |
"/ 2r0000011111000000
|
|
1080 |
"/ 2r0000111111100000
|
|
1081 |
"/ 2r0001001110010000
|
|
1082 |
"/ 2r0011001110011000
|
|
1083 |
"/ 2r0111111111111100
|
|
1084 |
"/ 2r1111111111111110
|
|
1085 |
"/ 2r0111111111111100
|
|
1086 |
"/ 2r0011001110011000
|
|
1087 |
"/ 2r0001001110010000
|
|
1088 |
"/ 2r0000111111100000
|
|
1089 |
"/ 2r0000011111000000
|
|
1090 |
"/ 2r0000001110000000
|
|
1091 |
"/ 2r0000000100000000
|
|
1092 |
"/ 2r0000000000000000)
|
|
1093 |
"/ offset: -7@-7.
|
|
1094 |
"/
|
151
|
1095 |
|
577
|
1096 |
"claus: added mask"
|
0
|
1097 |
|
577
|
1098 |
FourWayCursor :=
|
|
1099 |
Cursor
|
|
1100 |
extent: 16@16
|
|
1101 |
sourceArray: #(
|
|
1102 |
2r0000000100000000
|
|
1103 |
2r0000001110000000
|
|
1104 |
2r0000011111000000
|
|
1105 |
2r0000111111100000
|
|
1106 |
2r0001001110010000
|
|
1107 |
2r0011001110011000
|
|
1108 |
2r0111111111111100
|
|
1109 |
2r1111111111111110
|
|
1110 |
2r0111111111111100
|
|
1111 |
2r0011001110011000
|
|
1112 |
2r0001001110010000
|
|
1113 |
2r0000111111100000
|
|
1114 |
2r0000011111000000
|
|
1115 |
2r0000001110000000
|
|
1116 |
2r0000000100000000
|
|
1117 |
2r0000000000000000)
|
|
1118 |
maskArray: #(
|
|
1119 |
2r0000001110000000
|
|
1120 |
2r0000011111000000
|
|
1121 |
2r0000111111100000
|
|
1122 |
2r0001111111110000
|
|
1123 |
2r0010111111101000
|
|
1124 |
2r0111111111111100
|
|
1125 |
2r1111111111111110
|
|
1126 |
2r1111111111111110
|
|
1127 |
2r1111111111111110
|
|
1128 |
2r0111111111111100
|
|
1129 |
2r0010111111101000
|
|
1130 |
2r0001111111110000
|
|
1131 |
2r0000111111100000
|
|
1132 |
2r0000011111000000
|
|
1133 |
2r0000001110000000
|
|
1134 |
2r0000000000000000)
|
|
1135 |
offset: -7@-7.
|
0
|
1136 |
|
577
|
1137 |
ThumbsUpCursor := (Cursor
|
|
1138 |
extent: 16@16
|
|
1139 |
sourceArray: #(
|
|
1140 |
2r0000000000100000
|
|
1141 |
2r0000000001010000
|
|
1142 |
2r0000000010010000
|
|
1143 |
2r0000000011110000
|
|
1144 |
2r0000000100010000
|
|
1145 |
2r0000000100010000
|
|
1146 |
2r0001111100011000
|
|
1147 |
2r0010000100000110
|
|
1148 |
2r0100000000000000
|
|
1149 |
2r0111111000000000
|
|
1150 |
2r0100000000000000
|
|
1151 |
2r0111111000000000
|
|
1152 |
2r0100000000000000
|
|
1153 |
2r0011111000001110
|
|
1154 |
2r0001000000010000
|
|
1155 |
2r0001111111100000)
|
|
1156 |
maskArray: #(
|
|
1157 |
2r0000000000100000
|
|
1158 |
2r0000000001110000
|
|
1159 |
2r0000000011110000
|
|
1160 |
2r0000000011110000
|
|
1161 |
2r0000000111110000
|
|
1162 |
2r0000000111110000
|
|
1163 |
2r0001111111111000
|
|
1164 |
2r0011111111111110
|
|
1165 |
2r0111111111111110
|
|
1166 |
2r0111111111111110
|
|
1167 |
2r0111111111111110
|
|
1168 |
2r0111111111111110
|
|
1169 |
2r0111111111111110
|
|
1170 |
2r0011111111111110
|
|
1171 |
2r0001111111110000
|
|
1172 |
2r0001111111100000)
|
|
1173 |
offset: -8@-8).
|
71
|
1174 |
|
577
|
1175 |
CaretCursor := (Cursor
|
|
1176 |
extent: 16@16
|
|
1177 |
fromArray: #(
|
|
1178 |
2r0000000110000000
|
|
1179 |
2r0000000110000000
|
|
1180 |
2r0000001111000000
|
|
1181 |
2r0000011111100000
|
|
1182 |
2r0000011001100000
|
|
1183 |
2r0000000000000000
|
|
1184 |
2r0000000000000000
|
|
1185 |
2r0000000000000000
|
|
1186 |
2r0000000000000000
|
|
1187 |
2r0000000000000000
|
|
1188 |
2r0000000000000000
|
|
1189 |
2r0000000000000000
|
|
1190 |
2r0000000000000000
|
|
1191 |
2r0000000000000000
|
|
1192 |
2r0000000000000000
|
|
1193 |
2r0000000000000000)
|
|
1194 |
offset: -8@0).
|
71
|
1195 |
|
577
|
1196 |
ThumbsDownCursor := (Cursor
|
|
1197 |
extent: 16@16
|
|
1198 |
sourceArray: #(
|
|
1199 |
2r0001111111100000
|
|
1200 |
2r0001000000010000
|
|
1201 |
2r0011111000001110
|
|
1202 |
2r0100000000000000
|
|
1203 |
2r0111111000000000
|
|
1204 |
2r0100000000000000
|
|
1205 |
2r0111111000000000
|
|
1206 |
2r0100000000000000
|
|
1207 |
2r0010000100000110
|
|
1208 |
2r0001111100011000
|
|
1209 |
2r0000000100010000
|
|
1210 |
2r0000000100010000
|
|
1211 |
2r0000000011110000
|
|
1212 |
2r0000000010010000
|
|
1213 |
2r0000000001010000
|
|
1214 |
2r0000000000100000)
|
|
1215 |
|
|
1216 |
maskArray: #(
|
|
1217 |
2r0001111111100000
|
|
1218 |
2r0001111111110000
|
|
1219 |
2r0011111111111110
|
|
1220 |
2r0111111111111110
|
|
1221 |
2r0111111111111110
|
|
1222 |
2r0111111111111110
|
|
1223 |
2r0111111111111110
|
|
1224 |
2r0111111111111110
|
|
1225 |
2r0011111111111110
|
|
1226 |
2r0001111111111000
|
|
1227 |
2r0000000111110000
|
|
1228 |
2r0000000111110000
|
|
1229 |
2r0000000011110000
|
|
1230 |
2r0000000011110000
|
|
1231 |
2r0000000001110000
|
|
1232 |
2r0000000000100000)
|
|
1233 |
offset: -8@-8).
|
71
|
1234 |
|
577
|
1235 |
StopCursor := (Cursor
|
|
1236 |
extent: 16@16
|
|
1237 |
sourceArray: #(
|
|
1238 |
2r0000000000000000
|
|
1239 |
2r0000011111000000
|
|
1240 |
2r0001111111110000
|
|
1241 |
2r0011111111111000
|
|
1242 |
2r0011111111111000
|
|
1243 |
2r0111111111111100
|
|
1244 |
2r0111111111111100
|
|
1245 |
2r0100000000000100
|
|
1246 |
2r0100000000000100
|
|
1247 |
2r0111111111111100
|
|
1248 |
2r0111111111111100
|
|
1249 |
2r0011111111111000
|
|
1250 |
2r0011111111111000
|
|
1251 |
2r0001111111110000
|
|
1252 |
2r0000011111000000
|
|
1253 |
2r0000000000000000
|
|
1254 |
)
|
|
1255 |
maskArray: #(
|
|
1256 |
2r0000011111000000
|
|
1257 |
2r0001111111110000
|
|
1258 |
2r0011111111111000
|
|
1259 |
2r0111111111111100
|
|
1260 |
2r0111111111111100
|
|
1261 |
2r1111111111111110
|
|
1262 |
2r1111111111111110
|
|
1263 |
2r1111111111111110
|
|
1264 |
2r1111111111111110
|
|
1265 |
2r1111111111111110
|
|
1266 |
2r1111111111111110
|
|
1267 |
2r0111111111111100
|
|
1268 |
2r0111111111111100
|
|
1269 |
2r0011111111111000
|
|
1270 |
2r0001111111110000
|
|
1271 |
2r0000011111000000
|
|
1272 |
)
|
601
|
1273 |
offset: -8 @-8).
|
71
|
1274 |
|
577
|
1275 |
EyeCursor := (Cursor
|
|
1276 |
extent: 16@16
|
|
1277 |
sourceArray: #(
|
|
1278 |
2r0000000000000000
|
|
1279 |
2r0000000000000000
|
|
1280 |
2r0000000000000000
|
|
1281 |
2r0000011111000000
|
|
1282 |
2r0001111111110000
|
|
1283 |
2r0011000000011000
|
|
1284 |
2r0110001110001100
|
|
1285 |
2r1100011111000110
|
|
1286 |
2r1100011111000110
|
|
1287 |
2r0110001110001100
|
|
1288 |
2r0011000000011000
|
|
1289 |
2r0001111111110000
|
|
1290 |
2r0000011111000000
|
|
1291 |
2r0000000000000000
|
|
1292 |
2r0000000000000000
|
|
1293 |
2r0000000000000000
|
|
1294 |
)
|
|
1295 |
maskArray: #(
|
|
1296 |
2r0000000000000000
|
|
1297 |
2r0000000000000000
|
|
1298 |
2r0000000000000000
|
|
1299 |
2r0000011111000000
|
|
1300 |
2r0001111111110000
|
|
1301 |
2r0011111111111000
|
|
1302 |
2r0111111111111100
|
|
1303 |
2r1111111111111110
|
|
1304 |
2r1111111111111110
|
|
1305 |
2r0111111111111100
|
|
1306 |
2r0011111111111000
|
|
1307 |
2r0001111111110000
|
|
1308 |
2r0000011111000000
|
|
1309 |
2r0000000000000000
|
|
1310 |
2r0000000000000000
|
|
1311 |
2r0000000000000000
|
|
1312 |
)
|
601
|
1313 |
offset: -8 @-8).
|
71
|
1314 |
|
577
|
1315 |
device := Display.
|
0
|
1316 |
|
577
|
1317 |
FourWayCursor := FourWayCursor on:device.
|
|
1318 |
LeftCursor := LeftCursor on:device.
|
|
1319 |
RightCursor := RightCursor on:device.
|
|
1320 |
XMarkerCursor := XMarkerCursor on:device.
|
|
1321 |
|
|
1322 |
"/ OriginCursor := OriginCursor on:device.
|
|
1323 |
"/ CornerCursor := CornerCursor on:device.
|
|
1324 |
|
|
1325 |
ReadCursor := ReadCursor on:device.
|
|
1326 |
WriteCursor := WriteCursor on:device.
|
|
1327 |
WaitCursor := WaitCursor on:device.
|
|
1328 |
XeqCursor := XeqCursor on:device.
|
|
1329 |
|
|
1330 |
"/ SquareCursor := SquareCursor on:device.
|
|
1331 |
|
|
1332 |
NormalCursor := NormalCursor on:device.
|
|
1333 |
|
|
1334 |
"/ CrossHairCursor := CrossHairCursor on:device.
|
0
|
1335 |
|
577
|
1336 |
MarkerCursor := MarkerCursor on:device.
|
|
1337 |
UpCursor := UpCursor on:device.
|
|
1338 |
DownCursor := DownCursor on:device.
|
|
1339 |
LeftCursor := LeftCursor on:device.
|
|
1340 |
RightCursor := RightCursor on:device.
|
|
1341 |
XMarkerCursor := XMarkerCursor on:device.
|
|
1342 |
CaretCursor := CaretCursor on:device.
|
|
1343 |
|
|
1344 |
ThumbsUpCursor := ThumbsUpCursor on:device.
|
|
1345 |
ThumbsDownCursor := ThumbsDownCursor on:device.
|
|
1346 |
StopCursor := StopCursor on:device.
|
|
1347 |
EyeCursor := EyeCursor on:device.
|
|
1348 |
|
|
1349 |
"Cursor initializeNewCursors"
|
|
1350 |
! !
|
|
1351 |
|
|
1352 |
!Cursor class methodsFor:'default access'!
|
|
1353 |
|
|
1354 |
defaultFgColor:fgColor defaultBgColor:bgColor
|
|
1355 |
"set the default colors used for cursors"
|
|
1356 |
|
|
1357 |
DefaultFgColor := fgColor.
|
|
1358 |
DefaultBgColor := bgColor
|
0
|
1359 |
! !
|
|
1360 |
|
|
1361 |
!Cursor class methodsFor:'standard cursors'!
|
|
1362 |
|
|
1363 |
arrow
|
|
1364 |
"return an arrow (up-left-arrow) cursor"
|
|
1365 |
|
71
|
1366 |
^ self shape:#upLeftArrow on:Display
|
0
|
1367 |
!
|
|
1368 |
|
577
|
1369 |
blank
|
|
1370 |
"Answer the instance of me that is an invisible cursor."
|
0
|
1371 |
|
577
|
1372 |
^BlankCursor!
|
80
|
1373 |
|
|
1374 |
bottomLeft
|
|
1375 |
"return a bottom-left corner cursor"
|
|
1376 |
|
|
1377 |
^ self shape:#bottomLeft on:Display
|
|
1378 |
!
|
|
1379 |
|
|
1380 |
bottomRight
|
|
1381 |
"return a bottom-right corner cursor"
|
|
1382 |
|
|
1383 |
^ self corner
|
|
1384 |
!
|
|
1385 |
|
577
|
1386 |
caret
|
|
1387 |
"return a caret cursor"
|
|
1388 |
|
|
1389 |
^ CaretCursor!
|
|
1390 |
|
|
1391 |
corner
|
|
1392 |
"return a corner cursor"
|
80
|
1393 |
|
577
|
1394 |
CornerCursor isNil ifTrue:[
|
|
1395 |
CornerCursor := self shape:#corner on:Display
|
|
1396 |
].
|
|
1397 |
^ CornerCursor
|
|
1398 |
!
|
|
1399 |
|
|
1400 |
cross
|
|
1401 |
"return a cross cursor"
|
|
1402 |
|
|
1403 |
^ self shape:#cross on:Display
|
80
|
1404 |
!
|
|
1405 |
|
0
|
1406 |
crossHair
|
|
1407 |
"return a crossHair cursor"
|
|
1408 |
|
|
1409 |
CrossHairCursor isNil ifTrue:[
|
80
|
1410 |
CrossHairCursor := self shape:#crossHair on:Display
|
0
|
1411 |
].
|
|
1412 |
^ CrossHairCursor
|
|
1413 |
!
|
|
1414 |
|
577
|
1415 |
down
|
|
1416 |
"Answer the instance of me that is the shape of a down-arrow."
|
0
|
1417 |
|
577
|
1418 |
^DownCursor!
|
0
|
1419 |
|
577
|
1420 |
downLimitArrow
|
|
1421 |
"return a down-arrow-to-limit cursor"
|
0
|
1422 |
|
577
|
1423 |
^ self shape:#downLimitArrow on:Display
|
0
|
1424 |
!
|
|
1425 |
|
|
1426 |
execute
|
157
|
1427 |
"return a execute cursor - (the default here is a wait-cursor)"
|
0
|
1428 |
|
157
|
1429 |
XeqCursor notNil ifTrue:[
|
|
1430 |
^ XeqCursor
|
|
1431 |
].
|
71
|
1432 |
^ self wait
|
56
|
1433 |
!
|
|
1434 |
|
577
|
1435 |
eye
|
|
1436 |
"return an eye cursor"
|
|
1437 |
|
|
1438 |
^ EyeCursor
|
|
1439 |
!
|
|
1440 |
|
|
1441 |
fourWay
|
|
1442 |
"return a four-way arrow cursor"
|
|
1443 |
|
|
1444 |
FourWayCursor isNil ifTrue:[
|
|
1445 |
FourWayCursor := self shape:#fourWay on:Display
|
|
1446 |
].
|
|
1447 |
^ FourWayCursor
|
|
1448 |
!
|
|
1449 |
|
|
1450 |
hand
|
|
1451 |
"return a hand cursor"
|
|
1452 |
|
|
1453 |
HandCursor isNil ifTrue:[
|
|
1454 |
HandCursor := self shape:#upRightHand on:Display
|
|
1455 |
].
|
|
1456 |
^ HandCursor
|
|
1457 |
!
|
|
1458 |
|
|
1459 |
left
|
|
1460 |
"Answer the instance of me that is the shape of an arrow facing to the left."
|
|
1461 |
|
|
1462 |
^LeftCursor!
|
|
1463 |
|
|
1464 |
leftHand
|
|
1465 |
"return a left-hand cursor"
|
|
1466 |
|
|
1467 |
^ self shape:#leftHand
|
|
1468 |
!
|
|
1469 |
|
|
1470 |
leftLimitArrow
|
|
1471 |
"return a left-arrow-to-limit cursor"
|
|
1472 |
|
|
1473 |
^ self shape:#leftLimitArrow on:Display
|
|
1474 |
!
|
|
1475 |
|
|
1476 |
leftRightArrow
|
|
1477 |
"return a left-right-arrow cursor"
|
|
1478 |
|
|
1479 |
LeftRightArrowCursor isNil ifTrue:[
|
|
1480 |
LeftRightArrowCursor := self shape:#leftRightArrow on:Display
|
|
1481 |
].
|
|
1482 |
^ LeftRightArrowCursor
|
|
1483 |
!
|
|
1484 |
|
|
1485 |
marker
|
|
1486 |
"Answer the instance of me that is the shape of a horizontal arrow."
|
|
1487 |
|
|
1488 |
^MarkerCursor!
|
56
|
1489 |
|
577
|
1490 |
normal
|
|
1491 |
"return the normal cursor; an arrow.
|
|
1492 |
for ST-80 compatibility"
|
|
1493 |
|
|
1494 |
NormalCursor isNil ifTrue:[
|
|
1495 |
NormalCursor := self arrow on:Display
|
|
1496 |
].
|
|
1497 |
^ NormalCursor
|
|
1498 |
!
|
|
1499 |
|
|
1500 |
origin
|
|
1501 |
"return an origin cursor"
|
|
1502 |
|
|
1503 |
OriginCursor isNil ifTrue:[
|
|
1504 |
OriginCursor := self shape:#origin on:Display
|
157
|
1505 |
].
|
577
|
1506 |
^ OriginCursor
|
|
1507 |
!
|
|
1508 |
|
|
1509 |
questionMark
|
|
1510 |
"return a question-mark cursor"
|
|
1511 |
|
|
1512 |
^ self shape:#questionMark on:Display
|
|
1513 |
!
|
|
1514 |
|
|
1515 |
read
|
|
1516 |
"return a reading-file cursor (the default here is a wait-cursor)"
|
|
1517 |
|
|
1518 |
ReadCursor notNil ifTrue:[
|
|
1519 |
^ ReadCursor
|
|
1520 |
].
|
|
1521 |
^ self wait
|
|
1522 |
!
|
|
1523 |
|
|
1524 |
right
|
|
1525 |
"Answer the instance of me that is the shape of an arrow facing to the right."
|
|
1526 |
|
|
1527 |
^RightCursor!
|
|
1528 |
|
|
1529 |
rightLimitArrowOn
|
|
1530 |
"return a right-arrow-to-limit cursor"
|
|
1531 |
|
|
1532 |
^ self shape:#rightLimitArrow on:Display
|
|
1533 |
!
|
|
1534 |
|
|
1535 |
stop
|
|
1536 |
"return a stop cursor (the default here is a wait-cursor)"
|
|
1537 |
|
|
1538 |
StopCursor notNil ifTrue:[
|
|
1539 |
^ StopCursor
|
|
1540 |
].
|
|
1541 |
^ self wait
|
|
1542 |
!
|
|
1543 |
|
|
1544 |
text
|
|
1545 |
"return a text-cursor"
|
|
1546 |
|
|
1547 |
^ self shape:#text on:Display
|
56
|
1548 |
!
|
|
1549 |
|
|
1550 |
thumbsDown
|
|
1551 |
"return a hand cursor - ST-80 compatibility"
|
|
1552 |
|
157
|
1553 |
ThumbsDownCursor notNil ifTrue:[
|
|
1554 |
^ ThumbsDownCursor
|
|
1555 |
].
|
56
|
1556 |
^ self hand
|
577
|
1557 |
!
|
|
1558 |
|
|
1559 |
thumbsUp
|
|
1560 |
"return a hand cursor - ST-80 compatibility"
|
|
1561 |
|
|
1562 |
ThumbsUpCursor notNil ifTrue:[
|
|
1563 |
^ ThumbsUpCursor
|
|
1564 |
].
|
|
1565 |
^ self hand
|
|
1566 |
!
|
|
1567 |
|
|
1568 |
topLeft
|
|
1569 |
"return a top-left corner cursor"
|
0
|
1570 |
|
577
|
1571 |
^ self origin
|
|
1572 |
!
|
|
1573 |
|
|
1574 |
topRight
|
|
1575 |
"return a top-right corner cursor"
|
|
1576 |
|
|
1577 |
^ self shape:#topRight on:Display
|
|
1578 |
!
|
|
1579 |
|
|
1580 |
up
|
|
1581 |
"Answer the instance of me that is the shape of an up-arrow."
|
|
1582 |
|
|
1583 |
^UpCursor!
|
71
|
1584 |
|
577
|
1585 |
upDownArrow
|
|
1586 |
"return an up-down-arrow cursor"
|
|
1587 |
|
|
1588 |
UpDownArrowCursor isNil ifTrue:[
|
|
1589 |
UpDownArrowCursor := self shape:#upDownArrow on:Display
|
|
1590 |
].
|
|
1591 |
^ UpDownArrowCursor
|
|
1592 |
!
|
|
1593 |
|
|
1594 |
upLeftArrow
|
|
1595 |
"return an up-right-arrow cursor"
|
|
1596 |
|
|
1597 |
^ self shape:#upLeftArrow on:Display
|
|
1598 |
!
|
71
|
1599 |
|
577
|
1600 |
upLimitArrow
|
|
1601 |
"return an up-arrow-to-limit cursor"
|
|
1602 |
|
|
1603 |
^ self shape:#upLimitArrow on:Display
|
|
1604 |
!
|
0
|
1605 |
|
577
|
1606 |
upRightArrow
|
|
1607 |
"return an up-right-arrow cursor"
|
|
1608 |
|
|
1609 |
^ self shape:#upRightArrow on:Display
|
|
1610 |
!
|
|
1611 |
|
|
1612 |
upRightHand
|
|
1613 |
"return an up-right-hand cursor"
|
|
1614 |
|
|
1615 |
^ self shape:#upRightHand
|
71
|
1616 |
!
|
|
1617 |
|
577
|
1618 |
wait
|
|
1619 |
"return a wait cursor"
|
|
1620 |
|
|
1621 |
WaitCursor isNil ifTrue:[
|
|
1622 |
WaitCursor := self shape:#wait on:Display
|
|
1623 |
].
|
|
1624 |
^ WaitCursor
|
|
1625 |
!
|
|
1626 |
|
|
1627 |
write
|
|
1628 |
"return a writing-file cursor (the default here is a wait-cursor)"
|
0
|
1629 |
|
577
|
1630 |
WriteCursor notNil ifTrue:[
|
|
1631 |
^ WriteCursor
|
|
1632 |
].
|
|
1633 |
^ self wait
|
|
1634 |
!
|
|
1635 |
|
|
1636 |
xMarker
|
|
1637 |
"Answer the instance of me that is displayed when thumb-scrolling on the x-axis."
|
|
1638 |
|
|
1639 |
^XMarkerCursor! !
|
|
1640 |
|
|
1641 |
!Cursor methodsFor:'ST-80 displaying'!
|
|
1642 |
|
|
1643 |
displayOn:aGC at:origin clippingBox:aRectangle rule:aRule mask:aMask
|
|
1644 |
"ST-80 compatibility;
|
|
1645 |
limited functionality: can only display bitmap cursors (yet)"
|
|
1646 |
|
|
1647 |
sourceForm notNil ifTrue:[
|
|
1648 |
sourceForm displayOn:aGC at:origin clippingBox:aRectangle
|
|
1649 |
rule:aRule mask:aMask
|
0
|
1650 |
]
|
2
|
1651 |
!
|
|
1652 |
|
577
|
1653 |
show
|
|
1654 |
"ST-80 mimicri: change cursors in active groups views to the receiver."
|
2
|
1655 |
|
577
|
1656 |
WindowGroup activeGroup showCursor:self
|
|
1657 |
!
|
|
1658 |
|
|
1659 |
showIn:aView
|
|
1660 |
"ST-80 mimicri: install the receiver as aViews cursor"
|
|
1661 |
|
|
1662 |
aView cursor:self
|
2
|
1663 |
!
|
|
1664 |
|
577
|
1665 |
showIn:aView while:aBlock
|
|
1666 |
"ST-80 mimicri: change aViews cursors to the receiver, while evaluationg aBlock.
|
|
1667 |
Return the value as returned by aBlock."
|
|
1668 |
|
|
1669 |
|savedCursor|
|
|
1670 |
|
|
1671 |
savedCursor := aView cursor.
|
|
1672 |
aView cursor:self.
|
|
1673 |
^ aBlock valueNowOrOnUnwindDo:[aView cursor:savedCursor]
|
|
1674 |
!
|
2
|
1675 |
|
577
|
1676 |
showWhile:aBlock
|
|
1677 |
"ST-80 mimicri: change all views cursors to the receiver.
|
|
1678 |
Return the value as returned by aBlock."
|
|
1679 |
|
|
1680 |
^ WindowGroup activeGroup withCursor:self do:aBlock
|
|
1681 |
|
|
1682 |
"/ |v|
|
|
1683 |
"/
|
|
1684 |
"/ Display setCursors:self.
|
|
1685 |
"/ v := aBlock valueNowOrOnUnwindDo:[
|
|
1686 |
"/ Display restoreCursors.
|
|
1687 |
"/ ].
|
|
1688 |
"/ ^ v
|
2
|
1689 |
! !
|
|
1690 |
|
0
|
1691 |
!Cursor methodsFor:'accessing'!
|
|
1692 |
|
577
|
1693 |
device
|
|
1694 |
"return the device I am associated with"
|
|
1695 |
|
|
1696 |
^ device
|
|
1697 |
!
|
|
1698 |
|
|
1699 |
foreground:fgColor background:bgColor
|
|
1700 |
"set the cursor colors"
|
|
1701 |
|
|
1702 |
device colorCursor:cursorId foreground:fgColor background:bgColor
|
|
1703 |
!
|
|
1704 |
|
|
1705 |
hotX
|
|
1706 |
"return the hotspots x-coordinate of the receiver"
|
|
1707 |
|
|
1708 |
^ hotX
|
|
1709 |
!
|
|
1710 |
|
|
1711 |
hotY
|
|
1712 |
"return the hotspots y-coordinate of the receiver"
|
|
1713 |
|
|
1714 |
^ hotY
|
|
1715 |
!
|
|
1716 |
|
0
|
1717 |
id
|
|
1718 |
"return the cursors deviceId"
|
|
1719 |
|
|
1720 |
^ cursorId
|
|
1721 |
!
|
|
1722 |
|
577
|
1723 |
maskForm
|
|
1724 |
"return the mask-form of the receiver"
|
0
|
1725 |
|
577
|
1726 |
^ maskForm
|
|
1727 |
!
|
|
1728 |
|
|
1729 |
maskForm:aForm
|
|
1730 |
"set the mask-form of the receiver"
|
|
1731 |
|
|
1732 |
maskForm := aForm
|
0
|
1733 |
!
|
|
1734 |
|
|
1735 |
shape
|
|
1736 |
"return the shape"
|
|
1737 |
|
|
1738 |
^ shape
|
|
1739 |
!
|
|
1740 |
|
|
1741 |
sourceForm
|
|
1742 |
"return the source-form of the receiver"
|
|
1743 |
|
|
1744 |
^ sourceForm
|
|
1745 |
!
|
|
1746 |
|
|
1747 |
sourceForm:aForm
|
|
1748 |
"set the source-form of the receiver"
|
|
1749 |
|
|
1750 |
sourceForm := aForm
|
577
|
1751 |
! !
|
0
|
1752 |
|
577
|
1753 |
!Cursor methodsFor:'copying'!
|
0
|
1754 |
|
577
|
1755 |
postCopy
|
|
1756 |
sourceForm := sourceForm copy.
|
|
1757 |
maskForm := maskForm copy.
|
|
1758 |
device := cursorId := nil
|
0
|
1759 |
! !
|
|
1760 |
|
|
1761 |
!Cursor methodsFor:'creating a device cursor'!
|
|
1762 |
|
|
1763 |
on:aDevice
|
|
1764 |
"create a new Cursor representing the same cursor as
|
|
1765 |
myself on aDevice; if one already exists, return the one"
|
|
1766 |
|
|
1767 |
aDevice isNil ifTrue:[
|
80
|
1768 |
"this may not happen"
|
|
1769 |
self error:'nil device'
|
0
|
1770 |
].
|
|
1771 |
|
71
|
1772 |
"if I am already assigned to that device ..."
|
0
|
1773 |
(device == aDevice) ifTrue:[^ self].
|
|
1774 |
|
|
1775 |
"first look if not already there"
|
115
|
1776 |
Lobby do:[:aCursor |
|
80
|
1777 |
(aCursor device == aDevice) ifTrue:[
|
|
1778 |
shape notNil ifTrue:[
|
|
1779 |
(aCursor shape == shape) ifTrue:[
|
|
1780 |
^ aCursor
|
|
1781 |
]
|
|
1782 |
] ifFalse:[
|
|
1783 |
(aCursor sourceForm == sourceForm) ifTrue:[
|
|
1784 |
(aCursor maskForm == maskForm) ifTrue:[
|
|
1785 |
(aCursor hotX == hotX) ifTrue:[
|
|
1786 |
(aCursor hotY == hotY) ifTrue:[
|
|
1787 |
^ aCursor
|
|
1788 |
]
|
|
1789 |
]
|
|
1790 |
]
|
|
1791 |
]
|
|
1792 |
]
|
|
1793 |
]
|
0
|
1794 |
].
|
71
|
1795 |
^ self newOn:aDevice
|
|
1796 |
! !
|
|
1797 |
|
577
|
1798 |
!Cursor methodsFor:'instance release'!
|
|
1799 |
|
|
1800 |
disposed
|
|
1801 |
"some Cursor has been collected - tell it to the x-server"
|
|
1802 |
|
|
1803 |
cursorId notNil ifTrue:[
|
|
1804 |
device destroyCursor:cursorId.
|
|
1805 |
]
|
|
1806 |
!
|
|
1807 |
|
|
1808 |
shallowCopyForFinalization
|
|
1809 |
"redefined to return a lightweight copy
|
|
1810 |
- all we need is the device handle"
|
|
1811 |
|
|
1812 |
^ self class basicNew setDevice:device id:cursorId
|
|
1813 |
|
|
1814 |
"Modified: 20.4.1996 / 23:23:19 / cg"
|
|
1815 |
! !
|
|
1816 |
|
71
|
1817 |
!Cursor methodsFor:'private'!
|
|
1818 |
|
577
|
1819 |
device:aDevice
|
|
1820 |
device := aDevice
|
|
1821 |
!
|
|
1822 |
|
|
1823 |
id:anId
|
|
1824 |
"set the cursors deviceId"
|
|
1825 |
|
|
1826 |
cursorId := anId
|
|
1827 |
!
|
|
1828 |
|
71
|
1829 |
newOn:aDevice
|
|
1830 |
"create a new Cursor representing the same cursor as
|
|
1831 |
myself on aDevice. Dont search the lobby."
|
|
1832 |
|
133
|
1833 |
|newCursor id sF mF|
|
0
|
1834 |
|
|
1835 |
"ask that device for the cursor"
|
|
1836 |
shape notNil ifTrue:[
|
80
|
1837 |
id := aDevice createCursorShape:shape.
|
|
1838 |
id isNil ifTrue:[
|
145
|
1839 |
'CURSOR: no cursor with shape:' errorPrint. shape errorPrintNL.
|
363
|
1840 |
^ self
|
80
|
1841 |
].
|
0
|
1842 |
] ifFalse:[
|
133
|
1843 |
sourceForm notNil ifTrue:[
|
|
1844 |
sF := sourceForm on:aDevice.
|
|
1845 |
].
|
|
1846 |
maskForm notNil ifTrue:[
|
|
1847 |
mF := maskForm on:aDevice.
|
|
1848 |
].
|
|
1849 |
(sF isNil or:[mF isNil]) ifTrue:[
|
145
|
1850 |
'CURSOR: cursor has no form' errorPrintNL.
|
363
|
1851 |
^ self
|
133
|
1852 |
].
|
|
1853 |
sourceForm := sF.
|
|
1854 |
maskForm := mF.
|
|
1855 |
|
80
|
1856 |
id := aDevice createCursorSourceForm:sourceForm
|
|
1857 |
maskForm:maskForm
|
|
1858 |
hotX:hotX
|
|
1859 |
hotY:hotY.
|
|
1860 |
id isNil ifTrue:[
|
145
|
1861 |
'CURSOR: cannot create pixmap cursor' errorPrintNL.
|
363
|
1862 |
^ self
|
80
|
1863 |
].
|
0
|
1864 |
].
|
|
1865 |
|
|
1866 |
"goody for IRIXs red cursor"
|
|
1867 |
DefaultFgColor notNil ifTrue:[
|
80
|
1868 |
aDevice colorCursor:id foreground:DefaultFgColor
|
|
1869 |
background:DefaultBgColor
|
0
|
1870 |
].
|
|
1871 |
|
|
1872 |
device isNil ifTrue:[
|
80
|
1873 |
"receiver was not associated - do it now"
|
|
1874 |
device := aDevice.
|
|
1875 |
cursorId := id.
|
0
|
1876 |
|
80
|
1877 |
"must re-register, the old registration had a nil cursorId in it"
|
162
|
1878 |
Lobby registerChange:self.
|
80
|
1879 |
^ self
|
0
|
1880 |
].
|
|
1881 |
|
|
1882 |
"receiver was already associated to another device - need a new cursor"
|
2
|
1883 |
newCursor := self class basicNew.
|
0
|
1884 |
shape notNil ifTrue:[
|
80
|
1885 |
newCursor setShape:shape.
|
0
|
1886 |
] ifFalse:[
|
80
|
1887 |
newCursor setSourceForm:sourceForm
|
|
1888 |
maskForm:maskForm
|
|
1889 |
hotX:hotX
|
|
1890 |
hotY:hotY
|
0
|
1891 |
].
|
2
|
1892 |
newCursor setDevice:aDevice id:id.
|
23
|
1893 |
Lobby register:newCursor.
|
0
|
1894 |
^ newCursor
|
71
|
1895 |
!
|
0
|
1896 |
|
2
|
1897 |
restored
|
0
|
1898 |
"set both device and id"
|
|
1899 |
|
|
1900 |
device := nil.
|
|
1901 |
cursorId := nil
|
|
1902 |
! !
|
|
1903 |
|
577
|
1904 |
!Cursor methodsFor:'private accessing'!
|
0
|
1905 |
|
577
|
1906 |
setDevice:aDevice id:anId
|
|
1907 |
"set the device and deviceId of the receiver"
|
160
|
1908 |
|
577
|
1909 |
device := aDevice.
|
|
1910 |
cursorId := anId
|
0
|
1911 |
!
|
|
1912 |
|
577
|
1913 |
setShape:aShapeSymbol
|
|
1914 |
"set the shape"
|
160
|
1915 |
|
577
|
1916 |
shape := aShapeSymbol.
|
0
|
1917 |
!
|
|
1918 |
|
577
|
1919 |
setSourceForm:sForm maskForm:mForm hotX:hx hotY:hy
|
|
1920 |
"set the forms and hotspot"
|
0
|
1921 |
|
577
|
1922 |
sourceForm := sForm.
|
|
1923 |
maskForm := mForm.
|
|
1924 |
hotX := hx.
|
|
1925 |
hotY := hy.
|
|
1926 |
! !
|
157
|
1927 |
|
577
|
1928 |
!Cursor class methodsFor:'documentation'!
|
0
|
1929 |
|
577
|
1930 |
version
|
601
|
1931 |
^ '$Header: /cvs/stx/stx/libview/Cursor.st,v 1.28 1996-04-23 20:11:54 cg Exp $'
|
0
|
1932 |
! !
|
577
|
1933 |
Cursor initialize!
|