diff options
| author | Dmitry Antipov | 2014-06-10 07:13:41 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-06-10 07:13:41 +0400 |
| commit | 2e120be4e9871626734ba8334897488019c00cdb (patch) | |
| tree | b884de0bf1396af6648446871d487465a8484782 | |
| parent | 29993416fb4d19c1c3bb146367fc4bed74845486 (diff) | |
| download | emacs-2e120be4e9871626734ba8334897488019c00cdb.tar.gz emacs-2e120be4e9871626734ba8334897488019c00cdb.zip | |
* dispextern.h (PREPARE_FACE_FOR_DISPLAY): Remove as a duplicate of ...
* xfaces.c (prepare_face_for_display) [HAVE_WINDOW_SYSTEM]: ... this
function. Also adjust comment.
* fringe.c, w32term.c, xdisp.c, xterm.c: All users changed.
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/dispextern.h | 12 | ||||
| -rw-r--r-- | src/fringe.c | 2 | ||||
| -rw-r--r-- | src/w32term.c | 4 | ||||
| -rw-r--r-- | src/xdisp.c | 12 | ||||
| -rw-r--r-- | src/xfaces.c | 12 | ||||
| -rw-r--r-- | src/xterm.c | 4 |
7 files changed, 26 insertions, 27 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index acddd01dc4f..95afceece26 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2014-06-10 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | * dispextern.h (PREPARE_FACE_FOR_DISPLAY): Remove as a duplicate of ... | ||
| 4 | * xfaces.c (prepare_face_for_display) [HAVE_WINDOW_SYSTEM]: ... this | ||
| 5 | function. Also adjust comment. | ||
| 6 | * fringe.c, w32term.c, xdisp.c, xterm.c: All users changed. | ||
| 7 | |||
| 1 | 2014-06-09 Paul Eggert <eggert@cs.ucla.edu> | 8 | 2014-06-09 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 9 | ||
| 3 | Say (accept-process-output P)'s result pertains to P if P is non-nil. | 10 | Say (accept-process-output P)'s result pertains to P if P is non-nil. |
diff --git a/src/dispextern.h b/src/dispextern.h index ee17b65deaa..8b70985803a 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -1795,16 +1795,6 @@ struct face_cache | |||
| 1795 | bool_bf menu_face_changed_p : 1; | 1795 | bool_bf menu_face_changed_p : 1; |
| 1796 | }; | 1796 | }; |
| 1797 | 1797 | ||
| 1798 | |||
| 1799 | /* Prepare face FACE for use on frame F. This must be called before | ||
| 1800 | using X resources of FACE. */ | ||
| 1801 | |||
| 1802 | #define PREPARE_FACE_FOR_DISPLAY(F, FACE) \ | ||
| 1803 | do { \ | ||
| 1804 | if ((FACE)->gc == 0) \ | ||
| 1805 | prepare_face_for_display ((F), (FACE)); \ | ||
| 1806 | } while (false) | ||
| 1807 | |||
| 1808 | /* Return a pointer to the face with ID on frame F, or null if such a | 1798 | /* Return a pointer to the face with ID on frame F, or null if such a |
| 1809 | face doesn't exist. */ | 1799 | face doesn't exist. */ |
| 1810 | 1800 | ||
| @@ -3354,7 +3344,9 @@ unsigned long load_color (struct frame *, struct face *, Lisp_Object, | |||
| 3354 | enum lface_attribute_index); | 3344 | enum lface_attribute_index); |
| 3355 | char *choose_face_font (struct frame *, Lisp_Object *, Lisp_Object, | 3345 | char *choose_face_font (struct frame *, Lisp_Object *, Lisp_Object, |
| 3356 | int *); | 3346 | int *); |
| 3347 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 3357 | void prepare_face_for_display (struct frame *, struct face *); | 3348 | void prepare_face_for_display (struct frame *, struct face *); |
| 3349 | #endif | ||
| 3358 | int lookup_named_face (struct frame *, Lisp_Object, int); | 3350 | int lookup_named_face (struct frame *, Lisp_Object, int); |
| 3359 | int lookup_basic_face (struct frame *, int); | 3351 | int lookup_basic_face (struct frame *, int); |
| 3360 | int smaller_face (struct frame *, int, int); | 3352 | int smaller_face (struct frame *, int, int); |
diff --git a/src/fringe.c b/src/fringe.c index 7256987bcc2..d00aee0e0b6 100644 --- a/src/fringe.c +++ b/src/fringe.c | |||
| @@ -634,7 +634,7 @@ draw_fringe_bitmap_1 (struct window *w, struct glyph_row *row, int left_p, int o | |||
| 634 | return; | 634 | return; |
| 635 | } | 635 | } |
| 636 | 636 | ||
| 637 | PREPARE_FACE_FOR_DISPLAY (f, p.face); | 637 | prepare_face_for_display (f, p.face); |
| 638 | 638 | ||
| 639 | /* Clear left fringe if no bitmap to draw or if bitmap doesn't fill | 639 | /* Clear left fringe if no bitmap to draw or if bitmap doesn't fill |
| 640 | the fringe. */ | 640 | the fringe. */ |
diff --git a/src/w32term.c b/src/w32term.c index cbaf823ae29..fc45bdd30a3 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -1000,7 +1000,7 @@ x_set_mouse_face_gc (struct glyph_string *s) | |||
| 1000 | else | 1000 | else |
| 1001 | face_id = FACE_FOR_CHAR (s->f, face, 0, -1, Qnil); | 1001 | face_id = FACE_FOR_CHAR (s->f, face, 0, -1, Qnil); |
| 1002 | s->face = FACE_FROM_ID (s->f, face_id); | 1002 | s->face = FACE_FROM_ID (s->f, face_id); |
| 1003 | PREPARE_FACE_FOR_DISPLAY (s->f, s->face); | 1003 | prepare_face_for_display (s->f, s->face); |
| 1004 | 1004 | ||
| 1005 | /* If font in this face is same as S->font, use it. */ | 1005 | /* If font in this face is same as S->font, use it. */ |
| 1006 | if (s->font == s->face->font) | 1006 | if (s->font == s->face->font) |
| @@ -1050,7 +1050,7 @@ x_set_mode_line_face_gc (struct glyph_string *s) | |||
| 1050 | static inline void | 1050 | static inline void |
| 1051 | x_set_glyph_string_gc (struct glyph_string *s) | 1051 | x_set_glyph_string_gc (struct glyph_string *s) |
| 1052 | { | 1052 | { |
| 1053 | PREPARE_FACE_FOR_DISPLAY (s->f, s->face); | 1053 | prepare_face_for_display (s->f, s->face); |
| 1054 | 1054 | ||
| 1055 | if (s->hl == DRAW_NORMAL_TEXT) | 1055 | if (s->hl == DRAW_NORMAL_TEXT) |
| 1056 | { | 1056 | { |
diff --git a/src/xdisp.c b/src/xdisp.c index 1b86ec7d9d3..71398b833e8 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -23680,7 +23680,7 @@ get_char_face_and_encoding (struct frame *f, int c, int face_id, | |||
| 23680 | #endif | 23680 | #endif |
| 23681 | { | 23681 | { |
| 23682 | eassert (face != NULL); | 23682 | eassert (face != NULL); |
| 23683 | PREPARE_FACE_FOR_DISPLAY (f, face); | 23683 | prepare_face_for_display (f, face); |
| 23684 | } | 23684 | } |
| 23685 | 23685 | ||
| 23686 | return face; | 23686 | return face; |
| @@ -23703,7 +23703,7 @@ get_glyph_face_and_encoding (struct frame *f, struct glyph *glyph, | |||
| 23703 | 23703 | ||
| 23704 | /* Make sure X resources of the face are allocated. */ | 23704 | /* Make sure X resources of the face are allocated. */ |
| 23705 | eassert (face != NULL); | 23705 | eassert (face != NULL); |
| 23706 | PREPARE_FACE_FOR_DISPLAY (f, face); | 23706 | prepare_face_for_display (f, face); |
| 23707 | 23707 | ||
| 23708 | if (two_byte_p) | 23708 | if (two_byte_p) |
| 23709 | *two_byte_p = 0; | 23709 | *two_byte_p = 0; |
| @@ -24020,7 +24020,7 @@ fill_stretch_glyph_string (struct glyph_string *s, int start, int end) | |||
| 24020 | s->ybase += voffset; | 24020 | s->ybase += voffset; |
| 24021 | 24021 | ||
| 24022 | /* The case that face->gc == 0 is handled when drawing the glyph | 24022 | /* The case that face->gc == 0 is handled when drawing the glyph |
| 24023 | string by calling PREPARE_FACE_FOR_DISPLAY. */ | 24023 | string by calling prepare_face_for_display. */ |
| 24024 | eassert (s->face); | 24024 | eassert (s->face); |
| 24025 | return glyph - s->row->glyphs[s->area]; | 24025 | return glyph - s->row->glyphs[s->area]; |
| 24026 | } | 24026 | } |
| @@ -24969,7 +24969,7 @@ produce_image_glyph (struct it *it) | |||
| 24969 | face = FACE_FROM_ID (it->f, it->face_id); | 24969 | face = FACE_FROM_ID (it->f, it->face_id); |
| 24970 | eassert (face); | 24970 | eassert (face); |
| 24971 | /* Make sure X resources of the face is loaded. */ | 24971 | /* Make sure X resources of the face is loaded. */ |
| 24972 | PREPARE_FACE_FOR_DISPLAY (it->f, face); | 24972 | prepare_face_for_display (it->f, face); |
| 24973 | 24973 | ||
| 24974 | if (it->image_id < 0) | 24974 | if (it->image_id < 0) |
| 24975 | { | 24975 | { |
| @@ -25247,7 +25247,7 @@ produce_stretch_glyph (struct it *it) | |||
| 25247 | { | 25247 | { |
| 25248 | struct face *face = FACE_FROM_ID (it->f, it->face_id); | 25248 | struct face *face = FACE_FROM_ID (it->f, it->face_id); |
| 25249 | font = face->font ? face->font : FRAME_FONT (it->f); | 25249 | font = face->font ? face->font : FRAME_FONT (it->f); |
| 25250 | PREPARE_FACE_FOR_DISPLAY (it->f, face); | 25250 | prepare_face_for_display (it->f, face); |
| 25251 | } | 25251 | } |
| 25252 | #endif | 25252 | #endif |
| 25253 | 25253 | ||
| @@ -25711,7 +25711,7 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym) | |||
| 25711 | 25711 | ||
| 25712 | face = FACE_FROM_ID (it->f, face_id); | 25712 | face = FACE_FROM_ID (it->f, face_id); |
| 25713 | font = face->font ? face->font : FRAME_FONT (it->f); | 25713 | font = face->font ? face->font : FRAME_FONT (it->f); |
| 25714 | PREPARE_FACE_FOR_DISPLAY (it->f, face); | 25714 | prepare_face_for_display (it->f, face); |
| 25715 | 25715 | ||
| 25716 | if (it->glyphless_method == GLYPHLESS_DISPLAY_ACRONYM) | 25716 | if (it->glyphless_method == GLYPHLESS_DISPLAY_ACRONYM) |
| 25717 | { | 25717 | { |
diff --git a/src/xfaces.c b/src/xfaces.c index 1d869d90ac3..a475acdb927 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -4098,15 +4098,15 @@ free_realized_face (struct frame *f, struct face *face) | |||
| 4098 | } | 4098 | } |
| 4099 | } | 4099 | } |
| 4100 | 4100 | ||
| 4101 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 4101 | 4102 | ||
| 4102 | /* Prepare face FACE for subsequent display on frame F. This | 4103 | /* Prepare face FACE for subsequent display on frame F. This must be called |
| 4103 | allocated GCs if they haven't been allocated yet or have been freed | 4104 | before using X resources of FACE to allocate GCs if they haven't been |
| 4104 | by clearing the face cache. */ | 4105 | allocated yet or have been freed by clearing the face cache. */ |
| 4105 | 4106 | ||
| 4106 | void | 4107 | void |
| 4107 | prepare_face_for_display (struct frame *f, struct face *face) | 4108 | prepare_face_for_display (struct frame *f, struct face *face) |
| 4108 | { | 4109 | { |
| 4109 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 4110 | eassert (FRAME_WINDOW_P (f)); | 4110 | eassert (FRAME_WINDOW_P (f)); |
| 4111 | 4111 | ||
| 4112 | if (face->gc == 0) | 4112 | if (face->gc == 0) |
| @@ -4134,10 +4134,10 @@ prepare_face_for_display (struct frame *f, struct face *face) | |||
| 4134 | font_prepare_for_face (f, face); | 4134 | font_prepare_for_face (f, face); |
| 4135 | unblock_input (); | 4135 | unblock_input (); |
| 4136 | } | 4136 | } |
| 4137 | #endif /* HAVE_WINDOW_SYSTEM */ | ||
| 4138 | } | 4137 | } |
| 4139 | 4138 | ||
| 4140 | 4139 | #endif /* HAVE_WINDOW_SYSTEM */ | |
| 4140 | |||
| 4141 | /* Returns the `distance' between the colors X and Y. */ | 4141 | /* Returns the `distance' between the colors X and Y. */ |
| 4142 | 4142 | ||
| 4143 | static int | 4143 | static int |
diff --git a/src/xterm.c b/src/xterm.c index 8c2b6254e59..422800f3765 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -903,7 +903,7 @@ x_set_mouse_face_gc (struct glyph_string *s) | |||
| 903 | else | 903 | else |
| 904 | face_id = FACE_FOR_CHAR (s->f, face, 0, -1, Qnil); | 904 | face_id = FACE_FOR_CHAR (s->f, face, 0, -1, Qnil); |
| 905 | s->face = FACE_FROM_ID (s->f, face_id); | 905 | s->face = FACE_FROM_ID (s->f, face_id); |
| 906 | PREPARE_FACE_FOR_DISPLAY (s->f, s->face); | 906 | prepare_face_for_display (s->f, s->face); |
| 907 | 907 | ||
| 908 | if (s->font == s->face->font) | 908 | if (s->font == s->face->font) |
| 909 | s->gc = s->face->gc; | 909 | s->gc = s->face->gc; |
| @@ -951,7 +951,7 @@ x_set_mode_line_face_gc (struct glyph_string *s) | |||
| 951 | static void | 951 | static void |
| 952 | x_set_glyph_string_gc (struct glyph_string *s) | 952 | x_set_glyph_string_gc (struct glyph_string *s) |
| 953 | { | 953 | { |
| 954 | PREPARE_FACE_FOR_DISPLAY (s->f, s->face); | 954 | prepare_face_for_display (s->f, s->face); |
| 955 | 955 | ||
| 956 | if (s->hl == DRAW_NORMAL_TEXT) | 956 | if (s->hl == DRAW_NORMAL_TEXT) |
| 957 | { | 957 | { |