home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-03-01 | 57.0 KB | 2,024 lines |
- {.HEModule - PasVDI- Turbo Pascal GEM binding. Mass. General Hospital }
- {========================================================================}
- { }
- { Module name -> PasVDI Release date -> 8/10/85 Ver -> 01.0 }
- { ---------------------------------------------------------------------- }
-
- {**************************************************************************}
- { }
- { COPYRIGHT (c) 1985 }
- { by the Massachusetts General Hospital, Boston, MA 02114. }
- { }
- { This software is furnished under a license and may be used and copied }
- { only in accordance with the terms of such license and with the }
- { inclusion of the above copyright notice. This software or any other }
- { copies thereof may not be provided or otherwise made available to any }
- { other person. No title to and ownership of the software is hereby }
- { transferred. }
- { }
- { The information in this software is subject to change without notice }
- { and should not be construed as a commitment by the Massachusetts }
- { General Hospital. }
- { }
- { This software is distributed without any express or implied warranties }
- { whatsoever. Because of the diversity of conditions and hardware under }
- { which this program may be used, no warranty of fitness for a parti- }
- { cular purpose is offered. The user is advised to test this program }
- { thoroughly before relying upon it. The user must assume the entire }
- { risk of using the program. }
- { }
- { For more information as to the specific rights granted by this }
- { proviso or to obtain a copy of this software, contact: }
- { }
- { Jaime Taaffe }
- { Dept. of Radiation Radiology }
- { Massachusetts General Hospital }
- { Boston, MA 02114 }
- { }
- { (617) 726-8785 }
- { }
- {**************************************************************************}
-
-
- { Modified by: James Taaffe and JoAnn Yang of MGH from the Pascal MT+ }
- { package of Digital Research Inc. }
- { }
- { Written by: Athol M Foden }
- { }
- { Purpose: Interface to the Digital Research Gem VDI package. }
- { }
- { Calling convention: See Gem Manual }
- { }
- { }
- { Global data accessed:Contrl, Intin, InOut, PtsIn, PtsOut }
- { }
- { Testing considerations: Run program DmoVdi.pas }
- { }
- { ---------------------------------------------------------------------- }
- { AUDIT TRAIL }
- { Rev. Revised By Bug }
- { x.xx xx/xx/xx ????????????? ?????????????????????????????? }
- { x.xx xx/xx/xx ????????????? ?????????????????????????????? }
- { x.xx xx/xx/xx ????????????? ?????????????????????????????? }
- {========================================================================}
- {.PA}
- CONST
-
- cntl_max = 11; { max sizes for arrays - relative 0. }
- intin_max = 131;
- intout_max = 139;
- pts_max = 144; { you may need this larger. }
-
- white = 0; { std colors - not always true. }
- black = 1;
- red = 2;
- green = 3;
- blue = 4;
- cyan = 5;
- yellow = 6;
- magenta = 7;
-
- hollow = 0; { std fill interior styles. }
- solid = 1;
- pattern = 2;
- hatch = 3;
-
- longdash = 2; { line styles, solid as above. }
- dshdot = 4;
-
- maxndc = 32767; { max coord in NDC space. }
-
- normal = 0; { graphic text styles - combinations ok as well }
- bold = 1;
- light = 2;
- skew = 4;
- underline = 8;
- outline = 16;
- shadow = 32;
-
- request = 1; { input modes }
- sample = 2;
-
- replace = 1; { write modes }
- transparent = 2;
- GemXor = 3;
- erase = 4;
-
- {.PA}
- TYPE
-
- {* All arrays relative to zero here *}
-
- contrl_ARRAY = ARRAY [0..cntl_max] OF INTEGER;
- intin_ARRAY = ARRAY [0..intin_max] OF INTEGER;
- intout_ARRAY = ARRAY [0..intout_max] OF INTEGER;
- ptsin_ARRAY = ARRAY [0..pts_max] OF INTEGER;
- ptsout_ARRAY = ARRAY [0..pts_max] OF INTEGER;
-
-
- STRING80 = String[80];
- { type defns for gemtools }
- LongInt = Array[0..3] of byte;
- gptr = ^LONGINT; { general 32 bit pointer }
- gempoint = RECORD { ptr redefined so each part avail }
- CASE BOOLEAN OF
- TRUE : (gp : gptr);
- FALSE : (hi : INTEGER;
- lo : INTEGER);
- END;
-
- ARRAY_57 = ARRAY [0..56] OF INTEGER; { std arrray sizes }
- ARRAY_3 = ARRAY [0..2] OF INTEGER;
- ARRAY_4 = ARRAY [0..3] OF INTEGER;
- ARRAY_8 = ARRAY [0..7] OF INTEGER;
- ARRAY_10 = ARRAY [0..9] OF INTEGER;
- ARRAY_16 = ARRAY [0..15] OF INTEGER;
- ARRAY_37 = ARRAY [0..36] OF INTEGER;
-
- MFDB =
- record { MFDB layout }
- mptr : gempoint; { 32 bit pointer }
- formwidth : INTEGER;
- formheight : INTEGER;
- widthword : INTEGER;
- formatflag : INTEGER;
- memplanes : INTEGER;
- res1 : INTEGER; { reserved for futures }
- res2 : INTEGER;
- res3 : INTEGER;
- END;
-
-
- VAR { global gem vdi arrays }
- contrl : contrl_ARRAY; { global arrays reqd by gemvdi }
- intin : intin_ARRAY;
- intout : intout_ARRAY;
- ptsin : ptsin_ARRAY;
- ptsout : ptsout_ARRAY;
-
- {.pa}
- {========================================================================}
- { }
- { Procedure name -> GVDI }
- { Release date -> ../../.. Ver -> xx.x }
- { ---------------------------------------------------------------------- }
- { Written by: JoAnn Yang. Checked by: }
- { }
- { Purpose: Performs the interface between Gem and Turbo Pascal-3. }
- { In particular, it invokes the GEM VDI sub system via a }
- { software interupt. }
- { }
- { Calling convention: Load_PB_and_Call_GEM( Contrl, intin, intout }
- { ptsin, ptsout ) }
- { }
- { Input data: contrl, intin, and ptsin : arrays of integers. }
- { }
- { Output data:intout and ptsout : arrays of integer. }
- { }
- { Global data accessed: NONE except that in GEM VDI. }
- { }
- { Other procedures used: NONE except for the GEM package. }
- { }
- { Testing considerations: GEM VDI must be loaded into memory. }
- { }
- { Revisions: }
- { }
- {========================================================================}
-
- { This procedure loads the contents of the parameter block }
-
- procedure GVDI(var contrl: Contrl_Array;
- var intin : Intin_Array;
- var intout: Intout_Array;
- var ptsin : Ptsin_Array;
- var ptsout: Ptsout_Array );
-
- const
- vdi = $ef; { interrupt number for GEM VDI. }
- vdi_const = $0473; { GEM VDI function number }
-
-
- type
- i8088_RegsType = record { i8088 processors registers. }
- ax,bx,cx,dx,bp,si,di,ds,es,flags: integer;
- end;
-
- GemPB_Type = array[1..10] of integer;
-
- Var
- i8088_Regs: i8088_RegsType; { i8088 processor registers. }
- pb : GemPB_Type; { Parameter block points to arrays. }
-
- begin { Load_PB_and_Call_GEM }
-
- { Let array pb contain the address of all the GEM arrays. }
- pb[1] := ofs(contrl);
- pb[2] := seg(contrl);
- pb[3] := ofs(intin);
- pb[4] := seg(intin);
- pb[5] := ofs(ptsin);
- pb[6] := seg(ptsin);
- pb[7] := ofs(intout);
- pb[8] := seg(intout);
- pb[9] := ofs(ptsout);
- pb[10] := seg(ptsout);
-
- { Now let the i8088 registers point to the parameter block. }
- i8088_Regs.cx := vdi_const; { Load GEM VDI function number into cx.}
- i8088_Regs.dx := ofs(pb); { Load the address of the parameter }
- i8088_Regs.ds := seg(pb); { block into dx and ds. }
-
- { Let GEM handlet the request. }
- intr(vdi, i8088_Regs); { Call interrupt procedure. }
-
- end; { GVDI }
- {.PA}
-
- FUNCTION gemvdif(opcode, handle : INTEGER) : INTEGER;
-
- BEGIN
- contrl[0]:=opcode;
- contrl[6]:=handle;
- GVDI(contrl, intin, intout, ptsin, ptsout);
- gemvdif:=intout[0];
- END;
-
- {.PA}
- {******************************************************************}
- {** CONTROL FUNCTIONS **}
- {******************************************************************}
- {* open workstation *}
-
- FUNCTION v_opnwk (workin : intin_ARRAY;
- VAR handle : INTEGER;
- VAR workout : ARRAY_57 ) : INTEGER;
- VAR
- i : INTEGER;
-
- BEGIN
- FOR i:=0 TO intin_max DO intin[i]:=workin[i];
- contrl[1]:=0;
- contrl[3]:=11;
- v_opnwk:=gemvdif(1,handle); { opcode = 1 }
- handle:=contrl[6];
- FOR i:=0 TO 44 DO workout[i]:=intout[i];
- FOR i:=0 TO 11 DO workout[i + 44]:=ptsout[i];
- END;
-
- {**************************************************************}
- {* close workstation *}
-
- FUNCTION v_clswk (handle : INTEGER) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- v_clswk:=gemvdif(2,handle);
- END;
-
- {***************************************************************}
- {* open virtual workstation *}
-
- FUNCTION v_opnvwk (workin : intin_ARRAY;
- VAR handle : INTEGER;
- VAR workout : ARRAY_57 ) : INTEGER;
- VAR
- i : INTEGER;
-
- BEGIN
- contrl[1]:=0; { no of input vertices }
- contrl[3]:=11; { length of intin }
- FOR i:=0 TO intin_max DO intin[i]:=workin[i];
- v_opnvwk:=gemvdif(100,handle); { handle from previously opened screen device }
- handle:=contrl[6];
- FOR i:=0 TO 44 DO workout[i]:=intout[i];
- FOR i:=0 TO 11 DO workout[i + 44]:=ptsout[i];
- END;
-
- {**************************************************************}
- {* close virtual workstation *}
-
- FUNCTION v_clsvwk (handle : INTEGER) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- v_clsvwk:=gemvdif(101,handle);
- END;
-
- {***************************************************************}
- {* clear workstation *}
-
- FUNCTION v_clrwk (handle : INTEGER) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- v_clrwk:=gemvdif(3,handle);
- END;
-
- {****************************************************************}
- {* update workstation *}
-
- FUNCTION v_updwk ( handle : INTEGER) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- v_updwk:=gemvdif(4,handle);
- END;
-
- {************************************************************************}
- {* Load extra fonts into memory - caller must free up some memory space *}
-
- FUNCTION vst_load_fonts(handle : INTEGER;
- select : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=1;
- intin[0]:=select;
- vst_load_fonts:=gemvdif(119,handle);
- END;
-
- {******************************************************************}
- {* Unload those extra fonts *}
-
- FUNCTION vst_unload_fonts(handle : INTEGER;
- select : INTEGER) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=1;
- intin[0]:=select;
- vst_unload_fonts:=gemvdif(120,handle);
- END;
-
- {************************************************************************}
- {* set clipping rectangle *}
-
- FUNCTION vs_clip (handle : INTEGER;
- clipflag : INTEGER;
- pxyarray : ARRAY_4) : INTEGER;
- VAR
- i: INTEGER;
-
- BEGIN
- contrl[1]:=2;
- contrl[3]:=1;
- intin[0]:=clipflag;
- FOR i:=0 TO 3 DO ptsin[i]:=pxyarray[i];
- vs_clip:=gemvdif(129,handle);
- END;
-
- {**********************}
- {* OUTPUT FUNCTIONS *}
- {*************************************************************}
- {* polyline *}
-
- FUNCTION v_pline (handle : INTEGER;
- count : INTEGER;
- pxyarray : ptsin_ARRAY) : INTEGER;
- VAR
- i, n : INTEGER;
-
- BEGIN
- contrl[1]:=count; { number of vertices to follow }
- contrl[3]:=0;
- n:=count * 2 - 1; { twice as many numbers as there are coords }
- FOR i:=0 TO n DO ptsin[i]:=pxyarray[i];
- v_pline:=gemvdif(6,handle);
- END;
-
- {**************************************************************}
- {* polymarker *}
-
- FUNCTION v_pmarker (handle : INTEGER;
- count : INTEGER;
- pxyarray : ptsin_ARRAY) : INTEGER;
- VAR
- i,n : INTEGER;
-
- BEGIN
- contrl[1]:=count; { number of markers }
- contrl[3]:=0;
- n:=count * 2 - 1;
- FOR i:=0 TO n DO ptsin[i]:=pxyarray[i];
- v_pmarker:=gemvdif(7,handle);
- END;
-
- {************************************************************}
- {* text *}
-
- FUNCTION v_gtext (handle : INTEGER;
- x,y : INTEGER;
- chstring : STRING80) : INTEGER;
- VAR
- i : INTEGER;
-
- BEGIN
- contrl[1]:=1;
- contrl[3]:=LENGTH(chstring);
- ptsin[0]:=x;
- ptsin[1]:=y;
- FOR i:=1 TO LENGTH(chstring) DO intin[i- 1]:=ORD(chstring[i]);
- v_gtext:=gemvdif(8,handle);
- END;
-
- {*************************************************************}
- {* filled area *}
-
- FUNCTION v_fillarea(handle : INTEGER;
- count : INTEGER;
- pxyarray : ptsin_ARRAY) : INTEGER;
- VAR
- i,n : INTEGER;
-
- BEGIN
- contrl[1]:=count;
- contrl[3]:=0;
- n:=count * 2 - 1;
- FOR i:=0 TO n DO ptsin[i]:=pxyarray[i];
- v_fillarea:=gemvdif(9,handle);
- END;
-
- {************************************************************}
- {* cell array *}
-
- FUNCTION v_cellarray (handle : INTEGER;
- pxyarray : ARRAY_4;
- rowlength : INTEGER;
- elused : INTEGER;
- numrows : INTEGER;
- wrtmode : INTEGER;
- colorlen : INTEGER;
- colarray : intin_ARRAY) : INTEGER;
- VAR
- i,j : INTEGER;
-
- BEGIN
- contrl[1]:=2;
- contrl[3]:=colorlen;
- contrl[7]:=rowlength;
- contrl[8]:=elused;
- contrl[9]:=numrows;
- contrl[10]:=wrtmode;
- FOR i:=0 TO 3 DO ptsin[i]:=pxyarray[i];
- j:=colorlen - 1 ;
- FOR i:=0 TO j DO intin[i]:=colarray[i];
- v_cellarray:=gemvdif(10,handle);
- END;
-
- {*************************************************************}
- {* contour fill *}
-
- FUNCTION v_contour (handle, x, y, index : INTEGER) : INTEGER;
-
- BEGIN
- contrl[1]:=1;
- contrl[3]:=1;
- ptsin[0]:=x;
- ptsin[1]:=y;
- intin[0]:=index;
- v_contour:=gemvdif(103,handle);
- END;
-
- {*********************************************************}
- {* fill rectangle *}
-
- FUNCTION vr_recfl(handle : INTEGER;
- pxyarray : ARRAY_4) : INTEGER;
- VAR
- i : INTEGER;
-
- BEGIN
- contrl[1]:=2;
- contrl[3]:=0;
- FOR i:=0 TO 3 DO ptsin[i]:=pxyarray[i];
- vr_recfl:=gemvdif(114,handle);
- END;
-
- {***************}
- {* GDP 's *}
- {**************************************************************}
- {* gdp - bar *}
-
- FUNCTION v_bar (handle : INTEGER;
- pxyarray : ARRAY_4 ) : INTEGER;
- VAR
- i : INTEGER;
-
- BEGIN
- contrl[1]:=2;
- contrl[3]:=0;
- contrl[5]:=1;
- FOR i:=0 TO 3 DO ptsin[i]:=pxyarray[i];
- v_bar:=gemvdif(11,handle);
- END;
-
- {**************************************************************}
- {* GDP - arc *}
-
- FUNCTION v_arc (handle : INTEGER;
- x : INTEGER;
- y : INTEGER;
- radius : INTEGER;
- begang : INTEGER;
- endang : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=4;
- contrl[3]:=2;
- contrl[5]:=3;
- intin[0]:=begang;
- intin[1]:=endang;
- ptsin[0]:=x;
- ptsin[1]:=y;
- ptsin[6]:=radius;
- v_arc:=gemvdif(11,handle);
- END;
-
- {******************************************************************}
- {* GDP - pieslice *}
-
- FUNCTION v_pieslice (handle : INTEGER;
- x : INTEGER;
- y : INTEGER;
- radius : INTEGER;
- begang : INTEGER;
- endang : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=4;
- contrl[3]:=2;
- contrl[5]:=3;
- intin[0]:=begang;
- intin[1]:=endang;
- ptsin[0]:=x;
- ptsin[1]:=y;
- ptsin[6]:=radius;
- v_pieslice:=gemvdif(11,handle);
- END;
-
- {********************************************************************}
- {* GDP - circle *}
-
- FUNCTION v_circle (handle : INTEGER;
- x : INTEGER;
- y : INTEGER;
- radius : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=3;
- contrl[3]:=0;
- contrl[5]:=4;
- contrl[6]:=handle;
- ptsin[0]:=x;
- ptsin[1]:=y;
- ptsin[4]:=radius;
- v_circle:=gemvdif(11,handle);
- END;
-
- {******************************************************************}
- {* GDP - elliptical arc *}
-
- FUNCTION v_ellarc (handle : INTEGER;
- x : INTEGER;
- y : INTEGER;
- xradius : INTEGER;
- yradius : INTEGER;
- begang : INTEGER;
- endang : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=2;
- contrl[3]:=2;
- contrl[5]:=6;
- intin[0]:=begang;
- intin[1]:=endang;
- ptsin[0]:=x;
- ptsin[1]:=y;
- ptsin[2]:=xradius;
- ptsin[3]:=yradius;
- v_ellarc:=gemvdif(11,handle);
- END;
-
- {***************************************************************}
- {* GDP - elliptical pie *}
-
- FUNCTION v_ellpie (handle : INTEGER;
- x : INTEGER;
- y : INTEGER;
- xradius : INTEGER;
- yradius : INTEGER;
- begang : INTEGER;
- endang : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=2;
- contrl[3]:=2;
- contrl[5]:=7;
- intin[0]:=begang;
- intin[1]:=endang;
- ptsin[0]:=x;
- ptsin[1]:=y;
- ptsin[2]:=xradius;
- ptsin[3]:=yradius;
- v_ellpie:=gemvdif(11,handle);
- END;
-
- {***************************************************************}
- {* GDP - Ellipse *}
-
- FUNCTION v_ellipse (handle : INTEGER;
- x : INTEGER;
- y : INTEGER;
- xradius : INTEGER;
- yradius : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=2;
- contrl[3]:=0;
- contrl[5]:=5;
- ptsin[0]:=x;
- ptsin[1]:=y;
- ptsin[2]:=xradius;
- ptsin[3]:=yradius;
- v_ellipse:=gemvdif(11,handle);
- END;
-
- {**************************************************************}
- {* GDP rounded rectangle *}
-
- FUNCTION v_rbox (handle : INTEGER;
- xyarray : ARRAY_4 ) : INTEGER;
- VAR
- i : INTEGER;
-
- BEGIN
- contrl[1]:=2;
- contrl[3]:=0;
- contrl[5]:=8;
- FOR i:=0 TO 3 DO ptsin[i]:=xyarray[i];
- v_rbox:=gemvdif(11,handle);
- END;
-
- {**************************************************************}
- {* GDP Filled rounded rectangle *}
-
- FUNCTION v_rfbox (handle : INTEGER;
- xyarray : ARRAY_4 ) : INTEGER;
- VAR
- i : INTEGER;
-
- BEGIN
- contrl[1]:=2;
- contrl[3]:=0;
- contrl[5]:=9;
- FOR i:=0 TO 3 DO ptsin[i]:=xyarray[i];
- v_rfbox:=gemvdif(11,handle);
- END;
-
- {************************************************************}
- {* Justified graphics text *}
-
- FUNCTION v_justified(handle : INTEGER;
- x : INTEGER;
- y : INTEGER;
- jlength : INTEGER;
- gstring : STRING80;
- wordspace : INTEGER;
- charspace : INTEGER ) : INTEGER;
- VAR
- i: INTEGER;
-
- BEGIN
- contrl[1]:=2;
- contrl[3]:=LENGTH(gstring) + 2;
- FOR i:=1 TO LENGTH(gstring) DO intin[i+1]:=ORD(gstring[i]);
- intin[0]:=wordspace;
- intin[1]:=charspace;
- ptsin[0]:=x;
- ptsin[1]:=y;
- ptsin[2]:=jlength;
- v_justified:=gemvdif(10,handle);
- END;
-
- {*****************************}
- {** SET ATTRIBUTE FUNCTIONS **}
- {********************************************************}
- {* general set routine, called by many procedures below *}
-
- FUNCTION genset(opcode : INTEGER;
- handle : INTEGER;
- param : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=1;
- intin[0]:=param;
- genset:=gemvdif(opcode,handle); { return value suggested }
- END;
-
- {*************************************************************}
- {* set writing mode *}
-
- FUNCTION vswr_mode (handle, mode : INTEGER) : INTEGER;
-
- BEGIN
- vswr_mode:=genset(32,handle,mode);
- END;
-
- {************************************************************}
- {* set color representation *}
-
- FUNCTION vs_color (handle : INTEGER;
- index : INTEGER;
- rgbin : ARRAY_3 ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=4;
- intin[0]:=index;
- intin[1]:=rgbin[0];
- intin[2]:=rgbin[1];
- intin[3]:=rgbin[2];
- vs_color:=gemvdif(14,handle);
- END;
-
-
- {*********************************************************}
- {* set polyline line type *}
-
- FUNCTION vsl_type ( handle : INTEGER;
- style : INTEGER ) : INTEGER;
-
- BEGIN
- vsl_type:=genset(15,handle,style);
- END;
-
- {*********************************************************}
- {* set user defined line style pattern *}
-
- FUNCTION vsl_udsty (handle : INTEGER;
- pattern : INTEGER ) : INTEGER;
-
- BEGIN
- vsl_udsty:=genset(113,handle,pattern);
- END;
-
- {********************************************************}
- {* set polyline linewidth *}
-
- FUNCTION vsl_width (handle : INTEGER;
- width : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=1;
- contrl[3]:=0;
- ptsin[0]:=width;
- ptsin[1]:=0;
- vsl_width:=gemvdif(16,handle);
- vsl_width:=ptsout[0];
- END;
-
- {*********************************************************}
- {* set polyline color index *}
-
- FUNCTION vsl_color (handle : INTEGER;
- colindex : INTEGER ) : INTEGER;
-
- BEGIN
- vsl_color:=genset(17,handle,colindex);
- END;
-
- {***********************************************************}
- {* set polyline end style *}
-
- FUNCTION vsl_end_s (handle : INTEGER;
- begstyle : INTEGER;
- endstyle : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=2;
- intin[0]:=begstyle;
- intin[1]:=endstyle;
- vsl_end_s:=gemvdif(108,handle);
- END;
-
- {************************************************************}
- {* set polymarker type *}
-
- FUNCTION vsm_type (handle : INTEGER;
- symbol : INTEGER ) : INTEGER;
-
- BEGIN
- vsm_type:=genset(18,handle,symbol);
- END;
-
- {*************************************************************}
- {* set polymarker height *}
-
- FUNCTION vsm_height (handle : INTEGER;
- height : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[0]:=19;
- contrl[1]:=1;
- contrl[3]:=0;
- contrl[6]:=handle;
- ptsin[0]:=0;
- ptsin[1]:=height;
- vsm_height:=gemvdif(19,handle);
- vsm_height:=ptsout[1];
- END;
-
- {***********************************************************}
- {* set polymarker color index *}
-
- FUNCTION vsm_color (handle : INTEGER;
- colindex : INTEGER ) : INTEGER;
-
- BEGIN
- vsm_color:=genset(20,handle,colindex);
- END;
-
- {*************************************************************}
- {* set character height, absolute mode *}
-
- FUNCTION vst_height (handle : INTEGER;
- height : INTEGER;
- VAR charwidth : INTEGER;
- VAR charheight : INTEGER;
- VAR cellwidth : INTEGER;
- VAR cellheight : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=1;
- contrl[3]:=0;
- ptsin[0]:=0;
- ptsin[1]:=height;
- vst_height:=gemvdif(12,handle);
- charwidth:=ptsout[0];
- charheight:=ptsout[1];
- cellwidth:=ptsout[2];
- cellheight:=ptsout[3];
- END;
-
- {********************************************************************}
- {* set character cell height, points mode *}
-
- FUNCTION vst_point (handle : INTEGER;
- point : INTEGER;
- VAR charwidth : INTEGER;
- VAR charheight : INTEGER;
- VAR cellwidth : INTEGER;
- VAR cellheight : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=1;
- intin[0]:=point;
- vst_point:=gemvdif(107,handle);
- charwidth:=ptsout[0];
- charheight:=ptsout[1];
- cellwidth:=ptsout[2];
- cellheight:=ptsout[3];
- END;
-
- {*******************************************************************}
- {* set text character baseline vector - rotation *}
-
- FUNCTION vst_rotation (handle : INTEGER;
- angle : INTEGER) : INTEGER;
-
- BEGIN
- vst_rotation:=genset(13,handle,angle);
- END;
-
- {****************************************************************}
- {* set text font *}
-
- FUNCTION vst_font (handle : INTEGER;
- font : INTEGER) : INTEGER;
-
- BEGIN
- vst_font:=genset(21,handle,font);
- END;
-
- {****************************************************************}
- {* set text color *}
-
- FUNCTION vst_color (handle : INTEGER;
- colindex : INTEGER) : INTEGER;
-
- BEGIN
- vst_color:=genset(22,handle,colindex);
- END;
-
- {***************************************************************}
- {* set text special effects *}
-
- FUNCTION vst_effects (handle : INTEGER;
- effects : INTEGER) : INTEGER;
-
- BEGIN
- vst_effects:=genset(106,handle,effects);
- END;
-
- {**************************************************************}
- {* set graphics text alignment *}
-
- FUNCTION vst_alignment (handle : INTEGER;
- horin : INTEGER;
- vertin : INTEGER;
- VAR horout : INTEGER;
- VAR vertout : INTEGER) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=2;
- intin[0]:=horin;
- intin[1]:=vertin;
- vst_alignment:=gemvdif(39,handle);
- horout:=intout[0];
- vertout:=intout[1];
- END;
-
-
- {***************************************************************}
- {* set fill interior style *}
-
- FUNCTION vsf_interior (handle : INTEGER;
- style : INTEGER) : INTEGER;
-
- BEGIN
- vsf_interior:=genset(23,handle,style);
- END;
-
- {**************************************************************}
- {* set fill style index *}
-
- FUNCTION vsf_style (handle : INTEGER;
- styleindex : INTEGER) : INTEGER;
-
- BEGIN
- vsf_style:=genset(24,handle,styleindex);
- END;
-
- {*************************************************************}
- {* set fill color index *}
-
- FUNCTION vsf_color ( handle : INTEGER;
- colorindex : INTEGER) : INTEGER;
-
- BEGIN
- vsf_color:=genset(25,handle,colorindex);
- END;
-
- {**************************************************************}
- {* set fill perimeter visibility *}
-
- FUNCTION vsf_perimeter (handle : INTEGER;
- pervis : INTEGER) : INTEGER;
-
- BEGIN
- vsf_perimeter:=genset(104,handle,pervis);
- END;
-
- {******************************************************************}
- {* Exchange fill pattern *}
-
- FUNCTION vsf_udpat (handle : INTEGER;
- pfillpat : gempoint;
- poldfpat : gempoint) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- contrl[7]:=pfillpat.hi;
- contrl[8]:=pfillpat.lo;
- contrl[9]:=poldfpat.hi;
- contrl[10]:=poldfpat.lo;
- vsf_udpat:=gemvdif(112,handle);
- END;
-
-
- {*********************}
- {**** RASTOR OPS *****}
- {**************************************************************}
- {* Copy rastor , Opaque *}
-
- FUNCTION vro_cpyfm (handle : INTEGER;
- wrmode : INTEGER;
- pxyarray : ARRAY_8;
- psrcMFDB : MFDB;
- pdesMFDB : MFDB) : INTEGER;
- VAR
- i : INTEGER;
- gtemp1, gtemp2 : gempoint;
- sm, dm : MFDB;
-
- BEGIN
- contrl[1]:=4;
- contrl[3]:=1;
- sm:=psrcMFDB; { ensure MFDB is local to get right segment address }
- gtemp1.gp:=ADDR(sm); { long address }
- contrl[7]:=gtemp1.hi; { offset of MFDB }
- contrl[8]:=gtemp1.lo; { segemnt of MFDB }
- dm:=pdesMFDB;
- gtemp2.gp:=ADDR(dm);
- contrl[9]:=gtemp2.hi;
- contrl[10]:=gtemp2.lo;
- intin[0]:=wrmode; { logic operation write mode }
- FOR i:=0 TO 7 DO ptsin[i]:=pxyarray[i];
- vro_cpyfm:=gemvdif(109,handle);
- END;
-
- {**************************************************************}
- {* Copy rastor , Transparent *}
-
- FUNCTION vrt_cpyfm (handle : INTEGER;
- wrmode : INTEGER;
- pxyarray : ARRAY_8;
- psrcMFDB : MFDB;
- pdesMFDB : MFDB;
- color1 : INTEGER;
- color0 : INTEGER ) : INTEGER;
- VAR i : INTEGER;
- gemp1, gemp2 : gempoint;
- sm, dm : MFDB;
-
- BEGIN
- contrl[1]:=4;
- contrl[3]:=3;
- sm:=psrcMFDB; { local MFDB }
- gemp1.gp:=ADDR(sm);
- contrl[7]:=gemp1.hi; { hi order word of address ptr }
- contrl[8]:=gemp1.lo; { lo order word }
- dm:=pdesMFDB;
- gemp2.gp:=ADDR(dm);
- contrl[9]:=gemp2.hi;
- contrl[10]:=gemp2.lo;
- intin[0]:=wrmode; { logic operation write mode }
- intin[1]:=color1;
- intin[2]:=color0;
- FOR i:=0 TO 7 DO ptsin[i]:=pxyarray[i];
- vrt_cpyfm:=gemvdif(121,handle);
- END;
-
- {***********************************************************}
- {* Transform Form *}
-
- FUNCTION vr_trn_fm (handle : INTEGER;
- psrcMFDB : MFDB;
- pdesMFDB : MFDB ) : INTEGER;
- VAR
- gemp1, gemp2 : gempoint;
- sm, dm : MFDB;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- sm:=psrcMFDB;
- gemp1.gp:=ADDR(sm);
- contrl[7]:=gemp1.hi;
- contrl[8]:=gemp1.lo;
- dm:=pdesMFDB;
- gemp2.gp:=ADDR(dm);
- contrl[9]:=gemp2.hi;
- contrl[10]:=gemp2.lo;
- vr_trn_fm:=gemvdif(110,handle);
- END;
-
- {***********************}
- {*** INPUT FUNCTIONS ***}
- {*******************************************************************}
- {* Set Input Mode *}
-
- FUNCTION vsin_mode (handle : INTEGER;
- devtype : INTEGER;
- mode : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=2;
- intin[0]:=devtype;
- intin[1]:=mode;
- vsin_mode:=gemvdif(33,handle);
- vsin_mode:=intout[0];
- END;
-
- {**********************************************************************}
- {* Input locator, request mode *}
- {********************************}
-
- FUNCTION vrq_locator (handle : INTEGER;
- x : INTEGER;
- y : INTEGER;
- VAR xout : INTEGER;
- VAR yout : INTEGER;
- VAR term : CHAR ) : INTEGER;
-
- BEGIN
- contrl[1]:=1;
- contrl[3]:=0;
- ptsin[0]:=x;
- ptsin[1]:=y;
- vrq_locator:=gemvdif(28,handle);
- xout:=ptsout[0];
- yout:=ptsout[1];
- term:=CHR(intout[0]); { return single byte character }
- END;
-
- {****************************************************************}
- {* Input Locator , Sample mode *}
-
- FUNCTION vsm_locator (handle : INTEGER;
- x : INTEGER;
- y : INTEGER;
- VAR xout : INTEGER;
- VAR yout : INTEGER;
- VAR term : INTEGER;
- VAR coorchg : INTEGER;
- VAR keypress : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=1;
- contrl[3]:=0;
- ptsin[0]:=x;
- ptsin[1]:=y;
- vsm_locator:=gemvdif(28,handle);
- xout:=ptsout[0];
- yout:=ptsout[1];
- term:=intout[0];
- coorchg:=contrl[2];
- keypress:=contrl[4];
- END;
-
- {******************************************************************}
- {* Input Valuator, Request Mode *}
-
- FUNCTION vrq_valuator (handle : INTEGER;
- valin : INTEGER;
- VAR valout : INTEGER;
- VAR term : CHAR ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=1;
- intin[0]:=valin;
- vrq_valuator:=gemvdif(29,handle);
- valout:=intout[0];
- term:=CHR(intout[1]);
- END;
-
- {*****************************************************************}
- {* Input Valuator, Sample Mode *} { check this !!!}
-
- FUNCTION vsm_valuator (handle : INTEGER;
- valin : INTEGER;
- VAR valout : INTEGER;
- VAR term : CHAR;
- VAR status : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=1;
- intin[0]:=valin;
- vsm_valuator:=gemvdif(29,handle);
- valout:=intout[0];
- status:=contrl[4];
- term:=CHR(intout[1]);
- END;
-
- {***************************************************************}
- {* Input Choice, request Mode *}
-
- FUNCTION vrq_choice (handle : INTEGER;
- VAR choice : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=1;
- intin[0]:=choice;
- vrq_choice:=gemvdif(30,handle);
- choice:=intout[0];
- END;
-
- {*****************************************************************}
- {* Input Choice, Sample Mode *}
-
- FUNCTION vsm_choice (handle : INTEGER;
- VAR choice : INTEGER;
- VAR status : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- vsm_choice:=gemvdif(30,handle);
- choice:=intout[0];
- status:=contrl[4];
- END;
-
- {****************************************************************}
- {* Input String, Request Mode *}
-
- FUNCTION vrq_string (handle : INTEGER;
- maxlen : INTEGER;
- echomode : INTEGER;
- echox : INTEGER;
- echoy : INTEGER;
- VAR instring : STRING80 ) : INTEGER;
- VAR
- i : INTEGER;
-
- BEGIN
- contrl[1]:=1;
- contrl[3]:=2;
- intin[0]:=0-maxlen; { force standard keyboard input }
- intin[1]:=echomode;
- ptsin[0]:=echox;
- ptsin[1]:=echoy;
- vrq_string:=gemvdif(31,handle);
- instring:=''; { null string }
- FOR i:=1 TO contrl[4] DO instring:=CONCAT(instring,CHR(intout[i-1]));
- { into string char form }
- END;
-
- {**************************************************************}
- {* Input String, Sample Mode *}
-
- FUNCTION vsm_string (handle : INTEGER;
- maxlen : INTEGER;
- echomode : INTEGER;
- echox : INTEGER;
- echoy : INTEGER;
- VAR instring : STRING80;
- VAR status : INTEGER) : INTEGER;
- VAR
- I : INTEGER;
-
- BEGIN
- contrl[1]:=1;
- contrl[3]:=2;
- intin[0]:=0-maxlen; { force standard keyboard input }
- intin[1]:=echomode;
- ptsin[0]:=echox;
- ptsin[1]:=echoy;
- vsm_string:=gemvdif(31,handle);
- instring:=''; { null string }
- FOR i:=1 TO contrl[4] DO instring:=CONCAT(instring,CHR(intout[i-1]));
- { into string char form }
- status:=contrl[4];
- END;
-
- {*****************************************************************}
- {* Set Moose Form *}
-
- FUNCTION vsc_form (handle : INTEGER;
- pcurform : ARRAY_37 ) : INTEGER;
- VAR
- i : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=37;
- FOR i:=0 TO 36 DO intin[i]:=pcurform[i];
- vsc_form:=gemvdif(111,handle);
- END;
-
-
- {******************************************************************}
- {* Exchange Mouse Movement Vector *}
-
- FUNCTION vex_motv (handle : INTEGER;
- pusrcode : gempoint;
- VAR psavcode : gempoint ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- contrl[7]:=pusrcode.hi; { check this !!}
- contrl[8]:=pusrcode.lo;
- vex_motv:=gemvdif(126,handle);
- psavcode.hi:=contrl[9];
- psavcode.lo:=contrl[10];
- END;
-
- {****************************************************************}
- {** show graphic cursor ***}
-
- FUNCTION v_show_c (handle : INTEGER;
- reset : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=1;
- intin[0]:=reset;
- v_show_c:=gemvdif(122,handle);
- END;
-
- {*****************************************************}
- {* hide graphic cursor *}
-
- FUNCTION v_hide_c (handle : INTEGER) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- v_hide_c:=gemvdif(123,handle);
- END;
-
- {******************************************************************}
- {* Exchange Button Change Vector *}
-
- FUNCTION vex_butv (handle : INTEGER;
- pusrcode : gempoint;
- VAR psavcode : gempoint ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- contrl[7]:=pusrcode.hi; { CHECK THIS }
- contrl[8]:=pusrcode.lo;
- vex_butv:=gemvdif(125,handle);
- psavcode.hi:=contrl[8];
- psavcode.lo:=contrl[9];
- END;
-
- {********************************************************************}
- {* Exchange Cursor Change Vector *}
-
- FUNCTION vex_curv (handle : INTEGER;
- pusrcode : gempoint;
- VAR psavcode : gempoint ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- contrl[7]:=pusrcode.hi; { CHECK THIS }
- contrl[8]:=pusrcode.lo;
- vex_curv:=gemvdif(127,handle);
- psavcode.hi:=contrl[8];
- psavcode.lo:=contrl[9];
- END;
-
- {*********************************************************************}
- {* Sample Keyboard State Information *}
-
- FUNCTION vq_key_s (handle : INTEGER;
- VAR pstatus : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- vq_key_s:=gemvdif(128,handle);
- pstatus:=intout[0];
- END;
-
- {******************************************************************}
- {* Sample Mouse Button State *}
-
- FUNCTION vq_mouse (handle : INTEGER;
- VAR pstatus : INTEGER;
- VAR x : INTEGER;
- VAR y : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- vq_mouse:=gemvdif(124,handle);
- pstatus:=intout[0];
- x:=ptsout[0];
- y:=ptsout[1];
- END;
-
- {******************************************************************}
- {* Exchange Timer Interrupt Vector *}
-
- FUNCTION vex_timv (handle : INTEGER;
- timaddr : gempoint;
- VAR otimaddr : gempoint;
- VAR timconv : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- contrl[7]:=timaddr.hi; { CHECK THIS }
- contrl[8]:=timaddr.lo;
- vex_timv:=gemvdif(118,handle);
- otimaddr.hi:=contrl[9];
- otimaddr.lo:=contrl[10];
- timconv:=intout[0];
- END;
-
- {*******************************************************************}
-
-
- {*** INQUIRE FUNCTIONS ******}
- {********************************************************************}
- {* Extended Inquire Function *}
-
- FUNCTION vq_extend (handle : INTEGER;
- owflag : INTEGER;
- VAR workout : ARRAY_57 ) : INTEGER;
- VAR
- i: INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=1;
- intin[0]:=owflag;
- vq_extend:=gemvdif(102,handle);
- FOR i:=0 TO 44 DO workout[i]:=intout[i];
- FOR i:=45 TO 56 DO workout[i]:=ptsout[i-45];
- END;
-
- {*******************************************************************}
- {* Inquire color representation *}
-
- FUNCTION vq_color (handle : INTEGER;
- colorindex : INTEGER;
- setflag : INTEGER;
- VAR rgb : ARRAY_3 ) : INTEGER;
- VAR
- i : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=2;
- intin[0]:=colorindex;
- intin[1]:=setflag;
- vq_color:=gemvdif(26,handle);
- FOR i:=0 TO 2 DO rgb[i]:=intout[i];
- END;
-
- {******************************************************}
- {* Inquire polyline attributes }
-
- FUNCTION vql_attributes (handle : INTEGER;
- VAR attrib : ARRAY_4 ) : INTEGER;
- VAR
- i : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- vql_attributes:=gemvdif(35,handle);
- FOR i:=0 TO 2 DO attrib[i]:=intout[i];
- attrib[3]:=ptsout[0];
- END;
-
- {*******************************************************}
- {* Inquire polymarker attributes *}
-
- FUNCTION vqm_attributes (handle : INTEGER;
- VAR attrib : ARRAY_4) : INTEGER;
- VAR
- I : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- vqm_attributes:=gemvdif(36,handle);
- FOR i:= 0 TO 2 DO attrib[i]:=intout[i];
- attrib[3]:=ptsout[0];
- END;
-
- {*********************************************************}
- {* Inquire fill area attributes *}
-
- FUNCTION vqf_attributes (handle : INTEGER;
- VAR attrib : ARRAY_4 ) : INTEGER;
- VAR
- i : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- vqf_attributes:=gemvdif(37,handle);
- FOR i:=0 TO 3 DO attrib[i]:=intout[i];
- { what about fill perim status *}
- END;
-
- {****************************************************************}
- {* Inquire current Graphic text attributes *}
-
- FUNCTION vqt_attributes (handle : INTEGER;
- VAR attrib : ARRAY_10 ) : INTEGER;
- VAR
- i : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- vqt_attributes:=gemvdif(38,handle);
- FOR i:=0 TO 5 DO attrib[i]:=intout[i];
- FOR i:=6 TO 9 DO attrib[i]:=ptsout[i-6];
- END;
-
- {*****************************************************************}
- {* Inquire Text Extent *}
-
- FUNCTION vqt_extent (handle : INTEGER;
- chstring : STRING80;
- VAR extent : ARRAY_8 ) : INTEGER;
- VAR
- I : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=LENGTH(chstring);
- FOR i:=1 TO LENGTH(chstring) DO intin[i-1]:=ORD(chstring[i]);
- vqt_extent:=gemvdif(116,handle);
- FOR i:=0 TO 7 DO extent[i]:=ptsout[i];
- END;
-
- {********************************************************************}
- {* Inquire character cell width *}
-
- FUNCTION vqt_width (handle : INTEGER;
- character : CHAR;
- VAR cellwidth : INTEGER;
- VAR leftdelta : INTEGER;
- VAR rightdelta : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=1;
- intin[0]:=ORD(character);
- vqt_width:=gemvdif(117,handle);
- cellwidth:=ptsout[0];
- leftdelta:=ptsout[2];
- rightdelta:=ptsout[4];
- END;
-
- {******************************************************************}
- {** Inquire font name and index *}
-
- FUNCTION vqt_name (handle : INTEGER;
- elementnum : INTEGER;
- VAR name : STRING80 ) : INTEGER;
- VAR
- i : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=1;
- intin[0]:=elementnum;
- vqt_name:=gemvdif(130,handle);
- name:=''; { initialize string to null }
- FOR i:=1 TO 32 DO name:=CONCAT(name,CHR(intout[i]));
- END;
-
- {********************************************************************}
- {* Inquire Cell Array *}
-
- FUNCTION vq_cellarray (handle : INTEGER;
- pxyarray : ARRAY_4;
- rowlen : INTEGER;
- numrows : INTEGER;
- VAR elused : INTEGER;
- VAR rowsused : INTEGER;
- status : INTEGER;
- VAR colarray : intout_ARRAY ) : INTEGER;
- VAR
- i : INTEGER;
-
- BEGIN
- contrl[1]:=2;
- contrl[7]:=rowlen;
- contrl[8]:=numrows;
- FOR i:=0 TO 3 DO ptsin[i]:=pxyarray[i];
- vq_cellarray:=gemvdif(27,handle);
- elused:=contrl[9];
- rowsused:=contrl[10];
- status:=contrl[11];
- FOR i:=0 TO intout_max DO colarray[i]:=intout[i];
- END;
-
- {********************************************************************}
- {* Inquire Input Mode *}
-
- FUNCTION vqn_mode (handle : INTEGER;
- VAR inputmode : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=1;
- vqn_mode:=gemvdif(115,handle);
- inputmode:=intout[0];
- END;
-
-
-
- {******************************************************************}
- {* Inquire Current Font Information *}
-
- FUNCTION vqt_fontinfo (handle : INTEGER;
- VAR minADE : INTEGER;
- VAR maxADE : INTEGER;
- VAR distances : ARRAY_4;
- VAR maxwidth : INTEGER;
- effects : ARRAY_3 ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- vqt_fontinfo:=gemvdif(131,handle);
- minADE:=intout[0];
- maxADE:=intout[1];
- distances[0]:=ptsout[1];
- distances[1]:=ptsout[3];
- distances[2]:=ptsout[5];
- distances[3]:=ptsout[7];
- maxwidth:=ptsout[0];
- effects[0]:=ptsout[2];
- effects[1]:=ptsout[4];
- effects[2]:=ptsout[6];
- END;
-
- {*******************}
- {***** ESCAPES ****}
- {******************************************************************}
- {* escape : inquire addressable alpha char cells *}
-
- FUNCTION vq_chcells (handle : INTEGER;
- VAR rows : INTEGER;
- VAR columns : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- contrl[5]:=1;
- vq_chcells:=gemvdif(5,handle);
- rows:=intout[0];
- columns:=intout[1];
- END;
-
- {**********************************************************}
- {** general escape routine..called by many of those below *}
-
- FUNCTION genescape (fid : INTEGER;
- handle : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- contrl[5]:=fid; { function id }
- genescape:=gemvdif(5,handle);
- END;
-
- {************************************************************}
- FUNCTION v_exit_cur (handle : INTEGER) : INTEGER;
-
- BEGIN
- v_exit_cur:=genescape(2,handle);
- END;
-
- {************************************************************}
- FUNCTION v_enter_cur (handle : INTEGER) : INTEGER;
-
- BEGIN
- v_enter_cur:=genescape(3,handle);
- END;
-
- {************************************************************}
- FUNCTION v_curup (handle : INTEGER) : INTEGER;
-
- BEGIN
- v_curup:=genescape(4,handle);
- END;
-
- {************************************************************}
- FUNCTION v_curdown (handle : INTEGER) : INTEGER;
-
- BEGIN
- v_curdown:=genescape(5,handle);
- END;
-
- {************************************************************}
- FUNCTION v_curright (handle : INTEGER) : INTEGER;
-
- BEGIN
- v_curright:=genescape(6,handle);
- END;
-
- {************************************************************}
- FUNCTION v_curleft (handle : INTEGER) : INTEGER;
-
- BEGIN
- v_curleft:=genescape(7,handle);
- END;
-
- {************************************************************}
- FUNCTION v_curhome (handle : INTEGER) : INTEGER;
-
- BEGIN
- v_curhome:=genescape(8,handle);
- END;
-
- {************************************************************}
- FUNCTION v_eeos (handle : INTEGER) : INTEGER;
-
- BEGIN
- v_eeos:=genescape(9,handle);
- END;
-
- {************************************************************}
- FUNCTION v_eeol (handle : INTEGER) : INTEGER;
-
- BEGIN
- v_eeol:=genescape(10,handle);
- END;
-
- {*****************************************************************}
- {*****************************************************************}
- {* direct alpha cursor address *}
-
- FUNCTION vs_curaddress (handle, row, column : INTEGER) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=2;
- contrl[5]:=11;
- intin[0]:=row;
- intin[1]:=column;
- vs_curaddress:=gemvdif(5,handle);
- END;
-
- {************************************************************}
- {* output cursor addressable text *}
-
- FUNCTION v_curtext (handle : INTEGER;
- chstring : STRING80) : INTEGER;
- VAR
- i : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=LENGTH(chstring);
- contrl[5]:=12;
- FOR i:=1 TO LENGTH(chstring) DO intin[i- 1]:=ORD(chstring[i]);
- v_curtext:=gemvdif(5,handle);
- END;
-
- {************************************************************}
- FUNCTION v_rvon (handle : INTEGER) : INTEGER;
-
- BEGIN
- v_rvon:=genescape(13,handle);
- END;
-
- {************************************************************}
- FUNCTION v_rvoff (handle : INTEGER) : INTEGER;
-
- BEGIN
- v_rvoff:=genescape(14,handle);
- END;
-
- {*************************************************************}
- {* inquire current alpha cursor address *}
-
- FUNCTION vq_curaddress (handle : INTEGER;
- VAR row : INTEGER;
- VAR column : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- contrl[5]:=15;
- vq_curaddress:=gemvdif(5,handle);
- row:=intout[0];
- column:=intout[1];
- END;
-
- {************************************************************}
- {* inquire tablet status *}
-
- FUNCTION vq_tabstatus (handle : INTEGER; VAR status : INTEGER) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- contrl[5]:=16;
- vq_tabstatus:=gemvdif(5,handle);
- status:=intout[0];
- END;
-
- {*************************************************************}
- {* Hard Copy *}
-
- FUNCTION v_hardcopy (handle : INTEGER) : INTEGER;
-
- BEGIN
- v_hardcopy:=genescape(17,handle);
- END;
-
- {****************************************************************}
- {* place a graphic cursor at the specifeid location *}
-
- FUNCTION v_dspcur (handle,x, y : INTEGER) : INTEGER;
-
- BEGIN
- contrl[1]:=1;
- contrl[3]:=0;
- contrl[5]:=18;
- ptsin[0]:=x;
- ptsin[1]:=y;
- v_dspcur:=gemvdif(5,handle);
- END;
-
- {************************************************************}
-
- FUNCTION v_rmcur (handle : INTEGER) : INTEGER;
-
- BEGIN
- v_rmcur:=genescape(19,handle);
- END;
-
- {************************************************************}
- {** Form advance *}
-
- FUNCTION v_form_adv(handle : INTEGER) : INTEGER;
-
- BEGIN
- v_form_adv:=genescape(20,handle);
- END;
-
- {************************************************************}
- {* Output Window *}
-
- FUNCTION v_output_window(handle : INTEGER;
- xyarray : ARRAY_4 ) : INTEGER;
- VAR
- i : INTEGER;
-
- BEGIN
- contrl[1]:=2;
- contrl[3]:=0;
- contrl[5]:=21;
- FOR i:=0 TO 3 DO ptsin[i]:=xyarray[i];
- v_output_window:=gemvdif(5,handle);
- END;
-
- {*************************************************************}
- {* Clear display list *}
-
- FUNCTION v_clear_display_list (handle : INTEGER) : INTEGER;
-
- BEGIN
- v_clear_display_list:=genescape(22,handle);
- END;
-
-
- {************************************************************}
- {* selection of IBM color palette 0 = red,green,yelllow 1=cyan,blue,magenta }
-
- FUNCTION vs_palette(handle : INTEGER;
- palette : INTEGER ) : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=1;
- contrl[5]:=60;
- intin[0]:=palette;
- vs_palette:=gemvdif(5,handle);
- END;
-
- {************************************************************}
- {* Inquire Palette Film Types *}
-
- FUNCTION vqp_films(handle : INTEGER;
- VAR filmnames : STRING80 ) : INTEGER;
- VAR
- i : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- contrl[5]:=91;
- vqp_films:=gemvdif(5,handle);
- filmnames:='';
- FOR i:=0 TO 127 DO filmnames:=CONCAT(filmnames,CHR(intout[i]));
- END;
-
- {************************************************************}
- {* Inquire Palette Driver State *}
-
- FUNCTION vqp_state (handle : INTEGER;
- VAR port : INTEGER;
- VAR filmname : INTEGER;
- VAR lightness : INTEGER;
- VAR interlace : INTEGER;
- VAR planes : INTEGER;
- VAR indexes : ARRAY_16 ) : INTEGER;
- VAR
- i : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=0;
- contrl[5]:=92;
- vqp_state:=gemvdif(5,handle);
- port:=intout[0];
- filmname:=intout[1];
- lightness:=intout[2];
- interlace:=intout[3];
- planes:=intout[4];
- FOR i:=0 to 15 DO indexes[i]:=intout[i+5];
- END;
-
- {***************************************************************}
- {* Set Palette Driver State *}
-
- FUNCTION vsp_state (handle : INTEGER;
- port : INTEGER;
- filmname : INTEGER;
- lightness : INTEGER;
- interlace : INTEGER;
- planes : INTEGER;
- indexes : ARRAY_16) : INTEGER;
- VAR
- i : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=20;
- contrl[5]:=93;
- contrl[6]:=93;
- intin[0]:=port;
- intin[1]:=filmname;
- intin[2]:=lightness;
- intin[3]:=interlace;
- intin[4]:=planes;
- FOR i:=0 TO 15 DO intin[i+4]:=indexes[i]; { CHECK }
- vsp_state:=gemvdif(5,handle);
- END;
-
- {************************************************************}
- {* Save Palette Driver State *}
-
- FUNCTION vsp_save (handle : INTEGER) : INTEGER;
-
- BEGIN
- vsp_save:=genescape(94, handle);
- END;
-
- {************************************************************}
- {* suppress polaroid palette messages *}
-
- FUNCTION vsp_message (handle : INTEGER) : INTEGER;
-
- BEGIN
- vsp_message:=genescape(95,handle);
- END;
-
- {************************************************************}
- {* Palette Error Inquiries *}
-
- FUNCTION vqp_error (handle : INTEGER) : INTEGER;
-
- BEGIN
- vqp_error:=genescape(96,handle);
- END;
-
- {*****************************************************************}
- {** write gsx metafile **}
-
- FUNCTION v_write_meta (handle : INTEGER;
- numintin : INTEGER;
- intin : intin_ARRAY;
- numptsin : INTEGER;
- ptsin : ptsin_ARRAY ) : INTEGER;
- VAR
- i : INTEGER;
-
- BEGIN
- contrl[1]:=numintin;
- contrl[3]:=numptsin;
- contrl[5]:=99;
- contrl[6]:=handle;
- v_write_meta:=gemvdif(5,handle); { CHECK }
- END;
-
- {****************************************************************}
- {* change gsx metafile filename from gsxfile.gsx *}
-
- FUNCTION vm_filename (handle : INTEGER;
- filename : STRING80 ) : INTEGER;
- VAR
- i : INTEGER;
-
- BEGIN
- contrl[1]:=0;
- contrl[3]:=LENGTH(filename);
- contrl[5]:=100;
- FOR i:=1 TO LENGTH(filename) DO intin[i- 1]:=ORD(filename[i]);
- vm_filename:=gemvdif(5,handle);
- END;
-
-