Mercurial > emacs
annotate src/xfaces.c @ 9529:8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
(face_vector, nfaces, nfaces_allocated): Vars deleted.
(free_frame_faces): Free GCs in the computed faces.
Free the computed faces themselves.
(clear_face_cache): Renamed from clear_face_vector
and completely rewritten to free GCs in the computed faces.
(get_cached_face): Function deleted.
(build_face): Function deleted; code moved into intern_face.
(intern_face): Don't treat default and modeline faces specially.
(recompute_basic_faces): Call intern_face, not build_face.
(intern_face, clear_face_vector, load_font, unload_font)
(load_color, free_frame_faces, recompute_basic_faces): Use FRAME_X_DISPLAY.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 14 Oct 1994 05:19:13 +0000 |
parents | bcf42f7e049a |
children | 1bfb920ab23e |
rev | line source |
---|---|
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
1 /* "Face" primitives. |
7307 | 2 Copyright (C) 1993, 1994 Free Software Foundation. |
2342 | 3 |
2336 | 4 This file is part of GNU Emacs. |
5 | |
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 | |
2342 | 8 the Free Software Foundation; either version 2, or (at your option) |
2336 | 9 any later version. |
10 | |
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. | |
15 | |
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. */ | |
19 | |
2438 | 20 /* This is derived from work by Lucid (some parts very loosely so). */ |
2342 | 21 |
2336 | 22 #include <sys/types.h> |
23 #include <sys/stat.h> | |
24 | |
4696
1fc792473491
Include <config.h> instead of "config.h".
Roland McGrath <roland@gnu.org>
parents:
4258
diff
changeset
|
25 #include <config.h> |
2336 | 26 #include "lisp.h" |
27 | |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
28 #ifdef HAVE_X_WINDOWS |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
29 |
2336 | 30 #include "xterm.h" |
31 #include "buffer.h" | |
2391 | 32 #include "dispextern.h" |
2342 | 33 #include "frame.h" |
2438 | 34 #include "blockinput.h" |
2767
482fa0725db6
* xfaces.c (intern_frame_face): Exchange order of arguments, to
Jim Blandy <jimb@redhat.com>
parents:
2743
diff
changeset
|
35 #include "window.h" |
8848 | 36 #include "intervals.h" |
2336 | 37 |
3997
d968bcba16af
* xfaces.c [XOS_NEEDS_TIME_H]: #undef USG while #including
Jim Blandy <jimb@redhat.com>
parents:
3882
diff
changeset
|
38 /* Compensate for bug in Xos.h on some systems, on which it requires |
d968bcba16af
* xfaces.c [XOS_NEEDS_TIME_H]: #undef USG while #including
Jim Blandy <jimb@redhat.com>
parents:
3882
diff
changeset
|
39 time.h. On some such systems, Xos.h tries to redefine struct |
d968bcba16af
* xfaces.c [XOS_NEEDS_TIME_H]: #undef USG while #including
Jim Blandy <jimb@redhat.com>
parents:
3882
diff
changeset
|
40 timeval and struct timezone if USG is #defined while it is |
d968bcba16af
* xfaces.c [XOS_NEEDS_TIME_H]: #undef USG while #including
Jim Blandy <jimb@redhat.com>
parents:
3882
diff
changeset
|
41 #included. */ |
3436
291f28da7ea1
Test XOS_NEEDS_TIME_H, not HPUX, for including time.hj.
Richard M. Stallman <rms@gnu.org>
parents:
3401
diff
changeset
|
42 #ifdef XOS_NEEDS_TIME_H |
3277
564f748751ea
[HPUX]: Include time.h and define __TIMEVAL__.
Richard M. Stallman <rms@gnu.org>
parents:
3074
diff
changeset
|
43 |
3997
d968bcba16af
* xfaces.c [XOS_NEEDS_TIME_H]: #undef USG while #including
Jim Blandy <jimb@redhat.com>
parents:
3882
diff
changeset
|
44 #include <time.h> |
d968bcba16af
* xfaces.c [XOS_NEEDS_TIME_H]: #undef USG while #including
Jim Blandy <jimb@redhat.com>
parents:
3882
diff
changeset
|
45 #undef USG |
d968bcba16af
* xfaces.c [XOS_NEEDS_TIME_H]: #undef USG while #including
Jim Blandy <jimb@redhat.com>
parents:
3882
diff
changeset
|
46 #include <X11/Xos.h> |
d968bcba16af
* xfaces.c [XOS_NEEDS_TIME_H]: #undef USG while #including
Jim Blandy <jimb@redhat.com>
parents:
3882
diff
changeset
|
47 #define USG |
d968bcba16af
* xfaces.c [XOS_NEEDS_TIME_H]: #undef USG while #including
Jim Blandy <jimb@redhat.com>
parents:
3882
diff
changeset
|
48 #define __TIMEVAL__ |
d968bcba16af
* xfaces.c [XOS_NEEDS_TIME_H]: #undef USG while #including
Jim Blandy <jimb@redhat.com>
parents:
3882
diff
changeset
|
49 |
d968bcba16af
* xfaces.c [XOS_NEEDS_TIME_H]: #undef USG while #including
Jim Blandy <jimb@redhat.com>
parents:
3882
diff
changeset
|
50 #else |
3316
9857db8aa4cd
* xfaces.c (unload_color): Don't #include <X11/Intrinsic.h>,
Jim Blandy <jimb@redhat.com>
parents:
3302
diff
changeset
|
51 |
2336 | 52 #include <X11/Xos.h> |
53 | |
3997
d968bcba16af
* xfaces.c [XOS_NEEDS_TIME_H]: #undef USG while #including
Jim Blandy <jimb@redhat.com>
parents:
3882
diff
changeset
|
54 #endif |
d968bcba16af
* xfaces.c [XOS_NEEDS_TIME_H]: #undef USG while #including
Jim Blandy <jimb@redhat.com>
parents:
3882
diff
changeset
|
55 |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
56 |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
57 /* An explanation of the face data structures. */ |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
58 |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
59 /* ========================= Face Data Structures ========================= |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
60 |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
61 Let FACE-NAME be a symbol naming a face. |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
62 |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
63 Let FACE-VECTOR be (assq FACE-NAME (frame-face-alist FRAME)) |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
64 FACE-VECTOR is either nil, or a vector of the form |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
65 [face NAME ID FONT FOREGROUND BACKGROUND BACKGROUND-PIXMAP UNDERLINE-P] |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
66 where |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
67 face is the symbol `face', |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
68 NAME is the symbol with which this vector is associated (a backpointer), |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
69 ID is the face ID, an integer used internally by the C code to identify |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
70 the face, |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
71 FONT, FOREGROUND, and BACKGROUND are strings naming the fonts and colors |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
72 to use with the face, |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
73 BACKGROUND-PIXMAP is the name of an x bitmap filename, which we don't |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
74 use right now, and |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
75 UNDERLINE-P is non-nil if the face should be underlined. |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
76 If any of these elements are nil, that parameter is considered |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
77 unspecified; parameters from faces specified by lower-priority |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
78 overlays or text properties, or the parameters of the frame itself, |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
79 can show through. (lisp/faces.el maintains these lists.) |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
80 |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
81 (assq FACE-NAME global-face-data) returns a vector describing the |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
82 global parameters for that face. |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
83 |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
84 Let PARAM-FACE be FRAME->display.x->param_faces[Faref (FACE-VECTOR, 2)]. |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
85 PARAM_FACE is a struct face whose members are the Xlib analogues of |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
86 the parameters in FACE-VECTOR. If an element of FACE-VECTOR is |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
87 nil, then the corresponding member of PARAM_FACE is FACE_DEFAULT. |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
88 These faces are called "parameter faces", because they're the ones |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
89 lisp manipulates to control what gets displayed. Elements 0 and 1 |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
90 of FRAME->display.x->param_faces are special - they describe the |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
91 default and mode line faces. None of the faces in param_faces have |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
92 GC's. (See src/dispextern.h for the definiton of struct face. |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
93 lisp/faces.el maintains the isomorphism between face_alist and |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
94 param_faces.) |
2342 | 95 |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
96 The functions compute_char_face and compute_glyph_face find and |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
97 combine the parameter faces associated with overlays and text |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
98 properties. The resulting faces are called "computed faces"; none |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
99 of their members are FACE_DEFAULT; they are completely specified. |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
100 They then call intern_compute_face to search |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
101 FRAME->display.x->computed_faces for a matching face, add one if |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
102 none is found, and return the index into |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
103 FRAME->display.x->computed_faces. FRAME's glyph matrices use these |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
104 indices to record the faces of the matrix characters, and the X |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
105 display hooks consult compute_faces to decide how to display these |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
106 characters. Elements 0 and 1 of computed_faces always describe the |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
107 default and mode-line faces. |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
108 |
9529
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
109 Computed faces have graphics contexts some of the time. |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
110 intern_face builds a GC for a specified computed face |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
111 if it doesn't have one already. |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
112 clear_face_cache clears out the GCs of all computed faces. |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
113 This is done from time to time so that we don't hold on to |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
114 lots of GCs that are no longer needed. |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
115 |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
116 Constraints: |
2342 | 117 |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
118 Symbols naming faces must have associations on all frames; for any |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
119 FRAME, for all FACE-NAME, if (assq FACE-NAME (frame-face-alist |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
120 FRAME)) is non-nil, it must be non-nil for all frames. |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
121 |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
122 Analogously, indices into param_faces must be valid on all frames; |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
123 if param_faces[i] is a non-zero face pointer on one frame, then it |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
124 must be filled in on all frames. Code assumes that face ID's can |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
125 be used on any frame. |
2342 | 126 |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
127 Some subtleties: |
2342 | 128 |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
129 Why do we keep param_faces and computed_faces separate? |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
130 computed_faces contains an element for every combination of facial |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
131 parameters we have ever displayed. indices into param_faces have |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
132 to be valid on all frames. If they were the same array, then that |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
133 array would grow very large on all frames, because any facial |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
134 combination displayed on any frame would need to be a valid entry |
9529
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
135 on all frames. */ |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
136 |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
137 /* Definitions and declarations. */ |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
138 |
2336 | 139 /* The number of face-id's in use (same for all frames). */ |
140 int next_face_id; | |
141 | |
2795
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
142 /* The number of the face to use to indicate the region. */ |
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
143 int region_face; |
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
144 |
2838
5f6a2d52d2ef
(compute_char_face): Pass 0 as EXTEND arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
2821
diff
changeset
|
145 /* This is what appears in a slot in a face to signify that the face |
5f6a2d52d2ef
(compute_char_face): Pass 0 as EXTEND arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
2821
diff
changeset
|
146 does not specify that display aspect. */ |
2342 | 147 #define FACE_DEFAULT (~0) |
148 | |
6615
96ddf85642d1
(compute_char_face): New arg MOUSE.
Richard M. Stallman <rms@gnu.org>
parents:
5858
diff
changeset
|
149 Lisp_Object Qface, Qmouse_face; |
2391 | 150 |
3830
205d69567177
* xfaces.c: Add forward declaration for recompute_basic_faces.
Jim Blandy <jimb@redhat.com>
parents:
3811
diff
changeset
|
151 int face_name_id_number ( /* FRAME_PTR, Lisp_Object name */ ); |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
152 |
3830
205d69567177
* xfaces.c: Add forward declaration for recompute_basic_faces.
Jim Blandy <jimb@redhat.com>
parents:
3811
diff
changeset
|
153 struct face *intern_face ( /* FRAME_PTR, struct face * */ ); |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
154 static int new_computed_face ( /* FRAME_PTR, struct face * */ ); |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
155 static int intern_computed_face ( /* FRAME_PTR, struct face * */ ); |
3830
205d69567177
* xfaces.c: Add forward declaration for recompute_basic_faces.
Jim Blandy <jimb@redhat.com>
parents:
3811
diff
changeset
|
156 static void ensure_face_ready ( /* FRAME_PTR, int id */ ); |
3843
18892e151d53
* xfaces.c (recompute_basic_faces): This shouldn't be declared static.
Jim Blandy <jimb@redhat.com>
parents:
3830
diff
changeset
|
157 void recompute_basic_faces ( /* FRAME_PTR f */ ); |
2336 | 158 |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
159 /* Allocating, copying, and comparing struct faces. */ |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
160 |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
161 /* Allocate a new face */ |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
162 static struct face * |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
163 allocate_face () |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
164 { |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
165 struct face *result = (struct face *) xmalloc (sizeof (struct face)); |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
166 bzero (result, sizeof (struct face)); |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
167 result->font = (XFontStruct *) FACE_DEFAULT; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
168 result->foreground = FACE_DEFAULT; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
169 result->background = FACE_DEFAULT; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
170 result->stipple = FACE_DEFAULT; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
171 return result; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
172 } |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
173 |
2336 | 174 /* Make a new face that's a copy of an existing one. */ |
175 static struct face * | |
176 copy_face (face) | |
177 struct face *face; | |
178 { | |
179 struct face *result = allocate_face (); | |
180 | |
181 result->font = face->font; | |
182 result->foreground = face->foreground; | |
183 result->background = face->background; | |
2391 | 184 result->stipple = face->stipple; |
2336 | 185 result->underline = face->underline; |
186 | |
187 return result; | |
188 } | |
189 | |
190 static int | |
191 face_eql (face1, face2) | |
192 struct face *face1, *face2; | |
193 { | |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
194 return ( face1->font == face2->font |
2336 | 195 && face1->foreground == face2->foreground |
196 && face1->background == face2->background | |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
197 && face1->stipple == face2->stipple |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
198 && face1->underline == face2->underline); |
2336 | 199 } |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
200 |
9529
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
201 /* Managing graphics contexts of faces. */ |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
202 |
9529
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
203 /* Given a computed face, construct its graphics context if necessary. */ |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
204 |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
205 struct face * |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
206 intern_face (f, face) |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
207 struct frame *f; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
208 struct face *face; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
209 { |
2336 | 210 GC gc; |
211 XGCValues xgcv; | |
212 unsigned long mask; | |
213 | |
9529
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
214 if (face->gc) |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
215 return face; |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
216 |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
217 BLOCK_INPUT; |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
218 |
2391 | 219 if (face->foreground != FACE_DEFAULT) |
220 xgcv.foreground = face->foreground; | |
221 else | |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
222 xgcv.foreground = f->display.x->foreground_pixel; |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
223 |
2391 | 224 if (face->background != FACE_DEFAULT) |
225 xgcv.background = face->background; | |
226 else | |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
227 xgcv.background = f->display.x->background_pixel; |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
228 |
2391 | 229 if (face->font && (int) face->font != FACE_DEFAULT) |
230 xgcv.font = face->font->fid; | |
231 else | |
232 xgcv.font = f->display.x->font->fid; | |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
233 |
2336 | 234 xgcv.graphics_exposures = 0; |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
235 |
2336 | 236 mask = GCForeground | GCBackground | GCFont | GCGraphicsExposures; |
9529
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
237 gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
2336 | 238 mask, &xgcv); |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
239 |
2336 | 240 #if 0 |
2391 | 241 if (face->stipple && face->stipple != FACE_DEFAULT) |
9529
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
242 XSetStipple (FRAME_X_DISPLAY (f), gc, face->stipple); |
2336 | 243 #endif |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
244 |
2391 | 245 face->gc = gc; |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
246 |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
247 UNBLOCK_INPUT; |
9529
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
248 |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
249 return face; |
2336 | 250 } |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
251 |
9529
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
252 /* Clear out all graphics contexts for all computed faces |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
253 except for the default and mode line faces. |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
254 This should be done from time to time just to avoid |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
255 keeping too many graphics contexts that are no longer needed. */ |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
256 |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
257 void |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
258 clear_face_cache () |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
259 { |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
260 Lisp_Object tail, frame; |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
261 |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
262 BLOCK_INPUT; |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
263 FOR_EACH_FRAME (tail, frame) |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
264 { |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
265 FRAME_PTR f = XFRAME (frame); |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
266 if (FRAME_X_P (f)) |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
267 { |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
268 int i; |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
269 Display *dpy = FRAME_X_DISPLAY (f); |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
270 |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
271 for (i = 2; i < FRAME_N_COMPUTED_FACES (f); i++) |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
272 { |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
273 struct face *face = FRAME_COMPUTED_FACES (f) [i]; |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
274 if (face->gc) |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
275 XFreeGC (dpy, face->gc); |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
276 face->gc = 0; |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
277 } |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
278 } |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
279 } |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
280 |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
281 UNBLOCK_INPUT; |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
282 } |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
283 |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
284 /* Allocating, freeing, and duplicating fonts, colors, and pixmaps. */ |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
285 |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
286 static XFontStruct * |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
287 load_font (f, name) |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
288 struct frame *f; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
289 Lisp_Object name; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
290 { |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
291 XFontStruct *font; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
292 |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
293 if (NILP (name)) |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
294 return (XFontStruct *) FACE_DEFAULT; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
295 |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
296 CHECK_STRING (name, 0); |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
297 BLOCK_INPUT; |
9529
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
298 font = XLoadQueryFont (FRAME_X_DISPLAY (f), (char *) XSTRING (name)->data); |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
299 UNBLOCK_INPUT; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
300 |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
301 if (! font) |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
302 Fsignal (Qerror, Fcons (build_string ("undefined font"), |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
303 Fcons (name, Qnil))); |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
304 return font; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
305 } |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
306 |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
307 static void |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
308 unload_font (f, font) |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
309 struct frame *f; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
310 XFontStruct *font; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
311 { |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
312 if (!font || font == ((XFontStruct *) FACE_DEFAULT)) |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
313 return; |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
314 |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
315 BLOCK_INPUT; |
9529
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
316 XFreeFont (FRAME_X_DISPLAY (f), font); |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
317 UNBLOCK_INPUT; |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
318 } |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
319 |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
320 static unsigned long |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
321 load_color (f, name) |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
322 struct frame *f; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
323 Lisp_Object name; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
324 { |
9529
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
325 Display *dpy = FRAME_X_DISPLAY (f); |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
326 Colormap cmap; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
327 XColor color; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
328 int result; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
329 |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
330 if (NILP (name)) |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
331 return FACE_DEFAULT; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
332 |
9529
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
333 cmap = DefaultColormapOfScreen (DefaultScreenOfDisplay (dpy)); |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
334 |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
335 CHECK_STRING (name, 0); |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
336 BLOCK_INPUT; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
337 result = XParseColor (dpy, cmap, (char *) XSTRING (name)->data, &color); |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
338 UNBLOCK_INPUT; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
339 if (! result) |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
340 Fsignal (Qerror, Fcons (build_string ("undefined color"), |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
341 Fcons (name, Qnil))); |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
342 BLOCK_INPUT; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
343 result = XAllocColor (dpy, cmap, &color); |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
344 UNBLOCK_INPUT; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
345 if (! result) |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
346 Fsignal (Qerror, Fcons (build_string ("X server cannot allocate color"), |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
347 Fcons (name, Qnil))); |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
348 return (unsigned long) color.pixel; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
349 } |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
350 |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
351 static void |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
352 unload_color (f, pixel) |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
353 struct frame *f; |
3316
9857db8aa4cd
* xfaces.c (unload_color): Don't #include <X11/Intrinsic.h>,
Jim Blandy <jimb@redhat.com>
parents:
3302
diff
changeset
|
354 unsigned long pixel; |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
355 { |
3065
fff06093b756
* xfns.c (Fx_list_fonts): New function.
Jim Blandy <jimb@redhat.com>
parents:
2998
diff
changeset
|
356 /* Since faces get built by copying parameters from other faces, the |
fff06093b756
* xfns.c (Fx_list_fonts): New function.
Jim Blandy <jimb@redhat.com>
parents:
2998
diff
changeset
|
357 allocation counts for the colors get all screwed up. I don't see |
fff06093b756
* xfns.c (Fx_list_fonts): New function.
Jim Blandy <jimb@redhat.com>
parents:
2998
diff
changeset
|
358 any solution that will take less than 10 minutes, and it's better |
fff06093b756
* xfns.c (Fx_list_fonts): New function.
Jim Blandy <jimb@redhat.com>
parents:
2998
diff
changeset
|
359 to have a color leak than a crash, so I'm just dyking this out. |
fff06093b756
* xfns.c (Fx_list_fonts): New function.
Jim Blandy <jimb@redhat.com>
parents:
2998
diff
changeset
|
360 This isn't really a color leak, anyway - if we ask for it again, |
fff06093b756
* xfns.c (Fx_list_fonts): New function.
Jim Blandy <jimb@redhat.com>
parents:
2998
diff
changeset
|
361 we'll get the same pixel. */ |
fff06093b756
* xfns.c (Fx_list_fonts): New function.
Jim Blandy <jimb@redhat.com>
parents:
2998
diff
changeset
|
362 #if 0 |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
363 Colormap cmap; |
9529
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
364 Display *dpy = FRAME_X_DISPLAY (f); |
2818
d1cfc6cbdbf7
* xfaces.c (unload_color): Don't try to unload the standard black
Jim Blandy <jimb@redhat.com>
parents:
2795
diff
changeset
|
365 if (pixel == FACE_DEFAULT |
d1cfc6cbdbf7
* xfaces.c (unload_color): Don't try to unload the standard black
Jim Blandy <jimb@redhat.com>
parents:
2795
diff
changeset
|
366 || pixel == BLACK_PIX_DEFAULT |
d1cfc6cbdbf7
* xfaces.c (unload_color): Don't try to unload the standard black
Jim Blandy <jimb@redhat.com>
parents:
2795
diff
changeset
|
367 || pixel == WHITE_PIX_DEFAULT) |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
368 return; |
9529
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
369 cmap = DefaultColormapOfScreen (DefaultScreenOfDisplay (dpy)); |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
370 BLOCK_INPUT; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
371 XFreeColors (dpy, cmap, &pixel, 1, 0); |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
372 UNBLOCK_INPUT; |
3065
fff06093b756
* xfns.c (Fx_list_fonts): New function.
Jim Blandy <jimb@redhat.com>
parents:
2998
diff
changeset
|
373 #endif |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
374 } |
2336 | 375 |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
376 /* Managing parameter face arrays for frames. */ |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
377 |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
378 void |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
379 init_frame_faces (f) |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
380 FRAME_PTR f; |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
381 { |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
382 ensure_face_ready (f, 0); |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
383 ensure_face_ready (f, 1); |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
384 |
5801
af397aaa8e6b
(init_frame_faces): Clear FRAME_N_COMPUTED_FACES
Richard M. Stallman <rms@gnu.org>
parents:
5084
diff
changeset
|
385 FRAME_N_COMPUTED_FACES (f) = 0; |
af397aaa8e6b
(init_frame_faces): Clear FRAME_N_COMPUTED_FACES
Richard M. Stallman <rms@gnu.org>
parents:
5084
diff
changeset
|
386 FRAME_SIZE_COMPUTED_FACES (f) = 0; |
af397aaa8e6b
(init_frame_faces): Clear FRAME_N_COMPUTED_FACES
Richard M. Stallman <rms@gnu.org>
parents:
5084
diff
changeset
|
387 |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
388 new_computed_face (f, FRAME_PARAM_FACES (f)[0]); |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
389 new_computed_face (f, FRAME_PARAM_FACES (f)[1]); |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
390 recompute_basic_faces (f); |
3299
6fab7c7bb1f1
* xfaces.c (init_frame_faces): We have to make sure that face ID's
Jim Blandy <jimb@redhat.com>
parents:
3277
diff
changeset
|
391 |
3583
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
392 /* Find another X frame. */ |
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
393 { |
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
394 Lisp_Object tail, frame, result; |
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
395 |
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
396 result = Qnil; |
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
397 FOR_EACH_FRAME (tail, frame) |
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
398 if (FRAME_X_P (XFRAME (frame)) |
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
399 && XFRAME (frame) != f) |
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
400 { |
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
401 result = frame; |
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
402 break; |
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
403 } |
3299
6fab7c7bb1f1
* xfaces.c (init_frame_faces): We have to make sure that face ID's
Jim Blandy <jimb@redhat.com>
parents:
3277
diff
changeset
|
404 |
3583
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
405 /* If we didn't find any X frames other than f, then we don't need |
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
406 any faces other than 0 and 1, so we're okay. Otherwise, make |
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
407 sure that all faces valid on the selected frame are also valid |
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
408 on this new frame. */ |
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
409 if (FRAMEP (result)) |
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
410 { |
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
411 int i; |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
412 int n_faces = FRAME_N_PARAM_FACES (XFRAME (result)); |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
413 struct face **faces = FRAME_PARAM_FACES (XFRAME (result)); |
3299
6fab7c7bb1f1
* xfaces.c (init_frame_faces): We have to make sure that face ID's
Jim Blandy <jimb@redhat.com>
parents:
3277
diff
changeset
|
414 |
3583
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
415 for (i = 2; i < n_faces; i++) |
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
416 if (faces[i]) |
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
417 ensure_face_ready (f, i); |
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
418 } |
0bc9838eb0bb
* xfaces.c (init_frame_faces): Remove assumption that the selected
Jim Blandy <jimb@redhat.com>
parents:
3528
diff
changeset
|
419 } |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
420 } |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
421 |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
422 |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
423 /* Called from Fdelete_frame. */ |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
424 void |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
425 free_frame_faces (f) |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
426 struct frame *f; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
427 { |
9529
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
428 Display *dpy = FRAME_X_DISPLAY (f); |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
429 int i; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
430 |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
431 BLOCK_INPUT; |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
432 |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
433 for (i = 0; i < FRAME_N_PARAM_FACES (f); i++) |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
434 { |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
435 struct face *face = FRAME_PARAM_FACES (f) [i]; |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
436 if (face) |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
437 { |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
438 unload_font (f, face->font); |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
439 unload_color (f, face->foreground); |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
440 unload_color (f, face->background); |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
441 #if 0 |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
442 unload_pixmap (f, face->stipple); |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
443 #endif |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
444 xfree (face); |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
445 } |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
446 } |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
447 xfree (FRAME_PARAM_FACES (f)); |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
448 FRAME_PARAM_FACES (f) = 0; |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
449 FRAME_N_PARAM_FACES (f) = 0; |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
450 |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
451 /* All faces in FRAME_COMPUTED_FACES use resources copied from |
9529
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
452 FRAME_PARAM_FACES; we can free them without fuss. |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
453 But we do free the GCs and the face objects themselves. */ |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
454 for (i = 0; i < FRAME_N_COMPUTED_FACES (f); i++) |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
455 { |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
456 struct face *face = FRAME_COMPUTED_FACES (f) [i]; |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
457 if (face) |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
458 { |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
459 if (face->gc) |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
460 XFreeGC (dpy, face->gc); |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
461 xfree (face); |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
462 } |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
463 } |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
464 xfree (FRAME_COMPUTED_FACES (f)); |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
465 FRAME_COMPUTED_FACES (f) = 0; |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
466 FRAME_N_COMPUTED_FACES (f) = 0; |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
467 |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
468 UNBLOCK_INPUT; |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
469 } |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
470 |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
471 /* Interning faces in a frame's face array. */ |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
472 |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
473 static int |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
474 new_computed_face (f, new_face) |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
475 struct frame *f; |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
476 struct face *new_face; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
477 { |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
478 int i = FRAME_N_COMPUTED_FACES (f); |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
479 |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
480 if (i >= FRAME_SIZE_COMPUTED_FACES (f)) |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
481 { |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
482 int new_size = i + 32; |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
483 |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
484 FRAME_COMPUTED_FACES (f) |
5801
af397aaa8e6b
(init_frame_faces): Clear FRAME_N_COMPUTED_FACES
Richard M. Stallman <rms@gnu.org>
parents:
5084
diff
changeset
|
485 = (struct face **) (FRAME_SIZE_COMPUTED_FACES (f) == 0 |
af397aaa8e6b
(init_frame_faces): Clear FRAME_N_COMPUTED_FACES
Richard M. Stallman <rms@gnu.org>
parents:
5084
diff
changeset
|
486 ? xmalloc (new_size * sizeof (struct face *)) |
af397aaa8e6b
(init_frame_faces): Clear FRAME_N_COMPUTED_FACES
Richard M. Stallman <rms@gnu.org>
parents:
5084
diff
changeset
|
487 : xrealloc (FRAME_COMPUTED_FACES (f), |
af397aaa8e6b
(init_frame_faces): Clear FRAME_N_COMPUTED_FACES
Richard M. Stallman <rms@gnu.org>
parents:
5084
diff
changeset
|
488 new_size * sizeof (struct face *))); |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
489 FRAME_SIZE_COMPUTED_FACES (f) = new_size; |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
490 } |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
491 |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
492 i = FRAME_N_COMPUTED_FACES (f)++; |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
493 FRAME_COMPUTED_FACES (f)[i] = copy_face (new_face); |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
494 return i; |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
495 } |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
496 |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
497 |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
498 /* Find a match for NEW_FACE in a FRAME's computed face array, and add |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
499 it if we don't find one. */ |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
500 static int |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
501 intern_computed_face (f, new_face) |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
502 struct frame *f; |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
503 struct face *new_face; |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
504 { |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
505 int len = FRAME_N_COMPUTED_FACES (f); |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
506 int i; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
507 |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
508 /* Search for a computed face already on F equivalent to FACE. */ |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
509 for (i = 0; i < len; i++) |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
510 { |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
511 if (! FRAME_COMPUTED_FACES (f)[i]) |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
512 abort (); |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
513 if (face_eql (new_face, FRAME_COMPUTED_FACES (f)[i])) |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
514 return i; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
515 } |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
516 |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
517 /* We didn't find one; add a new one. */ |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
518 return new_computed_face (f, new_face); |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
519 } |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
520 |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
521 /* Make parameter face id ID valid on frame F. */ |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
522 |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
523 static void |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
524 ensure_face_ready (f, id) |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
525 struct frame *f; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
526 int id; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
527 { |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
528 if (FRAME_N_PARAM_FACES (f) <= id) |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
529 { |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
530 int n = id + 10; |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
531 int i; |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
532 if (!FRAME_N_PARAM_FACES (f)) |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
533 FRAME_PARAM_FACES (f) |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
534 = (struct face **) xmalloc (sizeof (struct face *) * n); |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
535 else |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
536 FRAME_PARAM_FACES (f) |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
537 = (struct face **) xrealloc (FRAME_PARAM_FACES (f), |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
538 sizeof (struct face *) * n); |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
539 |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
540 bzero (FRAME_PARAM_FACES (f) + FRAME_N_PARAM_FACES (f), |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
541 (n - FRAME_N_PARAM_FACES (f)) * sizeof (struct face *)); |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
542 FRAME_N_PARAM_FACES (f) = n; |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
543 } |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
544 |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
545 if (FRAME_PARAM_FACES (f) [id] == 0) |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
546 FRAME_PARAM_FACES (f) [id] = allocate_face (); |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
547 } |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
548 |
6784
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
549 /* Return non-zero if FONT1 and FONT2 have the same width. |
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
550 We do not check the height, because we can now deal with |
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
551 different heights. |
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
552 We assume that they're both character-cell fonts. */ |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
553 |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
554 int |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
555 same_size_fonts (font1, font2) |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
556 XFontStruct *font1, *font2; |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
557 { |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
558 XCharStruct *bounds1 = &font1->min_bounds; |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
559 XCharStruct *bounds2 = &font2->min_bounds; |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
560 |
3528
aad9fd004281
(same_size_fonts): Compare only the width.
Richard M. Stallman <rms@gnu.org>
parents:
3436
diff
changeset
|
561 return (bounds1->width == bounds2->width); |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
562 } |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
563 |
6768
0b61d2b74e64
(frame_update_line_height): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6615
diff
changeset
|
564 /* Update the line_height of frame F according to the biggest font in |
6879
471aebc1b151
(frame_update_line_height): Don't call x_set_window_size.
Richard M. Stallman <rms@gnu.org>
parents:
6784
diff
changeset
|
565 any face. Return nonzero if if line_height changes. */ |
6768
0b61d2b74e64
(frame_update_line_height): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6615
diff
changeset
|
566 |
6879
471aebc1b151
(frame_update_line_height): Don't call x_set_window_size.
Richard M. Stallman <rms@gnu.org>
parents:
6784
diff
changeset
|
567 int |
6768
0b61d2b74e64
(frame_update_line_height): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6615
diff
changeset
|
568 frame_update_line_height (f) |
0b61d2b74e64
(frame_update_line_height): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6615
diff
changeset
|
569 FRAME_PTR f; |
0b61d2b74e64
(frame_update_line_height): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6615
diff
changeset
|
570 { |
0b61d2b74e64
(frame_update_line_height): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6615
diff
changeset
|
571 int i; |
0b61d2b74e64
(frame_update_line_height): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6615
diff
changeset
|
572 int biggest = FONT_HEIGHT (f->display.x->font); |
0b61d2b74e64
(frame_update_line_height): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6615
diff
changeset
|
573 |
0b61d2b74e64
(frame_update_line_height): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6615
diff
changeset
|
574 for (i = 0; i < f->display.x->n_param_faces; i++) |
6784
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
575 if (f->display.x->param_faces[i] != 0 |
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
576 && f->display.x->param_faces[i]->font != (XFontStruct *) FACE_DEFAULT) |
6768
0b61d2b74e64
(frame_update_line_height): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6615
diff
changeset
|
577 { |
0b61d2b74e64
(frame_update_line_height): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6615
diff
changeset
|
578 int height = FONT_HEIGHT (f->display.x->param_faces[i]->font); |
0b61d2b74e64
(frame_update_line_height): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6615
diff
changeset
|
579 if (height > biggest) |
0b61d2b74e64
(frame_update_line_height): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6615
diff
changeset
|
580 biggest = height; |
0b61d2b74e64
(frame_update_line_height): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6615
diff
changeset
|
581 } |
0b61d2b74e64
(frame_update_line_height): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6615
diff
changeset
|
582 |
0b61d2b74e64
(frame_update_line_height): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6615
diff
changeset
|
583 if (biggest == f->display.x->line_height) |
6879
471aebc1b151
(frame_update_line_height): Don't call x_set_window_size.
Richard M. Stallman <rms@gnu.org>
parents:
6784
diff
changeset
|
584 return 0; |
6768
0b61d2b74e64
(frame_update_line_height): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6615
diff
changeset
|
585 |
0b61d2b74e64
(frame_update_line_height): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6615
diff
changeset
|
586 f->display.x->line_height = biggest; |
6879
471aebc1b151
(frame_update_line_height): Don't call x_set_window_size.
Richard M. Stallman <rms@gnu.org>
parents:
6784
diff
changeset
|
587 return 1; |
6768
0b61d2b74e64
(frame_update_line_height): New function.
Richard M. Stallman <rms@gnu.org>
parents:
6615
diff
changeset
|
588 } |
6784
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
589 |
2342 | 590 /* Modify face TO by copying from FROM all properties which have |
591 nondefault settings. */ | |
6784
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
592 |
2342 | 593 static void |
594 merge_faces (from, to) | |
595 struct face *from, *to; | |
596 { | |
6784
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
597 /* Only merge the font if it's the same width as the base font. |
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
598 Otherwise ignore it, since we can't handle it properly. */ |
2883
b8a3b11892dc
Make sure that all the display faces use fonts of the
Jim Blandy <jimb@redhat.com>
parents:
2875
diff
changeset
|
599 if (from->font != (XFontStruct *) FACE_DEFAULT |
b8a3b11892dc
Make sure that all the display faces use fonts of the
Jim Blandy <jimb@redhat.com>
parents:
2875
diff
changeset
|
600 && same_size_fonts (from->font, to->font)) |
b8a3b11892dc
Make sure that all the display faces use fonts of the
Jim Blandy <jimb@redhat.com>
parents:
2875
diff
changeset
|
601 to->font = from->font; |
2342 | 602 if (from->foreground != FACE_DEFAULT) |
603 to->foreground = from->foreground; | |
604 if (from->background != FACE_DEFAULT) | |
605 to->background = from->background; | |
2391 | 606 if (from->stipple != FACE_DEFAULT) |
607 to->stipple = from->stipple; | |
2342 | 608 if (from->underline) |
609 to->underline = from->underline; | |
610 } | |
611 | |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
612 /* Set up the basic set of facial parameters, based on the frame's |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
613 data; all faces are deltas applied to this. */ |
6784
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
614 |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
615 static void |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
616 compute_base_face (f, face) |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
617 FRAME_PTR f; |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
618 struct face *face; |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
619 { |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
620 struct x_display *d = f->display.x; |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
621 |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
622 face->gc = 0; |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
623 face->foreground = d->foreground_pixel; |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
624 face->background = d->background_pixel; |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
625 face->font = d->font; |
3811
48b1ef149180
* xfaces.c (compute_base_face): Initialize the face's stipple.
Jim Blandy <jimb@redhat.com>
parents:
3583
diff
changeset
|
626 face->stipple = 0; |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
627 face->underline = 0; |
3811
48b1ef149180
* xfaces.c (compute_base_face): Initialize the face's stipple.
Jim Blandy <jimb@redhat.com>
parents:
3583
diff
changeset
|
628 |
48b1ef149180
* xfaces.c (compute_base_face): Initialize the face's stipple.
Jim Blandy <jimb@redhat.com>
parents:
3583
diff
changeset
|
629 /* Avoid a face comparison by making this invalid. */ |
48b1ef149180
* xfaces.c (compute_base_face): Initialize the face's stipple.
Jim Blandy <jimb@redhat.com>
parents:
3583
diff
changeset
|
630 face->cached_index = -1; |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
631 } |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
632 |
6784
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
633 /* Return the face ID to use to display a special glyph which selects |
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
634 FACE_CODE as the face ID, assuming that ordinarily the face would |
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
635 be CURRENT_FACE. F is the frame. */ |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
636 |
6784
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
637 int |
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
638 compute_glyph_face (f, face_code, current_face) |
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
639 struct frame *f; |
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
640 int face_code, current_face; |
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
641 { |
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
642 struct face face; |
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
643 |
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
644 face = *FRAME_COMPUTED_FACES (f)[current_face]; |
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
645 |
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
646 if (face_code >= 0 && face_code < FRAME_N_PARAM_FACES (f) |
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
647 && FRAME_PARAM_FACES (f) [face_code] != 0) |
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
648 merge_faces (FRAME_PARAM_FACES (f) [face_code], &face); |
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
649 |
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
650 return intern_computed_face (f, &face); |
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
651 } |
8472
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
652 |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
653 /* Return the face ID to use to display a special glyph which selects |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
654 FACE_CODE as the face ID, assuming that ordinarily the face would |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
655 be CURRENT_FACE. F is the frame. */ |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
656 |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
657 int |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
658 compute_glyph_face_1 (f, face_name, current_face) |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
659 struct frame *f; |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
660 Lisp_Object face_name; |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
661 int current_face; |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
662 { |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
663 struct face face; |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
664 |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
665 face = *FRAME_COMPUTED_FACES (f)[current_face]; |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
666 |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
667 if (!NILP (face_name)) |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
668 { |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
669 int facecode = face_name_id_number (f, face_name); |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
670 if (facecode >= 0 && facecode < FRAME_N_PARAM_FACES (f) |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
671 && FRAME_PARAM_FACES (f) [facecode] != 0) |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
672 merge_faces (FRAME_PARAM_FACES (f) [facecode], &face); |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
673 } |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
674 |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
675 return intern_computed_face (f, &face); |
0d0b32e78a5b
(compute_glyph_face_1): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8119
diff
changeset
|
676 } |
6784
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
677 |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
678 /* Return the face ID associated with a buffer position POS. |
2342 | 679 Store into *ENDPTR the position at which a different face is needed. |
680 This does not take account of glyphs that specify their own face codes. | |
2784
f8c6796b7777
* xfaces.c (compute_char_face): When merging the overlays,
Jim Blandy <jimb@redhat.com>
parents:
2767
diff
changeset
|
681 F is the frame in use for display, and W is a window displaying |
2795
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
682 the current buffer. |
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
683 |
5084
863e092a5891
(compute_char_face): Accept new arg LIMIT.
Richard M. Stallman <rms@gnu.org>
parents:
4696
diff
changeset
|
684 REGION_BEG, REGION_END delimit the region, so it can be highlighted. |
863e092a5891
(compute_char_face): Accept new arg LIMIT.
Richard M. Stallman <rms@gnu.org>
parents:
4696
diff
changeset
|
685 |
863e092a5891
(compute_char_face): Accept new arg LIMIT.
Richard M. Stallman <rms@gnu.org>
parents:
4696
diff
changeset
|
686 LIMIT is a position not to scan beyond. That is to limit |
6615
96ddf85642d1
(compute_char_face): New arg MOUSE.
Richard M. Stallman <rms@gnu.org>
parents:
5858
diff
changeset
|
687 the time this function can take. |
96ddf85642d1
(compute_char_face): New arg MOUSE.
Richard M. Stallman <rms@gnu.org>
parents:
5858
diff
changeset
|
688 |
96ddf85642d1
(compute_char_face): New arg MOUSE.
Richard M. Stallman <rms@gnu.org>
parents:
5858
diff
changeset
|
689 If MOUSE is nonzero, use the character's mouse-face, not its face. */ |
2795
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
690 |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
691 int |
6615
96ddf85642d1
(compute_char_face): New arg MOUSE.
Richard M. Stallman <rms@gnu.org>
parents:
5858
diff
changeset
|
692 compute_char_face (f, w, pos, region_beg, region_end, endptr, limit, mouse) |
2342 | 693 struct frame *f; |
2391 | 694 struct window *w; |
2342 | 695 int pos; |
2795
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
696 int region_beg, region_end; |
2342 | 697 int *endptr; |
5084
863e092a5891
(compute_char_face): Accept new arg LIMIT.
Richard M. Stallman <rms@gnu.org>
parents:
4696
diff
changeset
|
698 int limit; |
6615
96ddf85642d1
(compute_char_face): New arg MOUSE.
Richard M. Stallman <rms@gnu.org>
parents:
5858
diff
changeset
|
699 int mouse; |
2342 | 700 { |
701 struct face face; | |
2767
482fa0725db6
* xfaces.c (intern_frame_face): Exchange order of arguments, to
Jim Blandy <jimb@redhat.com>
parents:
2743
diff
changeset
|
702 Lisp_Object prop, position; |
2342 | 703 int i, j, noverlays; |
704 int facecode; | |
705 Lisp_Object *overlay_vec; | |
2391 | 706 Lisp_Object frame; |
2784
f8c6796b7777
* xfaces.c (compute_char_face): When merging the overlays,
Jim Blandy <jimb@redhat.com>
parents:
2767
diff
changeset
|
707 int endpos; |
6615
96ddf85642d1
(compute_char_face): New arg MOUSE.
Richard M. Stallman <rms@gnu.org>
parents:
5858
diff
changeset
|
708 Lisp_Object propname; |
2784
f8c6796b7777
* xfaces.c (compute_char_face): When merging the overlays,
Jim Blandy <jimb@redhat.com>
parents:
2767
diff
changeset
|
709 |
f8c6796b7777
* xfaces.c (compute_char_face): When merging the overlays,
Jim Blandy <jimb@redhat.com>
parents:
2767
diff
changeset
|
710 /* W must display the current buffer. We could write this function |
f8c6796b7777
* xfaces.c (compute_char_face): When merging the overlays,
Jim Blandy <jimb@redhat.com>
parents:
2767
diff
changeset
|
711 to use the frame and buffer of W, but right now it doesn't. */ |
f8c6796b7777
* xfaces.c (compute_char_face): When merging the overlays,
Jim Blandy <jimb@redhat.com>
parents:
2767
diff
changeset
|
712 if (XBUFFER (w->buffer) != current_buffer) |
f8c6796b7777
* xfaces.c (compute_char_face): When merging the overlays,
Jim Blandy <jimb@redhat.com>
parents:
2767
diff
changeset
|
713 abort (); |
2391 | 714 |
9284
a969e0eefaf5
(compute_char_face): Use new accessor macros instead of calling XSET directly.
Karl Heuer <kwzh@gnu.org>
parents:
9186
diff
changeset
|
715 XSETFRAME (frame, f); |
2342 | 716 |
2784
f8c6796b7777
* xfaces.c (compute_char_face): When merging the overlays,
Jim Blandy <jimb@redhat.com>
parents:
2767
diff
changeset
|
717 endpos = ZV; |
2795
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
718 if (pos < region_beg && region_beg < endpos) |
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
719 endpos = region_beg; |
2784
f8c6796b7777
* xfaces.c (compute_char_face): When merging the overlays,
Jim Blandy <jimb@redhat.com>
parents:
2767
diff
changeset
|
720 |
9326
bcf42f7e049a
(compute_char_face): Don't use XFASTINT as an lvalue.
Karl Heuer <kwzh@gnu.org>
parents:
9284
diff
changeset
|
721 XSETFASTINT (position, pos); |
6615
96ddf85642d1
(compute_char_face): New arg MOUSE.
Richard M. Stallman <rms@gnu.org>
parents:
5858
diff
changeset
|
722 |
96ddf85642d1
(compute_char_face): New arg MOUSE.
Richard M. Stallman <rms@gnu.org>
parents:
5858
diff
changeset
|
723 if (mouse) |
96ddf85642d1
(compute_char_face): New arg MOUSE.
Richard M. Stallman <rms@gnu.org>
parents:
5858
diff
changeset
|
724 propname = Qmouse_face; |
96ddf85642d1
(compute_char_face): New arg MOUSE.
Richard M. Stallman <rms@gnu.org>
parents:
5858
diff
changeset
|
725 else |
96ddf85642d1
(compute_char_face): New arg MOUSE.
Richard M. Stallman <rms@gnu.org>
parents:
5858
diff
changeset
|
726 propname = Qface; |
96ddf85642d1
(compute_char_face): New arg MOUSE.
Richard M. Stallman <rms@gnu.org>
parents:
5858
diff
changeset
|
727 |
96ddf85642d1
(compute_char_face): New arg MOUSE.
Richard M. Stallman <rms@gnu.org>
parents:
5858
diff
changeset
|
728 prop = Fget_text_property (position, propname, w->buffer); |
96ddf85642d1
(compute_char_face): New arg MOUSE.
Richard M. Stallman <rms@gnu.org>
parents:
5858
diff
changeset
|
729 |
2767
482fa0725db6
* xfaces.c (intern_frame_face): Exchange order of arguments, to
Jim Blandy <jimb@redhat.com>
parents:
2743
diff
changeset
|
730 { |
5084
863e092a5891
(compute_char_face): Accept new arg LIMIT.
Richard M. Stallman <rms@gnu.org>
parents:
4696
diff
changeset
|
731 Lisp_Object limit1, end; |
2767
482fa0725db6
* xfaces.c (intern_frame_face): Exchange order of arguments, to
Jim Blandy <jimb@redhat.com>
parents:
2743
diff
changeset
|
732 |
9326
bcf42f7e049a
(compute_char_face): Don't use XFASTINT as an lvalue.
Karl Heuer <kwzh@gnu.org>
parents:
9284
diff
changeset
|
733 XSETFASTINT (limit1, (limit < endpos ? limit : endpos)); |
6615
96ddf85642d1
(compute_char_face): New arg MOUSE.
Richard M. Stallman <rms@gnu.org>
parents:
5858
diff
changeset
|
734 end = Fnext_single_property_change (position, propname, w->buffer, limit1); |
2767
482fa0725db6
* xfaces.c (intern_frame_face): Exchange order of arguments, to
Jim Blandy <jimb@redhat.com>
parents:
2743
diff
changeset
|
735 if (INTEGERP (end)) |
482fa0725db6
* xfaces.c (intern_frame_face): Exchange order of arguments, to
Jim Blandy <jimb@redhat.com>
parents:
2743
diff
changeset
|
736 endpos = XINT (end); |
482fa0725db6
* xfaces.c (intern_frame_face): Exchange order of arguments, to
Jim Blandy <jimb@redhat.com>
parents:
2743
diff
changeset
|
737 } |
2342 | 738 |
2767
482fa0725db6
* xfaces.c (intern_frame_face): Exchange order of arguments, to
Jim Blandy <jimb@redhat.com>
parents:
2743
diff
changeset
|
739 { |
2784
f8c6796b7777
* xfaces.c (compute_char_face): When merging the overlays,
Jim Blandy <jimb@redhat.com>
parents:
2767
diff
changeset
|
740 int next_overlay; |
2838
5f6a2d52d2ef
(compute_char_face): Pass 0 as EXTEND arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
2821
diff
changeset
|
741 int len; |
2767
482fa0725db6
* xfaces.c (intern_frame_face): Exchange order of arguments, to
Jim Blandy <jimb@redhat.com>
parents:
2743
diff
changeset
|
742 |
2838
5f6a2d52d2ef
(compute_char_face): Pass 0 as EXTEND arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
2821
diff
changeset
|
743 /* First try with room for 40 overlays. */ |
5f6a2d52d2ef
(compute_char_face): Pass 0 as EXTEND arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
2821
diff
changeset
|
744 len = 40; |
5f6a2d52d2ef
(compute_char_face): Pass 0 as EXTEND arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
2821
diff
changeset
|
745 overlay_vec = (Lisp_Object *) alloca (len * sizeof (Lisp_Object)); |
5f6a2d52d2ef
(compute_char_face): Pass 0 as EXTEND arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
2821
diff
changeset
|
746 |
8965
a7947f88d558
(compute_char_face): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8848
diff
changeset
|
747 noverlays = overlays_at (pos, 0, &overlay_vec, &len, &next_overlay, NULL); |
2838
5f6a2d52d2ef
(compute_char_face): Pass 0 as EXTEND arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
2821
diff
changeset
|
748 |
5f6a2d52d2ef
(compute_char_face): Pass 0 as EXTEND arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
2821
diff
changeset
|
749 /* If there are more than 40, |
5f6a2d52d2ef
(compute_char_face): Pass 0 as EXTEND arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
2821
diff
changeset
|
750 make enough space for all, and try again. */ |
5f6a2d52d2ef
(compute_char_face): Pass 0 as EXTEND arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
2821
diff
changeset
|
751 if (noverlays > len) |
5f6a2d52d2ef
(compute_char_face): Pass 0 as EXTEND arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
2821
diff
changeset
|
752 { |
5f6a2d52d2ef
(compute_char_face): Pass 0 as EXTEND arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
2821
diff
changeset
|
753 len = noverlays; |
5f6a2d52d2ef
(compute_char_face): Pass 0 as EXTEND arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
2821
diff
changeset
|
754 overlay_vec = (Lisp_Object *) alloca (len * sizeof (Lisp_Object)); |
8965
a7947f88d558
(compute_char_face): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8848
diff
changeset
|
755 noverlays = overlays_at (pos, 0, &overlay_vec, &len, |
a7947f88d558
(compute_char_face): Pass new arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
8848
diff
changeset
|
756 &next_overlay, NULL); |
2838
5f6a2d52d2ef
(compute_char_face): Pass 0 as EXTEND arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
2821
diff
changeset
|
757 } |
5f6a2d52d2ef
(compute_char_face): Pass 0 as EXTEND arg to overlays_at.
Richard M. Stallman <rms@gnu.org>
parents:
2821
diff
changeset
|
758 |
2784
f8c6796b7777
* xfaces.c (compute_char_face): When merging the overlays,
Jim Blandy <jimb@redhat.com>
parents:
2767
diff
changeset
|
759 if (next_overlay < endpos) |
f8c6796b7777
* xfaces.c (compute_char_face): When merging the overlays,
Jim Blandy <jimb@redhat.com>
parents:
2767
diff
changeset
|
760 endpos = next_overlay; |
2767
482fa0725db6
* xfaces.c (intern_frame_face): Exchange order of arguments, to
Jim Blandy <jimb@redhat.com>
parents:
2743
diff
changeset
|
761 } |
482fa0725db6
* xfaces.c (intern_frame_face): Exchange order of arguments, to
Jim Blandy <jimb@redhat.com>
parents:
2743
diff
changeset
|
762 |
482fa0725db6
* xfaces.c (intern_frame_face): Exchange order of arguments, to
Jim Blandy <jimb@redhat.com>
parents:
2743
diff
changeset
|
763 *endptr = endpos; |
2342 | 764 |
765 /* Optimize the default case. */ | |
2795
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
766 if (noverlays == 0 && NILP (prop) |
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
767 && !(pos >= region_beg && pos < region_end)) |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
768 return 0; |
2342 | 769 |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
770 compute_base_face (f, &face); |
2342 | 771 |
9186
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
772 if (CONSP (prop)) |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
773 { |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
774 /* We have a list of faces, merge them in reverse order */ |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
775 Lisp_Object length = Flength (prop); |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
776 int len = XINT (length); |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
777 Lisp_Object *faces; |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
778 |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
779 /* Put them into an array */ |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
780 faces = (Lisp_Object *) alloca (len * sizeof (Lisp_Object)); |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
781 for (j = 0; j < len; j++) |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
782 { |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
783 faces[j] = Fcar (prop); |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
784 prop = Fcdr (prop); |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
785 } |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
786 /* So that we can merge them in the reverse order */ |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
787 for (j = len - 1; j >= 0; j--) |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
788 { |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
789 facecode = face_name_id_number (f, faces[j]); |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
790 if (facecode >= 0 && facecode < FRAME_N_PARAM_FACES (f) |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
791 && FRAME_PARAM_FACES (f) [facecode] != 0) |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
792 merge_faces (FRAME_PARAM_FACES (f) [facecode], &face); |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
793 } |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
794 } |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
795 else if (!NILP (prop)) |
2342 | 796 { |
3065
fff06093b756
* xfns.c (Fx_list_fonts): New function.
Jim Blandy <jimb@redhat.com>
parents:
2998
diff
changeset
|
797 facecode = face_name_id_number (f, prop); |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
798 if (facecode >= 0 && facecode < FRAME_N_PARAM_FACES (f) |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
799 && FRAME_PARAM_FACES (f) [facecode] != 0) |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
800 merge_faces (FRAME_PARAM_FACES (f) [facecode], &face); |
2342 | 801 } |
802 | |
5858
021e58905963
(compute_char_face): Extract overlay-sorting code as a separate function,
Karl Heuer <kwzh@gnu.org>
parents:
5801
diff
changeset
|
803 noverlays = sort_overlays (overlay_vec, noverlays, w); |
2342 | 804 |
805 /* Now merge the overlay data in that order. */ | |
806 for (i = 0; i < noverlays; i++) | |
807 { | |
6615
96ddf85642d1
(compute_char_face): New arg MOUSE.
Richard M. Stallman <rms@gnu.org>
parents:
5858
diff
changeset
|
808 prop = Foverlay_get (overlay_vec[i], propname); |
9186
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
809 if (CONSP (prop)) |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
810 { |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
811 /* We have a list of faces, merge them in reverse order */ |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
812 Lisp_Object length = Flength (prop); |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
813 int len = XINT (length); |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
814 Lisp_Object *faces; |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
815 int i; |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
816 |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
817 /* Put them into an array */ |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
818 faces = (Lisp_Object *) alloca (len * sizeof (Lisp_Object)); |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
819 for (j = 0; j < len; j++) |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
820 { |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
821 faces[j] = Fcar (prop); |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
822 prop = Fcdr (prop); |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
823 } |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
824 /* So that we can merge them in the reverse order */ |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
825 for (j = len - 1; j >= 0; j--) |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
826 { |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
827 facecode = face_name_id_number (f, faces[j]); |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
828 if (facecode >= 0 && facecode < FRAME_N_PARAM_FACES (f) |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
829 && FRAME_PARAM_FACES (f) [facecode] != 0) |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
830 merge_faces (FRAME_PARAM_FACES (f) [facecode], &face); |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
831 } |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
832 } |
45bac5feb065
(compute_char_face): Handle list as overlay face property.
Richard M. Stallman <rms@gnu.org>
parents:
9184
diff
changeset
|
833 else if (!NILP (prop)) |
2342 | 834 { |
835 Lisp_Object oend; | |
836 int oendpos; | |
837 | |
3065
fff06093b756
* xfns.c (Fx_list_fonts): New function.
Jim Blandy <jimb@redhat.com>
parents:
2998
diff
changeset
|
838 facecode = face_name_id_number (f, prop); |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
839 if (facecode >= 0 && facecode < FRAME_N_PARAM_FACES (f) |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
840 && FRAME_PARAM_FACES (f) [facecode] != 0) |
6615
96ddf85642d1
(compute_char_face): New arg MOUSE.
Richard M. Stallman <rms@gnu.org>
parents:
5858
diff
changeset
|
841 merge_faces (FRAME_PARAM_FACES (f)[facecode], &face); |
2342 | 842 |
5858
021e58905963
(compute_char_face): Extract overlay-sorting code as a separate function,
Karl Heuer <kwzh@gnu.org>
parents:
5801
diff
changeset
|
843 oend = OVERLAY_END (overlay_vec[i]); |
2342 | 844 oendpos = OVERLAY_POSITION (oend); |
2784
f8c6796b7777
* xfaces.c (compute_char_face): When merging the overlays,
Jim Blandy <jimb@redhat.com>
parents:
2767
diff
changeset
|
845 if (oendpos < endpos) |
2342 | 846 endpos = oendpos; |
847 } | |
848 } | |
849 | |
2795
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
850 if (pos >= region_beg && pos < region_end) |
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
851 { |
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
852 if (region_end < endpos) |
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
853 endpos = region_end; |
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
854 if (region_face >= 0 && region_face < next_face_id) |
6615
96ddf85642d1
(compute_char_face): New arg MOUSE.
Richard M. Stallman <rms@gnu.org>
parents:
5858
diff
changeset
|
855 merge_faces (FRAME_PARAM_FACES (f)[region_face], &face); |
2795
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
856 } |
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
857 |
2342 | 858 *endptr = endpos; |
859 | |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
860 return intern_computed_face (f, &face); |
2342 | 861 } |
6784
d41c216ccd27
(frame_update_line_height): Check param_faces[i] not null.
Richard M. Stallman <rms@gnu.org>
parents:
6768
diff
changeset
|
862 |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
863 /* Recompute the GC's for the default and modeline faces. |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
864 We call this after changing frame parameters on which those GC's |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
865 depend. */ |
5801
af397aaa8e6b
(init_frame_faces): Clear FRAME_N_COMPUTED_FACES
Richard M. Stallman <rms@gnu.org>
parents:
5084
diff
changeset
|
866 |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
867 void |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
868 recompute_basic_faces (f) |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
869 FRAME_PTR f; |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
870 { |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
871 /* If the frame's faces haven't been initialized yet, don't worry about |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
872 this stuff. */ |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
873 if (FRAME_N_PARAM_FACES (f) < 2) |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
874 return; |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
875 |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
876 BLOCK_INPUT; |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
877 |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
878 if (FRAME_DEFAULT_FACE (f)->gc) |
9529
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
879 XFreeGC (FRAME_X_DISPLAY (f), FRAME_DEFAULT_FACE (f)->gc); |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
880 if (FRAME_MODE_LINE_FACE (f)->gc) |
9529
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
881 XFreeGC (FRAME_X_DISPLAY (f), FRAME_MODE_LINE_FACE (f)->gc); |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
882 |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
883 compute_base_face (f, FRAME_DEFAULT_FACE (f)); |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
884 compute_base_face (f, FRAME_MODE_LINE_FACE (f)); |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
885 |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
886 merge_faces (FRAME_DEFAULT_PARAM_FACE (f), FRAME_DEFAULT_FACE (f)); |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
887 merge_faces (FRAME_MODE_LINE_PARAM_FACE (f), FRAME_MODE_LINE_FACE (f)); |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
888 |
9529
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
889 intern_face (f, FRAME_DEFAULT_FACE (f)); |
8e610355cb29
Eliminate the "display faces"; store GCs in the "computed faces".
Richard M. Stallman <rms@gnu.org>
parents:
9326
diff
changeset
|
890 intern_face (f, FRAME_MODE_LINE_FACE (f)); |
3074
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
891 |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
892 UNBLOCK_INPUT; |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
893 } |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
894 |
96b4623fdeb3
* xterm.h: New section for declarations for xfaces.c.
Jim Blandy <jimb@redhat.com>
parents:
3065
diff
changeset
|
895 |
2336 | 896 |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
897 /* Lisp interface. */ |
2336 | 898 |
899 DEFUN ("frame-face-alist", Fframe_face_alist, Sframe_face_alist, 1, 1, 0, | |
900 "") | |
901 (frame) | |
902 Lisp_Object frame; | |
903 { | |
904 CHECK_FRAME (frame, 0); | |
905 return XFRAME (frame)->face_alist; | |
906 } | |
907 | |
908 DEFUN ("set-frame-face-alist", Fset_frame_face_alist, Sset_frame_face_alist, | |
909 2, 2, 0, "") | |
910 (frame, value) | |
911 Lisp_Object frame, value; | |
912 { | |
913 CHECK_FRAME (frame, 0); | |
914 XFRAME (frame)->face_alist = value; | |
915 return value; | |
916 } | |
917 | |
918 | |
919 DEFUN ("make-face-internal", Fmake_face_internal, Smake_face_internal, 1, 1, 0, | |
920 "Create face number FACE-ID on all frames.") | |
921 (face_id) | |
922 Lisp_Object face_id; | |
923 { | |
924 Lisp_Object rest; | |
925 int id = XINT (face_id); | |
926 | |
2391 | 927 CHECK_NUMBER (face_id, 0); |
928 if (id < 0 || id >= next_face_id) | |
929 error ("Face id out of range"); | |
2336 | 930 |
931 for (rest = Vframe_list; !NILP (rest); rest = XCONS (rest)->cdr) | |
932 { | |
933 struct frame *f = XFRAME (XCONS (rest)->car); | |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
934 if (FRAME_X_P (f)) |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
935 ensure_face_ready (f, id); |
2336 | 936 } |
937 return Qnil; | |
938 } | |
939 | |
940 | |
941 DEFUN ("set-face-attribute-internal", Fset_face_attribute_internal, | |
942 Sset_face_attribute_internal, 4, 4, 0, "") | |
943 (face_id, attr_name, attr_value, frame) | |
944 Lisp_Object face_id, attr_name, attr_value, frame; | |
945 { | |
946 struct face *face; | |
947 struct frame *f; | |
948 int magic_p; | |
949 int id; | |
9184
d50d31da6c8d
(Fset_face_attribute_internal): Mark frame garbaged whenever
Richard M. Stallman <rms@gnu.org>
parents:
8965
diff
changeset
|
950 int garbaged = 0; |
2336 | 951 |
952 CHECK_FRAME (frame, 0); | |
2391 | 953 CHECK_NUMBER (face_id, 0); |
2336 | 954 CHECK_SYMBOL (attr_name, 0); |
955 | |
956 f = XFRAME (frame); | |
957 id = XINT (face_id); | |
2391 | 958 if (id < 0 || id >= next_face_id) |
959 error ("Face id out of range"); | |
2336 | 960 |
2767
482fa0725db6
* xfaces.c (intern_frame_face): Exchange order of arguments, to
Jim Blandy <jimb@redhat.com>
parents:
2743
diff
changeset
|
961 if (! FRAME_X_P (f)) |
7583
7bfbe20f7686
(Fset_face_attribute_internal): Always return valid data.
Richard M. Stallman <rms@gnu.org>
parents:
7307
diff
changeset
|
962 return Qnil; |
2767
482fa0725db6
* xfaces.c (intern_frame_face): Exchange order of arguments, to
Jim Blandy <jimb@redhat.com>
parents:
2743
diff
changeset
|
963 |
2336 | 964 ensure_face_ready (f, id); |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
965 face = FRAME_PARAM_FACES (f) [XFASTINT (face_id)]; |
2336 | 966 |
967 if (EQ (attr_name, intern ("font"))) | |
968 { | |
2391 | 969 XFontStruct *font = load_font (f, attr_value); |
2998
885e08ef0577
(Fset_face_attribute_internal): Don't call unload_font
Richard M. Stallman <rms@gnu.org>
parents:
2981
diff
changeset
|
970 if (face->font != f->display.x->font) |
885e08ef0577
(Fset_face_attribute_internal): Don't call unload_font
Richard M. Stallman <rms@gnu.org>
parents:
2981
diff
changeset
|
971 unload_font (f, face->font); |
2336 | 972 face->font = font; |
6879
471aebc1b151
(frame_update_line_height): Don't call x_set_window_size.
Richard M. Stallman <rms@gnu.org>
parents:
6784
diff
changeset
|
973 if (frame_update_line_height (f)) |
471aebc1b151
(frame_update_line_height): Don't call x_set_window_size.
Richard M. Stallman <rms@gnu.org>
parents:
6784
diff
changeset
|
974 x_set_window_size (f, 0, f->width, f->height); |
9184
d50d31da6c8d
(Fset_face_attribute_internal): Mark frame garbaged whenever
Richard M. Stallman <rms@gnu.org>
parents:
8965
diff
changeset
|
975 /* Must clear cache, since it might contain the font |
d50d31da6c8d
(Fset_face_attribute_internal): Mark frame garbaged whenever
Richard M. Stallman <rms@gnu.org>
parents:
8965
diff
changeset
|
976 we just got rid of. */ |
d50d31da6c8d
(Fset_face_attribute_internal): Mark frame garbaged whenever
Richard M. Stallman <rms@gnu.org>
parents:
8965
diff
changeset
|
977 garbaged = 1; |
2336 | 978 } |
979 else if (EQ (attr_name, intern ("foreground"))) | |
980 { | |
2391 | 981 unsigned long new_color = load_color (f, attr_value); |
2336 | 982 unload_color (f, face->foreground); |
983 face->foreground = new_color; | |
9184
d50d31da6c8d
(Fset_face_attribute_internal): Mark frame garbaged whenever
Richard M. Stallman <rms@gnu.org>
parents:
8965
diff
changeset
|
984 garbaged = 1; |
2336 | 985 } |
986 else if (EQ (attr_name, intern ("background"))) | |
987 { | |
2391 | 988 unsigned long new_color = load_color (f, attr_value); |
2336 | 989 unload_color (f, face->background); |
990 face->background = new_color; | |
9184
d50d31da6c8d
(Fset_face_attribute_internal): Mark frame garbaged whenever
Richard M. Stallman <rms@gnu.org>
parents:
8965
diff
changeset
|
991 garbaged = 1; |
2336 | 992 } |
993 #if 0 | |
994 else if (EQ (attr_name, intern ("background-pixmap"))) | |
995 { | |
996 unsigned int w, h, d; | |
997 unsigned long new_pixmap = load_pixmap (f, attr_value, &w, &h, &d, 0); | |
2391 | 998 unload_pixmap (f, face->stipple); |
999 if (NILP (attr_value)) | |
1000 new_pixmap = 0; | |
1001 face->stipple = new_pixmap; | |
2336 | 1002 face->pixmap_w = w; |
1003 face->pixmap_h = h; | |
1004 /* face->pixmap_depth = d; */ | |
1005 } | |
1006 #endif /* 0 */ | |
1007 else if (EQ (attr_name, intern ("underline"))) | |
1008 { | |
1009 int new = !NILP (attr_value); | |
1010 face->underline = new; | |
1011 } | |
1012 else | |
1013 error ("unknown face attribute"); | |
1014 | |
3882
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
1015 if (id == 0 || id == 1) |
a0b9347a3973
Separate parameter faces (those created and modified by the user)
Jim Blandy <jimb@redhat.com>
parents:
3843
diff
changeset
|
1016 recompute_basic_faces (f); |
2336 | 1017 |
9184
d50d31da6c8d
(Fset_face_attribute_internal): Mark frame garbaged whenever
Richard M. Stallman <rms@gnu.org>
parents:
8965
diff
changeset
|
1018 /* We must redraw the frame whenever any face font or color changes, |
d50d31da6c8d
(Fset_face_attribute_internal): Mark frame garbaged whenever
Richard M. Stallman <rms@gnu.org>
parents:
8965
diff
changeset
|
1019 because it's possible that a merged (display) face |
d50d31da6c8d
(Fset_face_attribute_internal): Mark frame garbaged whenever
Richard M. Stallman <rms@gnu.org>
parents:
8965
diff
changeset
|
1020 contains the font or color we just replaced. |
d50d31da6c8d
(Fset_face_attribute_internal): Mark frame garbaged whenever
Richard M. Stallman <rms@gnu.org>
parents:
8965
diff
changeset
|
1021 And we must inhibit any Expose events until the redraw is done, |
d50d31da6c8d
(Fset_face_attribute_internal): Mark frame garbaged whenever
Richard M. Stallman <rms@gnu.org>
parents:
8965
diff
changeset
|
1022 since they would try to use the invalid display faces. */ |
d50d31da6c8d
(Fset_face_attribute_internal): Mark frame garbaged whenever
Richard M. Stallman <rms@gnu.org>
parents:
8965
diff
changeset
|
1023 if (garbaged) |
2821
95010b414003
* xfaces.c (Fset_face_attribute_internal): Jolt redisplay, so it
Jim Blandy <jimb@redhat.com>
parents:
2818
diff
changeset
|
1024 SET_FRAME_GARBAGED (f); |
95010b414003
* xfaces.c (Fset_face_attribute_internal): Jolt redisplay, so it
Jim Blandy <jimb@redhat.com>
parents:
2818
diff
changeset
|
1025 |
2336 | 1026 return Qnil; |
1027 } | |
1028 | |
1029 DEFUN ("internal-next-face-id", Finternal_next_face_id, Sinternal_next_face_id, | |
1030 0, 0, 0, "") | |
1031 () | |
1032 { | |
1033 return make_number (next_face_id++); | |
1034 } | |
2391 | 1035 |
1036 /* Return the face id for name NAME on frame FRAME. | |
1037 (It should be the same for all frames, | |
1038 but it's as easy to use the "right" frame to look it up | |
1039 as to use any other one.) */ | |
1040 | |
3065
fff06093b756
* xfns.c (Fx_list_fonts): New function.
Jim Blandy <jimb@redhat.com>
parents:
2998
diff
changeset
|
1041 int |
fff06093b756
* xfns.c (Fx_list_fonts): New function.
Jim Blandy <jimb@redhat.com>
parents:
2998
diff
changeset
|
1042 face_name_id_number (f, name) |
fff06093b756
* xfns.c (Fx_list_fonts): New function.
Jim Blandy <jimb@redhat.com>
parents:
2998
diff
changeset
|
1043 FRAME_PTR f; |
fff06093b756
* xfns.c (Fx_list_fonts): New function.
Jim Blandy <jimb@redhat.com>
parents:
2998
diff
changeset
|
1044 Lisp_Object name; |
2391 | 1045 { |
1046 Lisp_Object tem; | |
1047 | |
4258
8f02e992e4dc
(face_name_id_number): Use assq_no_quit, not Fassq.
Richard M. Stallman <rms@gnu.org>
parents:
3997
diff
changeset
|
1048 tem = Fcdr (assq_no_quit (name, f->face_alist)); |
2767
482fa0725db6
* xfaces.c (intern_frame_face): Exchange order of arguments, to
Jim Blandy <jimb@redhat.com>
parents:
2743
diff
changeset
|
1049 if (NILP (tem)) |
482fa0725db6
* xfaces.c (intern_frame_face): Exchange order of arguments, to
Jim Blandy <jimb@redhat.com>
parents:
2743
diff
changeset
|
1050 return 0; |
2391 | 1051 CHECK_VECTOR (tem, 0); |
1052 tem = XVECTOR (tem)->contents[2]; | |
1053 CHECK_NUMBER (tem, 0); | |
1054 return XINT (tem); | |
1055 } | |
2336 | 1056 |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
1057 /* Emacs initialization. */ |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
1058 |
2336 | 1059 void |
2391 | 1060 syms_of_xfaces () |
2336 | 1061 { |
2391 | 1062 Qface = intern ("face"); |
1063 staticpro (&Qface); | |
6615
96ddf85642d1
(compute_char_face): New arg MOUSE.
Richard M. Stallman <rms@gnu.org>
parents:
5858
diff
changeset
|
1064 Qmouse_face = intern ("mouse-face"); |
96ddf85642d1
(compute_char_face): New arg MOUSE.
Richard M. Stallman <rms@gnu.org>
parents:
5858
diff
changeset
|
1065 staticpro (&Qmouse_face); |
2391 | 1066 |
2795
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
1067 DEFVAR_INT ("region-face", ®ion_face, |
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
1068 "Face number to use to highlight the region\n\ |
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
1069 The region is highlighted with this face\n\ |
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
1070 when Transient Mark mode is enabled and the mark is active."); |
e97e96fb0cb8
(compute_char_face): New args REGION_BEG, REGION_END.
Richard M. Stallman <rms@gnu.org>
parents:
2784
diff
changeset
|
1071 |
2336 | 1072 defsubr (&Sframe_face_alist); |
1073 defsubr (&Sset_frame_face_alist); | |
1074 defsubr (&Smake_face_internal); | |
1075 defsubr (&Sset_face_attribute_internal); | |
1076 defsubr (&Sinternal_next_face_id); | |
1077 } | |
2730
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
1078 |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
1079 #endif /* HAVE_X_WINDOWS */ |
139740855fa6
* xfaces.c (Fmake_face_internal): Do nothing for non-X frames.
Jim Blandy <jimb@redhat.com>
parents:
2538
diff
changeset
|
1080 |