diff options
| author | Juanma Barranquero | 2007-11-14 15:34:37 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2007-11-14 15:34:37 +0000 |
| commit | 74084731475858dd97913dbe73989b06e2e9a39d (patch) | |
| tree | 26b6bb16df55aa25a666d67014b9347a9647890f /src | |
| parent | f31d0424eaa81455fb3bd32216061094e57b61cd (diff) | |
| download | emacs-74084731475858dd97913dbe73989b06e2e9a39d.tar.gz emacs-74084731475858dd97913dbe73989b06e2e9a39d.zip | |
(Fw32_registered_hot_keys): Don't return the nil values corresponding
to deleted entries; they are an implementation detail.
(gray_bitmap_width, gray_bitmap_height, gray_bitmap_bits): Remove variables.
(w32_pass_extra_mouse_buttons_to_system, w32_strict_fontnames,
w32_pass_multimedia_buttons_to_system, w32_strict_painting,
Vw32_charset_info_alist, w32_to_x_color, w32_init_class, w32_createscrollbar,
w32_createwindow, my_post_msg, w32_get_modifiers, w32_grabbed_keys,
cancel_all_deferred_msgs): Make static.
(syms_of_w32fns) <w32-pass-multimedia-buttons-to-system>: Fix typo in docstring.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 14 | ||||
| -rw-r--r-- | src/w32fns.c | 215 |
2 files changed, 119 insertions, 110 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index b8a8445155e..da730e53dd0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,17 @@ | |||
| 1 | 2007-11-14 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * w32fns.c (Fw32_registered_hot_keys): Don't return the nil values | ||
| 4 | corresponding to deleted entries; they are an implementation detail. | ||
| 5 | (gray_bitmap_width, gray_bitmap_height, gray_bitmap_bits): | ||
| 6 | Remove variables. | ||
| 7 | (w32_pass_extra_mouse_buttons_to_system, w32_strict_fontnames) | ||
| 8 | (w32_pass_multimedia_buttons_to_system, w32_strict_painting) | ||
| 9 | (Vw32_charset_info_alist, w32_to_x_color, w32_init_class) | ||
| 10 | (w32_createscrollbar, w32_createwindow, my_post_msg, w32_get_modifiers) | ||
| 11 | (w32_grabbed_keys, cancel_all_deferred_msgs): Make static. | ||
| 12 | (syms_of_w32fns) <w32-pass-multimedia-buttons-to-system>: | ||
| 13 | Fix typos in docstring. | ||
| 14 | |||
| 1 | 2007-11-13 Juanma Barranquero <lekktu@gmail.com> | 15 | 2007-11-13 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 16 | ||
| 3 | * w32fns.c (Fw32_register_hot_key): Don't try to register hot key | 17 | * w32fns.c (Fw32_register_hot_key): Don't try to register hot key |
diff --git a/src/w32fns.c b/src/w32fns.c index c8daa646720..2b7cf0f6117 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -77,10 +77,6 @@ extern char *lispy_function_keys[]; | |||
| 77 | it, and including `bitmaps/gray' more than once is a problem when | 77 | it, and including `bitmaps/gray' more than once is a problem when |
| 78 | config.h defines `static' as an empty replacement string. */ | 78 | config.h defines `static' as an empty replacement string. */ |
| 79 | 79 | ||
| 80 | int gray_bitmap_width = gray_width; | ||
| 81 | int gray_bitmap_height = gray_height; | ||
| 82 | unsigned char *gray_bitmap_bits = gray_bits; | ||
| 83 | |||
| 84 | /* The colormap for converting color names to RGB values */ | 80 | /* The colormap for converting color names to RGB values */ |
| 85 | Lisp_Object Vw32_color_map; | 81 | Lisp_Object Vw32_color_map; |
| 86 | 82 | ||
| @@ -143,10 +139,10 @@ int w32_mouse_button_tolerance; | |||
| 143 | int w32_mouse_move_interval; | 139 | int w32_mouse_move_interval; |
| 144 | 140 | ||
| 145 | /* 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. */ |
| 146 | int w32_pass_extra_mouse_buttons_to_system; | 142 | static int w32_pass_extra_mouse_buttons_to_system; |
| 147 | 143 | ||
| 148 | /* Flag to indicate if media keys should be passed on to Windows. */ | 144 | /* Flag to indicate if media keys should be passed on to Windows. */ |
| 149 | int w32_pass_multimedia_buttons_to_system; | 145 | static int w32_pass_multimedia_buttons_to_system; |
| 150 | 146 | ||
| 151 | /* Non nil if no window manager is in use. */ | 147 | /* Non nil if no window manager is in use. */ |
| 152 | Lisp_Object Vx_no_window_manager; | 148 | Lisp_Object Vx_no_window_manager; |
| @@ -185,14 +181,14 @@ Lisp_Object Vx_pixel_size_width_font_regexp; | |||
| 185 | Lisp_Object Vw32_bdf_filename_alist; | 181 | Lisp_Object Vw32_bdf_filename_alist; |
| 186 | 182 | ||
| 187 | /* A flag to control whether fonts are matched strictly or not. */ | 183 | /* A flag to control whether fonts are matched strictly or not. */ |
| 188 | int w32_strict_fontnames; | 184 | static int w32_strict_fontnames; |
| 189 | 185 | ||
| 190 | /* A flag to control whether we should only repaint if GetUpdateRect | 186 | /* A flag to control whether we should only repaint if GetUpdateRect |
| 191 | indicates there is an update region. */ | 187 | indicates there is an update region. */ |
| 192 | int w32_strict_painting; | 188 | static int w32_strict_painting; |
| 193 | 189 | ||
| 194 | /* Associative list linking character set strings to Windows codepages. */ | 190 | /* Associative list linking character set strings to Windows codepages. */ |
| 195 | Lisp_Object Vw32_charset_info_alist; | 191 | static Lisp_Object Vw32_charset_info_alist; |
| 196 | 192 | ||
| 197 | /* VIETNAMESE_CHARSET is not defined in some versions of MSVC. */ | 193 | /* VIETNAMESE_CHARSET is not defined in some versions of MSVC. */ |
| 198 | #ifndef VIETNAMESE_CHARSET | 194 | #ifndef VIETNAMESE_CHARSET |
| @@ -478,7 +474,7 @@ if the entry is new. */) | |||
| 478 | CHECK_NUMBER (blue); | 474 | CHECK_NUMBER (blue); |
| 479 | CHECK_STRING (name); | 475 | CHECK_STRING (name); |
| 480 | 476 | ||
| 481 | XSETINT (rgb, RGB(XUINT (red), XUINT (green), XUINT (blue))); | 477 | XSETINT (rgb, RGB (XUINT (red), XUINT (green), XUINT (blue))); |
| 482 | 478 | ||
| 483 | BLOCK_INPUT; | 479 | BLOCK_INPUT; |
| 484 | 480 | ||
| @@ -821,7 +817,7 @@ DEFUN ("w32-default-color-map", Fw32_default_color_map, Sw32_default_color_map, | |||
| 821 | return (cmap); | 817 | return (cmap); |
| 822 | } | 818 | } |
| 823 | 819 | ||
| 824 | Lisp_Object | 820 | static Lisp_Object |
| 825 | w32_to_x_color (rgb) | 821 | w32_to_x_color (rgb) |
| 826 | Lisp_Object rgb; | 822 | Lisp_Object rgb; |
| 827 | { | 823 | { |
| @@ -938,7 +934,7 @@ x_to_w32_color (colorname) | |||
| 938 | int size; | 934 | int size; |
| 939 | color = colorname + 1; | 935 | color = colorname + 1; |
| 940 | 936 | ||
| 941 | size = strlen(color); | 937 | size = strlen (color); |
| 942 | if (size == 3 || size == 6 || size == 9 || size == 12) | 938 | if (size == 3 || size == 6 || size == 9 || size == 12) |
| 943 | { | 939 | { |
| 944 | UINT colorval; | 940 | UINT colorval; |
| @@ -956,11 +952,11 @@ x_to_w32_color (colorname) | |||
| 956 | /* The check for 'x' in the following conditional takes into | 952 | /* The check for 'x' in the following conditional takes into |
| 957 | account the fact that strtol allows a "0x" in front of | 953 | account the fact that strtol allows a "0x" in front of |
| 958 | our numbers, and we don't. */ | 954 | our numbers, and we don't. */ |
| 959 | if (!isxdigit(color[0]) || color[1] == 'x') | 955 | if (!isxdigit (color[0]) || color[1] == 'x') |
| 960 | break; | 956 | break; |
| 961 | t = color[size]; | 957 | t = color[size]; |
| 962 | color[size] = '\0'; | 958 | color[size] = '\0'; |
| 963 | value = strtoul(color, &end, 16); | 959 | value = strtoul (color, &end, 16); |
| 964 | color[size] = t; | 960 | color[size] = t; |
| 965 | if (errno == ERANGE || end - color != size) | 961 | if (errno == ERANGE || end - color != size) |
| 966 | break; | 962 | break; |
| @@ -990,7 +986,7 @@ x_to_w32_color (colorname) | |||
| 990 | } | 986 | } |
| 991 | } | 987 | } |
| 992 | } | 988 | } |
| 993 | else if (strnicmp(colorname, "rgb:", 4) == 0) | 989 | else if (strnicmp (colorname, "rgb:", 4) == 0) |
| 994 | { | 990 | { |
| 995 | char *color; | 991 | char *color; |
| 996 | UINT colorval; | 992 | UINT colorval; |
| @@ -1007,9 +1003,9 @@ x_to_w32_color (colorname) | |||
| 1007 | /* The check for 'x' in the following conditional takes into | 1003 | /* The check for 'x' in the following conditional takes into |
| 1008 | account the fact that strtol allows a "0x" in front of | 1004 | account the fact that strtol allows a "0x" in front of |
| 1009 | our numbers, and we don't. */ | 1005 | our numbers, and we don't. */ |
| 1010 | if (!isxdigit(color[0]) || color[1] == 'x') | 1006 | if (!isxdigit (color[0]) || color[1] == 'x') |
| 1011 | break; | 1007 | break; |
| 1012 | value = strtoul(color, &end, 16); | 1008 | value = strtoul (color, &end, 16); |
| 1013 | if (errno == ERANGE) | 1009 | if (errno == ERANGE) |
| 1014 | break; | 1010 | break; |
| 1015 | switch (end - color) | 1011 | switch (end - color) |
| @@ -1045,7 +1041,7 @@ x_to_w32_color (colorname) | |||
| 1045 | color = end + 1; | 1041 | color = end + 1; |
| 1046 | } | 1042 | } |
| 1047 | } | 1043 | } |
| 1048 | else if (strnicmp(colorname, "rgbi:", 5) == 0) | 1044 | else if (strnicmp (colorname, "rgbi:", 5) == 0) |
| 1049 | { | 1045 | { |
| 1050 | /* This is an RGB Intensity specification. */ | 1046 | /* This is an RGB Intensity specification. */ |
| 1051 | char *color; | 1047 | char *color; |
| @@ -1061,7 +1057,7 @@ x_to_w32_color (colorname) | |||
| 1061 | double value; | 1057 | double value; |
| 1062 | UINT val; | 1058 | UINT val; |
| 1063 | 1059 | ||
| 1064 | value = strtod(color, &end); | 1060 | value = strtod (color, &end); |
| 1065 | if (errno == ERANGE) | 1061 | if (errno == ERANGE) |
| 1066 | break; | 1062 | break; |
| 1067 | if (value < 0.0 || value > 1.0) | 1063 | if (value < 0.0 || value > 1.0) |
| @@ -1559,7 +1555,6 @@ x_set_mouse_color (f, arg, oldval) | |||
| 1559 | #endif /* TODO */ | 1555 | #endif /* TODO */ |
| 1560 | } | 1556 | } |
| 1561 | 1557 | ||
| 1562 | /* Defined in w32term.c. */ | ||
| 1563 | void | 1558 | void |
| 1564 | x_set_cursor_color (f, arg, oldval) | 1559 | x_set_cursor_color (f, arg, oldval) |
| 1565 | struct frame *f; | 1560 | struct frame *f; |
| @@ -1911,7 +1906,7 @@ x_set_name (f, name, explicit) | |||
| 1911 | name = ENCODE_SYSTEM (name); | 1906 | name = ENCODE_SYSTEM (name); |
| 1912 | 1907 | ||
| 1913 | BLOCK_INPUT; | 1908 | BLOCK_INPUT; |
| 1914 | SetWindowText(FRAME_W32_WINDOW (f), SDATA (name)); | 1909 | SetWindowText (FRAME_W32_WINDOW (f), SDATA (name)); |
| 1915 | UNBLOCK_INPUT; | 1910 | UNBLOCK_INPUT; |
| 1916 | } | 1911 | } |
| 1917 | } | 1912 | } |
| @@ -1963,7 +1958,7 @@ x_set_title (f, name, old_name) | |||
| 1963 | name = ENCODE_SYSTEM (name); | 1958 | name = ENCODE_SYSTEM (name); |
| 1964 | 1959 | ||
| 1965 | BLOCK_INPUT; | 1960 | BLOCK_INPUT; |
| 1966 | SetWindowText(FRAME_W32_WINDOW (f), SDATA (name)); | 1961 | SetWindowText (FRAME_W32_WINDOW (f), SDATA (name)); |
| 1967 | UNBLOCK_INPUT; | 1962 | UNBLOCK_INPUT; |
| 1968 | } | 1963 | } |
| 1969 | } | 1964 | } |
| @@ -2010,7 +2005,7 @@ Cursor | |||
| 2010 | w32_load_cursor (LPCTSTR name) | 2005 | w32_load_cursor (LPCTSTR name) |
| 2011 | { | 2006 | { |
| 2012 | /* Try first to load cursor from application resource. */ | 2007 | /* Try first to load cursor from application resource. */ |
| 2013 | Cursor cursor = LoadImage ((HINSTANCE) GetModuleHandle(NULL), | 2008 | Cursor cursor = LoadImage ((HINSTANCE) GetModuleHandle (NULL), |
| 2014 | name, IMAGE_CURSOR, 0, 0, | 2009 | name, IMAGE_CURSOR, 0, 0, |
| 2015 | LR_DEFAULTCOLOR | LR_DEFAULTSIZE | LR_SHARED); | 2010 | LR_DEFAULTCOLOR | LR_DEFAULTSIZE | LR_SHARED); |
| 2016 | if (!cursor) | 2011 | if (!cursor) |
| @@ -2024,7 +2019,7 @@ w32_load_cursor (LPCTSTR name) | |||
| 2024 | 2019 | ||
| 2025 | extern LRESULT CALLBACK w32_wnd_proc (); | 2020 | extern LRESULT CALLBACK w32_wnd_proc (); |
| 2026 | 2021 | ||
| 2027 | BOOL | 2022 | static BOOL |
| 2028 | w32_init_class (hinst) | 2023 | w32_init_class (hinst) |
| 2029 | HINSTANCE hinst; | 2024 | HINSTANCE hinst; |
| 2030 | { | 2025 | { |
| @@ -2044,24 +2039,24 @@ w32_init_class (hinst) | |||
| 2044 | return (RegisterClass (&wc)); | 2039 | return (RegisterClass (&wc)); |
| 2045 | } | 2040 | } |
| 2046 | 2041 | ||
| 2047 | HWND | 2042 | static HWND |
| 2048 | w32_createscrollbar (f, bar) | 2043 | w32_createscrollbar (f, bar) |
| 2049 | struct frame *f; | 2044 | struct frame *f; |
| 2050 | struct scroll_bar * bar; | 2045 | struct scroll_bar * bar; |
| 2051 | { | 2046 | { |
| 2052 | return (CreateWindow ("SCROLLBAR", "", SBS_VERT | WS_CHILD | WS_VISIBLE, | 2047 | return (CreateWindow ("SCROLLBAR", "", SBS_VERT | WS_CHILD | WS_VISIBLE, |
| 2053 | /* Position and size of scroll bar. */ | 2048 | /* Position and size of scroll bar. */ |
| 2054 | XINT(bar->left) + VERTICAL_SCROLL_BAR_WIDTH_TRIM, | 2049 | XINT (bar->left) + VERTICAL_SCROLL_BAR_WIDTH_TRIM, |
| 2055 | XINT(bar->top), | 2050 | XINT (bar->top), |
| 2056 | XINT(bar->width) - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, | 2051 | XINT (bar->width) - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, |
| 2057 | XINT(bar->height), | 2052 | XINT (bar->height), |
| 2058 | FRAME_W32_WINDOW (f), | 2053 | FRAME_W32_WINDOW (f), |
| 2059 | NULL, | 2054 | NULL, |
| 2060 | hinst, | 2055 | hinst, |
| 2061 | NULL)); | 2056 | NULL)); |
| 2062 | } | 2057 | } |
| 2063 | 2058 | ||
| 2064 | void | 2059 | static void |
| 2065 | w32_createwindow (f) | 2060 | w32_createwindow (f) |
| 2066 | struct frame *f; | 2061 | struct frame *f; |
| 2067 | { | 2062 | { |
| @@ -2131,7 +2126,7 @@ w32_createwindow (f) | |||
| 2131 | } | 2126 | } |
| 2132 | } | 2127 | } |
| 2133 | 2128 | ||
| 2134 | void | 2129 | static void |
| 2135 | my_post_msg (wmsg, hwnd, msg, wParam, lParam) | 2130 | my_post_msg (wmsg, hwnd, msg, wParam, lParam) |
| 2136 | W32Msg * wmsg; | 2131 | W32Msg * wmsg; |
| 2137 | HWND hwnd; | 2132 | HWND hwnd; |
| @@ -2363,7 +2358,7 @@ w32_key_to_modifier (int key) | |||
| 2363 | return 0; | 2358 | return 0; |
| 2364 | } | 2359 | } |
| 2365 | 2360 | ||
| 2366 | unsigned int | 2361 | static unsigned int |
| 2367 | w32_get_modifiers () | 2362 | w32_get_modifiers () |
| 2368 | { | 2363 | { |
| 2369 | return ((modifier_set (VK_SHIFT) ? shift_modifier : 0) | | 2364 | return ((modifier_set (VK_SHIFT) ? shift_modifier : 0) | |
| @@ -2434,12 +2429,12 @@ map_keypad_keys (unsigned int virt_key, unsigned int extended) | |||
| 2434 | } | 2429 | } |
| 2435 | 2430 | ||
| 2436 | /* List of special key combinations which w32 would normally capture, | 2431 | /* List of special key combinations which w32 would normally capture, |
| 2437 | but emacs should grab instead. Not directly visible to lisp, to | 2432 | but Emacs should grab instead. Not directly visible to lisp, to |
| 2438 | simplify synchronization. Each item is an integer encoding a virtual | 2433 | simplify synchronization. Each item is an integer encoding a virtual |
| 2439 | key code and modifier combination to capture. */ | 2434 | key code and modifier combination to capture. */ |
| 2440 | Lisp_Object w32_grabbed_keys; | 2435 | static Lisp_Object w32_grabbed_keys; |
| 2441 | 2436 | ||
| 2442 | #define HOTKEY(vk,mods) make_number (((vk) & 255) | ((mods) << 8)) | 2437 | #define HOTKEY(vk, mods) make_number (((vk) & 255) | ((mods) << 8)) |
| 2443 | #define HOTKEY_ID(k) (XFASTINT (k) & 0xbfff) | 2438 | #define HOTKEY_ID(k) (XFASTINT (k) & 0xbfff) |
| 2444 | #define HOTKEY_VK_CODE(k) (XFASTINT (k) & 255) | 2439 | #define HOTKEY_VK_CODE(k) (XFASTINT (k) & 255) |
| 2445 | #define HOTKEY_MODIFIERS(k) (XFASTINT (k) >> 8) | 2440 | #define HOTKEY_MODIFIERS(k) (XFASTINT (k) >> 8) |
| @@ -2666,7 +2661,7 @@ complete_deferred_msg (HWND hwnd, UINT msg, LRESULT result) | |||
| 2666 | deferred_msg * msg_buf = find_deferred_msg (hwnd, msg); | 2661 | deferred_msg * msg_buf = find_deferred_msg (hwnd, msg); |
| 2667 | 2662 | ||
| 2668 | if (msg_buf == NULL) | 2663 | if (msg_buf == NULL) |
| 2669 | /* Message may have been cancelled, so don't abort(). */ | 2664 | /* Message may have been cancelled, so don't abort. */ |
| 2670 | return; | 2665 | return; |
| 2671 | 2666 | ||
| 2672 | msg_buf->result = result; | 2667 | msg_buf->result = result; |
| @@ -2676,7 +2671,7 @@ complete_deferred_msg (HWND hwnd, UINT msg, LRESULT result) | |||
| 2676 | PostThreadMessage (dwWindowsThreadId, WM_NULL, 0, 0); | 2671 | PostThreadMessage (dwWindowsThreadId, WM_NULL, 0, 0); |
| 2677 | } | 2672 | } |
| 2678 | 2673 | ||
| 2679 | void | 2674 | static void |
| 2680 | cancel_all_deferred_msgs () | 2675 | cancel_all_deferred_msgs () |
| 2681 | { | 2676 | { |
| 2682 | deferred_msg * item; | 2677 | deferred_msg * item; |
| @@ -2754,7 +2749,7 @@ post_character_message (hwnd, msg, wParam, lParam, modifiers) | |||
| 2754 | 2749 | ||
| 2755 | /* Detect quit_char and set quit-flag directly. Note that we | 2750 | /* Detect quit_char and set quit-flag directly. Note that we |
| 2756 | still need to post a message to ensure the main thread will be | 2751 | still need to post a message to ensure the main thread will be |
| 2757 | woken up if blocked in sys_select(), but we do NOT want to post | 2752 | woken up if blocked in sys_select, but we do NOT want to post |
| 2758 | the quit_char message itself (because it will usually be as if | 2753 | the quit_char message itself (because it will usually be as if |
| 2759 | the user had typed quit_char twice). Instead, we post a dummy | 2754 | the user had typed quit_char twice). Instead, we post a dummy |
| 2760 | message that has no particular effect. */ | 2755 | message that has no particular effect. */ |
| @@ -2909,7 +2904,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) | |||
| 2909 | 2904 | ||
| 2910 | /* If GetUpdateRect returns 0 (meaning there is no update | 2905 | /* If GetUpdateRect returns 0 (meaning there is no update |
| 2911 | region), assume the whole window needs to be repainted. */ | 2906 | region), assume the whole window needs to be repainted. */ |
| 2912 | GetClientRect(hwnd, &wmsg.rect); | 2907 | GetClientRect (hwnd, &wmsg.rect); |
| 2913 | my_post_msg (&wmsg, hwnd, msg, wParam, lParam); | 2908 | my_post_msg (&wmsg, hwnd, msg, wParam, lParam); |
| 2914 | return 0; | 2909 | return 0; |
| 2915 | } | 2910 | } |
| @@ -3703,7 +3698,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) | |||
| 3703 | DWORD scrollbar_extra; | 3698 | DWORD scrollbar_extra; |
| 3704 | RECT wr; | 3699 | RECT wr; |
| 3705 | 3700 | ||
| 3706 | wp.length = sizeof(wp); | 3701 | wp.length = sizeof (wp); |
| 3707 | GetWindowRect (hwnd, &wr); | 3702 | GetWindowRect (hwnd, &wr); |
| 3708 | 3703 | ||
| 3709 | enter_crit (); | 3704 | enter_crit (); |
| @@ -4498,11 +4493,12 @@ DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0, | |||
| 4498 | 4493 | ||
| 4499 | 4494 | ||
| 4500 | /* Return the charset portion of a font name. */ | 4495 | /* Return the charset portion of a font name. */ |
| 4501 | char * xlfd_charset_of_font (char * fontname) | 4496 | char * |
| 4497 | xlfd_charset_of_font (char * fontname) | ||
| 4502 | { | 4498 | { |
| 4503 | char *charset, *encoding; | 4499 | char *charset, *encoding; |
| 4504 | 4500 | ||
| 4505 | encoding = strrchr(fontname, '-'); | 4501 | encoding = strrchr (fontname, '-'); |
| 4506 | if (!encoding || encoding == fontname) | 4502 | if (!encoding || encoding == fontname) |
| 4507 | return NULL; | 4503 | return NULL; |
| 4508 | 4504 | ||
| @@ -4510,7 +4506,7 @@ char * xlfd_charset_of_font (char * fontname) | |||
| 4510 | if (*charset == '-') | 4506 | if (*charset == '-') |
| 4511 | break; | 4507 | break; |
| 4512 | 4508 | ||
| 4513 | if (charset == fontname || strcmp(charset, "-*-*") == 0) | 4509 | if (charset == fontname || strcmp (charset, "-*-*") == 0) |
| 4514 | return NULL; | 4510 | return NULL; |
| 4515 | 4511 | ||
| 4516 | return charset + 1; | 4512 | return charset + 1; |
| @@ -4524,7 +4520,7 @@ static BOOL w32_to_x_font (LOGFONT * lplf, char * lpxstr, int len, | |||
| 4524 | static BOOL x_to_w32_font (char *lpxstr, LOGFONT *lplogfont); | 4520 | static BOOL x_to_w32_font (char *lpxstr, LOGFONT *lplogfont); |
| 4525 | 4521 | ||
| 4526 | static struct font_info * | 4522 | static struct font_info * |
| 4527 | w32_load_system_font (f,fontname,size) | 4523 | w32_load_system_font (f, fontname, size) |
| 4528 | struct frame *f; | 4524 | struct frame *f; |
| 4529 | char * fontname; | 4525 | char * fontname; |
| 4530 | int size; | 4526 | int size; |
| @@ -4627,7 +4623,7 @@ w32_load_system_font (f,fontname,size) | |||
| 4627 | GetFontLanguageInfo, we check the properties of the | 4623 | GetFontLanguageInfo, we check the properties of the |
| 4628 | codepage directly, since that is ultimately what we are | 4624 | codepage directly, since that is ultimately what we are |
| 4629 | working from anyway. */ | 4625 | working from anyway. */ |
| 4630 | /* font->double_byte_p = GetFontLanguageInfo(hdc) & GCP_DBCS; */ | 4626 | /* font->double_byte_p = GetFontLanguageInfo (hdc) & GCP_DBCS; */ |
| 4631 | CPINFO cpi = {0}; | 4627 | CPINFO cpi = {0}; |
| 4632 | GetCPInfo (codepage, &cpi); | 4628 | GetCPInfo (codepage, &cpi); |
| 4633 | font->double_byte_p = cpi.MaxCharSize > 1; | 4629 | font->double_byte_p = cpi.MaxCharSize > 1; |
| @@ -4763,10 +4759,10 @@ w32_load_system_font (f,fontname,size) | |||
| 4763 | pointer to the structure font_info while allocating it dynamically. | 4759 | pointer to the structure font_info while allocating it dynamically. |
| 4764 | If loading fails, return NULL. */ | 4760 | If loading fails, return NULL. */ |
| 4765 | struct font_info * | 4761 | struct font_info * |
| 4766 | w32_load_font (f,fontname,size) | 4762 | w32_load_font (f, fontname, size) |
| 4767 | struct frame *f; | 4763 | struct frame *f; |
| 4768 | char * fontname; | 4764 | char * fontname; |
| 4769 | int size; | 4765 | int size; |
| 4770 | { | 4766 | { |
| 4771 | Lisp_Object bdf_fonts; | 4767 | Lisp_Object bdf_fonts; |
| 4772 | struct font_info *retval = NULL; | 4768 | struct font_info *retval = NULL; |
| @@ -4802,7 +4798,7 @@ int size; | |||
| 4802 | if (retval) | 4798 | if (retval) |
| 4803 | return retval; | 4799 | return retval; |
| 4804 | 4800 | ||
| 4805 | return w32_load_system_font(f, fontname, size); | 4801 | return w32_load_system_font (f, fontname, size); |
| 4806 | } | 4802 | } |
| 4807 | 4803 | ||
| 4808 | 4804 | ||
| @@ -4816,7 +4812,7 @@ w32_unload_font (dpyinfo, font) | |||
| 4816 | if (font->per_char) xfree (font->per_char); | 4812 | if (font->per_char) xfree (font->per_char); |
| 4817 | if (font->bdf) w32_free_bdf_font (font->bdf); | 4813 | if (font->bdf) w32_free_bdf_font (font->bdf); |
| 4818 | 4814 | ||
| 4819 | if (font->hfont) DeleteObject(font->hfont); | 4815 | if (font->hfont) DeleteObject (font->hfont); |
| 4820 | xfree (font); | 4816 | xfree (font); |
| 4821 | } | 4817 | } |
| 4822 | } | 4818 | } |
| @@ -4850,16 +4846,16 @@ x_to_w32_weight (lpw) | |||
| 4850 | { | 4846 | { |
| 4851 | if (!lpw) return (FW_DONTCARE); | 4847 | if (!lpw) return (FW_DONTCARE); |
| 4852 | 4848 | ||
| 4853 | if (stricmp (lpw,"heavy") == 0) return FW_HEAVY; | 4849 | if (stricmp (lpw, "heavy") == 0) return FW_HEAVY; |
| 4854 | else if (stricmp (lpw,"extrabold") == 0) return FW_EXTRABOLD; | 4850 | else if (stricmp (lpw, "extrabold") == 0) return FW_EXTRABOLD; |
| 4855 | else if (stricmp (lpw,"bold") == 0) return FW_BOLD; | 4851 | else if (stricmp (lpw, "bold") == 0) return FW_BOLD; |
| 4856 | else if (stricmp (lpw,"demibold") == 0) return FW_SEMIBOLD; | 4852 | else if (stricmp (lpw, "demibold") == 0) return FW_SEMIBOLD; |
| 4857 | else if (stricmp (lpw,"semibold") == 0) return FW_SEMIBOLD; | 4853 | else if (stricmp (lpw, "semibold") == 0) return FW_SEMIBOLD; |
| 4858 | else if (stricmp (lpw,"medium") == 0) return FW_MEDIUM; | 4854 | else if (stricmp (lpw, "medium") == 0) return FW_MEDIUM; |
| 4859 | else if (stricmp (lpw,"normal") == 0) return FW_NORMAL; | 4855 | else if (stricmp (lpw, "normal") == 0) return FW_NORMAL; |
| 4860 | else if (stricmp (lpw,"light") == 0) return FW_LIGHT; | 4856 | else if (stricmp (lpw, "light") == 0) return FW_LIGHT; |
| 4861 | else if (stricmp (lpw,"extralight") == 0) return FW_EXTRALIGHT; | 4857 | else if (stricmp (lpw, "extralight") == 0) return FW_EXTRALIGHT; |
| 4862 | else if (stricmp (lpw,"thin") == 0) return FW_THIN; | 4858 | else if (stricmp (lpw, "thin") == 0) return FW_THIN; |
| 4863 | else | 4859 | else |
| 4864 | return FW_DONTCARE; | 4860 | return FW_DONTCARE; |
| 4865 | } | 4861 | } |
| @@ -4905,12 +4901,12 @@ x_to_w32_charset (lpcs) | |||
| 4905 | Format of each entry is | 4901 | Format of each entry is |
| 4906 | (CHARSET_NAME . (WINDOWS_CHARSET . CODEPAGE)). | 4902 | (CHARSET_NAME . (WINDOWS_CHARSET . CODEPAGE)). |
| 4907 | */ | 4903 | */ |
| 4908 | this_entry = Fassoc (build_string(charset), Vw32_charset_info_alist); | 4904 | this_entry = Fassoc (build_string (charset), Vw32_charset_info_alist); |
| 4909 | 4905 | ||
| 4910 | if (NILP(this_entry)) | 4906 | if (NILP (this_entry)) |
| 4911 | { | 4907 | { |
| 4912 | /* At startup, we want iso8859-1 fonts to come up properly. */ | 4908 | /* At startup, we want iso8859-1 fonts to come up properly. */ |
| 4913 | if (stricmp(charset, "iso8859-1") == 0) | 4909 | if (stricmp (charset, "iso8859-1") == 0) |
| 4914 | return ANSI_CHARSET; | 4910 | return ANSI_CHARSET; |
| 4915 | else | 4911 | else |
| 4916 | return DEFAULT_CHARSET; | 4912 | return DEFAULT_CHARSET; |
| @@ -4978,7 +4974,7 @@ w32_to_x_charset (fncharset) | |||
| 4978 | case ANSI_CHARSET: | 4974 | case ANSI_CHARSET: |
| 4979 | /* Handle startup case of w32-charset-info-alist not | 4975 | /* Handle startup case of w32-charset-info-alist not |
| 4980 | being set up yet. */ | 4976 | being set up yet. */ |
| 4981 | if (NILP(Vw32_charset_info_alist)) | 4977 | if (NILP (Vw32_charset_info_alist)) |
| 4982 | return "iso8859-1"; | 4978 | return "iso8859-1"; |
| 4983 | charset_type = Qw32_charset_ansi; | 4979 | charset_type = Qw32_charset_ansi; |
| 4984 | break; | 4980 | break; |
| @@ -5117,7 +5113,7 @@ w32_to_x_charset (fncharset) | |||
| 5117 | return buf; | 5113 | return buf; |
| 5118 | } | 5114 | } |
| 5119 | 5115 | ||
| 5120 | strncpy(buf, best_match, 31); | 5116 | strncpy (buf, best_match, 31); |
| 5121 | buf[31] = '\0'; | 5117 | buf[31] = '\0'; |
| 5122 | return buf; | 5118 | return buf; |
| 5123 | } | 5119 | } |
| @@ -5138,7 +5134,7 @@ w32_to_all_x_charsets (fncharset) | |||
| 5138 | case ANSI_CHARSET: | 5134 | case ANSI_CHARSET: |
| 5139 | /* Handle startup case of w32-charset-info-alist not | 5135 | /* Handle startup case of w32-charset-info-alist not |
| 5140 | being set up yet. */ | 5136 | being set up yet. */ |
| 5141 | if (NILP(Vw32_charset_info_alist)) | 5137 | if (NILP (Vw32_charset_info_alist)) |
| 5142 | return Fcons (build_string ("iso8859-1"), Qnil); | 5138 | return Fcons (build_string ("iso8859-1"), Qnil); |
| 5143 | 5139 | ||
| 5144 | charset_type = Qw32_charset_ansi; | 5140 | charset_type = Qw32_charset_ansi; |
| @@ -5298,7 +5294,7 @@ w32_codepage_for_font (char *fontname) | |||
| 5298 | *end = '\0'; | 5294 | *end = '\0'; |
| 5299 | } | 5295 | } |
| 5300 | 5296 | ||
| 5301 | entry = Fassoc (build_string(charset), Vw32_charset_info_alist); | 5297 | entry = Fassoc (build_string (charset), Vw32_charset_info_alist); |
| 5302 | if (NILP (entry)) | 5298 | if (NILP (entry)) |
| 5303 | return CP_UNKNOWN; | 5299 | return CP_UNKNOWN; |
| 5304 | 5300 | ||
| @@ -5355,9 +5351,9 @@ w32_to_x_font (lplogfont, lpxstr, len, specific_charset) | |||
| 5355 | coding.composing = COMPOSITION_DISABLED; | 5351 | coding.composing = COMPOSITION_DISABLED; |
| 5356 | bufsz = decoding_buffer_size (&coding, LF_FACESIZE); | 5352 | bufsz = decoding_buffer_size (&coding, LF_FACESIZE); |
| 5357 | 5353 | ||
| 5358 | fontname = alloca(sizeof(*fontname) * bufsz); | 5354 | fontname = alloca (sizeof (*fontname) * bufsz); |
| 5359 | decode_coding (&coding, lplogfont->lfFaceName, fontname, | 5355 | decode_coding (&coding, lplogfont->lfFaceName, fontname, |
| 5360 | strlen(lplogfont->lfFaceName), bufsz - 1); | 5356 | strlen (lplogfont->lfFaceName), bufsz - 1); |
| 5361 | *(fontname + coding.produced) = '\0'; | 5357 | *(fontname + coding.produced) = '\0'; |
| 5362 | 5358 | ||
| 5363 | /* Replace dashes with underscores so the dashes are not | 5359 | /* Replace dashes with underscores so the dashes are not |
| @@ -5568,7 +5564,7 @@ x_to_w32_font (lpxstr, lplogfont) | |||
| 5568 | 5564 | ||
| 5569 | if (fields > 0) | 5565 | if (fields > 0) |
| 5570 | { | 5566 | { |
| 5571 | strncpy (lplogfont->lfFaceName,name, LF_FACESIZE); | 5567 | strncpy (lplogfont->lfFaceName, name, LF_FACESIZE); |
| 5572 | lplogfont->lfFaceName[LF_FACESIZE-1] = 0; | 5568 | lplogfont->lfFaceName[LF_FACESIZE-1] = 0; |
| 5573 | } | 5569 | } |
| 5574 | else | 5570 | else |
| @@ -5767,7 +5763,7 @@ w32_font_match (fontname, pattern) | |||
| 5767 | } | 5763 | } |
| 5768 | 5764 | ||
| 5769 | return (fast_string_match_ignore_case (build_string (regex), | 5765 | return (fast_string_match_ignore_case (build_string (regex), |
| 5770 | build_string(font_name_copy)) >= 0); | 5766 | build_string (font_name_copy)) >= 0); |
| 5771 | } | 5767 | } |
| 5772 | 5768 | ||
| 5773 | /* Callback functions, and a structure holding info they need, for | 5769 | /* Callback functions, and a structure holding info they need, for |
| @@ -6002,7 +5998,8 @@ enum_fontex_cb1 (lplf, lptm, font_type, lpef) | |||
| 6002 | /* Interface to fontset handler. (adapted from mw32font.c in Meadow | 5998 | /* Interface to fontset handler. (adapted from mw32font.c in Meadow |
| 6003 | and xterm.c in Emacs 20.3) */ | 5999 | and xterm.c in Emacs 20.3) */ |
| 6004 | 6000 | ||
| 6005 | static Lisp_Object w32_list_bdf_fonts (Lisp_Object pattern, int max_names) | 6001 | static Lisp_Object |
| 6002 | w32_list_bdf_fonts (Lisp_Object pattern, int max_names) | ||
| 6006 | { | 6003 | { |
| 6007 | char *fontname, *ptnstr; | 6004 | char *fontname, *ptnstr; |
| 6008 | Lisp_Object list, tem, newlist = Qnil; | 6005 | Lisp_Object list, tem, newlist = Qnil; |
| @@ -6073,7 +6070,7 @@ w32_list_fonts (f, pattern, size, maxnames) | |||
| 6073 | codepage = w32_codepage_for_font (SDATA (tpat)); | 6070 | codepage = w32_codepage_for_font (SDATA (tpat)); |
| 6074 | if (codepage != CP_8BIT && codepage != CP_UNICODE | 6071 | if (codepage != CP_8BIT && codepage != CP_UNICODE |
| 6075 | && codepage != CP_DEFAULT && codepage != CP_UNKNOWN | 6072 | && codepage != CP_DEFAULT && codepage != CP_UNKNOWN |
| 6076 | && !IsValidCodePage(codepage)) | 6073 | && !IsValidCodePage (codepage)) |
| 6077 | continue; | 6074 | continue; |
| 6078 | 6075 | ||
| 6079 | /* See if we cached the result for this particular query. | 6076 | /* See if we cached the result for this particular query. |
| @@ -6184,7 +6181,7 @@ w32_list_fonts (f, pattern, size, maxnames) | |||
| 6184 | XSETCDR (tem, make_number (0)); | 6181 | XSETCDR (tem, make_number (0)); |
| 6185 | SelectObject (hdc, oldobj); | 6182 | SelectObject (hdc, oldobj); |
| 6186 | ReleaseDC (dpyinfo->root_window, hdc); | 6183 | ReleaseDC (dpyinfo->root_window, hdc); |
| 6187 | DeleteObject(thisinfo.hfont); | 6184 | DeleteObject (thisinfo.hfont); |
| 6188 | UNBLOCK_INPUT; | 6185 | UNBLOCK_INPUT; |
| 6189 | } | 6186 | } |
| 6190 | found_size = XINT (XCDR (tem)); | 6187 | found_size = XINT (XCDR (tem)); |
| @@ -6233,7 +6230,7 @@ w32_list_fonts (f, pattern, size, maxnames) | |||
| 6233 | Lisp_Object combined[2]; | 6230 | Lisp_Object combined[2]; |
| 6234 | combined[0] = w32_list_bdf_fonts (pattern, maxnames - n_fonts); | 6231 | combined[0] = w32_list_bdf_fonts (pattern, maxnames - n_fonts); |
| 6235 | combined[1] = newlist; | 6232 | combined[1] = newlist; |
| 6236 | newlist = Fnconc(2, combined); | 6233 | newlist = Fnconc (2, combined); |
| 6237 | } | 6234 | } |
| 6238 | 6235 | ||
| 6239 | return newlist; | 6236 | return newlist; |
| @@ -6260,7 +6257,7 @@ w32_query_font (struct frame *f, char *fontname) | |||
| 6260 | 6257 | ||
| 6261 | for (i = 0; i < one_w32_display_info.n_fonts ;i++, pfi++) | 6258 | for (i = 0; i < one_w32_display_info.n_fonts ;i++, pfi++) |
| 6262 | { | 6259 | { |
| 6263 | if (stricmp(pfi->name, fontname) == 0) return pfi; | 6260 | if (stricmp (pfi->name, fontname) == 0) return pfi; |
| 6264 | } | 6261 | } |
| 6265 | 6262 | ||
| 6266 | return NULL; | 6263 | return NULL; |
| @@ -6297,7 +6294,7 @@ w32_find_ccl_program (fontp) | |||
| 6297 | } | 6294 | } |
| 6298 | 6295 | ||
| 6299 | /* directory-files from dired.c. */ | 6296 | /* directory-files from dired.c. */ |
| 6300 | Lisp_Object Fdirectory_files P_((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object)); | 6297 | Lisp_Object Fdirectory_files P_ ((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object)); |
| 6301 | 6298 | ||
| 6302 | 6299 | ||
| 6303 | /* Find BDF files in a specified directory. (use GCPRO when calling, | 6300 | /* Find BDF files in a specified directory. (use GCPRO when calling, |
| @@ -6308,13 +6305,13 @@ w32_find_bdf_fonts_in_dir (Lisp_Object directory) | |||
| 6308 | Lisp_Object filelist, list = Qnil; | 6305 | Lisp_Object filelist, list = Qnil; |
| 6309 | char fontname[100]; | 6306 | char fontname[100]; |
| 6310 | 6307 | ||
| 6311 | if (!STRINGP(directory)) | 6308 | if (!STRINGP (directory)) |
| 6312 | return Qnil; | 6309 | return Qnil; |
| 6313 | 6310 | ||
| 6314 | filelist = Fdirectory_files (directory, Qt, | 6311 | filelist = Fdirectory_files (directory, Qt, |
| 6315 | build_string (".*\\.[bB][dD][fF]"), Qt); | 6312 | build_string (".*\\.[bB][dD][fF]"), Qt); |
| 6316 | 6313 | ||
| 6317 | for ( ; CONSP(filelist); filelist = XCDR (filelist)) | 6314 | for ( ; CONSP (filelist); filelist = XCDR (filelist)) |
| 6318 | { | 6315 | { |
| 6319 | Lisp_Object filename = XCAR (filelist); | 6316 | Lisp_Object filename = XCAR (filelist); |
| 6320 | if (w32_BDF_to_x_font (SDATA (filename), fontname, 100)) | 6317 | if (w32_BDF_to_x_font (SDATA (filename), fontname, 100)) |
| @@ -6344,8 +6341,8 @@ in the list. DIRECTORY may be a list of directories. */) | |||
| 6344 | pair[0] = list; | 6341 | pair[0] = list; |
| 6345 | pair[1] = Qnil; | 6342 | pair[1] = Qnil; |
| 6346 | GCPRO2 (directory, list); | 6343 | GCPRO2 (directory, list); |
| 6347 | pair[1] = w32_find_bdf_fonts_in_dir( XCAR (directory) ); | 6344 | pair[1] = w32_find_bdf_fonts_in_dir ( XCAR (directory) ); |
| 6348 | list = Fnconc( 2, pair ); | 6345 | list = Fnconc ( 2, pair ); |
| 6349 | UNGCPRO; | 6346 | UNGCPRO; |
| 6350 | } | 6347 | } |
| 6351 | return list; | 6348 | return list; |
| @@ -6484,7 +6481,7 @@ If omitted or nil, that stands for the selected frame's display. */) | |||
| 6484 | /* We force 24+ bit depths to 24-bit, both to prevent an overflow | 6481 | /* We force 24+ bit depths to 24-bit, both to prevent an overflow |
| 6485 | and because probably is more meaningful on Windows anyway */ | 6482 | and because probably is more meaningful on Windows anyway */ |
| 6486 | if (cap < 0) | 6483 | if (cap < 0) |
| 6487 | cap = 1 << min(dpyinfo->n_planes * dpyinfo->n_cbits, 24); | 6484 | cap = 1 << min (dpyinfo->n_planes * dpyinfo->n_cbits, 24); |
| 6488 | 6485 | ||
| 6489 | ReleaseDC (dpyinfo->root_window, hdc); | 6486 | ReleaseDC (dpyinfo->root_window, hdc); |
| 6490 | 6487 | ||
| @@ -6747,7 +6744,7 @@ terminate Emacs if we can't open the connection. */) | |||
| 6747 | Lisp_Object color_file; | 6744 | Lisp_Object color_file; |
| 6748 | struct gcpro gcpro1; | 6745 | struct gcpro gcpro1; |
| 6749 | 6746 | ||
| 6750 | color_file = build_string("~/rgb.txt"); | 6747 | color_file = build_string ("~/rgb.txt"); |
| 6751 | 6748 | ||
| 6752 | GCPRO1 (color_file); | 6749 | GCPRO1 (color_file); |
| 6753 | 6750 | ||
| @@ -7985,7 +7982,7 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */) | |||
| 7985 | *last = '\0'; | 7982 | *last = '\0'; |
| 7986 | } | 7983 | } |
| 7987 | 7984 | ||
| 7988 | file = DECODE_FILE(build_string (filename)); | 7985 | file = DECODE_FILE (build_string (filename)); |
| 7989 | } | 7986 | } |
| 7990 | /* User cancelled the dialog without making a selection. */ | 7987 | /* User cancelled the dialog without making a selection. */ |
| 7991 | else if (!CommDlgExtendedError ()) | 7988 | else if (!CommDlgExtendedError ()) |
| @@ -8311,7 +8308,6 @@ DEFUN ("w32-unregister-hot-key", Fw32_unregister_hot_key, | |||
| 8311 | #else | 8308 | #else |
| 8312 | if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_UNREGISTER_HOT_KEY, | 8309 | if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_UNREGISTER_HOT_KEY, |
| 8313 | (WPARAM) XINT (XCAR (item)), (LPARAM) item)) | 8310 | (WPARAM) XINT (XCAR (item)), (LPARAM) item)) |
| 8314 | |||
| 8315 | #endif | 8311 | #endif |
| 8316 | { | 8312 | { |
| 8317 | MSG msg; | 8313 | MSG msg; |
| @@ -8327,7 +8323,7 @@ DEFUN ("w32-registered-hot-keys", Fw32_registered_hot_keys, | |||
| 8327 | doc: /* Return list of registered hot-key IDs. */) | 8323 | doc: /* Return list of registered hot-key IDs. */) |
| 8328 | () | 8324 | () |
| 8329 | { | 8325 | { |
| 8330 | return Fcopy_sequence (w32_grabbed_keys); | 8326 | return Fdelq (Qnil, Fcopy_sequence (w32_grabbed_keys)); |
| 8331 | } | 8327 | } |
| 8332 | 8328 | ||
| 8333 | DEFUN ("w32-reconstruct-hot-key", Fw32_reconstruct_hot_key, | 8329 | DEFUN ("w32-reconstruct-hot-key", Fw32_reconstruct_hot_key, |
| @@ -8490,10 +8486,10 @@ If the underlying system call fails, value is nil. */) | |||
| 8490 | LARGE_INTEGER freebytes; | 8486 | LARGE_INTEGER freebytes; |
| 8491 | LARGE_INTEGER totalbytes; | 8487 | LARGE_INTEGER totalbytes; |
| 8492 | 8488 | ||
| 8493 | if (pfn_GetDiskFreeSpaceEx(rootname, | 8489 | if (pfn_GetDiskFreeSpaceEx (rootname, |
| 8494 | (ULARGE_INTEGER *)&availbytes, | 8490 | (ULARGE_INTEGER *)&availbytes, |
| 8495 | (ULARGE_INTEGER *)&totalbytes, | 8491 | (ULARGE_INTEGER *)&totalbytes, |
| 8496 | (ULARGE_INTEGER *)&freebytes)) | 8492 | (ULARGE_INTEGER *)&freebytes)) |
| 8497 | value = list3 (make_float ((double) totalbytes.QuadPart), | 8493 | value = list3 (make_float ((double) totalbytes.QuadPart), |
| 8498 | make_float ((double) freebytes.QuadPart), | 8494 | make_float ((double) freebytes.QuadPart), |
| 8499 | make_float ((double) availbytes.QuadPart)); | 8495 | make_float ((double) availbytes.QuadPart)); |
| @@ -8505,11 +8501,11 @@ If the underlying system call fails, value is nil. */) | |||
| 8505 | DWORD free_clusters; | 8501 | DWORD free_clusters; |
| 8506 | DWORD total_clusters; | 8502 | DWORD total_clusters; |
| 8507 | 8503 | ||
| 8508 | if (GetDiskFreeSpace(rootname, | 8504 | if (GetDiskFreeSpace (rootname, |
| 8509 | §ors_per_cluster, | 8505 | §ors_per_cluster, |
| 8510 | &bytes_per_sector, | 8506 | &bytes_per_sector, |
| 8511 | &free_clusters, | 8507 | &free_clusters, |
| 8512 | &total_clusters)) | 8508 | &total_clusters)) |
| 8513 | value = list3 (make_float ((double) total_clusters | 8509 | value = list3 (make_float ((double) total_clusters |
| 8514 | * sectors_per_cluster * bytes_per_sector), | 8510 | * sectors_per_cluster * bytes_per_sector), |
| 8515 | make_float ((double) free_clusters | 8511 | make_float ((double) free_clusters |
| @@ -8555,12 +8551,12 @@ DEFUN ("default-printer-name", Fdefault_printer_name, Sdefault_printer_name, | |||
| 8555 | ClosePrinter (hPrn); | 8551 | ClosePrinter (hPrn); |
| 8556 | return Qnil; | 8552 | return Qnil; |
| 8557 | } | 8553 | } |
| 8558 | /* Call GetPrinter() again with big enouth memory block */ | 8554 | /* Call GetPrinter again with big enouth memory block */ |
| 8559 | err = GetPrinter (hPrn, 2, (LPBYTE)ppi2, dwNeeded, &dwReturned); | 8555 | err = GetPrinter (hPrn, 2, (LPBYTE)ppi2, dwNeeded, &dwReturned); |
| 8560 | ClosePrinter (hPrn); | 8556 | ClosePrinter (hPrn); |
| 8561 | if (!err) | 8557 | if (!err) |
| 8562 | { | 8558 | { |
| 8563 | xfree(ppi2); | 8559 | xfree (ppi2); |
| 8564 | return Qnil; | 8560 | return Qnil; |
| 8565 | } | 8561 | } |
| 8566 | 8562 | ||
| @@ -8570,23 +8566,23 @@ DEFUN ("default-printer-name", Fdefault_printer_name, Sdefault_printer_name, | |||
| 8570 | { | 8566 | { |
| 8571 | /* a remote printer */ | 8567 | /* a remote printer */ |
| 8572 | if (*ppi2->pServerName == '\\') | 8568 | if (*ppi2->pServerName == '\\') |
| 8573 | _snprintf(pname_buf, sizeof (pname_buf), "%s\\%s", ppi2->pServerName, | 8569 | _snprintf (pname_buf, sizeof (pname_buf), "%s\\%s", ppi2->pServerName, |
| 8574 | ppi2->pShareName); | 8570 | ppi2->pShareName); |
| 8575 | else | 8571 | else |
| 8576 | _snprintf(pname_buf, sizeof (pname_buf), "\\\\%s\\%s", ppi2->pServerName, | 8572 | _snprintf (pname_buf, sizeof (pname_buf), "\\\\%s\\%s", ppi2->pServerName, |
| 8577 | ppi2->pShareName); | 8573 | ppi2->pShareName); |
| 8578 | pname_buf[sizeof (pname_buf) - 1] = '\0'; | 8574 | pname_buf[sizeof (pname_buf) - 1] = '\0'; |
| 8579 | } | 8575 | } |
| 8580 | else | 8576 | else |
| 8581 | { | 8577 | { |
| 8582 | /* a local printer */ | 8578 | /* a local printer */ |
| 8583 | strncpy(pname_buf, ppi2->pPortName, sizeof (pname_buf)); | 8579 | strncpy (pname_buf, ppi2->pPortName, sizeof (pname_buf)); |
| 8584 | pname_buf[sizeof (pname_buf) - 1] = '\0'; | 8580 | pname_buf[sizeof (pname_buf) - 1] = '\0'; |
| 8585 | /* `pPortName' can include several ports, delimited by ','. | 8581 | /* `pPortName' can include several ports, delimited by ','. |
| 8586 | * we only use the first one. */ | 8582 | * we only use the first one. */ |
| 8587 | strtok(pname_buf, ","); | 8583 | strtok (pname_buf, ","); |
| 8588 | } | 8584 | } |
| 8589 | xfree(ppi2); | 8585 | xfree (ppi2); |
| 8590 | } | 8586 | } |
| 8591 | 8587 | ||
| 8592 | return build_string (pname_buf); | 8588 | return build_string (pname_buf); |
| @@ -8825,7 +8821,7 @@ system to handle them. */); | |||
| 8825 | &w32_pass_multimedia_buttons_to_system, | 8821 | &w32_pass_multimedia_buttons_to_system, |
| 8826 | doc: /* If non-nil, media buttons are passed to Windows. | 8822 | doc: /* If non-nil, media buttons are passed to Windows. |
| 8827 | Some modern keyboards contain buttons for controlling media players, web | 8823 | Some modern keyboards contain buttons for controlling media players, web |
| 8828 | browsers and other applications. Generally these buttons are handled on a | 8824 | browsers and other applications. Generally these buttons are handled on a |
| 8829 | system wide basis, but by setting this to nil they are made available | 8825 | system wide basis, but by setting this to nil they are made available |
| 8830 | to Emacs for binding. Depending on your keyboard, additional keys that | 8826 | to Emacs for binding. Depending on your keyboard, additional keys that |
| 8831 | may be available are: | 8827 | may be available are: |
| @@ -8841,8 +8837,7 @@ media-play, media-pause, media-record, media-fast-forward, media-rewind, | |||
| 8841 | media-channel-up, media-channel-down, | 8837 | media-channel-up, media-channel-down, |
| 8842 | volume-mute, volume-up, volume-down, | 8838 | volume-mute, volume-up, volume-down, |
| 8843 | mic-volume-mute, mic-volume-down, mic-volume-up, mic-toggle, | 8839 | mic-volume-mute, mic-volume-down, mic-volume-up, mic-toggle, |
| 8844 | bass-down, bass-boost, bass-up, treble-down, treble-up | 8840 | bass-down, bass-boost, bass-up, treble-down, treble-up */); |
| 8845 | */); | ||
| 8846 | w32_pass_multimedia_buttons_to_system = 1; | 8841 | w32_pass_multimedia_buttons_to_system = 1; |
| 8847 | 8842 | ||
| 8848 | DEFVAR_LISP ("x-pointer-shape", &Vx_pointer_shape, | 8843 | DEFVAR_LISP ("x-pointer-shape", &Vx_pointer_shape, |
| @@ -8871,14 +8866,14 @@ Value must be an integer or float. */); | |||
| 8871 | Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY); | 8866 | Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY); |
| 8872 | 8867 | ||
| 8873 | DEFVAR_LISP ("x-sensitive-text-pointer-shape", | 8868 | DEFVAR_LISP ("x-sensitive-text-pointer-shape", |
| 8874 | &Vx_sensitive_text_pointer_shape, | 8869 | &Vx_sensitive_text_pointer_shape, |
| 8875 | doc: /* The shape of the pointer when over mouse-sensitive text. | 8870 | doc: /* The shape of the pointer when over mouse-sensitive text. |
| 8876 | This variable takes effect when you create a new frame | 8871 | This variable takes effect when you create a new frame |
| 8877 | or when you set the mouse color. */); | 8872 | or when you set the mouse color. */); |
| 8878 | Vx_sensitive_text_pointer_shape = Qnil; | 8873 | Vx_sensitive_text_pointer_shape = Qnil; |
| 8879 | 8874 | ||
| 8880 | DEFVAR_LISP ("x-window-horizontal-drag-cursor", | 8875 | DEFVAR_LISP ("x-window-horizontal-drag-cursor", |
| 8881 | &Vx_window_horizontal_drag_shape, | 8876 | &Vx_window_horizontal_drag_shape, |
| 8882 | doc: /* Pointer shape to use for indicating a window can be dragged horizontally. | 8877 | doc: /* Pointer shape to use for indicating a window can be dragged horizontally. |
| 8883 | This variable takes effect when you create a new frame | 8878 | This variable takes effect when you create a new frame |
| 8884 | or when you set the mouse color. */); | 8879 | or when you set the mouse color. */); |
| @@ -9129,7 +9124,7 @@ void globals_of_w32fns () | |||
| 9129 | #undef abort | 9124 | #undef abort |
| 9130 | 9125 | ||
| 9131 | void | 9126 | void |
| 9132 | w32_abort() | 9127 | w32_abort () |
| 9133 | { | 9128 | { |
| 9134 | int button; | 9129 | int button; |
| 9135 | button = MessageBox (NULL, | 9130 | button = MessageBox (NULL, |
| @@ -9157,7 +9152,7 @@ w32_abort() | |||
| 9157 | 9152 | ||
| 9158 | /* For convenience when debugging. */ | 9153 | /* For convenience when debugging. */ |
| 9159 | int | 9154 | int |
| 9160 | w32_last_error() | 9155 | w32_last_error () |
| 9161 | { | 9156 | { |
| 9162 | return GetLastError (); | 9157 | return GetLastError (); |
| 9163 | } | 9158 | } |