aboutsummaryrefslogtreecommitdiffstats
path: root/src/xfaces.c
diff options
context:
space:
mode:
authorDmitry Antipov2013-08-01 14:33:25 +0400
committerDmitry Antipov2013-08-01 14:33:25 +0400
commitfdb396e222923dc98d46c170381c6b33dc1e8d99 (patch)
tree9cf9c6074b8386eec0f9e7d0e610b98447894d4a /src/xfaces.c
parent2f935d86fd7aa551e2c61d71c14a1c1a8b3ba707 (diff)
downloademacs-fdb396e222923dc98d46c170381c6b33dc1e8d99.tar.gz
emacs-fdb396e222923dc98d46c170381c6b33dc1e8d99.zip
Avoid redundant Lisp_Object <-> struct frame conversions in font API.
* font.h (struct font_driver): Change list, match, and list_family functions to accept struct frame * as first arg. * font.c (font_score, font_compare, font_sort_entities): Remove prototypes. (font_sort_entities, font_list_entities, font_select_entity): (font_find_for_lface, Flist_fonts, Ffont_family_list): Adjust to match font API change. * xfont.c (xfont_list, xfont_match, xfont_list_family): * ftfont.c (ftfont_list, ftfont_match, ftfont_list_family): * ftxfont.c (ftxfont_list, ftxfont_match): * xftfont.c (xftfont_list, xftfont_match): * nsfont.m (nsfont_list, nsfont_match, nsfont_list_family): * w32font.c (w32font_list, w32font_match, w32font_list): (w32font_list_internal, w32_font_match_internal): Likewise. * xfaces.c (Fx_family_fonts): Adjust user.
Diffstat (limited to 'src/xfaces.c')
-rw-r--r--src/xfaces.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/xfaces.c b/src/xfaces.c
index 52cd65c029f..b187193fc70 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -1530,15 +1530,12 @@ the face font sort order. */)
1530 (Lisp_Object family, Lisp_Object frame) 1530 (Lisp_Object family, Lisp_Object frame)
1531{ 1531{
1532 Lisp_Object font_spec, list, *drivers, vec; 1532 Lisp_Object font_spec, list, *drivers, vec;
1533 struct frame *f = decode_live_frame (frame);
1533 ptrdiff_t i, nfonts; 1534 ptrdiff_t i, nfonts;
1534 EMACS_INT ndrivers; 1535 EMACS_INT ndrivers;
1535 Lisp_Object result; 1536 Lisp_Object result;
1536 USE_SAFE_ALLOCA; 1537 USE_SAFE_ALLOCA;
1537 1538
1538 if (NILP (frame))
1539 frame = selected_frame;
1540 CHECK_LIVE_FRAME (frame);
1541
1542 font_spec = Ffont_spec (0, NULL); 1539 font_spec = Ffont_spec (0, NULL);
1543 if (!NILP (family)) 1540 if (!NILP (family))
1544 { 1541 {
@@ -1546,7 +1543,7 @@ the face font sort order. */)
1546 font_parse_family_registry (family, Qnil, font_spec); 1543 font_parse_family_registry (family, Qnil, font_spec);
1547 } 1544 }
1548 1545
1549 list = font_list_entities (frame, font_spec); 1546 list = font_list_entities (f, font_spec);
1550 if (NILP (list)) 1547 if (NILP (list))
1551 return Qnil; 1548 return Qnil;
1552 1549
@@ -1589,7 +1586,7 @@ the face font sort order. */)
1589 ASET (v, 0, AREF (font, FONT_FAMILY_INDEX)); 1586 ASET (v, 0, AREF (font, FONT_FAMILY_INDEX));
1590 ASET (v, 1, FONT_WIDTH_SYMBOLIC (font)); 1587 ASET (v, 1, FONT_WIDTH_SYMBOLIC (font));
1591 point = PIXEL_TO_POINT (XINT (AREF (font, FONT_SIZE_INDEX)) * 10, 1588 point = PIXEL_TO_POINT (XINT (AREF (font, FONT_SIZE_INDEX)) * 10,
1592 FRAME_RES_Y (XFRAME (frame))); 1589 FRAME_RES_Y (f));
1593 ASET (v, 2, make_number (point)); 1590 ASET (v, 2, make_number (point));
1594 ASET (v, 3, FONT_WEIGHT_SYMBOLIC (font)); 1591 ASET (v, 3, FONT_WEIGHT_SYMBOLIC (font));
1595 ASET (v, 4, FONT_SLANT_SYMBOLIC (font)); 1592 ASET (v, 4, FONT_SLANT_SYMBOLIC (font));