#define CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND(context, face) \
do { \
- CGColorRef refcol_ = get_cgcolor (NS_FACE_FOREGROUND (face)); \
- CGContextSetFillColorWithColor (context, refcol_) ; \
- CGColorRelease (refcol_); \
+ CGColorRef refcol = get_cgcolor (NS_FACE_FOREGROUND (face)); \
+ CGContextSetFillColorWithColor (context, refcol); \
+ CGColorRelease (refcol); \
} while (0)
#define CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND(context, face) \
do { \
- CGColorRef refcol_ = get_cgcolor (NS_FACE_BACKGROUND (face)); \
- CGContextSetFillColorWithColor (context, refcol_); \
- CGColorRelease (refcol_); \
+ CGColorRef refcol = get_cgcolor (NS_FACE_BACKGROUND (face)); \
+ CGContextSetFillColorWithColor (context, refcol); \
+ CGColorRelease (refcol); \
+ } while (0)
+#define CG_SET_FILL_COLOR_WITH_FRAME_CURSOR(context, frame) \
+ do { \
+ CGColorRef refcol \
+ = get_cgcolor_from_nscolor (FRAME_CURSOR_COLOR (frame), frame); \
+ CGContextSetFillColorWithColor (context, refcol); \
+ CGColorRelease (refcol); \
+ } while (0)
+#define CG_SET_FILL_COLOR_WITH_FRAME_BACKGROUND(context, frame) \
+ do { \
+ CGColorRef refcol \
+ = get_cgcolor_from_nscolor (FRAME_BACKGROUND_COLOR (frame), frame); \
+ CGContextSetFillColorWithColor (context, refcol); \
+ CGColorRelease (refcol); \
} while (0)
#define CG_SET_STROKE_COLOR_WITH_FACE_FOREGROUND(context, face) \
do { \
- CGColorRef refcol_ = get_cgcolor (NS_FACE_FOREGROUND (face)); \
- CGContextSetStrokeColorWithColor (context, refcol_); \
- CGColorRelease (refcol_); \
+ CGColorRef refcol = get_cgcolor (NS_FACE_FOREGROUND (face)); \
+ CGContextSetStrokeColorWithColor (context, refcol); \
+ CGColorRelease (refcol); \
} while (0)
{
if (s->hl == DRAW_CURSOR)
{
- CGColorRef colorref = get_cgcolor_from_nscolor (FRAME_CURSOR_COLOR (f), f);
- CGContextSetFillColorWithColor (context, colorref);
- CGColorRelease (colorref);
+ if (face && (NS_FACE_BACKGROUND (face)
+ == [(NSColor *) FRAME_CURSOR_COLOR (f)
+ unsignedLong]))
+ CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND (context, face);
+ else
+ CG_SET_FILL_COLOR_WITH_FRAME_CURSOR (context, f);
}
else
CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND (context, face);
CGContextScaleCTM (context, 1, -1);
if (s->hl == DRAW_CURSOR)
{
- CGColorRef colorref = get_cgcolor_from_nscolor (FRAME_BACKGROUND_COLOR (f), f);
- CGContextSetFillColorWithColor (context, colorref);
- CGColorRelease (colorref);
+ if (face && (NS_FACE_BACKGROUND (face)
+ == [(NSColor *) FRAME_CURSOR_COLOR (f)
+ unsignedLong]))
+ CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND (context, face);
+ else
+ CG_SET_FILL_COLOR_WITH_FRAME_BACKGROUND (context, f);
}
else
CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND (context, face);
{
struct face *face = s->face;
if (!face->stipple)
- {
- if (s->hl != DRAW_CURSOR)
- [(NS_FACE_BACKGROUND (face) != 0
- ? [NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)]
- : FRAME_BACKGROUND_COLOR (s->f)) set];
- else
- [FRAME_CURSOR_COLOR (s->f) set];
- }
+ {
+ if (s->hl != DRAW_CURSOR)
+ [(NS_FACE_BACKGROUND (face) != 0
+ ? [NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)]
+ : FRAME_BACKGROUND_COLOR (s->f)) set];
+ else if (face && (NS_FACE_BACKGROUND (face)
+ == [(NSColor *) FRAME_CURSOR_COLOR (s->f)
+ unsignedLong]))
+ [[NSColor colorWithUnsignedLong:NS_FACE_FOREGROUND (face)] set];
+ else
+ [FRAME_CURSOR_COLOR (s->f) set];
+ }
else
{
struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (s->f);