diff options
author | Miles Bader <[email protected]> | 2007-10-11 16:24:58 +0000 |
---|---|---|
committer | Miles Bader <[email protected]> | 2007-10-11 16:24:58 +0000 |
commit | c73bd236f75b742ad4642ec94798987ae6e3e1e8 (patch) | |
tree | ef5edc8db557fc1d25a17c379e4ae63a38b3ba5c /src/xfaces.c | |
parent | ecb21060d5c1752d41d7a742be565c59b5fcb855 (diff) | |
parent | 58ade22bf16a9ec2ff0aee6c59d8db4d1703e94f (diff) |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 866-879)
- Merge multi-tty branch
- Update from CVS
- Merge from emacs--rel--22
Revision: [email protected]/emacs--unicode--0--patch-257
Diffstat (limited to 'src/xfaces.c')
-rw-r--r-- | src/xfaces.c | 67 |
1 files changed, 46 insertions, 21 deletions
diff --git a/src/xfaces.c b/src/xfaces.c index c21d0a1cd5..298e9e52d5 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -197,12 +197,14 @@ Boston, MA 02110-1301, USA. */ #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> +#include <stdio.h> /* This needs to be before termchar.h */ #include "lisp.h" #include "character.h" #include "charset.h" #include "keyboard.h" #include "frame.h" +#include "termhooks.h" #ifdef HAVE_WINDOW_SYSTEM #include "fontset.h" @@ -245,6 +247,7 @@ Boston, MA 02110-1301, USA. */ #include "blockinput.h" #include "window.h" #include "intervals.h" +#include "termchar.h" #ifdef HAVE_WINDOW_SYSTEM #ifdef USE_FONT_BACKEND @@ -273,8 +276,6 @@ Boston, MA 02110-1301, USA. */ #include <ctype.h> -#define abs(X) ((X) < 0 ? -(X) : (X)) - /* Number of pt per inch (from the TeXbook). */ #define PT_PER_INCH 72.27 @@ -751,10 +752,9 @@ x_free_gc (f, gc) struct frame *f; GC gc; { - BLOCK_INPUT; + eassert (interrupt_input_blocked); IF_DEBUG (xassert (--ngcs >= 0)); XFreeGC (FRAME_X_DISPLAY (f), gc); - UNBLOCK_INPUT; } #endif /* HAVE_X_WINDOWS */ @@ -784,10 +784,8 @@ x_free_gc (f, gc) struct frame *f; GC gc; { - BLOCK_INPUT; IF_DEBUG (xassert (--ngcs >= 0)); xfree (gc); - UNBLOCK_INPUT; } #endif /* WINDOWSNT */ @@ -814,10 +812,9 @@ x_free_gc (f, gc) struct frame *f; GC gc; { - BLOCK_INPUT; + eassert (interrupt_input_blocked); IF_DEBUG (xassert (--ngcs >= 0)); XFreeGC (FRAME_MAC_DISPLAY (f), gc); - UNBLOCK_INPUT; } #endif /* MAC_OS */ @@ -1269,8 +1266,10 @@ load_face_font (f, face) face->overstrike = needs_overstrike; if (face->gc) { + BLOCK_INPUT; x_free_gc (f, face->gc); face->gc = 0; + UNBLOCK_INPUT; } } else @@ -3347,6 +3346,22 @@ push_named_merge_point (struct named_merge_point *new_named_merge_point, +#if 0 /* Seems to be unused. */ +static Lisp_Object +internal_resolve_face_name (nargs, args) + int nargs; + Lisp_Object *args; +{ + return Fget (args[0], args[1]); +} + +static Lisp_Object +resolve_face_name_error (ignore) + Lisp_Object ignore; +{ + return Qnil; +} +#endif /* Resolve face name FACE_NAME. If FACE_NAME is a string, intern it to make it a symbol. If FACE_NAME is an alias for another face, @@ -5561,8 +5576,10 @@ free_realized_face (f, face) if (enable_font_backend && face->font_info) font_done_for_face (f, face); #endif /* USE_FONT_BACKEND */ + BLOCK_INPUT; x_free_gc (f, face->gc); face->gc = 0; + UNBLOCK_INPUT; } free_face_colors (f, face); @@ -5734,8 +5751,10 @@ clear_face_gcs (c) if (enable_font_backend && face->font_info) font_done_for_face (c->f, face); #endif /* USE_FONT_BACKEND */ + BLOCK_INPUT; x_free_gc (c->f, face->gc); face->gc = 0; + UNBLOCK_INPUT; } } #endif /* HAVE_WINDOW_SYSTEM */ @@ -6470,7 +6489,7 @@ tty_supports_face_attributes_p (f, attrs, def_face) val = attrs[LFACE_INVERSE_INDEX]; if (!UNSPECIFIEDP (val)) { - if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) + if (face_attr_equal_p (val, def_attrs[LFACE_INVERSE_INDEX])) return 0; /* same as default */ else test_caps |= TTY_CAP_INVERSE; @@ -6513,7 +6532,7 @@ tty_supports_face_attributes_p (f, attrs, def_face) bg = attrs[LFACE_BACKGROUND_INDEX]; if (STRINGP (bg)) { - Lisp_Object def_bg = def_attrs[LFACE_FOREGROUND_INDEX]; + Lisp_Object def_bg = def_attrs[LFACE_BACKGROUND_INDEX]; if (face_attr_equal_p (bg, def_bg)) return 0; /* same as default */ @@ -6551,7 +6570,7 @@ tty_supports_face_attributes_p (f, attrs, def_face) /* See if the capabilities we selected above are supported, with the given colors. */ if (test_caps != 0 && - ! tty_capable_p (f, test_caps, fg_tty_color.pixel, bg_tty_color.pixel)) + ! tty_capable_p (FRAME_TTY (f), test_caps, fg_tty_color.pixel, bg_tty_color.pixel)) return 0; @@ -7394,7 +7413,8 @@ realize_basic_faces (f) { FRAME_FACE_CACHE (f)->menu_face_changed_p = 0; #ifdef USE_X_TOOLKIT - x_update_menu_appearance (f); + if (FRAME_WINDOW_P (f)) + x_update_menu_appearance (f); #endif } @@ -7496,7 +7516,7 @@ realize_default_face (f) LFACE_FOREGROUND (lface) = XCDR (color); else if (FRAME_WINDOW_P (f)) return 0; - else if (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)) + else if (FRAME_INITIAL_P (f) || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)) LFACE_FOREGROUND (lface) = build_string (unspecified_fg); else abort (); @@ -7511,7 +7531,7 @@ realize_default_face (f) LFACE_BACKGROUND (lface) = XCDR (color); else if (FRAME_WINDOW_P (f)) return 0; - else if (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)) + else if (FRAME_INITIAL_P (f) || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)) LFACE_BACKGROUND (lface) = build_string (unspecified_bg); else abort (); @@ -7528,17 +7548,17 @@ realize_default_face (f) #ifdef HAVE_WINDOW_SYSTEM #ifdef HAVE_X_WINDOWS - if (face->font != FRAME_FONT (f)) + if (FRAME_X_P (f) && face->font != FRAME_FONT (f)) { /* This can happen when making a frame on a display that does - not support the default font. */ + not support the default font. */ if (!face->font) - return 0; - + return 0; + /* Otherwise, the font specified for the frame was not - acceptable as a font for the default face (perhaps because - auto-scaled fonts are rejected), so we must adjust the frame - font. */ + acceptable as a font for the default face (perhaps because + auto-scaled fonts are rejected), so we must adjust the frame + font. */ x_set_font (f, build_string (face->font_name), Qnil); } #endif /* HAVE_X_WINDOWS */ @@ -7614,6 +7634,11 @@ realize_face (cache, attrs, former_face_id) face = realize_x_face (cache, attrs); else if (FRAME_TERMCAP_P (cache->f) || FRAME_MSDOS_P (cache->f)) face = realize_tty_face (cache, attrs); + else if (FRAME_INITIAL_P (cache->f)) + { + /* Create a dummy face. */ + face = make_realized_face (attrs); + } else abort (); |