annotate src/xfaces.c @ 2342:f881f2936eec

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Wed, 24 Mar 1993 02:48:44 +0000
parents 7aaafd275bec
children 226dcdb8ab67
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2342
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
1 /* Must define frame->faces, frame->n_faces,
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
2 FRAME_NORMAL_FACE, FRAME_MODELINE_FACE. */
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
3
2336
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4 /* "Face" primitives
2342
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
5 Copyright (C) 1992, 1993 Free Software Foundation.
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
6
2336
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7 This file is part of GNU Emacs.
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
8
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9 GNU Emacs is free software; you can redistribute it and/or modify
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10 it under the terms of the GNU General Public License as published by
2342
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
11 the Free Software Foundation; either version 2, or (at your option)
2336
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12 any later version.
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 GNU Emacs is distributed in the hope that it will be useful,
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17 GNU General Public License for more details.
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
18
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
19 You should have received a copy of the GNU General Public License
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20 along with GNU Emacs; see the file COPYING. If not, write to
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22
2342
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
23 struct face
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
24 {
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
25 unsigned char underline;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
26 unsigned char hilited;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
27 unsigned char modif;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
28 GC facegc;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
29 XFontStruct * font;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
30 unsigned long foreground;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
31 unsigned long background;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
32 Pixmap back_pixmap;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
33 unsigned int pixmap_w, pixmap_h /* , pixmap_depth */;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
34 };
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
35
2336
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
36 #include <sys/types.h>
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
37 #include <sys/stat.h>
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
38
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
39 #include "config.h"
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40 #include "lisp.h"
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42 #include "xterm.h"
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43 #include "buffer.h"
2342
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
44 #include "frame.h"
2336
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
45 #include "window.h"
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
46 #include "indent.h"
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
47
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
48 /* Display Context for the icons */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
49 #include <X11/Intrinsic.h>
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
50 #include <X11/StringDefs.h>
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
51 #include <X11/Xmu/Drawing.h>
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
52 #include <X11/Xos.h>
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
53
2342
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
54 /* We use face structures in two ways:
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
55 At the frame level, each frame has a vector of faces. (f->faces).
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
56 Face number 0 is the normal face (for normal text).
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
57 Face number 1 is the mode line face.
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
58 Higher face numbers have no built-in meaning.
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
59 The faces in these vectors are called "frame faces".
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
60
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
61 Faces number 0 and 1 have graphics contexts.
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
62 They can be user in the redisplay code directly.
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
63 Higher numbered frame faces do not have graphics contexts.
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
64
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
65 There are also "cached faces". They have graphics contexts.
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
66 They are kept in a C vector called face_vector.
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
67
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
68 A "display face" is a face with a graphics context.
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
69 It is either a frame face number 0 or 1,
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
70 or a cached face. */
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
71
2336
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
72 /* A table of display faces. */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
73 struct face **face_vector;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
74 /* The length in use of the table. */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
75 int nfaces;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
76 /* The allocated length of the table. */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
77 int nfaces_allocated;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
78
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
79 /* The number of face-id's in use (same for all frames). */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
80 int next_face_id;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
81
2342
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
82 #define FACE_DEFAULT (~0)
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
83
2336
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
84 static struct face *allocate_face ();
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
85 static void build_face ();
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
86
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
87 /* Make a new face that's a copy of an existing one. */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
88
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
89 static struct face *
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
90 copy_face (face)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
91 struct face *face;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
92 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
93 struct face *result = allocate_face ();
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
94
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
95 result->font = face->font;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
96 result->foreground = face->foreground;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
97 result->background = face->background;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
98 result->back_pixmap = face->back_pixmap;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
99 result->underline = face->underline;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
100
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
101 return result;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
102 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
103
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
104 static int
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
105 face_eql (face1, face2)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
106 struct face *face1, *face2;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
107 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
108 return (face1->font == face2->font
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
109 && face1->foreground == face2->foreground
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
110 && face1->background == face2->background
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
111 && face1->back_pixmap == face2->back_pixmap
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
112 && face1->underline == face2->underline);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
113 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
114
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
115 /* Return the unique display face corresponding to the user-level face FACE.
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
116
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
117 If there isn't one, make one, and find a slot in the face_vector to
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
118 put it in. */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
119
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
120 static struct face *
2342
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
121 get_cached_face (f, face)
2336
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
122 struct frame *f;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
123 struct face *face;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
124 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
125 int i, empty = -1;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
126
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
127 /* Look for an existing display face that does the job.
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
128 Also find an empty slot if any. */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
129 for (i = 0; i < nfaces; i++)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
130 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
131 if (face_eql (face_vector[i], face))
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
132 return face_vector[i];
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
133 if (face_vector[i] == 0)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
134 empty = i;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
135 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
136
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
137 /* If no empty slots, make one. */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
138 if (empty < 0 && nfaces == nfaces_allocated)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
139 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
140 int newsize = nfaces + 20;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
141 face_vector
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
142 = (struct face **) xrealloc (face_vector,
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
143 newsize * sizeof (struct face *));
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
144 nfaces_allocated = newsize;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
145 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
146
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
147 if (empty < 0)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
148 empty = nfaces++;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
149
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
150 /* Put a new display face in the empty slot. */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
151 result = copy_face (face);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
152 face_vector[empty] = result;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
153
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
154 /* Make a graphics context for it. */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
155 build_face (f, result);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
156
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
157 return result;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
158 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
159
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
160 /* Clear out face_vector and start anew.
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
161 This should be done from time to time just to avoid
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
162 keeping too many graphics contexts in face_vector
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
163 that are no longer needed. */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
164
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
165 void
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
166 clear_face_vector ()
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
167 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
168 Lisp_Object rest;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
169 Display *dpy = x_current_display;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
170
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
171 BLOCK_INPUT;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
172 /* Free the display faces in the face_vector. */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
173 for (i = 0; i < nfaces; i++)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
174 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
175 struct face *face = face_vector[i];
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
176 if (face->facegc)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
177 XFreeGC (dpy, face->facegc);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
178 xfree (face);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
179 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
180 nfaces = 0;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
181
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
182 UNBLOCK_INPUT;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
183 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
184
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
185 /* Make a graphics context for face FACE, which is on frame F. */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
186
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
187 static void
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
188 build_face (f, face)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
189 struct frame* f;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
190 struct face* face;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
191 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
192 GC gc;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
193 XGCValues xgcv;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
194 unsigned long mask;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
195
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
196 xgcv.foreground = face->foreground;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
197 xgcv.background = face->background;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
198 xgcv.font = face->font->fid;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
199 xgcv.graphics_exposures = 0;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
200 mask = GCForeground | GCBackground | GCFont | GCGraphicsExposures;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
201 gc = XCreateGC (x_current_display, FRAME_X_WINDOW (f),
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
202 mask, &xgcv);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
203 #if 0
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
204 if (face->back_pixmap && face->back_pixmap != FACE_DEFAULT)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
205 XSetStipple (XtDisplay (f->display.x->widget), gc, face->back_pixmap);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
206 #endif
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
207 face->facegc = gc;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
208 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
209
2342
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
210 /* Modify face TO by copying from FROM all properties which have
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
211 nondefault settings. */
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
212
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
213 static void
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
214 merge_faces (from, to)
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
215 struct face *from, *to;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
216 {
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
217 if (from->font != (XFontStruct *)FACE_DEFAULT)
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
218 {
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
219 to->font = from->font;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
220 }
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
221 if (from->foreground != FACE_DEFAULT)
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
222 to->foreground = from->foreground;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
223 if (from->background != FACE_DEFAULT)
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
224 to->background = from->background;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
225 if (from->back_pixmap != FACE_DEFAULT)
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
226 to->back_pixmap = from->back_pixmap;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
227 if (from->underline)
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
228 to->underline = from->underline;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
229 }
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
230
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
231 /* Return the display face associated with a buffer position POS.
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
232 Store into *ENDPTR the position at which a different face is needed.
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
233 This does not take account of glyphs that specify their own face codes.
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
234 F is the frame in use for display. */
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
235
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
236 struct face *
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
237 compute_char_face (f, pos, endptr)
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
238 struct frame *f;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
239 int pos;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
240 int *endptr;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
241 {
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
242 struct face face;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
243 Lisp_Object prop, position, length;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
244 Lisp_Object overlay, start, end;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
245 int i, j, noverlays;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
246 int facecode;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
247 int endpos;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
248 Lisp_Object *overlay_vec;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
249 int len;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
250
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
251 XFASTINT (position) = pos;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
252 prop = Fget_text_property (position, Qface);
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
253
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
254 len = 10;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
255 overlay_vec = (Lisp_Object *) xmalloc (len * sizeof (Lisp_Object));
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
256 noverlays = overlays_at (pos, &overlay_vec, &len, &endpos);
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
257
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
258 /* Optimize the default case. */
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
259 if (noverlays == 0 && NILP (prop))
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
260 return FRAME_NORMAL_FACE (f);
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
261
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
262 bcopy (FRAME_NORMAL_FACE (f), &face, sizeof (struct face));
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
263
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
264 if (!NILP (prop))
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
265 {
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
266 facecode = Fface_name_id_number (prop);
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
267 if (facecode >= 0 && facecode < f->n_faces && f->faces[facecode] != 0)
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
268 merge_faces (f->faces[facecode], &face);
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
269 }
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
270
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
271 /* Discard invalid overlays from the vector. */
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
272 for (i = 0, j = 0; i < noverlays; i++)
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
273 {
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
274 overlay = overlay_vec[i];
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
275
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
276 if (OVERLAY_VALID (overlay)
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
277 && OVERLAY_POSITION (OVERLAY_START (overlay)) > 0
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
278 && OVERLAY_POSITION (OVERLAY_END (overlay)) > 0)
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
279 overlay_vec[j++] = overlay;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
280 }
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
281 noverlays = j;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
282
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
283 /* Sort the overlays into the proper order. */
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
284
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
285 /* Now merge the overlay data in that order. */
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
286
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
287 for (i = 0; i < noverlays; i++)
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
288 {
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
289 prop = Foverlay_get (overlay_vec[i], Qface);
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
290 if (!NILP (prop))
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
291 {
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
292 Lisp_Object oend;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
293 int oendpos;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
294
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
295 facecode = Fface_name_id_number (prop);
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
296 if (facecode >= 0 && facecode < f->n_faces
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
297 && f->faces[facecode] != 0)
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
298 merge_faces (f->faces[facecode], &face);
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
299
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
300 oend = OVERLAY_END (overlay_vec[i]);
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
301 oendpos = OVERLAY_POSITION (oend);
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
302 if (oendpos > endpos)
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
303 endpos = oendpos;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
304 }
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
305 }
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
306
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
307 xfree (overlay_vec);
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
308
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
309 *endptr = endpos;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
310
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
311 return get_display_face (f, &face);
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
312 }
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
313
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
314 /* Return the display face to use to display a special glyph
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
315 which selects FACE_CODE as the face ID,
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
316 assuming that ordinarily the face would be BASIC_FACE.
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
317 F is the frame. */
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
318
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
319 struct face *
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
320 compute_glyph_face (f, basic_face, face_code)
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
321 struct frame *f;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
322 struct face *basic_face;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
323 int face_code;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
324 {
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
325 struct face face;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
326
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
327 bcopy (basic_face, &face, sizeof (struct face));
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
328
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
329 if (face_code >= 0 && face_code < f->n_faces && f->faces[face_code] != 0)
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
330 merge_faces (f->faces[face_code], &face);
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
331
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
332 return get_display_face (f, &face);
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
333 }
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
334
2336
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
335 /* Given a frame face, return an equivalent display face
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
336 (one which has a graphics context). */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
337
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
338 static struct face *
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
339 get_display_face (f, face)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
340 struct frame *f;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
341 struct face *face;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
342 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
343 struct face *result;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
344
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
345 /* Does the face have a GC already? */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
346 if (face->facegc)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
347 return face;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
348
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
349 /* If it's equivalent to the normal face, use that. */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
350 if (face->font == FRAME_NORMAL_FACE (f)->font
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
351 && face->foreground == FRAME_NORMAL_FACE (f)->foreground
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
352 && face->background == FRAME_NORMAL_FACE (f)->background
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
353 && face->back_pixmap == FRAME_NORMAL_FACE (f)->back_pixmap
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
354 && face->underline == FRAME_NORMAL_FACE (f)->underline)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
355 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
356 if (!FRAME_NORMAL_FACE (f)->framegc)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
357 build_frame (f, FRAME_NORMAL_FACE (f));
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
358 return FRAME_NORMAL_FACE (f);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
359 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
360
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
361 /* If it's equivalent to the mode line face, use that. */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
362 if (face->font == FRAME_MODELINE_FACE (f)->font
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
363 && face->foreground == FRAME_MODELINE_FACE (f)->foreground
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
364 && face->background == FRAME_MODELINE_FACE (f)->background
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
365 && face->back_pixmap == FRAME_MODELINE_FACE (f)->back_pixmap
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
366 && face->underline == FRAME_MODELINE_FACE (f)->underline)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
367 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
368 if (!FRAME_MODELINE_FACE (f)->framegc)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
369 build_frame (f, FRAME_MODELINE_FACE (f));
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
370 return FRAME_MODELINE_FACE (f);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
371 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
372
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
373 /* Get a specialized display face. */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
374 return get_cached_face (f, face);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
375 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
376
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
377
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
378 /* Allocate a new face */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
379 static struct face *
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
380 allocate_face ()
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
381 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
382 struct face *result = (struct face *) xmalloc (sizeof (struct face));
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
383 bzero (result, sizeof (struct face));
2342
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
384 result->font = (XFontStruct *) FACE_DEFAULT;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
385 result->foreground = FACE_DEFAULT;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
386 result->background = FACE_DEFAULT;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
387 result->back_pixmap = FACE_DEFAULT;
2336
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
388 return result;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
389 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
390
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
391 /* Make face id ID valid on frame F. */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
392
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
393 void
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
394 ensure_face_ready (f, id)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
395 struct frame *f;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
396 int id;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
397 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
398 if (f->n_faces <= id)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
399 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
400 int n = id + 10;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
401 int i;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
402 if (!f->n_faces)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
403 f->faces = (struct face **) xmalloc (sizeof (struct face *) * n);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
404 else
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
405 f->faces
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
406 = (struct face **) xrealloc (f->faces, sizeof (struct face *) * n);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
407
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
408 f->n_faces = n;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
409 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
410
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
411 f->faces[id] = allocate_face ();
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
412 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
413
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
414 /* Allocating, freeing, and duplicating fonts, colors, and pixmaps. */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
415
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
416 #ifdef HAVE_X_WINDOWS
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
417
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
418 static XFontStruct *
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
419 load_font (f, name)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
420 struct frame *f;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
421 Lisp_Object name;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
422 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
423 XFontStruct *font;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
424
2342
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
425 if (NILP (name))
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
426 return (XFontStruct *) FACE_DEFAULT;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
427
2336
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
428 CHECK_STRING (name, 0);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
429 BLOCK_INPUT;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
430 font = XLoadQueryFont (x_current_display, (char *) XSTRING (name)->data);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
431 UNBLOCK_INPUT;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
432
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
433 if (! font)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
434 Fsignal (Qerror, Fcons (build_string ("undefined font"),
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
435 Fcons (name, Qnil)));
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
436 return font;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
437 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
438
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
439 static void
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
440 unload_font (f, font)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
441 struct frame *f;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
442 XFontStruct *font;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
443 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
444 if (!font || font == ((XFontStruct *) FACE_DEFAULT))
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
445 return;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
446 XFreeFont (x_current_display, font);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
447 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
448
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
449 static unsigned long
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
450 load_color (f, name)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
451 struct frame *f;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
452 Lisp_Object name;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
453 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
454 Display *dpy = x_current_display;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
455 Colormap cmap;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
456 XColor color;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
457 int result;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
458
2342
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
459 if (NILP (name))
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
460 return FACE_DEFAULT;
f881f2936eec *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 2336
diff changeset
461
2336
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
462 cmap = DefaultColormapOfScreen (x_screen);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
463
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
464 CHECK_STRING (name, 0);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
465 BLOCK_INPUT;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
466 result = XParseColor (dpy, cmap, (char *) XSTRING (name)->data, &color);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
467 UNBLOCK_INPUT;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
468 if (! result)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
469 Fsignal (Qerror, Fcons (build_string ("undefined color"),
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
470 Fcons (name, Qnil)));
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
471 BLOCK_INPUT;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
472 result = XAllocColor (dpy, cmap, &color);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
473 UNBLOCK_INPUT;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
474 if (! result)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
475 Fsignal (Qerror, Fcons (build_string ("X server cannot allocate color"),
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
476 Fcons (name, Qnil)));
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
477 return (unsigned long) color.pixel;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
478 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
479
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
480 static void
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
481 unload_color (f, pixel)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
482 struct frame *f;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
483 Pixel pixel;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
484 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
485 Colormap cmap;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
486 Display *dpy = x_current_display;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
487 if (pixel == FACE_DEFAULT)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
488 return;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
489 cmap = DefaultColormapOfScreen (x_screen);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
490 BLOCK_INPUT;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
491 XFreeColors (dpy, cmap, &pixel, 1, 0);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
492 UNBLOCK_INPUT;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
493 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
494
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
495 #endif /* HAVE_X_WINDOWS */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
496
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
497
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
498 /* frames */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
499
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
500 void
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
501 init_frame_faces (f)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
502 struct frame f;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
503 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
504 struct frame *other_frame = 0;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
505 Lisp_Object rest;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
506
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
507 for (rest = Vframe_list; !NILP (rest); rest = Fcdr (rest))
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
508 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
509 struct frame *f2 = XFRAME (Fcar (rest));
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
510 if (f2 != f && FRAME_IS_X (f2))
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
511 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
512 other_frame = f2;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
513 break;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
514 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
515 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
516
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
517 if (other_frame)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
518 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
519 /* Make sure this frame's face vector is as big as the others. */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
520 f->n_faces = other_frame->n_faces;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
521 f->faces = (struct face **) xmalloc (f->n_faces * sizeof (struct face *));
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
522
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
523 /* Make sure the frame has the two basic faces. */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
524 FRAME_NORMAL_FACE (f)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
525 = copy_face (FRAME_NORMAL_FACE (other_frame));
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
526 FRAME_MODELINE_FACE (f)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
527 = copy_face (FRAME_MODELINE_FACE (other_frame));
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
528 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
529 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
530
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
531
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
532 /* Called from Fdelete_frame? */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
533
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
534 void
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
535 free_screen_faces (f)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
536 struct frame *f;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
537 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
538 Display *dpy = x_current_display;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
539 int i;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
540
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
541 for (i = 0; i < f->n_faces; i++)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
542 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
543 struct face *face = f->faces [i];
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
544 if (! face)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
545 continue;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
546 if (face->facegc)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
547 XFreeGC (dpy, face->facegc);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
548 unload_font (f, face->font);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
549 unload_color (f, face->foreground);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
550 unload_color (f, face->background);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
551 unload_pixmap (f, face->back_pixmap);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
552 xfree (face);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
553 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
554 xfree (f->faces);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
555 f->faces = 0;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
556 f->n_faces = 0;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
557 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
558
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
559
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
560 /* Lisp interface */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
561
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
562 DEFUN ("frame-face-alist", Fframe_face_alist, Sframe_face_alist, 1, 1, 0,
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
563 "")
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
564 (frame)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
565 Lisp_Object frame;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
566 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
567 CHECK_FRAME (frame, 0);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
568 return XFRAME (frame)->face_alist;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
569 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
570
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
571 DEFUN ("set-frame-face-alist", Fset_frame_face_alist, Sset_frame_face_alist,
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
572 2, 2, 0, "")
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
573 (frame, value)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
574 Lisp_Object frame, value;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
575 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
576 CHECK_FRAME (frame, 0);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
577 XFRAME (frame)->face_alist = value;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
578 return value;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
579 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
580
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
581
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
582 DEFUN ("make-face-internal", Fmake_face_internal, Smake_face_internal, 1, 1, 0,
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
583 "Create face number FACE-ID on all frames.")
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
584 (face_id)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
585 Lisp_Object face_id;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
586 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
587 Lisp_Object rest;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
588 int id = XINT (face_id);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
589
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
590 CHECK_FIXNUM (face_id, 0);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
591 if (id < 0)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
592 error ("Face id must be nonnegative");
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
593
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
594 for (rest = Vframe_list; !NILP (rest); rest = XCONS (rest)->cdr)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
595 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
596 struct frame *f = XFRAME (XCONS (rest)->car);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
597 ensure_face_ready (f, id);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
598 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
599 return Qnil;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
600 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
601
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
602
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
603 DEFUN ("set-face-attribute-internal", Fset_face_attribute_internal,
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
604 Sset_face_attribute_internal, 4, 4, 0, "")
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
605 (face_id, attr_name, attr_value, frame)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
606 Lisp_Object face_id, attr_name, attr_value, frame;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
607 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
608 struct face *face;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
609 struct frame *f;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
610 int magic_p;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
611 int id;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
612
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
613 CHECK_FRAME (frame, 0);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
614 CHECK_FIXNUM (face_id, 0);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
615 CHECK_SYMBOL (attr_name, 0);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
616
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
617 f = XFRAME (frame);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
618 id = XINT (face_id);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
619 if (id < 0)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
620 Fsignal (Qerror, Fcons (build_string ("invalid face id"),
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
621 Fcons (face_id, Fcons (frame, Qnil))));
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
622
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
623 ensure_face_ready (f, id);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
624 face = f->faces [XFASTINT (face_id)];
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
625 if (! face) abort ();
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
626
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
627 magic_p = (NILP (attr_value) && XFASTINT (face_id) <= 1);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
628
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
629 if (EQ (attr_name, intern ("font")))
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
630 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
631 #ifdef HAVE_X_WINDOWS
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
632 XFontStruct *font;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
633 if (magic_p)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
634 error ("font of the `normal' or `modeline' face may not be nil");
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
635 font = load_font (f, attr_value);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
636 unload_font (f, face->font);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
637 face->font = font;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
638 #endif /* HAVE_X_WINDOWS */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
639 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
640 else if (EQ (attr_name, intern ("foreground")))
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
641 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
642 #ifdef HAVE_X_WINDOWS
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
643 unsigned long new_color;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
644 if (magic_p)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
645 error ("forground color of the `normal' or `modeline' face may not be nil");
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
646 new_color = load_color (f, attr_value);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
647 unload_color (f, face->foreground);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
648 face->foreground = new_color;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
649 #endif /* HAVE_X_WINDOWS */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
650 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
651 else if (EQ (attr_name, intern ("background")))
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
652 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
653 #ifdef HAVE_X_WINDOWS
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
654 unsigned long new_color;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
655 if (magic_p)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
656 error ("background color of the `normal' or `modeline' face may not be nil");
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
657 new_color = load_color (f, attr_value);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
658 unload_color (f, face->background);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
659 face->background = new_color;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
660 #endif /* HAVE_X_WINDOWS */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
661 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
662 #if 0
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
663 else if (EQ (attr_name, intern ("background-pixmap")))
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
664 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
665 #ifdef HAVE_X_WINDOWS
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
666 unsigned int w, h, d;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
667 unsigned long new_pixmap = load_pixmap (f, attr_value, &w, &h, &d, 0);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
668 unload_pixmap (f, face->back_pixmap);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
669 if (magic_p) new_pixmap = 0;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
670 face->back_pixmap = new_pixmap;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
671 face->pixmap_w = w;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
672 face->pixmap_h = h;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
673 /* face->pixmap_depth = d; */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
674 #endif /* HAVE_X_WINDOWS */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
675 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
676 #endif /* 0 */
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
677 else if (EQ (attr_name, intern ("underline")))
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
678 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
679 int new = !NILP (attr_value);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
680 face->underline = new;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
681 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
682 else
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
683 error ("unknown face attribute");
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
684
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
685 if (id == 0)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
686 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
687 BLOCK_INPUT;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
688 XFreeGC (dpy, FRAME_NORMAL_FACE (f)->facegc);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
689 build_face (f, FRAME_NORMAL_FACE (f));
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
690 UNBLOCK_INPUT;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
691 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
692
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
693 if (id == 1)
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
694 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
695 BLOCK_INPUT;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
696 XFreeGC (dpy, FRAME_NORMAL_FACE (f)->facegc);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
697 build_face (f, FRAME_NORMAL_FACE (f));
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
698 UNBLOCK_INPUT;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
699 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
700
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
701 return Qnil;
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
702 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
703
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
704 DEFUN ("internal-next-face-id", Finternal_next_face_id, Sinternal_next_face_id,
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
705 0, 0, 0, "")
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
706 ()
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
707 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
708 return make_number (next_face_id++);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
709 }
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
710
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
711 void
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
712 syms_of_faces ()
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
713 {
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
714 defsubr (&Sframe_face_alist);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
715 defsubr (&Sset_frame_face_alist);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
716 defsubr (&Smake_face_internal);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
717 defsubr (&Sset_face_attribute_internal);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
718 defsubr (&Sinternal_next_face_id);
7aaafd275bec Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
719 }