diff options
| author | Jason Rumney | 2001-12-01 11:13:25 +0000 |
|---|---|---|
| committer | Jason Rumney | 2001-12-01 11:13:25 +0000 |
| commit | 9eb16b6264445b2281d46711221210b0452a6d46 (patch) | |
| tree | 5c3d94b11eca51f89ecb787f272b8237a216ef3e /src | |
| parent | 1576fbfa1d5e11934b94eb3fec634d08e2c87ed6 (diff) | |
| download | emacs-9eb16b6264445b2281d46711221210b0452a6d46.tar.gz emacs-9eb16b6264445b2281d46711221210b0452a6d46.zip | |
(trackmouse_window, track_mouse_event_fn): New vars.
(w32_wnd_proc) <WM_MOUSEMOVE>: Notice when mouse enters frame.
<WM_EXITMENULOOP>: Free menu strings.
<WM_MOUSELEAVE>: Stop tracking mouse.
(x_create_tip_frame): Specify no minibuffer, modeline or fringes.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32fns.c | 57 |
1 files changed, 51 insertions, 6 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index b6f94e499c4..3d149c53cf7 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -53,10 +53,12 @@ Boston, MA 02111-1307, USA. */ | |||
| 53 | #include <ctype.h> | 53 | #include <ctype.h> |
| 54 | 54 | ||
| 55 | extern void free_frame_menubar (); | 55 | extern void free_frame_menubar (); |
| 56 | extern void x_compute_fringe_widths (struct frame *, int); | 56 | extern void x_compute_fringe_widths P_ ((struct frame *, int)); |
| 57 | extern double atof (); | 57 | extern double atof (); |
| 58 | extern int w32_console_toggle_lock_key (int vk_code, Lisp_Object new_state); | 58 | extern int w32_console_toggle_lock_key P_ ((int, Lisp_Object)); |
| 59 | extern void w32_menu_display_help (HWND owner, HMENU menu, UINT menu_item, UINT flags); | 59 | extern void w32_menu_display_help P_ ((HWND, HMENU, UINT, UINT)); |
| 60 | extern void w32_free_menu_strings P_ ((HWND)); | ||
| 61 | |||
| 60 | extern int quit_char; | 62 | extern int quit_char; |
| 61 | 63 | ||
| 62 | /* A definition of XColor for non-X frames. */ | 64 | /* A definition of XColor for non-X frames. */ |
| @@ -280,6 +282,10 @@ static unsigned mouse_button_timer; /* non-zero when timer is active */ | |||
| 280 | static W32Msg saved_mouse_move_msg; | 282 | static W32Msg saved_mouse_move_msg; |
| 281 | static unsigned mouse_move_timer; | 283 | static unsigned mouse_move_timer; |
| 282 | 284 | ||
| 285 | /* Window that is tracking the mouse. */ | ||
| 286 | static HWND track_mouse_window; | ||
| 287 | FARPROC track_mouse_event_fn; | ||
| 288 | |||
| 283 | /* W95 mousewheel handler */ | 289 | /* W95 mousewheel handler */ |
| 284 | unsigned int msh_mousewheel = 0; | 290 | unsigned int msh_mousewheel = 0; |
| 285 | 291 | ||
| @@ -4581,8 +4587,24 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) | |||
| 4581 | my_post_msg (&wmsg, hwnd, msg, wParam, lParam); | 4587 | my_post_msg (&wmsg, hwnd, msg, wParam, lParam); |
| 4582 | return 0; | 4588 | return 0; |
| 4583 | 4589 | ||
| 4584 | case WM_VSCROLL: | ||
| 4585 | case WM_MOUSEMOVE: | 4590 | case WM_MOUSEMOVE: |
| 4591 | /* If the mouse has just moved into the frame, start tracking | ||
| 4592 | it, so we will be notified when it leaves the frame. Mouse | ||
| 4593 | tracking only works under W98 and NT4 and later. On earlier | ||
| 4594 | versions, there is no way of telling when the mouse leaves the | ||
| 4595 | frame, so we just have to put up with help-echo and mouse | ||
| 4596 | highlighting remaining while the frame is not active. */ | ||
| 4597 | if (track_mouse_event_fn && !track_mouse_window) | ||
| 4598 | { | ||
| 4599 | TRACKMOUSEEVENT tme; | ||
| 4600 | tme.cbSize = sizeof (tme); | ||
| 4601 | tme.dwFlags = TME_LEAVE; | ||
| 4602 | tme.hwndTrack = hwnd; | ||
| 4603 | |||
| 4604 | track_mouse_event_fn (&tme); | ||
| 4605 | track_mouse_window = hwnd; | ||
| 4606 | } | ||
| 4607 | case WM_VSCROLL: | ||
| 4586 | if (XINT (Vw32_mouse_move_interval) <= 0 | 4608 | if (XINT (Vw32_mouse_move_interval) <= 0 |
| 4587 | || (msg == WM_MOUSEMOVE && button_state == 0)) | 4609 | || (msg == WM_MOUSEMOVE && button_state == 0)) |
| 4588 | { | 4610 | { |
| @@ -4698,6 +4720,9 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) | |||
| 4698 | case WM_EXITMENULOOP: | 4720 | case WM_EXITMENULOOP: |
| 4699 | f = x_window_to_frame (dpyinfo, hwnd); | 4721 | f = x_window_to_frame (dpyinfo, hwnd); |
| 4700 | 4722 | ||
| 4723 | /* Free memory used by owner-drawn and help-echo strings. */ | ||
| 4724 | w32_free_menu_strings (hwnd); | ||
| 4725 | |||
| 4701 | /* Indicate that menubar can be modified again. */ | 4726 | /* Indicate that menubar can be modified again. */ |
| 4702 | if (f) | 4727 | if (f) |
| 4703 | f->output_data.w32->menubar_active = 0; | 4728 | f->output_data.w32->menubar_active = 0; |
| @@ -4808,6 +4833,10 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) | |||
| 4808 | goto dflt; | 4833 | goto dflt; |
| 4809 | #endif | 4834 | #endif |
| 4810 | 4835 | ||
| 4836 | case WM_MOUSELEAVE: | ||
| 4837 | /* No longer tracking mouse. */ | ||
| 4838 | track_mouse_window = NULL; | ||
| 4839 | |||
| 4811 | case WM_ACTIVATEAPP: | 4840 | case WM_ACTIVATEAPP: |
| 4812 | case WM_ACTIVATE: | 4841 | case WM_ACTIVATE: |
| 4813 | case WM_WINDOWPOSCHANGED: | 4842 | case WM_WINDOWPOSCHANGED: |
| @@ -8398,7 +8427,7 @@ x_clear_image_1 (f, img, pixmap_p, mask_p, colors_p) | |||
| 8398 | struct image *img; | 8427 | struct image *img; |
| 8399 | int pixmap_p, mask_p, colors_p; | 8428 | int pixmap_p, mask_p, colors_p; |
| 8400 | { | 8429 | { |
| 8401 | #if 0 | 8430 | #if 0 /* TODO: W32 image support */ |
| 8402 | if (pixmap_p && img->pixmap) | 8431 | if (pixmap_p && img->pixmap) |
| 8403 | { | 8432 | { |
| 8404 | XFreePixmap (FRAME_X_DISPLAY (f), img->pixmap); | 8433 | XFreePixmap (FRAME_X_DISPLAY (f), img->pixmap); |
| @@ -13129,7 +13158,9 @@ x_create_tip_frame (dpyinfo, parms, text) | |||
| 13129 | 13158 | ||
| 13130 | frame = Qnil; | 13159 | frame = Qnil; |
| 13131 | GCPRO3 (parms, name, frame); | 13160 | GCPRO3 (parms, name, frame); |
| 13132 | f = make_frame (1); | 13161 | /* Make a frame without minibuffer nor mode-line. */ |
| 13162 | f = make_frame (0); | ||
| 13163 | f->wants_modeline = 0; | ||
| 13133 | XSETFRAME (frame, f); | 13164 | XSETFRAME (frame, f); |
| 13134 | 13165 | ||
| 13135 | buffer = Fget_buffer_create (build_string (" *tip*")); | 13166 | buffer = Fget_buffer_create (build_string (" *tip*")); |
| @@ -13256,8 +13287,15 @@ x_create_tip_frame (dpyinfo, parms, text) | |||
| 13256 | 13287 | ||
| 13257 | f->output_data.w32->dwStyle = WS_BORDER | WS_POPUP | WS_DISABLED; | 13288 | f->output_data.w32->dwStyle = WS_BORDER | WS_POPUP | WS_DISABLED; |
| 13258 | f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window; | 13289 | f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window; |
| 13290 | |||
| 13259 | window_prompting = x_figure_window_size (f, parms); | 13291 | window_prompting = x_figure_window_size (f, parms); |
| 13260 | 13292 | ||
| 13293 | /* No fringes on tip frame. */ | ||
| 13294 | f->output_data.w32->fringes_extra = 0; | ||
| 13295 | f->output_data.w32->fringe_cols = 0; | ||
| 13296 | f->output_data.w32->left_fringe_width = 0; | ||
| 13297 | f->output_data.w32->right_fringe_width = 0; | ||
| 13298 | |||
| 13261 | if (window_prompting & XNegative) | 13299 | if (window_prompting & XNegative) |
| 13262 | { | 13300 | { |
| 13263 | if (window_prompting & YNegative) | 13301 | if (window_prompting & YNegative) |
| @@ -14218,9 +14256,16 @@ If the underlying system call fails, value is nil. */) | |||
| 14218 | void | 14256 | void |
| 14219 | syms_of_w32fns () | 14257 | syms_of_w32fns () |
| 14220 | { | 14258 | { |
| 14259 | HMODULE user32_lib = GetModuleHandle ("user32.dll"); | ||
| 14260 | |||
| 14221 | /* This is zero if not using MS-Windows. */ | 14261 | /* This is zero if not using MS-Windows. */ |
| 14222 | w32_in_use = 0; | 14262 | w32_in_use = 0; |
| 14223 | 14263 | ||
| 14264 | /* TrackMouseEvent not available in all versions of Windows, so must load | ||
| 14265 | it dynamically. Do it once, here, instead of every time it is used. */ | ||
| 14266 | track_mouse_event_fn = GetProcAddress (user32_lib, "TrackMouseEvent"); | ||
| 14267 | track_mouse_window = NULL; | ||
| 14268 | |||
| 14224 | /* The section below is built by the lisp expression at the top of the file, | 14269 | /* The section below is built by the lisp expression at the top of the file, |
| 14225 | just above where these variables are declared. */ | 14270 | just above where these variables are declared. */ |
| 14226 | /*&&& init symbols here &&&*/ | 14271 | /*&&& init symbols here &&&*/ |