summaryrefslogtreecommitdiff
path: root/src/nsgui.h
diff options
context:
space:
mode:
authorRobert Pluim <rpluim@gmail.com>2018-11-29 15:26:44 +0100
committerRobert Pluim <rpluim@gmail.com>2018-11-30 08:55:02 +0100
commit5f67353da7af3ebb8fdf7bc4953e112fe1a33689 (patch)
tree2467748be3324b6c89f958cfbbe2d14f1b09b487 /src/nsgui.h
parent3b852da52fda327302956d263a3f916e3363cdd4 (diff)
downloademacs-5f67353da7af3ebb8fdf7bc4953e112fe1a33689.tar.gz
Convert NS face colors to RGBA when comparing with frame values
The NS port uses indexes into a color table to specify the colors of faces, whereas frames use RGBA pixel values. In extend_face_to_end_of_line the two needed to be compared to ensure that the backgrounds of certain faces are not extended to the edge of the window, which was failing because of this difference, thus causing a visual difference with other platforms. Convert from index to RGBA when doing such comparisons. * src/dispextern.h (FACE_COLOR_TO_PIXEL) [HAVE_NS]: New macro. Call ns_color_index_to_rgba under NS only. * src/nsgui.h: Add prototype for ns_color_index_to_rgba. * src/nsterm.m (ns_color_index_to_rgba): New function. Converts a color_table entry to corresponding RGBA pixel value. * src/xdisp.c (extend_face_to_end_of_line): Call FACE_COLOR_TO_PIXEL on face background color when comparing with frame color.
Diffstat (limited to 'src/nsgui.h')
-rw-r--r--src/nsgui.h2
1 files changed, 2 insertions, 0 deletions
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;
#define XCHAR2B_BYTE2(chp) \
(*(chp) & 0x00ff)
+/* Used in xdisp.c when comparing faces and frame colors. */
+extern unsigned long ns_color_index_to_rgba(int idx, struct frame *f);
/* XXX: xfaces requires these structures, but the question is are we
forced to use them? */