ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/xpm.C
(Generate patch)

Comparing rxvt-unicode/src/xpm.C (file contents):
Revision 1.14 by root, Mon Aug 2 04:20:48 2004 UTC vs.
Revision 1.17 by root, Sun Aug 15 22:09:24 2004 UTC

61#define MAXLEN_GEOM sizeof("[1000x1000+1000+1000]") 61#define MAXLEN_GEOM sizeof("[1000x1000+1000+1000]")
62 62
63 if (geom == NULL) 63 if (geom == NULL)
64 return 0; 64 return 0;
65 str = (char *)rxvt_malloc (MAXLEN_GEOM + 1); 65 str = (char *)rxvt_malloc (MAXLEN_GEOM + 1);
66 if (!STRCMP (geom, "?")) 66 if (!strcmp (geom, "?"))
67 { 67 {
68 sprintf (str, "[%dx%d+%d+%d]", /* can't presume snprintf () ! */ 68 sprintf (str, "[%dx%d+%d+%d]", /* can't presume snprintf () ! */
69 min (bgpixmap->w, 9999), min (bgpixmap->h, 9999), 69 min (bgpixmap->w, 9999), min (bgpixmap->h, 9999),
70 min (bgpixmap->x, 9999), min (bgpixmap->y, 9999)); 70 min (bgpixmap->x, 9999), min (bgpixmap->y, 9999));
71 process_xterm_seq (XTerm_title, str, CHAR_ST); 71 process_xterm_seq (XTerm_title, str, CHAR_ST);
72 free (str); 72 free (str);
73 return 0; 73 return 0;
74 } 74 }
75 75
76 if ((p = STRCHR (geom, ';')) == NULL) 76 if ((p = strchr (geom, ';')) == NULL)
77 p = STRCHR (geom, '\0'); 77 p = strchr (geom, '\0');
78 n = (p - geom); 78 n = (p - geom);
79 if (n <= MAXLEN_GEOM) 79 if (n <= MAXLEN_GEOM)
80 { 80 {
81 STRNCPY (str, geom, n); 81 strncpy (str, geom, n);
82 str[n] = '\0'; 82 str[n] = '\0';
83 83
84 flags = XParseGeometry (str, &x, &y, &w, &h); 84 flags = XParseGeometry (str, &x, &y, &w, &h);
85 if (!flags) 85 if (!flags)
86 { 86 {
168 XFreePixmap (display->display, TermWin.pixmap); 168 XFreePixmap (display->display, TermWin.pixmap);
169 169
170 if (bgPixmap.pixmap == None) 170 if (bgPixmap.pixmap == None)
171 { /* So be it: I'm not using pixmaps */ 171 { /* So be it: I'm not using pixmaps */
172 TermWin.pixmap = None; 172 TermWin.pixmap = None;
173 if (! (Options & Opt_transparent) || am_transparent == 0) 173 if (! (options & Opt_transparent) || am_transparent == 0)
174 XSetWindowBackground (display->display, TermWin.vt, 174 XSetWindowBackground (display->display, TermWin.vt,
175 PixColors[Color_bg]); 175 pix_colors[Color_bg]);
176 return; 176 return;
177 } 177 }
178 178
179 gcvalue.foreground = PixColors[Color_bg]; 179 gcvalue.foreground = pix_colors[Color_bg];
180 gc = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue); 180 gc = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue);
181 181
182 if (bgPixmap.pixmap != None) 182 if (bgPixmap.pixmap != None)
183 { /* we have a specified pixmap */ 183 { /* we have a specified pixmap */
184 unsigned int w = bgPixmap.w, h = bgPixmap.h, 184 unsigned int w = bgPixmap.w, h = bgPixmap.h,
350 if (bgPixmap.pixmap != None) 350 if (bgPixmap.pixmap != None)
351 { 351 {
352 XFreePixmap (display->display, bgPixmap.pixmap); 352 XFreePixmap (display->display, bgPixmap.pixmap);
353 bgPixmap.pixmap = None; 353 bgPixmap.pixmap = None;
354 } 354 }
355 XSetWindowBackground (display->display, TermWin.vt, PixColors[Color_bg]); 355 XSetWindowBackground (display->display, TermWin.vt, pix_colors[Color_bg]);
356 356
357 if (*file != '\0') 357 if (*file != '\0')
358 { 358 {
359 /* XWindowAttributes attr; */ 359 /* XWindowAttributes attr; */
360 360
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_warn ("couldn't load XPM file \"%.*s\", ignoring.", (p - file), file); 386 rxvt_warn ("couldn't load XPM file \"%.*s\", ignoring.", (p - file), file);
387 } 387 }
388 388
389 free (f); 389 free (f);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines