author | Claus Gittinger <cg@exept.de> |
Fri, 11 May 2018 09:24:54 +0200 | |
changeset 8361 | 8d425e982530 |
parent 6065 | 75ff98ae918d |
child 6528 | 62c1dbef0b84 |
permissions | -rw-r--r-- |
0 | 1 |
" |
6 | 2 |
COPYRIGHT (c) 1992 by Claus Gittinger |
98 | 3 |
All Rights Reserved |
0 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
DeviceWorkstation subclass:#NeXTWorkstation |
|
5015 | 14 |
instanceVariableNames:' |
0 | 15 |
buffered |
16 |
knownDrawableIds' |
|
17 |
classVariableNames: '' |
|
18 |
poolDictionaries:'' |
|
19 |
category:'Interface-Graphics' |
|
20 |
! |
|
21 |
||
22 |
NeXTWorkstation comment:' |
|
23 |
||
6 | 24 |
COPYRIGHT (c) 1992 by Claus Gittinger |
98 | 25 |
All Rights Reserved |
0 | 26 |
|
27 |
this class provides the interface to NeXTStep; since we cannot include |
|
28 |
objc-code here (due to define conflicts with Class, nil ...) we call |
|
29 |
helper functions to do the job; the helpers are in ../librun/NXsupport.c |
|
30 |
||
31 |
All non-monochrome stuff is untested (I only have a monochroome station) |
|
32 |
||
6065 | 33 |
$Header: /cvs/stx/stx/libview/NeXTWorkstation.st,v 1.22 2013-05-21 20:49:14 cg Exp $ |
0 | 34 |
written spring 92 by claus |
35 |
'! |
|
36 |
||
193 | 37 |
!NeXTWorkstation primitiveDefinitions! |
38 |
||
0 | 39 |
%{ |
40 |
||
41 |
#include <stdio.h> |
|
42 |
#include <dpsclient/wraps.h> |
|
43 |
#include <dpsclient/psops.h> |
|
44 |
||
193 | 45 |
%} |
46 |
! ! |
|
47 |
||
48 |
!NeXTWorkstation primitiveFunctions! |
|
49 |
||
50 |
%{ |
|
0 | 51 |
/* |
52 |
* cannot include objc stuff - too many name conflicts |
|
53 |
*/ |
|
54 |
#define id INT |
|
55 |
static INT lastDrawable = 0; |
|
56 |
||
57 |
setDrawable(drawableId) |
|
58 |
OBJ drawableId; |
|
59 |
{ |
|
60 |
id drawable; |
|
61 |
||
62 |
drawable = (id)(_intVal(drawableId)); |
|
63 |
if (drawable != lastDrawable) { |
|
98 | 64 |
if (lastDrawable) { |
0 | 65 |
_objc_unlockFocus(lastDrawable); |
98 | 66 |
} |
0 | 67 |
_objc_lockFocus(drawable); |
68 |
lastDrawable = drawable; |
|
69 |
} |
|
70 |
} |
|
71 |
||
72 |
%} |
|
193 | 73 |
! ! |
0 | 74 |
|
75 |
!NeXTWorkstation class methodsFor:'initialization'! |
|
76 |
||
77 |
initialize |
|
78 |
self initializeDisplayConstants. |
|
79 |
self initializeConstants. |
|
80 |
! |
|
81 |
||
82 |
initializeDisplayConstants |
|
83 |
"initialize some common constants" |
|
84 |
! ! |
|
85 |
||
86 |
!NeXTWorkstation methodsFor:'initialize / release'! |
|
87 |
||
88 |
initialize |
|
89 |
"{ Symbol: color }" |
|
90 |
"{ Symbol: monochrome }" |
|
91 |
%{ |
|
92 |
int depth, width, height; |
|
93 |
char *visual; |
|
94 |
||
95 |
/* do NXApp stuff, get screen infos */ |
|
96 |
_NX_init(&visual, &depth, &width, &height); |
|
97 |
||
1701 | 98 |
_INST(visualType) = _MKSYMBOL(visual, (OBJ *)0); |
0 | 99 |
_INST(depth) = _MKSMALLINT(depth); |
100 |
_INST(width) = _MKSMALLINT(width); |
|
101 |
_INST(height) = _MKSMALLINT(height); |
|
102 |
||
103 |
_INST(widthMM) = _MKSMALLINT(300); |
|
104 |
_INST(heightMM) = _MKSMALLINT(222); |
|
105 |
||
106 |
if (strcmp(visual, "StaticGray") == 0) { |
|
98 | 107 |
_INST(hasColors) = false; |
108 |
_INST(hasGreyscales) = true; |
|
0 | 109 |
_INST(bitsPerRGB) = _MKSMALLINT(2); |
98 | 110 |
if (depth == 2) |
111 |
_INST(ncells) = _MKSMALLINT(4); |
|
0 | 112 |
_INST(monitorType) = _monochrome; |
113 |
} else if (strcmp(visual, "TrueColor") == 0) { |
|
98 | 114 |
_INST(hasColors) = true; |
115 |
_INST(hasGreyscales) = true; |
|
0 | 116 |
/* |
117 |
* does this exist ?" |
|
118 |
* |
|
98 | 119 |
if (depth == 8) { |
120 |
_INST(ncells) = _MKSMALLINT(256); |
|
0 | 121 |
} |
122 |
* |
|
123 |
*/ |
|
124 |
/* should work for colorStation */ |
|
98 | 125 |
if (depth == 12) { |
126 |
_INST(ncells) = _MKSMALLINT(4096); |
|
0 | 127 |
_INST(bitsPerRGB) = _MKSMALLINT(4); |
128 |
} |
|
129 |
/* should work for nextDimension */ |
|
98 | 130 |
if (depth == 24) { |
131 |
_INST(ncells) = _MKSMALLINT(4096 * 4096); |
|
0 | 132 |
_INST(bitsPerRGB) = _MKSMALLINT(8); |
133 |
} |
|
134 |
_INST(monitorType) = _color; |
|
135 |
} |
|
136 |
%} |
|
137 |
. |
|
138 |
dispatching := false. |
|
139 |
shiftDown := false. |
|
151 | 140 |
ctrlDown := false. |
0 | 141 |
metaDown := false. |
142 |
altDown := false. |
|
143 |
motionEventCompression := true. |
|
144 |
buffered := true. |
|
145 |
self initializeKeyboardMap |
|
146 |
! |
|
147 |
||
148 |
close |
|
149 |
%{ |
|
150 |
_NX_close(); |
|
151 |
%} |
|
152 |
! ! |
|
153 |
||
154 |
!NeXTWorkstation methodsFor:'private'! |
|
155 |
||
156 |
addKnownView:aView winId:aNumber withId:aDrawableNumber |
|
157 |
"add the View aView with Id:aNumber to the list of known views/id's" |
|
158 |
||
159 |
knownViews isNil ifTrue:[ |
|
255 | 160 |
knownViews := OrderedCollection new:100. |
161 |
knownIds := OrderedCollection new:100. |
|
162 |
knownDrawableIds := OrderedCollection new:100 |
|
0 | 163 |
]. |
164 |
knownViews add:aView. |
|
165 |
knownIds add:aNumber. |
|
166 |
knownDrawableIds add:aDrawableNumber |
|
167 |
! ! |
|
168 |
||
169 |
!NeXTWorkstation methodsFor:'misc'! |
|
170 |
||
171 |
lastError |
|
172 |
"return the last X-error string - when buffering is on, this may be |
|
173 |
an error for a long-ago operation" |
|
174 |
||
175 |
^ nil |
|
176 |
! |
|
177 |
||
178 |
unBuffered |
|
179 |
"make all drawing be sent immediately to the display" |
|
180 |
||
181 |
buffered := false |
|
182 |
! |
|
183 |
||
184 |
buffered |
|
185 |
"buffer drawing - do not send it immediately to the display" |
|
186 |
||
187 |
buffered := true |
|
188 |
! |
|
189 |
||
190 |
synchronizeOutput |
|
191 |
"send all buffered drawing to the display" |
|
192 |
%{ |
|
193 |
NXPing(); |
|
194 |
%} |
|
195 |
! ! |
|
196 |
||
103 | 197 |
!NeXTWorkstation class methodsFor:'queries'! |
198 |
||
199 |
platformName |
|
200 |
^ 'NeXTStep' |
|
201 |
! ! |
|
202 |
||
0 | 203 |
!NeXTWorkstation methodsFor:'accessing & queries'! |
204 |
||
205 |
displayFileDescriptor |
|
206 |
"return the displays fileNumber - for select" |
|
207 |
||
208 |
^ nil |
|
209 |
! |
|
210 |
||
211 |
serverVendor |
|
212 |
^ 'NeXT' |
|
213 |
! |
|
214 |
||
215 |
vendorRelease |
|
216 |
^ 2.1 "this is wrong - should get it from somewhere ..." |
|
217 |
! |
|
218 |
||
219 |
protocolVersion |
|
220 |
^ self vendorRelease |
|
221 |
! |
|
222 |
||
223 |
hasShape |
|
224 |
"return true, if display supports arbitrary shaped windows. |
|
225 |
(actually, DPS does support this - but I currently dont know how)" |
|
226 |
||
227 |
^ false |
|
228 |
! |
|
229 |
||
230 |
hasDPS |
|
231 |
"return true, if display supports postscript output into a view" |
|
232 |
||
233 |
^ true |
|
234 |
! |
|
235 |
||
236 |
blackpixel |
|
237 |
"return the colorId of black; |
|
238 |
for next, we use the color directly" |
|
239 |
||
240 |
^ 16r000000 |
|
241 |
! |
|
242 |
||
243 |
whitepixel |
|
244 |
"return the colorId of white; |
|
245 |
for next, we use the color directly" |
|
246 |
||
247 |
^ 16rFFFFFF |
|
248 |
! |
|
249 |
||
250 |
visualType:aSymbol |
|
251 |
^ self shouldNotImplement |
|
252 |
! |
|
253 |
||
254 |
viewIdFromPoint:aPoint in:windowId |
|
255 |
"given a point in rootWindow, return the viewId of the subview of windowId |
|
256 |
hit by this coordinate. |
|
257 |
return nil if no view was hit. |
|
258 |
- use to find window to drop objects after a cross-view drag" |
|
259 |
||
260 |
^ self shouldNotImplement |
|
261 |
! |
|
262 |
||
263 |
translatePoint:aPoint from:windowId1 to:windowId2 |
|
264 |
"given a point in window1, return the coordinate in window2 |
|
265 |
- use to xlate points from a window to rootwindow" |
|
266 |
||
267 |
^ self shouldNotImplement |
|
268 |
! ! |
|
269 |
||
270 |
!NeXTWorkstation methodsFor:'bitmap/window creation'! |
|
271 |
||
272 |
createFaxImageFromArray:data width:w height:h type:type k:k msbFirst:msbFirst |
|
273 |
"create a new faxImage in the workstation" |
|
274 |
||
275 |
^ nil |
|
276 |
! |
|
277 |
||
278 |
createBitmapWidth:w height:h |
|
279 |
^ self shouldNotImplement |
|
280 |
! |
|
281 |
||
282 |
createPixmapWidth:w height:h depth:d |
|
283 |
^ self shouldNotImplement |
|
284 |
! |
|
285 |
||
286 |
createBitmapFromFile:aString for:aForm |
|
287 |
^ self shouldNotImplement |
|
288 |
! |
|
289 |
||
290 |
createBitmapFromArray:anArray width:w height:h |
|
291 |
^ self shouldNotImplement |
|
292 |
! |
|
293 |
||
294 |
createWindowFor:aView left:xpos top:ypos width:wwidth height:wheight |
|
295 |
||
5015 | 296 |
|ext minWidth minHeight maxWidth maxHeight |
297 |
bWidth bColor viewBg viewBgId wsuperView wsuperViewId |
|
157 | 298 |
wlabel wcursor wcursorId wicon wiconId windowId |
299 |
wiconView wiconViewId |
|
69 | 300 |
drawableId| |
0 | 301 |
|
302 |
wsuperView := aView superView. |
|
303 |
wsuperView notNil ifTrue:[ |
|
98 | 304 |
wsuperViewId := wsuperView id |
0 | 305 |
]. |
306 |
wlabel := aView label. |
|
307 |
wcursor := aView cursor. |
|
308 |
||
309 |
wsuperView isNil ifTrue:[ |
|
98 | 310 |
ext := aView minExtent. |
311 |
ext notNil ifTrue:[ |
|
312 |
minWidth := ext x. |
|
313 |
minHeight := ext y |
|
314 |
]. |
|
315 |
ext := aView maxExtent. |
|
316 |
ext notNil ifTrue:[ |
|
317 |
maxWidth := ext x. |
|
318 |
maxHeight := ext y |
|
319 |
]. |
|
0 | 320 |
]. |
321 |
||
322 |
%{ |
|
323 |
id win; |
|
324 |
id view; |
|
325 |
int w, h, resizable; |
|
326 |
||
327 |
if ((minWidth != nil) && (maxWidth != nil) |
|
328 |
&& (minWidth == maxWidth) && (minHeight == maxHeight)) { |
|
329 |
w = _intVal(minWidth); |
|
330 |
h = _intVal(maxHeight); |
|
331 |
resizable = 0; |
|
332 |
} else { |
|
333 |
w = _intVal(wwidth); |
|
334 |
h = _intVal(wheight); |
|
335 |
resizable = 1; |
|
336 |
} |
|
1425
c6963c38dcd8
preparations for iconMasks (for windows)
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
337 |
win = _NX_create_window(_intVal(xpos), _intVal(ypos), w, h, resizable); |
0 | 338 |
if (! win) |
98 | 339 |
return nil; |
0 | 340 |
|
341 |
/* |
|
342 |
* define its name |
|
343 |
*/ |
|
344 |
if (_isString(wlabel)) |
|
98 | 345 |
_objc_setTitle(win, _stringVal(wlabel)); |
0 | 346 |
else |
98 | 347 |
_objc_setTitle(win, "untitled"); |
0 | 348 |
|
349 |
view = _objc_contentView(win); |
|
350 |
_objc_setFlipped_(view, 1); |
|
351 |
||
352 |
_objc_makeKeyAndOrderFront(win, 0); |
|
353 |
_objc_display(win); |
|
354 |
||
355 |
windowId = _MKSMALLINT(win); |
|
356 |
drawableId = _MKSMALLINT(view); |
|
1425
c6963c38dcd8
preparations for iconMasks (for windows)
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
357 |
%}. |
0 | 358 |
self addKnownView:aView winId:windowId withId:drawableId. |
359 |
^ drawableId |
|
360 |
! |
|
361 |
||
362 |
rootWindowFor:aView |
|
363 |
^ self shouldNotImplement |
|
364 |
! |
|
365 |
||
366 |
destroyView:aView withId:aWindowId |
|
367 |
^ self shouldNotImplement |
|
368 |
! |
|
369 |
||
370 |
destroyPixmap:aDrawableId |
|
371 |
^ self shouldNotImplement |
|
372 |
! |
|
373 |
||
374 |
destroyFaxImage:aFaxImageId |
|
375 |
^ self shouldNotImplement |
|
376 |
! |
|
377 |
||
378 |
destroyGC:aGCId |
|
379 |
^ self shouldNotImplement |
|
380 |
! |
|
381 |
||
382 |
gcFor:aDrawableId |
|
383 |
^ self shouldNotImplement |
|
384 |
! ! |
|
385 |
||
386 |
!NeXTWorkstation methodsFor:'misc stuff'! |
|
387 |
||
388 |
setInputFocusTo:aWindowId |
|
389 |
^ self primitiveFailed |
|
390 |
! ! |
|
391 |
||
392 |
!NeXTWorkstation methodsFor:'font stuff'! |
|
393 |
||
394 |
listOfAvailableFonts |
|
395 |
"return a list with all available font names on this display" |
|
396 |
%{ |
|
98 | 397 |
char **names; |
0 | 398 |
char **cp; |
399 |
int count, i; |
|
400 |
static struct inlineCache dummy1 = _DUMMYILC1; |
|
401 |
OBJ arr; |
|
402 |
||
98 | 403 |
names = (char **) _objc_availableFonts(_FontManager_new()); |
0 | 404 |
/* count them */ |
405 |
for (cp = names; *cp; cp++) ;; |
|
406 |
count = cp - names; |
|
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
407 |
arr = _SEND1(@global(Array), @symbol(new:), nil, &dummy1, _MKSMALLINT(count)); |
0 | 408 |
for (i=0; i<count;i++) |
6065 | 409 |
_ArrayInstPtr(arr)->a_element[i] = __MKSTRING(names[i]); |
0 | 410 |
free(names); |
411 |
RETURN (arr); |
|
412 |
%} |
|
413 |
! |
|
414 |
||
415 |
createFontFor:aFontName |
|
416 |
^ self primitiveFailed |
|
417 |
! |
|
418 |
||
419 |
releaseFont:aFontId |
|
420 |
^ self primitiveFailed |
|
421 |
! |
|
422 |
||
423 |
ascentOf:aFontId |
|
424 |
^ self primitiveFailed |
|
425 |
! |
|
426 |
||
427 |
descentOf:aFontId |
|
428 |
self badFont |
|
429 |
! |
|
430 |
||
431 |
minWidthOfFont:aFontId |
|
432 |
self badFont |
|
433 |
! |
|
434 |
||
435 |
maxWidthOfFont:aFontId |
|
436 |
self badFont |
|
437 |
! |
|
438 |
||
439 |
widthOf:aString inFont:aFontId |
|
440 |
^ self primitiveFailed |
|
441 |
! |
|
442 |
||
443 |
widthOf:aString from:index1 to:index2 inFont:aFontId |
|
444 |
^ self primitiveFailed |
|
445 |
! ! |
|
446 |
||
447 |
!NeXTWorkstation methodsFor:'cursor stuff'! |
|
448 |
||
449 |
destroyCursor:aCursorId |
|
450 |
^ self primitiveFailed |
|
451 |
! |
|
452 |
||
453 |
createCursorSourceFormId:sourceFormId maskFormId:maskFormId hotX:hx hotY:hy |
|
454 |
^ self primitiveFailed |
|
455 |
! |
|
456 |
||
457 |
grabPointerIn:aWindowId |
|
458 |
^ self primitiveFailed |
|
459 |
! |
|
460 |
||
461 |
ungrabPointer |
|
462 |
^ self primitiveFailed |
|
463 |
! |
|
464 |
||
465 |
pointerPosition |
|
466 |
^ self primitiveFailed |
|
467 |
! ! |
|
468 |
||
469 |
!NeXTWorkstation methodsFor:'color stuff'! |
|
470 |
||
471 |
listOfAvailableColors |
|
472 |
^ super listOfAvailableColors |
|
473 |
! |
|
474 |
||
475 |
freeColor:colorIndex |
|
476 |
"colors are never freed" |
|
477 |
||
5015 | 478 |
^ self |
0 | 479 |
! |
480 |
||
481 |
colorRed:redVal green:greenVal blue:blueVal |
|
482 |
"allocate a color with rgb values - return index" |
|
483 |
||
484 |
| r g b | |
|
485 |
||
486 |
"on the next, we use rgb value as index" |
|
487 |
r := (redVal * 16rFF / 100) asInteger. |
|
488 |
g := (greenVal * 16rFF / 100) asInteger. |
|
489 |
b := (blueVal * 16rFF / 100) asInteger. |
|
490 |
r := (r min:255) max:0. |
|
491 |
g := (g min:255) max:0. |
|
492 |
b := (b min:255) max:0. |
|
493 |
^ (((r bitShift:8) bitOr:g) bitShift:8) bitOr:b |
|
494 |
! |
|
495 |
||
496 |
colorNamed:aString |
|
497 |
"allocate a color with color name - return index" |
|
498 |
||
499 |
^ super colorNamed:aString |
|
500 |
! |
|
501 |
||
502 |
colorCell |
|
503 |
"allocate a color - return index. |
|
504 |
Since NeXTs are either StaticGrey or StaticColor, return nil here." |
|
505 |
||
506 |
^ nil |
|
507 |
! |
|
508 |
||
509 |
setColor:index red:redVal green:greenVal blue:blueVal |
|
510 |
"change color in map at:index. |
|
511 |
Since NeXTs are either StaticGrey or StaticColor, do nothing here." |
|
512 |
||
5015 | 513 |
^ self |
0 | 514 |
! |
515 |
||
516 |
getRedFrom:index |
|
517 |
"get red part of color in map at:index" |
|
518 |
||
519 |
^ ((index bitShift:-16) bitAnd:16rFF) * 100 / 16rFF |
|
520 |
! |
|
521 |
||
522 |
getGreenFrom:index |
|
523 |
"get green part of color in map at:index" |
|
524 |
||
525 |
^ ((index bitShift:-8) bitAnd:16rFF) * 100 / 16rFF |
|
526 |
! |
|
527 |
||
528 |
getBlueFrom:index |
|
529 |
"get blue part of color in map at:index" |
|
530 |
||
531 |
^ (index bitAnd:16rFF) * 100 / 16rFF |
|
532 |
! ! |
|
533 |
||
534 |
!NeXTWorkstation methodsFor:'window stuff'! |
|
535 |
||
536 |
setBackingStore:how in:aWindowId |
|
537 |
"turn on/off backing-store for a window" |
|
538 |
||
539 |
^ self |
|
540 |
! |
|
541 |
||
542 |
setSaveUnder:yesOrNo in:aWindowId |
|
543 |
"turn on/off save-under for a window" |
|
544 |
||
545 |
^ self |
|
546 |
! |
|
547 |
||
548 |
setWindowBackground:aColorId in:aWindowId |
|
549 |
%{ |
|
550 |
#ifdef NOTDEF |
|
551 |
int id, ir, ig, ib; |
|
552 |
float r, g, b; |
|
553 |
NXColor clr; |
|
554 |
||
97 | 555 |
if (__isSmallInteger(aColorId)) { |
98 | 556 |
id = _intVal(aColorId); |
5015 | 557 |
ir = (id >> 16) & 0xFF; |
558 |
ig = (id >> 8) & 0xFF; |
|
559 |
ib = id & 0xFF; |
|
0 | 560 |
/* scale from 0 .. 255 to 0.0 .. 1.0 */ |
561 |
r = (float)ir / 255.0; |
|
562 |
g = (float)ig / 255.0; |
|
563 |
b = (float)ib / 255.0; |
|
564 |
clr = NXConvertRGBToColor(r, g, b); |
|
565 |
} |
|
566 |
#endif |
|
567 |
%} |
|
568 |
. |
|
569 |
^ self primitiveFailed |
|
570 |
! |
|
571 |
||
572 |
setWindowBackgroundPixmap:aPixmapId in:aWindowId |
|
573 |
^ self primitiveFailed |
|
574 |
! |
|
575 |
||
576 |
setWindowBorderColor:aColorId in:aWindowId |
|
577 |
^ self primitiveFailed |
|
578 |
! |
|
579 |
||
580 |
setWindowBorderPixmap:aPixmapId in:aWindowId |
|
581 |
^ self primitiveFailed |
|
582 |
! |
|
583 |
||
584 |
setWindowBorderWidth:aNumber in:aWindowId |
|
585 |
^ self primitiveFailed |
|
586 |
! |
|
587 |
||
588 |
setWindowBorderShape:aPixmapId in:aWindowId |
|
589 |
^ self |
|
590 |
! |
|
591 |
||
592 |
setWindowShape:aPixmapId in:aWindowId |
|
593 |
^ self |
|
594 |
! |
|
595 |
||
596 |
setCursor:aCursorId in:aWindowId |
|
597 |
^ self primitiveFailed |
|
598 |
! |
|
599 |
||
600 |
setWindowName:aString in:aWindowId |
|
601 |
^ self primitiveFailed |
|
602 |
! |
|
603 |
||
604 |
setWindowIcon:aForm in:aWindowId |
|
605 |
^ self primitiveFailed |
|
606 |
! |
|
607 |
||
1375 | 608 |
setWindowIcon:aForm mask:aMaskForm in:aWindowId |
609 |
^ self primitiveFailed |
|
610 |
! |
|
611 |
||
0 | 612 |
setWindowIconWindow:aView in:aWindowId |
613 |
^ self primitiveFailed |
|
614 |
! |
|
615 |
||
616 |
clearWindow:aWindowId |
|
617 |
^ self primitiveFailed |
|
618 |
! |
|
619 |
||
620 |
clearRectangleX:x y:y width:width height:height in:aWindowId |
|
621 |
^ self primitiveFailed |
|
622 |
! |
|
623 |
||
624 |
mapWindow:aWindowId |
|
625 |
^ self primitiveFailed |
|
626 |
! |
|
627 |
||
628 |
unmapWindow:aWindowId |
|
629 |
^ self primitiveFailed |
|
630 |
! |
|
631 |
||
632 |
raiseWindow:aWindowId |
|
633 |
^ self primitiveFailed |
|
634 |
! |
|
635 |
||
636 |
moveWindow:aWindowId x:x y:y |
|
637 |
^ self primitiveFailed |
|
638 |
! |
|
639 |
||
640 |
resizeWindow:aWindowId width:w height:h |
|
641 |
^ self primitiveFailed |
|
642 |
! |
|
643 |
||
644 |
moveResizeWindow:aWindowId x:x y:y width:w height:h |
|
645 |
^ self primitiveFailed |
|
646 |
! ! |
|
647 |
||
648 |
!NeXTWorkstation methodsFor:'graphic context stuff'! |
|
649 |
||
650 |
setForeground:fgColorIndex in:aGCId |
|
651 |
"set foreground color to be drawn with" |
|
652 |
||
653 |
^ self primitiveFailed |
|
654 |
! |
|
655 |
||
656 |
setBackground:bgColorIndex in:aGCId |
|
657 |
"set background color to be drawn with" |
|
658 |
||
659 |
^ self primitiveFailed |
|
660 |
! |
|
661 |
||
662 |
setForeground:fgColorIndex background:bgColorIndex in:aGCId |
|
663 |
"set foreground and background colors to be drawn with" |
|
664 |
||
665 |
^ self primitiveFailed |
|
666 |
! |
|
667 |
||
668 |
setForeground:fgColor background:bgColor mask:aBitmapId in:aGCId |
|
669 |
"set foreground and background colors to be drawn with using mask or |
|
670 |
solid (if aBitmapId is nil)" |
|
671 |
||
672 |
^ self primitiveFailed |
|
673 |
! |
|
674 |
||
675 |
setLineWidth:aNumber in:aGCId |
|
676 |
"set linewidth to be drawn with" |
|
677 |
||
678 |
^ self primitiveFailed |
|
679 |
! |
|
680 |
||
681 |
setForeground:fgColor background:bgColor mask:aBitmapId lineWidth:lw in:aGCId |
|
682 |
"set foreground and background colors to be drawn with using mask or |
|
683 |
solid (if aBitmapId is nil); also set lineWidth" |
|
684 |
||
685 |
^ self primitiveFailed |
|
686 |
! |
|
687 |
||
688 |
setFunction:aFunctionSymbol in:aGCId |
|
689 |
"set alu function to be drawn with" |
|
690 |
||
691 |
"{ Symbol: and } " |
|
692 |
"{ Symbol: or } " |
|
693 |
"{ Symbol: xor } " |
|
694 |
"{ Symbol: copy } " |
|
695 |
"{ Symbol: copyInverted } " |
|
696 |
"{ Symbol: andInverted } " |
|
697 |
"{ Symbol: andReverse } " |
|
698 |
"{ Symbol: orInverted } " |
|
699 |
"{ Symbol: orReverse } " |
|
700 |
||
701 |
^ self primitiveFailed |
|
702 |
! |
|
703 |
||
704 |
setFont:aFontId in:aGCId |
|
705 |
"set font to be drawn in" |
|
706 |
||
707 |
^ self primitiveFailed |
|
708 |
! |
|
709 |
||
710 |
setPixmapMask:aPixmapId in:aGCId |
|
711 |
"set or clear the drawing mask - a pixmap mask providing full color" |
|
712 |
||
713 |
^ self primitiveFailed |
|
714 |
! |
|
715 |
||
716 |
setBitmapMask:aBitmapId in:aGCId |
|
717 |
"set or clear the drawing mask - a bitmap mask using current fg/bg" |
|
718 |
||
719 |
^ self primitiveFailed |
|
720 |
! |
|
721 |
||
722 |
setMaskOriginX:orgX y:orgY in:aGCid |
|
723 |
"set the mask origin" |
|
724 |
||
725 |
^ self primitiveFailed |
|
726 |
! |
|
727 |
||
728 |
setClipByChildren:aBool in:aGCId |
|
729 |
"enable/disable drawing into child views" |
|
730 |
||
731 |
^ self primitiveFailed |
|
732 |
! |
|
733 |
||
1711 | 734 |
noClipIn:aDrawableId gc:aGCId |
0 | 735 |
"disable clipping rectangle" |
736 |
||
737 |
^ self primitiveFailed |
|
738 |
! |
|
739 |
||
1711 | 740 |
setClipX:clipX y:clipY width:clipWidth height:clipHeight in:drawableId gc:aGCId |
0 | 741 |
"clip to a rectangle" |
742 |
||
743 |
^ self primitiveFailed |
|
744 |
! |
|
745 |
||
746 |
setGraphicsExposures:aBoolean in:aGCId |
|
747 |
"set or clear the graphics exposures flag" |
|
748 |
||
749 |
^ self primitiveFailed |
|
750 |
! ! |
|
751 |
||
752 |
!NeXTWorkstation methodsFor:'retrieving pixels'! |
|
753 |
||
754 |
getPixelX:x y:y from:aDrawableId |
|
755 |
"return the pixel value at x/y" |
|
756 |
||
757 |
^ self primitiveFailed |
|
758 |
! ! |
|
759 |
||
760 |
!NeXTWorkstation methodsFor:'drawing'! |
|
761 |
||
762 |
displayString:aString x:x y:y in:aDrawableId with:aGCId |
|
5015 | 763 |
"draw a string - draw foreground only" |
0 | 764 |
|
765 |
%{ |
|
766 |
float fx, fy; |
|
767 |
||
768 |
do { |
|
98 | 769 |
if (__isSmallInteger(x)) |
0 | 770 |
fx = (float)_intVal(x); |
98 | 771 |
else if (_isFloat(x)) |
0 | 772 |
fx = _floatVal(x); |
98 | 773 |
else break; |
774 |
if (__isSmallInteger(y)) |
|
0 | 775 |
fy = (float)_intVal(y); |
98 | 776 |
else if (_isFloat(y)) |
0 | 777 |
fy = _floatVal(y); |
98 | 778 |
else break; |
779 |
setDrawable(aDrawableId); |
|
780 |
PSmoveto(fx, fy); |
|
781 |
PSshow((char *)_stringVal(aString)); |
|
0 | 782 |
if (_INST(buffered) == false) |
783 |
NXPing(); |
|
98 | 784 |
RETURN ( self ); |
0 | 785 |
} while (1); |
786 |
%} |
|
787 |
. |
|
788 |
self primitiveFailed |
|
789 |
! |
|
790 |
||
791 |
displayString:aString from:index1 to:index2 x:x y:y in:aDrawableId with:aGCId |
|
5015 | 792 |
"draw part of a string - draw foreground only" |
0 | 793 |
|
794 |
^ self primitiveFailed |
|
795 |
! |
|
796 |
||
797 |
displayOpaqueString:aString x:x y:y in:aDrawableId with:aGCId |
|
5015 | 798 |
"draw a string - draw both foreground and background" |
0 | 799 |
|
800 |
^ self primitiveFailed |
|
801 |
! |
|
802 |
||
803 |
displayOpaqueString:aString from:index1 to:index2 x:x y:y in:aDrawableId with:aGCId |
|
5015 | 804 |
"draw part of a string - draw both foreground and background" |
0 | 805 |
|
806 |
^ self primitiveFailed |
|
807 |
! |
|
808 |
||
24 | 809 |
displayPointX:x y:y in:aDrawableId with:aGCId |
5015 | 810 |
"draw a point" |
0 | 811 |
|
812 |
^ self primitiveFailed |
|
813 |
! |
|
814 |
||
815 |
displayLineFromX:x0 y:y0 toX:x1 y:y1 in:aDrawableId with:aGCId |
|
5015 | 816 |
"draw a line" |
0 | 817 |
|
818 |
%{ |
|
819 |
float fx0, fy0, fx1, fy1; |
|
820 |
||
821 |
do { |
|
98 | 822 |
if (__isSmallInteger(x0)) |
0 | 823 |
fx0 = _intVal(x0); |
98 | 824 |
else if (_isFloat(x0)) |
0 | 825 |
fx0 = _floatVal(x0); |
98 | 826 |
else break; |
827 |
if (__isSmallInteger(y0)) |
|
0 | 828 |
fy0 = _intVal(y0); |
98 | 829 |
else if (_isFloat(y0)) |
0 | 830 |
fy0 = _floatVal(y0); |
98 | 831 |
else break; |
832 |
if (__isSmallInteger(x1)) |
|
0 | 833 |
fx1 = _intVal(x1); |
98 | 834 |
else if (_isFloat(x1)) |
0 | 835 |
fx1 = _floatVal(x1); |
98 | 836 |
else break; |
837 |
if (__isSmallInteger(y1)) |
|
0 | 838 |
fy1 = _intVal(y1); |
98 | 839 |
else if (_isFloat(y1)) |
0 | 840 |
fy1 = _floatVal(y1); |
98 | 841 |
else break; |
0 | 842 |
|
98 | 843 |
setDrawable(aDrawableId); |
844 |
PSsetlinewidth(0.0); |
|
845 |
PSnewpath(); |
|
846 |
PSmoveto(fx0, fy0); |
|
847 |
PSlineto(fx1, fy1); |
|
848 |
PSstroke(); |
|
0 | 849 |
if (_INST(buffered) == false) |
850 |
NXPing(); |
|
851 |
||
98 | 852 |
RETURN ( self ); |
0 | 853 |
} while (1); |
854 |
%} |
|
855 |
. |
|
856 |
^ self primitiveFailed |
|
857 |
! |
|
858 |
||
859 |
drawRectangleX:x y:y width:width height:height in:aDrawableId with:aGCId |
|
5015 | 860 |
"draw a rectangle" |
0 | 861 |
|
862 |
^ self primitiveFailed |
|
863 |
! |
|
864 |
||
865 |
drawPolygon:aPolygon in:aDrawableId with:aGCId |
|
5015 | 866 |
"draw a polygon" |
0 | 867 |
|
868 |
^ self primitiveFailed |
|
869 |
! |
|
870 |
||
1030
ca9d23090688
pass srcGCId to bit-blitters (req'd on WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
871 |
copyFromId:sourceId x:srcX y:srcY gc:srcGCId to:destId x:dstX y:dstY gc:dstGCId width:w height:h |
0 | 872 |
"do a bit-blt" |
873 |
||
874 |
^ self primitiveFailed |
|
875 |
! |
|
876 |
||
1030
ca9d23090688
pass srcGCId to bit-blitters (req'd on WINDOWS)
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
877 |
copyPlaneFromId:sourceId x:srcX y:srcY gc:srcGCId to:destId x:dstX y:dstY gc:dstGCId width:w height:h |
0 | 878 |
"do a bit-blt" |
879 |
||
880 |
^ self primitiveFailed |
|
881 |
! |
|
882 |
||
12 | 883 |
displayArcX:x y:y w:width h:height from:startAngle angle:angle |
98 | 884 |
in:aDrawableId with:aGCId |
0 | 885 |
"draw an arc" |
886 |
||
887 |
^ self primitiveFailed |
|
888 |
! |
|
889 |
||
890 |
fillArcX:x y:y w:width h:height from:startAngle angle:angle |
|
98 | 891 |
in:aDrawableId with:aGCId |
0 | 892 |
"fill an arc" |
893 |
||
894 |
^ self primitiveFailed |
|
895 |
! |
|
896 |
||
897 |
fillRectangleX:x y:y width:w height:h in:aDrawableId with:aGCId |
|
898 |
"fill a rectangle" |
|
899 |
||
900 |
%{ |
|
901 |
float fx, fy, fw, fh; |
|
902 |
||
903 |
do { |
|
98 | 904 |
if (__isSmallInteger(x)) |
0 | 905 |
fx = (float)_intVal(x); |
98 | 906 |
else if (_isFloat(x)) |
0 | 907 |
fx = _floatVal(x); |
98 | 908 |
else break; |
909 |
if (__isSmallInteger(y)) |
|
0 | 910 |
fy = (float)_intVal(y); |
98 | 911 |
else if (_isFloat(y)) |
0 | 912 |
fy = _floatVal(y); |
98 | 913 |
else break; |
0 | 914 |
|
98 | 915 |
if (__isSmallInteger(w)) |
0 | 916 |
fw = (float)_intVal(w); |
98 | 917 |
else if (_isFloat(w)) |
0 | 918 |
fw = _floatVal(w); |
98 | 919 |
else break; |
920 |
if (__isSmallInteger(h)) |
|
0 | 921 |
fh = (float)_intVal(h); |
98 | 922 |
else if (_isFloat(h)) |
0 | 923 |
fh = _floatVal(h); |
98 | 924 |
else break; |
0 | 925 |
|
98 | 926 |
setDrawable(aDrawableId); |
927 |
PSnewpath(); |
|
928 |
PSmoveto(fx, fy); |
|
929 |
PSlineto(fx + fw, fy); |
|
930 |
PSlineto(fx + fx, fy + fh); |
|
931 |
PSlineto(fx, fy + fh); |
|
932 |
PSlineto(fx, fy); |
|
933 |
PSclosepath(); |
|
934 |
PSfill(); |
|
0 | 935 |
if (_INST(buffered) == false) |
936 |
NXPing(); |
|
937 |
RETURN ( self ); |
|
938 |
} while (1); |
|
939 |
%} |
|
940 |
! |
|
941 |
||
942 |
fillPolygon:aPolygon in:aDrawableId with:aGCId |
|
943 |
"fill a polygon" |
|
944 |
||
945 |
^ self primitiveFailed |
|
946 |
! |
|
947 |
||
5015 | 948 |
drawBits:imageBits depth:imageDepth width:imageWidth height:imageHeight |
98 | 949 |
x:srcx y:srcy |
950 |
into:aDrawableId x:dstx y:dsty width:w height:h with:aGCId |
|
0 | 951 |
"draw a bitimage which has depth id, width iw and height ih into |
952 |
the drawable. draw a region of w/h pixels from srcx/srcy to dstx/dsty. |
|
953 |
It has to be checked elsewhere, that server can do it with the given |
|
954 |
depth; also it is assumed, that the colormap is setup correctly" |
|
955 |
||
956 |
^ self primitiveFailed |
|
957 |
! ! |
|
958 |
||
959 |
!NeXTWorkstation methodsFor:'events'! |
|
960 |
||
961 |
eventMaskFor:anEventSymbol |
|
962 |
^ self primitiveFailed |
|
963 |
! |
|
964 |
||
965 |
setEventMask:aMask in:aWindowId |
|
966 |
^ self primitiveFailed |
|
967 |
! |
|
968 |
||
969 |
exposeEventsFor:aViewId do:aBlock |
|
970 |
! |
|
971 |
||
972 |
eventPending |
|
973 |
"return true, if any event is pending" |
|
974 |
||
975 |
^ false |
|
976 |
! |
|
977 |
||
978 |
eventPendingWithoutSync |
|
979 |
"return true, if any event is pending" |
|
980 |
||
981 |
^ false |
|
982 |
! |
|
983 |
||
984 |
eventsPending:anEventMask for:aWindowId |
|
985 |
"return true, if any of the masked events is pending" |
|
986 |
||
987 |
^ self primitiveFailed |
|
988 |
! |
|
989 |
||
990 |
eventPending:anEventSymbol for:aWindowId |
|
991 |
"return true, if a specific event is pending" |
|
992 |
||
993 |
^ self primitiveFailed |
|
994 |
! ! |