/[emacs]/emacs/src/w32fns.c
ViewVC logotype

Diff of /emacs/src/w32fns.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.173.2.9 by miles, Tue May 11 02:39:03 2004 UTC revision 1.173.2.10 by miles, Tue Jul 6 09:14:38 2004 UTC
# Line 1  Line 1 
1  /* Graphical user interface functions for the Microsoft W32 API.  /* Graphical user interface functions for the Microsoft W32 API.
2     Copyright (C) 1989, 92, 93, 94, 95, 1996, 1997, 1998, 1999, 2000, 2001     Copyright (C) 1989, 92, 93, 94, 95, 96, 97, 98, 1999, 2000, 01, 2004
3       Free Software Foundation, Inc.       Free Software Foundation, Inc.
4    
5  This file is part of GNU Emacs.  This file is part of GNU Emacs.
# Line 88  Lisp_Object Vw32_pass_alt_to_system; Line 88  Lisp_Object Vw32_pass_alt_to_system;
88  Lisp_Object Vw32_alt_is_meta;  Lisp_Object Vw32_alt_is_meta;
89    
90  /* If non-zero, the windows virtual key code for an alternative quit key. */  /* If non-zero, the windows virtual key code for an alternative quit key. */
91  Lisp_Object Vw32_quit_key;  int w32_quit_key;
92    
93  /* Non nil if left window key events are passed on to Windows (this only  /* Non nil if left window key events are passed on to Windows (this only
94     affects whether "tapping" the key opens the Start menu).  */     affects whether "tapping" the key opens the Start menu).  */
# Line 132  Lisp_Object Vw32_enable_palette; Line 132  Lisp_Object Vw32_enable_palette;
132    
133  /* Control how close left/right button down events must be to  /* Control how close left/right button down events must be to
134     be converted to a middle button down event. */     be converted to a middle button down event. */
135  Lisp_Object Vw32_mouse_button_tolerance;  int w32_mouse_button_tolerance;
136    
137  /* Minimum interval between mouse movement (and scroll bar drag)  /* Minimum interval between mouse movement (and scroll bar drag)
138     events that are passed on to the event loop. */     events that are passed on to the event loop. */
139  Lisp_Object Vw32_mouse_move_interval;  int w32_mouse_move_interval;
140    
141  /* Flag to indicate if XBUTTON events should be passed on to Windows.  */  /* Flag to indicate if XBUTTON events should be passed on to Windows.  */
142  int w32_pass_extra_mouse_buttons_to_system;  int w32_pass_extra_mouse_buttons_to_system;
# Line 235  Lisp_Object Qw32_charset_unicode; Line 235  Lisp_Object Qw32_charset_unicode;
235  #endif  #endif
236    
237  /* The ANSI codepage.  */  /* The ANSI codepage.  */
238  Lisp_Object Vw32_ansi_code_page;  int w32_ansi_code_page;
239    
240  /* Prefix for system colors.  */  /* Prefix for system colors.  */
241  #define SYSTEM_COLOR_PREFIX "System"  #define SYSTEM_COLOR_PREFIX "System"
# Line 283  int image_cache_refcount, dpyinfo_refcou Line 283  int image_cache_refcount, dpyinfo_refcou
283    
284    
285  /* From w32term.c. */  /* From w32term.c. */
286  extern Lisp_Object Vw32_num_mouse_buttons;  extern int w32_num_mouse_buttons;
287  extern Lisp_Object Vw32_recognize_altgr;  extern Lisp_Object Vw32_recognize_altgr;
288    
289  extern HWND w32_system_caret_hwnd;  extern HWND w32_system_caret_hwnd;
# Line 465  if the entry is new.  */) Line 465  if the entry is new.  */)
465    CHECK_NUMBER (blue);    CHECK_NUMBER (blue);
466    CHECK_STRING (name);    CHECK_STRING (name);
467    
468    XSET (rgb, Lisp_Int, RGB(XUINT (red), XUINT (green), XUINT (blue)));    XSETINT (rgb, RGB(XUINT (red), XUINT (green), XUINT (blue)));
469    
470    BLOCK_INPUT;    BLOCK_INPUT;
471    
# Line 828  w32_to_x_color (rgb) Line 828  w32_to_x_color (rgb)
828      return Qnil;      return Qnil;
829  }  }
830    
831  COLORREF  static Lisp_Object
832  w32_color_map_lookup (colorname)  w32_color_map_lookup (colorname)
833       char *colorname;       char *colorname;
834  {  {
# Line 847  w32_color_map_lookup (colorname) Line 847  w32_color_map_lookup (colorname)
847    
848        if (lstrcmpi (SDATA (tem), colorname) == 0)        if (lstrcmpi (SDATA (tem), colorname) == 0)
849          {          {
850            ret = XUINT (Fcdr (elt));            ret = Fcdr (elt);
851            break;            break;
852          }          }
853    
# Line 910  add_system_logical_colors_to_map (system Line 910  add_system_logical_colors_to_map (system
910  }  }
911    
912    
913  COLORREF  static Lisp_Object
914  x_to_w32_color (colorname)  x_to_w32_color (colorname)
915       char * colorname;       char * colorname;
916  {  {
# Line 970  x_to_w32_color (colorname) Line 970  x_to_w32_color (colorname)
970                if (i == 2)                if (i == 2)
971                  {                  {
972                    UNBLOCK_INPUT;                    UNBLOCK_INPUT;
973                    return (colorval);                    XSETINT (ret, colorval);
974                      return ret;
975                  }                  }
976                color = end;                color = end;
977              }              }
# Line 1023  x_to_w32_color (colorname) Line 1024  x_to_w32_color (colorname)
1024                if (*end != '\0')                if (*end != '\0')
1025                  break;                  break;
1026                UNBLOCK_INPUT;                UNBLOCK_INPUT;
1027                return (colorval);                XSETINT (ret, colorval);
1028                  return ret;
1029              }              }
1030            if (*end != '/')            if (*end != '/')
1031              break;              break;
# Line 1064  x_to_w32_color (colorname) Line 1066  x_to_w32_color (colorname)
1066                if (*end != '\0')                if (*end != '\0')
1067                  break;                  break;
1068                UNBLOCK_INPUT;                UNBLOCK_INPUT;
1069                return (colorval);                XSETINT (ret, colorval);
1070                  return ret;
1071              }              }
1072            if (*end != '/')            if (*end != '/')
1073              break;              break;
# Line 2418  Lisp_Object w32_grabbed_keys; Line 2421  Lisp_Object w32_grabbed_keys;
2421  #define HOTKEY_VK_CODE(k)     (XFASTINT (k) & 255)  #define HOTKEY_VK_CODE(k)     (XFASTINT (k) & 255)
2422  #define HOTKEY_MODIFIERS(k)   (XFASTINT (k) >> 8)  #define HOTKEY_MODIFIERS(k)   (XFASTINT (k) >> 8)
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    
2428  /* Register hot-keys for reserved key combinations when Emacs has  /* Register hot-keys for reserved key combinations when Emacs has
2429     keyboard focus, since this is the only way Emacs can receive key     keyboard focus, since this is the only way Emacs can receive key
2430     combinations like Alt-Tab which are used by the system.  */     combinations like Alt-Tab which are used by the system.  */
# Line 2499  w32_msg_pump (deferred_msg * msg_buf) Line 2506  w32_msg_pump (deferred_msg * msg_buf)
2506                focus_window = GetFocus ();                focus_window = GetFocus ();
2507                if (focus_window != NULL)                if (focus_window != NULL)
2508                  RegisterHotKey (focus_window,                  RegisterHotKey (focus_window,
2509                                  HOTKEY_ID (msg.wParam),                                  RAW_HOTKEY_ID (msg.wParam),
2510                                  HOTKEY_MODIFIERS (msg.wParam),                                  RAW_HOTKEY_MODIFIERS (msg.wParam),
2511                                  HOTKEY_VK_CODE (msg.wParam));                                  RAW_HOTKEY_VK_CODE (msg.wParam));
2512                /* Reply is not expected.  */                /* Reply is not expected.  */
2513                break;                break;
2514              case WM_EMACS_UNREGISTER_HOT_KEY:              case WM_EMACS_UNREGISTER_HOT_KEY:
2515                focus_window = GetFocus ();                focus_window = GetFocus ();
2516                if (focus_window != NULL)                if (focus_window != NULL)
2517                  UnregisterHotKey (focus_window, HOTKEY_ID (msg.wParam));                  UnregisterHotKey (focus_window, RAW_HOTKEY_ID (msg.wParam));
2518                /* Mark item as erased.  NB: this code must be                /* Mark item as erased.  NB: this code must be
2519                   thread-safe.  The next line is okay because the cons                   thread-safe.  The next line is okay because the cons
2520                   cell is never made into garbage and is not relocated by                   cell is never made into garbage and is not relocated by
2521                   GC.  */                   GC.  */
2522                XSETCAR ((Lisp_Object) msg.lParam, Qnil);                XSETCAR ((Lisp_Object) ((EMACS_INT) msg.lParam), Qnil);
2523                if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0))                if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0))
2524                  abort ();                  abort ();
2525                break;                break;
# Line 2520  w32_msg_pump (deferred_msg * msg_buf) Line 2527  w32_msg_pump (deferred_msg * msg_buf)
2527                {                {
2528                  int vk_code = (int) msg.wParam;                  int vk_code = (int) msg.wParam;
2529                  int cur_state = (GetKeyState (vk_code) & 1);                  int cur_state = (GetKeyState (vk_code) & 1);
2530                  Lisp_Object new_state = (Lisp_Object) msg.lParam;                  Lisp_Object new_state = (Lisp_Object) ((EMACS_INT) msg.lParam);
2531    
2532                  /* NB: This code must be thread-safe.  It is safe to                  /* NB: This code must be thread-safe.  It is safe to
2533                     call NILP because symbols are not relocated by GC,                     call NILP because symbols are not relocated by GC,
# Line 2710  post_character_message (hwnd, msg, wPara Line 2717  post_character_message (hwnd, msg, wPara
2717        c = make_ctrl_char (c) & 0377;        c = make_ctrl_char (c) & 0377;
2718      if (c == quit_char      if (c == quit_char
2719          || (wmsg.dwModifiers == 0 &&          || (wmsg.dwModifiers == 0 &&
2720              XFASTINT (Vw32_quit_key) && wParam == XFASTINT (Vw32_quit_key)))              w32_quit_key && wParam == w32_quit_key))
2721        {        {
2722          Vquit_flag = Qt;          Vquit_flag = Qt;
2723    
# Line 3120  w32_wnd_proc (hwnd, msg, wParam, lParam) Line 3127  w32_wnd_proc (hwnd, msg, wParam, lParam)
3127           are used together, but only if user has two button mouse. */           are used together, but only if user has two button mouse. */
3128      case WM_LBUTTONDOWN:      case WM_LBUTTONDOWN:
3129      case WM_RBUTTONDOWN:      case WM_RBUTTONDOWN:
3130        if (XINT (Vw32_num_mouse_buttons) > 2)        if (w32_num_mouse_buttons > 2)
3131          goto handle_plain_button;          goto handle_plain_button;
3132    
3133        {        {
# Line 3170  w32_wnd_proc (hwnd, msg, wParam, lParam) Line 3177  w32_wnd_proc (hwnd, msg, wParam, lParam)
3177              /* Hold onto message for now. */              /* Hold onto message for now. */
3178              mouse_button_timer =              mouse_button_timer =
3179                SetTimer (hwnd, MOUSE_BUTTON_ID,                SetTimer (hwnd, MOUSE_BUTTON_ID,
3180                          XINT (Vw32_mouse_button_tolerance), NULL);                          w32_mouse_button_tolerance, NULL);
3181              saved_mouse_button_msg.msg.hwnd = hwnd;              saved_mouse_button_msg.msg.hwnd = hwnd;
3182              saved_mouse_button_msg.msg.message = msg;              saved_mouse_button_msg.msg.message = msg;
3183              saved_mouse_button_msg.msg.wParam = wParam;              saved_mouse_button_msg.msg.wParam = wParam;
# Line 3183  w32_wnd_proc (hwnd, msg, wParam, lParam) Line 3190  w32_wnd_proc (hwnd, msg, wParam, lParam)
3190    
3191      case WM_LBUTTONUP:      case WM_LBUTTONUP:
3192      case WM_RBUTTONUP:      case WM_RBUTTONUP:
3193        if (XINT (Vw32_num_mouse_buttons) > 2)        if (w32_num_mouse_buttons > 2)
3194          goto handle_plain_button;          goto handle_plain_button;
3195    
3196        {        {
# Line 3279  w32_wnd_proc (hwnd, msg, wParam, lParam) Line 3286  w32_wnd_proc (hwnd, msg, wParam, lParam)
3286            track_mouse_window = hwnd;            track_mouse_window = hwnd;
3287          }          }
3288      case WM_VSCROLL:      case WM_VSCROLL:
3289        if (XINT (Vw32_mouse_move_interval) <= 0        if (w32_mouse_move_interval <= 0
3290            || (msg == WM_MOUSEMOVE && button_state == 0))            || (msg == WM_MOUSEMOVE && button_state == 0))
3291          {          {
3292            wmsg.dwModifiers = w32_get_modifiers ();            wmsg.dwModifiers = w32_get_modifiers ();
# Line 3295  w32_wnd_proc (hwnd, msg, wParam, lParam) Line 3302  w32_wnd_proc (hwnd, msg, wParam, lParam)
3302        if (saved_mouse_move_msg.msg.hwnd == 0)        if (saved_mouse_move_msg.msg.hwnd == 0)
3303          mouse_move_timer =          mouse_move_timer =
3304            SetTimer (hwnd, MOUSE_MOVE_ID,            SetTimer (hwnd, MOUSE_MOVE_ID,
3305                      XINT (Vw32_mouse_move_interval), NULL);                      w32_mouse_move_interval, NULL);
3306    
3307        /* Hold onto message for now. */        /* Hold onto message for now. */
3308        saved_mouse_move_msg.msg.hwnd = hwnd;        saved_mouse_move_msg.msg.hwnd = hwnd;
# Line 4772  x_to_w32_charset (lpcs) Line 4779  x_to_w32_charset (lpcs)
4779    w32_charset = Fcar (Fcdr (this_entry));    w32_charset = Fcar (Fcdr (this_entry));
4780    
4781    /* Translate Lisp symbol to number.  */    /* Translate Lisp symbol to number.  */
4782    if (w32_charset == Qw32_charset_ansi)    if (EQ (w32_charset, Qw32_charset_ansi))
4783      return ANSI_CHARSET;      return ANSI_CHARSET;
4784    if (w32_charset == Qw32_charset_symbol)    if (EQ (w32_charset, Qw32_charset_symbol))
4785      return SYMBOL_CHARSET;      return SYMBOL_CHARSET;
4786    if (w32_charset == Qw32_charset_shiftjis)    if (EQ (w32_charset, Qw32_charset_shiftjis))
4787      return SHIFTJIS_CHARSET;      return SHIFTJIS_CHARSET;
4788    if (w32_charset == Qw32_charset_hangeul)    if (EQ (w32_charset, Qw32_charset_hangeul))
4789      return HANGEUL_CHARSET;      return HANGEUL_CHARSET;
4790    if (w32_charset == Qw32_charset_chinesebig5)    if (EQ (w32_charset, Qw32_charset_chinesebig5))
4791      return CHINESEBIG5_CHARSET;      return CHINESEBIG5_CHARSET;
4792    if (w32_charset == Qw32_charset_gb2312)    if (EQ (w32_charset, Qw32_charset_gb2312))
4793      return GB2312_CHARSET;      return GB2312_CHARSET;
4794    if (w32_charset == Qw32_charset_oem)    if (EQ (w32_charset, Qw32_charset_oem))
4795      return OEM_CHARSET;      return OEM_CHARSET;
4796  #ifdef JOHAB_CHARSET  #ifdef JOHAB_CHARSET
4797    if (w32_charset == Qw32_charset_johab)    if (EQ (w32_charset, Qw32_charset_johab))
4798      return JOHAB_CHARSET;      return JOHAB_CHARSET;
4799    if (w32_charset == Qw32_charset_easteurope)    if (EQ (w32_charset, Qw32_charset_easteurope))
4800      return EASTEUROPE_CHARSET;      return EASTEUROPE_CHARSET;
4801    if (w32_charset == Qw32_charset_turkish)    if (EQ (w32_charset, Qw32_charset_turkish))
4802      return TURKISH_CHARSET;      return TURKISH_CHARSET;
4803    if (w32_charset == Qw32_charset_baltic)    if (EQ (w32_charset, Qw32_charset_baltic))
4804      return BALTIC_CHARSET;      return BALTIC_CHARSET;
4805    if (w32_charset == Qw32_charset_russian)    if (EQ (w32_charset, Qw32_charset_russian))
4806      return RUSSIAN_CHARSET;      return RUSSIAN_CHARSET;
4807    if (w32_charset == Qw32_charset_arabic)    if (EQ (w32_charset, Qw32_charset_arabic))
4808      return ARABIC_CHARSET;      return ARABIC_CHARSET;
4809    if (w32_charset == Qw32_charset_greek)    if (EQ (w32_charset, Qw32_charset_greek))
4810      return GREEK_CHARSET;      return GREEK_CHARSET;
4811    if (w32_charset == Qw32_charset_hebrew)    if (EQ (w32_charset, Qw32_charset_hebrew))
4812      return HEBREW_CHARSET;      return HEBREW_CHARSET;
4813    if (w32_charset == Qw32_charset_vietnamese)    if (EQ (w32_charset, Qw32_charset_vietnamese))
4814      return VIETNAMESE_CHARSET;      return VIETNAMESE_CHARSET;
4815    if (w32_charset == Qw32_charset_thai)    if (EQ (w32_charset, Qw32_charset_thai))
4816      return THAI_CHARSET;      return THAI_CHARSET;
4817    if (w32_charset == Qw32_charset_mac)    if (EQ (w32_charset, Qw32_charset_mac))
4818      return MAC_CHARSET;      return MAC_CHARSET;
4819  #endif /* JOHAB_CHARSET */  #endif /* JOHAB_CHARSET */
4820  #ifdef UNICODE_CHARSET  #ifdef UNICODE_CHARSET
4821    if (w32_charset == Qw32_charset_unicode)    if (EQ (w32_charset, Qw32_charset_unicode))
4822      return UNICODE_CHARSET;      return UNICODE_CHARSET;
4823  #endif  #endif
4824    
# Line 4937  w32_to_x_charset (fncharset) Line 4944  w32_to_x_charset (fncharset)
4944    
4945          /* Look for Same charset and a valid codepage (or non-int          /* Look for Same charset and a valid codepage (or non-int
4946             which means ignore).  */             which means ignore).  */
4947          if (w32_charset == charset_type          if (EQ (w32_charset, charset_type)
4948              && (!INTEGERP (codepage) || codepage == CP_DEFAULT              && (!INTEGERP (codepage) || XINT (codepage) == CP_DEFAULT
4949                  || IsValidCodePage (XINT (codepage))))                  || IsValidCodePage (XINT (codepage))))
4950            {            {
4951              /* If we don't have a match already, then this is the              /* If we don't have a match already, then this is the
# Line 5095  w32_to_all_x_charsets (fncharset) Line 5102  w32_to_all_x_charsets (fncharset)
5102    
5103          /* Look for Same charset and a valid codepage (or non-int          /* Look for Same charset and a valid codepage (or non-int
5104             which means ignore).  */             which means ignore).  */
5105          if (w32_charset == charset_type          if (EQ (w32_charset, charset_type)
5106              && (!INTEGERP (codepage) || codepage == CP_DEFAULT              && (!INTEGERP (codepage) || XINT (codepage) == CP_DEFAULT
5107                  || IsValidCodePage (XINT (codepage))))                  || IsValidCodePage (XINT (codepage))))
5108            {            {
5109              retval = Fcons (x_charset, retval);              retval = Fcons (x_charset, retval);
# Line 6145  w32_find_ccl_program (fontp) Line 6152  w32_find_ccl_program (fontp)
6152      }      }
6153  }  }
6154    
6155    /* directory-files from dired.c.  */
6156    Lisp_Object Fdirectory_files P_((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object));
6157    
6158    
6159  /* Find BDF files in a specified directory.  (use GCPRO when calling,  /* Find BDF files in a specified directory.  (use GCPRO when calling,
6160     as this calls lisp to get a directory listing).  */     as this calls lisp to get a directory listing).  */
# Line 6158  w32_find_bdf_fonts_in_dir (Lisp_Object d Line 6168  w32_find_bdf_fonts_in_dir (Lisp_Object d
6168      return Qnil;      return Qnil;
6169    
6170    filelist = Fdirectory_files (directory, Qt,    filelist = Fdirectory_files (directory, Qt,
6171                                build_string (".*\\.[bB][dD][fF]"), Qt);                                 build_string (".*\\.[bB][dD][fF]"), Qt);
6172    
6173    for ( ; CONSP(filelist); filelist = XCDR (filelist))    for ( ; CONSP(filelist); filelist = XCDR (filelist))
6174      {      {
# Line 7945  lookup_vk_code (char *key) Line 7955  lookup_vk_code (char *key)
7955    
7956  /* Convert a one-element vector style key sequence to a hot key  /* Convert a one-element vector style key sequence to a hot key
7957     definition.  */     definition.  */
7958  static int  static Lisp_Object
7959  w32_parse_hot_key (key)  w32_parse_hot_key (key)
7960       Lisp_Object key;       Lisp_Object key;
7961  {  {
# Line 7977  w32_parse_hot_key (key) Line 7987  w32_parse_hot_key (key)
7987    if (SYMBOLP (c))    if (SYMBOLP (c))
7988      {      {
7989        c = parse_modifiers (c);        c = parse_modifiers (c);
7990        lisp_modifiers = Fcar (Fcdr (c));        lisp_modifiers = XINT (Fcar (Fcdr (c)));
7991        c = Fcar (c);        c = Fcar (c);
7992        if (!SYMBOLP (c))        if (!SYMBOLP (c))
7993          abort ();          abort ();
# Line 8046  The return value is the hotkey-id if reg Line 8056  The return value is the hotkey-id if reg
8056    
8057        /* Notify input thread about new hot-key definition, so that it        /* Notify input thread about new hot-key definition, so that it
8058           takes effect without needing to switch focus.  */           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
8063        PostThreadMessage (dwWindowsThreadId, WM_EMACS_REGISTER_HOT_KEY,        PostThreadMessage (dwWindowsThreadId, WM_EMACS_REGISTER_HOT_KEY,
8064                           (WPARAM) key, 0);                           (WPARAM) key, 0);
8065    #endif
8066      }      }
8067    
8068    return key;    return key;
# Line 8070  DEFUN ("w32-unregister-hot-key", Fw32_un Line 8085  DEFUN ("w32-unregister-hot-key", Fw32_un
8085      {      {
8086        /* Notify input thread about hot-key definition being removed, so        /* Notify input thread about hot-key definition being removed, so
8087           that it takes effect without needing focus switch.  */           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
8092        if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_UNREGISTER_HOT_KEY,        if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_UNREGISTER_HOT_KEY,
8093                               (WPARAM) XINT (XCAR (item)), (LPARAM) item))                               (WPARAM) XINT (XCAR (item)), (LPARAM) item.i))
8094    
8095    #endif
8096          {          {
8097            MSG msg;            MSG msg;
8098            GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE);            GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE);
# Line 8144  is set to off if the low bit of NEW-STAT Line 8165  is set to off if the low bit of NEW-STAT
8165    if (!dwWindowsThreadId)    if (!dwWindowsThreadId)
8166      return make_number (w32_console_toggle_lock_key (vk_code, new_state));      return make_number (w32_console_toggle_lock_key (vk_code, new_state));
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
8172    if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_TOGGLE_LOCK_KEY,    if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_TOGGLE_LOCK_KEY,
8173                           (WPARAM) vk_code, (LPARAM) new_state))                           (WPARAM) vk_code, (LPARAM) new_state.i))
8174    #endif
8175      {      {
8176        MSG msg;        MSG msg;
8177        GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE);        GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE);
# Line 8424  open the System menu.  When nil, Emacs s Line 8450  open the System menu.  When nil, Emacs s
8450  When nil, Emacs will translate the alt key to the Alt modifier, and not Meta.  */);  When nil, Emacs will translate the alt key to the Alt modifier, and not Meta.  */);
8451    Vw32_alt_is_meta = Qt;    Vw32_alt_is_meta = Qt;
8452    
8453    DEFVAR_INT ("w32-quit-key", &Vw32_quit_key,    DEFVAR_INT ("w32-quit-key", &w32_quit_key,
8454                doc: /* If non-zero, the virtual key code for an alternative quit key.  */);                 doc: /* If non-zero, the virtual key code for an alternative quit key.  */);
8455    XSETINT (Vw32_quit_key, 0);    w32_quit_key = 0;
8456    
8457    DEFVAR_LISP ("w32-pass-lwindow-to-system",    DEFVAR_LISP ("w32-pass-lwindow-to-system",
8458                 &Vw32_pass_lwindow_to_system,                 &Vw32_pass_lwindow_to_system,
# Line 8440  When non-nil, the Start menu is opened b Line 8466  When non-nil, the Start menu is opened b
8466  When non-nil, the Start menu is opened by tapping the key.  */);  When non-nil, the Start menu is opened by tapping the key.  */);
8467    Vw32_pass_rwindow_to_system = Qt;    Vw32_pass_rwindow_to_system = Qt;
8468    
8469    DEFVAR_INT ("w32-phantom-key-code",    DEFVAR_LISP ("w32-phantom-key-code",
8470                 &Vw32_phantom_key_code,                 &Vw32_phantom_key_code,
8471                doc: /* Virtual key code used to generate \"phantom\" key presses.                 doc: /* Virtual key code used to generate \"phantom\" key presses.
8472  Value is a number between 0 and 255.  Value is a number between 0 and 255.
8473    
8474  Phantom key presses are generated in order to stop the system from  Phantom key presses are generated in order to stop the system from
# Line 8450  acting on \"Windows\" key events when `w Line 8476  acting on \"Windows\" key events when `w
8476  `w32-pass-rwindow-to-system' is nil.  */);  `w32-pass-rwindow-to-system' is nil.  */);
8477    /* Although 255 is technically not a valid key code, it works and    /* Although 255 is technically not a valid key code, it works and
8478       means that this hack won't interfere with any real key code.  */       means that this hack won't interfere with any real key code.  */
8479    Vw32_phantom_key_code = 255;    XSETINT (Vw32_phantom_key_code, 255);
8480    
8481    DEFVAR_LISP ("w32-enable-num-lock",    DEFVAR_LISP ("w32-enable-num-lock",
8482                 &Vw32_enable_num_lock,                 &Vw32_enable_num_lock,
# Line 8505  Any other value will cause the key to be Line 8531  Any other value will cause the key to be
8531    Vw32_enable_palette = Qt;    Vw32_enable_palette = Qt;
8532    
8533    DEFVAR_INT ("w32-mouse-button-tolerance",    DEFVAR_INT ("w32-mouse-button-tolerance",
8534                &Vw32_mouse_button_tolerance,                &w32_mouse_button_tolerance,
8535                doc: /* Analogue of double click interval for faking middle mouse events.                doc: /* Analogue of double click interval for faking middle mouse events.
8536  The value is the minimum time in milliseconds that must elapse between  The value is the minimum time in milliseconds that must elapse between
8537  left/right button down events before they are considered distinct events.  left/right button down events before they are considered distinct events.
8538  If both mouse buttons are depressed within this interval, a middle mouse  If both mouse buttons are depressed within this interval, a middle mouse
8539  button down event is generated instead.  */);  button down event is generated instead.  */);
8540    XSETINT (Vw32_mouse_button_tolerance, GetDoubleClickTime () / 2);    w32_mouse_button_tolerance = GetDoubleClickTime () / 2;
8541    
8542    DEFVAR_INT ("w32-mouse-move-interval",    DEFVAR_INT ("w32-mouse-move-interval",
8543                &Vw32_mouse_move_interval,                &w32_mouse_move_interval,
8544                doc: /* Minimum interval between mouse move events.                doc: /* Minimum interval between mouse move events.
8545  The value is the minimum time in milliseconds that must elapse between  The value is the minimum time in milliseconds that must elapse between
8546  successive mouse move (or scroll bar drag) events before they are  successive mouse move (or scroll bar drag) events before they are
8547  reported as lisp events.  */);  reported as lisp events.  */);
8548    XSETINT (Vw32_mouse_move_interval, 0);    w32_mouse_move_interval = 0;
8549    
8550    DEFVAR_BOOL ("w32-pass-extra-mouse-buttons-to-system",    DEFVAR_BOOL ("w32-pass-extra-mouse-buttons-to-system",
8551                 &w32_pass_extra_mouse_buttons_to_system,                 &w32_pass_extra_mouse_buttons_to_system,
# Line 8800  void globals_of_w32fns () Line 8826  void globals_of_w32fns ()
8826      GetProcAddress (user32_lib, "GetClipboardSequenceNumber");      GetProcAddress (user32_lib, "GetClipboardSequenceNumber");
8827    
8828    DEFVAR_INT ("w32-ansi-code-page",    DEFVAR_INT ("w32-ansi-code-page",
8829                &Vw32_ansi_code_page,                &w32_ansi_code_page,
8830                doc: /* The ANSI code page used by the system.  */);                doc: /* The ANSI code page used by the system.  */);
8831    XSETINT (Vw32_ansi_code_page, GetACP ());    w32_ansi_code_page = GetACP ();
8832  }  }
8833    
8834  #undef abort  #undef abort

Legend:
Removed from v.1.173.2.9  
changed lines
  Added in v.1.173.2.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26