1 | /*--------------------------------*-C-*---------------------------------* |
1 | /*--------------------------------*-C-*---------------------------------* |
2 | * File: xpm.c |
2 | * File: xpm.c |
3 | *----------------------------------------------------------------------* |
3 | *----------------------------------------------------------------------* |
4 | * $Id: xpm.C,v 1.9 2004/02/13 12:16:21 pcg Exp $ |
4 | * $Id: xpm.C,v 1.11 2004/04/02 20:41:01 pcg Exp $ |
5 | * |
5 | * |
6 | * All portions of code are copyright by their respective author/s. |
6 | * All portions of code are copyright by their respective author/s. |
7 | * Copyright (c) 1997 Carsten Haitzler <raster@zip.com.au> |
7 | * Copyright (c) 1997 Carsten Haitzler <raster@zip.com.au> |
8 | * Copyright (c) 1997,1998 Oezguer Kesim <kesim@math.fu-berlin.de> |
8 | * Copyright (c) 1997,1998 Oezguer Kesim <kesim@math.fu-berlin.de> |
9 | * Copyright (c) 1998-2001 Geoff Wing <gcw@pobox.com> |
9 | * Copyright (c) 1998-2001 Geoff Wing <gcw@pobox.com> |
… | |
… | |
67 | if (!STRCMP (geom, "?")) |
67 | if (!STRCMP (geom, "?")) |
68 | { |
68 | { |
69 | sprintf (str, "[%dx%d+%d+%d]", /* can't presume snprintf () ! */ |
69 | sprintf (str, "[%dx%d+%d+%d]", /* can't presume snprintf () ! */ |
70 | min (bgpixmap->w, 9999), min (bgpixmap->h, 9999), |
70 | min (bgpixmap->w, 9999), min (bgpixmap->h, 9999), |
71 | min (bgpixmap->x, 9999), min (bgpixmap->y, 9999)); |
71 | min (bgpixmap->x, 9999), min (bgpixmap->y, 9999)); |
72 | xterm_seq (XTerm_title, str, CHAR_ST); |
72 | process_xterm_seq (XTerm_title, str, CHAR_ST); |
73 | free (str); |
73 | free (str); |
74 | return 0; |
74 | return 0; |
75 | } |
75 | } |
76 | |
76 | |
77 | if ((p = STRCHR (geom, ';')) == NULL) |
77 | if ((p = STRCHR (geom, ';')) == NULL) |
… | |
… | |
375 | if (f == NULL |
375 | if (f == NULL |
376 | || XpmReadFileToPixmap (display->display, display->root, f, |
376 | || XpmReadFileToPixmap (display->display, display->root, f, |
377 | &bgPixmap.pixmap, NULL, |
377 | &bgPixmap.pixmap, NULL, |
378 | &xpmAttr)) |
378 | &xpmAttr)) |
379 | { |
379 | { |
380 | char *p; |
380 | char *p; |
381 | |
381 | |
382 | /* semi-colon delimited */ |
382 | /* semi-colon delimited */ |
383 | if ((p = STRCHR (file, ';')) == NULL) |
383 | if ((p = STRCHR (file, ';')) == NULL) |
384 | p = STRCHR (file, '\0'); |
384 | p = STRCHR (file, '\0'); |
385 | |
385 | |
386 | rxvt_print_error ("couldn't load XPM file \"%.*s\"", (p - file), |
386 | rxvt_warn ("couldn't load XPM file \"%.*s\", ignoring.", (p - file), file); |
387 | file); |
|
|
388 | } |
387 | } |
|
|
388 | |
389 | free (f); |
389 | free (f); |
390 | } |
390 | } |
|
|
391 | |
391 | resize_pixmap (); |
392 | resize_pixmap (); |
392 | return bgPixmap.pixmap; |
393 | return bgPixmap.pixmap; |
393 | } |
394 | } |
394 | |
395 | |
395 | #endif /* XPM_BACKGROUND */ |
396 | #endif /* XPM_BACKGROUND */ |