diff options
| -rw-r--r-- | src/dispextern.h | 3 | ||||
| -rw-r--r-- | src/nsgui.h | 2 | ||||
| -rw-r--r-- | src/nsterm.m | 16 | ||||
| -rw-r--r-- | src/xdisp.c | 6 |
4 files changed, 24 insertions, 3 deletions
diff --git a/src/dispextern.h b/src/dispextern.h index 579665c2ff8..776d14080e5 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -74,10 +74,13 @@ typedef HDC XImagePtr_or_DC; | |||
| 74 | 74 | ||
| 75 | #ifdef HAVE_NS | 75 | #ifdef HAVE_NS |
| 76 | #include "nsgui.h" | 76 | #include "nsgui.h" |
| 77 | #define FACE_COLOR_TO_PIXEL(face_color, frame) ns_color_index_to_rgba(face_color, frame) | ||
| 77 | /* Following typedef needed to accommodate the MSDOS port, believe it or not. */ | 78 | /* Following typedef needed to accommodate the MSDOS port, believe it or not. */ |
| 78 | typedef struct ns_display_info Display_Info; | 79 | typedef struct ns_display_info Display_Info; |
| 79 | typedef Pixmap XImagePtr; | 80 | typedef Pixmap XImagePtr; |
| 80 | typedef XImagePtr XImagePtr_or_DC; | 81 | typedef XImagePtr XImagePtr_or_DC; |
| 82 | #else | ||
| 83 | #define FACE_COLOR_TO_PIXEL(face_color, frame) face_color | ||
| 81 | #endif | 84 | #endif |
| 82 | 85 | ||
| 83 | #ifdef HAVE_WINDOW_SYSTEM | 86 | #ifdef HAVE_WINDOW_SYSTEM |
diff --git a/src/nsgui.h b/src/nsgui.h index 4e7d7d35daa..f858fa7a14a 100644 --- a/src/nsgui.h +++ b/src/nsgui.h | |||
| @@ -73,6 +73,8 @@ typedef unichar XChar2b; | |||
| 73 | #define XCHAR2B_BYTE2(chp) \ | 73 | #define XCHAR2B_BYTE2(chp) \ |
| 74 | (*(chp) & 0x00ff) | 74 | (*(chp) & 0x00ff) |
| 75 | 75 | ||
| 76 | /* Used in xdisp.c when comparing faces and frame colors. */ | ||
| 77 | extern unsigned long ns_color_index_to_rgba(int idx, struct frame *f); | ||
| 76 | 78 | ||
| 77 | /* XXX: xfaces requires these structures, but the question is are we | 79 | /* XXX: xfaces requires these structures, but the question is are we |
| 78 | forced to use them? */ | 80 | forced to use them? */ |
diff --git a/src/nsterm.m b/src/nsterm.m index 07978c0d3b8..6ba867d27c0 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -2332,6 +2332,22 @@ ns_lisp_to_color (Lisp_Object color, NSColor **col) | |||
| 2332 | return 1; | 2332 | return 1; |
| 2333 | } | 2333 | } |
| 2334 | 2334 | ||
| 2335 | /* Convert an index into the color table into an RGBA value. Used in | ||
| 2336 | xdisp.c:extend_face_to_end_of_line when comparing faces and frame | ||
| 2337 | color values. */ | ||
| 2338 | |||
| 2339 | unsigned long | ||
| 2340 | ns_color_index_to_rgba(int idx, struct frame *f) | ||
| 2341 | { | ||
| 2342 | NSColor *col; | ||
| 2343 | col = ns_lookup_indexed_color (idx, f); | ||
| 2344 | |||
| 2345 | EmacsCGFloat r, g, b, a; | ||
| 2346 | [col getRed: &r green: &g blue: &b alpha: &a]; | ||
| 2347 | |||
| 2348 | return ARGB_TO_ULONG((int)(a*255), | ||
| 2349 | (int)(r*255), (int)(g*255), (int)(b*255)); | ||
| 2350 | } | ||
| 2335 | 2351 | ||
| 2336 | void | 2352 | void |
| 2337 | ns_query_color(void *col, XColor *color_def, int setPixel) | 2353 | ns_query_color(void *col, XColor *color_def, int setPixel) |
diff --git a/src/xdisp.c b/src/xdisp.c index a0113a05190..9a0752f2671 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -20287,7 +20287,7 @@ extend_face_to_end_of_line (struct it *it) | |||
| 20287 | if (FRAME_WINDOW_P (f) | 20287 | if (FRAME_WINDOW_P (f) |
| 20288 | && MATRIX_ROW_DISPLAYS_TEXT_P (it->glyph_row) | 20288 | && MATRIX_ROW_DISPLAYS_TEXT_P (it->glyph_row) |
| 20289 | && face->box == FACE_NO_BOX | 20289 | && face->box == FACE_NO_BOX |
| 20290 | && face->background == FRAME_BACKGROUND_PIXEL (f) | 20290 | && FACE_COLOR_TO_PIXEL (face->background, f) == FRAME_BACKGROUND_PIXEL (f) |
| 20291 | #ifdef HAVE_WINDOW_SYSTEM | 20291 | #ifdef HAVE_WINDOW_SYSTEM |
| 20292 | && !face->stipple | 20292 | && !face->stipple |
| 20293 | #endif | 20293 | #endif |
| @@ -20432,7 +20432,7 @@ extend_face_to_end_of_line (struct it *it) | |||
| 20432 | && (it->glyph_row->used[LEFT_MARGIN_AREA] | 20432 | && (it->glyph_row->used[LEFT_MARGIN_AREA] |
| 20433 | < WINDOW_LEFT_MARGIN_WIDTH (it->w)) | 20433 | < WINDOW_LEFT_MARGIN_WIDTH (it->w)) |
| 20434 | && !it->glyph_row->mode_line_p | 20434 | && !it->glyph_row->mode_line_p |
| 20435 | && default_face->background != FRAME_BACKGROUND_PIXEL (f)) | 20435 | && FACE_COLOR_TO_PIXEL (face->background, f) != FRAME_BACKGROUND_PIXEL (f)) |
| 20436 | { | 20436 | { |
| 20437 | struct glyph *g = it->glyph_row->glyphs[LEFT_MARGIN_AREA]; | 20437 | struct glyph *g = it->glyph_row->glyphs[LEFT_MARGIN_AREA]; |
| 20438 | struct glyph *e = g + it->glyph_row->used[LEFT_MARGIN_AREA]; | 20438 | struct glyph *e = g + it->glyph_row->used[LEFT_MARGIN_AREA]; |
| @@ -20473,7 +20473,7 @@ extend_face_to_end_of_line (struct it *it) | |||
| 20473 | && (it->glyph_row->used[RIGHT_MARGIN_AREA] | 20473 | && (it->glyph_row->used[RIGHT_MARGIN_AREA] |
| 20474 | < WINDOW_RIGHT_MARGIN_WIDTH (it->w)) | 20474 | < WINDOW_RIGHT_MARGIN_WIDTH (it->w)) |
| 20475 | && !it->glyph_row->mode_line_p | 20475 | && !it->glyph_row->mode_line_p |
| 20476 | && default_face->background != FRAME_BACKGROUND_PIXEL (f)) | 20476 | && FACE_COLOR_TO_PIXEL (face->background, f) != FRAME_BACKGROUND_PIXEL (f)) |
| 20477 | { | 20477 | { |
| 20478 | struct glyph *g = it->glyph_row->glyphs[RIGHT_MARGIN_AREA]; | 20478 | struct glyph *g = it->glyph_row->glyphs[RIGHT_MARGIN_AREA]; |
| 20479 | struct glyph *e = g + it->glyph_row->used[RIGHT_MARGIN_AREA]; | 20479 | struct glyph *e = g + it->glyph_row->used[RIGHT_MARGIN_AREA]; |