static void x_raise_frame (struct frame *);
static void x_lower_frame (struct frame *);
static const XColor *x_color_cells (Display *, int *);
-static void x_update_window_end (struct window *, int, int);
-
static int x_io_error_quitter (Display *);
static struct terminal *x_create_terminal (struct x_display_info *);
void x_delete_terminal (struct terminal *);
here. */
static void
-x_update_window_end (struct window *w, int cursor_on_p, int mouse_face_overwritten_p)
+x_update_window_end (struct window *w, bool cursor_on_p,
+ bool mouse_face_overwritten_p)
{
- Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
-
if (!w->pseudo_window_p)
{
block_input ();
/* If a row with mouse-face was overwritten, arrange for
XTframe_up_to_date to redisplay the mouse highlight. */
if (mouse_face_overwritten_p)
- {
- hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
- hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
- hlinfo->mouse_face_window = Qnil;
- }
+ reset_mouse_highlight (MOUSE_HL_INFO (XFRAME (w->frame)));
}
}
else if (glyph->u.glyphless.method == GLYPHLESS_DISPLAY_HEX_CODE)
{
- sprintf ((char *) buf, "%0*X",
+ sprintf (buf, "%0*X",
glyph->u.glyphless.ch < 0x10000 ? 4 : 6,
glyph->u.glyphless.ch);
str = buf;
static void
xm_scroll_callback (Widget widget, XtPointer client_data, XtPointer call_data)
{
- struct scroll_bar *bar = (struct scroll_bar *) client_data;
- XmScrollBarCallbackStruct *cs = (XmScrollBarCallbackStruct *) call_data;
+ struct scroll_bar *bar = client_data;
+ XmScrollBarCallbackStruct *cs = call_data;
int part = -1, whole = 0, portion = 0;
switch (cs->reason)
gdouble value,
gpointer user_data)
{
- struct scroll_bar *bar = (struct scroll_bar *) user_data;
+ struct scroll_bar *bar = user_data;
gdouble position;
int part = -1, whole = 0, portion = 0;
GtkAdjustment *adj = GTK_ADJUSTMENT (gtk_range_get_adjustment (range));
- struct frame *f = (struct frame *) g_object_get_data (G_OBJECT (range),
- XG_FRAME_DATA);
+ struct frame *f = g_object_get_data (G_OBJECT (range), XG_FRAME_DATA);
if (xg_ignore_gtk_scrollbar) return FALSE;
position = gtk_adjustment_get_value (adj);
GdkEventButton *event,
gpointer user_data)
{
- struct scroll_bar *bar = (struct scroll_bar *) user_data;
+ struct scroll_bar *bar = user_data;
bar->dragging = Qnil;
if (WINDOWP (window_being_scrolled))
{
static void
xaw_jump_callback (Widget widget, XtPointer client_data, XtPointer call_data)
{
- struct scroll_bar *bar = (struct scroll_bar *) client_data;
- float top = *(float *) call_data;
+ struct scroll_bar *bar = client_data;
+ float *top_addr = call_data;
+ float top = *top_addr;
float shown;
int whole, portion, height;
int part;
static void
xaw_scroll_callback (Widget widget, XtPointer client_data, XtPointer call_data)
{
- struct scroll_bar *bar = (struct scroll_bar *) client_data;
+ struct scroll_bar *bar = client_data;
/* The position really is stored cast to a pointer. */
- int position = (long) call_data;
+ int position = (intptr_t) call_data;
Dimension height;
int part;
int top, height, left, sb_left, width, sb_width;
int window_y, window_height;
#ifdef USE_TOOLKIT_SCROLL_BARS
- int fringe_extended_p;
+ bool fringe_extended_p;
#endif
/* Get window dimensions. */
#endif
#ifdef USE_TOOLKIT_SCROLL_BARS
- if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
- fringe_extended_p = (WINDOW_LEFTMOST_P (w)
- && WINDOW_LEFT_FRINGE_WIDTH (w)
- && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
- || WINDOW_LEFT_MARGIN_COLS (w) == 0));
- else
- fringe_extended_p = (WINDOW_RIGHTMOST_P (w)
- && WINDOW_RIGHT_FRINGE_WIDTH (w)
- && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
- || WINDOW_RIGHT_MARGIN_COLS (w) == 0));
+ fringe_extended_p = WINDOW_FRINGE_EXTENDED_P (w);
#endif
/* Does the scroll bar exist yet? */
/* RIF: Draw cursor on window W. */
static void
-x_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x, int y, int cursor_type, int cursor_width, int on_p, int active_p)
+x_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x,
+ int y, enum text_cursor_kinds cursor_type,
+ int cursor_width, bool on_p, bool active_p)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
x_error_handler (Display *display, XErrorEvent *event)
{
#if defined USE_GTK && defined HAVE_GTK3
- if (event->error_code == BadMatch
- && event->request_code == X_SetInputFocus
- && event->minor_code == 0)
+ if ((event->error_code == BadMatch || event->error_code == BadWindow)
+ && event->request_code == X_SetInputFocus)
{
return 0;
}
dpyinfo->x_focus_event_frame = 0;
if (f == dpyinfo->x_highlight_frame)
dpyinfo->x_highlight_frame = 0;
-
if (f == hlinfo->mouse_face_mouse_frame)
- {
- hlinfo->mouse_face_beg_row
- = hlinfo->mouse_face_beg_col = -1;
- hlinfo->mouse_face_end_row
- = hlinfo->mouse_face_end_col = -1;
- hlinfo->mouse_face_window = Qnil;
- hlinfo->mouse_face_mouse_frame = 0;
- }
+ reset_mouse_highlight (hlinfo);
unblock_input ();
}
struct terminal *terminal;
struct x_display_info *dpyinfo;
XrmDatabase xrdb;
- Mouse_HLInfo *hlinfo;
ptrdiff_t lim;
block_input ();
/* We have definitely succeeded. Record the new connection. */
dpyinfo = xzalloc (sizeof *dpyinfo);
- hlinfo = &dpyinfo->mouse_highlight;
-
terminal = x_create_terminal (dpyinfo);
{
dpyinfo->display = dpy;
/* Set the name of the terminal. */
- terminal->name = xmalloc (SBYTES (display_name) + 1);
- memcpy (terminal->name, SSDATA (display_name), SBYTES (display_name));
- terminal->name[SBYTES (display_name)] = 0;
+ terminal->name = xlispstrdup (display_name);
#if 0
XSetAfterFunction (x_current_display, x_trace_wire);
select_visual (dpyinfo);
dpyinfo->cmap = DefaultColormapOfScreen (dpyinfo->screen);
dpyinfo->root_window = RootWindowOfScreen (dpyinfo->screen);
- dpyinfo->client_leader_window = 0;
- dpyinfo->grabbed = 0;
- dpyinfo->reference_count = 0;
dpyinfo->icon_bitmap_id = -1;
- dpyinfo->n_fonts = 0;
- dpyinfo->bitmaps = 0;
- dpyinfo->bitmaps_size = 0;
- dpyinfo->bitmaps_last = 0;
- dpyinfo->scratch_cursor_gc = 0;
- hlinfo->mouse_face_mouse_frame = 0;
- hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
- hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
- hlinfo->mouse_face_face_id = DEFAULT_FACE_ID;
- hlinfo->mouse_face_window = Qnil;
- hlinfo->mouse_face_overlay = Qnil;
- hlinfo->mouse_face_mouse_x = hlinfo->mouse_face_mouse_y = 0;
- hlinfo->mouse_face_defer = 0;
- hlinfo->mouse_face_hidden = 0;
- dpyinfo->x_focus_frame = 0;
- dpyinfo->x_focus_event_frame = 0;
- dpyinfo->x_highlight_frame = 0;
dpyinfo->wm_type = X_WMTYPE_UNKNOWN;
- /* See if we can construct pixel values from RGB values. */
- dpyinfo->red_bits = dpyinfo->blue_bits = dpyinfo->green_bits = 0;
- dpyinfo->red_offset = dpyinfo->blue_offset = dpyinfo->green_offset = 0;
+ reset_mouse_highlight (&dpyinfo->mouse_highlight);
+ /* See if we can construct pixel values from RGB values. */
if (dpyinfo->visual->class == TrueColor)
{
get_bits_and_offset (dpyinfo->visual->red_mask,
}
dpyinfo->x_dnd_atoms_size = 8;
- dpyinfo->x_dnd_atoms_length = 0;
dpyinfo->x_dnd_atoms = xmalloc (sizeof *dpyinfo->x_dnd_atoms
* dpyinfo->x_dnd_atoms_size);
- dpyinfo->net_supported_atoms = NULL;
- dpyinfo->nr_net_supported_atoms = 0;
- dpyinfo->net_supported_window = 0;
-
connection = ConnectionNumber (dpyinfo->display);
dpyinfo->connection = connection;
dpyinfo->gray