Not compiled yet.
nsterm.m (ns_update_window_begin, ns_update_window_end)
(ns_update_end, x_destroy_window, ns_frame_up_to_date)
(ns_dumpglyphs_box_or_relief, ns_maybe_dumpglyphs_background)
(ns_dumpglyphs_image, ns_dumpglyphs_stretch)
(ns_initialize_display_info, keyDown, mouseMoved, mouseExited):
Replace Display_Info with Mouse_HLInfo everywhere where
mouse_face_* members were accessed for mouse highlight purposes.
xterm.c (x_update_window_begin, x_update_window_end)
(x_update_end, XTframe_up_to_date, x_set_mouse_face_gc)
(handle_one_xevent, x_free_frame_resources, x_term_init): Replace
Display_Info with Mouse_HLInfo everywhere where mouse_face_*
members were accessed for mouse highlight purposes.
w32term.c (x_update_window_begin, x_update_window_end)
(x_update_end, w32_read_socket, x_free_frame_resources)
(w32_initialize_display_info): Replace Display_Info with
Mouse_HLInfo everywhere where mouse_face_* members were accessed
for mouse highlight purposes.
xdisp.c (show_mouse_face, note_mode_line_or_margin_highlight)
(note_mouse_highlight) [HAVE_WINDOW_SYSTEM]: Don't run GUI code
unless the frame is on a window-system.
+2010-11-01 Eli Zaretskii <eliz@gnu.org>
+
+ * nsterm.m (ns_update_window_begin, ns_update_window_end)
+ (ns_update_end, x_destroy_window, ns_frame_up_to_date)
+ (ns_dumpglyphs_box_or_relief, ns_maybe_dumpglyphs_background)
+ (ns_dumpglyphs_image, ns_dumpglyphs_stretch)
+ (ns_initialize_display_info, keyDown, mouseMoved, mouseExited):
+ Replace Display_Info with Mouse_HLInfo everywhere where
+ mouse_face_* members were accessed for mouse highlight purposes.
+
+ * xterm.c (x_update_window_begin, x_update_window_end)
+ (x_update_end, XTframe_up_to_date, x_set_mouse_face_gc)
+ (handle_one_xevent, x_free_frame_resources, x_term_init): Replace
+ Display_Info with Mouse_HLInfo everywhere where mouse_face_*
+ members were accessed for mouse highlight purposes.
+
+ * w32term.c (x_update_window_begin, x_update_window_end)
+ (x_update_end, w32_read_socket, x_free_frame_resources)
+ (w32_initialize_display_info): Replace Display_Info with
+ Mouse_HLInfo everywhere where mouse_face_* members were accessed
+ for mouse highlight purposes.
+
+ * xdisp.c (show_mouse_face, note_mode_line_or_margin_highlight)
+ (note_mouse_highlight) [HAVE_WINDOW_SYSTEM]: Don't run GUI code
+ unless the frame is on a window-system.
+
2010-10-31 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (get_tool_bar_item, handle_tool_bar_click)
-------------------------------------------------------------------------- */
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
- struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f);
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
NSTRACE (ns_update_window_begin);
updated_window = w;
BLOCK_INPUT;
- if (f == dpyinfo->mouse_face_mouse_frame)
+ if (f == hlinfo->mouse_face_mouse_frame)
{
/* Don't do highlighting for mouse motion during the update. */
- dpyinfo->mouse_face_defer = 1;
+ hlinfo->mouse_face_defer = 1;
/* If the frame needs to be redrawn,
simply forget about any prior mouse highlighting. */
if (FRAME_GARBAGED_P (f))
- dpyinfo->mouse_face_window = Qnil;
+ hlinfo->mouse_face_window = Qnil;
/* (further code for mouse faces ifdef'd out in other terms elided) */
}
external (RIF) call; for one window called before update_end
-------------------------------------------------------------------------- */
{
- struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (XFRAME (w->frame));
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
/* note: this fn is nearly identical in all terms */
if (!w->pseudo_window_p)
frame_up_to_date to redisplay the mouse highlight. */
if (mouse_face_overwritten_p)
{
- dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1;
- dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1;
- dpyinfo->mouse_face_window = Qnil;
+ 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;
}
updated_window = NULL;
{
NSView *view = FRAME_NS_VIEW (f);
-/* if (f == FRAME_NS_DISPLAY_INFO (f)->mouse_face_mouse_frame) */
- FRAME_NS_DISPLAY_INFO (f)->mouse_face_defer = 0;
+/* if (f == MOUSE_HL_INFO (f)->mouse_face_mouse_frame) */
+ MOUSE_HL_INFO (f)->mouse_face_defer = 0;
BLOCK_INPUT;
{
NSView *view = FRAME_NS_VIEW (f);
struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f);
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
NSTRACE (x_destroy_window);
check_ns ();
dpyinfo->x_focus_frame = 0;
if (f == dpyinfo->x_highlight_frame)
dpyinfo->x_highlight_frame = 0;
- if (f == dpyinfo->mouse_face_mouse_frame)
+ if (f == hlinfo->mouse_face_mouse_frame)
{
- dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1;
- dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1;
- dpyinfo->mouse_face_window = Qnil;
- dpyinfo->mouse_face_deferred_gc = 0;
- dpyinfo->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_window = Qnil;
+ hlinfo->mouse_face_deferred_gc = 0;
+ hlinfo->mouse_face_mouse_frame = 0;
}
xfree (f->output_data.ns);
if (FRAME_NS_P (f))
{
- struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f);
- if ((dpyinfo->mouse_face_deferred_gc||f ==dpyinfo->mouse_face_mouse_frame)
- /*&& dpyinfo->mouse_face_mouse_frame*/)
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
+ if ((hlinfo->mouse_face_deferred_gc || f ==hlinfo->mouse_face_mouse_frame)
+ /*&& hlinfo->mouse_face_mouse_frame*/)
{
BLOCK_INPUT;
- ns_update_begin(f);
- if (dpyinfo->mouse_face_mouse_frame)
- note_mouse_highlight (dpyinfo->mouse_face_mouse_frame,
- dpyinfo->mouse_face_mouse_x,
- dpyinfo->mouse_face_mouse_y);
- dpyinfo->mouse_face_deferred_gc = 0;
- ns_update_end(f);
+ ns_update_begin(f);
+ if (hlinfo->mouse_face_mouse_frame)
+ note_mouse_highlight (hlinfo->mouse_face_mouse_frame,
+ hlinfo->mouse_face_mouse_x,
+ hlinfo->mouse_face_mouse_y);
+ hlinfo->mouse_face_deferred_gc = 0;
+ ns_update_end(f);
UNBLOCK_INPUT;
}
}
if (s->hl == DRAW_MOUSE_FACE)
{
- face = FACE_FROM_ID
- (s->f, FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id);
+ face = FACE_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id);
if (!face)
face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
}
struct face *face;
if (s->hl == DRAW_MOUSE_FACE)
{
- face = FACE_FROM_ID
- (s->f, FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id);
+ face = FACE_FROM_ID (s->f,
+ MOUSE_HL_INFO (s->f)->mouse_face_face_id);
if (!face)
face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
}
with its background color), we must clear just the image area. */
if (s->hl == DRAW_MOUSE_FACE)
{
- face = FACE_FROM_ID
- (s->f, FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id);
+ face = FACE_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id);
if (!face)
face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
}
if (s->hl == DRAW_MOUSE_FACE)
{
- face = FACE_FROM_ID
- (s->f, FRAME_NS_DISPLAY_INFO (s->f)->mouse_face_face_id);
+ face = FACE_FROM_ID (s->f, MOUSE_HL_INFO (s->f)->mouse_face_face_id);
if (!face)
face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
}
{
NSScreen *screen = [NSScreen mainScreen];
NSWindowDepth depth = [screen depth];
+ Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight;
dpyinfo->resx = 72.27; /* used 75.0, but this makes pt == pixel, expected */
dpyinfo->resy = 72.27;
dpyinfo->color_table->colors = NULL;
dpyinfo->root_window = 42; /* a placeholder.. */
- dpyinfo->mouse_face_mouse_frame = NULL;
- dpyinfo->mouse_face_deferred_gc = 0;
- dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1;
- dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1;
- dpyinfo->mouse_face_face_id = DEFAULT_FACE_ID;
- dpyinfo->mouse_face_window = dpyinfo->mouse_face_overlay = Qnil;
- dpyinfo->mouse_face_hidden = 0;
+ hlinfo->mouse_face_mouse_frame = NULL;
+ hlinfo->mouse_face_deferred_gc = 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 = hlinfo->mouse_face_overlay = Qnil;
+ hlinfo->mouse_face_hidden = 0;
- dpyinfo->mouse_face_mouse_x = dpyinfo->mouse_face_mouse_y = 0;
- dpyinfo->mouse_face_defer = 0;
+ hlinfo->mouse_face_mouse_x = hlinfo->mouse_face_mouse_y = 0;
+ hlinfo->mouse_face_defer = 0;
dpyinfo->x_highlight_frame = dpyinfo->x_focus_frame = NULL;
- (void)keyDown: (NSEvent *)theEvent
{
- struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (emacsframe);
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (emacsframe);
int code;
unsigned fnKeysym = 0;
int flags;
[NSCursor setHiddenUntilMouseMoves: YES];
- if (dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight))
+ if (hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight))
{
- clear_mouse_face (dpyinfo);
- dpyinfo->mouse_face_hidden = 1;
+ clear_mouse_face (hlinfo);
+ hlinfo->mouse_face_hidden = 1;
}
if (!processingCompose)
/* Tell emacs the mouse has moved. */
- (void)mouseMoved: (NSEvent *)e
{
- struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (emacsframe);
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (emacsframe);
Lisp_Object frame;
// NSTRACE (mouseMoved);
= [self convertPoint: [e locationInWindow] fromView: nil];
/* update any mouse face */
- if (dpyinfo->mouse_face_hidden)
+ if (hlinfo->mouse_face_hidden)
{
- dpyinfo->mouse_face_hidden = 0;
- clear_mouse_face (dpyinfo);
+ hlinfo->mouse_face_hidden = 0;
+ clear_mouse_face (hlinfo);
}
/* tooltip handling */
{
NSPoint p = [self convertPoint: [theEvent locationInWindow] fromView: nil];
NSRect r;
- struct ns_display_info *dpyinfo
- = emacsframe ? FRAME_NS_DISPLAY_INFO (emacsframe) : NULL;
+ Mouse_HLInfo *hlinfo = emacsframe ? MOUSE_HL_INFO (emacsframe) : NULL;
NSTRACE (mouseExited);
- if (dpyinfo || !emacsframe)
+ if (hlinfo || !emacsframe)
return;
last_mouse_movement_time = EV_TIMESTAMP (theEvent);
- if (emacsframe == dpyinfo->mouse_face_mouse_frame)
+ if (emacsframe == hlinfo->mouse_face_mouse_frame)
{
- clear_mouse_face (dpyinfo);
- dpyinfo->mouse_face_mouse_frame = 0;
+ clear_mouse_face (hlinfo);
+ hlinfo->mouse_face_mouse_frame = 0;
}
}
x_update_window_begin (struct window *w)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
- struct w32_display_info *display_info = FRAME_W32_DISPLAY_INFO (f);
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
/* Hide the system caret during an update. */
if (w32_use_visible_system_caret && w32_system_caret_hwnd)
BLOCK_INPUT;
- if (f == display_info->mouse_face_mouse_frame)
+ if (f == hlinfo->mouse_face_mouse_frame)
{
/* Don't do highlighting for mouse motion during the update. */
- display_info->mouse_face_defer = 1;
+ hlinfo->mouse_face_defer = 1;
/* If F needs to be redrawn, simply forget about any prior mouse
highlighting. */
if (FRAME_GARBAGED_P (f))
- display_info->mouse_face_window = Qnil;
+ hlinfo->mouse_face_window = Qnil;
#if 0 /* Rows in a current matrix containing glyphs in mouse-face have
their mouse_face_p flag set, which means that they are always
Likewise, don't do anything if the frame is garbaged;
in that case, the frame's current matrix that we would use
is all wrong, and we will redisplay that line anyway. */
- if (!NILP (display_info->mouse_face_window)
- && w == XWINDOW (display_info->mouse_face_window))
+ if (!NILP (hlinfo->mouse_face_window)
+ && w == XWINDOW (hlinfo->mouse_face_window))
{
int i;
break;
if (i < w->desired_matrix->nrows)
- clear_mouse_face (display_info);
+ clear_mouse_face (hlinfo);
}
#endif /* 0 */
}
x_update_window_end (struct window *w, int cursor_on_p,
int mouse_face_overwritten_p)
{
- struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (XFRAME (w->frame));
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
if (!w->pseudo_window_p)
{
XTframe_up_to_date to redisplay the mouse highlight. */
if (mouse_face_overwritten_p)
{
- dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1;
- dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1;
- dpyinfo->mouse_face_window = Qnil;
+ 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;
}
/* Unhide the caret. This won't actually show the cursor, unless it
return;
/* Mouse highlight may be displayed again. */
- FRAME_W32_DISPLAY_INFO (f)->mouse_face_defer = 0;
+ MOUSE_HL_INFO (f)->mouse_face_defer = 0;
}
{
if (FRAME_W32_P (f))
{
- struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
- if (dpyinfo->mouse_face_deferred_gc
- || f == dpyinfo->mouse_face_mouse_frame)
+ if (hlinfo->mouse_face_deferred_gc
+ || f == hlinfo->mouse_face_mouse_frame)
{
BLOCK_INPUT;
- if (dpyinfo->mouse_face_mouse_frame)
- note_mouse_highlight (dpyinfo->mouse_face_mouse_frame,
- dpyinfo->mouse_face_mouse_x,
- dpyinfo->mouse_face_mouse_y);
- dpyinfo->mouse_face_deferred_gc = 0;
+ if (hlinfo->mouse_face_mouse_frame)
+ note_mouse_highlight (hlinfo->mouse_face_mouse_frame,
+ hlinfo->mouse_face_mouse_x,
+ hlinfo->mouse_face_mouse_y);
+ hlinfo->mouse_face_deferred_gc = 0;
UNBLOCK_INPUT;
}
}
struct face *face;
/* What face has to be used last for the mouse face? */
- face_id = FRAME_W32_DISPLAY_INFO (s->f)->mouse_face_face_id;
+ face_id = MOUSE_HL_INFO (s->f)->mouse_face_face_id;
face = FACE_FROM_ID (s->f, face_id);
if (face == NULL)
face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
W32Msg msg;
struct frame *f;
struct w32_display_info *dpyinfo = &one_w32_display_info;
+ Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight;
if (interrupt_input_blocked)
{
if (f && !f->iconified)
{
- if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
- && !EQ (f->tool_bar_window, dpyinfo->mouse_face_window))
+ if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
+ && !EQ (f->tool_bar_window, hlinfo->mouse_face_window))
{
- clear_mouse_face (dpyinfo);
- dpyinfo->mouse_face_hidden = 1;
+ clear_mouse_face (hlinfo);
+ hlinfo->mouse_face_hidden = 1;
}
if (temp_index == sizeof temp_buffer / sizeof (short))
if (f && !f->iconified)
{
- if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
- && !EQ (f->tool_bar_window, dpyinfo->mouse_face_window))
+ if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
+ && !EQ (f->tool_bar_window, hlinfo->mouse_face_window))
{
- clear_mouse_face (dpyinfo);
- dpyinfo->mouse_face_hidden = 1;
+ clear_mouse_face (hlinfo);
+ hlinfo->mouse_face_hidden = 1;
}
if (temp_index == sizeof temp_buffer / sizeof (short))
if (f && !f->iconified)
{
- if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
- && !EQ (f->tool_bar_window, dpyinfo->mouse_face_window))
+ if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
+ && !EQ (f->tool_bar_window, hlinfo->mouse_face_window))
{
- clear_mouse_face (dpyinfo);
- dpyinfo->mouse_face_hidden = 1;
+ clear_mouse_face (hlinfo);
+ hlinfo->mouse_face_hidden = 1;
}
if (temp_index == sizeof temp_buffer / sizeof (short))
else
f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
- if (dpyinfo->mouse_face_hidden)
+ if (hlinfo->mouse_face_hidden)
{
- dpyinfo->mouse_face_hidden = 0;
- clear_mouse_face (dpyinfo);
+ hlinfo->mouse_face_hidden = 0;
+ clear_mouse_face (hlinfo);
}
if (f)
{
/* If we move outside the frame, then we're
certainly no longer on any text in the frame. */
- clear_mouse_face (dpyinfo);
+ clear_mouse_face (hlinfo);
}
/* If the contents of the global variable help_echo_string
f = x_any_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f)
{
- if (f == dpyinfo->mouse_face_mouse_frame)
+ if (f == hlinfo->mouse_face_mouse_frame)
{
/* If we move outside the frame, then we're
certainly no longer on any text in the frame. */
- clear_mouse_face (dpyinfo);
- dpyinfo->mouse_face_mouse_frame = 0;
+ clear_mouse_face (hlinfo);
+ hlinfo->mouse_face_mouse_frame = 0;
}
/* Generate a nil HELP_EVENT to cancel a help-echo.
if (f == dpyinfo->w32_focus_frame)
x_new_focus_frame (dpyinfo, 0);
- if (f == dpyinfo->mouse_face_mouse_frame)
+ if (f == hlinfo->mouse_face_mouse_frame)
{
/* If we move outside the frame, then we're
certainly no longer on any text in the frame. */
- clear_mouse_face (dpyinfo);
- dpyinfo->mouse_face_mouse_frame = 0;
+ clear_mouse_face (hlinfo);
+ hlinfo->mouse_face_mouse_frame = 0;
}
/* Generate a nil HELP_EVENT to cancel a help-echo.
x_free_frame_resources (struct frame *f)
{
struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
BLOCK_INPUT;
if (f == dpyinfo->x_highlight_frame)
dpyinfo->x_highlight_frame = 0;
- if (f == dpyinfo->mouse_face_mouse_frame)
+ if (f == hlinfo->mouse_face_mouse_frame)
{
- dpyinfo->mouse_face_beg_row
- = dpyinfo->mouse_face_beg_col = -1;
- dpyinfo->mouse_face_end_row
- = dpyinfo->mouse_face_end_col = -1;
- dpyinfo->mouse_face_window = Qnil;
- dpyinfo->mouse_face_deferred_gc = 0;
- dpyinfo->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_window = Qnil;
+ hlinfo->mouse_face_deferred_gc = 0;
+ hlinfo->mouse_face_mouse_frame = 0;
}
UNBLOCK_INPUT;
w32_initialize_display_info (Lisp_Object display_name)
{
struct w32_display_info *dpyinfo = &one_w32_display_info;
+ Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight;
memset (dpyinfo, 0, sizeof (*dpyinfo));
dpyinfo->smallest_font_height = 1;
dpyinfo->smallest_char_width = 1;
- dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1;
- dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1;
- dpyinfo->mouse_face_face_id = DEFAULT_FACE_ID;
- dpyinfo->mouse_face_window = Qnil;
- dpyinfo->mouse_face_overlay = Qnil;
- dpyinfo->mouse_face_hidden = 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_hidden = 0;
dpyinfo->vertical_scroll_bar_cursor = w32_load_cursor (IDC_ARROW);
/* TODO: dpyinfo->gray */
#ifdef HAVE_WINDOW_SYSTEM
/* When we've written over the cursor, arrange for it to
be displayed again. */
- if (phys_cursor_on_p && !w->phys_cursor_on_p)
+ if (FRAME_WINDOW_P (f)
+ && phys_cursor_on_p && !w->phys_cursor_on_p)
{
BLOCK_INPUT;
display_and_set_cursor (w, 1,
#ifdef HAVE_WINDOW_SYSTEM
/* Change the mouse cursor. */
- if (draw == DRAW_NORMAL_TEXT && !EQ (hlinfo->mouse_face_window, f->tool_bar_window))
- FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor);
- else if (draw == DRAW_MOUSE_FACE)
- FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor);
- else
- FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->nontext_cursor);
-
+ if (FRAME_WINDOW_P (f))
+ {
+ if (draw == DRAW_NORMAL_TEXT
+ && !EQ (hlinfo->mouse_face_window, f->tool_bar_window))
+ FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor);
+ else if (draw == DRAW_MOUSE_FACE)
+ FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor);
+ else
+ FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->nontext_cursor);
+ }
#endif /* HAVE_WINDOW_SYSTEM */
}
struct frame *f = XFRAME (w->frame);
Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
#ifdef HAVE_WINDOW_SYSTEM
- Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
- Cursor cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
+ Display_Info *dpyinfo;
+ Cursor cursor;
#else
Cursor cursor = No_Cursor;
#endif
}
#ifdef HAVE_WINDOW_SYSTEM
- if (NILP (pointer))
- pointer = Fget_text_property (pos, Qpointer, string);
-
- /* Change the mouse pointer according to what is under X/Y. */
- if (NILP (pointer) && ((area == ON_MODE_LINE) || (area == ON_HEADER_LINE)))
+ if (FRAME_WINDOW_P (f))
{
- Lisp_Object map;
- map = Fget_text_property (pos, Qlocal_map, string);
- if (!KEYMAPP (map))
- map = Fget_text_property (pos, Qkeymap, string);
- if (!KEYMAPP (map))
- cursor = dpyinfo->vertical_scroll_bar_cursor;
+ dpyinfo = FRAME_X_DISPLAY_INFO (f);
+ cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
+ if (NILP (pointer))
+ pointer = Fget_text_property (pos, Qpointer, string);
+
+ /* Change the mouse pointer according to what is under X/Y. */
+ if (NILP (pointer)
+ && ((area == ON_MODE_LINE) || (area == ON_HEADER_LINE)))
+ {
+ Lisp_Object map;
+ map = Fget_text_property (pos, Qlocal_map, string);
+ if (!KEYMAPP (map))
+ map = Fget_text_property (pos, Qkeymap, string);
+ if (!KEYMAPP (map))
+ cursor = dpyinfo->vertical_scroll_bar_cursor;
+ }
}
#endif
clear_mouse_face (hlinfo);
}
#ifdef HAVE_WINDOW_SYSTEM
- define_frame_cursor1 (f, cursor, pointer);
+ if (FRAME_WINDOW_P (f))
+ define_frame_cursor1 (f, cursor, pointer);
#endif
}
if (clear_mouse_face (hlinfo))
cursor = No_Cursor;
#ifdef HAVE_WINDOW_SYSTEM
- if (NILP (pointer))
+ if (FRAME_WINDOW_P (f) && NILP (pointer))
{
if (area != TEXT_AREA)
cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
#ifdef HAVE_WINDOW_SYSTEM
/* Look for a `pointer' property. */
- if (NILP (pointer))
+ if (FRAME_WINDOW_P (f) && NILP (pointer))
{
/* Check overlays first. */
for (i = noverlays - 1; i >= 0 && NILP (pointer); --i)
set_cursor:
#ifdef HAVE_WINDOW_SYSTEM
- define_frame_cursor1 (f, cursor, pointer);
+ if (FRAME_WINDOW_P (f))
+ define_frame_cursor1 (f, cursor, pointer);
#else
- /* This is here to prevent a compiler error, due to "label at end of
+ /* This is here to prevent a compiler error, about "label at end of
compound statement". */
return;
#endif
x_update_window_begin (struct window *w)
{
struct frame *f = XFRAME (WINDOW_FRAME (w));
- struct x_display_info *display_info = FRAME_X_DISPLAY_INFO (f);
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
updated_window = w;
set_output_cursor (&w->cursor);
BLOCK_INPUT;
- if (f == display_info->mouse_face_mouse_frame)
+ if (f == hlinfo->mouse_face_mouse_frame)
{
/* Don't do highlighting for mouse motion during the update. */
- display_info->mouse_face_defer = 1;
+ hlinfo->mouse_face_defer = 1;
/* If F needs to be redrawn, simply forget about any prior mouse
highlighting. */
if (FRAME_GARBAGED_P (f))
- display_info->mouse_face_window = Qnil;
+ hlinfo->mouse_face_window = Qnil;
}
UNBLOCK_INPUT;
static void
x_update_window_end (struct window *w, int cursor_on_p, int mouse_face_overwritten_p)
{
- struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (w->frame));
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
if (!w->pseudo_window_p)
{
XTframe_up_to_date to redisplay the mouse highlight. */
if (mouse_face_overwritten_p)
{
- dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1;
- dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1;
- dpyinfo->mouse_face_window = Qnil;
+ 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;
}
updated_window = NULL;
x_update_end (struct frame *f)
{
/* Mouse highlight may be displayed again. */
- FRAME_X_DISPLAY_INFO (f)->mouse_face_defer = 0;
+ MOUSE_HL_INFO (f)->mouse_face_defer = 0;
#ifndef XFlush
BLOCK_INPUT;
{
if (FRAME_X_P (f))
{
- struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
+ Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
- if (dpyinfo->mouse_face_deferred_gc
- || f == dpyinfo->mouse_face_mouse_frame)
+ if (hlinfo->mouse_face_deferred_gc
+ || f == hlinfo->mouse_face_mouse_frame)
{
BLOCK_INPUT;
- if (dpyinfo->mouse_face_mouse_frame)
- note_mouse_highlight (dpyinfo->mouse_face_mouse_frame,
- dpyinfo->mouse_face_mouse_x,
- dpyinfo->mouse_face_mouse_y);
- dpyinfo->mouse_face_deferred_gc = 0;
+ if (hlinfo->mouse_face_mouse_frame)
+ note_mouse_highlight (hlinfo->mouse_face_mouse_frame,
+ hlinfo->mouse_face_mouse_x,
+ hlinfo->mouse_face_mouse_y);
+ hlinfo->mouse_face_deferred_gc = 0;
UNBLOCK_INPUT;
}
}
struct face *face;
/* What face has to be used last for the mouse face? */
- face_id = FRAME_X_DISPLAY_INFO (s->f)->mouse_face_face_id;
+ face_id = MOUSE_HL_INFO (s->f)->mouse_face_face_id;
face = FACE_FROM_ID (s->f, face_id);
if (face == NULL)
face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
struct frame *f = NULL;
struct coding_system coding;
XEvent event = *eventp;
+ Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight;
*finish = X_EVENT_NORMAL;
/* If mouse-highlight is an integer, input clears out
mouse highlighting. */
- if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
+ if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
&& (f == 0
- || !EQ (f->tool_bar_window, dpyinfo->mouse_face_window)))
+ || !EQ (f->tool_bar_window, hlinfo->mouse_face_window)))
{
- clear_mouse_face (dpyinfo);
- dpyinfo->mouse_face_hidden = 1;
+ clear_mouse_face (hlinfo);
+ hlinfo->mouse_face_hidden = 1;
}
#if defined USE_MOTIF && defined USE_TOOLKIT_SCROLL_BARS
f = x_top_window_to_frame (dpyinfo, event.xcrossing.window);
if (f)
{
- if (f == dpyinfo->mouse_face_mouse_frame)
+ if (f == hlinfo->mouse_face_mouse_frame)
{
/* If we move outside the frame, then we're
certainly no longer on any text in the frame. */
- clear_mouse_face (dpyinfo);
- dpyinfo->mouse_face_mouse_frame = 0;
+ clear_mouse_face (hlinfo);
+ hlinfo->mouse_face_mouse_frame = 0;
}
/* Generate a nil HELP_EVENT to cancel a help-echo.
else
f = x_window_to_frame (dpyinfo, event.xmotion.window);
- if (dpyinfo->mouse_face_hidden)
+ if (hlinfo->mouse_face_hidden)
{
- dpyinfo->mouse_face_hidden = 0;
- clear_mouse_face (dpyinfo);
+ hlinfo->mouse_face_hidden = 0;
+ clear_mouse_face (hlinfo);
}
#ifdef USE_GTK
/* If we move outside the frame, then we're
certainly no longer on any text in the frame. */
- clear_mouse_face (dpyinfo);
+ clear_mouse_face (hlinfo);
}
/* If the contents of the global variable help_echo_string
struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
Lisp_Object bar;
struct scroll_bar *b;
+ Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight;
BLOCK_INPUT;
if (f == dpyinfo->x_highlight_frame)
dpyinfo->x_highlight_frame = 0;
- if (f == dpyinfo->mouse_face_mouse_frame)
+ if (f == hlinfo->mouse_face_mouse_frame)
{
- dpyinfo->mouse_face_beg_row
- = dpyinfo->mouse_face_beg_col = -1;
- dpyinfo->mouse_face_end_row
- = dpyinfo->mouse_face_end_col = -1;
- dpyinfo->mouse_face_window = Qnil;
- dpyinfo->mouse_face_deferred_gc = 0;
- dpyinfo->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_window = Qnil;
+ hlinfo->mouse_face_deferred_gc = 0;
+ hlinfo->mouse_face_mouse_frame = 0;
}
UNBLOCK_INPUT;
struct terminal *terminal;
struct x_display_info *dpyinfo;
XrmDatabase xrdb;
+ Mouse_HLInfo *hlinfo;
BLOCK_INPUT;
dpyinfo = (struct x_display_info *) xmalloc (sizeof (struct x_display_info));
memset (dpyinfo, 0, sizeof *dpyinfo);
+ hlinfo = &dpyinfo->mouse_highlight;
terminal = x_create_terminal (dpyinfo);
dpyinfo->bitmaps_size = 0;
dpyinfo->bitmaps_last = 0;
dpyinfo->scratch_cursor_gc = 0;
- dpyinfo->mouse_face_mouse_frame = 0;
- dpyinfo->mouse_face_deferred_gc = 0;
- dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1;
- dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1;
- dpyinfo->mouse_face_face_id = DEFAULT_FACE_ID;
- dpyinfo->mouse_face_window = Qnil;
- dpyinfo->mouse_face_overlay = Qnil;
- dpyinfo->mouse_face_mouse_x = dpyinfo->mouse_face_mouse_y = 0;
- dpyinfo->mouse_face_defer = 0;
- dpyinfo->mouse_face_hidden = 0;
+ hlinfo->mouse_face_mouse_frame = 0;
+ hlinfo->mouse_face_deferred_gc = 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;