# include "Ximage.h"

void Refresh () {

  int i, Nsection;
  Graphic *graphic;
  Section *section;

  if (!USE_XWINDOW) return;
  if (HAVE_BACKING) return;

  graphic = GetGraphic();
  
  /* XClearWindow   (graphic.display, graphic.window); */
  XSetForeground (graphic->display, graphic->gc, graphic->back);
  XFillRectangle (graphic->display, graphic->window, graphic->gc, 0, 0, graphic->dx, graphic->dy);
  XSetForeground (graphic->display, graphic->gc, graphic->fore);
  
  // reset the sizes for all sections
  Nsection = GetNumberOfSections ();
  for (i = 0; i < Nsection; i++) {
      section = GetSectionByNumber (i);
      DrawImage (section->image);
      DrawGraph (section->graph);
  }

  FlushDisplay ();
}

