Mercurial > hg > xemacs-beta
comparison src/redisplay-x.c @ 219:262b8bb4a523 r20-4b8
Import from CVS: tag r20-4b8
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:09:35 +0200 |
parents | d44af0c54775 |
children | e70b3a057e12 |
comparison
equal
deleted
inserted
replaced
218:c9f226976f56 | 219:262b8bb4a523 |
---|---|
1699 unsigned long background, | 1699 unsigned long background, |
1700 unsigned long core_background) | 1700 unsigned long core_background) |
1701 { | 1701 { |
1702 struct device *d = XDEVICE (f->device); | 1702 struct device *d = XDEVICE (f->device); |
1703 Display *dpy = DEVICE_X_DISPLAY (d); | 1703 Display *dpy = DEVICE_X_DISPLAY (d); |
1704 Colormap cmap = | 1704 Colormap cmap = DEVICE_X_COLORMAP (d); |
1705 DefaultColormapOfScreen (XtScreen ((Widget) FRAME_X_TEXT_WIDGET (f))); | 1705 Visual *visual = DEVICE_X_VISUAL (d); |
1706 | 1706 |
1707 XColor topc, botc; | 1707 XColor topc, botc; |
1708 int top_frobbed = 0, bottom_frobbed = 0; | 1708 int top_frobbed = 0, bottom_frobbed = 0; |
1709 | 1709 |
1710 /* If the top shadow is the same color as the background, try to | 1710 /* If the top shadow is the same color as the background, try to |
1715 XQueryColor (dpy, cmap, &topc); | 1715 XQueryColor (dpy, cmap, &topc); |
1716 /* don't overflow/wrap! */ | 1716 /* don't overflow/wrap! */ |
1717 topc.red = MINL (65535, (unsigned long) topc.red * 6 / 5); | 1717 topc.red = MINL (65535, (unsigned long) topc.red * 6 / 5); |
1718 topc.green = MINL (65535, (unsigned long) topc.green * 6 / 5); | 1718 topc.green = MINL (65535, (unsigned long) topc.green * 6 / 5); |
1719 topc.blue = MINL (65535, (unsigned long) topc.blue * 6 / 5); | 1719 topc.blue = MINL (65535, (unsigned long) topc.blue * 6 / 5); |
1720 if (allocate_nearest_color (dpy, cmap, &topc)) | 1720 if (allocate_nearest_color (dpy, cmap, visual, &topc)) |
1721 { | 1721 { |
1722 *top_shadow = topc.pixel; | 1722 *top_shadow = topc.pixel; |
1723 top_frobbed = 1; | 1723 top_frobbed = 1; |
1724 } | 1724 } |
1725 } | 1725 } |
1731 botc.pixel = background; | 1731 botc.pixel = background; |
1732 XQueryColor (dpy, cmap, &botc); | 1732 XQueryColor (dpy, cmap, &botc); |
1733 botc.red = (unsigned short) ((unsigned long) botc.red * 3 / 5); | 1733 botc.red = (unsigned short) ((unsigned long) botc.red * 3 / 5); |
1734 botc.green = (unsigned short) ((unsigned long) botc.green * 3 / 5); | 1734 botc.green = (unsigned short) ((unsigned long) botc.green * 3 / 5); |
1735 botc.blue = (unsigned short) ((unsigned long) botc.blue * 3 / 5); | 1735 botc.blue = (unsigned short) ((unsigned long) botc.blue * 3 / 5); |
1736 if (allocate_nearest_color (dpy, cmap, &botc)) | 1736 if (allocate_nearest_color (dpy, cmap, visual, &botc)) |
1737 { | 1737 { |
1738 *bottom_shadow = botc.pixel; | 1738 *bottom_shadow = botc.pixel; |
1739 bottom_frobbed = 1; | 1739 bottom_frobbed = 1; |
1740 } | 1740 } |
1741 } | 1741 } |