home *** CD-ROM | disk | FTP | other *** search
- /*---------------------------------------------------------------------------*
- | TEGL Windows ToolKit II |
- | Copyright (C) 1990, TEGL Systems Corporation |
- | All Rights Reserved. |
- *---------------------------------------------------------------------------*/
- /* teglcond.h
-
- Conditional defines and compatability defines
-
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
-
- #ifndef __TEGLCOND_H
- #define __TEGLCOND_H
-
- #ifdef __WATCOMC__
- #include <stddef.h>
- #ifndef MSDOS
- #define MSDOS
- #endif
- #define QUICKC
- #define __STDTEGL__
- #endif
-
- #ifdef __TSC__
- #define TURBOC
- #define __STDTEGL__
- #endif
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #define __PASTEGL__
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
-
- /* MSDOS is defined in Quick C and Microsoft C */
- #ifdef MSDOS
- #define QUICKC
- #else
- #define TURBOC
- #endif
-
- /* only define one of these for the compiler, only necessary if */
- /* the above does not recognize the compiler type. */
- /* #define TURBOC */
- /* #define QUICKC */
-
- #ifdef TURBOC
- #ifdef QUICKC
- #error Can only define one compiler.
- #endif
- #endif
-
- #ifndef TURBOC
- #ifndef QUICKC
- #error No compiler defined.
- #endif
- #endif
-
- /* #define TRACE */
- #ifdef TRACE
- #define trace(fmt,itm) printf(fmt,itm); getch()
- #else
- #define trace(fmt,itm)
- #endif
-
-
- /* define to build the demonstrator version of the library */
-
- #define TEGLDEMO
-
-
- /* define if the virtual memory manager is NOT to be used */
-
- /* #define NOVIRT */
-
- /* define if the graphics libraries from TURBO C or QUICK C are */
- /* not to be used. */
-
- #define NOGR
-
- /* common defines */
-
- #ifdef __cplusplus
- extern "C" {
- #endif
- extern void cdecl resetkeyboard(void);
- #ifdef __cplusplus
- }
- #endif
-
-
- #ifndef TGMK_FP
- #define TGMK_FP(seg,ofs) ((void far *) \
- (((unsigned long)(seg) << 16) | (unsigned)(ofs)))
- #endif
-
- #ifndef NULL
- #if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)
- #define NULL 0
- #else
- #define NULL 0L
- #endif
- #endif
-
-
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
- #include <dos.h>
-
- #ifdef TURBOC
- #include <dir.h>
- #include <alloc.h>
- #include <sys\stat.h>
-
- #if defined(__TSC__)
- #define OS_MAJOR (__TSC__ & 0xff)
- #else
- #define OS_MAJOR (_version & 0xff)
- #endif
- #endif
-
- #ifdef QUICKC
-
- #include <malloc.h>
- #include <direct.h>
- #include <sys\types.h>
- #include <sys\stat.h>
-
- #define random( max ) ((rand() % (int)((max) - (0))) + (0) + 1)
- #define poke(a,b,c) (*((int far*) TGMK_FP((a),(b))) = (int) (c))
- #define peekb( a,b )( *( (char far* ) TGMK_FP( (a ),( b )) ))
- #define pokeb( a,b,c )( *( (char far* ) TGMK_FP( (a ),( b )) ) =( char )( c ))
-
- extern void sound(unsigned mhz);
- extern void nosound(void);
- extern void delay(unsigned delayms);
-
- /* TURBO C's and QUICK C's dos.h are largely compatible */
- /* just a few name changes are required. */
-
- #define time dostime_t
- #define gettime _dos_gettime
- #define ti_sec second
-
- #define dfree diskfree_t
- #define df_avail avail_clusters
- #define df_total total_clusters
- #define df_bsec bytes_per_sector
- #define df_sclus sectors_per_cluster
- #define findnext _dos_findnext
-
- #define WILDCARDS 0x01
- #define EXTENSION 0x02
- #define FILENAME 0x04
- #define DIRECTORY 0x08
- #define DRIVE 0x10
-
- #define MAXPATH _MAX_PATH
- #define MAXDRIVE _MAX_DRIVE
- #define MAXDIR _MAX_DIR
- #define MAXFILE _MAX_FNAME
- #define MAXEXT _MAX_EXT
-
- #define FA_RDONLY _A_RDONLY
- #define FA_HIDDEN _A_HIDDEN
- #define FA_SYSTEM _A_SYSTEM
- #define FA_ARCH _A_ARCH
- #define FA_LABEL 0x08 /* Volume label */
- #define FA_DIREC 0x10 /* Directory */
-
- #define fnsplit _splitpath
- #define fnmerge _makepath
-
- #define findfirst(a,b,c) _dos_findfirst(a,c,b)
- #define ffblk find_t
-
- #define OS_MAJOR _osmajor
-
- #define farmalloc(x) ((void far *)halloc(x,1))
- #define farfree(x) hfree((void huge *)x)
-
- #define stpcpy(d,s) (strcpy (d, s), d + strlen (s))
-
- #endif
-
- #ifndef FALSE
- #define FALSE 0
- #define TRUE 1
- #endif
-
- /* if its QuickC and NoGr has not been specifically defined by now */
- /* then use the graphics routines provided with the compiler. */
-
- #ifdef QUICKC
- #ifndef NOGR
- #define MSGRAPH
- #endif
- #endif
-
- /* map the Borland graph drivers to TEGL just in case */
- /* The TEGL graphic drivers are defined in FASTGRPH */
-
- #define CGA_driver GRCGABW_driver
- #define EGAVGA_driver GREVGA16_driver
- #define IBM8514_driver GREVGA16_driver
- #define Herc_driver GRHERCBW_driver
- #define ATT_driver GREVGA16_driver
- #define PC3270_driver GREVGA16_driver
-
-
-
- #endif
- /* errorlog.h
-
- Standard Error for delayed message output
-
- Copyright (c) TEGL Systems Corporation 1989,1990,1991
- All Rights Reserved.
- */
-
- #ifndef __ERRORLOG_H
- #define __ERRORLOG_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- void _TGdecl logmessage(char * msg);
- void _TGdecl aborterror(char * msg, int errorcode);
- void _TGdecl abortexit(char * msg);
- void _TGdecl showloggedmsg(void);
- void _TGdecl clearlog(void);
-
- #ifdef __cplusplus
- }
- #endif
- #endif
- /* videochk.h
-
- Defines structs and functions for Autodetecting Graphic Drivers
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
- #ifndef __VIDEOCHK_H
- #define __VIDEOCHK_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- typedef struct vidid {
- unsigned char video0type;
- unsigned char display0type;
- unsigned char video1type;
- unsigned char display1type;
- } vidid;
-
- #define TG_MDA 0x01
- #define TG_CGA 0x02
- #define TG_EGA 0x03
- #define TG_MCGA 0x04
- #define TG_VGA 0x05
- #define TG_SVGA 0x06
- #define TG_SVGA256 0x07
- #define TG_VGA256 0x08
- #define TG_HGC 0x80
- #define TG_HGCPLUS 0x81
- #define TG_INCOLOR 0x82
-
- #define TG_MDADISPLAY 0x01
- #define TG_CGADISPLAY 0x02
- #define TG_EGACOLORDISPLAY 0x03
- #define TG_PS2MONODISPLAY 0x04
- #define TG_PS2COLORDISPLAY 0x05
-
- extern char videochoicescga640x200x2;
- extern char videochoicesega640x350x16;
- extern char videochoicesvga640x480x16;
- extern char videochoicesherc720x348x2;
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- void _TGType videoid(vidid far * v);
- void _TGdecl setvideochoices(unsigned v, char accept);
- char *_TGdecl videomodestring(char vtype, char dtype);
- char *_TGdecl videoautodetect(void);
- char *_TGdecl returnvideotype(void);
-
- #ifdef __cplusplus
- }
- #endif
- #endif
- /* fastgrph.h
-
- Defines structs and functions for the TEGL Graphic Drivers
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
- #ifndef __FASTGRPH_H
- #define __FASTGRPH_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- typedef void (far *vmode)(void);
- typedef unsigned masktype[2][16];
- #define maskptr masktype *
-
- typedef void (far *fontptr)(void);
-
- /* typedef struct fontinfo *fontptr; */
- typedef struct fontinfo {
- unsigned fontsignature;
- unsigned char fontheight;
- unsigned char fontwidth;
- unsigned char fontasciistart;
- unsigned char fontasciiend;
- unsigned char fonttop;
- unsigned char fontbase;
- unsigned char fontbottom;
- unsigned char fontbytewidth;
- } fontinfo;
-
- typedef struct videoinforec *videoinfoptr;
- typedef struct videoinforec {
- char modename[22]; /* Mode String Name */
- int modenumber; /* Mode Number */
- unsigned maxx; /* Device Full Resolution in X */
- unsigned maxy; /* Device Full Resolution in Y */
- unsigned stdchrwidth; /* Standard char size X */
- unsigned stdchrheight; /* Standard char size Y */
- unsigned maxcolor; /* Number of colors */
- unsigned maxpages; /* Number of pages */
- unsigned maxpalette; /* Number of palettes */
- unsigned activepage; /* buffer offset for 2 page */
- unsigned screenseg; /* Screen Segment */
- unsigned bytesperline; /* bytes per line */
- unsigned aspectx; /* aspect ratio x * 1000 */
- unsigned aspecty; /* aspect ratio y * 1000 */
- char *driveraddr; /* video driver start address */
- char *drivernameptr; /* video driver name char * */
- char *driverjumptable; /* video driver Jump Table */
- void *graphbufferptr; /* Graphic Work Buffer */
- unsigned graphbuffersize; /* Graphic Size Buffer */
- unsigned rmwbits; /* Read/Write modes */
- unsigned char transparency; /* transpanrancy on-$00/off-$ff */
- unsigned char jagged; /* jagged characters on-$01/off-$00 */
- fontptr fonttable; /* char * to font table */
- unsigned char egapaletteflag; /* allow EGA pallete set */
- unsigned char rgbpaletteflag; /* allow VGA pallete set */
- unsigned char proportionalfont; /* proportional font switch */
- unsigned teglfillmask; /* fillmask for lines */
- unsigned wminx; /* viewport - minx */
- unsigned wminy; /* viewport - miny */
- unsigned wmaxx; /* viewport - maxx */
- unsigned wmaxy; /* viewport - maxy */
- unsigned char clipped; /* viewport - clipping on/off */
- unsigned mousecolor; /* Mouse color */
- unsigned mousehotspot_xofs; /* Mouse hotspot */
- unsigned mousehotspot_yofs; /* Mouse hotspot */
- maskptr mousemask; /* Mouse Cursor Mask */
- videoinfoptr nextmodeptr; /* Next VideoMode */
- } videoinforec;
-
- typedef struct driverfiletable *driverfileptr;
- typedef struct driverfiletable {
- driverfileptr nextdrvfile;
- char modename[21];
- char filename[81];
- } driverfiletable;
-
- typedef struct bgigdgmrec *bgigdgmptr;
- typedef struct bgigdgmrec {
- bgigdgmptr nextbgiptr;
- char modename[21];
- int gd;
- int gm;
- } bgigdgmrec;
-
- typedef struct bgitgirec *bgitgidrv;
- typedef struct bgitgirec {
- bgitgidrv nextbgitgi;
- char tgidriver[16];
- int graphdriver;
- } bgitgirec;
-
- #define FGNORM 0x00
- #define FGAND 0x08
- #define FGOR 0x10
- #define FGXOR 0x18
- #define FGNOT 0x80
-
- #define grok 0
- #define grnoinitgraph -1
- #define grnotdetected -2
- #define grfilenotfound -3
- #define grinvaliddriver -4
- #define grnoloadmem -5
- #define grnoscanmem -6
- #define grnofloodmem -7
- #define grfontnotfound -8
- #define grnofontmem -9
- #define grinvalidmode -10
- #define grerror -11
- #define grioerror -12
- #define grinvalidfont -13
- #define grinvalidfontnum -14
-
- #ifdef QUICKC
- typedef char *(_TGType far* teglgrfunc00)(void);
- typedef unsigned (_TGType far* teglgrfunc01)(unsigned,unsigned);
- typedef unsigned (_TGType far* teglgrfunc02)(unsigned,unsigned,void*);
- typedef unsigned long (_TGType far* teglgrfunc03)(unsigned,unsigned,unsigned,unsigned);
- typedef unsigned (_TGType far* teglgrfunc04)(unsigned);
- typedef unsigned (_TGType far* teglgrfunc05)(unsigned,unsigned,unsigned,int);
-
- typedef void (_TGType far * teglgrproc00)(void*);
- typedef void (_TGType far * teglgrproc01)(unsigned,unsigned,unsigned,unsigned,unsigned);
- typedef void (_TGType far * teglgrproc02)(unsigned,unsigned,unsigned);
- typedef void (_TGType far * teglgrproc03)(unsigned,unsigned,void*,unsigned);
- typedef void (_TGType far * teglgrproc04)(unsigned,unsigned,unsigned,unsigned,void*);
- typedef void (_TGType far * teglgrproc05)(unsigned,unsigned,unsigned,unsigned,void*,void*);
- typedef void (_TGType far * teglgrproc06)(unsigned,unsigned,void*,void*);
- typedef void (_TGType far * teglgrproc07)(unsigned,unsigned,unsigned,unsigned,unsigned);
- typedef void (_TGType far * teglgrproc08)(void);
- typedef void (_TGType far * teglgrproc09)(unsigned,unsigned);
- typedef void (_TGType far * teglgrproc10)(unsigned,unsigned,unsigned,unsigned,unsigned,unsigned,int,int,void*,void*);
- typedef void (_TGType far * teglgrproc11)(unsigned);
- #else
- #ifdef __TSC__
- typedef char *(_TGType far* teglgrfunc00)(void);
- typedef unsigned (_TGType far* teglgrfunc01)(unsigned,unsigned);
- typedef unsigned (_TGType far* teglgrfunc02)(unsigned,unsigned,void*);
- typedef unsigned long (_TGType far* teglgrfunc03)(unsigned,unsigned,unsigned,unsigned);
- typedef unsigned (_TGType far* teglgrfunc04)(unsigned);
- typedef unsigned (_TGType far* teglgrfunc05)(unsigned,unsigned,unsigned,int);
-
- typedef void (_TGType far * teglgrproc00)(void*);
- typedef void (_TGType far * teglgrproc01)(unsigned,unsigned,unsigned,unsigned,unsigned);
- typedef void (_TGType far * teglgrproc02)(unsigned,unsigned,unsigned);
- typedef void (_TGType far * teglgrproc03)(unsigned,unsigned,void*,unsigned);
- typedef void (_TGType far * teglgrproc04)(unsigned,unsigned,unsigned,unsigned,void*);
- typedef void (_TGType far * teglgrproc05)(unsigned,unsigned,unsigned,unsigned,void*,void*);
- typedef void (_TGType far * teglgrproc06)(unsigned,unsigned,void*,void*);
- typedef void (_TGType far * teglgrproc07)(unsigned,unsigned,unsigned,unsigned,unsigned);
- typedef void (_TGType far * teglgrproc08)(void);
- typedef void (_TGType far * teglgrproc09)(unsigned,unsigned);
- typedef void (_TGType far * teglgrproc10)(unsigned,unsigned,unsigned,unsigned,unsigned,unsigned,int,int,void*,void*);
- typedef void (_TGType far * teglgrproc11)(unsigned);
- #else
- typedef char *_TGType(far* teglgrfunc00)(void);
- typedef unsigned _TGType(far* teglgrfunc01)(unsigned,unsigned);
- typedef unsigned _TGType(far* teglgrfunc02)(unsigned,unsigned,void*);
- typedef unsigned long _TGType(far* teglgrfunc03)(unsigned,unsigned,unsigned,unsigned);
- typedef unsigned _TGType(far* teglgrfunc04)(unsigned);
- typedef unsigned _TGType(far* teglgrfunc05)(unsigned,unsigned,unsigned,int);
-
- typedef void _TGType(far * teglgrproc00)(void*);
- typedef void _TGType(far * teglgrproc01)(unsigned,unsigned,unsigned,unsigned,unsigned);
- typedef void _TGType(far * teglgrproc02)(unsigned,unsigned,unsigned);
- typedef void _TGType(far * teglgrproc03)(unsigned,unsigned,void*,unsigned);
- typedef void _TGType(far * teglgrproc04)(unsigned,unsigned,unsigned,unsigned,void*);
- typedef void _TGType(far * teglgrproc05)(unsigned,unsigned,unsigned,unsigned,void*,void*);
- typedef void _TGType(far * teglgrproc06)(unsigned,unsigned,void*,void*);
- typedef void _TGType(far * teglgrproc07)(unsigned,unsigned,unsigned,unsigned,unsigned);
- typedef void _TGType(far * teglgrproc08)(void);
- typedef void _TGType(far * teglgrproc09)(unsigned,unsigned);
- typedef void _TGType(far * teglgrproc10)(unsigned,unsigned,unsigned,unsigned,unsigned,unsigned,int,int,void*,void*);
- typedef void _TGType(far * teglgrproc11)(unsigned);
- #endif
- #endif
-
- extern videoinfoptr _TGType activeteglmode;
- extern videoinfoptr _TGType drvinfotable;
- extern void * graphscanbuffer;
- extern unsigned graphbuffersize;
-
- extern bgigdgmptr drvbgitable;
-
- #ifdef NOGR
- extern int lastmode__;
- extern int lastpage__;
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- extern teglgrfunc00 _TGType getvideotable;
- extern teglgrfunc01 _TGType getpixs;
- extern teglgrfunc02 _TGType extractpixs;
- extern teglgrfunc03 _TGType bigimagesize;
- extern teglgrfunc04 _TGType initvideomode;
- extern teglgrfunc05 _TGType scanborder;
-
- extern teglgrproc00 _TGType setvideotable;
- extern teglgrproc00 _TGType setxlattable;
- extern teglgrproc01 _TGType fastline;
- extern teglgrproc02 _TGType putpixs;
- extern teglgrproc03 _TGType putbiti;
- extern teglgrproc04 _TGType getbiti;
- extern teglgrproc05 _TGType extractimg;
- extern teglgrproc06 _TGType overlayimg;
- extern teglgrproc07 _TGType teglwrtchar;
- extern teglgrproc08 _TGType mcursoroff;
- extern teglgrproc09 _TGType mcursoron;
- extern teglgrproc09 _TGType msetpos;
- extern teglgrproc10 _TGType movevideopixels;
- extern teglgrproc11 _TGType setteglvpage;
- extern teglgrproc11 _TGType setteglapage;
-
- extern int _TGType attachtgidriver(char * driver);
- extern int _TGType registertgi(void (*driver)(void));
- extern void _TGType putpict(unsigned x,unsigned y,char * buf,unsigned n);
- extern void _TGType pictsize(unsigned * w,unsigned * h,char * buf);
- extern void _TGType swapbytes(char * buff1,char * buff2,unsigned long bytestoswap);
- extern unsigned _TGType teglcharwidth(unsigned c);
- extern unsigned _TGType teglcharheight(void);
-
- void _TGdecl settransparency(unsigned char onoff);
- int _TGdecl registertgidriver(void (*driver)(void));
- void _TGdecl outtgtextxy(int x,int y,int color,int bkcolor,char * mystr,...);
- unsigned _TGdecl tegltextwidth(char *mystr,...);
- int _TGdecl teglcharbase(void);
- int _TGdecl teglchartop(void);
- int _TGdecl teglcharstart(void);
- int _TGdecl teglcharbottom(void);
- int _TGdecl teglcharrange(void);
- int _TGdecl teglcharmaxwidth(void);
- void _TGdecl setteglfont(fontptr p);
- fontptr _TGdecl getteglfont(void);
- void _TGdecl setproportional(unsigned char onoff);
- unsigned char _TGdecl getproportional(void);
- void _TGdecl xorcornerbox(int x,int y,int x1,int y1,int color);
- void _TGdecl xorbox(int x1,int y1,int x2,int y2,int color);
- void _TGdecl fastrect(int x1,int y1,int x2,int y2,int c);
- void _TGdecl fastbar(int x1,int y1,int x2,int y2,int c);
- int _TGdecl setgraphicmode(char *modename,char far *pathtodriver);
- void _TGdecl adddriverfilename(char * filename,char * modename);
- bgigdgmptr _TGdecl findbgitomodename(int gd,int gm);
- bgigdgmptr _TGdecl findmodenametobgi(char * modename);
- void _TGdecl adddriverbgimodes(char * modename,int gd,int gm);
- bgitgidrv _TGdecl findtgigraphdriver(char * tegldrivername);
- void _TGdecl addtgigraphdriver(char * tegldrivername,int gd);
- void _TGdecl allocatescanbuffer(unsigned bufsize);
- void _TGdecl fastscrolldown(int x1,int y1,int x2,int y2,int pixlines);
- void _TGdecl fastscrollup(int x1,int y1,int x2,int y2,int pixlines);
- void _TGdecl fastscrollright(int x1,int y1,int x2,int y2,int pixlines);
- void _TGdecl fastscrollleft(int x1,int y1,int x2,int y2,int pixlines);
- unsigned _TGdecl getrmwbits(void);
- void _TGdecl setrmwbits(unsigned rmwb);
- unsigned char _TGdecl overlaparea(unsigned ax,unsigned ay,unsigned ax1,unsigned ay1,
- unsigned bx,unsigned by,unsigned bx1,unsigned by1,
- unsigned * cx,unsigned * cy,unsigned * cx1,unsigned * cy1);
-
- void _TGdecl resetlastvideomode(int tmode, int tpage);
-
-
- /* !! These "functions" are NOT user-callable !! */
- /* !! They are there just so you can link in graphics drivers !! */
-
- #ifdef __TSC__
- void GREVGA16_driver(void);
- void GRHERCBW_driver(void);
- void GRCGABW_driver(void);
- void GRVGA256_driver(void);
- #else
- void cdecl GREVGA16_driver(void);
- void cdecl GRHERCBW_driver(void);
- void cdecl GRCGABW_driver(void);
- void cdecl GRVGA256_driver(void);
- #endif
-
- #ifdef __cplusplus
- }
- #endif
- #endif
- /* tgraph.h
-
- Definitions for TEGL's Graphics Package.
-
- Copyright (c) TEGL Systems Corporation 1989,1990,1991
- All Rights Reserved.
- */
-
- #ifndef __TGRAPH_H
- #define __TGRAPH_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- #ifndef __FASTGRPH_H
- #include <FASTGRPH.H>
- #endif
-
- enum graphics_errors { /* graphresult error return codes */
- grOk = 0,
- grNoInitGraph = -1,
- grNotDetected = -2,
- grFileNotFound = -3,
- grInvalidDriver = -4,
- grNoLoadMem = -5,
- grNoScanMem = -6,
- grNoFloodMem = -7,
- grFontNotFound = -8,
- grNoFontMem = -9,
- grInvalidMode = -10,
- grError = -11, /* generic error */
- grIOerror = -12,
- grInvalidFont = -13,
- grInvalidFontNum = -14,
- grInvalidVersion = -18
- };
-
- enum graphics_drivers { /* define graphics drivers */
- DETECT, /* requests autodetection */
- CGA, MCGA, EGA, EGA64, EGAMONO, IBM8514, /* 1 - 6 */
- HERCMONO, ATT400, VGA, PC3270, /* 7 - 10 */
- CURRENT_DRIVER = -1
- };
-
- enum graphics_modes { /* graphics modes for each driver */
- CGAC0 = 0, /* 320x200 palette 0; 1 page */
- CGAC1 = 1, /* 320x200 palette 1; 1 page */
- CGAC2 = 2, /* 320x200 palette 2: 1 page */
- CGAC3 = 3, /* 320x200 palette 3; 1 page */
- CGAHI = 4, /* 640x200 1 page */
- MCGAC0 = 0, /* 320x200 palette 0; 1 page */
- MCGAC1 = 1, /* 320x200 palette 1; 1 page */
- MCGAC2 = 2, /* 320x200 palette 2; 1 page */
- MCGAC3 = 3, /* 320x200 palette 3; 1 page */
- MCGAMED = 4, /* 640x200 1 page */
- MCGAHI = 5, /* 640x480 1 page */
- EGALO = 0, /* 640x200 16 color 4 pages */
- EGAHI = 1, /* 640x350 16 color 2 pages */
- EGA64LO = 0, /* 640x200 16 color 1 page */
- EGA64HI = 1, /* 640x350 4 color 1 page */
- EGAMONOHI = 0, /* 640x350 64K on card, 1 page - 256K on card, 4 pages */
- HERCMONOHI = 0, /* 720x348 2 pages */
- ATT400C0 = 0, /* 320x200 palette 0; 1 page */
- ATT400C1 = 1, /* 320x200 palette 1; 1 page */
- ATT400C2 = 2, /* 320x200 palette 2; 1 page */
- ATT400C3 = 3, /* 320x200 palette 3; 1 page */
- ATT400MED = 4, /* 640x200 1 page */
- ATT400HI = 5, /* 640x400 1 page */
- VGALO = 0, /* 640x200 16 color 4 pages */
- VGAMED = 1, /* 640x350 16 color 2 pages */
- VGAHI = 2, /* 640x480 16 color 1 page */
- PC3270HI = 0, /* 720x350 1 page */
- IBM8514LO = 0, /* 640x480 256 colors */
- IBM8514HI = 1 /*1024x768 256 colors */
- };
-
- /* Colors for setpalette and setallpalette */
-
- #ifndef __COLORS
- #define __COLORS
-
- enum COLORS {
- BLACK, /* dark colors */
- BLUE,
- GREEN,
- CYAN,
- RED,
- MAGENTA,
- BROWN,
- LIGHTGRAY,
- DARKGRAY, /* light colors */
- LIGHTBLUE,
- LIGHTGREEN,
- LIGHTCYAN,
- LIGHTRED,
- LIGHTMAGENTA,
- YELLOW,
- WHITE
- };
- #endif
-
- enum CGA_COLORS {
- CGA_LIGHTGREEN = 1, /* Palette C0 Color Names */
- CGA_LIGHTRED = 2,
- CGA_YELLOW = 3,
-
- CGA_LIGHTCYAN = 1, /* Palette C1 Color Names */
- CGA_LIGHTMAGENTA = 2,
- CGA_WHITE = 3,
-
- CGA_GREEN = 1, /* Palette C2 Color Names */
- CGA_RED = 2,
- CGA_BROWN = 3,
-
- CGA_CYAN = 1, /* Palette C3 Color Names */
- CGA_MAGENTA = 2,
- CGA_LIGHTGRAY = 3
- };
-
-
- enum EGA_COLORS {
- EGA_BLACK = 0, /* dark colors */
- EGA_BLUE = 1,
- EGA_GREEN = 2,
- EGA_CYAN = 3,
- EGA_RED = 4,
- EGA_MAGENTA = 5,
- EGA_BROWN = 20,
- EGA_LIGHTGRAY = 7,
- EGA_DARKGRAY = 56, /* light colors */
- EGA_LIGHTBLUE = 57,
- EGA_LIGHTGREEN = 58,
- EGA_LIGHTCYAN = 59,
- EGA_LIGHTRED = 60,
- EGA_LIGHTMAGENTA = 61,
- EGA_YELLOW = 62,
- EGA_WHITE = 63
- };
-
- enum line_styles { /* Line styles for get/setlinestyle */
- SOLID_LINE = 0,
- DOTTED_LINE = 1,
- CENTER_LINE = 2,
- DASHED_LINE = 3,
- USERBIT_LINE = 4 /* User defined line style */
- };
-
- enum line_widths { /* Line widths for get/setlinestyle */
- NORM_WIDTH = 1,
- THICK_WIDTH = 3
- };
-
- enum font_names {
- DEFAULT_FONT = 0, /* 8x8 bit mapped font */
- TRIPLEX_FONT = 1, /* "Stroked" fonts */
- SMALL_FONT = 2,
- SANS_SERIF_FONT = 3,
- GOTHIC_FONT = 4
- };
-
- #define HORIZ_DIR 0 /* left to right */
- #define VERT_DIR 1 /* bottom to top */
-
- #define USER_CHAR_SIZE 0 /* user-defined char size */
-
- enum fill_patterns { /* Fill patterns for get/setfillstyle */
- EMPTY_FILL, /* fills area in background color */
- SOLID_FILL, /* fills area in solid fill color */
- LINE_FILL, /* --- fill */
- LTSLASH_FILL, /* /// fill */
- SLASH_FILL, /* /// fill with thick lines */
- BKSLASH_FILL, /* \\\ fill with thick lines */
- LTBKSLASH_FILL, /* \\\ fill */
- HATCH_FILL, /* light hatch fill */
- XHATCH_FILL, /* heavy cross hatch fill */
- INTERLEAVE_FILL, /* interleaving line fill */
- WIDE_DOT_FILL, /* Widely spaced dot fill */
- CLOSE_DOT_FILL, /* Closely spaced dot fill */
- USER_FILL /* user defined fill */
- };
-
- enum putimage_ops { /* BitBlt operators for putimage */
- COPY_PUT, /* MOV */
- XOR_PUT, /* XOR */
- OR_PUT, /* OR */
- AND_PUT, /* AND */
- NOT_PUT /* NOT */
- };
-
- enum text_just { /* Horizontal and vertical justification
- for settextjustify */
- LEFT_TEXT = 0,
- CENTER_TEXT = 1,
- RIGHT_TEXT = 2,
-
- BOTTOM_TEXT = 0,
- /* CENTER_TEXT = 1, already defined above */
- TOP_TEXT = 2
- };
-
-
- #define MAXCOLORS 15
-
- struct palettetype {
- unsigned char size;
- signed char colors[MAXCOLORS+1];
- };
-
- struct linesettingstype {
- int linestyle;
- unsigned upattern;
- int thickness;
- };
-
- struct textsettingstype {
- int font;
- int direction;
- int charsize;
- int horiz;
- int vert;
- };
-
- struct fillsettingstype {
- int pattern;
- int color;
- };
-
- struct pointtype {
- int x, y;
- };
-
- struct viewporttype {
- int left, top, right, bottom;
- int clip;
- };
-
- struct arccoordstype {
- int x, y;
- int xstart, ystart, xend, yend;
- };
-
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- void _TGdecl arc(int __x, int __y, int __stangle, int __endangle,
- int __radius);
- void _TGdecl bar(int __left, int __top, int __right, int __bottom);
- void _TGdecl bar3d(int __left, int __top, int __right, int __bottom,
- int __depth, int __topflag);
- void _TGdecl circle(int __x, int __y, int __radius);
- void _TGdecl cleardevice(void);
- void _TGdecl clearviewport(void);
- void _TGdecl closegraph(void);
- void _TGdecl detectgraph(int far *__graphdriver,int far *__graphmode);
- void _TGdecl drawpoly(int __numpoints, const int far *__polypoints);
- void _TGdecl ellipse(int __x, int __y, int __stangle, int __endangle,
- int __xradius, int __yradius);
- void _TGdecl fillellipse( int __x, int __y, int __xradius, int __yradius );
- void _TGdecl fillpoly(int __numpoints, const int far *__polypoints);
- void _TGdecl floodfill(int __x, int __y, int __border);
- void _TGdecl getarccoords(struct arccoordstype far *__arccoords);
- void _TGdecl getaspectratio(int far *__xasp, int far *__yasp);
- int _TGdecl getbkcolor(void);
- int _TGdecl getcolor(void);
- struct palettetype far * far _TGdecl getdefaultpalette( void );
- char * _TGdecl getdrivername( void );
- void _TGdecl getfillpattern(char far *__pattern);
- void _TGdecl getfillsettings(struct fillsettingstype far *__fillinfo);
- int _TGdecl getgraphmode(void);
- void _TGdecl getimage(int __left, int __top, int __right, int __bottom,
- void far *__bitmap);
- void _TGdecl getlinesettings(struct linesettingstype far *__lineinfo);
- int _TGdecl getmaxcolor(void);
- int _TGdecl getmaxmode(void);
- int _TGdecl getmaxx(void);
- int _TGdecl getmaxy(void);
- char * _TGdecl getmodename( int __mode_number );
- void _TGdecl getmoderange(int __graphdriver, int far *__lomode,
- int far *__himode);
- unsigned _TGdecl getpixel(int __x, int __y);
- void _TGdecl getpalette(struct palettetype far *__palette);
- int _TGdecl getpalettesize( void );
- void _TGdecl gettextsettings(struct textsettingstype far *__texttypeinfo);
- void _TGdecl getviewsettings(struct viewporttype far *__viewport);
- int _TGdecl getx(void);
- int _TGdecl gety(void);
- void _TGdecl graphdefaults(void);
- char * _TGdecl grapherrormsg(int __errorcode);
- /* void _TGdecl _graphfreemem(void far *__ptr, unsigned __size); */
- /* void far * _TGdecl _graphgetmem(unsigned __size); */
- int _TGdecl graphresult(void);
- unsigned _TGdecl imagesize(int __left, int __top, int __right, int __bottom);
- void _TGdecl initgraph(int far *__graphdriver,int far *__graphmode,const char far *__pathtodriver);
- int _TGdecl installuserdriver( const char far *__name,int ((*detect)(void)));
- int _TGdecl installuserfont( const char far *__name );
- void _TGdecl line(int __x1, int __y1, int __x2, int __y2);
- void _TGdecl linerel(int __dx, int __dy);
- void _TGdecl lineto(int __x, int __y);
- void _TGdecl moverel(int __dx, int __dy);
- void _TGdecl moveto(int __x, int __y);
- void _TGdecl outtext(const char far *__textstring);
- void _TGdecl outtextxy(int __x, int __y, const char far *__textstring);
- void _TGdecl pieslice(int __x, int __y, int __stangle, int __endangle,
- int __radius);
- void _TGdecl putimage(int __left, int __top, const void far *__bitmap,
- int __op);
- void _TGdecl putpixel(int __x, int __y, int __color);
- void _TGdecl rectangle(int __left, int __top, int __right, int __bottom);
- void _TGdecl restorecrtmode(void);
- void _TGdecl sector( int __X, int __Y, int __StAngle, int __EndAngle,
- int __XRadius, int __YRadius );
- void _TGdecl setactivepage(int __page);
- void _TGdecl setallpalette(const struct palettetype far *__palette);
- void _TGdecl setaspectratio( int __xasp, int __yasp );
- void _TGdecl setbkcolor(int __color);
- void _TGdecl setcolor(int __color);
- void _TGdecl setfillpattern(const char far *__upattern, int __color);
- void _TGdecl setfillstyle(int __pattern, int __color);
- unsigned _TGdecl setgraphbufsize(unsigned __bufsize);
- void _TGdecl setgraphmode(int __mode);
- void _TGdecl setlinestyle(int __linestyle, unsigned __upattern,
- int __thickness);
- void _TGdecl setpalette(int __colornum, int __color);
- void _TGdecl setrgbpalette(int __colornum,
- int __red, int __green, int __blue);
- void _TGdecl settextjustify(int __horiz, int __vert);
- void _TGdecl settextstyle(int __font, int __direction, int __charsize);
- void _TGdecl setusercharsize(int __multx, int __divx,
- int __multy, int __divy);
- void _TGdecl setviewport(int __left, int __top, int __right, int __bottom,
- int __clip);
- void _TGdecl setvisualpage(int __page);
- void _TGdecl setwritemode( int __mode );
- int _TGdecl textheight(const char far *__textstring);
- int _TGdecl textwidth(const char far *__textstring);
-
- /***** graphics drivers *****/
-
- int _TGdecl registerbgidriver(void (*driver)(void));
-
-
- /***** graphics fonts *****/
-
- int _TGdecl registerbgifont(void (*font)(void));
-
- /* !! These "functions" are NOT user-callable, !! */
- /* !! they are there just so you can link in fonts !! */
-
- void cdecl triplex_font(void);
- void cdecl small_font(void);
- void cdecl sansserif_font(void);
- void cdecl gothic_font(void);
-
- #ifdef __cplusplus
- }
- #endif
- #endif
- /* virtmem.h
-
- Defines structs and functions for dealing with the virtual Memory
- Manager.
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
- #ifndef __VIRTMEM_H
- #define __VIRTMEM_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- typedef int (*allocerror) (unsigned long heapsize);
-
- typedef struct freelistrec *freelistptr;
- typedef struct freelistrec {
- void far *orgptr;
- void far *endptr;
- } freelistrec;
-
- typedef struct ofsseg *segofs;
- typedef struct ofsseg {
- unsigned offset;
- unsigned segment;
- } ofsseg;
-
- #ifndef TGMK_FP
- #define TGMK_FP(seg,ofs) ((void far *) (((unsigned long)(seg) << 16) | (unsigned)(ofs)))
- #endif
-
- #define ORGPTR_FP(fp) ((freelistptr) (fp))->orgptr
- #define ENDPTR_FP(fp) ((freelistptr) (fp))->endptr
- #define OFFSET_FP(fp) ((segofs) &(fp))->offset
- #define SEGMENT_FP(fp) ((segofs) &(fp))->segment
- #define NORM_FP(fp) TGMK_FP(SEGMENT_FP(fp)+(OFFSET_FP(fp) >> 4),(OFFSET_FP(fp) & 0x000F))
- #define LINEAR_FP(fp) ((unsigned long) SEGMENT_FP(fp)<<4) + ((unsigned long) OFFSET_FP(fp))
- #define POINTER_FP(fp) TGMK_FP( (unsigned)((fp) >> 4),(unsigned)((fp) & 0x000F))
- #define PTRDIFF_FP(fp1,fp2) ((unsigned long) LINEAR_FP(fp1)) - ((unsigned long) LINEAR_FP(fp2))
-
-
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- extern void far * _TGType tfreeptr;
- extern void far *theaporg;
- extern void far *theapptr;
- extern unsigned freemin;
- extern unsigned long hugemin;
- extern unsigned long standardheapsize;
- extern allocerror hugeheaperror;
- extern allocerror virtmemerror;
- extern char heapmeminit;
- extern unsigned long upperheapsize;
-
- void _TGdecl setstandardheapsize(unsigned long heapsize);
- void _TGdecl reservehugeminimum(unsigned long minimumsize);
- void _TGdecl initteglheap(void);
-
- void far *_TGdecl cgetmem(unsigned long heapsize);
- unsigned long _TGdecl reservedmemavail(void);
- unsigned long _TGdecl reservedmaxavail(void);
- unsigned long _TGdecl cmaxavail(void);
- unsigned long _TGdecl cmemavail(void);
- void far *_TGdecl fgetmem(unsigned long heapsize);
- void _TGdecl cfreemem(void far * freeorgptr,unsigned long heapsize);
-
- #ifndef NOVIRT
- /*-----------------------------------------------------------------------*/
-
- typedef void (*errorproc) (int errcode);
- typedef char signate[5];
- typedef struct vdskfreerecord *vdskfreeptr;
- typedef struct vdskfilerecord *vdskfile;
- typedef struct emsblock *emsblockptr;
- typedef struct emsfilerec *emsfile;
-
- typedef struct emsblock {
- emsblockptr nextblockptr;
- unsigned handle; /* Multiple handles */
- unsigned emspage;/* Pages allocated */
- } emsblock;
-
- typedef struct emsfilerec {
- unsigned pageoffset; /* current offset within page */
- unsigned baseaddress;
- unsigned long emsposition;
- unsigned totalpages; /* Total number of 16k pages */
- emsblockptr rootblkptr;
- } emsfilerec;
-
- typedef struct vdskfreerecord {
- vdskfreeptr nextvdskfree;
- unsigned long startblock;
- unsigned long endblock;
- signate signature;
- char blockfree;
- } vdskfreerecord;
-
- typedef struct vdskblocksizerecord {
- unsigned long bsize;
- unsigned long realsize;
- signate signature;
- char blockfree;
- unsigned chksum;
- } vdskblocksizerecord;
-
- typedef struct vdskfilerecord {
- vdskfreeptr vdskfreeptrchain;
- unsigned long vdsktopoffile;
- unsigned vdskattribute;
- unsigned long vdskpacketsave;
- char *vdskfilename;
- char emstype;/* Selector */
- union v {
- int vdskheapfile;
- emsfile vemsheapfile;
- } v;
- } vdskfilerecord;
-
- #ifndef __VIRTSTRUC
- #define __VIRTSTRUC
- typedef struct virtualrec *virtualptr;
- typedef struct virtualrec {
- virtualptr nxtptr;
- virtualptr lstptr;
- unsigned long memorysize;
- char far *memoryptr;
- unsigned char memorylock;
- unsigned char memoryinuse;
- unsigned char memorypageout;
- unsigned long memorypageptr;
- void far **vpreferback;
- char far *vplastmemptr;
- unsigned char memorylevel;
- } virtualrec;
- #endif
-
- extern unsigned ems_status;
- extern unsigned vdskstatus;
- extern errorproc vdskerror;
- extern char virtualsound;
- extern char triedems;
- extern errorproc virtualerror;
- extern unsigned virtdskemsinitpages;
-
- #define virtsound(yesno) virtualsound = yesno
- #define useharddisk(yesno) triedems = yesno
- #define setvirtdskemsmax(maxsize) virtdskemsinitpages = maxsize
- #define vdskreadwrite 1
- #define vdsktemporary 2
-
- char _TGdecl emminstalled(void);
- unsigned _TGdecl emspagesavailable(unsigned * total_ems_pages,unsigned * pages_available);
- unsigned _TGdecl allocateexpandedmemorypages(unsigned pages_needed,unsigned * handle);
- unsigned _TGdecl mapexpandedmemorypages(unsigned handle,unsigned logical_page,unsigned physical_page);
- unsigned _TGdecl getpageframebaseaddress(unsigned * page_frame_address);
- unsigned _TGdecl deallocateexpandedmemorypages(unsigned handle);
- unsigned _TGdecl getversionnumber(char * version_string);
- unsigned _TGdecl gethandlecountused(unsigned * numberofhandles);
- unsigned _TGdecl getpagesownedbyhandle(unsigned handle,unsigned * pagesowned);
- emsfile _TGdecl emsopen(unsigned minimumpages);
- void _TGdecl emsseek(emsfile emsramfile,unsigned long position);
- void _TGdecl emsblockwrite(emsfile emsramfile,char *buffer,unsigned long bytestowrite);
- void _TGdecl emsblockread(emsfile emsramfile,char *buffer,unsigned long bytestoread);
- void _TGdecl emsclose(emsfile emsramfile);
- void _TGdecl movefromvirtual(char far * dataptr,unsigned long virtualheapptr);
- unsigned long _TGdecl movetovirtual(char far * dataptr,unsigned long heapsize);
- void _TGdecl freevirtual(unsigned long virtualheapptr);
- unsigned long _TGdecl vdskgetmem(vdskfile vdskpacket,unsigned long heapsize,char *signature);
- void _TGdecl vdskfreemem(vdskfile vdskpacket,unsigned long vdskheapptr);
- void _TGdecl vdskwriteheapdata(vdskfile vdskpacket,char far * dataptr,unsigned long vdskheapptr);
- void _TGdecl vdskreadheapdata(vdskfile vdskpacket,char far * dataptr,unsigned long vdskheapptr);
- void _TGdecl vdskcloseheapfile(vdskfile vdskpacket);
- vdskfile _TGdecl vdskopenheapfile(char *vdskfilename,unsigned vdskattribute);
- vdskfile _TGdecl vemsopenheapfile(int initialalloc);
- unsigned long _TGdecl virtualmemused(void);
-
- /*-----------------------------------------------------------------------*/
- #endif /* NOVIRT */
-
- void _TGdecl setstandardheapsize(unsigned long heapsize);
- void _TGdecl vpunlock(virtualptr vp);
- void _TGdecl vplock(virtualptr vp);
- unsigned char _TGdecl vmpageout(unsigned long memrequest);
- void _TGdecl vpuse(virtualptr vp);
- void _TGdecl vpaccess(virtualptr vp,void**rfptr);
- void _TGdecl vpgetmem(virtualptr * vp, unsigned long heapsize);
- void _TGdecl vpfreemem(virtualptr vp);
- void _TGdecl vppageout(virtualptr vp);
- void _TGdecl vppagein(virtualptr vp);
- void _TGdecl vpunuse(virtualptr vp);
- void _TGdecl vmsetlevel(unsigned char level);
- unsigned char _TGdecl vmgetlevel(void);
- void _TGdecl pushvplevel(void);
- void _TGdecl popvplevel(void);
- void _TGdecl monitorcheck(unsigned long rmax, unsigned long rmem, unsigned long moremem);
- void _TGdecl setmonitorthresholds(unsigned long rmax, unsigned long rmem, unsigned long moremem);
- int _TGdecl memoryshuffle(unsigned long size);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
- /* teglintr.h
-
- Defines structs and functions for dealing with system Interrupts.
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
- #ifndef __TEGLINTR_H
- #define __TEGLINTR_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- #ifndef __FASTGRPH_H
- #include <fastgrph.h>
- #endif
-
- typedef unsigned char (far *funccallproc)(void);
-
- typedef struct keyflags *keyrecptr;
- typedef struct keyflags {
- keyrecptr nextkeyflag;
- unsigned char repeatkey;
- unsigned keycode;
- funccallproc keycall;
- } keyflags;
-
- typedef struct timeflags *timerecptr;
- typedef struct timeflags {
- timerecptr nexttimeflag;
- unsigned timercount;
- unsigned timerstart;
- char timerflag;
- funccallproc timercall;
- } timeflags;
-
- #define sk_noshift 0x01
- #define sk_rightshift 0x01
- #define sk_leftshift 0x02
- #define sk_ctrlshift 0x04
- #define sk_altshift 0x08
- #define sk_scrolllock 0x10
- #define sk_numlock 0x20
- #define sk_capslock 0x40
- #define sk_inslock 0x80
- #define bios_data 0x40
-
- #define key_esc 0x01
- #define key_a 0x1E
- #define key_b 0x30
- #define key_c 0x2E
- #define key_d 0x20
- #define key_e 0x12
- #define key_f 0x21
- #define key_g 0x22
- #define key_h 0x23
- #define key_i 0x17
- #define key_j 0x24
- #define key_k 0x25
- #define key_l 0x26
- #define key_m 0x32
- #define key_n 0x31
- #define key_o 0x18
- #define key_p 0x19
- #define key_q 0x10
- #define key_r 0x13
- #define key_s 0x1F
- #define key_t 0x14
- #define key_u 0x16
- #define key_v 0x2F
- #define key_w 0x11
- #define key_x 0x2D
- #define key_y 0x15
- #define key_z 0x2C
-
- #define key_1 0x02
- #define key_2 0x03
- #define key_3 0x04
- #define key_4 0x05
- #define key_5 0x06
- #define key_6 0x07
- #define key_7 0x08
- #define key_8 0x09
- #define key_9 0x0A
- #define key_0 0x0B
-
- #define key_f1 0x3B
- #define key_f2 0x3C
- #define key_f3 0x3D
- #define key_f4 0x3E
- #define key_f5 0x3F
- #define key_f6 0x40
- #define key_f7 0x41
- #define key_f8 0x42
- #define key_f9 0x43
- #define key_f10 0x44
-
- #define key_space 0x39
- #define key_enter 0x1C
- #define key_tab 0x0F
- #define key_sysreq 0x54
- #define key_backspace 0x0E
- #define key_ins 0x52
- #define key_del 0x53
-
- #define key_home 0x47
- #define key_uparrow 0x48
- #define key_pgup 0x49
- #define key_leftarrow 0x4B
- #define key_rightarrow 0x4D
- #define key_downarrow 0x50
- #define key_end 0x4F
- #define key_pgdn 0x51
-
- #define key_numlock 0x45
- #define key_scrolllock 0x46
- #define key_ctrl 0x1D
- #define key_shift 0x2A
- #define key_alt 0x38
- #define key_capslock 0x3A
-
- #define key_minus 0x0C
- #define key_equal 0x0D
- #define key_period 0x34
- #define key_lbracket 0x1A
- #define key_rbracket 0x1B
- #define key_coma 0x33
- #define key_semi 0x27
- #define key_rquote 0x28
- #define key_lquote 0x29
- #define key_asterisk 0x37
- #define key_grayminus 0x4A
- #define key_center5 0x4C
- #define key_grayplus 0x4E
-
- #define key_backslash 0x2B
- #define key_forwslash 0x35
-
- extern char volatile scancodetable[128];
- extern char asciiscancode[128];
-
- extern unsigned char volatile timerignore;
- extern unsigned char volatile timerbusy;
- extern unsigned char controlbreakflag;
-
- extern unsigned char volatile far *kb_flag;
- extern unsigned char mouse_installed;
-
- extern unsigned volatile _TGType mouse_buttons;
- extern unsigned char volatile _TGType kbmousebusy;
- extern unsigned char _TGType mouseshow;
- extern int volatile _TGType mouse_xcoord;
- extern int volatile _TGType mouse_ycoord;
- extern unsigned volatile _TGType mouse_event;
- extern unsigned char volatile _TGType leftbuttondouble;
- extern unsigned volatile _TGType leftbuttontimerem;
- extern unsigned _TGType leftbuttonpress;
- extern unsigned _TGType leftpressxcoord;
- extern unsigned _TGType leftpressycoord;
- extern unsigned _TGType leftbuttonrelease;
- extern unsigned _TGType leftreleasexcoord;
- extern unsigned _TGType leftreleaseycoord;
- extern unsigned char volatile _TGType rightbuttondouble;
- extern unsigned volatile _TGType rightbuttontimerem;
- extern unsigned _TGType rightbuttonpress;
- extern unsigned _TGType rightpressxcoord;
- extern unsigned _TGType rightpressycoord;
- extern unsigned _TGType rightbuttonrelease;
- extern unsigned _TGType rightreleasexcoord;
- extern unsigned _TGType rightreleaseycoord;
- extern unsigned char volatile _TGType middlebuttondouble;
- extern unsigned volatile _TGType middlebuttontimerem;
- extern unsigned _TGType middlebuttonpress;
- extern unsigned _TGType middlepressxcoord;
- extern unsigned _TGType middlepressycoord;
- extern unsigned _TGType middlebuttonrelease;
- extern unsigned _TGType middlereleasexcoord;
- extern unsigned _TGType middlereleaseycoord;
- extern unsigned _TGType doubleclickspeed;
-
- extern masktype pointinghand;
- extern masktype hourglass;
- extern masktype standard;
- extern masktype diagcross;
- extern masktype checkmark;
- extern masktype maskcursor;
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
-
- unsigned char _TGdecl leftdoubleclick(void);
- unsigned char _TGdecl rightdoubleclick(void);
- unsigned char _TGdecl middledoubleclick(void);
- void _TGdecl setmousesensitivity(unsigned x_sense,unsigned y_sense,unsigned threshold);
- void _TGdecl getmousesensitivity(unsigned *x_sense,unsigned *y_sense,unsigned *threshold);
- void _TGdecl setmouseminmax(unsigned minx,unsigned miny,unsigned maxx,unsigned maxy);
- void _TGdecl showmouse(void);
- void _TGdecl hidemouse(void);
- void _TGdecl setmouseposition(unsigned mousex,unsigned mousey);
- void _TGType setmousepos(unsigned xpos,unsigned ypos);
- void _TGdecl cursorshape(void *shape);
- void _TGdecl setmousemask(void *shape, unsigned x, unsigned y);
- unsigned _TGdecl mouseposition(unsigned *mousex,unsigned *mousey);
- void _TGdecl setmousehotspot(unsigned x,unsigned y);
- void _TGdecl setmousecolor(unsigned color);
- void _TGdecl setkeyboardmouse(unsigned char on_off);
- void _TGdecl setkbsteps(unsigned xsteps,unsigned ysteps,unsigned sfxsteps,unsigned sfysteps);
- void _TGdecl getkbsteps(unsigned *xsteps,unsigned *ysteps,unsigned *sfxsteps,unsigned *sfysteps);
- void _TGdecl getbuttonreleaseinfo(unsigned button,unsigned *buttonstat,
- unsigned *buttonrelease,unsigned *xpos,unsigned *ypos);
- void _TGdecl getbuttonpressinfo(unsigned button,unsigned *buttonstat,
- unsigned *buttonpresses,unsigned *xpos,unsigned *ypos);
- void _TGdecl clearbuttoninfo(void);
- void _TGdecl frozenmouse(void);
- unsigned char _TGdecl freezemouse(unsigned x,unsigned y,unsigned x1,unsigned y1);
- void _TGdecl unfreezemouse(char mshow);
- void _TGdecl swaptimerout(void);
- void _TGdecl swaptimerin(void);
- void _TGdecl settimerstart(timerecptr *timepiece,unsigned timeset);
- void _TGdecl settimercallprocstart(timerecptr * timepiece, unsigned timeset, funccallproc timercallproc);
- void _TGdecl resettimerflag(timerecptr timepiece);
- void _TGdecl droptimercount(timerecptr timepiece);
- void _TGdecl timerswitch(unsigned char onoff);
- void _TGdecl swapteglintroff(void);
- void _TGdecl swapteglintron(void);
- unsigned _TGdecl teglreadkey(void);
- char _TGdecl teglkeypressed(void);
- void _TGdecl addcapturekey(unsigned keycode,unsigned char repeatkey,funccallproc keycall);
- void _TGdecl deletecapturekey(unsigned keycode);
- unsigned _TGdecl key(unsigned char shiftbits,unsigned char keycode);
- void _TGdecl setshiftkeys(unsigned char shiftflag,unsigned char onoff);
- void _TGdecl txtcursorpos(unsigned x1, unsigned y1);
- void _TGdecl txtcursoron(void);
- void _TGdecl txtcursoroff(void);
- void _TGdecl txtcursorstop(void);
- void _TGdecl txtcursorinit(unsigned x1, unsigned y1, unsigned x2, unsigned y2,
- unsigned blinktime, unsigned color, char * iconcursor);
- unsigned char _TGdecl txtcursorblink(void);
- void _TGdecl txtcursorresume(void);
- void _TGdecl txtcursorfreeze(void);
- void _TGdecl init_teglintr(void);
-
-
- unsigned _TGType initmouse(void);
- void _TGType mousereset(void);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
- /* iconsys.h
-
- Defines prototype constants for TEGL icons
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
- #ifndef __ICONSYS_H
- #define __ICONSYS_H
-
- extern unsigned char imageARROWLF[];
- extern unsigned char imageARROWDN[];
- extern unsigned char imageARROWRT[];
- extern unsigned char imageARROWUP[];
- extern unsigned char imageBAR[];
- extern unsigned char imageBELL[];
- extern unsigned char imageBELL2[];
- extern unsigned char imageBLANKBUT[];
- extern unsigned char imageBULB[];
- extern unsigned char imageC[];
- extern unsigned char imageCANCEL[];
- extern unsigned char imageCHK7X6[];
- extern unsigned char imageCHK8X10[];
- extern unsigned char imageCHK8X12[];
- extern unsigned char imageCHK8X8[];
- extern unsigned char imageCLOCK[];
- extern unsigned char imageCOMPUTER[];
- extern unsigned char imageCORNER[];
- extern unsigned char imageCORNER2[];
- extern unsigned char imageCORNER3[];
- extern unsigned char imageCREDITS[];
- extern unsigned char imageDISK[];
- extern unsigned char imageDISK35[];
- extern unsigned char imageDISKDRV[];
- extern unsigned char imageDOCUMENT[];
- extern unsigned char imageDOWN[];
- extern unsigned char imageDRAWER[];
- extern unsigned char imageFILE[];
- extern unsigned char imageFIND[];
- extern unsigned char imageKEYBOARD[];
- extern unsigned char imageKEYBRD2[];
- extern unsigned char imageLAST[];
- extern unsigned char imageLBUT[];
- extern unsigned char imageLEFT[];
- extern unsigned char imageMBUT[];
- extern unsigned char imageMC[];
- extern unsigned char imageMONITOR[];
- extern unsigned char imageMOUSE[];
- extern unsigned char imageMOUSE2[];
- extern unsigned char imageMUSIC[];
- extern unsigned char imageMUSIC2[];
- extern unsigned char imageNEXT[];
- extern unsigned char imageNOTE[];
- extern unsigned char imageNOTE2[];
- extern unsigned char imageOK[];
- extern unsigned char imagePREV[];
- extern unsigned char imagePRINTER[];
- extern unsigned char imageQUESTN2[];
- extern unsigned char imageR[];
- extern unsigned char imageRBUT[];
- extern unsigned char imageREAD[];
- extern unsigned char imageRESIZE[];
- extern unsigned char imageRIGHT[];
- extern unsigned char imageSLIDER[];
- extern unsigned char imageSLIDER2[];
- extern unsigned char imageSTOPSIGN[];
- extern unsigned char imageSUBMENU[];
- extern unsigned char imageSYSTEM[];
- extern unsigned char imageTIGER[];
- extern unsigned char imageTINYTEGL[];
- extern unsigned char imageTRASH[];
- extern unsigned char imageUP[];
- extern unsigned char imageVS[];
- extern unsigned char imageWFDN[];
- extern unsigned char imageWFUP[];
- extern unsigned char imageWFICON[];
- extern unsigned char imageWFLF[];
- extern unsigned char imageWFRT[];
- extern unsigned char imageWFUD[];
- extern unsigned char imageWFBAR[];
- extern unsigned char imageWRITE[];
- extern unsigned char imageWFMDN[];
-
- #endif
- /* fontsys.h
-
- declaration for TEGL fonts
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- #ifndef __FONTSYS_H
- #define __FONTSYS_H
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #ifdef __TSC__
- void far antiqu25(void);
- void far apls7(void);
- void far bigsf25(void);
- void far block25(void);
- void far brdwx19(void);
- void far broadway(void);
- void far bway25(void);
- void far countdwn(void);
- void far cour25(void);
- void far defa25(void);
- void far ega09(void);
- void far f5x6norm(void);
- void far f6x6norm(void);
- void far f7x7bold(void);
- void far f7x7norm(void);
- void far f8x12bol(void);
- void far f8x12nor(void);
- void far f8x8bold(void);
- void far f8x8ital(void);
- void far f8x8norm(void);
- void far font07(void);
- void far font07cp(void);
- void far font09(void);
- void far font14(void);
- void far fraktur(void);
- void far fresn25(void);
- void far future(void);
- void far gaelic(void);
- void far georgian(void);
- void far italic(void);
- void far kids25(void);
- void far lcdfont(void);
- void far light14(void);
- void far light9(void);
- void far litalic(void);
- void far m3270(void);
- void far normss25(void);
- void far ocr(void);
- void far oenglish(void);
- void far pc24(void);
- void far pc3270(void);
- void far pc9(void);
- void far roman25(void);
- void far sansx19(void);
- void far script(void);
- void far script2(void);
- void far thin25(void);
- void far wndwx19(void);
- #else
- void far cdecl antiqu25(void);
- void far cdecl apls7(void);
- void far cdecl bigsf25(void);
- void far cdecl block25(void);
- void far cdecl brdwx19(void);
- void far cdecl broadway(void);
- void far cdecl bway25(void);
- void far cdecl countdwn(void);
- void far cdecl cour25(void);
- void far cdecl defa25(void);
- void far cdecl ega09(void);
- void far cdecl f5x6norm(void);
- void far cdecl f6x6norm(void);
- void far cdecl f7x7bold(void);
- void far cdecl f7x7norm(void);
- void far cdecl f8x12bol(void);
- void far cdecl f8x12nor(void);
- void far cdecl f8x8bold(void);
- void far cdecl f8x8ital(void);
- void far cdecl f8x8norm(void);
- void far cdecl font07(void);
- void far cdecl font07cp(void);
- void far cdecl font09(void);
- void far cdecl font14(void);
- void far cdecl fraktur(void);
- void far cdecl fresn25(void);
- void far cdecl future(void);
- void far cdecl gaelic(void);
- void far cdecl georgian(void);
- void far cdecl italic(void);
- void far cdecl kids25(void);
- void far cdecl lcdfont(void);
- void far cdecl light14(void);
- void far cdecl light9(void);
- void far cdecl litalic(void);
- void far cdecl m3270(void);
- void far cdecl normss25(void);
- void far cdecl ocr(void);
- void far cdecl oenglish(void);
- void far cdecl pc24(void);
- void far cdecl pc3270(void);
- void far cdecl pc9(void);
- void far cdecl roman25(void);
- void far cdecl sansx19(void);
- void far cdecl script(void);
- void far cdecl script2(void);
- void far cdecl thin25(void);
- void far cdecl wndwx19(void);
- #endif
-
- #ifdef __cplusplus
- }
- #endif
- #endif
- /* ipstacks.h
-
- Defines structs and functions for the image partial core routines
-
- Copyright (c) TEGL Systems Corporation 1989,1990,1991
- All Rights Reserved.
- */
-
- #ifndef __IPSTACKS_H
- #define __IPSTACKS_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- #ifndef __VIRTMEM_H
- #include <VIRTMEM.H>
- #endif
-
- typedef struct imageslice *imagepartial;
- typedef struct imageslice {
- imagepartial nxtptr;
- imagepartial lstptr;
- imagepartial nxtip; /* chained IP image */
- unsigned x, y, x1, y1;
- unsigned long imagesize;
- virtualptr imagesave;
- unsigned char imageactive;
- unsigned mouseshow;
- imagepartial partialstack;
- unsigned char prepareupdate;
- unsigned preparecount;
- } imageslice;
-
- extern imagepartial ipstack;
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- void _TGdecl ipcreatepartial(imagepartial *ip,unsigned x,unsigned y,unsigned x1,unsigned y1);
- void _TGdecl ipcreateemptypartial(imagepartial *ip,unsigned x,unsigned y,unsigned x1,unsigned y1);
- void _TGdecl iplink(imagepartial nip,imagepartial cip);
- void _TGdecl iplinkunder(imagepartial nip,imagepartial cip);
- void _TGdecl ippushimage(unsigned x,unsigned y,unsigned x1,unsigned y1);
- void _TGdecl ippopimage(void);
- void _TGdecl ipsetcoord(imagepartial ip,unsigned x1,unsigned y1,unsigned x2,unsigned y2);
- void _TGdecl ipunlink(imagepartial cip);
- void _TGdecl ipinsert(imagepartial ip,unsigned x,unsigned y,unsigned x1,unsigned y1);
- imagepartial _TGdecl ipstackpartials(imagepartial ip,unsigned x,unsigned y,unsigned x1,unsigned y1);
- void _TGdecl ipmerge(imagepartial tp1,imagepartial tp2,unsigned x,unsigned y,unsigned x1,unsigned y1);
- void _TGdecl ipputpartial(imagepartial ip,unsigned x,unsigned y,unsigned x1,unsigned y1);
- void _TGdecl ippreparepartial(imagepartial ip,unsigned x,unsigned y,unsigned x1,unsigned y1);
- void _TGdecl ipprepareupdate(imagepartial ip);
- void _TGdecl ipgetpartial(imagepartial ip,unsigned x,unsigned y,unsigned x1,unsigned y1);
- void _TGdecl ipcommitupdate(void);
- void _TGdecl ipcommitimg(imagepartial lstptr,imagepartial tp);
- void _TGdecl iprotate(imagepartial ip1,imagepartial ip2);
- void _TGdecl iprotateunder(imagepartial ip1,imagepartial ip2);
- void _TGdecl ipmoveimage(imagepartial ip,unsigned x,unsigned y);
- void _TGdecl ipdropimage(imagepartial ip);
- void _TGdecl ipfreebuffers(imagepartial ip);
- void _TGdecl ipdroppartial(imagepartial ip);
- imagepartial _TGdecl ippreppartial(imagepartial ip,imagepartial tp,unsigned x,unsigned y,unsigned x1,unsigned y1);
- imagepartial _TGdecl ipprepupdate(imagepartial ip,imagepartial tp);
- imagepartial _TGdecl ipgetpartialfront(imagepartial ip,unsigned x,unsigned y,unsigned x1,unsigned y1);
- imagepartial _TGdecl ipgetfront(imagepartial ip);
- void _TGdecl iphideimage(imagepartial ip);
- void _TGdecl ipshowimage(imagepartial ip,unsigned x,unsigned y);
- void _TGdecl ipgetimage(unsigned x,unsigned y,imagepartial ip);
- void _TGdecl ipputimage(unsigned x,unsigned y,imagepartial ip,unsigned rmwbits);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
- /* teglunit.h
-
- Defines structs and functions for TEGL core routines
-
- Copyright (c) TEGL Systems Corporation 1989,1990,1991
- All Rights Reserved.
- */
-
- #ifndef __TEGLUNIT_H
- #define __TEGLUNIT_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- #define MSSENSE TRUE
- #define MSCLICK FALSE
-
- #ifndef __TEGLINTR_H
- #include <TEGLINTR.H>
- #endif
- #ifndef __IPSTACKS_H
- #include <IPSTACKS.H>
- #endif
-
- /*
- * The four pointers below provides the total integration of TEGL, of which
- * the ImageStkPtr is the main structure that ties everything together. The
- * hierarchy is such that the MsClickPtrs and KeyClickPtrs are pointer
- * chained within an Imagestkptr.
- */
-
- #define nilunitproc NULL
- #define nildataproc NULL
-
- typedef struct imagestack *imagestkptr;
- typedef struct timetickstk far *timetickptr;
- typedef struct keyclickstk far *keyclickptr;
- typedef struct msclickstk far *msclickptr;
-
- typedef unsigned (far *callproc)(imagestkptr,msclickptr);
- typedef struct xyx1y1rec { unsigned x,y,x1,y1; } xyx1y1rec;
- typedef unsigned (far *dataproc)(imagestkptr,unsigned,void *);
-
- typedef struct timetickstk {
- timetickptr nexttimetick; /* chain of timer tick events */
- timerecptr timepiece; /* timer counter, flag */
- unsigned long signature; /* signature for dropping timer ticks */
- callproc entrycallproc; /* timer event - when flag is true */
- imagestkptr fs; /* related fs/ms for event */
- msclickptr ms;
- } timetickstk;
-
- typedef struct keyclickstk {
- keyclickptr nextkeyclick; /* chain of keyboard click areas */
- unsigned keycode; /* scancode for capturing */
- callproc entrycallproc; /* event for scancode activation */
- imagestkptr fs; /* related fs/ms for event */
- msclickptr ms;
- } keyclickstk;
-
- typedef struct msclickstk {
- msclickptr nextmsclick; /* mouse click chains */
- unsigned clicknumber; /* assignable key for mouse click */
- xyx1y1rec ms; /* mouse x,y,x1,y1 region */
- unsigned char msactive; /* sets inactive mode of mouse */
- callproc entrycallproc; /* normal mouse click call event */
- unsigned char senseactivate; /* true-sense,false-mouse click */
- unsigned char sensehighlight; /* enables supervisor to auto */
- /* highlight a mouse click area */
-
- unsigned mousebuttons; /* Defines the active mouse button */
- /* 2-right mouse button */
-
- callproc doublecallproc; /* double click event */
-
- maskptr mousemask; /* autochanging of mouse mask */
- unsigned xhotspot; /* mouse hot spot of mouse mask */
- unsigned yhotspot;
- imagepartial ipptr; /* Mouse click image partials */
- /* used in sliders and pop-off buttons */
- } msclickstk;
-
- typedef struct framechange *framechangeptr;
- typedef struct framechange {
- callproc frameenter; /* Frame Enter Event */
- callproc frameexit; /* Frame Exit Event */
- maskptr entermask; /* Enter frame Mouse Mask */
- unsigned xehs, yehs; /* Enter frame Mouse Hotspots */
- maskptr exitmask; /* Exit frame Mouse Mask */
- unsigned xxhs, yxhs; /* Exit frame Mouse Hotspots */
- } framechange;
-
- typedef struct userrecord *userrecptr;
- typedef struct userrecord {
- userrecptr nxtuserptr; /* user data area chains */
- unsigned userkey; /* user assigned key for retrieving data */
- void far *userdataarea; /* pointer to userdata */
- dataproc userterminate; /* terminating call event */
- } userrecord;
-
- typedef struct pendrecord *pendingptr;
- typedef struct pendrecord {
- pendingptr nxtpendptr; /* pending event chains */
- callproc pendcallproc; /* pending call proc */
- imagestkptr pendingfs; /* pending matching FS */
- unsigned char pendingclose; /* ignore close pending if false */
- } pendrecord;
-
- typedef struct moverecord *moveptr;
- typedef struct moverecord {
- moveptr nxtmove;
- callproc movecallproc; /* a user definable event when frame is
- * {moved */
- } moverecord;
-
- typedef struct imagestack {
- imagestkptr nxtptr; /* forward chain of Frames */
- imagestkptr lstptr; /* backward chain for frame stack */
- unsigned long signature; /* time code signature */
- unsigned frameactive; /* set by resetframeactive for locking */
- /* events from occuring */
- unsigned x, y, x1, y1; /* frame coordinates */
- unsigned char movable; /* flag indicating mobility of frame */
- moveptr movecallproc; /* move event chain */
- char *iconframe; /* icon for putpict when moving frame */
- unsigned iconcolor; /* icon color */
- unsigned char emptyframe; /* flag indicating empty frame */
- unsigned char autorotate; /* indicator if frame can be rotated up */
- xyx1y1rec restrictmovef; /* move area restriction */
- xyx1y1rec minmaxstretch; /* minimum/maximum resize */
- callproc resizecallproc; /* required event for re-drawing frame */
- /* after frame has been re-sized */
- unsigned char imageactive; /* frame hiding/showing flag */
- imagestkptr relatedstack; /* related fs for use in Menus and explodes */
- msclickptr relatedmsclick; /* related ms for use in Menus and explodes */
- unsigned long relatedsignate; /* related signature for validating Menus */
- imagestkptr chainedstack; /* chained fs sub menu */
- msclickptr chainedmsclick; /* chained ms sub menu */
- imagepartial ipptr; /* image partial chain */
- imagepartial iptop; /* image partial top of chain */
- keyclickptr keyptr; /* key chain for local keyclicks */
- msclickptr msptr; /* ms chain for mouse click areas */
- unsigned msclickcount; /* ms clicks counts */
- framechangeptr fschangeptr; /* frame enter/exit events */
- userrecptr userdataptr; /* user data chain */
- } imagestack;
-
-
- extern imagestkptr stackptr;
- extern keyclickptr keystackptr;
- extern timetickptr timestackptr;
- extern unsigned functionkeycode;
- extern unsigned char autorotateup;
- extern callproc ctrlbreakproc;
- extern unsigned long maxwindowsize;
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /*
- * *------------------------------------------------------------------------*
- * | Image Stack routines |
- * *------------------------------------------------------------------------*
- */
-
- unsigned char _TGdecl frameexist(imagestkptr fs);
- unsigned _TGdecl countframes(void);
- void _TGdecl pushimage(unsigned x,unsigned y,unsigned x1,unsigned y1);
- void _TGdecl pushemptyimage(unsigned x,unsigned y,unsigned x1,unsigned y1);
- void _TGdecl popimage(void);
- void _TGdecl prepareforpartialupdate(imagestkptr fs,unsigned x,
- unsigned y,unsigned x1,unsigned y1);
- void _TGdecl prepareforupdate(imagestkptr fs);
- void _TGdecl commitupdate(void);
- void _TGdecl setframeautorotate(imagestkptr fs,unsigned char autorotate);
- void _TGdecl rotatestackimage(imagestkptr fs1,imagestkptr fs2);
- void _TGdecl rotateunderstackimage(imagestkptr fs1,imagestkptr fs2);
- void _TGdecl moveframe(int *fx,int *fy,int *fx1,int *fy1,
- int rx,int ry,int rx1,int ry1,int color);
- imagestkptr _TGdecl frameselectandmove(unsigned mxpos,unsigned mypos);
- unsigned _TGdecl selectandmoveframe(imagestkptr fs,msclickptr mouseclickpos);
- void _TGdecl setmoverestrictions(imagestkptr fs,unsigned x,unsigned y,
- unsigned x1,unsigned y1);
- void _TGdecl setframemobility(imagestkptr fs,unsigned char movable);
- void _TGdecl dropmoveframecallproc(imagestkptr fs,callproc entrycallproc);
- void _TGdecl setmoveframecallproc(imagestkptr fs,callproc entrycallproc);
- void _TGdecl linkfs(imagestkptr nfs,imagestkptr cfs);
- void _TGdecl linkunderfs(imagestkptr nfs,imagestkptr cfs);
- void _TGdecl unlinkfs(imagestkptr fs);
- void _TGdecl hideimage(imagestkptr fs);
- void _TGdecl showimage(imagestkptr fs,unsigned x,unsigned y);
- void _TGdecl movestackimage(imagestkptr fs,unsigned x,unsigned y);
- void _TGdecl dropstackimage(imagestkptr fs);
- void _TGdecl createimagebuffer(imagestkptr *fs,unsigned x,unsigned y,
- unsigned x1,unsigned y1);
- void _TGdecl dropimagebuffer(imagestkptr fs);
- void _TGdecl freeimagebuffer(imagestkptr fs);
- imagestkptr _TGdecl getfrontimage(imagestkptr fs);
- imagestkptr _TGdecl getpartialfrontimage(imagestkptr fs,unsigned x,unsigned y,
- unsigned x1,unsigned y1);
- imagestkptr _TGdecl getpartialbackimage(imagestkptr fs,unsigned x,unsigned y,
- unsigned x1,unsigned y1);
- imagestkptr _TGdecl getbackimage(imagestkptr fs);
- void _TGdecl getfsimage(unsigned x,unsigned y,imagestkptr fs);
- void _TGdecl putfsimage(unsigned x,unsigned y,imagestkptr fs,unsigned rmwbits);
- imagepartial _TGdecl sliceimagepartials(imagepartial lastip,unsigned x,unsigned y,
- unsigned x1,unsigned y1);
- void _TGdecl resizeframe(imagestkptr fs,unsigned x,unsigned y,unsigned x1,unsigned y1);
- void _TGdecl setimageactive(imagestkptr fs,unsigned char imageactive);
- void _TGdecl setframeentercallproc(imagestkptr fs,callproc entrycallproc);
- void _TGdecl setframeexitcallproc(imagestkptr fs,callproc entrycallproc);
- unsigned char _TGdecl changeuserdatakey(imagestkptr fs,unsigned userkey,unsigned newkey);
- void _TGdecl getuserdataarea(imagestkptr fs,unsigned userkey,void *userdata);
- void _TGdecl setuserdataarea(imagestkptr fs,unsigned userkey,void *userdata,
- dataproc terminatedataproc);
- void _TGdecl dropuserdataareas(imagestkptr fs,dataproc terminatedataproc);
- void _TGdecl dropuserdatabykey(imagestkptr fs,unsigned userkey);
- void _TGdecl dropuserdataarea(imagestkptr fs,userrecptr ud);
- userrecptr _TGdecl getfirstuserdataarea(imagestkptr fs,dataproc terminatedataproc,void *userdata);
- userrecptr _TGdecl getnextuserdataarea(userrecptr ud,void *userdata);
- void _TGdecl setenterexitmousemask(imagestkptr fs,maskptr entermask,unsigned xehs,
- unsigned yehs,maskptr exitmask,unsigned xxhs,unsigned yxhs);
- void _TGdecl setstandardmousemask(maskptr mousemask,unsigned xhotspot,unsigned yhotspot);
- void _TGdecl setfsipcoords(imagestkptr fs,unsigned x,unsigned y);
- unsigned char _TGdecl framesoverlapped(imagestkptr fs1,imagestkptr fs2);
-
- /*
- * *------------------------------------------------------------------------*
- * | Utility Routines |
- * *------------------------------------------------------------------------*
- */
-
- void _TGdecl clearkeyboardbuf(void);
- void _TGdecl clearteglkeyboardbuf(void);
- void _TGdecl setautorotate(unsigned char onoff);
- unsigned char _TGdecl userrelease(void);
- void _TGdecl waitforuserrelease(void);
-
- /*
- * *------------------------------------------------------------------------*
- * | Find Mouse Screen positions |
- * *------------------------------------------------------------------------*
- */
-
- imagestkptr _TGdecl findframe(unsigned mxpos,unsigned mypos);
- void _TGdecl resetframeactive(imagestkptr fs,unsigned char active);
-
- /*
- * *------------------------------------------------------------------------*
- * | Mouse Click defines |
- * *------------------------------------------------------------------------*
- */
-
- msclickptr _TGdecl findmouseclickptr(imagestkptr fs,unsigned clicknumber);
- unsigned char _TGdecl mouseclickexist(imagestkptr fs,msclickptr ms);
- void _TGdecl resetmouseclicks(imagestkptr fs,msclickptr clickptr);
- void _TGdecl resetmsclicksense(imagestkptr fs,unsigned char newsense);
- void _TGdecl resetmsclickcallproc(imagestkptr fs,unsigned mouseclicknumber,
- callproc entrycallproc);
- void _TGdecl resetmsclickactive(imagestkptr fs,unsigned mouseclicknumber,
- unsigned char active);
- void _TGdecl definemouseclickarea(imagestkptr fs,unsigned x,
- unsigned y,unsigned x1,unsigned y1,unsigned char active,
- callproc entrycallproc,unsigned char sense);
- void _TGdecl dropmouseclick(imagestkptr fs,msclickptr ms);
- msclickptr _TGdecl checkmouseclickpos(imagestkptr fs,unsigned mxpos,
- unsigned mypos);
- void _TGdecl resetmsassignmentnum(imagestkptr fs,unsigned startcount);
- void _TGdecl assignmouseclicknumber(imagestkptr fs,msclickptr ms,
- unsigned clicknumber);
- msclickptr _TGdecl getlastmsptr(imagestkptr fs);
- void _TGdecl addmouseclickmask(msclickptr ms,maskptr mousemask,
- unsigned xhs,unsigned yhs);
- void _TGdecl definemaskclickarea(imagestkptr fs,unsigned x,unsigned y,
- unsigned x1,unsigned y1,unsigned char active,
- callproc entrycallproc,unsigned char sense,
- maskptr mousemask,unsigned xhs,unsigned yhs);
- void _TGdecl adddoubleclickcallproc(msclickptr ms,callproc doublecallproc);
- void _TGdecl definedoubleclickarea(imagestkptr fs,unsigned x,
- unsigned y,unsigned x1,unsigned y1,unsigned char active,
- callproc entrycallproc,callproc doublecallproc,
- unsigned char sense);
- void _TGdecl setmssensehighlight(msclickptr ms,unsigned char autohighlight);
- void _TGdecl setmousebutton(msclickptr ms,unsigned mousebutton);
- void _TGdecl defineiconframe(unsigned x,unsigned y,char *iconimage,
- unsigned iconcolor,unsigned char active,
- callproc entrycallproc,unsigned char sense);
- /*
- * *------------------------------------------------------------------------*
- * | Key Click defines |
- * *------------------------------------------------------------------------*
- */
-
- void _TGdecl defineglobalkeyclickarea(imagestkptr fs,msclickptr ms,
- unsigned keycode,unsigned char repeatkey,callproc entrycallproc);
- void _TGdecl definelocalkeyclickarea(imagestkptr fs,msclickptr ms,
- unsigned keycode,unsigned char repeatkey,callproc entrycallproc);
- keyclickptr _TGdecl findkeyclickptr(imagestkptr fs,unsigned keycode);
- void _TGdecl dropkeyclick(imagestkptr fs,unsigned keycode,callproc entrycallproc);
- void _TGdecl resetkeyclickcallproc(imagestkptr fs,unsigned keycode,
- callproc entrycallproc);
- void _TGdecl resetlocalkeyclicks(imagestkptr fs);
-
- /*
- * *------------------------------------------------------------------------*
- * | Supervisor Loop |
- * *------------------------------------------------------------------------*
- */
-
- void _TGdecl toggleoptionbar(imagestkptr fs,msclickptr opt,msclickptr lastopt);
- unsigned _TGdecl eventmanager(imagestkptr fs,msclickptr ms);
- void _TGdecl setpendingevent(imagestkptr fs,callproc pendcallproc);
- void _TGdecl resetpendingcallproc(imagestkptr fs,callproc pendcallproc);
- void _TGdecl setpendingclose(imagestkptr fs,unsigned char pendingclose);
- unsigned _TGdecl getfsms(imagestkptr * fs,msclickptr * ms);
-
- /*
- * *------------------------------------------------------------------------*
- * | Chain functions |
- * *------------------------------------------------------------------------*
- */
-
- void _TGdecl checkctrlbreak(void);
- void _TGdecl setctrlbreakfs(callproc cbrkproc);
- void _TGdecl settimertick(unsigned timerinterrupt,
- callproc entrycallproc,imagestkptr fs,msclickptr ms);
- void _TGdecl droptimertick(unsigned timerinterrupt,callproc entrycallproc);
-
- #ifdef __cplusplus
- }
- #endif
- #endif
- /* teglgrph.h
-
- Combined modules of TEGLEASY, TEGLGRPH and TEGLINIT.
- Central generalize TEGL Startup routines.
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
- #ifndef __TEGLGRPH_H
- #define __TEGLGRPH_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- #ifndef __TEGLUNIT_H
- #include <teglunit.h>
- #endif
-
- typedef struct teglconstants {
- unsigned teglbackcolor;
- unsigned teglbordercolor;
- unsigned char teglbackpattern[8];
- unsigned char teglbordershow;
- unsigned char tegluserpattern;
- unsigned teglfillstyle;
- unsigned shadowcolor;
- unsigned shadowbordercolor;
- unsigned char shadowfillpattern[8];
- unsigned char shadowuserpattern;
- unsigned shadowfillstyle;
- fontptr shadowtexttype;
- unsigned char defaulttexthighlight;
- unsigned defaulttexthcolor;
- unsigned defaulttextscolor;
- unsigned char shadowtextmode;
- unsigned extendtexthcolor;
- unsigned extendtextscolor;
- unsigned extendtextcolor;
- unsigned shifttextcolor;
- unsigned shifttextscolor;
- unsigned zipduration;
- } teglconstants;
-
- extern teglconstants tg;
- extern teglconstants herc_tg;
- extern fontptr standardfont;
- extern unsigned char beepstatus;
- extern unsigned beepdivisor;
- extern unsigned char gridfill[];
- extern unsigned char bwtranslatetable[];
- extern unsigned char c256translatetable[];
-
- #define setshadowfillpattern(bp) memcpy(tg.shadowfillpattern,bp,sizeof(tg.shadowfillpattern)); tg.shadowuserpattern=TRUE
- #define setteglfillpattern(bp) memcpy(tg.teglbackpattern,bp,sizeof(tg.teglbackpattern)); tg.tegluserpattern = TRUE
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- void _TGdecl activebutton(unsigned x,unsigned y,char *s,callproc p);
- int _TGdecl coltox(int col);
- void _TGdecl errmess(unsigned x,unsigned y,char *s);
- void _TGdecl fitframe(unsigned *x,unsigned *y,unsigned *width,unsigned *height);
- void _TGdecl framefromicon(imagestkptr ifs,msclickptr ms,
- unsigned x,unsigned y,unsigned x1,unsigned y1);
- void _TGdecl frametext(imagestkptr ifs,int row,int col,char *s);
- unsigned _TGdecl getmousey(imagestkptr ifs);
- unsigned char _TGdecl getyesno(unsigned x,unsigned y,char *s);
- void _TGdecl easytegl(void);
- void _TGdecl easyout(void);
- unsigned _TGdecl quit(imagestkptr frame,msclickptr mouseclickpos);
- void _TGdecl quickframe(imagestkptr *ifs,unsigned *x,unsigned *y,
- unsigned *width,unsigned *height);
- void _TGdecl outframetextxy(imagestkptr ifs,unsigned x,unsigned y,char *s);
- void _TGdecl restoretext(void);
- int _TGdecl rowtoy(int row);
- int _TGdecl lastcol(imagestkptr ifs);
- int _TGdecl lastrow(imagestkptr ifs);
- void _TGdecl selecteasytext(void);
- void _TGdecl seteasyfont(fontptr p);
-
- void _TGdecl setshadowcolor(unsigned bcolor);
- void _TGdecl setshadowbordercolor(unsigned bcolor);
- void _TGdecl setshadowfillstyle(unsigned pattern);
- void _TGdecl shadowbox(unsigned x,unsigned y,unsigned x1,unsigned y1);
- void _TGdecl shadowtext(unsigned x,unsigned y,unsigned color,char *textstr);
- void _TGdecl setshadowtexttype(fontptr texttype);
- void _TGdecl setshadowtextshadow(unsigned color);
- void _TGdecl setshadowtexthighlight(unsigned color);
- void _TGdecl shadowtexthighlightoff(void);
- void _TGdecl setshadowtextmode(unsigned char modeonoff);
- void _TGdecl shadowboxtext(unsigned x,unsigned y,unsigned txtlen,char *textstr);
- void _TGdecl setextendtexthighlight(unsigned color);
- void _TGdecl setextendtextshadow(unsigned color);
- void _TGdecl setextendtextcolor(unsigned color);
- void _TGdecl extendtextxy(unsigned x,unsigned y,char *msg);
- void _TGdecl shifttextxy(unsigned x,unsigned y,char *msg);
-
- void _TGdecl setteglbordershow(unsigned char bordershow);
- void _TGdecl setteglbackcolor(unsigned backcolor);
- void _TGdecl setteglbordercolor(unsigned bordercolor);
- void _TGdecl setteglfillstyle(unsigned pattern);
- void _TGdecl clearteglscreen(void);
-
- void _TGdecl movebox(int ax,int ay,int x,int y,int x1,int y1);
- void _TGdecl ziptobox(int ax,int ay,int ax1,int ay1,int x,int y,int x1,int y1);
- void _TGdecl zipfrombox(int ax,int ay,int ax1,int ay1,int x,int y,int x1,int y1);
-
- void _TGdecl explodefromiconhide(imagestkptr frame,msclickptr mouseclickpos,
- unsigned x,unsigned y,unsigned x1,unsigned y1);
- void _TGdecl explodefrommsclick(imagestkptr frame,msclickptr mouseclickpos,
- unsigned x,unsigned y,unsigned x1,unsigned y1);
- unsigned _TGdecl collapsetomsclick(imagestkptr fs,msclickptr mouseclickpos);
- unsigned _TGdecl collapsetoiconshow(imagestkptr fs,msclickptr mouseclickpos);
-
- void _TGdecl pressbutton(imagestkptr fs,msclickptr ms);
- void _TGdecl releasebutton(imagestkptr fs,msclickptr ms);
- unsigned char _TGdecl visualbuttonpress(imagestkptr fs,msclickptr ms);
- msclickptr _TGdecl checkformouseselect(imagestkptr frame);
- void _TGdecl presssquarebutton(imagestkptr fs,msclickptr ms);
- void _TGdecl releasesquarebutton(imagestkptr fs,msclickptr ms);
- unsigned char _TGdecl visualsquarebuttonpress(imagestkptr fs,msclickptr ms);
- void _TGdecl drawsquarebutton(unsigned x1,unsigned y1,unsigned x2,unsigned y2);
- void _TGdecl definesquarebuttonclick(imagestkptr fs,unsigned x,unsigned y,
- unsigned x1,unsigned y1,unsigned rx,unsigned ry,
- char *button,callproc entrycallproc);
- void _TGdecl shifttext(unsigned x,unsigned y,unsigned c,unsigned s,char *msg);
- void _TGdecl definesquarebuttontext(imagestkptr fs,unsigned x,unsigned y,
- unsigned x1,unsigned y1,unsigned rx,unsigned ry,
- char *msg,callproc entrycallproc);
- void _TGdecl bevelbox(unsigned x,unsigned y,unsigned x1,unsigned y1,
- unsigned topcolor,unsigned botcolor,
- unsigned interior,unsigned thickness);
- void _TGdecl bevelboxfs(imagestkptr fs,unsigned x,unsigned y,unsigned x1,
- unsigned y1,unsigned topcolor,unsigned botcolor,
- unsigned interior,unsigned thickness);
- void _TGdecl drawlongbutton(unsigned x,unsigned y,unsigned ln);
- void _TGdecl putuserbuttonclick(imagestkptr fs,unsigned x,unsigned y,char *msg);
- void _TGdecl definebuttonclick(imagestkptr fs,unsigned x,unsigned y,
- char *button,callproc entrycallproc);
- void _TGdecl definelongbuttonclick(imagestkptr fs,unsigned x,unsigned y,
- unsigned ln,char *msg,callproc entrycallproc);
- void _TGdecl defineuserbuttonclick(imagestkptr fs,unsigned x,unsigned y,
- char *msg,callproc entrycallproc);
- void _TGdecl beep(int tone,int n,int duration);
- void _TGdecl slidebeep(int tone1,int tone2,int n);
- void _TGdecl soundswitch(unsigned char onoff);
- void _TGdecl flipapage(void);
- void _TGdecl flipvpage(void);
- void _TGdecl setapage(unsigned pagenum);
- void _TGdecl setvpage(unsigned pagenum);
- unsigned char _TGdecl videopage(void);
- void _TGdecl outtegltextxy(int x,int y,char *mystr);
- void _TGdecl fmttegltextxy(int x, int y, char *format,...);
- unsigned char _TGdecl crclickpress(void);
- unsigned char _TGdecl crclickrelease(void);
- void _TGdecl teglinit(char *videomodename,unsigned long hugeminimum);
- void _TGdecl teglsupervisor(void);
-
-
-
- #ifdef __cplusplus
- }
- #endif
- #endif
-
- /* tegledit.h
-
- Defines structs and functions for TEGL Edit routines
-
- Copyright (c) TEGL Systems Corporation 1989,1990,1991
- All Rights Reserved.
- */
-
- #ifndef __TEGLEDIT_H
- #define __TEGLEDIT_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- typedef unsigned char (far *acceptch)(char);
- typedef unsigned char (far *formatstr)(char *);
-
- typedef struct serec *septr;
- typedef struct serec {
- unsigned cpos;
- char *txtstr;
- unsigned maxlen;
- unsigned tcursx;
- unsigned tcursy;
- fontptr font;
- unsigned char prop;
- unsigned color;
- msclickptr ms;
- acceptch userch;
- formatstr formenter;
- formatstr formexit;
- callproc formevent;
- } serec;
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- unsigned char _TGdecl allchars(char ch);
- unsigned char _TGdecl alphaonly(char ch);
- unsigned char _TGdecl numbersonly(char ch);
- unsigned char _TGdecl alphanumeric(char ch);
- unsigned char _TGdecl strnoformat(char *txtstr);
- unsigned char _TGdecl strredisplay(char *txtstr);
-
- void _TGdecl strdelete(char *txtstr,unsigned cpos,unsigned nchars);
- void _TGdecl strinsert(char ch,char * txtstr,unsigned cpos);
-
- void _TGdecl definestreditevent(imagestkptr fs,unsigned x,unsigned y,unsigned x1,unsigned y1,
- unsigned maxlen,unsigned color,fontptr font,unsigned char prop,
- char *txtstr,acceptch userch,formatstr formenter,
- formatstr formexit,callproc formevent);
- void _TGdecl setstredit(imagestkptr fs,msclickptr ms,unsigned ncpos);
- void _TGdecl dropstreditevents(imagestkptr fs);
-
- #ifdef __cplusplus
- }
- #endif
- #endif
- /* teglspec.h
-
- Defines structs and functions for sliders and resizers.
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
- #ifndef __TEGLSPEC_H
- #define __TEGLSPEC_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- #ifndef __TEGLUNIT_H
- #include <TEGLUNIT.H>
- #endif
-
- typedef struct sliderms *slidermsptr;
- typedef struct sliderms {
- slidermsptr nxtms;
- msclickptr ms; /* related slider area */
- } sliderms;
-
- typedef struct sliderrec *sliderptr;
- typedef struct sliderrec {
- imagestkptr fs;
- msclickptr ms1; /* slider area */
- msclickptr ms2; /* slider button/thumb */
- slidermsptr relatedms; /* related ms for searching */
- unsigned minx, maxx;
- unsigned miny, maxy;
- callproc slidecallproc;
- callproc pagea1callproc;
- callproc pagea2callproc;
- } sliderrec;
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- unsigned _TGdecl selectandresizeframe(imagestkptr fs,msclickptr mouseclickpos);
- void _TGdecl defineresizeminmax(imagestkptr fs,unsigned minx,unsigned miny,
- unsigned maxx,unsigned maxy);
- void _TGdecl defineresizeclickarea(imagestkptr fs,unsigned x,unsigned y,
- unsigned x1,unsigned y1,callproc resizecallproc);
- void _TGdecl movesliderbar(sliderptr slptr,unsigned x,unsigned y);
- void _TGdecl setsliderrelative(sliderptr slptr,unsigned long xrange,
- unsigned long xpos,unsigned long yrange,unsigned long ypos);
- void _TGdecl getsliderrelative(sliderptr slptr,unsigned long xrange,
- unsigned long * xpos,unsigned long yrange,unsigned long * ypos);
- void _TGdecl dropsliders(imagestkptr frame);
- unsigned _TGdecl slideraction(imagestkptr fs,msclickptr mouseclickpos);
- void _TGdecl addsliderpageevent(imagestkptr fs,msclickptr ms,
- callproc spagea1,callproc spagea2);
- void _TGdecl definesliderarea(imagestkptr fs,unsigned x,unsigned y,
- unsigned x1,unsigned y1,unsigned minx,unsigned miny,
- unsigned maxx,unsigned maxy,callproc slidecallproc);
- sliderptr _TGdecl getlastsliderdef(imagestkptr fs);
- void _TGdecl addrelatedsliderms(imagestkptr fs,msclickptr sliderms,msclickptr ms);
- void _TGdecl setslideposition(imagestkptr fs,unsigned mxpos,unsigned mypos);
- sliderptr _TGdecl findsliderfs(imagestkptr frame,msclickptr mouseclickpos);
- void _TGdecl disposeslider(imagestkptr frame,sliderptr dslptr);
-
- #ifdef __cplusplus
- }
- #endif
- #endif
- /* teglmenu.h
-
- Defines structs and functions for the TEGL Menu system.
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
- #ifndef __TEGLMENU_H
- #define __TEGLMENU_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- #define menuentryheight 3
- #define maxtextstringsize 40
-
- #define UPPERRIGHT 0
- #define UPPERLEFT 1
- #define LOWERRIGHT 2
- #define LOWERLEFT 3
- #define RIGHTTOP 4
- #define LEFTTOP 5
- #define RIGHTBOTTOM 6
- #define LEFTBOTTOM 7
- #define NOTOGGLEENTRY 8
- #define NOTOGGLEEXIT 16
-
- typedef struct omevents *omeventptr;
- typedef struct optionentry *optioneptr;
- typedef struct optionmenu *optionmptr;
-
- typedef struct omevents {
- optionmptr optionmn;
- unsigned char optiontype;
- callproc entrycallproc;
- msclickptr ms;
- } omevents;
-
- typedef struct optionmenu {
- optionmptr nextom;
- unsigned numofentries;
- unsigned maxwidth;
- unsigned displaynum;
- unsigned margin;
- fontptr fonttype;
- unsigned char proportional;
- optioneptr firstentry;
- optioneptr currententry;
- unsigned currentoenum;
-
- imagestkptr fs;
- msclickptr ms;
- int x;
- int y;
- int x1;
- int y1;
- msclickptr slidems;
- unsigned selectedoenum;
- } optionmenu;
-
- typedef struct optionentry {
- optioneptr nextoe;
- char entryline[maxtextstringsize+1];
- unsigned char entryactive;
- int entrycolor;
- callproc entrycallproc;
- optionmptr entrysubom;
-
- msclickptr entryms;
- userrecptr entryud;
- optionmptr om;
-
- unsigned char entryboolean;
- unsigned entryvalue;
- void *entryglobal;
- } optionentry;
-
- typedef struct menuconstants {
- unsigned barmenumargin;
- unsigned barmenucolor;
- unsigned bartextcolor;
- unsigned barbordercolor;
- unsigned char barbordershow;
- unsigned omsliderwidth;
- unsigned omsliderheight;
- unsigned char ominactivejagged;
- unsigned omseparatorline;
- unsigned ommargin;
- unsigned omtabsize;
- unsigned ominactivecolor;
- unsigned omactivecolor;
- unsigned ombordercolor;
- unsigned char hidesubmenu;
- } menuconstants;
-
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /*------------------------------------------------------------------------*
- | Menu Constants |
- *------------------------------------------------------------------------*/
- extern menuconstants mc;
- extern menuconstants herc_mc;
-
- /*------------------------------------------------------------------------*
- | Bar Menu routines |
- *------------------------------------------------------------------------*/
-
- void _TGdecl createbarmenu(unsigned x,unsigned y,unsigned ln);
- void _TGdecl outbaroption(char *entrystr,optionmptr om);
- void _TGdecl outbarevent(char *entrystr,callproc entrycallproc);
-
- /*------------------------------------------------------------------------*
- | Option Menu / Option Entry |
- *------------------------------------------------------------------------*/
- optioneptr _TGdecl getomoe(optionmptr om,unsigned oenum);
- optionmptr _TGdecl getfsom(imagestkptr fs);
- void _TGdecl entrystatus(optionmptr om,unsigned oenum,unsigned char status);
- void _TGdecl optiontext(optionmptr om,unsigned oenum,char *entrystr);
-
- /*------------------------------------------------------------------------*
- | Option Menu. Basis of Drop down Menus |
- *------------------------------------------------------------------------*/
-
- optionmptr _TGdecl createoptionmenu(fontptr fonttype);
- void _TGdecl setomdisplaynum(optionmptr om,unsigned displaynum);
- void _TGdecl setommaxwidth(optionmptr om,unsigned maxwidth);
- void _TGdecl setommargin(optionmptr om,unsigned margins);
- void _TGdecl defineoptions(optionmptr om,char *entrystr,unsigned char active,callproc entrycallproc);
- void _TGdecl defineoptionssub(optionmptr om,char *entrystr,unsigned char active,optionmptr om2);
- void _TGdecl defineoptionsradio(optionmptr om,char *entrystr,unsigned char active,callproc entrycallproc,unsigned radiovalue,unsigned *radiovar);
- void _TGdecl defineoptionscheck(optionmptr om,char *entrystr,unsigned char active,callproc entrycallproc,unsigned char *chkmark);
- void _TGdecl setcurrentoepos(optionmptr om,unsigned oenum);
- void _TGdecl dropoptionentry(optionmptr om,unsigned oenum);
- void _TGdecl dropoptionmenu(optionmptr om);
-
- /*------------------------------------------------------------------------*
- | Option Menu Events. |
- *------------------------------------------------------------------------*/
-
- void _TGdecl defineoptionclickarea(imagestkptr fs,unsigned x,unsigned y,unsigned x1,unsigned y1,optionmptr om,unsigned char sense,unsigned char omtype,unsigned keycode);
- void _TGdecl dropoptionclickareas(imagestkptr fs);
-
- /*------------------------------------------------------------------------*
- | Menu Color Constants |
- *------------------------------------------------------------------------*/
-
- void _TGdecl setoptionmenucolors(unsigned activecolor,unsigned inactivecolor);
- void _TGdecl setoptionmenubordercolor(unsigned color);
- void _TGdecl setbartextcolor(unsigned color);
- void _TGdecl setbarmenumargin(unsigned margin);
- void _TGdecl setbarmenucolor(unsigned color);
- void _TGdecl setbarborderoff(void);
- void _TGdecl setbarbordercolor(unsigned color);
- void _TGdecl sethidesubmenu(unsigned char on_off);
- void _TGdecl setmenumargin(unsigned pixsize);
- void _TGdecl setmenutabsize(unsigned charnum);
- void _TGdecl setseparatorline(unsigned mask);
- void _TGdecl setinactivejaggies(unsigned char on_off);
- void _TGdecl setomslidersize(unsigned width,unsigned height);
- int _TGdecl menutextwidth(char *mystr);
- void _TGdecl outmenutextxy(int x,int y,int color,char *mystr,unsigned maxw);
- unsigned char _TGdecl omexists(optionmptr om);
- unsigned _TGdecl scanquickkey(char *mystr);
- imagestkptr _TGdecl openoptionmenu(unsigned x,unsigned y,optionmptr om);
-
- #ifdef __cplusplus
- }
- #endif
- #endif
- /* teglpick.h
-
- Defines structs and functions for TEGL Picklist.
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
- #ifndef __TEGLPICK_H
- #define __TEGLPICK_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- #ifndef __TEGLMENU_H
- #include <TEGLMENU.H>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- optionmptr _TGdecl createpicklist(fontptr fonttype);
- void _TGdecl definepickitem(optionmptr om,char * entrystr,callproc entrycallproc,char * pickitem);
- void _TGdecl definepicklistarea(imagestkptr fs,unsigned x,unsigned y,unsigned oeselect,unsigned displaynum,optionmptr om);
- void _TGdecl detachpicklist(optionmptr om);
- void _TGdecl attachpicklist(optionmptr om,unsigned oeselect);
- void _TGdecl insertpickitem(optionmptr om,unsigned oenum,char * entrystr,callproc entrycallproc,char * pickitem);
- void _TGdecl deletepickitem(optionmptr om,unsigned oenum);
- void _TGdecl clearpicklist(optionmptr om);
- void _TGdecl setpicklistwidth(optionmptr om,unsigned maxwidth);
- void _TGdecl setpicklistmargin(optionmptr om,unsigned marginw);
-
- #ifdef __cplusplus
- }
- #endif
- #endif
- /* teglfsio.h
-
- Defines structs and functions for dealing with Frame Input and Output
-
- Copyright (c) TEGL Systems Corporation 1989,1990,1991
- All Rights Reserved.
- */
-
- #ifndef __TEGLFSIO_H
- #define __TEGLFSIO_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- typedef struct frameiorec *frameioptr;
- typedef struct frameiorec {
- frameioptr nextframeio;
- imagestkptr fs;
- unsigned x, y;
- unsigned minx, maxx;
- unsigned miny, maxy;
- } frameiorec;
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- frameioptr _TGdecl findfsio(imagestkptr frame);
- void _TGdecl openfsio(imagestkptr frame,unsigned x,unsigned y,unsigned x1,unsigned y1);
- void _TGdecl closefsio(imagestkptr frame);
- void _TGdecl writefs(imagestkptr fs,char *textstr);
- void _TGdecl getmargins(imagestkptr frame,unsigned *x,unsigned *y,unsigned *x1,unsigned *y1);
- void _TGdecl setmargins(imagestkptr frame,unsigned x,unsigned y,unsigned x1,unsigned y1);
- void _TGdecl gotofsxy(imagestkptr frame,unsigned x,unsigned y);
- unsigned _TGdecl fsiowherey(imagestkptr frame);
- unsigned _TGdecl fsiowherex(imagestkptr frame);
- void _TGdecl scrollup(imagestkptr fs);
- void _TGdecl scrolldown(imagestkptr fs);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
- /* animate.h
-
- Defines structs and functions for dealing with animation
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
- #ifndef __ANIMATE_H
- #define __ANIMATE_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
-
- typedef struct coordinates {
- int x, y;
- } coordinates;
-
- typedef struct animateframe *aframeptr;
- typedef struct animateframe {
- aframeptr nextframe; /* next char *, can be circular buffer */
- char *imagepic; /* image for display */
- unsigned tonehz; /* 0 turns off tone */
- unsigned tonedelay;
- coordinates movement; /* next increment */
- unsigned imgdelay; /* delay before next image is placed */
- unsigned imagesz; /* size of image */
- unsigned height, width; /* length and width of image */
- unsigned color; /* color for putpict */
- } animateframe;
-
- typedef struct sequenceset *sequenceptr;
- typedef struct sequenceset {
- sequenceptr nextsequence;
- unsigned sequencenum;
- aframeptr sequenceframe;
- } sequenceset;
-
- typedef struct animateobject {
- aframeptr currentframe; /* char * to current picture frame */
- aframeptr firstframe; /* first image char * */
- sequenceptr sequenceframe;
- unsigned framenumber;
- coordinates cc;
- } animateobject;
-
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- void _TGdecl init(animateobject *ao);
- void _TGdecl origin(animateobject *ao,unsigned ox,unsigned oy);
- void _TGdecl getorigin(animateobject *ao,int *lastox,int *lastoy);
- void _TGdecl resetframe(animateobject *ao,unsigned startframe);
- unsigned _TGdecl currentframenumber(animateobject *ao);
- unsigned _TGdecl destination(animateobject *ao,int dx,int dy);
- void _TGdecl addframe(animateobject *ao,char *pp,int mx,int my,unsigned ht,
- unsigned wd,unsigned dy,unsigned hz,unsigned hzdy,unsigned co);
- void _TGdecl sequence(animateobject *ao,unsigned seqnum);
- void _TGdecl resetsequence(animateobject *ao);
- void _TGdecl animateinit(void);
- void _TGdecl animate(animateobject *ao,unsigned numframe);
- void _TGdecl animatecomplete(animateobject *ao);
- void _TGdecl anim_init(int argc,char **argv);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
- /* extendc.h
-
- Prototypes for File function extensions
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
- #ifndef __EXTENDC_H
- #define __EXTENDC_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- char *_TGdecl fexpand (char *ipath);
- void _TGdecl dos_getpath(unsigned char drive, char far *pathname);
- int _TGdecl appendwildcards(char *FilePath);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
- /* selectfl.h
-
- Prototype for File Selection Event
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
- #ifndef __SELECTFL_H
- #define __SELECTFL_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- char _TGdecl selectafile(int x,int y,char *path,char *fileselected);
-
- void _TGdecl editstring(imagestkptr fs,int x,int y,int maxlen,char *textstr);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
- /* soundunt.h
-
- Defines functions for dealing with the IBM speaker
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
- #ifndef __SOUNDUNT_H
- #define __SOUNDUNT_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- unsigned _TGdecl asksoundsense(imagestkptr frame, msclickptr mouseclickpos);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
- /* sensems.h
-
- Prototype for Setting Mouse Sensitivity Event
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
- #ifndef __SENSEMS_H
- #define __SENSEMS_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- void _TGdecl setmousesense(int x, int y);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
- /* debugunt.h
-
- Prototypes for Information Events
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
- #ifndef __DEBUGUNT_H
- #define __DEBUGUNT_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- unsigned _TGdecl showcoordinates(imagestkptr frame,msclickptr mouseclickpos);
-
- unsigned _TGdecl showmousexycoords(imagestkptr fs, msclickptr mouseclickpos);
-
- unsigned _TGdecl showbuttonstatus(imagestkptr frame,msclickptr mouseclickpos);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
- /* pcxgraph.h
-
- Defines structs and functions for the TEGL PCX Reader
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
-
- #ifndef __PCXGRAPH_H
- #define __PCXGRAPH_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
-
- typedef struct pcxheader {
- unsigned char manufacturer;
- unsigned char version;
- unsigned char encoding;
- unsigned char bitsperpixel;
- int xmin,ymin;
- int xmax,ymax;
- int hdpi,vdpi;
- unsigned char colormap[48];
- unsigned char reserved;
- unsigned char nplanes;
- int bytesperline;
- int paletteinfo;
- unsigned hscreensize;
- unsigned vscreensize;
- unsigned char filler[54];
- } pcxheader;
-
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- void _TGdecl setpcxbwmap(unsigned char r,unsigned char g,unsigned char b,unsigned char i);
- void _TGdecl quickshowpcxfile(char *pcxfilename,unsigned char palettechange,
- unsigned baseoffset,unsigned maxlines,unsigned maxwidth);
- void _TGdecl displaypcxfile(void *pcxbuff,unsigned char palettechange,
- unsigned baseoffset,unsigned maxlines,unsigned maxwidth);
- virtualptr _TGdecl loadpcxfiletovirtual(char *pcxfilename);
- void _TGdecl displayvirtualpcxfile(virtualptr pcxbuff,unsigned char palettechange,
- unsigned baseoffset,unsigned maxlines,unsigned maxwidth);
- void _TGdecl listpcxheaderinfo(pcxheader *pcxhead);
- void _TGdecl getpcxheader(char *pcxfilename,pcxheader *pcxhead);
-
- extern _TGType egapcx4plane(void * pcxbuff,unsigned baseoffset,unsigned maxlines,unsigned maxwidth);
- extern _TGType egapcx1plane(void * pcxbuff,unsigned baseoffset,unsigned maxlines,unsigned maxwidth);
-
- #ifdef __cplusplus
- }
- #endif
- #endif
- /* twcommon.h
-
- Common routines used in TEGL Window Modules
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
- #ifndef __TWCOMMON_H
- #define __TWCOMMON_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
-
- #define twmaxheaderlen 40 /* -- maximum header string length. */
-
- extern unsigned twminx;
- extern unsigned twminy;
- extern unsigned twmaxx;
- extern unsigned twmaxy;
-
- extern int twbordercolor;
- extern int twheadercolor;
- extern int twframecolor;
- extern int twframecolor2;
- extern int twfillcolor;
- extern int twtextcolor;
- extern int twtextbackground;
-
- extern int twthickness;
- extern char twmoveable;
- extern char twresize;
-
-
- extern char twclipping;
-
-
- /* -- dialog CONSTANTS */
- #define TDNOTHING 00 /* -- marker to break apart clusters */
- #define TDLABEL 01
- #define TDBUTTON 02 /* -- button, like OK or CANCEL */
- #define TDICONBUTTON 03 /* -- button, custom */
- #define TDRADIOBUTTON 04 /* -- radio buttons */
- #define TDCHECKBOX 05
- #define TDUSERDEFINED 06
-
-
-
- /* -- Standard frame drawing routine. */
- typedef void (far * framedrawfunc) (int x1, int y1, int x2, int y2, int thickness,
- int border, int uppershade, int lowershade, int fill);
-
- /* -- Declare the type of float world coordinate system uses if it is */
- /* -- defined. */
-
- /**** TWWORLD *******/
-
- #define TWWORLD
-
- #ifdef TWWORLD
- /* #define WCFLOATLINT */
-
- #ifdef WCFLOATLINT
- typedef long wcfloat;
- #else
- typedef float wcfloat;
- #endif
-
- #endif
-
- struct twpoints {
- int x1;
- int y1;
- int x2;
- int y2;
- };
-
-
- struct graphvars {
- int x_;
- int y_;
- unsigned color;
- unsigned bkcolor;
- struct linesettingstype linesettings;
-
- struct textsettingstype textsettings;
- struct fillsettingstype fillsettings;
- /* struct fillpatterntype fillpattern; */
- };
-
-
- extern fontptr twheaderfont;
- extern fontptr twdialogfont;
-
- extern unsigned char buth;
- extern unsigned char butw;
- extern unsigned char udslen;
- extern unsigned char lrslen;
- extern unsigned char resizeh;
- extern unsigned char resizew;
-
-
- extern void *twlfbut;
- extern void *twrtbut;
- extern void *twupbut;
- extern void *twdnbut;
- extern void *twudbut;
- extern void *twcrbut;
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- unsigned _TGdecl twexitoption(imagestkptr ifs,msclickptr ms);
- void _TGdecl emergencyexit(void);
- void _TGdecl tweasystart(void);
- void _TGdecl twfit(unsigned *i,unsigned *i1,unsigned max);
- void _TGdecl twfitframe(unsigned *x,unsigned *y,unsigned *width,unsigned *height);
- void _TGdecl twsetglobalbuttonsize(unsigned char width,unsigned char height);
- void _TGdecl twsetglobalbuttonicons(void *left,void *right,void *up,void *down,
- void *updown,void *corner);
- void _TGdecl twsetglobalslidersize(unsigned char updown,unsigned char leftright);
- void _TGdecl twsetglobalresizearea(unsigned char width,unsigned char height);
- void _TGdecl twsetglobalminmax(unsigned minx_,unsigned miny_,unsigned maxx_,unsigned maxy_);
- void _TGdecl filledrectangle(int x,int y,int x1,int y1,int bordercolor,int fill,int color);
- void _TGdecl drawsliderbackground(int x1,int y1,int x2,int y2);
- void _TGdecl lineset(int x1,int y1,int x2,int y2,int c1,int c2);
- void _TGdecl stdbox(int x1,int y1,int x2,int y2,int thickness,int border,
- int edgefill,int discard,int fill);
- void _TGdecl bevbox(int x1,int y1,int x2,int y2,int thickness,int border,
- int uppershade,int lowershade,int fill);
- void _TGdecl getgraphsettings(struct graphvars * gs);
- void _TGdecl setgraphsettings(struct graphvars * gs);
- void _TGdecl twsetheaderfont(fontptr font);
- void _TGdecl twsetdialogfont(void *font);
- void _TGdecl twcommoninit(void);
-
- #ifdef __cplusplus
- }
- #endif
- #endif
- /* twkernel.h
-
- TYPE definitions for DIALOGUES
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
- #ifndef __TWKERNEL_H
- #define __TWKERNEL_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- typedef struct twdialogitem *twdialogptr;
- typedef struct twdialogitem {
- int x1, y1; /* -- display relative on window */
- int x2, y2;
- int sx1, sy1; /* -- xor box selection indicator locations */
- int sx2, sy2;
- unsigned char active; /* -- set TRUE if active, FALSE if
- * non-selectable */
- unsigned char len; /* -- length of input string (max) */
- unsigned char places; /* -- for floating point display */
- msclickptr ms; /* -- store the associate mouse click ptr */
- msclickptr ms_edit; /* -- associated editior mouse clikc ptr */
- int tdtype; /* -- type of dialogue item, def in twcommon */
- char *message; /* -- prompt or message */
- int msnum; /* -- mouse click number association */
- int number; /* -- simply the counter */
- int clusnum; /* -- cluster number, for grouping items
- * together */
- int clusitem; /* -- cluster item, item of group */
- void *data; /* -- points to data item, NULLif not
- * required */
- char *strdata; /* -- store intermediate string */
- twdialogptr prev; /* -- point to previous dialog item */
- twdialogptr next; /* -- point to next dialog item */
- callproc action; /* -- user event (attaches to button) */
- } twdialogitem;
-
-
- typedef struct menuitem *twmenuptr;
- typedef struct menuitem {
- void *next; /* -- points to next, NULLif last */
- unsigned char item; /* -- just a counter */
- char prompt[31]; /* -- the menu item name */
- optionmptr om; /* -- what pulls down from it */
- int mousenum; /* -- store associated mouse num */
- unsigned char entries; /* -- */
- unsigned char entryactive; /* -- TRUE if active */
- callproc entrycall; /* -- point to event if its not a pull down */
- } menuitem;
-
- /*
- The WinFrame record is an 'object-like' data structure. It contains all
- the data items required to program and manipulate a complex window. All
- the procedure and functions which access this data record start with
- tw<name> and the parameter list is AT LEAST ONE but may be more, and the
- first parameter is always a WinFramePtr. In this respect the
- WinFramePtr points to what would be called 'self' in an object-oriented
- implementation.
-
- Note that this only mimics and object implementation. It is done to
- make the switch to a TRUE object oriented version easier.
- */
-
- typedef struct winframe *winframeptr;
- typedef struct winframe {
- imagestkptr ifs; /* -- void * from image stack */
- imagestkptr iconifs;
- unsigned char firsttime; /* -- flag for window drawing. DO NOT TOUCH! */
- unsigned char redrawonmove; /* -- force redraw after a window move */
- framedrawfunc style; /* -- window framestyle */
- int thickness; /* -- window framethickness */
- unsigned x1, y1, x2, y2; /* -- window coordinates */
- unsigned mx1, my1, mx2, my2;/* -- store window size before maximize */
- unsigned wx1, wy1, wx2, wy2;/* -- window working coordinates */
- /* -- these are the absolute coordinates inside */
- /* -- the window allowing for header, border, */
- /* -- menu and sliders. */
- unsigned minx, miny, maxx, maxy; /* -- min max for resize */
- fontptr font; /* -- font to use for text output */
- fontptr displayfont; /* -- font for header, menus */
- unsigned char theight; /* -- text height in pixels */
- unsigned char twidth; /* -- text width in pixels */
- unsigned char rows; /* -- number of rows in the working window */
- unsigned char cols; /* -- number of cols in the working window */
- int curx; /* -- cursor location (col, row) */
- int cury;
- unsigned char textattr; /* -- traditional text char attribute */
- unsigned char charclear; /* -- clear character before drawing new one */
- int bordercolor; /* -- color scheme */
- int headercolor;
- int framecolor;
- int framecolor2;
- int fillcolor;
- int textcolor;
-
- /* -- Header and buttons stuff */
-
- unsigned char header; /* -- if header shown */
- char headerstr[twmaxheaderlen + 1];
- unsigned char maximize; /* -- TRUE if minimize, maximize OK */
- unsigned char maximized; /* -- TRUE if we are maximized */
- int thickstore; /* -- remember thickness when maximized */
- unsigned char minimized; /* -- TRUE if we are now an icon */
- void *icon; /* -- icon to display when window minimized */
-
- /* -- SLIDERS - up down */
-
- unsigned char updownslider; /* -- TRUE if updown slider shown */
- int updnslideper; /* -- set to sliders relative position % */
- unsigned char upbuttonpress;/* -- set TRUE if up button was pressed */
- unsigned char dnbuttonpress;/* -- set TRUE if down button was pressed */
- callproc updownevent; /* -- user event to process up down slider
- * action */
- sliderptr updownsldptr; /* -- store slider void * */
- int updownrange; /* -- scale of the slider */
- int updownstep; /* -- button step value */
-
- /* -- Left right */
-
- unsigned char leftrightslider; /* -- TRUE if leftright slider shown */
- int lfrtslideper; /* -- */
- unsigned char lfbuttonpress;/* -- TRUE if left button was pressed */
- unsigned char rtbuttonpress;/* -- ture if right button was pressed */
- callproc leftrightevent; /* -- user event to process left right slider
- * action */
- sliderptr leftrightsldptr; /* -- store slider void * */
- int leftrightrange;
- int leftrightstep;
-
-
- unsigned char resize; /* -- TRUE if resizeable */
- unsigned char moveable; /* -- TRUE if window is moveable */
- unsigned char proportional; /* -- TRUE if text is displayed
- * proportionally */
- unsigned char wrap; /* -- TRUE if text is to wrap at border */
-
- /* -- framemenu */
- optionmptr om; /* -- the alt-space bar menu */
- /* -- twMenu */
-
- unsigned char menuentries; /* -- number of main menu bar selections */
- unsigned char menuthickness;/* -- depends on number of lines */
- twmenuptr menu; /* -- points to first item, NULLif none */
- twmenuptr menulast; /* -- last item added */
- /* -- */
-
- #ifdef TWWORLD
- /* -- world coordinate data items follow, procedures in 'twWorld.pas' */
- wcfloat wcx1, wcy1, wcx2, wcy2; /* -- coordinate system range to use */
-
- /* -- width an hight in defined system */
- /* -- offset to normalize */
- wcfloat wcheight, wcwidth, wcxoff, wcyoff, wcxfac, wcyfac; /* -- factor to multiply */
- /* by (transforms) */
- #endif
-
- unsigned char clipping;
- /* -- for 'twdialog' - anchor pointer for dialog list */
- twdialogptr twdanchor; /* -- anchor, starting point for list */
- twdialogptr twdcurrent; /* -- current is also the last item */
- unsigned twdcount; /* -- counts the number of dialog entries */
- fontptr twdfont;
-
- /* -- procedural void *s follow */
- callproc closeevent; /* -- userdefined Close from mouse click */
- callproc menucloseevent; /* -- userdefined close from menu */
- callproc redrawevent; /* -- redraw window event */
- /* -- the about selection from space bar menu */
- callproc aboutevent;
- } winframe;
-
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- winframeptr _TGdecl findwinframe(imagestkptr ifs);
- unsigned _TGdecl redrawwinframe(imagestkptr ifs,msclickptr ms);
- void _TGdecl twsetcloseevent(winframeptr wf,callproc event);
- unsigned _TGdecl twcloseevent(imagestkptr ifs,msclickptr ms);
- unsigned _TGdecl twmenucloseevent(imagestkptr ifs,msclickptr ms);
- void _TGdecl twclear(winframeptr wf);
- void _TGdecl twclose(winframeptr wf);
- void _TGdecl twmenuitem(winframeptr wf,char *s,unsigned char active);
- void _TGdecl twsubmenuitem(winframeptr wf,char *s,unsigned char active,callproc event);
- void _TGdecl twselect(winframeptr wf);
- void _TGdecl twfixup(winframeptr wf);
- void _TGdecl twdefinemouseclickarea(winframeptr wf,unsigned x1_,unsigned y1_,unsigned x2_,unsigned y2_,unsigned char active,callproc action);
- void _TGdecl twputpict(winframeptr wf,int x,int y,void *image,int color);
- void _TGdecl twsetbordercolor(winframeptr wf,unsigned char color);
- void _TGdecl twsetdisplayfont(winframeptr wf,void *font);
- void _TGdecl twsetfont(winframeptr wf,void *font);
- void _TGdecl twsetmaximize(winframeptr wf,unsigned char tf);
- void _TGdecl twsetredraw(winframeptr wf,callproc redraw_);
- void _TGdecl twsetresize(winframeptr wf,unsigned char tf);
- void _TGdecl twsetupdownslider(winframeptr wf,unsigned char active);
- void _TGdecl twsetleftrightslider(winframeptr wf,unsigned char active);
- void _TGdecl twsetupdownevent(winframeptr wf,callproc event);
- void _TGdecl twsetleftrightevent(winframeptr wf,callproc event);
- void _TGdecl twsetupdownrange(winframeptr wf,int range,int step);
- void _TGdecl twsetleftrightrange(winframeptr wf,int range,int step);
- void _TGdecl twsetminimizeicon(winframeptr wf,void *icon);
- void _TGdecl twscrolldown(winframeptr wf,int num);
- void _TGdecl twscrollup(winframeptr wf,int num);
- void _TGdecl twsetfillcolor(winframeptr wf,unsigned char color);
- void _TGdecl twsetcolor(winframeptr wf,unsigned char color);
- void _TGdecl twsetthickness(winframeptr wf,unsigned char thickness);
- void _TGdecl twinit(winframeptr * wf,unsigned x_,unsigned y_,unsigned x1_,unsigned y1_);
- void _TGdecl twsetwinframecolors(winframeptr wf,unsigned char color1,unsigned char color2);
- void _TGdecl twsetwindowstyle(winframeptr wf,framedrawfunc style);
- void _TGdecl twsetheader(winframeptr wf,char *s);
- void _TGdecl twdrawwindowframe(winframeptr wf);
-
- #ifdef __cplusplus
- }
- #endif
- #endif
-
- /* twwindow.h
-
- Standard CRT Output.
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
- #ifndef __TWWINDOW_H
- #define __TWWINDOW_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- void _TGdecl twcrton(void);
- void _TGdecl twcrtoff(void);
- void _TGdecl twcrtassign(winframeptr wf);
- void _TGdecl twgotoxy(winframeptr wf, int x_, int y_);
- int _TGdecl twhix(winframeptr wf, int x_);
- int _TGdecl twhiy(winframeptr wf, int y_);
- int _TGdecl twlox(winframeptr wf, int x_);
- int _TGdecl twloy(winframeptr wf, int y_);
- void _TGdecl twsettextcolor(winframeptr wf, unsigned char color);
- void _TGdecl twsettextbackground(winframeptr wf,unsigned char color);
- void _TGdecl twwritechar(winframeptr wf, char c);
- void _TGdecl twwritestring(winframeptr wf, char * s);
- void _TGdecl twwritexy(winframeptr wf, int col, int row, char * s);
- void _TGdecl twprintf(char *control, ...);
-
- #ifdef __cplusplus
- }
- #endif
- #endif
- /* twworld.h
-
- World Coordinates in TEGL Windows.
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
- #ifdef TWWORLD
-
- #ifndef __TWWORLD_H
- #define __TWWORLD_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- void _TGdecl twwworldselect(winframeptr wf_);
- void _TGdecl twwarc(winframeptr wf,wcfloat x,wcfloat y,wcfloat stangle,wcfloat endangle,wcfloat radius);
- void _TGdecl twwbar(winframeptr wf,wcfloat x1,wcfloat y1,wcfloat x2,wcfloat y2);
- void _TGdecl twwbar3d(winframeptr wf,wcfloat x1,wcfloat y1,wcfloat x2,wcfloat y2,wcfloat depth,unsigned char top);
- void _TGdecl twwcircle(winframeptr wf,wcfloat x,wcfloat y,wcfloat radius);
- void _TGdecl twwdefineworld(winframeptr wf,wcfloat x1,wcfloat y1,wcfloat x2,wcfloat y2);
- void _TGdecl twwellipse(winframeptr wf,wcfloat x,wcfloat y,wcfloat stangle,wcfloat endangle,wcfloat xradius,wcfloat yradius);
- void _TGdecl twwfillellipse(winframeptr wf,wcfloat x,wcfloat y,wcfloat xradius,wcfloat yradius);
- void _TGdecl twwfloodfill(winframeptr wf,wcfloat x,wcfloat y,unsigned border);
- unsigned _TGdecl twwgetpixel(winframeptr wf,wcfloat x,wcfloat y);
- void _TGdecl twwline(winframeptr wf,wcfloat x1,wcfloat y1,wcfloat x2,wcfloat y2);
- void _TGdecl twwlinerel(winframeptr wf,wcfloat dx,wcfloat dy);
- void _TGdecl twwlineto(winframeptr wf,wcfloat x,wcfloat y);
- void _TGdecl twwmoverel(winframeptr wf,wcfloat dx,wcfloat dy);
- void _TGdecl twwmoveto(winframeptr wf,wcfloat x,wcfloat y);
- void _TGdecl twwouttextxy(winframeptr wf,wcfloat x,wcfloat y,char *textstring);
- void _TGdecl twwpieslice(winframeptr wf,wcfloat x,wcfloat y,wcfloat stangle,wcfloat endangle,wcfloat radius);
- void _TGdecl twwputpixel(winframeptr wf,wcfloat x,wcfloat y,unsigned pixel);
- void _TGdecl twwrectangle(winframeptr wf,wcfloat x1,wcfloat y1,wcfloat x2,wcfloat y2);
- void _TGdecl twwsector(winframeptr wf,wcfloat x,wcfloat y,wcfloat stangle,wcfloat endangle,wcfloat xradius,wcfloat yradius);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-
- #endif /* if TWWORLD */
-
- /* twdialog.h
-
- Dialog Management in TEGL Windows.
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
- #ifndef __TWDIALOG_H
- #define __TWDIALOG_H
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
-
- /* control constants for the conversion routine */
- /* for user defined dialogues . */
-
- #define twdcondisplay 0
- #define twdconentry 1
- #define twdcondelete 2
- #define twdconreturn 3
-
- /* -- This is the type definition of the conversion routine that must be */
- /* -- coded for each user defined Dialogue entry. */
- /* -- The node pointer is passed along for advanced error recovery */
-
- typedef void (far * twdconvert) (char *s,void *p,int mode,unsigned char width,unsigned char decimals,twdialogptr node);
-
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- int _TGdecl twdregisterusertype(twdconvert convertproc,acceptch charproc);
- unsigned _TGdecl twdclose(imagestkptr ifs,msclickptr ms);
- void _TGdecl twdinit(winframeptr * wf,unsigned x1_,unsigned y1_,unsigned x2_,unsigned y2_);
- void _TGdecl twdadddialogitem(winframeptr wf,int tdtype,int x,int y,char *mess,
- void *dp,unsigned char len,unsigned char places,callproc event);
- void _TGdecl twdnewcluster(winframeptr wf);
- void _TGdecl twdaddlabel(winframeptr wf,int x,int y,char *mess);
- void _TGdecl twdaddbutton(winframeptr wf,int x,int y,char *mess,callproc event);
- void _TGdecl twdaddcheckbox(winframeptr wf,int x,int y,char *mess,unsigned char *b);
- void _TGdecl twdaddradiobutton(winframeptr wf,int x,int y,char *mess,int *i);
- void _TGdecl twdaddiconbutton(winframeptr wf,int x,int y,void *icon,callproc event);
- void _TGdecl twdaddinputline(winframeptr wf,int x,int y,char *mess,char *utype,unsigned char len);
-
- #ifdef __cplusplus
- }
- #endif
- #endif
- /* EXEC.H
-
- do_exec with memory swap.
-
- EXEC is a public domain product. For your convenience, we have
- integrated the library functions with TEGL.
-
- Copyright (c) TEGL Systems Corporation 1989,1990
- All Rights Reserved.
- */
-
- #ifdef __STDTEGL__
- #define _TGdecl
- #else
- #define _TGdecl cdecl
- #endif
-
- #ifndef __PASTEGL__
- #define _TGType _TGdecl
- #else
- #define _TGType pascal
- #endif
-
- #ifndef __EXEC_H
- #define __EXEC_H
-
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- int _TGdecl do_exec(char *xfn, char *pars, int spwn, unsigned needed,char **envp);
-
- int cdecl do_spawn (unsigned char method,char *swapfn, char *xeqfn,char *cmdtail,
- unsigned envlen, char *envp);
-
- #ifdef __cplusplus
- }
- #endif
- #endif