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