aboutsummaryrefslogtreecommitdiffstats
path: root/src/xfont.c
diff options
context:
space:
mode:
authorDan Nicolaescu2010-07-04 00:50:25 -0700
committerDan Nicolaescu2010-07-04 00:50:25 -0700
commit971de7fb158335fbda39525feb2d7776a26bc030 (patch)
tree605333d85f16e35bb06baffcb66ac49f4ec0dce9 /src/xfont.c
parentb8463cbfbe2c5183cf40772df2746e58b787ddeb (diff)
downloademacs-971de7fb158335fbda39525feb2d7776a26bc030.tar.gz
emacs-971de7fb158335fbda39525feb2d7776a26bc030.zip
Convert (most) functions in src to standard C.
* src/alloc.c: Convert function definitions to standard C. * src/atimer.c: * src/bidi.c: * src/bytecode.c: * src/callint.c: * src/callproc.c: * src/casefiddle.c: * src/casetab.c: * src/category.c: * src/ccl.c: * src/character.c: * src/charset.c: * src/chartab.c: * src/cmds.c: * src/coding.c: * src/composite.c: * src/data.c: * src/dbusbind.c: * src/dired.c: * src/dispnew.c: * src/doc.c: * src/doprnt.c: * src/ecrt0.c: * src/editfns.c: * src/fileio.c: * src/filelock.c: * src/filemode.c: * src/fns.c: * src/font.c: * src/fontset.c: * src/frame.c: * src/fringe.c: * src/ftfont.c: * src/ftxfont.c: * src/gtkutil.c: * src/indent.c: * src/insdel.c: * src/intervals.c: * src/keymap.c: * src/lread.c: * src/macros.c: * src/marker.c: * src/md5.c: * src/menu.c: * src/minibuf.c: * src/prefix-args.c: * src/print.c: * src/ralloc.c: * src/regex.c: * src/region-cache.c: * src/scroll.c: * src/search.c: * src/sound.c: * src/strftime.c: * src/syntax.c: * src/sysdep.c: * src/termcap.c: * src/terminal.c: * src/terminfo.c: * src/textprop.c: * src/tparam.c: * src/undo.c: * src/unexelf.c: * src/window.c: * src/xfaces.c: * src/xfns.c: * src/xfont.c: * src/xftfont.c: * src/xgselect.c: * src/xmenu.c: * src/xrdb.c: * src/xselect.c: * src/xsettings.c: * src/xsmfns.c: * src/xterm.c: Likewise.
Diffstat (limited to 'src/xfont.c')
-rw-r--r--src/xfont.c53
1 files changed, 14 insertions, 39 deletions
diff --git a/src/xfont.c b/src/xfont.c
index 8a1d960343c..b1e793de808 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -55,9 +55,7 @@ static XCharStruct *xfont_get_pcm (XFontStruct *, XChar2b *);
55 is not contained in the font. */ 55 is not contained in the font. */
56 56
57static XCharStruct * 57static XCharStruct *
58xfont_get_pcm (xfont, char2b) 58xfont_get_pcm (XFontStruct *xfont, XChar2b *char2b)
59 XFontStruct *xfont;
60 XChar2b *char2b;
61{ 59{
62 /* The result metric information. */ 60 /* The result metric information. */
63 XCharStruct *pcm = NULL; 61 XCharStruct *pcm = NULL;
@@ -159,8 +157,7 @@ struct font_driver xfont_driver =
159extern Lisp_Object QCname; 157extern Lisp_Object QCname;
160 158
161static Lisp_Object 159static Lisp_Object
162xfont_get_cache (f) 160xfont_get_cache (FRAME_PTR f)
163 FRAME_PTR f;
164{ 161{
165 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 162 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
166 163
@@ -497,8 +494,7 @@ xfont_list_pattern (Display *display, char *pattern,
497} 494}
498 495
499static Lisp_Object 496static Lisp_Object
500xfont_list (frame, spec) 497xfont_list (Lisp_Object frame, Lisp_Object spec)
501 Lisp_Object frame, spec;
502{ 498{
503 FRAME_PTR f = XFRAME (frame); 499 FRAME_PTR f = XFRAME (frame);
504 Display *display = FRAME_X_DISPLAY_INFO (f)->display; 500 Display *display = FRAME_X_DISPLAY_INFO (f)->display;
@@ -577,8 +573,7 @@ xfont_list (frame, spec)
577} 573}
578 574
579static Lisp_Object 575static Lisp_Object
580xfont_match (frame, spec) 576xfont_match (Lisp_Object frame, Lisp_Object spec)
581 Lisp_Object frame, spec;
582{ 577{
583 FRAME_PTR f = XFRAME (frame); 578 FRAME_PTR f = XFRAME (frame);
584 Display *display = FRAME_X_DISPLAY_INFO (f)->display; 579 Display *display = FRAME_X_DISPLAY_INFO (f)->display;
@@ -636,8 +631,7 @@ xfont_match (frame, spec)
636} 631}
637 632
638static Lisp_Object 633static Lisp_Object
639xfont_list_family (frame) 634xfont_list_family (Lisp_Object frame)
640 Lisp_Object frame;
641{ 635{
642 FRAME_PTR f = XFRAME (frame); 636 FRAME_PTR f = XFRAME (frame);
643 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 637 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
@@ -696,10 +690,7 @@ xfont_list_family (frame)
696extern Lisp_Object QCavgwidth; 690extern Lisp_Object QCavgwidth;
697 691
698static Lisp_Object 692static Lisp_Object
699xfont_open (f, entity, pixel_size) 693xfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size)
700 FRAME_PTR f;
701 Lisp_Object entity;
702 int pixel_size;
703{ 694{
704 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 695 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
705 Display *display = dpyinfo->display; 696 Display *display = dpyinfo->display;
@@ -911,9 +902,7 @@ xfont_open (f, entity, pixel_size)
911} 902}
912 903
913static void 904static void
914xfont_close (f, font) 905xfont_close (FRAME_PTR f, struct font *font)
915 FRAME_PTR f;
916 struct font *font;
917{ 906{
918 BLOCK_INPUT; 907 BLOCK_INPUT;
919 XFreeFont (FRAME_X_DISPLAY (f), ((struct xfont_info *) font)->xfont); 908 XFreeFont (FRAME_X_DISPLAY (f), ((struct xfont_info *) font)->xfont);
@@ -921,9 +910,7 @@ xfont_close (f, font)
921} 910}
922 911
923static int 912static int
924xfont_prepare_face (f, face) 913xfont_prepare_face (FRAME_PTR f, struct face *face)
925 FRAME_PTR f;
926 struct face *face;
927{ 914{
928 BLOCK_INPUT; 915 BLOCK_INPUT;
929 XSetFont (FRAME_X_DISPLAY (f), face->gc, 916 XSetFont (FRAME_X_DISPLAY (f), face->gc,
@@ -934,9 +921,7 @@ xfont_prepare_face (f, face)
934} 921}
935 922
936static int 923static int
937xfont_has_char (font, c) 924xfont_has_char (Lisp_Object font, int c)
938 Lisp_Object font;
939 int c;
940{ 925{
941 Lisp_Object registry = AREF (font, FONT_REGISTRY_INDEX); 926 Lisp_Object registry = AREF (font, FONT_REGISTRY_INDEX);
942 struct charset *encoding; 927 struct charset *encoding;
@@ -965,9 +950,7 @@ xfont_has_char (font, c)
965} 950}
966 951
967static unsigned 952static unsigned
968xfont_encode_char (font, c) 953xfont_encode_char (struct font *font, int c)
969 struct font *font;
970 int c;
971{ 954{
972 XFontStruct *xfont = ((struct xfont_info *) font)->xfont; 955 XFontStruct *xfont = ((struct xfont_info *) font)->xfont;
973 struct charset *charset; 956 struct charset *charset;
@@ -990,11 +973,7 @@ xfont_encode_char (font, c)
990} 973}
991 974
992static int 975static int
993xfont_text_extents (font, code, nglyphs, metrics) 976xfont_text_extents (struct font *font, unsigned int *code, int nglyphs, struct font_metrics *metrics)
994 struct font *font;
995 unsigned *code;
996 int nglyphs;
997 struct font_metrics *metrics;
998{ 977{
999 XFontStruct *xfont = ((struct xfont_info *) font)->xfont; 978 XFontStruct *xfont = ((struct xfont_info *) font)->xfont;
1000 int width = 0; 979 int width = 0;
@@ -1046,9 +1025,7 @@ xfont_text_extents (font, code, nglyphs, metrics)
1046} 1025}
1047 1026
1048static int 1027static int
1049xfont_draw (s, from, to, x, y, with_background) 1028xfont_draw (struct glyph_string *s, int from, int to, int x, int y, int with_background)
1050 struct glyph_string *s;
1051 int from, to, x, y, with_background;
1052{ 1029{
1053 XFontStruct *xfont = ((struct xfont_info *) s->font)->xfont; 1030 XFontStruct *xfont = ((struct xfont_info *) s->font)->xfont;
1054 int len = to - from; 1031 int len = to - from;
@@ -1123,9 +1100,7 @@ xfont_draw (s, from, to, x, y, with_background)
1123} 1100}
1124 1101
1125static int 1102static int
1126xfont_check (f, font) 1103xfont_check (FRAME_PTR f, struct font *font)
1127 FRAME_PTR f;
1128 struct font *font;
1129{ 1104{
1130 struct xfont_info *xfont = (struct xfont_info *) font; 1105 struct xfont_info *xfont = (struct xfont_info *) font;
1131 1106
@@ -1134,7 +1109,7 @@ xfont_check (f, font)
1134 1109
1135 1110
1136void 1111void
1137syms_of_xfont () 1112syms_of_xfont (void)
1138{ 1113{
1139 staticpro (&xfont_scripts_cache); 1114 staticpro (&xfont_scripts_cache);
1140 { /* Here we rely on the fact that syms_of_xfont (via syms_of_font) 1115 { /* Here we rely on the fact that syms_of_xfont (via syms_of_font)