#ifndef _PICO_SCREEN_H_
#define _PICO_SCREEN_H_

#ifndef __stdio_h
#include <stdio.h>
#endif
#ifndef __stdlib_h
#include <stdlib.h>
#endif

typedef struct {
 short width,height;                                    /* text window size */
 short foreground,background;                       /* current text colours */
 char standout;                /* standout flag - 1=reverse video, 0=normal */
 char redraw;         /* redraw flag - 1=next refresh redraws entire screen */
 short *screen;                   /* contents of screen (to be manipulated) */
 short *curscr;            /* actual current contents of screen (displayed) */
 short x,y;                      /* current x,y positions (0,0 is top left) */
 int oldx,oldy;          /* return values from initial *FX 4 cursor command */
 short cminx,cminy;                               /* min x,y of changed box */
 short cmaxx,cmaxy;                               /* max x,y of changed box */
} Screendata;

int init_screen(Screendata *);  /* initialise screen & Screendata structure */
void end_screen(Screendata *);                 /* put screen back to normal */
void refresh(Screendata *);                              /* refresh display */
void redraw(Screendata *);             /* redraw entire screen from scratch */
void addstr(Screendata *,char *);         /* put string at current position */
void addch(Screendata *,int);   /* put single character at current position */
void move(Screendata *,int,int);                    /* move to new position */
int standout(Screendata *,char);                    /* inverse video on/off */
int readchar(void);                   /* read a character from the keyboard */

#endif
