/* Header for module newCRT, generated by p2c */
#ifndef NEWCRT_H
#define NEWCRT_H
#include <X11/Xlib.h>


#ifdef NEWCRT_G
# define vextern
#else
# define vextern extern
#endif



/* Caged_date="r      nc_revision='V1.01: $X';" */
#define nc_revision     "V1.01: Dec 17, 1988 11:00 pm"



/* Window stuff */
/* Maybe use this info?? */
/* Graphics window */
/* Clip region */
/* Offsets to add for gLine */
/* Saved values of xpos, ypos */
/*Number of bytes needed to save window*/
/*NIL or pointer to save area*/

typedef struct nc_windowRec {
    short top, height, left, width;
    long area;
    short font, gcolor, gtop, gheight, gleft, gwidth, gminx, gmaxx, gminy,
	  gmaxy, goffx, goffy, savex, savey, saveHigh;
    long saveSize;
    Anyptr *saveArea;
} nc_windowRec;



/* newCrt-4  */
/* newCrt-8  */
/* newCrt-12 */
/* newCrt-16 */
/* newCrt-20 */
/* Character re-mapping stuff */

typedef short nc_maparray[256];



/* newCrt-22  NOT USED ANY MORE */
/* newCrt-26  NOT USED ANY MORE */
/* newCrt-28 */
/* newCrt-30 */
/* Font information */
#define nc_maxFonts     4



typedef struct nc_fontRec {
    short foffset, fwidth, fheight;
} nc_fontRec;



/*nc_windows : array[0..nc_maxWindows] of nc_windowRec;*/
/* Exciting colors */
#define nc_green        0
#define nc_yellow       4096
#define nc_black        8192
#define nc_red          12288
#define nc_cyan         16384
#define nc_white        20480
#define nc_blue         24576
#define nc_purple       28672

/* Exciting attributes */
#define nc_inv          256
#define nc_blink        512
#define nc_under        1024
#define nc_half         2048

/* Exciting displays */
#define nc_g26          0
#define nc_g36          2
#define nc_g36c         4
#define nc_g300         6

/* #define nc_fontwidth 8 */
#define nc_fontwidth 8 
#define nc_fontheight 13


/* Command translation */

typedef Char nc_commandArray[256];



/* Things to deal with graphics junk left on screen */
/* Information about graphics VS alpha screen stuff */
/* left edge of main window */
/* top of main window */
/* pixels/character in X */
/* pixels/character in Y */
/* real width of hardware */
/* real height of hardware */
/* number of graphics colors */
/* number of available graphics colors */

typedef union nc_crtword {
    struct {
      Char h, c;
    } U1;
    short i;
} nc_crtword;

typedef nc_crtword nc_scrtype[];



/* call nc_refreshXY, etc after changing! */
/* New, improved Colors to eliminate Mylib conflicts. */

typedef uchar nc_colorarray[3][256];


#ifndef NEWCRT_G
extern nc_windowRec *nc_curWindow;
extern nc_windowRec *nc_mainWindow, *nc_lastLineWindow, *nc_statusWindow,
                    *nc_defaultWindow;
#endif
vextern int nc_text_in_window;
vextern Window nc_window;
vextern int nc_initialized;
vextern GC nc_gc;
vextern short nc_highlight, nc_defaultHighlight;
vextern nc_windowRec *nc_tempWindow;
vextern nc_fontRec nc_fonts[nc_maxFonts + 1];
vextern Char *nc_commands;
vextern _PROCEDURE nc_startAlphaHook, nc_endAlphaHook;
vextern struct {
    short left, top, xincr, yincr, width, height, colors, gColors;
} nc_g;
vextern nc_crtword *nc_screen;
vextern uchar (*nc_colors)[256];



/* Simulation routines.  Should GO AWAY. */
extern Void nc_scrollDown PV();
extern Void nc_scrollUp PV();
extern Void nc_setWindow PP((int s, int l));
extern Void nc_revCheck PP((Char *rev));
extern Void nc_setbeep PP((int b));
extern short nc_getNumPlanes PV();
extern short nc_getAlphaPlanes PV();
extern Void nc_setAlphaPlanes PP((int num));
extern short nc_getGraphicsPlanes PV();
extern Void nc_setGraphicsPlanes PP((int num));
extern boolean nc_alphashared PV();
extern Void nc_sharealpha PP((int b));
extern Void nc_setAlpha PP((int on));
extern Void nc_setGraphics PP((int on));
extern short nc_getPlanes PV();
extern Void nc_setPlanes PP((int mask));
extern Void nc_putChar PP((int x, int y, int c));
extern Void nc_putChars PP((int x, int y, int len, Char *c));
extern Void nc_putStr PP((int x, int y, Char *s));
extern Void nc_writeStr PP((int x, int y, Char *s));
extern Char nc_getChar PP((int x, int y));
extern Void nc_getChars PP((int x, int y, int len, Char *c));
extern Void nc_getStr PP((int x, int y, Char *s));
extern short nc_getHighlight PP((int x, int y));
extern Void nc_setHighlight PP((int high));
extern Void nc_writeHighlight PP((int x, int y, int len, int newhigh));
extern Void nc_orHighlight PP((int x, int y, int len, int newhigh));
extern Void nc_andnotHighlight PP((int x, int y, int len, int newhigh));
extern Void nc_putWord PP((int x, int y, int w));
extern Void nc_putWords PP((int x, int y, int len, short *w));
extern short nc_getWord PP((int x, int y));
extern Void nc_getWords PP((int x, int y, int len, short *w));
extern Void nc_makeWindow PP((nc_windowRec *w, int ptop, int pheight,
			      int pleft, int pwidth));
extern Void nc_setWindow_ PP((nc_windowRec *w));
extern Void nc_saveWindow PV();
extern Void nc_restoreWindow PV();
extern Void nc_exchangeWindow PV();
extern Void nc_refreshON PV();
extern Void nc_refreshOFF PV();
extern Void nc_refreshXY PP((int x, int y, int dx, int dy));
extern Void nc_refreshWindow PV();
extern Void nc_refreshScreenXY PP((int x, int y, int dx, int dy));
extern Void nc_refreshScreen PV();
extern short nc_gType PV();
extern Void nc_aCMap PP((int col, int r, int g, int b));
extern Void nc_defaCMap PV();
extern Void nc_gCMap PP((int col, int r, int g, int b));
extern Void nc_defgCMap PV();
extern Void nc_gColor PP((int col));
extern Void nc_gLine PP((int x1, int y1, int x2, int y2));
extern Void nc_gFillRect PP((int x1, int y1, int x2, int y2));
extern Void nc_gBlit PP((int repl_rule, int dox, int doy, int sox, int soy,
			 int width, int height));
extern Void nc_gClear PV();
extern Void nc_gClipToWindow PP((int x1, int y1, int x2, int y2));
extern Void nc_gClipToHardware PP((int x1, int y1, int x2, int y2));
extern Void nc_clearXY PP((int x, int y, int dx, int dy));
extern Void nc_clear PV();
extern Void nc_scrollUp_ PV();
extern Void nc_scrollDown_ PV();
extern Void nc_scrollLeft PV();
extern Void nc_scrollRight PV();
extern Void nc_scrollXY PP((int dx, int dy));
extern Void nc_insChar PP((int x, int y, int numChars));
extern Void nc_insLine PP((int y, int numLines));
extern Void nc_getXY PP((long *x, long *y));
extern Void nc_setXY PP((int x, int y));
extern Void nc_gotoXY PP((int x, int y));
extern Void nc_cursXY PP((int x, int y));
extern Void nc_cursorOn PV();
extern Void nc_cursorOff PV();
extern Void nc_nothing PV();
extern Void nc_unInit PV();
extern Void nc_init PV();
extern Void nc_setDevice PP((long newDevice));

char *nc_fgets PP((char *s, int n, FILE *stream));
char *nc_gets PP((char *s));

#define printf nc_printf 
#define fprintf nc_fprintf 
#define puts nc_puts
#undef putchar
#define putchar nc_putchar
#undef putc
#define putc nc_putc
#define fputs nc_fputs
#define gets nc_gets
#define fgets nc_fgets


#undef vextern

#endif /*NEWCRT_H*/

/* End. */

