Mercurial > emacs
comparison src/xfaces.c @ 5801:af397aaa8e6b
(init_frame_faces): Clear FRAME_N_COMPUTED_FACES
and FRAME_SIZE_COMPUTED_FACES.
(compute_glyph_face): New arg CURRENT_FACE specifies face to merge with.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 06 Feb 1994 08:05:58 +0000 |
parents | 863e092a5891 |
children | 021e58905963 |
comparison
equal
deleted
inserted
replaced
5800:295e342614a4 | 5801:af397aaa8e6b |
---|---|
479 FRAME_PTR f; | 479 FRAME_PTR f; |
480 { | 480 { |
481 ensure_face_ready (f, 0); | 481 ensure_face_ready (f, 0); |
482 ensure_face_ready (f, 1); | 482 ensure_face_ready (f, 1); |
483 | 483 |
484 FRAME_N_COMPUTED_FACES (f) = 0; | |
485 FRAME_SIZE_COMPUTED_FACES (f) = 0; | |
486 | |
484 new_computed_face (f, FRAME_PARAM_FACES (f)[0]); | 487 new_computed_face (f, FRAME_PARAM_FACES (f)[0]); |
485 new_computed_face (f, FRAME_PARAM_FACES (f)[1]); | 488 new_computed_face (f, FRAME_PARAM_FACES (f)[1]); |
486 recompute_basic_faces (f); | 489 recompute_basic_faces (f); |
487 | 490 |
488 /* Find another X frame. */ | 491 /* Find another X frame. */ |
567 if (i >= FRAME_SIZE_COMPUTED_FACES (f)) | 570 if (i >= FRAME_SIZE_COMPUTED_FACES (f)) |
568 { | 571 { |
569 int new_size = i + 32; | 572 int new_size = i + 32; |
570 | 573 |
571 FRAME_COMPUTED_FACES (f) | 574 FRAME_COMPUTED_FACES (f) |
572 = (struct face **) | 575 = (struct face **) (FRAME_SIZE_COMPUTED_FACES (f) == 0 |
573 (FRAME_SIZE_COMPUTED_FACES (f) == 0 | 576 ? xmalloc (new_size * sizeof (struct face *)) |
574 ? xmalloc (new_size * sizeof (struct face *)) | 577 : xrealloc (FRAME_COMPUTED_FACES (f), |
575 : xrealloc (FRAME_COMPUTED_FACES (f), | 578 new_size * sizeof (struct face *))); |
576 new_size * sizeof (struct face *))); | |
577 FRAME_SIZE_COMPUTED_FACES (f) = new_size; | 579 FRAME_SIZE_COMPUTED_FACES (f) = new_size; |
578 } | 580 } |
579 | 581 |
580 i = FRAME_N_COMPUTED_FACES (f)++; | 582 i = FRAME_N_COMPUTED_FACES (f)++; |
581 FRAME_COMPUTED_FACES (f)[i] = copy_face (new_face); | 583 FRAME_COMPUTED_FACES (f)[i] = copy_face (new_face); |
885 return intern_computed_face (f, &face); | 887 return intern_computed_face (f, &face); |
886 } | 888 } |
887 | 889 |
888 /* Return the face ID to use to display a special glyph which selects | 890 /* Return the face ID to use to display a special glyph which selects |
889 FACE_CODE as the face ID, assuming that ordinarily the face would | 891 FACE_CODE as the face ID, assuming that ordinarily the face would |
890 be BASIC_FACE. F is the frame. */ | 892 be CURRENT_FACE. F is the frame. */ |
893 | |
891 int | 894 int |
892 compute_glyph_face (f, face_code) | 895 compute_glyph_face (f, face_code, current_face) |
893 struct frame *f; | 896 struct frame *f; |
894 int face_code; | 897 int face_code, current_face; |
895 { | 898 { |
896 struct face face; | 899 struct face face; |
897 | 900 |
898 compute_base_face (f, &face); | 901 face = *FRAME_COMPUTED_FACES (f)[current_face]; |
899 | 902 |
900 if (face_code >= 0 && face_code < FRAME_N_PARAM_FACES (f) | 903 if (face_code >= 0 && face_code < FRAME_N_PARAM_FACES (f) |
901 && FRAME_PARAM_FACES (f) [face_code] != 0) | 904 && FRAME_PARAM_FACES (f) [face_code] != 0) |
902 merge_faces (FRAME_PARAM_FACES (f) [face_code], &face); | 905 merge_faces (FRAME_PARAM_FACES (f) [face_code], &face); |
903 | 906 |
906 | 909 |
907 | 910 |
908 /* Recompute the GC's for the default and modeline faces. | 911 /* Recompute the GC's for the default and modeline faces. |
909 We call this after changing frame parameters on which those GC's | 912 We call this after changing frame parameters on which those GC's |
910 depend. */ | 913 depend. */ |
914 | |
911 void | 915 void |
912 recompute_basic_faces (f) | 916 recompute_basic_faces (f) |
913 FRAME_PTR f; | 917 FRAME_PTR f; |
914 { | 918 { |
915 /* If the frame's faces haven't been initialized yet, don't worry about | 919 /* If the frame's faces haven't been initialized yet, don't worry about |