home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume5 / xldimage / part02 / root.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-13  |  912 b   |  35 lines

  1. /* root.c:
  2.  *
  3.  * this loads an image onto the root window
  4.  *
  5.  * jim frost 10.03.89
  6.  *
  7.  * Copyright 1989 Jim Frost.  See included file "copyright.h" for complete
  8.  * copyright information.
  9.  */
  10.  
  11. #include "copyright.h"
  12. #include "xloadimage.h"
  13.  
  14. void imageOnRoot(disp, scrn, image, install, verbose)
  15.      Display      *disp;
  16.      int           scrn;
  17.      Image        *image;
  18.      unsigned int  install;
  19.      unsigned int  verbose;
  20. { Pixmap   pixmap;
  21.   Colormap xcmap;
  22.  
  23.   if (! sendImageToX(disp, scrn, DefaultVisual(disp, scrn), image,
  24.              &pixmap, &xcmap, verbose))
  25.     exit(1);
  26.   XSetWindowBackgroundPixmap(disp, RootWindow(disp, scrn), pixmap);
  27.   XSetWindowColormap(disp, RootWindow(disp, scrn), xcmap);
  28.   if (install)
  29.     XInstallColormap(disp, scrn, xcmap);
  30.   XClearWindow(disp, RootWindow(disp, scrn));
  31.   XFreeColormap(disp, xcmap);
  32.   XFreePixmap(disp, pixmap);
  33.   XSetCloseDownMode(disp, RetainPermanent);
  34. }
  35.