Mercurial > hg > xemacs-beta
comparison src/redisplay-x.c @ 647:b39c14581166
[xemacs-hg @ 2001-08-13 04:45:47 by ben]
removal of unsigned, size_t, etc.
author | ben |
---|---|
date | Mon, 13 Aug 2001 04:46:48 +0000 |
parents | 98528da0b7fc |
children | 6e99cc8c6ca5 |
comparison
equal
deleted
inserted
replaced
646:00c54252fe4f | 647:b39c14581166 |
---|---|
969 runs[i].len); | 969 runs[i].len); |
970 | 970 |
971 /* We draw underlines in the same color as the text. */ | 971 /* We draw underlines in the same color as the text. */ |
972 if (cachel->underline) | 972 if (cachel->underline) |
973 { | 973 { |
974 unsigned long upos, uthick; | 974 int upos, uthick; |
975 unsigned long upos_ext, uthick_ext; | |
975 XFontStruct *xfont; | 976 XFontStruct *xfont; |
976 | 977 |
977 xfont = FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font)); | 978 xfont = FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font)); |
978 if (!XGetFontProperty (xfont, XA_UNDERLINE_POSITION, &upos)) | 979 if (!XGetFontProperty (xfont, XA_UNDERLINE_POSITION, &upos_ext)) |
979 upos = dl->descent / 2; | 980 upos = dl->descent / 2; |
980 if (!XGetFontProperty (xfont, XA_UNDERLINE_THICKNESS, &uthick)) | 981 else |
982 upos = (int) upos_ext; | |
983 if (!XGetFontProperty (xfont, XA_UNDERLINE_THICKNESS, &uthick_ext)) | |
981 uthick = 1; | 984 uthick = 1; |
985 else | |
986 uthick = (int) uthick_ext; | |
982 | 987 |
983 if (dl->ypos + upos < dl->ypos + dl->descent - dl->clip) | 988 if (dl->ypos + upos < dl->ypos + dl->descent - dl->clip) |
984 { | 989 { |
985 if (dl->ypos + upos + uthick > dl->ypos + dl->descent - dl->clip) | 990 if (dl->ypos + upos + uthick > dl->ypos + dl->descent - dl->clip) |
986 uthick = dl->descent - dl->clip - upos; | 991 uthick = dl->descent - dl->clip - upos; |
996 dl->ypos + upos, this_width, uthick); | 1001 dl->ypos + upos, this_width, uthick); |
997 } | 1002 } |
998 } | 1003 } |
999 } | 1004 } |
1000 | 1005 |
1001 if (cachel->strikethru) { | 1006 if (cachel->strikethru) |
1002 unsigned long ascent,descent,upos, uthick; | 1007 { |
1003 XFontStruct *xfont; | 1008 int ascent, descent, upos, uthick; |
1004 | 1009 unsigned long ascent_ext, descent_ext, uthick_ext; |
1005 xfont = FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font)); | 1010 XFontStruct *xfont; |
1006 | 1011 |
1007 if (!XGetFontProperty (xfont, XA_STRIKEOUT_ASCENT, &ascent)) | 1012 xfont = FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font)); |
1008 ascent = xfont->ascent; | 1013 |
1009 if (!XGetFontProperty (xfont, XA_STRIKEOUT_DESCENT, &descent)) | 1014 if (!XGetFontProperty (xfont, XA_STRIKEOUT_ASCENT, &ascent_ext)) |
1010 descent = xfont->descent; | 1015 ascent = xfont->ascent; |
1011 if (!XGetFontProperty (xfont, XA_UNDERLINE_THICKNESS, &uthick)) | 1016 else |
1012 uthick = 1; | 1017 ascent = (int) ascent_ext; |
1013 | 1018 if (!XGetFontProperty (xfont, XA_STRIKEOUT_DESCENT, &descent_ext)) |
1014 upos = ascent - ((ascent + descent) / 2) + 1; | 1019 descent = xfont->descent; |
1015 | 1020 else |
1016 /* Generally, upos will be positive (above the baseline),so subtract */ | 1021 descent = (int) descent_ext; |
1017 if (dl->ypos - upos < dl->ypos + dl->descent - dl->clip) | 1022 if (!XGetFontProperty (xfont, XA_UNDERLINE_THICKNESS, &uthick_ext)) |
1018 { | 1023 uthick = 1; |
1019 if (dl->ypos - upos + uthick > dl->ypos + dl->descent - dl->clip) | 1024 else |
1020 uthick = dl->descent - dl->clip + upos; | 1025 uthick = (int) uthick_ext; |
1021 | 1026 |
1022 if (uthick == 1) | 1027 upos = ascent - ((ascent + descent) / 2) + 1; |
1023 { | 1028 |
1029 /* Generally, upos will be positive (above the baseline),so | |
1030 subtract */ | |
1031 if (dl->ypos - upos < dl->ypos + dl->descent - dl->clip) | |
1032 { | |
1033 if (dl->ypos - upos + uthick > dl->ypos + dl->descent - dl->clip) | |
1034 uthick = dl->descent - dl->clip + upos; | |
1035 | |
1036 if (uthick == 1) | |
1024 XDrawLine (dpy, x_win, gc, xpos, dl->ypos - upos, | 1037 XDrawLine (dpy, x_win, gc, xpos, dl->ypos - upos, |
1025 xpos + this_width, dl->ypos - upos); | 1038 xpos + this_width, dl->ypos - upos); |
1026 } | 1039 else if (uthick > 1) |
1027 else if (uthick > 1) | |
1028 { | |
1029 XFillRectangle (dpy, x_win, gc, xpos, dl->ypos + upos, | 1040 XFillRectangle (dpy, x_win, gc, xpos, dl->ypos + upos, |
1030 this_width, uthick); | 1041 this_width, uthick); |
1031 } | 1042 } |
1032 } | 1043 } |
1033 } | |
1034 | 1044 |
1035 /* Restore the GC */ | 1045 /* Restore the GC */ |
1036 if (need_clipping) | 1046 if (need_clipping) |
1037 { | 1047 { |
1038 XSetClipMask (dpy, gc, None); | 1048 XSetClipMask (dpy, gc, None); |
1299 GC background_gc; | 1309 GC background_gc; |
1300 enum edge_style style; | 1310 enum edge_style style; |
1301 | 1311 |
1302 unsigned long mask; | 1312 unsigned long mask; |
1303 int x, y1, y2, width, shadow_thickness, spacing, line_width; | 1313 int x, y1, y2, width, shadow_thickness, spacing, line_width; |
1304 face_index div_face = get_builtin_face_cache_index (w, Vvertical_divider_face); | 1314 face_index div_face = |
1315 get_builtin_face_cache_index (w, Vvertical_divider_face); | |
1305 | 1316 |
1306 width = window_divider_width (w); | 1317 width = window_divider_width (w); |
1307 shadow_thickness = XINT (w->vertical_divider_shadow_thickness); | 1318 shadow_thickness = XINT (w->vertical_divider_shadow_thickness); |
1308 spacing = XINT (w->vertical_divider_spacing); | 1319 spacing = XINT (w->vertical_divider_spacing); |
1309 line_width = XINT (w->vertical_divider_line_width); | 1320 line_width = XINT (w->vertical_divider_line_width); |