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