cCHARWIN ; Char windows mnemonic space ; ; +--------------------------------------------------------+ ; | Copyright 1986-2008 by InterSystems Corporation, | ; | Cambridge, Massachusetts, U.S.A. | ; | All rights reserved. | ; | | ; | Confidential, unpublished property of InterSystems. | ; | | ; | This media contains an authorized copy or copies | ; | of material copyrighted by InterSystems and is the | ; | confidential, unpublished property of InterSystems. | ; | This copyright notice and any other copyright notices | ; | included in machine readable copies must be reproduced | ; | on all authorized copies. | ; +--------------------------------------------------------+ WMODE(m) n x s x=$zu(119,50,$g(m,-1)) q:'$zbitget($zversion(0),1) s x=$g(^%SYS("LOCALE","CURRENT")) i x="jpnw"!(x="zdsw")!(x="zdtw") s x=$zu(119,33,8) q ; WOPEN(a,b,c,d,e,f,g,h,i,j,k,l,m,n) ; i $zu(119,50)=1 q:'$zu(119,51,a,b,c,d,e,$g(f,0),$g(g,""),$g(h,""),$g(i,""),$g(j,""),$g(k,7),$g(l,0),$g(m,7),$g(n,0)) q q:'$zu(119,51,-1,a,b,c,d,$g(e,0),$g(f,""),$g(g,""),$g(h,""),$g(i,""),$g(j,7),$g(k,0),$g(l,7),$g(m,0)) q ; WCLOSE q:'$zu(119,52) q ; WUSE(id) q:'$zu(119,53,id) q ; WLIM(c,l,w,h,b,a,ba,cap,cpo,wf,wb,bf,bb) ; n r i '$d(c) s r=$zu(119,58) e s r=$zu(119,55,c,l,w,h,$g(b,0),$g(a,""),$g(ba,""),$g(cap,""),$g(cpo,""),$g(wf,255),$g(wb,255),$g(bf,255),$g(bb,255)) q ; WBOX(c,l,w,h,b,a,ba,cap,cpo,wf,wb,bf,bb) ; q:'$zu(119,54,c,l,w,h,b,$g(a,""),$g(ba,""),$g(cap,""),$g(cpo,""),$g(wf,255),$g(wb,255),$g(bf,255),$g(bb,255)) q ; BOX(x1,y1,x2,y2,border,battr,cap,cpos,ch,wfc,wbc,bfc,bbc) ; q:'$zu(119,56,x1,y1,x2,y2,border,$g(battr,""),$g(cap,""),$g(cpos,""),$s('$d(ch):-1,1:$a(ch)),$g(wfc,255),$g(wbc,255),$g(bfc,255),$g(bbc,255)) q ; FILL(x1,y1,x2,y2,char,wfc,wbc) q:'$zu(119,57,x1,y1,x2,y2,$a($g(char," ")),$g(wfc,255),$g(wbc,255)) q ; WREFRESH q:'$zu(119,4) q ; ZWSTATUS(wid) ; n mode,r s mode=$zu(119,50) i '$d(wid) d q r . i mode'>0 s r="" q . i mode=1 s r=$zu(119,42,0,14) q . i mode=2 d q . . s r=$zu(119,42,0,1)_";"_$zu(119,42,0,0)_";"_$zu(119,42,0,3)_";" . . s r=r_$zu(119,42,0,2)_";"_$zu(119,42,0,5)_";"_$zu(119,42,0,4)_";" . . s r=r_$zu(119,42,0,7)_";"_$zu(119,42,0,6)_";"_$zu(119,42,0,9)_";" . . s r=r_$zu(119,42,0,8)_";"_$zu(119,42,0,10)_";" . . s r=r_$zu(119,42,0,11)_";"_$zu(119,42,0,12)_";1;"_$j_";" . . s r=r_$zu(119,42,0,14) q . q s r=$zu(119,42,wid,0)_";"_$zu(119,42,wid,1)_";"_$zu(119,42,wid,2)_";" s r=r_$zu(119,42,wid,3)_";"_$zu(119,42,wid,11)_";"_$zu(119,42,wid,20) s r=r_";"_$zu(119,42,wid,13)_";"_$zu(119,42,wid,8)_";" s r=r_$zu(119,42,wid,9)_";"_$zu(119,42,wid,12) q r ; INIT(ty) ; Init terminal type s $zt="error" i '$d(ty) s ty="Cache Terminal" i $zu(120,80)[ty q ; This type is already loaded i $d(^%SYS("tercap",ty)) g INIT1 ; This is a canonical name n tt s tt="" f s tt=$o(^%SYS("tercap",tt)) q:tt="" q:^(tt,"names")[("|"_ty) i tt="" d q . w *7,!,"%CHARWIN: Unknown terminal type: ",ty . w !,"Try one of the following:" . f s tt=$o(^%SYS("tercap",tt)) q:tt="" w !,?5,tt . w ! h 2 q s ty=$p(^("names"),"|",1) ; Make ty a canonical name INIT1 n x,by,mn s by=0,mn="" ; Calculate # bytes to allocate f s mn=$o(^%SYS("tercap",ty,"bin",mn)) q:mn="" s by=by+$l(^(mn)) s:$d(^%SYS("tercap",ty,"names")) by=by+$l(^("names"))+1 i '$zu(120,100,by),$zu(96,0,15) ; Allocate area (ERSTORE) s x=$zu(120,80,$g(^%SYS("tercap",ty,"names"),ty)) ; Set names s x=$zu(120,78,$g(^%SYS("tercap",ty,"lins"),24)) ; Set # of lines s x=$zu(120,77,$g(^%SYS("tercap",ty,"cols"),80)) ; Set # of columns s x=$zu(120,79,$g(^%SYS("tercap",ty,"flags"),0)) ; Set flags ; Set mnemonics i $d(^%SYS("tercap",ty,"bin","cup")) s x=$zu(120,40,^("cup")) i $d(^("clr")) s x=$zu(120,0,^("clr")) i $d(^("bell")) s x=$zu(120,2,^("bell")) i $d(^("aoff")) s x=$zu(120,3,^("aoff")) i $d(^("init")) s x=$zu(120,5,^("init")) i $d(^("end")) s x=$zu(120,6,^("end")) i $d(^("ind")) s x=$zu(120,10,^("ind")) i $d(^("ri")) s x=$zu(120,11,^("ri")) i $d(^("cuf")) s x=$zu(120,12,^("cuf")) i $d(^("cub")) s x=$zu(120,13,^("cub")) i $d(^("cuu")) s x=$zu(120,14,^("cuu")) i $d(^("cud")) s x=$zu(120,15,^("cud")) i $d(^("ech")) s x=$zu(120,18,^("ech")) i $d(^("ich")) s x=$zu(120,19,^("ich")) i $d(^("il")) s x=$zu(120,20,^("il")) i $d(^("dch")) s x=$zu(120,21,^("dch")) i $d(^("dl")) s x=$zu(120,22,^("dl")) i $d(^("hon")) s x=$zu(120,24,^("hon")) i $d(^("ron")) s x=$zu(120,25,^("ron")) i $d(^("uon")) s x=$zu(120,26,^("uon")) i $d(^("bon")) s x=$zu(120,27,^("bon")) i $d(^("il1")) s x=$zu(120,70,^("il1")) i $d(^("dl1")) s x=$zu(120,71,^("dl1")) i $d(^("con")) s x=$zu(120,72,^("con")) i $d(^("coff")) s x=$zu(120,73,^("coff")) i $d(^("colb")) s x=$zu(120,74,^("colb")) i $d(^("colf")) s x=$zu(120,75,^("colf")) i $d(^("rep")) s x=$zu(120,76,^("rep")) i $d(^("el0")) s x=$zu(120,81,^("el0")) i $d(^("el1")) s x=$zu(120,82,^("el1")) i $d(^("el2")) s x=$zu(120,83,^("el2")) i $d(^("ed0")) s x=$zu(120,84,^("ed0")) i $d(^("ed1")) s x=$zu(120,85,^("ed1")) i $d(^("ed2")) s x=$zu(120,86,^("ed2")) i $d(^("cs01")) s x=$zu(120,88,^("cs01")) i $d(^("cs02")) s x=$zu(120,89,^("cs02")) i $d(^("cs10")) s x=$zu(120,90,^("cs10")) i $d(^("cs20")) s x=$zu(120,91,^("cs20")) i $d(^("hoff")) s x=$zu(120,92,^("hoff")) i $d(^("roff")) s x=$zu(120,93,^("roff")) i $d(^("uoff")) s x=$zu(120,94,^("uoff")) i $d(^("boff")) s x=$zu(120,95,^("boff")) i $d(^("pon")) s x=$zu(120,96,^("pon")) ; JLC036+ i $d(^("poff")) s x=$zu(120,97,^("poff")) ; JLC036- i $d(^("wopen")) s x=$zu(120,51,^("wopen")) i $d(^("wclose")) s x=$zu(120,52,^("wclose")) i $d(^("wbox")) s x=$zu(120,54,^("wbox")) i $d(^("wlimits")) s x=$zu(120,55,^("wlimits")) i $d(^("wuse")) s x=$zu(120,53,^("wuse")) i $d(^("fill")) s x=$zu(120,57,^("fill")) i $d(^("bormap")) s x=$zu(120,87,^("bormap")) s x=$zu(119,5) ; Send init string q ; error w *7,!,"This system does not support character windows",! zq q ; END n x s x=$zu(119,50,-1),x=$zu(119,6),x=$zu(120,100,0) q ; HVP(c,l) q:'$zu(119,40,$g(l,1),$g(c,1)) q ; CUP(l,c) i $g(l)<1 s l=$y+1 i $g(c)<1 s c=$x+1 i $g(QW),'$p(QW(QW),D,6) h 0 q:'$zu(119,40,$g(l,1),$g(c,1)) q ; CLR q:'$zu(119,0) q ; CUF(n) q:'$zu(119,12,$g(n,1)) q ; CUB(n) q:'$zu(119,13,$g(n,1)) q ; CUU(n) q:'$zu(119,14,$g(n,1)) q ; CUD(n) q:'$zu(119,15,$g(n,1)) q ; BS(n) q:'$zu(119,16,$g(n,1)) q ; CR q:'$zu(119,1) q ; LF(n) q:'$zu(119,17,$g(n,1)) q ; IND(n) q:'$zu(119,10,$g(n,1)) q ; RI(n) s n=$g(n,1) q:'$zu(119,11,n) q ; EOL q:'$zu(119,29,0) q ; EL(s) q:'$zu(119,29,$g(s,0)) q ; EOS q:'$zu(119,30,0) q ; ED(s) q:'$zu(119,30,$g(s,0)) q ; ECH(n) q:'$zu(119,18,$g(n,1)) q ; ICH(n) q:'$zu(119,19,$g(n,1)) q ; IL(n) q:'$zu(119,20,$g(n,1)) q ; DCH(n) q:'$zu(119,21,$g(n,1)) q ; DL(n) q:'$zu(119,22,$g(n,1)) q ; PITCH(n) i '$zbitget($zversion(0),1) q ; JLC143+ q:'$zu(119,33,n*4) q ; ; JLC143- AOFF q:'$zu(119,3) q ; HON q:'$zu(119,24,1) q ; HOFF q:'$zu(119,24,0) q ; RON q:'$zu(119,25,1) q ; ROFF q:'$zu(119,25,0) q ; UON q:'$zu(119,26,1) q ; UOFF q:'$zu(119,26,0) q ; BON q:'$zu(119,27,1) q ; BOFF q:'$zu(119,27,0) q ; CON q:'$zu(119,28,1) q ; COFF q:'$zu(119,28,0) q ; TON q:'$zu(119,31,1) q ; JLC112+ ; TOFF q:'$zu(119,31,0) q ; ; JLC112- PON q:'$zu(119,32,1) q ; JLC036+ ; POFF q:'$zu(119,32,0) q ; ; JLC036- COLOR(fg,bg) q:'$zu(119,41,$g(fg,0),$g(bg,0)) q ; SP(n) q:'$zu(119,23,$g(n,1)) q ; BELL ; BEL q:'$zu(119,2) q ; RAW(s) q:'$zu(119,34,s) q ; SUSPEND q:'$zu(119,35,1) q RESUME q:'$zu(119,35,0) q ; tt ; Ask terminal type r !,"Terminal type: ",tt q:tt="" i tt="?" d g tt . s tt="" f s tt=$o(^%SYS("tercap",tt)) q:tt="" w !,?5,tt i '$d(^%SYS("tercap",tt)) w " " g tt q ; ;vanaf hier Data-M (compatibiliteit met Zwinterm van MSM): erdx s $x=0 q erdy s $y=0 q ; WCMD ; Clear Display d ED(0) i $g(QW),'$p(QW(QW),D,6) h 0 q WCML ; Clear Line d EL(0) i $g(QW),'$p(QW(QW),D,6) h 0 q WBSGR(a) ; Window Border SGR q WCSGR(a,b) ; Window Current SGR d SGR(a,b) q WDSGR(a) ; Window Default SGR d SGR(a) q WTSGR(a) ; Window Title SGR q WGETSW ; Get Current Window q ; lftxxx changed this WT q WT(a,b,c) ; Window Title q WSCROFF ; Disable Automatic Display i $g(QW) s $p(QW(QW),D,6)=1 q WSCRON ; Enable Automatic Display i $g(QW) s $p(QW(QW),D,6)=0 h 0 q WDSP ; Display Window h 0 q WUNDSP ; Undisplay Window q WWR(a) ; Change Wrap Mode s a=+$g(a) i 'a w /TOFF i a w /TON q REP ; Repeat w $c(27,91)_"b" q WMOVE(a,b) ; Move Window q ZXYMODE(a) ; XY Mode q WSC(a) ; Change Scroll mode q CUR(a) ; Cursor q CBT(%1) ; Cursor backward tabulation %1 tab stops s %1=+$g(%1,1) w $c(27,91)_%1_"Z" s $zt="erdx",$x=$x+7\8-%1*8 q CCH ; Cancel character w $c(27)_"T" q CHA(%1) ; Cursor horizontal absolute (move to column %1) s %1=+$g(%1,1) w $c(27,91)_%1_"G" s $zt="erdx",$x=%1-1 q CHT(%1) ; Cursor horizontal tabulation (forward %1 tab stops) s %1=+$g(%1,1) w $c(27,91)_%1_"I" s $zt="erdx",$x=$x\8+%1*8 q CNL(%1) ; Cursor next line (cursor down %1 lines) s %1=+$g(%1,1) w $c(27,91)_%1_"E" s $zt="erdy",$y=$y+%1 q CPL(%1) ; Cursor preceding line (cursor up %1 lines) s %1=+$g(%1,1) w $c(27,91)_%1_"F" s $zt="erdy",$y=$y-%1 q CPR ; Cursor position report (return in $KEY) n %1 w $c(27,91)_"6n" r %1 q CTC(%1,%2,%3,%4,%5,%6,%7,%8,%9) ; Cursor tabulation control n %i,%p s %p="" f %i=1:1:9 i $d(@("%"_%i)) s %p=%p_$e(";",%p'="")_@("%"_%i) w $c(27,91)_%p_"W" q CVT(%1) ; Cursor vertical tabulation w $c(27,91)_+$g(%1,1)_"Y" q DA ; Device attributes - return in $KEY n %1,%2,%3 s %3="" u $i:("":"+S") w $c(27,91)_"c" r %1 s %2=$k f r *%1 s %3=%3_$c(%1) q:%1=99 s $k=%2_%3 u $i:("":"-S") q DAQ(%1,%2,%3,%4,%5,%6,%7,%8,%9) ; Define area qualification n %i,%p s %p="" f %i=1:1:9 i $d(@("%"_%i)) s %p=%p_$e(";",%p'="")_@("%"_i) w $c(27,91)_%p_"o" q DCS ; Device control string w $c(27)_"P" q DMI ; Disable manual input q DSR(%1) ; Device status report - type %1 - return in $KEY n %2 w $c(27,91)_+$g(%1,5)_"n" r %2 q EA(%1) ; Erase in area w $c(27,91)_+$g(%1,1)_"O" q EF(%1) ; Erase in field w $c(27,91)_+$g(%1,1)_"N" q EMI ; Enable manual input q EPA ; End of protected area w $c(27)_"W" q ESA ; End of selected area w $c(27)_"G" q FNT ; Font selection q GSM ; Graphic size modification q GSS ; Graphic size selection q HPA(%1) ; Horizontal position attribute (cursor to column %1) s %1=+$g(%1,1) w $c(27,91)_%1_"`" s $zt="erdx",$x=%1-1 q HPR(%1) ; Horizontal position relative (cursor forward %1 columns) s %1=+$g(%1,1) w $c(27,91)_%1_"a" s $zt="erdx",$x=$x+%1 q HTJ ; Horizontal tab with justify w $c(27)_"I" q HTS ; Horizontal tabulation set w $c(27)_"H" q INT ; Interrupt w $c(27,91)_"a" q JFY ; Justify q MC ; Media copy w $c(27,91)_"i" q MW ; Message waiting w $c(27)_"U" q MSMRGN(%1,%2) ; Scrolling region ; w $c(27,91)_%1_";"_%2_"r" ; 13.06.2001 q NEL ; Next line w $c(27)_"E" s $x=0,$y=$y+1 s:$y>255 $y=255 q NP(%1) ; Next page (advance %1 pages of terminal display memory) w $c(27,91)_+$g(%1,1)_"U" q OSC ; Operating system command w $c(27)_"]" q PLD ; Partial line down w $c(27)_"K" q PLU ; Partial line up w $c(27)_"L" q PM ; Privacy message w $c(27)_"^" q PP(%1) ; Preceding page (backup %1 pages of terminal display memory) w $c(27,91)_+$g(%1,1)_"V" q PU1 ; Private use one w $c(27)_"Q" q PU2 ; Private use two w $c(27)_"R" q QUAD ; QUAD q RIS ; Reset to initial state w $c(27)_"c" s $x=0,$y=0 q RM(%1,%2,%3,%4,%5,%6,%7,%8,%9) ; Reset mode n %i,%p s %p="" f %i=1:1:9 i $d(@("%"_%i)) s %p=%p_$e(";",%p'="")_@("%"_%i) w $c(27,91)_%p_"l" q SEM ; Select editing extent mode w $c(27,91)_"Q" q SGR(%1,%2,%3,%4,%5,%6,%7,%8,%9) ; Select graphic rendition %1 thru %9 S %1=$G(%1) D @$S(%1=1:"HON",%1=4:"UON",%1=5!(%1=6):"BON",%1=7:"RON",%1=22:"HOFF",%1=24:"UOFF",%1=25!(%1=26):"BOFF",%1=27:"ROFF",1:"AOFF") q SL ; Scroll left q SM(%1,%2,%3,%4,%5,%6,%7,%8,%9) ; Set mode n %i,%p s %p="" f %i=1:1:9 i $d(@("%"_%i)) s %p=%p_$e(";",%p'="")_@("%"_%i) w $c(27,91)_%p_"h" q SPA ; Start of protected area w $c(27)_"V" q SPI ; Spacing increment q SR ; Scroll right q SS2 ; Single shift two w $c(27)_"N" q SS3 ; Single shift three w $c(27)_"O" q SSA ; Start of selected area w $c(27)_"F" q ST ; String terminator w $c(27)_"\" q STS ; Set transmit state w $c(27)_"S" q SU ; Scroll up w $c(27,91)_"S" q TBC ; Tabulation clear w $c(27,91)_"g" q TSS ; Thin space specification q VPA(%1) ; Vertical position attribute (move to row %1 at same column) s %1=+$g(%1,1) w $c(27,91)_%1_"d" s $zt="erdy",$y=%1-1 q VPR(%1) ; Vertical position relative (move down %1 lines at same column) s %1=+$g(%1,1) w $c(27,91)_%1_"e" s $zt="erdy",$y=$y+%1 q VTS ; Vertical tabulation sets w $c(27)_"J" q FF ; Formfeed w $c(12) q HT ; Horizontal tab w $c(9) q VT ; Vertical tab w $c(11) q CDR(a,b) ; ?DR mnemonic n i,c s a=$g(a),b=$g(b,1) i a=0 q i a=1 q s c=$p(";140;142;128;130;132;134;134;130;134;132;138;",";",a) f i=1:1:b w $c(c) q ; ZZ ; 17.01.2012 - 15:58 * Cache-r6.4.9