diff options
| author | Jason Rumney | 2000-10-31 12:42:51 +0000 |
|---|---|---|
| committer | Jason Rumney | 2000-10-31 12:42:51 +0000 |
| commit | 01b220b61ab1e1790b998a7e7a75a03cd0ef4188 (patch) | |
| tree | 10a8ea4021bcc769c196a6a746368bd851452a13 /src | |
| parent | 4edc4a39e6546f643d5d17bae067b3cf8fe8ce31 (diff) | |
| download | emacs-01b220b61ab1e1790b998a7e7a75a03cd0ef4188.tar.gz emacs-01b220b61ab1e1790b998a7e7a75a03cd0ef4188.zip | |
(x_produce_glyphs): Handle composite characters.
(x_draw_glyph_string_foreground)
(x_draw_composite_glyph_string_foreground): Restore old font.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/w32term.c | 343 |
2 files changed, 321 insertions, 28 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index fd0fac81b21..a1730161457 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2000-10-31 Jason Rumney <jasonr@gnu.org> | ||
| 2 | |||
| 3 | * w32term.c (x_produce_glyphs): Handle composite characters. | ||
| 4 | (x_draw_glyph_string_foreground) | ||
| 5 | (x_draw_composite_glyph_string_foreground): Restore old font. | ||
| 6 | |||
| 1 | 2000-10-31 Miles Bader <miles@lsi.nec.co.jp> | 7 | 2000-10-31 Miles Bader <miles@lsi.nec.co.jp> |
| 2 | 8 | ||
| 3 | * minibuf.c (read_minibuf): Reset the undo history just before | 9 | * minibuf.c (read_minibuf): Reset the undo history just before |
diff --git a/src/w32term.c b/src/w32term.c index 5a2b1bdeb10..aa2ce4980ff 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -1165,9 +1165,6 @@ w32_native_per_char_metric (font, char2b, font_type, pcm) | |||
| 1165 | enum w32_char_font_type font_type; | 1165 | enum w32_char_font_type font_type; |
| 1166 | XCharStruct * pcm; | 1166 | XCharStruct * pcm; |
| 1167 | { | 1167 | { |
| 1168 | /* NTEMACS_TODO: Use GetGlyphOutline where possible (no Unicode | ||
| 1169 | version on W9x) */ | ||
| 1170 | |||
| 1171 | HDC hdc = GetDC (NULL); | 1168 | HDC hdc = GetDC (NULL); |
| 1172 | HFONT old_font; | 1169 | HFONT old_font; |
| 1173 | BOOL retval = FALSE; | 1170 | BOOL retval = FALSE; |
| @@ -1205,6 +1202,11 @@ w32_native_per_char_metric (font, char2b, font_type, pcm) | |||
| 1205 | though - we can call GetTextExtentPoint32 to get rbearing and | 1202 | though - we can call GetTextExtentPoint32 to get rbearing and |
| 1206 | deduce width based on the font's per-string overhang. lbearing | 1203 | deduce width based on the font's per-string overhang. lbearing |
| 1207 | is assumed to be zero. */ | 1204 | is assumed to be zero. */ |
| 1205 | |||
| 1206 | /* TODO: Some Thai characters (and other composites if Windows | ||
| 1207 | supports them) do have lbearing, and report their total width | ||
| 1208 | as zero. Need some way of handling them when | ||
| 1209 | GetCharABCWidthsW fails. */ | ||
| 1208 | SIZE sz; | 1210 | SIZE sz; |
| 1209 | 1211 | ||
| 1210 | if (font_type == UNICODE_FONT) | 1212 | if (font_type == UNICODE_FONT) |
| @@ -2191,7 +2193,283 @@ x_produce_glyphs (it) | |||
| 2191 | } | 2193 | } |
| 2192 | else if (it->what == IT_COMPOSITION) | 2194 | else if (it->what == IT_COMPOSITION) |
| 2193 | { | 2195 | { |
| 2194 | /* NTEMACS_TODO: Composite glyphs. */ | 2196 | /* Note: A composition is represented as one glyph in the |
| 2197 | glyph matrix. There are no padding glyphs. */ | ||
| 2198 | wchar_t char2b; | ||
| 2199 | XFontStruct *font; | ||
| 2200 | struct face *face = FACE_FROM_ID (it->f, it->face_id); | ||
| 2201 | XCharStruct *pcm; | ||
| 2202 | int font_not_found_p; | ||
| 2203 | struct font_info *font_info; | ||
| 2204 | int boff; /* baseline offset */ | ||
| 2205 | struct composition *cmp = composition_table[it->cmp_id]; | ||
| 2206 | |||
| 2207 | /* Maybe translate single-byte characters to multibyte. */ | ||
| 2208 | it->char_to_display = it->c; | ||
| 2209 | if (unibyte_display_via_language_environment | ||
| 2210 | && SINGLE_BYTE_CHAR_P (it->c) | ||
| 2211 | && (it->c >= 0240 | ||
| 2212 | || (it->c >= 0200 | ||
| 2213 | && !NILP (Vnonascii_translation_table)))) | ||
| 2214 | { | ||
| 2215 | it->char_to_display = unibyte_char_to_multibyte (it->c); | ||
| 2216 | } | ||
| 2217 | |||
| 2218 | /* Get face and font to use. Encode IT->char_to_display. */ | ||
| 2219 | it->face_id = FACE_FOR_CHAR (it->f, face, it->char_to_display); | ||
| 2220 | face = FACE_FROM_ID (it->f, it->face_id); | ||
| 2221 | x_get_char_face_and_encoding (it->f, it->char_to_display, | ||
| 2222 | it->face_id, &char2b, it->multibyte_p); | ||
| 2223 | font = face->font; | ||
| 2224 | |||
| 2225 | /* When no suitable font found, use the default font. */ | ||
| 2226 | font_not_found_p = font == NULL; | ||
| 2227 | if (font_not_found_p) | ||
| 2228 | { | ||
| 2229 | font = FRAME_FONT (it->f); | ||
| 2230 | boff = it->f->output_data.w32->baseline_offset; | ||
| 2231 | font_info = NULL; | ||
| 2232 | } | ||
| 2233 | else | ||
| 2234 | { | ||
| 2235 | font_info = FONT_INFO_FROM_ID (it->f, face->font_info_id); | ||
| 2236 | boff = font_info->baseline_offset; | ||
| 2237 | if (font_info->vertical_centering) | ||
| 2238 | boff = VCENTER_BASELINE_OFFSET (font, it->f) - boff; | ||
| 2239 | } | ||
| 2240 | |||
| 2241 | /* There are no padding glyphs, so there is only one glyph to | ||
| 2242 | produce for the composition. Important is that pixel_width, | ||
| 2243 | ascent and descent are the values of what is drawn by | ||
| 2244 | draw_glyphs (i.e. the values of the overall glyphs composed). */ | ||
| 2245 | it->nglyphs = 1; | ||
| 2246 | |||
| 2247 | /* If we have not yet calculated pixel size data of glyphs of | ||
| 2248 | the composition for the current face font, calculate them | ||
| 2249 | now. Theoretically, we have to check all fonts for the | ||
| 2250 | glyphs, but that requires much time and memory space. So, | ||
| 2251 | here we check only the font of the first glyph. This leads | ||
| 2252 | to incorrect display very rarely, and C-l (recenter) can | ||
| 2253 | correct the display anyway. */ | ||
| 2254 | if (cmp->font != (void *) font) | ||
| 2255 | { | ||
| 2256 | /* Ascent and descent of the font of the first character of | ||
| 2257 | this composition (adjusted by baseline offset). Ascent | ||
| 2258 | and descent of overall glyphs should not be less than | ||
| 2259 | them respectively. */ | ||
| 2260 | int font_ascent = FONT_BASE (font) + boff; | ||
| 2261 | int font_descent = FONT_DESCENT (font) - boff; | ||
| 2262 | /* Bounding box of the overall glyphs. */ | ||
| 2263 | int leftmost, rightmost, lowest, highest; | ||
| 2264 | int i, width, ascent, descent; | ||
| 2265 | enum w32_font_type font_type; | ||
| 2266 | |||
| 2267 | cmp->font = (void *) font; | ||
| 2268 | |||
| 2269 | if (font->bdf && CHARSET_DIMENSION (CHAR_CHARSET (it->c)) == 1) | ||
| 2270 | font_type = BDF_1D_FONT; | ||
| 2271 | else if (font->bdf) | ||
| 2272 | font_type = BDF_2D_FONT; | ||
| 2273 | else | ||
| 2274 | font_type = UNICODE_FONT; | ||
| 2275 | |||
| 2276 | /* Initialize the bounding box. */ | ||
| 2277 | pcm = w32_per_char_metric (font, &char2b, font_type); | ||
| 2278 | if (pcm) | ||
| 2279 | { | ||
| 2280 | width = pcm->width; | ||
| 2281 | ascent = pcm->ascent; | ||
| 2282 | descent = pcm->descent; | ||
| 2283 | } | ||
| 2284 | else | ||
| 2285 | { | ||
| 2286 | width = FONT_WIDTH (font); | ||
| 2287 | ascent = FONT_BASE (font); | ||
| 2288 | descent = FONT_DESCENT (font); | ||
| 2289 | } | ||
| 2290 | |||
| 2291 | rightmost = width; | ||
| 2292 | lowest = - descent + boff; | ||
| 2293 | highest = ascent + boff; | ||
| 2294 | leftmost = 0; | ||
| 2295 | |||
| 2296 | if (font_info | ||
| 2297 | && font_info->default_ascent | ||
| 2298 | && CHAR_TABLE_P (Vuse_default_ascent) | ||
| 2299 | && !NILP (Faref (Vuse_default_ascent, | ||
| 2300 | make_number (it->char_to_display)))) | ||
| 2301 | highest = font_info->default_ascent + boff; | ||
| 2302 | |||
| 2303 | /* Draw the first glyph at the normal position. It may be | ||
| 2304 | shifted to right later if some other glyphs are drawn at | ||
| 2305 | the left. */ | ||
| 2306 | cmp->offsets[0] = 0; | ||
| 2307 | cmp->offsets[1] = boff; | ||
| 2308 | |||
| 2309 | /* Set cmp->offsets for the remaining glyphs. */ | ||
| 2310 | for (i = 1; i < cmp->glyph_len; i++) | ||
| 2311 | { | ||
| 2312 | int left, right, btm, top; | ||
| 2313 | int ch = COMPOSITION_GLYPH (cmp, i); | ||
| 2314 | int face_id = FACE_FOR_CHAR (it->f, face, ch); | ||
| 2315 | |||
| 2316 | face = FACE_FROM_ID (it->f, face_id); | ||
| 2317 | x_get_char_face_and_encoding (it->f, ch, face->id, &char2b, | ||
| 2318 | it->multibyte_p); | ||
| 2319 | font = face->font; | ||
| 2320 | if (font == NULL) | ||
| 2321 | { | ||
| 2322 | font = FRAME_FONT (it->f); | ||
| 2323 | boff = it->f->output_data.w32->baseline_offset; | ||
| 2324 | font_info = NULL; | ||
| 2325 | } | ||
| 2326 | else | ||
| 2327 | { | ||
| 2328 | font_info | ||
| 2329 | = FONT_INFO_FROM_ID (it->f, face->font_info_id); | ||
| 2330 | boff = font_info->baseline_offset; | ||
| 2331 | if (font_info->vertical_centering) | ||
| 2332 | boff = VCENTER_BASELINE_OFFSET (font, it->f) - boff; | ||
| 2333 | } | ||
| 2334 | |||
| 2335 | if (font->bdf && CHARSET_DIMENSION (CHAR_CHARSET (ch)) == 1) | ||
| 2336 | font_type = BDF_1D_FONT; | ||
| 2337 | else if (font->bdf) | ||
| 2338 | font_type = BDF_2D_FONT; | ||
| 2339 | else | ||
| 2340 | font_type = UNICODE_FONT; | ||
| 2341 | |||
| 2342 | pcm = w32_per_char_metric (font, &char2b, font_type); | ||
| 2343 | if (pcm) | ||
| 2344 | { | ||
| 2345 | width = pcm->width; | ||
| 2346 | ascent = pcm->ascent; | ||
| 2347 | descent = pcm->descent; | ||
| 2348 | } | ||
| 2349 | else | ||
| 2350 | { | ||
| 2351 | width = FONT_WIDTH (font); | ||
| 2352 | ascent = FONT_BASE (font); | ||
| 2353 | descent = FONT_DESCENT (font); | ||
| 2354 | } | ||
| 2355 | |||
| 2356 | if (cmp->method != COMPOSITION_WITH_RULE_ALTCHARS) | ||
| 2357 | { | ||
| 2358 | /* Relative composition with or without | ||
| 2359 | alternate chars. */ | ||
| 2360 | left = (leftmost + rightmost - width) / 2; | ||
| 2361 | btm = - descent + boff; | ||
| 2362 | if (font_info && font_info->relative_compose | ||
| 2363 | && (! CHAR_TABLE_P (Vignore_relative_composition) | ||
| 2364 | || NILP (Faref (Vignore_relative_composition, | ||
| 2365 | make_number (ch))))) | ||
| 2366 | { | ||
| 2367 | |||
| 2368 | if (- descent >= font_info->relative_compose) | ||
| 2369 | /* One extra pixel between two glyphs. */ | ||
| 2370 | btm = highest + 1; | ||
| 2371 | else if (ascent <= 0) | ||
| 2372 | /* One extra pixel between two glyphs. */ | ||
| 2373 | btm = lowest - 1 - ascent - descent; | ||
| 2374 | } | ||
| 2375 | } | ||
| 2376 | else | ||
| 2377 | { | ||
| 2378 | /* A composition rule is specified by an integer | ||
| 2379 | value that encodes global and new reference | ||
| 2380 | points (GREF and NREF). GREF and NREF are | ||
| 2381 | specified by numbers as below: | ||
| 2382 | |||
| 2383 | 0---1---2 -- ascent | ||
| 2384 | | | | ||
| 2385 | | | | ||
| 2386 | | | | ||
| 2387 | 9--10--11 -- center | ||
| 2388 | | | | ||
| 2389 | ---3---4---5--- baseline | ||
| 2390 | | | | ||
| 2391 | 6---7---8 -- descent | ||
| 2392 | */ | ||
| 2393 | int rule = COMPOSITION_RULE (cmp, i); | ||
| 2394 | int gref, nref, grefx, grefy, nrefx, nrefy; | ||
| 2395 | |||
| 2396 | COMPOSITION_DECODE_RULE (rule, gref, nref); | ||
| 2397 | grefx = gref % 3, nrefx = nref % 3; | ||
| 2398 | grefy = gref / 3, nrefy = nref / 3; | ||
| 2399 | |||
| 2400 | left = (leftmost | ||
| 2401 | + grefx * (rightmost - leftmost) / 2 | ||
| 2402 | - nrefx * width / 2); | ||
| 2403 | btm = ((grefy == 0 ? highest | ||
| 2404 | : grefy == 1 ? 0 | ||
| 2405 | : grefy == 2 ? lowest | ||
| 2406 | : (highest + lowest) / 2) | ||
| 2407 | - (nrefy == 0 ? ascent + descent | ||
| 2408 | : nrefy == 1 ? descent - boff | ||
| 2409 | : nrefy == 2 ? 0 | ||
| 2410 | : (ascent + descent) / 2)); | ||
| 2411 | } | ||
| 2412 | |||
| 2413 | cmp->offsets[i * 2] = left; | ||
| 2414 | cmp->offsets[i * 2 + 1] = btm + descent; | ||
| 2415 | |||
| 2416 | /* Update the bounding box of the overall glyphs. */ | ||
| 2417 | right = left + width; | ||
| 2418 | top = btm + descent + ascent; | ||
| 2419 | if (left < leftmost) | ||
| 2420 | leftmost = left; | ||
| 2421 | if (right > rightmost) | ||
| 2422 | rightmost = right; | ||
| 2423 | if (top > highest) | ||
| 2424 | highest = top; | ||
| 2425 | if (btm < lowest) | ||
| 2426 | lowest = btm; | ||
| 2427 | } | ||
| 2428 | |||
| 2429 | /* If there are glyphs whose x-offsets are negative, | ||
| 2430 | shift all glyphs to the right and make all x-offsets | ||
| 2431 | non-negative. */ | ||
| 2432 | if (leftmost < 0) | ||
| 2433 | { | ||
| 2434 | for (i = 0; i < cmp->glyph_len; i++) | ||
| 2435 | cmp->offsets[i * 2] -= leftmost; | ||
| 2436 | rightmost -= leftmost; | ||
| 2437 | } | ||
| 2438 | |||
| 2439 | cmp->pixel_width = rightmost; | ||
| 2440 | cmp->ascent = highest; | ||
| 2441 | cmp->descent = - lowest; | ||
| 2442 | if (cmp->ascent < font_ascent) | ||
| 2443 | cmp->ascent = font_ascent; | ||
| 2444 | if (cmp->descent < font_descent) | ||
| 2445 | cmp->descent = font_descent; | ||
| 2446 | } | ||
| 2447 | |||
| 2448 | it->pixel_width = cmp->pixel_width; | ||
| 2449 | it->ascent = it->phys_ascent = cmp->ascent; | ||
| 2450 | it->descent = it->phys_descent = cmp->descent; | ||
| 2451 | |||
| 2452 | if (face->box != FACE_NO_BOX) | ||
| 2453 | { | ||
| 2454 | int thick = face->box_line_width; | ||
| 2455 | it->ascent += thick; | ||
| 2456 | it->descent += thick; | ||
| 2457 | |||
| 2458 | if (it->start_of_box_run_p) | ||
| 2459 | it->pixel_width += thick; | ||
| 2460 | if (it->end_of_box_run_p) | ||
| 2461 | it->pixel_width += thick; | ||
| 2462 | } | ||
| 2463 | |||
| 2464 | /* If face has an overline, add the height of the overline | ||
| 2465 | (1 pixel) and a 1 pixel margin to the character height. */ | ||
| 2466 | if (face->overline_p) | ||
| 2467 | it->ascent += 2; | ||
| 2468 | |||
| 2469 | take_vertical_position_into_account (it); | ||
| 2470 | |||
| 2471 | if (it->glyph_row) | ||
| 2472 | x_append_composite_glyph (it); | ||
| 2195 | } | 2473 | } |
| 2196 | else if (it->what == IT_IMAGE) | 2474 | else if (it->what == IT_IMAGE) |
| 2197 | x_produce_image_glyph (it); | 2475 | x_produce_image_glyph (it); |
| @@ -2775,7 +3053,7 @@ static INLINE void | |||
| 2775 | x_compute_glyph_string_overhangs (s) | 3053 | x_compute_glyph_string_overhangs (s) |
| 2776 | struct glyph_string *s; | 3054 | struct glyph_string *s; |
| 2777 | { | 3055 | { |
| 2778 | /* NTEMACS_TODO: Windows does not appear to have a method for | 3056 | /* TODO: Windows does not appear to have a method for |
| 2779 | getting this info without getting the ABC widths for each | 3057 | getting this info without getting the ABC widths for each |
| 2780 | individual character and working it out manually. */ | 3058 | individual character and working it out manually. */ |
| 2781 | } | 3059 | } |
| @@ -3018,7 +3296,7 @@ x_draw_glyph_string_background (s, force_p) | |||
| 3018 | shouldn't be drawn in the first place. */ | 3296 | shouldn't be drawn in the first place. */ |
| 3019 | if (!s->background_filled_p) | 3297 | if (!s->background_filled_p) |
| 3020 | { | 3298 | { |
| 3021 | #if 0 /* NTEMACS_TODO: stipple */ | 3299 | #if 0 /* TODO: stipple */ |
| 3022 | if (s->stippled_p) | 3300 | if (s->stippled_p) |
| 3023 | { | 3301 | { |
| 3024 | /* Fill background with a stipple pattern. */ | 3302 | /* Fill background with a stipple pattern. */ |
| @@ -3054,6 +3332,7 @@ x_draw_glyph_string_foreground (s) | |||
| 3054 | struct glyph_string *s; | 3332 | struct glyph_string *s; |
| 3055 | { | 3333 | { |
| 3056 | int i, x; | 3334 | int i, x; |
| 3335 | HFONT old_font; | ||
| 3057 | 3336 | ||
| 3058 | /* If first glyph of S has a left box line, start drawing the text | 3337 | /* If first glyph of S has a left box line, start drawing the text |
| 3059 | of S to the right of that box line. */ | 3338 | of S to the right of that box line. */ |
| @@ -3073,7 +3352,7 @@ x_draw_glyph_string_foreground (s) | |||
| 3073 | SetTextAlign (s->hdc, TA_BASELINE | TA_LEFT); | 3352 | SetTextAlign (s->hdc, TA_BASELINE | TA_LEFT); |
| 3074 | 3353 | ||
| 3075 | if (s->font && s->font->hfont) | 3354 | if (s->font && s->font->hfont) |
| 3076 | SelectObject (s->hdc, s->font->hfont); | 3355 | old_font = SelectObject (s->hdc, s->font->hfont); |
| 3077 | 3356 | ||
| 3078 | /* Draw characters of S as rectangles if S's font could not be | 3357 | /* Draw characters of S as rectangles if S's font could not be |
| 3079 | loaded. */ | 3358 | loaded. */ |
| @@ -3104,6 +3383,8 @@ x_draw_glyph_string_foreground (s) | |||
| 3104 | /* Draw text with TextOut and friends. */ | 3383 | /* Draw text with TextOut and friends. */ |
| 3105 | W32_TEXTOUT (s, x, s->ybase - boff, s->char2b, s->nchars); | 3384 | W32_TEXTOUT (s, x, s->ybase - boff, s->char2b, s->nchars); |
| 3106 | } | 3385 | } |
| 3386 | if (s->font && s->font->hfont) | ||
| 3387 | SelectObject (s->hdc, old_font); | ||
| 3107 | } | 3388 | } |
| 3108 | 3389 | ||
| 3109 | /* Draw the foreground of composite glyph string S. */ | 3390 | /* Draw the foreground of composite glyph string S. */ |
| @@ -3113,6 +3394,7 @@ x_draw_composite_glyph_string_foreground (s) | |||
| 3113 | struct glyph_string *s; | 3394 | struct glyph_string *s; |
| 3114 | { | 3395 | { |
| 3115 | int i, x; | 3396 | int i, x; |
| 3397 | HFONT old_font; | ||
| 3116 | 3398 | ||
| 3117 | /* If first glyph of S has a left box line, start drawing the text | 3399 | /* If first glyph of S has a left box line, start drawing the text |
| 3118 | of S to the right of that box line. */ | 3400 | of S to the right of that box line. */ |
| @@ -3132,6 +3414,9 @@ x_draw_composite_glyph_string_foreground (s) | |||
| 3132 | SetBkMode (s->hdc, TRANSPARENT); | 3414 | SetBkMode (s->hdc, TRANSPARENT); |
| 3133 | SetTextAlign (s->hdc, TA_BASELINE | TA_LEFT); | 3415 | SetTextAlign (s->hdc, TA_BASELINE | TA_LEFT); |
| 3134 | 3416 | ||
| 3417 | if (s->font && s->font->hfont) | ||
| 3418 | old_font = SelectObject (s->hdc, s->font->hfont); | ||
| 3419 | |||
| 3135 | /* Draw a rectangle for the composition if the font for the very | 3420 | /* Draw a rectangle for the composition if the font for the very |
| 3136 | first character of the composition could not be loaded. */ | 3421 | first character of the composition could not be loaded. */ |
| 3137 | if (s->font_not_found_p) | 3422 | if (s->font_not_found_p) |
| @@ -3143,10 +3428,12 @@ x_draw_composite_glyph_string_foreground (s) | |||
| 3143 | else | 3428 | else |
| 3144 | { | 3429 | { |
| 3145 | for (i = 0; i < s->nchars; i++, ++s->gidx) | 3430 | for (i = 0; i < s->nchars; i++, ++s->gidx) |
| 3146 | W32_TEXTOUT (s, x + s->cmp->offsets[s->gidx * 2], | 3431 | W32_TEXTOUT (s, x + s->cmp->offsets[s->gidx * 2], |
| 3147 | s->ybase - s->cmp->offsets[s->gidx * 2 + 1], | 3432 | s->ybase - s->cmp->offsets[s->gidx * 2 + 1], |
| 3148 | s->char2b + i, 1); | 3433 | s->char2b + i, 1); |
| 3149 | } | 3434 | } |
| 3435 | if (s->font && s->font->hfont) | ||
| 3436 | SelectObject (s->hdc, old_font); | ||
| 3150 | } | 3437 | } |
| 3151 | 3438 | ||
| 3152 | /* Allocate a color which is lighter or darker than *COLOR by FACTOR | 3439 | /* Allocate a color which is lighter or darker than *COLOR by FACTOR |
| @@ -3175,8 +3462,8 @@ w32_alloc_lighter_color (f, color, factor, delta) | |||
| 3175 | max (0, min (0xff, delta + GetGValue (*color))), | 3462 | max (0, min (0xff, delta + GetGValue (*color))), |
| 3176 | max (0, min (0xff, delta + GetBValue (*color)))); | 3463 | max (0, min (0xff, delta + GetBValue (*color)))); |
| 3177 | 3464 | ||
| 3178 | /* NTEMACS_TODO: Map to palette and retry with delta if same? */ | 3465 | /* TODO: Map to palette and retry with delta if same? */ |
| 3179 | /* NTEMACS_TODO: Free colors (if using palette)? */ | 3466 | /* TODO: Free colors (if using palette)? */ |
| 3180 | 3467 | ||
| 3181 | if (new == *color) | 3468 | if (new == *color) |
| 3182 | return 0; | 3469 | return 0; |
| @@ -3209,7 +3496,7 @@ w32_setup_relief_color (f, relief, factor, delta, default_pixel) | |||
| 3209 | COLORREF background = di->relief_background; | 3496 | COLORREF background = di->relief_background; |
| 3210 | struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); | 3497 | struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); |
| 3211 | 3498 | ||
| 3212 | /* NTEMACS_TODO: Free colors (if using palette)? */ | 3499 | /* TODO: Free colors (if using palette)? */ |
| 3213 | 3500 | ||
| 3214 | /* Allocate new color. */ | 3501 | /* Allocate new color. */ |
| 3215 | xgcv.foreground = default_pixel; | 3502 | xgcv.foreground = default_pixel; |
| @@ -3222,7 +3509,7 @@ w32_setup_relief_color (f, relief, factor, delta, default_pixel) | |||
| 3222 | 3509 | ||
| 3223 | if (relief->gc == 0) | 3510 | if (relief->gc == 0) |
| 3224 | { | 3511 | { |
| 3225 | #if 0 /* NTEMACS_TODO: stipple */ | 3512 | #if 0 /* TODO: stipple */ |
| 3226 | xgcv.stipple = dpyinfo->gray; | 3513 | xgcv.stipple = dpyinfo->gray; |
| 3227 | mask |= GCStipple; | 3514 | mask |= GCStipple; |
| 3228 | #endif | 3515 | #endif |
| @@ -3462,7 +3749,7 @@ x_draw_image_foreground (s) | |||
| 3462 | 3749 | ||
| 3463 | if (s->img->pixmap) | 3750 | if (s->img->pixmap) |
| 3464 | { | 3751 | { |
| 3465 | #if 0 /* NTEMACS_TODO: image mask */ | 3752 | #if 0 /* TODO: image mask */ |
| 3466 | if (s->img->mask) | 3753 | if (s->img->mask) |
| 3467 | { | 3754 | { |
| 3468 | /* We can't set both a clip mask and use XSetClipRectangles | 3755 | /* We can't set both a clip mask and use XSetClipRectangles |
| @@ -3614,7 +3901,7 @@ w32_draw_image_foreground_1 (s, pixmap) | |||
| 3614 | 3901 | ||
| 3615 | if (s->img->pixmap) | 3902 | if (s->img->pixmap) |
| 3616 | { | 3903 | { |
| 3617 | #if 0 /* NTEMACS_TODO: image mask */ | 3904 | #if 0 /* TODO: image mask */ |
| 3618 | if (s->img->mask) | 3905 | if (s->img->mask) |
| 3619 | { | 3906 | { |
| 3620 | /* We can't set both a clip mask and use XSetClipRectangles | 3907 | /* We can't set both a clip mask and use XSetClipRectangles |
| @@ -3686,7 +3973,7 @@ x_draw_glyph_string_bg_rect (s, x, y, w, h) | |||
| 3686 | struct glyph_string *s; | 3973 | struct glyph_string *s; |
| 3687 | int x, y, w, h; | 3974 | int x, y, w, h; |
| 3688 | { | 3975 | { |
| 3689 | #if 0 /* NTEMACS_TODO: stipple */ | 3976 | #if 0 /* TODO: stipple */ |
| 3690 | if (s->stippled_p) | 3977 | if (s->stippled_p) |
| 3691 | { | 3978 | { |
| 3692 | /* Fill background with a stipple pattern. */ | 3979 | /* Fill background with a stipple pattern. */ |
| @@ -3732,7 +4019,7 @@ x_draw_image_glyph_string (s) | |||
| 3732 | s->stippled_p = s->face->stipple != 0; | 4019 | s->stippled_p = s->face->stipple != 0; |
| 3733 | if (height > s->img->height | 4020 | if (height > s->img->height |
| 3734 | || margin | 4021 | || margin |
| 3735 | #if 0 /* NTEMACS_TODO: image mask */ | 4022 | #if 0 /* TODO: image mask */ |
| 3736 | || s->img->mask | 4023 | || s->img->mask |
| 3737 | #endif | 4024 | #endif |
| 3738 | || s->img->pixmap == 0 | 4025 | || s->img->pixmap == 0 |
| @@ -3744,7 +4031,7 @@ x_draw_image_glyph_string (s) | |||
| 3744 | x = s->x; | 4031 | x = s->x; |
| 3745 | 4032 | ||
| 3746 | y = s->y + box_line_width; | 4033 | y = s->y + box_line_width; |
| 3747 | #if 0 /* NTEMACS_TODO: image mask */ | 4034 | #if 0 /* TODO: image mask */ |
| 3748 | if (s->img->mask) | 4035 | if (s->img->mask) |
| 3749 | { | 4036 | { |
| 3750 | /* Create a pixmap as large as the glyph string Fill it with | 4037 | /* Create a pixmap as large as the glyph string Fill it with |
| @@ -3858,7 +4145,7 @@ x_draw_stretch_glyph_string (s) | |||
| 3858 | w32_get_glyph_string_clip_rect (s, &r); | 4145 | w32_get_glyph_string_clip_rect (s, &r); |
| 3859 | w32_set_clip_rectangle (hdc, &r); | 4146 | w32_set_clip_rectangle (hdc, &r); |
| 3860 | 4147 | ||
| 3861 | #if 0 /* NTEMACS_TODO: stipple */ | 4148 | #if 0 /* TODO: stipple */ |
| 3862 | if (s->face->stipple) | 4149 | if (s->face->stipple) |
| 3863 | { | 4150 | { |
| 3864 | /* Fill background with a stipple pattern. */ | 4151 | /* Fill background with a stipple pattern. */ |
| @@ -5946,7 +6233,7 @@ note_mode_line_highlight (w, x, mode_line_p) | |||
| 5946 | } | 6233 | } |
| 5947 | } | 6234 | } |
| 5948 | 6235 | ||
| 5949 | #if 0 /* NTEMACS_TODO: mouse cursor */ | 6236 | #if 0 /* TODO: mouse cursor */ |
| 5950 | XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), cursor); | 6237 | XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), cursor); |
| 5951 | #endif | 6238 | #endif |
| 5952 | } | 6239 | } |
| @@ -6017,7 +6304,7 @@ note_mouse_highlight (f, x, y) | |||
| 6017 | note_mode_line_highlight (w, x, portion == 1); | 6304 | note_mode_line_highlight (w, x, portion == 1); |
| 6018 | return; | 6305 | return; |
| 6019 | } | 6306 | } |
| 6020 | #if 0 /* NTEMACS_TODO: mouse cursor */ | 6307 | #if 0 /* TODO: mouse cursor */ |
| 6021 | else | 6308 | else |
| 6022 | XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 6309 | XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 6023 | f->output_data.x->text_cursor); | 6310 | f->output_data.x->text_cursor); |
| @@ -6650,7 +6937,7 @@ show_mouse_face (dpyinfo, draw) | |||
| 6650 | output_cursor = saved_cursor; | 6937 | output_cursor = saved_cursor; |
| 6651 | 6938 | ||
| 6652 | set_x_cursor: | 6939 | set_x_cursor: |
| 6653 | #if 0 /* NTEMACS_TODO: mouse cursor */ | 6940 | #if 0 /* TODO: mouse cursor */ |
| 6654 | /* Change the mouse cursor. */ | 6941 | /* Change the mouse cursor. */ |
| 6655 | if (draw == DRAW_NORMAL_TEXT) | 6942 | if (draw == DRAW_NORMAL_TEXT) |
| 6656 | XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 6943 | XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| @@ -7653,7 +7940,7 @@ w32_read_socket (sd, bufp, numchars, expected) | |||
| 7653 | if (numchars <= 0) | 7940 | if (numchars <= 0) |
| 7654 | abort (); /* Don't think this happens. */ | 7941 | abort (); /* Don't think this happens. */ |
| 7655 | 7942 | ||
| 7656 | /* NTEMACS_TODO: tooltips, tool-bars, ghostscript integration, mouse | 7943 | /* TODO: tooltips, tool-bars, ghostscript integration, mouse |
| 7657 | cursors. */ | 7944 | cursors. */ |
| 7658 | while (get_next_msg (&msg, FALSE)) | 7945 | while (get_next_msg (&msg, FALSE)) |
| 7659 | { | 7946 | { |
| @@ -8108,7 +8395,7 @@ w32_read_socket (sd, bufp, numchars, expected) | |||
| 8108 | break; | 8395 | break; |
| 8109 | 8396 | ||
| 8110 | case WM_KILLFOCUS: | 8397 | case WM_KILLFOCUS: |
| 8111 | /* NTEMACS_TODO: some of this belongs in MOUSE_LEAVE */ | 8398 | /* TODO: some of this belongs in MOUSE_LEAVE */ |
| 8112 | f = x_top_window_to_frame (dpyinfo, msg.msg.hwnd); | 8399 | f = x_top_window_to_frame (dpyinfo, msg.msg.hwnd); |
| 8113 | 8400 | ||
| 8114 | if (f) | 8401 | if (f) |
| @@ -8998,7 +9285,7 @@ x_font_min_bounds (font, w, h) | |||
| 8998 | int *w, *h; | 9285 | int *w, *h; |
| 8999 | { | 9286 | { |
| 9000 | /* | 9287 | /* |
| 9001 | * NTEMACS_TODO: Windows does not appear to offer min bound, only | 9288 | * TODO: Windows does not appear to offer min bound, only |
| 9002 | * average and maximum width, and maximum height. | 9289 | * average and maximum width, and maximum height. |
| 9003 | */ | 9290 | */ |
| 9004 | *h = FONT_HEIGHT (font); | 9291 | *h = FONT_HEIGHT (font); |
| @@ -9435,7 +9722,7 @@ x_make_frame_visible (f) | |||
| 9435 | input_signal_count < count && !FRAME_VISIBLE_P (f);) | 9722 | input_signal_count < count && !FRAME_VISIBLE_P (f);) |
| 9436 | { | 9723 | { |
| 9437 | /* Force processing of queued events. */ | 9724 | /* Force processing of queued events. */ |
| 9438 | /* NTEMACS_TODO: x_sync equivalent? */ | 9725 | /* TODO: x_sync equivalent? */ |
| 9439 | 9726 | ||
| 9440 | /* Machines that do polling rather than SIGIO have been observed | 9727 | /* Machines that do polling rather than SIGIO have been observed |
| 9441 | to go into a busy-wait here. So we'll fake an alarm signal | 9728 | to go into a busy-wait here. So we'll fake an alarm signal |
| @@ -9634,7 +9921,7 @@ w32_initialize_display_info (display_name) | |||
| 9634 | dpyinfo->mouse_face_face_id = DEFAULT_FACE_ID; | 9921 | dpyinfo->mouse_face_face_id = DEFAULT_FACE_ID; |
| 9635 | dpyinfo->mouse_face_window = Qnil; | 9922 | dpyinfo->mouse_face_window = Qnil; |
| 9636 | 9923 | ||
| 9637 | /* NTEMACS_TODO: dpyinfo->gray */ | 9924 | /* TODO: dpyinfo->gray */ |
| 9638 | 9925 | ||
| 9639 | } | 9926 | } |
| 9640 | 9927 | ||