aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2011-07-28 11:45:07 -0400
committerChong Yidong2011-07-28 11:45:07 -0400
commitc897048c52b767decd44fa59805f80cd71ae9050 (patch)
tree0d89dd4b12386325ccbeb33e5fb4267711da6ce3 /src
parentea180610badb3df580d68e444f4418dce7929d17 (diff)
downloademacs-c897048c52b767decd44fa59805f80cd71ae9050.tar.gz
emacs-c897048c52b767decd44fa59805f80cd71ae9050.zip
Backport 2010-07-03T14:42:02Z!eliz@gnu.org from trunk
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/xfaces.c64
2 files changed, 39 insertions, 31 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 0587a414acb..1c2218f9d96 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12011-07-28 Eli Zaretskii <eliz@gnu.org>
2
3 * xfaces.c (update_face_from_frame_parameter): Move out of
4 HAVE_WINDOW_SYSTEM portion. Condition window-system only parts
5 with HAVE_WINDOW_SYSTEM.
6
12011-07-26 Andreas Schwab <schwab@linux-m68k.org> 72011-07-26 Andreas Schwab <schwab@linux-m68k.org>
2 8
3 * fontset.c (fontset_get_font_group): Add proper type checks. 9 * fontset.c (fontset_get_font_group): Add proper type checks.
diff --git a/src/xfaces.c b/src/xfaces.c
index 1606113596d..70850cc8a36 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -3490,37 +3490,6 @@ FRAME 0 means change the face on all frames, and change the default
3490} 3490}
3491 3491
3492 3492
3493#ifdef HAVE_WINDOW_SYSTEM
3494
3495/* Set the `font' frame parameter of FRAME determined from the
3496 font-object set in `default' face attributes LFACE. */
3497
3498static void
3499set_font_frame_param (frame, lface)
3500 Lisp_Object frame, lface;
3501{
3502 struct frame *f = XFRAME (frame);
3503 Lisp_Object font;
3504
3505 if (FRAME_WINDOW_P (f)
3506 /* Don't do anything if the font is `unspecified'. This can
3507 happen during frame creation. */
3508 && (font = LFACE_FONT (lface),
3509 ! UNSPECIFIEDP (font)))
3510 {
3511 if (FONT_SPEC_P (font))
3512 {
3513 font = font_load_for_lface (f, XVECTOR (lface)->contents, font);
3514 if (NILP (font))
3515 return;
3516 LFACE_FONT (lface) = font;
3517 }
3518 f->default_face_done_p = 0;
3519 Fmodify_frame_parameters (frame, Fcons (Fcons (Qfont, font), Qnil));
3520 }
3521}
3522
3523
3524/* Update the corresponding face when frame parameter PARAM on frame F 3493/* Update the corresponding face when frame parameter PARAM on frame F
3525 has been assigned the value NEW_VALUE. */ 3494 has been assigned the value NEW_VALUE. */
3526 3495
@@ -3562,6 +3531,7 @@ update_face_from_frame_parameter (f, param, new_value)
3562 ? new_value : Qunspecified); 3531 ? new_value : Qunspecified);
3563 realize_basic_faces (f); 3532 realize_basic_faces (f);
3564 } 3533 }
3534#ifdef HAVE_WINDOW_SYSTEM
3565 else if (EQ (param, Qborder_color)) 3535 else if (EQ (param, Qborder_color))
3566 { 3536 {
3567 face = Qborder; 3537 face = Qborder;
@@ -3583,6 +3553,7 @@ update_face_from_frame_parameter (f, param, new_value)
3583 LFACE_BACKGROUND (lface) = (STRINGP (new_value) 3553 LFACE_BACKGROUND (lface) = (STRINGP (new_value)
3584 ? new_value : Qunspecified); 3554 ? new_value : Qunspecified);
3585 } 3555 }
3556#endif
3586 3557
3587 /* Changing a named face means that all realized faces depending on 3558 /* Changing a named face means that all realized faces depending on
3588 that face are invalid. Since we cannot tell which realized faces 3559 that face are invalid. Since we cannot tell which realized faces
@@ -3598,6 +3569,37 @@ update_face_from_frame_parameter (f, param, new_value)
3598} 3569}
3599 3570
3600 3571
3572#ifdef HAVE_WINDOW_SYSTEM
3573
3574/* Set the `font' frame parameter of FRAME determined from the
3575 font-object set in `default' face attributes LFACE. */
3576
3577static void
3578set_font_frame_param (frame, lface)
3579 Lisp_Object frame, lface;
3580{
3581 struct frame *f = XFRAME (frame);
3582 Lisp_Object font;
3583
3584 if (FRAME_WINDOW_P (f)
3585 /* Don't do anything if the font is `unspecified'. This can
3586 happen during frame creation. */
3587 && (font = LFACE_FONT (lface),
3588 ! UNSPECIFIEDP (font)))
3589 {
3590 if (FONT_SPEC_P (font))
3591 {
3592 font = font_load_for_lface (f, XVECTOR (lface)->contents, font);
3593 if (NILP (font))
3594 return;
3595 LFACE_FONT (lface) = font;
3596 }
3597 f->default_face_done_p = 0;
3598 Fmodify_frame_parameters (frame, Fcons (Fcons (Qfont, font), Qnil));
3599 }
3600}
3601
3602
3601/* Get the value of X resource RESOURCE, class CLASS for the display 3603/* Get the value of X resource RESOURCE, class CLASS for the display
3602 of frame FRAME. This is here because ordinary `x-get-resource' 3604 of frame FRAME. This is here because ordinary `x-get-resource'
3603 doesn't take a frame argument. */ 3605 doesn't take a frame argument. */