1 /* Definitions and headers for communication with X protocol.
2 Copyright (C) 1989, 1993, 1994 Free Software Foundation, Inc.
4 This file is part of GNU Emacs.
6 GNU Emacs is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU Emacs is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Emacs; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
21 #include <X11/cursorfont.h>
22 #include <X11/Xutil.h>
23 #include <X11/keysym.h>
24 #include <X11/Xatom.h>
25 #include <X11/Xresource.h>
28 #include <X11/StringDefs.h>
29 #include <X11/IntrinsicP.h> /* CoreP.h needs this */
30 #include <X11/CoreP.h> /* foul, but we need this to use our own
31 window inside a widget instead of one
33 #include <X11/StringDefs.h>
36 /* The class of this X application. */
37 #define EMACS_CLASS "Emacs"
39 /* Bookkeeping to distinguish X versions. */
41 /* HAVE_X11R4 is defined if we have the features of X11R4. It should
42 be defined when we're using X11R5, since X11R5 has the features of
43 X11R4. If, in the future, we find we need more of these flags
44 (HAVE_X11R5, for example), code should always be written to test
45 the most recent flag first:
55 If you ever find yourself writing a "#ifdef HAVE_FOO" clause that
56 looks a lot like another one, consider moving the text into a macro
57 whose definition is configuration-dependent, but whose usage is
58 universal - like the stuff in systime.h.
60 It turns out that we can auto-detect whether we're being compiled
61 with X11R3 or X11R4 by looking for the flag macros for R4 structure
62 members that R3 doesn't have. */
64 /* AIX 3.1's X is somewhere between X11R3 and X11R4. It has
65 PBaseSize, but not XWithdrawWindow, XSetWMName, XSetWMNormalHints,
67 AIX 3.2 is at least X11R4. */
68 #if (!defined AIX) || (defined AIX3_2)
73 #ifdef XlibSpecificationRelease
74 #if XlibSpecificationRelease >= 5
76 /* In case someone has X11R5 on AIX 3.1,
77 make sure HAVE_X11R4 is defined as well as HAVE_X11R5. */
82 #define BLACK_PIX_DEFAULT(f) BlackPixel (FRAME_X_DISPLAY (f), \
83 XScreenNumberOfScreen (FRAME_X_SCREEN (f)))
84 #define WHITE_PIX_DEFAULT(f) WhitePixel (FRAME_X_DISPLAY (f), \
85 XScreenNumberOfScreen (FRAME_X_SCREEN (f)))
87 #define FONT_WIDTH(f) ((f)->max_bounds.width)
88 #define FONT_HEIGHT(f) ((f)->ascent + (f)->descent)
89 #define FONT_BASE(f) ((f)->ascent)
91 #define CHECK_X_FRAME(f, frame) \
96 CHECK_LIVE_FRAME (frame, 0); \
103 /* The mask of events that text windows always want to receive. This
104 does not include mouse movement events. It is used when the window
105 is created (in x_window) and and in selection processing.
107 We do include ButtonReleases in this set because Emacs isn't always
108 fast enough to catch them when it wants them, and they're rare
109 enough that they don't use much processor time. */
111 #define STANDARD_EVENT_SET \
115 | ButtonReleaseMask \
116 | PointerMotionMask \
117 | PointerMotionHintMask \
118 | StructureNotifyMask \
122 | VisibilityChangeMask)
124 /* This checks to make sure we have a display. */
125 extern void check_x ();
127 extern struct frame
*x_window_to_frame ();
130 extern struct frame
*x_any_window_to_frame ();
131 extern struct frame
*x_top_window_to_frame ();
134 /* The frame (if any) which has the X window that has keyboard focus.
135 Zero if none. This is examined by Ffocus_frame in xfns.c */
137 extern struct frame
*x_focus_frame
;
139 extern Visual
*select_visual ();
141 enum text_cursor_kinds
{
142 filled_box_cursor
, hollow_box_cursor
, bar_cursor
145 /* This data type is used for the font_table field
146 of struct x_display_info. */
155 /* Structure recording X pixmap and reference count.
156 If REFCOUNT is 0 then this record is free to be reused. */
158 struct x_bitmap_record
163 /* Record some info about this pixmap. */
164 int height
, width
, depth
;
167 /* For each X display, we have a structure that records
168 information about it. */
170 struct x_display_info
172 /* Chain of all x_display_info structures. */
173 struct x_display_info
*next
;
174 /* Connection number (normally a file descriptor number). */
176 /* This says how to access this display in Xlib. */
178 /* This is a cons cell of the form (NAME . FONT-LIST-CACHE).
179 The same cons cell also appears in x_display_name_list. */
180 Lisp_Object name_list_element
;
181 /* Number of frames that are on this display. */
183 /* The Screen this connection is connected to. */
185 /* The Visual being used for this display. */
187 /* Number of panes on this screen. */
189 /* Dimensions of this screen. */
191 /* Mask of things that cause the mouse to be grabbed. */
193 /* Emacs bitmap-id of the default icon bitmap for this frame.
194 Or -1 if none has been allocated yet. */
196 /* The root window of this screen. */
198 /* The cursor to use for vertical scroll bars. */
199 Cursor vertical_scroll_bar_cursor
;
200 /* X Resource data base */
203 /* A table of all the fonts we have already loaded. */
204 struct font_info
*font_table
;
206 /* The current capacity of x_font_table. */
209 /* Reusable Graphics Context for drawing a cursor in a non-default face. */
210 GC scratch_cursor_gc
;
212 /* These variables describe the range of text currently shown
213 in its mouse-face, together with the window they apply to.
214 As long as the mouse stays within this range, we need not
215 redraw anything on its account. */
216 int mouse_face_beg_row
, mouse_face_beg_col
;
217 int mouse_face_end_row
, mouse_face_end_col
;
218 int mouse_face_past_end
;
219 Lisp_Object mouse_face_window
;
220 int mouse_face_face_id
;
222 /* 1 if a mouse motion event came and we didn't handle it right away because
223 gc was in progress. */
224 int mouse_face_deferred_gc
;
226 /* FRAME and X, Y position of mouse when last checked for
227 highlighting. X and Y can be negative or out of range for the frame. */
228 struct frame
*mouse_face_mouse_frame
;
229 int mouse_face_mouse_x
, mouse_face_mouse_y
;
231 /* Nonzero means defer mouse-motion highlighting. */
232 int mouse_face_defer
;
236 /* The number of fonts actually stored in x_font_table.
237 font_table[n] is used and valid iff 0 <= n < n_fonts.
238 0 <= n_fonts <= font_table_size. */
241 /* Pointer to bitmap records. */
242 struct x_bitmap_record
*bitmaps
;
244 /* Allocated size of bitmaps field. */
247 /* Last used bitmap index. */
250 /* Which modifier keys are on which modifier bits?
252 With each keystroke, X returns eight bits indicating which modifier
253 keys were held down when the key was pressed. The interpretation
254 of the top five modifier bits depends on what keys are attached
255 to them. If the Meta_L and Meta_R keysyms are on mod5, then mod5
258 meta_mod_mask is a mask containing the bits used for the meta key.
259 It may have more than one bit set, if more than one modifier bit
260 has meta keys on it. Basically, if EVENT is a KeyPress event,
261 the meta key is pressed if (EVENT.state & meta_mod_mask) != 0.
263 shift_lock_mask is LockMask if the XK_Shift_Lock keysym is on the
264 lock modifier bit, or zero otherwise. Non-alphabetic keys should
265 only be affected by the lock modifier bit if XK_Shift_Lock is in
266 use; XK_Caps_Lock should only affect alphabetic keys. With this
267 arrangement, the lock modifier should shift the character if
268 (EVENT.state & shift_lock_mask) != 0. */
269 int meta_mod_mask
, shift_lock_mask
;
271 /* These are like meta_mod_mask, but for different modifiers. */
272 int alt_mod_mask
, super_mod_mask
, hyper_mod_mask
;
274 /* Communication with window managers. */
275 Atom Xatom_wm_protocols
;
276 /* Kinds of protocol things we may receive. */
277 Atom Xatom_wm_take_focus
;
278 Atom Xatom_wm_save_yourself
;
279 Atom Xatom_wm_delete_window
;
280 /* Atom for indicating window state to the window manager. */
281 Atom Xatom_wm_change_state
;
282 /* Other WM communication */
283 Atom Xatom_wm_configure_denied
; /* When our config request is denied */
284 Atom Xatom_wm_window_moved
; /* When the WM moves us. */
285 /* EditRes protocol */
288 /* More atoms, which are selection types. */
289 Atom Xatom_CLIPBOARD
, Xatom_TIMESTAMP
, Xatom_TEXT
, Xatom_DELETE
,
290 Xatom_MULTIPLE
, Xatom_INCR
, Xatom_EMACS_TMP
, Xatom_TARGETS
, Xatom_NULL
,
294 /* This is a chain of structures for all the X displays currently in use. */
295 extern struct x_display_info
*x_display_list
;
297 /* This is a list of cons cells, each of the form (NAME . FONT-LIST-CACHE),
298 one for each element of x_display_list and in the same order.
299 NAME is the name of the frame.
300 FONT-LIST-CACHE records previous values returned by x-list-fonts. */
301 extern Lisp_Object x_display_name_list
;
303 extern struct x_display_info
*x_display_info_for_display ();
304 extern struct x_display_info
*x_display_info_for_name ();
306 extern struct x_display_info
*x_term_init ();
308 /* Each X frame object points to its own struct x_display object
309 in the display.x field. The x_display structure contains all
310 the information that is specific to X windows. */
314 /* Position of the X window (x and y offsets in root window). */
318 /* Border width of the X window as known by the X window system. */
321 /* Size of the X window in pixels. */
322 int pixel_height
, pixel_width
;
324 /* Height of a line, in pixels. */
327 /* The tiled border used when the mouse is out of the frame. */
330 /* Here are the Graphics Contexts for the default font. */
331 GC normal_gc
; /* Normal video */
332 GC reverse_gc
; /* Reverse video */
333 GC cursor_gc
; /* cursor drawing */
335 /* Width of the internal border. This is a line of background color
336 just inside the window's border. When the frame is selected,
337 a highlighting is displayed inside the internal border. */
338 int internal_border_width
;
340 /* The X window used for this frame.
341 May be zero while the frame object is being created
342 and the X window has not yet been created. */
345 /* The X window used for the bitmap icon;
346 or 0 if we don't have a bitmap icon. */
349 /* The X window that is the parent of this X window.
350 Usually but not always RootWindow. */
354 /* The widget of this screen. This is the window of a "shell" widget. */
356 /* The XmPanedWindows... */
357 Widget column_widget
;
358 /* The widget of the edit portion of this screen; the window in
359 "window_desc" is inside of this. */
362 Widget menubar_widget
;
365 /* If >=0, a bitmap index. The indicated bitmap is used for the
371 /* Pixel values used for various purposes.
372 border_pixel may be -1 meaning use a gray tile. */
373 unsigned long background_pixel
;
374 unsigned long foreground_pixel
;
375 unsigned long cursor_pixel
;
376 unsigned long border_pixel
;
377 unsigned long mouse_pixel
;
378 unsigned long cursor_foreground_pixel
;
380 /* Descriptor for the cursor in use for this window. */
382 Cursor nontext_cursor
;
383 Cursor modeline_cursor
;
386 /* The name that was associated with the icon, the last time
387 it was refreshed. Usually the same as the name of the
388 buffer in the currently selected window in the frame */
391 /* Flag to set when the X window needs to be completely repainted. */
394 /* What kind of text cursor is drawn in this window right now?
395 (If there is no cursor (phys_cursor_x < 0), then this means nothing.) */
396 enum text_cursor_kinds current_cursor
;
398 /* What kind of text cursor should we draw in the future?
399 This should always be filled_box_cursor or bar_cursor. */
400 enum text_cursor_kinds desired_cursor
;
402 /* These are the current window manager hints. It seems that
403 XSetWMHints, when presented with an unset bit in the `flags'
404 member of the hints structure, does not leave the corresponding
405 attribute unchanged; rather, it resets that attribute to its
406 default value. For example, unless you set the `icon_pixmap'
407 field and the `IconPixmapHint' bit, XSetWMHints will forget what
408 your icon pixmap was. This is rather troublesome, since some of
409 the members (for example, `input' and `icon_pixmap') want to stay
410 the same throughout the execution of Emacs. So, we keep this
411 structure around, just leaving values in it and adding new bits
412 to the mask as we go. */
415 /* The size of the extra width currently allotted for vertical
416 scroll bars, in pixels. */
417 int vertical_scroll_bar_extra
;
419 /* Table of parameter faces for this frame. Any X resources (pixel
420 values, fonts) referred to here have been allocated explicitly
421 for this face, and should be freed if we change the face. */
422 struct face
**param_faces
;
425 /* Table of computed faces for this frame. These are the faces
426 whose indexes go into the upper bits of a glyph, computed by
427 combining the parameter faces specified by overlays, text
428 properties, and what have you. The X resources mentioned here
429 are all shared with parameter faces. */
430 struct face
**computed_faces
;
431 int n_computed_faces
; /* How many are valid */
432 int size_computed_faces
; /* How many are allocated */
434 /* This is the gravity value for the specified window position. */
437 /* The geometry flags for this window. */
440 /* This is the Emacs structure for the X display this frame is on. */
441 struct x_display_info
*display_info
;
444 /* Get at the computed faces of an X window frame. */
445 #define FRAME_PARAM_FACES(f) ((f)->display.x->param_faces)
446 #define FRAME_N_PARAM_FACES(f) ((f)->display.x->n_param_faces)
447 #define FRAME_DEFAULT_PARAM_FACE(f) (FRAME_PARAM_FACES (f)[0])
448 #define FRAME_MODE_LINE_PARAM_FACE(f) (FRAME_PARAM_FACES (f)[1])
450 #define FRAME_COMPUTED_FACES(f) ((f)->display.x->computed_faces)
451 #define FRAME_N_COMPUTED_FACES(f) ((f)->display.x->n_computed_faces)
452 #define FRAME_SIZE_COMPUTED_FACES(f) ((f)->display.x->size_computed_faces)
453 #define FRAME_DEFAULT_FACE(f) ((f)->display.x->computed_faces[0])
454 #define FRAME_MODE_LINE_FACE(f) ((f)->display.x->computed_faces[1])
456 /* Return the window associated with the frame F. */
457 #define FRAME_X_WINDOW(f) ((f)->display.x->window_desc)
459 #define FRAME_FOREGROUND_PIXEL(f) ((f)->display.x->foreground_pixel)
460 #define FRAME_BACKGROUND_PIXEL(f) ((f)->display.x->background_pixel)
461 #define FRAME_FONT(f) ((f)->display.x->font)
463 /* This gives the x_display_info structure for the display F is on. */
464 #define FRAME_X_DISPLAY_INFO(f) ((f)->display.x->display_info)
466 /* This is the `Display *' which frame F is on. */
467 #define FRAME_X_DISPLAY(f) (FRAME_X_DISPLAY_INFO (f)->display)
469 /* This is the `Screen *' which frame F is on. */
470 #define FRAME_X_SCREEN(f) (FRAME_X_DISPLAY_INFO (f)->screen)
472 /* These two really ought to be called FRAME_PIXEL_{WIDTH,HEIGHT}. */
473 #define PIXEL_WIDTH(f) ((f)->display.x->pixel_width)
474 #define PIXEL_HEIGHT(f) ((f)->display.x->pixel_height)
476 #define FRAME_DESIRED_CURSOR(f) ((f)->display.x->desired_cursor)
479 /* X-specific scroll bar stuff. */
481 /* We represent scroll bars as lisp vectors. This allows us to place
482 references to them in windows without worrying about whether we'll
483 end up with windows referring to dead scroll bars; the garbage
484 collector will free it when its time comes.
486 We use struct scroll_bar as a template for accessing fields of the
491 /* These fields are shared by all vectors. */
492 EMACS_INT size_from_Lisp_Vector_struct
;
493 struct Lisp_Vector
*next_from_Lisp_Vector_struct
;
495 /* The window we're a scroll bar for. */
498 /* The next and previous in the chain of scroll bars in this frame. */
499 Lisp_Object next
, prev
;
501 /* The X window representing this scroll bar. Since this is a full
502 32-bit quantity, we store it split into two 32-bit values. */
503 Lisp_Object x_window_low
, x_window_high
;
505 /* The position and size of the scroll bar in pixels, relative to the
507 Lisp_Object top
, left
, width
, height
;
509 /* The starting and ending positions of the handle, relative to the
510 handle area (i.e. zero is the top position, not
511 SCROLL_BAR_TOP_BORDER). If they're equal, that means the handle
512 hasn't been drawn yet.
514 These are not actually the locations where the beginning and end
515 are drawn; in order to keep handles from becoming invisible when
516 editing large files, we establish a minimum height by always
517 drawing handle bottoms VERTICAL_SCROLL_BAR_MIN_HANDLE pixels below
518 where they would be normally; the bottom and top are in a
519 different co-ordinate system. */
520 Lisp_Object start
, end
;
522 /* If the scroll bar handle is currently being dragged by the user,
523 this is the number of pixels from the top of the handle to the
524 place where the user grabbed it. If the handle isn't currently
525 being dragged, this is Qnil. */
526 Lisp_Object dragging
;
529 /* The number of elements a vector holding a struct scroll_bar needs. */
530 #define SCROLL_BAR_VEC_SIZE \
531 ((sizeof (struct scroll_bar) - sizeof (EMACS_INT) - sizeof (struct Lisp_Vector *)) \
532 / sizeof (Lisp_Object))
534 /* Turning a lisp vector value into a pointer to a struct scroll_bar. */
535 #define XSCROLL_BAR(vec) ((struct scroll_bar *) XPNTR (vec))
538 /* Building a 32-bit C integer from two 16-bit lisp integers. */
539 #define SCROLL_BAR_PACK(low, high) (XINT (high) << 16 | XINT (low))
541 /* Setting two lisp integers to the low and high words of a 32-bit C int. */
542 #define SCROLL_BAR_UNPACK(low, high, int32) \
543 (XSETINT ((low), (int32) & 0xffff), \
544 XSETINT ((high), ((int32) >> 16) & 0xffff))
547 /* Extract the X window id of the scroll bar from a struct scroll_bar. */
548 #define SCROLL_BAR_X_WINDOW(ptr) \
549 ((Window) SCROLL_BAR_PACK ((ptr)->x_window_low, (ptr)->x_window_high))
551 /* Store a window id in a struct scroll_bar. */
552 #define SET_SCROLL_BAR_X_WINDOW(ptr, id) \
553 (SCROLL_BAR_UNPACK ((ptr)->x_window_low, (ptr)->x_window_high, (int) id))
556 /* Return the outside pixel height for a vertical scroll bar HEIGHT
557 rows high on frame F. */
558 #define VERTICAL_SCROLL_BAR_PIXEL_HEIGHT(f, height) \
559 ((height) * (f)->display.x->line_height)
561 /* Return the inside width of a vertical scroll bar, given the outside
563 #define VERTICAL_SCROLL_BAR_INSIDE_WIDTH(width) \
564 ((width) - VERTICAL_SCROLL_BAR_LEFT_BORDER - VERTICAL_SCROLL_BAR_RIGHT_BORDER)
566 /* Return the length of the rectangle within which the top of the
567 handle must stay. This isn't equivalent to the inside height,
568 because the scroll bar handle has a minimum height.
570 This is the real range of motion for the scroll bar, so when we're
571 scaling buffer positions to scroll bar positions, we use this, not
572 VERTICAL_SCROLL_BAR_INSIDE_HEIGHT. */
573 #define VERTICAL_SCROLL_BAR_TOP_RANGE(height) \
574 (VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (height) - VERTICAL_SCROLL_BAR_MIN_HANDLE)
576 /* Return the inside height of vertical scroll bar, given the outside
577 height. See VERTICAL_SCROLL_BAR_TOP_RANGE too. */
578 #define VERTICAL_SCROLL_BAR_INSIDE_HEIGHT(height) \
579 ((height) - VERTICAL_SCROLL_BAR_TOP_BORDER - VERTICAL_SCROLL_BAR_BOTTOM_BORDER)
582 /* Border widths for scroll bars.
584 Scroll bar windows don't have any X borders; their border width is
585 set to zero, and we redraw borders ourselves. This makes the code
586 a bit cleaner, since we don't have to convert between outside width
587 (used when relating to the rest of the screen) and inside width
588 (used when sizing and drawing the scroll bar window itself).
590 The handle moves up and down/back and forth in a rectangle inset
591 from the edges of the scroll bar. These are widths by which we
592 inset the handle boundaries from the scroll bar edges. */
593 #define VERTICAL_SCROLL_BAR_LEFT_BORDER (2)
594 #define VERTICAL_SCROLL_BAR_RIGHT_BORDER (2)
595 #define VERTICAL_SCROLL_BAR_TOP_BORDER (2)
596 #define VERTICAL_SCROLL_BAR_BOTTOM_BORDER (2)
598 /* Minimum lengths for scroll bar handles, in pixels. */
599 #define VERTICAL_SCROLL_BAR_MIN_HANDLE (5)
602 /* Manipulating pixel sizes and character sizes.
603 Knowledge of which factors affect the overall size of the window should
604 be hidden in these macros, if that's possible.
606 Return the upper/left pixel position of the character cell on frame F
608 #define CHAR_TO_PIXEL_ROW(f, row) \
609 ((f)->display.x->internal_border_width \
610 + (row) * (f)->display.x->line_height)
611 #define CHAR_TO_PIXEL_COL(f, col) \
612 ((f)->display.x->internal_border_width \
613 + (col) * FONT_WIDTH ((f)->display.x->font))
615 /* Return the pixel width/height of frame F if it has
616 WIDTH columns/HEIGHT rows. */
617 #define CHAR_TO_PIXEL_WIDTH(f, width) \
618 (CHAR_TO_PIXEL_COL (f, width) \
619 + (f)->display.x->vertical_scroll_bar_extra \
620 + (f)->display.x->internal_border_width)
621 #define CHAR_TO_PIXEL_HEIGHT(f, height) \
622 (CHAR_TO_PIXEL_ROW (f, height) \
623 + (f)->display.x->internal_border_width)
626 /* Return the row/column (zero-based) of the character cell containing
627 the pixel on FRAME at ROW/COL. */
628 #define PIXEL_TO_CHAR_ROW(f, row) \
629 (((row) - (f)->display.x->internal_border_width) \
630 / (f)->display.x->line_height)
631 #define PIXEL_TO_CHAR_COL(f, col) \
632 (((col) - (f)->display.x->internal_border_width) \
633 / FONT_WIDTH ((f)->display.x->font))
635 /* How many columns/rows of text can we fit in WIDTH/HEIGHT pixels on
637 #define PIXEL_TO_CHAR_WIDTH(f, width) \
638 (PIXEL_TO_CHAR_COL (f, ((width) \
639 - (f)->display.x->internal_border_width \
640 - (f)->display.x->vertical_scroll_bar_extra)))
641 #define PIXEL_TO_CHAR_HEIGHT(f, height) \
642 (PIXEL_TO_CHAR_ROW (f, ((height) \
643 - (f)->display.x->internal_border_width)))
645 /* If a struct input_event has a kind which is selection_request_event
646 or selection_clear_event, then its contents are really described
647 by this structure. */
649 /* For an event of kind selection_request_event,
650 this structure really describes the contents. */
651 struct selection_input_event
656 Atom selection
, target
, property
;
660 #define SELECTION_EVENT_DISPLAY(eventp) \
661 (((struct selection_input_event *) (eventp))->display)
662 #define SELECTION_EVENT_REQUESTOR(eventp) \
663 (((struct selection_input_event *) (eventp))->requestor)
664 #define SELECTION_EVENT_SELECTION(eventp) \
665 (((struct selection_input_event *) (eventp))->selection)
666 #define SELECTION_EVENT_TARGET(eventp) \
667 (((struct selection_input_event *) (eventp))->target)
668 #define SELECTION_EVENT_PROPERTY(eventp) \
669 (((struct selection_input_event *) (eventp))->property)
670 #define SELECTION_EVENT_TIME(eventp) \
671 (((struct selection_input_event *) (eventp))->time)
674 /* Interface to the face code functions. */
676 /* Create the first two computed faces for a frame -- the ones that
678 extern void init_frame_faces (/* FRAME_PTR */);
680 /* Free the resources for the faces associated with a frame. */
681 extern void free_frame_faces (/* FRAME_PTR */);
683 /* Given a computed face, find or make an equivalent display face
684 in face_vector, and return a pointer to it. */
685 extern struct face
*intern_face (/* FRAME_PTR, struct face * */);
687 /* Given a frame and a face name, return the face's ID number, or
688 zero if it isn't a recognized face name. */
689 extern int face_name_id_number (/* FRAME_PTR, Lisp_Object */);
691 /* Return non-zero if FONT1 and FONT2 have the same size bounding box.
692 We assume that they're both character-cell fonts. */
693 extern int same_size_fonts (/* XFontStruct *, XFontStruct * */);
695 /* Recompute the GC's for the default and modeline faces.
696 We call this after changing frame parameters on which those GC's
698 extern void recompute_basic_faces (/* FRAME_PTR */);
700 /* Return the face ID associated with a buffer position POS. Store
701 into *ENDPTR the next position at which a different face is
702 needed. This does not take account of glyphs that specify their
703 own face codes. F is the frame in use for display, and W is a
704 window displaying the current buffer.
706 REGION_BEG, REGION_END delimit the region, so it can be highlighted. */
707 extern int compute_char_face (/* FRAME_PTR frame,
710 int region_beg, int region_end,
712 /* Return the face ID to use to display a special glyph which selects
713 FACE_CODE as the face ID, assuming that ordinarily the face would
714 be BASIC_FACE. F is the frame. */
715 extern int compute_glyph_face (/* FRAME_PTR, int */);