int w32_message_fd = -1;
#endif /* CYGWIN */
-static void x_update_window_end (struct window *, int, int);
static void w32_handle_tool_bar_click (struct frame *,
struct input_event *);
static void w32_define_cursor (Window, Cursor);
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)));
/* Unhide the caret. This won't actually show the cursor, unless it
was visible before the corresponding call to HideCaret in
HWND hwnd;
SCROLLINFO si;
struct scroll_bar *bar
- = XSCROLL_BAR (Fmake_vector (make_number (VECSIZE (struct scroll_bar)), Qnil));
+ = ALLOCATE_PSEUDOVECTOR (struct scroll_bar, fringe_extended_p, PVEC_OTHER);
Lisp_Object barobj;
block_input ();
XSETINT (bar->start, 0);
XSETINT (bar->end, 0);
bar->dragging = Qnil;
- bar->fringe_extended_p = Qnil;
+ bar->fringe_extended_p = 0;
/* Requires geometry to be set before call to create the real window */
struct scroll_bar *bar;
int top, height, left, sb_left, width, sb_width;
int window_y, window_height;
- int fringe_extended_p;
+ bool fringe_extended_p;
/* Get window dimensions. */
window_box (w, -1, 0, &window_y, 0, &window_height);
else
sb_left = left + (WINDOW_LEFTMOST_P (w) ? 0 : width - sb_width);
- 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);
/* Does the scroll bar exist yet? */
if (NILP (w->vertical_scroll_bar))
hwnd = SCROLL_BAR_W32_WINDOW (bar);
/* If already correctly positioned, do nothing. */
- if ( XINT (bar->left) == sb_left
- && XINT (bar->top) == top
- && XINT (bar->width) == sb_width
- && XINT (bar->height) == height
- && !NILP (bar->fringe_extended_p) == fringe_extended_p )
+ if (XINT (bar->left) == sb_left
+ && XINT (bar->top) == top
+ && XINT (bar->width) == sb_width
+ && XINT (bar->height) == height
+ && bar->fringe_extended_p == fringe_extended_p)
{
/* Redraw after clear_frame. */
if (!my_show_window (f, hwnd, SW_NORMAL))
unblock_input ();
}
}
- bar->fringe_extended_p = fringe_extended_p ? Qt : Qnil;
+ bar->fringe_extended_p = fringe_extended_p;
w32_set_scroll_bar_thumb (bar, portion, position, whole);
XSETVECTOR (barobj, bar);
static void
w32_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)
+ int x, int y, enum text_cursor_kinds cursor_type,
+ int cursor_width, bool on_p, bool active_p)
{
if (on_p)
{
dpyinfo->w32_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 ();
}
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->n_fonts = 0;
dpyinfo->smallest_font_height = 1;
dpyinfo->smallest_char_width = 1;
-
- 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 */
+ reset_mouse_highlight (&dpyinfo->mouse_highlight);
}
/* Create an xrdb-style database of resources to supersede registry settings.
terminal = w32_create_terminal (dpyinfo);
/* Set the name of the terminal. */
- terminal->name = xmalloc (SBYTES (display_name) + 1);
- strncpy (terminal->name, SDATA (display_name), SBYTES (display_name));
- terminal->name[SBYTES (display_name)] = 0;
+ terminal->name = xlispstrdup (display_name);
dpyinfo->xrdb = xrm_option ? w32_make_rdb (xrm_option) : NULL;