diff options
| author | Jan Djärv | 2014-01-13 11:32:48 +0100 |
|---|---|---|
| committer | Jan Djärv | 2014-01-13 11:32:48 +0100 |
| commit | 6c21e306f270575a5e7a7af3b47e5230dfe5c7eb (patch) | |
| tree | e24f22161bcab88d3cdf8b84419c087372fc7cf8 /src | |
| parent | 3c0c4562d178819ee3f82f6876c19d61d281358a (diff) | |
| download | emacs-6c21e306f270575a5e7a7af3b47e5230dfe5c7eb.tar.gz emacs-6c21e306f270575a5e7a7af3b47e5230dfe5c7eb.zip | |
* macfont.m: Include termchar.h.
(CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND)
(CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND)
(CG_SET_STROKE_COLOR_WITH_FACE_FOREGROUND): Modified from
*_WITH_GC_* to take face and f as parameters.
(macfont_draw): Check for DRAW_MOUSE_FACE and set face accordingly.
Use *_WITH_FACE_*, and pass face as parameter.
Fixes: debbugs:16425
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/macfont.m | 30 |
2 files changed, 28 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2929c03329c..381a3fe7869 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2014-01-13 Jan Djärv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * macfont.m: Include termchar.h. | ||
| 4 | (CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND) | ||
| 5 | (CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND) | ||
| 6 | (CG_SET_STROKE_COLOR_WITH_FACE_FOREGROUND): Modified from | ||
| 7 | *_WITH_GC_* to take face and f as parameters. | ||
| 8 | (macfont_draw): Check for DRAW_MOUSE_FACE and set face accordingly. | ||
| 9 | Use *_WITH_FACE_*, and pass face as parameter (Bug#16425). | ||
| 10 | |||
| 1 | 2014-01-13 Daniel Colascione <dancol@dancol.org> | 11 | 2014-01-13 Daniel Colascione <dancol@dancol.org> |
| 2 | 12 | ||
| 3 | Fix menu item updating in the presence of the Unity global menu | 13 | Fix menu item updating in the presence of the Unity global menu |
diff --git a/src/macfont.m b/src/macfont.m index feeee1fbebf..075b512e686 100644 --- a/src/macfont.m +++ b/src/macfont.m | |||
| @@ -30,6 +30,7 @@ Original author: YAMAMOTO Mitsuharu | |||
| 30 | #include "composite.h" | 30 | #include "composite.h" |
| 31 | #include "fontset.h" | 31 | #include "fontset.h" |
| 32 | #include "font.h" | 32 | #include "font.h" |
| 33 | #include "termchar.h" | ||
| 33 | #include "nsgui.h" | 34 | #include "nsgui.h" |
| 34 | #include "nsterm.h" | 35 | #include "nsterm.h" |
| 35 | #include "macfont.h" | 36 | #include "macfont.h" |
| @@ -630,24 +631,21 @@ get_cgcolor(unsigned long idx, struct frame *f) | |||
| 630 | return cgColor; | 631 | return cgColor; |
| 631 | } | 632 | } |
| 632 | 633 | ||
| 633 | #define CG_SET_FILL_COLOR_WITH_GC_FOREGROUND(context, s) \ | 634 | #define CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND(context, face, f) \ |
| 634 | do { \ | 635 | do { \ |
| 635 | CGColorRef refcol_ = get_cgcolor (NS_FACE_FOREGROUND (s->face), \ | 636 | CGColorRef refcol_ = get_cgcolor (NS_FACE_FOREGROUND (face), f); \ |
| 636 | s->f); \ | ||
| 637 | CGContextSetFillColorWithColor (context, refcol_) ; \ | 637 | CGContextSetFillColorWithColor (context, refcol_) ; \ |
| 638 | CGColorRelease (refcol_); \ | 638 | CGColorRelease (refcol_); \ |
| 639 | } while (0) | 639 | } while (0) |
| 640 | #define CG_SET_FILL_COLOR_WITH_GC_BACKGROUND(context, s) \ | 640 | #define CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND(context, face, f) \ |
| 641 | do { \ | 641 | do { \ |
| 642 | CGColorRef refcol_ = get_cgcolor (NS_FACE_BACKGROUND (s->face),\ | 642 | CGColorRef refcol_ = get_cgcolor (NS_FACE_BACKGROUND (face), f); \ |
| 643 | s->f); \ | ||
| 644 | CGContextSetFillColorWithColor (context, refcol_); \ | 643 | CGContextSetFillColorWithColor (context, refcol_); \ |
| 645 | CGColorRelease (refcol_); \ | 644 | CGColorRelease (refcol_); \ |
| 646 | } while (0) | 645 | } while (0) |
| 647 | #define CG_SET_STROKE_COLOR_WITH_GC_FOREGROUND(context, s) \ | 646 | #define CG_SET_STROKE_COLOR_WITH_FACE_FOREGROUND(context, face, f) \ |
| 648 | do { \ | 647 | do { \ |
| 649 | CGColorRef refcol_ = get_cgcolor (NS_FACE_FOREGROUND (s->face),\ | 648 | CGColorRef refcol_ = get_cgcolor (NS_FACE_FOREGROUND (face), f); \ |
| 650 | s->f); \ | ||
| 651 | CGContextSetStrokeColorWithColor (context, refcol_); \ | 649 | CGContextSetStrokeColorWithColor (context, refcol_); \ |
| 652 | CGColorRelease (refcol_); \ | 650 | CGColorRelease (refcol_); \ |
| 653 | } while (0) | 651 | } while (0) |
| @@ -2719,6 +2717,7 @@ macfont_draw (struct glyph_string *s, int from, int to, int x, int y, | |||
| 2719 | BOOL isComposite = s->first_glyph->type == COMPOSITE_GLYPH; | 2717 | BOOL isComposite = s->first_glyph->type == COMPOSITE_GLYPH; |
| 2720 | int end = isComposite ? s->cmp_to : s->nchars; | 2718 | int end = isComposite ? s->cmp_to : s->nchars; |
| 2721 | int len = end - s->cmp_from; | 2719 | int len = end - s->cmp_from; |
| 2720 | struct face *face = s->face; | ||
| 2722 | int i; | 2721 | int i; |
| 2723 | 2722 | ||
| 2724 | block_input (); | 2723 | block_input (); |
| @@ -2741,7 +2740,14 @@ macfont_draw (struct glyph_string *s, int from, int to, int x, int y, | |||
| 2741 | 2740 | ||
| 2742 | if (with_background) | 2741 | if (with_background) |
| 2743 | { | 2742 | { |
| 2744 | CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, s); | 2743 | if (s->hl == DRAW_MOUSE_FACE) |
| 2744 | { | ||
| 2745 | face = FACE_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id); | ||
| 2746 | if (!face) | ||
| 2747 | face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); | ||
| 2748 | } | ||
| 2749 | |||
| 2750 | CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND (context, face, f); | ||
| 2745 | CGContextFillRect (context, | 2751 | CGContextFillRect (context, |
| 2746 | CGRectMake (x, y, | 2752 | CGRectMake (x, y, |
| 2747 | s->width, FONT_HEIGHT (s->font))); | 2753 | s->width, FONT_HEIGHT (s->font))); |
| @@ -2776,7 +2782,7 @@ macfont_draw (struct glyph_string *s, int from, int to, int x, int y, | |||
| 2776 | } | 2782 | } |
| 2777 | 2783 | ||
| 2778 | CGContextScaleCTM (context, 1, -1); | 2784 | CGContextScaleCTM (context, 1, -1); |
| 2779 | CG_SET_FILL_COLOR_WITH_GC_FOREGROUND (context, s); | 2785 | CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND (context, face, s->f); |
| 2780 | if (macfont_info->synthetic_italic_p) | 2786 | if (macfont_info->synthetic_italic_p) |
| 2781 | atfm = synthetic_italic_atfm; | 2787 | atfm = synthetic_italic_atfm; |
| 2782 | else | 2788 | else |
| @@ -2785,7 +2791,7 @@ macfont_draw (struct glyph_string *s, int from, int to, int x, int y, | |||
| 2785 | { | 2791 | { |
| 2786 | CGContextSetTextDrawingMode (context, kCGTextFillStroke); | 2792 | CGContextSetTextDrawingMode (context, kCGTextFillStroke); |
| 2787 | CGContextSetLineWidth (context, synthetic_bold_factor * font_size); | 2793 | CGContextSetLineWidth (context, synthetic_bold_factor * font_size); |
| 2788 | CG_SET_STROKE_COLOR_WITH_GC_FOREGROUND (context, s); | 2794 | CG_SET_STROKE_COLOR_WITH_FACE_FOREGROUND (context, face, f); |
| 2789 | } | 2795 | } |
| 2790 | if (no_antialias_p) | 2796 | if (no_antialias_p) |
| 2791 | CGContextSetShouldAntialias (context, false); | 2797 | CGContextSetShouldAntialias (context, false); |