extern void free_frame_menubar ();
extern int w32_codepage_for_font (char *fontname);
+extern Cursor w32_load_cursor (LPCTSTR name);
extern glyph_metric *w32_BDF_TextMetric(bdffont *fontp,
unsigned char *text, int dim);
enum draw_glyphs_face));
static int cursor_in_mouse_face_p P_ ((struct window *));
static int clear_mouse_face P_ ((struct w32_display_info *));
+void w32_define_cursor P_ ((Window, Cursor));
void x_lower_frame P_ ((struct frame *));
void x_scroll_bar_clear P_ ((struct frame *));
{
ccl->reg[0] = charset;
ccl->reg[1] = BYTE2 (*char2b);
+ ccl->reg[2] = -1;
}
else
{
w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
raised_p, left_p, right_p, clip_rect)
struct frame *f;
- int left_x, top_y, right_x, bottom_y, left_p, right_p, raised_p;
+ int left_x, top_y, right_x, bottom_y, width, left_p, right_p, raised_p;
RECT *clip_rect;
{
int i;
}
}
}
-#if 0 /* TODO: mouse cursor */
- XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), cursor);
-#endif
+ w32_define_cursor (FRAME_W32_WINDOW (f), cursor);
}
int portion;
Lisp_Object window;
struct window *w;
+ Cursor cursor = 0;
struct buffer *b;
/* When a menu is active, don't highlight because this looks odd. */
note_mode_line_highlight (w, x, portion == 1);
return;
}
-#if 0 /* TODO: mouse cursor */
+
if (portion == 2)
- cursor = f->output_data.x->horizontal_drag_cursor;
+ cursor = f->output_data.w32->horizontal_drag_cursor;
else
- cursor = f->output_data.x->text_cursor;
-#endif
+ cursor = f->output_data.w32->text_cursor;
+
/* Are we in a window whose display is up to date?
And verify the buffer's text has not changed. */
b = XBUFFER (w->buffer);
|| !MATRIX_ROW (w->current_matrix, vpos)->displays_text_p)
{
clear_mouse_face (dpyinfo);
- /* TODO: mouse cursor */
+ cursor = f->output_data.w32->nontext_cursor;
goto set_cursor;
}
|| hpos < dpyinfo->mouse_face_end_col
|| dpyinfo->mouse_face_past_end));
- /* TODO: if (same_region)
- mouse cursor */
+ if (same_region)
+ cursor = 0;
/* Check mouse-face highlighting. */
if (! same_region
dpyinfo->mouse_face_overlay = overlay;
/* Clear the display of the old active region, if any. */
- clear_mouse_face (dpyinfo);
- /* TODO: mouse cursor changes. */
+ if (clear_mouse_face (dpyinfo))
+ cursor = 0;
/* If no overlay applies, get a text property. */
if (NILP (overlay))
/* Display it as active. */
show_mouse_face (dpyinfo, DRAW_MOUSE_FACE);
- /* TODO: mouse cursor changes. */
+ cursor = 0;
}
/* Handle the text property case. */
else if (! NILP (mouse_face) && BUFFERP (object))
/* Display it as active. */
show_mouse_face (dpyinfo, DRAW_MOUSE_FACE);
- /* TODO: mouse cursor changes. */
+ cursor = 0;
}
else if (!NILP (mouse_face) && STRINGP (object))
{
= face_at_string_position (w, object, pos, 0, 0, 0, &ignore,
glyph->face_id, 1);
show_mouse_face (dpyinfo, DRAW_MOUSE_FACE);
- /* TODO: mouse cursor changes. */
+ cursor = 0;
}
else if (STRINGP (object) && NILP (mouse_face))
{
/* Display it as active. */
show_mouse_face (dpyinfo, DRAW_MOUSE_FACE);
- /* TODO: mouse cursor changes. */
+ cursor = 0;
}
}
}
}
set_cursor:
- /* TODO: mouse cursor changes. */
- ;
+ if (cursor)
+ w32_define_cursor (FRAME_W32_WINDOW (f), cursor);
}
static void
HIWORD (last_mouse_motion_event.lParam));
}
+void
+w32_define_cursor (window, cursor)
+ Window window;
+ Cursor cursor;
+{
+ PostMessage (window, WM_EMACS_SETCURSOR, (WPARAM) cursor, 0);
+}
\f
/***********************************************************************
w->phys_cursor.x, w->phys_cursor.y);
}
-#if 0 /* TODO: mouse cursor */
/* Change the mouse cursor. */
if (draw == DRAW_NORMAL_TEXT)
- XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- f->output_data.x->text_cursor);
+ w32_define_cursor (FRAME_W32_WINDOW (f),
+ f->output_data.w32->text_cursor);
else if (draw == DRAW_MOUSE_FACE)
- XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- f->output_data.x->cross_cursor);
+ w32_define_cursor (FRAME_W32_WINDOW (f),
+ f->output_data.w32->hand_cursor);
else
- XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- f->output_data.x->nontext_cursor);
-#endif
+ w32_define_cursor (FRAME_W32_WINDOW (f),
+ f->output_data.w32->nontext_cursor);
+
}
/* Clear out the mouse-highlighted active region.
dpyinfo->mouse_face_window = Qnil;
dpyinfo->mouse_face_overlay = Qnil;
dpyinfo->mouse_face_hidden = 0;
+
+ dpyinfo->vertical_scroll_bar_cursor = w32_load_cursor (IDC_ARROW);
/* TODO: dpyinfo->gray */
}