rem: } } else if (timage) { w = timage->width; h = timage->height;  if (w - TEXPREV_WIDTH > h - TEXPREV_HEIGHT) { h = (w * TEXPREV_HEIGHT)/TEXPREV_WIDTH; } else { w = (h * TEXPREV_WIDTH)/TEXPREV_HEIGHT;
add: break; case 'C': image = RMakeCenteredImage(timage, width, height, &color); RDestroyImage(timage); timage = image; break; case 'S': case 'M': image = RScaleImage(timage, width, height); RDestroyImage(timage); timage = image; break;
context: renderTexture(WMScreen *scr, proplist_t texture, int width, int height,	      char *path, int border){    char *type;    RImage *image;    Pixmap pixmap;    RContext *rc = WMScreenRContext(scr);    char *str;    RColor rcolor;    type = PLGetString(PLGetArrayElement(texture, 0));    image = RCreateImage(width, height, False);    if (strcasecmp(type, "solid")==0) {	str = PLGetString(PLGetArrayElement(texture, 1));	str2rcolor(rc, str, &rcolor);	RClearImage(image, &rcolor);    } else if (strcasecmp(&type[1], "gradient")==0) {	int style;	RColor rcolor2;	switch (toupper(type[0])) {	 case 'V':	    style = RVerticalGradient;	    break;	 case 'H':	    style = RHorizontalGradient;	    break;	 case 'D':	    style = RDiagonalGradient;	    break;	}	str = PLGetString(PLGetArrayElement(texture, 1));	str2rcolor(rc, str, &rcolor);	str = PLGetString(PLGetArrayElement(texture, 2));	str2rcolor(rc, str, &rcolor2);		image = RRenderGradient(width, height, &rcolor, &rcolor2, style);    } else if (strcasecmp(&type[2], "gradient")==0) {	int style;	RColor **colors;	int i, j;	switch (toupper(type[1])) {	 case 'V':	    style = RVerticalGradient;	    break;	 case 'H':	    style = RHorizontalGradient;	    break;	 case 'D':	    style = RDiagonalGradient;	    break;	}	j = PLGetNumberOfElements(texture);		if (j > 0) {	    colors = wmalloc(j * sizeof(RColor*));	    for (i = 2; i < j; i++) {		str = PLGetString(PLGetArrayElement(texture, i));		colors[i-2] = wmalloc(sizeof(RColor));		str2rcolor(rc, str, colors[i-2]);	    }	    colors[i-2] = NULL;	    image = RRenderMultiGradient(width, height, colors, style);	    	    for (i = 0; colors[i]!=NULL; i++)		free(colors[i]);	    free(colors);	}    } else if (strcasecmp(&type[1], "pixmap")==0) {	int style;	RImage *timage;	int w, h;	char *path;	str = PLGetString(PLGetArrayElement(texture, 1));	path = wfindfileinarray(GetObjectForKey("PixmapPath"), str);	timage = RLoadImage(rc, path, 0);	free(path);		if (toupper(type[0]) == 'T') {	    if (timage->width < TEXPREV_WIDTH 		|| timage->height < TEXPREV_HEIGHT) {		image = RMakeTiledImage(timage, TEXPREV_WIDTH, TEXPREV_HEIGHT);		RDestroyImage(timage);		timage = image;	    }	} else if (timage) {	    w = timage->width;	    h = timage->height;		    if (w - TEXPREV_WIDTH > h - TEXPREV_HEIGHT) {		h = (w * TEXPREV_HEIGHT)/TEXPREV_WIDTH;	    } else {		w = (h * TEXPREV_WIDTH)/TEXPREV_HEIGHT;	    }	    image = RScaleImage(timage, w, h);	    RDestroyImage(timage);	    timage = image;	}    }    if (path) {	dumpRImage(path, image);    }        if (border) {	RBevelImage(image, border);    }    RConvertImage(rc, image, &pixmap);    RDestroyImage(image);    return pixmap;}