aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Rumney2003-01-21 23:06:50 +0000
committerJason Rumney2003-01-21 23:06:50 +0000
commit2bf04b9d20b0ff801d4ec5f0d7b0f18a97326229 (patch)
tree2f815557f6abf8f4014c4a6a4bf8cb679a471036 /src
parentf3358105791ff9bca56fdc3957554aeabf16b824 (diff)
downloademacs-2bf04b9d20b0ff801d4ec5f0d7b0f18a97326229.tar.gz
emacs-2bf04b9d20b0ff801d4ec5f0d7b0f18a97326229.zip
2003-01-21 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp>
* w32term.c (note_mode_line_highlight): Delete #if 0 to enable function w32_define_cursor. (note_mouse_highlight): Initialize, setup cursor accoding to mouse position, change member name output_data.x to output_data.w32 and add function w32_define_cursor. (show_mouse_face): Delete #if 0 to enable function w32_define_cursor and change member name output_data.x to output_data.w32. (w32_initialize_display_info): Setup dpyinfo->vertical_scroll_bar_cursor. 2003-01-21 David Ponce <david@dponce.com> * w32term.c (w32_encode_char): For DIM=1 charset, set ccl->reg[2] to -1 before calling ccl_driver. (Sync. with xterm.c x_encode_char change by Kenichi Handa <handa@m17n.org> on 2002-09-30. (w32_draw_relief_rect): Declare all args. (w32_define_cursor): New.
Diffstat (limited to 'src')
-rw-r--r--src/w32term.c64
1 files changed, 37 insertions, 27 deletions
diff --git a/src/w32term.c b/src/w32term.c
index 08b076df037..dd12c5b871d 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -191,6 +191,7 @@ extern unsigned int msh_mousewheel;
191extern void free_frame_menubar (); 191extern void free_frame_menubar ();
192 192
193extern int w32_codepage_for_font (char *fontname); 193extern int w32_codepage_for_font (char *fontname);
194extern Cursor w32_load_cursor (LPCTSTR name);
194 195
195extern glyph_metric *w32_BDF_TextMetric(bdffont *fontp, 196extern glyph_metric *w32_BDF_TextMetric(bdffont *fontp,
196 unsigned char *text, int dim); 197 unsigned char *text, int dim);
@@ -369,6 +370,7 @@ static void show_mouse_face P_ ((struct w32_display_info *,
369 enum draw_glyphs_face)); 370 enum draw_glyphs_face));
370static int cursor_in_mouse_face_p P_ ((struct window *)); 371static int cursor_in_mouse_face_p P_ ((struct window *));
371static int clear_mouse_face P_ ((struct w32_display_info *)); 372static int clear_mouse_face P_ ((struct w32_display_info *));
373void w32_define_cursor P_ ((Window, Cursor));
372 374
373void x_lower_frame P_ ((struct frame *)); 375void x_lower_frame P_ ((struct frame *));
374void x_scroll_bar_clear P_ ((struct frame *)); 376void x_scroll_bar_clear P_ ((struct frame *));
@@ -1432,6 +1434,7 @@ w32_encode_char (c, char2b, font_info, two_byte_p)
1432 { 1434 {
1433 ccl->reg[0] = charset; 1435 ccl->reg[0] = charset;
1434 ccl->reg[1] = BYTE2 (*char2b); 1436 ccl->reg[1] = BYTE2 (*char2b);
1437 ccl->reg[2] = -1;
1435 } 1438 }
1436 else 1439 else
1437 { 1440 {
@@ -3730,7 +3733,7 @@ static void
3730w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, 3733w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
3731 raised_p, left_p, right_p, clip_rect) 3734 raised_p, left_p, right_p, clip_rect)
3732 struct frame *f; 3735 struct frame *f;
3733 int left_x, top_y, right_x, bottom_y, left_p, right_p, raised_p; 3736 int left_x, top_y, right_x, bottom_y, width, left_p, right_p, raised_p;
3734 RECT *clip_rect; 3737 RECT *clip_rect;
3735{ 3738{
3736 int i; 3739 int i;
@@ -6571,9 +6574,7 @@ note_mode_line_highlight (w, x, mode_line_p)
6571 } 6574 }
6572 } 6575 }
6573 } 6576 }
6574#if 0 /* TODO: mouse cursor */ 6577 w32_define_cursor (FRAME_W32_WINDOW (f), cursor);
6575 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), cursor);
6576#endif
6577} 6578}
6578 6579
6579 6580
@@ -6591,6 +6592,7 @@ note_mouse_highlight (f, x, y)
6591 int portion; 6592 int portion;
6592 Lisp_Object window; 6593 Lisp_Object window;
6593 struct window *w; 6594 struct window *w;
6595 Cursor cursor = 0;
6594 struct buffer *b; 6596 struct buffer *b;
6595 6597
6596 /* When a menu is active, don't highlight because this looks odd. */ 6598 /* When a menu is active, don't highlight because this looks odd. */
@@ -6646,12 +6648,12 @@ note_mouse_highlight (f, x, y)
6646 note_mode_line_highlight (w, x, portion == 1); 6648 note_mode_line_highlight (w, x, portion == 1);
6647 return; 6649 return;
6648 } 6650 }
6649#if 0 /* TODO: mouse cursor */ 6651
6650 if (portion == 2) 6652 if (portion == 2)
6651 cursor = f->output_data.x->horizontal_drag_cursor; 6653 cursor = f->output_data.w32->horizontal_drag_cursor;
6652 else 6654 else
6653 cursor = f->output_data.x->text_cursor; 6655 cursor = f->output_data.w32->text_cursor;
6654#endif 6656
6655 /* Are we in a window whose display is up to date? 6657 /* Are we in a window whose display is up to date?
6656 And verify the buffer's text has not changed. */ 6658 And verify the buffer's text has not changed. */
6657 b = XBUFFER (w->buffer); 6659 b = XBUFFER (w->buffer);
@@ -6679,7 +6681,7 @@ note_mouse_highlight (f, x, y)
6679 || !MATRIX_ROW (w->current_matrix, vpos)->displays_text_p) 6681 || !MATRIX_ROW (w->current_matrix, vpos)->displays_text_p)
6680 { 6682 {
6681 clear_mouse_face (dpyinfo); 6683 clear_mouse_face (dpyinfo);
6682 /* TODO: mouse cursor */ 6684 cursor = f->output_data.w32->nontext_cursor;
6683 goto set_cursor; 6685 goto set_cursor;
6684 } 6686 }
6685 6687
@@ -6734,8 +6736,8 @@ note_mouse_highlight (f, x, y)
6734 || hpos < dpyinfo->mouse_face_end_col 6736 || hpos < dpyinfo->mouse_face_end_col
6735 || dpyinfo->mouse_face_past_end)); 6737 || dpyinfo->mouse_face_past_end));
6736 6738
6737 /* TODO: if (same_region) 6739 if (same_region)
6738 mouse cursor */ 6740 cursor = 0;
6739 6741
6740 /* Check mouse-face highlighting. */ 6742 /* Check mouse-face highlighting. */
6741 if (! same_region 6743 if (! same_region
@@ -6765,8 +6767,8 @@ note_mouse_highlight (f, x, y)
6765 dpyinfo->mouse_face_overlay = overlay; 6767 dpyinfo->mouse_face_overlay = overlay;
6766 6768
6767 /* Clear the display of the old active region, if any. */ 6769 /* Clear the display of the old active region, if any. */
6768 clear_mouse_face (dpyinfo); 6770 if (clear_mouse_face (dpyinfo))
6769 /* TODO: mouse cursor changes. */ 6771 cursor = 0;
6770 6772
6771 /* If no overlay applies, get a text property. */ 6773 /* If no overlay applies, get a text property. */
6772 if (NILP (overlay)) 6774 if (NILP (overlay))
@@ -6804,7 +6806,7 @@ note_mouse_highlight (f, x, y)
6804 6806
6805 /* Display it as active. */ 6807 /* Display it as active. */
6806 show_mouse_face (dpyinfo, DRAW_MOUSE_FACE); 6808 show_mouse_face (dpyinfo, DRAW_MOUSE_FACE);
6807 /* TODO: mouse cursor changes. */ 6809 cursor = 0;
6808 } 6810 }
6809 /* Handle the text property case. */ 6811 /* Handle the text property case. */
6810 else if (! NILP (mouse_face) && BUFFERP (object)) 6812 else if (! NILP (mouse_face) && BUFFERP (object))
@@ -6847,7 +6849,7 @@ note_mouse_highlight (f, x, y)
6847 6849
6848 /* Display it as active. */ 6850 /* Display it as active. */
6849 show_mouse_face (dpyinfo, DRAW_MOUSE_FACE); 6851 show_mouse_face (dpyinfo, DRAW_MOUSE_FACE);
6850 /* TODO: mouse cursor changes. */ 6852 cursor = 0;
6851 } 6853 }
6852 else if (!NILP (mouse_face) && STRINGP (object)) 6854 else if (!NILP (mouse_face) && STRINGP (object))
6853 { 6855 {
@@ -6879,7 +6881,7 @@ note_mouse_highlight (f, x, y)
6879 = face_at_string_position (w, object, pos, 0, 0, 0, &ignore, 6881 = face_at_string_position (w, object, pos, 0, 0, 0, &ignore,
6880 glyph->face_id, 1); 6882 glyph->face_id, 1);
6881 show_mouse_face (dpyinfo, DRAW_MOUSE_FACE); 6883 show_mouse_face (dpyinfo, DRAW_MOUSE_FACE);
6882 /* TODO: mouse cursor changes. */ 6884 cursor = 0;
6883 } 6885 }
6884 else if (STRINGP (object) && NILP (mouse_face)) 6886 else if (STRINGP (object) && NILP (mouse_face))
6885 { 6887 {
@@ -6927,7 +6929,7 @@ note_mouse_highlight (f, x, y)
6927 6929
6928 /* Display it as active. */ 6930 /* Display it as active. */
6929 show_mouse_face (dpyinfo, DRAW_MOUSE_FACE); 6931 show_mouse_face (dpyinfo, DRAW_MOUSE_FACE);
6930 /* TODO: mouse cursor changes. */ 6932 cursor = 0;
6931 } 6933 }
6932 } 6934 }
6933 } 6935 }
@@ -7007,8 +7009,8 @@ note_mouse_highlight (f, x, y)
7007 } 7009 }
7008 7010
7009 set_cursor: 7011 set_cursor:
7010 /* TODO: mouse cursor changes. */ 7012 if (cursor)
7011 ; 7013 w32_define_cursor (FRAME_W32_WINDOW (f), cursor);
7012} 7014}
7013 7015
7014static void 7016static void
@@ -7021,6 +7023,13 @@ redo_mouse_highlight ()
7021 HIWORD (last_mouse_motion_event.lParam)); 7023 HIWORD (last_mouse_motion_event.lParam));
7022} 7024}
7023 7025
7026void
7027w32_define_cursor (window, cursor)
7028 Window window;
7029 Cursor cursor;
7030{
7031 PostMessage (window, WM_EMACS_SETCURSOR, (WPARAM) cursor, 0);
7032}
7024 7033
7025 7034
7026/*********************************************************************** 7035/***********************************************************************
@@ -7561,18 +7570,17 @@ show_mouse_face (dpyinfo, draw)
7561 w->phys_cursor.x, w->phys_cursor.y); 7570 w->phys_cursor.x, w->phys_cursor.y);
7562 } 7571 }
7563 7572
7564#if 0 /* TODO: mouse cursor */
7565 /* Change the mouse cursor. */ 7573 /* Change the mouse cursor. */
7566 if (draw == DRAW_NORMAL_TEXT) 7574 if (draw == DRAW_NORMAL_TEXT)
7567 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 7575 w32_define_cursor (FRAME_W32_WINDOW (f),
7568 f->output_data.x->text_cursor); 7576 f->output_data.w32->text_cursor);
7569 else if (draw == DRAW_MOUSE_FACE) 7577 else if (draw == DRAW_MOUSE_FACE)
7570 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 7578 w32_define_cursor (FRAME_W32_WINDOW (f),
7571 f->output_data.x->cross_cursor); 7579 f->output_data.w32->hand_cursor);
7572 else 7580 else
7573 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 7581 w32_define_cursor (FRAME_W32_WINDOW (f),
7574 f->output_data.x->nontext_cursor); 7582 f->output_data.w32->nontext_cursor);
7575#endif 7583
7576} 7584}
7577 7585
7578/* Clear out the mouse-highlighted active region. 7586/* Clear out the mouse-highlighted active region.
@@ -11065,6 +11073,8 @@ w32_initialize_display_info (display_name)
11065 dpyinfo->mouse_face_window = Qnil; 11073 dpyinfo->mouse_face_window = Qnil;
11066 dpyinfo->mouse_face_overlay = Qnil; 11074 dpyinfo->mouse_face_overlay = Qnil;
11067 dpyinfo->mouse_face_hidden = 0; 11075 dpyinfo->mouse_face_hidden = 0;
11076
11077 dpyinfo->vertical_scroll_bar_cursor = w32_load_cursor (IDC_ARROW);
11068 /* TODO: dpyinfo->gray */ 11078 /* TODO: dpyinfo->gray */
11069 11079
11070} 11080}