Changeset 1687
- Timestamp:
- 02/17/98 01:45:18 (11 years ago)
- Files:
-
- branches/GNU/src/w32inevt.c (modified) (4 diffs)
- branches/GNU/src/w32proc.c (modified) (3 diffs)
- branches/GNU/src/w32select.c (modified) (4 diffs)
- branches/GNU/src/w32term.c (modified) (26 diffs)
- branches/GNU/src/w32term.h (modified) (1 diff)
- branches/GNU/src/w32xfns.c (modified) (1 diff)
- branches/GNU/src/xdisp.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/GNU/src/w32inevt.c
r1663 r1687 49 49 /* from dispnew.c */ 50 50 extern int change_frame_size (FRAME_PTR, int, int, int, int); 51 52 /* from w32console.c */53 extern int w32_use_full_screen_buffer;54 51 55 52 /* from w32fns.c */ … … 624 621 } 625 622 626 static void627 maybe_generate_resize_event ()628 {629 CONSOLE_SCREEN_BUFFER_INFO info;630 FRAME_PTR f = get_frame ();631 632 GetConsoleScreenBufferInfo (GetStdHandle (STD_OUTPUT_HANDLE), &info);633 634 /* It is okay to call this unconditionally, since it will do nothing635 if the size hasn't actually changed. */636 change_frame_size (f,637 1 + info.srWindow.Bottom - info.srWindow.Top,638 1 + info.srWindow.Right - info.srWindow.Left,639 0, 0);640 }641 642 623 int 643 624 w32_console_read_socket (int sd, struct input_event *bufp, int numchars, … … 693 674 694 675 case WINDOW_BUFFER_SIZE_EVENT: 695 if (w32_use_full_screen_buffer) 696 resize_event (&queue_ptr->Event.WindowBufferSizeEvent); 676 resize_event (&queue_ptr->Event.WindowBufferSizeEvent); 697 677 break; 698 678 … … 710 690 break; 711 691 } 712 713 /* We don't get told about changes in the window size (only the buffer 714 size, which we no longer care about), so we have to check it 715 periodically. */ 716 if (!w32_use_full_screen_buffer) 717 maybe_generate_resize_event (); 718 692 719 693 UNBLOCK_INPUT; 720 694 return ret; branches/GNU/src/w32proc.c
r1663 r1687 1176 1176 } 1177 1177 1178 /* Wait for input or child death to be signalled. */ 1178 1179 start_time = GetTickCount (); 1179 1180 /* Wait for input or child death to be signalled. If user input is 1181 allowed, then also accept window messages. */ 1182 if (FD_ISSET (0, &orfds)) 1183 active = MsgWaitForMultipleObjects (nh + nc, wait_hnd, FALSE, timeout_ms, 1184 QS_ALLINPUT); 1185 else 1186 active = WaitForMultipleObjects (nh + nc, wait_hnd, FALSE, timeout_ms); 1180 active = WaitForMultipleObjects (nh + nc, wait_hnd, FALSE, timeout_ms); 1187 1181 1188 1182 if (active == WAIT_FAILED) … … 1220 1214 do 1221 1215 { 1222 if (active == nh + nc) 1223 { 1224 /* There are messages in the lisp thread's queue; we must 1225 drain the queue now to ensure they are processed promptly, 1226 because if we don't do so, we will not be woken again until 1227 further messages arrive. 1228 1229 NB. If ever we allow window message procedures to callback 1230 into lisp, we will need to ensure messages are dispatched 1231 at a safe time for lisp code to be run (*), and we may also 1232 want to provide some hooks in the dispatch loop to cater 1233 for modeless dialogs created by lisp (ie. to register 1234 window handles to pass to IsDialogMessage). 1235 1236 (*) Note that MsgWaitForMultipleObjects above is an 1237 internal dispatch point for messages that are sent to 1238 windows created by this thread. */ 1239 drain_message_queue (); 1240 } 1241 else if (active >= nh) 1216 if (active >= nh) 1242 1217 { 1243 1218 cp = cps[active - nh]; … … 1385 1360 1386 1361 foreground_window = GetForegroundWindow (); 1387 if (foreground_window )1362 if (foreground_window && SetForegroundWindow (cp->hwnd)) 1388 1363 { 1389 /* NT 5.0, and apparently also Windows 98, will not allow 1390 a Window to be set to foreground directly without the 1391 user's involvement. The workaround is to attach 1392 ourselves to the thread that owns the foreground 1393 window, since that is the only thread that can set the 1394 foreground window. */ 1395 DWORD foreground_thread, child_thread; 1396 foreground_thread = 1397 GetWindowThreadProcessId (foreground_window, NULL); 1398 if (foreground_thread == GetCurrentThreadId () 1399 || !AttachThreadInput (GetCurrentThreadId (), 1400 foreground_thread, TRUE)) 1401 foreground_thread = 0; 1402 1403 child_thread = GetWindowThreadProcessId (cp->hwnd, NULL); 1404 if (child_thread == GetCurrentThreadId () 1405 || !AttachThreadInput (GetCurrentThreadId (), 1406 child_thread, TRUE)) 1407 child_thread = 0; 1408 1409 /* Set the foreground window to the child. */ 1410 if (SetForegroundWindow (cp->hwnd)) 1411 { 1412 /* Generate keystrokes as if user had typed Ctrl-Break or 1413 Ctrl-C. */ 1414 keybd_event (VK_CONTROL, control_scan_code, 0, 0); 1415 keybd_event (vk_break_code, break_scan_code, 1416 (vk_break_code == 'C' ? 0 : KEYEVENTF_EXTENDEDKEY), 0); 1417 keybd_event (vk_break_code, break_scan_code, 1418 (vk_break_code == 'C' ? 0 : KEYEVENTF_EXTENDEDKEY) 1419 | KEYEVENTF_KEYUP, 0); 1420 keybd_event (VK_CONTROL, control_scan_code, 1421 KEYEVENTF_KEYUP, 0); 1422 1423 /* Sleep for a bit to give time for Emacs frame to respond 1424 to focus change events (if Emacs was active app). */ 1425 Sleep (100); 1426 1427 SetForegroundWindow (foreground_window); 1428 } 1429 /* Detach from the foreground and child threads now that 1430 the foreground switching is over. */ 1431 if (foreground_thread) 1432 AttachThreadInput (GetCurrentThreadId (), 1433 foreground_thread, FALSE); 1434 if (child_thread) 1435 AttachThreadInput (GetCurrentThreadId (), 1436 child_thread, FALSE); 1437 } 1438 } 1364 /* Generate keystrokes as if user had typed Ctrl-Break or 1365 Ctrl-C. */ 1366 keybd_event (VK_CONTROL, control_scan_code, 0, 0); 1367 keybd_event (vk_break_code, break_scan_code, 1368 (vk_break_code == 'C' ? 0 : KEYEVENTF_EXTENDEDKEY), 0); 1369 keybd_event (vk_break_code, break_scan_code, 1370 (vk_break_code == 'C' ? 0 : KEYEVENTF_EXTENDEDKEY) 1371 | KEYEVENTF_KEYUP, 0); 1372 keybd_event (VK_CONTROL, control_scan_code, KEYEVENTF_KEYUP, 0); 1373 1374 /* Sleep for a bit to give time for Emacs frame to respond 1375 to focus change events (if Emacs was active app). */ 1376 Sleep (10); 1377 1378 SetForegroundWindow (foreground_window); 1379 } 1380 } 1439 1381 /* Ctrl-Break is NT equivalent of SIGINT. */ 1440 1382 else if (!GenerateConsoleCtrlEvent (CTRL_BREAK_EVENT, pid)) branches/GNU/src/w32select.c
r1667 r1687 100 100 HANDLE htext; 101 101 int nbytes; 102 int truelen , nlines = 0;102 int truelen; 103 103 unsigned char *src; 104 104 unsigned char *dst; 105 105 106 106 CHECK_STRING (string, 0); 107 107 … … 113 113 nbytes = STRING_BYTES (XSTRING (string)) + 1; 114 114 src = XSTRING (string)->data; 115 dst = src;116 117 /* We need to know how many lines there are, since we need CRLF line118 termination for compatibility with other Windows Programs.119 avoid using strchr because it recomputes the length every time */120 while ((dst = memchr (dst, '\n', nbytes - (dst - src))) != NULL)121 {122 nlines++;123 dst++;124 }125 115 126 116 { … … 145 135 while Emacs uses just LF internally). */ 146 136 147 truelen = nbytes + nlines; 137 truelen = nbytes; 138 dst = src; 139 /* avoid using strchr because it recomputes the length everytime */ 140 while ((dst = memchr (dst, '\n', nbytes - (dst - src))) != NULL) 141 { 142 truelen++; 143 dst++; 144 } 148 145 149 146 if ((htext = GlobalAlloc (GMEM_MOVEABLE | GMEM_DDESHARE, truelen)) == NULL) … … 195 192 Vnext_selection_coding_system = Qnil; 196 193 coding.mode |= CODING_MODE_LAST_BLOCK; 197 bufsize = encoding_buffer_size (&coding, nbytes) + nlines;194 bufsize = encoding_buffer_size (&coding, nbytes); 198 195 if ((htext = GlobalAlloc (GMEM_MOVEABLE | GMEM_DDESHARE, bufsize)) == NULL) 199 196 goto error; branches/GNU/src/w32term.c
r1667 r1687 543 543 (ch & 0x00ff) 544 544 545 #define W32_TEXTOUT(start_offset,nchars) \546 { \547 int charset_dim = CHARSET_DIMENSION(charset); \548 if (font->bdf) \549 w32_BDF_TextOut (font->bdf, hdc, left + xoffset, \550 top + yoffset, \551 x_1byte_buffer + start_offset, \552 charset_dim, nchars, 0); \553 else if (print_via_unicode) \554 ExtTextOutW (hdc, left + xoffset, top + yoffset, \555 fuOptions, clip_region, \556 x_2byte_buffer + start_offset, nchars, NULL); \557 else \558 ExtTextOut (hdc, left + xoffset, top + yoffset, \559 fuOptions, clip_region, \560 x_1byte_buffer + start_offset, \561 nchars * charset_dim, NULL); \562 start_offset += nchars * (print_via_unicode ? 1 : charset_dim ); \563 xoffset += nchars * glyph_width; \564 }565 545 566 546 /* Display a sequence of N glyphs found at GP. … … 710 690 3) Drawing a composite character. 711 691 4) Font has non-zero _MULE_BASELINE_OFFSET property. 712 5) Font is a bdf font.713 692 After filling background, we draw glyphs by XDrawString16. */ 714 693 int background_filled; … … 720 699 /* 1 if we find no font or a font of inappropriate size. */ 721 700 int require_clipping; 722 RECT clip_rectangle;723 LPRECT clip_region = NULL;724 UINT fuOptions = 0;725 726 701 int codepage = CP_DEFAULT; 727 702 BOOL print_via_unicode = FALSE; … … 770 745 font = (XFontStruct *) (fontp->font); 771 746 codepage = w32_codepage_for_font (fontp->name); 772 773 if ( font && !font->bdf ) 774 print_via_unicode = w32_use_unicode_for_codepage (codepage); 775 776 baseline = FONT_BASE (font) + fontp->baseline_offset; 747 print_via_unicode = w32_use_unicode_for_codepage (codepage); 748 749 /* tmLastChar will only exceed 255 if TEXTMETRICW is used 750 (ie on NT but not on 95). In this case there is no harm 751 in being wrong, so have a go anyway. */ 752 baseline = 753 (font->tm.tmLastChar > 255 754 ? (line_height + font->tm.tmAscent - font->tm.tmDescent) / 2 755 : f->output_data.w32->font_baseline - fontp->baseline_offset); 756 if (FONT_HEIGHT (font) <= line_height 757 && (font->tm.tmAscent > baseline 758 || font->tm.tmDescent > line_height - baseline)) 759 /* Adjust baseline for this font to show the whole 760 glyphs in a line. */ 761 baseline = line_height - font->tm.tmDescent; 777 762 778 763 if (cmpcharp && cmpcharp->cmp_rule == NULL) … … 824 809 } 825 810 } 811 /* Japanese Kanji are a special case under w32, as they 812 must be printed in SJIS rather than EUC. */ 813 else if ((charset == charset_jisx0208) 814 || (charset == charset_jisx0208_1978) 815 || (charset == charset_id_internal ("japanese-jisx0212"))) 816 { 817 int sjis1, sjis2; 818 for (cp = x_2byte_buffer; cp < x_2byte_buffer + len; cp++) 819 { 820 ENCODE_SJIS (BYTE1 (*cp), BYTE2 (*cp), sjis1, sjis2); 821 *cp = BUILD_WCHAR_T (sjis1, sjis2); 822 } 823 } 826 824 else if (fontp->encoding[charset]) 827 825 { … … 834 832 for (cp = x_2byte_buffer; cp < x_2byte_buffer + len; cp++) 835 833 *cp = BUILD_WCHAR_T (BYTE1 (*cp), BYTE2 (*cp) | 0x80); 836 /* Special encoding for SJIS Kanji. */837 if (enc == 4)838 {839 if (CHARSET_DIMENSION (charset) == 2)840 {841 int sjis1, sjis2;842 for (cp = x_2byte_buffer;843 cp < x_2byte_buffer + len; cp++)844 {845 ENCODE_SJIS (BYTE1 (*cp), BYTE2 (*cp),846 sjis1, sjis2);847 *cp = BUILD_WCHAR_T (sjis1, sjis2);848 }849 }850 else851 for (cp = x_2byte_buffer;852 cp < x_2byte_buffer + len; cp++)853 *cp = BUILD_WCHAR_T (BYTE1 (*cp),854 BYTE2 (*cp) | 0x80);855 }856 834 } 857 835 } … … 867 845 if (charset == charset_latin_iso8859_1) 868 846 { 869 if ( !font->bdf &&font->tm.tmLastChar < 0x80)847 if (font->tm.tmLastChar < 0x80) 870 848 /* This font can't display Latin1 characters. */ 871 849 font = NULL; … … 934 912 if (font) 935 913 require_clipping = (!NILP (Vclip_large_size_font) 936 && ((font->bdf 937 ? (font->bdf->ury > baseline 938 || font->bdf->lly > line_height - baseline) 939 : (font->tm.tmAscent > baseline 940 || font->tm.tmDescent > line_height - baseline)) 941 || (!cmpcharp && FONT_MAX_WIDTH (font) > glyph_width))); 914 && (font->tm.tmAscent > baseline 915 || font->tm.tmDescent > 916 line_height - baseline 917 || (!cmpcharp 918 && FONT_MAX_WIDTH (font) > glyph_width))); 942 919 943 920 if (font && (just_foreground || (cmpcharp && gidx > 0))) … … 947 924 948 925 else if (!font 949 || font->bdf950 926 || FONT_HEIGHT (font) < line_height 951 927 || FONT_WIDTH (font) < glyph_width … … 971 947 SetTextColor (hdc, fg); 972 948 SetBkColor (hdc, bg); 973 SetTextAlign (hdc, TA_BASELINE | TA_LEFT); 974 975 if (print_via_unicode) 949 950 if ( print_via_unicode ) 976 951 n_chars = MultiByteToWideChar 977 952 (codepage, 0, x_1byte_buffer, n_chars, … … 980 955 if (font) 981 956 { 982 if (font->hfont)983 957 SelectObject (hdc, font->hfont); 984 958 985 959 if (!cmpcharp) 986 960 { 987 int xoffset = 0, yoffset = baseline;961 int multibyte_pos_offset = 0; 988 962 if (require_clipping || FONT_WIDTH (font) != glyph_width 989 963 || FONT_MAX_WIDTH (font) != FONT_WIDTH (font)) 990 964 { 991 /* The incrementing of i in this loop is done 992 inside the W32_CHAROUT macro. */ 993 for (i = 0; i < n_chars; ) 965 RECT clip_rectangle; 966 LPRECT clip_region = NULL; 967 UINT fuOptions = 0; 968 969 for (i = 0; i < n_chars; i++) 994 970 { 995 971 if (require_clipping) … … 1004 980 clip_region = &clip_rectangle; 1005 981 } 1006 W32_TEXTOUT (i, 1); 982 983 /* baseline works differently on w32 than X, 984 leave it out for now. */ 985 if (print_via_unicode) 986 ExtTextOutW (hdc, left + glyph_width * i, 987 top /*+ baseline*/, fuOptions, 988 clip_region, x_2byte_buffer + i, 989 1, NULL); 990 else if (CHARSET_DIMENSION (charset) > 1) 991 { 992 /* Keep character together */ 993 int n = CHARSET_DIMENSION (charset) ; 994 ExtTextOut (hdc, left + multibyte_pos_offset, 995 top /*+ baseline*/, fuOptions, 996 clip_region, x_1byte_buffer + i, 997 n, NULL); 998 /* fiddle i. */ 999 i += n - 1; 1000 multibyte_pos_offset += glyph_width; 1001 } 1002 else 1003 ExtTextOut (hdc, left + glyph_width * i, 1004 top /*+ baseline*/, fuOptions, 1005 clip_region, x_1byte_buffer + i, 1006 1, NULL); 1007 1007 } 1008 1008 } 1009 1009 else 1010 1010 { 1011 i = 0; 1012 W32_TEXTOUT (i, n_chars); 1011 /* Print the whole run of characters. */ 1012 if (print_via_unicode) 1013 TextOutW (hdc, left, top /*+ baseline*/, 1014 x_2byte_buffer, n_chars); 1015 else 1016 TextOut (hdc, left, top /*+ baseline*/, 1017 x_1byte_buffer, n_chars); 1013 1018 } 1014 1019 } … … 1038 1043 HIGHEST is the highest position of glyphs ever 1039 1044 written, LOWEST the lowest position. */ 1040 int xoffset = 0; 1041 int yoffset = baseline; 1042 int start = 0; 1045 int x_offset = 0; 1043 1046 1044 1047 if (default_ascent … … 1049 1052 lowest = 0; 1050 1053 } 1051 /* TODO: per char metrics for Truetype and BDF 1052 fonts. */ 1054 else 1053 1055 { 1054 highest = FONT_BASE (font) + 1; 1055 lowest = - (FONT_HEIGHT (font) - FONT_BASE (font)); 1056 /* Per char metrics not supported on w32 - use 1057 font's metrics. */ 1058 highest = font->tm.tmAscent + 1; 1059 lowest = - font->tm.tmDescent; 1056 1060 } 1057 1061 1058 1062 if (cmpcharp->cmp_rule) 1059 x offset = (int)(cmpcharp->col_offset[0]1063 x_offset = (int)(cmpcharp->col_offset[0] 1060 1064 * FONT_WIDTH (FRAME_FONT (f))); 1061 1065 … … 1077 1081 char_width = char_placement.abcA 1078 1082 + char_placement.abcB + char_placement.abcC; 1079 x offset += FONT_WIDTH (font) - char_width;1083 x_offset += FONT_WIDTH (font) - char_width; 1080 1084 } 1081 1085 /* Don't let characters go beyond the glyph 1082 1086 boundary whatever their over/underhangs. */ 1083 if (xoffset > glyph_width - char_width) 1084 xoffset = glyph_width - char_width; 1085 1086 if (xoffset < 0) 1087 xoffset = 0; 1088 1089 /* Draw the first character at the normal 1090 position. */ 1091 W32_TEXTOUT (start, 1); 1087 if (x_offset > glyph_width - char_width) 1088 x_offset = glyph_width - char_width; 1089 1090 if (x_offset < 0) 1091 x_offset = 0; 1092 1093 /* Draw the first character at the normal position. */ 1094 if (print_via_unicode) 1095 ExtTextOutW (hdc, left + x_offset, 1096 top /*+ baseline*/, 1097 fuOptions, clip_region, 1098 x_2byte_buffer, 1, NULL); 1099 else if (CHARSET_DIMENSION (charset) > 1) 1100 { 1101 /* Keep character together */ 1102 int n = CHARSET_DIMENSION (charset) ; 1103 ExtTextOut (hdc, left + x_offset, 1104 top /*+ baseline*/, 1105 fuOptions, clip_region, 1106 x_1byte_buffer, n, NULL); 1107 /* fiddle i. */ 1108 i += n - 1; 1109 } 1110 else 1111 ExtTextOut (hdc, left + x_offset, 1112 top /*+ baseline*/, 1113 fuOptions, clip_region, 1114 x_1byte_buffer, 1, NULL); 1092 1115 gidx++; 1093 1116 } … … 1095 1118 i = 0; 1096 1119 1097 for (; i < n_chars; gidx++)1120 for (; i < n_chars; i++, gidx++) 1098 1121 { 1099 int x offset = 0, yoffset = FONT_BASE (font);1122 int x_offset = 0, y_offset = 0; 1100 1123 1101 1124 if (relative_compose) … … 1106 1129 make_number (cmpcharp->glyph[gidx])))) 1107 1130 { 1108 if (- (FONT_HEIGHT (font) - FONT_BASE (font)) 1109 >= relative_compose) 1131 if (- font->tm.tmDescent >= relative_compose) 1110 1132 { 1111 1133 /* Draw above the current glyphs. */ 1112 yoffset = highest + FONT_HEIGHT (font); 1113 highest += FONT_HEIGHT (font); 1134 y_offset = highest + font->tm.tmDescent; 1135 highest += font->tm.tmAscent 1136 + font->tm.tmDescent; 1114 1137 } 1115 else if ( FONT_BASE (font)<= 0)1138 else if (font->tm.tmAscent <= 0) 1116 1139 { 1117 1140 /* Draw beneath the current glyphs. */ 1118 yoffset = lowest; 1119 lowest -= FONT_HEIGHT (font); 1141 y_offset = lowest - font->tm.tmAscent; 1142 lowest -= font->tm.tmAscent 1143 + font->tm.tmDescent; 1120 1144 } 1121 1145 } … … 1125 1149 it sticks out of HIGHEST or LOWEST, 1126 1150 update them appropriately. */ 1127 if (FONT_BASE (font) > highest) 1128 highest = FONT_BASE (font); 1129 else if (- (FONT_HEIGHT (font) - FONT_BASE (font)) 1130 < lowest) 1131 lowest = - (FONT_HEIGHT (font) - 1132 FONT_BASE (font)); 1151 if (font->tm.tmAscent > highest) 1152 highest = font->tm.tmAscent; 1153 else if (- font->tm.tmDescent < lowest) 1154 lowest = - font->tm.tmDescent; 1133 1155 } 1134 1156 } … … 1149 1171 : gref == 2 ? lowest 1150 1172 : (highest + lowest) / 2) 1151 - (nref == 0 ? FONT_HEIGHT (font)1152 : nref == 1 ? (FONT_HEIGHT (font) - 1153 FONT_BASE (font)) 1173 - (nref == 0 ? font->tm.tmAscent 1174 + font->tm.tmDescent 1175 : nref == 1 ? font->tm.tmDescent 1154 1176 : nref == 2 ? 0 1155 : (FONT_HEIGHT (font) / 2))); 1156 top = bottom + FONT_HEIGHT (font); 1157 1177 : (font->tm.tmAscent + 1178 font->tm.tmDescent) / 2)); 1179 top = bottom + (font->tm.tmAscent + 1180 font->tm.tmDescent); 1158 1181 if (top > highest) 1159 1182 highest = top; 1160 1183 if (bottom < lowest) 1161 1184 lowest = bottom; 1162 y offset = bottom + FONT_HEIGHT (font);1163 x offset = (int)(cmpcharp->col_offset[gidx]1185 y_offset = bottom + font->tm.tmDescent; 1186 x_offset = (int)(cmpcharp->col_offset[gidx] 1164 1187 * FONT_WIDTH (FRAME_FONT(f))); 1165 1188 } … … 1180 1203 char_width = char_placement.abcA 1181 1204 + char_placement.abcB + char_placement.abcC; 1182 x offset += FONT_WIDTH (font) - char_width;1205 x_offset += FONT_WIDTH (font) - char_width; 1183 1206 } 1184 1207 /* Don't let characters go beyond the glyph 1185 1208 boundary whatever their over/underhangs. */ 1186 if (xoffset > glyph_width - char_width) 1187 xoffset = glyph_width - char_width; 1188 1189 if (xoffset < 0) 1190 xoffset = 0; 1191 1192 W32_TEXTOUT (i, 1); 1209 if (x_offset > glyph_width - char_width) 1210 x_offset = glyph_width - char_width; 1211 1212 if (x_offset < 0) 1213 x_offset = 0; 1214 1215 if (print_via_unicode) 1216 ExtTextOutW (hdc, left + x_offset, 1217 top /*+ baseline - y_offset*/, 1218 fuOptions, clip_region, 1219 x_2byte_buffer + i, 1, NULL); 1220 else if (CHARSET_DIMENSION (charset) > 1) 1221 { 1222 /* Keep character together */ 1223 int n = CHARSET_DIMENSION (charset) ; 1224 ExtTextOut (hdc, left + x_offset, 1225 top /*+ baseline - y_offset*/, 1226 fuOptions, clip_region, 1227 x_1byte_buffer + i, n, NULL); 1228 /* fiddle i. */ 1229 i += n - 1; 1230 } 1231 else 1232 ExtTextOut (hdc, left + x_offset, 1233 top /*+ baseline - y_offset*/, 1234 fuOptions, clip_region, 1235 x_1byte_buffer + i, 1, NULL); 1193 1236 } 1194 1237 } … … 1224 1267 int underline_position = 1; 1225 1268 1226 if (FONT_HEIGHT (FRAME_FONT (f)) - FONT_BASE(FRAME_FONT (f)) 1227 <= underline_position) 1228 underline_position = (FONT_HEIGHT (FRAME_FONT (f)) - 1229 FONT_BASE(FRAME_FONT (f))) - 1; 1269 if (FRAME_FONT (f)->tm.tmDescent <= underline_position) 1270 underline_position = FRAME_FONT (f)->tm.tmDescent - 1; 1230 1271 1231 1272 if (face->underline) … … 1973 2014 result->modifiers = msg->dwModifiers; 1974 2015 1975 hdrop = (HDROP) msg->msg.wParam;1976 DragQueryPoint (hdrop, &p);1977 1978 2016 p.x = LOWORD (msg->msg.lParam); 1979 2017 p.y = HIWORD (msg->msg.lParam); … … 1982 2020 XSETINT (result->y, p.y); 1983 2021 2022 hdrop = (HDROP) msg->msg.wParam; 2023 DragQueryPoint (hdrop, &p); 1984 2024 num_files = DragQueryFile (hdrop, 0xFFFFFFFF, NULL, 0); 1985 2025 files = Qnil; … … 4139 4179 FRAME_FONT (f) = (XFontStruct *) (fontp->font); 4140 4180 f->output_data.w32->font_baseline 4141 = F ONT_BASE (FRAME_FONT (f))+ fontp->baseline_offset;4181 = FRAME_FONT(f)->tm.tmAscent + fontp->baseline_offset; 4142 4182 FRAME_FONTSET (f) = -1; 4143 4183 … … 5116 5156 w32_enable_unicode_output = 1; 5117 5157 5158 /* w32-charset-to-codepage-alist is initialized in w32-win.el. */ 5118 5159 DEFVAR_LISP ("w32-charset-to-codepage-alist", 5119 5160 &Vw32_charset_to_codepage_alist, … … 5129 5170 XSETFASTINT (codepage, 949); 5130 5171 store_in_alist (&Vw32_charset_to_codepage_alist, 5131 build_string ("ksc5601.1987"), codepage); 5132 XSETFASTINT (codepage, 1361); 5172 build_string ("ksc5601"), codepage); 5173 XSETFASTINT (codepage, 932); 5174 /* SJIS only contains a subset of JISX0212, but list it anyway. */ 5133 5175 store_in_alist (&Vw32_charset_to_codepage_alist, 5134 build_string (" ksc5601.1992"), codepage);5176 build_string ("jisx0212-sjis"), codepage); 5135 5177 XSETFASTINT (codepage, 932); 5136 5178 store_in_alist (&Vw32_charset_to_codepage_alist, branches/GNU/src/w32term.h
r1667 r1687 29 29 #define WHITE_PIX_DEFAULT(f) PALETTERGB(255,255,255) 30 30 31 #define FONT_WIDTH(f) \ 32 ((f)->bdf ? (f)->bdf->width : (f)->tm.tmAveCharWidth) 33 #define FONT_HEIGHT(f) \ 34 ((f)->bdf ? (f)->bdf->height : (f)->tm.tmHeight) 35 /* No idea why 5 seems to work in here, but it does */ 36 #define FONT_BASE(f) \ 37 ((f)->bdf ? (f)->bdf->ury : (f)->tm.tmAscent) 38 #define FONT_MAX_WIDTH(f) \ 39 ((f)->bdf ? (f)->bdf->width : (f)->tm.tmMaxCharWidth) 31 #define FONT_WIDTH(f) ((f)->tm.tmAveCharWidth) 32 #define FONT_HEIGHT(f) ((f)->tm.tmHeight) 33 #define FONT_BASE(f) ((f)->tm.tmAscent) 34 #define FONT_MAX_WIDTH(f) ((f)->tm.tmMaxCharWidth) 40 35 41 36 #define CHECK_W32_FRAME(f, frame) \ branches/GNU/src/w32xfns.c
r1663 r1687 239 239 return (TRUE); 240 240 } 241 242 /* Process all messages in the current thread's queue. */243 void244 drain_message_queue ()245 {246 MSG msg;247 while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))248 {249 TranslateMessage (&msg);250 DispatchMessage (&msg);251 }252 }253 254 241 255 242 /* branches/GNU/src/xdisp.c
r1667 r1687 2090 2090 - (last_point_x + hscroll - !! hscroll)); 2091 2091 2092 pos = *compute_motion (last_point, last_point_y, last_point_x, 1,2092 pos = *compute_motion (last_point, last_point_y, last_point_x, 0, 2093 2093 PT, height, 2094 2094 /* BUG FIX: See the comment of … … 2899 2899 2900 2900 val.bytepos = pos_byte; 2901 val.ovstring_chars_done = 0;2902 2901 2903 2902 /* Redisplay the lines where the text was changed */ … … 3458 3457 ovlen -= ovstr_done; 3459 3458 3460 while (ovlen > 0 && p1 < endp)3459 while (ovlen > 0) 3461 3460 { 3462 3461 int charset, cols; … … 4558 4557 type of CODING_SYSTEM. Return updated pointer into BUF. */ 4559 4558 4560 static char invalid_eol_type[] = "(*invalid*)";4561 4562 4559 static char * 4563 4560 decode_mode_spec_coding (coding_system, buf, eol_flag) … … 4568 4565 Lisp_Object val; 4569 4566 int multibyte = !NILP (current_buffer->enable_multibyte_characters); 4570 unsigned char *eol_str;4571 int eol_str_len;4572 /* The EOL conversion we are using. */4573 Lisp_Object eoltype;4574 4567 4575 4568 val = coding_system; … … 4580 4573 *buf++ = '-'; 4581 4574 if (eol_flag) 4582 eoltype= eol_mnemonic_undecided;4575 *buf++ = eol_mnemonic_undecided; 4583 4576 /* Don't mention EOL conversion if it isn't decided. */ 4584 4577 } … … 4601 4594 if (eol_flag) 4602 4595 { 4596 /* The EOL conversion we are using. */ 4597 int eoltype; 4603 4598 /* The EOL conversion that is normal on this system. */ <
