comparison src/w32term.c @ 16884:36babc489b0c

Change all uses of win95, winnt, and win32 into Windows 95, Windows NT, and W32, respectively. Expand "win" substring in variables referring to Microsoft Windows constructs into "windows". Canonicalize header comments to use same terminology.
author Geoff Voelker <voelker@cs.washington.edu>
date Mon, 20 Jan 1997 00:38:22 +0000
parents 481b7874a1e9
children be4c110cda51
comparison
equal deleted inserted replaced
16883:d1d4d81f9ece 16884:36babc489b0c
1 /* Implementation of GUI terminal on the Win32 API. 1 /* Implementation of GUI terminal on the Microsoft W32 API.
2 Copyright (C) 1989, 1993, 1994, 1995 Free Software Foundation, Inc. 2 Copyright (C) 1989, 1993, 1994, 1995 Free Software Foundation, Inc.
3 3
4 This file is part of GNU Emacs. 4 This file is part of GNU Emacs.
5 5
6 GNU Emacs is free software; you can redistribute it and/or modify 6 GNU Emacs is free software; you can redistribute it and/or modify
87 During an update, these are different from the cursor-box position. */ 87 During an update, these are different from the cursor-box position. */
88 88
89 static int curs_x; 89 static int curs_x;
90 static int curs_y; 90 static int curs_y;
91 91
92 DWORD dwWinThreadId = 0; 92 DWORD dwWindowsThreadId = 0;
93 HANDLE hWinThread = NULL; 93 HANDLE hWindowsThread = NULL;
94 DWORD dwMainThreadId = 0; 94 DWORD dwMainThreadId = 0;
95 HANDLE hMainThread = NULL; 95 HANDLE hMainThread = NULL;
96 96
97 /* Mouse movement. */ 97 /* Mouse movement. */
98 98
1800 struct frame * f; 1800 struct frame * f;
1801 struct scroll_bar * bar; 1801 struct scroll_bar * bar;
1802 { 1802 {
1803 MSG msg; 1803 MSG msg;
1804 1804
1805 PostThreadMessage (dwWinThreadId, WM_EMACS_CREATESCROLLBAR, (WPARAM) f, 1805 PostThreadMessage (dwWindowsThreadId, WM_EMACS_CREATESCROLLBAR, (WPARAM) f,
1806 (LPARAM) bar); 1806 (LPARAM) bar);
1807 GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE); 1807 GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE);
1808 1808
1809 return ((HWND) msg.wParam); 1809 return ((HWND) msg.wParam);
1810 } 1810 }
2329 static int 2329 static int
2330 is_dead_key (int wparam) 2330 is_dead_key (int wparam)
2331 { 2331 {
2332 unsigned int code = MapVirtualKey (wparam, 2); 2332 unsigned int code = MapVirtualKey (wparam, 2);
2333 2333
2334 /* Win95 returns 0x8000, NT returns 0x80000000. */ 2334 /* Windows 95 returns 0x8000, NT returns 0x80000000. */
2335 if ((code & 0x8000) || (code & 0x80000000)) 2335 if ((code & 0x8000) || (code & 0x80000000))
2336 return 1; 2336 return 1;
2337 else 2337 else
2338 return 0; 2338 return 0;
2339 } 2339 }
2348 thus pretending to be `read'. 2348 thus pretending to be `read'.
2349 2349
2350 EXPECTED is nonzero if the caller knows input is available. 2350 EXPECTED is nonzero if the caller knows input is available.
2351 2351
2352 Some of these messages are reposted back to the message queue since the 2352 Some of these messages are reposted back to the message queue since the
2353 system calls the winproc directly in a context where we cannot return the 2353 system calls the windows proc directly in a context where we cannot return
2354 data nor can we guarantee the state we are in. So if we dispatch them 2354 the data nor can we guarantee the state we are in. So if we dispatch them
2355 we will get into an infinite loop. To prevent this from ever happening we 2355 we will get into an infinite loop. To prevent this from ever happening we
2356 will set a variable to indicate we are in the read_socket call and indicate 2356 will set a variable to indicate we are in the read_socket call and indicate
2357 which message we are processing since the winproc gets called recursively with different 2357 which message we are processing since the windows proc gets called
2358 messages by the system. 2358 recursively with different messages by the system.
2359 */ 2359 */
2360 2360
2361 int 2361 int
2362 w32_read_socket (sd, bufp, numchars, expected) 2362 w32_read_socket (sd, bufp, numchars, expected)
2363 register int sd; 2363 register int sd;
3789 xfree (dpyinfo->w32_id_name); 3789 xfree (dpyinfo->w32_id_name);
3790 } 3790 }
3791 3791
3792 /* Set up use of W32. */ 3792 /* Set up use of W32. */
3793 3793
3794 DWORD win_msg_worker (); 3794 DWORD windows_msg_worker ();
3795 3795
3796 w32_initialize () 3796 w32_initialize ()
3797 { 3797 {
3798 clear_frame_hook = w32_clear_frame; 3798 clear_frame_hook = w32_clear_frame;
3799 clear_end_of_line_hook = w32_clear_end_of_line; 3799 clear_end_of_line_hook = w32_clear_end_of_line;
3844 { 3844 {
3845 MSG msg; 3845 MSG msg;
3846 3846
3847 PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE); 3847 PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE);
3848 3848
3849 hWinThread = CreateThread (NULL, 0, 3849 hWindowsThread = CreateThread (NULL, 0,
3850 (LPTHREAD_START_ROUTINE) win_msg_worker, 3850 (LPTHREAD_START_ROUTINE) windows_msg_worker,
3851 0, 0, &dwWinThreadId); 3851 0, 0, &dwWindowsThreadId);
3852 3852
3853 GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE); 3853 GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE);
3854 } 3854 }
3855 3855
3856 /* It is desirable that mainThread should have the same notion of 3856 /* It is desirable that mainThread should have the same notion of
3857 focus window and active window as winThread. Unfortunately, the 3857 focus window and active window as windowsThread. Unfortunately, the
3858 following call to AttachThreadInput, which should do precisely what 3858 following call to AttachThreadInput, which should do precisely what
3859 we need, causes major problems when Emacs is linked as a console 3859 we need, causes major problems when Emacs is linked as a console
3860 program. Unfortunately, we have good reasons for doing that, so 3860 program. Unfortunately, we have good reasons for doing that, so
3861 instead we need to send messages to winThread to make some API 3861 instead we need to send messages to windowsThread to make some API
3862 calls for us (ones that affect, or depend on, the active/focus 3862 calls for us (ones that affect, or depend on, the active/focus
3863 window state. */ 3863 window state. */
3864 #ifdef ATTACH_THREADS 3864 #ifdef ATTACH_THREADS
3865 AttachThreadInput (dwMainThreadId, dwWinThreadId, TRUE); 3865 AttachThreadInput (dwMainThreadId, dwWindowsThreadId, TRUE);
3866 #endif 3866 #endif
3867 } 3867 }
3868 3868
3869 void 3869 void
3870 syms_of_w32term () 3870 syms_of_w32term ()