*** src/w32term.c.orig Sat Nov 16 14:11:32 2002 --- src/w32term.c Sat Nov 16 15:26:23 2002 *************** *** 189,194 **** --- 189,195 ---- 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); *************** *** 367,372 **** --- 368,374 ---- 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 *)); *************** *** 1426,1431 **** --- 1428,1434 ---- { ccl->reg[0] = charset; ccl->reg[1] = BYTE2 (*char2b); + ccl->reg[2] = -1; } else { *************** *** 3724,3730 **** 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; RECT *clip_rect; { int i; --- 3727,3733 ---- 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, width, left_p, right_p, raised_p; RECT *clip_rect; { int i; *************** *** 6565,6573 **** } } } ! #if 0 /* TODO: mouse cursor */ ! XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), cursor); ! #endif } --- 6568,6574 ---- } } } ! w32_define_cursor (FRAME_W32_WINDOW (f), cursor); } *************** *** 6585,6590 **** --- 6586,6592 ---- 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. */ *************** *** 6640,6651 **** 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; else ! cursor = f->output_data.x->text_cursor; ! #endif /* Are we in a window whose display is up to date? And verify the buffer's text has not changed. */ b = XBUFFER (w->buffer); --- 6642,6653 ---- note_mode_line_highlight (w, x, portion == 1); return; } ! if (portion == 2) ! cursor = f->output_data.w32->horizontal_drag_cursor; else ! 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); *************** *** 6673,6679 **** || !MATRIX_ROW (w->current_matrix, vpos)->displays_text_p) { clear_mouse_face (dpyinfo); ! /* TODO: mouse cursor */ goto set_cursor; } --- 6675,6681 ---- || !MATRIX_ROW (w->current_matrix, vpos)->displays_text_p) { clear_mouse_face (dpyinfo); ! cursor = f->output_data.w32->nontext_cursor; goto set_cursor; } *************** *** 6728,6735 **** || hpos < dpyinfo->mouse_face_end_col || dpyinfo->mouse_face_past_end)); ! /* TODO: if (same_region) ! mouse cursor */ /* Check mouse-face highlighting. */ if (! same_region --- 6730,6737 ---- || hpos < dpyinfo->mouse_face_end_col || dpyinfo->mouse_face_past_end)); ! if (same_region) ! cursor = 0; /* Check mouse-face highlighting. */ if (! same_region *************** *** 6759,6766 **** dpyinfo->mouse_face_overlay = overlay; /* Clear the display of the old active region, if any. */ ! clear_mouse_face (dpyinfo); ! /* TODO: mouse cursor changes. */ /* If no overlay applies, get a text property. */ if (NILP (overlay)) --- 6761,6768 ---- dpyinfo->mouse_face_overlay = overlay; /* Clear the display of the old active region, if any. */ ! if (clear_mouse_face (dpyinfo)) ! cursor = 0; /* If no overlay applies, get a text property. */ if (NILP (overlay)) *************** *** 6798,6804 **** /* Display it as active. */ show_mouse_face (dpyinfo, DRAW_MOUSE_FACE); ! /* TODO: mouse cursor changes. */ } /* Handle the text property case. */ else if (! NILP (mouse_face) && BUFFERP (object)) --- 6800,6806 ---- /* Display it as active. */ show_mouse_face (dpyinfo, DRAW_MOUSE_FACE); ! cursor = 0; } /* Handle the text property case. */ else if (! NILP (mouse_face) && BUFFERP (object)) *************** *** 6841,6847 **** /* Display it as active. */ show_mouse_face (dpyinfo, DRAW_MOUSE_FACE); ! /* TODO: mouse cursor changes. */ } else if (!NILP (mouse_face) && STRINGP (object)) { --- 6843,6849 ---- /* Display it as active. */ show_mouse_face (dpyinfo, DRAW_MOUSE_FACE); ! cursor = 0; } else if (!NILP (mouse_face) && STRINGP (object)) { *************** *** 6873,6879 **** = 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. */ } else if (STRINGP (object) && NILP (mouse_face)) { --- 6875,6881 ---- = face_at_string_position (w, object, pos, 0, 0, 0, &ignore, glyph->face_id, 1); show_mouse_face (dpyinfo, DRAW_MOUSE_FACE); ! cursor = 0; } else if (STRINGP (object) && NILP (mouse_face)) { *************** *** 6921,6927 **** /* Display it as active. */ show_mouse_face (dpyinfo, DRAW_MOUSE_FACE); ! /* TODO: mouse cursor changes. */ } } } --- 6923,6929 ---- /* Display it as active. */ show_mouse_face (dpyinfo, DRAW_MOUSE_FACE); ! cursor = 0; } } } *************** *** 7001,7008 **** } set_cursor: ! /* TODO: mouse cursor changes. */ ! ; } static void --- 7003,7010 ---- } set_cursor: ! if (cursor) ! w32_define_cursor (FRAME_W32_WINDOW (f), cursor); } static void *************** *** 7015,7020 **** --- 7017,7029 ---- HIWORD (last_mouse_motion_event.lParam)); } + void + w32_define_cursor (window, cursor) + Window window; + Cursor cursor; + { + PostMessage (window, WM_EMACS_SETCURSOR, (WPARAM) cursor, 0); + } /*********************************************************************** *************** *** 7555,7572 **** 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); else if (draw == DRAW_MOUSE_FACE) ! XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), ! f->output_data.x->cross_cursor); else ! XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), ! f->output_data.x->nontext_cursor); ! #endif } /* Clear out the mouse-highlighted active region. --- 7564,7580 ---- w->phys_cursor.x, w->phys_cursor.y); } /* Change the mouse cursor. */ if (draw == DRAW_NORMAL_TEXT) ! w32_define_cursor (FRAME_W32_WINDOW (f), ! f->output_data.w32->text_cursor); else if (draw == DRAW_MOUSE_FACE) ! w32_define_cursor (FRAME_W32_WINDOW (f), ! f->output_data.w32->hand_cursor); else ! w32_define_cursor (FRAME_W32_WINDOW (f), ! f->output_data.w32->nontext_cursor); ! } /* Clear out the mouse-highlighted active region. *************** *** 11044,11049 **** --- 11052,11059 ---- 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 */ } *** src/w32term.h.orig Fri Aug 30 15:20:36 2002 --- src/w32term.h Tue Dec 3 13:38:19 2002 *************** *** 350,355 **** --- 350,356 ---- Cursor cross_cursor; Cursor hourglass_cursor; Cursor horizontal_drag_cursor; + Cursor hand_cursor; /* Window whose cursor is hourglass_cursor. This window is temporarily mapped to display an hourglass cursor. */ *************** *** 735,741 **** #define WM_EMACS_DESTROY_CARET (WM_EMACS_START + 16) #define WM_EMACS_SHOW_CARET (WM_EMACS_START + 17) #define WM_EMACS_HIDE_CARET (WM_EMACS_START + 18) ! #define WM_EMACS_END (WM_EMACS_START + 19) #define WND_FONTWIDTH_INDEX (0) #define WND_LINEHEIGHT_INDEX (4) --- 736,743 ---- #define WM_EMACS_DESTROY_CARET (WM_EMACS_START + 16) #define WM_EMACS_SHOW_CARET (WM_EMACS_START + 17) #define WM_EMACS_HIDE_CARET (WM_EMACS_START + 18) ! #define WM_EMACS_SETCURSOR (WM_EMACS_START + 19) ! #define WM_EMACS_END (WM_EMACS_START + 20) #define WND_FONTWIDTH_INDEX (0) #define WND_LINEHEIGHT_INDEX (4) *** src/w32fns.c.orig Thu Nov 21 09:01:42 2002 --- src/w32fns.c Thu Nov 21 09:47:41 2002 *************** *** 152,158 **** over text or in the modeline. */ Lisp_Object Vx_pointer_shape, Vx_nontext_pointer_shape, Vx_mode_pointer_shape; ! Lisp_Object Vx_hourglass_pointer_shape, Vx_window_horizontal_drag_shape; /* The shape when over mouse-sensitive text. */ --- 152,158 ---- over text or in the modeline. */ Lisp_Object Vx_pointer_shape, Vx_nontext_pointer_shape, Vx_mode_pointer_shape; ! Lisp_Object Vx_hourglass_pointer_shape, Vx_window_horizontal_drag_shape, Vx_hand_shape; /* The shape when over mouse-sensitive text. */ *************** *** 2193,2198 **** --- 2193,2199 ---- else horizontal_drag_cursor = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_sb_h_double_arrow); + /* TODO: hand_cursor */ /* Check and report errors with the above calls. */ x_check_errors (FRAME_W32_DISPLAY (f), "can't set cursor shape: %s"); *************** *** 2221,2226 **** --- 2222,2228 ---- &fore_color, &back_color); XRecolorCursor (FRAME_W32_DISPLAY (f), hourglass_cursor, &fore_color, &back_color); + /* TODO: hand_cursor */ } if (FRAME_W32_WINDOW (f) != 0) *************** *** 2249,2254 **** --- 2251,2257 ---- && f->output_data.w32->cross_cursor != 0) XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->cross_cursor); f->output_data.w32->cross_cursor = cross_cursor; + /* TODO: hand_cursor */ XFlush (FRAME_W32_DISPLAY (f)); UNBLOCK_INPUT; *************** *** 3417,3422 **** --- 3420,3440 ---- } + Cursor + w32_load_cursor (LPCTSTR name) + { + /* Try first to load cursor from application resource. */ + Cursor cursor = LoadImage ((HINSTANCE) GetModuleHandle(NULL), + name, IMAGE_CURSOR, 0, 0, + LR_DEFAULTCOLOR | LR_DEFAULTSIZE | LR_SHARED); + if (!cursor) + { + /* Then try to load a shared predefined cursor. */ + cursor = LoadImage (NULL, name, IMAGE_CURSOR, 0, 0, + LR_DEFAULTCOLOR | LR_DEFAULTSIZE | LR_SHARED); + } + return cursor; + } extern LRESULT CALLBACK w32_wnd_proc (); *************** *** 3432,3438 **** wc.cbWndExtra = WND_EXTRA_BYTES; wc.hInstance = hinst; wc.hIcon = LoadIcon (hinst, EMACS_CLASS); ! wc.hCursor = LoadCursor (NULL, IDC_ARROW); wc.hbrBackground = NULL; /* GetStockObject (WHITE_BRUSH); */ wc.lpszMenuName = NULL; wc.lpszClassName = EMACS_CLASS; --- 3450,3456 ---- wc.cbWndExtra = WND_EXTRA_BYTES; wc.hInstance = hinst; wc.hIcon = LoadIcon (hinst, EMACS_CLASS); ! wc.hCursor = w32_load_cursor (IDC_ARROW); wc.hbrBackground = NULL; /* GetStockObject (WHITE_BRUSH); */ wc.lpszMenuName = NULL; wc.lpszClassName = EMACS_CLASS; *************** *** 5084,5089 **** --- 5102,5121 ---- ((LPMINMAXINFO) lParam)->ptMaxTrackSize.y = 32767; return 0; + case WM_SETCURSOR: + if (LOWORD (lParam) == HTCLIENT) + return 0; + + goto dflt; + + case WM_EMACS_SETCURSOR: + { + Cursor cursor = (Cursor) wParam; + if (cursor) + SetCursor (cursor); + return 0; + } + case WM_EMACS_CREATESCROLLBAR: return (LRESULT) w32_createscrollbar ((struct frame *) wParam, (struct scroll_bar *) lParam); *************** *** 5674,5679 **** --- 5706,5719 ---- f->output_data.w32->dwStyle = WS_OVERLAPPEDWINDOW; f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window; + f->output_data.w32->text_cursor = w32_load_cursor (IDC_IBEAM); + f->output_data.w32->nontext_cursor = w32_load_cursor (IDC_ARROW); + f->output_data.w32->modeline_cursor = w32_load_cursor (IDC_ARROW); + f->output_data.w32->cross_cursor = w32_load_cursor (IDC_CROSS); + f->output_data.w32->hourglass_cursor = w32_load_cursor (IDC_WAIT); + f->output_data.w32->horizontal_drag_cursor = w32_load_cursor (IDC_SIZEWE); + f->output_data.w32->hand_cursor = w32_load_cursor (IDC_HAND); + /* Add the tool-bar height to the initial frame height so that the user gets a text display area of the size he specified with -g or via .Xdefaults. Later changes of the tool-bar height don't *************** *** 9441,9446 **** --- 9481,9487 ---- struct frame *f; XImage *ximg; Pixmap pixmap; + int width, height; { #if 0 /* I don't think this is necessary looking at where it is used. */ HDC hdc = get_frame_dc (f); *** src/w32menu.c.orig Mon Nov 18 09:23:57 2002 --- src/w32menu.c Mon Nov 18 09:55:53 2002 *************** *** 1175,1181 **** static widget_value * digest_single_submenu (start, end, top_level_items) ! int start, end; { widget_value *wv, *prev_wv, *save_wv, *first_wv; int i; --- 1175,1181 ---- static widget_value * digest_single_submenu (start, end, top_level_items) ! int start, end, top_level_items; { widget_value *wv, *prev_wv, *save_wv, *first_wv; int i; *** nt/emacs.rc.orig Tue Sep 3 09:50:51 2002 --- nt/emacs.rc Thu Sep 12 16:50:28 2002 *************** *** 1,4 **** ! Emacs ICON icons\gnu2a32t.ico #ifndef VS_VERSION_INFO #define VS_VERSION_INFO 1 --- 1,5 ---- ! Emacs ICON icons\gnu2a32t.ico ! 32649 CURSOR icons\hand.cur #ifndef VS_VERSION_INFO #define VS_VERSION_INFO 1 -----------------------------41184676334--