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