-static void
-xm_set_menu_resources_from_menu_face (f, widget)
- struct frame *f;
- Widget widget;
-{
- struct face *face;
- Lisp_Object lface;
- Arg av[3];
- int ac = 0;
- XmFontList fl = 0;
-
- lface = lface_from_face_name (f, Qmenu, 1);
- face = FACE_FROM_ID (f, MENU_FACE_ID);
-
- if (!UNSPECIFIEDP (LFACE_FOREGROUND (lface)))
- {
- XtSetArg (av[ac], XmNforeground, face->foreground);
- ++ac;
- }
-
- if (!UNSPECIFIEDP (LFACE_BACKGROUND (lface)))
- {
- XtSetArg (av[ac], XmNbackground, face->background);
- ++ac;
- }
-
- /* If any font-related attribute of `menu' is set, set the font. */
- if (face->font
- && (!UNSPECIFIEDP (LFACE_FAMILY (lface))
- || !UNSPECIFIEDP (LFACE_SWIDTH (lface))
- || !UNSPECIFIEDP (LFACE_WEIGHT (lface))
- || !UNSPECIFIEDP (LFACE_SLANT (lface))
- || !UNSPECIFIEDP (LFACE_HEIGHT (lface))))
- {
-#if 0 /* Setting the font leads to an infinite loop somewhere
- in LessTif during geometry computation. */
- XmFontListEntry fe;
- fe = XmFontListEntryCreate ("menu_font", XmFONT_IS_FONT, face->font);
- fl = XmFontListAppendEntry (NULL, fe);
- XtSetArg (av[ac], XmNfontList, fl);
- ++ac;
-#endif
- }
-
- xassert (ac <= sizeof av / sizeof *av);
-
- if (ac)
- {
- struct x_resources res;
-
- XtSetValues (widget, av, ac);
- res.av = av, res.ac = ac;
- XtApplyToWidgets (widget, xm_apply_resources, &res);
- if (fl)
- XmFontListFree (fl);
- }
-}
-
-
-#endif /* USE_MOTIF */
-
-#ifdef USE_LUCID
-
-static void xl_apply_resources P_ ((Widget, XtPointer));
-static void xl_set_menu_resources_from_menu_face P_ ((struct frame *, Widget));
-
-
-/* Set widget W's resources from P which points to an x_resources
- structure. */
-
-static void
-xl_apply_resources (widget, p)
- Widget widget;
- XtPointer p;
-{
- struct x_resources *res = (struct x_resources *) p;
- XtSetValues (widget, res->av, res->ac);
-}
-
-
-/* On frame F, set X resources of menu-widget WIDGET from face `menu'.
- This is the Lucid version. */
-
-static void
-xl_set_menu_resources_from_menu_face (f, widget)
- struct frame *f;
- Widget widget;
-{
- struct face *face;
- Lisp_Object lface;
- Arg av[3];
- int ac = 0;
-
- lface = lface_from_face_name (f, Qmenu, 1);
- face = FACE_FROM_ID (f, MENU_FACE_ID);
-
- if (!UNSPECIFIEDP (LFACE_FOREGROUND (lface)))
- {
- XtSetArg (av[ac], XtNforeground, face->foreground);
- ++ac;
- }
-
- if (!UNSPECIFIEDP (LFACE_BACKGROUND (lface)))
- {
- XtSetArg (av[ac], XtNbackground, face->background);
- ++ac;
- }
-
- if (face->font
- && (!UNSPECIFIEDP (LFACE_FAMILY (lface))
- || !UNSPECIFIEDP (LFACE_SWIDTH (lface))
- || !UNSPECIFIEDP (LFACE_WEIGHT (lface))
- || !UNSPECIFIEDP (LFACE_SLANT (lface))
- || !UNSPECIFIEDP (LFACE_HEIGHT (lface))))
- {
- XtSetArg (av[ac], XtNfont, face->font);
- ++ac;
- }
-
- if (ac)
- {
- struct x_resources res;
-
- XtSetValues (widget, av, ac);
-
- /* We must do children here in case we're handling a pop-up menu
- in which case WIDGET is a popup shell. XtApplyToWidgets
- is a function from lwlib. */
- res.av = av, res.ac = ac;
- XtApplyToWidgets (widget, xl_apply_resources, &res);
- }
-}
-
-#endif /* USE_LUCID */
-
-
-/* On frame F, set X resources of menu-widget WIDGET from face `menu'. */
-
-void
-x_set_menu_resources_from_menu_face (f, widget)
- struct frame *f;
- Widget widget;
-{
- /* Realized faces may have been removed on frame F, e.g. because of
- face attribute changes. Recompute them, if necessary, since we
- will need the `menu' face. */
- if (f->face_cache->used == 0)
- recompute_basic_faces (f);
-
-#ifdef USE_LUCID
- xl_set_menu_resources_from_menu_face (f, widget);
-#endif
-#ifdef USE_MOTIF
- xm_set_menu_resources_from_menu_face (f, widget);
-#endif
-}
-
-#endif /* USE_X_TOOLKIT */
-
-#endif /* HAVE_X_WINDOWS */
-
-
-
-DEFUN ("internal-get-lisp-face-attribute", Finternal_get_lisp_face_attribute,
- Sinternal_get_lisp_face_attribute,
- 2, 3, 0,
- "Return face attribute KEYWORD of face SYMBOL.\n\
-If SYMBOL does not name a valid Lisp face or KEYWORD isn't a valid\n\
-face attribute name, signal an error.\n\
-If the optional argument FRAME is given, report on face FACE in that\n\
-frame. If FRAME is t, report on the defaults for face FACE (for new\n\
-frames). If FRAME is omitted or nil, use the selected frame.")
- (symbol, keyword, frame)
- Lisp_Object symbol, keyword, frame;