diff options
Diffstat (limited to 'src/xfaces.c')
| -rw-r--r-- | src/xfaces.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/xfaces.c b/src/xfaces.c index a55ac90086d..e8cb7a70322 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -211,13 +211,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 211 | #include "frame.h" | 211 | #include "frame.h" |
| 212 | #include "termhooks.h" | 212 | #include "termhooks.h" |
| 213 | 213 | ||
| 214 | #ifdef HAVE_X_WINDOWS | ||
| 215 | #include "xterm.h" | ||
| 216 | #ifdef USE_MOTIF | 214 | #ifdef USE_MOTIF |
| 217 | #include <Xm/Xm.h> | 215 | #include <Xm/Xm.h> |
| 218 | #include <Xm/XmStrDefs.h> | 216 | #include <Xm/XmStrDefs.h> |
| 219 | #endif /* USE_MOTIF */ | 217 | #endif /* USE_MOTIF */ |
| 220 | #endif /* HAVE_X_WINDOWS */ | ||
| 221 | 218 | ||
| 222 | #ifdef MSDOS | 219 | #ifdef MSDOS |
| 223 | #include "dosfns.h" | 220 | #include "dosfns.h" |
| @@ -238,6 +235,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 238 | #define FRAME_X_DISPLAY_INFO FRAME_NS_DISPLAY_INFO | 235 | #define FRAME_X_DISPLAY_INFO FRAME_NS_DISPLAY_INFO |
| 239 | #define GCGraphicsExposures 0 | 236 | #define GCGraphicsExposures 0 |
| 240 | #endif /* HAVE_NS */ | 237 | #endif /* HAVE_NS */ |
| 238 | |||
| 239 | /* Number of pt per inch (from the TeXbook). */ | ||
| 240 | |||
| 241 | #define PT_PER_INCH 72.27 | ||
| 242 | |||
| 241 | #endif /* HAVE_WINDOW_SYSTEM */ | 243 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 242 | 244 | ||
| 243 | #include "buffer.h" | 245 | #include "buffer.h" |
| @@ -272,10 +274,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 272 | 274 | ||
| 273 | #include <c-ctype.h> | 275 | #include <c-ctype.h> |
| 274 | 276 | ||
| 275 | /* Number of pt per inch (from the TeXbook). */ | ||
| 276 | |||
| 277 | #define PT_PER_INCH 72.27 | ||
| 278 | |||
| 279 | /* Non-zero if face attribute ATTR is unspecified. */ | 277 | /* Non-zero if face attribute ATTR is unspecified. */ |
| 280 | 278 | ||
| 281 | #define UNSPECIFIEDP(ATTR) EQ ((ATTR), Qunspecified) | 279 | #define UNSPECIFIEDP(ATTR) EQ ((ATTR), Qunspecified) |
| @@ -396,6 +394,8 @@ static Lisp_Object Qtty_color_desc, Qtty_color_by_index, Qtty_color_standard_val | |||
| 396 | 394 | ||
| 397 | static Lisp_Object Qtty_color_alist; | 395 | static Lisp_Object Qtty_color_alist; |
| 398 | 396 | ||
| 397 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 398 | |||
| 399 | /* Counter for calls to clear_face_cache. If this counter reaches | 399 | /* Counter for calls to clear_face_cache. If this counter reaches |
| 400 | CLEAR_FONT_TABLE_COUNT, and a frame has more than | 400 | CLEAR_FONT_TABLE_COUNT, and a frame has more than |
| 401 | CLEAR_FONT_TABLE_NFONTS load, unused fonts are freed. */ | 401 | CLEAR_FONT_TABLE_NFONTS load, unused fonts are freed. */ |
| @@ -404,6 +404,8 @@ static int clear_font_table_count; | |||
| 404 | #define CLEAR_FONT_TABLE_COUNT 100 | 404 | #define CLEAR_FONT_TABLE_COUNT 100 |
| 405 | #define CLEAR_FONT_TABLE_NFONTS 10 | 405 | #define CLEAR_FONT_TABLE_NFONTS 10 |
| 406 | 406 | ||
| 407 | #endif /* HAVE_WINDOW_SYSTEM */ | ||
| 408 | |||
| 407 | /* Non-zero means face attributes have been changed since the last | 409 | /* Non-zero means face attributes have been changed since the last |
| 408 | redisplay. Used in redisplay_internal. */ | 410 | redisplay. Used in redisplay_internal. */ |
| 409 | 411 | ||
| @@ -434,29 +436,27 @@ static int ngcs; | |||
| 434 | 436 | ||
| 435 | static int menu_face_changed_default; | 437 | static int menu_face_changed_default; |
| 436 | 438 | ||
| 437 | |||
| 438 | /* Function prototypes. */ | ||
| 439 | |||
| 440 | struct table_entry; | ||
| 441 | struct named_merge_point; | 439 | struct named_merge_point; |
| 442 | 440 | ||
| 443 | static void set_font_frame_param (Lisp_Object, Lisp_Object); | ||
| 444 | static struct face *realize_face (struct face_cache *, Lisp_Object *, | 441 | static struct face *realize_face (struct face_cache *, Lisp_Object *, |
| 445 | int); | 442 | int); |
| 446 | static struct face *realize_non_ascii_face (struct frame *, Lisp_Object, | ||
| 447 | struct face *); | ||
| 448 | static struct face *realize_x_face (struct face_cache *, Lisp_Object *); | 443 | static struct face *realize_x_face (struct face_cache *, Lisp_Object *); |
| 449 | static struct face *realize_tty_face (struct face_cache *, Lisp_Object *); | 444 | static struct face *realize_tty_face (struct face_cache *, Lisp_Object *); |
| 450 | static bool realize_basic_faces (struct frame *); | 445 | static bool realize_basic_faces (struct frame *); |
| 451 | static bool realize_default_face (struct frame *); | 446 | static bool realize_default_face (struct frame *); |
| 452 | static void realize_named_face (struct frame *, Lisp_Object, int); | 447 | static void realize_named_face (struct frame *, Lisp_Object, int); |
| 453 | static struct face_cache *make_face_cache (struct frame *); | 448 | static struct face_cache *make_face_cache (struct frame *); |
| 454 | static void clear_face_gcs (struct face_cache *); | ||
| 455 | static void free_face_cache (struct face_cache *); | 449 | static void free_face_cache (struct face_cache *); |
| 456 | static int merge_face_ref (struct frame *, Lisp_Object, Lisp_Object *, | 450 | static int merge_face_ref (struct frame *, Lisp_Object, Lisp_Object *, |
| 457 | int, struct named_merge_point *); | 451 | int, struct named_merge_point *); |
| 458 | 452 | ||
| 459 | 453 | #ifdef HAVE_WINDOW_SYSTEM | |
| 454 | static void set_font_frame_param (Lisp_Object, Lisp_Object); | ||
| 455 | static void clear_face_gcs (struct face_cache *); | ||
| 456 | static struct face *realize_non_ascii_face (struct frame *, Lisp_Object, | ||
| 457 | struct face *); | ||
| 458 | #endif /* HAVE_WINDOW_SYSTEM */ | ||
| 459 | |||
| 460 | /*********************************************************************** | 460 | /*********************************************************************** |
| 461 | Utilities | 461 | Utilities |
| 462 | ***********************************************************************/ | 462 | ***********************************************************************/ |
| @@ -3983,6 +3983,7 @@ lface_hash (Lisp_Object *v) | |||
| 3983 | ^ XHASH (v[LFACE_HEIGHT_INDEX])); | 3983 | ^ XHASH (v[LFACE_HEIGHT_INDEX])); |
| 3984 | } | 3984 | } |
| 3985 | 3985 | ||
| 3986 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 3986 | 3987 | ||
| 3987 | /* Return non-zero if LFACE1 and LFACE2 specify the same font (without | 3988 | /* Return non-zero if LFACE1 and LFACE2 specify the same font (without |
| 3988 | considering charsets/registries). They do if they specify the same | 3989 | considering charsets/registries). They do if they specify the same |
| @@ -4011,8 +4012,8 @@ lface_same_font_attributes_p (Lisp_Object *lface1, Lisp_Object *lface2) | |||
| 4011 | ); | 4012 | ); |
| 4012 | } | 4013 | } |
| 4013 | 4014 | ||
| 4015 | #endif /* HAVE_WINDOW_SYSTEM */ | ||
| 4014 | 4016 | ||
| 4015 | |||
| 4016 | /*********************************************************************** | 4017 | /*********************************************************************** |
| 4017 | Realized Faces | 4018 | Realized Faces |
| 4018 | ***********************************************************************/ | 4019 | ***********************************************************************/ |
| @@ -4171,6 +4172,7 @@ make_face_cache (struct frame *f) | |||
| 4171 | return c; | 4172 | return c; |
| 4172 | } | 4173 | } |
| 4173 | 4174 | ||
| 4175 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 4174 | 4176 | ||
| 4175 | /* Clear out all graphics contexts for all realized faces, except for | 4177 | /* Clear out all graphics contexts for all realized faces, except for |
| 4176 | the basic faces. This should be done from time to time just to avoid | 4178 | the basic faces. This should be done from time to time just to avoid |
| @@ -4181,7 +4183,6 @@ clear_face_gcs (struct face_cache *c) | |||
| 4181 | { | 4183 | { |
| 4182 | if (c && FRAME_WINDOW_P (c->f)) | 4184 | if (c && FRAME_WINDOW_P (c->f)) |
| 4183 | { | 4185 | { |
| 4184 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 4185 | int i; | 4186 | int i; |
| 4186 | for (i = BASIC_FACE_ID_SENTINEL; i < c->used; ++i) | 4187 | for (i = BASIC_FACE_ID_SENTINEL; i < c->used; ++i) |
| 4187 | { | 4188 | { |
| @@ -4196,10 +4197,10 @@ clear_face_gcs (struct face_cache *c) | |||
| 4196 | unblock_input (); | 4197 | unblock_input (); |
| 4197 | } | 4198 | } |
| 4198 | } | 4199 | } |
| 4199 | #endif /* HAVE_WINDOW_SYSTEM */ | ||
| 4200 | } | 4200 | } |
| 4201 | } | 4201 | } |
| 4202 | 4202 | ||
| 4203 | #endif /* HAVE_WINDOW_SYSTEM */ | ||
| 4203 | 4204 | ||
| 4204 | /* Free all realized faces in face cache C, including basic faces. | 4205 | /* Free all realized faces in face cache C, including basic faces. |
| 4205 | C may be null. If faces are freed, make sure the frame's current | 4206 | C may be null. If faces are freed, make sure the frame's current |