author | Claus Gittinger <cg@exept.de> |
Tue, 04 Sep 2001 14:38:39 +0200 | |
changeset 3474 | 2043444bdc24 |
parent 3452 | 58e757c27a76 |
child 3512 | e7da73a7e77b |
permissions | -rw-r--r-- |
0 | 1 |
" |
6 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
78 | 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 |
||
3192 | 13 |
"{ Package: 'stx:libview' }" |
14 |
||
721
ba7861418087
renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
15 |
GraphicsMedium subclass:#Form |
412
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
16 |
instanceVariableNames:'depth localColorMap offset data fileName' |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
17 |
classVariableNames:'VeryLightGreyForm LightGreyForm GreyForm DarkGreyForm |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
18 |
VeryDarkGreyForm AdditionalBitmapDirectoryNames |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
19 |
BlackAndWhiteColorMap DitherPatternArray' |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
20 |
poolDictionaries:'' |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
21 |
category:'Graphics-Display Objects' |
0 | 22 |
! |
23 |
||
1907
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
24 |
DeviceHandle subclass:#DeviceFormHandle |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
25 |
instanceVariableNames:'' |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
26 |
classVariableNames:'' |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
27 |
poolDictionaries:'' |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
28 |
privateIn:Form |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
29 |
! |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
30 |
|
1142
2a83bf7d5627
Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents:
1138
diff
changeset
|
31 |
!Form class methodsFor:'documentation'! |
46 | 32 |
|
33 |
copyright |
|
34 |
" |
|
35 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
78 | 36 |
All Rights Reserved |
0 | 37 |
|
46 | 38 |
This software is furnished under a license and may be used |
39 |
only in accordance with the terms of that license and with the |
|
40 |
inclusion of the above copyright notice. This software may not |
|
41 |
be provided or otherwise made available to, or used by, any |
|
42 |
other person. No title to or ownership of the software is |
|
43 |
hereby transferred. |
|
44 |
" |
|
45 |
! |
|
46 |
||
47 |
documentation |
|
48 |
" |
|
49 |
Instances of this class represent forms (i.e. bit- and pixmaps) |
|
590 | 50 |
which can be created on a drawing device. |
51 |
In X, these device resources are XPixmaps. |
|
46 | 52 |
Not all devices will support forms. |
134 | 53 |
|
54 |
NOTICE: |
|
1138
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
55 |
the Form class is a historic leftover and now only used for real |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
56 |
device forms (i.e. on devices which support downloading bitmaps). |
590 | 57 |
|
1138
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
58 |
In your application, you should always use Image, both for compatibility |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
59 |
with ST-80 and for device independence, since Form may not be supported |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
60 |
by all devices. |
589 | 61 |
|
935 | 62 |
WARNING: |
1138
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
63 |
Forms created on some device may not be recreatable, when an |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
64 |
image is restarted on a display with different display capabilities. |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
65 |
For example, a 24bit truecolor form will be lost when the image is |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
66 |
saved and restarted in an 8bit or monochrome display. |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
67 |
Worse: the information is completely lost. |
935 | 68 |
|
1138
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
69 |
With images, the original information is always preserved, although |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
70 |
the display may be with less resolution, dithered or otherwise |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
71 |
approximated. |
935 | 72 |
|
591 | 73 |
[See also:] |
1138
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
74 |
Image DeviceDrawable |
610 | 75 |
|
76 |
[author:] |
|
1138
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
77 |
Claus Gittinger |
46 | 78 |
" |
79 |
! ! |
|
0 | 80 |
|
1142
2a83bf7d5627
Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents:
1138
diff
changeset
|
81 |
!Form class methodsFor:'initialization'! |
0 | 82 |
|
889 | 83 |
flushDeviceForms |
84 |
"recreate all forms on aDevice; called by Workstation, to |
|
85 |
have all background bitmaps at hand, when views are restored" |
|
86 |
||
87 |
Lobby do:[:aDrawable | |
|
1138
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
88 |
aDrawable isForm ifTrue:[ |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
89 |
(aDrawable graphicsDevice notNil) ifTrue:[ |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
90 |
"now, try to recreate it" |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
91 |
aDrawable recreate. |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
92 |
] |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
93 |
] |
889 | 94 |
] |
95 |
||
96 |
"Created: 18.6.1996 / 13:04:59 / cg" |
|
927
c4bc2a7ff733
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
925
diff
changeset
|
97 |
"Modified: 5.7.1996 / 17:56:02 / cg" |
889 | 98 |
! |
99 |
||
0 | 100 |
initialize |
126 | 101 |
"initialize set of dictionaries to look for bitmaps" |
0 | 102 |
|
103 |
AdditionalBitmapDirectoryNames isNil ifTrue:[ |
|
78 | 104 |
AdditionalBitmapDirectoryNames := #('/usr/lib/X11/bitmaps'). |
0 | 105 |
|
78 | 106 |
"want to be informed when returning from snapshot" |
107 |
ObjectMemory addDependent:self. |
|
0 | 108 |
] |
109 |
! |
|
110 |
||
111 |
reinitializeAllOn:aDevice |
|
112 |
"recreate all forms on aDevice; called by Workstation, to |
|
113 |
have all background bitmaps at hand, when views are restored" |
|
114 |
||
127 | 115 |
Lobby do:[:aDrawable | |
1138
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
116 |
(aDrawable graphicsDevice == aDevice) ifTrue:[ |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
117 |
aDrawable isForm ifTrue:[ |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
118 |
"now, try to recreate it" |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
119 |
aDrawable recreate. |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
120 |
] |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
121 |
] |
0 | 122 |
] |
927
c4bc2a7ff733
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
925
diff
changeset
|
123 |
|
c4bc2a7ff733
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
925
diff
changeset
|
124 |
"Modified: 5.7.1996 / 17:55:58 / cg" |
0 | 125 |
! |
126 |
||
870
2b7db80e7ad1
oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
127 |
update:something with:aParameter from:changedObject |
0 | 128 |
"sent just before snapOut and just after a snapIn" |
129 |
||
130 |
(something == #save) ifTrue:[ |
|
2823
c10e30bad607
catch form-fetch bit error during save
Claus Gittinger <cg@exept.de>
parents:
2773
diff
changeset
|
131 |
"get all bits from the device into saveable arrays" |
c10e30bad607
catch form-fetch bit error during save
Claus Gittinger <cg@exept.de>
parents:
2773
diff
changeset
|
132 |
Lobby do:[:aDrawable | |
c10e30bad607
catch form-fetch bit error during save
Claus Gittinger <cg@exept.de>
parents:
2773
diff
changeset
|
133 |
aDrawable isForm ifTrue:[ |
c10e30bad607
catch form-fetch bit error during save
Claus Gittinger <cg@exept.de>
parents:
2773
diff
changeset
|
134 |
PrimitiveFailureSignal handle:[:ex | |
c10e30bad607
catch form-fetch bit error during save
Claus Gittinger <cg@exept.de>
parents:
2773
diff
changeset
|
135 |
'Form [warning]: cannot fetch form bits from device' errorPrintCR |
c10e30bad607
catch form-fetch bit error during save
Claus Gittinger <cg@exept.de>
parents:
2773
diff
changeset
|
136 |
] do:[ |
2933
fd5033d6a182
ask device, if it wants to be made persistent in the snapshot image
Claus Gittinger <cg@exept.de>
parents:
2850
diff
changeset
|
137 |
|dev| |
fd5033d6a182
ask device, if it wants to be made persistent in the snapshot image
Claus Gittinger <cg@exept.de>
parents:
2850
diff
changeset
|
138 |
|
fd5033d6a182
ask device, if it wants to be made persistent in the snapshot image
Claus Gittinger <cg@exept.de>
parents:
2850
diff
changeset
|
139 |
((dev := aDrawable device) isNil |
fd5033d6a182
ask device, if it wants to be made persistent in the snapshot image
Claus Gittinger <cg@exept.de>
parents:
2850
diff
changeset
|
140 |
or:[dev isPersistentInSnapshot]) ifTrue:[ |
fd5033d6a182
ask device, if it wants to be made persistent in the snapshot image
Claus Gittinger <cg@exept.de>
parents:
2850
diff
changeset
|
141 |
aDrawable getBits |
fd5033d6a182
ask device, if it wants to be made persistent in the snapshot image
Claus Gittinger <cg@exept.de>
parents:
2850
diff
changeset
|
142 |
] |
2823
c10e30bad607
catch form-fetch bit error during save
Claus Gittinger <cg@exept.de>
parents:
2773
diff
changeset
|
143 |
] |
c10e30bad607
catch form-fetch bit error during save
Claus Gittinger <cg@exept.de>
parents:
2773
diff
changeset
|
144 |
] |
c10e30bad607
catch form-fetch bit error during save
Claus Gittinger <cg@exept.de>
parents:
2773
diff
changeset
|
145 |
] |
0 | 146 |
]. |
147 |
(something == #restarted) ifTrue:[ |
|
2823
c10e30bad607
catch form-fetch bit error during save
Claus Gittinger <cg@exept.de>
parents:
2773
diff
changeset
|
148 |
"remove all left-over device info" |
c10e30bad607
catch form-fetch bit error during save
Claus Gittinger <cg@exept.de>
parents:
2773
diff
changeset
|
149 |
Lobby do:[:aDrawable | |
c10e30bad607
catch form-fetch bit error during save
Claus Gittinger <cg@exept.de>
parents:
2773
diff
changeset
|
150 |
aDrawable isForm ifTrue:[ |
c10e30bad607
catch form-fetch bit error during save
Claus Gittinger <cg@exept.de>
parents:
2773
diff
changeset
|
151 |
aDrawable flushDeviceHandles. |
c10e30bad607
catch form-fetch bit error during save
Claus Gittinger <cg@exept.de>
parents:
2773
diff
changeset
|
152 |
Lobby registerChange:aDrawable |
c10e30bad607
catch form-fetch bit error during save
Claus Gittinger <cg@exept.de>
parents:
2773
diff
changeset
|
153 |
] |
c10e30bad607
catch form-fetch bit error during save
Claus Gittinger <cg@exept.de>
parents:
2773
diff
changeset
|
154 |
] |
0 | 155 |
] |
870
2b7db80e7ad1
oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
156 |
|
2b7db80e7ad1
oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
157 |
"Modified: 15.6.1996 / 15:44:09 / cg" |
2b7db80e7ad1
oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
158 |
"Created: 15.6.1996 / 15:47:50 / cg" |
0 | 159 |
! ! |
160 |
||
1142
2a83bf7d5627
Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents:
1138
diff
changeset
|
161 |
!Form class methodsFor:'instance creation'! |
278 | 162 |
|
2964 | 163 |
dotOfSize:size |
164 |
"create and return a form which contains a dot (filled circle) |
|
165 |
of the given size." |
|
166 |
||
167 |
|f| |
|
168 |
||
169 |
f := self extent:size asPoint on:Screen current. |
|
170 |
f clear. |
|
171 |
f fillCircle:(f center) radius:(f width min:f height) // 2. |
|
172 |
^ f |
|
173 |
||
174 |
" |
|
175 |
(Form dotOfSize:8) inspect |
|
176 |
(Form dotOfSize:20) inspect |
|
177 |
" |
|
178 |
! |
|
179 |
||
278 | 180 |
extent:ext |
181 |
"create a new, cleared form, take dimensions from ext. |
|
182 |
Smalltalk-80 compatibility" |
|
183 |
||
184 |
|newForm| |
|
185 |
||
186 |
newForm := self width:(ext x) height:(ext y). |
|
187 |
newForm fill:(Color colorId:0). |
|
188 |
newForm paint:(Color colorId:1). |
|
189 |
^ newForm |
|
190 |
! |
|
191 |
||
1278 | 192 |
extent:ext depth:d |
193 |
"create a new, cleared form. |
|
194 |
Smalltalk-80 compatibility" |
|
195 |
||
196 |
^ self width:ext x height:ext y depth:d |
|
197 |
||
198 |
"Created: 27.1.1997 / 16:08:37 / cg" |
|
199 |
"Modified: 27.1.1997 / 16:08:50 / cg" |
|
200 |
! |
|
201 |
||
1548 | 202 |
extent:ext depth:d on:aDevice |
203 |
"create a new form on device, aDevice; depth is what device likes most" |
|
204 |
||
1549 | 205 |
^ self width:ext x height:ext y depth:d on:aDevice |
1548 | 206 |
|
207 |
"Created: 4.4.1997 / 20:23:32 / cg" |
|
1549 | 208 |
"Modified: 4.4.1997 / 20:25:28 / cg" |
1548 | 209 |
! |
210 |
||
3452 | 211 |
extent:ext depth:d onDevice:aDevice |
212 |
"create a new form on device, aDevice; depth is what device likes most" |
|
213 |
||
214 |
^ self width:ext x height:ext y depth:d onDevice:aDevice |
|
215 |
||
216 |
"Created: 4.4.1997 / 20:23:32 / cg" |
|
217 |
"Modified: 4.4.1997 / 20:25:28 / cg" |
|
218 |
! |
|
219 |
||
278 | 220 |
extent:ext fromArray:data |
221 |
"create a new form, take dimensions from ext, bits from data. |
|
222 |
Smalltalk-80 compatibility." |
|
223 |
||
224 |
^ self width:(ext x) height:(ext y) offset:0@0 fromArray:data |
|
225 |
! |
|
226 |
||
227 |
extent:ext fromArray:data offset:offs |
|
228 |
"create a new form, take dimensions from ext, bits from data. |
|
229 |
Smalltalk-80 compatibility." |
|
230 |
||
231 |
^ self width:(ext x) height:(ext y) offset:offs fromArray:data |
|
232 |
! |
|
233 |
||
1571 | 234 |
extent:ext fromArray:data offset:offs on:aDevice |
235 |
"create a new form, take dimensions from ext, bits from data." |
|
236 |
||
237 |
^ self width:(ext x) height:(ext y) offset:offs fromArray:data on:aDevice |
|
238 |
||
239 |
"Created: 10.4.1997 / 15:36:31 / cg" |
|
240 |
! |
|
241 |
||
3452 | 242 |
extent:ext fromArray:data offset:offs onDevice:aDevice |
243 |
"create a new form, take dimensions from ext, bits from data." |
|
244 |
||
245 |
^ self width:(ext x) height:(ext y) offset:offs fromArray:data onDevice:aDevice |
|
246 |
||
247 |
"Created: 10.4.1997 / 15:36:31 / cg" |
|
248 |
! |
|
249 |
||
1571 | 250 |
extent:ext fromArray:data on:aDevice |
251 |
"create a new form, take dimensions from ext, bits from data." |
|
252 |
||
253 |
^ self width:(ext x) height:(ext y) fromArray:data on:aDevice |
|
254 |
||
255 |
"Created: 10.4.1997 / 15:34:34 / cg" |
|
256 |
"Modified: 10.4.1997 / 15:36:04 / cg" |
|
257 |
! |
|
258 |
||
3452 | 259 |
extent:ext fromArray:data onDevice:aDevice |
260 |
"create a new form, take dimensions from ext, bits from data." |
|
261 |
||
262 |
^ self width:(ext x) height:(ext y) fromArray:data onDevice:aDevice |
|
263 |
||
264 |
"Created: 10.4.1997 / 15:34:34 / cg" |
|
265 |
"Modified: 10.4.1997 / 15:36:04 / cg" |
|
266 |
! |
|
267 |
||
278 | 268 |
extent:ext offset:anOffset |
269 |
"create a new, cleared form, take dimensions from ext. |
|
270 |
Smalltalk-80 compatibility" |
|
271 |
||
272 |
^ (self extent:ext) offset:anOffset. |
|
273 |
! |
|
274 |
||
1548 | 275 |
extent:ext on:aDevice |
276 |
"create a new form on device, aDevice; depth is what device likes most" |
|
277 |
||
1549 | 278 |
^ self width:ext x height:ext y on:aDevice |
1548 | 279 |
|
1549 | 280 |
"Modified: 4.4.1997 / 20:25:07 / cg" |
1548 | 281 |
! |
282 |
||
3452 | 283 |
extent:ext onDevice:aDevice |
284 |
"create a new form on device, aDevice; depth is what device likes most" |
|
285 |
||
286 |
^ self width:ext x height:ext y onDevice:aDevice |
|
287 |
||
288 |
"Modified: 4.4.1997 / 20:25:07 / cg" |
|
289 |
! |
|
290 |
||
278 | 291 |
width:w height:h |
292 |
"create a new form on the default device" |
|
293 |
||
3135
f9304f22f07b
handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents:
3106
diff
changeset
|
294 |
|scr| |
f9304f22f07b
handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents:
3106
diff
changeset
|
295 |
|
f9304f22f07b
handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents:
3106
diff
changeset
|
296 |
Screen notNil ifTrue:[scr := Screen current]. |
f9304f22f07b
handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents:
3106
diff
changeset
|
297 |
^ self width:w height:h on:scr |
789 | 298 |
|
299 |
"Modified: 4.6.1996 / 22:16:33 / cg" |
|
278 | 300 |
! |
301 |
||
302 |
width:w height:h depth:d |
|
303 |
"create a new form on the default device" |
|
304 |
||
3135
f9304f22f07b
handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents:
3106
diff
changeset
|
305 |
|scr| |
f9304f22f07b
handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents:
3106
diff
changeset
|
306 |
|
f9304f22f07b
handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents:
3106
diff
changeset
|
307 |
Screen notNil ifTrue:[scr := Screen current]. |
f9304f22f07b
handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents:
3106
diff
changeset
|
308 |
^ self width:w height:h depth:d on:scr |
789 | 309 |
|
310 |
"Modified: 4.6.1996 / 22:16:51 / cg" |
|
278 | 311 |
! |
312 |
||
313 |
width:w height:h depth:d on:aDevice |
|
314 |
"create a new form with depth d on device, aDevice" |
|
315 |
||
1255 | 316 |
^ (self onDevice:aDevice) width:w height:h depth:d |
317 |
||
318 |
"Modified: 18.1.1997 / 18:26:03 / cg" |
|
278 | 319 |
! |
320 |
||
3452 | 321 |
width:w height:h depth:d onDevice:aDevice |
322 |
"create a new form with depth d on device, aDevice" |
|
323 |
||
324 |
^ (self onDevice:aDevice) width:w height:h depth:d |
|
325 |
||
326 |
"Modified: 18.1.1997 / 18:26:03 / cg" |
|
327 |
! |
|
328 |
||
278 | 329 |
width:w height:h fromArray:anArray |
330 |
"create a new form on the default device" |
|
331 |
||
3135
f9304f22f07b
handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents:
3106
diff
changeset
|
332 |
|scr| |
f9304f22f07b
handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents:
3106
diff
changeset
|
333 |
|
f9304f22f07b
handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents:
3106
diff
changeset
|
334 |
Screen notNil ifTrue:[scr := Screen current]. |
f9304f22f07b
handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents:
3106
diff
changeset
|
335 |
^ self width:w height:h fromArray:anArray on:scr |
789 | 336 |
|
337 |
"Modified: 4.6.1996 / 22:17:05 / cg" |
|
278 | 338 |
! |
339 |
||
340 |
width:w height:h fromArray:anArray on:aDevice |
|
341 |
"create a new form on device, aDevice and |
|
342 |
initialize the pixels from anArray" |
|
343 |
||
1255 | 344 |
^ (self onDevice:aDevice) width:w height:h fromArray:anArray |
345 |
||
346 |
"Modified: 18.1.1997 / 18:26:24 / cg" |
|
278 | 347 |
! |
109 | 348 |
|
3452 | 349 |
width:w height:h fromArray:anArray onDevice:aDevice |
350 |
"create a new form on device, aDevice and |
|
351 |
initialize the pixels from anArray" |
|
352 |
||
353 |
^ (self onDevice:aDevice) width:w height:h fromArray:anArray |
|
354 |
||
355 |
"Modified: 18.1.1997 / 18:26:24 / cg" |
|
356 |
! |
|
357 |
||
278 | 358 |
width:w height:h offset:offs fromArray:anArray |
359 |
"create a new form on the default device" |
|
360 |
||
3135
f9304f22f07b
handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents:
3106
diff
changeset
|
361 |
|scr| |
f9304f22f07b
handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents:
3106
diff
changeset
|
362 |
|
f9304f22f07b
handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents:
3106
diff
changeset
|
363 |
Screen notNil ifTrue:[scr := Screen current]. |
f9304f22f07b
handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents:
3106
diff
changeset
|
364 |
^ self width:w height:h offset:offs fromArray:anArray on:scr |
1255 | 365 |
|
278 | 366 |
! |
367 |
||
1571 | 368 |
width:w height:h offset:offs fromArray:anArray on:aDevice |
369 |
"create a new form on the default device" |
|
370 |
||
371 |
^ (self onDevice:aDevice) width:w height:h offset:offs fromArray:anArray |
|
372 |
||
373 |
"Modified: 18.1.1997 / 18:26:28 / cg" |
|
374 |
"Created: 10.4.1997 / 15:35:07 / cg" |
|
375 |
! |
|
376 |
||
3452 | 377 |
width:w height:h offset:offs fromArray:anArray onDevice:aDevice |
378 |
"create a new form on the default device" |
|
379 |
||
380 |
^ (self onDevice:aDevice) width:w height:h offset:offs fromArray:anArray |
|
381 |
||
382 |
"Modified: 18.1.1997 / 18:26:28 / cg" |
|
383 |
"Created: 10.4.1997 / 15:35:07 / cg" |
|
384 |
! |
|
385 |
||
278 | 386 |
width:w height:h on:aDevice |
387 |
"create a new form on device, aDevice; depth is what device likes most" |
|
388 |
||
1255 | 389 |
^ (self onDevice:aDevice) width:w height:h |
390 |
||
391 |
"Modified: 18.1.1997 / 18:26:31 / cg" |
|
3452 | 392 |
! |
393 |
||
394 |
width:w height:h onDevice:aDevice |
|
395 |
"create a new form on device, aDevice; depth is what device likes most" |
|
396 |
||
397 |
^ (self onDevice:aDevice) width:w height:h |
|
398 |
||
399 |
"Modified: 18.1.1997 / 18:26:31 / cg" |
|
278 | 400 |
! ! |
401 |
||
3142 | 402 |
!Form class methodsFor:'Compatibility - ST80'! |
278 | 403 |
|
404 |
and |
|
632
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
405 |
"return a constant usable as bitblt-combinationrule. |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
406 |
In ST-80rel2.x, these used to be numeric constants; in ST/X, |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
407 |
these are symbolic." |
278 | 408 |
|
409 |
^ #and |
|
632
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
410 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
411 |
"Modified: 2.5.1996 / 11:41:23 / cg" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
412 |
! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
413 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
414 |
black |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
415 |
"ST80 compatibility; |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
416 |
In old st80, you could use `Form black' for drawing |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
417 |
- here we return the black color." |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
418 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
419 |
^ Color black |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
420 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
421 |
"Modified: 2.5.1996 / 11:44:17 / cg" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
422 |
! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
423 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
424 |
darkGray |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
425 |
"ST80 compatibility; |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
426 |
In old st80, you could use `Form darkGray' for drawing |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
427 |
- here we return the darkGray color." |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
428 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
429 |
^ Color darkGray |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
430 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
431 |
"Modified: 2.5.1996 / 11:44:06 / cg" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
432 |
! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
433 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
434 |
darkGrey |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
435 |
"ST80 compatibility; |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
436 |
In old st80, you could use `Form darkGrey' for drawing |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
437 |
- here we return the darkGrey color." |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
438 |
|
746 | 439 |
^ Color darkGray |
440 |
||
441 |
"Modified: 28.5.1996 / 20:47:54 / cg" |
|
632
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
442 |
! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
443 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
444 |
gray |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
445 |
"ST80 compatibility; |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
446 |
In old st80, you could use `Form gray' for drawing |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
447 |
- here we return the grey color." |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
448 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
449 |
^ Color gray |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
450 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
451 |
"Modified: 2.5.1996 / 11:43:44 / cg" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
452 |
! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
453 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
454 |
grey |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
455 |
"ST80 compatibility; |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
456 |
In old st80, you could use `Form grey' for drawing |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
457 |
- here we return the grey color." |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
458 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
459 |
^ Color grey |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
460 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
461 |
"Modified: 2.5.1996 / 11:43:17 / cg" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
462 |
! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
463 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
464 |
lightGray |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
465 |
"ST80 compatibility; |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
466 |
In old st80, you could use `Form lightGray' for drawing |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
467 |
- here we return the lightGray color." |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
468 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
469 |
^ Color lightGray |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
470 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
471 |
"Created: 2.5.1996 / 11:40:07 / cg" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
472 |
"Modified: 2.5.1996 / 11:43:21 / cg" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
473 |
! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
474 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
475 |
lightGrey |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
476 |
"ST80 compatibility; |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
477 |
In old st80, you could use `Form lightGray' for drawing |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
478 |
- here we return the lightGray color." |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
479 |
|
746 | 480 |
^ Color lightGray |
481 |
||
482 |
"Modified: 28.5.1996 / 20:53:28 / cg" |
|
278 | 483 |
! |
484 |
||
485 |
over |
|
632
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
486 |
"return a constant usable as bitblt-combinationrule. |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
487 |
In ST-80rel2.x, these used to be numeric constants; in ST/X, |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
488 |
these are symbolic." |
278 | 489 |
|
490 |
^ #copy |
|
632
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
491 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
492 |
"Modified: 2.5.1996 / 11:41:31 / cg" |
278 | 493 |
! |
494 |
||
495 |
paint |
|
632
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
496 |
"return a constant usable as bitblt-combinationrule. |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
497 |
In ST-80rel2.x, these used to be numeric constants; in ST/X, |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
498 |
these are symbolic." |
278 | 499 |
|
500 |
^ #copy |
|
632
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
501 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
502 |
"Modified: 2.5.1996 / 11:41:40 / cg" |
278 | 503 |
! |
504 |
||
505 |
reverse |
|
632
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
506 |
"return a constant usable as bitblt-combinationrule. |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
507 |
In ST-80rel2.x, these used to be numeric constants; in ST/X, |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
508 |
these are symbolic." |
278 | 509 |
|
510 |
^ #xor |
|
632
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
511 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
512 |
"Modified: 2.5.1996 / 11:41:45 / cg" |
278 | 513 |
! |
514 |
||
515 |
under |
|
632
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
516 |
"return a constant usable as bitblt-combinationrule. |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
517 |
In ST-80rel2.x, these used to be numeric constants; in ST/X, |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
518 |
these are symbolic." |
278 | 519 |
|
520 |
^ #or |
|
632
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
521 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
522 |
"Modified: 2.5.1996 / 11:41:49 / cg" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
523 |
! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
524 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
525 |
white |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
526 |
"ST80rel2.x compatibility; |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
527 |
In old st80, you could use `Form white' for drawing |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
528 |
- here we return the white color." |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
529 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
530 |
^ Color white |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
531 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
532 |
"Modified: 2.5.1996 / 11:42:50 / cg" |
109 | 533 |
! ! |
534 |
||
3142 | 535 |
!Form class methodsFor:'Compatibility - Squeak'! |
536 |
||
537 |
extent:ext depth:d fromArray:data offset:offs |
|
538 |
||
539 |
d ~~ 1 ifTrue:[self halt:'unsupported depth']. |
|
540 |
^self width:(ext x) height:(ext y) offset:offs fromArray:data |
|
541 |
||
542 |
||
543 |
! ! |
|
544 |
||
1142
2a83bf7d5627
Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents:
1138
diff
changeset
|
545 |
!Form class methodsFor:'cleanup'! |
12 | 546 |
|
547 |
lowSpaceCleanup |
|
548 |
"cleanup in low-memory situations" |
|
549 |
||
54 | 550 |
DitherPatternArray := nil |
12 | 551 |
! ! |
552 |
||
1142
2a83bf7d5627
Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents:
1138
diff
changeset
|
553 |
!Form class methodsFor:'file search'! |
0 | 554 |
|
555 |
findBitmapFile:fileName |
|
556 |
"find the bitmap file in one of the standard places; |
|
557 |
return the pathName or nil" |
|
558 |
||
559 |
|aStream path| |
|
560 |
||
561 |
((fileName at:1) == $/) ifTrue:[^ fileName]. |
|
562 |
(fileName startsWith:'../') ifTrue:[^ fileName]. |
|
563 |
(fileName startsWith:'./') ifTrue:[^ fileName]. |
|
127 | 564 |
fileName asFilename exists ifTrue:[^ fileName]. |
0 | 565 |
|
134 | 566 |
aStream := Smalltalk bitmapFileStreamFor:fileName. |
0 | 567 |
aStream notNil ifTrue:[ |
78 | 568 |
path := aStream pathName. |
569 |
aStream close. |
|
570 |
^ path |
|
0 | 571 |
]. |
572 |
AdditionalBitmapDirectoryNames notNil ifTrue:[ |
|
78 | 573 |
AdditionalBitmapDirectoryNames do:[:aPath | |
574 |
path := aPath , '/' , fileName. |
|
575 |
(OperatingSystem isReadable:path) ifTrue:[ |
|
576 |
^ path |
|
577 |
] |
|
578 |
] |
|
0 | 579 |
]. |
580 |
^ nil |
|
581 |
! ! |
|
582 |
||
1142
2a83bf7d5627
Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents:
1138
diff
changeset
|
583 |
!Form class methodsFor:'fileIn/Out'! |
54 | 584 |
|
278 | 585 |
fromFile:filename |
586 |
"create a new form taking the bits from a file on the default device. |
|
587 |
WARNING: |
|
588 |
Please do no longer use this, since it will not work |
|
589 |
correctly in multi-display applications (creates the form on the |
|
590 |
default Display). |
|
591 |
Use #fromFile:on: and pass the devive as argument." |
|
0 | 592 |
|
3431 | 593 |
<resource:#obsolete> |
594 |
||
1142
2a83bf7d5627
Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents:
1138
diff
changeset
|
595 |
self obsoleteMethodWarning:'please use Image>>fromFile:'. |
278 | 596 |
^ self fromFile:filename on:Screen current |
1142
2a83bf7d5627
Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents:
1138
diff
changeset
|
597 |
|
2a83bf7d5627
Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents:
1138
diff
changeset
|
598 |
"Modified: 19.12.1996 / 13:59:09 / cg" |
0 | 599 |
! |
600 |
||
278 | 601 |
fromFile:filename on:aDevice |
602 |
"create a new form on device, aDevice and |
|
603 |
initialize the pixels from the file filename" |
|
0 | 604 |
|
3431 | 605 |
<resource:#obsolete> |
606 |
||
1142
2a83bf7d5627
Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents:
1138
diff
changeset
|
607 |
self obsoleteMethodWarning:'please use Image>>fromFile:'. |
1741 | 608 |
^ (self onDevice:aDevice) readFromFile:filename |
1142
2a83bf7d5627
Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents:
1138
diff
changeset
|
609 |
|
1741 | 610 |
"Modified: 5.6.1997 / 21:05:59 / cg" |
89 | 611 |
! |
612 |
||
278 | 613 |
fromFile:filename resolution:dpi |
614 |
"create a new form taking the bits from a file on the default device |
|
615 |
the data in the file is assumed to be for dpi resolution; |
|
616 |
if it is different from the displays resolution, magnify or |
|
617 |
shrink the picture (but only in integer magnification steps). |
|
618 |
WARNING: |
|
619 |
Please do no longer use this, since it will not work |
|
620 |
correctly in multi-display applications (creates the form on the |
|
621 |
default Display). |
|
622 |
Use #fromFile:resolution:on: and pass the devive as argument." |
|
98 | 623 |
|
3431 | 624 |
<resource:#obsolete> |
625 |
||
1145 | 626 |
self obsoleteMethodWarning:'please use Image>>fromFile:'. |
1741 | 627 |
^ (self onDevice:Screen current) readFromFile:filename resolution:dpi |
1145 | 628 |
|
1741 | 629 |
"Modified: 5.6.1997 / 21:06:03 / cg" |
0 | 630 |
! |
631 |
||
278 | 632 |
fromFile:filename resolution:dpi on:aDevice |
633 |
"create a new form on device, aDevice and |
|
634 |
initialize the pixels from the file filename; |
|
635 |
the data in the file is assumed to be for dpi resolution; |
|
636 |
if it is different from the displays resolution, magnify or |
|
637 |
shrink the picture (but only in integer magnification steps)" |
|
0 | 638 |
|
3431 | 639 |
<resource:#obsolete> |
640 |
||
1142
2a83bf7d5627
Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents:
1138
diff
changeset
|
641 |
self obsoleteMethodWarning:'please use Image>>fromFile:'. |
1741 | 642 |
^ (self onDevice:aDevice) readFromFile:filename resolution:dpi |
1142
2a83bf7d5627
Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents:
1138
diff
changeset
|
643 |
|
1741 | 644 |
"Modified: 5.6.1997 / 21:05:54 / cg" |
0 | 645 |
! |
646 |
||
278 | 647 |
readFrom:fileName |
648 |
"same as Form>>fromFile: - for ST-80 compatibility. |
|
649 |
WARNING: |
|
650 |
Please do no longer use this, since it will not work |
|
651 |
correctly in multi-display applications (creates the form on the |
|
652 |
default Display). |
|
653 |
Use #fromFile:on: and pass the devive as argument." |
|
0 | 654 |
|
3431 | 655 |
<resource:#obsolete> |
656 |
||
1142
2a83bf7d5627
Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents:
1138
diff
changeset
|
657 |
self obsoleteMethodWarning:'please use Image>>fromFile:'. |
278 | 658 |
^ self fromFile:fileName on:Screen current |
1142
2a83bf7d5627
Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents:
1138
diff
changeset
|
659 |
|
2a83bf7d5627
Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents:
1138
diff
changeset
|
660 |
"Modified: 19.12.1996 / 13:59:50 / cg" |
0 | 661 |
! ! |
662 |
||
1142
2a83bf7d5627
Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents:
1138
diff
changeset
|
663 |
!Form class methodsFor:'obsolete instance creation'! |
632
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
664 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
665 |
darkGreyFormOn:aDevice |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
666 |
"return a darkGrey form" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
667 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
668 |
|f| |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
669 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
670 |
((aDevice == Display) and:[DarkGreyForm notNil]) ifTrue:[ |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
671 |
^ DarkGreyForm |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
672 |
]. |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
673 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
674 |
f := self width:8 height:4 fromArray:(self darkGreyFormBits) on:aDevice. |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
675 |
(aDevice == Display) ifTrue:[ |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
676 |
DarkGreyForm := f |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
677 |
]. |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
678 |
^ f |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
679 |
! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
680 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
681 |
grey:percent on:aDevice |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
682 |
"return a form for dithering" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
683 |
|
2827 | 684 |
(percent < 20) ifTrue:[^ Color black onDevice:aDevice]. |
632
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
685 |
(percent < 40) ifTrue:[^ self darkGreyFormOn:aDevice]. |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
686 |
(percent < 60) ifTrue:[^ self mediumGreyFormOn:aDevice]. |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
687 |
(percent < 80) ifTrue:[^ self lightGreyFormOn:aDevice]. |
2827 | 688 |
^ Color white onDevice:aDevice |
632
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
689 |
! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
690 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
691 |
lightGreyFormOn:aDevice |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
692 |
"return a lightGrey form" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
693 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
694 |
|f| |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
695 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
696 |
((aDevice == Display) and:[LightGreyForm notNil]) ifTrue:[ |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
697 |
^ LightGreyForm |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
698 |
]. |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
699 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
700 |
f := self width:8 height:4 fromArray:(self lightGreyFormBits) on:aDevice. |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
701 |
(aDevice == Display) ifTrue:[ |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
702 |
LightGreyForm := f |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
703 |
]. |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
704 |
^ f |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
705 |
! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
706 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
707 |
mediumGreyFormOn:aDevice |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
708 |
"return a grey form" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
709 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
710 |
|f| |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
711 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
712 |
((aDevice == Display) and:[GreyForm notNil]) ifTrue:[ |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
713 |
^ GreyForm |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
714 |
]. |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
715 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
716 |
f := self width:8 height:4 fromArray:(self greyFormBits) on:aDevice. |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
717 |
(aDevice == Display) ifTrue:[ |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
718 |
GreyForm := f |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
719 |
]. |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
720 |
^ f |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
721 |
! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
722 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
723 |
veryDarkGreyFormOn:aDevice |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
724 |
"return a veryDarkGrey form" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
725 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
726 |
|f| |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
727 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
728 |
((aDevice == Display) and:[VeryDarkGreyForm notNil]) ifTrue:[ |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
729 |
^ VeryDarkGreyForm |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
730 |
]. |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
731 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
732 |
f := self width:8 height:4 fromArray:(self veryDarkGreyFormBits) on:aDevice. |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
733 |
(aDevice == Display) ifTrue:[ |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
734 |
VeryDarkGreyForm := f |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
735 |
]. |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
736 |
^ f |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
737 |
! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
738 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
739 |
veryLightGreyFormOn:aDevice |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
740 |
"return a veryLightGrey form" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
741 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
742 |
|f| |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
743 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
744 |
((aDevice == Display) and:[VeryLightGreyForm notNil]) ifTrue:[ |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
745 |
^ VeryLightGreyForm |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
746 |
]. |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
747 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
748 |
f := self width:8 height:4 fromArray:(self veryLightGreyFormBits) on:aDevice. |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
749 |
(aDevice == Display) ifTrue:[ |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
750 |
VeryLightGreyForm := f |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
751 |
]. |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
752 |
^ f |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
753 |
! ! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
754 |
|
1142
2a83bf7d5627
Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents:
1138
diff
changeset
|
755 |
!Form class methodsFor:'obsolete patterns'! |
0 | 756 |
|
278 | 757 |
darkGreyFormBits |
758 |
"return a pattern usable to simulate darkGray on monochrome device" |
|
0 | 759 |
|
278 | 760 |
^ #(2r10111011 |
761 |
2r11101110 |
|
762 |
2r10111011 |
|
763 |
2r11101110) |
|
0 | 764 |
! |
765 |
||
632
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
766 |
grey12Bits |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
767 |
"return a pattern with 12% grey, usable for dithering" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
768 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
769 |
^ #(2r00010001 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
770 |
2r00000000 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
771 |
2r01000100 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
772 |
2r00000000) |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
773 |
! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
774 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
775 |
grey25Bits |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
776 |
"return a pattern with 25% grey, usable for dithering" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
777 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
778 |
^ #(2r00010001 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
779 |
2r01000100 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
780 |
2r00010001 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
781 |
2r01000100) |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
782 |
! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
783 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
784 |
grey37Bits |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
785 |
"return a pattern with 37% grey, usable for dithering" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
786 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
787 |
^ #(2r00010001 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
788 |
2r10101010 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
789 |
2r01000100 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
790 |
2r10101010) |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
791 |
! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
792 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
793 |
grey50Bits |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
794 |
"return a pattern with 50% grey, usable for dithering" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
795 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
796 |
^ #(2r01010101 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
797 |
2r10101010 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
798 |
2r01010101 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
799 |
2r10101010) |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
800 |
! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
801 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
802 |
grey6Bits |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
803 |
"return a pattern with 6% grey, usable for dithering" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
804 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
805 |
^ #(2r00000001 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
806 |
2r00000000 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
807 |
2r00010000 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
808 |
2r00000000) |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
809 |
! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
810 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
811 |
greyFormBits |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
812 |
"return a pattern usable to simulate gray on monochrome device" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
813 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
814 |
^ #(2r01010101 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
815 |
2r10101010 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
816 |
2r01010101 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
817 |
2r10101010) |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
818 |
! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
819 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
820 |
lightGreyFormBits |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
821 |
"return a pattern usable to simulate lightGray on monochrome device" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
822 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
823 |
^ #(2r01000100 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
824 |
2r00010001 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
825 |
2r01000100 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
826 |
2r00010001 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
827 |
2r01000100) |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
828 |
! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
829 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
830 |
veryDarkGreyFormBits |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
831 |
"return a pattern usable to simulate veryDarkGray on monochrome device" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
832 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
833 |
^ #(2r01110111 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
834 |
2r11111111 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
835 |
2r11011101 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
836 |
2r11111111) |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
837 |
! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
838 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
839 |
veryLightGreyFormBits |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
840 |
"return a pattern usable to simulate veryDarkGray on monochrome device" |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
841 |
|
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
842 |
^ #(2r10001000 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
843 |
2r00000000 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
844 |
2r00100010 |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
845 |
2r00000000) |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
846 |
! ! |
28cbc6517090
marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents:
610
diff
changeset
|
847 |
|
3142 | 848 |
!Form methodsFor:'Compatibility - ST80'! |
278 | 849 |
|
1520 | 850 |
destroy |
851 |
"destroy my underlying device resource(s)" |
|
1436 | 852 |
|
1520 | 853 |
|id| |
854 |
||
855 |
(id := gcId) notNil ifTrue:[ |
|
856 |
gcId := nil. |
|
857 |
device destroyGC:id. |
|
1508
5d9b6b2524c9
release device resource in close.
Claus Gittinger <cg@exept.de>
parents:
1498
diff
changeset
|
858 |
]. |
5d9b6b2524c9
release device resource in close.
Claus Gittinger <cg@exept.de>
parents:
1498
diff
changeset
|
859 |
|
1520 | 860 |
(id := drawableId) notNil ifTrue:[ |
861 |
drawableId := nil. |
|
862 |
device destroyPixmap:id. |
|
863 |
]. |
|
864 |
||
865 |
Lobby unregister:self. |
|
866 |
||
867 |
"Modified: 2.4.1997 / 19:39:52 / cg" |
|
1436 | 868 |
! |
869 |
||
2964 | 870 |
displayAt:aPoint |
871 |
"show the receiver on the current display screen" |
|
872 |
||
873 |
self displayOn:Screen current rootView at:aPoint |
|
874 |
||
875 |
" |
|
876 |
(Form dotOfSize:8) displayAt:10@10 |
|
877 |
" |
|
878 |
||
879 |
||
880 |
! |
|
881 |
||
278 | 882 |
displayOn:aGC at:aPoint |
883 |
"draw in aGC. |
|
884 |
Smalltalk-80 (2.x) compatibility" |
|
885 |
||
672 | 886 |
^ self displayOn:aGC x:aPoint x y:aPoint y rule:#copy |
887 |
||
888 |
"Modified: 12.5.1996 / 20:16:15 / cg" |
|
278 | 889 |
! |
890 |
||
891 |
displayOn:aGC at:aPoint rule:rule |
|
892 |
"draw in aGC. |
|
893 |
Smalltalk-80 (2.x) compatibility" |
|
894 |
||
672 | 895 |
self displayOn:aGC x:aPoint x y:aPoint y rule:rule |
896 |
||
897 |
"Modified: 12.5.1996 / 20:16:02 / cg" |
|
898 |
! |
|
899 |
||
900 |
displayOn:aGC rule:rule |
|
901 |
"draw in aGC. |
|
902 |
Smalltalk-80 (2.x) compatibility" |
|
903 |
||
904 |
^ self displayOn:aGC x:0 y:0 rule:rule |
|
905 |
||
906 |
"Modified: 12.5.1996 / 20:15:41 / cg" |
|
907 |
! |
|
908 |
||
909 |
displayOn:aGC x:x y:y |
|
910 |
"draw in aGC. |
|
911 |
Smalltalk-80 (2.x) compatibility" |
|
912 |
||
913 |
^ self displayOn:aGC x:x y:y rule:#copy |
|
914 |
||
915 |
"Created: 12.5.1996 / 20:15:05 / cg" |
|
916 |
! |
|
917 |
||
918 |
displayOn:aGC x:x y:y rule:rule |
|
919 |
"draw in aGC. |
|
920 |
Smalltalk-80 (2.x) compatibility" |
|
921 |
||
278 | 922 |
|f| |
923 |
||
924 |
f := aGC function. |
|
925 |
aGC function:rule. |
|
672 | 926 |
aGC displayOpaqueForm:self x:x y:y. |
278 | 927 |
aGC function:f. |
928 |
||
672 | 929 |
"Created: 12.5.1996 / 20:15:26 / cg" |
278 | 930 |
! |
931 |
||
1325 | 932 |
isOpen |
933 |
^ true |
|
934 |
||
935 |
"Created: 10.2.1997 / 12:43:49 / cg" |
|
936 |
! |
|
937 |
||
278 | 938 |
offset |
939 |
"set the offset. |
|
940 |
Smalltalk-80 compatibility" |
|
941 |
||
942 |
^ offset |
|
943 |
! |
|
944 |
||
945 |
offset:org |
|
946 |
"set the offset. |
|
947 |
Smalltalk-80 compatibility" |
|
948 |
||
949 |
offset := org |
|
1325 | 950 |
! |
951 |
||
952 |
preferredBounds |
|
953 |
^ self bounds |
|
954 |
||
955 |
"Created: 10.2.1997 / 12:43:00 / cg" |
|
278 | 956 |
! ! |
957 |
||
3020 | 958 |
!Form methodsFor:'Compatibility - Squeak'! |
959 |
||
960 |
colormapIfNeededForDepth:destDepth |
|
961 |
||
962 |
^nil |
|
3025 | 963 |
! |
964 |
||
965 |
magnify:aRectangle by:scale smoothing:smooth |
|
966 |
^ ((Image fromSubForm:aRectangle in:self) magnifiedBy:scale) asFormOn:device. |
|
3020 | 967 |
! ! |
968 |
||
278 | 969 |
!Form methodsFor:'accessing'! |
970 |
||
971 |
bits |
|
972 |
"return a ByteArray filled with my bits - |
|
973 |
for depth 8 forms, 1 pixel/byte is filled; |
|
974 |
for depth 1 forms, 8 pixels/byte are filled |
|
975 |
for depth 4 forms, 2 pixels/byte are filled. |
|
1645 | 976 |
Padding is done row-wise to the next BYTE-boundary |
977 |
If multiple pixels are contained in a single byte, |
|
978 |
left bits are in the most significant bit positions. |
|
278 | 979 |
(i.e. for width==13 and depth==1 it will return 2 bytes per scanline)" |
980 |
||
981 |
|bytesPerLine "{ Class: SmallInteger }" |
|
982 |
bytesPerLineIn "{ Class: SmallInteger }" |
|
983 |
inData tmpData info |
|
984 |
srcIndex "{ Class: SmallInteger }" |
|
985 |
dstIndex "{ Class: SmallInteger }" |
|
2060 | 986 |
buffer spaceBitsPerPixel| |
278 | 987 |
|
988 |
data notNil ifTrue:[ |
|
1458
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
989 |
^ data |
278 | 990 |
]. |
991 |
drawableId isNil ifTrue:[ |
|
1458
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
992 |
fileName notNil ifTrue:[ |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
993 |
^ (self on:Screen current) bits |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
994 |
]. |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
995 |
^ nil |
278 | 996 |
]. |
997 |
||
2060 | 998 |
spaceBitsPerPixel := depth. |
999 |
(depth > 8) ifTrue:[ |
|
1000 |
spaceBitsPerPixel := 16. |
|
1001 |
(depth > 16) ifTrue:[ |
|
1002 |
spaceBitsPerPixel := 32. |
|
1003 |
(depth > 32) ifTrue:[ |
|
1004 |
spaceBitsPerPixel := depth. |
|
1005 |
] |
|
1006 |
] |
|
1007 |
]. |
|
1008 |
||
1009 |
bytesPerLine := (width * spaceBitsPerPixel + 31) // 32 * 4. |
|
278 | 1010 |
inData := ByteArray uninitializedNew:(bytesPerLine * height). |
1461
6d8b022bfcd8
renamed getBitsFrom to getBitsFromId
Claus Gittinger <cg@exept.de>
parents:
1458
diff
changeset
|
1011 |
info := device getBitsFromPixmapId:drawableId x:0 y:0 width:width height:height into:inData. |
398
2b35bb58a82b
changes for new returned info from getBits
Claus Gittinger <cg@exept.de>
parents:
278
diff
changeset
|
1012 |
bytesPerLineIn := (info at:#bytesPerLine). "what I got" |
278 | 1013 |
bytesPerLine := (width * depth + 7) // 8. "what I want" |
1014 |
(bytesPerLine ~~ bytesPerLineIn) ifTrue:[ |
|
1458
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1015 |
" |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1016 |
different padding - have to copy over row-wise |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1017 |
" |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1018 |
tmpData := inData. |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1019 |
inData := ByteArray uninitializedNew:(bytesPerLine * height). |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1020 |
srcIndex := 1. |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1021 |
dstIndex := 1. |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1022 |
1 to:height do:[:hi | |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1023 |
inData replaceFrom:dstIndex to:(dstIndex + bytesPerLine - 1) |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1024 |
with:tmpData startingAt:srcIndex. |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1025 |
dstIndex := dstIndex + bytesPerLine. |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1026 |
srcIndex := srcIndex + bytesPerLineIn |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1027 |
] |
278 | 1028 |
] ifFalse:[ |
1458
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1029 |
" |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1030 |
same padding - copy over all in one chunk |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1031 |
" |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1032 |
(bytesPerLine * height) ~~ inData size ifTrue:[ |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1033 |
tmpData := inData. |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1034 |
inData := ByteArray uninitializedNew:(bytesPerLine * height). |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1035 |
inData replaceFrom:1 to:bytesPerLine * height with:tmpData startingAt:1 |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1036 |
] |
278 | 1037 |
]. |
1645 | 1038 |
|
278 | 1039 |
" |
1040 |
have to reverse bytes, if not msbFirst ? |
|
1041 |
" |
|
915 | 1042 |
|
1043 |
"/ (info at:#byteOrder) ~~ #msbFirst ifTrue:[ |
|
1044 |
"/ buffer := ByteArray new:bytesPerLine. |
|
1045 |
"/ dstIndex := 1. |
|
1046 |
"/ 1 to:height do:[:hi | |
|
1047 |
"/ buffer replaceFrom:1 to:bytesPerLine with:inData startingAt:dstIndex. |
|
1048 |
"/ buffer reverse. |
|
1049 |
"/ inData replaceFrom:dstIndex to:dstIndex+bytesPerLine-1 with:buffer startingAt:1. |
|
1050 |
"/ dstIndex := dstIndex + bytesPerLine |
|
1051 |
"/ ] |
|
1052 |
"/ ]. |
|
1645 | 1053 |
|
1054 |
" |
|
1055 |
have to reverse bits, if not msbFirst ? |
|
1056 |
" |
|
398
2b35bb58a82b
changes for new returned info from getBits
Claus Gittinger <cg@exept.de>
parents:
278
diff
changeset
|
1057 |
(info at:#bitOrder) ~~ #msbFirst ifTrue:[ |
1458
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1058 |
buffer := ByteArray new:bytesPerLine. |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1059 |
dstIndex := 1. |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1060 |
1 to:height do:[:hi | |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1061 |
buffer replaceFrom:1 to:bytesPerLine with:inData startingAt:dstIndex. |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1062 |
buffer expandPixels:8 width:bytesPerLine height:1 into:buffer |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1063 |
mapping:(ImageReader reverseBits). "/ translate only |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1064 |
inData replaceFrom:dstIndex to:dstIndex+bytesPerLine-1 with:buffer startingAt:1. |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1065 |
dstIndex := dstIndex + bytesPerLine |
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1066 |
] |
278 | 1067 |
]. |
1068 |
||
1069 |
^ inData. |
|
1458
612420702141
splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents:
1452
diff
changeset
|
1070 |
|
2060 | 1071 |
"Modified: / 19.2.1998 / 14:47:06 / cg" |
278 | 1072 |
! |
1073 |
||
588 | 1074 |
bits:aByteArray |
1075 |
"set the forms bits; |
|
1076 |
for depth-8 forms, 1 pixel/byte is expected; |
|
1077 |
for depth-1 forms, 8 pixels/byte are expected |
|
1078 |
for depth-4 forms, 2 pixels/byte are expected. |
|
1079 |
Padding is expected to the next byte-boundary |
|
1080 |
(i.e. for width==13 and depth==1 2 bytes per scanline are expected)" |
|
1081 |
||
1082 |
data := aByteArray |
|
1083 |
||
1084 |
"Modified: 23.4.1996 / 10:06:01 / cg" |
|
278 | 1085 |
! |
1086 |
||
1087 |
bitsPerSample |
|
1088 |
"for compatibility with Image class ..." |
|
1089 |
||
1090 |
^ Array with:depth |
|
1091 |
! |
|
1092 |
||
1093 |
colorMap |
|
1094 |
"return the receivers colormap" |
|
1095 |
||
1096 |
^ localColorMap |
|
1097 |
! |
|
1098 |
||
1436 | 1099 |
colorMap:anArrayOrColorMap |
278 | 1100 |
"set the receivers colormap" |
1101 |
||
1446
3007549e3d5e
never convert a colorArray to a colorMap
Claus Gittinger <cg@exept.de>
parents:
1436
diff
changeset
|
1102 |
localColorMap := anArrayOrColorMap |
1436 | 1103 |
|
1446
3007549e3d5e
never convert a colorArray to a colorMap
Claus Gittinger <cg@exept.de>
parents:
1436
diff
changeset
|
1104 |
"Modified: 7.3.1997 / 21:26:11 / cg" |
278 | 1105 |
! |
1106 |
||
1107 |
depth |
|
1108 |
"return the receivers depth" |
|
1109 |
||
1110 |
^ depth |
|
1111 |
! |
|
1112 |
||
2456 | 1113 |
fileName |
1114 |
"return the filename, from which the receiver was created, |
|
1115 |
or nil, if it was not read from a file" |
|
1116 |
||
1117 |
^ fileName |
|
1118 |
! |
|
1119 |
||
278 | 1120 |
filename |
1121 |
"return the filename, from which the receiver was created, |
|
1122 |
or nil, if it was not read from a file" |
|
1123 |
||
2456 | 1124 |
"/ going to be obsoleted - use #fileName |
278 | 1125 |
^ fileName |
1126 |
! |
|
1127 |
||
1128 |
forgetBits |
|
1129 |
"for image, which also keeps the bits - so there is |
|
1130 |
no need to hold them again here" |
|
1131 |
||
1132 |
data := nil |
|
1133 |
! |
|
1134 |
||
897 | 1135 |
mask |
1136 |
"for compatibility with images; forms have no mask/alpha channel" |
|
1137 |
||
1138 |
^ nil |
|
1139 |
||
1140 |
"Created: 21.6.1996 / 12:52:42 / cg" |
|
1141 |
! |
|
1142 |
||
278 | 1143 |
photometric |
1144 |
"for compatibility with Image class ..." |
|
1145 |
||
1146 |
depth == 1 ifTrue:[ |
|
1138
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1147 |
localColorMap isNil ifTrue:[ |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1148 |
^ #whiteIs0 |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1149 |
]. |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1150 |
((localColorMap at:1) = Color white) ifTrue:[ |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1151 |
((localColorMap at:2) = Color black) ifTrue:[ |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1152 |
^ #whiteIs0 |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1153 |
]. |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1154 |
]. |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1155 |
((localColorMap at:1) = Color black) ifTrue:[ |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1156 |
((localColorMap at:2) = Color white) ifTrue:[ |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1157 |
^ #blackIs0 |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1158 |
]. |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1159 |
]. |
278 | 1160 |
]. |
1161 |
^ #palette |
|
872 | 1162 |
|
1163 |
"Modified: 17.6.1996 / 11:45:16 / cg" |
|
278 | 1164 |
! |
1165 |
||
1166 |
samplesperPixel |
|
1167 |
"for compatibility with Image class ..." |
|
1168 |
||
1169 |
^ 1 |
|
1170 |
! |
|
1171 |
||
1172 |
valueAt:aPoint |
|
588 | 1173 |
"return the pixel at aPoint; the coordinates start with 0@0 |
1174 |
in the upper left, increasing to the lower right" |
|
1175 |
||
278 | 1176 |
^ self at:aPoint |
588 | 1177 |
|
1178 |
"Modified: 23.4.1996 / 10:06:55 / cg" |
|
278 | 1179 |
! |
1180 |
||
1181 |
valueAt:aPoint put:value |
|
588 | 1182 |
"set the pixel at aPoint; the coordinates start with 0@0 |
1183 |
in the upper left, increasing to the lower right." |
|
1184 |
||
278 | 1185 |
^ self at:aPoint put:value |
588 | 1186 |
|
1187 |
" |
|
1188 |
|f| |
|
1189 |
||
1190 |
f := Form width:10 height:10 depth:1. |
|
1191 |
f clear. |
|
1192 |
1 to:10 do:[:i | |
|
1138
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1193 |
f valueAt:(i @ i) put:1 |
588 | 1194 |
]. |
1195 |
f inspect |
|
1196 |
" |
|
1197 |
||
1198 |
"Modified: 23.4.1996 / 10:12:48 / cg" |
|
278 | 1199 |
! ! |
1200 |
||
1201 |
!Form methodsFor:'binary storage'! |
|
1202 |
||
1203 |
readBinaryContentsFrom: stream manager: manager |
|
1204 |
"tell the newly restored Form about restoration" |
|
1205 |
||
2850
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1206 |
width := manager nextObject. |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1207 |
height := manager nextObject. |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1208 |
depth := manager nextObject. |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1209 |
offset := manager nextObject. |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1210 |
data := manager nextObject. |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1211 |
|
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1212 |
"/ super readBinaryContentsFrom: stream manager: manager. |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1213 |
"/ device := nil. "/ Screen current. |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1214 |
|
278 | 1215 |
fileName := nil. |
1216 |
self restored. |
|
2850
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1217 |
"/ self recreate. |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1218 |
"/ Lobby register:self. |
278 | 1219 |
|
1220 |
" |
|
1221 |
|f| |
|
1222 |
||
1223 |
f := Form fromFile:'bitmaps/SBrowser.xbm'. |
|
1224 |
f storeBinaryOn:'foo.bos'. |
|
1225 |
||
1226 |
(Form readBinaryFrom:'foo.bos') inspect |
|
1227 |
" |
|
1228 |
! |
|
1229 |
||
1230 |
storeBinaryDefinitionOn: stream manager: manager |
|
1231 |
"store a binary representation of the receiver on stream. |
|
588 | 1232 |
This is an internal interface for binary storage mechanism. |
278 | 1233 |
Redefined to store the actual bits, even if I have been loaded |
2850
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1234 |
from a file, and to ommit all device related stuff." |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1235 |
|
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1236 |
|bits savedData savedDevice| |
278 | 1237 |
|
2850
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1238 |
manager putIdOfClass:(self class) on:stream. |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1239 |
manager putIdOf:width on:stream. |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1240 |
manager putIdOf:height on:stream. |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1241 |
manager putIdOf:depth on:stream. |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1242 |
manager putIdOf:offset on:stream. |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1243 |
(bits := data) isNil ifTrue:[ |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1244 |
bits := self bits. |
278 | 1245 |
]. |
2850
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1246 |
manager putIdOf:bits on:stream. |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1247 |
|
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1248 |
"/ savedDevice := device. |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1249 |
"/ (savedData := data) isNil ifTrue:[ |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1250 |
"/ data := self bits. |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1251 |
"/ ]. |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1252 |
"/ device := nil. |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1253 |
"/ super storeBinaryDefinitionOn:stream manager:manager. |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1254 |
"/ data := savedData. |
cac9758df2ca
crippled binaryStorage, to avoid desaster
Claus Gittinger <cg@exept.de>
parents:
2849
diff
changeset
|
1255 |
"/ device := savedDevice. |
588 | 1256 |
|
1257 |
"Modified: 23.4.1996 / 09:30:47 / cg" |
|
278 | 1258 |
! ! |
1259 |
||
1260 |
!Form methodsFor:'converting'! |
|
1261 |
||
1262 |
asForm |
|
588 | 1263 |
"convert & return the receiver into a Form instance - nothing to be done here" |
1264 |
||
278 | 1265 |
^ self |
588 | 1266 |
|
1267 |
"Modified: 23.4.1996 / 10:14:11 / cg" |
|
278 | 1268 |
! |
1269 |
||
1270 |
asImage |
|
588 | 1271 |
"convert & return the receiver into an Image instance" |
1272 |
||
278 | 1273 |
^ Image fromForm:self |
588 | 1274 |
|
1275 |
"Modified: 23.4.1996 / 10:13:56 / cg" |
|
278 | 1276 |
! ! |
1277 |
||
1278 |
!Form methodsFor:'copying'! |
|
1279 |
||
2849 | 1280 |
executor |
1281 |
"redefined for faster creation of finalization copies |
|
1282 |
(only device, gcId and drawableId are needed)" |
|
1283 |
||
1284 |
^ DeviceFormHandle basicNew setDevice:device id:drawableId gcId:gcId. |
|
1285 |
! |
|
1286 |
||
278 | 1287 |
postCopy |
588 | 1288 |
"redefined to copy the colorMap as well" |
1289 |
||
278 | 1290 |
super postCopy. |
1291 |
localColorMap := localColorMap copy. |
|
1292 |
data := data copy |
|
588 | 1293 |
|
1294 |
"Modified: 23.4.1996 / 10:14:46 / cg" |
|
278 | 1295 |
! ! |
1296 |
||
1297 |
!Form methodsFor:'editing'! |
|
1298 |
||
1299 |
show |
|
588 | 1300 |
"open an imageView on the receiver" |
1301 |
||
278 | 1302 |
ImageView openOnImage:self |
1303 |
||
1304 |
" |
|
1305 |
(Form fromFile:'bitmaps/SBrowser.xbm') show |
|
1306 |
" |
|
588 | 1307 |
|
1308 |
"Modified: 23.4.1996 / 10:16:12 / cg" |
|
278 | 1309 |
! ! |
1310 |
||
1311 |
!Form methodsFor:'getting a device form'! |
|
1312 |
||
1313 |
asFormOn:aDevice |
|
588 | 1314 |
"convert & return the receiver into a Form instance |
1315 |
and associate it to a device (i.e. download its bits). |
|
1316 |
Added for protocol compatibility with Image." |
|
1317 |
||
278 | 1318 |
aDevice == device ifTrue:[ |
1889
8e24afd8174e
Send #onDevice instead of obsolete #on:
Stefan Vogel <sv@exept.de>
parents:
1745
diff
changeset
|
1319 |
^ self |
278 | 1320 |
]. |
1889
8e24afd8174e
Send #onDevice instead of obsolete #on:
Stefan Vogel <sv@exept.de>
parents:
1745
diff
changeset
|
1321 |
^ self onDevice:aDevice |
588 | 1322 |
|
1323 |
"Modified: 23.4.1996 / 10:17:26 / cg" |
|
1889
8e24afd8174e
Send #onDevice instead of obsolete #on:
Stefan Vogel <sv@exept.de>
parents:
1745
diff
changeset
|
1324 |
"Modified: 26.8.1997 / 10:29:14 / stefan" |
278 | 1325 |
! |
1326 |
||
1327 |
asMonochromeFormOn:aDevice |
|
588 | 1328 |
"added for protocol compatiblity with Image" |
1329 |
||
278 | 1330 |
aDevice == device ifTrue:[ |
2191 | 1331 |
depth == 1 ifTrue:[ |
1332 |
^ self |
|
1333 |
]. |
|
278 | 1334 |
]. |
1335 |
(depth == 1) ifTrue:[ |
|
2191 | 1336 |
^ self onDevice:aDevice |
278 | 1337 |
]. |
1338 |
^ nil |
|
588 | 1339 |
|
2191 | 1340 |
"Modified: / 27.7.1998 / 20:04:37 / cg" |
278 | 1341 |
! |
1342 |
||
3104
edc88b280153
added #exactOn: - for Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
3068
diff
changeset
|
1343 |
exactOn:aDevice |
3106
d6333a2bd850
more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
3104
diff
changeset
|
1344 |
"for compatibility with color protocol - here, the same as #onDevice." |
d6333a2bd850
more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
3104
diff
changeset
|
1345 |
|
d6333a2bd850
more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
3104
diff
changeset
|
1346 |
^ self onDevice:aDevice |
d6333a2bd850
more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
3104
diff
changeset
|
1347 |
|
d6333a2bd850
more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
3104
diff
changeset
|
1348 |
! |
d6333a2bd850
more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
3104
diff
changeset
|
1349 |
|
d6333a2bd850
more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
3104
diff
changeset
|
1350 |
exactOrNearestOn:aDevice |
d6333a2bd850
more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
3104
diff
changeset
|
1351 |
"for compatibility with color protocol - here, the same as #onDevice." |
d6333a2bd850
more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
3104
diff
changeset
|
1352 |
|
d6333a2bd850
more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
3104
diff
changeset
|
1353 |
^ self onDevice:aDevice |
d6333a2bd850
more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
3104
diff
changeset
|
1354 |
|
d6333a2bd850
more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
3104
diff
changeset
|
1355 |
! |
d6333a2bd850
more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
3104
diff
changeset
|
1356 |
|
d6333a2bd850
more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
3104
diff
changeset
|
1357 |
nearestOn:aDevice |
d6333a2bd850
more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
3104
diff
changeset
|
1358 |
"for compatibility with color protocol - here, the same as #onDevice." |
3104
edc88b280153
added #exactOn: - for Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
3068
diff
changeset
|
1359 |
|
edc88b280153
added #exactOn: - for Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
3068
diff
changeset
|
1360 |
^ self onDevice:aDevice |
edc88b280153
added #exactOn: - for Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
3068
diff
changeset
|
1361 |
|
edc88b280153
added #exactOn: - for Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
3068
diff
changeset
|
1362 |
! |
edc88b280153
added #exactOn: - for Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
3068
diff
changeset
|
1363 |
|
278 | 1364 |
on:aDevice |
588 | 1365 |
"associate the receiver to a device (i.e. download its bits); |
1366 |
return a deviceForm (possibly different from the receiver)." |
|
1367 |
||
1741 | 1368 |
"/ send out a warning: #on: is typically used to create views |
1369 |
"/ operating on a model. |
|
1370 |
"/ Please use #onDevice: to avoid confusion. |
|
1371 |
||
3431 | 1372 |
<resource:#obsolete> |
1373 |
||
1741 | 1374 |
self obsoleteMethodWarning:'use #onDevice:'. |
1375 |
^ self onDevice:aDevice |
|
1376 |
||
1377 |
"Modified: 5.6.1997 / 21:05:34 / cg" |
|
1378 |
! |
|
1379 |
||
1380 |
onDevice:aDevice |
|
1381 |
"associate the receiver to a device (i.e. download its bits); |
|
1382 |
return a deviceForm (possibly different from the receiver)." |
|
1383 |
||
278 | 1384 |
aDevice == device ifTrue:[ |
1436 | 1385 |
^ self |
278 | 1386 |
]. |
2980
409e9547a45c
ignore nil device in #onDevice:
Claus Gittinger <cg@exept.de>
parents:
2964
diff
changeset
|
1387 |
aDevice isNil ifTrue:[^ self]. |
409e9547a45c
ignore nil device in #onDevice:
Claus Gittinger <cg@exept.de>
parents:
2964
diff
changeset
|
1388 |
|
278 | 1389 |
"create a new form ..." |
1390 |
||
1391 |
data notNil ifTrue:[ |
|
2191 | 1392 |
"/ 'Form [info]: create from data' printCR. |
1436 | 1393 |
^ self class width:width height:height fromArray:data on:aDevice |
278 | 1394 |
]. |
1395 |
fileName notNil ifTrue:[ |
|
2191 | 1396 |
"/ 'Form [info]: create from file' printCR. |
1436 | 1397 |
^ self class fromFile:fileName on:aDevice |
278 | 1398 |
]. |
2191 | 1399 |
'Form [warning]: no bit data in #onDevice: - returning a black form.' infoPrintCR. |
1436 | 1400 |
^ (self class width:width height:height on:aDevice) clear |
588 | 1401 |
|
2191 | 1402 |
"Modified: / 27.7.1998 / 20:05:20 / cg" |
278 | 1403 |
! ! |
1404 |
||
1405 |
!Form methodsFor:'image manipulations'! |
|
1406 |
||
1407 |
darkened |
|
588 | 1408 |
"return a darkened version of the receiver. |
1409 |
Added for protocol compatibility with Color and Image. |
|
1410 |
Here, the receiver is returned as a kludge |
|
1411 |
- actually should return a darkened image (or Color black ?) .." |
|
278 | 1412 |
|
1413 |
^ self |
|
588 | 1414 |
|
1415 |
"Modified: 23.4.1996 / 10:19:52 / cg" |
|
278 | 1416 |
! |
1417 |
||
3334 | 1418 |
easyMagnifiedBy:extent into: newForm |
1419 |
"return a new form magnified by extent, aPoint. |
|
1420 |
If non-integral magnify is asked for, pass the work on to 'hardMagnifiedBy:'" |
|
1421 |
||
1422 |
|mX mY dstX dstY ext |
|
1423 |
factor "{ Class: SmallInteger }" |
|
1424 |
n "{ Class: SmallInteger }" | |
|
1425 |
||
1426 |
ext := extent asPoint. |
|
1427 |
mX := ext x. |
|
1428 |
mY := ext y. |
|
1429 |
((mX = 1) and:[mY = 1]) ifTrue:[^ self]. |
|
1430 |
||
1431 |
"expand rows" |
|
1432 |
(mY > 1) ifTrue:[ |
|
1433 |
dstY := 0. |
|
1434 |
n := height. |
|
1435 |
factor := mY. |
|
1436 |
0 to:(n - 1) do:[:srcY | |
|
1437 |
1 to:factor do:[:i | |
|
1438 |
newForm copyFrom:self |
|
1439 |
x:0 y:srcY |
|
1440 |
toX:0 y:dstY |
|
1441 |
width:width height:1. |
|
1442 |
dstY := dstY + 1 |
|
1443 |
] |
|
1444 |
] |
|
1445 |
]. |
|
1446 |
||
1447 |
"expand cols" |
|
1448 |
(mX > 1) ifTrue:[ |
|
1449 |
n := width. |
|
1450 |
factor := mX. |
|
1451 |
dstX := (n * factor) - 1. |
|
1452 |
(n - 1) to:0 by:-1 do:[:srcX | |
|
1453 |
1 to:factor do:[:i | |
|
1454 |
newForm copyFrom:newForm |
|
1455 |
x:srcX y:0 |
|
1456 |
toX:dstX y:0 |
|
1457 |
width:1 height:(height * mY). |
|
1458 |
dstX := dstX - 1 |
|
1459 |
] |
|
1460 |
] |
|
1461 |
]. |
|
1462 |
^ newForm |
|
1463 |
||
1464 |
" |
|
1465 |
(ArrowButton upArrowButtonForm:#iris on:Display) magnifiedBy:(2 @ 2) |
|
1466 |
(Form fromFile:'bitmaps/SBrowser.xbm') magnifiedBy:(2 @ 2) |
|
1467 |
(Form fromFile:'bitmaps/SBrowser.xbm') magnifiedBy:(0.4 @ 0.4) |
|
1468 |
" |
|
1469 |
! |
|
1470 |
||
278 | 1471 |
flipHorizontal |
1472 |
"return a new form flipped horizontally" |
|
1473 |
||
1474 |
|dstY newForm nRows "{ Class: SmallInteger }" | |
|
1475 |
||
2827 | 1476 |
newForm := (self class on:device) |
1477 |
width:width |
|
1478 |
height:height |
|
1479 |
depth:depth. |
|
278 | 1480 |
"expand rows" |
1481 |
dstY := height - 1. |
|
1482 |
nRows := dstY // 2. |
|
1483 |
0 to:nRows do:[:srcY | |
|
2827 | 1484 |
newForm copyFrom:self |
1485 |
x:0 y:srcY |
|
1486 |
toX:0 y:dstY |
|
1487 |
width:width height:1. |
|
1488 |
dstY := dstY - 1 |
|
278 | 1489 |
]. |
1490 |
newForm colorMap:localColorMap. |
|
1491 |
^ newForm |
|
1492 |
! |
|
1493 |
||
1494 |
flipVertical |
|
1495 |
"return a new form flipped vertically" |
|
1496 |
||
1497 |
|dstX newForm nCols "{ Class: SmallInteger }" | |
|
1498 |
||
2827 | 1499 |
newForm := (self class on:device) |
1500 |
width:width |
|
1501 |
height:height |
|
1502 |
depth:depth. |
|
278 | 1503 |
"expand cols" |
1504 |
dstX := width - 1. |
|
1505 |
nCols := dstX // 2. |
|
1506 |
0 to:nCols do:[:srcX | |
|
2827 | 1507 |
newForm copyFrom:self |
1508 |
x:srcX y:0 |
|
1509 |
toX:dstX y:0 |
|
1510 |
width:1 height:height. |
|
1511 |
dstX := dstX - 1 |
|
278 | 1512 |
]. |
1513 |
newForm colorMap:localColorMap. |
|
1514 |
^ newForm |
|
1515 |
! |
|
1516 |
||
1517 |
hardMagnifiedBy:extent |
|
1518 |
"return a new form magnified by extent, aPoint. |
|
1519 |
This method handles non-integral factors." |
|
1520 |
||
1521 |
" |
|
1522 |
since Form will be replaced by Image in the long run, |
|
1523 |
and this operation is slow anyway, use the implementation |
|
1524 |
in Image for this." |
|
1525 |
||
1526 |
^ ((Image fromForm:self) magnifiedBy:extent) asFormOn:device. |
|
1527 |
||
1528 |
" |
|
1529 |
(Form fromFile:'OutputOn.64') magnifiedBy:0.5@0.5 |
|
1530 |
(Form fromFile:'OutputOn.64') magnifiedBy:1.5@1.5 |
|
1531 |
" |
|
1532 |
! |
|
1533 |
||
1534 |
lightened |
|
588 | 1535 |
"return a lightened version of the receiver. |
1536 |
Added for protocol compatibility with Color and Image. |
|
1537 |
Here, the receiver is returned as a kludge |
|
1538 |
- actually should return a lightened image (or Color white ?) .." |
|
278 | 1539 |
|
1540 |
^ self |
|
588 | 1541 |
|
1542 |
"Modified: 23.4.1996 / 10:20:14 / cg" |
|
278 | 1543 |
! |
1544 |
||
1545 |
magnifiedBy:extent |
|
1546 |
"return a new form magnified by extent, aPoint. |
|
1547 |
If non-integral magnify is asked for, pass the work on to 'hardMagnifiedBy:'" |
|
1548 |
||
1549 |
|mX mY dstX dstY newForm ext |
|
1550 |
factor "{ Class: SmallInteger }" |
|
1551 |
n "{ Class: SmallInteger }" | |
|
1552 |
||
1553 |
ext := extent asPoint. |
|
1554 |
mX := ext x. |
|
1555 |
mY := ext y. |
|
1556 |
((mX = 1) and:[mY = 1]) ifTrue:[^ self]. |
|
1557 |
||
1558 |
((mX isMemberOf:SmallInteger) and:[mY isMemberOf:SmallInteger]) ifFalse:[ |
|
2827 | 1559 |
^ self hardMagnifiedBy:ext |
278 | 1560 |
]. |
1561 |
||
2827 | 1562 |
newForm := (self class on:device) |
1563 |
width:(width * mX) |
|
1564 |
height:(height * mY) |
|
1565 |
depth:depth. |
|
3334 | 1566 |
self easyMagnifiedBy:extent into:newForm. |
278 | 1567 |
newForm colorMap:localColorMap. |
1568 |
^ newForm |
|
1569 |
||
1570 |
" |
|
1571 |
(ArrowButton upArrowButtonForm:#iris on:Display) magnifiedBy:(2 @ 2) |
|
1572 |
(Form fromFile:'bitmaps/SBrowser.xbm') magnifiedBy:(2 @ 2) |
|
1573 |
(Form fromFile:'bitmaps/SBrowser.xbm') magnifiedBy:(0.4 @ 0.4) |
|
1574 |
" |
|
1575 |
! |
|
1576 |
||
569
7dee80bce37b
added #magnifiedTo: (protocol compatibility with Image)
Claus Gittinger <cg@exept.de>
parents:
425
diff
changeset
|
1577 |
magnifiedTo:anExtent |
7dee80bce37b
added #magnifiedTo: (protocol compatibility with Image)
Claus Gittinger <cg@exept.de>
parents:
425
diff
changeset
|
1578 |
"return a new form magnified to have the size specified by extent. |
7dee80bce37b
added #magnifiedTo: (protocol compatibility with Image)
Claus Gittinger <cg@exept.de>
parents:
425
diff
changeset
|
1579 |
This may distort the image if the arguments ratio is not the images ratio. |
7dee80bce37b
added #magnifiedTo: (protocol compatibility with Image)
Claus Gittinger <cg@exept.de>
parents:
425
diff
changeset
|
1580 |
See also #magnifiedPreservingRatioTo: and #magnifiedBy:" |
7dee80bce37b
added #magnifiedTo: (protocol compatibility with Image)
Claus Gittinger <cg@exept.de>
parents:
425
diff
changeset
|
1581 |
|
7dee80bce37b
added #magnifiedTo: (protocol compatibility with Image)
Claus Gittinger <cg@exept.de>
parents:
425
diff
changeset
|
1582 |
^ self magnifiedBy:(anExtent / self extent) |
7dee80bce37b
added #magnifiedTo: (protocol compatibility with Image)
Claus Gittinger <cg@exept.de>
parents:
425
diff
changeset
|
1583 |
|
7dee80bce37b
added #magnifiedTo: (protocol compatibility with Image)
Claus Gittinger <cg@exept.de>
parents:
425
diff
changeset
|
1584 |
"Created: 18.4.1996 / 16:17:52 / cg" |
7dee80bce37b
added #magnifiedTo: (protocol compatibility with Image)
Claus Gittinger <cg@exept.de>
parents:
425
diff
changeset
|
1585 |
! |
7dee80bce37b
added #magnifiedTo: (protocol compatibility with Image)
Claus Gittinger <cg@exept.de>
parents:
425
diff
changeset
|
1586 |
|
278 | 1587 |
magnifyBy:scale |
1588 |
"obsolete: has been renamed to magnifiedBy: for ST-80 compatibility |
|
1589 |
and name consistency ..." |
|
1590 |
||
1591 |
self obsoleteMethodWarning. |
|
1592 |
^ self magnifiedBy:scale |
|
0 | 1593 |
! ! |
1594 |
||
1595 |
!Form methodsFor:'initialization'! |
|
1596 |
||
1138
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1597 |
createGC |
1452 | 1598 |
"physically create a device GC. |
1599 |
Since we do not need a gc-object for the drawable until something is |
|
1600 |
really drawn, none is created up to the first draw. |
|
1601 |
This method is sent, when the first drawing happens. |
|
1602 |
Redefined here to create a bitmap GC (some devices (i.e. windows) require |
|
1603 |
different GC's for different canvases." |
|
1604 |
||
1138
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1605 |
gcId := device gcForBitmap:drawableId. |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1606 |
Lobby registerChange:self. |
1452 | 1607 |
|
1608 |
"Modified: 19.3.1997 / 11:08:49 / cg" |
|
1138
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1609 |
! |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1610 |
|
0 | 1611 |
initGC |
1612 |
"stop server from sending exposure events for Forms - |
|
1613 |
(will fill up stream-queue on some stupid (i.e. sco) systems" |
|
1614 |
||
951 | 1615 |
"/ depth-1 forms draw differently ... |
1616 |
||
1617 |
depth == 1 ifTrue:[ |
|
1138
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1618 |
foreground isNil ifTrue:[ |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1619 |
foreground := paint := Color colorId:1. |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1620 |
]. |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1621 |
background isNil ifTrue:[ |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1622 |
background := bgPaint := Color colorId:0 |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1623 |
] |
951 | 1624 |
]. |
126 | 1625 |
super initGC. |
0 | 1626 |
self setGraphicsExposures:false |
836
d6eb406b1c04
dither bitmaps moved to Color
Claus Gittinger <cg@exept.de>
parents:
789
diff
changeset
|
1627 |
|
951 | 1628 |
"Modified: 17.7.1996 / 13:21:24 / cg" |
0 | 1629 |
! |
1630 |
||
278 | 1631 |
initialize |
951 | 1632 |
foreground := paint := Color colorId:1. |
1633 |
background := bgPaint := Color colorId:0. |
|
1634 |
||
3068
7f4b0dd1f738
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3067
diff
changeset
|
1635 |
"/ must allow for device-less forms to be created |
7f4b0dd1f738
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3067
diff
changeset
|
1636 |
true "device isNil" ifTrue:[ |
7f4b0dd1f738
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3067
diff
changeset
|
1637 |
realized := false. |
7f4b0dd1f738
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3067
diff
changeset
|
1638 |
width := 0. |
7f4b0dd1f738
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3067
diff
changeset
|
1639 |
height := 0. |
7f4b0dd1f738
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3067
diff
changeset
|
1640 |
function := #copy. |
7f4b0dd1f738
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3067
diff
changeset
|
1641 |
lineWidth := 1. |
7f4b0dd1f738
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3067
diff
changeset
|
1642 |
lineStyle := #solid. |
7f4b0dd1f738
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3067
diff
changeset
|
1643 |
joinStyle := #miter. |
7f4b0dd1f738
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3067
diff
changeset
|
1644 |
capStyle := #butt. |
7f4b0dd1f738
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3067
diff
changeset
|
1645 |
font := DefaultFont. |
7f4b0dd1f738
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3067
diff
changeset
|
1646 |
] ifFalse:[ |
7f4b0dd1f738
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3067
diff
changeset
|
1647 |
super initialize. |
7f4b0dd1f738
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3067
diff
changeset
|
1648 |
]. |
278 | 1649 |
depth := 1. |
836
d6eb406b1c04
dither bitmaps moved to Color
Claus Gittinger <cg@exept.de>
parents:
789
diff
changeset
|
1650 |
|
951 | 1651 |
"/ foreground isNil ifTrue:[ |
1652 |
"/ foreground := Color colorId:1. |
|
1653 |
"/ ]. |
|
1654 |
"/ paint isNil ifTrue:[ |
|
1655 |
"/ paint := foreground. |
|
1656 |
"/ ]. |
|
1657 |
"/ background isNil ifTrue:[ |
|
1658 |
"/ background := Color colorId:0 |
|
1659 |
"/ ]. |
|
1660 |
"/ bgPaint isNil ifTrue:[ |
|
1661 |
"/ bgPaint := background |
|
1662 |
"/ ] |
|
1663 |
||
1664 |
"Modified: 17.7.1996 / 13:02:01 / cg" |
|
278 | 1665 |
! |
1666 |
||
0 | 1667 |
recreate |
3300 | 1668 |
"reconstruct the form after a snapin or a migration" |
0 | 1669 |
|
2473 | 1670 |
device isNil ifTrue:[^ self]. |
1671 |
||
0 | 1672 |
data notNil ifTrue:[ |
2473 | 1673 |
" |
1674 |
create one from data |
|
1675 |
" |
|
1676 |
(depth == 1 or:[depth == device depth]) ifTrue:[ |
|
1677 |
drawableId := device createBitmapFromArray:data width:width height:height. |
|
1678 |
Lobby registerChange:self. |
|
1679 |
drawableId notNil ifTrue:[ |
|
1680 |
^ self |
|
1681 |
] |
|
1682 |
]. |
|
1683 |
'FORM: cannot recreate form' errorPrintCR. |
|
0 | 1684 |
]. |
1685 |
fileName notNil ifTrue:[ |
|
2473 | 1686 |
" |
1687 |
create one from a file (mhmh - this seems X-specific and will vanish) |
|
1688 |
" |
|
1689 |
self readFromFile:fileName. |
|
871
c078c33c51ac
recreate was somehow corrupted ?!
Claus Gittinger <cg@exept.de>
parents:
870
diff
changeset
|
1690 |
|
c078c33c51ac
recreate was somehow corrupted ?!
Claus Gittinger <cg@exept.de>
parents:
870
diff
changeset
|
1691 |
"/ drawableId := device createBitmapFromFile:fileName for:self. |
c078c33c51ac
recreate was somehow corrupted ?!
Claus Gittinger <cg@exept.de>
parents:
870
diff
changeset
|
1692 |
"/ Lobby registerChange:self. |
2473 | 1693 |
drawableId notNil ifTrue:[ |
1694 |
^ self |
|
1695 |
]. |
|
1696 |
'FORM: cannot recreate file form: ' errorPrint. fileName errorPrintCR. |
|
0 | 1697 |
]. |
871
c078c33c51ac
recreate was somehow corrupted ?!
Claus Gittinger <cg@exept.de>
parents:
870
diff
changeset
|
1698 |
|
c078c33c51ac
recreate was somehow corrupted ?!
Claus Gittinger <cg@exept.de>
parents:
870
diff
changeset
|
1699 |
^ self. |
c078c33c51ac
recreate was somehow corrupted ?!
Claus Gittinger <cg@exept.de>
parents:
870
diff
changeset
|
1700 |
|
3474 | 1701 |
"/ " |
1702 |
"/ create an empty one |
|
1703 |
"/ " |
|
1704 |
"/ depth == 1 ifTrue:[ |
|
1705 |
"/ drawableId := device createBitmapWidth:width height:height |
|
1706 |
"/ ] ifFalse:[ |
|
1707 |
"/ drawableId := device createPixmapWidth:width height:height depth:device depth |
|
1708 |
"/ ]. |
|
1709 |
"/ Lobby registerChange:self |
|
871
c078c33c51ac
recreate was somehow corrupted ?!
Claus Gittinger <cg@exept.de>
parents:
870
diff
changeset
|
1710 |
|
c078c33c51ac
recreate was somehow corrupted ?!
Claus Gittinger <cg@exept.de>
parents:
870
diff
changeset
|
1711 |
"Modified: 15.6.1996 / 16:18:12 / cg" |
2 | 1712 |
! ! |
1713 |
||
278 | 1714 |
!Form methodsFor:'inspecting'! |
127 | 1715 |
|
278 | 1716 |
inspectorClass |
1717 |
"redefined to launch an ImageInspector |
|
1718 |
(instead of the default InspectorView)." |
|
2 | 1719 |
|
278 | 1720 |
^ ImageInspectorView |
2 | 1721 |
! ! |
1722 |
||
278 | 1723 |
!Form methodsFor:'printing & storing'! |
107 | 1724 |
|
278 | 1725 |
storeOn:aStream |
588 | 1726 |
"append an ascii representation of the receiver to aStream, |
1727 |
from which a copy of the receiver can be reconstructed" |
|
1728 |
||
278 | 1729 |
aStream nextPutAll:'(Form width:'. |
1730 |
width storeOn:aStream. |
|
1731 |
aStream nextPutAll:' height:'. |
|
1732 |
height storeOn:aStream. |
|
1733 |
aStream nextPutAll:' fromArray:('. |
|
1734 |
self bits storeOn:aStream. |
|
1735 |
aStream nextPutAll:'))' |
|
588 | 1736 |
|
1737 |
"Modified: 23.4.1996 / 10:21:10 / cg" |
|
107 | 1738 |
! ! |
1739 |
||
0 | 1740 |
!Form methodsFor:'private'! |
1741 |
||
412
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1742 |
beImmediateForm |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1743 |
"read the pixels from the device into a local data array. |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1744 |
This makes certain that a fileName form is independent of |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1745 |
its fileName. |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1746 |
To make the image smaller (i.e. not keep all those bitmaps), |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1747 |
this is NOT done by default." |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1748 |
|
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1749 |
data isNil ifTrue:[ |
1138
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1750 |
data := self bits. |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1751 |
data notNil ifTrue:[ |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1752 |
fileName := nil |
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1753 |
] |
412
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1754 |
] |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1755 |
|
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1756 |
" |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1757 |
Form allInstances:[:f | |
1138
4a2b3b407cae
need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents:
1058
diff
changeset
|
1758 |
f beImmediateForm |
412
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1759 |
] |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1760 |
" |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1761 |
|
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1762 |
"Created: 7.2.1996 / 16:04:18 / cg" |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1763 |
! |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1764 |
|
870
2b7db80e7ad1
oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
1765 |
flushDeviceHandles |
2b7db80e7ad1
oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
1766 |
"flush device handles (sent after a restart)" |
2b7db80e7ad1
oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
1767 |
|
2b7db80e7ad1
oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
1768 |
drawableId := nil. |
2b7db80e7ad1
oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
1769 |
gcId := nil. |
2b7db80e7ad1
oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
1770 |
|
2b7db80e7ad1
oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
1771 |
"Created: 15.6.1996 / 15:44:28 / cg" |
2b7db80e7ad1
oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
1772 |
! |
2b7db80e7ad1
oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
1773 |
|
54 | 1774 |
getBits |
1775 |
"if the receiver was not created from a file, or |
|
1776 |
an array (i.e. it was drawn), read the pixels from the |
|
1777 |
device into a local data array. This has to be done before |
|
1778 |
an image is saved, or the receiver is storedBinary, since |
|
1779 |
the information present in the device is lost after restart/reload" |
|
1780 |
||
1781 |
(data isNil and:[fileName isNil]) ifTrue:[ |
|
78 | 1782 |
data := self bits |
54 | 1783 |
] |
1784 |
! |
|
1785 |
||
412
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1786 |
readFromFile:fn |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1787 |
"read a monochrome form from a file (in xbm-format). |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1788 |
The fileName argument, fn should be a relative pathname |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1789 |
such as bitmaps/foo.xbm and the corresponding file |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1790 |
will be searched in the standard places (i.e. along the SEARCHPATH). |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1791 |
Notice, when saving an image, only that fileName is kept with the |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1792 |
form, and the file is reloaded at image startup time. |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1793 |
You should therefore make certain, that the file is present at image |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1794 |
reload time. (this is done to make the image smaller ...) |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1795 |
If you dont like that behavior (or your application should be able to |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1796 |
restart fully standAlone), send #beImmediateForm to all instances of |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1797 |
Form - this will set the data instance variable to a ByteArray containing |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1798 |
the actual bits and will therefore no longer depend on the file being present. |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1799 |
" |
278 | 1800 |
|
3431 | 1801 |
<resource:#obsolete> |
1802 |
||
278 | 1803 |
|pathName| |
1804 |
||
3067
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1805 |
"/ this method is a historic leftover; it uses |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1806 |
"/ the X-libs bitmap file reading function, which is not |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1807 |
"/ available with other windowing systems ... |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1808 |
self obsoleteMethodWarning:'use Image fromFile:'. |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1809 |
|
412
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1810 |
pathName := self class findBitmapFile:fn. |
278 | 1811 |
pathName notNil ifTrue:[ |
3067
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1812 |
drawableId := device createBitmapFromFile:pathName for:self. |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1813 |
drawableId isNil ifTrue:[^ nil]. |
412
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1814 |
|
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1815 |
"/ fileName := pathName. "/ keep the actual name (wrong) |
3067
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1816 |
fileName := fn. "/ keep the relative name (better - SEARCHPATH may be different at restart) |
278 | 1817 |
|
3067
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1818 |
offset := 0@0. |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1819 |
realized := true. |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1820 |
BlackAndWhiteColorMap isNil ifTrue:[ |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1821 |
BlackAndWhiteColorMap := Array with:(Color white) with:(Color black) |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1822 |
]. |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1823 |
localColorMap := BlackAndWhiteColorMap. |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1824 |
Lobby registerChange:self. |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1825 |
^ self |
278 | 1826 |
]. |
1827 |
^ nil |
|
412
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1828 |
|
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1829 |
"Modified: 7.2.1996 / 16:04:25 / cg" |
278 | 1830 |
! |
1831 |
||
1832 |
readFromFile:filename resolution:dpi |
|
1833 |
"read a monochrome form from a file, which is assumed to have data for a dpi-resolution; |
|
412
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1834 |
if the actual resolution of the device differs, magnify the form. |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1835 |
Read the comment in #readFromFile: on what happenes if the file is no longer present |
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1836 |
after an image reload." |
278 | 1837 |
|
1838 |
|dpiH mag dev| |
|
1839 |
||
1840 |
(self readFromFile:filename) isNil ifTrue:[^ nil]. |
|
1841 |
||
1842 |
"if the device is within +- 50% of dpi, no magnify is needed" |
|
1843 |
dev := device. |
|
1844 |
dev isNil ifTrue:[ |
|
3067
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1845 |
"should not happen ..." |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1846 |
dev := Screen current |
278 | 1847 |
]. |
3067
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1848 |
dpiH := dev isNil ifTrue:[90] ifFalse:[dev horizontalPixelPerInch]. |
278 | 1849 |
((dpi >= (dpiH * 0.75)) and:[dpi <= (dpiH * 1.5)]) ifTrue:[^ self]. |
1850 |
mag := (dpiH / dpi) rounded. |
|
1851 |
mag == 0 ifTrue:[ |
|
3067
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1852 |
^ self |
278 | 1853 |
]. |
1854 |
^ self magnifiedBy:(mag @ mag) |
|
1855 |
||
1856 |
"Form fromFile:'SBrowser.icn' resolution:50" |
|
412
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1857 |
|
766ba454c23d
keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents:
398
diff
changeset
|
1858 |
"Modified: 7.2.1996 / 16:03:45 / cg" |
278 | 1859 |
! |
1860 |
||
1058 | 1861 |
release |
1862 |
"flush device data" |
|
278 | 1863 |
|
425
7e1df86e2517
flush device ref when restored
Claus Gittinger <cg@exept.de>
parents:
412
diff
changeset
|
1864 |
device := nil. |
278 | 1865 |
drawableId := nil. |
1866 |
gcId := nil. |
|
1745
7333e0ddc087
oops - release must send a super release also
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
1867 |
super release. |
870
2b7db80e7ad1
oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
1868 |
|
1058 | 1869 |
"Created: 16.9.1996 / 21:08:50 / cg" |
1745
7333e0ddc087
oops - release must send a super release also
Claus Gittinger <cg@exept.de>
parents:
1741
diff
changeset
|
1870 |
"Modified: 11.6.1997 / 13:19:05 / cg" |
1058 | 1871 |
! |
1872 |
||
1873 |
restored |
|
1874 |
"flush device data, when restored (sent after a binaryLoad)" |
|
1875 |
||
1876 |
self release |
|
1877 |
||
1878 |
"Modified: 16.9.1996 / 21:08:57 / cg" |
|
278 | 1879 |
! |
1880 |
||
0 | 1881 |
width:w height:h |
54 | 1882 |
"actual create of a monochrome form" |
0 | 1883 |
|
1884 |
((w == 0) or:[h == 0]) ifTrue:[ |
|
3067
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1885 |
self error:'invalid form extent'. |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1886 |
^ nil |
0 | 1887 |
]. |
1888 |
width := w. |
|
1889 |
height := h. |
|
54 | 1890 |
depth := 1. |
0 | 1891 |
offset := 0@0. |
1892 |
BlackAndWhiteColorMap isNil ifTrue:[ |
|
3067
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1893 |
BlackAndWhiteColorMap := Array with:(Color white) with:(Color black) |
0 | 1894 |
]. |
1895 |
localColorMap := BlackAndWhiteColorMap. |
|
3067
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1896 |
|
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1897 |
device notNil ifTrue:[ |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1898 |
drawableId := device createBitmapWidth:w height:h. |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1899 |
"/ drawableId isNil ifTrue:[^ nil]. |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1900 |
realized := true. |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1901 |
Lobby registerChange:self. |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1902 |
]. |
0 | 1903 |
! |
1904 |
||
1905 |
width:w height:h depth:d |
|
54 | 1906 |
"actual create of an arbitrary deep form (but, must be supported by device)" |
0 | 1907 |
|
1908 |
width := w. |
|
1909 |
height := h. |
|
1910 |
offset := 0@0. |
|
1911 |
depth := d. |
|
3067
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1912 |
device notNil ifTrue:[ |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1913 |
drawableId := device createPixmapWidth:w height:h depth:d. |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1914 |
"/ drawableId isNil ifTrue:[^ nil]. |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1915 |
realized := true. |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1916 |
Lobby registerChange:self. |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
1917 |
]. |
0 | 1918 |
! |
1919 |
||
2773
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1920 |
width:wIn height:hIn fromArray:anArray |
54 | 1921 |
"actual create of a monochrome form from array. |
0 | 1922 |
This method is somewhat more complicated as it should be due to |
1923 |
supporting both byte-wise (ST/X-type) and short-word-wise (ST-80-type) |
|
1924 |
Arrays; in the later case, the shorts are first converted to bytes in |
|
1925 |
a ByteArray, then passed to the device." |
|
1926 |
||
134 | 1927 |
|bytes bits |
1928 |
srcPerRow "{ Class: SmallInteger }" |
|
1929 |
dstPerRow "{ Class: SmallInteger }" |
|
1930 |
srcStart "{ Class: SmallInteger }" |
|
1931 |
srcIndex "{ Class: SmallInteger }" |
|
1932 |
dstIndex "{ Class: SmallInteger }" |
|
2773
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1933 |
hi "{ Class: SmallInteger }" |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1934 |
w "{ Class: SmallInteger }" |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1935 |
h "{ Class: SmallInteger }" |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1936 |
sz "{ Class: SmallInteger }" | |
0 | 1937 |
|
2773
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1938 |
w := wIn. |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1939 |
h := hIn. |
0 | 1940 |
bytes := anArray. |
2773
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1941 |
sz := anArray size. |
0 | 1942 |
|
2773
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1943 |
sz ~~ (((w + 7) // 8) * h) ifTrue:[ |
3020 | 1944 |
"/ not bytes ... |
2773
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1945 |
sz == (((w + 15) // 16) * h) ifTrue:[ |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1946 |
"I want the bytes but got shorts (ST-80)" |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1947 |
bytes := ByteArray uninitializedNew:(((w + 7) // 8) * h). |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1948 |
srcPerRow := (w + 15) // 16. |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1949 |
dstPerRow := (w + 7) // 8. |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1950 |
srcStart := 1. |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1951 |
dstIndex := 1. |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1952 |
|
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1953 |
1 to:h do:[:hi | |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1954 |
srcIndex := srcStart. |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1955 |
bits := anArray at:srcIndex. |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1956 |
1 to:dstPerRow do:[:di | |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1957 |
di odd ifTrue:[ |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1958 |
bits := anArray at:srcIndex. |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1959 |
bytes at:dstIndex put:(bits bitShift:-8) |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1960 |
] ifFalse:[ |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1961 |
bytes at:dstIndex put:(bits bitAnd:16rFF). |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1962 |
srcIndex := srcIndex + 1 |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1963 |
]. |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1964 |
dstIndex := dstIndex + 1 |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1965 |
]. |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1966 |
srcStart := srcStart + srcPerRow |
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
1967 |
] |
3020 | 1968 |
] ifFalse:[ |
1969 |
sz == (((w + 31) // 32) * h) ifTrue:[ |
|
1970 |
"I want the bytes but got longs (Squeak)" |
|
1971 |
||
1972 |
bytes := ByteArray uninitializedNew:(((w + 7) // 8) * h). |
|
1973 |
srcPerRow := (w + 31) // 32. |
|
1974 |
dstPerRow := (w + 7) // 8. |
|
1975 |
srcStart := 1. |
|
1976 |
dstIndex := 1. |
|
1977 |
||
1978 |
1 to:h do:[:hi | |
|
1979 |
|ss| |
|
1980 |
||
1981 |
srcIndex := srcStart. |
|
1982 |
bits := anArray at:srcIndex. |
|
1983 |
ss := 0. |
|
1984 |
1 to:dstPerRow do:[:di | |
|
3025 | 1985 |
ss == 0 ifTrue:[ |
1986 |
bits := anArray at:srcIndex. |
|
1987 |
]. |
|
3020 | 1988 |
bytes at:dstIndex put:((bits bitShift:-24) bitAnd:16rFF). |
1989 |
bits := bits bitShift:8. |
|
1990 |
ss := ss + 1. |
|
1991 |
ss == 4 ifTrue:[ |
|
1992 |
srcIndex := srcIndex + 1. |
|
1993 |
ss := 0. |
|
1994 |
]. |
|
1995 |
dstIndex := dstIndex + 1 |
|
1996 |
]. |
|
1997 |
srcStart := srcStart + srcPerRow |
|
1998 |
] |
|
1999 |
] |
|
2773
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
2000 |
] |
0 | 2001 |
]. |
2002 |
width := w. |
|
2003 |
height := h. |
|
54 | 2004 |
depth := 1. |
0 | 2005 |
offset := 0@0. |
2006 |
data := bytes. |
|
2007 |
BlackAndWhiteColorMap isNil ifTrue:[ |
|
2773
8aefa2576a50
a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents:
2473
diff
changeset
|
2008 |
BlackAndWhiteColorMap := Array with:(Color white) with:(Color black) |
0 | 2009 |
]. |
2010 |
localColorMap := BlackAndWhiteColorMap. |
|
3067
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
2011 |
|
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
2012 |
device notNil ifTrue:[ |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
2013 |
drawableId := device createBitmapFromArray:bytes width:w height:h. |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
2014 |
"/ drawableId isNil ifTrue:[^ nil]. |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
2015 |
realized := true. |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
2016 |
Lobby registerChange:self. |
908e910e6c94
allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents:
3025
diff
changeset
|
2017 |
]. |
0 | 2018 |
! |
2019 |
||
2020 |
width:w height:h offset:offs fromArray:anArray |
|
54 | 2021 |
"actual create of a monochrome form from array" |
0 | 2022 |
|
2023 |
self width:w height:h fromArray:anArray. |
|
2024 |
offset := offs |
|
2025 |
! ! |
|
2026 |
||
3177 | 2027 |
!Form methodsFor:'queries'! |
99 | 2028 |
|
680
a905d02dcb82
added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents:
674
diff
changeset
|
2029 |
bounds |
a905d02dcb82
added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents:
674
diff
changeset
|
2030 |
"return my bounds (added to make forms usable as VisualComponents)" |
a905d02dcb82
added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents:
674
diff
changeset
|
2031 |
|
a905d02dcb82
added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents:
674
diff
changeset
|
2032 |
^ Rectangle left:0 top:0 width:width height:height |
a905d02dcb82
added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents:
674
diff
changeset
|
2033 |
|
a905d02dcb82
added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents:
674
diff
changeset
|
2034 |
"Modified: 13.5.1996 / 10:26:13 / cg" |
a905d02dcb82
added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents:
674
diff
changeset
|
2035 |
! |
a905d02dcb82
added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents:
674
diff
changeset
|
2036 |
|
910
6a19a80f66b4
added colorFromValue: for Image compatibility
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
2037 |
colorFromValue:pixel |
1200 | 2038 |
"given a pixelValue, return the corresponding color. |
2039 |
For compatibility with Images" |
|
2040 |
||
910
6a19a80f66b4
added colorFromValue: for Image compatibility
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
2041 |
localColorMap notNil ifTrue:[ |
1200 | 2042 |
^ localColorMap at:(pixel + 1) |
910
6a19a80f66b4
added colorFromValue: for Image compatibility
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
2043 |
]. |
6a19a80f66b4
added colorFromValue: for Image compatibility
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
2044 |
depth == 1 ifTrue:[ |
1200 | 2045 |
pixel == 0 ifTrue:[^ White]. |
910
6a19a80f66b4
added colorFromValue: for Image compatibility
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
2046 |
]. |
951 | 2047 |
^ Black |
910
6a19a80f66b4
added colorFromValue: for Image compatibility
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
2048 |
|
6a19a80f66b4
added colorFromValue: for Image compatibility
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
2049 |
"Created: 28.6.1996 / 16:10:13 / cg" |
1200 | 2050 |
"Modified: 13.1.1997 / 23:06:25 / cg" |
910
6a19a80f66b4
added colorFromValue: for Image compatibility
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
2051 |
! |
6a19a80f66b4
added colorFromValue: for Image compatibility
Claus Gittinger <cg@exept.de>
parents:
897
diff
changeset
|
2052 |
|
925 | 2053 |
hasBits |
2054 |
"return true, if the receiver has its pixel data available. |
|
2055 |
For forms, which were created from data, this is always true. |
|
2056 |
For forms, which were created as off-screen device forms on some |
|
2057 |
device, this is always false." |
|
2058 |
||
2059 |
^ data notNil |
|
2060 |
||
2061 |
"Created: 5.7.1996 / 16:21:20 / cg" |
|
2062 |
! |
|
2063 |
||
673 | 2064 |
heightOn:aGC |
674 | 2065 |
"return my height, if displayed on aGC; |
2066 |
since my height is independent of the device (the number of pixels), |
|
2067 |
return the pixel-height" |
|
2068 |
||
680
a905d02dcb82
added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents:
674
diff
changeset
|
2069 |
^ height |
673 | 2070 |
|
2071 |
"Created: 12.5.1996 / 21:35:33 / cg" |
|
680
a905d02dcb82
added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents:
674
diff
changeset
|
2072 |
"Modified: 13.5.1996 / 10:26:09 / cg" |
673 | 2073 |
! |
2074 |
||
99 | 2075 |
isForm |
2076 |
"return true, if the receiver is some kind of form; |
|
2077 |
true is returned here - the method is redefined from Object." |
|
2078 |
||
2079 |
^ true |
|
2080 |
! |
|
2081 |
||
2082 |
isImageOrForm |
|
2083 |
"return true, if the receiver is some kind of image or form; |
|
2084 |
true is returned here - the method is redefined from Object." |
|
2085 |
||
2086 |
^ true |
|
673 | 2087 |
! |
2088 |
||
2089 |
widthOn:aGC |
|
674 | 2090 |
"return my width, if displayed on aGC; |
2091 |
since my width is independent of the device (the number of pixels), |
|
2092 |
return the pixel-width" |
|
2093 |
||
680
a905d02dcb82
added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents:
674
diff
changeset
|
2094 |
^ width |
673 | 2095 |
|
2096 |
"Created: 12.5.1996 / 21:35:29 / cg" |
|
680
a905d02dcb82
added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents:
674
diff
changeset
|
2097 |
"Modified: 13.5.1996 / 10:26:05 / cg" |
99 | 2098 |
! ! |
2099 |
||
1907
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2100 |
!Form::DeviceFormHandle class methodsFor:'documentation'! |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2101 |
|
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2102 |
documentation |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2103 |
" |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2104 |
This is used as a finalization handle for forms - in previous systems, |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2105 |
a shallowCopy of a form was responsible to destroy the underlying |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2106 |
devices bitmap. To make the memory requirements smaller and to speed up |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2107 |
bitmap creation a bit, this lightweight class is used now, which only |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2108 |
keeps the device handle for finalization. |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2109 |
|
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2110 |
[see also:] |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2111 |
Form |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2112 |
|
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2113 |
[author:] |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2114 |
Claus Gittinger |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2115 |
|
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2116 |
" |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2117 |
! ! |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2118 |
|
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2119 |
!Form::DeviceFormHandle methodsFor:'finalization'! |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2120 |
|
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2121 |
disposed |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2122 |
"the Form for which I am a handle has been collected - tell it to the x-server" |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2123 |
|
2074 | 2124 |
|id| |
2125 |
||
1907
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2126 |
drawableId notNil ifTrue:[ |
2074 | 2127 |
(id := gcId) notNil ifTrue:[ |
2128 |
gcId := nil. |
|
2129 |
device destroyGC:id. |
|
1907
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2130 |
]. |
2074 | 2131 |
id := drawableId. |
2132 |
drawableId := nil. |
|
2133 |
device destroyPixmap:id. |
|
1907
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2134 |
] |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2135 |
|
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2136 |
"Created: 25.9.1997 / 10:03:05 / stefan" |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2137 |
! ! |
61fdff318175
Make Device*Handles (used for finalization) private in their resp. classes.
Stefan Vogel <sv@exept.de>
parents:
1889
diff
changeset
|
2138 |
|
1142
2a83bf7d5627
Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents:
1138
diff
changeset
|
2139 |
!Form class methodsFor:'documentation'! |
134 | 2140 |
|
278 | 2141 |
version |
3474 | 2142 |
^ '$Header: /cvs/stx/stx/libview/Form.st,v 1.117 2001-09-04 12:38:10 cg Exp $' |
0 | 2143 |
! ! |
278 | 2144 |
Form initialize! |