Commit 6ccf47d1 authored by Richard M. Stallman's avatar Richard M. Stallman

Delete X11 conditionals.

(XTupdate_end, XTupdate_begin, XTclear_end_of_line)
(XTclear_frame, XRINGBELL, stufflines, scraplines, dumprectangle)
(XTread_socket, x_draw_box, clear_cursor, refreshicon, x_iconify_frame)
(x_bitmap_icon, x_text_icon, x_new_font, x_term_init)
(x_calc_absolute_position, x_set_window_size)
(x_make_frame_visible, x_make_frame_invisible): Delete X10 code.
(dumpqueue, x_do_pending_expose, dumpborder, XEvent, x_read_exposes)
(enqueue_event, dequeue_event, queue_event_count)
(mouse_event_pending_p, x_set_resize_hint): Delete X10 versions.
parent 3f8600ae
......@@ -99,12 +99,7 @@ extern void _XEditResCheckMessages ();
#endif
#endif
#ifdef HAVE_X11
#define XMapWindow XMapRaised /* Raise them when mapping. */
#else /* ! defined (HAVE_X11) */
#include <X/Xkeyboard.h>
/*#include <X/Xproto.h> */
#endif /* ! defined (HAVE_X11) */
#ifdef FD_SET
/* We could get this from param.h, but better not to depend on finding that.
......@@ -144,18 +139,6 @@ static int expose_all_windows;
static int expose_all_icons;
#ifndef HAVE_X11
/* ExposeRegion events, when received, are copied into this queue
for later processing. */
static struct event_queue x_expose_queue;
/* ButtonPress and ButtonReleased events, when received,
are copied into this queue for later processing. */
struct event_queue x_mouse_queue;
#endif /* HAVE_X11 */
#if defined (SIGIO) && defined (FIONREAD)
int BLOCK_INPUT_mask;
#endif /* ! defined (SIGIO) && defined (FIONREAD) */
......@@ -304,7 +287,6 @@ static int mouse_face_mouse_x, mouse_face_mouse_y;
/* Nonzero means defer mouse-motion highlighting. */
static int mouse_face_defer;
#ifdef HAVE_X11
/* `t' if a mouse button is depressed. */
extern Lisp_Object Vmouse_depressed;
......@@ -324,28 +306,6 @@ extern int _Xdebug;
extern Lisp_Object Qface, Qmouse_face;
#else /* ! defined (HAVE_X11) */
/* Bit patterns for the mouse cursor. */
short MouseCursor[] = {
0x0000, 0x0008, 0x0018, 0x0038,
0x0078, 0x00f8, 0x01f8, 0x03f8,
0x07f8, 0x00f8, 0x00d8, 0x0188,
0x0180, 0x0300, 0x0300, 0x0000};
short MouseMask[] = {
0x000c, 0x001c, 0x003c, 0x007c,
0x00fc, 0x01fc, 0x03fc, 0x07fc,
0x0ffc, 0x0ffc, 0x01fc, 0x03dc,
0x03cc, 0x0780, 0x0780, 0x0300};
static short grey_bits[] = {
0x0005, 0x000a, 0x0005, 0x000a};
static Pixmap GreyPixmap = 0;
#endif /* ! defined (HAVE_X11) */
static int x_noop_count;
......@@ -374,10 +334,6 @@ static void note_mouse_highlight ();
static void clear_mouse_face ();
static void show_mouse_face ();
#ifndef HAVE_X11
static void dumpqueue ();
#endif /* HAVE_X11 */
void dumpborder ();
static int XTcursor_to ();
static int XTclear_end_of_line ();
......@@ -439,16 +395,10 @@ XTupdate_begin (f)
clear_mouse_face ();
}
}
#ifndef HAVE_X11
dumpqueue ();
#endif /* HAVE_X11 */
UNBLOCK_INPUT;
}
#ifndef HAVE_X11
static void x_do_pending_expose ();
#endif
static
XTupdate_end (f)
struct frame *f;
......@@ -456,10 +406,6 @@ XTupdate_end (f)
int mask;
BLOCK_INPUT;
#ifndef HAVE_X11
dumpqueue ();
x_do_pending_expose ();
#endif /* HAVE_X11 */
x_display_cursor (f, 1);
......@@ -884,7 +830,6 @@ XTclear_end_of_line (first_unused)
&& f->phys_cursor_x < first_unused)
f->phys_cursor_x = -1;
#ifdef HAVE_X11
XClearArea (x_current_display, FRAME_X_WINDOW (f),
CHAR_TO_PIXEL_COL (f, curs_x),
CHAR_TO_PIXEL_ROW (f, curs_y),
......@@ -893,14 +838,6 @@ XTclear_end_of_line (first_unused)
#if 0
redraw_previous_char (f, curs_x, curs_y, highlight);
#endif
#else /* ! defined (HAVE_X11) */
XPixSet (FRAME_X_WINDOW (f),
CHAR_TO_PIXEL_COL (f, curs_x),
CHAR_TO_PIXEL_ROW (f, curs_y),
FONT_WIDTH (f->display.x->font) * (first_unused - curs_x),
f->display.x->line_height,
f->display.x->background_pixel);
#endif /* ! defined (HAVE_X11) */
UNBLOCK_INPUT;
}
......@@ -926,10 +863,6 @@ XTclear_frame ()
colors or something like that, then they should be notified. */
x_scroll_bar_clear (f);
#ifndef HAVE_X11
dumpborder (f, 0);
#endif /* HAVE_X11 */
XFlushQueue ();
UNBLOCK_INPUT;
}
......@@ -1216,11 +1149,7 @@ XTflash (f)
/* Make audible bell. */
#ifdef HAVE_X11
#define XRINGBELL XBell (x_current_display, 0)
#else /* ! defined (HAVE_X11) */
#define XRINGBELL XFeep (0);
#endif /* ! defined (HAVE_X11) */
XTring_bell ()
{
......@@ -1297,51 +1226,21 @@ stufflines (n)
newtop = topregion + n;
length = (bottomregion - topregion) + 1;
#ifndef HAVE_X11
dumpqueue ();
#endif /* HAVE_X11 */
if ((length > 0) && (newtop <= flexlines))
{
#ifdef HAVE_X11
XCopyArea (x_current_display, FRAME_X_WINDOW (f),
FRAME_X_WINDOW (f), f->display.x->normal_gc,
intborder, CHAR_TO_PIXEL_ROW (f, topregion),
f->width * FONT_WIDTH (f->display.x->font),
length * f->display.x->line_height, intborder,
CHAR_TO_PIXEL_ROW (f, newtop));
#else /* ! defined (HAVE_X11) */
XMoveArea (FRAME_X_WINDOW (f),
intborder, CHAR_TO_PIXEL_ROW (f, topregion),
intborder, CHAR_TO_PIXEL_ROW (f, newtop),
f->width * FONT_WIDTH (f->display.x->font),
length * f->display.x->line_height);
/* Now we must process any ExposeRegion events that occur
if the area being copied from is obscured.
We can't let it wait because further i/d operations
may want to copy this area to another area. */
x_read_exposes ();
#endif /* ! defined (HAVE_X11) */
}
XCopyArea (x_current_display, FRAME_X_WINDOW (f),
FRAME_X_WINDOW (f), f->display.x->normal_gc,
intborder, CHAR_TO_PIXEL_ROW (f, topregion),
f->width * FONT_WIDTH (f->display.x->font),
length * f->display.x->line_height, intborder,
CHAR_TO_PIXEL_ROW (f, newtop));
newtop = min (newtop, (flexlines - 1));
length = newtop - topregion;
if (length > 0)
{
#ifdef HAVE_X11
XClearArea (x_current_display, FRAME_X_WINDOW (f), intborder,
CHAR_TO_PIXEL_ROW (f, topregion),
f->width * FONT_WIDTH (f->display.x->font),
n * f->display.x->line_height, False);
#else /* ! defined (HAVE_X11) */
XPixSet (FRAME_X_WINDOW (f),
intborder,
CHAR_TO_PIXEL_ROW (f, topregion),
f->width * FONT_WIDTH (f->display.x->font),
n * f->display.x->line_height,
f->display.x->background_pixel);
#endif /* ! defined (HAVE_X11) */
}
XClearArea (x_current_display, FRAME_X_WINDOW (f), intborder,
CHAR_TO_PIXEL_ROW (f, topregion),
f->width * FONT_WIDTH (f->display.x->font),
n * f->display.x->line_height, False);
}
/* Perform a delete-lines operation, deleting N lines
......@@ -1358,31 +1257,16 @@ scraplines (n)
if (curs_y >= flexlines)
return;
#ifndef HAVE_X11
dumpqueue ();
#endif /* HAVE_X11 */
if ((curs_y + n) >= flexlines)
{
if (flexlines >= (curs_y + 1))
{
#ifdef HAVE_X11
XClearArea (x_current_display, FRAME_X_WINDOW (f), intborder,
CHAR_TO_PIXEL_ROW (f, curs_y),
f->width * FONT_WIDTH (f->display.x->font),
(flexlines - curs_y) * f->display.x->line_height, False);
#else /* ! defined (HAVE_X11) */
XPixSet (FRAME_X_WINDOW (f),
intborder, CHAR_TO_PIXEL_ROW (f, curs_y),
f->width * FONT_WIDTH (f->display.x->font),
(flexlines - curs_y) * f->display.x->line_height,
f->display.x->background_pixel);
#endif /* ! defined (HAVE_X11) */
}
XClearArea (x_current_display, FRAME_X_WINDOW (f), intborder,
CHAR_TO_PIXEL_ROW (f, curs_y),
f->width * FONT_WIDTH (f->display.x->font),
(flexlines - curs_y) * f->display.x->line_height, False);
}
else
{
#ifdef HAVE_X11
XCopyArea (x_current_display, FRAME_X_WINDOW (f),
FRAME_X_WINDOW (f), f->display.x->normal_gc,
intborder,
......@@ -1395,23 +1279,6 @@ scraplines (n)
CHAR_TO_PIXEL_ROW (f, flexlines - n),
f->width * FONT_WIDTH (f->display.x->font),
n * f->display.x->line_height, False);
#else /* ! defined (HAVE_X11) */
XMoveArea (FRAME_X_WINDOW (f),
intborder,
CHAR_TO_PIXEL_ROW (f, curs_y + n),
intborder, CHAR_TO_PIXEL_ROW (f, curs_y),
f->width * FONT_WIDTH (f->display.x->font),
(flexlines - (curs_y + n)) * f->display.x->line_height);
/* Now we must process any ExposeRegion events that occur
if the area being copied from is obscured.
We can't let it wait because further i/d operations
may want to copy this area to another area. */
x_read_exposes ();
XPixSet (FRAME_X_WINDOW (f), intborder,
CHAR_TO_PIXEL_ROW (f, flexlines - n),
f->width * FONT_WIDTH (f->display.x->font),
n * f->display.x->line_height, f->display.x->background_pixel);
#endif /* ! defined (HAVE_X11) */
}
}
......@@ -1463,19 +1330,6 @@ dumprectangle (f, left, top, cols, rows)
/* Express rectangle as four edges, instead of position-and-size. */
bottom = top + rows;
right = left + cols;
#ifndef HAVE_X11 /* Window manger does this for X11. */
{
int intborder = f->display.x->internal_border_width;
/* If the rectangle includes any of the internal border area,
redisplay the border emphasis. */
if (top < intborder || left < intborder
|| bottom > intborder + f->height * f->display.x->line_height
|| right > intborder + f->width * f->display.x->line_height)
dumpborder (f, 0);
}
#endif /* not HAVE_X11 Window manger does this for X11. */
/* Convert rectangle edges in pixels to edges in chars.
Round down for left and top, up for right and bottom. */
......@@ -1534,99 +1388,7 @@ dumprectangle (f, left, top, cols, rows)
if (cursor_cleared)
x_display_cursor (f, 1);
}
#ifndef HAVE_X11
/* Process all queued ExposeRegion events. */
static void
dumpqueue ()
{
register int i;
XExposeRegionEvent r;
while (dequeue_event (&r, &x_expose_queue))
{
struct frame *f = x_window_to_frame (r.window);
if (f->display.x->icon_desc == r.window)
refreshicon (f);
else
dumprectangle (f, r.x, r.y, r.width, r.height);
}
XFlushQueue ();
}
#endif /* HAVE_X11 */
/* Process all expose events that are pending, for X10.
Redraws the cursor if necessary on any frame that
is not in the process of being updated with update_frame. */
#ifndef HAVE_X11
static void
x_do_pending_expose ()
{
int mask;
struct frame *f;
Lisp_Object tail, frame;
if (expose_all_windows)
{
expose_all_windows = 0;
for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
{
register int temp_width, temp_height;
int intborder;
frame = XCONS (tail)->car;
if (XGCTYPE (frame) != Lisp_Frame)
continue;
f = XFRAME (frame);
if (! FRAME_X_P (f))
continue;
if (!f->async_visible)
continue;
if (!f->display.x->needs_exposure)
continue;
intborder = f->display.x->internal_border_width;
clear_cursor (f);
XGetWindowInfo (FRAME_X_WINDOW (f), &windowinfo);
temp_width = ((windowinfo.width - 2 * intborder
- f->display.x->v_scroll_bar_width)
/ FONT_WIDTH (f->display.x->font));
temp_height = ((windowinfo.height- 2 * intborder
- f->display.x->h_scroll_bar_height)
/ f->display.x->line_height);
if (temp_width != f->width || temp_height != f->height)
{
change_frame_size (f, max (1, temp_height),
max (1, temp_width), 0, 1);
x_resize_scroll_bars (f);
}
f->display.x->left_pos = windowinfo.x;
f->display.x->top_pos = windowinfo.y;
dumprectangle (f, 0, 0, PIXEL_WIDTH (f), PIXEL_HEIGHT (f));
#if 0
dumpborder (f, 0);
#endif /* ! 0 */
f->display.x->needs_exposure = 0;
if (updating_frame != f)
x_display_cursor (f, 1);
XFlushQueue ();
}
}
else
/* Handle any individual-rectangle expose events queued
for various windows. */
#ifdef HAVE_X11
;
#else /* ! defined (HAVE_X11) */
dumpqueue ();
#endif /* ! defined (HAVE_X11) */
}
#endif
#ifdef HAVE_X11
static void
frame_highlight (frame)
struct frame *frame;
......@@ -1656,50 +1418,6 @@ frame_unhighlight (frame)
UNBLOCK_INPUT;
x_display_cursor (frame, 1);
}
#else /* ! defined (HAVE_X11) */
/* Dump the border-emphasis of frame F.
If F is selected, this is a lining of the same color as the border,
just within the border, occupying a portion of the internal border.
If F is not selected, it is background in the same place.
If ALWAYS is 0, don't bother explicitly drawing if it's background.
ALWAYS = 1 is used when a frame becomes selected or deselected.
In that case, we also turn the cursor off and on again
so it will appear in the proper shape (solid if selected; else hollow.) */
static void
dumpborder (f, always)
struct frame *f;
int always;
{
int thickness = f->display.x->internal_border_width / 2;
int width = PIXEL_WIDTH (f);
int height = PIXEL_HEIGHT (f);
int pixel;
if (f != selected_frame)
{
if (!always)
return;
pixel = f->display.x->background_pixel;
}
else
{
pixel = f->display.x->border_pixel;
}
XPixSet (FRAME_X_WINDOW (f), 0, 0, width, thickness, pixel);
XPixSet (FRAME_X_WINDOW (f), 0, 0, thickness, height, pixel);
XPixSet (FRAME_X_WINDOW (f), 0, height - thickness, width,
thickness, pixel);
XPixSet (FRAME_X_WINDOW (f), width - thickness, 0, thickness,
height, pixel);
if (always)
x_display_cursor (f, 1);
}
#endif /* ! defined (HAVE_X11) */
static void XTframe_rehighlight ();
......@@ -1929,7 +1647,6 @@ x_emacs_to_x_modifiers (state)
}
/* Mouse clicks and mouse movement. Rah. */
#ifdef HAVE_X11
/* Given a pixel position (PIX_X, PIX_Y) on the frame F, return
glyph co-ordinates in (*X, *Y). Set *BOUNDS to the rectangle
......@@ -2602,10 +2319,6 @@ XTmouse_position (f, bar_window, part, x, y, time)
UNBLOCK_INPUT;
}
#else /* ! defined (HAVE_X11) */
#define XEvent XKeyPressedEvent
#endif /* ! defined (HAVE_X11) */
/* Scroll bar support. */
......@@ -3480,7 +3193,6 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
switch (event.type)
{
#ifdef HAVE_X11
case ClientMessage:
{
if (event.xclient.message_type == Xatom_wm_protocols
......@@ -3694,55 +3406,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
source area was completely
available */
break;
#else /* ! defined (HAVE_X11) */
case ExposeWindow:
if (event.subwindow != 0)
break; /* duplicate event */
f = x_window_to_frame (event.window);
if (event.window == f->display.x->icon_desc)
{
refreshicon (f);
f->async_iconified = 1;
}
if (event.window == FRAME_X_WINDOW (f))
{
/* Say must check all windows' needs_exposure flags. */
expose_all_windows = 1;
f->display.x->needs_exposure = 1;
f->async_visible = 1;
}
break;
case ExposeRegion:
if (event.subwindow != 0)
break; /* duplicate event */
f = x_window_to_frame (event.window);
if (event.window == f->display.x->icon_desc)
{
refreshicon (f);
break;
}
/* If window already needs full redraw, ignore this rectangle. */
if (expose_all_windows && f->display.x->needs_exposure)
break;
/* Put the event on the queue of rectangles to redraw. */
if (enqueue_event (&event, &x_expose_queue))
/* If it is full, we can't record the rectangle,
so redraw this entire window. */
{
/* Say must check all windows' needs_exposure flags. */
expose_all_windows = 1;
f->display.x->needs_exposure = 1;
}
break;
case ExposeCopy:
/* This should happen only when we are expecting it,
in x_read_exposes. */
abort ();
#endif /* ! defined (HAVE_X11) */
#ifdef HAVE_X11
case UnmapNotify:
f = x_any_window_to_frame (event.xunmap.window);
if (f) /* F may no longer exist if
......@@ -3786,17 +3450,6 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
case VisibilityNotify:
break;
#else /* ! defined (HAVE_X11) */
case UnmapWindow:
f = x_window_to_frame (event.window);
if (event.window == f->display.x->icon_desc)
f->async_iconified = 0;
if (event.window == FRAME_X_WINDOW (f))
f->async_visible = 0;
break;
#endif /* ! defined (HAVE_X11) */
#ifdef HAVE_X11
case KeyPress:
f = x_any_window_to_frame (event.xkey.window);
......@@ -3930,56 +3583,6 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
abort ();
}
break;
#else /* ! defined (HAVE_X11) */
case KeyPressed:
{
register char *where_mapping;
f = x_window_to_frame (event.window);
/* Ignore keys typed on icon windows. */
if (f != 0 && event.window == f->display.x->icon_desc)
break;
where_mapping = XLookupMapping (&event, &nbytes);
/* Nasty fix for arrow keys */
if (!nbytes && IsCursorKey (event.detail & 0xff))
{
switch (event.detail & 0xff)
{
case KC_CURSOR_LEFT:
where_mapping = "\002";
break;
case KC_CURSOR_RIGHT:
where_mapping = "\006";
break;
case KC_CURSOR_UP:
where_mapping = "\020";
break;
case KC_CURSOR_DOWN:
where_mapping = "\016";
break;
}
nbytes = 1;
}
if (numchars - nbytes > 0)
{
register int i;
for (i = 0; i < nbytes; i++)
{
bufp->kind = ascii_keystroke;
bufp->code = where_mapping[i];
XSET (bufp->time, Lisp_Int, event.xkey.time);
XSET (bufp->frame_or_window, Lisp_Frame, f);
bufp++;
}
count += nbytes;
numchars -= nbytes;
}
}
break;
#endif /* ! defined (HAVE_X11) */
#ifdef HAVE_X11
/* Here's a possible interpretation of the whole
FocusIn-EnterNotify FocusOut-LeaveNotify mess. If you get a
......@@ -4065,43 +3668,6 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
#endif /* USE_X_TOOLKIT */
break;
#else /* ! defined (HAVE_X11) */
case EnterWindow:
if ((event.detail & 0xFF) == 1)
break; /* Coming from our own subwindow */
if (event.subwindow != 0)
break; /* Entering our own subwindow. */
{
f = x_window_to_frame (event.window);
x_mouse_frame = f;
x_new_focus_frame (f);
}
break;
case LeaveWindow:
if ((event.detail & 0xFF) == 1)
break; /* Entering our own subwindow */
if (event.subwindow != 0)
break; /* Leaving our own subwindow. */
x_mouse_frame = 0;
if (x_focus_frame == 0
&& x_input_frame != 0
&& x_input_frame == x_window_to_frame (event.window)
&& event.window == FRAME_X_WINDOW (x_input_frame))
{
f = x_input_frame;
x_input_frame = 0;
if (f)
frame_unhighlight (f);
}
break;
#endif /* ! defined (HAVE_X11) */
#ifdef HAVE_X11
case MotionNotify:
{
if (x_mouse_grabbed && last_mouse_frame
......@@ -4312,56 +3878,11 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
}
break;
#else /* ! defined (HAVE_X11) */
case ButtonPressed:
case ButtonReleased:
f = x_window_to_frame (event.window);
if (f)
{
if (event.window == f->display.x->icon_desc)
{
x_make_frame_visible (f);
if (warp_mouse_on_deiconify)
XWarpMouse (FRAME_X_WINDOW (f), 10, 10);
break;
}
if (event.window == FRAME_X_WINDOW (f))
{
if (f->auto_raise)
x_raise_frame (f);
}
}
enqueue_event (&event, &x_mouse_queue);