#include <intuition/intuition.h>
#include <intuition/screens.h>
  
#undef TRUE
#undef FALSE
#include "curses.h"
  
/*
 *
 * Module      : acurses.h
 *
 * Description : Header file for AMIGA CURSES package.
 *
 * Author      : Simon Raybould  (sie@fulcrum.bt.co.uk)
 *
 * Date        : 16th February 1990
 *
 */
  
  
#define MAXTEXTLEN    80    /* Max text to an output call */
#define SOUNDLENGTH    2    /* Number of bytes in the sound wave */
#define CAPSMASK    0x07    /* leftshift | rightshift | capslock */
#define SHIFTMASK    0x03    /* leftshift | rightshift */
  
/*
 *    Characters
 */
  
#define BS            0x08    /* Backspace */
#define CR            0x0d    /* Carriage return */
  
/*
 *    My Flags. These are global to all windows, not window specific.
 */

#define CFLAG_CURSOR    (1<<0)    /* T=Cursor on, F=Cursor off. */
#define CFLAG_CBREAK    (1<<1)    /* T=cbreak mode, F=nocbreak mode */
#define CFLAG_NLCR    (1<<2)    /* T=nl to cr mapping, F=no mapping */
#define    CFLAG_ECHO    (1<<3)    /* T=Echo enabled, F=no echo */
#define    CFLAG_INITSCR    (1<<4)    /* T=initscr has been called */

/*
 *    WINDOW flags, these are specific to each window.
 */

#define CWF_MOVED    (1<<0)    /* move() has been done on this window */

/*
 *    Buffer size for raw key events.
 */
#define RAWBUFSIZ    32

/*
 *    Scroll directions
 */
#define SCROLL_UP    1
#define SCROLL_DOWN    2

/*
 *    Internal structures.
 */

struct LineElement {
  unsigned char Touched;    /* This line needs refreshing */
  char *Line;    /* Actual text */
  char *LRLine;    /* text when last refreshed */
  short *ATTRS;    /* Attributes */
  short *LRATTRS;    /* Attributes when last refreshed */
  unsigned char StartCol;
  unsigned char EndCol;
};

struct WindowState {
  WINDOW *ParentWin;
  WINDOW Window;
  short ScrollTop;
  short ScrollBot;
  struct WindowState *Prev;
  struct WindowState *Next;
  struct LineElement *LnArry;
  unsigned char NLines;
};

/*
 *    Simple implementation of wnoutrefresh() and doupdate()
 */

struct RefreshElement {
  WINDOW *WinPtr;
  struct RefreshElement *Next;
};
