aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Blandy1991-07-03 02:30:48 +0000
committerJim Blandy1991-07-03 02:30:48 +0000
commitc7004826695c9b13990ccfe78a7b582470ef95b1 (patch)
tree8ded7c3248b9ff6b431c0c46f04c42d3d6314fe9 /src
parent992d176e388ea77eb3792fcc35adc8b6e96c6c32 (diff)
downloademacs-c7004826695c9b13990ccfe78a7b582470ef95b1.tar.gz
emacs-c7004826695c9b13990ccfe78a7b582470ef95b1.zip
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c148
1 files changed, 19 insertions, 129 deletions
diff --git a/src/xterm.c b/src/xterm.c
index c99899d3d0a..17a0c46992e 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -414,8 +414,16 @@ dumpglyphs (s, left, top, gp, n, hl, font)
414 : (hl ? s->display.x->reverse_gc 414 : (hl ? s->display.x->reverse_gc
415 : s->display.x->normal_gc)); 415 : s->display.x->normal_gc));
416 416
417 XDrawImageString16 (x_current_display, window, drawing_gc, 417 if (sizeof (GLYPH) == sizeof (XChar2b))
418 left, top + FONT_BASE (font), (XChar2b *) gp, n); 418 XDrawImageString16 (x_current_display, window, drawing_gc,
419 left, top + FONT_BASE (font), (XChar2b *) gp, n);
420 else if (sizeof (GLYPH) == sizeof (unsigned char))
421 XDrawImageString (x_current_display, window, drawing_gc,
422 left, top + FONT_BASE (font), (char *) gp, n);
423 else
424 /* What size of glyph ARE you using? And does X have a function to
425 draw them? */
426 abort ();
419} 427}
420 428
421#if 0 429#if 0
@@ -1051,7 +1059,6 @@ dumprectangle (s, left, top, cols, rows)
1051 1059
1052 if (cursor_cleared) 1060 if (cursor_cleared)
1053 x_display_cursor (s, 1); 1061 x_display_cursor (s, 1);
1054 XFlushQueue ();
1055} 1062}
1056 1063
1057#ifndef HAVE_X11 1064#ifndef HAVE_X11
@@ -1252,7 +1259,7 @@ x_new_focus_screen (screen, bufp, buf_free)
1252 screen_highlight (x_focus_screen); 1259 screen_highlight (x_focus_screen);
1253 1260
1254 /* Enqueue an event. It's kind of important not to drop these 1261 /* Enqueue an event. It's kind of important not to drop these
1255 events, but the event queue's fixed size is a real pain in the butt 1262 events, but the event queue's fixed size is a real pain
1256 anyway. */ 1263 anyway. */
1257 if (buf_free > 0) 1264 if (buf_free > 0)
1258 { 1265 {
@@ -1897,6 +1904,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
1897 { 1904 {
1898 int n = x_new_focus_screen (s, bufp, numchars); 1905 int n = x_new_focus_screen (s, bufp, numchars);
1899 bufp += n; 1906 bufp += n;
1907 count += n;
1900 numchars -= n; 1908 numchars -= n;
1901 enter_timestamp = event.xcrossing.time; 1909 enter_timestamp = event.xcrossing.time;
1902 } 1910 }
@@ -1934,6 +1942,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
1934 { 1942 {
1935 int n = x_new_focus_screen (s, bufp, numchars); 1943 int n = x_new_focus_screen (s, bufp, numchars);
1936 bufp += n; 1944 bufp += n;
1945 count += n;
1937 numchars -= n; 1946 numchars -= n;
1938 } 1947 }
1939 break; 1948 break;
@@ -1943,12 +1952,13 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
1943 && event.xcrossing.subwindow == None 1952 && event.xcrossing.subwindow == None
1944 && event.xcrossing.mode == NotifyNormal) 1953 && event.xcrossing.mode == NotifyNormal)
1945 { 1954 {
1946 if (event.xcrossing.focus 1955 if (event.xcrossing.focus)
1947 && (x_focus_screen
1948 == x_window_to_screen (event.xcrossing.window)))
1949 { 1956 {
1950 int n = x_new_focus_screen (0, bufp, numchars); 1957 int n;
1958 s = x_window_to_screen (event.xcrossing.window);
1959 n = x_new_focus_screen (s, bufp, numchars);
1951 bufp += n; 1960 bufp += n;
1961 count += n;
1952 numchars -= n; 1962 numchars -= n;
1953 } 1963 }
1954 } 1964 }
@@ -1960,6 +1970,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
1960 { 1970 {
1961 int n = x_new_focus_screen (0, bufp, numchars); 1971 int n = x_new_focus_screen (0, bufp, numchars);
1962 bufp += n; 1972 bufp += n;
1973 count += n;
1963 numchars -= n; 1974 numchars -= n;
1964 } 1975 }
1965 break; 1976 break;
@@ -2519,127 +2530,6 @@ x_display_box_cursor (s, on)
2519 XFlushQueue (); 2530 XFlushQueue ();
2520} 2531}
2521 2532
2522#if 0
2523This code has been rewritten to use x_draw_single_glyph and draw
2524box cursors successfully. Once that code is working, this can go away.
2525
2526/* Turn the displayed cursor of screen S on or off according to ON.
2527 If ON is nonzero, where to put the cursor is specified
2528 by S->cursor_x and S->cursor_y. */
2529
2530static void
2531x_display_box_cursor (s, on)
2532 struct screen *s;
2533 int on;
2534{
2535 register struct screen_glyphs *current_screen = SCREEN_CURRENT_GLYPHS (s);
2536
2537 if (! s->visible)
2538 return;
2539
2540 /* If cursor is off and we want it off, return quickly. */
2541
2542 if (!on && s->phys_cursor_x < 0)
2543 return;
2544
2545 /* If cursor is currently being shown and we don't want it to be
2546 or it is in the wrong place, erase it. */
2547
2548 if (s->phys_cursor_x >= 0
2549 && (!on || s->phys_cursor_x != s->cursor_x
2550 || s->phys_cursor_y != s->cursor_y))
2551 {
2552 /* If there is supposed to be a character there, redraw it
2553 in that line's normal video. */
2554 if (current_screen->enable[s->phys_cursor_y]
2555 && s->phys_cursor_x < current_screen->used[s->phys_cursor_y])
2556 dumpglyphs (s,
2557 (s->phys_cursor_x * FONT_WIDTH (s->display.x->font)
2558 + s->display.x->internal_border_width),
2559 (s->phys_cursor_y * FONT_HEIGHT (s->display.x->font)
2560 + s->display.x->internal_border_width),
2561 &current_screen->glyphs[s->phys_cursor_y][s->phys_cursor_x],
2562 1, current_screen->highlight[s->phys_cursor_y],
2563 s->display.x->font);
2564 /* Otherwise just erase the space. */
2565 else
2566#ifdef HAVE_X11
2567 XClearArea (x_current_display, s->display.x->window_desc,
2568 s->phys_cursor_x * FONT_WIDTH (s->display.x->font)
2569 + s->display.x->internal_border_width,
2570 s->phys_cursor_y * FONT_HEIGHT (s->display.x->font)
2571 + s->display.x->internal_border_width,
2572 FONT_WIDTH (s->display.x->font),
2573 FONT_HEIGHT (s->display.x->font), False);
2574#else
2575 XPixSet (s->display.x->window_desc,
2576 s->phys_cursor_x * FONT_WIDTH (s->display.x->font)
2577 + s->display.x->internal_border_width,
2578 s->phys_cursor_y * FONT_HEIGHT (s->display.x->font)
2579 + s->display.x->internal_border_width,
2580 FONT_WIDTH (s->display.x->font),
2581 FONT_HEIGHT (s->display.x->font),
2582 s->display.x->background_pixel);
2583#endif /* HAVE_X11 */
2584
2585 s->phys_cursor_x = -1;
2586 }
2587
2588 /* If we want to show a cursor, write it in the right place. */
2589
2590 if (on && s->phys_cursor_x < 0)
2591 {
2592 if (s != selected_screen || s != x_input_screen)
2593 x_draw_box (s);
2594 else if (current_screen->enable[s->cursor_y]
2595 && s->cursor_x < current_screen->used[s->cursor_y])
2596 /* There is a character there: draw the character with
2597 cursor coloration. */
2598 dumpglyphs (s,
2599 (s->cursor_x * FONT_WIDTH (s->display.x->font)
2600 + s->display.x->internal_border_width),
2601 (s->cursor_y * FONT_HEIGHT (s->display.x->font)
2602 + s->display.x->internal_border_width),
2603 &current_screen->glyphs[s->cursor_y][s->cursor_x],
2604 1, 2, s->display.x->font);
2605 else
2606#ifdef HAVE_X11
2607 {
2608 GLYPH space = SPACEGLYPH;
2609 dumpglyphs (s,
2610 (s->cursor_x * FONT_WIDTH (s->display.x->font)
2611 + s->display.x->internal_border_width),
2612 (s->cursor_y * FONT_HEIGHT (s->display.x->font)
2613 + s->display.x->internal_border_width),
2614 &space, 1,
2615 2, s->display.x->font);
2616 }
2617#if 0
2618 /* This kills the HP-BSD X11R3 server... */
2619 XFillRectangle (x_current_display, s->display.x->window_desc,
2620 s->display.x->cursor_gc,
2621 s->cursor_x * FONT_WIDTH (s->display.x->font)
2622 + s->display.x->internal_border_width,
2623 s->cursor_y * FONT_HEIGHT (s->display.x->font)
2624 + s->display.x->internal_border_width,
2625 FONT_WIDTH (s->display.x->font), FONT_HEIGHT (s->display.x->font));
2626#endif
2627#else
2628 XPixSet (s->display.x->window_desc,
2629 s->cursor_x * FONT_WIDTH (s->display.x->font)+s->display.x->internal_border_width,
2630 s->cursor_y * FONT_HEIGHT (s->display.x->font)+s->display.x->internal_border_width,
2631 FONT_WIDTH (s->display.x->font), FONT_HEIGHT (s->display.x->font), s->display.x->cursor_pixel);
2632#endif /* HAVE_X11 */
2633
2634 s->phys_cursor_x = s->cursor_x;
2635 s->phys_cursor_y = s->cursor_y;
2636 }
2637
2638 if (updating_screen != s)
2639 XFlushQueue ();
2640}
2641#endif
2642
2643extern Lisp_Object Vbar_cursor; 2533extern Lisp_Object Vbar_cursor;
2644 2534
2645x_display_cursor (s, on) 2535x_display_cursor (s, on)