* lisp.h (XCONS, XSTRING, XSYMBOL, XFLOAT, XPROCESS, XWINDOW, XSUBR, XBUFFER):
[bpt/emacs.git] / src / dispextern.h
index 54b58b7..2665cf3 100644 (file)
@@ -130,21 +130,27 @@ struct text_pos
 
 /* Increment text position POS.  */
 
-#define INC_TEXT_POS(POS)                      \
+#define INC_TEXT_POS(POS, MULTIBYTE_P)         \
      do                                                \
        {                                       \
         ++(POS).charpos;                       \
-        INC_POS ((POS).bytepos);               \
+         if (MULTIBYTE_P)                      \
+          INC_POS ((POS).bytepos);             \
+        else                                   \
+          ++(POS).bytepos;                     \
        }                                       \
      while (0)
 
 /* Decrement text position POS.  */
 
-#define DEC_TEXT_POS(POS)                      \
+#define DEC_TEXT_POS(POS, MULTIBYTE_P)         \
      do                                                \
        {                                       \
         --(POS).charpos;                       \
-        DEC_POS ((POS).bytepos);               \
+         if (MULTIBYTE_P)                      \
+          DEC_POS ((POS).bytepos);             \
+        else                                   \
+          --(POS).bytepos;                     \
        }                                       \
      while (0)
 
@@ -269,8 +275,12 @@ struct glyph
      padding. */
   unsigned padding_p : 1;
 
+  /* 1 means the actual glyph is not available in the current
+     system.  */
+  unsigned glyph_not_available_p : 1;
+
   /* Face of the glyph.  */
-  unsigned face_id : 23;
+  unsigned face_id : 22;
 
   /* A union of sub-structures for different glyph types.  */
   union
@@ -1056,6 +1066,7 @@ extern struct glyph_row scratch_glyph_row;
      (!MINI_WINDOW_P (W)                                               \
       && !(W)->pseudo_window_p                                         \
       && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME (W)))            \
+      && BUFFERP ((W)->buffer)                                         \
       && !NILP (XBUFFER ((W)->buffer)->mode_line_format))
 
 /* Value is non-zero if window W wants a top line.  */
@@ -1064,6 +1075,7 @@ extern struct glyph_row scratch_glyph_row;
      (!MINI_WINDOW_P (W)                                               \
       && !(W)->pseudo_window_p                                         \
       && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME (W)))            \
+      && BUFFERP ((W)->buffer)                                         \
       && !NILP (XBUFFER ((W)->buffer)->header_line_format))
 
 \f     
@@ -1089,6 +1101,7 @@ enum lface_attribute_index
   LFACE_OVERLINE_INDEX,
   LFACE_STRIKE_THROUGH_INDEX,
   LFACE_BOX_INDEX,
+  LFACE_FONT_INDEX,
   LFACE_VECTOR_SIZE
 };
 
@@ -1166,9 +1179,6 @@ struct face
      must not be freed.  */
   char *font_name;
 
-  /* The X font registry and encoding of font_name.  */
-  Lisp_Object registry;
-
   /* Font info ID for this face's font.  An ID is stored here because
      pointers to font_info structures may change.  The reason is that
      they are pointers into a font table vector that is itself
@@ -1249,6 +1259,10 @@ 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.  */
+  struct face *ascii_face;
 };
 
 
@@ -1324,33 +1338,30 @@ struct face_cache
       ? FRAME_FACE_CACHE (F)->faces_by_id[ID]          \
       : NULL)
 
-/* Non-zero if FACE is suitable for displaying characters of CHARSET.
-   CHARSET < 0 means unibyte text.  */
-
-#define FACE_SUITABLE_FOR_CHARSET_P(FACE, CHARSET)                     \
-     (((CHARSET) < 0                                                   \
-       ? (EQ ((FACE)->registry, Vface_default_registry)                        \
-         || !NILP (Fequal ((FACE)->registry, Vface_default_registry))) \
-       : ((FACE)->charset == (CHARSET)                                 \
-         || ((FACE)->charset == CHARSET_ASCII                          \
-             && (CHARSET) == charset_latin_iso8859_1                   \
-             && face_suitable_for_iso8859_1_p ((FACE)))                \
-         || ((FACE)->charset == charset_latin_iso8859_1                \
-             && (CHARSET) == CHARSET_ASCII))))
-     
+#ifdef HAVE_WINDOW_SYSTEM
+
+/* Non-zero if FACE is suitable for displaying character CHAR.  */
+
+#define FACE_SUITABLE_FOR_CHAR_P(FACE, CHAR)   \
+  (SINGLE_BYTE_CHAR_P (CHAR)                   \
+   ? (FACE) == (FACE)->ascii_face              \
+   : face_suitable_for_char_p ((FACE), (CHAR)))
+
 /* Return the id of the realized face on frame F that is like the face
-   with id ID but is suitable for displaying characters of CHARSET.
-   This macro is only meaningful for CHARSET >= 0, i.e. multibyte
-   text.  */
+   with id ID but is suitable for displaying character CHAR.
+   This macro is only meaningful for multibyte character CHAR.  */
    
-#define FACE_FOR_CHARSET(F, ID, CHARSET)                               \
-     (FACE_SUITABLE_FOR_CHARSET_P (FACE_FROM_ID ((F), (ID)), (CHARSET))        \
-      ? (ID)                                                           \
-      : lookup_face ((F), FACE_FROM_ID ((F), (ID))->lface, (CHARSET)))
+#define FACE_FOR_CHAR(F, FACE, CHAR)   \
+  (SINGLE_BYTE_CHAR_P (CHAR)           \
+   ? (FACE)->ascii_face->id            \
+   : face_for_char ((F), (FACE), (CHAR)))
 
-/* The default registry and encoding to use.  */
+#else /* not HAVE_WINDOW_SYSTEM */
+
+#define FACE_SUITABLE_FOR_CHAR_P(FACE, CHAR) 1
+#define FACE_FOR_CHAR(F, FACE, CHAR) ((FACE)->id)
 
-extern Lisp_Object Vface_default_registry;
+#endif /* not HAVE_WINDOW_SYSTEM */
 
 /* Non-zero means face attributes have been changed since the last
    redisplay.  Used in redisplay_internal.  */
@@ -1601,6 +1612,10 @@ struct it
   /* 1 means overlay strings at end_charpos have been processed.  */
   unsigned overlay_strings_at_end_processed_p : 1;
 
+  /* 1 means the actual glyph is not available in the current
+     system.  */
+  unsigned glyph_not_available_p : 1; 
+
   /* The ID of the default face to use.  One of DEFAULT_FACE_ID,
      MODE_LINE_FACE_ID, or TOOL_BAR_FACE_ID, depending on what we
      are displaying.  */
@@ -1624,10 +1639,6 @@ struct it
      is set after x_produce_glyphs has been called.  */
   int char_to_display;
 
-  /* Charset for which face_id was computed.  This is the charset
-     of char_to_display after x_produce_glyphs has been called.  */
-  int charset;
-
   /* If what == IT_IMAGE, the id of the image to display.  */
   int image_id;
 
@@ -2112,10 +2123,12 @@ void init_sigio P_ ((int));
 #ifdef USE_X_TOOLKIT
 void x_set_menu_resources_from_menu_face P_ ((struct frame *, Widget));
 #endif
+#ifdef HAVE_X_WINDOWS
+void x_free_colors P_ ((struct frame *, unsigned long *, int));
+#endif
 
 void update_face_from_frame_parameter P_ ((struct frame *, Lisp_Object,
                                           Lisp_Object));
-char *x_charset_registry P_ ((int));
 Lisp_Object tty_color_name P_ ((struct frame *, int));
 void clear_face_cache P_ ((int));
 unsigned long load_color P_ ((struct frame *, struct face *, Lisp_Object,
@@ -2124,10 +2137,8 @@ void unload_color P_ ((struct frame *, unsigned long));
 int frame_update_line_height P_ ((struct frame *));
 int ascii_face_of_lisp_face P_ ((struct frame *, int));
 void prepare_face_for_display P_ ((struct frame *, struct face *));
-int face_suitable_for_iso8859_1_p P_ ((struct face *));
 int xstricmp P_ ((unsigned char *, unsigned char *));
-int lookup_face P_ ((struct frame *, Lisp_Object *, int));
-int face_suitable_for_charset_p P_ ((struct face *, int));
+int lookup_face P_ ((struct frame *, Lisp_Object *, int, struct face *));
 int lookup_named_face P_ ((struct frame *, Lisp_Object, int));
 int smaller_face P_ ((struct frame *, int, int));
 int face_with_height P_ ((struct frame *, int, int));
@@ -2142,6 +2153,7 @@ int face_at_string_position P_ ((struct window *, Lisp_Object,
 int compute_char_face P_ ((struct frame *, int, Lisp_Object));
 void free_all_realized_faces P_ ((Lisp_Object));
 extern Lisp_Object Qforeground_color, Qbackground_color;
+void free_realized_multibyte_face P_ ((struct frame *, int));
 
 /* Defined in xfns.c  */
 
@@ -2169,9 +2181,8 @@ extern struct frame *tip_frame;
 extern Window tip_window;
 EXFUN (Fx_show_tip, 4);
 EXFUN (Fx_hide_tip, 0);
-EXFUN (Fx_show_busy_cursor, 0);
-EXFUN (Fx_hide_busy_cursor, 1);
-extern int inhibit_busy_cursor;
+extern void start_busy_cursor P_ ((void));
+extern void cancel_busy_cursor P_ ((void));
 extern int display_busy_cursor_p;
 
 #endif /* HAVE_WINDOW_SYSTEM */