# include "Ximage.h"

int SetImageData (int sock) {
  
  int i;
  double xmin, xmax, ymin, ymax;
  Graphic *graphic;
  Section *section;
  KapaImageWidget *image;

  graphic = GetGraphic();

  section = GetActiveSection();
  if (section->image == NULL) {
    section->image = InitImage ();
    SetSectionSizes (section);
  }
  image = section->image;
  
  // get image data from client 
  KiiScanMessage (sock, "%lf %lf %s", 
		  &image[0].zero, 
		  &image[0].range, 
		  image[0].name, 
		  image[0].file);

  // XXX when we go to 32bit, this should remap the image
  // if (USE_XWINDOW) XClearWindow (graphic->display, graphic->window);
  // Refresh (1);

  return (TRUE);  
}

int GetImageData (int sock) {
  
  Section *section;
  KapaImageWidget *image;

  section = GetActiveSection();
  if (section->image == NULL) {
    section->image = InitImage ();
    SetSectionSizes (section);
  }
  image = section->image;

  KiiSendMessage (sock, "%g %g %s %s", 
		  image[0].zero,
		  image[0].range,
		  image[0].name,
		  image[0].file);

  return (TRUE);
}
