diff options
| author | Jason Rumney | 2007-12-02 16:18:47 +0000 |
|---|---|---|
| committer | Jason Rumney | 2007-12-02 16:18:47 +0000 |
| commit | 44b1dc2e970d46690fba94b0ae726053198552ea (patch) | |
| tree | ff11c92e0687b8625a968d0607a700ca56223edc | |
| parent | 1a39318ad320b6c9dc9021a858711938a8a6105f (diff) | |
| download | emacs-44b1dc2e970d46690fba94b0ae726053198552ea.tar.gz emacs-44b1dc2e970d46690fba94b0ae726053198552ea.zip | |
(xbm_load) [WINDOWSNT]: Shuffle the bits of directly specified XBMs.
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/image.c | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 90768f33c4c..002c442b376 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2007-12-02 Jason Rumney <jasonr@gnu.org> | ||
| 2 | |||
| 3 | * image.c (xbm_load) [WINDOWSNT]: Shuffle the bits of directly | ||
| 4 | specified XBMs. | ||
| 5 | |||
| 1 | 2007-12-01 Richard Stallman <rms@gnu.org> | 6 | 2007-12-01 Richard Stallman <rms@gnu.org> |
| 2 | 7 | ||
| 3 | * xdisp.c (syms_of_xdisp) <scroll-conservatively>: Doc fix. | 8 | * xdisp.c (syms_of_xdisp) <scroll-conservatively>: Doc fix. |
diff --git a/src/image.c b/src/image.c index 28214642c3a..a92578862f0 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -3120,6 +3120,8 @@ convert_mono_to_color_image (f, img, foreground, background) | |||
| 3120 | release_frame_dc (f, hdc); | 3120 | release_frame_dc (f, hdc); |
| 3121 | old_prev = SelectObject (old_img_dc, img->pixmap); | 3121 | old_prev = SelectObject (old_img_dc, img->pixmap); |
| 3122 | new_prev = SelectObject (new_img_dc, new_pixmap); | 3122 | new_prev = SelectObject (new_img_dc, new_pixmap); |
| 3123 | /* Windows convention for mono bitmaps is black = background, | ||
| 3124 | white = foreground. */ | ||
| 3123 | SetTextColor (new_img_dc, background); | 3125 | SetTextColor (new_img_dc, background); |
| 3124 | SetBkColor (new_img_dc, foreground); | 3126 | SetBkColor (new_img_dc, foreground); |
| 3125 | 3127 | ||
| @@ -3515,6 +3517,19 @@ xbm_load (f, img) | |||
| 3515 | else | 3517 | else |
| 3516 | bits = XBOOL_VECTOR (data)->data; | 3518 | bits = XBOOL_VECTOR (data)->data; |
| 3517 | 3519 | ||
| 3520 | #ifdef WINDOWSNT | ||
| 3521 | { | ||
| 3522 | char *invertedBits; | ||
| 3523 | int nbytes, i; | ||
| 3524 | /* Windows mono bitmaps are reversed compared with X. */ | ||
| 3525 | invertedBits = bits; | ||
| 3526 | nbytes = (img->width + BITS_PER_CHAR - 1) / BITS_PER_CHAR | ||
| 3527 | * img->height; | ||
| 3528 | bits = (char *) alloca(nbytes); | ||
| 3529 | for (i = 0; i < nbytes; i++) | ||
| 3530 | bits[i] = XBM_BIT_SHUFFLE (invertedBits[i]); | ||
| 3531 | } | ||
| 3532 | #endif | ||
| 3518 | /* Create the pixmap. */ | 3533 | /* Create the pixmap. */ |
| 3519 | 3534 | ||
| 3520 | Create_Pixmap_From_Bitmap_Data (f, img, bits, | 3535 | Create_Pixmap_From_Bitmap_Data (f, img, bits, |