/* Whether or not to underline text in this face. */
char underline;
-
- /* Does this face own its resources? (color, font, etcetera)
- If this is a face which we computed by combining other faces,
- then this is true, and we shouldn't free any of the resources
- it refers to; the faces from which it was constructed own it.
- On the other hand, if this is a face the user created and
- filled in directly, then this is false, and we should free the
- resources when we free it. */
- char copy;
};
/* Let's stop using this and get rid of it. */
Since the display generation code is responsible for calling
compute_char_face and compute_glyph_face on everything it puts in
the display structure, we can assume that the face code on each
- glyph is a valid index into FRAME_FACES (f), and the one to which
- we can actually apply intern_face. */
+ glyph is a valid index into FRAME_COMPUTED_FACES (f), and the one
+ to which we can actually apply intern_face. */
#if 1
/* This is the multi-face code. */
{
/* The face codes on the glyphs must be valid indices into the
frame's face table. */
- if (cf < 0 || cf >= FRAME_N_FACES (f))
+ if (cf < 0 || cf >= FRAME_N_COMPUTED_FACES (f)
+ || FRAME_COMPUTED_FACES (f) [cf] == 0)
abort ();
if (cf == 1)
face = FRAME_MODE_LINE_FACE (f);
else
- face = intern_face (f, FRAME_FACES (f) [cf]);
+ face = intern_face (f, FRAME_COMPUTED_FACES (f) [cf]);
font = FACE_FONT (face);
gc = FACE_GC (face);
defaulted = 0;
scroll bars, in pixels. */
int vertical_scroll_bar_extra;
- /* Table of faces for this frame. */
- struct face **faces;
- /* Length of that table. */
- int n_faces;
+ /* Table of parameter faces for this frame. Any X resources (pixel
+ values, fonts) referred to here have been allocated explicitly
+ for this face, and should be freed if we change the face. */
+ struct face **param_faces;
+ int n_param_faces;
+
+ /* Table of computed faces for this frame. These are the faces
+ whose indexes go into the upper bits of a glyph, computed by
+ combining the parameter faces specified by overlays, text
+ properties, and what have you. The X resources mentioned here
+ are all shared with parameter faces. */
+ struct face **computed_faces;
+ int n_computed_faces; /* How many are valid */
+ int size_computed_faces; /* How many are allocated */
};
-/* Get at the faces of an X window frame. */
-#define FRAME_FACES(f) ((f)->display.x->faces)
-#define FRAME_N_FACES(f) ((f)->display.x->n_faces)
-#define FRAME_DEFAULT_FACE(f) ((f)->display.x->faces[0])
-#define FRAME_MODE_LINE_FACE(f) ((f)->display.x->faces[1])
+/* Get at the computed faces of an X window frame. */
+#define FRAME_PARAM_FACES(f) ((f)->display.x->param_faces)
+#define FRAME_N_PARAM_FACES(f) ((f)->display.x->n_param_faces)
+#define FRAME_DEFAULT_PARAM_FACE(f) (FRAME_PARAM_FACES (f)[0])
+#define FRAME_MODE_LINE_PARAM_FACE(f) (FRAME_PARAM_FACES (f)[1])
+
+#define FRAME_COMPUTED_FACES(f) ((f)->display.x->computed_faces)
+#define FRAME_N_COMPUTED_FACES(f) ((f)->display.x->n_computed_faces)
+#define FRAME_SIZE_COMPUTED_FACES(f) ((f)->display.x->size_computed_faces)
+#define FRAME_DEFAULT_FACE(f) ((f)->display.x->computed_faces[0])
+#define FRAME_MODE_LINE_FACE(f) ((f)->display.x->computed_faces[1])
/* Return the window associated with the frame F. */
#define FRAME_X_WINDOW(f) ((f)->display.x->window_desc)
\f
/* Interface to the face code functions. */
-/* Create the first two faces for a frame -- the ones that have GC's. */
+/* Create the first two computed faces for a frame -- the ones that
+ have GC's. */
extern void init_frame_faces (/* FRAME_PTR */);
/* Free the resources for the faces associated with a frame. */
extern void free_frame_faces (/* FRAME_PTR */);
-/* Given a non-display face, find or make an equivalent display face
+/* Given a computed face, find or make an equivalent display face
in face_vector, and return a pointer to it. */
extern struct face *intern_face (/* FRAME_PTR, struct face * */);
depend. */
extern void recompute_basic_faces (/* FRAME_PTR */);
-/* Return the face ID associated with a buffer position POS.
- Store into *ENDPTR the position at which a different face is needed.
- This does not take account of glyphs that specify their own face codes.
- F is the frame in use for display, and W is a window displaying
- the current buffer.
+/* Return the face ID associated with a buffer position POS. Store
+ into *ENDPTR the next position at which a different face is
+ needed. This does not take account of glyphs that specify their
+ own face codes. F is the frame in use for display, and W is a
+ window displaying the current buffer.
REGION_BEG, REGION_END delimit the region, so it can be highlighted. */
extern int compute_char_face (/* FRAME_PTR frame,