diff options
| author | Jason Rumney | 2004-05-17 22:51:47 +0000 |
|---|---|---|
| committer | Jason Rumney | 2004-05-17 22:51:47 +0000 |
| commit | 2ba49441af2401cc7f5a2eaec8aeeb9dd9edeea0 (patch) | |
| tree | 5d1ebe9a3c9d8858b00528a89b34c925fae166e7 /src | |
| parent | 0bc90bbad41afce8e8e4130e25e4f36f09cfd5fa (diff) | |
| download | emacs-2ba49441af2401cc7f5a2eaec8aeeb9dd9edeea0.tar.gz emacs-2ba49441af2401cc7f5a2eaec8aeeb9dd9edeea0.zip | |
(Fw32_register_hot_key, Fw32_unregister_hot_key)
(Fw32_toggle_lock_key) [USE_LISP_UNION_TYPE]: Cast from Lisp_Object
using i member.
(w32_quit_key): Rename from Vw32_quit_key, and make an int.
(syms_of_w32fns, globals_of_w32fns): Use Lisp_Object and int consistently.
(w32_color_map_lookup): Return a Lisp_Object.
(x_to_w32_charset, w32_to_x_charset, w32_to_all_x_charsets):
Use EQ to compare Lisp_Objects.
(w32_parse_hot_key): Use int for lisp_modifiers consistently.
(w32_wnd_proc): Use w32_num_mouse_buttons.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32fns.c | 152 |
1 files changed, 89 insertions, 63 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index 20b07413033..f56ecc35cc6 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -88,7 +88,7 @@ Lisp_Object Vw32_pass_alt_to_system; | |||
| 88 | Lisp_Object Vw32_alt_is_meta; | 88 | Lisp_Object Vw32_alt_is_meta; |
| 89 | 89 | ||
| 90 | /* If non-zero, the windows virtual key code for an alternative quit key. */ | 90 | /* If non-zero, the windows virtual key code for an alternative quit key. */ |
| 91 | Lisp_Object Vw32_quit_key; | 91 | int w32_quit_key; |
| 92 | 92 | ||
| 93 | /* Non nil if left window key events are passed on to Windows (this only | 93 | /* Non nil if left window key events are passed on to Windows (this only |
| 94 | affects whether "tapping" the key opens the Start menu). */ | 94 | affects whether "tapping" the key opens the Start menu). */ |
| @@ -132,11 +132,11 @@ Lisp_Object Vw32_enable_palette; | |||
| 132 | 132 | ||
| 133 | /* Control how close left/right button down events must be to | 133 | /* Control how close left/right button down events must be to |
| 134 | be converted to a middle button down event. */ | 134 | be converted to a middle button down event. */ |
| 135 | Lisp_Object Vw32_mouse_button_tolerance; | 135 | int w32_mouse_button_tolerance; |
| 136 | 136 | ||
| 137 | /* Minimum interval between mouse movement (and scroll bar drag) | 137 | /* Minimum interval between mouse movement (and scroll bar drag) |
| 138 | events that are passed on to the event loop. */ | 138 | events that are passed on to the event loop. */ |
| 139 | Lisp_Object Vw32_mouse_move_interval; | 139 | int w32_mouse_move_interval; |
| 140 | 140 | ||
| 141 | /* Flag to indicate if XBUTTON events should be passed on to Windows. */ | 141 | /* Flag to indicate if XBUTTON events should be passed on to Windows. */ |
| 142 | int w32_pass_extra_mouse_buttons_to_system; | 142 | int w32_pass_extra_mouse_buttons_to_system; |
| @@ -235,7 +235,7 @@ Lisp_Object Qw32_charset_unicode; | |||
| 235 | #endif | 235 | #endif |
| 236 | 236 | ||
| 237 | /* The ANSI codepage. */ | 237 | /* The ANSI codepage. */ |
| 238 | Lisp_Object Vw32_ansi_code_page; | 238 | int w32_ansi_code_page; |
| 239 | 239 | ||
| 240 | /* Prefix for system colors. */ | 240 | /* Prefix for system colors. */ |
| 241 | #define SYSTEM_COLOR_PREFIX "System" | 241 | #define SYSTEM_COLOR_PREFIX "System" |
| @@ -283,7 +283,7 @@ int image_cache_refcount, dpyinfo_refcount; | |||
| 283 | 283 | ||
| 284 | 284 | ||
| 285 | /* From w32term.c. */ | 285 | /* From w32term.c. */ |
| 286 | extern Lisp_Object Vw32_num_mouse_buttons; | 286 | extern int w32_num_mouse_buttons; |
| 287 | extern Lisp_Object Vw32_recognize_altgr; | 287 | extern Lisp_Object Vw32_recognize_altgr; |
| 288 | 288 | ||
| 289 | extern HWND w32_system_caret_hwnd; | 289 | extern HWND w32_system_caret_hwnd; |
| @@ -828,7 +828,7 @@ w32_to_x_color (rgb) | |||
| 828 | return Qnil; | 828 | return Qnil; |
| 829 | } | 829 | } |
| 830 | 830 | ||
| 831 | COLORREF | 831 | static Lisp_Object |
| 832 | w32_color_map_lookup (colorname) | 832 | w32_color_map_lookup (colorname) |
| 833 | char *colorname; | 833 | char *colorname; |
| 834 | { | 834 | { |
| @@ -847,7 +847,7 @@ w32_color_map_lookup (colorname) | |||
| 847 | 847 | ||
| 848 | if (lstrcmpi (SDATA (tem), colorname) == 0) | 848 | if (lstrcmpi (SDATA (tem), colorname) == 0) |
| 849 | { | 849 | { |
| 850 | ret = XUINT (Fcdr (elt)); | 850 | ret = Fcdr (elt); |
| 851 | break; | 851 | break; |
| 852 | } | 852 | } |
| 853 | 853 | ||
| @@ -910,7 +910,7 @@ add_system_logical_colors_to_map (system_colors) | |||
| 910 | } | 910 | } |
| 911 | 911 | ||
| 912 | 912 | ||
| 913 | COLORREF | 913 | static Lisp_Object |
| 914 | x_to_w32_color (colorname) | 914 | x_to_w32_color (colorname) |
| 915 | char * colorname; | 915 | char * colorname; |
| 916 | { | 916 | { |
| @@ -970,7 +970,8 @@ x_to_w32_color (colorname) | |||
| 970 | if (i == 2) | 970 | if (i == 2) |
| 971 | { | 971 | { |
| 972 | UNBLOCK_INPUT; | 972 | UNBLOCK_INPUT; |
| 973 | return (colorval); | 973 | XSETINT (ret, colorval); |
| 974 | return ret; | ||
| 974 | } | 975 | } |
| 975 | color = end; | 976 | color = end; |
| 976 | } | 977 | } |
| @@ -1023,7 +1024,8 @@ x_to_w32_color (colorname) | |||
| 1023 | if (*end != '\0') | 1024 | if (*end != '\0') |
| 1024 | break; | 1025 | break; |
| 1025 | UNBLOCK_INPUT; | 1026 | UNBLOCK_INPUT; |
| 1026 | return (colorval); | 1027 | XSETINT (ret, colorval); |
| 1028 | return ret; | ||
| 1027 | } | 1029 | } |
| 1028 | if (*end != '/') | 1030 | if (*end != '/') |
| 1029 | break; | 1031 | break; |
| @@ -1064,7 +1066,8 @@ x_to_w32_color (colorname) | |||
| 1064 | if (*end != '\0') | 1066 | if (*end != '\0') |
| 1065 | break; | 1067 | break; |
| 1066 | UNBLOCK_INPUT; | 1068 | UNBLOCK_INPUT; |
| 1067 | return (colorval); | 1069 | XSETINT (ret, colorval); |
| 1070 | return ret; | ||
| 1068 | } | 1071 | } |
| 1069 | if (*end != '/') | 1072 | if (*end != '/') |
| 1070 | break; | 1073 | break; |
| @@ -2418,6 +2421,10 @@ Lisp_Object w32_grabbed_keys; | |||
| 2418 | #define HOTKEY_VK_CODE(k) (XFASTINT (k) & 255) | 2421 | #define HOTKEY_VK_CODE(k) (XFASTINT (k) & 255) |
| 2419 | #define HOTKEY_MODIFIERS(k) (XFASTINT (k) >> 8) | 2422 | #define HOTKEY_MODIFIERS(k) (XFASTINT (k) >> 8) |
| 2420 | 2423 | ||
| 2424 | #define RAW_HOTKEY_ID(k) ((k) & 0xbfff) | ||
| 2425 | #define RAW_HOTKEY_VK_CODE(k) ((k) & 255) | ||
| 2426 | #define RAW_HOTKEY_MODIFIERS(k) ((k) >> 8) | ||
| 2427 | |||
| 2421 | /* Register hot-keys for reserved key combinations when Emacs has | 2428 | /* Register hot-keys for reserved key combinations when Emacs has |
| 2422 | keyboard focus, since this is the only way Emacs can receive key | 2429 | keyboard focus, since this is the only way Emacs can receive key |
| 2423 | combinations like Alt-Tab which are used by the system. */ | 2430 | combinations like Alt-Tab which are used by the system. */ |
| @@ -2499,20 +2506,20 @@ w32_msg_pump (deferred_msg * msg_buf) | |||
| 2499 | focus_window = GetFocus (); | 2506 | focus_window = GetFocus (); |
| 2500 | if (focus_window != NULL) | 2507 | if (focus_window != NULL) |
| 2501 | RegisterHotKey (focus_window, | 2508 | RegisterHotKey (focus_window, |
| 2502 | HOTKEY_ID (msg.wParam), | 2509 | RAW_HOTKEY_ID (msg.wParam), |
| 2503 | HOTKEY_MODIFIERS (msg.wParam), | 2510 | RAW_HOTKEY_MODIFIERS (msg.wParam), |
| 2504 | HOTKEY_VK_CODE (msg.wParam)); | 2511 | RAW_HOTKEY_VK_CODE (msg.wParam)); |
| 2505 | /* Reply is not expected. */ | 2512 | /* Reply is not expected. */ |
| 2506 | break; | 2513 | break; |
| 2507 | case WM_EMACS_UNREGISTER_HOT_KEY: | 2514 | case WM_EMACS_UNREGISTER_HOT_KEY: |
| 2508 | focus_window = GetFocus (); | 2515 | focus_window = GetFocus (); |
| 2509 | if (focus_window != NULL) | 2516 | if (focus_window != NULL) |
| 2510 | UnregisterHotKey (focus_window, HOTKEY_ID (msg.wParam)); | 2517 | UnregisterHotKey (focus_window, RAW_HOTKEY_ID (msg.wParam)); |
| 2511 | /* Mark item as erased. NB: this code must be | 2518 | /* Mark item as erased. NB: this code must be |
| 2512 | thread-safe. The next line is okay because the cons | 2519 | thread-safe. The next line is okay because the cons |
| 2513 | cell is never made into garbage and is not relocated by | 2520 | cell is never made into garbage and is not relocated by |
| 2514 | GC. */ | 2521 | GC. */ |
| 2515 | XSETCAR ((Lisp_Object) msg.lParam, Qnil); | 2522 | XSETCAR ((Lisp_Object) ((EMACS_INT) msg.lParam), Qnil); |
| 2516 | if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0)) | 2523 | if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0)) |
| 2517 | abort (); | 2524 | abort (); |
| 2518 | break; | 2525 | break; |
| @@ -2520,7 +2527,7 @@ w32_msg_pump (deferred_msg * msg_buf) | |||
| 2520 | { | 2527 | { |
| 2521 | int vk_code = (int) msg.wParam; | 2528 | int vk_code = (int) msg.wParam; |
| 2522 | int cur_state = (GetKeyState (vk_code) & 1); | 2529 | int cur_state = (GetKeyState (vk_code) & 1); |
| 2523 | Lisp_Object new_state = (Lisp_Object) msg.lParam; | 2530 | Lisp_Object new_state = (Lisp_Object) ((EMACS_INT) msg.lParam); |
| 2524 | 2531 | ||
| 2525 | /* NB: This code must be thread-safe. It is safe to | 2532 | /* NB: This code must be thread-safe. It is safe to |
| 2526 | call NILP because symbols are not relocated by GC, | 2533 | call NILP because symbols are not relocated by GC, |
| @@ -2710,7 +2717,7 @@ post_character_message (hwnd, msg, wParam, lParam, modifiers) | |||
| 2710 | c = make_ctrl_char (c) & 0377; | 2717 | c = make_ctrl_char (c) & 0377; |
| 2711 | if (c == quit_char | 2718 | if (c == quit_char |
| 2712 | || (wmsg.dwModifiers == 0 && | 2719 | || (wmsg.dwModifiers == 0 && |
| 2713 | XFASTINT (Vw32_quit_key) && wParam == XFASTINT (Vw32_quit_key))) | 2720 | w32_quit_key && wParam == w32_quit_key)) |
| 2714 | { | 2721 | { |
| 2715 | Vquit_flag = Qt; | 2722 | Vquit_flag = Qt; |
| 2716 | 2723 | ||
| @@ -3120,7 +3127,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) | |||
| 3120 | are used together, but only if user has two button mouse. */ | 3127 | are used together, but only if user has two button mouse. */ |
| 3121 | case WM_LBUTTONDOWN: | 3128 | case WM_LBUTTONDOWN: |
| 3122 | case WM_RBUTTONDOWN: | 3129 | case WM_RBUTTONDOWN: |
| 3123 | if (XINT (Vw32_num_mouse_buttons) > 2) | 3130 | if (w32_num_mouse_buttons > 2) |
| 3124 | goto handle_plain_button; | 3131 | goto handle_plain_button; |
| 3125 | 3132 | ||
| 3126 | { | 3133 | { |
| @@ -3170,7 +3177,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) | |||
| 3170 | /* Hold onto message for now. */ | 3177 | /* Hold onto message for now. */ |
| 3171 | mouse_button_timer = | 3178 | mouse_button_timer = |
| 3172 | SetTimer (hwnd, MOUSE_BUTTON_ID, | 3179 | SetTimer (hwnd, MOUSE_BUTTON_ID, |
| 3173 | XINT (Vw32_mouse_button_tolerance), NULL); | 3180 | w32_mouse_button_tolerance, NULL); |
| 3174 | saved_mouse_button_msg.msg.hwnd = hwnd; | 3181 | saved_mouse_button_msg.msg.hwnd = hwnd; |
| 3175 | saved_mouse_button_msg.msg.message = msg; | 3182 | saved_mouse_button_msg.msg.message = msg; |
| 3176 | saved_mouse_button_msg.msg.wParam = wParam; | 3183 | saved_mouse_button_msg.msg.wParam = wParam; |
| @@ -3183,7 +3190,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) | |||
| 3183 | 3190 | ||
| 3184 | case WM_LBUTTONUP: | 3191 | case WM_LBUTTONUP: |
| 3185 | case WM_RBUTTONUP: | 3192 | case WM_RBUTTONUP: |
| 3186 | if (XINT (Vw32_num_mouse_buttons) > 2) | 3193 | if (w32_num_mouse_buttons > 2) |
| 3187 | goto handle_plain_button; | 3194 | goto handle_plain_button; |
| 3188 | 3195 | ||
| 3189 | { | 3196 | { |
| @@ -3279,7 +3286,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) | |||
| 3279 | track_mouse_window = hwnd; | 3286 | track_mouse_window = hwnd; |
| 3280 | } | 3287 | } |
| 3281 | case WM_VSCROLL: | 3288 | case WM_VSCROLL: |
| 3282 | if (XINT (Vw32_mouse_move_interval) <= 0 | 3289 | if (w32_mouse_move_interval <= 0 |
| 3283 | || (msg == WM_MOUSEMOVE && button_state == 0)) | 3290 | || (msg == WM_MOUSEMOVE && button_state == 0)) |
| 3284 | { | 3291 | { |
| 3285 | wmsg.dwModifiers = w32_get_modifiers (); | 3292 | wmsg.dwModifiers = w32_get_modifiers (); |
| @@ -3295,7 +3302,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) | |||
| 3295 | if (saved_mouse_move_msg.msg.hwnd == 0) | 3302 | if (saved_mouse_move_msg.msg.hwnd == 0) |
| 3296 | mouse_move_timer = | 3303 | mouse_move_timer = |
| 3297 | SetTimer (hwnd, MOUSE_MOVE_ID, | 3304 | SetTimer (hwnd, MOUSE_MOVE_ID, |
| 3298 | XINT (Vw32_mouse_move_interval), NULL); | 3305 | w32_mouse_move_interval, NULL); |
| 3299 | 3306 | ||
| 3300 | /* Hold onto message for now. */ | 3307 | /* Hold onto message for now. */ |
| 3301 | saved_mouse_move_msg.msg.hwnd = hwnd; | 3308 | saved_mouse_move_msg.msg.hwnd = hwnd; |
| @@ -4772,46 +4779,46 @@ x_to_w32_charset (lpcs) | |||
| 4772 | w32_charset = Fcar (Fcdr (this_entry)); | 4779 | w32_charset = Fcar (Fcdr (this_entry)); |
| 4773 | 4780 | ||
| 4774 | /* Translate Lisp symbol to number. */ | 4781 | /* Translate Lisp symbol to number. */ |
| 4775 | if (w32_charset == Qw32_charset_ansi) | 4782 | if (EQ (w32_charset, Qw32_charset_ansi)) |
| 4776 | return ANSI_CHARSET; | 4783 | return ANSI_CHARSET; |
| 4777 | if (w32_charset == Qw32_charset_symbol) | 4784 | if (EQ (w32_charset, Qw32_charset_symbol)) |
| 4778 | return SYMBOL_CHARSET; | 4785 | return SYMBOL_CHARSET; |
| 4779 | if (w32_charset == Qw32_charset_shiftjis) | 4786 | if (EQ (w32_charset, Qw32_charset_shiftjis)) |
| 4780 | return SHIFTJIS_CHARSET; | 4787 | return SHIFTJIS_CHARSET; |
| 4781 | if (w32_charset == Qw32_charset_hangeul) | 4788 | if (EQ (w32_charset, Qw32_charset_hangeul)) |
| 4782 | return HANGEUL_CHARSET; | 4789 | return HANGEUL_CHARSET; |
| 4783 | if (w32_charset == Qw32_charset_chinesebig5) | 4790 | if (EQ (w32_charset, Qw32_charset_chinesebig5)) |
| 4784 | return CHINESEBIG5_CHARSET; | 4791 | return CHINESEBIG5_CHARSET; |
| 4785 | if (w32_charset == Qw32_charset_gb2312) | 4792 | if (EQ (w32_charset, Qw32_charset_gb2312)) |
| 4786 | return GB2312_CHARSET; | 4793 | return GB2312_CHARSET; |
| 4787 | if (w32_charset == Qw32_charset_oem) | 4794 | if (EQ (w32_charset, Qw32_charset_oem)) |
| 4788 | return OEM_CHARSET; | 4795 | return OEM_CHARSET; |
| 4789 | #ifdef JOHAB_CHARSET | 4796 | #ifdef JOHAB_CHARSET |
| 4790 | if (w32_charset == Qw32_charset_johab) | 4797 | if (EQ (w32_charset, Qw32_charset_johab)) |
| 4791 | return JOHAB_CHARSET; | 4798 | return JOHAB_CHARSET; |
| 4792 | if (w32_charset == Qw32_charset_easteurope) | 4799 | if (EQ (w32_charset, Qw32_charset_easteurope)) |
| 4793 | return EASTEUROPE_CHARSET; | 4800 | return EASTEUROPE_CHARSET; |
| 4794 | if (w32_charset == Qw32_charset_turkish) | 4801 | if (EQ (w32_charset, Qw32_charset_turkish)) |
| 4795 | return TURKISH_CHARSET; | 4802 | return TURKISH_CHARSET; |
| 4796 | if (w32_charset == Qw32_charset_baltic) | 4803 | if (EQ (w32_charset, Qw32_charset_baltic)) |
| 4797 | return BALTIC_CHARSET; | 4804 | return BALTIC_CHARSET; |
| 4798 | if (w32_charset == Qw32_charset_russian) | 4805 | if (EQ (w32_charset, Qw32_charset_russian)) |
| 4799 | return RUSSIAN_CHARSET; | 4806 | return RUSSIAN_CHARSET; |
| 4800 | if (w32_charset == Qw32_charset_arabic) | 4807 | if (EQ (w32_charset, Qw32_charset_arabic)) |
| 4801 | return ARABIC_CHARSET; | 4808 | return ARABIC_CHARSET; |
| 4802 | if (w32_charset == Qw32_charset_greek) | 4809 | if (EQ (w32_charset, Qw32_charset_greek)) |
| 4803 | return GREEK_CHARSET; | 4810 | return GREEK_CHARSET; |
| 4804 | if (w32_charset == Qw32_charset_hebrew) | 4811 | if (EQ (w32_charset, Qw32_charset_hebrew)) |
| 4805 | return HEBREW_CHARSET; | 4812 | return HEBREW_CHARSET; |
| 4806 | if (w32_charset == Qw32_charset_vietnamese) | 4813 | if (EQ (w32_charset, Qw32_charset_vietnamese)) |
| 4807 | return VIETNAMESE_CHARSET; | 4814 | return VIETNAMESE_CHARSET; |
| 4808 | if (w32_charset == Qw32_charset_thai) | 4815 | if (EQ (w32_charset, Qw32_charset_thai)) |
| 4809 | return THAI_CHARSET; | 4816 | return THAI_CHARSET; |
| 4810 | if (w32_charset == Qw32_charset_mac) | 4817 | if (EQ (w32_charset, Qw32_charset_mac)) |
| 4811 | return MAC_CHARSET; | 4818 | return MAC_CHARSET; |
| 4812 | #endif /* JOHAB_CHARSET */ | 4819 | #endif /* JOHAB_CHARSET */ |
| 4813 | #ifdef UNICODE_CHARSET | 4820 | #ifdef UNICODE_CHARSET |
| 4814 | if (w32_charset == Qw32_charset_unicode) | 4821 | if (EQ (w32_charset, Qw32_charset_unicode)) |
| 4815 | return UNICODE_CHARSET; | 4822 | return UNICODE_CHARSET; |
| 4816 | #endif | 4823 | #endif |
| 4817 | 4824 | ||
| @@ -4937,8 +4944,8 @@ w32_to_x_charset (fncharset) | |||
| 4937 | 4944 | ||
| 4938 | /* Look for Same charset and a valid codepage (or non-int | 4945 | /* Look for Same charset and a valid codepage (or non-int |
| 4939 | which means ignore). */ | 4946 | which means ignore). */ |
| 4940 | if (w32_charset == charset_type | 4947 | if (EQ (w32_charset, charset_type) |
| 4941 | && (!INTEGERP (codepage) || codepage == CP_DEFAULT | 4948 | && (!INTEGERP (codepage) || XINT (codepage) == CP_DEFAULT |
| 4942 | || IsValidCodePage (XINT (codepage)))) | 4949 | || IsValidCodePage (XINT (codepage)))) |
| 4943 | { | 4950 | { |
| 4944 | /* If we don't have a match already, then this is the | 4951 | /* If we don't have a match already, then this is the |
| @@ -5095,8 +5102,8 @@ w32_to_all_x_charsets (fncharset) | |||
| 5095 | 5102 | ||
| 5096 | /* Look for Same charset and a valid codepage (or non-int | 5103 | /* Look for Same charset and a valid codepage (or non-int |
| 5097 | which means ignore). */ | 5104 | which means ignore). */ |
| 5098 | if (w32_charset == charset_type | 5105 | if (EQ (w32_charset, charset_type) |
| 5099 | && (!INTEGERP (codepage) || codepage == CP_DEFAULT | 5106 | && (!INTEGERP (codepage) || XINT (codepage) == CP_DEFAULT |
| 5100 | || IsValidCodePage (XINT (codepage)))) | 5107 | || IsValidCodePage (XINT (codepage)))) |
| 5101 | { | 5108 | { |
| 5102 | retval = Fcons (x_charset, retval); | 5109 | retval = Fcons (x_charset, retval); |
| @@ -6145,6 +6152,9 @@ w32_find_ccl_program (fontp) | |||
| 6145 | } | 6152 | } |
| 6146 | } | 6153 | } |
| 6147 | 6154 | ||
| 6155 | /* directory-files from dired.c. */ | ||
| 6156 | Lisp_Object Fdirectory_files P_((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object)); | ||
| 6157 | |||
| 6148 | 6158 | ||
| 6149 | /* Find BDF files in a specified directory. (use GCPRO when calling, | 6159 | /* Find BDF files in a specified directory. (use GCPRO when calling, |
| 6150 | as this calls lisp to get a directory listing). */ | 6160 | as this calls lisp to get a directory listing). */ |
| @@ -6158,7 +6168,7 @@ w32_find_bdf_fonts_in_dir (Lisp_Object directory) | |||
| 6158 | return Qnil; | 6168 | return Qnil; |
| 6159 | 6169 | ||
| 6160 | filelist = Fdirectory_files (directory, Qt, | 6170 | filelist = Fdirectory_files (directory, Qt, |
| 6161 | build_string (".*\\.[bB][dD][fF]"), Qt); | 6171 | build_string (".*\\.[bB][dD][fF]"), Qt); |
| 6162 | 6172 | ||
| 6163 | for ( ; CONSP(filelist); filelist = XCDR (filelist)) | 6173 | for ( ; CONSP(filelist); filelist = XCDR (filelist)) |
| 6164 | { | 6174 | { |
| @@ -7945,7 +7955,7 @@ lookup_vk_code (char *key) | |||
| 7945 | 7955 | ||
| 7946 | /* Convert a one-element vector style key sequence to a hot key | 7956 | /* Convert a one-element vector style key sequence to a hot key |
| 7947 | definition. */ | 7957 | definition. */ |
| 7948 | static int | 7958 | static Lisp_Object |
| 7949 | w32_parse_hot_key (key) | 7959 | w32_parse_hot_key (key) |
| 7950 | Lisp_Object key; | 7960 | Lisp_Object key; |
| 7951 | { | 7961 | { |
| @@ -7977,7 +7987,7 @@ w32_parse_hot_key (key) | |||
| 7977 | if (SYMBOLP (c)) | 7987 | if (SYMBOLP (c)) |
| 7978 | { | 7988 | { |
| 7979 | c = parse_modifiers (c); | 7989 | c = parse_modifiers (c); |
| 7980 | lisp_modifiers = Fcar (Fcdr (c)); | 7990 | lisp_modifiers = XINT (Fcar (Fcdr (c))); |
| 7981 | c = Fcar (c); | 7991 | c = Fcar (c); |
| 7982 | if (!SYMBOLP (c)) | 7992 | if (!SYMBOLP (c)) |
| 7983 | abort (); | 7993 | abort (); |
| @@ -8046,8 +8056,13 @@ The return value is the hotkey-id if registered, otherwise nil. */) | |||
| 8046 | 8056 | ||
| 8047 | /* Notify input thread about new hot-key definition, so that it | 8057 | /* Notify input thread about new hot-key definition, so that it |
| 8048 | takes effect without needing to switch focus. */ | 8058 | takes effect without needing to switch focus. */ |
| 8059 | #ifdef USE_LISP_UNION_TYPE | ||
| 8060 | PostThreadMessage (dwWindowsThreadId, WM_EMACS_REGISTER_HOT_KEY, | ||
| 8061 | (WPARAM) key.i, 0); | ||
| 8062 | #else | ||
| 8049 | PostThreadMessage (dwWindowsThreadId, WM_EMACS_REGISTER_HOT_KEY, | 8063 | PostThreadMessage (dwWindowsThreadId, WM_EMACS_REGISTER_HOT_KEY, |
| 8050 | (WPARAM) key, 0); | 8064 | (WPARAM) key, 0); |
| 8065 | #endif | ||
| 8051 | } | 8066 | } |
| 8052 | 8067 | ||
| 8053 | return key; | 8068 | return key; |
| @@ -8070,8 +8085,14 @@ DEFUN ("w32-unregister-hot-key", Fw32_unregister_hot_key, | |||
| 8070 | { | 8085 | { |
| 8071 | /* Notify input thread about hot-key definition being removed, so | 8086 | /* Notify input thread about hot-key definition being removed, so |
| 8072 | that it takes effect without needing focus switch. */ | 8087 | that it takes effect without needing focus switch. */ |
| 8088 | #ifdef USE_LISP_UNION_TYPE | ||
| 8089 | if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_UNREGISTER_HOT_KEY, | ||
| 8090 | (WPARAM) XINT (XCAR (item)), (LPARAM) item.i)) | ||
| 8091 | #else | ||
| 8073 | if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_UNREGISTER_HOT_KEY, | 8092 | if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_UNREGISTER_HOT_KEY, |
| 8074 | (WPARAM) XINT (XCAR (item)), (LPARAM) item)) | 8093 | (WPARAM) XINT (XCAR (item)), (LPARAM) item.i)) |
| 8094 | |||
| 8095 | #endif | ||
| 8075 | { | 8096 | { |
| 8076 | MSG msg; | 8097 | MSG msg; |
| 8077 | GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE); | 8098 | GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE); |
| @@ -8144,8 +8165,13 @@ is set to off if the low bit of NEW-STATE is zero, otherwise on. */) | |||
| 8144 | if (!dwWindowsThreadId) | 8165 | if (!dwWindowsThreadId) |
| 8145 | return make_number (w32_console_toggle_lock_key (vk_code, new_state)); | 8166 | return make_number (w32_console_toggle_lock_key (vk_code, new_state)); |
| 8146 | 8167 | ||
| 8168 | #ifdef USE_LISP_UNION_TYPE | ||
| 8169 | if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_TOGGLE_LOCK_KEY, | ||
| 8170 | (WPARAM) vk_code, (LPARAM) new_state.i)) | ||
| 8171 | #else | ||
| 8147 | if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_TOGGLE_LOCK_KEY, | 8172 | if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_TOGGLE_LOCK_KEY, |
| 8148 | (WPARAM) vk_code, (LPARAM) new_state)) | 8173 | (WPARAM) vk_code, (LPARAM) new_state.i)) |
| 8174 | #endif | ||
| 8149 | { | 8175 | { |
| 8150 | MSG msg; | 8176 | MSG msg; |
| 8151 | GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE); | 8177 | GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE); |
| @@ -8424,9 +8450,9 @@ open the System menu. When nil, Emacs silently swallows alt key events. */); | |||
| 8424 | When nil, Emacs will translate the alt key to the Alt modifier, and not Meta. */); | 8450 | When nil, Emacs will translate the alt key to the Alt modifier, and not Meta. */); |
| 8425 | Vw32_alt_is_meta = Qt; | 8451 | Vw32_alt_is_meta = Qt; |
| 8426 | 8452 | ||
| 8427 | DEFVAR_INT ("w32-quit-key", &Vw32_quit_key, | 8453 | DEFVAR_INT ("w32-quit-key", &w32_quit_key, |
| 8428 | doc: /* If non-zero, the virtual key code for an alternative quit key. */); | 8454 | doc: /* If non-zero, the virtual key code for an alternative quit key. */); |
| 8429 | XSETINT (Vw32_quit_key, 0); | 8455 | w32_quit_key = 0; |
| 8430 | 8456 | ||
| 8431 | DEFVAR_LISP ("w32-pass-lwindow-to-system", | 8457 | DEFVAR_LISP ("w32-pass-lwindow-to-system", |
| 8432 | &Vw32_pass_lwindow_to_system, | 8458 | &Vw32_pass_lwindow_to_system, |
| @@ -8440,9 +8466,9 @@ When non-nil, the Start menu is opened by tapping the key. */); | |||
| 8440 | When non-nil, the Start menu is opened by tapping the key. */); | 8466 | When non-nil, the Start menu is opened by tapping the key. */); |
| 8441 | Vw32_pass_rwindow_to_system = Qt; | 8467 | Vw32_pass_rwindow_to_system = Qt; |
| 8442 | 8468 | ||
| 8443 | DEFVAR_INT ("w32-phantom-key-code", | 8469 | DEFVAR_LISP ("w32-phantom-key-code", |
| 8444 | &Vw32_phantom_key_code, | 8470 | &Vw32_phantom_key_code, |
| 8445 | doc: /* Virtual key code used to generate \"phantom\" key presses. | 8471 | doc: /* Virtual key code used to generate \"phantom\" key presses. |
| 8446 | Value is a number between 0 and 255. | 8472 | Value is a number between 0 and 255. |
| 8447 | 8473 | ||
| 8448 | Phantom key presses are generated in order to stop the system from | 8474 | Phantom key presses are generated in order to stop the system from |
| @@ -8450,7 +8476,7 @@ acting on \"Windows\" key events when `w32-pass-lwindow-to-system' or | |||
| 8450 | `w32-pass-rwindow-to-system' is nil. */); | 8476 | `w32-pass-rwindow-to-system' is nil. */); |
| 8451 | /* Although 255 is technically not a valid key code, it works and | 8477 | /* Although 255 is technically not a valid key code, it works and |
| 8452 | means that this hack won't interfere with any real key code. */ | 8478 | means that this hack won't interfere with any real key code. */ |
| 8453 | Vw32_phantom_key_code = 255; | 8479 | XSETINT (Vw32_phantom_key_code, 255); |
| 8454 | 8480 | ||
| 8455 | DEFVAR_LISP ("w32-enable-num-lock", | 8481 | DEFVAR_LISP ("w32-enable-num-lock", |
| 8456 | &Vw32_enable_num_lock, | 8482 | &Vw32_enable_num_lock, |
| @@ -8505,21 +8531,21 @@ Any other value will cause the key to be ignored. */); | |||
| 8505 | Vw32_enable_palette = Qt; | 8531 | Vw32_enable_palette = Qt; |
| 8506 | 8532 | ||
| 8507 | DEFVAR_INT ("w32-mouse-button-tolerance", | 8533 | DEFVAR_INT ("w32-mouse-button-tolerance", |
| 8508 | &Vw32_mouse_button_tolerance, | 8534 | &w32_mouse_button_tolerance, |
| 8509 | doc: /* Analogue of double click interval for faking middle mouse events. | 8535 | doc: /* Analogue of double click interval for faking middle mouse events. |
| 8510 | The value is the minimum time in milliseconds that must elapse between | 8536 | The value is the minimum time in milliseconds that must elapse between |
| 8511 | left/right button down events before they are considered distinct events. | 8537 | left/right button down events before they are considered distinct events. |
| 8512 | If both mouse buttons are depressed within this interval, a middle mouse | 8538 | If both mouse buttons are depressed within this interval, a middle mouse |
| 8513 | button down event is generated instead. */); | 8539 | button down event is generated instead. */); |
| 8514 | XSETINT (Vw32_mouse_button_tolerance, GetDoubleClickTime () / 2); | 8540 | w32_mouse_button_tolerance = GetDoubleClickTime () / 2; |
| 8515 | 8541 | ||
| 8516 | DEFVAR_INT ("w32-mouse-move-interval", | 8542 | DEFVAR_INT ("w32-mouse-move-interval", |
| 8517 | &Vw32_mouse_move_interval, | 8543 | &w32_mouse_move_interval, |
| 8518 | doc: /* Minimum interval between mouse move events. | 8544 | doc: /* Minimum interval between mouse move events. |
| 8519 | The value is the minimum time in milliseconds that must elapse between | 8545 | The value is the minimum time in milliseconds that must elapse between |
| 8520 | successive mouse move (or scroll bar drag) events before they are | 8546 | successive mouse move (or scroll bar drag) events before they are |
| 8521 | reported as lisp events. */); | 8547 | reported as lisp events. */); |
| 8522 | XSETINT (Vw32_mouse_move_interval, 0); | 8548 | w32_mouse_move_interval = 0; |
| 8523 | 8549 | ||
| 8524 | DEFVAR_BOOL ("w32-pass-extra-mouse-buttons-to-system", | 8550 | DEFVAR_BOOL ("w32-pass-extra-mouse-buttons-to-system", |
| 8525 | &w32_pass_extra_mouse_buttons_to_system, | 8551 | &w32_pass_extra_mouse_buttons_to_system, |
| @@ -8800,9 +8826,9 @@ void globals_of_w32fns () | |||
| 8800 | GetProcAddress (user32_lib, "GetClipboardSequenceNumber"); | 8826 | GetProcAddress (user32_lib, "GetClipboardSequenceNumber"); |
| 8801 | 8827 | ||
| 8802 | DEFVAR_INT ("w32-ansi-code-page", | 8828 | DEFVAR_INT ("w32-ansi-code-page", |
| 8803 | &Vw32_ansi_code_page, | 8829 | &w32_ansi_code_page, |
| 8804 | doc: /* The ANSI code page used by the system. */); | 8830 | doc: /* The ANSI code page used by the system. */); |
| 8805 | XSETINT (Vw32_ansi_code_page, GetACP ()); | 8831 | w32_ansi_code_page = GetACP (); |
| 8806 | } | 8832 | } |
| 8807 | 8833 | ||
| 8808 | #undef abort | 8834 | #undef abort |