]> code.delx.au - gnu-emacs/commitdiff
* dispextern.h (PREPARE_FACE_FOR_DISPLAY): Remove as a duplicate of ...
authorDmitry Antipov <dmantipov@yandex.ru>
Tue, 10 Jun 2014 03:13:41 +0000 (07:13 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Tue, 10 Jun 2014 03:13:41 +0000 (07:13 +0400)
* 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.

src/ChangeLog
src/dispextern.h
src/fringe.c
src/w32term.c
src/xdisp.c
src/xfaces.c
src/xterm.c

index acddd01dc4f41b613578127e759cc211142b9f97..95afceece262091f7859811971ea8ec9e8b99c1d 100644 (file)
@@ -1,3 +1,10 @@
+2014-06-10  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * 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.
+
 2014-06-09  Paul Eggert  <eggert@cs.ucla.edu>
 
        Say (accept-process-output P)'s result pertains to P if P is non-nil.
index ee17b65deaa43404c5901314be4d9ad40fbc0345..8b70985803a1c2a6fb14d81eb419b1f2e7eca8a5 100644 (file)
@@ -1795,16 +1795,6 @@ struct face_cache
   bool_bf menu_face_changed_p : 1;
 };
 
-
-/* Prepare face FACE for use on frame F.  This must be called before
-   using X resources of FACE.  */
-
-#define PREPARE_FACE_FOR_DISPLAY(F, FACE)      \
-  do {                                         \
-     if ((FACE)->gc == 0)                      \
-       prepare_face_for_display ((F), (FACE)); \
-  } while (false)
-
 /* Return a pointer to the face with ID on frame F, or null if such a
    face doesn't exist.  */
 
@@ -3354,7 +3344,9 @@ unsigned long load_color (struct frame *, struct face *, Lisp_Object,
                           enum lface_attribute_index);
 char *choose_face_font (struct frame *, Lisp_Object *, Lisp_Object,
                         int *);
+#ifdef HAVE_WINDOW_SYSTEM
 void prepare_face_for_display (struct frame *, struct face *);
+#endif
 int lookup_named_face (struct frame *, Lisp_Object, int);
 int lookup_basic_face (struct frame *, int);
 int smaller_face (struct frame *, int, int);
index 7256987bcc25942b176f7d9d754771ea2839084e..d00aee0e0b6114ec47ba2042ed5906d5d3a4a15e 100644 (file)
@@ -634,7 +634,7 @@ draw_fringe_bitmap_1 (struct window *w, struct glyph_row *row, int left_p, int o
       return;
     }
 
-  PREPARE_FACE_FOR_DISPLAY (f, p.face);
+  prepare_face_for_display (f, p.face);
 
   /* Clear left fringe if no bitmap to draw or if bitmap doesn't fill
      the fringe.  */
index cbaf823ae29d86e00fe808974bde6e8ef9cb3e7b..fc45bdd30a3842dbdfb363d0579b3a808689bc91 100644 (file)
@@ -1000,7 +1000,7 @@ x_set_mouse_face_gc (struct glyph_string *s)
   else
     face_id = FACE_FOR_CHAR (s->f, face, 0, -1, Qnil);
   s->face = FACE_FROM_ID (s->f, face_id);
-  PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
+  prepare_face_for_display (s->f, s->face);
 
   /* If font in this face is same as S->font, use it.  */
   if (s->font == s->face->font)
@@ -1050,7 +1050,7 @@ x_set_mode_line_face_gc (struct glyph_string *s)
 static inline void
 x_set_glyph_string_gc (struct glyph_string *s)
 {
-  PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
+  prepare_face_for_display (s->f, s->face);
 
   if (s->hl == DRAW_NORMAL_TEXT)
     {
index 1b86ec7d9d333b5c992bc92a56f4ea3b51914862..71398b833e82d23b28b68a61225f8c96bad6dcca 100644 (file)
@@ -23680,7 +23680,7 @@ get_char_face_and_encoding (struct frame *f, int c, int face_id,
 #endif
     {
       eassert (face != NULL);
-      PREPARE_FACE_FOR_DISPLAY (f, face);
+      prepare_face_for_display (f, face);
     }
 
   return face;
@@ -23703,7 +23703,7 @@ get_glyph_face_and_encoding (struct frame *f, struct glyph *glyph,
 
   /* Make sure X resources of the face are allocated.  */
   eassert (face != NULL);
-  PREPARE_FACE_FOR_DISPLAY (f, face);
+  prepare_face_for_display (f, face);
 
   if (two_byte_p)
     *two_byte_p = 0;
@@ -24020,7 +24020,7 @@ fill_stretch_glyph_string (struct glyph_string *s, int start, int end)
   s->ybase += voffset;
 
   /* The case that face->gc == 0 is handled when drawing the glyph
-     string by calling PREPARE_FACE_FOR_DISPLAY.  */
+     string by calling prepare_face_for_display.  */
   eassert (s->face);
   return glyph - s->row->glyphs[s->area];
 }
@@ -24969,7 +24969,7 @@ produce_image_glyph (struct it *it)
   face = FACE_FROM_ID (it->f, it->face_id);
   eassert (face);
   /* Make sure X resources of the face is loaded.  */
-  PREPARE_FACE_FOR_DISPLAY (it->f, face);
+  prepare_face_for_display (it->f, face);
 
   if (it->image_id < 0)
     {
@@ -25247,7 +25247,7 @@ produce_stretch_glyph (struct it *it)
     {
       struct face *face = FACE_FROM_ID (it->f, it->face_id);
       font = face->font ? face->font : FRAME_FONT (it->f);
-      PREPARE_FACE_FOR_DISPLAY (it->f, face);
+      prepare_face_for_display (it->f, face);
     }
 #endif
 
@@ -25711,7 +25711,7 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)
 
       face = FACE_FROM_ID (it->f, face_id);
       font = face->font ? face->font : FRAME_FONT (it->f);
-      PREPARE_FACE_FOR_DISPLAY (it->f, face);
+      prepare_face_for_display (it->f, face);
 
       if (it->glyphless_method == GLYPHLESS_DISPLAY_ACRONYM)
        {
index 1d869d90ac3678e240cadec60ea1ee7f5bb0982a..a475acdb927e7b18cc5e406c31700de4c5d5ee54 100644 (file)
@@ -4098,15 +4098,15 @@ free_realized_face (struct frame *f, struct face *face)
     }
 }
 
+#ifdef HAVE_WINDOW_SYSTEM
 
-/* Prepare face FACE for subsequent display on frame F.  This
-   allocated GCs if they haven't been allocated yet or have been freed
-   by clearing the face cache.  */
+/* Prepare face FACE for subsequent display on frame F.  This must be called
+   before using X resources of FACE to allocate GCs if they haven't been
+   allocated yet or have been freed by clearing the face cache.  */
 
 void
 prepare_face_for_display (struct frame *f, struct face *face)
 {
-#ifdef HAVE_WINDOW_SYSTEM
   eassert (FRAME_WINDOW_P (f));
 
   if (face->gc == 0)
@@ -4134,10 +4134,10 @@ prepare_face_for_display (struct frame *f, struct face *face)
        font_prepare_for_face (f, face);
       unblock_input ();
     }
-#endif /* HAVE_WINDOW_SYSTEM */
 }
 
-\f
+#endif /* HAVE_WINDOW_SYSTEM */
+
 /* Returns the `distance' between the colors X and Y.  */
 
 static int
index 8c2b6254e597f1922f7e351ea8d3bdef75f85999..422800f3765c91f0fbb103c7f38901dd2766965f 100644 (file)
@@ -903,7 +903,7 @@ x_set_mouse_face_gc (struct glyph_string *s)
   else
     face_id = FACE_FOR_CHAR (s->f, face, 0, -1, Qnil);
   s->face = FACE_FROM_ID (s->f, face_id);
-  PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
+  prepare_face_for_display (s->f, s->face);
 
   if (s->font == s->face->font)
     s->gc = s->face->gc;
@@ -951,7 +951,7 @@ x_set_mode_line_face_gc (struct glyph_string *s)
 static void
 x_set_glyph_string_gc (struct glyph_string *s)
 {
-  PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
+  prepare_face_for_display (s->f, s->face);
 
   if (s->hl == DRAW_NORMAL_TEXT)
     {