#include "DRW/drwwh.h"
#include "DRW/drwWwinit.h"
#include "DRW/drwWxdata.h"
#include "DRW/drwWredraw.h"
#include "DRW/drwUredraw.h"

#include "DRW/drwSetCols.h"
#include "DRW/drwLengths.h"
#include "DRW/drwWplot.h"


extern int cm;


void grid_cross(int x, int y)

{

int s;

s = 6;

drw_wimp_plotwindowline(pwd->uwd->barwin,
                        x - s,
                        y,
                        x + s,
                        y,
                        0,
                        FALSE);

drw_wimp_plotwindowline(pwd->uwd->barwin,
                        x,
                        y - s,
                        x,
                        y + s,
                        0,
                        FALSE);

}


void drw_u_redraw(wimp_draw *r,
                  int printing,
                  int page)

{

int xoff, yoff, x, y;

if (r->w == pwd->uwd->barwin)
 {
  drw_wimp_setforegroundcolour((os_colour) 160,
                               (os_colour) 160,
                               (os_colour) 160);

  xoff = drw_wimp_screentowork(pwd->uwd->barwin, r->clip.x0, 0, NULL) % cm;
  yoff = drw_wimp_screentowork(pwd->uwd->barwin, r->clip.y0, 1, NULL) % cm;

  for (x = r->clip.x0 - xoff - cm; x <=  r->clip.x1 + cm; x += cm)
   {
    for (y = r->clip.y0 - yoff - cm; y <= r->clip.y1 + cm; y += cm)
     grid_cross(x, y);
   }
 }

}


