home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Enlightenment / enl_DR-0.10.tar.gz / enl_DR-0.10.tar / enl / root.c < prev    next >
C/C++ Source or Header  |  1997-06-22  |  1KB  |  40 lines

  1. #include "enlightenment.h"
  2.  
  3. void SetRoot(void)
  4. {
  5.    Image *root_im;
  6.    int w,h,dummy;
  7.    Pixmap pmap;
  8.    Window wdummy;
  9.    int im_w,im_h;
  10.    int r,g,b;
  11.    
  12.    if (!cfg.root_pname) return;
  13. /*   r=0,g=0;b=0;*/
  14. /*   XSetWindowBackground(disp,root,ImlibBestColorMatch(imd,&r,&g,&b));*/
  15. /*   XClearWindow(disp,root);*/
  16. /*   XSync(disp,False);*/
  17.    root_im=LoadImage(imd,cfg.root_pname,NULL);
  18.    if (!root_im) 
  19.      {
  20.     Alert("Oh Bummer!\n I didn't find the image:\n%s\n",cfg.root_pname);
  21.     return;
  22.      }
  23.    XGetGeometry(disp,root,&wdummy,&dummy,&dummy,&w,&h,&dummy,&dummy);
  24.    if (cfg.root_width==0) im_w=root_im->rgb_width;
  25.    else if (cfg.root_width==-1) im_w=w;
  26.    else im_w=cfg.root_width;
  27.    if (cfg.root_height==0) im_h=root_im->rgb_height;
  28.    else if (cfg.root_height==-1) im_h=h;
  29.    else im_w=cfg.root_height;
  30.    ImlibRender(imd,root_im,im_w,im_h);
  31.    pmap=ImlibMoveImageToPixmap(imd,root_im);
  32.    ImlibDestroyImage(imd,root_im);
  33.    XSetWindowBackgroundPixmap(disp,root,pmap);
  34.    XClearWindow(disp,root);
  35.    root_pm=pmap;
  36.    if (root_pm) XFreePixmap(disp,root_pm);
  37.    XSync(disp,0x00);
  38. }
  39.  
  40.