Mercurial > emacs
comparison src/xfaces.c @ 18083:c361afa561c5
Include frame.h unconditionally.
(Fframe_face_alist, Fset_frame_face_alist): Define unconditionally.
(Finternal_next_face_id, next_face_id): Likewise.
(syms_of_xfaces): Define unconditionally,
but conditionalize some of the contents.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 01 Jun 1997 00:30:01 +0000 |
parents | 6c586afaa572 |
children | 157cdb505495 |
comparison
equal
deleted
inserted
replaced
18082:4a796f28f98e | 18083:c361afa561c5 |
---|---|
25 | 25 |
26 #include <config.h> | 26 #include <config.h> |
27 #include "lisp.h" | 27 #include "lisp.h" |
28 | 28 |
29 #include "charset.h" | 29 #include "charset.h" |
30 | |
31 #include "frame.h" | |
32 | |
33 /* The number of face-id's in use (same for all frames). */ | |
34 static int next_face_id; | |
30 | 35 |
31 #ifdef HAVE_FACES | 36 #ifdef HAVE_FACES |
32 | 37 |
33 #ifdef HAVE_X_WINDOWS | 38 #ifdef HAVE_X_WINDOWS |
34 #include "xterm.h" | 39 #include "xterm.h" |
37 #ifdef MSDOS | 42 #ifdef MSDOS |
38 #include "dosfns.h" | 43 #include "dosfns.h" |
39 #endif | 44 #endif |
40 #include "buffer.h" | 45 #include "buffer.h" |
41 #include "dispextern.h" | 46 #include "dispextern.h" |
42 #include "frame.h" | |
43 #include "blockinput.h" | 47 #include "blockinput.h" |
44 #include "window.h" | 48 #include "window.h" |
45 #include "intervals.h" | 49 #include "intervals.h" |
46 | 50 |
47 #ifdef HAVE_X_WINDOWS | 51 #ifdef HAVE_X_WINDOWS |
148 array would grow very large on all frames, because any facial | 152 array would grow very large on all frames, because any facial |
149 combination displayed on any frame would need to be a valid entry | 153 combination displayed on any frame would need to be a valid entry |
150 on all frames. */ | 154 on all frames. */ |
151 | 155 |
152 /* Definitions and declarations. */ | 156 /* Definitions and declarations. */ |
153 | |
154 /* The number of face-id's in use (same for all frames). */ | |
155 static int next_face_id; | |
156 | 157 |
157 /* The number of the face to use to indicate the region. */ | 158 /* The number of the face to use to indicate the region. */ |
158 static int region_face; | 159 static int region_face; |
159 | 160 |
160 /* This is what appears in a slot in a face to signify that the face | 161 /* This is what appears in a slot in a face to signify that the face |
1113 } | 1114 } |
1114 | 1115 |
1115 | 1116 |
1116 | 1117 |
1117 /* Lisp interface. */ | 1118 /* Lisp interface. */ |
1118 | |
1119 DEFUN ("frame-face-alist", Fframe_face_alist, Sframe_face_alist, 1, 1, 0, | |
1120 "") | |
1121 (frame) | |
1122 Lisp_Object frame; | |
1123 { | |
1124 CHECK_FRAME (frame, 0); | |
1125 return XFRAME (frame)->face_alist; | |
1126 } | |
1127 | |
1128 DEFUN ("set-frame-face-alist", Fset_frame_face_alist, Sset_frame_face_alist, | |
1129 2, 2, 0, "") | |
1130 (frame, value) | |
1131 Lisp_Object frame, value; | |
1132 { | |
1133 CHECK_FRAME (frame, 0); | |
1134 XFRAME (frame)->face_alist = value; | |
1135 return value; | |
1136 } | |
1137 | |
1138 | 1119 |
1139 DEFUN ("make-face-internal", Fmake_face_internal, Smake_face_internal, 1, 1, 0, | 1120 DEFUN ("make-face-internal", Fmake_face_internal, Smake_face_internal, 1, 1, 0, |
1140 "Create face number FACE-ID on all frames.") | 1121 "Create face number FACE-ID on all frames.") |
1141 (face_id) | 1122 (face_id) |
1142 Lisp_Object face_id; | 1123 Lisp_Object face_id; |
1275 FRAME_X_DISPLAY_INFO (f)->mouse_face_defer = 1; | 1256 FRAME_X_DISPLAY_INFO (f)->mouse_face_defer = 1; |
1276 } | 1257 } |
1277 | 1258 |
1278 return Qnil; | 1259 return Qnil; |
1279 } | 1260 } |
1280 | |
1281 DEFUN ("internal-next-face-id", Finternal_next_face_id, Sinternal_next_face_id, | |
1282 0, 0, 0, "") | |
1283 () | |
1284 { | |
1285 return make_number (next_face_id++); | |
1286 } | |
1287 | |
1288 /* Return the face id for name NAME on frame FRAME. | 1261 /* Return the face id for name NAME on frame FRAME. |
1289 (It should be the same for all frames, | 1262 (It should be the same for all frames, |
1290 but it's as easy to use the "right" frame to look it up | 1263 but it's as easy to use the "right" frame to look it up |
1291 as to use any other one.) */ | 1264 as to use any other one.) */ |
1292 | 1265 |
1303 CHECK_VECTOR (tem, 0); | 1276 CHECK_VECTOR (tem, 0); |
1304 tem = XVECTOR (tem)->contents[2]; | 1277 tem = XVECTOR (tem)->contents[2]; |
1305 CHECK_NUMBER (tem, 0); | 1278 CHECK_NUMBER (tem, 0); |
1306 return XINT (tem); | 1279 return XINT (tem); |
1307 } | 1280 } |
1281 | |
1282 #endif /* HAVE_FACES */ | |
1283 | |
1284 | |
1285 DEFUN ("frame-face-alist", Fframe_face_alist, Sframe_face_alist, 1, 1, 0, | |
1286 "") | |
1287 (frame) | |
1288 Lisp_Object frame; | |
1289 { | |
1290 CHECK_FRAME (frame, 0); | |
1291 return XFRAME (frame)->face_alist; | |
1292 } | |
1293 | |
1294 DEFUN ("set-frame-face-alist", Fset_frame_face_alist, Sset_frame_face_alist, | |
1295 2, 2, 0, "") | |
1296 (frame, value) | |
1297 Lisp_Object frame, value; | |
1298 { | |
1299 CHECK_FRAME (frame, 0); | |
1300 XFRAME (frame)->face_alist = value; | |
1301 return value; | |
1302 } | |
1303 | |
1304 DEFUN ("internal-next-face-id", Finternal_next_face_id, Sinternal_next_face_id, | |
1305 0, 0, 0, "") | |
1306 () | |
1307 { | |
1308 return make_number (next_face_id++); | |
1309 } | |
1308 | 1310 |
1309 /* Emacs initialization. */ | 1311 /* Emacs initialization. */ |
1310 | 1312 |
1311 void | 1313 void |
1312 syms_of_xfaces () | 1314 syms_of_xfaces () |
1313 { | 1315 { |
1316 #ifdef HAVE_FACES | |
1314 Qface = intern ("face"); | 1317 Qface = intern ("face"); |
1315 staticpro (&Qface); | 1318 staticpro (&Qface); |
1316 Qmouse_face = intern ("mouse-face"); | 1319 Qmouse_face = intern ("mouse-face"); |
1317 staticpro (&Qmouse_face); | 1320 staticpro (&Qmouse_face); |
1318 Qpixmap_spec_p = intern ("pixmap-spec-p"); | 1321 Qpixmap_spec_p = intern ("pixmap-spec-p"); |
1321 DEFVAR_INT ("region-face", ®ion_face, | 1324 DEFVAR_INT ("region-face", ®ion_face, |
1322 "Face number to use to highlight the region\n\ | 1325 "Face number to use to highlight the region\n\ |
1323 The region is highlighted with this face\n\ | 1326 The region is highlighted with this face\n\ |
1324 when Transient Mark mode is enabled and the mark is active."); | 1327 when Transient Mark mode is enabled and the mark is active."); |
1325 | 1328 |
1329 defsubr (&Smake_face_internal); | |
1330 defsubr (&Sset_face_attribute_internal); | |
1331 #endif /* HAVE_FACES */ | |
1332 | |
1326 #ifdef HAVE_X_WINDOWS | 1333 #ifdef HAVE_X_WINDOWS |
1327 defsubr (&Spixmap_spec_p); | 1334 defsubr (&Spixmap_spec_p); |
1328 #endif | 1335 #endif |
1336 | |
1329 defsubr (&Sframe_face_alist); | 1337 defsubr (&Sframe_face_alist); |
1330 defsubr (&Sset_frame_face_alist); | 1338 defsubr (&Sset_frame_face_alist); |
1331 defsubr (&Smake_face_internal); | |
1332 defsubr (&Sset_face_attribute_internal); | |
1333 defsubr (&Sinternal_next_face_id); | 1339 defsubr (&Sinternal_next_face_id); |
1334 } | 1340 } |
1335 | |
1336 #endif /* HAVE_FACES */ |