struct  IntuitionBase   *IntuitionBase; /* ptr to intuition.library */
struct  GfxBase         *GfxBase;       /* ptr to graphics.library  */
struct  Window *window; /* ptr to intuition window */

struct  RPort *rp;
        /* ^^^ pointer to our window's rastport (output structure) */

static char inputbuffer[80], outputbuffer[80], undobuffer[80];
        /* ^^^ three 80-char buffers for string gadgets */

    /* border data */
static SHORT borderpairs[] = { 0, 0, 259, 0, 259, 11, 0, 11, 0, 0 };
static SHORT gadgetpairs[] = { 0, 0, 99, 0, 99, 17, 0, 17, 0, 0 };
static SHORT togglepairs[] = { 0, 0, 91, 0, 91, 14, 0, 14, 0, 0 };

    /* IntuiText structures */
static struct IntuiText inputtext = { 1, 0, JAM1, -96, 0, NULL, (UBYTE *) "Input file:", NULL };
static struct IntuiText outputtext = { 1, 0, JAM1, -104, 0, NULL, (UBYTE *) "Output file:", NULL };
static struct IntuiText starttext = { 1, 0, JAM1, 24, 4, NULL, (UBYTE *) "START", NULL };
static struct IntuiText stoptext = { 1, 0, JAM1, 24, 4, NULL, (UBYTE *) "STOP", NULL };
static struct IntuiText formattext = { 1, 0, JAM1, 20, 1, NULL, (UBYTE *) "FORMAT", NULL };
static struct IntuiText indenttext = { 1, 0, JAM1, 4, 1, NULL, (UBYTE *) "AUTOINDENT", NULL };
static struct IntuiText cleartext = { 1, 0, JAM1, 20, 1, NULL, (UBYTE *) "CTRL-L", NULL };

    /* border structures, after border data to set addresses */
static struct Border stringborder = { -2, -2, 1, 0, JAM1, 5, &borderpairs, NULL };
static struct Border shadowborder = { -1, -1, 2, 0, JAM1, 5, &borderpairs, &stringborder };
static struct Border gadgetborder = { -2, -2, 1, 0, JAM1, 5, &gadgetpairs, NULL };
static struct Border gadgetshadow = { -1, -1, 2, 0, JAM1, 5, &gadgetpairs, &gadgetborder };
static struct Border toggleborder = { -2, -2, 1, 0, JAM1, 5, &togglepairs, NULL };
static struct Border toggleshadow = { -1, -1, 2, 0, JAM1, 5, &togglepairs, &toggleborder };

    /* extra gadget info; for string gadgets */
static struct StringInfo inputinfo = { inputbuffer, undobuffer, NULL, 79, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
static struct StringInfo outputinfo = { outputbuffer, undobuffer, NULL, 79, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };

    /* gadget definitions */
static struct Gadget fileinputgadget =
    {
    NULL,
    128, 16, 256, 8, /* LeftEdge, TopEdge, Width, Height, */
    GADGHCOMP, RELVERIFY,  /* Flags, Activation, */
    STRGADGET, &shadowborder, NULL, &inputtext, NULL, &inputinfo, 1, NULL
    };

static struct Gadget fileoutputgadget =
    {
    &fileinputgadget,
    128, 31, 256, 8, /* LeftEdge, TopEdge, Width, Height, */
    GADGHCOMP, RELVERIFY,  /* Flags, Activation, */
    STRGADGET, &shadowborder, NULL, &outputtext, NULL, &outputinfo, 2, NULL
    };

static struct Gadget startgadget =
    {
    &fileoutputgadget,
    64, 52, 96, 15, /* LeftEdge, TopEdge, Width, Height, */
    GADGHCOMP, RELVERIFY,  /* Flags, Activation, */
    BOOLGADGET, &gadgetshadow, NULL, &starttext, NULL, NULL, 3, NULL
    };

static struct Gadget stopgadget =
    {
    &startgadget,
    240, 52, 96, 15, /* LeftEdge, TopEdge, Width, Height, */
    GADGHCOMP | GADGDISABLED, RELVERIFY,  /* Flags, Activation, */
    BOOLGADGET, &gadgetshadow, NULL, &stoptext, NULL, NULL, 4, NULL
    };

static struct Gadget formatgadget =
    {
    &stopgadget,
    424, 19, 88, 11, /* LeftEdge, TopEdge, Width, Height, */
    GADGHCOMP | SELECTED, RELVERIFY | TOGGLESELECT,  /* Flags, Activation, */
    BOOLGADGET, &toggleshadow, NULL, &formattext, NULL, NULL, 5, NULL
    };

static struct Gadget indentgadget =
    {
    &formatgadget,
    424, 35, 88, 11, /* LeftEdge, TopEdge, Width, Height, */
    GADGHCOMP | SELECTED, RELVERIFY | TOGGLESELECT, /* Flags, Activation, */
    BOOLGADGET, &toggleshadow, NULL, &indenttext, NULL, NULL, 6, NULL
    };

static struct Gadget cleargadget =
    {
    &indentgadget,
    424, 51, 88, 11, /* LeftEdge, TopEdge, Width, Height, */
    GADGHCOMP | SELECTED, RELVERIFY | TOGGLESELECT,  /* Flags, Activation, */
    BOOLGADGET, &toggleshadow, NULL, &cleartext, NULL, NULL, 7, NULL
    };

    /* window definition */
static struct NewWindow MainWindow =
    {
    64, 11,         /* LeftEdge, TopEdge, */
    560, 84,        /* Width, Height, */
    2, 1,           /* DetailPen, BlockPen, */
    REFRESHWINDOW |
    GADGETUP |
    CLOSEWINDOW,    /* IDCMP flags, */
    WINDOWCLOSE |
    WINDOWDRAG |
    WINDOWDEPTH |
    SIMPLE_REFRESH,  /* Flags, */
    &cleargadget,    /* first gadget in list */
    NULL,
    (UBYTE *) "FileLab V0.85 by Chris Papademetrious",
    NULL, NULL,
    0, 0, 0, 0,     /* min width/height, max width/height */
    WBENCHSCREEN    /* window type */
    };