/* $Header:_clear.c 12.0$ */
/* $ACIS:_clear.c 12.0$ */
/* $Source: /ibm/acis/usr/src/usr.lib/libaed/RCS/_clear.c,v $ */

#ifndef lint
static char *rcsid = "$Header:_clear.c 12.0$";
#endif

#include "whim.h"
clear(n)
  INT16 n;		   /* number of words in next order */

   {
#include "whimdcl.h"
    /* if new order will not fit in buffer, transmit it */
    if ((vikoff+n) > 2047)
      VI_Force();

    /* if there are no orders already in buffer, initialize it */
    if (vikoff == 0)
       {
	vikint[VIKCMD] = 1; /* process orders */

	/* set parameters */
	vikint[ORMERGE] = parms.merge;	    /* merge mode */
	vikint[ORFONTID] = parms.fontid;	    /* font id */
	vikint[ORWIDTH] = parms.width;	    /* line width */
	vikint[ORDASHPAT] = parms.dashpat;     /* line dash pattern */
	vikint[ORDASHLEN] = parms.dashlen;     /* line pattern length */
	vikint[ORXPOSN] = parms.xposn;	    /* current x position */
	vikint[ORYPOSN] = parms.yposn;	    /* current y position */
	vikint[ORXORG] = 0;		    /* window origin */
	vikint[ORYORG] = 0;		    /* window origin */
	vikint[ORCLIPLX] = parms.cliplx;	    /* clip low x */
	vikint[ORCLIPLY] = parms.cliply;	    /* clip low x */
	vikint[ORCLIPHX] = parms.cliphx;	    /* clip high x */
	vikint[ORCLIPHY] = parms.cliphy;	    /* clip high y */
	vikint[ORCOLOR] = parms.color;	    /* window color */

	vikint[ORLEN] = 0;   /* will get set to actual length */

	/* start placing orders */
	vikoff = ORDATA;
      };
  }
