
#include <exec/types.h>
#include <exec/lists.h>
#include <exec/execbase.h>
#include <exec/memory.h>
#include <libraries/gadtools.h>
#include <libraries/asl.h>
#include <dos/dos.h>
#include <intuition/screens.h>
#include <intuition/intuition.h>
#include <intuition/gadgetclass.h>
#include <intuition/sghooks.h>
#include <workbench/startup.h>
#include <workbench/workbench.h>
#include <graphics/view.h>
#include <graphics/gfxmacros.h>
#include "rexx/storage.h"
#include "rexx/rxslib.h"
#include "rexx/rexxio.h"
#include "rexx/errors.h"
#include <ctype.h>

/* Prototypes */
#include <clib/exec_protos.h>
#include <clib/intuition_protos.h>
#include <clib/graphics_protos.h>
#include <clib/gadtools_protos.h>
#include <clib/asl_protos.h>
#include <clib/dos_protos.h>
#include <clib/alib_protos.h>
#include <clib/rexxsyslib_protos.h>

struct linkgad {
  struct Node   lg_node;
  char         *lg_linknode;
  short         lg_line;
  short         lg_xs;
  short         lg_xe;
};

struct mynode {
  struct Node   mn_node;
  char         *mn_prev;
  char         *mn_next;
  char         *mn_toc;
  char        **mn_txtline;
  BYTE          mn_headline;
  BYTE          mn_hasprev;
  BYTE          mn_hasnext;
  BYTE          mn_hastoc;
  struct List   mn_linkgads;
  int           mn_linum;
  int           mn_offset;
};


#define GD_cursor                1
#define GD_scroller              2
#define GD_Gad_return       0x0013
#define GD_Gad_nextpage     0x0036
#define GD_Gad_prevpage     0x0019
#define GD_Gad_firstpage    0x0023
#define GD_Gad_load         0x0028
#define GD_Gad_sleep        0x0021

#define STATE_NEWLINE    0
#define STATE_TXTLINE    1
#define STATE_TXTLINE1   2
#define STATE_LINKINLINE 3
#define STATE_NODE       4
#define STATE_ENDNODE    5
#define STATE_LINKNODE   6
#define STATE_COMMENT    7
#define STATE_WIDTH      8
#define STATE_HEIGHT     9
#define STATE_TOC       10
#define STATE_DATABASE  11
#define STATE_MASTER    12
#define STATE_NEXT      13
#define STATE_PREV      14

#define NEWNODE_OK            0
#define NEWNODE_NODENOTFOUND  5
#define NEWNODE_DOCNOTFOUND  10
#define NEWNODE_WINNOTOPENED 20

#define XS   6
#define YS  14
#define XE 622
#define YE 172
#define XL 616
#define YL 163

#define SCROLLERWIDTH 12
#define BUTTONHEIGHT  15
#define LINEHEIGHT     9

#define  MSG struct Message
#define IMSG struct IntuiMessage
#define AMSG struct AppMessage
#define RMSG struct RexxMsg
#define MSGP struct MsgPort
#define RARG struct RexxArg

#define MPC  MEMF_PUBLIC|MEMF_CLEAR

#define Prototype extern

#include "hyper-protos.h"

/*  #define DEBUG 1  */

