summaryrefslogtreecommitdiff
path: root/src/haikufont.c
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-02-05 03:17:58 +0000
committerPo Lu <luangruo@yahoo.com>2022-02-05 03:17:58 +0000
commitc274bd5c52fd64c888b1c713060da881bf72caa7 (patch)
tree5471cc3c01428d184566fb584028fc87953014d1 /src/haikufont.c
parent686f7f8f628c04e9d574186173165b2b5a9f92e2 (diff)
downloademacs-c274bd5c52fd64c888b1c713060da881bf72caa7.tar.gz
Implement face cursor color merging on Haiku
* src/ftcrfont.c (ftcrfont_draw): * src/haikufont.c (haikufont_draw): Use `haiku_merge_cursor_foreground' to calculate cursor HL colors. * src/haikuterm.c (haiku_merge_cursor_foreground): New function. * src/haikuterm.h: Update prototypes.
Diffstat (limited to 'src/haikufont.c')
-rw-r--r--src/haikufont.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/haikufont.c b/src/haikufont.c
index 1ef5f54c9aa..6cc984f3165 100644
--- a/src/haikufont.c
+++ b/src/haikufont.c
@@ -951,10 +951,19 @@ haikufont_draw (struct glyph_string *s, int from, int to,
struct font_info *info = (struct font_info *) s->font;
unsigned char mb[MAX_MULTIBYTE_LENGTH];
void *view = FRAME_HAIKU_VIEW (f);
+ unsigned long foreground, background;
block_input ();
prepare_face_for_display (s->f, face);
+ if (s->hl != DRAW_CURSOR)
+ {
+ foreground = s->face->foreground;
+ background = s->face->background;
+ }
+ else
+ haiku_merge_cursor_foreground (s, &foreground, &background);
+
/* Presumably the draw lock is already held by
haiku_draw_glyph_string; */
if (with_background)
@@ -977,18 +986,12 @@ haikufont_draw (struct glyph_string *s, int from, int to,
s->first_glyph->slice.glyphless.lower_yoff
- s->first_glyph->slice.glyphless.upper_yoff;
- BView_SetHighColor (view, s->hl == DRAW_CURSOR ?
- FRAME_CURSOR_COLOR (s->f).pixel : face->background);
-
+ BView_SetHighColor (view, background);
BView_FillRectangle (view, x, y - ascent, s->width, height);
s->background_filled_p = 1;
}
- if (s->hl == DRAW_CURSOR)
- BView_SetHighColor (view, FRAME_OUTPUT_DATA (s->f)->cursor_fg);
- else
- BView_SetHighColor (view, face->foreground);
-
+ BView_SetHighColor (view, foreground);
BView_MovePenTo (view, x, y);
BView_SetFont (view, ((struct haikufont_info *) info)->be_font);