Motorola Mobility, Inc. v. Microsoft Corporation
Filing
127
NOTICE by Microsoft Corporation re #126 Defendant's MOTION for Summary Judgment (Redacted) of Filing Exhibits (Attachments: #1 Appendix Statement of Material Facts, #2 Appendix Index to Exhibits, #3 Exhibit 1 (Part 1), #4 Exhibit 1 (Part 2), #5 Exhibit 2, #6 Exhibit 3, #7 Exhibit 4, #8 Exhibit 10, #9 Exhibit 11, #10 Exhibit 12, #11 Exhibit 13, #12 Exhibit 14, #13 Exhibit 17, #14 Exhibit 19, #15 Exhibit 20)(Miner, Curtis)
EXHIBIT 1
PART 2 OF 2
1127
1128
1129
1130
II 31
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
]150
1151
1152
1153
1154
1155
1156
1157
1158
1159
scrQll(direction,nodel
~eg~ster char
dIrection;
regIster MAPNODE
*nodei
(
register char
*reply;
.
reglster short low row, low col, pict ht, Plct wd, *Pi
short
roap:row, roap:col;
.if (node && node->picture.pid && noQe->window.pid && !node->roetaphor)
if (reply ::: Call(DIRECT,node->wlndow.pid,Newmsg(64,lIquery",NULL),0,0))
{
if (p == (short'll) Find triple(reply," v iew",O,NULL,4,NULL))
(
map row = *p++;
map-col::: *p;
Free(reply) ;
reply =
.
Call(DIRECTtnOde-~picture.pld,NewmSq(32LltqueryItLNULL) ,0,0);
P.= (short *) F nd trIple(rep1y,"size",O,NU IJ,4,NOL)i
p~ct ht ::: *p++;
lct-Wd == *p'
::: 1short ~{ Find triple(reply,"low II,O,HULL,4,NULL};
ow row ::: *p~+;
lOW--C91 = *p.
scroll ~os(hbde/direction,
.
&ma row,&map yOl,loWtrow,low col'F-lct ht,Plct wd);
Put(DIR ';T,node->Wlndow.p 'd,t;lewlllsg(64, 'mapit,
"to=#C; at=#2s",&node->plcture/map row,roap col)) ~
~ree (reply) ;
-
~
Q
~
lJl.
lJl
o
00
lJ.,)
N
\D
~
~
S
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
scr9 11 pos(node~direction,map row,map c01,low row,low c01,pict ht,pict wd)
reQlstet MApNOO~
*node·
reOtster char
direcfion'
feglster short
low_row, iow_col, pict_ht, pict_wd, *map_row, *map_col;
switch (direction)
(
.
case 'u':
if (*map row - low roW >=== VCHAR liT)
*map-row -= VCHAR UTi
Qreak· case 'd':
If {olct ht - (*map row-low row) - node->height >"" VCIIAR HT)
~map-row += VCHAR liT;
Qreak; case 'I':
If (*map col - low col >= VCHAR WO)
*map-col -= VCHAR WO;
Qreaki case 'r':
If (Olct wd - (*map col-low col) - node->width >= VCIlAR WD)
~map-col += VCHAR WO;
Qreak' -.
case 'U':
If (*~ap row - low row >~ node->height)
*map-row -= node->height;
else
*map row = low row;
Qreak' case '0':
If (oict ht - (*rnap row 7 low row) >= 2 * node->height)
~map-row += noHe->helght;else
*map row = pict ht - low row - node->height;
Qreaki case 'L':
If (*map col - low col >= node->width)
*map-col -= node->width;
else
*rnap col = low col;
Qreak' case 'R':
If (olet wd - (*map co1,- low col) >= 2 * node->width)
~map-col += nooe->wldth; else
.
*map_col = pict_wd - low_col - node->wldth;
!tool
ffi
U'I
Ut
o
N
00
w
\0
!tool
~
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
]214
1215
1216
1217
]2]8
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
notify process(node,row~col,act,area,hdr,indic,active)
reglstet MAPNOOE
*noae;
reg~ster P E nOR
*hdr;
regIster char
Qct, area;
char
1ndIo;
short
row, col;
MAPNODE
*accive;
{
register char
*p *m'
len == 6;
regIster lnt
~
Q
(Jl
if (hdr)
len::::: *{short *) h4r'
Newmsg( en+200 'clIck",
"from=iCj map=~C; name::;:#S; actn=#b; what=#b; pos=#2slt,
.
&node->wlndow,&node->plcture,node->name,act,atea,row,c01);
1 f (hdr)
{
p = Append triple(m,"data",lent6 hdr);
{(P E HDR*Tp)->attr.se1ected = N6 ;
P +~ *(~hort *) p;
Lonq alIOn(p);
*(sftOrt ~) p = NULL;
(indie)
,
ApP(y'!nd triple(m,Uchar",l,&indic);
If (activer
Append triple(m,"actY",4(&active->owner);
Put(DIRECT;node->owner.pld,m,;
U1
ill :::::
'lit
a
Co
N
W
\0
If
~
Q
~
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
Met 9phor(screen,map,buf,size,output,dialogue)
regtster SCREEN
*screen;
reglster LIST
*map;
reqister long
buf, size, output:
CONNECTOR
*dlalogue;
{
register short
*p;
regIster MAPNODE
*node;
screen->meta row = screen->m~ta col = 0;
screen->meta-ht = screen->h~lght;
l?creen->meta""'7Wd = sc;reen->wIdth;
If (node ~ create wlndow(screen,rnap,output,"Metaphor",buf,size))
(
maR->metaphor = node;
noae->owner = *Qialog~e'
p :=: (short *) FInd trlPie(buf,"area",size,none,8,NULL);
screen->meta row =-*~+~;
screen->meta-col = * ++;
screen->meta-ht = *~ +;
screen->meta-wd = * ;
node->m~taDhor = no e->never = node->keep open = YES;
node->flxea = node->nonmod =tl YES;
Reply(buf,NewJnsg(32,lI co nnect ,uconn=#C",&node->window)) :
}
else
rep1y_status(buf,"-Metaphor","can\·t create \'window\''',O);
~
S
lJl
l.n
o
N
00
w
\D
~
Q
oc
]261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
J274
1275
1276
1277
1278
1279
)280
1281
1282
]283
1284
1285
)286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
MAPNODE *creRte terminal(screen,map,output,buf,size,sender)
SCR~EN
*screen;
reqlster LIST
*mapi
COANECTOR
*output;
register long
buf, SIze, sender;
(
static char
def type(] = "//processes/terminal";
reglster MAPNODE
*node,
reqlster char
*p;
CONNECTOR
terminal;
if (Find triple(buf,"name",size,NULL,l,NULL))
{
if (t<;rminal.pid :::: NewProc(ttTerminal",
Flnd_trlple(buf," emul",slze,def_type,l,NULL) ,YES,-l))
p = Alloc(size,YES);
memcPYIP,OUf SIze};
memcpy p s~nder,slzeof CONNECTOR});
memc~y ptslzeOf(CONNecfoR) .&terrnlnal,sizeof(CONNECTOR)):
p:::: a l(DIRECT,termlnal.pld,p,O,O);
If (.strcmp{p,"create")
. ,
&& (noae = create window(screen,map,output,"Hlndow",p,Slze)))
(
node->terminal = ~ode->owner ~ terminal;
Free (p) ;
return(node) ;
}
}
}
reply_status(buf,"- c reate","cal1\'t create \'terminal\'",O);
else
reply status(buf, "-create", "(terminal) no hame giventl,o);
returntNOI:;L)i
~
Q
\C
lJl
'tt.
o
N
00
V.)
1.0
~
~
Q
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
])20
1321
1322
1323
1324
1325
1326
1.327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
MAPNODE *create window(screen,map,output,proc,buf,size)
SCREEN
*screen;
LIST
'map;
CONNECTOR
*putput;
char
*proci
reglster long
buf, size;
{
.
def outl[4] = (G~EEN,3,BLACK, '5')1
static char
'WIndow name, ~tltle, *Pi
reglster char
Dlct ro~ = 0, Plct col = 0;
reglster short
~node·
reglster MAPNODE
out cir~ out fill, pane cIr;
char
*ne~_noQe();MAPNODE
if ((window name = Find tripl,fbuf,"name",size,NULL,l,NULL))
&& (node = new nod,rmap wlndow name)~
&& (node->window.pld = NewProc1proc, '//processes/window",YES,-l)))
m~p after(node,~ULLlmaQ)' .
.
tl~le = Flnd trlple(~ut Atltl",size,wlndow name,I,NULL);
Inlt node(node/hvf/sl~e{;
strcpy(node->devlce,FlnCl triple(buf,"from",size,none,2,NULL)):
strnc~y(nod,->term
FInd trlple(but, "mod" ,size,none, 1,NULL) ,sizeof(node->term) -1);
strnCPYlnOd,->sfeclaA,
F:j.hd trl pIe bu f, I spec" , size, none, 1L NULL1 sizeof (node->special) -1) ;
P = Flnd-trlple buf,"outl",slze,def ou~1,4/N 6LL};
out clr ~ *pt+;
node->outline ; *0++,
if (I (out fill = ~P+T))
out fill = BLACK'
if (1 (node->style = ~p))
node->style = 'S';
node->pane == 0;
pane cIr 7 out 91r;
If (p = Flnd trlple(buf,"pane",size,NULL,2,NULL))
{
pane clr :::: *p++;
node-=:>pane = *p;
~lse if (node->Hscrol1 I I node->Vscroll)
node->pane =; 1;
tf (p = Fifld_trlple(buf,"map ",size,NULL,8,NULL))
node->picture = *(CONNECTOR *) p'
if (*(Iong*) (p-4) > sizeof(CONNECTOR))
{
~
~
~
lJ't
U.
S
be
I..J,.)
\0
~
~
N
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
135S
1356
1357
1358
1359
1360
1361
1362
1363
J 364
1365
1366
1367
1368
1369
1370
1371
1372
1.373
1374
1375
1376
1377
1378
1379
1380
1381
]382
1383
1384
plct row
Plct:col
=
=
*'
*(short *) (p + sl'zeof(coNNECTOR));
*(short
(p + 5 zeof(CONNECTOR) + sizeof(short)};
lf (init window(screen,node,o~tput,title,pict row,pict col,
out_clr/out fl11,O,pane_c1r))activate(node) ;
clip window(map->last);
return(node) ;
)
1-1
1-1
!.JJ
)
reply status(buf, "-create", " (window) ",0) ;
return (NULL) ;
init node(node buf,size\
reglster MAPNODE
*noae:,
reglster long
buf, SIze;
{
static short
def pos[2] = (O,O), def size[2J = (S,lO);
reglster char
*pI
P ::::: Fin d t rip 1 e (b u f I " po S II f s i z e Ide f po S I 4 , NU LL) ;
node->row = ~l(shor~ ~) p)~+;
node->col : : : * short *) ;
p : : : Find trip' e(bUf,lIsi~e"Lsize,-def size,4,NULL);
node->out ht : : : node->helgh~ : : : *((short *} p)+t;
node->o~t-wd : : : node->Wldth : : : *(snort *) p'
"
node->tltle == check bar(buf "toa n VCHAR fIT) ;
node->menu = check bar(Bufl~mbar' ,~CHAR HT) ~
node->Vscroll = clre:ck oar (DU f I "vbar ll , YES) ;
node->Hscroll = check-bar{bufltlhbar" YES)'
node->general use = check bar~buf,lIg6arll,YES);
node->corner ~ check bar(buf,,'corn",YES)'
node->resize box = check bar(buf 'rslz" YES)'
if (node->patette = check bar (but I "pbar(' I 5*VCHAR WD})
node->palette t= 2 *VCHAR WO;
window_optlons(node,buf,slze)T
lJ\
'lit
o
N
bo
w
\0
1-1
1-1
,J:.
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
cheQk bar(ptr,kevwLdeflt)
keglster char
~pcrf. *keyw;
regIster short detl ;
{ register short *p;
if (! (p = (short *) Find triple(ptr,keyw,O,NO,O,NULL)))
r~turn(NO) :
else If (p == Ishort *) 1)
return(det t);
else
return(*p) ;
~
~
ttl
U\
"Ul
8
00
W
\0
~
~
="
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
win~ow options(node/buf~size)
reglstEr MAPNODE
*noae;
regIster long
buf, size;
(
register char
*options, opt;
op~ions : : : Find triple(buf,"wh e n",size,none,l,NULL) 1
whlle (opt = *optlonsf+)
sWItch (opt)
{
case 'S':
node->on element = opt; break;
case 'X':
node->on-cancel = 0Et; break;
case's':
node->on-select = o~t; break;
case 'a':
node->on-open = opt, break;
case 'M':
node->on-modify = opt; break;
case 'e':
node->on-clQse ~ opt; break;
case 'Q':
node->on-ql).lt = oDt; break;
case 'WI:
node->on~lndow eBqe - opt;
break;
case 'P':
node->on-plcture edge = ope; breaK;
case 'A':
node->on-anychar-::::: opt; break;
case 'D':
node->on-de1ete::::: opt; break;
case 'B':
node->on-box = opt; break;
case 'L':
node->on-location::::: opt; break;
case 'N':
node->on-lnsert = opt; break;
opti6ns = Find triple(bUf'''o~t ",size,none,l,NULL};
WhIle (opt = *optlons++)
sWItch (opt)
{
node->auto highlight = opt; break;
case 'II' :
node->edit,ble = opt; break;
case , E'I :
:
node->multl select = opti break;
case ,, S :
X,
node->never-~ opt;
breaK;
case
node->remap = opt- break'
case 'B' :
node->nQnmod = opf; break;
case 'N I :
node->flxed = opt; break;
case 'F' :
node->keep open = opt; break;
case '0 ' :
node->mQve-mark = opt: break;
case 'M' :
node->tlght = opt; break;
case t'+'t.:
node->plcture.pld = NULL;
case -
.
~
~
-...l
U't
1.J.
o
N
~oo
LN
\0
~
)oM
Q()
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
init window(screen,node,out~ut,title,roW/Col,out elr,out fi11,out pat,pane elr)
reglster SCREEN
*screen,
reqlster MAPNODE
*node;
CONNECTOR
*output·
register short
row L coi;
reglster char
*ti~le;
regIster char
out cIr, out fill, out pat, pane elr;
{
reqister char
*ms g "
Ine
resu i t = NO;
if (node->style == IS' && (screen->colors < 7 I I !screen->bit map))
node->styl~ = IS';
if (nOde->outllnej
.
out linefnode ;
If (nod~->pa ette
node->left = node->palette"
if (node->r~slze box I I node->Vscrol1)
node->rlght T= VcfiAR WO;
if (node->corner && lnode->palette)
node->left t= VCHAR WD;
if (node->menu I I node-~general use)
nQde->bottom = VCHAR HT * 2T
else If (node->Hscrolll nod~->bottom == VCHAR liT;
align wlndow(screen,nQdeT;
msg =-Newms g (30 Q
O'''lnlt lt ,
l'pos=#2S; SlZ~= 25; outl=#5b; Rane=H2b; marg=#4s; scrn=#4s; outp=#Ci \
self=RC; map=nC 25' name=RS; :r ly"
node->row,node->cot,node->h~ig t,n6de->width,
out clr,node->outllne,out fllI,out pat,noQe->style,pane elr,node->pane,
node->top,node->bottom,node->left,node->rI9Qt O,O,screen->height,
. . screen->Wldth~out~ut,&node->Wlndow,&node->plcf.ure,row,col,node->name):
lnlt frame{msq noae,tltle,out cIr);
msg ~ Call(DIRECT,node-~wlndow.pla,msg,o,O);
result = strcmp(msg,lIfalled");
Free(msg) ;
return(result) ;
~
~
\C
VI
"ut
S
00
W
\0
~
~
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
out line(node)
register MAPNbOE
Anode;
{
node->outer = node->outline + node->pane + (node->outline && node->pane)
(nQde->height/lOO + node->wldth/100 + 2);
if (node->tlght)
{
node->tog = node->bottom = node->outer;
node->left = node->rlght = node->outer+ node->width/200;
J
else
{
node->top = VCHAR HT;
node->bottom = node-~outer;
node->left = node->rlght = VCHAR WD;
}
If (node->style == '5')
(
node->bQttom += 5;
110de->rlght t= 5;
*
~
N
~
U!
yU!
o
tv
"00
1504
w
1.0
~
~
1505
1506
1507
1508
1509
1510
15]1
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
]525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
] 544
1545
1546
1547
1548
1549
init frame(msQ6nOde,title,out clr)
reg1ster MAPNO E
*node;
reglster char
*rnsg, *titIe, out cIr;
(
char
tn, *frame barf) •
reglster char
scroll clr-;:: (4~i6)tYELLOW, title clr = WHITE;
reql$ter P E IIDR
*hdr; statlc shortup arrowr] = (7 0,0,6,7,12 7 9 10,9,10 3,7 3 7 01*
statlc short
down arr6w[1 = {3tO,3,3,0,1,6/963£913,i2L161t,1,O\1"
stat-l-c short
l~ft-arrow[ = 6 0 0 7 3 7 3 1 ~ 0 9 I It,l,b,6 ;
stat~c short
rlg~t arrow 1 = {j~6,j6j66~16~6l6~12~1t9t3,9t063~O ;
statIc long
reSIze syrnb In == OxO 07rB
x7r80/ftlO ox7r'8 7r8
Ox7f807fc4,OxOOeco 7c,OX003co67c,oxOOfco6oo,oxooooo6oo};
if (node->title)
(
n = fr~me bar(mS! "top",400, 'T',O O,node->title,lOOO O,out cIr 0 NO)l
draw fIlled rect tn6o1o,node->tlti'L1000~NULL(OiOlout clr,o,o,6,6,"a ' );
draw-rect(&n,5,1 1
0 "CLQSEr" tn:le c+r 's
,"S"lT
Qraw-te~t(&n,O,3*VcHAR WD,tItle,('NAME"-;-tltie cir,o,NULL,NULL);
1 f ("!"node->nonrnod)
{
hdr = (P E HDR *\ start rnacro(&n 0 1000
VCBAR HT-2,2~VCHAR WO, 'N' "FiLL!1I 0'0 "Sail) i
draw r~ct1&n,3,OlVCHAR-HT-7A2!VCHAR wD-4{NULL,t..tltle clr, 'S',l,NULL);
draw-fIlled reQtl&n,6,3"6VCH R HT-1472*VCIAR WlJ-lO, .
NULL,OtO/title clr, IO,O,O,NULL,;
end rnacro(~n,hdr);Jraw end (&n) ;
}
If (node->Vscroll)
(
n = frame bar(m~gl"rght",400, IV',node->paDe-11node->pane-l~790,
node->rlgnt-node->Qane-node->outllnet"out clr,BrA~K,l,NO):
draw rect(&n,node->Qane,noae->pane,VCHAR HT-4,
node->riaht-(noae->pane\-l node ->outline),
"SCROLL!" scroll clr,'si ,"Sb");
draw poly(&n,A75 node->pane+i
S,up arrow "UP!",scrolI cir,o,o,'S' ,O,l,"Sa ll ) ;
draw pOly(&n,9~O,node->Dane~1
8 ' down arrow "DOWUt" , scroil cIr , a I '
a's' I I1' "Sa ll ) .,
raw_en d ( & ) '
n;
d
°
jooo&
N
!.H
VI
lI!
t8
"00
f.i.)
\0
jooo&
~
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
157]
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
if (node->I1scroll)
(
n = frame bar(ms~ "bot II 400, 'H' node->pane-l,O,
node->bo tom-LRode->fiane1-cnode->outllne)+2,
910,out clr,B CK,l, 0);
.
draw rect(&n node->§ane,node->§ane,
node->bottom-no e->Eane-no e->out11ne
2*VCHAR WD-2,"SCROL !" scroll clr, 'S':l,"Sb");
draw polt(&n,node->~anr 955/
8,le t arrow/ilL FT (, scroll clr,o,O, '8' ,0,1,"Sa");
draw poly(tn,node->~ane 990,
0 ,
'rl(l1t arrow"
,
d raw Eend & r ' 1GBTI" , scroll - clr " 0 'Sf , ,1 IISa")',
n;
}
lf (node->menu)
frame bar(ms~ "bot" 200, 'M' node->pane-1,O,
node->bo tom-~node->paneI-(nOde->outllne)+21
1000,out clr, LACK,I,YES ;
if (nOde->general uset
frame ar(ms~-lIbo II 200, 'G' node->pane-l,O,
node->bo tom-~node->paneJ-(nOde->outllne)+21
.
1000 0ut clr, LACK,I,YES i
If (node->ga 1etta)
frame ar(ms1 "left",200, ,pl,o,node->~ane,lOOOO,
node-~le t-(node->pane)-(node->ou line)-I,out_clr,BLACK,l,YES);
.
If (node->reslze box)
(
n = frame bar(msg IIrbox",200,NULL,O
0 0 scro~l clr,B[ACK,l NO~'
draw symbol(&n,O,6,16,16,reslze symboi,('R8SIZE.",scroll clr,6,11 i,) i
draw-end(&n);
}
lf (node->corner)
frame_bar(msg,"lboX",200,NULL,0,0,O,0,out_clr,BLACK,1,YES);
~
N
til
°
~
U1
"U1
0
J0
00
V.J
\0
°
~
N
Q\
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
]602
1603
1604
}605
1606
1607
1608
1609
1610
1611
J612
16J3
1614
Cllar *frame bar(msg,keywLsize,type,row,col,height,w!dth,color,fill,thick,end)
regIster char
*msg, *Keyw; .
char
type, color, fIll, end;
reglster short
row, col, height, width, size, thick;
(
char
*n;
n = Append triple(msg,keyw,size,NULL);
*n++ = typl:!";
draw filled rect(&~lrow,col,heig~tLwidth,
.
NULL,cotor,O,fl I,D, 'Sf ,0,tfilcK,"a");
If (end)
drawend(&n);
return(n)i
""'"
~
LIl
u-.
o
set+user(name,buf,size)
teg+ster NAME
*name;
regIster long
buf, size;
(
register char
*p;
if (p = Find triple(buf,"name",size,NULL,2,NULL))
(
strclv(name->user,p) ;
Note l1si ned on" };
Put( LL,~III",NeWJrtgg(128,IIUII,lInarne=#S"'p));
N
00
W
1.0
N"
""'
QC
1615
16]6
1617
]618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
chanqe(screen,map,rnsg)
SCREEN
*screen;
LIST
*map;
HESSAGE
*msg;
{
register CONNECTOR *window, towner = NULL;
reglster short
*P;
reglster MAPNODE
*node;
if (window:::: (CONNECTOR*)Find triple(msg->buf,"conn",msg->size,NULL,8,NULL))
{
for (node = map->first; n~de &~ node->window.pid 1= window->~id
~& node->ternllnal.pid T== wlndow->pid; node = node->nxt) ,
if (node)
{
if (p ==, (short*) Find triple(msg->buf,"size",msg->size,none,4,NULL))
.
r~slze(~creen,node,*p *(p+1));
.
1 f (F lnd tr lple (msg->buf I ('actv" , msg->slze, NULL, 0, NULL)
&& I node->neyer)
.
map->actlve :::: node;
If (owner =
.
.
(CONl;lECTOR*) Flnd triple(msg->buf,"ownr",msg->slze,NULL,O,NULL))
If ((long)owner == 1)
owner = &msg->sender;
if (owner)
{
node->owner = *ownerj
if (node->terminal.pld)
{
Forward(DIRECTtnode->terminal.pid,msg->buf);
msg->buf :::: NUL i
}
61ip_windOW(map->last) i
~
N
\t:)
1Il
'LIt
o
N
00
W
\0
~
(.H
Q
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
h igl~l ight (node map )
ieglster MAPNO 6E
*node;
regIster LIST
*map;
(
if (node && node 1= map->last active)
{
if (!node->metaphor)
{
~
w
~
Put(LOCAL,lIwindo~11
.
Newmsg(r;i4 "hlg61iqht" , "bar=Ub' tag=#S", 'T',"CLOSE1"));
If (node-}Wlndow.Qld &~ node->tltie)
Put(DIRECT,noae->wlnd9w.pid
Newmsg{128, "highlIght", (toff; bar;;;;#b; tag;;;;#SII, 'T' ,"CLOSE! "));
lJl
If
"vi
o
N
"cxl
w
(node->window.Qid\
.
Put(DIRECT,noae->window.pld,Newmsg(32,"k e ys?",NULL)) ;
map->last_actIve = node;
1.0
mark(rowLcol,picture)
row, col;
reglster CONNECTOR
*picture;
(
Pu t (DIRECT picture->pid, Newmsg (32, "mark" , II a t=# 25" , row, col) ) i
mov~
teg~ster shor~
I
~
~
1681
1682
1683
1684
1685
1686
1687
1688
]689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
}700
1701
1702
170)
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
clip window(node)
regIster MAPNODE
*node;
{
regjster MAPNODE
*t,mp;
reglster short
prlO = 127, count, *count addr, *n;
char
'm;
for ( ; node; node = node->pre)
{
m = Newmsg(1000 l "cut" (tlinlJ1=#s#$#A" ,priC;>--fo, 950"NULI.I);
count addr = (snort *1 (FInd trlple(m, "lnH '11,O,NuLL,O,NULL) + 2);
n = count addr + 1#
count = OT
for (temp = node->pre; temp; temp = temp->pre)
(
*n++ = temp->row;
*n++ = temp->col;
*n'.+ = temp->out ht;
*n++ "'" temp->out-wd;
count++:
lcount addr ~ count:
Put(DIRECT,node->wlndow.pid,m) ;
~
tu
tu
LII
"LII
a
N
be
w
\0
MAPNODE *find window(map,window,row,col)
register LIST- *m~p·
register WINDOW *Wlndow ·
regIster short row, co i ;
{
.
regIs t er MAPt,lODE
*node;
for (node = map->first; node; node = node->nxt)
(
QuerytwindoW(windOW,node->window,row,col) ;
If (wndow->area 1= IN')
break;
}, d ow->preV10US ~ wln d ow->no d e;
.
.
Wln
return(wlndow->node = node);
~
tu
.j:;;..
1724
1725
1726
]727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
174
1741
°
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
]753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
query window(window"conn,row,col)
reqlster WINDOW *wIndow;
CONNECTOR
conn;
register short row, col'
(
register char
*p, *reply;
if (window-;->hdr)
Free(wlndow->hdr):
w!ndow->tldr = NULL;
wlndow->elem row = window->elem col = -t.:
reply,= call1DIRECTlconQ.pid,Newmsg(64,y 'w"c"inHI=#2s",row,col) ,0,0);
p = FInd tJ;lPlelrep Y(llnHI",o,none,l,NULL/;
p += 2 *-slzeof short,;
~tndow->area·
p++;
wlndow->bar = *t l +;
wlndow->row = * short *
++;
wlndow-~col(p)= ; * ~short *J ~l++;
~Jong alIgn
If {*(short*)p)
{ window->l)dr;= (P E HOR *) Alloc(*(short*)p,YES);
memcPy(wlndow->htlr,p,*(short*)p);
~ree(replY) ;
MAPNODE *new node(map,name)
register LIST
*map;
reglster char
*narne;
(
reg1.ster MAPNODE
*node = NULL;
regIster short
i;
for fi = POOL SIZE, node ;= rnap->pool; node->pool && i; ++node, --i)
If (.I)
.
node = (MAPNODE *) Alloc(Slzeof(MAPNODE),YES);
mernset(node,O,sizeof(MAPNODE)) ;
nOde->r001 = 1;
strcpy node->name,narne);
return node) ;
1-1
~
til
1II
u-.
S
00
t,;.)
\0
1-1
~
="
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
·1811
1812
1813
1814
1815
fre~ node(node)
*node;
regIster MAPNoDE
(
if (node->pool)
node->pool "" NULL;
else
Free(node) ;
map after(node pred,mapl
tegtster MAPNObE
*noBe, *pred:
regIster LIST
*map:
t
if (pred)
{
no d ·
e->nxt = ~red->nxt;
node->pre = red;
if (pred->nx )
{pred->nxtl->pre = node;
pred->nxt = noae;
}
else
{
if (node->n~t = map->firstl
(map->fIrstl->pre = noae;
node->pre = NULL;
)
If (!node->pre)
map->first = node;
if (!node->nxt)
map->last = node;
++map->count;
unmi"j\p(node map)
teglster MApNODE
Anode;
regIster LIST
*map:
(
if (node->pre)
(node->pre)->nxt "" node->nxt;
else
map->first = node->nxt;
if (noae->nxt)
(node->nxt)->pre = node->pre;
else
map->last = node->pre;
--map->count:
~
W
....:J
U\
'til
o
N
00
w
\0
~
w
00
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
]827
1828
1829
1830
1831
1832
1833
1834
1835
rem?p(window node new oiyture,map,sell
register CONhECTOA
-~wlndow, *new picture;
reglster MAPNODE
*node;
regIster SELECTION
*se1;
LIST
*map;
{
if (window)
for (node = map->firsti
.
node && wlndow->pld 1= node->wlndow.pidl node = node->nxt)
if (node)
{
~nd edit(node, 'x' O,O,NU~L};
If 1new picture &t new plcture->pid 1= node->picture.pid)
if Thode == sel->map)
{
sel->map = NULL;
sel->pehding = NO;
}
node->picture = *new_picture;
"'""
t".l
\Q
1II
lit
o
tv
00
w
\0
]836
1837
01::0.
"'""
Q
1838
]839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
align window(screen,node)
teglster SCREEN
*sereen;
reglster MAPNODE
*node;
register short temp;
(
if (sereen->ehar align)
{
if (node->ti;ht)
(
temp:::: ((node->row % VCHl\R liT)
node->outer
node->row = (node->row I VCHAR fI' ) * VCHAR HT
temp = (lnode->col % VcHAR WD)-I node->outer
node->col = (node->col / VCHAR W )1* VCHAR WD
(node->outer + node->w dth/200t +
It
{
]858
1859
1860
}
If
if
if
if
if
{
1861
1862
1863
1864
1865
1866
1867
1868
}869
1870
1871
1872
1873
1876
1877
1878
~
? VCHAR lIT : 0);
- node-?outer + tempi
? VCHAR_WD : 0);
temp;
else
1856
1857
1875
~
)
1855
1874
~
)
}
node->row =:: ((node->row + VCHAR IIT-l) I VCHAR 11'1') Ie VCHAR liT;
node->col == (( node->col + VCH.AR-WD-l) - - - i
- ! VCHAW-WD) * VCHAR-WD
(node->row < screen->meta row)
node->row += (screen->meta row + VCHAR Il'r-1) / VCHAR liT Ie VCHAR liT;
(node->col < sereen->meta col)
node->col += (screen->meta col + VCllAR WD-l) / VCHAR WD Ie VCIIAR WDi
(node->out ht > screen->meta ht)
node->helght :::: screen->meta-ht - (node->top + node->bottom);
(node->ol,1t wd > screen->meta-wd)
node->w14th = screen->meta wd - (node->left + node->right);
(! node->tlght)
temp = (node->height % VC;HAR liT 7 VCHAR liT : 0)·
node->height = ! node->helght1VCHAR BT) 1r VCHAR {IT + temp;
temp == (node->wldth % YCHAR WD 7 VCIlAR WD : O)-r
node->wldth :::: (node->wldth/VCHAR_WD) *-VCHAR_w6 + temp;
node->out ht = node->h~iqht + node->top + node->b<;>ttoIDi
node->out--wd = node->wldth + node->left + node->rlghti
Ul
lJ1
o
N
"00
l;.)
\D
~
~
1879
]880
]881
1882
1883
]884
1885
1886
1887
l888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
190']
1908
1909
1910
1911
1912
1913
1914
1915
1916
191.7
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
status(msg size)
reg+ster char
*~sg;
regIster long
SIZe;
{ register char
*m;
*(m = Alloy(size,YES)) = NULvi
strcat m,Flnd trlple(msg,lorlg",size,none,l,NULL));
strcat m il II} .....
strcat m:FiDa'triple(msg,"stat l ,size,none,l,NULL));
strcat millo- II ) •
strcat m;,Find trlple(msg, "reg ", size,none, 1, NULL)) ;
Note(m II.t!RROR");
Free(mJ;
reply status(req,mid,stat,code)
reg+ster char
*req, *mld, *stat;
reglsterlong
*code;
(
register·char
*type, *msg;
type = "failed'"
If (!mid)
,
tyge = "status'"
else +t l*mid == ,_I)
mld+-f. ( .
else If (*mld == '+')
{
tyg8 = "done";
mlCl++ ;
}
msg = N~wmJq(strlen,stat)+10i tyne,
"Qrlg= s· stat= s· code:::: 1" , "console" " ,
stat code)'
if (mId)'
,
(
Append triple(msg,"req ",strlen(mid)+l,mid);
Reply(req,msg);
}
else
Put(DIRECT,(long)req,msg) ;
info(dialogue,string,window}
CONNECTOR
dlalQgue, wlndow;
register char
*strIng;
(
Put(DIRECTJ,dialogueLpid,Nfi!wm!ilq{strl~n(strlng)+loo("info ",
"text=lIS; near=ffCi walt=Rs",strlng,&WlndoW,5)};
~
.a:o.
~
U\
"v-t
f3
be
w
\0
~
.a:o.
~
Moduie ..... .
Date submitted
Au t.l19r
Ongu;J ,
Descrlption
y
10
11
12
13
)4
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
3~
35
36
37
38
39
40
42
4]
44
45
46
41
48
49
50
51
41
52
53
54
55
56
57
58
59
60
%M% %1%
%E% %U%
Frank Kolnick
cX
Picture Uanager
****************************************************** ************1
#ifnc)ef lint:
~
statIc char Srcld[] :::: U%Z% %M%:%I%";
#endlf
1*
Picttif~·
.
manager:
_
global data
~
*1
1* eX definitions *L , ,
,!lnCIUde
1* picture, etc. definltlons *1
Illclude
Include
lllc.Jude
statIc long none:::: 0:
It links picture elements: *1
typedef struct element node
{
->next nQde *1
struct element node *nxt;
->precedlnq node *1
~z
strl,lct element-node "'pre;
'element bas changed' *1
uI1s1gned char changed;
/.Z
'element IS markea' *1
tJllslgned char
markedt
'no longer in use' */
unsl.gned char
deletea;
'local Duffer pool' *1
uI1s1qned char
paoli
(start of element) *1
shore
.
1el1gch;
1* boundary HU*I
1***** HOTE: 'length' must start on a long-word
/.:
EL:ENENTi
lypedef struct current state
(
*msq;
char
sti!nderl
CONN EC'l'OR
SIze;
long
app1;
long
appi row, appl col;
sllorl:.
owner;
CONNECTOR
*mark;
char
told mark;
char
*~rase mark'
char
dl!';1play mark;
unslgned char
prlvateT
unSIgned char
checki
llllslgned char
d~bug'
unsIgned char
hlghI1ght;
cllar
32
char
11 9 1l18! 64 :
file
char
stat s 'odej
long
*status strIng:
char
CURHENT;
1;
'"0
::0
o
~
~
lJl
r-<
tr.
o
N
00
I-!
~
I-!
Z
W
I.D
G)
td
1* current data: AI
~!
/.!
/.:
/.:
~:
/.:
/.:
/.!
~:
->current msg. *1
c9nn. to msg. sender *1
Slze of msg. ~I
releyantjapplle~tJon *1
appllcatoh 'orlgin' */
conn. to owning proc. *1
current mark element */
copy of previous mark *1
Tl~ment to erase mark *1
dl~play m~rk' */
'prlvate~Plcture'
'ch~ck St~e'
AI
*1
'prInt dlQgno~tic~' */
type of highlightlng *1
Plcture's na~e *1
pIcture file s name *1
current status •.. *1
... *1
~
.a;:.
~
61
62
63
61\
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
BB
89
90
91
92
93
94
95
96
97
98
99
100
101
)02
10)
104
105
JOG
107
lOB
109
110
]11
112
J13
114
ll5
116
typedef struct view node
l
strllct view node
"'nxti
owner;
CONNECTOR row, col;
short
height, width;
short
VIE\~
;
It
~:
~:
links viewports: *1
->next nod'i! *1
owner of Viewport '/
start of v ewport *1
extent *1
typedef struct appl node
{
*nxt
struct appl node
name
lonq
conn
CONNECTOR
row, col;
short
It
1*
typedef struct an1m node
(
struct anim node
"'nxt;
name;
lonq
conn;
COlmECTOR
ANIM;
typedef struct affected area
l
rl, cl;
short
r2 c2;
short
co 1or;
char
pattern;
char
max h~iqht;
short
l11alCwldth'
short
height, width;
short
1* links _animation processes: *1
->next node *1
name of element *1
~:
conn. to process *1
1*
APPL;
links applications: *1
->next node ~I .
/.*
name of appl19atl9n *1
/.*
cOQ", to appllcatlon *1
/*
or1g1n *1
1*
1*
/.*
1*
1*
area changed by a request:
upper l,ft front */
lower r1ght back */.
background color 'I
backgr01,llld pattern *1
/.*
max. h~lqht *1
/.*
max. WIdth *1
/*
current size *1
~
~
*1
U\
Ut
o
N
"00
w
\0
lIHEA;
typedef struct lisls
{
ELEr1EHT
ELE~1EII'r
ELEMENT
VIEW
APr!,
AIllH
lnt
11lt
lnt
struct
(
) LIST;
long
lonq
ELEHENT
pool;
*first;
"'last;
*qlrrent;
*vIews;
*appls;
*anlms;
changes;
erases;
size;
n'
size;
*ptr;
1*
1*
/.*
1.*
/.*
/.*
/.*
/.*
/.*
/.*
/*
1*
/.*
/*
list pointers, etc.: *1
->pict. element.list *1
->end of p.e. lIst */
->l~st p.e. 9hanaed *1
->v1ewport lIst ~I
->apPllc~tiont llst *1
->ahlmatlQn 1 st */
iChangeS in 1 $t *1
erasures in llst *1
plcture elements */
element pool deser.! *1
ft~lements
*1
S1ze of elements */
->element buffer *1
~
.j:;o.
QO
)17
118
]19
)20
121
122
123
124
]25
126
12"1
128
129
130
131
]J2
133
]34
135
136
137
138
]39
140
141
142
113
144
115
]46
147
14B
149
150
] 51
J52
153
] 54
155
156
157
) 58
159
1*
local functions *1
cllflr.
*value(), *tarOi
Ef£MEHT
*m~[k number( I *mark area()( *mark elements(), *new_element():
P E 1I0R
*fu:st_macro(, *next:nlacro(/;
1* Picture manager: main-line 'III
PHOCESS (P.icture)
(
CURRENT
cur;
AREA
area;
LIST
11!?ti
reglster VIEW
*Vl~W;
regIster ANIM
*anlm;
get event key("Picturt;:! \11gr.");
Inlt P~(&cur,&area &llstJ',
draw~Ptcturel$cur,'area,&tlst) ;,
for lVlew = lst,vlews; vlewi Vlew = view->nxt)
Put(OlREC1',VIew-;->owner,pId,N(,;,!wmsg(3?,"Unmap",NULL)) ;
for (CHl1 m == lISt. 1illllms; anlTJ1' Bilim ." a 111 m->nxt)
. Put (lHHECT, anlm->COnn. p Id, Newmsg (32, IIgui t" , HULL) ) i
EXlt() i
"'""
~
til
'Ll
o
tv
ini.~ PH(CU[{area,llst)
reglster CU~RENT
'cur;
reg~ster AREA
*ar ea ;
rAglster LIST
*llst;
(
area->color = DLACK;
area->pattern = 0;
*cur->name :::: *cur->file = NULLi
area->max height ~ area->max wl~th = 0;
}lst->c~rrent :::: list->first ~ llst->last = NULL;
) 1 st->Vlew5 = HULl,;
] I st->apl?ls == fHJL/I,:
] l st ->alllmS :::: NULIJ;
llst->size :::: list->pool.n :::: 0;
cur->debug :::: cur->ciJBck
cur->private :::: cllr->display mark:::: HO,
cur->mark = cur->old mark = cur->erase mark :::: NULL; -
=
"00
lJ,)
\0
!Jl
"'""
Q
]60
161
]62
163
]64
165
)66
167
16B
169
170
171
172
]73
174
175
176
]77
178
]79
100
181
182
183
184
}85
186
187
188
]89
190
]91
192
193
194
1.95
1.96
]97
19B
199
200
201
202
203
draw picture(currarea,list)
GUR~ENT
*cur;
reytster AREA
*area;
regIster LIST
*llst;
(
register char
""msg~
transaction = 0, result = 0, go = YES:
reglster short
*element·
regIster ELEMENT
status[li], list size = 0, *req = NULL;
long
while (go)
(
9 u r->msg = msg = Get(o,&cur->sender,&cur->size);
If (!transactIon)
(
list->changes = list->erases ~ area->r2 ~ area->c2 ~ 0;
area->rl = area->cl = 32767;
9ur->~ppl = NULIJ;
If (llst->appls)
check appl(cur,list->appls);
}
If (*msq == 'f' && tr~nsaction < 10)
status(++transactIon) = 0;
else If (*msg 7= ')')
--transactIon;
else
.
go = Request(cur,area,list,rnsg,cur->size,cur->appl):
If (!transactlon)
(
if (list->chr'lnges)
notlfy(cur,area,li!?t) ·
for (element = 11st->flrs~; element; element = element->nxt)
{
~lernent->chanqed = element->marked = NO;
If (element->deleted.&& IAny mSr(NULL))
delete- element(llst,element ;
}
.
If (Find triple(msg,IIrplY",cur->slze,No,olNULL) && result >= O}
reply status(rnsg,msg,"completed",resu t) ~
tree_requests(msg,cur->size,&req,&list_size) ;
~
!.II
~
lJl
'til
o
tv
00
I.J.)
\0
~
~
201
205
206
207
208
209
210
211
212
2))
214
215
216
cl1e<;:k appl(cur appl)
reglnter CORRE~T
tcur1'
reglster APPL
*app ;
{
for ( ; appl && (appl->conn.pid 1= cur->sender.pid); appl
If (appl)
(
if (! (cur->appl = appl->name))
cur->appl :::: -1;
cllr->appl row:: app]->rowi
cur->appl=col = appl~>col;
~
appl->nxt) ;
1-1
til
tH
217
2]8
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
2)4
235
236
237
238
239
210
241
242
244
213
fre~ requests(msg,size,req,list size)
regIster char
*~sg, *"'reg; ,register long
SIze, "'lISE SIze;
{
regi.ster char
*temp, *nexti
if (msg)
(
*(ci1ar**)msg == *req;
.,. r~q == lJlSg;
·llst size += Slze;
if ([nny msg(NULL) I I *list size> 10QO)
for -(temp := *req, "'req ~ HULL, *llst size :::: 0; tempi temp
{
next = *(char**)tempi
Free(temp) ;
U\
'tit
o
N
"00
w
1.0
I
= next)
1-1
til
Reqvest(cur~area,list,msg,size,appl)
rC91ster
reQ1ster
reQlster
re~lster
(
CUlcRENT
AREA
LIST
long
*cur;
*area;
"'lIst;
msg, size, appl;
~
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
2'77
278
279
280
201
282
283
284
285
286
287
288
289
290
291
292
293
re~i~~er shor~
go = YES;
if (I strcmp(msg, "wdte lt ) )
Draw(llst,msg,slze) .
else If (lstrcmp(msg,"elq.t lt ))
•
E~lt text(cu~,area'llst!mSg'SlZe,apPl) ~
else If '(1strcmp(msg,"mark" )
MQve mark(cur,area lJst ;
else :}.f Ilstrcmp (m:;;g,lI(nt lf )
Iq.t( tst,msg,slze appll i
else If { strcmp{msg,"moye'/)
M9ve area,llst,ms~,slzefiappl); .
else If !strcmp(msg, era~e')}
Erasefarea,llst,msg,slZe(uppl) ;
else If {,strcm p (mS 9 '''read ll )J
C9~Y cur,area,llst,mSg,slzB(appl);
else 1I !strcmp(m:;;g "replaye")}
R~place(area,lls~~msg,slze(appl) ;
else I I (! strcmplljlsq, 'change") J
c~ange{area, lst,msg1slze,appl);
else If llstrcmp(ljlsq("an mate I}}
Anlmate(cur,11st, •
else if (!strcmp(msg,"alter lt ) II lstrcmp(msg,lIcancel ll ) )
Alter(cur,llst);
else If (!strcmplm:;;g Ifnumber"))
Qverynumber 1Is~~msg/slze,appl);
else If r! s trcmp lllS~, 'marK?") )
Qvery mark(c r),
else If (t'trcmp{msg,II~ave"))
Sqve Icture cur,llst •
else If -r?strcmp msgr"s~t~I{)
s~t mark(cur,area lIst);
else If-(lstrcmp{msq,(lrestore ll ))
R,store mark cut,area lIst);
else If (!strcmp msg IIbkgd ll ) )
D~ckground(area,list,msg(size) ;
else If l!strc IJ1P (msg ,"create')l
gO = New plcture(c~r,area, 1st);
else If (!strcmp(msg,"lnIt"))
cvr->orlvate = go ~ New licture(cur,area,list) ;
else If (1strcl)1p(msg,lIopen':l
99 = Old Piceure(cur,lh s );
else If !!strcIJ1P(msg,lIapPl'))
l\p 1 Ur,llSe);
else I~ Tstrcmp(msg,lIquit ll ) )
{ i f (qO = (cur->sen er.pId !~ cur->owner'RldJ)
'd'
.
teply status(msg,ntsg,"not authorized ',0 i
}
-
i-I
Ul
Ul
lI\
"ut
o
N
"00
w
1.0
i-I
Ul
C'I
29~
295
296
297
290
299
300
301
302
303
304
305
306
307
308
J09
310
else if (!strcmp(msC},trquery")
Q1.,lery(cur,llst) I
else If {fstrcmp.(msg,"failed"))
S~atus(rnsg/slzeJ ;
else 1 f (! strcrnp (msg I "done") II Is trcmp (msg, "s tatus") )
else: if( !Change attribute(list,msg,s.ize,appl»
{
if (!!?trcmp(msg,IIviewlIll
Vl-ewp(;nt(cur,area 1st)
else If {lstrcmp(msg,hdebug~»
cur->debug = !cur->debug;
else
}
reply_status(msg,"-\'unknown\tll,msg,o);
return(go) ;
~
til
-.,J
I
Ul
~
8
"00
w
\0
~
til
QO
311
312
313
314
315
3]6
317
)18
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
331\
335
336
337
JJ8
339
340
341
342
343
31\1
315
346
347
318
349
350
351
352
353
354
355
356
Char,lge attribute(li$tLmsg,size,appl)
n~glster 1.1I8'1'
*llsq
re<]-Lster 10l1g
msg, SIze, app11
(
static char
rnsgids(] = "select\Oblink\oinvert\Ohide\Ohighlight\O";
I
regi.ster char
*lH
new state, changed, type;
reglster short
*element;
regIster ELEMENT
*hdr;
regIster P_E_IWR
for fO "'" msgids, type = 0; *p && strcrnp(rnsg,p); p t= strlen(p)'~l, tttype) i
If ( *p)
return (HO) ;
list->current = element = rn~rk elements(list,NULL6NuLLhrnsg,size,apPl};
new state = !(short)Find trIPle(rnsg,' off ",slze,H ,O,HuLL);
for- ( ; e1 ement; element····= elernent->nxt)
]f (element->rnarked)
l
hdr ~ (P B I1DR *) &element->length;
sWltch (type)
(
-;hanged = bdr->at.tr.selected II new state;
case 0:
If (hrlr->attr.selected = new ~tate)Pu t (NEX'l\ "Conso} e" hNjwmsq (hd r-> 1 en q th+50
"Wtlce" "data=::: e e' type==Jlc" hdr JlUL L 'P') )
'
,"""
b rea k :
chanqed :::: hdr->attr.blink != new state;
case 1:
hdr-5attr.bllnk :::: new state;
break;
chanqed :::: bdr->attr.invert 1= new state;
case 2:
hdr->attr.ltlVert = new state;
break;
chanaect :::: 11 Qr->attr. hidden !:::: new sta te;
case 3:
1dr-5attr. ndden "" new state;
Jreak;
changed:::: h<;Ir->Glttr.higlll1ght != new state;
case 4:
hdr->attr.lnghllght :::: new_state;
}
If (elemeIlt->chanqed = changed)
Ilst->chanqesf-+'
elernent->rnarkea. :::: 116;
}
return (YES) ;
l
~
til
\C)
VI
'tA
S
00
•
W
1.0
I
~
<='I
Q
J 5'/
358
359
360
361
Ollery(cllt,list)
CUR~E~T
*c~r'
regIster LIST
AIIsf;
I
unsigned
380
381
n elem - 0 n vi~ws ~ o·
reyJster unsigned
min r = 65~35; mIn c ~ ~5535;
req~ster unslqned
max-r:::: 0, max c =-0, pIc ht == 0, pic wd ;::: 0;
re~Jl ster ELEMEHl'
*elementi
reglster P E IIDR
*11<;1[;
regIster VIEW
*vlew;
for (element = list->first; element; element;::; element->J1xt)
{
hdr : : : {P E IIDR *l &elem~nt->lenqth;
if Ihdr-?row < lTl.tl1-C Illln-·c = har->row;
< mpl
mpl r =
~ f
hdr->col
hdr->col:
1 f hdr->row + hdr=> Wlqht > max r) max r = hdr->row + hdr->lleiqht;
If hdr->col + hdr->wldth > max c) max c : : : hdr->col + hdr->widtl1;
n e eml-!';
}
1 f (11 elem)
(
ptc ht = max r - mjl1 r;
p lc-wd "" max"c - mlnc:
383
else
362
363
364
365
366
367
368
369
370
371
372
373
374
375
316
377
378
379
382
38~
385
386
387
388
389
390
391
392
393
394
395
396
391
398
399
400
401
402
403
404
405
406
407
408
~
~
~
r}
-
)
lJl
"ut
-
a
N
pi y ht = t1ic wd == max r "" ma:Ji: c = lllin r == mill C = 0;
for (VIeW
llst=>views; VIew; VlEW = Vlew->nxt, n views++) ;
Rcplv(cur->msg,
N~WmSg(256,,,S t.'<;!tllS"."Oriq:=#s; ,size=i2s; low=#2s; 111gh=#2s; cnt::::#s; \
..
Vle\oJ= 5; ,nal1le-'Y9: fll~=#SIl,"plcture/\,
pIC 11 ,PIC wd,mlQ r(m11l c,max r,max c,n elem,l1 views,
cur=>name,cur->flleJ); -
query
00
w
\0
number.I,list,ms~j~iz?,appl)
teg I ster I,IS
,1st I
regIster long
meg, size, app1;
(
register unsistned
11;: 0;
reg 1S ter EIJEHEN'l'
*element, 1< temp;
if (element = mark elements(list,NULL,NULL,msg,size,appl))
{
for (temp = li;t->first; temp != element; temp ~ temp->nxt, ni+);
Hepl y (nlsq f N!?,wmsglelement:-> length+32 I "number" ,
"num=ns; e em:::#e",ll,&element->length));
~lse
,
reply_status (lIIsg, "-number", "too h1gh",0):
~
~
N
409
4]0
411
4J2
413
414
415
416
417
410
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
4'39
440
441
442
40
414
445
446
447
448
449
450
451
452
453
454
455
456
457
Dra~(listtmsq,sizeli
reglster ,IS'I'
* st;.
regIster long
msg, SIze;
{
register ELEMENT
*after;
regIster long
*p:
if (p = (long *) Find triple(lIH3g / "data",size,NULL,4,NULL))
{
if (Find trinleLmsg,"back",size,No,O,NULL))
after:.:: NUL ;
else
after = list->last;
if (!draw elements(p,*(P-l),list,after)}
reply-status(msg,"-wrlte","bad length/type/macro",O);
}
e1 se
.. .
reply_status(msg/"-wrlte",ltmlsslng \'data\''',O);
.
dra~ elernents(p,list len/list,after)
reglster char
*~);
regIster long
ll~t len:
regIster LIST
*llst;
regIster ELEMENT
*after;
{
reglster ELEMENT
'element;
reglster short
length, number = 0;
while «length = *(short *) p)
&& (lIst len -:::: length) >= 0
{
&& strchr( "tlreacdsmn", ( (P_.. E_lIDR*) p) ->type) )
if «(P E HDR*)p)->type == 'm' && Icheck macro(p»)
)jreakT
.
.element = new element(llstllengthtslzeOf(ELEMENT) ,after) ;
lJ1emcOYi &element-> length, P,. engEh) 1
If (1( ~ E IIDR*)Pl->heig[){~)
de Ine-box(&e ement->length);
number++; p += let.lgth;
Long allgn(p);
Ijst->si;e +~ number:
Jlst->changes t= number;
llst->current = elementreturn(length 7 NO : YES);
~
~
VI
"vi
o
N
00
UJ
\0
~
~
450
459
460
461
462
463
464
465
466
467
468
469
470
471
472
4'1J
474
475
476
477
478
479
400
481
482
483
484
485
486
487
488
489
490
491
492
deflne box(hdrl
'*hdr;
regIster P.-. E-_. IIDR
(
regist.er char
*val:
val = value(lldr) ~
If (hdr->type == It')
{
hdr->lwiqht = VClIAR tI'l';
hdr->wldth =: VCHAH ND #( strlen(val+8) ;
)
else if {(hdr->type == 'nIl II (hdr->type == 'm'))
'"'
8i"
,
1II
clH~yk
lit
o
macro (hdr)
regIster P- g.-- flon
{
tv
*hdr;
register P E 1I0R
*temp, "'first;
short
- -..
len:
char
*p, macro_type~
for (first :::' temp = first macro(hdr,¯o type,&len,&p); temp;
temp = next_macro(&len,&p))
if (macro type == 'LI)
t~ell1p-""'attr.hidden ~
if (fteIJ1P->helgllt)
deflne_box(temp) ;
If (m~cro type == IL')
tlt'st=>attr.hidden ~ HO;
return(p ? YES: NO);
}
00
W
\0
YES;
'"'"
="
0\
493
494
495
496
497
4~)
8
499
500
501
502
50J
504
505
506
507
50B
509
510
511
5J2
513
5]4
515
5]6
51 '7
518
519
520
521
522
523
524
525
526
527
520
529
530
531
532
533
534
535
PElion "'first macro(hdr,type,len,p)
regtster P E I1DH
~hdr;
reglster char
*type;
reglster sil0rt
*.1eh:
reglster char
**Pi
(
register P_E_llDl~
*tetnp;
~p "" value(hdr);
11 (type)
*type ::: **p:
("'p) +-1-'
LOIlCj aiiqn(*p)!
temp-=: (P B IIDK *) *p;
*) hdr}'
"'len = hdr-~length - (*p - (char < *1el1 ~& strchr("tlreacdsmn",temp->type))
if (temp->lengtn && temp->length
re turn (temp) :
*p ;::: NUJ..JIJ'
return (~mtIJ) ;
I-'
~
-...l
til
'LIt
S
P E lIDR "'next macro(len,p)
reg1ster short
*len;
reglster char
**Pi
{
register P_E_IIDR
*temp:
00
W
\D
j f ("'p)
{
temp::: (P E lIDR *) *pr
*p ~= t~mp-~length;
i,cmg ali~h (*p) ;
*len--= *p - (clwr *) temp) 1
t.emp =: ( E BDn *) *p;
if (t_emp-~length)
lf (temp->length < "len && strchr("tlreacdsmn",temp->type))
return(temp);
else
*p = NULL:
}
return (HUl,L) ;
I-'
~
536
537
538
5]9
540
511
512
543
544
545
546
547
518
549
550
551
552
553
554
555
Replace(area,list,msg,sizB,appl)
AGEA
'area;
LIST
"'lIst; .
register long
msg, SIze, appl;
l
register char
-Ap;
re91ster short
length = 0:
regIster ELEMENT
*tempt
reglster P E HDR
*bdr~ *temp hdr = NULl,;
regIster long
llst len; -
*(lonq
*) (p-4\) I
&&
(list len
-
-= length)
> 0)
1II
hdr = (P E IIDH *) p'
if (hclr-::>type
m' && lcheck macro(hdr))
break;
.
for (temp = llst->last; temp &&
((P E IIDR*)&temp->Jength)->row 1= hdr->row &&
•
( (p--E-m)H*) & temp-> leng th} ~>col . == hclr-->col: temp
temp->pre) ;
If (teInp) (
temp hdr == (P E mlH *) &temp->length;
temp=>deleled···;:;:-YES;
after == temp->pre;
Jraw elements(hdr lenqth,list,afterl r
•
1 f (temp hdr ~& ((ldr-:5 type 1== 't' I
hdr->helght! == temp hdr->hei gh t
II lldr->wldth 1= teJllp hdr->width»)
"{
change area (area, temp hdr->1-0Yl, temp hdr-:;col (
.
temp hdr-::>helght,temp htlr->Hldth) i
=;:;:
~i62
563
561
565
566
567
5G8
569
5'10
571
572
573
S74
575
576
577
}
578
llst->erases++' I
-
Long_align(p) ;
)
"vt
o
'
P += length:
579
584
==
(
560
561
585
len
li~t
winle «length"'" *(short ~) p)
557
558
559
5U3
0'1
\C
lr
556
580
581
~) (32
~
ELEMENT
*after = NULL;
J f (Find tri.ple (mr;g I"@\O\O\O\O", size, NO, 0, HULL) )
(
Eras;(are~,list,msg,size,appl);
after = Ilst->current;
(p = Find triple(msg,"data",slze,HULL,l,lIULL))
(
....
If (length)
reply._ s ta tus (msg t II-replace" I "bad length/type/macro", 0) ;
tv
00
w
\0
~
-...l
=
586
58 'l
580
589
590
591
592
593
594
595
596
597
590
599
600
601
602
G03
604
605
606
607
608
609
610
611
6J2
613
611
615
6]6
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
Erase(area,list,msg,size,appl)
AREA
*area~
reg.j ster LIST
*llst; .
regIster long
msg, SIze, appJ.;
{
register ELEMENT
*element = NULL1
reQlster P E llDR
*hdr;
InE
- number1
i.f (element = mark elements(list,NULL,&number/Dlsg,size,appl))
{
list->current = element->pre"
for ( ; element; element = eiement->nKt)
If (element->marked)
{
element->deleted = YES;
,
hdr::::: (P E HOR*) &eleI0811t->len q th '
change area:(area,hdr->row,hdr-5co 1,hdr->helght,hdr->width);
J
Jist->erases += number;
11st->changes += number;
~
"'-l
~
U\
'tA
S
"00
w
copy(cut,area,list,msg,size,appl)
CUR~ENT
*cur;
regtster AREA
tarea;
reg1ster LIS'1'
*llst;,
regIster long
msg l sIze, appl;
{
regIster ELEMENT
*element;
reglster short
bkgd, *p;
short
*q;
unsIgned illt
length:=: 0:
if (bkgd :::= (short) Find - triple(msg,"bkgd",slze,NO,O,UULL))
{
p = (short *) F~nd tdg1e(msg,II@PoslI,size,&none,0,HtJLlr);
q = (short *) FIJld--trl le(msg,"@endllfS1Ze,&nOne,O,NULL) i
change area(area,*p,*( +l),*q-*p,*(q-'l)-*{pU)):
.1. f «( element :::= mark e1 ements (1. ist &len q th NULI'I msq r size, appl) )
send(cur,area,ltst,o,length,e 1ement,H 6 ,NO,Dkga,;
else
}
Heply(msg,UewlIIsg(64,"write",NULL)) :
\0
~
tj
II bkgd)
6JJ
634
635
636
63"J
630
639
640
641
642
643
644
645
646
641
648
649
650
651
652
653
654
655
656
(is"!
G58
659
660
661
662
663
66~
665
666
667
669
668
670
671
672
673
674
675
676
677
670
Move(area,list,msg,size,appl)
linEA
*cl};ea;
1,lS'£
*llsti.
long
msg, SIze, appl;
(
register ELEMENT
*element;
reglster r E nnR
*hdr;
regl ster Intdelta row, delta col, by offset = NO, row = 0, col a 0;
regIster char
*p; InE
n;
if (p = Find triple(msg,"by ",size,NULl.,4,UULL))
(
by offset.= YES;
delta row = *((short *) p)++;
delta-col = *(short *) p;
~lse if (~ = Find triple(msg,ttto ",size,NULL,4,NULL))
(
row = *((short *) p)++;
col = *(short *) p}
~r (list->cllrrent :: element == mark_elernents(list,NULIJ,&n,msg,size,appl)}
{
if (!by offset)
(
hdr "'" (P E lIDR *) &element->length;
della row ~ row - hdr->row;
delta-col = col - hdr->col;
for ( ; e-I-ement; element;;::; element->nxt)
]f (e ement->marked)
{
hdr = (P E 1I0H *) &element->length;
chanqe area(area,hdr->row,hdr->col,hdr->height,hdr->width);
hdr-5row += delta row~
hdr->col +:::: delta-col'
element->changed ~ YES:
element->marked = NO;
element->deleted :::: (hdr->row < 0 I I hdr->col < 0) i
]istl>chanqes +"" n;
1Ist:->erases +"" n;
~
'I
(JJ
VI
Ut
o
N
00
LN
\0
1-1
'I
~
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
70J
704
705
706
707
708
709
7]0
7]1
712
7J)
714
715
716
7]7
7]8
719
720
ChaDge(area~list,msg,s.ize,appl)
reglster AR~A
*area;
reg 1s ter l,IS'1'
*lIst;
regIster long
Rlsg , size, appl;
(
reg~ster ELEMENT
*element = NULL;
regIster P E lllJR
*hdr;
char
- *eo10r, *bkgd, *fi11, *pat;
color = find triple(msg "Coli",~ize NULL 1 NULL):
b~gd = Flnd tr-l-Ple(msg,('bl}gd' ,slze,imI.I"i.,NUr.r.) i
flll : : : fll1d-trlple(msg "flIl",1i;lZe NULL 1 NULl,);
pat =,Flnd trlple(msg flpat ",slze NULL,i,NULI,l;
.
If (llst->current = element:::::: mark e1ements(11st,lfULL,NULL,msg,slze,appl))
for ( ; element; element = elernent->nxt)
lf (element->marked)
{
l~dr : : : (P E IIDR*) &element-> length;
If (eolor)-hdr->color : : : *eo10r;
if (bkgd1
h~r-~bkgrnd : : : *bkgd;
if (flll) .
.
hdr-~fll1 = *f111;
.if (pat)
I1dr->pa t tern == *pa t;
.
cl,Hlnge area (area, hdr->row, hdr->col, hdr->height, hdr->wldth) ;
llst->changes++l
~
~
VI
V.
o
"00
N
w
\0
nac~ground(area,listlmsg,size)
reglster ~~EA
*area;
reglster LIST
*llst;
reglster long
Rlsg, size;
{
area->color = *Finq triple(msg,"colr",siz~,&area->color 1,NUI.L)·
area->pattern:::: *Flnd trlple(msg,lIpat ",slze,&area->pattern,l,WJLL)
c~~nge area(arealQ,o,MAX ROW,MAX COL);
11st->changes = lst->erases = IT
~
-..l
1:\
i
721
722
723
724
725
726
727
728
729
730
731
7]2
733
734
735
736
737
738
739
740
711
742
743
714
745
746
717
748
7,19
750
751
752
75)
75'1
755
7 ~)6
757
758
759
760
761
762
76)
764
New picture(cur area list)
rcgtster cunRENt
'cur;
regj.ster AREA
tarea:
regIster LIST
*llst;
(
register ELEMENT
*element;
reglster long
max, maxe;
short
def f11ax : : : 20 def maxe :::: 100'
char
def=bkgd ~ BLACK,-def_pat ;: : 6;
for (element = list->first; element; element = element->nxt)
element->deleted ; YES'
list->current :::: l~st->flrsf : : : li,t->la~t = NULL;
llst->ehang~s = 11st->erase~ = llst->s~ze :::: O·
If (find trlPle(9Ur->msg,l1flle"rcur->slz8,NO,6,HULL))
return(Old plcture(eur,llst}) t
else
(
eur->owner -;: : cur->$ender;
strcpv(cur->l)ame,Flnd_trlple(cur->msg,"name",cur->size,&none,l,NULL));
area->max helql,t =
,
*(short~)Flnd_triple{Cur->msg,lIsize",cur->sIZe,&nonet4,NULL);
area->max wlath -;: :
* (short -}() (rind tr ipl e (cllr->msg ( "si ze" , cur->~ i ze ~ &none,4 ,)H1LL) +2 i
are a - >color = 'II; f'111() t r 1 P leI cur - >tn s 9 I 'b k 9 d" I ell r - >S 1 Z Ei' , t.c d e f b Kg a 1 N(J LL •
area ->pa tt~rJl = /( f lTld trlp e (eur->msg, l'p,a t " cnt->s 1 ~e, &def pa t / i NU L 1;
cllr-> tnghllgh t = *Find tr 1ple (c\lr->msg, 'hIgh (, f cur->s lze, &none I I, N6LL) ;
cur->check = (area->m3X heIght 1= 0);
max =
(* (sbort*) FIn? trlpl elcur->msg, "l1IC1X ", cur->slzEi!, &def max, 2/ UUI,L)) -11;
~
.....:t
.....:t
VI
'tit
S
t
I
I
-
00
w
\0
I
~laxe ::: *(short*)FlIld trlp e(cur->msg,"maxe",cur->slze,&dof maxe,2,UULL);
If (maxe & 1)
-
++maxe;
ljst->pool.n = max;
11st->~OOJ .. size = maxe + sizeoflELEMENTl + 10;
llst-> oQl.ptr = (ELEMENT *) ~l oc(max* Ist->pool.size,YES);
memset
Ilst->pool.ptrJo~max~llst->gool.SlZe);
cl,lange area(area Q,0,r1i\;\ ROW/I1i\X C L);
llst->changes = 1lst->erases - l~
reply sta tus (eur->msg, "+erea te" , II comple te" , 0) ;
return(YES) ;
~
.....:t
QIO
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
700
Old picture(cUr 1ist\
reg I s ter CUI = (char*)1;
CONNECTOR
fIle;
s trcpy (Cll r->nGlme, F lnd td pl e (cur->msg , "n9 me " , cur->s 1ze, &none, 1 , HULL) )L'
!;Jt rcoy (cur-> f 11 e, F lIld'-tr Iple (cur->rnsg , "t lIe" I cur->Slze I cur->narne, 1, frU L));
If (~cur->file)
1
{
787
788
789
790
791
795
796
C\lr->owner
ctlr->sender;
= Call(DIRECT file,Pi,.
.
New m!;J q ( 6 4 r "r e Gl d ,. , ,. c (;m f1 = C; S 1 Z e::::: #1 " I & f 11 e , - I) t 0 f 0)
If (g = Flnd trIple P, "data",.O,(WL[,,4 c lHJ.J ,)
, oraw elements(p',~(long*) (p-4), IlSl:,NUI,tJ ;
Put (DIRECT, f lIe. pld, Newmsg (32, 'olose" I. "cofln=ffc", &fl1e) ) ;
reply status(cur->msg,tI+open","oomplec.e ll ,0) ;
return(YES) ;
}
else
,
reply_status(cur->msg,lI-open","canlt open flIen,O);
(I?)
If {n
785
786
791
792
79)
"narne=#S; omod=hs; amod=ffs", cur-5fll~, IIH" I NULL) r &f11e) )
wh.ll~
78)
781
}
else
~
if (Connect to(NEXT "File mgt" Newrnsq({i4 "open"
{
781
782
1-1
lJ\
==
't.n
S
)
"00
w
\0
I
reply status(cur->msg,"-open"," no fIle namell,O);
return {NO)';
1-1
IX)
Q
797
798
799
800
801
802
803
804
805
B06
807
808
B09
810
811
012
8lJ
814
815
UJ6
817
Bl8
SRve IJicture(cUr,list)
cunHE fl'
*c",r'
*llst;·
*f11e name, *m, *p;
register char
*Ei!lement;
reqlster ELEMENT
fIle'
CONNECTOR
length = 0, num;
unsigned int
if (! (file name == Findtt:·r.iple(Cllr->ms g , trfile" ,cur->size,NULL, 1,HULL)))
fl1e name = cllr->f ·le;
If (*flle name)
if (element ::::
mark_elements(list,&length,&num,cur->msg,cur->size,cur->appl))
.
if (!COlmeQt to(NEX! "File mgt",N~wmsg(64,"open"
"name=nSr omod:::: Si amm;t=nS",fnle name,"w'~NULL),&flle))
Connect tonEX1',"Flle mgt' Nl?,wmsq(64, 'create",
"name""'RS; omod,:::ffSr amod=ffSllr fIle name,'I\-l", nULL) ,&file)
]f (flle.pld)
-
LIST·
{
•
(
I
•
i
Ul
LA
o
N
00
num == lengt.h + 4 '* null' + 4'
.
= NEi! Wms 9 ( I) Um+50 I "w r 1 t e " 6(I con n::::: ~ C; d a t a"" #A" , & f 11 e , n u m, it ULL) ;
p!::! Flnd t.rlple(m,"datn", ,NULL,l.,NULL);
In
820
821
822
823
824
025
826
827
828
829
830
f3Jl
832
}
else
OJ)
834
840
841
~
I
819
835
036
837
83H
839
~
QO
ror ( ; element; element = elemenc->l1xt)
If (element->marked)
(
memcPYIP,element,element->length) ;
p += e ~ment->length;
Long a 11 9 n ( p) ;
}
* (short *) P,= NU~IL;
putlDIHEctrIlle.p.J.d,m) :
Pu t IH HE CT , f 11 e . P 1 d , New ms g (3 2 , "c los e" , "c 0 n n::: nCII &f i 1 e) ) ;
rep Y status(cur->msg,"+snve","plcture saved ,oj;
-
reply_status(cur->msg,"-save","can't open/create file",O) i
}
else
else
reply status(cur->msg,"-save","no elements",O):
reply_.status (cur->msg til-save" r "no file name", 0) ;
w
\0
~
QO
N
842
843
844
845
846
fH7
U48
849
850
851
852
853
054
855
856
857
858
859
060
861
862
863
864
865
866
867
868
869
870
0'71
872
873
874
0'75
B76
877
878
879
BBO
881
882
803
884
885
886
887
OB8
889
890
AQPl (cur list)
C R~ENT '
*c~r'
regIster LIST
*llsf;
(
regtster APPL
*appl;
reglster long
name;
regIster short *p;
name = *{lon g .*} Find triple!cUr->ms g ,"name ll ,cur->size/&nOne,4,NULL)i
for lapp :::: 11st->appls; app && appI->name =< name; app1 "'" app1->mn:);
If (!appl)
appl = (APPL *) Alloc(sizeof(APPL) ,YES);
appl-:>conn = cur->sender;
p = (short *l Flnd tripIe(cur->msg,"org ",cur->size,&none,2,lIULL) 1
appl->row = Lp++: appl->col = *p;
appl->name :::: harne;
ap{Jl->conn "'"
*(CONHECTQH *) Find triple(cur->msg,"appl",cur->size / &l1one / 4,HULL);
appl->nxt :::: 11st-~applsT
llst->appls = appl;
mark(ctlr,t,area,list)
reglster CURR~NT
*cut·
re~lster AREA
*are~;
reglster LIST
*Ilst;
{
register P E HOI<
*hdri
register short
*pos;
char
*g;
if (pos = (short *) Find triple(cur->msg,"at " , cur->size, NULL, 4, NULL) )
(
if (cur->mark)
erase mark(cur,area);
else
(
q = cur->mark "" Alloc(sizeof(P E H[)Hl+30 YES);
draw_llne(&q,O,o,VCIlAn_.ll'l',o,NULL-;YEL JOW,IS',O,l,NULL);
1
lid r "" (P E IIDH .. ) cur->rnark:
IIdr->roltr=--*posH- - ((hdr->height - VCIIAH_HT) / 2);
hdr->cQl "" *pos;
c~r->display mark = YES;
11S t->chalJgesl'+;
1-1
~
LIt
"LIl
o
tv
00
f.J,;)
MOVE;!
\0
1-1
~
891
892
893
894
895
896
897
898
899
900
901
902
90)
904
905
906
907
908
909
9)0
9]1
912
91)
9H
915
916
9J7
91H
919
920
921
922
923
924
925
926
927
928
929
930
931
932
Query mark(Cllr)
regIster CURRENT
*cur;
{
register P_E_I1DR
*hdr;
if (hdr :::: (P E IIDR *) cur->mark)
.
Heply(cur--':msg,Newrnsg(64,"mark", "at=H2s ll ,hdr->row,hdr->col));
else
reply_status (cur->msg, "-mark?lI, "no lnark defined",O);
~
~
Set mark(ctJrl.area,list)
reg1ster CURKENT
*cur;
regIster AREA
*area;
regIster LIST
*lIst;
(
register P_E_HDR
*hdr;
if ((hdr = (P E lIDR*)Find triple(cur->msg,"data",cur->size,HULL,l/NULL))
&& hdr->length)
if (cllr->mark)
(
erase mark(cur,area);
free(cur->mark} ;
Free(cur->erase mark)L"
cur->erase_mark-= NuL ;
}
cur->mark "'" Alloc(hdr->length,YES);
memcpy' (cur->markkhdr /,hdr-> length) ;
cur->Olsplay mar = yES;
}
else
(,
If (cur->ol d mark)
Free(cur=>old mark);
clIr->old mark = cur->marki
cur->mark = NULL;
L.st->changes++ ;
l.Il
"vJ
S
00
W
1.0
~
Q!j
<::\
9))
9)4
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
961\
965
966
967
960
969
970
971
Res t.ore marJ-c (cur, area, 1 is t)
reglster CUHHENT
*cur;
reglster ~REA
*area;
reglster LIST
'lIst;
{
.i f (cur->old mark)
{
if (cur->mark)
(
erase mark(curcarea);
free(~ur->mark, ;
free(cUr->erase markl '
cur->erase mark-= NULL;
}
cur->mark = cur->old mark;
cvr->old mark = NULUr
Ilst->changes/"';
~
~
lit
V.
o
N
00
W
mark(cutharea)
reglster CORRENT
*cur;
regIster AREA
*area;
{
if (!cur->erase mark)
cur->erase mark = Alloc(*(short*lcur->mark,YES)'
memcpy(cur->erase mark,cur->mark *(short*)cur->markJ;
((P_E_HDR *)cur->erase_mark)->co 1or :::: area->colori
era~e
Edit text(cur,area,llst,msg,size,appl)
*cur;
l\HEA
*a rea;
register LIST
*llst;,
regIster long
msg! SIze;
CURRENT
long
{
app.;
\C
~
oc
oc
972
973
974
975
976
977
978
979
980
981
982
983
984
985
98G
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
]001\
1005
1006
1007
]008
]009
]010
1 OJ 1
10]2
] 013
10)1\
lOI5
]0]6
IOU
lOl8
1019
register char
*p, c, *text start, *new'
regIster short 8hlft, offset, sel offset, ok = YES;
short
sel lenqth;
~
ELEMENT
*element;
P_E IlDR
IIhdr;
tf (list->current = element = mark_elements(list,HULL,llULL,msg,size,appl))
offset"" *(short *) rind once(msq,,"offs",size,&none,2,HULL);
hdr := (P E !lDR -,\) &e .ement->lengEn;
if (hdr-::>type :::::::: 't')
(
text start = (p ~ valu,{hdr) + sizeof(long)} + 2 * sizeof(short);
If (slqft = *(short*)Fllld oncelmsl'''shftll,slzer&none/2,o»
.
Sblft text(p,text star~,sh ft ;
1f (FInd once(msg,"set ",slze/HO, ,NULL»
(
sel offset:::: *«(short *) p)++;
sel-lenqth = *(short *) Pi
ok ~ (offset < sel lengtl1/;
offset += sel offset;
)
If (ok
(ok && (offset < strlen(text start))))
{
p = text st~rt + offset;
,
If (new ~ FInd once(msg,"new ",slze,NULL,l,IIULL))
(
tvhill:i! (c =-*neWII)
if (c > 31 && c < 127 && lip)
'l\pH == c;
else If (0 == 8 && P > text start)
*--p = , ';
-
If
~
QC
\C
1II
V.
o
tv
"00
w
\0
(F:ind once(msQ',"blnk",size,No,O,IIULL))
19r( • *p' 11 p++
if (Flnd triple(msg,"by
(
}
else
{
r:'!
,
,).
",size,Ho,O,HULL»
Move(aIea,list/~sgrsize,apPl) 1
Uraw(l st,msg,slze,;
element->chanqed = YES;
llst->challgesf+;
~ove ~ark(cur,area list};
if (r~lld once(ms9,"fast',size,Ho,o,NUr.I.))
11st=>erases = 0;
~
\C
Q
]020
1021
]022
J023
1024
] 025
1026
]027
J 028
1029
]030
]031
1032
1033
1034
)035
1036
1037
]038
10)9
1040
) 041
1042
104 :3
J044
1045
1046
]047
1018
]049
1050
J051
J052
1053
]051
10S5
]056
]057
J058
)059
]060
)061
1062
)
J
J
else
else
else
reply_status(msg,"-edit","outside text string",O);
reply_status(msg,lI-edit"," no t a text element",O)i
~
\C
~
reply_status(msg,"-edit","not found",O);
shift text(sel,text,nchars)
reglster short
*sel L nchars;
regIster char
*tex\.:;
{
register short
length, n;
if (length = strlen(text))
1.f {nchars < 0 && (n = length + nchars) >
(
memcpy(text,text+n,-nchars);
l}1emset (text-nchars, I I , n) :
if (*sel - n >= 0)
l\sel -;:: n:
else
(
*8e1 = 0;
*(sel~l) += *8el - n;
)
VI
0)
1.n
o
tv
00
W
\0
)
else if (nehars > 0 && (n := length - nchars) > 0)
(
memcpy (text'l-l ength I text+nchars, nchars) ;
l}1emset (text, I I n);
If (*se1 + n < iength)
*8el -= n;
else
(
*se1 = l.ength - n'
*(8e1+1) -: *sel 1- n - length;
~.
\C
N
)063
1064
1065
]066
)067
]068
]069
1070
J 071
)072
]073
1074
] 075
]076
1077
1078
]079
]0(30
1081
]082
10U3
)08~
]085
)086
1087
]088
]089
1090
] 091
)092
]093
)091
]095
1096
1097
l\nJTpate (cur list)
register CU~RENT
*Cl,lri
*lISe.;
regIster LIST
(
.
*anim;
reg 1 S t er AlfIB
*name;
reglster char
oid;
rogJ.sterlong
~m;
char
if (Qame = Find triple(cur->msg,"name",cur->size,HULL,2,HULL))
If (strlen(nameJ < 16)
for (anim = li~t->anims; anim && strcmp(name,anim->name);
{
alll m = anlm->nxt);
if (Ianlm)
] f (pld = NewProc (name I" / /processes/ anima te" YES, -1) )
{
anim:=: (ANTH *) Alloc(sizeof(ANIH), YES);
anlm->conn.pld = pld;
stfCpy(anim->oame,na~e) :
anlm-)nxt = llst->anlms;
1 ist->8111ms = an tm;
m = Alloc(cur->slze,YES)«
m~mcpy(m cur->msq,Cur->~lze);
Put (DlnEtrl', aniJll-.5col1l1. pld ,m) :
}
else
reply status(cur->msg,"-animate","not supported",O);
else
reply_status(cur->msg,"-animate","duplicate name",O);
~
\C
W
U\
't.rt
o
tv
00
I
\0
~
\C
}
l':!lse
w
~
reply st.atus (cur->msg, "-animate", Itname too long" I 0) ;
~
J098
1099
1100
1101
Jl 02
110)
]J04
1)05
11 06
] 101
II 08
)]09
] II a
] )]1
] 112
]]]J
] 1J4
] 1] 5
]1] 6
] ] 17
] 1 18
] 119
ll20
]] 21
1122
] 12 J
1 ] 24
1125
\C
1\ 1 b; r
(cur lIs t)
rC91ster tURRENT
teglster LIST
l
reg1ster ANIH
re(llster char
CIl
*C\~r i
*llSC;
*anim;
*name;
conn:
CONNEC'!'OR
if (name == Find triple (cur->msg, "name" , cur->s ize, HULL, 2 , HULTJ) )
{
for (anlm = 11~t->anlms: anim && strcmp(name,anirn->name);
U\
'VI
alllm == alllm->l1xt) ;
o
if (anlm)
{
90nn = anim->conn;
If (!strcmp(cur->msg,"cancel"))
(
I' t '
,
IS ->anlrnS = all1rn->nx t ;
}
else
N
00
w
\0
Free(allim);
frorward (DIHEC'f I conn. pid, cur->msg) ;
cur->msg = NULL;
reply_status(cur->msg,cur->msg,"not found",O} ;
~
\C
c::I"I
1126
1127
1 J 28
1129
II J 0
~
I..c'I
"'-l
lI.it(list,msq~sJze,appl)
rcg.lstcr LIS'1
""lIst;,
feglster long
msg, Size, appI;
reg~ster short
reglster ELEMENT
*p tolerance;
*eiement;
1134
ELbMENT
*f111d_box();
] ]JG
t· oleranee ::: * (short *) Find t riple ~msg, "tal til I si ze, &l1one 2 {NULL) :
If (p = {$hort *) Fino tdpte(msg,'pos ",Slze,&none 4 HU LL])
]f (.lst->current!!!! elerner\t:= fInd box(*p,*(p+lj,iist,appl))
1131
11 ) 2
113 ")
] J 35
J"
J1
1138
] 139
regIster P E flDR
{
]]40
*hQr'
-
~dr ~, (P E ~DR
(
1143
1 11 tl
)145
)146
J } 41
*) &element->length:
&&
w
:::=
else
else
\0
'V))
J\eply (msg I Newmsg (hdr-> lengthl50, "wr i te" , "da ta="
1151
f3
00
~
hdr->attr.selected = YES'
if ((hdr-?type ==" 'mil && (*value(hdr)
sel llst(hdr);
element=>chanqed = YES;
}
1150
U.
hdr->attr.selectable)
1Ist->changesf+;
IJ48
) 1 49
lJ\
-
If (l'lnd-trlple(msg,"sel ",s ze,NO,O,NULIJ)
JJ 4 1
114 2
1152
1 l5 3
] ] 54
1155
-
e" e", hdt ,HULIJ) ) ~
reply stntus(rnsg,msg,"not found",O);
reply_status(msg,msg,"miss.lng \'pos\''',O};
~
I..c'I
QO
]]56
1157
1158
1159
1160
1161
]162
1163
1164
11.65
1166
1167
1168
1169
1170
1171
1172
11.7 J
1174
1175
]176
1]77
] 178
11'79
1J 80
J) 81
Jl (12
. ]) 83
1184
1185
11!J 6
1187
1 188
)189
)] 90
}191
1192
ll9)
1194
) ) 95
) 196
1197
1198
)199
1200
]201
1202
1203
ELE~fENT *find box(row,colflist,appl)
regtster short row, col;
reglster {.IST
""list;
reglster long
appl;
{
regjster P E IIDR
*hdr;
reglster E~gMENT
*element;
for (element = list->last; element; element = element->pre)
{
hdr :;' (P E IIOR *) Scelement->length;
if (In boxlhdr->rowlhdr->col,hdr->he19ht,hdr->widLh,rowlcol)
&&-!,lement->de .eted)
lf (! appl
(appl == -1 && ! * (lonq*) (hdr+l)
appl == *(long*) (hdrtl»)
break;
)
return(element) ;
I
~
~
~
I
in ~ox(r,c,h,w,Cl,c2)
reglster short r, c, cl, c2, h, w;
(
if «Cl < r) J I «(:2 < c»
return (fWJ
]. f « c 1 > r + h) I I (c2 > c + w»)
return(IW) ;
return(YES) ;
I
U\
v.
8
"00
(,;.)
I
1.0
sel list(hdr)
register P E IIDR
*hdr;
{
- register P E BOR
"'temp, *first;
short
- len;
char
'p;
[or (first == temp == first macro(hdr,HULL,&len,&p)i
temp && temp->attr.lntlden: temp == next macro(~len, &p));
if (temp)
{
temp->attr.hldden = YES;
If {! (temp =,next macro(&len,&p)))
temp,,;: flrst;temp->a ttr .llldden "" NO;
-
g
120~
]205
1206
1207
1208
)209
)2]0
] 211 .
1212
1213
12] 4
1215
} 2] 6
12]7
12)8
1219
1220
1221
]222
]223
]224
1225
1226
1227
]228
1229
12)0
1231
]232
)23:3
)2]4
]235
]236
]237
1238
1239
]240
)241
] 242
1243
1244
1245
1246
1247
1240
1249
v J C!\,~port (ct,lr{ area 11 is t)
reglster CUI( msg,"area",cur->si.ze,HULL,8,NULL))
for (vIew ~ ll'st->views; view && (view->owner.pid != cur->sender.pid);
,
y le~J = v ew->nxt) ;
lf (vlew),
.
rnemcPy(&vlew->row,p,4*slzeof(short)) ;
else
(
vlew::: (VIEW 7) AIIQc(sizeof(VIEW) ,YES);
vlew->nxt ::: 11st->vlews;
vlew->own~r = cur->sendir;
ll1'i'mcpY{~Vlew->rc;>w,P/4*s. zeof(shorl:)):
1Ist->vlews = VIew;
~11ange area(area,view->row£view->collview->height,view->wjdth);
element := mark a rea (area -> -1 J. area->c , area->r2, area ->c2 lIS t
HAX P E tWLIJI NULr.J, NULL, &lenqth, NULL Qur->appl { ·
send{cur,area7lisf,o,length/element,YES,CUr->~lsplay ma~k,YES);
J
else
(
conn "'" (CONNECTOR *} F ind ~.r lp 1 e (cur->msg, "conn',' tOr &cur->senqer, 8 , NULL)
for {view := ltst->vlews; vlew && (V18w->owner.llld ."" conn->pld);
.
prev = Vlew, VIew = vlew->nxE) ;
1 [ (VIew)
(
if (prev)
,
prev->nxt = vlew->nxt;
else
,
li9 t ->vlews = view->nxt;
Free(vlew) ;
N
Q
~
1II
'til
f3
00
l;.)
1.0
I
;
s
]250
1251
]252
)253
] 254
)255
1256
1257
)258
]259
]260
] 2 G1
1262
126)
1264
]265
]266
J267
J268
]269
1270
1271
]272
chat;lge area(area,row,col,height,wldth)
reglster AHEA
1Iarea;
reglster short row, col, height, width,
(
if (row < area->rl)
area->rl :::: row'
if (col < area->c1J
area->cl '" col;
if (row + height> area->r2)
.
area->r? = row + height;
If (col + wIdth> area->c2)
area->c2 = col + width;
1289
]290
]291
1292
129)
)294
1295
1296
1297
)298
1299
~
notjfy(cur area list\
regIster C6RRENt
~cur;
reqlster AREA
*area;
"lIst;
IJIS'r
{
regjster VIEW
*view:
regIster lnt
length;
for (view = list->views; view; view = view->nxt)
(
1 ength :::: mark changes (l is~->first,
view->row;v~ew->c9.l,vlew->helght view->width) .
Send(CUr,area,llst &Vlew->owner,len q fh,list->flrst,
YES,cur->dlsp 1ay_mark,list->erases);
]21)
]274
]275
]276
1277
J278
1279
1280
1281
]282
1283
]284
1285
1286
)287
1288
~
Ut
"Ut
S
"00
w
\0
n~ar~ chan~es(el~tnellt~rlc,h/w~
legp;ter EJ.,EMEIJr
regIster short
{
reglster:r
e ement,
r, 0, lI, w;
E 1I0R
*Qdr;
reglster 1ntlIst_length = 0;
for ( ; element && !element->chal1qed; e)emen!: == elernent->nxt) ;
for ( ; element; element = elemenc->nxt)
(
hdr :: (P E IIDR .,q &elell1ent->lenqth;
.
if (element->marked ~ (,lement-Sahanged && !hdr->attr.llldden ,&
(hdr->row + hdr->h,lQht >= r) && (hdr->row <= r + h) &&
(hdr->co.l + hdr->wldth >= c) && (hdr->col <= c + w)))
list length += hdr->length + J;
)
-
return(list_length};
~
1300
1)01
1302
nO)
]]04
1305
]:)06
)]07
1]00
1309
13]0
13] 1
1))2
])] J
1314
1)}5
1316
] J 17
13 ]8
))]9
]]20
1321
1322
])23
]J2~
] 32:5
1326
1327
1328
1329
1330
1] Jl
sell r) (cur, areat,l ist, proc, length, element, modify / mark, redraw)
recpst:er CUHH.t<~NT
tcut;
AREA
*ar ea ;
LIST
regIster CONNECTOR
reqlster unsigned int
reglster ELEMENT
reglster unsigned short
(
regjster P E nDR
reglster short
char
ELEMEN'I'
*llst;
~proc,
length:
*el,ment;
modlfy, mark, redraw;
*hdr;
element length; .
*m *p '-*fleE mark() ;
*r~dUH4_bkgd 0 ;
else
p : ;: (m == Hewmsa (lenqth+JOO
.
"write","daEa=HA; type=Hc",lengthI250,HULL,'P')) + 24;
if (element)
for ( ; element: element = element->nxt)
(
j f (element->marked && lelement->deleted)
(
element->marked :::: tlO;
elemellt length'" element->length;
memcPY1Q, &e].emen1:-> length, (loilg) element length) ~
hd r = ~ E IlDH '1<) P ~
if (mo lfyr
(
]))3
13 J4
])35
J336
JJJ7
o
N
"00
w
\0
.
element lellgth = check text(hdr,hdr->length);
element length ==
change origin(hdr,cur->appl row,cur->nppl col):
if (cur->appl)
)
]342
P ·t= e]limellt length;
I,ong_ align (Pt:
)]40
]30
1)4'3
)
}
)345
1346
if (mark)
p :::: set mark(p cur);
~(short *) p = NOLL;
If (proc)
1350
else
1351
1352
U)
"vt
if (hdr->attl. selected)
element length := set select (hdr !,cur->h i ghllght.) ;
i f ((hdr->type == 'ml) && ('''yalue(!1ur) :::::: 'I,'))
element length = !nacro llst (hdr) :
if ((l1dr->type ::::: 't'))
-
1330
1339
1347
1348
]]49
~
if (redraw)
element ~ redraw bkgd{area/llst,&m,&p);
lJJ2
1344
N
rut(DIRECT,proc->pid,m) ;
Reply(cur->msg/m) ;
-
--
N
o
="
1353
])54
J]55
1356
1357
]358
1359
))60
1361
1362
1363
) :3 64
1365
]366
]367
]]68
1369
1370
1371
}373
1374
1375
1376
]377
1)72
J378
1379
1300
1)81
]382
1383
1384
])85
1386
1387
1308
1389
]390
]391
1392
]393
1)9~
1395
)396
)]97
1398
cha'~ge
origin (hdr, rowE col)
regIster P E nOR
*ldr:
req 1s tel' silOrt
row, col;
l
if «hdr->row -~ row) < 0)
returnC01;
if «hdr~>~o -= col) < 0)
return(ol;
return(hdr-> ength};
~
.....:a
chaJ; *set mark(p,cud
reglster char
~p;
reg1ster CURRENT
*cur;
{
,
if (cur->erase mark)
(
memcpv(p(cur->erase mark,*(short*)cur->erase mark)
P += .(slort *) Pi lr (cl1r->)lla rk)
{
memCPv(ptcur->mark,*(short*)cur->mark) ;
p 4·= .(Slort *) p;
J
return (p) ;
ELE~ENT
i
Ul
V.
S
00
tJ,)
\0
*redraw bkgd(area,list,buf,ptr)
reglster AREA
reg~ster LIST
register char
(
-'area;
*llst;
**buf, *'ptr;
~LEMENT
*element:
lilt
length, nUID;
elemen t :::: m<.;l rk _area (area->r 1,.(\rea->01, a rea-> 1'2 l area ->c2 c
lIst,MAX P E1NULL,~ULLINULL,&length'knum,NULLJ;
length += (4 * llum)" T 50; .
*buf. = Ncwmsq(length+50,"wrlte","data=HA; type=#c",length,HULL, IPI);
*ptr = *buf f 24;
draw filled rect(ptr,area->rl area->cl, (area->r2)-(area->rl),
tarea->c2)-(area->cl),NULL,0,o,area->color,atea->pattern,O,O,O,NULL);
return(element) ;
~
Q()
1399
]400
1401
14 02
1403
1404
1405
1406
1407
1408
1409
]4]0
set select(hdr,)ligh option)
1'og1 ster P E HuH
-*I)dr:
.
reglster char
h1gh OI)tIon;
{
register short length:
length
J412
104
1415
1116
{
1417
1418
1419
hdr.->color :::: (hdr->color 1, 1) % 7 • 1;
if ( h d r - > fi.1 ) )
hdr->flll "" (hdr->fll.l
else
14 21
1422
)
1423
1124
macro -, color(htlr)
]4 31
14 32
{
J440
J40
14 4 2
1443
1444
1445
1446
1447
14 1\!3
+ I;
"ut
o
i
N
else if (hdr->type == 'ttl
sel text(hdr,high optIon):
return (length) ;
-
macro list (helr)
1436
1) % 7
1I1
1429
14 37
JOD
J439
+
)
14 20
1113
14 3 4
lOS
I,C
hqr->attr71hv'i!rt :::: Ihdr->attr.invert;
1413
14JO
N
Q
else If (l11gh option == 'Il'l
hQ r->n t.Er:-lnql)liqht "" ! htlr->atl:r. highlight:
else 1£ (l11gh opEloll ::::== 'C')
{
if (hdr.->type 1"" I In' )
14 11
14 25
14 26
1427
]428
= hdr->length:
1f (fhigh optiQn)
hqr->a~tr.1nv~rt == Ihdr->attr.invert;
else If (111gh 9ptlon =:::: 'I')
l'cg 1. Gter P E Il(JR
- -
w
\0
*hdr;
register P E 1I0R
regIster short
*temp;
row, col;
len;
*p;
short
char
row == hdr->row:
col = hdr->co~;
for (temp = flrst macro(bdr,NULL,&len,&p)'
,
temp && temp-;;attr.lndden; temp "" nex~ macro{&len, &p));
1 f (temp)
(
meIncpy(hdr,temp,t~mp->length) :
hdr->tow = row;
)
00
hdr->col = col;
return(hdr->length} ;
N
~
Q
1449
]450
1451
1452
1453
1454
1455
1456
1457
14 58
1159
]460
1461
1.4 62
1463
)464
14 65
14 66
1467
14 68
1469
1470
14 71
1172
1473
14 74
]175
14 76
117'1
147 (3
]479
1480
]4B1
] 4B2
HI.l3
1484
1485
H86
1187
14 88
14 89
1490
1491
1492
1493
1494
1495
1496
1497
149B
1499
1500
color(hdr)
IIIhdr;
reglster P E lIDR
(
-- *temp;
register P E lIOR
short
- len;
*p;
char
for (temp = first
{ -macro(hdr,NULL,&len,&p); temp; temp
temp->color = (temp->color + 1) % 7 + 1;
If (temp->fill)
.
temp->flll = (temp->flll + 1) % 7 + 1;
lOaCrO
= next _.macro(&len,&p))
N
~
~
sel text (helr hiqh option)
reg1ster P E lIDR - *I)dr;
regIster cllar
h1.gh option;
{
register TEXT_OPTIONS
'opt;
QRt =, (TEXT OPTIONS *l value(hdr);
If (Iuqh optlon == I b )
opt-~bQrder = YES;
else If (hlqh option == 'U')
opt->unaerlln~ = YES'
else lf (hiqh optlon =~ IS')
opt->bold-= YES;
I
cheyk text (hdr.,(.length)
reglster P E IIlJR
IIIhdr'
regIster shott
1engfh;
(
,
regls t er char
"'Pi
eha r
*111
reglster 'l'EXT_OPTIOHS
*opt;
Qpt a (TEXT OPTIONS *l value(hdr);
l [ (opt->border && hdr.->flll)
(
opt->horder = NO;
p = (eh~r *) hdr + length;
Long align(p);
n ::: p;
draw rect(&n,hd r ->roW-3 hdr->col-J,11dr->hei ghtt6,hdr->width.6,
NULL,hdr->flll , 'S', 1
.,NULL);
length ~ n - (char*)hdr;
teturn(length) ;
Ut
lh
S
"00
w
\0
~
N
1501
]502
1503
) 504
1505
]506
]507
]508
1509
1510
1511
1512
15]J
1514
1515
]516
1517
]518
]519
1520
] 521
]522
1523
1524
1525
]526
1527
1528
1529
1530
1531
1532
153)
1531
)535
1536
153'7
1530
}5]9
1540
1541
]542
154J
]544
*mark elements(list,length,num,msg,size,appl)
"'llst'
*lengtl,l, "'Hum;
long
msg, s1ze, appl:
{
register short
row = 0, col;: 0, number == Or count =: 1;
reglster short
to row:: HA}( ROH, to col"" Hl\X COL, *p;
re~~ster ELEMENT
*element;
regIster char
*tag pat ~ NULL;
char
what:-·= NULLf. tag buQ200), *text pat = NULL, dOt "" YES;
long
*tr1p1e, at r = NULL,
-
FI,EMENT
LIST
utlslglled int
el~ment
}548
1549
]550
1551
]552
1553
]554
1555
1556
NUl,I.J;
whIle (p = (short*)Find trip1e(msg,"@\O\o\oll,size,NULL,O,&triple))
{
switch ("'triple)
(
case Keypack ( I ~ , , I C I I 'n' , I t I ) :
count = *p~
break'
case Keypack( I@I, 'al I 't I , It'):
attr \= *(long *) p;
break! ::: Ox8000;
pttr
case Keypack ( I @I , 's ' , Ie' , , l' ) :
break,
number := *p;
case Keypack ( I @, I 'n' , 'u ' , 'm' ) :
what = HULL;
break~
row"" *pl·";
case Keypack ( I ~ , , 'p' I '0 1 I 's ' ) :
col :=: *p.'
what ::= 'A';
break:
case Keypacl«' @, , 'e ' , 'n' I'd' ) :
to row "" *~.H;
to-col == -Ie ;
what"" 'A',
break;
text pat
Alloc(500,YES);
case Keypnck ( , @, , It' , I x' , , t ') :
If (Hnakpat(p,text pat))
{
Free (text Pi'lt }f'
text pat!!;! NULJ;
~reak; lf (lmakpat(p{ (ta~ pat ~ tag buf))}
case Keypnck ( '@ I I ' t· / 'a' , 'g' ) :
tag_pat a 10LL,-
I:,.)
)-I
w
1II
"vi
o
00
N
W
\D
I:,.)
)-I
1515
1516
]54"1
=:
I
!triple", HULL;
dflt = 1IOi
If (dflU
count - MAX P E;
element = m~rk number(number,tacr pat,text t;at,
11stA-count,attr,1engtn;hum,appll,
else j f (what === I ' )
element = mark atea(row{col,to row/to col,list1count,
attr7tag_pat,cext_pat,length,num,app );
i f (!wlwt)
.a;.
]557
J558
] 559
1560
]561
]562
J563
] 564
1565
1566
]567
1568
1569
)570
] 571
1572
1573
] 574
]575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1505
1586
1587
1588
) 589
1590
1591
] 592
J 59 J
] 591
]595
)596
1597
1598
if (text pat)
Free'ftext pat):
return{e ement};
ELEMENT *mark area(row,col/to row,to col,11stf.
. .
count,actr;tag pat,text pa ,length,num,appl)
reglster short
row, col, to row, to co17 count;
lohq
at~r;
LIST
*1181:;
char
*tag pat, *text pat;
unsIgned Int .
*length, *num; {
reglster P E HDR
*hdr;
regIster ELEMENT
*element = NULL *temp;
regIster long
total length:= 6;
unsIgned Int
or1g_count;
if (row >= 0 && col >= 0 && to row >= 0 && to col >= 0)
(
orig count = ~ountL
.
for ltemp = 11st->rirst; temp && count: temp = temp->nxt)
{
hdr :::: (P E lIOR *) &temp->length;
if (hdr-~row <= to row'&& hdt->Qol <= to col
&& row < hdr->row + hdr->he1ght && col < hdr->col + hdr->width
&& valid(hdr,tag pat,text pat,attr,appl) && !temp->deleted)
(
-total length t= temp->length~
temp-~marRed = YES;
1f (Ielement)
element == temp;
count--;
N
i-&
UI
I
)
If (length)
*length : : : total length;
if (ntlm)
•
*nulll ::::: orlg count - count:
)
return(element):
U\
"u!
S
~oo
(;.)
1..0
~
="
]599
1600
1601
1602
1603
1604
1605
1606
1607
]60A
]609
1610
]611
] 6) 2
] 61 3
1614
]615
]616
] 617
1618
) 619
1620
J621
1622
1623
1624
]625
1626
)627
1620
ELE~ENT
*mark number(n,taq pat,text_pat,list,count,attr,length,num,appl)
reglster short
n I GOllnt':-r
regIster long
tH.Q pat, text pat, attn
reg 1ster (lIST
*] 1st·
.1lllsJgned lnt
*length, *num;
{
reg1 ster ELEHENT
*element ::::; IfULL6 *temp : : ; HULL;
reg~ster long
tot·al lenqt 1 "" ;
unsIgned lnt
orlg_t!ount;
if (n == ~11
temp:::: ist->last;
else
for (temp = list->first; temp && n--" temp = temp->nxt);
for (or ig c<;Jllnt : : ; COllnt; temp & & count; temp :=: temp->nxt)
If (val1d(&temp->length,tag pat,text pat,attr,appl) S& Itemp->deleted)
{
-total length += temp->length;
temp-~marRed = YES;
If (! element.)
element:::: temp;
count--j
if dengthl
.
*leilgt.h:::: total length;
If (num)
*num : : : or1g coltnt!- count;
return(element}T
N
I-l
....;J
lit
U.
8
"00
w
\0
N
I-l
!Xl
]629
]630
] 6)1
1632
1633
1634
1635
)636
1637
1638
1639
]610
}641
1642
1643
1644
1645
1646
]647
1648
1649
1650
165t
]652
1653
1654
1.655
]656
1657
1658
1659
1660
1661
1662
]663
1664
1665
1666
1667
1668
]669
1670
1671
1672
1673
l674
1675
1676
1677
va11d(hdr~tag pat,
reglster 1:' E tWR
text pat,attr,appl)
*htlt;
reglster char
*taq pat, *text pat;
register long
attf7 appl;
(
register char
*target, ok = YES;
long
temp,
if (tag pat)
If "( target = tag (hdr))
ok = aruatchlfarget,tag pat);
else
ok :: NO;
if (text Rat)
If (l1or->type === 't')
ok = ok && aruatch(value(hdr)+8,text pat);
else
ok = NO;
if (attr)
(
rnerncpy(&temp,&hdr->attr(sizeof(long));
ok = ok && lcemp & attr,;
)
]f (appl)
{
if (appl === -1)
ok :::: ok && (! * (long*) (hdr+l)) :
else
ok = ok && (appl == *(long*) (hdrl·l));
)
return(ok) ;
sta~us(msg size)
reglster c~ar
*~Sq;
regIster long
SIZe;
(
register char
tm;
*(m = Allo9(slze,YES)) ::; tlUL\,;
streat m,Flnd trlple(msg, 'orlg",size,Scnone,l,llULL));
strcat m," lilT
strcat m,Fina triple(msg,"stat",size,&none,l,NULL))i
strcatm,f'in-II)j
.
strcat mJ..Find trlple(msg,"req ",size,&none,1,UULL));
Note(m "t:HROR") t
Free(mJ;
~
',Q
U\
"Ut
o
tv
"00
w
\0
~
1678
)679
1600
1681
1682
1683
1684
)685
1686
]687
1688
1689
1690
1691
)692
1693
)694
1695
1696
]697
1698
1699
]700
1701
1702
1703
1704
1705
)706
1707
]708
1709
]710
1711
1712
1713
17 J 4
1715
1716
1717
]718
1119
reply status(cur,mid~statlcode)
register char
*cur, *m d, 'stat;
regIster long
'code:
{
register char
'type:
type ::::! "failed'"
If ("'lr id ='" '-'J
nqd++ •
else If (~mid ~'" It')
(
type
~
,...
= "done":
IDIa'I-+ ;
~eplv(Cvr,Newmsq(strlen(mldl+strlen(§t"t\+50 type,
"0[1g=#S; req=#S; sf.at=HS; code=#l",('plctltte",rnid,stat,code)) i
ELE~EHT 'new elementjlist,size,after)
reglster I,IST
lIst,
reglster lonq
SIze:
regIster ELEMENT
*after;
{
register BLEMElI'r
"'element;
regIster long
i :: 0;
if (size <= 9t ->pool,size)
for (i = lst->P091.n'jelem~nt ~ list->pool.ptr;
element->pool && . && I element->delet'i!d;
if (i)
(char*)element +:::-: li.st->pooLsize, --1) ;
l
)
else
{
element
== (ELE~IElI'r -II)
elemcnt->pool
==
HO;
Alloc(size, YES);
}
17 22
(llst->last)->nxt == elerneht;
else
list->first ~ element;
list->last = elementl
element->chanqed "" yes;
element->delefed = element->marked
return(element) :
)724
1125
1726
1727
]728
1729
\0
if (element->deleted)
delete element(llst,element):
element->paol = YES;
~lement->nxt
1723
o
00
w
N
11
]720
1721
lJl
~lJl
== InnJI,',
1f (el~ment->pre == ilst->lastl
= NO;
~
1730
]731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1717
1748
]749
1750
]751
1752
1753
J754
]755
1756
),]57
1758
1759
]760
1761
]762
1763
)764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
element(list,element)
regtster ELEMENT
*element;
regIster LIST
*llst;
{
if (element->pre)
(element->pre)->nxt = element->nxt;
else ,
.
list->flrst = element->nxt;
if (e ement->nxtl
(element->llxt)->pre = element->pre;
else .
11st->last = element->pre;
if (element->po61)
element->pool = NULL;
else
,Free('i!Iement) ;
--llst->slze;
del~te
*value (hdr)
*hdr;
reg IS t.er P B 1I0R
(
-register char
*p:
p "" (char'll) hdr + sizeof(P E 1I0R)
If (hdr->attr.appl)
- p 1= 4·
if (hdr->aftr.ta9ged)
~
char
l.I\
U.
S
00
tJ.)
1
\0
whlle (*p++),
1,0 n9 a 11 9 n ( p J
return(p) ;
;
char *tag(hdd
reglster P E (lOR
*hdr:
(
-register char
*p;
p = (char *l hdr + sizeof(P E IIDR);
if (hdr->attr.appl)
P += 4'
if (hdr->a~tr,tagged)
returnLP) ;
return(NUL ,;
- -
lj
.&;;:.
5,502,839
225
What is claimed is:
1. A virtual input interface in a data processing system,
said interface comprising:
means for accepting input from at least one physical
device and for converting said physical device input
into virtual input, said means comprising a virtual input
manager process responsive to said at least one physical input device for generating a picture, said picture
comprising one or more picture elements, each picture
element comprising a plurality of device-independent
data structures in a predetermined, standard data format, at least one of said data structures comprising a
plurality of different data fields each containing information describing said picture element; and
means responsive to said virtual input for performing
processing operations upon said virtual input, said
means comprising a console manager process for performing processing operations on said one or more
picture elements.
2. The virtual input interface as recited in claim 1, wherein
said input accepting means accepts input in the form of
keystrokes.
3. The virtual input interface as recited in claim 1, wherein
said input accepting means accepts input in the form of
cursor position.
4. The virtual input interface as recited in claim 1, wherein
said input accepting means accepts input in the form of
system-defined actions.
5. The virtual input interface as recited in claim 1, wherein
said input accepting means accepts input in the form of
user-defined functions.
6. The virtual input interface as recited in claim 1, wherein
said input accepting means accepts input in the form of
menu selections.
7. The virtual input interface as recited in claim 1, wherein
said at least one physical device can be removed from said
system without affecting the operation of the remainder of
said system.
8. The virtual input interface as recited in claim 1, wherein
at least one additional physical device can be added to said
system without affecting the operation of the remainder of
said system.
9. A virtual output interface in a data processing system,
said interface comprising:
a source of virtual input, said virtual input comprising one
or more picture elements, each picture element comprising a plurality of device-independent data structures in a predetermined, standard data format, at least
one of said data structures comprising a plurality of
different data fields each containing information
describing said picture element;
means for performing processing operations on said virtual input and for generating virtual output;
means for accepting said virtual output; and
means for converting said virtual output into at least one
physical output suitable for use by at least one physical
output device.
10. The virtual output interface as recited in claim 9,
wherein said virtual input comprises a plurality of related
picture elements and wherein said virtual output accepting
means comprises a picture manager process for controlling
said plurality of related picture elements.
226
S
10
15
20
2S
30
3S
40
45
50
55
60
11. The virtual output interface as recited in claim 10 and
further comprising a display device, wherein said virtual
output accepting means further comprises a window manager process for controlling the display of said plurality of
related picture elements on said display device.
12. The virtual output interface as recited in claim 9,
wherein said virtual output converting means comprises a
virtual output manager process responsive to said one or
more processed picture elements for coupling said one or
more processed picture elements to said at least one physical
output device.
13. The virtual output interface as recited in claim 9,
wherein said at least one physical device can be removed
from said system without affecting the operation of the
remainder of said system.
14. The virtual output interface as recited in claim 9,
wherein at least one additional physical device can be added
to said system without affecting the operation of the remainder of said system.
15. In a data processing system, an interface between
processes and data in said system and physical input and
output devices coupled to said system, said interface comprising:
means responsive to one of said physical input devices for
generating a picture, said picture comprising one or
more picture elements, each picture element comprising a plurality of device-independent data structures in
a predetermined, standard data format, at least one of
said data structures comprising a plurality of different
data fields each containing information describing said
picture element;
means for performing processing operations on said one
or more picture elements; and
means responsive to said one or more processed picture
elements for coupling said one or more processed
picture elements to one of said physical output devices.
16. The data processing system as recited in claim 15,
wherein said one or more picture elements define a graphical
object and at least one attribute thereof.
17. The data processing system as recited in claim 16,
wherein one of said data fields describes the length of the
associated picture element.
18. The data processing system as recited in claim 16,
wherein one of said data fields identifies the particular type
of the associated picture element.
19. The data processing system as recited in claim 16,
wherein one of said data fields describes the position of the
associated picture element relative to row and column
coordinates on a picture of which said picture element forms
a part.
20. The data processing system as recited in claim 16,
wherein one of said data fields describes the size of the
associated picture element.
21. The data processing system as recited in claim 16,
wherein one of said data fields describes the color of the
associated picture element.
22. The data processing system as recited in claim 15,
wherein said means responsive to one of said physical input
devices comprises a virtual input manager process.
23. The data processing system as recited in claim 15,
wherein said means responsive to said one or more processed picture elements comprises a virtual output manager
process.
* * * * *
Disclaimer: Justia Dockets & Filings provides public litigation records from the federal appellate and district courts. These filings and docket sheets should not be considered findings of fact or liability, nor do they necessarily reflect the view of Justia.
Why Is My Information Online?