| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- (* Release 3.10 *)
- (*-------------------------------------------------------------------------*
- * *
- * CWINDOW.DEF - Modula-2 interface to WINDOW.H *
- * *
- * COPYRIGHT (C) 1989..1992 Clarion Software Corporation. *
- * All Rights Reserved *
- * *
- *--------------------------------------------------------------------------*)
- (*# project("#set tsc='on'") *)
- (*# project("#set cwindow='jpi'") *)
- (*# call(o_a_size=>off, o_a_copy=>off, c_conv=>on, result_optional=>on) *)
- (*# module(implementation=>off, init_code=>off) *)
- (*# name(prefix=>c) *)
- DEFINITION MODULE cwindow;
- CONST
- TRUE = 1;
- FALSE = 0;
- SCREENWIDTH = 80;
- SCREENDEPTH = 25;
- PALETTESIZE = 10;
- PALETTEMAX = PALETTESIZE;
- SINGLEFRAME = 'ÚÄżłłŔÄŮ';
- DOUBLEFRAME = 'ÉÍťşşČÍź';
- TYPE
- wintype = POINTER TO WDS;
- relcoord = CARDINAL;
- abscoord = CARDINAL;
- Color = (Black,Blue,Green,Cyan,Red,Magenta,Brown,LightGray,
- DarkGray,LightBlue,LightGreen,LightCyan,LightRed,LightMagenta,
- LightYellow,White);
- titlestr = ARRAY[0..SCREENWIDTH-1] OF CHAR;
- framestr = ARRAY[0..8] OF CHAR;
- windef = RECORD
- X1,Y1,X2,Y2: abscoord; (* outer coords of opposite corners *)
- ForeGround,BackGround: Color; (* not used if palette *)
- CursorOn, (* if cursor active *)
- WrapOn, (* if EOL wrap enabled *)
- Hidden, (* if window on view *)
- FrameOn: BOOLEAN; (* if frame *)
- FrameDef: framestr; (* only used if frame *)
- FrameFore,FrameBack: Color; (* only used if frame *)
- END;
- TitleMode = (NoTitle,
- LeftUpperTitle,CenterUpperTitle,RightUpperTitle,
- LeftLowerTitle,CenterLowerTitle,RightLowerTitle);
- VAR
- fullscreendef: windef;
- _fullscreen: wintype;
- PROCEDURE windowopen(VAR WD: windef): wintype;
- PROCEDURE settitle(_win: wintype; _NewTitle: ARRAY OF CHAR; _Mode: TitleMode);
- PROCEDURE setframe(_win: wintype; _Frame: framestr; _Fore,_Back: Color);
- PROCEDURE use(_win: wintype);
- PROCEDURE putontop(_win: wintype);
- PROCEDURE putbeneath(_win,_WA: wintype);
- PROCEDURE hide(_win: wintype);
- PROCEDURE change(_win: wintype; _X1,_Y1,_X2,_Y2: abscoord);
- PROCEDURE snapshot;
- PROCEDURE windowclose(_win: wintype);
- PROCEDURE used(): wintype;
- PROCEDURE top(): wintype;
- PROCEDURE obscuredat(_win: wintype; _X,_Y: relcoord): INTEGER;
- PROCEDURE at(_X,_Y: abscoord): wintype;
- PROCEDURE gotoxy(_X,_Y: relcoord);
- PROCEDURE wherex(): relcoord;
- PROCEDURE wherey(): relcoord;
- PROCEDURE convertcoords(_win: wintype; _X,_Y: relcoord; VAR XO,YO: abscoord);
- PROCEDURE clrscr;
- PROCEDURE cursoron;
- PROCEDURE cursoroff;
- PROCEDURE inline;
- PROCEDURE delline;
- PROCEDURE clreol;
- PROCEDURE textcolor(_c: Color);
- PROCEDURE textbackgroun(_c: Color);
- PROCEDURE _directwrite(_X,_Y: relcoord; _A: ADDRESS; _len: CARDINAL);
- PROCEDURE setwrap(_on: INTEGER);
- PROCEDURE info(_win: wintype; VAR _WD: windef);
- PROCEDURE _rdbufferln(_win: wintype; _X,_Y: relcoord; _Dest: ADDRESS; _Len: CARDINAL);
- PROCEDURE _wrbufferln(_win: wintype; _X,_Y: relcoord; _src: ADDRESS; _Len: CARDINAL);
- TYPE
- PaletteColorDef = RECORD
- Fore,Back: Color;
- END;
- PaletteDef = ARRAY[0..PALETTEMAX-1] OF PaletteColorDef;
- CONST
- NORMALPALETTECOLOR = 0;
- FRAMEPALETTECOLOR = 1;
- PROCEDURE paletteopen(VAR WD: windef; _Pal: PaletteDef): wintype;
- PROCEDURE setpalette(_win: wintype; _Pal: PaletteDef);
- PROCEDURE palettecolor(): CARDINAL;
- PROCEDURE setpalettecolor(_c: CARDINAL);
- PROCEDURE palettecolorused(_win: wintype; _pc: CARDINAL): INTEGER;
- TYPE
- bufferptr = POINTER TO CARDINAL;
- WinDescriptor = RECORD
- Guard: CARDINAL;
- Next,
- CursorChain: wintype;
- WDef: windef;
- XA,YA,XB,YB: abscoord;
- OWidth,ODepth: CARDINAL;
- Width,Depth: CARDINAL;
- Title: ADDRESS;
- CurrentX,CurrentY: relcoord;
- IsPalette: BOOLEAN;
- PalAttr: ARRAY[0..PALETTEMAX-1] OF SHORTCARD;
- CurPalColor: CARDINAL;
- Buffer: bufferptr;
- UserRecord: ADDRESS;
- END;
- END cwindow.
|