*** empty log message ***
[bpt/emacs.git] / src / dispextern.h
index 83f539c..bba96ba 100644 (file)
@@ -923,6 +923,32 @@ extern struct glyph_row scratch_glyph_row;
       ? MATRIX_HEADER_LINE_ROW (MATRIX)->height        \
       : 0)
 
+/* Return the desired face id for the mode line of a window, depending
+   on whether the window is selected or not, or if the window is the
+   scrolling window for the currently active minibuffer window.
+
+   Due to the way display_mode_lines manipulates with the contents of
+   selected_window, this macro needs three arguments: SELW which is
+   compared against the current value of selected_window, MBW which is
+   compared against minibuf_window (if SELW doesn't match), and SCRW
+   which is compared against Vminibuf_selected_window (if MBW matches).  */
+
+#define CURRENT_MODE_LINE_FACE_ID_3(SELW, MBW, SCRW)           \
+     ((!mode_line_in_non_selected_windows                      \
+       || (SELW) == XWINDOW (selected_window)                  \
+       || (minibuf_level > 0                                   \
+           && !NILP (Vminibuf_selected_window)                 \
+           && (MBW) == XWINDOW (minibuf_window)                        \
+           && (SCRW) == XWINDOW (Vminibuf_selected_window)))   \
+      ? MODE_LINE_FACE_ID                                      \
+      : MODE_LINE_INACTIVE_FACE_ID)
+
+
+/* Return the desired face id for the mode line of window W.  */
+
+#define CURRENT_MODE_LINE_FACE_ID(W)           \
+       (CURRENT_MODE_LINE_FACE_ID_3((W), XWINDOW (selected_window), (W)))
+
 /* Return the current height of the mode line of window W.  If not
    known from current_mode_line_height, look at W's current glyph
    matrix, or return a default based on the height of the font of the
@@ -934,7 +960,7 @@ extern struct glyph_row scratch_glyph_row;
       : (MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix)         \
         ? MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix)        \
         : estimate_mode_line_height (XFRAME ((W)->frame),      \
-                                     MODE_LINE_FACE_ID)))
+                                     CURRENT_MODE_LINE_FACE_ID (W))))
 
 /* Return the current height of the header line of window W.  If not
    known from current_header_line_height, look at W's current glyph
@@ -1155,6 +1181,7 @@ enum lface_attribute_index
   LFACE_FONT_INDEX,
   LFACE_INHERIT_INDEX,
   LFACE_AVGWIDTH_INDEX,
+  LFACE_FONTSET_INDEX,
   LFACE_VECTOR_SIZE
 };
 
@@ -1239,10 +1266,8 @@ struct face
      reallocated.  */
   int font_info_id;
 
-  /* Fontset ID if this face uses a fontset, or -1.  This is only >= 0
-     if the face was realized for a composition sequence.
-     Otherwise, a specific font is loaded from the set of fonts
-     specified by the fontset given by the family attribute of the face.  */
+  /* Fontset ID if for this face's fontset.  Non-ASCII faces derived
+     from the same ASCII face have the same fontset.  */
   int fontset;
   
   /* Pixmap width and height.  */
@@ -1274,13 +1299,6 @@ struct face
   /* The hash value of this face.  */
   unsigned hash;
 
-  /* The charset for which this face was realized if it was realized
-     for use in multibyte text.  If fontset >= 0, this is the charset
-     of the first character of the composition sequence.  A value of
-     charset < 0 means the face was realized for use in unibyte text
-     where the idea of Emacs charsets isn't applicable.  */
-  int charset;
-
   /* Non-zero if text in this face should be underlined, overlined,
      strike-through or have a box drawn around it.  */
   unsigned underline_p : 1;
@@ -1323,8 +1341,9 @@ struct face
   /* Next and previous face in hash collision list of face cache.  */
   struct face *next, *prev;
 
-  /* If this face is for ASCII characters, this points this face
-     itself.  Otherwise, this points a face for ASCII characters.  */
+  /* If this face is an ASCII face, this points to this face itself.
+     Otherwise, this points to an ASCII face that has the same
+     attributes except the font.  */
   struct face *ascii_face;
 };
 
@@ -1353,6 +1372,7 @@ enum face_id
 {
   DEFAULT_FACE_ID,
   MODE_LINE_FACE_ID,
+  MODE_LINE_INACTIVE_FACE_ID,
   TOOL_BAR_FACE_ID,
   FRINGE_FACE_ID,
   HEADER_LINE_FACE_ID,
@@ -1410,7 +1430,7 @@ struct face_cache
 /* Non-zero if FACE is suitable for displaying character CHAR.  */
 
 #define FACE_SUITABLE_FOR_CHAR_P(FACE, CHAR)   \
-  (SINGLE_BYTE_CHAR_P (CHAR)                   \
+  (ASCII_CHAR_P (CHAR)                 \
    ? (FACE) == (FACE)->ascii_face              \
    : face_suitable_for_char_p ((FACE), (CHAR)))
 
@@ -1419,7 +1439,7 @@ struct face_cache
    This macro is only meaningful for multibyte character CHAR.  */
    
 #define FACE_FOR_CHAR(F, FACE, CHAR)   \
-  (SINGLE_BYTE_CHAR_P (CHAR)           \
+  (ASCII_CHAR_P (CHAR)         \
    ? (FACE)->ascii_face->id            \
    : face_for_char ((F), (FACE), (CHAR)))
 
@@ -2218,6 +2238,7 @@ void highlight_trailing_whitespace P_ ((struct frame *, struct glyph_row *));
 int tool_bar_item_info P_ ((struct frame *, struct glyph *, int *));
 extern Lisp_Object Qtool_bar;
 extern Lisp_Object Vshow_trailing_whitespace;
+extern int mode_line_in_non_selected_windows;
 extern int redisplaying_p;
 extern Lisp_Object Vimage_types;
 extern void add_to_log P_ ((char *, Lisp_Object, Lisp_Object));
@@ -2248,14 +2269,16 @@ unsigned long load_color P_ ((struct frame *, struct face *, Lisp_Object,
                              enum lface_attribute_index));
 void unload_color P_ ((struct frame *, unsigned long));
 int frame_update_line_height P_ ((struct frame *));
+char *choose_face_font P_ ((struct frame *, Lisp_Object *, Lisp_Object));
 int ascii_face_of_lisp_face P_ ((struct frame *, int));
 void prepare_face_for_display P_ ((struct frame *, struct face *));
 int xstricmp P_ ((unsigned char *, unsigned char *));
-int lookup_face P_ ((struct frame *, Lisp_Object *, int, struct face *));
-int lookup_named_face P_ ((struct frame *, Lisp_Object, int));
+int lookup_face P_ ((struct frame *, Lisp_Object *));
+int lookup_non_ascii_face P_ ((struct frame *, int, struct face *));
+int lookup_named_face P_ ((struct frame *, Lisp_Object));
 int smaller_face P_ ((struct frame *, int, int));
 int face_with_height P_ ((struct frame *, int, int));
-int lookup_derived_face P_ ((struct frame *, Lisp_Object, int, int));
+int lookup_derived_face P_ ((struct frame *, Lisp_Object, int));
 void init_frame_faces P_ ((struct frame *));
 void free_frame_faces P_ ((struct frame *));
 void recompute_basic_faces P_ ((struct frame *));
@@ -2265,9 +2288,13 @@ int face_at_string_position P_ ((struct window *, Lisp_Object, int, int, int,
                                 int, int *, enum face_id, int));
 int compute_char_face P_ ((struct frame *, int, Lisp_Object));
 void free_all_realized_faces P_ ((Lisp_Object));
+void free_realized_face P_ ((struct frame *, struct face *));
+
 extern Lisp_Object Qforeground_color, Qbackground_color;
 extern char unspecified_fg[], unspecified_bg[];
-void free_realized_multibyte_face P_ ((struct frame *, int));
+extern void check_face_attributes P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
+extern Lisp_Object generate_ascii_font_name P_ ((Lisp_Object, Lisp_Object));
+extern Lisp_Object font_name_registry P_ ((Lisp_Object));
 
 /* Defined in xfns.c  */
 
@@ -2371,8 +2398,6 @@ int line_hash_code P_ ((struct glyph_row *));
 void set_window_update_flags P_ ((struct window *, int));
 void write_glyphs P_ ((struct glyph *, int));
 void insert_glyphs P_ ((struct glyph *, int));
-void redraw_frame P_ ((struct frame *));
-void redraw_garbaged_frames P_ ((void));
 int scroll_cost P_ ((struct frame *, int, int, int));
 int direct_output_for_insert P_ ((int));
 int direct_output_forward_char P_ ((int));
@@ -2409,6 +2434,8 @@ extern void ins_del_lines P_ ((int, int));
 extern int string_cost P_ ((char *));
 extern int per_line_cost P_ ((char *));
 extern void calculate_costs P_ ((struct frame *));
+extern void set_tty_color_mode P_ ((struct frame *, Lisp_Object));
+extern void tty_setup_colors P_ ((int));
 extern void term_init P_ ((char *));
 extern void fatal P_ ((/* char *, ... */));
 void cursor_to P_ ((int, int));