Mercurial > emacs
comparison src/xterm.c @ 12667:a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 25 Jul 1995 21:55:50 +0000 |
parents | 05b7a5d25df6 |
children | 7e5276da6270 |
comparison
equal
deleted
inserted
replaced
12666:47630952226e | 12667:a3466dad7d6d |
---|---|
579 /* The cursor overrides stippling. */ | 579 /* The cursor overrides stippling. */ |
580 stippled = 0; | 580 stippled = 0; |
581 | 581 |
582 if ((!face->font | 582 if ((!face->font |
583 || face->font == (XFontStruct *) FACE_DEFAULT | 583 || face->font == (XFontStruct *) FACE_DEFAULT |
584 || face->font == f->display.x->font) | 584 || face->font == f->output_data.x->font) |
585 && face->background == f->display.x->background_pixel | 585 && face->background == f->output_data.x->background_pixel |
586 && face->foreground == f->display.x->foreground_pixel) | 586 && face->foreground == f->output_data.x->foreground_pixel) |
587 { | 587 { |
588 gc = f->display.x->cursor_gc; | 588 gc = f->output_data.x->cursor_gc; |
589 } | 589 } |
590 /* Cursor on non-default face: must merge. */ | 590 /* Cursor on non-default face: must merge. */ |
591 else | 591 else |
592 { | 592 { |
593 XGCValues xgcv; | 593 XGCValues xgcv; |
594 unsigned long mask; | 594 unsigned long mask; |
595 | 595 |
596 xgcv.background = f->display.x->cursor_pixel; | 596 xgcv.background = f->output_data.x->cursor_pixel; |
597 xgcv.foreground = face->background; | 597 xgcv.foreground = face->background; |
598 /* If the glyph would be invisible, | 598 /* If the glyph would be invisible, |
599 try a different foreground. */ | 599 try a different foreground. */ |
600 if (xgcv.foreground == xgcv.background) | 600 if (xgcv.foreground == xgcv.background) |
601 xgcv.foreground = face->foreground; | 601 xgcv.foreground = face->foreground; |
602 if (xgcv.foreground == xgcv.background) | 602 if (xgcv.foreground == xgcv.background) |
603 xgcv.foreground = f->display.x->cursor_foreground_pixel; | 603 xgcv.foreground = f->output_data.x->cursor_foreground_pixel; |
604 if (xgcv.foreground == xgcv.background) | 604 if (xgcv.foreground == xgcv.background) |
605 xgcv.foreground = face->foreground; | 605 xgcv.foreground = face->foreground; |
606 /* Make sure the cursor is distinct from text in this face. */ | 606 /* Make sure the cursor is distinct from text in this face. */ |
607 if (xgcv.background == face->background | 607 if (xgcv.background == face->background |
608 && xgcv.foreground == face->foreground) | 608 && xgcv.foreground == face->foreground) |
629 #endif | 629 #endif |
630 } | 630 } |
631 } | 631 } |
632 | 632 |
633 if (font == (XFontStruct *) FACE_DEFAULT) | 633 if (font == (XFontStruct *) FACE_DEFAULT) |
634 font = f->display.x->font; | 634 font = f->output_data.x->font; |
635 | 635 |
636 if (just_foreground) | 636 if (just_foreground) |
637 XDrawString (FRAME_X_DISPLAY (f), window, gc, | 637 XDrawString (FRAME_X_DISPLAY (f), window, gc, |
638 left, top + FONT_BASE (font), buf, len); | 638 left, top + FONT_BASE (font), buf, len); |
639 else | 639 else |
659 else | 659 else |
660 XDrawImageString (FRAME_X_DISPLAY (f), window, gc, | 660 XDrawImageString (FRAME_X_DISPLAY (f), window, gc, |
661 left, top + FONT_BASE (font), buf, len); | 661 left, top + FONT_BASE (font), buf, len); |
662 | 662 |
663 /* Clear the rest of the line's height. */ | 663 /* Clear the rest of the line's height. */ |
664 if (f->display.x->line_height != FONT_HEIGHT (font)) | 664 if (f->output_data.x->line_height != FONT_HEIGHT (font)) |
665 XClearArea (FRAME_X_DISPLAY (f), window, left, | 665 XClearArea (FRAME_X_DISPLAY (f), window, left, |
666 top + FONT_HEIGHT (font), | 666 top + FONT_HEIGHT (font), |
667 FONT_WIDTH (font) * len, | 667 FONT_WIDTH (font) * len, |
668 /* This is how many pixels of height | 668 /* This is how many pixels of height |
669 we have to clear. */ | 669 we have to clear. */ |
670 f->display.x->line_height - FONT_HEIGHT (font), | 670 f->output_data.x->line_height - FONT_HEIGHT (font), |
671 False); | 671 False); |
672 } | 672 } |
673 | 673 |
674 #if 0 /* Doesn't work, because it uses FRAME_CURRENT_GLYPHS, | 674 #if 0 /* Doesn't work, because it uses FRAME_CURRENT_GLYPHS, |
675 which often is not up to date yet. */ | 675 which often is not up to date yet. */ |
720 int hl; | 720 int hl; |
721 XFontStruct *font; | 721 XFontStruct *font; |
722 { | 722 { |
723 register int len; | 723 register int len; |
724 Window window = FRAME_X_WINDOW (f); | 724 Window window = FRAME_X_WINDOW (f); |
725 GC drawing_gc = (hl == 2 ? f->display.x->cursor_gc | 725 GC drawing_gc = (hl == 2 ? f->output_data.x->cursor_gc |
726 : (hl ? f->display.x->reverse_gc | 726 : (hl ? f->output_data.x->reverse_gc |
727 : f->display.x->normal_gc)); | 727 : f->output_data.x->normal_gc)); |
728 | 728 |
729 if (sizeof (GLYPH) == sizeof (XChar2b)) | 729 if (sizeof (GLYPH) == sizeof (XChar2b)) |
730 XDrawImageString16 (FRAME_X_DISPLAY (f), window, drawing_gc, | 730 XDrawImageString16 (FRAME_X_DISPLAY (f), window, drawing_gc, |
731 left, top + FONT_BASE (font), (XChar2b *) gp, n); | 731 left, top + FONT_BASE (font), (XChar2b *) gp, n); |
732 else if (sizeof (GLYPH) == sizeof (unsigned char)) | 732 else if (sizeof (GLYPH) == sizeof (unsigned char)) |
825 f->phys_cursor_x = -1; | 825 f->phys_cursor_x = -1; |
826 | 826 |
827 XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 827 XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
828 CHAR_TO_PIXEL_COL (f, curs_x), | 828 CHAR_TO_PIXEL_COL (f, curs_x), |
829 CHAR_TO_PIXEL_ROW (f, curs_y), | 829 CHAR_TO_PIXEL_ROW (f, curs_y), |
830 FONT_WIDTH (f->display.x->font) * (first_unused - curs_x), | 830 FONT_WIDTH (f->output_data.x->font) * (first_unused - curs_x), |
831 f->display.x->line_height, False); | 831 f->output_data.x->line_height, False); |
832 #if 0 | 832 #if 0 |
833 redraw_previous_char (f, curs_x, curs_y, highlight); | 833 redraw_previous_char (f, curs_x, curs_y, highlight); |
834 #endif | 834 #endif |
835 | 835 |
836 UNBLOCK_INPUT; | 836 UNBLOCK_INPUT; |
892 if (start_x < 0) | 892 if (start_x < 0) |
893 start_x = 0; | 893 start_x = 0; |
894 XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 894 XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
895 CHAR_TO_PIXEL_COL (f, x - 1), | 895 CHAR_TO_PIXEL_COL (f, x - 1), |
896 CHAR_TO_PIXEL_ROW (f, y), | 896 CHAR_TO_PIXEL_ROW (f, y), |
897 FONT_WIDTH (f->display.x->font), | 897 FONT_WIDTH (f->output_data.x->font), |
898 f->display.x->line_height, False); | 898 f->output_data.x->line_height, False); |
899 | 899 |
900 dumpglyphs (f, CHAR_TO_PIXEL_COL (f, start_x), | 900 dumpglyphs (f, CHAR_TO_PIXEL_COL (f, start_x), |
901 CHAR_TO_PIXEL_ROW (f, y), | 901 CHAR_TO_PIXEL_ROW (f, y), |
902 &FRAME_CURRENT_GLYPHS (f)->glyphs[y][start_x], | 902 &FRAME_CURRENT_GLYPHS (f)->glyphs[y][start_x], |
903 x - start_x, highlight_flag, 1); | 903 x - start_x, highlight_flag, 1); |
928 if (end_x > limit) | 928 if (end_x > limit) |
929 end_x = limit; | 929 end_x = limit; |
930 XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 930 XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
931 CHAR_TO_PIXEL_COL (f, x), | 931 CHAR_TO_PIXEL_COL (f, x), |
932 CHAR_TO_PIXEL_ROW (f, y), | 932 CHAR_TO_PIXEL_ROW (f, y), |
933 FONT_WIDTH (f->display.x->font), | 933 FONT_WIDTH (f->output_data.x->font), |
934 f->display.x->line_height, False); | 934 f->output_data.x->line_height, False); |
935 | 935 |
936 dumpglyphs (f, CHAR_TO_PIXEL_COL (f, x), | 936 dumpglyphs (f, CHAR_TO_PIXEL_COL (f, x), |
937 CHAR_TO_PIXEL_ROW (f, y), | 937 CHAR_TO_PIXEL_ROW (f, y), |
938 &FRAME_CURRENT_GLYPHS (f)->glyphs[y][x], | 938 &FRAME_CURRENT_GLYPHS (f)->glyphs[y][x], |
939 end_x - x, highlight_flag, 1); | 939 end_x - x, highlight_flag, 1); |
1084 into background pixels. */ | 1084 into background pixels. */ |
1085 { | 1085 { |
1086 XGCValues values; | 1086 XGCValues values; |
1087 | 1087 |
1088 values.function = GXxor; | 1088 values.function = GXxor; |
1089 values.foreground = (f->display.x->foreground_pixel | 1089 values.foreground = (f->output_data.x->foreground_pixel |
1090 ^ f->display.x->background_pixel); | 1090 ^ f->output_data.x->background_pixel); |
1091 | 1091 |
1092 gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 1092 gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
1093 GCFunction | GCForeground, &values); | 1093 GCFunction | GCForeground, &values); |
1094 } | 1094 } |
1095 | 1095 |
1278 f = updating_frame; | 1278 f = updating_frame; |
1279 if (f == 0) | 1279 if (f == 0) |
1280 abort (); | 1280 abort (); |
1281 | 1281 |
1282 ht = f->height; | 1282 ht = f->height; |
1283 intborder = f->display.x->internal_border_width; | 1283 intborder = f->output_data.x->internal_border_width; |
1284 | 1284 |
1285 x_display_cursor (updating_frame, 0); | 1285 x_display_cursor (updating_frame, 0); |
1286 | 1286 |
1287 for (i = 0; i < ht; ++i) | 1287 for (i = 0; i < ht; ++i) |
1288 if (line_dance[i] != -1 && (distance = line_dance[i]-i) > 0) | 1288 if (line_dance[i] != -1 && (distance = line_dance[i]-i) > 0) |
1289 { | 1289 { |
1290 for (j = i; (j < ht && line_dance[j] != -1 | 1290 for (j = i; (j < ht && line_dance[j] != -1 |
1291 && line_dance[j]-j == distance); ++j); | 1291 && line_dance[j]-j == distance); ++j); |
1292 /* Copy [i,j) upward from [i+distance,j+distance) */ | 1292 /* Copy [i,j) upward from [i+distance,j+distance) */ |
1293 XCopyArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 1293 XCopyArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
1294 FRAME_X_WINDOW (f), f->display.x->normal_gc, | 1294 FRAME_X_WINDOW (f), f->output_data.x->normal_gc, |
1295 intborder, CHAR_TO_PIXEL_ROW (f, i+distance), | 1295 intborder, CHAR_TO_PIXEL_ROW (f, i+distance), |
1296 f->width * FONT_WIDTH (f->display.x->font), | 1296 f->width * FONT_WIDTH (f->output_data.x->font), |
1297 (j-i) * f->display.x->line_height, | 1297 (j-i) * f->output_data.x->line_height, |
1298 intborder, CHAR_TO_PIXEL_ROW (f, i)); | 1298 intborder, CHAR_TO_PIXEL_ROW (f, i)); |
1299 i = j-1; | 1299 i = j-1; |
1300 } | 1300 } |
1301 | 1301 |
1302 for (i = ht; --i >=0; ) | 1302 for (i = ht; --i >=0; ) |
1304 { | 1304 { |
1305 for (j = i; (--j >= 0 && line_dance[j] != -1 | 1305 for (j = i; (--j >= 0 && line_dance[j] != -1 |
1306 && line_dance[j]-j == distance);); | 1306 && line_dance[j]-j == distance);); |
1307 /* Copy (j,i] downward from (j+distance, i+distance] */ | 1307 /* Copy (j,i] downward from (j+distance, i+distance] */ |
1308 XCopyArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 1308 XCopyArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
1309 FRAME_X_WINDOW (f), f->display.x->normal_gc, | 1309 FRAME_X_WINDOW (f), f->output_data.x->normal_gc, |
1310 intborder, CHAR_TO_PIXEL_ROW (f, j+1+distance), | 1310 intborder, CHAR_TO_PIXEL_ROW (f, j+1+distance), |
1311 f->width * FONT_WIDTH (f->display.x->font), | 1311 f->width * FONT_WIDTH (f->output_data.x->font), |
1312 (i-j) * f->display.x->line_height, | 1312 (i-j) * f->output_data.x->line_height, |
1313 intborder, CHAR_TO_PIXEL_ROW (f, j+1)); | 1313 intborder, CHAR_TO_PIXEL_ROW (f, j+1)); |
1314 i = j+1; | 1314 i = j+1; |
1315 } | 1315 } |
1316 | 1316 |
1317 for (i = 0; i < ht; ++i) | 1317 for (i = 0; i < ht; ++i) |
1319 { | 1319 { |
1320 for (j = i; j < ht && line_dance[j] == -1; ++j); | 1320 for (j = i; j < ht && line_dance[j] == -1; ++j); |
1321 /* Clear [i,j) */ | 1321 /* Clear [i,j) */ |
1322 XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 1322 XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
1323 intborder, CHAR_TO_PIXEL_ROW (f, i), | 1323 intborder, CHAR_TO_PIXEL_ROW (f, i), |
1324 f->width * FONT_WIDTH (f->display.x->font), | 1324 f->width * FONT_WIDTH (f->output_data.x->font), |
1325 (j-i) * f->display.x->line_height, False); | 1325 (j-i) * f->output_data.x->line_height, False); |
1326 i = j-1; | 1326 i = j-1; |
1327 } | 1327 } |
1328 line_dance_in_progress = 0; | 1328 line_dance_in_progress = 0; |
1329 } | 1329 } |
1330 | 1330 |
1356 | 1356 |
1357 /* Convert rectangle edges in pixels to edges in chars. | 1357 /* Convert rectangle edges in pixels to edges in chars. |
1358 Round down for left and top, up for right and bottom. */ | 1358 Round down for left and top, up for right and bottom. */ |
1359 top = PIXEL_TO_CHAR_ROW (f, top); | 1359 top = PIXEL_TO_CHAR_ROW (f, top); |
1360 left = PIXEL_TO_CHAR_COL (f, left); | 1360 left = PIXEL_TO_CHAR_COL (f, left); |
1361 bottom += (f->display.x->line_height - 1); | 1361 bottom += (f->output_data.x->line_height - 1); |
1362 right += (FONT_WIDTH (f->display.x->font) - 1); | 1362 right += (FONT_WIDTH (f->output_data.x->font) - 1); |
1363 bottom = PIXEL_TO_CHAR_ROW (f, bottom); | 1363 bottom = PIXEL_TO_CHAR_ROW (f, bottom); |
1364 right = PIXEL_TO_CHAR_COL (f, right); | 1364 right = PIXEL_TO_CHAR_COL (f, right); |
1365 | 1365 |
1366 /* Clip the rectangle to what can be visible. */ | 1366 /* Clip the rectangle to what can be visible. */ |
1367 if (left < 0) | 1367 if (left < 0) |
1420 the ICCCM (section 4.1.6) says that the window's border pixmap | 1420 the ICCCM (section 4.1.6) says that the window's border pixmap |
1421 and border pixel are window attributes which are "private to the | 1421 and border pixel are window attributes which are "private to the |
1422 client", so we can always change it to whatever we want. */ | 1422 client", so we can always change it to whatever we want. */ |
1423 BLOCK_INPUT; | 1423 BLOCK_INPUT; |
1424 XSetWindowBorder (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 1424 XSetWindowBorder (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
1425 f->display.x->border_pixel); | 1425 f->output_data.x->border_pixel); |
1426 UNBLOCK_INPUT; | 1426 UNBLOCK_INPUT; |
1427 x_update_cursor (f, 1); | 1427 x_update_cursor (f, 1); |
1428 } | 1428 } |
1429 | 1429 |
1430 static void | 1430 static void |
1435 the ICCCM (section 4.1.6) says that the window's border pixmap | 1435 the ICCCM (section 4.1.6) says that the window's border pixmap |
1436 and border pixel are window attributes which are "private to the | 1436 and border pixel are window attributes which are "private to the |
1437 client", so we can always change it to whatever we want. */ | 1437 client", so we can always change it to whatever we want. */ |
1438 BLOCK_INPUT; | 1438 BLOCK_INPUT; |
1439 XSetWindowBorderPixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 1439 XSetWindowBorderPixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
1440 f->display.x->border_tile); | 1440 f->output_data.x->border_tile); |
1441 UNBLOCK_INPUT; | 1441 UNBLOCK_INPUT; |
1442 x_update_cursor (f, 1); | 1442 x_update_cursor (f, 1); |
1443 } | 1443 } |
1444 | 1444 |
1445 static void XTframe_rehighlight (); | 1445 static void XTframe_rehighlight (); |
1701 int noclip; | 1701 int noclip; |
1702 { | 1702 { |
1703 /* Arrange for the division in PIXEL_TO_CHAR_COL etc. to round down | 1703 /* Arrange for the division in PIXEL_TO_CHAR_COL etc. to round down |
1704 even for negative values. */ | 1704 even for negative values. */ |
1705 if (pix_x < 0) | 1705 if (pix_x < 0) |
1706 pix_x -= FONT_WIDTH ((f)->display.x->font) - 1; | 1706 pix_x -= FONT_WIDTH ((f)->output_data.x->font) - 1; |
1707 if (pix_y < 0) | 1707 if (pix_y < 0) |
1708 pix_y -= (f)->display.x->line_height - 1; | 1708 pix_y -= (f)->output_data.x->line_height - 1; |
1709 | 1709 |
1710 pix_x = PIXEL_TO_CHAR_COL (f, pix_x); | 1710 pix_x = PIXEL_TO_CHAR_COL (f, pix_x); |
1711 pix_y = PIXEL_TO_CHAR_ROW (f, pix_y); | 1711 pix_y = PIXEL_TO_CHAR_ROW (f, pix_y); |
1712 | 1712 |
1713 if (bounds) | 1713 if (bounds) |
1714 { | 1714 { |
1715 bounds->width = FONT_WIDTH (f->display.x->font); | 1715 bounds->width = FONT_WIDTH (f->output_data.x->font); |
1716 bounds->height = f->display.x->line_height; | 1716 bounds->height = f->output_data.x->line_height; |
1717 bounds->x = CHAR_TO_PIXEL_COL (f, pix_x); | 1717 bounds->x = CHAR_TO_PIXEL_COL (f, pix_x); |
1718 bounds->y = CHAR_TO_PIXEL_ROW (f, pix_y); | 1718 bounds->y = CHAR_TO_PIXEL_ROW (f, pix_y); |
1719 } | 1719 } |
1720 | 1720 |
1721 if (!noclip) | 1721 if (!noclip) |
2203 curs_y = old_curs_y; | 2203 curs_y = old_curs_y; |
2204 | 2204 |
2205 /* Change the mouse cursor according to the value of HL. */ | 2205 /* Change the mouse cursor according to the value of HL. */ |
2206 if (hl > 0) | 2206 if (hl > 0) |
2207 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 2207 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
2208 f->display.x->cross_cursor); | 2208 f->output_data.x->cross_cursor); |
2209 else | 2209 else |
2210 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 2210 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
2211 f->display.x->text_cursor); | 2211 f->output_data.x->text_cursor); |
2212 } | 2212 } |
2213 | 2213 |
2214 /* Clear out the mouse-highlighted active region. | 2214 /* Clear out the mouse-highlighted active region. |
2215 Redraw it unhighlighted first. */ | 2215 Redraw it unhighlighted first. */ |
2216 | 2216 |
2472 BLOCK_INPUT; | 2472 BLOCK_INPUT; |
2473 | 2473 |
2474 { | 2474 { |
2475 XSetWindowAttributes a; | 2475 XSetWindowAttributes a; |
2476 unsigned long mask; | 2476 unsigned long mask; |
2477 a.background_pixel = f->display.x->background_pixel; | 2477 a.background_pixel = f->output_data.x->background_pixel; |
2478 a.event_mask = (ButtonPressMask | ButtonReleaseMask | 2478 a.event_mask = (ButtonPressMask | ButtonReleaseMask |
2479 | ButtonMotionMask | PointerMotionHintMask | 2479 | ButtonMotionMask | PointerMotionHintMask |
2480 | ExposureMask); | 2480 | ExposureMask); |
2481 a.cursor = FRAME_X_DISPLAY_INFO (f)->vertical_scroll_bar_cursor; | 2481 a.cursor = FRAME_X_DISPLAY_INFO (f)->vertical_scroll_bar_cursor; |
2482 | 2482 |
2490 XtSetArg (al[ac], XtNwidth, width); ac++; | 2490 XtSetArg (al[ac], XtNwidth, width); ac++; |
2491 XtSetArg (al[ac], XtNheight, height); ac++; | 2491 XtSetArg (al[ac], XtNheight, height); ac++; |
2492 XtSetArg (al[ac], XtNborderWidth, 0); ac++; | 2492 XtSetArg (al[ac], XtNborderWidth, 0); ac++; |
2493 sb_widget = XtCreateManagedWidget ("box", | 2493 sb_widget = XtCreateManagedWidget ("box", |
2494 boxWidgetClass, | 2494 boxWidgetClass, |
2495 f->display.x->edit_widget, al, ac); | 2495 f->output_data.x->edit_widget, al, ac); |
2496 SET_SCROLL_BAR_X_WINDOW | 2496 SET_SCROLL_BAR_X_WINDOW |
2497 (bar, sb_widget->core.window); | 2497 (bar, sb_widget->core.window); |
2498 #endif | 2498 #endif |
2499 SET_SCROLL_BAR_X_WINDOW | 2499 SET_SCROLL_BAR_X_WINDOW |
2500 (bar, | 2500 (bar, |
2551 int rebuild; | 2551 int rebuild; |
2552 { | 2552 { |
2553 int dragging = ! NILP (bar->dragging); | 2553 int dragging = ! NILP (bar->dragging); |
2554 Window w = SCROLL_BAR_X_WINDOW (bar); | 2554 Window w = SCROLL_BAR_X_WINDOW (bar); |
2555 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); | 2555 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); |
2556 GC gc = f->display.x->normal_gc; | 2556 GC gc = f->output_data.x->normal_gc; |
2557 | 2557 |
2558 /* If the display is already accurate, do nothing. */ | 2558 /* If the display is already accurate, do nothing. */ |
2559 if (! rebuild | 2559 if (! rebuild |
2560 && start == XINT (bar->start) | 2560 && start == XINT (bar->start) |
2561 && end == XINT (bar->end)) | 2561 && end == XINT (bar->end)) |
2710 int pixel_top = CHAR_TO_PIXEL_ROW (f, top); | 2710 int pixel_top = CHAR_TO_PIXEL_ROW (f, top); |
2711 int pixel_left = CHAR_TO_PIXEL_COL (f, left); | 2711 int pixel_left = CHAR_TO_PIXEL_COL (f, left); |
2712 int pixel_width | 2712 int pixel_width |
2713 = (FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0 | 2713 = (FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0 |
2714 ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f) | 2714 ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f) |
2715 : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->display.x->font))); | 2715 : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.x->font))); |
2716 int pixel_height = VERTICAL_SCROLL_BAR_PIXEL_HEIGHT (f, height); | 2716 int pixel_height = VERTICAL_SCROLL_BAR_PIXEL_HEIGHT (f, height); |
2717 | 2717 |
2718 struct scroll_bar *bar; | 2718 struct scroll_bar *bar; |
2719 | 2719 |
2720 /* Does the scroll bar exist yet? */ | 2720 /* Does the scroll bar exist yet? */ |
2861 struct scroll_bar *bar; | 2861 struct scroll_bar *bar; |
2862 XEvent *event; | 2862 XEvent *event; |
2863 { | 2863 { |
2864 Window w = SCROLL_BAR_X_WINDOW (bar); | 2864 Window w = SCROLL_BAR_X_WINDOW (bar); |
2865 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); | 2865 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); |
2866 GC gc = f->display.x->normal_gc; | 2866 GC gc = f->output_data.x->normal_gc; |
2867 | 2867 |
2868 BLOCK_INPUT; | 2868 BLOCK_INPUT; |
2869 | 2869 |
2870 x_scroll_bar_set_handle (bar, XINT (bar->start), XINT (bar->end), 1); | 2870 x_scroll_bar_set_handle (bar, XINT (bar->start), XINT (bar->end), 1); |
2871 | 2871 |
3403 new_x = event.xclient.data.s[0]; | 3403 new_x = event.xclient.data.s[0]; |
3404 new_y = event.xclient.data.s[1]; | 3404 new_y = event.xclient.data.s[1]; |
3405 | 3405 |
3406 if (f) | 3406 if (f) |
3407 { | 3407 { |
3408 f->display.x->left_pos = new_x; | 3408 f->output_data.x->left_pos = new_x; |
3409 f->display.x->top_pos = new_y; | 3409 f->output_data.x->top_pos = new_y; |
3410 } | 3410 } |
3411 } | 3411 } |
3412 #if defined (USE_X_TOOLKIT) && defined (HAVE_X11R5) | 3412 #if defined (USE_X_TOOLKIT) && defined (HAVE_X11R5) |
3413 else if (event.xclient.message_type | 3413 else if (event.xclient.message_type |
3414 == dpyinfo->Xatom_editres) | 3414 == dpyinfo->Xatom_editres) |
3415 { | 3415 { |
3416 struct frame *f | 3416 struct frame *f |
3417 = x_any_window_to_frame (dpyinfo, event.xclient.window); | 3417 = x_any_window_to_frame (dpyinfo, event.xclient.window); |
3418 _XEditResCheckMessages (f->display.x->widget, NULL, | 3418 _XEditResCheckMessages (f->output_data.x->widget, NULL, |
3419 &event, NULL); | 3419 &event, NULL); |
3420 } | 3420 } |
3421 #endif /* USE_X_TOOLKIT and HAVE_X11R5 */ | 3421 #endif /* USE_X_TOOLKIT and HAVE_X11R5 */ |
3422 } | 3422 } |
3423 break; | 3423 break; |
3492 case ReparentNotify: | 3492 case ReparentNotify: |
3493 f = x_top_window_to_frame (dpyinfo, event.xreparent.window); | 3493 f = x_top_window_to_frame (dpyinfo, event.xreparent.window); |
3494 if (f) | 3494 if (f) |
3495 { | 3495 { |
3496 int x, y; | 3496 int x, y; |
3497 f->display.x->parent_desc = event.xreparent.parent; | 3497 f->output_data.x->parent_desc = event.xreparent.parent; |
3498 x_real_positions (f, &x, &y); | 3498 x_real_positions (f, &x, &y); |
3499 f->display.x->left_pos = x; | 3499 f->output_data.x->left_pos = x; |
3500 f->display.x->top_pos = y; | 3500 f->output_data.x->top_pos = y; |
3501 } | 3501 } |
3502 break; | 3502 break; |
3503 | 3503 |
3504 case Expose: | 3504 case Expose: |
3505 f = x_window_to_frame (dpyinfo, event.xexpose.window); | 3505 f = x_window_to_frame (dpyinfo, event.xexpose.window); |
3867 | 3867 |
3868 case ConfigureNotify: | 3868 case ConfigureNotify: |
3869 f = x_any_window_to_frame (dpyinfo, event.xconfigure.window); | 3869 f = x_any_window_to_frame (dpyinfo, event.xconfigure.window); |
3870 if (f | 3870 if (f |
3871 #ifdef USE_X_TOOLKIT | 3871 #ifdef USE_X_TOOLKIT |
3872 && (event.xconfigure.window == XtWindow (f->display.x->widget)) | 3872 && (event.xconfigure.window == XtWindow (f->output_data.x->widget)) |
3873 #endif | 3873 #endif |
3874 ) | 3874 ) |
3875 { | 3875 { |
3876 #ifndef USE_X_TOOLKIT | 3876 #ifndef USE_X_TOOLKIT |
3877 /* In the toolkit version, change_frame_size | 3877 /* In the toolkit version, change_frame_size |
3884 /* Even if the number of character rows and columns has | 3884 /* Even if the number of character rows and columns has |
3885 not changed, the font size may have changed, so we need | 3885 not changed, the font size may have changed, so we need |
3886 to check the pixel dimensions as well. */ | 3886 to check the pixel dimensions as well. */ |
3887 if (columns != f->width | 3887 if (columns != f->width |
3888 || rows != f->height | 3888 || rows != f->height |
3889 || event.xconfigure.width != f->display.x->pixel_width | 3889 || event.xconfigure.width != f->output_data.x->pixel_width |
3890 || event.xconfigure.height != f->display.x->pixel_height) | 3890 || event.xconfigure.height != f->output_data.x->pixel_height) |
3891 { | 3891 { |
3892 change_frame_size (f, rows, columns, 0, 1); | 3892 change_frame_size (f, rows, columns, 0, 1); |
3893 SET_FRAME_GARBAGED (f); | 3893 SET_FRAME_GARBAGED (f); |
3894 } | 3894 } |
3895 #endif | 3895 #endif |
3925 &child); | 3925 &child); |
3926 event.xconfigure.x = win_x; | 3926 event.xconfigure.x = win_x; |
3927 event.xconfigure.y = win_y; | 3927 event.xconfigure.y = win_y; |
3928 } | 3928 } |
3929 | 3929 |
3930 f->display.x->pixel_width = event.xconfigure.width; | 3930 f->output_data.x->pixel_width = event.xconfigure.width; |
3931 f->display.x->pixel_height = event.xconfigure.height; | 3931 f->output_data.x->pixel_height = event.xconfigure.height; |
3932 f->display.x->left_pos = event.xconfigure.x; | 3932 f->output_data.x->left_pos = event.xconfigure.x; |
3933 f->display.x->top_pos = event.xconfigure.y; | 3933 f->output_data.x->top_pos = event.xconfigure.y; |
3934 | 3934 |
3935 /* What we have now is the position of Emacs's own window. | 3935 /* What we have now is the position of Emacs's own window. |
3936 Convert that to the position of the window manager window. */ | 3936 Convert that to the position of the window manager window. */ |
3937 { | 3937 { |
3938 int x, y; | 3938 int x, y; |
3939 x_real_positions (f, &x, &y); | 3939 x_real_positions (f, &x, &y); |
3940 f->display.x->left_pos = x; | 3940 f->output_data.x->left_pos = x; |
3941 f->display.x->top_pos = y; | 3941 f->output_data.x->top_pos = y; |
3942 /* Formerly we did not do this in the USE_X_TOOLKIT | 3942 /* Formerly we did not do this in the USE_X_TOOLKIT |
3943 version. Let's try making them the same. */ | 3943 version. Let's try making them the same. */ |
3944 /* #ifndef USE_X_TOOLKIT */ | 3944 /* #ifndef USE_X_TOOLKIT */ |
3945 if (y != event.xconfigure.y) | 3945 if (y != event.xconfigure.y) |
3946 { | 3946 { |
3947 /* Since the WM decorations come below top_pos now, | 3947 /* Since the WM decorations come below top_pos now, |
3948 we must put them below top_pos in the future. */ | 3948 we must put them below top_pos in the future. */ |
3949 f->display.x->win_gravity = NorthWestGravity; | 3949 f->output_data.x->win_gravity = NorthWestGravity; |
3950 x_wm_set_size_hint (f, (long) 0, 0); | 3950 x_wm_set_size_hint (f, (long) 0, 0); |
3951 } | 3951 } |
3952 /* #endif */ | 3952 /* #endif */ |
3953 } | 3953 } |
3954 } | 3954 } |
4013 Instead, save it away | 4013 Instead, save it away |
4014 and we will pass it to Xt from kbd_buffer_get_event. | 4014 and we will pass it to Xt from kbd_buffer_get_event. |
4015 That way, we can run some Lisp code first. */ | 4015 That way, we can run some Lisp code first. */ |
4016 if (f && event.type == ButtonPress) | 4016 if (f && event.type == ButtonPress) |
4017 { | 4017 { |
4018 if (f->display.x->saved_button_event == 0) | 4018 if (f->output_data.x->saved_button_event == 0) |
4019 f->display.x->saved_button_event | 4019 f->output_data.x->saved_button_event |
4020 = (XButtonEvent *) xmalloc (sizeof (XButtonEvent)); | 4020 = (XButtonEvent *) xmalloc (sizeof (XButtonEvent)); |
4021 bcopy (&event, f->display.x->saved_button_event, | 4021 bcopy (&event, f->output_data.x->saved_button_event, |
4022 sizeof (XButtonEvent)); | 4022 sizeof (XButtonEvent)); |
4023 if (numchars >= 1) | 4023 if (numchars >= 1) |
4024 { | 4024 { |
4025 bufp->kind = menu_bar_activate_event; | 4025 bufp->kind = menu_bar_activate_event; |
4026 XSETFRAME (bufp->frame_or_window, f); | 4026 XSETFRAME (bufp->frame_or_window, f); |
4114 struct frame *f; | 4114 struct frame *f; |
4115 int x, y; | 4115 int x, y; |
4116 { | 4116 { |
4117 int left = CHAR_TO_PIXEL_COL (f, x); | 4117 int left = CHAR_TO_PIXEL_COL (f, x); |
4118 int top = CHAR_TO_PIXEL_ROW (f, y); | 4118 int top = CHAR_TO_PIXEL_ROW (f, y); |
4119 int width = FONT_WIDTH (f->display.x->font); | 4119 int width = FONT_WIDTH (f->output_data.x->font); |
4120 int height = f->display.x->line_height; | 4120 int height = f->output_data.x->line_height; |
4121 | 4121 |
4122 XDrawRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 4122 XDrawRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
4123 f->display.x->cursor_gc, | 4123 f->output_data.x->cursor_gc, |
4124 left, top, width - 1, height - 1); | 4124 left, top, width - 1, height - 1); |
4125 } | 4125 } |
4126 | 4126 |
4127 /* Clear the cursor of frame F to background color, | 4127 /* Clear the cursor of frame F to background color, |
4128 and mark the cursor as not shown. | 4128 and mark the cursor as not shown. |
4180 /* If there is anything wrong with the current cursor state, remove it. */ | 4180 /* If there is anything wrong with the current cursor state, remove it. */ |
4181 if (f->phys_cursor_x >= 0 | 4181 if (f->phys_cursor_x >= 0 |
4182 && (!on | 4182 && (!on |
4183 || f->phys_cursor_x != x | 4183 || f->phys_cursor_x != x |
4184 || f->phys_cursor_y != y | 4184 || f->phys_cursor_y != y |
4185 || f->display.x->current_cursor != bar_cursor)) | 4185 || f->output_data.x->current_cursor != bar_cursor)) |
4186 { | 4186 { |
4187 /* Erase the cursor by redrawing the character underneath it. */ | 4187 /* Erase the cursor by redrawing the character underneath it. */ |
4188 x_draw_single_glyph (f, f->phys_cursor_y, f->phys_cursor_x, | 4188 x_draw_single_glyph (f, f->phys_cursor_y, f->phys_cursor_x, |
4189 f->phys_cursor_glyph, | 4189 f->phys_cursor_glyph, |
4190 current_glyphs->highlight[f->phys_cursor_y]); | 4190 current_glyphs->highlight[f->phys_cursor_y]); |
4192 } | 4192 } |
4193 | 4193 |
4194 /* If we now need a cursor in the new place or in the new form, do it so. */ | 4194 /* If we now need a cursor in the new place or in the new form, do it so. */ |
4195 if (on | 4195 if (on |
4196 && (f->phys_cursor_x < 0 | 4196 && (f->phys_cursor_x < 0 |
4197 || (f->display.x->current_cursor != bar_cursor))) | 4197 || (f->output_data.x->current_cursor != bar_cursor))) |
4198 { | 4198 { |
4199 f->phys_cursor_glyph | 4199 f->phys_cursor_glyph |
4200 = ((current_glyphs->enable[y] | 4200 = ((current_glyphs->enable[y] |
4201 && x < current_glyphs->used[y]) | 4201 && x < current_glyphs->used[y]) |
4202 ? current_glyphs->glyphs[y][x] | 4202 ? current_glyphs->glyphs[y][x] |
4203 : SPACEGLYPH); | 4203 : SPACEGLYPH); |
4204 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 4204 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
4205 f->display.x->cursor_gc, | 4205 f->output_data.x->cursor_gc, |
4206 CHAR_TO_PIXEL_COL (f, x), | 4206 CHAR_TO_PIXEL_COL (f, x), |
4207 CHAR_TO_PIXEL_ROW (f, y), | 4207 CHAR_TO_PIXEL_ROW (f, y), |
4208 max (f->display.x->cursor_width, 1), | 4208 max (f->output_data.x->cursor_width, 1), |
4209 f->display.x->line_height); | 4209 f->output_data.x->line_height); |
4210 | 4210 |
4211 f->phys_cursor_x = x; | 4211 f->phys_cursor_x = x; |
4212 f->phys_cursor_y = y; | 4212 f->phys_cursor_y = y; |
4213 | 4213 |
4214 f->display.x->current_cursor = bar_cursor; | 4214 f->output_data.x->current_cursor = bar_cursor; |
4215 } | 4215 } |
4216 | 4216 |
4217 if (updating_frame != f) | 4217 if (updating_frame != f) |
4218 XFlush (FRAME_X_DISPLAY (f)); | 4218 XFlush (FRAME_X_DISPLAY (f)); |
4219 } | 4219 } |
4246 erase it. */ | 4246 erase it. */ |
4247 if (f->phys_cursor_x >= 0 | 4247 if (f->phys_cursor_x >= 0 |
4248 && (!on | 4248 && (!on |
4249 || f->phys_cursor_x != x | 4249 || f->phys_cursor_x != x |
4250 || f->phys_cursor_y != y | 4250 || f->phys_cursor_y != y |
4251 || (f->display.x->current_cursor != hollow_box_cursor | 4251 || (f->output_data.x->current_cursor != hollow_box_cursor |
4252 && (f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame)))) | 4252 && (f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame)))) |
4253 { | 4253 { |
4254 int mouse_face_here = 0; | 4254 int mouse_face_here = 0; |
4255 struct frame_glyphs *active_glyphs = FRAME_CURRENT_GLYPHS (f); | 4255 struct frame_glyphs *active_glyphs = FRAME_CURRENT_GLYPHS (f); |
4256 | 4256 |
4271 && active_glyphs->used[f->phys_cursor_y] > f->phys_cursor_x) | 4271 && active_glyphs->used[f->phys_cursor_y] > f->phys_cursor_x) |
4272 mouse_face_here = 1; | 4272 mouse_face_here = 1; |
4273 | 4273 |
4274 /* If the font is not as tall as a whole line, | 4274 /* If the font is not as tall as a whole line, |
4275 we must explicitly clear the line's whole height. */ | 4275 we must explicitly clear the line's whole height. */ |
4276 if (FONT_HEIGHT (f->display.x->font) != f->display.x->line_height) | 4276 if (FONT_HEIGHT (f->output_data.x->font) != f->output_data.x->line_height) |
4277 XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 4277 XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
4278 CHAR_TO_PIXEL_COL (f, f->phys_cursor_x), | 4278 CHAR_TO_PIXEL_COL (f, f->phys_cursor_x), |
4279 CHAR_TO_PIXEL_ROW (f, f->phys_cursor_y), | 4279 CHAR_TO_PIXEL_ROW (f, f->phys_cursor_y), |
4280 FONT_WIDTH (f->display.x->font), | 4280 FONT_WIDTH (f->output_data.x->font), |
4281 f->display.x->line_height, False); | 4281 f->output_data.x->line_height, False); |
4282 /* Erase the cursor by redrawing the character underneath it. */ | 4282 /* Erase the cursor by redrawing the character underneath it. */ |
4283 x_draw_single_glyph (f, f->phys_cursor_y, f->phys_cursor_x, | 4283 x_draw_single_glyph (f, f->phys_cursor_y, f->phys_cursor_x, |
4284 f->phys_cursor_glyph, | 4284 f->phys_cursor_glyph, |
4285 (mouse_face_here | 4285 (mouse_face_here |
4286 ? 3 | 4286 ? 3 |
4291 /* If we want to show a cursor, | 4291 /* If we want to show a cursor, |
4292 or we want a box cursor and it's not so, | 4292 or we want a box cursor and it's not so, |
4293 write it in the right place. */ | 4293 write it in the right place. */ |
4294 if (on | 4294 if (on |
4295 && (f->phys_cursor_x < 0 | 4295 && (f->phys_cursor_x < 0 |
4296 || (f->display.x->current_cursor != filled_box_cursor | 4296 || (f->output_data.x->current_cursor != filled_box_cursor |
4297 && f == FRAME_X_DISPLAY_INFO (f)->x_highlight_frame))) | 4297 && f == FRAME_X_DISPLAY_INFO (f)->x_highlight_frame))) |
4298 { | 4298 { |
4299 f->phys_cursor_glyph | 4299 f->phys_cursor_glyph |
4300 = ((current_glyphs->enable[y] | 4300 = ((current_glyphs->enable[y] |
4301 && x < current_glyphs->used[y]) | 4301 && x < current_glyphs->used[y]) |
4302 ? current_glyphs->glyphs[y][x] | 4302 ? current_glyphs->glyphs[y][x] |
4303 : SPACEGLYPH); | 4303 : SPACEGLYPH); |
4304 if (f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame) | 4304 if (f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame) |
4305 { | 4305 { |
4306 x_draw_box (f, x, y); | 4306 x_draw_box (f, x, y); |
4307 f->display.x->current_cursor = hollow_box_cursor; | 4307 f->output_data.x->current_cursor = hollow_box_cursor; |
4308 } | 4308 } |
4309 else | 4309 else |
4310 { | 4310 { |
4311 x_draw_single_glyph (f, y, x, | 4311 x_draw_single_glyph (f, y, x, |
4312 f->phys_cursor_glyph, 2); | 4312 f->phys_cursor_glyph, 2); |
4313 f->display.x->current_cursor = filled_box_cursor; | 4313 f->output_data.x->current_cursor = filled_box_cursor; |
4314 } | 4314 } |
4315 | 4315 |
4316 f->phys_cursor_x = x; | 4316 f->phys_cursor_x = x; |
4317 f->phys_cursor_y = y; | 4317 f->phys_cursor_y = y; |
4318 } | 4318 } |
4395 | 4395 |
4396 if (FRAME_X_WINDOW (f) == 0) | 4396 if (FRAME_X_WINDOW (f) == 0) |
4397 return 1; | 4397 return 1; |
4398 | 4398 |
4399 /* Free up our existing icon bitmap if any. */ | 4399 /* Free up our existing icon bitmap if any. */ |
4400 if (f->display.x->icon_bitmap > 0) | 4400 if (f->output_data.x->icon_bitmap > 0) |
4401 x_destroy_bitmap (f, f->display.x->icon_bitmap); | 4401 x_destroy_bitmap (f, f->output_data.x->icon_bitmap); |
4402 f->display.x->icon_bitmap = 0; | 4402 f->output_data.x->icon_bitmap = 0; |
4403 | 4403 |
4404 if (STRINGP (file)) | 4404 if (STRINGP (file)) |
4405 bitmap_id = x_create_bitmap_from_file (f, file); | 4405 bitmap_id = x_create_bitmap_from_file (f, file); |
4406 else | 4406 else |
4407 { | 4407 { |
4419 | 4419 |
4420 bitmap_id = FRAME_X_DISPLAY_INFO (f)->icon_bitmap_id; | 4420 bitmap_id = FRAME_X_DISPLAY_INFO (f)->icon_bitmap_id; |
4421 } | 4421 } |
4422 | 4422 |
4423 x_wm_set_icon_pixmap (f, bitmap_id); | 4423 x_wm_set_icon_pixmap (f, bitmap_id); |
4424 f->display.x->icon_bitmap = bitmap_id; | 4424 f->output_data.x->icon_bitmap = bitmap_id; |
4425 | 4425 |
4426 return 0; | 4426 return 0; |
4427 } | 4427 } |
4428 | 4428 |
4429 | 4429 |
4444 text.value = (unsigned char *) icon_name; | 4444 text.value = (unsigned char *) icon_name; |
4445 text.encoding = XA_STRING; | 4445 text.encoding = XA_STRING; |
4446 text.format = 8; | 4446 text.format = 8; |
4447 text.nitems = strlen (icon_name); | 4447 text.nitems = strlen (icon_name); |
4448 #ifdef USE_X_TOOLKIT | 4448 #ifdef USE_X_TOOLKIT |
4449 XSetWMIconName (FRAME_X_DISPLAY (f), XtWindow (f->display.x->widget), | 4449 XSetWMIconName (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget), |
4450 &text); | 4450 &text); |
4451 #else /* not USE_X_TOOLKIT */ | 4451 #else /* not USE_X_TOOLKIT */ |
4452 XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &text); | 4452 XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &text); |
4453 #endif /* not USE_X_TOOLKIT */ | 4453 #endif /* not USE_X_TOOLKIT */ |
4454 } | 4454 } |
4455 #else /* not HAVE_X11R4 */ | 4455 #else /* not HAVE_X11R4 */ |
4456 XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), icon_name); | 4456 XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), icon_name); |
4457 #endif /* not HAVE_X11R4 */ | 4457 #endif /* not HAVE_X11R4 */ |
4458 | 4458 |
4459 if (f->display.x->icon_bitmap > 0) | 4459 if (f->output_data.x->icon_bitmap > 0) |
4460 x_destroy_bitmap (f, f->display.x->icon_bitmap); | 4460 x_destroy_bitmap (f, f->output_data.x->icon_bitmap); |
4461 f->display.x->icon_bitmap = 0; | 4461 f->output_data.x->icon_bitmap = 0; |
4462 x_wm_set_icon_pixmap (f, 0); | 4462 x_wm_set_icon_pixmap (f, 0); |
4463 | 4463 |
4464 return 0; | 4464 return 0; |
4465 } | 4465 } |
4466 | 4466 |
4727 } | 4727 } |
4728 found_font: | 4728 found_font: |
4729 | 4729 |
4730 /* If we have, just return it from the table. */ | 4730 /* If we have, just return it from the table. */ |
4731 if (already_loaded >= 0) | 4731 if (already_loaded >= 0) |
4732 f->display.x->font = FRAME_X_DISPLAY_INFO (f)->font_table[already_loaded].font; | 4732 f->output_data.x->font = FRAME_X_DISPLAY_INFO (f)->font_table[already_loaded].font; |
4733 /* Otherwise, load the font and add it to the table. */ | 4733 /* Otherwise, load the font and add it to the table. */ |
4734 else | 4734 else |
4735 { | 4735 { |
4736 int i; | 4736 int i; |
4737 char *full_name; | 4737 char *full_name; |
4819 bcopy (fontname, FRAME_X_DISPLAY_INFO (f)->font_table[n_fonts].name, strlen (fontname) + 1); | 4819 bcopy (fontname, FRAME_X_DISPLAY_INFO (f)->font_table[n_fonts].name, strlen (fontname) + 1); |
4820 if (full_name != 0) | 4820 if (full_name != 0) |
4821 FRAME_X_DISPLAY_INFO (f)->font_table[n_fonts].full_name = full_name; | 4821 FRAME_X_DISPLAY_INFO (f)->font_table[n_fonts].full_name = full_name; |
4822 else | 4822 else |
4823 FRAME_X_DISPLAY_INFO (f)->font_table[n_fonts].full_name = FRAME_X_DISPLAY_INFO (f)->font_table[n_fonts].name; | 4823 FRAME_X_DISPLAY_INFO (f)->font_table[n_fonts].full_name = FRAME_X_DISPLAY_INFO (f)->font_table[n_fonts].name; |
4824 f->display.x->font = FRAME_X_DISPLAY_INFO (f)->font_table[n_fonts].font = font; | 4824 f->output_data.x->font = FRAME_X_DISPLAY_INFO (f)->font_table[n_fonts].font = font; |
4825 FRAME_X_DISPLAY_INFO (f)->n_fonts++; | 4825 FRAME_X_DISPLAY_INFO (f)->n_fonts++; |
4826 | 4826 |
4827 if (full_name) | 4827 if (full_name) |
4828 fontname = full_name; | 4828 fontname = full_name; |
4829 } | 4829 } |
4830 | 4830 |
4831 /* Compute the scroll bar width in character columns. */ | 4831 /* Compute the scroll bar width in character columns. */ |
4832 if (f->scroll_bar_pixel_width > 0) | 4832 if (f->scroll_bar_pixel_width > 0) |
4833 { | 4833 { |
4834 int wid = FONT_WIDTH (f->display.x->font); | 4834 int wid = FONT_WIDTH (f->output_data.x->font); |
4835 f->scroll_bar_cols = (f->scroll_bar_pixel_width + wid-1) / wid; | 4835 f->scroll_bar_cols = (f->scroll_bar_pixel_width + wid-1) / wid; |
4836 } | 4836 } |
4837 else | 4837 else |
4838 f->scroll_bar_cols = 2; | 4838 f->scroll_bar_cols = 2; |
4839 | 4839 |
4840 /* Now make the frame display the given font. */ | 4840 /* Now make the frame display the given font. */ |
4841 if (FRAME_X_WINDOW (f) != 0) | 4841 if (FRAME_X_WINDOW (f) != 0) |
4842 { | 4842 { |
4843 XSetFont (FRAME_X_DISPLAY (f), f->display.x->normal_gc, | 4843 XSetFont (FRAME_X_DISPLAY (f), f->output_data.x->normal_gc, |
4844 f->display.x->font->fid); | 4844 f->output_data.x->font->fid); |
4845 XSetFont (FRAME_X_DISPLAY (f), f->display.x->reverse_gc, | 4845 XSetFont (FRAME_X_DISPLAY (f), f->output_data.x->reverse_gc, |
4846 f->display.x->font->fid); | 4846 f->output_data.x->font->fid); |
4847 XSetFont (FRAME_X_DISPLAY (f), f->display.x->cursor_gc, | 4847 XSetFont (FRAME_X_DISPLAY (f), f->output_data.x->cursor_gc, |
4848 f->display.x->font->fid); | 4848 f->output_data.x->font->fid); |
4849 | 4849 |
4850 frame_update_line_height (f); | 4850 frame_update_line_height (f); |
4851 x_set_window_size (f, 0, f->width, f->height); | 4851 x_set_window_size (f, 0, f->width, f->height); |
4852 } | 4852 } |
4853 else | 4853 else |
4854 /* If we are setting a new frame's font for the first time, | 4854 /* If we are setting a new frame's font for the first time, |
4855 there are no faces yet, so this font's height is the line height. */ | 4855 there are no faces yet, so this font's height is the line height. */ |
4856 f->display.x->line_height = FONT_HEIGHT (f->display.x->font); | 4856 f->output_data.x->line_height = FONT_HEIGHT (f->output_data.x->font); |
4857 | 4857 |
4858 { | 4858 { |
4859 Lisp_Object lispy_name; | 4859 Lisp_Object lispy_name; |
4860 | 4860 |
4861 lispy_name = build_string (fontname); | 4861 lispy_name = build_string (fontname); |
4871 x_calc_absolute_position (f) | 4871 x_calc_absolute_position (f) |
4872 struct frame *f; | 4872 struct frame *f; |
4873 { | 4873 { |
4874 Window win, child; | 4874 Window win, child; |
4875 int win_x = 0, win_y = 0; | 4875 int win_x = 0, win_y = 0; |
4876 int flags = f->display.x->size_hint_flags; | 4876 int flags = f->output_data.x->size_hint_flags; |
4877 int this_window; | 4877 int this_window; |
4878 | 4878 |
4879 #ifdef USE_X_TOOLKIT | 4879 #ifdef USE_X_TOOLKIT |
4880 this_window = XtWindow (f->display.x->widget); | 4880 this_window = XtWindow (f->output_data.x->widget); |
4881 #else | 4881 #else |
4882 this_window = FRAME_X_WINDOW (f); | 4882 this_window = FRAME_X_WINDOW (f); |
4883 #endif | 4883 #endif |
4884 | 4884 |
4885 /* Find the position of the outside upper-left corner of | 4885 /* Find the position of the outside upper-left corner of |
4886 the inner window, with respect to the outer window. */ | 4886 the inner window, with respect to the outer window. */ |
4887 if (f->display.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window) | 4887 if (f->output_data.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window) |
4888 { | 4888 { |
4889 BLOCK_INPUT; | 4889 BLOCK_INPUT; |
4890 XTranslateCoordinates (FRAME_X_DISPLAY (f), | 4890 XTranslateCoordinates (FRAME_X_DISPLAY (f), |
4891 | 4891 |
4892 /* From-window, to-window. */ | 4892 /* From-window, to-window. */ |
4893 this_window, | 4893 this_window, |
4894 f->display.x->parent_desc, | 4894 f->output_data.x->parent_desc, |
4895 | 4895 |
4896 /* From-position, to-position. */ | 4896 /* From-position, to-position. */ |
4897 0, 0, &win_x, &win_y, | 4897 0, 0, &win_x, &win_y, |
4898 | 4898 |
4899 /* Child of win. */ | 4899 /* Child of win. */ |
4902 } | 4902 } |
4903 | 4903 |
4904 /* Treat negative positions as relative to the leftmost bottommost | 4904 /* Treat negative positions as relative to the leftmost bottommost |
4905 position that fits on the screen. */ | 4905 position that fits on the screen. */ |
4906 if (flags & XNegative) | 4906 if (flags & XNegative) |
4907 f->display.x->left_pos = (FRAME_X_DISPLAY_INFO (f)->width | 4907 f->output_data.x->left_pos = (FRAME_X_DISPLAY_INFO (f)->width |
4908 - 2 * f->display.x->border_width - win_x | 4908 - 2 * f->output_data.x->border_width - win_x |
4909 - PIXEL_WIDTH (f) | 4909 - PIXEL_WIDTH (f) |
4910 + f->display.x->left_pos); | 4910 + f->output_data.x->left_pos); |
4911 | 4911 |
4912 if (flags & YNegative) | 4912 if (flags & YNegative) |
4913 f->display.x->top_pos = (FRAME_X_DISPLAY_INFO (f)->height | 4913 f->output_data.x->top_pos = (FRAME_X_DISPLAY_INFO (f)->height |
4914 - 2 * f->display.x->border_width - win_y | 4914 - 2 * f->output_data.x->border_width - win_y |
4915 - PIXEL_HEIGHT (f) | 4915 - PIXEL_HEIGHT (f) |
4916 - (FRAME_EXTERNAL_MENU_BAR (f) | 4916 - (FRAME_EXTERNAL_MENU_BAR (f) |
4917 ? f->display.x->menubar_height : 0) | 4917 ? f->output_data.x->menubar_height : 0) |
4918 + f->display.x->top_pos); | 4918 + f->output_data.x->top_pos); |
4919 /* The left_pos and top_pos | 4919 /* The left_pos and top_pos |
4920 are now relative to the top and left screen edges, | 4920 are now relative to the top and left screen edges, |
4921 so the flags should correspond. */ | 4921 so the flags should correspond. */ |
4922 f->display.x->size_hint_flags &= ~ (XNegative | YNegative); | 4922 f->output_data.x->size_hint_flags &= ~ (XNegative | YNegative); |
4923 } | 4923 } |
4924 | 4924 |
4925 /* CHANGE_GRAVITY is 1 when calling from Fset_frame_position, | 4925 /* CHANGE_GRAVITY is 1 when calling from Fset_frame_position, |
4926 to really change the position, and 0 when calling from | 4926 to really change the position, and 0 when calling from |
4927 x_make_frame_visible (in that case, XOFF and YOFF are the current | 4927 x_make_frame_visible (in that case, XOFF and YOFF are the current |
4935 { | 4935 { |
4936 int modified_top, modified_left; | 4936 int modified_top, modified_left; |
4937 | 4937 |
4938 if (change_gravity > 0) | 4938 if (change_gravity > 0) |
4939 { | 4939 { |
4940 f->display.x->top_pos = yoff; | 4940 f->output_data.x->top_pos = yoff; |
4941 f->display.x->left_pos = xoff; | 4941 f->output_data.x->left_pos = xoff; |
4942 f->display.x->size_hint_flags &= ~ (XNegative | YNegative); | 4942 f->output_data.x->size_hint_flags &= ~ (XNegative | YNegative); |
4943 if (xoff < 0) | 4943 if (xoff < 0) |
4944 f->display.x->size_hint_flags |= XNegative; | 4944 f->output_data.x->size_hint_flags |= XNegative; |
4945 if (yoff < 0) | 4945 if (yoff < 0) |
4946 f->display.x->size_hint_flags |= YNegative; | 4946 f->output_data.x->size_hint_flags |= YNegative; |
4947 f->display.x->win_gravity = NorthWestGravity; | 4947 f->output_data.x->win_gravity = NorthWestGravity; |
4948 } | 4948 } |
4949 x_calc_absolute_position (f); | 4949 x_calc_absolute_position (f); |
4950 | 4950 |
4951 BLOCK_INPUT; | 4951 BLOCK_INPUT; |
4952 x_wm_set_size_hint (f, (long) 0, 0); | 4952 x_wm_set_size_hint (f, (long) 0, 0); |
4953 | 4953 |
4954 /* It is a mystery why we need to add the border_width here | 4954 /* It is a mystery why we need to add the border_width here |
4955 when the frame is already visible, but experiment says we do. */ | 4955 when the frame is already visible, but experiment says we do. */ |
4956 modified_left = f->display.x->left_pos; | 4956 modified_left = f->output_data.x->left_pos; |
4957 modified_top = f->display.x->top_pos; | 4957 modified_top = f->output_data.x->top_pos; |
4958 if (change_gravity != 0) | 4958 if (change_gravity != 0) |
4959 { | 4959 { |
4960 modified_left += f->display.x->border_width; | 4960 modified_left += f->output_data.x->border_width; |
4961 modified_top += f->display.x->border_width; | 4961 modified_top += f->output_data.x->border_width; |
4962 } | 4962 } |
4963 | 4963 |
4964 #ifdef USE_X_TOOLKIT | 4964 #ifdef USE_X_TOOLKIT |
4965 XMoveWindow (FRAME_X_DISPLAY (f), XtWindow (f->display.x->widget), | 4965 XMoveWindow (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget), |
4966 modified_left, modified_top); | 4966 modified_left, modified_top); |
4967 #else /* not USE_X_TOOLKIT */ | 4967 #else /* not USE_X_TOOLKIT */ |
4968 XMoveWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 4968 XMoveWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
4969 modified_left, modified_top); | 4969 modified_left, modified_top); |
4970 #endif /* not USE_X_TOOLKIT */ | 4970 #endif /* not USE_X_TOOLKIT */ |
4989 { | 4989 { |
4990 /* The x and y position of the widget is clobbered by the | 4990 /* The x and y position of the widget is clobbered by the |
4991 call to XtSetValues within EmacsFrameSetCharSize. | 4991 call to XtSetValues within EmacsFrameSetCharSize. |
4992 This is a real kludge, but I don't understand Xt so I can't | 4992 This is a real kludge, but I don't understand Xt so I can't |
4993 figure out a correct fix. Can anyone else tell me? -- rms. */ | 4993 figure out a correct fix. Can anyone else tell me? -- rms. */ |
4994 int xpos = f->display.x->widget->core.x; | 4994 int xpos = f->output_data.x->widget->core.x; |
4995 int ypos = f->display.x->widget->core.y; | 4995 int ypos = f->output_data.x->widget->core.y; |
4996 EmacsFrameSetCharSize (f->display.x->edit_widget, cols, rows); | 4996 EmacsFrameSetCharSize (f->output_data.x->edit_widget, cols, rows); |
4997 f->display.x->widget->core.x = xpos; | 4997 f->output_data.x->widget->core.x = xpos; |
4998 f->display.x->widget->core.y = ypos; | 4998 f->output_data.x->widget->core.y = ypos; |
4999 } | 4999 } |
5000 UNBLOCK_INPUT; | 5000 UNBLOCK_INPUT; |
5001 | 5001 |
5002 #else /* not USE_X_TOOLKIT */ | 5002 #else /* not USE_X_TOOLKIT */ |
5003 | 5003 |
5004 BLOCK_INPUT; | 5004 BLOCK_INPUT; |
5005 | 5005 |
5006 check_frame_size (f, &rows, &cols); | 5006 check_frame_size (f, &rows, &cols); |
5007 f->display.x->vertical_scroll_bar_extra | 5007 f->output_data.x->vertical_scroll_bar_extra |
5008 = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f) | 5008 = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f) |
5009 ? 0 | 5009 ? 0 |
5010 : FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0 | 5010 : FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0 |
5011 ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f) | 5011 ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f) |
5012 : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->display.x->font))); | 5012 : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.x->font))); |
5013 pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols); | 5013 pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols); |
5014 pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows); | 5014 pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows); |
5015 | 5015 |
5016 f->display.x->win_gravity = NorthWestGravity; | 5016 f->output_data.x->win_gravity = NorthWestGravity; |
5017 x_wm_set_size_hint (f, (long) 0, 0); | 5017 x_wm_set_size_hint (f, (long) 0, 0); |
5018 | 5018 |
5019 XSync (FRAME_X_DISPLAY (f), False); | 5019 XSync (FRAME_X_DISPLAY (f), False); |
5020 XResizeWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 5020 XResizeWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
5021 pixelwidth, pixelheight); | 5021 pixelwidth, pixelheight); |
5060 struct frame *f; | 5060 struct frame *f; |
5061 int x, y; | 5061 int x, y; |
5062 { | 5062 { |
5063 int pix_x, pix_y; | 5063 int pix_x, pix_y; |
5064 | 5064 |
5065 pix_x = CHAR_TO_PIXEL_COL (f, x) + FONT_WIDTH (f->display.x->font) / 2; | 5065 pix_x = CHAR_TO_PIXEL_COL (f, x) + FONT_WIDTH (f->output_data.x->font) / 2; |
5066 pix_y = CHAR_TO_PIXEL_ROW (f, y) + f->display.x->line_height / 2; | 5066 pix_y = CHAR_TO_PIXEL_ROW (f, y) + f->output_data.x->line_height / 2; |
5067 | 5067 |
5068 if (pix_x < 0) pix_x = 0; | 5068 if (pix_x < 0) pix_x = 0; |
5069 if (pix_x > PIXEL_WIDTH (f)) pix_x = PIXEL_WIDTH (f); | 5069 if (pix_x > PIXEL_WIDTH (f)) pix_x = PIXEL_WIDTH (f); |
5070 | 5070 |
5071 if (pix_y < 0) pix_y = 0; | 5071 if (pix_y < 0) pix_y = 0; |
5127 { | 5127 { |
5128 if (f->async_visible) | 5128 if (f->async_visible) |
5129 { | 5129 { |
5130 BLOCK_INPUT; | 5130 BLOCK_INPUT; |
5131 #ifdef USE_X_TOOLKIT | 5131 #ifdef USE_X_TOOLKIT |
5132 XRaiseWindow (FRAME_X_DISPLAY (f), XtWindow (f->display.x->widget)); | 5132 XRaiseWindow (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget)); |
5133 #else /* not USE_X_TOOLKIT */ | 5133 #else /* not USE_X_TOOLKIT */ |
5134 XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); | 5134 XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); |
5135 #endif /* not USE_X_TOOLKIT */ | 5135 #endif /* not USE_X_TOOLKIT */ |
5136 XFlush (FRAME_X_DISPLAY (f)); | 5136 XFlush (FRAME_X_DISPLAY (f)); |
5137 UNBLOCK_INPUT; | 5137 UNBLOCK_INPUT; |
5145 { | 5145 { |
5146 if (f->async_visible) | 5146 if (f->async_visible) |
5147 { | 5147 { |
5148 BLOCK_INPUT; | 5148 BLOCK_INPUT; |
5149 #ifdef USE_X_TOOLKIT | 5149 #ifdef USE_X_TOOLKIT |
5150 XLowerWindow (FRAME_X_DISPLAY (f), XtWindow (f->display.x->widget)); | 5150 XLowerWindow (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget)); |
5151 #else /* not USE_X_TOOLKIT */ | 5151 #else /* not USE_X_TOOLKIT */ |
5152 XLowerWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); | 5152 XLowerWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); |
5153 #endif /* not USE_X_TOOLKIT */ | 5153 #endif /* not USE_X_TOOLKIT */ |
5154 XFlush (FRAME_X_DISPLAY (f)); | 5154 XFlush (FRAME_X_DISPLAY (f)); |
5155 UNBLOCK_INPUT; | 5155 UNBLOCK_INPUT; |
5193 /* We test FRAME_GARBAGED_P here to make sure we don't | 5193 /* We test FRAME_GARBAGED_P here to make sure we don't |
5194 call x_set_offset a second time | 5194 call x_set_offset a second time |
5195 if we get to x_make_frame_visible a second time | 5195 if we get to x_make_frame_visible a second time |
5196 before the window gets really visible. */ | 5196 before the window gets really visible. */ |
5197 if (! FRAME_ICONIFIED_P (f) | 5197 if (! FRAME_ICONIFIED_P (f) |
5198 && ! f->display.x->asked_for_visible) | 5198 && ! f->output_data.x->asked_for_visible) |
5199 x_set_offset (f, f->display.x->left_pos, f->display.x->top_pos, 0); | 5199 x_set_offset (f, f->output_data.x->left_pos, f->output_data.x->top_pos, 0); |
5200 | 5200 |
5201 f->display.x->asked_for_visible = 1; | 5201 f->output_data.x->asked_for_visible = 1; |
5202 | 5202 |
5203 if (! EQ (Vx_no_window_manager, Qt)) | 5203 if (! EQ (Vx_no_window_manager, Qt)) |
5204 x_wm_set_window_state (f, NormalState); | 5204 x_wm_set_window_state (f, NormalState); |
5205 #ifdef USE_X_TOOLKIT | 5205 #ifdef USE_X_TOOLKIT |
5206 /* This was XtPopup, but that did nothing for an iconified frame. */ | 5206 /* This was XtPopup, but that did nothing for an iconified frame. */ |
5207 XtMapWidget (f->display.x->widget); | 5207 XtMapWidget (f->output_data.x->widget); |
5208 #else /* not USE_X_TOOLKIT */ | 5208 #else /* not USE_X_TOOLKIT */ |
5209 XMapRaised (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); | 5209 XMapRaised (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); |
5210 #endif /* not USE_X_TOOLKIT */ | 5210 #endif /* not USE_X_TOOLKIT */ |
5211 #if 0 /* This seems to bring back scroll bars in the wrong places | 5211 #if 0 /* This seems to bring back scroll bars in the wrong places |
5212 if the window configuration has changed. They seem | 5212 if the window configuration has changed. They seem |
5274 int mask; | 5274 int mask; |
5275 Window window; | 5275 Window window; |
5276 | 5276 |
5277 #ifdef USE_X_TOOLKIT | 5277 #ifdef USE_X_TOOLKIT |
5278 /* Use the frame's outermost window, not the one we normally draw on. */ | 5278 /* Use the frame's outermost window, not the one we normally draw on. */ |
5279 window = XtWindow (f->display.x->widget); | 5279 window = XtWindow (f->output_data.x->widget); |
5280 #else /* not USE_X_TOOLKIT */ | 5280 #else /* not USE_X_TOOLKIT */ |
5281 window = FRAME_X_WINDOW (f); | 5281 window = FRAME_X_WINDOW (f); |
5282 #endif /* not USE_X_TOOLKIT */ | 5282 #endif /* not USE_X_TOOLKIT */ |
5283 | 5283 |
5284 /* Don't keep the highlight on an invisible frame. */ | 5284 /* Don't keep the highlight on an invisible frame. */ |
5375 if (! FRAME_VISIBLE_P (f)) | 5375 if (! FRAME_VISIBLE_P (f)) |
5376 { | 5376 { |
5377 if (! EQ (Vx_no_window_manager, Qt)) | 5377 if (! EQ (Vx_no_window_manager, Qt)) |
5378 x_wm_set_window_state (f, IconicState); | 5378 x_wm_set_window_state (f, IconicState); |
5379 /* This was XtPopup, but that did nothing for an iconified frame. */ | 5379 /* This was XtPopup, but that did nothing for an iconified frame. */ |
5380 XtMapWidget (f->display.x->widget); | 5380 XtMapWidget (f->output_data.x->widget); |
5381 UNBLOCK_INPUT; | 5381 UNBLOCK_INPUT; |
5382 return; | 5382 return; |
5383 } | 5383 } |
5384 | 5384 |
5385 result = XIconifyWindow (FRAME_X_DISPLAY (f), | 5385 result = XIconifyWindow (FRAME_X_DISPLAY (f), |
5386 XtWindow (f->display.x->widget), | 5386 XtWindow (f->output_data.x->widget), |
5387 DefaultScreen (FRAME_X_DISPLAY (f))); | 5387 DefaultScreen (FRAME_X_DISPLAY (f))); |
5388 UNBLOCK_INPUT; | 5388 UNBLOCK_INPUT; |
5389 | 5389 |
5390 if (!result) | 5390 if (!result) |
5391 error ("Can't notify window manager of iconification"); | 5391 error ("Can't notify window manager of iconification"); |
5398 #else /* not USE_X_TOOLKIT */ | 5398 #else /* not USE_X_TOOLKIT */ |
5399 | 5399 |
5400 /* Make sure the X server knows where the window should be positioned, | 5400 /* Make sure the X server knows where the window should be positioned, |
5401 in case the user deiconifies with the window manager. */ | 5401 in case the user deiconifies with the window manager. */ |
5402 if (! FRAME_VISIBLE_P (f) && !FRAME_ICONIFIED_P (f)) | 5402 if (! FRAME_VISIBLE_P (f) && !FRAME_ICONIFIED_P (f)) |
5403 x_set_offset (f, f->display.x->left_pos, f->display.x->top_pos, 0); | 5403 x_set_offset (f, f->output_data.x->left_pos, f->output_data.x->top_pos, 0); |
5404 | 5404 |
5405 /* Since we don't know which revision of X we're running, we'll use both | 5405 /* Since we don't know which revision of X we're running, we'll use both |
5406 the X11R3 and X11R4 techniques. I don't know if this is a good idea. */ | 5406 the X11R3 and X11R4 techniques. I don't know if this is a good idea. */ |
5407 | 5407 |
5408 /* X11R4: send a ClientMessage to the window manager using the | 5408 /* X11R4: send a ClientMessage to the window manager using the |
5451 { | 5451 { |
5452 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 5452 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
5453 | 5453 |
5454 BLOCK_INPUT; | 5454 BLOCK_INPUT; |
5455 | 5455 |
5456 if (f->display.x->icon_desc != 0) | 5456 if (f->output_data.x->icon_desc != 0) |
5457 XDestroyWindow (FRAME_X_DISPLAY (f), f->display.x->icon_desc); | 5457 XDestroyWindow (FRAME_X_DISPLAY (f), f->output_data.x->icon_desc); |
5458 XDestroyWindow (FRAME_X_DISPLAY (f), f->display.x->window_desc); | 5458 XDestroyWindow (FRAME_X_DISPLAY (f), f->output_data.x->window_desc); |
5459 #ifdef USE_X_TOOLKIT | 5459 #ifdef USE_X_TOOLKIT |
5460 XtDestroyWidget (f->display.x->widget); | 5460 XtDestroyWidget (f->output_data.x->widget); |
5461 free_frame_menubar (f); | 5461 free_frame_menubar (f); |
5462 #endif /* USE_X_TOOLKIT */ | 5462 #endif /* USE_X_TOOLKIT */ |
5463 | 5463 |
5464 free_frame_faces (f); | 5464 free_frame_faces (f); |
5465 XFlush (FRAME_X_DISPLAY (f)); | 5465 XFlush (FRAME_X_DISPLAY (f)); |
5466 | 5466 |
5467 xfree (f->display.x); | 5467 xfree (f->output_data.x); |
5468 f->display.x = 0; | 5468 f->output_data.x = 0; |
5469 if (f == dpyinfo->x_focus_frame) | 5469 if (f == dpyinfo->x_focus_frame) |
5470 dpyinfo->x_focus_frame = 0; | 5470 dpyinfo->x_focus_frame = 0; |
5471 if (f == dpyinfo->x_focus_event_frame) | 5471 if (f == dpyinfo->x_focus_event_frame) |
5472 dpyinfo->x_focus_event_frame = 0; | 5472 dpyinfo->x_focus_event_frame = 0; |
5473 if (f == dpyinfo->x_highlight_frame) | 5473 if (f == dpyinfo->x_highlight_frame) |
5504 | 5504 |
5505 #ifdef USE_X_TOOLKIT | 5505 #ifdef USE_X_TOOLKIT |
5506 Arg al[2]; | 5506 Arg al[2]; |
5507 int ac = 0; | 5507 int ac = 0; |
5508 Dimension widget_width, widget_height; | 5508 Dimension widget_width, widget_height; |
5509 Window window = XtWindow (f->display.x->widget); | 5509 Window window = XtWindow (f->output_data.x->widget); |
5510 #else /* not USE_X_TOOLKIT */ | 5510 #else /* not USE_X_TOOLKIT */ |
5511 Window window = FRAME_X_WINDOW (f); | 5511 Window window = FRAME_X_WINDOW (f); |
5512 #endif /* not USE_X_TOOLKIT */ | 5512 #endif /* not USE_X_TOOLKIT */ |
5513 | 5513 |
5514 /* Setting PMaxSize caused various problems. */ | 5514 /* Setting PMaxSize caused various problems. */ |
5515 size_hints.flags = PResizeInc | PMinSize /* | PMaxSize */; | 5515 size_hints.flags = PResizeInc | PMinSize /* | PMaxSize */; |
5516 | 5516 |
5517 flexlines = f->height; | 5517 flexlines = f->height; |
5518 | 5518 |
5519 size_hints.x = f->display.x->left_pos; | 5519 size_hints.x = f->output_data.x->left_pos; |
5520 size_hints.y = f->display.x->top_pos; | 5520 size_hints.y = f->output_data.x->top_pos; |
5521 | 5521 |
5522 #ifdef USE_X_TOOLKIT | 5522 #ifdef USE_X_TOOLKIT |
5523 XtSetArg (al[ac], XtNwidth, &widget_width); ac++; | 5523 XtSetArg (al[ac], XtNwidth, &widget_width); ac++; |
5524 XtSetArg (al[ac], XtNheight, &widget_height); ac++; | 5524 XtSetArg (al[ac], XtNheight, &widget_height); ac++; |
5525 XtGetValues (f->display.x->widget, al, ac); | 5525 XtGetValues (f->output_data.x->widget, al, ac); |
5526 size_hints.height = widget_height; | 5526 size_hints.height = widget_height; |
5527 size_hints.width = widget_width; | 5527 size_hints.width = widget_width; |
5528 #else /* not USE_X_TOOLKIT */ | 5528 #else /* not USE_X_TOOLKIT */ |
5529 size_hints.height = PIXEL_HEIGHT (f); | 5529 size_hints.height = PIXEL_HEIGHT (f); |
5530 size_hints.width = PIXEL_WIDTH (f); | 5530 size_hints.width = PIXEL_WIDTH (f); |
5531 #endif /* not USE_X_TOOLKIT */ | 5531 #endif /* not USE_X_TOOLKIT */ |
5532 | 5532 |
5533 size_hints.width_inc = FONT_WIDTH (f->display.x->font); | 5533 size_hints.width_inc = FONT_WIDTH (f->output_data.x->font); |
5534 size_hints.height_inc = f->display.x->line_height; | 5534 size_hints.height_inc = f->output_data.x->line_height; |
5535 size_hints.max_width | 5535 size_hints.max_width |
5536 = FRAME_X_DISPLAY_INFO (f)->width - CHAR_TO_PIXEL_WIDTH (f, 0); | 5536 = FRAME_X_DISPLAY_INFO (f)->width - CHAR_TO_PIXEL_WIDTH (f, 0); |
5537 size_hints.max_height | 5537 size_hints.max_height |
5538 = FRAME_X_DISPLAY_INFO (f)->height - CHAR_TO_PIXEL_HEIGHT (f, 0); | 5538 = FRAME_X_DISPLAY_INFO (f)->height - CHAR_TO_PIXEL_HEIGHT (f, 0); |
5539 | 5539 |
5618 } | 5618 } |
5619 | 5619 |
5620 no_read: | 5620 no_read: |
5621 | 5621 |
5622 #ifdef PWinGravity | 5622 #ifdef PWinGravity |
5623 size_hints.win_gravity = f->display.x->win_gravity; | 5623 size_hints.win_gravity = f->output_data.x->win_gravity; |
5624 size_hints.flags |= PWinGravity; | 5624 size_hints.flags |= PWinGravity; |
5625 | 5625 |
5626 if (user_position) | 5626 if (user_position) |
5627 { | 5627 { |
5628 size_hints.flags &= ~ PPosition; | 5628 size_hints.flags &= ~ PPosition; |
5644 { | 5644 { |
5645 #ifdef USE_X_TOOLKIT | 5645 #ifdef USE_X_TOOLKIT |
5646 Arg al[1]; | 5646 Arg al[1]; |
5647 | 5647 |
5648 XtSetArg (al[0], XtNinitialState, state); | 5648 XtSetArg (al[0], XtNinitialState, state); |
5649 XtSetValues (f->display.x->widget, al, 1); | 5649 XtSetValues (f->output_data.x->widget, al, 1); |
5650 #else /* not USE_X_TOOLKIT */ | 5650 #else /* not USE_X_TOOLKIT */ |
5651 Window window = FRAME_X_WINDOW (f); | 5651 Window window = FRAME_X_WINDOW (f); |
5652 | 5652 |
5653 f->display.x->wm_hints.flags |= StateHint; | 5653 f->output_data.x->wm_hints.flags |= StateHint; |
5654 f->display.x->wm_hints.initial_state = state; | 5654 f->output_data.x->wm_hints.initial_state = state; |
5655 | 5655 |
5656 XSetWMHints (FRAME_X_DISPLAY (f), window, &f->display.x->wm_hints); | 5656 XSetWMHints (FRAME_X_DISPLAY (f), window, &f->output_data.x->wm_hints); |
5657 #endif /* not USE_X_TOOLKIT */ | 5657 #endif /* not USE_X_TOOLKIT */ |
5658 } | 5658 } |
5659 | 5659 |
5660 x_wm_set_icon_pixmap (f, pixmap_id) | 5660 x_wm_set_icon_pixmap (f, pixmap_id) |
5661 struct frame *f; | 5661 struct frame *f; |
5662 int pixmap_id; | 5662 int pixmap_id; |
5663 { | 5663 { |
5664 #ifdef USE_X_TOOLKIT | 5664 #ifdef USE_X_TOOLKIT |
5665 Window window = XtWindow (f->display.x->widget); | 5665 Window window = XtWindow (f->output_data.x->widget); |
5666 #else | 5666 #else |
5667 Window window = FRAME_X_WINDOW (f); | 5667 Window window = FRAME_X_WINDOW (f); |
5668 #endif | 5668 #endif |
5669 | 5669 |
5670 if (pixmap_id > 0) | 5670 if (pixmap_id > 0) |
5671 { | 5671 { |
5672 Pixmap icon_pixmap = x_bitmap_pixmap (f, pixmap_id); | 5672 Pixmap icon_pixmap = x_bitmap_pixmap (f, pixmap_id); |
5673 f->display.x->wm_hints.icon_pixmap = icon_pixmap; | 5673 f->output_data.x->wm_hints.icon_pixmap = icon_pixmap; |
5674 } | 5674 } |
5675 else | 5675 else |
5676 f->display.x->wm_hints.icon_pixmap = None; | 5676 f->output_data.x->wm_hints.icon_pixmap = None; |
5677 | 5677 |
5678 f->display.x->wm_hints.flags |= IconPixmapHint; | 5678 f->output_data.x->wm_hints.flags |= IconPixmapHint; |
5679 XSetWMHints (FRAME_X_DISPLAY (f), window, &f->display.x->wm_hints); | 5679 XSetWMHints (FRAME_X_DISPLAY (f), window, &f->output_data.x->wm_hints); |
5680 } | 5680 } |
5681 | 5681 |
5682 x_wm_set_icon_position (f, icon_x, icon_y) | 5682 x_wm_set_icon_position (f, icon_x, icon_y) |
5683 struct frame *f; | 5683 struct frame *f; |
5684 int icon_x, icon_y; | 5684 int icon_x, icon_y; |
5685 { | 5685 { |
5686 #ifdef USE_X_TOOLKIT | 5686 #ifdef USE_X_TOOLKIT |
5687 Window window = XtWindow (f->display.x->widget); | 5687 Window window = XtWindow (f->output_data.x->widget); |
5688 #else | 5688 #else |
5689 Window window = FRAME_X_WINDOW (f); | 5689 Window window = FRAME_X_WINDOW (f); |
5690 #endif | 5690 #endif |
5691 | 5691 |
5692 f->display.x->wm_hints.flags |= IconPositionHint; | 5692 f->output_data.x->wm_hints.flags |= IconPositionHint; |
5693 f->display.x->wm_hints.icon_x = icon_x; | 5693 f->output_data.x->wm_hints.icon_x = icon_x; |
5694 f->display.x->wm_hints.icon_y = icon_y; | 5694 f->output_data.x->wm_hints.icon_y = icon_y; |
5695 | 5695 |
5696 XSetWMHints (FRAME_X_DISPLAY (f), window, &f->display.x->wm_hints); | 5696 XSetWMHints (FRAME_X_DISPLAY (f), window, &f->output_data.x->wm_hints); |
5697 } | 5697 } |
5698 | 5698 |
5699 | 5699 |
5700 /* Initialization. */ | 5700 /* Initialization. */ |
5701 | 5701 |