comparison src/faces.c @ 290:c9fe270a4101 r21-0b43

Import from CVS: tag r21-0b43
author cvs
date Mon, 13 Aug 2007 10:36:47 +0200
parents e11d67e05968
children 70ad99077275
comparison
equal deleted inserted replaced
289:6e6992ccc4b6 290:c9fe270a4101
52 Lisp_Object Qinit_global_faces; 52 Lisp_Object Qinit_global_faces;
53 53
54 /* These faces are used directly internally. We use these variables 54 /* These faces are used directly internally. We use these variables
55 to be able to reference them directly and save the overhead of 55 to be able to reference them directly and save the overhead of
56 calling Ffind_face. */ 56 calling Ffind_face. */
57 Lisp_Object Vdefault_face, Vmodeline_face, V3d_object_face; 57 Lisp_Object Vdefault_face, Vmodeline_face, Vgui_element_face;
58 Lisp_Object Vleft_margin_face, Vright_margin_face, Vtext_cursor_face; 58 Lisp_Object Vleft_margin_face, Vright_margin_face, Vtext_cursor_face;
59 Lisp_Object Vpointer_face; 59 Lisp_Object Vpointer_face, Vvertical_divider_face, Vtoolbar_face;
60 Lisp_Object Vvertical_divider_face;
61 60
62 /* Qdefault, Qhighlight defined in general.c */ 61 /* Qdefault, Qhighlight defined in general.c */
63 Lisp_Object Qmodeline, Q3d_object, Qleft_margin, Qright_margin, Qtext_cursor; 62 Lisp_Object Qmodeline, Qgui_element, Qleft_margin, Qright_margin, Qtext_cursor;
64 Lisp_Object Qvertical_divider; 63 Lisp_Object Qvertical_divider;
65 64
66 /* In the old implementation Vface_list was a list of the face names, 65 /* In the old implementation Vface_list was a list of the face names,
67 not the faces themselves. We now distinguish between permanent and 66 not the faces themselves. We now distinguish between permanent and
68 temporary faces. Permanent faces are kept in a regular hash table, 67 temporary faces. Permanent faces are kept in a regular hash table,
1750 void 1749 void
1751 syms_of_faces (void) 1750 syms_of_faces (void)
1752 { 1751 {
1753 /* Qdefault defined in general.c */ 1752 /* Qdefault defined in general.c */
1754 defsymbol (&Qmodeline, "modeline"); 1753 defsymbol (&Qmodeline, "modeline");
1755 defsymbol (&Q3d_object, "3d-object"); 1754 defsymbol (&Qgui_element, "gui-element");
1756 defsymbol (&Qleft_margin, "left-margin"); 1755 defsymbol (&Qleft_margin, "left-margin");
1757 defsymbol (&Qright_margin, "right-margin"); 1756 defsymbol (&Qright_margin, "right-margin");
1758 defsymbol (&Qtext_cursor, "text-cursor"); 1757 defsymbol (&Qtext_cursor, "text-cursor");
1759 defsymbol (&Qvertical_divider, "vertical-divider"); 1758 defsymbol (&Qvertical_divider, "vertical-divider");
1760 1759
1803 staticpro (&Vtemporary_faces_cache); 1802 staticpro (&Vtemporary_faces_cache);
1804 Vtemporary_faces_cache = Qnil; 1803 Vtemporary_faces_cache = Qnil;
1805 1804
1806 staticpro (&Vdefault_face); 1805 staticpro (&Vdefault_face);
1807 Vdefault_face = Qnil; 1806 Vdefault_face = Qnil;
1808 staticpro (&V3d_object_face); 1807 staticpro (&Vgui_element_face);
1809 V3d_object_face = Qnil; 1808 Vgui_element_face = Qnil;
1810 staticpro (&Vmodeline_face); 1809 staticpro (&Vmodeline_face);
1811 Vmodeline_face = Qnil; 1810 Vmodeline_face = Qnil;
1811 staticpro (&Vtoolbar_face);
1812 Vtoolbar_face = Qnil;
1812 1813
1813 staticpro (&Vvertical_divider_face); 1814 staticpro (&Vvertical_divider_face);
1814 Vvertical_divider_face = Qnil; 1815 Vvertical_divider_face = Qnil;
1815 staticpro (&Vleft_margin_face); 1816 staticpro (&Vleft_margin_face);
1816 Vleft_margin_face = Qnil; 1817 Vleft_margin_face = Qnil;
1934 list1 (Fcons (Qnil, Qnil))); 1935 list1 (Fcons (Qnil, Qnil)));
1935 set_specifier_fallback (Fget (Vdefault_face, Qblinking, Qnil), 1936 set_specifier_fallback (Fget (Vdefault_face, Qblinking, Qnil),
1936 list1 (Fcons (Qnil, Qnil))); 1937 list1 (Fcons (Qnil, Qnil)));
1937 set_specifier_fallback (Fget (Vdefault_face, Qreverse, Qnil), 1938 set_specifier_fallback (Fget (Vdefault_face, Qreverse, Qnil),
1938 list1 (Fcons (Qnil, Qnil))); 1939 list1 (Fcons (Qnil, Qnil)));
1939 1940
1940 /* mustn't inherit bg pixmaps from the default face */ 1941 /* gui-element is the parent face of all gui elements such as
1941 V3d_object_face = Fmake_face (Q3d_object, build_string ("3d object face"), 1942 modeline, vertical divider and toolbar. */
1942 Qnil); 1943 Vgui_element_face = Fmake_face (Qgui_element,
1944 build_string ("gui element face"),
1945 Qnil);
1943 1946
1944 /* Now create the other faces that redisplay needs to refer to 1947 /* Now create the other faces that redisplay needs to refer to
1945 directly. We could create them in Lisp but it's simpler this 1948 directly. We could create them in Lisp but it's simpler this
1946 way since we need to get them anyway. */ 1949 way since we need to get them anyway. */
1950
1951 /* modeline is gui element. */
1947 Vmodeline_face = Fmake_face (Qmodeline, build_string ("modeline face"), 1952 Vmodeline_face = Fmake_face (Qmodeline, build_string ("modeline face"),
1948 Qnil); 1953 Qnil);
1949 1954
1950 /* modeline-face should not inherit colors from the default face. */
1951 set_specifier_fallback (Fget (Vmodeline_face, Qforeground, Qunbound), 1955 set_specifier_fallback (Fget (Vmodeline_face, Qforeground, Qunbound),
1952 Fget (V3d_object_face, Qforeground, Qunbound)); 1956 Fget (Vgui_element_face, Qforeground, Qunbound));
1953 set_specifier_fallback (Fget (Vmodeline_face, Qbackground, Qunbound), 1957 set_specifier_fallback (Fget (Vmodeline_face, Qbackground, Qunbound),
1954 Fget (V3d_object_face, Qbackground, Qunbound)); 1958 Fget (Vgui_element_face, Qbackground, Qunbound));
1955 set_specifier_fallback (Fget (Vmodeline_face, Qbackground_pixmap, 1959 set_specifier_fallback (Fget (Vmodeline_face, Qbackground_pixmap, Qnil),
1956 Qnil), 1960 Fget (Vgui_element_face, Qbackground_pixmap,
1957 Fget (V3d_object_face, Qbackground_pixmap, Qunbound)); 1961 Qunbound));
1958 1962
1963 /* toolbar is another gui element */
1964 Vtoolbar_face = Fmake_face (Qtoolbar,
1965 build_string ("toolbar face"),
1966 Qnil);
1967 set_specifier_fallback (Fget (Vtoolbar_face, Qforeground, Qunbound),
1968 Fget (Vgui_element_face, Qforeground, Qunbound));
1969 set_specifier_fallback (Fget (Vtoolbar_face, Qbackground, Qunbound),
1970 Fget (Vgui_element_face, Qbackground, Qunbound));
1971 set_specifier_fallback (Fget (Vtoolbar_face, Qbackground_pixmap, Qnil),
1972 Fget (Vgui_element_face, Qbackground_pixmap,
1973 Qunbound));
1974
1975 /* vertical divider is another gui element */
1959 Vvertical_divider_face = Fmake_face (Qvertical_divider, 1976 Vvertical_divider_face = Fmake_face (Qvertical_divider,
1960 build_string ("vertical divider face"), 1977 build_string ("vertical divider face"),
1961 Qnil); 1978 Qnil);
1962 /* #### vertical-divider-face should not inherit from modeline face. 1979
1963 Perhaps there must be a 3d-object-face to supply default foreground,
1964 background and pixmap. */
1965 set_specifier_fallback (Fget (Vvertical_divider_face, Qforeground, Qunbound), 1980 set_specifier_fallback (Fget (Vvertical_divider_face, Qforeground, Qunbound),
1966 Fget (V3d_object_face, Qforeground, Qunbound)); 1981 Fget (Vgui_element_face, Qforeground, Qunbound));
1967 set_specifier_fallback (Fget (Vvertical_divider_face, Qbackground, Qunbound), 1982 set_specifier_fallback (Fget (Vvertical_divider_face, Qbackground, Qunbound),
1968 Fget (V3d_object_face, Qbackground, Qunbound)); 1983 Fget (Vgui_element_face, Qbackground, Qunbound));
1969 set_specifier_fallback (Fget (Vvertical_divider_face, Qbackground_pixmap, 1984 set_specifier_fallback (Fget (Vvertical_divider_face, Qbackground_pixmap,
1970 Qunbound), 1985 Qunbound),
1971 Fget (V3d_object_face, Qbackground_pixmap, Qunbound)); 1986 Fget (Vgui_element_face, Qbackground_pixmap,
1987 Qunbound));
1972 1988
1973 Vleft_margin_face = Fmake_face (Qleft_margin, 1989 Vleft_margin_face = Fmake_face (Qleft_margin,
1974 build_string ("left margin face"), 1990 build_string ("left margin face"),
1975 Qnil); 1991 Qnil);
1976 Vright_margin_face = Fmake_face (Qright_margin, 1992 Vright_margin_face = Fmake_face (Qright_margin,