diff options
| author | Jason Rumney | 2008-06-26 10:48:28 +0000 |
|---|---|---|
| committer | Jason Rumney | 2008-06-26 10:48:28 +0000 |
| commit | 1b5defe6580487f499c0af4a598ee968c5cae062 (patch) | |
| tree | fda3244a1c6bcaac61eda98d5429d2d6599ddb57 /src/w32term.c | |
| parent | dc018447584eecaf2de92eef2ec3c9f60c5f818f (diff) | |
| download | emacs-1b5defe6580487f499c0af4a598ee968c5cae062.tar.gz emacs-1b5defe6580487f499c0af4a598ee968c5cae062.zip | |
* w32bdf.c, w32bdf.h: Remove obsolete files.
* makefile.w32-in: Remove refs to w32bdf.h and w32bdf.c.
* w32gui.h: Don't include w32bdf.h.
(XCharStruct, enum w32_char_font_type, W32FontStruct):
Remove obsolete font support.
* w32font.h (struct w32font_info): Remove compat_w32_font.
Add hfont member.
(FONT_COMPAT): Remove obsolete macro.
* w32font.c (w32font_close): Remove compat code. Delete hfont member.
(w32font_encode_char, w32font_text_extents): Use new hfont member.
(w32font_open_internal): Remove compat code. Set new hfont member.
(Fx_select_font): Use new hfont member.
* w32uniscribe.c (uniscribe_otf_capability, uniscribe_shape):
(uniscribe_encode_char): Use new hfont member.
* w32term.c (x_draw_glyph_string_foreground):
(x_draw_composite_glyph_string_foreground): Use new hfont member.
(x_draw_glyph_string): Use metrics in w32font_info.
Diffstat (limited to 'src/w32term.c')
| -rw-r--r-- | src/w32term.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/w32term.c b/src/w32term.c index 770369454ed..57662051302 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -251,8 +251,6 @@ void x_set_window_size P_ ((struct frame *, int, int, int)); | |||
| 251 | void x_wm_set_window_state P_ ((struct frame *, int)); | 251 | void x_wm_set_window_state P_ ((struct frame *, int)); |
| 252 | void x_wm_set_icon_pixmap P_ ((struct frame *, int)); | 252 | void x_wm_set_icon_pixmap P_ ((struct frame *, int)); |
| 253 | static void w32_initialize P_ ((void)); | 253 | static void w32_initialize P_ ((void)); |
| 254 | static void x_font_min_bounds P_ ((XFontStruct *, int *, int *)); | ||
| 255 | int x_compute_min_glyph_bounds P_ ((struct frame *)); | ||
| 256 | static void x_update_end P_ ((struct frame *)); | 254 | static void x_update_end P_ ((struct frame *)); |
| 257 | static void w32_frame_up_to_date P_ ((struct frame *)); | 255 | static void w32_frame_up_to_date P_ ((struct frame *)); |
| 258 | static void w32_set_terminal_modes P_ ((struct terminal *)); | 256 | static void w32_set_terminal_modes P_ ((struct terminal *)); |
| @@ -1239,6 +1237,7 @@ x_draw_glyph_string_foreground (s) | |||
| 1239 | struct glyph_string *s; | 1237 | struct glyph_string *s; |
| 1240 | { | 1238 | { |
| 1241 | int i, x; | 1239 | int i, x; |
| 1240 | struct w32font_info * w32_font; | ||
| 1242 | HFONT old_font; | 1241 | HFONT old_font; |
| 1243 | 1242 | ||
| 1244 | /* If first glyph of S has a left box line, start drawing the text | 1243 | /* If first glyph of S has a left box line, start drawing the text |
| @@ -1259,8 +1258,10 @@ x_draw_glyph_string_foreground (s) | |||
| 1259 | SetBkColor (s->hdc, s->gc->background); | 1258 | SetBkColor (s->hdc, s->gc->background); |
| 1260 | SetTextAlign (s->hdc, TA_BASELINE | TA_LEFT); | 1259 | SetTextAlign (s->hdc, TA_BASELINE | TA_LEFT); |
| 1261 | 1260 | ||
| 1262 | if (s->font && FONT_COMPAT (s->font)->hfont) | 1261 | w32_font = (struct w32font_info *) s->font; |
| 1263 | old_font = SelectObject (s->hdc, FONT_COMPAT (s->font)->hfont); | 1262 | |
| 1263 | if (w32_font && w32_font->hfont) | ||
| 1264 | old_font = SelectObject (s->hdc, w32_font->hfont); | ||
| 1264 | 1265 | ||
| 1265 | /* Draw characters of S as rectangles if S's font could not be | 1266 | /* Draw characters of S as rectangles if S's font could not be |
| 1266 | loaded. */ | 1267 | loaded. */ |
| @@ -1278,7 +1279,6 @@ x_draw_glyph_string_foreground (s) | |||
| 1278 | else | 1279 | else |
| 1279 | { | 1280 | { |
| 1280 | int boff = s->font->baseline_offset; | 1281 | int boff = s->font->baseline_offset; |
| 1281 | struct font *font = s->font; | ||
| 1282 | int y; | 1282 | int y; |
| 1283 | 1283 | ||
| 1284 | if (s->font->vertical_centering) | 1284 | if (s->font->vertical_centering) |
| @@ -1287,14 +1287,14 @@ x_draw_glyph_string_foreground (s) | |||
| 1287 | y = s->ybase - boff; | 1287 | y = s->ybase - boff; |
| 1288 | if (s->for_overlaps | 1288 | if (s->for_overlaps |
| 1289 | || (s->background_filled_p && s->hl != DRAW_CURSOR)) | 1289 | || (s->background_filled_p && s->hl != DRAW_CURSOR)) |
| 1290 | font->driver->draw (s, 0, s->nchars, x, y, 0); | 1290 | s->font->driver->draw (s, 0, s->nchars, x, y, 0); |
| 1291 | else | 1291 | else |
| 1292 | font->driver->draw (s, 0, s->nchars, x, y, 1); | 1292 | s->font->driver->draw (s, 0, s->nchars, x, y, 1); |
| 1293 | if (s->face->overstrike) | 1293 | if (s->face->overstrike) |
| 1294 | font->driver->draw (s, 0, s->nchars, x + 1, y, 0); | 1294 | s->font->driver->draw (s, 0, s->nchars, x + 1, y, 0); |
| 1295 | } | 1295 | } |
| 1296 | 1296 | ||
| 1297 | if (s->font && FONT_COMPAT (s->font)->hfont) | 1297 | if (w32_font && w32_font->hfont) |
| 1298 | SelectObject (s->hdc, old_font); | 1298 | SelectObject (s->hdc, old_font); |
| 1299 | } | 1299 | } |
| 1300 | 1300 | ||
| @@ -1306,6 +1306,7 @@ x_draw_composite_glyph_string_foreground (s) | |||
| 1306 | { | 1306 | { |
| 1307 | int i, j, x; | 1307 | int i, j, x; |
| 1308 | HFONT old_font; | 1308 | HFONT old_font; |
| 1309 | struct w32font_info * w32_font; | ||
| 1309 | 1310 | ||
| 1310 | /* If first glyph of S has a left box line, start drawing the text | 1311 | /* If first glyph of S has a left box line, start drawing the text |
| 1311 | of S to the right of that box line. */ | 1312 | of S to the right of that box line. */ |
| @@ -1325,8 +1326,10 @@ x_draw_composite_glyph_string_foreground (s) | |||
| 1325 | SetBkMode (s->hdc, TRANSPARENT); | 1326 | SetBkMode (s->hdc, TRANSPARENT); |
| 1326 | SetTextAlign (s->hdc, TA_BASELINE | TA_LEFT); | 1327 | SetTextAlign (s->hdc, TA_BASELINE | TA_LEFT); |
| 1327 | 1328 | ||
| 1328 | if (s->font && FONT_COMPAT (s->font)->hfont) | 1329 | w32_font = (struct w32font_info *) s->font; |
| 1329 | old_font = SelectObject (s->hdc, FONT_COMPAT (s->font)->hfont); | 1330 | |
| 1331 | if (w32_font && w32_font->hfont) | ||
| 1332 | old_font = SelectObject (s->hdc, w32_font->hfont); | ||
| 1330 | 1333 | ||
| 1331 | /* Draw a rectangle for the composition if the font for the very | 1334 | /* Draw a rectangle for the composition if the font for the very |
| 1332 | first character of the composition could not be loaded. */ | 1335 | first character of the composition could not be loaded. */ |
| @@ -1392,7 +1395,7 @@ x_draw_composite_glyph_string_foreground (s) | |||
| 1392 | } | 1395 | } |
| 1393 | } | 1396 | } |
| 1394 | 1397 | ||
| 1395 | if (s->font && FONT_COMPAT (s->font)->hfont) | 1398 | if (w32_font && w32_font->hfont) |
| 1396 | SelectObject (s->hdc, old_font); | 1399 | SelectObject (s->hdc, old_font); |
| 1397 | } | 1400 | } |
| 1398 | 1401 | ||
| @@ -2342,7 +2345,7 @@ x_draw_glyph_string (s) | |||
| 2342 | 2345 | ||
| 2343 | /* Draw strike-through. */ | 2346 | /* Draw strike-through. */ |
| 2344 | if (s->face->strike_through_p | 2347 | if (s->face->strike_through_p |
| 2345 | && !FONT_COMPAT (s->font)->tm.tmStruckOut) | 2348 | && !((struct w32font_info *) s->font)->metrics.tmStruckOut) |
| 2346 | { | 2349 | { |
| 2347 | unsigned long h = 1; | 2350 | unsigned long h = 1; |
| 2348 | unsigned long dy = (s->height - h) / 2; | 2351 | unsigned long dy = (s->height - h) / 2; |