diff options
| author | Geoff Voelker | 1995-11-07 07:14:59 +0000 |
|---|---|---|
| committer | Geoff Voelker | 1995-11-07 07:14:59 +0000 |
| commit | fd2e066a8654cbf5527224894f27d84b20f5ce5a (patch) | |
| tree | 57f45896f09dd83dc6d5c6db95799fb7c9dc24b9 /src | |
| parent | 497fbd42da3c4f7f98e3c02c853f17459883a279 (diff) | |
| download | emacs-fd2e066a8654cbf5527224894f27d84b20f5ce5a.tar.gz emacs-fd2e066a8654cbf5527224894f27d84b20f5ce5a.zip | |
[HAVE_NTGUI]: Include w32term.h.
Include dispextern.h before cm.h since dispextern.h includes windows.h.
[HAVE_NTGUI] (make_frame_glyphs, free_frame_glyphs, scroll_frame_lines,
update_frame, update_line): Test for WIN32 frame.
[HAVE_NTGUI] (init_display): Initialize WIN32 window system.
Use HAVE_WINDOW_SYSTEM instead of testing for specific window systems.
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispnew.c | 78 |
1 files changed, 48 insertions, 30 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index 166d7b9fb37..dbedca2a817 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -29,8 +29,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 29 | #include "termchar.h" | 29 | #include "termchar.h" |
| 30 | #include "termopts.h" | 30 | #include "termopts.h" |
| 31 | #include "termhooks.h" | 31 | #include "termhooks.h" |
| 32 | #ifdef HAVE_NTGUI | ||
| 33 | #include "dispextern.h" | ||
| 34 | #include "cm.h" | ||
| 35 | #else | ||
| 32 | #include "cm.h" | 36 | #include "cm.h" |
| 33 | #include "dispextern.h" | 37 | #include "dispextern.h" |
| 38 | #endif /* HAVE_NTGUI */ | ||
| 34 | #include "buffer.h" | 39 | #include "buffer.h" |
| 35 | #include "frame.h" | 40 | #include "frame.h" |
| 36 | #include "window.h" | 41 | #include "window.h" |
| @@ -46,6 +51,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 46 | #include "xterm.h" | 51 | #include "xterm.h" |
| 47 | #endif /* HAVE_X_WINDOWS */ | 52 | #endif /* HAVE_X_WINDOWS */ |
| 48 | 53 | ||
| 54 | #ifdef HAVE_NTGUI | ||
| 55 | #include "w32term.h" | ||
| 56 | #endif /* HAVE_NTGUI */ | ||
| 57 | |||
| 49 | /* Include systime.h after xterm.h to avoid double inclusion of time.h. */ | 58 | /* Include systime.h after xterm.h to avoid double inclusion of time.h. */ |
| 50 | #include "systime.h" | 59 | #include "systime.h" |
| 51 | 60 | ||
| @@ -271,8 +280,8 @@ make_frame_glyphs (frame, empty) | |||
| 271 | bzero (new->enable, height * sizeof (char)); | 280 | bzero (new->enable, height * sizeof (char)); |
| 272 | new->bufp = (int *) xmalloc (height * sizeof (int)); | 281 | new->bufp = (int *) xmalloc (height * sizeof (int)); |
| 273 | 282 | ||
| 274 | #ifdef HAVE_X_WINDOWS | 283 | #ifdef HAVE_WINDOW_SYSTEM |
| 275 | if (FRAME_X_P (frame)) | 284 | if (FRAME_WINDOW_P (frame)) |
| 276 | { | 285 | { |
| 277 | new->top_left_x = (short *) xmalloc (height * sizeof (short)); | 286 | new->top_left_x = (short *) xmalloc (height * sizeof (short)); |
| 278 | new->top_left_y = (short *) xmalloc (height * sizeof (short)); | 287 | new->top_left_y = (short *) xmalloc (height * sizeof (short)); |
| @@ -280,7 +289,7 @@ make_frame_glyphs (frame, empty) | |||
| 280 | new->pix_height = (short *) xmalloc (height * sizeof (short)); | 289 | new->pix_height = (short *) xmalloc (height * sizeof (short)); |
| 281 | new->max_ascent = (short *) xmalloc (height * sizeof (short)); | 290 | new->max_ascent = (short *) xmalloc (height * sizeof (short)); |
| 282 | } | 291 | } |
| 283 | #endif | 292 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 284 | 293 | ||
| 285 | if (empty) | 294 | if (empty) |
| 286 | { | 295 | { |
| @@ -345,8 +354,8 @@ free_frame_glyphs (frame, glyphs) | |||
| 345 | if (glyphs->charstarts) | 354 | if (glyphs->charstarts) |
| 346 | xfree (glyphs->charstarts); | 355 | xfree (glyphs->charstarts); |
| 347 | 356 | ||
| 348 | #ifdef HAVE_X_WINDOWS | 357 | #ifdef HAVE_WINDOW_SYSTEM |
| 349 | if (FRAME_X_P (frame)) | 358 | if (FRAME_WINDOW_P (frame)) |
| 350 | { | 359 | { |
| 351 | xfree (glyphs->top_left_x); | 360 | xfree (glyphs->top_left_x); |
| 352 | xfree (glyphs->top_left_y); | 361 | xfree (glyphs->top_left_y); |
| @@ -354,7 +363,7 @@ free_frame_glyphs (frame, glyphs) | |||
| 354 | xfree (glyphs->pix_height); | 363 | xfree (glyphs->pix_height); |
| 355 | xfree (glyphs->max_ascent); | 364 | xfree (glyphs->max_ascent); |
| 356 | } | 365 | } |
| 357 | #endif | 366 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 358 | 367 | ||
| 359 | xfree (glyphs); | 368 | xfree (glyphs); |
| 360 | } | 369 | } |
| @@ -718,8 +727,8 @@ scroll_frame_lines (frame, from, end, amount, newpos) | |||
| 718 | current_frame->bufp + from + amount, | 727 | current_frame->bufp + from + amount, |
| 719 | (end - from) * sizeof current_frame->bufp[0]); | 728 | (end - from) * sizeof current_frame->bufp[0]); |
| 720 | 729 | ||
| 721 | #ifdef HAVE_X_WINDOWS | 730 | #ifdef HAVE_WINDOW_SYSTEM |
| 722 | if (FRAME_X_P (frame)) | 731 | if (FRAME_WINDOW_P (frame)) |
| 723 | { | 732 | { |
| 724 | safe_bcopy (current_frame->top_left_x + from, | 733 | safe_bcopy (current_frame->top_left_x + from, |
| 725 | current_frame->top_left_x + from + amount, | 734 | current_frame->top_left_x + from + amount, |
| @@ -741,7 +750,7 @@ scroll_frame_lines (frame, from, end, amount, newpos) | |||
| 741 | current_frame->max_ascent + from + amount, | 750 | current_frame->max_ascent + from + amount, |
| 742 | (end - from) * sizeof current_frame->max_ascent[0]); | 751 | (end - from) * sizeof current_frame->max_ascent[0]); |
| 743 | } | 752 | } |
| 744 | #endif /* HAVE_X_WINDOWS */ | 753 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 745 | 754 | ||
| 746 | update_end (frame); | 755 | update_end (frame); |
| 747 | } | 756 | } |
| @@ -814,8 +823,8 @@ scroll_frame_lines (frame, from, end, amount, newpos) | |||
| 814 | current_frame->bufp + from + amount, | 823 | current_frame->bufp + from + amount, |
| 815 | (end - from) * sizeof current_frame->bufp[0]); | 824 | (end - from) * sizeof current_frame->bufp[0]); |
| 816 | 825 | ||
| 817 | #ifdef HAVE_X_WINDOWS | 826 | #ifdef HAVE_WINDOW_SYSTEM |
| 818 | if (FRAME_X_P (frame)) | 827 | if (FRAME_WINDOW_P (frame)) |
| 819 | { | 828 | { |
| 820 | safe_bcopy (current_frame->top_left_x + from, | 829 | safe_bcopy (current_frame->top_left_x + from, |
| 821 | current_frame->top_left_x + from + amount, | 830 | current_frame->top_left_x + from + amount, |
| @@ -837,7 +846,7 @@ scroll_frame_lines (frame, from, end, amount, newpos) | |||
| 837 | current_frame->max_ascent + from + amount, | 846 | current_frame->max_ascent + from + amount, |
| 838 | (end - from) * sizeof current_frame->max_ascent[0]); | 847 | (end - from) * sizeof current_frame->max_ascent[0]); |
| 839 | } | 848 | } |
| 840 | #endif /* HAVE_X_WINDOWS */ | 849 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 841 | 850 | ||
| 842 | update_end (frame); | 851 | update_end (frame); |
| 843 | } | 852 | } |
| @@ -1110,7 +1119,7 @@ direct_output_for_insert (g) | |||
| 1110 | #ifdef HAVE_FACES | 1119 | #ifdef HAVE_FACES |
| 1111 | int dummy; | 1120 | int dummy; |
| 1112 | 1121 | ||
| 1113 | if (FRAME_X_P (frame)) | 1122 | if (FRAME_WINDOW_P (frame)) |
| 1114 | face = compute_char_face (frame, w, point - 1, -1, -1, &dummy, point, 0); | 1123 | face = compute_char_face (frame, w, point - 1, -1, -1, &dummy, point, 0); |
| 1115 | #endif | 1124 | #endif |
| 1116 | current_frame->glyphs[vpos][hpos] = MAKE_GLYPH (frame, g, face); | 1125 | current_frame->glyphs[vpos][hpos] = MAKE_GLYPH (frame, g, face); |
| @@ -1215,7 +1224,7 @@ update_frame (f, force, inhibit_hairy_id) | |||
| 1215 | int pause; | 1224 | int pause; |
| 1216 | int preempt_count = baud_rate / 2400 + 1; | 1225 | int preempt_count = baud_rate / 2400 + 1; |
| 1217 | extern input_pending; | 1226 | extern input_pending; |
| 1218 | #ifdef HAVE_X_WINDOWS | 1227 | #ifdef HAVE_WINDOW_SYSTEM |
| 1219 | register int downto, leftmost; | 1228 | register int downto, leftmost; |
| 1220 | #endif | 1229 | #endif |
| 1221 | 1230 | ||
| @@ -1258,21 +1267,21 @@ update_frame (f, force, inhibit_hairy_id) | |||
| 1258 | if (desired_frame->enable[FRAME_HEIGHT (f) - 1]) | 1267 | if (desired_frame->enable[FRAME_HEIGHT (f) - 1]) |
| 1259 | update_line (f, FRAME_HEIGHT (f) - 1); | 1268 | update_line (f, FRAME_HEIGHT (f) - 1); |
| 1260 | 1269 | ||
| 1261 | #ifdef HAVE_X_WINDOWS | 1270 | #ifdef HAVE_WINDOW_SYSTEM |
| 1262 | if (FRAME_X_P (f)) | 1271 | if (FRAME_WINDOW_P (f)) |
| 1263 | { | 1272 | { |
| 1264 | leftmost = downto = f->output_data.x->internal_border_width; | 1273 | leftmost = downto = FRAME_INTERNAL_BORDER_WIDTH (f); |
| 1265 | if (desired_frame->enable[0]) | 1274 | if (desired_frame->enable[0]) |
| 1266 | { | 1275 | { |
| 1267 | current_frame->top_left_x[FRAME_HEIGHT (f) - 1] = leftmost; | 1276 | current_frame->top_left_x[FRAME_HEIGHT (f) - 1] = leftmost; |
| 1268 | current_frame->top_left_y[FRAME_HEIGHT (f) - 1] | 1277 | current_frame->top_left_y[FRAME_HEIGHT (f) - 1] |
| 1269 | = PIXEL_HEIGHT (f) - f->output_data.x->internal_border_width | 1278 | = PIXEL_HEIGHT (f) - FRAME_INTERNAL_BORDER_WIDTH (f) |
| 1270 | - current_frame->pix_height[FRAME_HEIGHT (f) - 1]; | 1279 | - current_frame->pix_height[FRAME_HEIGHT (f) - 1]; |
| 1271 | current_frame->top_left_x[0] = leftmost; | 1280 | current_frame->top_left_x[0] = leftmost; |
| 1272 | current_frame->top_left_y[0] = downto; | 1281 | current_frame->top_left_y[0] = downto; |
| 1273 | } | 1282 | } |
| 1274 | } | 1283 | } |
| 1275 | #endif /* HAVE_X_WINDOWS */ | 1284 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 1276 | 1285 | ||
| 1277 | /* Now update the rest of the lines. */ | 1286 | /* Now update the rest of the lines. */ |
| 1278 | for (i = 0; i < FRAME_HEIGHT (f) - 1 && (force || !input_pending); i++) | 1287 | for (i = 0; i < FRAME_HEIGHT (f) - 1 && (force || !input_pending); i++) |
| @@ -1308,19 +1317,19 @@ update_frame (f, force, inhibit_hairy_id) | |||
| 1308 | } | 1317 | } |
| 1309 | 1318 | ||
| 1310 | update_line (f, i); | 1319 | update_line (f, i); |
| 1311 | #ifdef HAVE_X_WINDOWS | 1320 | #ifdef HAVE_WINDOW_SYSTEM |
| 1312 | if (FRAME_X_P (f)) | 1321 | if (FRAME_WINDOW_P (f)) |
| 1313 | { | 1322 | { |
| 1314 | current_frame->top_left_y[i] = downto; | 1323 | current_frame->top_left_y[i] = downto; |
| 1315 | current_frame->top_left_x[i] = leftmost; | 1324 | current_frame->top_left_x[i] = leftmost; |
| 1316 | } | 1325 | } |
| 1317 | #endif /* HAVE_X_WINDOWS */ | 1326 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 1318 | } | 1327 | } |
| 1319 | 1328 | ||
| 1320 | #ifdef HAVE_X_WINDOWS | 1329 | #ifdef HAVE_WINDOW_SYSTEM |
| 1321 | if (FRAME_X_P (f)) | 1330 | if (FRAME_WINDOW_P (f)) |
| 1322 | downto += current_frame->pix_height[i]; | 1331 | downto += current_frame->pix_height[i]; |
| 1323 | #endif | 1332 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 1324 | } | 1333 | } |
| 1325 | pause = (i < FRAME_HEIGHT (f) - 1) ? i : 0; | 1334 | pause = (i < FRAME_HEIGHT (f) - 1) ? i : 0; |
| 1326 | 1335 | ||
| @@ -1624,16 +1633,16 @@ update_line (frame, vpos) | |||
| 1624 | current_frame->highlight[vpos] = desired_frame->highlight[vpos]; | 1633 | current_frame->highlight[vpos] = desired_frame->highlight[vpos]; |
| 1625 | current_frame->bufp[vpos] = desired_frame->bufp[vpos]; | 1634 | current_frame->bufp[vpos] = desired_frame->bufp[vpos]; |
| 1626 | 1635 | ||
| 1627 | #ifdef HAVE_X_WINDOWS | 1636 | #ifdef HAVE_WINDOW_SYSTEM |
| 1628 | if (FRAME_X_P (frame)) | 1637 | if (FRAME_WINDOW_P (frame)) |
| 1629 | { | 1638 | { |
| 1630 | current_frame->pix_width[vpos] | 1639 | current_frame->pix_width[vpos] |
| 1631 | = current_frame->used[vpos] | 1640 | = current_frame->used[vpos] |
| 1632 | * FONT_WIDTH (frame->output_data.x->font); | 1641 | * FONT_WIDTH (FRAME_FONT (frame)); |
| 1633 | current_frame->pix_height[vpos] | 1642 | current_frame->pix_height[vpos] |
| 1634 | = frame->output_data.x->line_height; | 1643 | = FRAME_LINE_HEIGHT (frame); |
| 1635 | } | 1644 | } |
| 1636 | #endif /* HAVE_X_WINDOWS */ | 1645 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 1637 | 1646 | ||
| 1638 | if (!desired_frame->enable[vpos]) | 1647 | if (!desired_frame->enable[vpos]) |
| 1639 | { | 1648 | { |
| @@ -2492,6 +2501,15 @@ init_display () | |||
| 2492 | } | 2501 | } |
| 2493 | #endif /* HAVE_X_WINDOWS */ | 2502 | #endif /* HAVE_X_WINDOWS */ |
| 2494 | 2503 | ||
| 2504 | #ifdef HAVE_NTGUI | ||
| 2505 | if (!inhibit_window_system) | ||
| 2506 | { | ||
| 2507 | Vwindow_system = intern ("win32"); | ||
| 2508 | Vwindow_system_version = make_number (1); | ||
| 2509 | return; | ||
| 2510 | } | ||
| 2511 | #endif /* HAVE_NTGUI */ | ||
| 2512 | |||
| 2495 | /* If no window system has been specified, try to use the terminal. */ | 2513 | /* If no window system has been specified, try to use the terminal. */ |
| 2496 | if (! isatty (0)) | 2514 | if (! isatty (0)) |
| 2497 | { | 2515 | { |