#ifdef HAVE_NS
#include "nsgui.h"
+#define FACE_COLOR_TO_PIXEL(face_color, frame) ns_color_index_to_rgba(face_color, frame)
/* Following typedef needed to accommodate the MSDOS port, believe it or not. */
typedef struct ns_display_info Display_Info;
typedef Pixmap XImagePtr;
typedef XImagePtr XImagePtr_or_DC;
+#else
+#define FACE_COLOR_TO_PIXEL(face_color, frame) face_color
#endif
#ifdef HAVE_WINDOW_SYSTEM
#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? */
return 1;
}
+/* Convert an index into the color table into an RGBA value. Used in
+ xdisp.c:extend_face_to_end_of_line when comparing faces and frame
+ color values. */
+
+unsigned long
+ns_color_index_to_rgba(int idx, struct frame *f)
+{
+ NSColor *col;
+ col = ns_lookup_indexed_color (idx, f);
+
+ EmacsCGFloat r, g, b, a;
+ [col getRed: &r green: &g blue: &b alpha: &a];
+
+ return ARGB_TO_ULONG((int)(a*255),
+ (int)(r*255), (int)(g*255), (int)(b*255));
+}
void
ns_query_color(void *col, XColor *color_def, int setPixel)
if (FRAME_WINDOW_P (f)
&& MATRIX_ROW_DISPLAYS_TEXT_P (it->glyph_row)
&& face->box == FACE_NO_BOX
- && face->background == FRAME_BACKGROUND_PIXEL (f)
+ && FACE_COLOR_TO_PIXEL (face->background, f) == FRAME_BACKGROUND_PIXEL (f)
#ifdef HAVE_WINDOW_SYSTEM
&& !face->stipple
#endif
&& (it->glyph_row->used[LEFT_MARGIN_AREA]
< WINDOW_LEFT_MARGIN_WIDTH (it->w))
&& !it->glyph_row->mode_line_p
- && default_face->background != FRAME_BACKGROUND_PIXEL (f))
+ && FACE_COLOR_TO_PIXEL (face->background, f) != FRAME_BACKGROUND_PIXEL (f))
{
struct glyph *g = it->glyph_row->glyphs[LEFT_MARGIN_AREA];
struct glyph *e = g + it->glyph_row->used[LEFT_MARGIN_AREA];
&& (it->glyph_row->used[RIGHT_MARGIN_AREA]
< WINDOW_RIGHT_MARGIN_WIDTH (it->w))
&& !it->glyph_row->mode_line_p
- && default_face->background != FRAME_BACKGROUND_PIXEL (f))
+ && FACE_COLOR_TO_PIXEL (face->background, f) != FRAME_BACKGROUND_PIXEL (f))
{
struct glyph *g = it->glyph_row->glyphs[RIGHT_MARGIN_AREA];
struct glyph *e = g + it->glyph_row->used[RIGHT_MARGIN_AREA];