aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGeoff Voelker1996-11-19 04:59:23 +0000
committerGeoff Voelker1996-11-19 04:59:23 +0000
commitfbd6baedb5818026258ae813d298779d4d029bf1 (patch)
treeb48b862a1f549f0a5d903fb6aad622e4ae80bfe9 /src
parent0f7d64d24552f764c1a34a2d6087dee2eb92770e (diff)
downloademacs-fbd6baedb5818026258ae813d298779d4d029bf1.tar.gz
emacs-fbd6baedb5818026258ae813d298779d4d029bf1.zip
Change identifiers of the form win32* to w32*.
Diffstat (limited to 'src')
-rw-r--r--src/emacs.c10
-rw-r--r--src/frame.c10
-rw-r--r--src/frame.h10
-rw-r--r--src/keyboard.c4
-rw-r--r--src/s/ms-w32.h2
-rw-r--r--src/termhooks.h2
-rw-r--r--src/unexw32.c2
-rw-r--r--src/w32.c56
-rw-r--r--src/w32.h2
-rw-r--r--src/w32console.c12
-rw-r--r--src/w32faces.c32
-rw-r--r--src/w32fns.c838
-rw-r--r--src/w32heap.c8
-rw-r--r--src/w32heap.h8
-rw-r--r--src/w32inevt.c22
-rw-r--r--src/w32inevt.h8
-rw-r--r--src/w32menu.c44
-rw-r--r--src/w32proc.c52
-rw-r--r--src/w32reg.c4
-rw-r--r--src/w32select.c32
-rw-r--r--src/w32term.c784
-rw-r--r--src/w32term.h180
-rw-r--r--src/w32xfns.c34
23 files changed, 1078 insertions, 1078 deletions
diff --git a/src/emacs.c b/src/emacs.c
index f44b7cf3f24..593156cf4b6 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -979,11 +979,11 @@ the Bugs section of the Emacs manual or the file BUGS.", argv[0]);
979#endif 979#endif
980 980
981#ifdef HAVE_NTGUI 981#ifdef HAVE_NTGUI
982 syms_of_win32term (); 982 syms_of_w32term ();
983 syms_of_win32fns (); 983 syms_of_w32fns ();
984 syms_of_win32faces (); 984 syms_of_w32faces ();
985 syms_of_win32select (); 985 syms_of_w32select ();
986 syms_of_win32menu (); 986 syms_of_w32menu ();
987#endif /* HAVE_NTGUI */ 987#endif /* HAVE_NTGUI */
988 988
989#ifdef SYMS_SYSTEM 989#ifdef SYMS_SYSTEM
diff --git a/src/frame.c b/src/frame.c
index 31b5b854348..937336c4873 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -75,7 +75,7 @@ Lisp_Object Qunsplittable;
75Lisp_Object Qmenu_bar_lines; 75Lisp_Object Qmenu_bar_lines;
76Lisp_Object Qwidth; 76Lisp_Object Qwidth;
77Lisp_Object Qx; 77Lisp_Object Qx;
78Lisp_Object Qwin32; 78Lisp_Object Qw32;
79Lisp_Object Qpc; 79Lisp_Object Qpc;
80Lisp_Object Qvisible; 80Lisp_Object Qvisible;
81Lisp_Object Qbuffer_predicate; 81Lisp_Object Qbuffer_predicate;
@@ -112,8 +112,8 @@ syms_of_frame_1 ()
112 staticpro (&Qwidth); 112 staticpro (&Qwidth);
113 Qx = intern ("x"); 113 Qx = intern ("x");
114 staticpro (&Qx); 114 staticpro (&Qx);
115 Qwin32 = intern ("win32"); 115 Qw32 = intern ("w32");
116 staticpro (&Qwin32); 116 staticpro (&Qw32);
117 Qpc = intern ("pc"); 117 Qpc = intern ("pc");
118 staticpro (&Qpc); 118 staticpro (&Qpc);
119 Qvisible = intern ("visible"); 119 Qvisible = intern ("visible");
@@ -221,8 +221,8 @@ See also `frame-live-p'.")
221 return Qt; 221 return Qt;
222 case output_x_window: 222 case output_x_window:
223 return Qx; 223 return Qx;
224 case output_win32: 224 case output_w32:
225 return Qwin32; 225 return Qw32;
226 case output_msdos_raw: 226 case output_msdos_raw:
227 return Qpc; 227 return Qpc;
228 default: 228 default:
diff --git a/src/frame.h b/src/frame.h
index 6d21437c860..404dfcdfb04 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -33,7 +33,7 @@ extern int message_buf_print;
33/* The structure representing a frame. */ 33/* The structure representing a frame. */
34 34
35enum output_method 35enum output_method
36{ output_termcap, output_x_window, output_msdos_raw, output_win32 }; 36{ output_termcap, output_x_window, output_msdos_raw, output_w32 };
37 37
38enum vertical_scroll_bar_type 38enum vertical_scroll_bar_type
39{ vertical_scroll_bar_none, vertical_scroll_bar_left, vertical_scroll_bar_right }; 39{ vertical_scroll_bar_none, vertical_scroll_bar_left, vertical_scroll_bar_right };
@@ -181,9 +181,9 @@ struct frame
181 /* A structure of auxiliary data used for displaying the contents. 181 /* A structure of auxiliary data used for displaying the contents.
182 struct x_output is used for X window frames; 182 struct x_output is used for X window frames;
183 it is defined in xterm.h. 183 it is defined in xterm.h.
184 struct win32_output is used for Win32 window frames; 184 struct w32_output is used for W32 window frames;
185 it is defined in w32term.h. */ 185 it is defined in w32term.h. */
186 union output_data { struct x_output *x; struct win32_output *win32; int nothing; } output_data; 186 union output_data { struct x_output *x; struct w32_output *w32; int nothing; } output_data;
187 187
188#ifdef MULTI_KBOARD 188#ifdef MULTI_KBOARD
189 /* A pointer to the kboard structure associated with this frame. 189 /* A pointer to the kboard structure associated with this frame.
@@ -309,7 +309,7 @@ typedef struct frame *FRAME_PTR;
309#define WINDOW_FRAME(w) (w)->frame 309#define WINDOW_FRAME(w) (w)->frame
310 310
311#define FRAME_X_P(f) ((f)->output_method == output_x_window) 311#define FRAME_X_P(f) ((f)->output_method == output_x_window)
312#define FRAME_WIN32_P(f) ((f)->output_method == output_win32) 312#define FRAME_W32_P(f) ((f)->output_method == output_w32)
313#define FRAME_MSDOS_P(f) ((f)->output_method == output_msdos_raw) 313#define FRAME_MSDOS_P(f) ((f)->output_method == output_msdos_raw)
314 314
315/* FRAME_WINDOW_P tests whether the frame is a window, and is 315/* FRAME_WINDOW_P tests whether the frame is a window, and is
@@ -318,7 +318,7 @@ typedef struct frame *FRAME_PTR;
318#define FRAME_WINDOW_P(f) FRAME_X_P (f) 318#define FRAME_WINDOW_P(f) FRAME_X_P (f)
319#endif 319#endif
320#ifdef HAVE_NTGUI 320#ifdef HAVE_NTGUI
321#define FRAME_WINDOW_P(f) FRAME_WIN32_P (f) 321#define FRAME_WINDOW_P(f) FRAME_W32_P (f)
322#endif 322#endif
323#ifndef FRAME_WINDOW_P 323#ifndef FRAME_WINDOW_P
324#define FRAME_WINDOW_P(f) (0) 324#define FRAME_WINDOW_P(f) (0)
diff --git a/src/keyboard.c b/src/keyboard.c
index e23034e4d56..a52fd604991 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -3920,7 +3920,7 @@ make_lispy_event (event)
3920 } 3920 }
3921 3921
3922#ifdef WINDOWSNT 3922#ifdef WINDOWSNT
3923 case win32_scroll_bar_click: 3923 case w32_scroll_bar_click:
3924 { 3924 {
3925 int button = event->code; 3925 int button = event->code;
3926 int is_double; 3926 int is_double;
@@ -3948,7 +3948,7 @@ make_lispy_event (event)
3948 Fcons (part, Qnil))))); 3948 Fcons (part, Qnil)))));
3949 } 3949 }
3950 3950
3951 /* Always treat Win32 scroll bar events as clicks. */ 3951 /* Always treat W32 scroll bar events as clicks. */
3952 event->modifiers |= click_modifier; 3952 event->modifiers |= click_modifier;
3953 3953
3954 { 3954 {
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h
index 97ca6aa0769..041da1f5a16 100644
--- a/src/s/ms-w32.h
+++ b/src/s/ms-w32.h
@@ -319,7 +319,7 @@ Boston, MA 02111-1307, USA. */
319#define rindex strrchr 319#define rindex strrchr
320 320
321#ifdef HAVE_NTGUI 321#ifdef HAVE_NTGUI
322#define abort win32_abort 322#define abort w32_abort
323#endif 323#endif
324 324
325/* Defines that we need that aren't in the standard signal.h */ 325/* Defines that we need that aren't in the standard signal.h */
diff --git a/src/termhooks.h b/src/termhooks.h
index 4787e245493..984c4284ec1 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -248,7 +248,7 @@ enum event_kind
248 .timestamp gives a timestamp (in 248 .timestamp gives a timestamp (in
249 milliseconds) for the click. */ 249 milliseconds) for the click. */
250#ifdef WINDOWSNT 250#ifdef WINDOWSNT
251 win32_scroll_bar_click, /* as for scroll_bar_click, but only generated 251 w32_scroll_bar_click, /* as for scroll_bar_click, but only generated
252 by MS-Windows scroll bar controls. */ 252 by MS-Windows scroll bar controls. */
253#endif 253#endif
254 selection_request_event, /* Another X client wants a selection from us. 254 selection_request_event, /* Another X client wants a selection from us.
diff --git a/src/unexw32.c b/src/unexw32.c
index 8fb1f8001b7..4391a89f127 100644
--- a/src/unexw32.c
+++ b/src/unexw32.c
@@ -314,7 +314,7 @@ static unsigned long
314get_section_size (PIMAGE_SECTION_HEADER p_section) 314get_section_size (PIMAGE_SECTION_HEADER p_section)
315{ 315{
316 /* The section size is in different locations in the different versions. */ 316 /* The section size is in different locations in the different versions. */
317 switch (get_nt_minor_version ()) 317 switch (get_w32_minor_version ())
318 { 318 {
319 case 10: 319 case 10:
320 return p_section->SizeOfRawData; 320 return p_section->SizeOfRawData;
diff --git a/src/w32.c b/src/w32.c
index 2f30e30b2ac..32881ecae7d 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -122,7 +122,7 @@ static HANDLE dir_find_handle = INVALID_HANDLE_VALUE;
122static int dir_is_fat; 122static int dir_is_fat;
123static char dir_pathname[MAXPATHLEN+1]; 123static char dir_pathname[MAXPATHLEN+1];
124 124
125extern Lisp_Object Vwin32_downcase_file_names; 125extern Lisp_Object Vw32_downcase_file_names;
126 126
127DIR * 127DIR *
128opendir (char *filename) 128opendir (char *filename)
@@ -199,7 +199,7 @@ readdir (DIR *dirp)
199 strcpy (dir_static.d_name, find_data.cFileName); 199 strcpy (dir_static.d_name, find_data.cFileName);
200 if (dir_is_fat) 200 if (dir_is_fat)
201 _strlwr (dir_static.d_name); 201 _strlwr (dir_static.d_name);
202 else if (!NILP (Vwin32_downcase_file_names)) 202 else if (!NILP (Vw32_downcase_file_names))
203 { 203 {
204 register char *p; 204 register char *p;
205 for (p = dir_static.d_name; *p; p++) 205 for (p = dir_static.d_name; *p; p++)
@@ -412,7 +412,7 @@ normalize_filename (fp, path_sep)
412 fp += 2; 412 fp += 2;
413 } 413 }
414 414
415 if (NILP (Vwin32_downcase_file_names)) 415 if (NILP (Vw32_downcase_file_names))
416 { 416 {
417 while (*fp) 417 while (*fp)
418 { 418 {
@@ -536,7 +536,7 @@ request_sigio (void)
536#define REG_ROOT "SOFTWARE\\GNU\\Emacs" 536#define REG_ROOT "SOFTWARE\\GNU\\Emacs"
537 537
538LPBYTE 538LPBYTE
539nt_get_resource (key, lpdwtype) 539w32_get_resource (key, lpdwtype)
540 char *key; 540 char *key;
541 LPDWORD lpdwtype; 541 LPDWORD lpdwtype;
542{ 542{
@@ -610,7 +610,7 @@ init_environment ()
610 for (i = 0; i < (sizeof (env_vars) / sizeof (env_vars[0])); i++) 610 for (i = 0; i < (sizeof (env_vars) / sizeof (env_vars[0])); i++)
611 { 611 {
612 if (!getenv (env_vars[i]) && 612 if (!getenv (env_vars[i]) &&
613 (lpval = nt_get_resource (env_vars[i], &dwType)) != NULL) 613 (lpval = w32_get_resource (env_vars[i], &dwType)) != NULL)
614 { 614 {
615 if (dwType == REG_EXPAND_SZ) 615 if (dwType == REG_EXPAND_SZ)
616 { 616 {
@@ -691,7 +691,7 @@ get_emacs_configuration (void)
691 os = (GetVersion () & 0x80000000) ? "win95" : "nt"; 691 os = (GetVersion () & 0x80000000) ? "win95" : "nt";
692 692
693 sprintf (configuration_buffer, "%s-%s-%s%d.%d", arch, oem, os, 693 sprintf (configuration_buffer, "%s-%s-%s%d.%d", arch, oem, os,
694 get_nt_major_version (), get_nt_minor_version ()); 694 get_w32_major_version (), get_w32_minor_version ());
695 return configuration_buffer; 695 return configuration_buffer;
696} 696}
697 697
@@ -714,7 +714,7 @@ gettimeofday (struct timeval *tv, struct timezone *tz)
714} 714}
715 715
716/* ------------------------------------------------------------------------- */ 716/* ------------------------------------------------------------------------- */
717/* IO support and wrapper functions for Win32 API. */ 717/* IO support and wrapper functions for W32 API. */
718/* ------------------------------------------------------------------------- */ 718/* ------------------------------------------------------------------------- */
719 719
720/* Place a wrapper around the MSVC version of ctime. It returns NULL 720/* Place a wrapper around the MSVC version of ctime. It returns NULL
@@ -818,7 +818,7 @@ is_fat_volume (const char * name, const char ** pPath)
818 818
819/* Map filename to a legal 8.3 name if necessary. */ 819/* Map filename to a legal 8.3 name if necessary. */
820const char * 820const char *
821map_win32_filename (const char * name, const char ** pPath) 821map_w32_filename (const char * name, const char ** pPath)
822{ 822{
823 static char shortname[MAX_PATH]; 823 static char shortname[MAX_PATH];
824 char * str = shortname; 824 char * str = shortname;
@@ -922,25 +922,25 @@ map_win32_filename (const char * name, const char ** pPath)
922int 922int
923sys_access (const char * path, int mode) 923sys_access (const char * path, int mode)
924{ 924{
925 return _access (map_win32_filename (path, NULL), mode); 925 return _access (map_w32_filename (path, NULL), mode);
926} 926}
927 927
928int 928int
929sys_chdir (const char * path) 929sys_chdir (const char * path)
930{ 930{
931 return _chdir (map_win32_filename (path, NULL)); 931 return _chdir (map_w32_filename (path, NULL));
932} 932}
933 933
934int 934int
935sys_chmod (const char * path, int mode) 935sys_chmod (const char * path, int mode)
936{ 936{
937 return _chmod (map_win32_filename (path, NULL), mode); 937 return _chmod (map_w32_filename (path, NULL), mode);
938} 938}
939 939
940int 940int
941sys_creat (const char * path, int mode) 941sys_creat (const char * path, int mode)
942{ 942{
943 return _creat (map_win32_filename (path, NULL), mode); 943 return _creat (map_w32_filename (path, NULL), mode);
944} 944}
945 945
946FILE * 946FILE *
@@ -980,7 +980,7 @@ sys_fopen(const char * path, const char * mode)
980 } 980 }
981 else break; 981 else break;
982 982
983 fd = _open (map_win32_filename (path, NULL), oflag | _O_NOINHERIT, 0644); 983 fd = _open (map_w32_filename (path, NULL), oflag | _O_NOINHERIT, 0644);
984 if (fd < 0) 984 if (fd < 0)
985 return NULL; 985 return NULL;
986 986
@@ -997,7 +997,7 @@ sys_link (const char * path1, const char * path2)
997int 997int
998sys_mkdir (const char * path) 998sys_mkdir (const char * path)
999{ 999{
1000 return _mkdir (map_win32_filename (path, NULL)); 1000 return _mkdir (map_w32_filename (path, NULL));
1001} 1001}
1002 1002
1003/* Because of long name mapping issues, we need to implement this 1003/* Because of long name mapping issues, we need to implement this
@@ -1054,7 +1054,7 @@ int
1054sys_open (const char * path, int oflag, int mode) 1054sys_open (const char * path, int oflag, int mode)
1055{ 1055{
1056 /* Force all file handles to be non-inheritable. */ 1056 /* Force all file handles to be non-inheritable. */
1057 return _open (map_win32_filename (path, NULL), oflag | _O_NOINHERIT, mode); 1057 return _open (map_w32_filename (path, NULL), oflag | _O_NOINHERIT, mode);
1058} 1058}
1059 1059
1060int 1060int
@@ -1076,7 +1076,7 @@ sys_rename (const char * oldname, const char * newname)
1076 So, on Win95 we always rename through a temp name, and we make sure 1076 So, on Win95 we always rename through a temp name, and we make sure
1077 the temp name has a long extension to ensure correct renaming. */ 1077 the temp name has a long extension to ensure correct renaming. */
1078 1078
1079 strcpy (temp, map_win32_filename (oldname, NULL)); 1079 strcpy (temp, map_w32_filename (oldname, NULL));
1080 1080
1081 if (GetVersion () & 0x80000000) 1081 if (GetVersion () & 0x80000000)
1082 { 1082 {
@@ -1091,7 +1091,7 @@ sys_rename (const char * oldname, const char * newname)
1091 /* Force temp name to require a manufactured 8.3 alias - this 1091 /* Force temp name to require a manufactured 8.3 alias - this
1092 seems to make the second rename work properly. */ 1092 seems to make the second rename work properly. */
1093 strcat (temp, ".long"); 1093 strcat (temp, ".long");
1094 if (rename (map_win32_filename (oldname, NULL), temp) < 0) 1094 if (rename (map_w32_filename (oldname, NULL), temp) < 0)
1095 return -1; 1095 return -1;
1096 } 1096 }
1097 1097
@@ -1099,7 +1099,7 @@ sys_rename (const char * oldname, const char * newname)
1099 (at least if it is a file; don't do this for directories). 1099 (at least if it is a file; don't do this for directories).
1100 However, don't do this if we are just changing the case of the file 1100 However, don't do this if we are just changing the case of the file
1101 name - we will end up deleting the file we are trying to rename! */ 1101 name - we will end up deleting the file we are trying to rename! */
1102 newname = map_win32_filename (newname, NULL); 1102 newname = map_w32_filename (newname, NULL);
1103 if (stricmp (newname, temp) != 0 1103 if (stricmp (newname, temp) != 0
1104 && (attr = GetFileAttributes (newname)) != -1 1104 && (attr = GetFileAttributes (newname)) != -1
1105 && (attr & FILE_ATTRIBUTE_DIRECTORY) == 0) 1105 && (attr & FILE_ATTRIBUTE_DIRECTORY) == 0)
@@ -1114,13 +1114,13 @@ sys_rename (const char * oldname, const char * newname)
1114int 1114int
1115sys_rmdir (const char * path) 1115sys_rmdir (const char * path)
1116{ 1116{
1117 return _rmdir (map_win32_filename (path, NULL)); 1117 return _rmdir (map_w32_filename (path, NULL));
1118} 1118}
1119 1119
1120int 1120int
1121sys_unlink (const char * path) 1121sys_unlink (const char * path)
1122{ 1122{
1123 return _unlink (map_win32_filename (path, NULL)); 1123 return _unlink (map_w32_filename (path, NULL));
1124} 1124}
1125 1125
1126static FILETIME utc_base_ft; 1126static FILETIME utc_base_ft;
@@ -1218,7 +1218,7 @@ generate_inode_val (const char * name)
1218 1218
1219 GetFullPathName (name, sizeof (fullname), fullname, &p); 1219 GetFullPathName (name, sizeof (fullname), fullname, &p);
1220 get_volume_info (fullname, &p); 1220 get_volume_info (fullname, &p);
1221 /* Normal Win32 filesystems are still case insensitive. */ 1221 /* Normal W32 filesystems are still case insensitive. */
1222 _strlwr (p); 1222 _strlwr (p);
1223 hash = hashval (p); 1223 hash = hashval (p);
1224 return (_ino_t) (hash ^ (hash >> 16)); 1224 return (_ino_t) (hash ^ (hash >> 16));
@@ -1243,7 +1243,7 @@ stat (const char * path, struct stat * buf)
1243 return -1; 1243 return -1;
1244 } 1244 }
1245 1245
1246 name = (char *) map_win32_filename (path, &path); 1246 name = (char *) map_w32_filename (path, &path);
1247 /* must be valid filename, no wild cards */ 1247 /* must be valid filename, no wild cards */
1248 if (strchr (name, '*') || strchr (name, '?')) 1248 if (strchr (name, '*') || strchr (name, '?'))
1249 { 1249 {
@@ -1340,7 +1340,7 @@ stat (const char * path, struct stat * buf)
1340 buf->st_uid = the_passwd.pw_uid; 1340 buf->st_uid = the_passwd.pw_uid;
1341 buf->st_gid = the_passwd.pw_gid; 1341 buf->st_gid = the_passwd.pw_gid;
1342 1342
1343 /* volume_info is set indirectly by map_win32_filename */ 1343 /* volume_info is set indirectly by map_w32_filename */
1344 buf->st_dev = volume_info.serialnum; 1344 buf->st_dev = volume_info.serialnum;
1345 buf->st_rdev = volume_info.serialnum; 1345 buf->st_rdev = volume_info.serialnum;
1346 1346
@@ -1932,7 +1932,7 @@ sys_pipe (int * phandles)
1932} 1932}
1933 1933
1934/* From ntproc.c */ 1934/* From ntproc.c */
1935extern Lisp_Object Vwin32_pipe_read_delay; 1935extern Lisp_Object Vw32_pipe_read_delay;
1936 1936
1937/* Function to do blocking read of one byte, needed to implement 1937/* Function to do blocking read of one byte, needed to implement
1938 select. It is only allowed on sockets and pipes. */ 1938 select. It is only allowed on sockets and pipes. */
@@ -1969,11 +1969,11 @@ _sys_read_ahead (int fd)
1969 connects DOS programs to pipes by making the pipe appear to be 1969 connects DOS programs to pipes by making the pipe appear to be
1970 the normal console stdout - as a result most DOS programs will 1970 the normal console stdout - as a result most DOS programs will
1971 write to stdout without buffering, ie. one character at a 1971 write to stdout without buffering, ie. one character at a
1972 time. Even some Win32 programs do this - "dir" in a command 1972 time. Even some W32 programs do this - "dir" in a command
1973 shell on NT is very slow if we don't do this. */ 1973 shell on NT is very slow if we don't do this. */
1974 if (rc > 0) 1974 if (rc > 0)
1975 { 1975 {
1976 int wait = XINT (Vwin32_pipe_read_delay); 1976 int wait = XINT (Vw32_pipe_read_delay);
1977 1977
1978 if (wait > 0) 1978 if (wait > 0)
1979 Sleep (wait); 1979 Sleep (wait);
@@ -2165,7 +2165,7 @@ init_ntproc ()
2165#ifdef HAVE_SOCKETS 2165#ifdef HAVE_SOCKETS
2166 /* Initialise the socket interface now if available and requested by 2166 /* Initialise the socket interface now if available and requested by
2167 the user by defining PRELOAD_WINSOCK; otherwise loading will be 2167 the user by defining PRELOAD_WINSOCK; otherwise loading will be
2168 delayed until open-network-stream is called (win32-has-winsock can 2168 delayed until open-network-stream is called (w32-has-winsock can
2169 also be used to dynamically load or reload winsock). 2169 also be used to dynamically load or reload winsock).
2170 2170
2171 Conveniently, init_environment is called before us, so 2171 Conveniently, init_environment is called before us, so
@@ -2238,7 +2238,7 @@ init_ntproc ()
2238 } 2238 }
2239 2239
2240 /* Restrict Emacs to running only one DOS program at a time (with any 2240 /* Restrict Emacs to running only one DOS program at a time (with any
2241 number of Win32 programs). This is to prevent the user from 2241 number of W32 programs). This is to prevent the user from
2242 running into problems with DOS programs being run in the same VDM 2242 running into problems with DOS programs being run in the same VDM
2243 under both Windows 95 and Windows NT. 2243 under both Windows 95 and Windows NT.
2244 2244
diff --git a/src/w32.h b/src/w32.h
index 2ee36488657..90ba7fbe015 100644
--- a/src/w32.h
+++ b/src/w32.h
@@ -119,7 +119,7 @@ extern void reset_standard_handles (int in, int out,
119 int err, HANDLE handles[4]); 119 int err, HANDLE handles[4]);
120 120
121/* Return the string resource associated with KEY of type TYPE. */ 121/* Return the string resource associated with KEY of type TYPE. */
122extern LPBYTE nt_get_resource (char * key, LPDWORD type); 122extern LPBYTE w32_get_resource (char * key, LPDWORD type);
123 123
124extern void init_ntproc (); 124extern void init_ntproc ();
125extern void term_ntproc (); 125extern void term_ntproc ();
diff --git a/src/w32console.c b/src/w32console.c
index bbce33f4657..ca6210d7e83 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -58,7 +58,7 @@ static void reassert_line_highlight (int, int);
58static void insert_glyphs (GLYPH *start, int len); 58static void insert_glyphs (GLYPH *start, int len);
59static void write_glyphs (GLYPH *string, int len); 59static void write_glyphs (GLYPH *string, int len);
60static void delete_glyphs (int n); 60static void delete_glyphs (int n);
61void nt_ring_bell (void); 61void w32_sys_ring_bell (void);
62static void reset_terminal_modes (void); 62static void reset_terminal_modes (void);
63static void set_terminal_modes (void); 63static void set_terminal_modes (void);
64static void set_terminal_window (int size); 64static void set_terminal_window (int size);
@@ -193,7 +193,7 @@ ins_del_lines (int vpos, int n)
193 193
194 ScrollConsoleScreenBuffer (cur_screen, &scroll, NULL, dest, &fill); 194 ScrollConsoleScreenBuffer (cur_screen, &scroll, NULL, dest, &fill);
195 195
196 /* Here we have to deal with a win32 console flake: If the scroll 196 /* Here we have to deal with a w32 console flake: If the scroll
197 region looks like abc and we scroll c to a and fill with d we get 197 region looks like abc and we scroll c to a and fill with d we get
198 cbd... if we scroll block c one line at a time to a, we get cdd... 198 cbd... if we scroll block c one line at a time to a, we get cdd...
199 Emacs expects cdd consistently... So we have to deal with that 199 Emacs expects cdd consistently... So we have to deal with that
@@ -418,7 +418,7 @@ delete_glyphs (int n)
418static unsigned int sound_type = 0xFFFFFFFF; 418static unsigned int sound_type = 0xFFFFFFFF;
419 419
420void 420void
421nt_ring_bell (void) 421w32_sys_ring_bell (void)
422{ 422{
423 if (sound_type == 0xFFFFFFFF) 423 if (sound_type == 0xFFFFFFFF)
424 Beep (666, 100); 424 Beep (666, 100);
@@ -554,15 +554,15 @@ initialize_win_nt_display (void)
554 insert_glyphs_hook = (term_hook) insert_glyphs; 554 insert_glyphs_hook = (term_hook) insert_glyphs;
555 write_glyphs_hook = (term_hook) write_glyphs; 555 write_glyphs_hook = (term_hook) write_glyphs;
556 delete_glyphs_hook = (term_hook) delete_glyphs; 556 delete_glyphs_hook = (term_hook) delete_glyphs;
557 ring_bell_hook = (term_hook) nt_ring_bell; 557 ring_bell_hook = (term_hook) w32_sys_ring_bell;
558 reset_terminal_modes_hook = (term_hook) reset_terminal_modes; 558 reset_terminal_modes_hook = (term_hook) reset_terminal_modes;
559 set_terminal_modes_hook = (term_hook) set_terminal_modes; 559 set_terminal_modes_hook = (term_hook) set_terminal_modes;
560 set_terminal_window_hook = (term_hook) set_terminal_window; 560 set_terminal_window_hook = (term_hook) set_terminal_window;
561 update_begin_hook = (term_hook) update_begin; 561 update_begin_hook = (term_hook) update_begin;
562 update_end_hook = (term_hook) update_end; 562 update_end_hook = (term_hook) update_end;
563 563
564 read_socket_hook = win32_read_socket; 564 read_socket_hook = w32_console_read_socket;
565 mouse_position_hook = win32_mouse_position; 565 mouse_position_hook = w32_mouse_position;
566 566
567 prev_screen = GetStdHandle (STD_OUTPUT_HANDLE); 567 prev_screen = GetStdHandle (STD_OUTPUT_HANDLE);
568 568
diff --git a/src/w32faces.c b/src/w32faces.c
index 1b30e85bdff..1328dd8cab5 100644
--- a/src/w32faces.c
+++ b/src/w32faces.c
@@ -1,4 +1,4 @@
1/* "Face" primitives. 1/* "Face" primitives under the Win32 API.
2 Copyright (C) 1993, 1994, 1995 Free Software Foundation. 2 Copyright (C) 1993, 1994, 1995 Free Software Foundation.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
@@ -18,7 +18,7 @@ along with GNU Emacs; see the file COPYING. If not, write to
18the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19Boston, MA 02111-1307, USA. */ 19Boston, MA 02111-1307, USA. */
20 20
21/* Ported xfaces.c for win32 - Kevin Gallo */ 21/* Ported xfaces.c for w32 - Kevin Gallo */
22 22
23#include <sys/types.h> 23#include <sys/types.h>
24#include <sys/stat.h> 24#include <sys/stat.h>
@@ -227,7 +227,7 @@ load_font (f, name)
227 227
228 CHECK_STRING (name, 0); 228 CHECK_STRING (name, 0);
229 BLOCK_INPUT; 229 BLOCK_INPUT;
230 font = win32_load_font (FRAME_WIN32_DISPLAY_INFO (f), (char *) XSTRING (name)->data); 230 font = w32_load_font (FRAME_W32_DISPLAY_INFO (f), (char *) XSTRING (name)->data);
231 UNBLOCK_INPUT; 231 UNBLOCK_INPUT;
232 232
233 if (! font) 233 if (! font)
@@ -245,7 +245,7 @@ unload_font (f, font)
245 return; 245 return;
246 246
247 BLOCK_INPUT; 247 BLOCK_INPUT;
248 win32_unload_font (FRAME_WIN32_DISPLAY_INFO (f), font); 248 w32_unload_font (FRAME_W32_DISPLAY_INFO (f), font);
249 UNBLOCK_INPUT; 249 UNBLOCK_INPUT;
250} 250}
251 251
@@ -379,7 +379,7 @@ init_frame_faces (f)
379 379
380 result = Qnil; 380 result = Qnil;
381 FOR_EACH_FRAME (tail, frame) 381 FOR_EACH_FRAME (tail, frame)
382 if (FRAME_WIN32_P (XFRAME (frame)) 382 if (FRAME_W32_P (XFRAME (frame))
383 && XFRAME (frame) != f) 383 && XFRAME (frame) != f)
384 { 384 {
385 result = frame; 385 result = frame;
@@ -546,21 +546,21 @@ frame_update_line_height (f)
546 FRAME_PTR f; 546 FRAME_PTR f;
547{ 547{
548 int i; 548 int i;
549 int biggest = FONT_HEIGHT (f->output_data.win32->font); 549 int biggest = FONT_HEIGHT (f->output_data.w32->font);
550 550
551 for (i = 0; i < f->output_data.win32->n_param_faces; i++) 551 for (i = 0; i < f->output_data.w32->n_param_faces; i++)
552 if (f->output_data.win32->param_faces[i] != 0 552 if (f->output_data.w32->param_faces[i] != 0
553 && f->output_data.win32->param_faces[i]->font != (XFontStruct *) FACE_DEFAULT) 553 && f->output_data.w32->param_faces[i]->font != (XFontStruct *) FACE_DEFAULT)
554 { 554 {
555 int height = FONT_HEIGHT (f->output_data.win32->param_faces[i]->font); 555 int height = FONT_HEIGHT (f->output_data.w32->param_faces[i]->font);
556 if (height > biggest) 556 if (height > biggest)
557 biggest = height; 557 biggest = height;
558 } 558 }
559 559
560 if (biggest == f->output_data.win32->line_height) 560 if (biggest == f->output_data.w32->line_height)
561 return 0; 561 return 0;
562 562
563 f->output_data.win32->line_height = biggest; 563 f->output_data.w32->line_height = biggest;
564 return 1; 564 return 1;
565} 565}
566 566
@@ -902,7 +902,7 @@ DEFUN ("make-face-internal", Fmake_face_internal, Smake_face_internal, 1, 1, 0,
902 902
903 FOR_EACH_FRAME (rest, frame) 903 FOR_EACH_FRAME (rest, frame)
904 { 904 {
905 if (FRAME_WIN32_P (XFRAME (frame))) 905 if (FRAME_W32_P (XFRAME (frame)))
906 ensure_face_ready (XFRAME (frame), id); 906 ensure_face_ready (XFRAME (frame), id);
907 } 907 }
908 return Qnil; 908 return Qnil;
@@ -929,7 +929,7 @@ DEFUN ("set-face-attribute-internal", Fset_face_attribute_internal,
929 if (id < 0 || id >= next_face_id) 929 if (id < 0 || id >= next_face_id)
930 error ("Face id out of range"); 930 error ("Face id out of range");
931 931
932 if (! FRAME_WIN32_P (f)) 932 if (! FRAME_W32_P (f))
933 return Qnil; 933 return Qnil;
934 934
935 ensure_face_ready (f, id); 935 ensure_face_ready (f, id);
@@ -938,7 +938,7 @@ DEFUN ("set-face-attribute-internal", Fset_face_attribute_internal,
938 if (EQ (attr_name, intern ("font"))) 938 if (EQ (attr_name, intern ("font")))
939 { 939 {
940 XFontStruct *font = load_font (f, attr_value); 940 XFontStruct *font = load_font (f, attr_value);
941 if (face->font != f->output_data.win32->font) 941 if (face->font != f->output_data.w32->font)
942 unload_font (f, face->font); 942 unload_font (f, face->font);
943 face->font = font; 943 face->font = font;
944 if (frame_update_line_height (f)) 944 if (frame_update_line_height (f))
@@ -1024,7 +1024,7 @@ face_name_id_number (f, name)
1024/* Emacs initialization. */ 1024/* Emacs initialization. */
1025 1025
1026void 1026void
1027syms_of_win32faces () 1027syms_of_w32faces ()
1028{ 1028{
1029 Qface = intern ("face"); 1029 Qface = intern ("face");
1030 staticpro (&Qface); 1030 staticpro (&Qface);
diff --git a/src/w32fns.c b/src/w32fns.c
index 60471c9deb6..9cd5a50e8fa 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -1,4 +1,4 @@
1/* Functions for the Win32 window system. 1/* Functions for the MS Win32 window system API.
2 Copyright (C) 1989, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. 2 Copyright (C) 1989, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
@@ -44,33 +44,33 @@ extern struct scroll_bar *x_window_to_scroll_bar ();
44extern int quit_char; 44extern int quit_char;
45 45
46/* The colormap for converting color names to RGB values */ 46/* The colormap for converting color names to RGB values */
47Lisp_Object Vwin32_color_map; 47Lisp_Object Vw32_color_map;
48 48
49/* Non nil if alt key presses are passed on to Windows. */ 49/* Non nil if alt key presses are passed on to Windows. */
50Lisp_Object Vwin32_pass_alt_to_system; 50Lisp_Object Vw32_pass_alt_to_system;
51 51
52/* Non nil if alt key is translated to meta_modifier, nil if it is translated 52/* Non nil if alt key is translated to meta_modifier, nil if it is translated
53 to alt_modifier. */ 53 to alt_modifier. */
54Lisp_Object Vwin32_alt_is_meta; 54Lisp_Object Vw32_alt_is_meta;
55 55
56/* Non nil if left window, right window, and application key events 56/* Non nil if left window, right window, and application key events
57 are passed on to Windows. */ 57 are passed on to Windows. */
58Lisp_Object Vwin32_pass_optional_keys_to_system; 58Lisp_Object Vw32_pass_optional_keys_to_system;
59 59
60/* Switch to control whether we inhibit requests for italicised fonts (which 60/* Switch to control whether we inhibit requests for italicised fonts (which
61 are synthesized, look ugly, and are trashed by cursor movement under NT). */ 61 are synthesized, look ugly, and are trashed by cursor movement under NT). */
62Lisp_Object Vwin32_enable_italics; 62Lisp_Object Vw32_enable_italics;
63 63
64/* Enable palette management. */ 64/* Enable palette management. */
65Lisp_Object Vwin32_enable_palette; 65Lisp_Object Vw32_enable_palette;
66 66
67/* Control how close left/right button down events must be to 67/* Control how close left/right button down events must be to
68 be converted to a middle button down event. */ 68 be converted to a middle button down event. */
69Lisp_Object Vwin32_mouse_button_tolerance; 69Lisp_Object Vw32_mouse_button_tolerance;
70 70
71/* Minimum interval between mouse movement (and scroll bar drag) 71/* Minimum interval between mouse movement (and scroll bar drag)
72 events that are passed on to the event loop. */ 72 events that are passed on to the event loop. */
73Lisp_Object Vwin32_mouse_move_interval; 73Lisp_Object Vw32_mouse_move_interval;
74 74
75/* The name we're using in resource queries. */ 75/* The name we're using in resource queries. */
76Lisp_Object Vx_resource_name; 76Lisp_Object Vx_resource_name;
@@ -165,9 +165,9 @@ Lisp_Object Qdisplay;
165#define RMOUSE 4 165#define RMOUSE 4
166 166
167static int button_state = 0; 167static int button_state = 0;
168static Win32Msg saved_mouse_button_msg; 168static W32Msg saved_mouse_button_msg;
169static unsigned mouse_button_timer; /* non-zero when timer is active */ 169static unsigned mouse_button_timer; /* non-zero when timer is active */
170static Win32Msg saved_mouse_move_msg; 170static W32Msg saved_mouse_move_msg;
171static unsigned mouse_move_timer; 171static unsigned mouse_move_timer;
172 172
173#define MOUSE_BUTTON_ID 1 173#define MOUSE_BUTTON_ID 1
@@ -182,14 +182,14 @@ extern Lisp_Object Vwindow_system_version;
182extern Lisp_Object last_mouse_scroll_bar; 182extern Lisp_Object last_mouse_scroll_bar;
183extern int last_mouse_scroll_bar_pos; 183extern int last_mouse_scroll_bar_pos;
184 184
185/* From win32term.c. */ 185/* From w32term.c. */
186extern Lisp_Object Vwin32_num_mouse_buttons; 186extern Lisp_Object Vw32_num_mouse_buttons;
187 187
188Time last_mouse_movement_time; 188Time last_mouse_movement_time;
189 189
190 190
191/* Extract a frame as a FRAME_PTR, defaulting to the selected frame 191/* Extract a frame as a FRAME_PTR, defaulting to the selected frame
192 and checking validity for Win32. */ 192 and checking validity for W32. */
193 193
194FRAME_PTR 194FRAME_PTR
195check_x_frame (frame) 195check_x_frame (frame)
@@ -204,25 +204,25 @@ check_x_frame (frame)
204 CHECK_LIVE_FRAME (frame, 0); 204 CHECK_LIVE_FRAME (frame, 0);
205 f = XFRAME (frame); 205 f = XFRAME (frame);
206 } 206 }
207 if (! FRAME_WIN32_P (f)) 207 if (! FRAME_W32_P (f))
208 error ("non-win32 frame used"); 208 error ("non-w32 frame used");
209 return f; 209 return f;
210} 210}
211 211
212/* Let the user specify an display with a frame. 212/* Let the user specify an display with a frame.
213 nil stands for the selected frame--or, if that is not a win32 frame, 213 nil stands for the selected frame--or, if that is not a w32 frame,
214 the first display on the list. */ 214 the first display on the list. */
215 215
216static struct win32_display_info * 216static struct w32_display_info *
217check_x_display_info (frame) 217check_x_display_info (frame)
218 Lisp_Object frame; 218 Lisp_Object frame;
219{ 219{
220 if (NILP (frame)) 220 if (NILP (frame))
221 { 221 {
222 if (FRAME_WIN32_P (selected_frame)) 222 if (FRAME_W32_P (selected_frame))
223 return FRAME_WIN32_DISPLAY_INFO (selected_frame); 223 return FRAME_W32_DISPLAY_INFO (selected_frame);
224 else 224 else
225 return &one_win32_display_info; 225 return &one_w32_display_info;
226 } 226 }
227 else if (STRINGP (frame)) 227 else if (STRINGP (frame))
228 return x_display_info_for_name (frame); 228 return x_display_info_for_name (frame);
@@ -232,20 +232,20 @@ check_x_display_info (frame)
232 232
233 CHECK_LIVE_FRAME (frame, 0); 233 CHECK_LIVE_FRAME (frame, 0);
234 f = XFRAME (frame); 234 f = XFRAME (frame);
235 if (! FRAME_WIN32_P (f)) 235 if (! FRAME_W32_P (f))
236 error ("non-win32 frame used"); 236 error ("non-w32 frame used");
237 return FRAME_WIN32_DISPLAY_INFO (f); 237 return FRAME_W32_DISPLAY_INFO (f);
238 } 238 }
239} 239}
240 240
241/* Return the Emacs frame-object corresponding to an win32 window. 241/* Return the Emacs frame-object corresponding to an w32 window.
242 It could be the frame's main window or an icon window. */ 242 It could be the frame's main window or an icon window. */
243 243
244/* This function can be called during GC, so use GC_xxx type test macros. */ 244/* This function can be called during GC, so use GC_xxx type test macros. */
245 245
246struct frame * 246struct frame *
247x_window_to_frame (dpyinfo, wdesc) 247x_window_to_frame (dpyinfo, wdesc)
248 struct win32_display_info *dpyinfo; 248 struct w32_display_info *dpyinfo;
249 HWND wdesc; 249 HWND wdesc;
250{ 250{
251 Lisp_Object tail, frame; 251 Lisp_Object tail, frame;
@@ -258,9 +258,9 @@ x_window_to_frame (dpyinfo, wdesc)
258 continue; 258 continue;
259 f = XFRAME (frame); 259 f = XFRAME (frame);
260 if (f->output_data.nothing == 1 260 if (f->output_data.nothing == 1
261 || FRAME_WIN32_DISPLAY_INFO (f) != dpyinfo) 261 || FRAME_W32_DISPLAY_INFO (f) != dpyinfo)
262 continue; 262 continue;
263 if (FRAME_WIN32_WINDOW (f) == wdesc) 263 if (FRAME_W32_WINDOW (f) == wdesc)
264 return f; 264 return f;
265 } 265 }
266 return 0; 266 return 0;
@@ -287,7 +287,7 @@ x_bitmap_height (f, id)
287 FRAME_PTR f; 287 FRAME_PTR f;
288 int id; 288 int id;
289{ 289{
290 return FRAME_WIN32_DISPLAY_INFO (f)->bitmaps[id - 1].height; 290 return FRAME_W32_DISPLAY_INFO (f)->bitmaps[id - 1].height;
291} 291}
292 292
293int 293int
@@ -295,7 +295,7 @@ x_bitmap_width (f, id)
295 FRAME_PTR f; 295 FRAME_PTR f;
296 int id; 296 int id;
297{ 297{
298 return FRAME_WIN32_DISPLAY_INFO (f)->bitmaps[id - 1].width; 298 return FRAME_W32_DISPLAY_INFO (f)->bitmaps[id - 1].width;
299} 299}
300 300
301int 301int
@@ -303,7 +303,7 @@ x_bitmap_pixmap (f, id)
303 FRAME_PTR f; 303 FRAME_PTR f;
304 int id; 304 int id;
305{ 305{
306 return (int) FRAME_WIN32_DISPLAY_INFO (f)->bitmaps[id - 1].pixmap; 306 return (int) FRAME_W32_DISPLAY_INFO (f)->bitmaps[id - 1].pixmap;
307} 307}
308 308
309 309
@@ -313,14 +313,14 @@ static int
313x_allocate_bitmap_record (f) 313x_allocate_bitmap_record (f)
314 FRAME_PTR f; 314 FRAME_PTR f;
315{ 315{
316 struct win32_display_info *dpyinfo = FRAME_WIN32_DISPLAY_INFO (f); 316 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
317 int i; 317 int i;
318 318
319 if (dpyinfo->bitmaps == NULL) 319 if (dpyinfo->bitmaps == NULL)
320 { 320 {
321 dpyinfo->bitmaps_size = 10; 321 dpyinfo->bitmaps_size = 10;
322 dpyinfo->bitmaps 322 dpyinfo->bitmaps
323 = (struct win32_bitmap_record *) xmalloc (dpyinfo->bitmaps_size * sizeof (struct win32_bitmap_record)); 323 = (struct w32_bitmap_record *) xmalloc (dpyinfo->bitmaps_size * sizeof (struct w32_bitmap_record));
324 dpyinfo->bitmaps_last = 1; 324 dpyinfo->bitmaps_last = 1;
325 return 1; 325 return 1;
326 } 326 }
@@ -334,8 +334,8 @@ x_allocate_bitmap_record (f)
334 334
335 dpyinfo->bitmaps_size *= 2; 335 dpyinfo->bitmaps_size *= 2;
336 dpyinfo->bitmaps 336 dpyinfo->bitmaps
337 = (struct win32_bitmap_record *) xrealloc (dpyinfo->bitmaps, 337 = (struct w32_bitmap_record *) xrealloc (dpyinfo->bitmaps,
338 dpyinfo->bitmaps_size * sizeof (struct win32_bitmap_record)); 338 dpyinfo->bitmaps_size * sizeof (struct w32_bitmap_record));
339 return ++dpyinfo->bitmaps_last; 339 return ++dpyinfo->bitmaps_last;
340} 340}
341 341
@@ -346,7 +346,7 @@ x_reference_bitmap (f, id)
346 FRAME_PTR f; 346 FRAME_PTR f;
347 int id; 347 int id;
348{ 348{
349 ++FRAME_WIN32_DISPLAY_INFO (f)->bitmaps[id - 1].refcount; 349 ++FRAME_W32_DISPLAY_INFO (f)->bitmaps[id - 1].refcount;
350} 350}
351 351
352/* Create a bitmap for frame F from a HEIGHT x WIDTH array of bits at BITS. */ 352/* Create a bitmap for frame F from a HEIGHT x WIDTH array of bits at BITS. */
@@ -357,13 +357,13 @@ x_create_bitmap_from_data (f, bits, width, height)
357 char *bits; 357 char *bits;
358 unsigned int width, height; 358 unsigned int width, height;
359{ 359{
360 struct win32_display_info *dpyinfo = FRAME_WIN32_DISPLAY_INFO (f); 360 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
361 Pixmap bitmap; 361 Pixmap bitmap;
362 int id; 362 int id;
363 363
364 bitmap = CreateBitmap (width, height, 364 bitmap = CreateBitmap (width, height,
365 FRAME_WIN32_DISPLAY_INFO (XFRAME (frame))->n_planes, 365 FRAME_W32_DISPLAY_INFO (XFRAME (frame))->n_planes,
366 FRAME_WIN32_DISPLAY_INFO (XFRAME (frame))->n_cbits, 366 FRAME_W32_DISPLAY_INFO (XFRAME (frame))->n_cbits,
367 bits); 367 bits);
368 368
369 if (! bitmap) 369 if (! bitmap)
@@ -390,7 +390,7 @@ x_create_bitmap_from_file (f, file)
390{ 390{
391 return -1; 391 return -1;
392#if 0 392#if 0
393 struct win32_display_info *dpyinfo = FRAME_WIN32_DISPLAY_INFO (f); 393 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
394 unsigned int width, height; 394 unsigned int width, height;
395 Pixmap bitmap; 395 Pixmap bitmap;
396 int xhot, yhot, result, id; 396 int xhot, yhot, result, id;
@@ -425,7 +425,7 @@ x_create_bitmap_from_file (f, file)
425 return -1; 425 return -1;
426 426
427 427
428 result = XReadBitmapFile (FRAME_WIN32_DISPLAY (f), FRAME_WIN32_WINDOW (f), 428 result = XReadBitmapFile (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f),
429 filename, &width, &height, &bitmap, &xhot, &yhot); 429 filename, &width, &height, &bitmap, &xhot, &yhot);
430 if (result != BitmapSuccess) 430 if (result != BitmapSuccess)
431 return -1; 431 return -1;
@@ -450,7 +450,7 @@ x_destroy_bitmap (f, id)
450 FRAME_PTR f; 450 FRAME_PTR f;
451 int id; 451 int id;
452{ 452{
453 struct win32_display_info *dpyinfo = FRAME_WIN32_DISPLAY_INFO (f); 453 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
454 454
455 if (id > 0) 455 if (id > 0)
456 { 456 {
@@ -473,7 +473,7 @@ x_destroy_bitmap (f, id)
473 473
474static void 474static void
475x_destroy_all_bitmaps (dpyinfo) 475x_destroy_all_bitmaps (dpyinfo)
476 struct win32_display_info *dpyinfo; 476 struct w32_display_info *dpyinfo;
477{ 477{
478 int i; 478 int i;
479 for (i = 0; i < dpyinfo->bitmaps_last; i++) 479 for (i = 0; i < dpyinfo->bitmaps_last; i++)
@@ -486,7 +486,7 @@ x_destroy_all_bitmaps (dpyinfo)
486 dpyinfo->bitmaps_last = 0; 486 dpyinfo->bitmaps_last = 0;
487} 487}
488 488
489/* Connect the frame-parameter names for Win32 frames 489/* Connect the frame-parameter names for W32 frames
490 to the ways of passing the parameter values to the window system. 490 to the ways of passing the parameter values to the window system.
491 491
492 The name of a parameter, as a Lisp symbol, 492 The name of a parameter, as a Lisp symbol,
@@ -563,7 +563,7 @@ static struct x_frame_parm_table x_frame_parms[] =
563}; 563};
564 564
565/* Attach the `x-frame-parameter' properties to 565/* Attach the `x-frame-parameter' properties to
566 the Lisp symbol names of parameters relevant to Win32. */ 566 the Lisp symbol names of parameters relevant to W32. */
567 567
568init_x_parm_symbols () 568init_x_parm_symbols ()
569{ 569{
@@ -668,18 +668,18 @@ x_set_frame_parameters (f, alist)
668 if (EQ (left, Qunbound)) 668 if (EQ (left, Qunbound))
669 { 669 {
670 left_no_change = 1; 670 left_no_change = 1;
671 if (f->output_data.win32->left_pos < 0) 671 if (f->output_data.w32->left_pos < 0)
672 left = Fcons (Qplus, Fcons (make_number (f->output_data.win32->left_pos), Qnil)); 672 left = Fcons (Qplus, Fcons (make_number (f->output_data.w32->left_pos), Qnil));
673 else 673 else
674 XSETINT (left, f->output_data.win32->left_pos); 674 XSETINT (left, f->output_data.w32->left_pos);
675 } 675 }
676 if (EQ (top, Qunbound)) 676 if (EQ (top, Qunbound))
677 { 677 {
678 top_no_change = 1; 678 top_no_change = 1;
679 if (f->output_data.win32->top_pos < 0) 679 if (f->output_data.w32->top_pos < 0)
680 top = Fcons (Qplus, Fcons (make_number (f->output_data.win32->top_pos), Qnil)); 680 top = Fcons (Qplus, Fcons (make_number (f->output_data.w32->top_pos), Qnil));
681 else 681 else
682 XSETINT (top, f->output_data.win32->top_pos); 682 XSETINT (top, f->output_data.w32->top_pos);
683 } 683 }
684 684
685 /* If one of the icon positions was not set, preserve or default it. */ 685 /* If one of the icon positions was not set, preserve or default it. */
@@ -719,28 +719,28 @@ x_set_frame_parameters (f, alist)
719 719
720 if ((!NILP (left) || !NILP (top)) 720 if ((!NILP (left) || !NILP (top))
721 && ! (left_no_change && top_no_change) 721 && ! (left_no_change && top_no_change)
722 && ! (NUMBERP (left) && XINT (left) == f->output_data.win32->left_pos 722 && ! (NUMBERP (left) && XINT (left) == f->output_data.w32->left_pos
723 && NUMBERP (top) && XINT (top) == f->output_data.win32->top_pos)) 723 && NUMBERP (top) && XINT (top) == f->output_data.w32->top_pos))
724 { 724 {
725 int leftpos = 0; 725 int leftpos = 0;
726 int toppos = 0; 726 int toppos = 0;
727 727
728 /* Record the signs. */ 728 /* Record the signs. */
729 f->output_data.win32->size_hint_flags &= ~ (XNegative | YNegative); 729 f->output_data.w32->size_hint_flags &= ~ (XNegative | YNegative);
730 if (EQ (left, Qminus)) 730 if (EQ (left, Qminus))
731 f->output_data.win32->size_hint_flags |= XNegative; 731 f->output_data.w32->size_hint_flags |= XNegative;
732 else if (INTEGERP (left)) 732 else if (INTEGERP (left))
733 { 733 {
734 leftpos = XINT (left); 734 leftpos = XINT (left);
735 if (leftpos < 0) 735 if (leftpos < 0)
736 f->output_data.win32->size_hint_flags |= XNegative; 736 f->output_data.w32->size_hint_flags |= XNegative;
737 } 737 }
738 else if (CONSP (left) && EQ (XCONS (left)->car, Qminus) 738 else if (CONSP (left) && EQ (XCONS (left)->car, Qminus)
739 && CONSP (XCONS (left)->cdr) 739 && CONSP (XCONS (left)->cdr)
740 && INTEGERP (XCONS (XCONS (left)->cdr)->car)) 740 && INTEGERP (XCONS (XCONS (left)->cdr)->car))
741 { 741 {
742 leftpos = - XINT (XCONS (XCONS (left)->cdr)->car); 742 leftpos = - XINT (XCONS (XCONS (left)->cdr)->car);
743 f->output_data.win32->size_hint_flags |= XNegative; 743 f->output_data.w32->size_hint_flags |= XNegative;
744 } 744 }
745 else if (CONSP (left) && EQ (XCONS (left)->car, Qplus) 745 else if (CONSP (left) && EQ (XCONS (left)->car, Qplus)
746 && CONSP (XCONS (left)->cdr) 746 && CONSP (XCONS (left)->cdr)
@@ -750,19 +750,19 @@ x_set_frame_parameters (f, alist)
750 } 750 }
751 751
752 if (EQ (top, Qminus)) 752 if (EQ (top, Qminus))
753 f->output_data.win32->size_hint_flags |= YNegative; 753 f->output_data.w32->size_hint_flags |= YNegative;
754 else if (INTEGERP (top)) 754 else if (INTEGERP (top))
755 { 755 {
756 toppos = XINT (top); 756 toppos = XINT (top);
757 if (toppos < 0) 757 if (toppos < 0)
758 f->output_data.win32->size_hint_flags |= YNegative; 758 f->output_data.w32->size_hint_flags |= YNegative;
759 } 759 }
760 else if (CONSP (top) && EQ (XCONS (top)->car, Qminus) 760 else if (CONSP (top) && EQ (XCONS (top)->car, Qminus)
761 && CONSP (XCONS (top)->cdr) 761 && CONSP (XCONS (top)->cdr)
762 && INTEGERP (XCONS (XCONS (top)->cdr)->car)) 762 && INTEGERP (XCONS (XCONS (top)->cdr)->car))
763 { 763 {
764 toppos = - XINT (XCONS (XCONS (top)->cdr)->car); 764 toppos = - XINT (XCONS (XCONS (top)->cdr)->car);
765 f->output_data.win32->size_hint_flags |= YNegative; 765 f->output_data.w32->size_hint_flags |= YNegative;
766 } 766 }
767 else if (CONSP (top) && EQ (XCONS (top)->car, Qplus) 767 else if (CONSP (top) && EQ (XCONS (top)->car, Qplus)
768 && CONSP (XCONS (top)->cdr) 768 && CONSP (XCONS (top)->cdr)
@@ -773,10 +773,10 @@ x_set_frame_parameters (f, alist)
773 773
774 774
775 /* Store the numeric value of the position. */ 775 /* Store the numeric value of the position. */
776 f->output_data.win32->top_pos = toppos; 776 f->output_data.w32->top_pos = toppos;
777 f->output_data.win32->left_pos = leftpos; 777 f->output_data.w32->left_pos = leftpos;
778 778
779 f->output_data.win32->win_gravity = NorthWestGravity; 779 f->output_data.w32->win_gravity = NorthWestGravity;
780 780
781 /* Actually set that position, and convert to absolute. */ 781 /* Actually set that position, and convert to absolute. */
782 x_set_offset (f, leftpos, toppos, -1); 782 x_set_offset (f, leftpos, toppos, -1);
@@ -802,14 +802,14 @@ x_real_positions (f, xptr, yptr)
802 { 802 {
803 RECT rect; 803 RECT rect;
804 804
805 GetClientRect(FRAME_WIN32_WINDOW(f), &rect); 805 GetClientRect(FRAME_W32_WINDOW(f), &rect);
806 AdjustWindowRect(&rect, f->output_data.win32->dwStyle, FRAME_EXTERNAL_MENU_BAR(f)); 806 AdjustWindowRect(&rect, f->output_data.w32->dwStyle, FRAME_EXTERNAL_MENU_BAR(f));
807 807
808 pt.x = rect.left; 808 pt.x = rect.left;
809 pt.y = rect.top; 809 pt.y = rect.top;
810 } 810 }
811 811
812 ClientToScreen (FRAME_WIN32_WINDOW(f), &pt); 812 ClientToScreen (FRAME_W32_WINDOW(f), &pt);
813 813
814 *xptr = pt.x; 814 *xptr = pt.x;
815 *yptr = pt.y; 815 *yptr = pt.y;
@@ -817,7 +817,7 @@ x_real_positions (f, xptr, yptr)
817 817
818/* Insert a description of internally-recorded parameters of frame X 818/* Insert a description of internally-recorded parameters of frame X
819 into the parameter alist *ALISTPTR that is to be given to the user. 819 into the parameter alist *ALISTPTR that is to be given to the user.
820 Only parameters that are specific to Win32 820 Only parameters that are specific to W32
821 and whose values are not correctly recorded in the frame's 821 and whose values are not correctly recorded in the frame's
822 param_alist need to be considered here. */ 822 param_alist need to be considered here. */
823 823
@@ -830,23 +830,23 @@ x_report_frame_params (f, alistptr)
830 830
831 /* Represent negative positions (off the top or left screen edge) 831 /* Represent negative positions (off the top or left screen edge)
832 in a way that Fmodify_frame_parameters will understand correctly. */ 832 in a way that Fmodify_frame_parameters will understand correctly. */
833 XSETINT (tem, f->output_data.win32->left_pos); 833 XSETINT (tem, f->output_data.w32->left_pos);
834 if (f->output_data.win32->left_pos >= 0) 834 if (f->output_data.w32->left_pos >= 0)
835 store_in_alist (alistptr, Qleft, tem); 835 store_in_alist (alistptr, Qleft, tem);
836 else 836 else
837 store_in_alist (alistptr, Qleft, Fcons (Qplus, Fcons (tem, Qnil))); 837 store_in_alist (alistptr, Qleft, Fcons (Qplus, Fcons (tem, Qnil)));
838 838
839 XSETINT (tem, f->output_data.win32->top_pos); 839 XSETINT (tem, f->output_data.w32->top_pos);
840 if (f->output_data.win32->top_pos >= 0) 840 if (f->output_data.w32->top_pos >= 0)
841 store_in_alist (alistptr, Qtop, tem); 841 store_in_alist (alistptr, Qtop, tem);
842 else 842 else
843 store_in_alist (alistptr, Qtop, Fcons (Qplus, Fcons (tem, Qnil))); 843 store_in_alist (alistptr, Qtop, Fcons (Qplus, Fcons (tem, Qnil)));
844 844
845 store_in_alist (alistptr, Qborder_width, 845 store_in_alist (alistptr, Qborder_width,
846 make_number (f->output_data.win32->border_width)); 846 make_number (f->output_data.w32->border_width));
847 store_in_alist (alistptr, Qinternal_border_width, 847 store_in_alist (alistptr, Qinternal_border_width,
848 make_number (f->output_data.win32->internal_border_width)); 848 make_number (f->output_data.w32->internal_border_width));
849 sprintf (buf, "%ld", (long) FRAME_WIN32_WINDOW (f)); 849 sprintf (buf, "%ld", (long) FRAME_W32_WINDOW (f));
850 store_in_alist (alistptr, Qwindow_id, 850 store_in_alist (alistptr, Qwindow_id,
851 build_string (buf)); 851 build_string (buf));
852 store_in_alist (alistptr, Qicon_name, f->icon_name); 852 store_in_alist (alistptr, Qicon_name, f->icon_name);
@@ -855,13 +855,13 @@ x_report_frame_params (f, alistptr)
855 (FRAME_VISIBLE_P (f) ? Qt 855 (FRAME_VISIBLE_P (f) ? Qt
856 : FRAME_ICONIFIED_P (f) ? Qicon : Qnil)); 856 : FRAME_ICONIFIED_P (f) ? Qicon : Qnil));
857 store_in_alist (alistptr, Qdisplay, 857 store_in_alist (alistptr, Qdisplay,
858 XCONS (FRAME_WIN32_DISPLAY_INFO (f)->name_list_element)->car); 858 XCONS (FRAME_W32_DISPLAY_INFO (f)->name_list_element)->car);
859} 859}
860 860
861 861
862DEFUN ("win32-define-rgb-color", Fwin32_define_rgb_color, Swin32_define_rgb_color, 4, 4, 0, 862DEFUN ("w32-define-rgb-color", Fw32_define_rgb_color, Sw32_define_rgb_color, 4, 4, 0,
863 "Convert RGB numbers to a windows color reference and associate with NAME (a string).\n\ 863 "Convert RGB numbers to a windows color reference and associate with NAME (a string).\n\
864This adds or updates a named color to win32-color-map, making it available for use.\n\ 864This adds or updates a named color to w32-color-map, making it available for use.\n\
865The original entry's RGB ref is returned, or nil if the entry is new.") 865The original entry's RGB ref is returned, or nil if the entry is new.")
866 (red, green, blue, name) 866 (red, green, blue, name)
867 Lisp_Object red, green, blue, name; 867 Lisp_Object red, green, blue, name;
@@ -879,12 +879,12 @@ The original entry's RGB ref is returned, or nil if the entry is new.")
879 879
880 BLOCK_INPUT; 880 BLOCK_INPUT;
881 881
882 /* replace existing entry in win32-color-map or add new entry. */ 882 /* replace existing entry in w32-color-map or add new entry. */
883 entry = Fassoc (name, Vwin32_color_map); 883 entry = Fassoc (name, Vw32_color_map);
884 if (NILP (entry)) 884 if (NILP (entry))
885 { 885 {
886 entry = Fcons (name, rgb); 886 entry = Fcons (name, rgb);
887 Vwin32_color_map = Fcons (entry, Vwin32_color_map); 887 Vw32_color_map = Fcons (entry, Vw32_color_map);
888 } 888 }
889 else 889 else
890 { 890 {
@@ -897,9 +897,9 @@ The original entry's RGB ref is returned, or nil if the entry is new.")
897 return (oldrgb); 897 return (oldrgb);
898} 898}
899 899
900DEFUN ("win32-load-color-file", Fwin32_load_color_file, Swin32_load_color_file, 1, 1, 0, 900DEFUN ("w32-load-color-file", Fw32_load_color_file, Sw32_load_color_file, 1, 1, 0,
901 "Create an alist of color entries from an external file (ie. rgb.txt).\n\ 901 "Create an alist of color entries from an external file (ie. rgb.txt).\n\
902Assign this value to win32-color-map to replace the existing color map.\n\ 902Assign this value to w32-color-map to replace the existing color map.\n\
903\ 903\
904The file should define one named RGB color per line like so:\ 904The file should define one named RGB color per line like so:\
905 R G B name\n\ 905 R G B name\n\
@@ -943,14 +943,14 @@ where R,G,B are numbers between 0 and 255 and name is an arbitrary string.")
943 return cmap; 943 return cmap;
944} 944}
945 945
946/* The default colors for the win32 color map */ 946/* The default colors for the w32 color map */
947typedef struct colormap_t 947typedef struct colormap_t
948{ 948{
949 char *name; 949 char *name;
950 COLORREF colorref; 950 COLORREF colorref;
951} colormap_t; 951} colormap_t;
952 952
953colormap_t win32_color_map[] = 953colormap_t w32_color_map[] =
954{ 954{
955 {"snow" , PALETTERGB (255,250,250)}, 955 {"snow" , PALETTERGB (255,250,250)},
956 {"ghost white" , PALETTERGB (248,248,255)}, 956 {"ghost white" , PALETTERGB (248,248,255)},
@@ -1194,19 +1194,19 @@ colormap_t win32_color_map[] =
1194 {"LightGreen" , PALETTERGB (144,238,144)}, 1194 {"LightGreen" , PALETTERGB (144,238,144)},
1195}; 1195};
1196 1196
1197DEFUN ("win32-default-color-map", Fwin32_default_color_map, Swin32_default_color_map, 1197DEFUN ("w32-default-color-map", Fw32_default_color_map, Sw32_default_color_map,
1198 0, 0, 0, "Return the default color map.") 1198 0, 0, 0, "Return the default color map.")
1199 () 1199 ()
1200{ 1200{
1201 int i; 1201 int i;
1202 colormap_t *pc = win32_color_map; 1202 colormap_t *pc = w32_color_map;
1203 Lisp_Object cmap; 1203 Lisp_Object cmap;
1204 1204
1205 BLOCK_INPUT; 1205 BLOCK_INPUT;
1206 1206
1207 cmap = Qnil; 1207 cmap = Qnil;
1208 1208
1209 for (i = 0; i < sizeof (win32_color_map) / sizeof (win32_color_map[0]); 1209 for (i = 0; i < sizeof (w32_color_map) / sizeof (w32_color_map[0]);
1210 pc++, i++) 1210 pc++, i++)
1211 cmap = Fcons (Fcons (build_string (pc->name), 1211 cmap = Fcons (Fcons (build_string (pc->name),
1212 make_number (pc->colorref)), 1212 make_number (pc->colorref)),
@@ -1218,7 +1218,7 @@ DEFUN ("win32-default-color-map", Fwin32_default_color_map, Swin32_default_color
1218} 1218}
1219 1219
1220Lisp_Object 1220Lisp_Object
1221win32_to_x_color (rgb) 1221w32_to_x_color (rgb)
1222 Lisp_Object rgb; 1222 Lisp_Object rgb;
1223{ 1223{
1224 Lisp_Object color; 1224 Lisp_Object color;
@@ -1227,7 +1227,7 @@ win32_to_x_color (rgb)
1227 1227
1228 BLOCK_INPUT; 1228 BLOCK_INPUT;
1229 1229
1230 color = Frassq (rgb, Vwin32_color_map); 1230 color = Frassq (rgb, Vw32_color_map);
1231 1231
1232 UNBLOCK_INPUT; 1232 UNBLOCK_INPUT;
1233 1233
@@ -1238,14 +1238,14 @@ win32_to_x_color (rgb)
1238} 1238}
1239 1239
1240COLORREF 1240COLORREF
1241x_to_win32_color (colorname) 1241x_to_w32_color (colorname)
1242 char * colorname; 1242 char * colorname;
1243{ 1243{
1244 register Lisp_Object tail, ret = Qnil; 1244 register Lisp_Object tail, ret = Qnil;
1245 1245
1246 BLOCK_INPUT; 1246 BLOCK_INPUT;
1247 1247
1248 for (tail = Vwin32_color_map; !NILP (tail); tail = Fcdr (tail)) 1248 for (tail = Vw32_color_map; !NILP (tail); tail = Fcdr (tail))
1249 { 1249 {
1250 register Lisp_Object elt, tem; 1250 register Lisp_Object elt, tem;
1251 1251
@@ -1270,26 +1270,26 @@ x_to_win32_color (colorname)
1270 1270
1271 1271
1272void 1272void
1273win32_regenerate_palette (FRAME_PTR f) 1273w32_regenerate_palette (FRAME_PTR f)
1274{ 1274{
1275 struct win32_palette_entry * list; 1275 struct w32_palette_entry * list;
1276 LOGPALETTE * log_palette; 1276 LOGPALETTE * log_palette;
1277 HPALETTE new_palette; 1277 HPALETTE new_palette;
1278 int i; 1278 int i;
1279 1279
1280 /* don't bother trying to create palette if not supported */ 1280 /* don't bother trying to create palette if not supported */
1281 if (! FRAME_WIN32_DISPLAY_INFO (f)->has_palette) 1281 if (! FRAME_W32_DISPLAY_INFO (f)->has_palette)
1282 return; 1282 return;
1283 1283
1284 log_palette = (LOGPALETTE *) 1284 log_palette = (LOGPALETTE *)
1285 alloca (sizeof (LOGPALETTE) + 1285 alloca (sizeof (LOGPALETTE) +
1286 FRAME_WIN32_DISPLAY_INFO (f)->num_colors * sizeof (PALETTEENTRY)); 1286 FRAME_W32_DISPLAY_INFO (f)->num_colors * sizeof (PALETTEENTRY));
1287 log_palette->palVersion = 0x300; 1287 log_palette->palVersion = 0x300;
1288 log_palette->palNumEntries = FRAME_WIN32_DISPLAY_INFO (f)->num_colors; 1288 log_palette->palNumEntries = FRAME_W32_DISPLAY_INFO (f)->num_colors;
1289 1289
1290 list = FRAME_WIN32_DISPLAY_INFO (f)->color_list; 1290 list = FRAME_W32_DISPLAY_INFO (f)->color_list;
1291 for (i = 0; 1291 for (i = 0;
1292 i < FRAME_WIN32_DISPLAY_INFO (f)->num_colors; 1292 i < FRAME_W32_DISPLAY_INFO (f)->num_colors;
1293 i++, list = list->next) 1293 i++, list = list->next)
1294 log_palette->palPalEntry[i] = list->entry; 1294 log_palette->palPalEntry[i] = list->entry;
1295 1295
@@ -1297,9 +1297,9 @@ win32_regenerate_palette (FRAME_PTR f)
1297 1297
1298 enter_crit (); 1298 enter_crit ();
1299 1299
1300 if (FRAME_WIN32_DISPLAY_INFO (f)->palette) 1300 if (FRAME_W32_DISPLAY_INFO (f)->palette)
1301 DeleteObject (FRAME_WIN32_DISPLAY_INFO (f)->palette); 1301 DeleteObject (FRAME_W32_DISPLAY_INFO (f)->palette);
1302 FRAME_WIN32_DISPLAY_INFO (f)->palette = new_palette; 1302 FRAME_W32_DISPLAY_INFO (f)->palette = new_palette;
1303 1303
1304 /* Realize display palette and garbage all frames. */ 1304 /* Realize display palette and garbage all frames. */
1305 release_frame_dc (f, get_frame_dc (f)); 1305 release_frame_dc (f, get_frame_dc (f));
@@ -1307,8 +1307,8 @@ win32_regenerate_palette (FRAME_PTR f)
1307 leave_crit (); 1307 leave_crit ();
1308} 1308}
1309 1309
1310#define WIN32_COLOR(pe) RGB (pe.peRed, pe.peGreen, pe.peBlue) 1310#define W32_COLOR(pe) RGB (pe.peRed, pe.peGreen, pe.peBlue)
1311#define SET_WIN32_COLOR(pe, color) \ 1311#define SET_W32_COLOR(pe, color) \
1312 do \ 1312 do \
1313 { \ 1313 { \
1314 pe.peRed = GetRValue (color); \ 1314 pe.peRed = GetRValue (color); \
@@ -1320,17 +1320,17 @@ win32_regenerate_palette (FRAME_PTR f)
1320#if 0 1320#if 0
1321/* Keep these around in case we ever want to track color usage. */ 1321/* Keep these around in case we ever want to track color usage. */
1322void 1322void
1323win32_map_color (FRAME_PTR f, COLORREF color) 1323w32_map_color (FRAME_PTR f, COLORREF color)
1324{ 1324{
1325 struct win32_palette_entry * list = FRAME_WIN32_DISPLAY_INFO (f)->color_list; 1325 struct w32_palette_entry * list = FRAME_W32_DISPLAY_INFO (f)->color_list;
1326 1326
1327 if (NILP (Vwin32_enable_palette)) 1327 if (NILP (Vw32_enable_palette))
1328 return; 1328 return;
1329 1329
1330 /* check if color is already mapped */ 1330 /* check if color is already mapped */
1331 while (list) 1331 while (list)
1332 { 1332 {
1333 if (WIN32_COLOR (list->entry) == color) 1333 if (W32_COLOR (list->entry) == color)
1334 { 1334 {
1335 ++list->refcount; 1335 ++list->refcount;
1336 return; 1336 return;
@@ -1339,37 +1339,37 @@ win32_map_color (FRAME_PTR f, COLORREF color)
1339 } 1339 }
1340 1340
1341 /* not already mapped, so add to list and recreate Windows palette */ 1341 /* not already mapped, so add to list and recreate Windows palette */
1342 list = (struct win32_palette_entry *) 1342 list = (struct w32_palette_entry *)
1343 xmalloc (sizeof (struct win32_palette_entry)); 1343 xmalloc (sizeof (struct w32_palette_entry));
1344 SET_WIN32_COLOR (list->entry, color); 1344 SET_W32_COLOR (list->entry, color);
1345 list->refcount = 1; 1345 list->refcount = 1;
1346 list->next = FRAME_WIN32_DISPLAY_INFO (f)->color_list; 1346 list->next = FRAME_W32_DISPLAY_INFO (f)->color_list;
1347 FRAME_WIN32_DISPLAY_INFO (f)->color_list = list; 1347 FRAME_W32_DISPLAY_INFO (f)->color_list = list;
1348 FRAME_WIN32_DISPLAY_INFO (f)->num_colors++; 1348 FRAME_W32_DISPLAY_INFO (f)->num_colors++;
1349 1349
1350 /* set flag that palette must be regenerated */ 1350 /* set flag that palette must be regenerated */
1351 FRAME_WIN32_DISPLAY_INFO (f)->regen_palette = TRUE; 1351 FRAME_W32_DISPLAY_INFO (f)->regen_palette = TRUE;
1352} 1352}
1353 1353
1354void 1354void
1355win32_unmap_color (FRAME_PTR f, COLORREF color) 1355w32_unmap_color (FRAME_PTR f, COLORREF color)
1356{ 1356{
1357 struct win32_palette_entry * list = FRAME_WIN32_DISPLAY_INFO (f)->color_list; 1357 struct w32_palette_entry * list = FRAME_W32_DISPLAY_INFO (f)->color_list;
1358 struct win32_palette_entry **prev = &FRAME_WIN32_DISPLAY_INFO (f)->color_list; 1358 struct w32_palette_entry **prev = &FRAME_W32_DISPLAY_INFO (f)->color_list;
1359 1359
1360 if (NILP (Vwin32_enable_palette)) 1360 if (NILP (Vw32_enable_palette))
1361 return; 1361 return;
1362 1362
1363 /* check if color is already mapped */ 1363 /* check if color is already mapped */
1364 while (list) 1364 while (list)
1365 { 1365 {
1366 if (WIN32_COLOR (list->entry) == color) 1366 if (W32_COLOR (list->entry) == color)
1367 { 1367 {
1368 if (--list->refcount == 0) 1368 if (--list->refcount == 0)
1369 { 1369 {
1370 *prev = list->next; 1370 *prev = list->next;
1371 xfree (list); 1371 xfree (list);
1372 FRAME_WIN32_DISPLAY_INFO (f)->num_colors--; 1372 FRAME_W32_DISPLAY_INFO (f)->num_colors--;
1373 break; 1373 break;
1374 } 1374 }
1375 else 1375 else
@@ -1380,7 +1380,7 @@ win32_unmap_color (FRAME_PTR f, COLORREF color)
1380 } 1380 }
1381 1381
1382 /* set flag that palette must be regenerated */ 1382 /* set flag that palette must be regenerated */
1383 FRAME_WIN32_DISPLAY_INFO (f)->regen_palette = TRUE; 1383 FRAME_W32_DISPLAY_INFO (f)->regen_palette = TRUE;
1384} 1384}
1385#endif 1385#endif
1386 1386
@@ -1397,21 +1397,21 @@ defined_color (f, color, color_def, alloc)
1397{ 1397{
1398 register Lisp_Object tem; 1398 register Lisp_Object tem;
1399 1399
1400 tem = x_to_win32_color (color); 1400 tem = x_to_w32_color (color);
1401 1401
1402 if (!NILP (tem)) 1402 if (!NILP (tem))
1403 { 1403 {
1404 if (!NILP (Vwin32_enable_palette)) 1404 if (!NILP (Vw32_enable_palette))
1405 { 1405 {
1406 struct win32_palette_entry * entry = 1406 struct w32_palette_entry * entry =
1407 FRAME_WIN32_DISPLAY_INFO (f)->color_list; 1407 FRAME_W32_DISPLAY_INFO (f)->color_list;
1408 struct win32_palette_entry ** prev = 1408 struct w32_palette_entry ** prev =
1409 &FRAME_WIN32_DISPLAY_INFO (f)->color_list; 1409 &FRAME_W32_DISPLAY_INFO (f)->color_list;
1410 1410
1411 /* check if color is already mapped */ 1411 /* check if color is already mapped */
1412 while (entry) 1412 while (entry)
1413 { 1413 {
1414 if (WIN32_COLOR (entry->entry) == XUINT (tem)) 1414 if (W32_COLOR (entry->entry) == XUINT (tem))
1415 break; 1415 break;
1416 prev = &entry->next; 1416 prev = &entry->next;
1417 entry = entry->next; 1417 entry = entry->next;
@@ -1420,15 +1420,15 @@ defined_color (f, color, color_def, alloc)
1420 if (entry == NULL && alloc) 1420 if (entry == NULL && alloc)
1421 { 1421 {
1422 /* not already mapped, so add to list */ 1422 /* not already mapped, so add to list */
1423 entry = (struct win32_palette_entry *) 1423 entry = (struct w32_palette_entry *)
1424 xmalloc (sizeof (struct win32_palette_entry)); 1424 xmalloc (sizeof (struct w32_palette_entry));
1425 SET_WIN32_COLOR (entry->entry, XUINT (tem)); 1425 SET_W32_COLOR (entry->entry, XUINT (tem));
1426 entry->next = NULL; 1426 entry->next = NULL;
1427 *prev = entry; 1427 *prev = entry;
1428 FRAME_WIN32_DISPLAY_INFO (f)->num_colors++; 1428 FRAME_W32_DISPLAY_INFO (f)->num_colors++;
1429 1429
1430 /* set flag that palette must be regenerated */ 1430 /* set flag that palette must be regenerated */
1431 FRAME_WIN32_DISPLAY_INFO (f)->regen_palette = TRUE; 1431 FRAME_W32_DISPLAY_INFO (f)->regen_palette = TRUE;
1432 } 1432 }
1433 } 1433 }
1434 /* Ensure COLORREF value is snapped to nearest color in (default) 1434 /* Ensure COLORREF value is snapped to nearest color in (default)
@@ -1463,7 +1463,7 @@ x_decode_color (f, arg, def)
1463 else if (strcmp (XSTRING (arg)->data, "white") == 0) 1463 else if (strcmp (XSTRING (arg)->data, "white") == 0)
1464 return WHITE_PIX_DEFAULT (f); 1464 return WHITE_PIX_DEFAULT (f);
1465 1465
1466 if ((FRAME_WIN32_DISPLAY_INFO (f)->n_planes * FRAME_WIN32_DISPLAY_INFO (f)->n_cbits) == 1) 1466 if ((FRAME_W32_DISPLAY_INFO (f)->n_planes * FRAME_W32_DISPLAY_INFO (f)->n_cbits) == 1)
1467 return def; 1467 return def;
1468 1468
1469 /* defined_color is responsible for coping with failures 1469 /* defined_color is responsible for coping with failures
@@ -1478,7 +1478,7 @@ x_decode_color (f, arg, def)
1478/* Functions called only from `x_set_frame_param' 1478/* Functions called only from `x_set_frame_param'
1479 to set individual parameters. 1479 to set individual parameters.
1480 1480
1481 If FRAME_WIN32_WINDOW (f) is 0, 1481 If FRAME_W32_WINDOW (f) is 0,
1482 the frame is being created and its window does not exist yet. 1482 the frame is being created and its window does not exist yet.
1483 In that case, just record the parameter's new value 1483 In that case, just record the parameter's new value
1484 in the standard place; do not attempt to change the window. */ 1484 in the standard place; do not attempt to change the window. */
@@ -1488,10 +1488,10 @@ x_set_foreground_color (f, arg, oldval)
1488 struct frame *f; 1488 struct frame *f;
1489 Lisp_Object arg, oldval; 1489 Lisp_Object arg, oldval;
1490{ 1490{
1491 f->output_data.win32->foreground_pixel 1491 f->output_data.w32->foreground_pixel
1492 = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); 1492 = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
1493 1493
1494 if (FRAME_WIN32_WINDOW (f) != 0) 1494 if (FRAME_W32_WINDOW (f) != 0)
1495 { 1495 {
1496 recompute_basic_faces (f); 1496 recompute_basic_faces (f);
1497 if (FRAME_VISIBLE_P (f)) 1497 if (FRAME_VISIBLE_P (f))
@@ -1507,12 +1507,12 @@ x_set_background_color (f, arg, oldval)
1507 Pixmap temp; 1507 Pixmap temp;
1508 int mask; 1508 int mask;
1509 1509
1510 f->output_data.win32->background_pixel 1510 f->output_data.w32->background_pixel
1511 = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f)); 1511 = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f));
1512 1512
1513 if (FRAME_WIN32_WINDOW (f) != 0) 1513 if (FRAME_W32_WINDOW (f) != 0)
1514 { 1514 {
1515 SetWindowLong (FRAME_WIN32_WINDOW (f), WND_BACKGROUND_INDEX, f->output_data.win32->background_pixel); 1515 SetWindowLong (FRAME_W32_WINDOW (f), WND_BACKGROUND_INDEX, f->output_data.w32->background_pixel);
1516 1516
1517 recompute_basic_faces (f); 1517 recompute_basic_faces (f);
1518 1518
@@ -1532,110 +1532,110 @@ x_set_mouse_color (f, arg, oldval)
1532 int mask_color; 1532 int mask_color;
1533 1533
1534 if (!EQ (Qnil, arg)) 1534 if (!EQ (Qnil, arg))
1535 f->output_data.win32->mouse_pixel 1535 f->output_data.w32->mouse_pixel
1536 = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); 1536 = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
1537 mask_color = f->output_data.win32->background_pixel; 1537 mask_color = f->output_data.w32->background_pixel;
1538 /* No invisible pointers. */ 1538 /* No invisible pointers. */
1539 if (mask_color == f->output_data.win32->mouse_pixel 1539 if (mask_color == f->output_data.w32->mouse_pixel
1540 && mask_color == f->output_data.win32->background_pixel) 1540 && mask_color == f->output_data.w32->background_pixel)
1541 f->output_data.win32->mouse_pixel = f->output_data.win32->foreground_pixel; 1541 f->output_data.w32->mouse_pixel = f->output_data.w32->foreground_pixel;
1542 1542
1543#if 0 1543#if 0
1544 BLOCK_INPUT; 1544 BLOCK_INPUT;
1545 1545
1546 /* It's not okay to crash if the user selects a screwy cursor. */ 1546 /* It's not okay to crash if the user selects a screwy cursor. */
1547 x_catch_errors (FRAME_WIN32_DISPLAY (f)); 1547 x_catch_errors (FRAME_W32_DISPLAY (f));
1548 1548
1549 if (!EQ (Qnil, Vx_pointer_shape)) 1549 if (!EQ (Qnil, Vx_pointer_shape))
1550 { 1550 {
1551 CHECK_NUMBER (Vx_pointer_shape, 0); 1551 CHECK_NUMBER (Vx_pointer_shape, 0);
1552 cursor = XCreateFontCursor (FRAME_WIN32_DISPLAY (f), XINT (Vx_pointer_shape)); 1552 cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XINT (Vx_pointer_shape));
1553 } 1553 }
1554 else 1554 else
1555 cursor = XCreateFontCursor (FRAME_WIN32_DISPLAY (f), XC_xterm); 1555 cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_xterm);
1556 x_check_errors (FRAME_WIN32_DISPLAY (f), "bad text pointer cursor: %s"); 1556 x_check_errors (FRAME_W32_DISPLAY (f), "bad text pointer cursor: %s");
1557 1557
1558 if (!EQ (Qnil, Vx_nontext_pointer_shape)) 1558 if (!EQ (Qnil, Vx_nontext_pointer_shape))
1559 { 1559 {
1560 CHECK_NUMBER (Vx_nontext_pointer_shape, 0); 1560 CHECK_NUMBER (Vx_nontext_pointer_shape, 0);
1561 nontext_cursor = XCreateFontCursor (FRAME_WIN32_DISPLAY (f), 1561 nontext_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f),
1562 XINT (Vx_nontext_pointer_shape)); 1562 XINT (Vx_nontext_pointer_shape));
1563 } 1563 }
1564 else 1564 else
1565 nontext_cursor = XCreateFontCursor (FRAME_WIN32_DISPLAY (f), XC_left_ptr); 1565 nontext_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_left_ptr);
1566 x_check_errors (FRAME_WIN32_DISPLAY (f), "bad nontext pointer cursor: %s"); 1566 x_check_errors (FRAME_W32_DISPLAY (f), "bad nontext pointer cursor: %s");
1567 1567
1568 if (!EQ (Qnil, Vx_mode_pointer_shape)) 1568 if (!EQ (Qnil, Vx_mode_pointer_shape))
1569 { 1569 {
1570 CHECK_NUMBER (Vx_mode_pointer_shape, 0); 1570 CHECK_NUMBER (Vx_mode_pointer_shape, 0);
1571 mode_cursor = XCreateFontCursor (FRAME_WIN32_DISPLAY (f), 1571 mode_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f),
1572 XINT (Vx_mode_pointer_shape)); 1572 XINT (Vx_mode_pointer_shape));
1573 } 1573 }
1574 else 1574 else
1575 mode_cursor = XCreateFontCursor (FRAME_WIN32_DISPLAY (f), XC_xterm); 1575 mode_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_xterm);
1576 x_check_errors (FRAME_WIN32_DISPLAY (f), "bad modeline pointer cursor: %s"); 1576 x_check_errors (FRAME_W32_DISPLAY (f), "bad modeline pointer cursor: %s");
1577 1577
1578 if (!EQ (Qnil, Vx_sensitive_text_pointer_shape)) 1578 if (!EQ (Qnil, Vx_sensitive_text_pointer_shape))
1579 { 1579 {
1580 CHECK_NUMBER (Vx_sensitive_text_pointer_shape, 0); 1580 CHECK_NUMBER (Vx_sensitive_text_pointer_shape, 0);
1581 cross_cursor 1581 cross_cursor
1582 = XCreateFontCursor (FRAME_WIN32_DISPLAY (f), 1582 = XCreateFontCursor (FRAME_W32_DISPLAY (f),
1583 XINT (Vx_sensitive_text_pointer_shape)); 1583 XINT (Vx_sensitive_text_pointer_shape));
1584 } 1584 }
1585 else 1585 else
1586 cross_cursor = XCreateFontCursor (FRAME_WIN32_DISPLAY (f), XC_crosshair); 1586 cross_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_crosshair);
1587 1587
1588 /* Check and report errors with the above calls. */ 1588 /* Check and report errors with the above calls. */
1589 x_check_errors (FRAME_WIN32_DISPLAY (f), "can't set cursor shape: %s"); 1589 x_check_errors (FRAME_W32_DISPLAY (f), "can't set cursor shape: %s");
1590 x_uncatch_errors (FRAME_WIN32_DISPLAY (f)); 1590 x_uncatch_errors (FRAME_W32_DISPLAY (f));
1591 1591
1592 { 1592 {
1593 XColor fore_color, back_color; 1593 XColor fore_color, back_color;
1594 1594
1595 fore_color.pixel = f->output_data.win32->mouse_pixel; 1595 fore_color.pixel = f->output_data.w32->mouse_pixel;
1596 back_color.pixel = mask_color; 1596 back_color.pixel = mask_color;
1597 XQueryColor (FRAME_WIN32_DISPLAY (f), 1597 XQueryColor (FRAME_W32_DISPLAY (f),
1598 DefaultColormap (FRAME_WIN32_DISPLAY (f), 1598 DefaultColormap (FRAME_W32_DISPLAY (f),
1599 DefaultScreen (FRAME_WIN32_DISPLAY (f))), 1599 DefaultScreen (FRAME_W32_DISPLAY (f))),
1600 &fore_color); 1600 &fore_color);
1601 XQueryColor (FRAME_WIN32_DISPLAY (f), 1601 XQueryColor (FRAME_W32_DISPLAY (f),
1602 DefaultColormap (FRAME_WIN32_DISPLAY (f), 1602 DefaultColormap (FRAME_W32_DISPLAY (f),
1603 DefaultScreen (FRAME_WIN32_DISPLAY (f))), 1603 DefaultScreen (FRAME_W32_DISPLAY (f))),
1604 &back_color); 1604 &back_color);
1605 XRecolorCursor (FRAME_WIN32_DISPLAY (f), cursor, 1605 XRecolorCursor (FRAME_W32_DISPLAY (f), cursor,
1606 &fore_color, &back_color); 1606 &fore_color, &back_color);
1607 XRecolorCursor (FRAME_WIN32_DISPLAY (f), nontext_cursor, 1607 XRecolorCursor (FRAME_W32_DISPLAY (f), nontext_cursor,
1608 &fore_color, &back_color); 1608 &fore_color, &back_color);
1609 XRecolorCursor (FRAME_WIN32_DISPLAY (f), mode_cursor, 1609 XRecolorCursor (FRAME_W32_DISPLAY (f), mode_cursor,
1610 &fore_color, &back_color); 1610 &fore_color, &back_color);
1611 XRecolorCursor (FRAME_WIN32_DISPLAY (f), cross_cursor, 1611 XRecolorCursor (FRAME_W32_DISPLAY (f), cross_cursor,
1612 &fore_color, &back_color); 1612 &fore_color, &back_color);
1613 } 1613 }
1614 1614
1615 if (FRAME_WIN32_WINDOW (f) != 0) 1615 if (FRAME_W32_WINDOW (f) != 0)
1616 { 1616 {
1617 XDefineCursor (FRAME_WIN32_DISPLAY (f), FRAME_WIN32_WINDOW (f), cursor); 1617 XDefineCursor (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), cursor);
1618 } 1618 }
1619 1619
1620 if (cursor != f->output_data.win32->text_cursor && f->output_data.win32->text_cursor != 0) 1620 if (cursor != f->output_data.w32->text_cursor && f->output_data.w32->text_cursor != 0)
1621 XFreeCursor (FRAME_WIN32_DISPLAY (f), f->output_data.win32->text_cursor); 1621 XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->text_cursor);
1622 f->output_data.win32->text_cursor = cursor; 1622 f->output_data.w32->text_cursor = cursor;
1623 1623
1624 if (nontext_cursor != f->output_data.win32->nontext_cursor 1624 if (nontext_cursor != f->output_data.w32->nontext_cursor
1625 && f->output_data.win32->nontext_cursor != 0) 1625 && f->output_data.w32->nontext_cursor != 0)
1626 XFreeCursor (FRAME_WIN32_DISPLAY (f), f->output_data.win32->nontext_cursor); 1626 XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->nontext_cursor);
1627 f->output_data.win32->nontext_cursor = nontext_cursor; 1627 f->output_data.w32->nontext_cursor = nontext_cursor;
1628 1628
1629 if (mode_cursor != f->output_data.win32->modeline_cursor 1629 if (mode_cursor != f->output_data.w32->modeline_cursor
1630 && f->output_data.win32->modeline_cursor != 0) 1630 && f->output_data.w32->modeline_cursor != 0)
1631 XFreeCursor (FRAME_WIN32_DISPLAY (f), f->output_data.win32->modeline_cursor); 1631 XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->modeline_cursor);
1632 f->output_data.win32->modeline_cursor = mode_cursor; 1632 f->output_data.w32->modeline_cursor = mode_cursor;
1633 if (cross_cursor != f->output_data.win32->cross_cursor 1633 if (cross_cursor != f->output_data.w32->cross_cursor
1634 && f->output_data.win32->cross_cursor != 0) 1634 && f->output_data.w32->cross_cursor != 0)
1635 XFreeCursor (FRAME_WIN32_DISPLAY (f), f->output_data.win32->cross_cursor); 1635 XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->cross_cursor);
1636 f->output_data.win32->cross_cursor = cross_cursor; 1636 f->output_data.w32->cross_cursor = cross_cursor;
1637 1637
1638 XFlush (FRAME_WIN32_DISPLAY (f)); 1638 XFlush (FRAME_W32_DISPLAY (f));
1639 UNBLOCK_INPUT; 1639 UNBLOCK_INPUT;
1640#endif 1640#endif
1641} 1641}
@@ -1651,19 +1651,19 @@ x_set_cursor_color (f, arg, oldval)
1651 fore_pixel = x_decode_color (f, Vx_cursor_fore_pixel, 1651 fore_pixel = x_decode_color (f, Vx_cursor_fore_pixel,
1652 WHITE_PIX_DEFAULT (f)); 1652 WHITE_PIX_DEFAULT (f));
1653 else 1653 else
1654 fore_pixel = f->output_data.win32->background_pixel; 1654 fore_pixel = f->output_data.w32->background_pixel;
1655 f->output_data.win32->cursor_pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); 1655 f->output_data.w32->cursor_pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
1656 1656
1657 /* Make sure that the cursor color differs from the background color. */ 1657 /* Make sure that the cursor color differs from the background color. */
1658 if (f->output_data.win32->cursor_pixel == f->output_data.win32->background_pixel) 1658 if (f->output_data.w32->cursor_pixel == f->output_data.w32->background_pixel)
1659 { 1659 {
1660 f->output_data.win32->cursor_pixel = f->output_data.win32->mouse_pixel; 1660 f->output_data.w32->cursor_pixel = f->output_data.w32->mouse_pixel;
1661 if (f->output_data.win32->cursor_pixel == fore_pixel) 1661 if (f->output_data.w32->cursor_pixel == fore_pixel)
1662 fore_pixel = f->output_data.win32->background_pixel; 1662 fore_pixel = f->output_data.w32->background_pixel;
1663 } 1663 }
1664 f->output_data.win32->cursor_foreground_pixel = fore_pixel; 1664 f->output_data.w32->cursor_foreground_pixel = fore_pixel;
1665 1665
1666 if (FRAME_WIN32_WINDOW (f) != 0) 1666 if (FRAME_W32_WINDOW (f) != 0)
1667 { 1667 {
1668 if (FRAME_VISIBLE_P (f)) 1668 if (FRAME_VISIBLE_P (f))
1669 { 1669 {
@@ -1703,9 +1703,9 @@ x_set_border_pixel (f, pix)
1703 struct frame *f; 1703 struct frame *f;
1704 int pix; 1704 int pix;
1705{ 1705{
1706 f->output_data.win32->border_pixel = pix; 1706 f->output_data.w32->border_pixel = pix;
1707 1707
1708 if (FRAME_WIN32_WINDOW (f) != 0 && f->output_data.win32->border_width > 0) 1708 if (FRAME_W32_WINDOW (f) != 0 && f->output_data.w32->border_width > 0)
1709 { 1709 {
1710 if (FRAME_VISIBLE_P (f)) 1710 if (FRAME_VISIBLE_P (f))
1711 redraw_frame (f); 1711 redraw_frame (f);
@@ -1720,13 +1720,13 @@ x_set_cursor_type (f, arg, oldval)
1720 if (EQ (arg, Qbar)) 1720 if (EQ (arg, Qbar))
1721 { 1721 {
1722 FRAME_DESIRED_CURSOR (f) = bar_cursor; 1722 FRAME_DESIRED_CURSOR (f) = bar_cursor;
1723 f->output_data.win32->cursor_width = 2; 1723 f->output_data.w32->cursor_width = 2;
1724 } 1724 }
1725 else if (CONSP (arg) && EQ (XCONS (arg)->car, Qbar) 1725 else if (CONSP (arg) && EQ (XCONS (arg)->car, Qbar)
1726 && INTEGERP (XCONS (arg)->cdr)) 1726 && INTEGERP (XCONS (arg)->cdr))
1727 { 1727 {
1728 FRAME_DESIRED_CURSOR (f) = bar_cursor; 1728 FRAME_DESIRED_CURSOR (f) = bar_cursor;
1729 f->output_data.win32->cursor_width = XINT (XCONS (arg)->cdr); 1729 f->output_data.w32->cursor_width = XINT (XCONS (arg)->cdr);
1730 } 1730 }
1731 else 1731 else
1732 /* Treat anything unknown as "box cursor". 1732 /* Treat anything unknown as "box cursor".
@@ -1776,12 +1776,12 @@ x_set_icon_type (f, arg, oldval)
1776 if (FRAME_VISIBLE_P (f)) 1776 if (FRAME_VISIBLE_P (f))
1777 { 1777 {
1778#ifdef USE_X_TOOLKIT 1778#ifdef USE_X_TOOLKIT
1779 XtPopup (f->output_data.win32->widget, XtGrabNone); 1779 XtPopup (f->output_data.w32->widget, XtGrabNone);
1780#endif 1780#endif
1781 XMapWindow (FRAME_WIN32_DISPLAY (f), FRAME_WIN32_WINDOW (f)); 1781 XMapWindow (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f));
1782 } 1782 }
1783 1783
1784 XFlush (FRAME_WIN32_DISPLAY (f)); 1784 XFlush (FRAME_W32_DISPLAY (f));
1785 UNBLOCK_INPUT; 1785 UNBLOCK_INPUT;
1786#endif 1786#endif
1787} 1787}
@@ -1820,7 +1820,7 @@ x_set_icon_name (f, arg, oldval)
1820 f->icon_name = arg; 1820 f->icon_name = arg;
1821 1821
1822#if 0 1822#if 0
1823 if (f->output_data.win32->icon_bitmap != 0) 1823 if (f->output_data.w32->icon_bitmap != 0)
1824 return; 1824 return;
1825 1825
1826 BLOCK_INPUT; 1826 BLOCK_INPUT;
@@ -1841,12 +1841,12 @@ x_set_icon_name (f, arg, oldval)
1841 if (FRAME_VISIBLE_P (f)) 1841 if (FRAME_VISIBLE_P (f))
1842 { 1842 {
1843#ifdef USE_X_TOOLKIT 1843#ifdef USE_X_TOOLKIT
1844 XtPopup (f->output_data.win32->widget, XtGrabNone); 1844 XtPopup (f->output_data.w32->widget, XtGrabNone);
1845#endif 1845#endif
1846 XMapWindow (FRAME_WIN32_DISPLAY (f), FRAME_WIN32_WINDOW (f)); 1846 XMapWindow (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f));
1847 } 1847 }
1848 1848
1849 XFlush (FRAME_WIN32_DISPLAY (f)); 1849 XFlush (FRAME_W32_DISPLAY (f));
1850 UNBLOCK_INPUT; 1850 UNBLOCK_INPUT;
1851#endif 1851#endif
1852} 1852}
@@ -1886,13 +1886,13 @@ x_set_border_width (f, arg, oldval)
1886{ 1886{
1887 CHECK_NUMBER (arg, 0); 1887 CHECK_NUMBER (arg, 0);
1888 1888
1889 if (XINT (arg) == f->output_data.win32->border_width) 1889 if (XINT (arg) == f->output_data.w32->border_width)
1890 return; 1890 return;
1891 1891
1892 if (FRAME_WIN32_WINDOW (f) != 0) 1892 if (FRAME_W32_WINDOW (f) != 0)
1893 error ("Cannot change the border width of a window"); 1893 error ("Cannot change the border width of a window");
1894 1894
1895 f->output_data.win32->border_width = XINT (arg); 1895 f->output_data.w32->border_width = XINT (arg);
1896} 1896}
1897 1897
1898void 1898void
@@ -1901,17 +1901,17 @@ x_set_internal_border_width (f, arg, oldval)
1901 Lisp_Object arg, oldval; 1901 Lisp_Object arg, oldval;
1902{ 1902{
1903 int mask; 1903 int mask;
1904 int old = f->output_data.win32->internal_border_width; 1904 int old = f->output_data.w32->internal_border_width;
1905 1905
1906 CHECK_NUMBER (arg, 0); 1906 CHECK_NUMBER (arg, 0);
1907 f->output_data.win32->internal_border_width = XINT (arg); 1907 f->output_data.w32->internal_border_width = XINT (arg);
1908 if (f->output_data.win32->internal_border_width < 0) 1908 if (f->output_data.w32->internal_border_width < 0)
1909 f->output_data.win32->internal_border_width = 0; 1909 f->output_data.w32->internal_border_width = 0;
1910 1910
1911 if (f->output_data.win32->internal_border_width == old) 1911 if (f->output_data.w32->internal_border_width == old)
1912 return; 1912 return;
1913 1913
1914 if (FRAME_WIN32_WINDOW (f) != 0) 1914 if (FRAME_W32_WINDOW (f) != 0)
1915 { 1915 {
1916 BLOCK_INPUT; 1916 BLOCK_INPUT;
1917 x_set_window_size (f, 0, f->width, f->height); 1917 x_set_window_size (f, 0, f->width, f->height);
@@ -1968,7 +1968,7 @@ x_set_menu_bar_lines (f, value, oldval)
1968} 1968}
1969 1969
1970/* Change the name of frame F to NAME. If NAME is nil, set F's name to 1970/* Change the name of frame F to NAME. If NAME is nil, set F's name to
1971 win32_id_name. 1971 w32_id_name.
1972 1972
1973 If EXPLICIT is non-zero, that indicates that lisp code is setting the 1973 If EXPLICIT is non-zero, that indicates that lisp code is setting the
1974 name; if NAME is a string, set F's name to NAME and set 1974 name; if NAME is a string, set F's name to NAME and set
@@ -1998,15 +1998,15 @@ x_set_name (f, name, explicit)
1998 else if (f->explicit_name) 1998 else if (f->explicit_name)
1999 return; 1999 return;
2000 2000
2001 /* If NAME is nil, set the name to the win32_id_name. */ 2001 /* If NAME is nil, set the name to the w32_id_name. */
2002 if (NILP (name)) 2002 if (NILP (name))
2003 { 2003 {
2004 /* Check for no change needed in this very common case 2004 /* Check for no change needed in this very common case
2005 before we do any consing. */ 2005 before we do any consing. */
2006 if (!strcmp (FRAME_WIN32_DISPLAY_INFO (f)->win32_id_name, 2006 if (!strcmp (FRAME_W32_DISPLAY_INFO (f)->w32_id_name,
2007 XSTRING (f->name)->data)) 2007 XSTRING (f->name)->data))
2008 return; 2008 return;
2009 name = build_string (FRAME_WIN32_DISPLAY_INFO (f)->win32_id_name); 2009 name = build_string (FRAME_W32_DISPLAY_INFO (f)->w32_id_name);
2010 } 2010 }
2011 else 2011 else
2012 CHECK_STRING (name, 0); 2012 CHECK_STRING (name, 0);
@@ -2015,10 +2015,10 @@ x_set_name (f, name, explicit)
2015 if (! NILP (Fstring_equal (name, f->name))) 2015 if (! NILP (Fstring_equal (name, f->name)))
2016 return; 2016 return;
2017 2017
2018 if (FRAME_WIN32_WINDOW (f)) 2018 if (FRAME_W32_WINDOW (f))
2019 { 2019 {
2020 BLOCK_INPUT; 2020 BLOCK_INPUT;
2021 SetWindowText(FRAME_WIN32_WINDOW (f), XSTRING (name)->data); 2021 SetWindowText(FRAME_W32_WINDOW (f), XSTRING (name)->data);
2022 UNBLOCK_INPUT; 2022 UNBLOCK_INPUT;
2023 } 2023 }
2024 2024
@@ -2091,7 +2091,7 @@ x_set_vertical_scroll_bars (f, arg, oldval)
2091 frame, so we can get the geometry right from the start. 2091 frame, so we can get the geometry right from the start.
2092 However, if the window hasn't been created yet, we shouldn't 2092 However, if the window hasn't been created yet, we shouldn't
2093 call x_set_window_size. */ 2093 call x_set_window_size. */
2094 if (FRAME_WIN32_WINDOW (f)) 2094 if (FRAME_W32_WINDOW (f))
2095 x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f)); 2095 x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f));
2096 } 2096 }
2097} 2097}
@@ -2109,10 +2109,10 @@ x_set_scroll_bar_width (f, arg, oldval)
2109 else if (INTEGERP (arg) && XINT (arg) > 0 2109 else if (INTEGERP (arg) && XINT (arg) > 0
2110 && XFASTINT (arg) != FRAME_SCROLL_BAR_PIXEL_WIDTH (f)) 2110 && XFASTINT (arg) != FRAME_SCROLL_BAR_PIXEL_WIDTH (f))
2111 { 2111 {
2112 int wid = FONT_WIDTH (f->output_data.win32->font); 2112 int wid = FONT_WIDTH (f->output_data.w32->font);
2113 FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = XFASTINT (arg); 2113 FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = XFASTINT (arg);
2114 FRAME_SCROLL_BAR_COLS (f) = (XFASTINT (arg) + wid-1) / wid; 2114 FRAME_SCROLL_BAR_COLS (f) = (XFASTINT (arg) + wid-1) / wid;
2115 if (FRAME_WIN32_WINDOW (f)) 2115 if (FRAME_W32_WINDOW (f))
2116 x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f)); 2116 x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f));
2117 } 2117 }
2118} 2118}
@@ -2474,8 +2474,8 @@ x_figure_window_size (f, parms)
2474 f->height = DEFAULT_ROWS; 2474 f->height = DEFAULT_ROWS;
2475 /* Window managers expect that if program-specified 2475 /* Window managers expect that if program-specified
2476 positions are not (0,0), they're intentional, not defaults. */ 2476 positions are not (0,0), they're intentional, not defaults. */
2477 f->output_data.win32->top_pos = 0; 2477 f->output_data.w32->top_pos = 0;
2478 f->output_data.win32->left_pos = 0; 2478 f->output_data.w32->left_pos = 0;
2479 2479
2480 tem0 = x_get_arg (parms, Qheight, 0, 0, number); 2480 tem0 = x_get_arg (parms, Qheight, 0, 0, number);
2481 tem1 = x_get_arg (parms, Qwidth, 0, 0, number); 2481 tem1 = x_get_arg (parms, Qwidth, 0, 0, number);
@@ -2498,14 +2498,14 @@ x_figure_window_size (f, parms)
2498 window_prompting |= PSize; 2498 window_prompting |= PSize;
2499 } 2499 }
2500 2500
2501 f->output_data.win32->vertical_scroll_bar_extra 2501 f->output_data.w32->vertical_scroll_bar_extra
2502 = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f) 2502 = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f)
2503 ? 0 2503 ? 0
2504 : FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0 2504 : FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0
2505 ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f) 2505 ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f)
2506 : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.win32->font))); 2506 : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.w32->font)));
2507 f->output_data.win32->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width); 2507 f->output_data.w32->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width);
2508 f->output_data.win32->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height); 2508 f->output_data.w32->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height);
2509 2509
2510 tem0 = x_get_arg (parms, Qtop, 0, 0, number); 2510 tem0 = x_get_arg (parms, Qtop, 0, 0, number);
2511 tem1 = x_get_arg (parms, Qleft, 0, 0, number); 2511 tem1 = x_get_arg (parms, Qleft, 0, 0, number);
@@ -2514,57 +2514,57 @@ x_figure_window_size (f, parms)
2514 { 2514 {
2515 if (EQ (tem0, Qminus)) 2515 if (EQ (tem0, Qminus))
2516 { 2516 {
2517 f->output_data.win32->top_pos = 0; 2517 f->output_data.w32->top_pos = 0;
2518 window_prompting |= YNegative; 2518 window_prompting |= YNegative;
2519 } 2519 }
2520 else if (CONSP (tem0) && EQ (XCONS (tem0)->car, Qminus) 2520 else if (CONSP (tem0) && EQ (XCONS (tem0)->car, Qminus)
2521 && CONSP (XCONS (tem0)->cdr) 2521 && CONSP (XCONS (tem0)->cdr)
2522 && INTEGERP (XCONS (XCONS (tem0)->cdr)->car)) 2522 && INTEGERP (XCONS (XCONS (tem0)->cdr)->car))
2523 { 2523 {
2524 f->output_data.win32->top_pos = - XINT (XCONS (XCONS (tem0)->cdr)->car); 2524 f->output_data.w32->top_pos = - XINT (XCONS (XCONS (tem0)->cdr)->car);
2525 window_prompting |= YNegative; 2525 window_prompting |= YNegative;
2526 } 2526 }
2527 else if (CONSP (tem0) && EQ (XCONS (tem0)->car, Qplus) 2527 else if (CONSP (tem0) && EQ (XCONS (tem0)->car, Qplus)
2528 && CONSP (XCONS (tem0)->cdr) 2528 && CONSP (XCONS (tem0)->cdr)
2529 && INTEGERP (XCONS (XCONS (tem0)->cdr)->car)) 2529 && INTEGERP (XCONS (XCONS (tem0)->cdr)->car))
2530 { 2530 {
2531 f->output_data.win32->top_pos = XINT (XCONS (XCONS (tem0)->cdr)->car); 2531 f->output_data.w32->top_pos = XINT (XCONS (XCONS (tem0)->cdr)->car);
2532 } 2532 }
2533 else if (EQ (tem0, Qunbound)) 2533 else if (EQ (tem0, Qunbound))
2534 f->output_data.win32->top_pos = 0; 2534 f->output_data.w32->top_pos = 0;
2535 else 2535 else
2536 { 2536 {
2537 CHECK_NUMBER (tem0, 0); 2537 CHECK_NUMBER (tem0, 0);
2538 f->output_data.win32->top_pos = XINT (tem0); 2538 f->output_data.w32->top_pos = XINT (tem0);
2539 if (f->output_data.win32->top_pos < 0) 2539 if (f->output_data.w32->top_pos < 0)
2540 window_prompting |= YNegative; 2540 window_prompting |= YNegative;
2541 } 2541 }
2542 2542
2543 if (EQ (tem1, Qminus)) 2543 if (EQ (tem1, Qminus))
2544 { 2544 {
2545 f->output_data.win32->left_pos = 0; 2545 f->output_data.w32->left_pos = 0;
2546 window_prompting |= XNegative; 2546 window_prompting |= XNegative;
2547 } 2547 }
2548 else if (CONSP (tem1) && EQ (XCONS (tem1)->car, Qminus) 2548 else if (CONSP (tem1) && EQ (XCONS (tem1)->car, Qminus)
2549 && CONSP (XCONS (tem1)->cdr) 2549 && CONSP (XCONS (tem1)->cdr)
2550 && INTEGERP (XCONS (XCONS (tem1)->cdr)->car)) 2550 && INTEGERP (XCONS (XCONS (tem1)->cdr)->car))
2551 { 2551 {
2552 f->output_data.win32->left_pos = - XINT (XCONS (XCONS (tem1)->cdr)->car); 2552 f->output_data.w32->left_pos = - XINT (XCONS (XCONS (tem1)->cdr)->car);
2553 window_prompting |= XNegative; 2553 window_prompting |= XNegative;
2554 } 2554 }
2555 else if (CONSP (tem1) && EQ (XCONS (tem1)->car, Qplus) 2555 else if (CONSP (tem1) && EQ (XCONS (tem1)->car, Qplus)
2556 && CONSP (XCONS (tem1)->cdr) 2556 && CONSP (XCONS (tem1)->cdr)
2557 && INTEGERP (XCONS (XCONS (tem1)->cdr)->car)) 2557 && INTEGERP (XCONS (XCONS (tem1)->cdr)->car))
2558 { 2558 {
2559 f->output_data.win32->left_pos = XINT (XCONS (XCONS (tem1)->cdr)->car); 2559 f->output_data.w32->left_pos = XINT (XCONS (XCONS (tem1)->cdr)->car);
2560 } 2560 }
2561 else if (EQ (tem1, Qunbound)) 2561 else if (EQ (tem1, Qunbound))
2562 f->output_data.win32->left_pos = 0; 2562 f->output_data.w32->left_pos = 0;
2563 else 2563 else
2564 { 2564 {
2565 CHECK_NUMBER (tem1, 0); 2565 CHECK_NUMBER (tem1, 0);
2566 f->output_data.win32->left_pos = XINT (tem1); 2566 f->output_data.w32->left_pos = XINT (tem1);
2567 if (f->output_data.win32->left_pos < 0) 2567 if (f->output_data.w32->left_pos < 0)
2568 window_prompting |= XNegative; 2568 window_prompting |= XNegative;
2569 } 2569 }
2570 2570
@@ -2579,16 +2579,16 @@ x_figure_window_size (f, parms)
2579 2579
2580 2580
2581 2581
2582extern LRESULT CALLBACK win32_wnd_proc (); 2582extern LRESULT CALLBACK w32_wnd_proc ();
2583 2583
2584BOOL 2584BOOL
2585win32_init_class (hinst) 2585w32_init_class (hinst)
2586 HINSTANCE hinst; 2586 HINSTANCE hinst;
2587{ 2587{
2588 WNDCLASS wc; 2588 WNDCLASS wc;
2589 2589
2590 wc.style = CS_HREDRAW | CS_VREDRAW; 2590 wc.style = CS_HREDRAW | CS_VREDRAW;
2591 wc.lpfnWndProc = (WNDPROC) win32_wnd_proc; 2591 wc.lpfnWndProc = (WNDPROC) w32_wnd_proc;
2592 wc.cbClsExtra = 0; 2592 wc.cbClsExtra = 0;
2593 wc.cbWndExtra = WND_EXTRA_BYTES; 2593 wc.cbWndExtra = WND_EXTRA_BYTES;
2594 wc.hInstance = hinst; 2594 wc.hInstance = hinst;
@@ -2602,7 +2602,7 @@ win32_init_class (hinst)
2602} 2602}
2603 2603
2604HWND 2604HWND
2605win32_createscrollbar (f, bar) 2605w32_createscrollbar (f, bar)
2606 struct frame *f; 2606 struct frame *f;
2607 struct scroll_bar * bar; 2607 struct scroll_bar * bar;
2608{ 2608{
@@ -2610,14 +2610,14 @@ win32_createscrollbar (f, bar)
2610 /* Position and size of scroll bar. */ 2610 /* Position and size of scroll bar. */
2611 XINT(bar->left), XINT(bar->top), 2611 XINT(bar->left), XINT(bar->top),
2612 XINT(bar->width), XINT(bar->height), 2612 XINT(bar->width), XINT(bar->height),
2613 FRAME_WIN32_WINDOW (f), 2613 FRAME_W32_WINDOW (f),
2614 NULL, 2614 NULL,
2615 hinst, 2615 hinst,
2616 NULL)); 2616 NULL));
2617} 2617}
2618 2618
2619void 2619void
2620win32_createwindow (f) 2620w32_createwindow (f)
2621 struct frame *f; 2621 struct frame *f;
2622{ 2622{
2623 HWND hwnd; 2623 HWND hwnd;
@@ -2626,14 +2626,14 @@ win32_createwindow (f)
2626 2626
2627 if (!hprevinst) 2627 if (!hprevinst)
2628 { 2628 {
2629 win32_init_class (hinst); 2629 w32_init_class (hinst);
2630 } 2630 }
2631 2631
2632 FRAME_WIN32_WINDOW (f) = hwnd = CreateWindow (EMACS_CLASS, 2632 FRAME_W32_WINDOW (f) = hwnd = CreateWindow (EMACS_CLASS,
2633 f->namebuf, 2633 f->namebuf,
2634 f->output_data.win32->dwStyle | WS_CLIPCHILDREN, 2634 f->output_data.w32->dwStyle | WS_CLIPCHILDREN,
2635 f->output_data.win32->left_pos, 2635 f->output_data.w32->left_pos,
2636 f->output_data.win32->top_pos, 2636 f->output_data.w32->top_pos,
2637 PIXEL_WIDTH (f), 2637 PIXEL_WIDTH (f),
2638 PIXEL_HEIGHT (f), 2638 PIXEL_HEIGHT (f),
2639 NULL, 2639 NULL,
@@ -2643,29 +2643,29 @@ win32_createwindow (f)
2643 2643
2644 if (hwnd) 2644 if (hwnd)
2645 { 2645 {
2646 SetWindowLong (hwnd, WND_X_UNITS_INDEX, FONT_WIDTH (f->output_data.win32->font)); 2646 SetWindowLong (hwnd, WND_X_UNITS_INDEX, FONT_WIDTH (f->output_data.w32->font));
2647 SetWindowLong (hwnd, WND_Y_UNITS_INDEX, f->output_data.win32->line_height); 2647 SetWindowLong (hwnd, WND_Y_UNITS_INDEX, f->output_data.w32->line_height);
2648 SetWindowLong (hwnd, WND_BACKGROUND_INDEX, f->output_data.win32->background_pixel); 2648 SetWindowLong (hwnd, WND_BACKGROUND_INDEX, f->output_data.w32->background_pixel);
2649 2649
2650 /* Do this to discard the default setting specified by our parent. */ 2650 /* Do this to discard the default setting specified by our parent. */
2651 ShowWindow (hwnd, SW_HIDE); 2651 ShowWindow (hwnd, SW_HIDE);
2652 } 2652 }
2653} 2653}
2654 2654
2655/* Convert between the modifier bits Win32 uses and the modifier bits 2655/* Convert between the modifier bits W32 uses and the modifier bits
2656 Emacs uses. */ 2656 Emacs uses. */
2657unsigned int 2657unsigned int
2658win32_get_modifiers () 2658w32_get_modifiers ()
2659{ 2659{
2660 return (((GetKeyState (VK_SHIFT)&0x8000) ? shift_modifier : 0) | 2660 return (((GetKeyState (VK_SHIFT)&0x8000) ? shift_modifier : 0) |
2661 ((GetKeyState (VK_CONTROL)&0x8000) ? ctrl_modifier : 0) | 2661 ((GetKeyState (VK_CONTROL)&0x8000) ? ctrl_modifier : 0) |
2662 ((GetKeyState (VK_MENU)&0x8000) ? 2662 ((GetKeyState (VK_MENU)&0x8000) ?
2663 ((NILP (Vwin32_alt_is_meta)) ? alt_modifier : meta_modifier) : 0)); 2663 ((NILP (Vw32_alt_is_meta)) ? alt_modifier : meta_modifier) : 0));
2664} 2664}
2665 2665
2666void 2666void
2667my_post_msg (wmsg, hwnd, msg, wParam, lParam) 2667my_post_msg (wmsg, hwnd, msg, wParam, lParam)
2668 Win32Msg * wmsg; 2668 W32Msg * wmsg;
2669 HWND hwnd; 2669 HWND hwnd;
2670 UINT msg; 2670 UINT msg;
2671 WPARAM wParam; 2671 WPARAM wParam;
@@ -2897,12 +2897,12 @@ win_msg_worker (dw)
2897 switch (msg.message) 2897 switch (msg.message)
2898 { 2898 {
2899 case WM_EMACS_CREATEWINDOW: 2899 case WM_EMACS_CREATEWINDOW:
2900 win32_createwindow ((struct frame *) msg.wParam); 2900 w32_createwindow ((struct frame *) msg.wParam);
2901 PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0); 2901 PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0);
2902 break; 2902 break;
2903 case WM_EMACS_CREATESCROLLBAR: 2903 case WM_EMACS_CREATESCROLLBAR:
2904 { 2904 {
2905 HWND hwnd = win32_createscrollbar ((struct frame *) msg.wParam, 2905 HWND hwnd = w32_createscrollbar ((struct frame *) msg.wParam,
2906 (struct scroll_bar *) msg.lParam); 2906 (struct scroll_bar *) msg.lParam);
2907 PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, (WPARAM)hwnd, 0); 2907 PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, (WPARAM)hwnd, 0);
2908 } 2908 }
@@ -2925,7 +2925,7 @@ win_msg_worker (dw)
2925extern char *lispy_function_keys[]; 2925extern char *lispy_function_keys[];
2926 2926
2927LRESULT CALLBACK 2927LRESULT CALLBACK
2928win32_wnd_proc (hwnd, msg, wParam, lParam) 2928w32_wnd_proc (hwnd, msg, wParam, lParam)
2929 HWND hwnd; 2929 HWND hwnd;
2930 UINT msg; 2930 UINT msg;
2931 WPARAM wParam; 2931 WPARAM wParam;
@@ -2933,8 +2933,8 @@ win32_wnd_proc (hwnd, msg, wParam, lParam)
2933{ 2933{
2934 struct frame *f; 2934 struct frame *f;
2935 LRESULT ret = 1; 2935 LRESULT ret = 1;
2936 struct win32_display_info *dpyinfo = &one_win32_display_info; 2936 struct w32_display_info *dpyinfo = &one_w32_display_info;
2937 Win32Msg wmsg; 2937 W32Msg wmsg;
2938 int windows_translate; 2938 int windows_translate;
2939 2939
2940 /* Note that it is okay to call x_window_to_frame, even though we are 2940 /* Note that it is okay to call x_window_to_frame, even though we are
@@ -2950,7 +2950,7 @@ win32_wnd_proc (hwnd, msg, wParam, lParam)
2950 delete-frame has synchronized with this thread. 2950 delete-frame has synchronized with this thread.
2951 2951
2952 It is also safe to use functions that make GDI calls, such as 2952 It is also safe to use functions that make GDI calls, such as
2953 win32_clear_rect, because these functions must obtain a DC handle 2953 w32_clear_rect, because these functions must obtain a DC handle
2954 from the frame struct using get_frame_dc which is thread-aware. */ 2954 from the frame struct using get_frame_dc which is thread-aware. */
2955 2955
2956 switch (msg) 2956 switch (msg)
@@ -2960,7 +2960,7 @@ win32_wnd_proc (hwnd, msg, wParam, lParam)
2960 if (f) 2960 if (f)
2961 { 2961 {
2962 GetUpdateRect (hwnd, &wmsg.rect, FALSE); 2962 GetUpdateRect (hwnd, &wmsg.rect, FALSE);
2963 win32_clear_rect (f, NULL, &wmsg.rect); 2963 w32_clear_rect (f, NULL, &wmsg.rect);
2964 } 2964 }
2965 return 1; 2965 return 1;
2966 case WM_PALETTECHANGED: 2966 case WM_PALETTECHANGED:
@@ -3009,11 +3009,11 @@ win32_wnd_proc (hwnd, msg, wParam, lParam)
3009 case VK_RWIN: 3009 case VK_RWIN:
3010 case VK_APPS: 3010 case VK_APPS:
3011 /* More support for these keys will likely be necessary. */ 3011 /* More support for these keys will likely be necessary. */
3012 if (!NILP (Vwin32_pass_optional_keys_to_system)) 3012 if (!NILP (Vw32_pass_optional_keys_to_system))
3013 windows_translate = 1; 3013 windows_translate = 1;
3014 break; 3014 break;
3015 case VK_MENU: 3015 case VK_MENU:
3016 if (NILP (Vwin32_pass_alt_to_system)) 3016 if (NILP (Vw32_pass_alt_to_system))
3017 return 0; 3017 return 0;
3018 windows_translate = 1; 3018 windows_translate = 1;
3019 break; 3019 break;
@@ -3070,7 +3070,7 @@ win32_wnd_proc (hwnd, msg, wParam, lParam)
3070 are used together, but only if user has two button mouse. */ 3070 are used together, but only if user has two button mouse. */
3071 case WM_LBUTTONDOWN: 3071 case WM_LBUTTONDOWN:
3072 case WM_RBUTTONDOWN: 3072 case WM_RBUTTONDOWN:
3073 if (XINT (Vwin32_num_mouse_buttons) == 3) 3073 if (XINT (Vw32_num_mouse_buttons) == 3)
3074 goto handle_plain_button; 3074 goto handle_plain_button;
3075 3075
3076 { 3076 {
@@ -3109,7 +3109,7 @@ win32_wnd_proc (hwnd, msg, wParam, lParam)
3109 /* Flush out saved message. */ 3109 /* Flush out saved message. */
3110 post_msg (&saved_mouse_button_msg); 3110 post_msg (&saved_mouse_button_msg);
3111 } 3111 }
3112 wmsg.dwModifiers = win32_get_modifiers (); 3112 wmsg.dwModifiers = w32_get_modifiers ();
3113 my_post_msg (&wmsg, hwnd, msg, wParam, lParam); 3113 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
3114 3114
3115 /* Clear message buffer. */ 3115 /* Clear message buffer. */
@@ -3119,20 +3119,20 @@ win32_wnd_proc (hwnd, msg, wParam, lParam)
3119 { 3119 {
3120 /* Hold onto message for now. */ 3120 /* Hold onto message for now. */
3121 mouse_button_timer = 3121 mouse_button_timer =
3122 SetTimer (hwnd, MOUSE_BUTTON_ID, XINT (Vwin32_mouse_button_tolerance), NULL); 3122 SetTimer (hwnd, MOUSE_BUTTON_ID, XINT (Vw32_mouse_button_tolerance), NULL);
3123 saved_mouse_button_msg.msg.hwnd = hwnd; 3123 saved_mouse_button_msg.msg.hwnd = hwnd;
3124 saved_mouse_button_msg.msg.message = msg; 3124 saved_mouse_button_msg.msg.message = msg;
3125 saved_mouse_button_msg.msg.wParam = wParam; 3125 saved_mouse_button_msg.msg.wParam = wParam;
3126 saved_mouse_button_msg.msg.lParam = lParam; 3126 saved_mouse_button_msg.msg.lParam = lParam;
3127 saved_mouse_button_msg.msg.time = GetMessageTime (); 3127 saved_mouse_button_msg.msg.time = GetMessageTime ();
3128 saved_mouse_button_msg.dwModifiers = win32_get_modifiers (); 3128 saved_mouse_button_msg.dwModifiers = w32_get_modifiers ();
3129 } 3129 }
3130 } 3130 }
3131 return 0; 3131 return 0;
3132 3132
3133 case WM_LBUTTONUP: 3133 case WM_LBUTTONUP:
3134 case WM_RBUTTONUP: 3134 case WM_RBUTTONUP:
3135 if (XINT (Vwin32_num_mouse_buttons) == 3) 3135 if (XINT (Vw32_num_mouse_buttons) == 3)
3136 goto handle_plain_button; 3136 goto handle_plain_button;
3137 3137
3138 { 3138 {
@@ -3165,7 +3165,7 @@ win32_wnd_proc (hwnd, msg, wParam, lParam)
3165 post_msg (&saved_mouse_button_msg); 3165 post_msg (&saved_mouse_button_msg);
3166 } 3166 }
3167 } 3167 }
3168 wmsg.dwModifiers = win32_get_modifiers (); 3168 wmsg.dwModifiers = w32_get_modifiers ();
3169 my_post_msg (&wmsg, hwnd, msg, wParam, lParam); 3169 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
3170 3170
3171 /* Always clear message buffer and cancel timer. */ 3171 /* Always clear message buffer and cancel timer. */
@@ -3191,16 +3191,16 @@ win32_wnd_proc (hwnd, msg, wParam, lParam)
3191 } 3191 }
3192 } 3192 }
3193 3193
3194 wmsg.dwModifiers = win32_get_modifiers (); 3194 wmsg.dwModifiers = w32_get_modifiers ();
3195 my_post_msg (&wmsg, hwnd, msg, wParam, lParam); 3195 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
3196 return 0; 3196 return 0;
3197 3197
3198 case WM_VSCROLL: 3198 case WM_VSCROLL:
3199 case WM_MOUSEMOVE: 3199 case WM_MOUSEMOVE:
3200 if (XINT (Vwin32_mouse_move_interval) <= 0 3200 if (XINT (Vw32_mouse_move_interval) <= 0
3201 || (msg == WM_MOUSEMOVE && button_state == 0)) 3201 || (msg == WM_MOUSEMOVE && button_state == 0))
3202 { 3202 {
3203 wmsg.dwModifiers = win32_get_modifiers (); 3203 wmsg.dwModifiers = w32_get_modifiers ();
3204 my_post_msg (&wmsg, hwnd, msg, wParam, lParam); 3204 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
3205 return 0; 3205 return 0;
3206 } 3206 }
@@ -3212,7 +3212,7 @@ win32_wnd_proc (hwnd, msg, wParam, lParam)
3212 3212
3213 if (saved_mouse_move_msg.msg.hwnd == 0) 3213 if (saved_mouse_move_msg.msg.hwnd == 0)
3214 mouse_move_timer = 3214 mouse_move_timer =
3215 SetTimer (hwnd, MOUSE_MOVE_ID, XINT (Vwin32_mouse_move_interval), NULL); 3215 SetTimer (hwnd, MOUSE_MOVE_ID, XINT (Vw32_mouse_move_interval), NULL);
3216 3216
3217 /* Hold onto message for now. */ 3217 /* Hold onto message for now. */
3218 saved_mouse_move_msg.msg.hwnd = hwnd; 3218 saved_mouse_move_msg.msg.hwnd = hwnd;
@@ -3220,7 +3220,7 @@ win32_wnd_proc (hwnd, msg, wParam, lParam)
3220 saved_mouse_move_msg.msg.wParam = wParam; 3220 saved_mouse_move_msg.msg.wParam = wParam;
3221 saved_mouse_move_msg.msg.lParam = lParam; 3221 saved_mouse_move_msg.msg.lParam = lParam;
3222 saved_mouse_move_msg.msg.time = GetMessageTime (); 3222 saved_mouse_move_msg.msg.time = GetMessageTime ();
3223 saved_mouse_move_msg.dwModifiers = win32_get_modifiers (); 3223 saved_mouse_move_msg.dwModifiers = w32_get_modifiers ();
3224 3224
3225 return 0; 3225 return 0;
3226 3226
@@ -3264,12 +3264,12 @@ win32_wnd_proc (hwnd, msg, wParam, lParam)
3264 case WM_SIZE: 3264 case WM_SIZE:
3265 case WM_SYSCOMMAND: 3265 case WM_SYSCOMMAND:
3266 case WM_COMMAND: 3266 case WM_COMMAND:
3267 wmsg.dwModifiers = win32_get_modifiers (); 3267 wmsg.dwModifiers = w32_get_modifiers ();
3268 my_post_msg (&wmsg, hwnd, msg, wParam, lParam); 3268 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
3269 goto dflt; 3269 goto dflt;
3270 3270
3271 case WM_CLOSE: 3271 case WM_CLOSE:
3272 wmsg.dwModifiers = win32_get_modifiers (); 3272 wmsg.dwModifiers = w32_get_modifiers ();
3273 my_post_msg (&wmsg, hwnd, msg, wParam, lParam); 3273 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
3274 return 0; 3274 return 0;
3275 3275
@@ -3343,7 +3343,7 @@ win32_wnd_proc (hwnd, msg, wParam, lParam)
3343 return ShowWindow (hwnd, wParam); 3343 return ShowWindow (hwnd, wParam);
3344 case WM_EMACS_SETWINDOWPOS: 3344 case WM_EMACS_SETWINDOWPOS:
3345 { 3345 {
3346 Win32WindowPos * pos = (Win32WindowPos *) wParam; 3346 W32WindowPos * pos = (W32WindowPos *) wParam;
3347 return SetWindowPos (hwnd, pos->hwndAfter, 3347 return SetWindowPos (hwnd, pos->hwndAfter,
3348 pos->x, pos->y, pos->cx, pos->cy, pos->flags); 3348 pos->x, pos->y, pos->cx, pos->cy, pos->flags);
3349 } 3349 }
@@ -3368,10 +3368,10 @@ my_create_window (f)
3368 GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE); 3368 GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE);
3369} 3369}
3370 3370
3371/* Create and set up the win32 window for frame F. */ 3371/* Create and set up the w32 window for frame F. */
3372 3372
3373static void 3373static void
3374win32_window (f, window_prompting, minibuffer_only) 3374w32_window (f, window_prompting, minibuffer_only)
3375 struct frame *f; 3375 struct frame *f;
3376 long window_prompting; 3376 long window_prompting;
3377 int minibuffer_only; 3377 int minibuffer_only;
@@ -3413,7 +3413,7 @@ win32_window (f, window_prompting, minibuffer_only)
3413 if (!minibuffer_only && FRAME_EXTERNAL_MENU_BAR (f)) 3413 if (!minibuffer_only && FRAME_EXTERNAL_MENU_BAR (f))
3414 initialize_frame_menubar (f); 3414 initialize_frame_menubar (f);
3415 3415
3416 if (FRAME_WIN32_WINDOW (f) == 0) 3416 if (FRAME_W32_WINDOW (f) == 0)
3417 error ("Unable to create window"); 3417 error ("Unable to create window");
3418} 3418}
3419 3419
@@ -3471,7 +3471,7 @@ This function is an internal primitive--use `make-frame' instead.")
3471 int count = specpdl_ptr - specpdl; 3471 int count = specpdl_ptr - specpdl;
3472 struct gcpro gcpro1; 3472 struct gcpro gcpro1;
3473 Lisp_Object display; 3473 Lisp_Object display;
3474 struct win32_display_info *dpyinfo; 3474 struct w32_display_info *dpyinfo;
3475 Lisp_Object parent; 3475 Lisp_Object parent;
3476 struct kboard *kb; 3476 struct kboard *kb;
3477 3477
@@ -3526,11 +3526,11 @@ This function is an internal primitive--use `make-frame' instead.")
3526 XSETFRAME (frame, f); 3526 XSETFRAME (frame, f);
3527 GCPRO1 (frame); 3527 GCPRO1 (frame);
3528 3528
3529 f->output_method = output_win32; 3529 f->output_method = output_w32;
3530 f->output_data.win32 = (struct win32_output *) xmalloc (sizeof (struct win32_output)); 3530 f->output_data.w32 = (struct w32_output *) xmalloc (sizeof (struct w32_output));
3531 bzero (f->output_data.win32, sizeof (struct win32_output)); 3531 bzero (f->output_data.w32, sizeof (struct w32_output));
3532 3532
3533/* FRAME_WIN32_DISPLAY_INFO (f) = dpyinfo; */ 3533/* FRAME_W32_DISPLAY_INFO (f) = dpyinfo; */
3534#ifdef MULTI_KBOARD 3534#ifdef MULTI_KBOARD
3535 FRAME_KBOARD (f) = kb; 3535 FRAME_KBOARD (f) = kb;
3536#endif 3536#endif
@@ -3539,13 +3539,13 @@ This function is an internal primitive--use `make-frame' instead.")
3539 3539
3540 if (!NILP (parent)) 3540 if (!NILP (parent))
3541 { 3541 {
3542 f->output_data.win32->parent_desc = (Window) parent; 3542 f->output_data.w32->parent_desc = (Window) parent;
3543 f->output_data.win32->explicit_parent = 1; 3543 f->output_data.w32->explicit_parent = 1;
3544 } 3544 }
3545 else 3545 else
3546 { 3546 {
3547 f->output_data.win32->parent_desc = FRAME_WIN32_DISPLAY_INFO (f)->root_window; 3547 f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window;
3548 f->output_data.win32->explicit_parent = 0; 3548 f->output_data.w32->explicit_parent = 0;
3549 } 3549 }
3550 3550
3551 /* Note that the frame has no physical cursor right now. */ 3551 /* Note that the frame has no physical cursor right now. */
@@ -3555,7 +3555,7 @@ This function is an internal primitive--use `make-frame' instead.")
3555 be set. */ 3555 be set. */
3556 if (EQ (name, Qunbound) || NILP (name)) 3556 if (EQ (name, Qunbound) || NILP (name))
3557 { 3557 {
3558 f->name = build_string (dpyinfo->win32_id_name); 3558 f->name = build_string (dpyinfo->w32_id_name);
3559 f->explicit_name = 0; 3559 f->explicit_name = 0;
3560 } 3560 }
3561 else 3561 else
@@ -3639,28 +3639,28 @@ This function is an internal primitive--use `make-frame' instead.")
3639 x_default_parameter (f, parms, Qscroll_bar_width, Qnil, 3639 x_default_parameter (f, parms, Qscroll_bar_width, Qnil,
3640 "scrollBarWidth", "ScrollBarWidth", number); 3640 "scrollBarWidth", "ScrollBarWidth", number);
3641 3641
3642 f->output_data.win32->dwStyle = WS_OVERLAPPEDWINDOW; 3642 f->output_data.w32->dwStyle = WS_OVERLAPPEDWINDOW;
3643 f->output_data.win32->parent_desc = FRAME_WIN32_DISPLAY_INFO (f)->root_window; 3643 f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window;
3644 window_prompting = x_figure_window_size (f, parms); 3644 window_prompting = x_figure_window_size (f, parms);
3645 3645
3646 if (window_prompting & XNegative) 3646 if (window_prompting & XNegative)
3647 { 3647 {
3648 if (window_prompting & YNegative) 3648 if (window_prompting & YNegative)
3649 f->output_data.win32->win_gravity = SouthEastGravity; 3649 f->output_data.w32->win_gravity = SouthEastGravity;
3650 else 3650 else
3651 f->output_data.win32->win_gravity = NorthEastGravity; 3651 f->output_data.w32->win_gravity = NorthEastGravity;
3652 } 3652 }
3653 else 3653 else
3654 { 3654 {
3655 if (window_prompting & YNegative) 3655 if (window_prompting & YNegative)
3656 f->output_data.win32->win_gravity = SouthWestGravity; 3656 f->output_data.w32->win_gravity = SouthWestGravity;
3657 else 3657 else
3658 f->output_data.win32->win_gravity = NorthWestGravity; 3658 f->output_data.w32->win_gravity = NorthWestGravity;
3659 } 3659 }
3660 3660
3661 f->output_data.win32->size_hint_flags = window_prompting; 3661 f->output_data.w32->size_hint_flags = window_prompting;
3662 3662
3663 win32_window (f, window_prompting, minibuffer_only); 3663 w32_window (f, window_prompting, minibuffer_only);
3664 x_icon (f, parms); 3664 x_icon (f, parms);
3665 init_frame_faces (f); 3665 init_frame_faces (f);
3666 3666
@@ -3704,12 +3704,12 @@ This function is an internal primitive--use `make-frame' instead.")
3704 3704
3705 /* Now that the frame is official, it counts as a reference to 3705 /* Now that the frame is official, it counts as a reference to
3706 its display. */ 3706 its display. */
3707 FRAME_WIN32_DISPLAY_INFO (f)->reference_count++; 3707 FRAME_W32_DISPLAY_INFO (f)->reference_count++;
3708 3708
3709 /* Make the window appear on the frame and enable display, 3709 /* Make the window appear on the frame and enable display,
3710 unless the caller says not to. However, with explicit parent, 3710 unless the caller says not to. However, with explicit parent,
3711 Emacs cannot control visibility, so don't try. */ 3711 Emacs cannot control visibility, so don't try. */
3712 if (! f->output_data.win32->explicit_parent) 3712 if (! f->output_data.w32->explicit_parent)
3713 { 3713 {
3714 Lisp_Object visibility; 3714 Lisp_Object visibility;
3715 3715
@@ -3736,18 +3736,18 @@ Lisp_Object
3736x_get_focus_frame (frame) 3736x_get_focus_frame (frame)
3737 struct frame *frame; 3737 struct frame *frame;
3738{ 3738{
3739 struct win32_display_info *dpyinfo = FRAME_WIN32_DISPLAY_INFO (frame); 3739 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (frame);
3740 Lisp_Object xfocus; 3740 Lisp_Object xfocus;
3741 if (! dpyinfo->win32_focus_frame) 3741 if (! dpyinfo->w32_focus_frame)
3742 return Qnil; 3742 return Qnil;
3743 3743
3744 XSETFRAME (xfocus, dpyinfo->win32_focus_frame); 3744 XSETFRAME (xfocus, dpyinfo->w32_focus_frame);
3745 return xfocus; 3745 return xfocus;
3746} 3746}
3747 3747
3748XFontStruct * 3748XFontStruct *
3749win32_load_font (dpyinfo,name) 3749w32_load_font (dpyinfo,name)
3750struct win32_display_info *dpyinfo; 3750struct w32_display_info *dpyinfo;
3751char * name; 3751char * name;
3752{ 3752{
3753 XFontStruct * font = NULL; 3753 XFontStruct * font = NULL;
@@ -3756,7 +3756,7 @@ char * name;
3756 { 3756 {
3757 LOGFONT lf; 3757 LOGFONT lf;
3758 3758
3759 if (!name || !x_to_win32_font (name, &lf)) 3759 if (!name || !x_to_w32_font (name, &lf))
3760 return (NULL); 3760 return (NULL);
3761 3761
3762 font = (XFontStruct *) xmalloc (sizeof (XFontStruct)); 3762 font = (XFontStruct *) xmalloc (sizeof (XFontStruct));
@@ -3788,13 +3788,13 @@ char * name;
3788 3788
3789 if (ok) return (font); 3789 if (ok) return (font);
3790 3790
3791 win32_unload_font (dpyinfo, font); 3791 w32_unload_font (dpyinfo, font);
3792 return (NULL); 3792 return (NULL);
3793} 3793}
3794 3794
3795void 3795void
3796win32_unload_font (dpyinfo, font) 3796w32_unload_font (dpyinfo, font)
3797 struct win32_display_info *dpyinfo; 3797 struct w32_display_info *dpyinfo;
3798 XFontStruct * font; 3798 XFontStruct * font;
3799{ 3799{
3800 if (font) 3800 if (font)
@@ -3804,7 +3804,7 @@ win32_unload_font (dpyinfo, font)
3804 } 3804 }
3805} 3805}
3806 3806
3807/* The font conversion stuff between x and win32 */ 3807/* The font conversion stuff between x and w32 */
3808 3808
3809/* X font string is as follows (from faces.el) 3809/* X font string is as follows (from faces.el)
3810 * (let ((- "[-?]") 3810 * (let ((- "[-?]")
@@ -3879,7 +3879,7 @@ win32_unload_font (dpyinfo, font)
3879#define FONT_REGEXP_WEIGHT "-" FONT_WEIGHT "-" 3879#define FONT_REGEXP_WEIGHT "-" FONT_WEIGHT "-"
3880 3880
3881LONG 3881LONG
3882x_to_win32_weight (lpw) 3882x_to_w32_weight (lpw)
3883 char * lpw; 3883 char * lpw;
3884{ 3884{
3885 if (!lpw) return (FW_DONTCARE); 3885 if (!lpw) return (FW_DONTCARE);
@@ -3899,7 +3899,7 @@ x_to_win32_weight (lpw)
3899 3899
3900 3900
3901char * 3901char *
3902win32_to_x_weight (fnweight) 3902w32_to_x_weight (fnweight)
3903 int fnweight; 3903 int fnweight;
3904{ 3904{
3905 if (fnweight >= FW_HEAVY) return "heavy"; 3905 if (fnweight >= FW_HEAVY) return "heavy";
@@ -3916,7 +3916,7 @@ win32_to_x_weight (fnweight)
3916} 3916}
3917 3917
3918LONG 3918LONG
3919x_to_win32_charset (lpcs) 3919x_to_w32_charset (lpcs)
3920 char * lpcs; 3920 char * lpcs;
3921{ 3921{
3922 if (!lpcs) return (0); 3922 if (!lpcs) return (0);
@@ -3934,7 +3934,7 @@ x_to_win32_charset (lpcs)
3934} 3934}
3935 3935
3936char * 3936char *
3937win32_to_x_charset (fncharset) 3937w32_to_x_charset (fncharset)
3938 int fncharset; 3938 int fncharset;
3939{ 3939{
3940 switch (fncharset) 3940 switch (fncharset)
@@ -3950,7 +3950,7 @@ win32_to_x_charset (fncharset)
3950} 3950}
3951 3951
3952BOOL 3952BOOL
3953win32_to_x_font (lplogfont, lpxstr, len) 3953w32_to_x_font (lplogfont, lpxstr, len)
3954 LOGFONT * lplogfont; 3954 LOGFONT * lplogfont;
3955 char * lpxstr; 3955 char * lpxstr;
3956 int len; 3956 int len;
@@ -3968,7 +3968,7 @@ win32_to_x_font (lplogfont, lpxstr, len)
3968 { 3968 {
3969 sprintf (height_pixels, "%u", abs (lplogfont->lfHeight)); 3969 sprintf (height_pixels, "%u", abs (lplogfont->lfHeight));
3970 sprintf (height_dpi, "%u", 3970 sprintf (height_dpi, "%u",
3971 (abs (lplogfont->lfHeight) * 720) / one_win32_display_info.height_in); 3971 (abs (lplogfont->lfHeight) * 720) / one_w32_display_info.height_in);
3972 } 3972 }
3973 else 3973 else
3974 { 3974 {
@@ -3983,13 +3983,13 @@ win32_to_x_font (lplogfont, lpxstr, len)
3983 _snprintf (lpxstr, len - 1, 3983 _snprintf (lpxstr, len - 1,
3984 "-*-%s-%s-%c-*-*-%s-%s-*-*-%c-%s-*-%s-", 3984 "-*-%s-%s-%c-*-*-%s-%s-*-*-%c-%s-*-%s-",
3985 lplogfont->lfFaceName, 3985 lplogfont->lfFaceName,
3986 win32_to_x_weight (lplogfont->lfWeight), 3986 w32_to_x_weight (lplogfont->lfWeight),
3987 lplogfont->lfItalic?'i':'r', 3987 lplogfont->lfItalic?'i':'r',
3988 height_pixels, 3988 height_pixels,
3989 height_dpi, 3989 height_dpi,
3990 ((lplogfont->lfPitchAndFamily & 0x3) == VARIABLE_PITCH) ? 'p' : 'c', 3990 ((lplogfont->lfPitchAndFamily & 0x3) == VARIABLE_PITCH) ? 'p' : 'c',
3991 width_pixels, 3991 width_pixels,
3992 win32_to_x_charset (lplogfont->lfCharSet) 3992 w32_to_x_charset (lplogfont->lfCharSet)
3993 ); 3993 );
3994 3994
3995 lpxstr[len - 1] = 0; /* just to be sure */ 3995 lpxstr[len - 1] = 0; /* just to be sure */
@@ -3997,7 +3997,7 @@ win32_to_x_font (lplogfont, lpxstr, len)
3997} 3997}
3998 3998
3999BOOL 3999BOOL
4000x_to_win32_font (lpxstr, lplogfont) 4000x_to_w32_font (lpxstr, lplogfont)
4001 char * lpxstr; 4001 char * lpxstr;
4002 LOGFONT * lplogfont; 4002 LOGFONT * lplogfont;
4003{ 4003{
@@ -4049,11 +4049,11 @@ x_to_win32_font (lpxstr, lplogfont)
4049 4049
4050 fields--; 4050 fields--;
4051 4051
4052 lplogfont->lfWeight = x_to_win32_weight ((fields > 0 ? weight : "")); 4052 lplogfont->lfWeight = x_to_w32_weight ((fields > 0 ? weight : ""));
4053 4053
4054 fields--; 4054 fields--;
4055 4055
4056 if (!NILP (Vwin32_enable_italics)) 4056 if (!NILP (Vw32_enable_italics))
4057 lplogfont->lfItalic = (fields > 0 && slant == 'i'); 4057 lplogfont->lfItalic = (fields > 0 && slant == 'i');
4058 4058
4059 fields--; 4059 fields--;
@@ -4065,7 +4065,7 @@ x_to_win32_font (lpxstr, lplogfont)
4065 4065
4066 if (fields > 0 && lplogfont->lfHeight == 0 && height[0] != '*') 4066 if (fields > 0 && lplogfont->lfHeight == 0 && height[0] != '*')
4067 lplogfont->lfHeight = (atoi (height) 4067 lplogfont->lfHeight = (atoi (height)
4068 * one_win32_display_info.height_in) / 720; 4068 * one_w32_display_info.height_in) / 720;
4069 4069
4070 fields--; 4070 fields--;
4071 4071
@@ -4090,7 +4090,7 @@ x_to_win32_font (lpxstr, lplogfont)
4090 encoding = remainder; 4090 encoding = remainder;
4091 if (strncmp (encoding, "*-", 2) == 0) 4091 if (strncmp (encoding, "*-", 2) == 0)
4092 encoding += 2; 4092 encoding += 2;
4093 lplogfont->lfCharSet = x_to_win32_charset (fields > 0 ? encoding : ""); 4093 lplogfont->lfCharSet = x_to_w32_charset (fields > 0 ? encoding : "");
4094 } 4094 }
4095 else 4095 else
4096 { 4096 {
@@ -4125,7 +4125,7 @@ x_to_win32_font (lpxstr, lplogfont)
4125 4125
4126 fields--; 4126 fields--;
4127 4127
4128 lplogfont->lfWeight = x_to_win32_weight ((fields > 0 ? weight : "")); 4128 lplogfont->lfWeight = x_to_w32_weight ((fields > 0 ? weight : ""));
4129 } 4129 }
4130 4130
4131 /* This makes TrueType fonts work better. */ 4131 /* This makes TrueType fonts work better. */
@@ -4135,7 +4135,7 @@ x_to_win32_font (lpxstr, lplogfont)
4135} 4135}
4136 4136
4137BOOL 4137BOOL
4138win32_font_match (lpszfont1, lpszfont2) 4138w32_font_match (lpszfont1, lpszfont2)
4139 char * lpszfont1; 4139 char * lpszfont1;
4140 char * lpszfont2; 4140 char * lpszfont2;
4141{ 4141{
@@ -4200,9 +4200,9 @@ enum_font_cb2 (lplf, lptm, FontType, lpef)
4200 lplf->elfLogFont.lfWidth = lpef->logfont.lfWidth; 4200 lplf->elfLogFont.lfWidth = lpef->logfont.lfWidth;
4201 } 4201 }
4202 4202
4203 if (!win32_to_x_font (lplf, buf, 100)) return (0); 4203 if (!w32_to_x_font (lplf, buf, 100)) return (0);
4204 4204
4205 if (NILP (*(lpef->pattern)) || win32_font_match (buf, XSTRING (*(lpef->pattern))->data)) 4205 if (NILP (*(lpef->pattern)) || w32_font_match (buf, XSTRING (*(lpef->pattern))->data))
4206 { 4206 {
4207 *lpef->tail = Fcons (build_string (buf), Qnil); 4207 *lpef->tail = Fcons (build_string (buf), Qnil);
4208 lpef->tail = &XCONS (*lpef->tail)->cdr; 4208 lpef->tail = &XCONS (*lpef->tail)->cdr;
@@ -4270,25 +4270,25 @@ even if they match PATTERN and FACE.")
4270 int face_id; 4270 int face_id;
4271 4271
4272 /* Don't die if we get called with a terminal frame. */ 4272 /* Don't die if we get called with a terminal frame. */
4273 if (! FRAME_WIN32_P (f)) 4273 if (! FRAME_W32_P (f))
4274 error ("non-win32 frame used in `x-list-fonts'"); 4274 error ("non-w32 frame used in `x-list-fonts'");
4275 4275
4276 face_id = face_name_id_number (f, face); 4276 face_id = face_name_id_number (f, face);
4277 4277
4278 if (face_id < 0 || face_id >= FRAME_N_PARAM_FACES (f) 4278 if (face_id < 0 || face_id >= FRAME_N_PARAM_FACES (f)
4279 || FRAME_PARAM_FACES (f) [face_id] == 0) 4279 || FRAME_PARAM_FACES (f) [face_id] == 0)
4280 size_ref = f->output_data.win32->font; 4280 size_ref = f->output_data.w32->font;
4281 else 4281 else
4282 { 4282 {
4283 size_ref = FRAME_PARAM_FACES (f) [face_id]->font; 4283 size_ref = FRAME_PARAM_FACES (f) [face_id]->font;
4284 if (size_ref == (XFontStruct *) (~0)) 4284 if (size_ref == (XFontStruct *) (~0))
4285 size_ref = f->output_data.win32->font; 4285 size_ref = f->output_data.w32->font;
4286 } 4286 }
4287 } 4287 }
4288 4288
4289 /* See if we cached the result for this particular query. */ 4289 /* See if we cached the result for this particular query. */
4290 list = Fassoc (pattern, 4290 list = Fassoc (pattern,
4291 XCONS (FRAME_WIN32_DISPLAY_INFO (f)->name_list_element)->cdr); 4291 XCONS (FRAME_W32_DISPLAY_INFO (f)->name_list_element)->cdr);
4292 4292
4293 /* We have info in the cache for this PATTERN. */ 4293 /* We have info in the cache for this PATTERN. */
4294 if (!NILP (list)) 4294 if (!NILP (list))
@@ -4309,12 +4309,12 @@ even if they match PATTERN and FACE.")
4309 { 4309 {
4310 XFontStruct *thisinfo; 4310 XFontStruct *thisinfo;
4311 4311
4312 thisinfo = win32_load_font (FRAME_WIN32_DISPLAY_INFO (f), XSTRING (XCONS (tem)->car)->data); 4312 thisinfo = w32_load_font (FRAME_W32_DISPLAY_INFO (f), XSTRING (XCONS (tem)->car)->data);
4313 4313
4314 if (thisinfo && same_size_fonts (thisinfo, size_ref)) 4314 if (thisinfo && same_size_fonts (thisinfo, size_ref))
4315 newlist = Fcons (XCONS (tem)->car, newlist); 4315 newlist = Fcons (XCONS (tem)->car, newlist);
4316 4316
4317 win32_unload_font (FRAME_WIN32_DISPLAY_INFO (f), thisinfo); 4317 w32_unload_font (FRAME_W32_DISPLAY_INFO (f), thisinfo);
4318 } 4318 }
4319 4319
4320 UNBLOCK_INPUT; 4320 UNBLOCK_INPUT;
@@ -4328,14 +4328,14 @@ even if they match PATTERN and FACE.")
4328 ef.pattern = &pattern; 4328 ef.pattern = &pattern;
4329 ef.tail = ef.head = &namelist; 4329 ef.tail = ef.head = &namelist;
4330 ef.numFonts = 0; 4330 ef.numFonts = 0;
4331 x_to_win32_font (STRINGP (pattern) ? XSTRING (pattern)->data : NULL, &ef.logfont); 4331 x_to_w32_font (STRINGP (pattern) ? XSTRING (pattern)->data : NULL, &ef.logfont);
4332 4332
4333 { 4333 {
4334 ef.hdc = GetDC (FRAME_WIN32_WINDOW (f)); 4334 ef.hdc = GetDC (FRAME_W32_WINDOW (f));
4335 4335
4336 EnumFontFamilies (ef.hdc, NULL, (FONTENUMPROC) enum_font_cb1, (LPARAM)&ef); 4336 EnumFontFamilies (ef.hdc, NULL, (FONTENUMPROC) enum_font_cb1, (LPARAM)&ef);
4337 4337
4338 ReleaseDC (FRAME_WIN32_WINDOW (f), ef.hdc); 4338 ReleaseDC (FRAME_W32_WINDOW (f), ef.hdc);
4339 } 4339 }
4340 4340
4341 UNBLOCK_INPUT; 4341 UNBLOCK_INPUT;
@@ -4347,9 +4347,9 @@ even if they match PATTERN and FACE.")
4347 4347
4348 /* Make a list of all the fonts we got back. 4348 /* Make a list of all the fonts we got back.
4349 Store that in the font cache for the display. */ 4349 Store that in the font cache for the display. */
4350 XCONS (FRAME_WIN32_DISPLAY_INFO (f)->name_list_element)->cdr 4350 XCONS (FRAME_W32_DISPLAY_INFO (f)->name_list_element)->cdr
4351 = Fcons (Fcons (pattern, namelist), 4351 = Fcons (Fcons (pattern, namelist),
4352 XCONS (FRAME_WIN32_DISPLAY_INFO (f)->name_list_element)->cdr); 4352 XCONS (FRAME_W32_DISPLAY_INFO (f)->name_list_element)->cdr);
4353 4353
4354 /* Make a list of the fonts that have the right width. */ 4354 /* Make a list of the fonts that have the right width. */
4355 list = Qnil; 4355 list = Qnil;
@@ -4365,11 +4365,11 @@ even if they match PATTERN and FACE.")
4365 XFontStruct *thisinfo; 4365 XFontStruct *thisinfo;
4366 4366
4367 BLOCK_INPUT; 4367 BLOCK_INPUT;
4368 thisinfo = win32_load_font (FRAME_WIN32_DISPLAY_INFO (f), XSTRING (Fcar (cur))->data); 4368 thisinfo = w32_load_font (FRAME_W32_DISPLAY_INFO (f), XSTRING (Fcar (cur))->data);
4369 4369
4370 keeper = thisinfo && same_size_fonts (thisinfo, size_ref); 4370 keeper = thisinfo && same_size_fonts (thisinfo, size_ref);
4371 4371
4372 win32_unload_font (FRAME_WIN32_DISPLAY_INFO (f), thisinfo); 4372 w32_unload_font (FRAME_W32_DISPLAY_INFO (f), thisinfo);
4373 4373
4374 UNBLOCK_INPUT; 4374 UNBLOCK_INPUT;
4375 } 4375 }
@@ -4436,7 +4436,7 @@ If omitted or nil, that stands for the selected frame's display.")
4436 (display) 4436 (display)
4437 Lisp_Object display; 4437 Lisp_Object display;
4438{ 4438{
4439 struct win32_display_info *dpyinfo = check_x_display_info (display); 4439 struct w32_display_info *dpyinfo = check_x_display_info (display);
4440 4440
4441 if ((dpyinfo->n_planes * dpyinfo->n_cbits) <= 2) 4441 if ((dpyinfo->n_planes * dpyinfo->n_cbits) <= 2)
4442 return Qnil; 4442 return Qnil;
@@ -4454,7 +4454,7 @@ If omitted or nil, that stands for the selected frame's display.")
4454 (display) 4454 (display)
4455 Lisp_Object display; 4455 Lisp_Object display;
4456{ 4456{
4457 struct win32_display_info *dpyinfo = check_x_display_info (display); 4457 struct w32_display_info *dpyinfo = check_x_display_info (display);
4458 4458
4459 if ((dpyinfo->n_planes * dpyinfo->n_cbits) <= 1) 4459 if ((dpyinfo->n_planes * dpyinfo->n_cbits) <= 1)
4460 return Qnil; 4460 return Qnil;
@@ -4471,7 +4471,7 @@ If omitted or nil, that stands for the selected frame's display.")
4471 (display) 4471 (display)
4472 Lisp_Object display; 4472 Lisp_Object display;
4473{ 4473{
4474 struct win32_display_info *dpyinfo = check_x_display_info (display); 4474 struct w32_display_info *dpyinfo = check_x_display_info (display);
4475 4475
4476 return make_number (dpyinfo->width); 4476 return make_number (dpyinfo->width);
4477} 4477}
@@ -4485,7 +4485,7 @@ If omitted or nil, that stands for the selected frame's display.")
4485 (display) 4485 (display)
4486 Lisp_Object display; 4486 Lisp_Object display;
4487{ 4487{
4488 struct win32_display_info *dpyinfo = check_x_display_info (display); 4488 struct w32_display_info *dpyinfo = check_x_display_info (display);
4489 4489
4490 return make_number (dpyinfo->height); 4490 return make_number (dpyinfo->height);
4491} 4491}
@@ -4499,7 +4499,7 @@ If omitted or nil, that stands for the selected frame's display.")
4499 (display) 4499 (display)
4500 Lisp_Object display; 4500 Lisp_Object display;
4501{ 4501{
4502 struct win32_display_info *dpyinfo = check_x_display_info (display); 4502 struct w32_display_info *dpyinfo = check_x_display_info (display);
4503 4503
4504 return make_number (dpyinfo->n_planes * dpyinfo->n_cbits); 4504 return make_number (dpyinfo->n_planes * dpyinfo->n_cbits);
4505} 4505}
@@ -4513,7 +4513,7 @@ If omitted or nil, that stands for the selected frame's display.")
4513 (display) 4513 (display)
4514 Lisp_Object display; 4514 Lisp_Object display;
4515{ 4515{
4516 struct win32_display_info *dpyinfo = check_x_display_info (display); 4516 struct w32_display_info *dpyinfo = check_x_display_info (display);
4517 HDC hdc; 4517 HDC hdc;
4518 int cap; 4518 int cap;
4519 4519
@@ -4538,20 +4538,20 @@ If omitted or nil, that stands for the selected frame's display.")
4538 (display) 4538 (display)
4539 Lisp_Object display; 4539 Lisp_Object display;
4540{ 4540{
4541 struct win32_display_info *dpyinfo = check_x_display_info (display); 4541 struct w32_display_info *dpyinfo = check_x_display_info (display);
4542 4542
4543 return make_number (1); 4543 return make_number (1);
4544} 4544}
4545 4545
4546DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0, 4546DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
4547 "Returns the vendor ID string of the Win32 system (Microsoft).\n\ 4547 "Returns the vendor ID string of the W32 system (Microsoft).\n\
4548The optional argument DISPLAY specifies which display to ask about.\n\ 4548The optional argument DISPLAY specifies which display to ask about.\n\
4549DISPLAY should be either a frame or a display name (a string).\n\ 4549DISPLAY should be either a frame or a display name (a string).\n\
4550If omitted or nil, that stands for the selected frame's display.") 4550If omitted or nil, that stands for the selected frame's display.")
4551 (display) 4551 (display)
4552 Lisp_Object display; 4552 Lisp_Object display;
4553{ 4553{
4554 struct win32_display_info *dpyinfo = check_x_display_info (display); 4554 struct w32_display_info *dpyinfo = check_x_display_info (display);
4555 char *vendor = "Microsoft Corp."; 4555 char *vendor = "Microsoft Corp.";
4556 4556
4557 if (! vendor) vendor = ""; 4557 if (! vendor) vendor = "";
@@ -4569,10 +4569,10 @@ If omitted or nil, that stands for the selected frame's display.")
4569 (display) 4569 (display)
4570 Lisp_Object display; 4570 Lisp_Object display;
4571{ 4571{
4572 struct win32_display_info *dpyinfo = check_x_display_info (display); 4572 struct w32_display_info *dpyinfo = check_x_display_info (display);
4573 4573
4574 return Fcons (make_number (nt_major_version), 4574 return Fcons (make_number (w32_major_version),
4575 Fcons (make_number (nt_minor_version), Qnil)); 4575 Fcons (make_number (w32_minor_version), Qnil));
4576} 4576}
4577 4577
4578DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0, 4578DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0,
@@ -4583,7 +4583,7 @@ If omitted or nil, that stands for the selected frame's display.")
4583 (display) 4583 (display)
4584 Lisp_Object display; 4584 Lisp_Object display;
4585{ 4585{
4586 struct win32_display_info *dpyinfo = check_x_display_info (display); 4586 struct w32_display_info *dpyinfo = check_x_display_info (display);
4587 4587
4588 return make_number (1); 4588 return make_number (1);
4589} 4589}
@@ -4596,7 +4596,7 @@ If omitted or nil, that stands for the selected frame's display.")
4596 (display) 4596 (display)
4597 Lisp_Object display; 4597 Lisp_Object display;
4598{ 4598{
4599 struct win32_display_info *dpyinfo = check_x_display_info (display); 4599 struct w32_display_info *dpyinfo = check_x_display_info (display);
4600 HDC hdc; 4600 HDC hdc;
4601 int cap; 4601 int cap;
4602 4602
@@ -4617,7 +4617,7 @@ If omitted or nil, that stands for the selected frame's display.")
4617 (display) 4617 (display)
4618 Lisp_Object display; 4618 Lisp_Object display;
4619{ 4619{
4620 struct win32_display_info *dpyinfo = check_x_display_info (display); 4620 struct w32_display_info *dpyinfo = check_x_display_info (display);
4621 4621
4622 HDC hdc; 4622 HDC hdc;
4623 int cap; 4623 int cap;
@@ -4655,7 +4655,7 @@ If omitted or nil, that stands for the selected frame's display.")
4655 (display) 4655 (display)
4656 Lisp_Object display; 4656 Lisp_Object display;
4657{ 4657{
4658 struct win32_display_info *dpyinfo = check_x_display_info (display); 4658 struct w32_display_info *dpyinfo = check_x_display_info (display);
4659 4659
4660#if 0 4660#if 0
4661 switch (dpyinfo->visual->class) 4661 switch (dpyinfo->visual->class)
@@ -4683,7 +4683,7 @@ If omitted or nil, that stands for the selected frame's display.")
4683 (display) 4683 (display)
4684 Lisp_Object display; 4684 Lisp_Object display;
4685{ 4685{
4686 struct win32_display_info *dpyinfo = check_x_display_info (display); 4686 struct w32_display_info *dpyinfo = check_x_display_info (display);
4687 4687
4688 return Qnil; 4688 return Qnil;
4689} 4689}
@@ -4706,37 +4706,37 @@ int
4706x_char_width (f) 4706x_char_width (f)
4707 register struct frame *f; 4707 register struct frame *f;
4708{ 4708{
4709 return FONT_WIDTH (f->output_data.win32->font); 4709 return FONT_WIDTH (f->output_data.w32->font);
4710} 4710}
4711 4711
4712int 4712int
4713x_char_height (f) 4713x_char_height (f)
4714 register struct frame *f; 4714 register struct frame *f;
4715{ 4715{
4716 return f->output_data.win32->line_height; 4716 return f->output_data.w32->line_height;
4717} 4717}
4718 4718
4719int 4719int
4720x_screen_planes (frame) 4720x_screen_planes (frame)
4721 Lisp_Object frame; 4721 Lisp_Object frame;
4722{ 4722{
4723 return (FRAME_WIN32_DISPLAY_INFO (XFRAME (frame))->n_planes * 4723 return (FRAME_W32_DISPLAY_INFO (XFRAME (frame))->n_planes *
4724 FRAME_WIN32_DISPLAY_INFO (XFRAME (frame))->n_cbits); 4724 FRAME_W32_DISPLAY_INFO (XFRAME (frame))->n_cbits);
4725} 4725}
4726 4726
4727/* Return the display structure for the display named NAME. 4727/* Return the display structure for the display named NAME.
4728 Open a new connection if necessary. */ 4728 Open a new connection if necessary. */
4729 4729
4730struct win32_display_info * 4730struct w32_display_info *
4731x_display_info_for_name (name) 4731x_display_info_for_name (name)
4732 Lisp_Object name; 4732 Lisp_Object name;
4733{ 4733{
4734 Lisp_Object names; 4734 Lisp_Object names;
4735 struct win32_display_info *dpyinfo; 4735 struct w32_display_info *dpyinfo;
4736 4736
4737 CHECK_STRING (name, 0); 4737 CHECK_STRING (name, 0);
4738 4738
4739 for (dpyinfo = &one_win32_display_info, names = win32_display_name_list; 4739 for (dpyinfo = &one_w32_display_info, names = w32_display_name_list;
4740 dpyinfo; 4740 dpyinfo;
4741 dpyinfo = dpyinfo->next, names = XCONS (names)->cdr) 4741 dpyinfo = dpyinfo->next, names = XCONS (names)->cdr)
4742 { 4742 {
@@ -4751,7 +4751,7 @@ x_display_info_for_name (name)
4751 4751
4752 validate_x_resource_name (); 4752 validate_x_resource_name ();
4753 4753
4754 dpyinfo = win32_term_init (name, (unsigned char *)0, 4754 dpyinfo = w32_term_init (name, (unsigned char *)0,
4755 (char *) XSTRING (Vx_resource_name)->data); 4755 (char *) XSTRING (Vx_resource_name)->data);
4756 4756
4757 if (dpyinfo == 0) 4757 if (dpyinfo == 0)
@@ -4773,7 +4773,7 @@ terminate Emacs if we can't open the connection.")
4773{ 4773{
4774 unsigned int n_planes; 4774 unsigned int n_planes;
4775 unsigned char *xrm_option; 4775 unsigned char *xrm_option;
4776 struct win32_display_info *dpyinfo; 4776 struct w32_display_info *dpyinfo;
4777 4777
4778 CHECK_STRING (display, 0); 4778 CHECK_STRING (display, 0);
4779 if (! NILP (xrm_string)) 4779 if (! NILP (xrm_string))
@@ -4794,12 +4794,12 @@ terminate Emacs if we can't open the connection.")
4794 Fexpand_file_name (build_string ("rgb.txt"), 4794 Fexpand_file_name (build_string ("rgb.txt"),
4795 Fsymbol_value (intern ("data-directory"))); 4795 Fsymbol_value (intern ("data-directory")));
4796 4796
4797 Vwin32_color_map = Fwin32_load_color_file (color_file); 4797 Vw32_color_map = Fw32_load_color_file (color_file);
4798 4798
4799 UNGCPRO; 4799 UNGCPRO;
4800 } 4800 }
4801 if (NILP (Vwin32_color_map)) 4801 if (NILP (Vw32_color_map))
4802 Vwin32_color_map = Fwin32_default_color_map (); 4802 Vw32_color_map = Fw32_default_color_map ();
4803 4803
4804 if (! NILP (xrm_string)) 4804 if (! NILP (xrm_string))
4805 xrm_option = (unsigned char *) XSTRING (xrm_string)->data; 4805 xrm_option = (unsigned char *) XSTRING (xrm_string)->data;
@@ -4822,7 +4822,7 @@ terminate Emacs if we can't open the connection.")
4822 4822
4823 /* This is what opens the connection and sets x_current_display. 4823 /* This is what opens the connection and sets x_current_display.
4824 This also initializes many symbols, such as those used for input. */ 4824 This also initializes many symbols, such as those used for input. */
4825 dpyinfo = win32_term_init (display, xrm_option, 4825 dpyinfo = w32_term_init (display, xrm_option,
4826 (char *) XSTRING (Vx_resource_name)->data); 4826 (char *) XSTRING (Vx_resource_name)->data);
4827 4827
4828 if (dpyinfo == 0) 4828 if (dpyinfo == 0)
@@ -4846,8 +4846,8 @@ If DISPLAY is nil, that stands for the selected frame's display.")
4846 (display) 4846 (display)
4847 Lisp_Object display; 4847 Lisp_Object display;
4848{ 4848{
4849 struct win32_display_info *dpyinfo = check_x_display_info (display); 4849 struct w32_display_info *dpyinfo = check_x_display_info (display);
4850 struct win32_display_info *tail; 4850 struct w32_display_info *tail;
4851 int i; 4851 int i;
4852 4852
4853 if (dpyinfo->reference_count > 0) 4853 if (dpyinfo->reference_count > 0)
@@ -4861,7 +4861,7 @@ If DISPLAY is nil, that stands for the selected frame's display.")
4861 free (dpyinfo->font_table[i].name); 4861 free (dpyinfo->font_table[i].name);
4862 /* Don't free the full_name string; 4862 /* Don't free the full_name string;
4863 it is always shared with something else. */ 4863 it is always shared with something else. */
4864 win32_unload_font (dpyinfo, dpyinfo->font_table[i].font); 4864 w32_unload_font (dpyinfo, dpyinfo->font_table[i].font);
4865 } 4865 }
4866 x_destroy_all_bitmaps (dpyinfo); 4866 x_destroy_all_bitmaps (dpyinfo);
4867 4867
@@ -4878,7 +4878,7 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
4878 Lisp_Object tail, result; 4878 Lisp_Object tail, result;
4879 4879
4880 result = Qnil; 4880 result = Qnil;
4881 for (tail = win32_display_name_list; ! NILP (tail); tail = XCONS (tail)->cdr) 4881 for (tail = w32_display_name_list; ! NILP (tail); tail = XCONS (tail)->cdr)
4882 result = Fcons (XCONS (XCONS (tail)->car)->car, result); 4882 result = Fcons (XCONS (XCONS (tail)->car)->car, result);
4883 4883
4884 return result; 4884 return result;
@@ -4887,23 +4887,23 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
4887DEFUN ("x-synchronize", Fx_synchronize, Sx_synchronize, 1, 2, 0, 4887DEFUN ("x-synchronize", Fx_synchronize, Sx_synchronize, 1, 2, 0,
4888 "If ON is non-nil, report errors as soon as the erring request is made.\n\ 4888 "If ON is non-nil, report errors as soon as the erring request is made.\n\
4889If ON is nil, allow buffering of requests.\n\ 4889If ON is nil, allow buffering of requests.\n\
4890This is a noop on Win32 systems.\n\ 4890This is a noop on W32 systems.\n\
4891The optional second argument DISPLAY specifies which display to act on.\n\ 4891The optional second argument DISPLAY specifies which display to act on.\n\
4892DISPLAY should be either a frame or a display name (a string).\n\ 4892DISPLAY should be either a frame or a display name (a string).\n\
4893If DISPLAY is omitted or nil, that stands for the selected frame's display.") 4893If DISPLAY is omitted or nil, that stands for the selected frame's display.")
4894 (on, display) 4894 (on, display)
4895 Lisp_Object display, on; 4895 Lisp_Object display, on;
4896{ 4896{
4897 struct win32_display_info *dpyinfo = check_x_display_info (display); 4897 struct w32_display_info *dpyinfo = check_x_display_info (display);
4898 4898
4899 return Qnil; 4899 return Qnil;
4900} 4900}
4901 4901
4902 4902
4903/* These are the win32 specialized functions */ 4903/* These are the w32 specialized functions */
4904 4904
4905DEFUN ("win32-select-font", Fwin32_select_font, Swin32_select_font, 0, 1, 0, 4905DEFUN ("w32-select-font", Fw32_select_font, Sw32_select_font, 0, 1, 0,
4906 "This will display the Win32 font dialog and return an X font string corresponding to the selection.") 4906 "This will display the W32 font dialog and return an X font string corresponding to the selection.")
4907 (frame) 4907 (frame)
4908 Lisp_Object frame; 4908 Lisp_Object frame;
4909{ 4909{
@@ -4915,18 +4915,18 @@ DEFUN ("win32-select-font", Fwin32_select_font, Swin32_select_font, 0, 1, 0,
4915 bzero (&cf, sizeof (cf)); 4915 bzero (&cf, sizeof (cf));
4916 4916
4917 cf.lStructSize = sizeof (cf); 4917 cf.lStructSize = sizeof (cf);
4918 cf.hwndOwner = FRAME_WIN32_WINDOW (f); 4918 cf.hwndOwner = FRAME_W32_WINDOW (f);
4919 cf.Flags = CF_FIXEDPITCHONLY | CF_FORCEFONTEXIST | CF_SCREENFONTS; 4919 cf.Flags = CF_FIXEDPITCHONLY | CF_FORCEFONTEXIST | CF_SCREENFONTS;
4920 cf.lpLogFont = &lf; 4920 cf.lpLogFont = &lf;
4921 4921
4922 if (!ChooseFont (&cf) || !win32_to_x_font (&lf, buf, 100)) 4922 if (!ChooseFont (&cf) || !w32_to_x_font (&lf, buf, 100))
4923 return Qnil; 4923 return Qnil;
4924 4924
4925 return build_string (buf); 4925 return build_string (buf);
4926} 4926}
4927 4927
4928 4928
4929syms_of_win32fns () 4929syms_of_w32fns ()
4930{ 4930{
4931 /* The section below is built by the lisp expression at the top of the file, 4931 /* The section below is built by the lisp expression at the top of the file,
4932 just above where these variables are declared. */ 4932 just above where these variables are declared. */
@@ -5004,56 +5004,56 @@ syms_of_win32fns ()
5004 Fput (Qundefined_color, Qerror_message, 5004 Fput (Qundefined_color, Qerror_message,
5005 build_string ("Undefined color")); 5005 build_string ("Undefined color"));
5006 5006
5007 DEFVAR_LISP ("win32-color-map", &Vwin32_color_map, 5007 DEFVAR_LISP ("w32-color-map", &Vw32_color_map,
5008 "A array of color name mappings for windows."); 5008 "A array of color name mappings for windows.");
5009 Vwin32_color_map = Qnil; 5009 Vw32_color_map = Qnil;
5010 5010
5011 DEFVAR_LISP ("win32-pass-alt-to-system", &Vwin32_pass_alt_to_system, 5011 DEFVAR_LISP ("w32-pass-alt-to-system", &Vw32_pass_alt_to_system,
5012 "Non-nil if alt key presses are passed on to Windows.\n\ 5012 "Non-nil if alt key presses are passed on to Windows.\n\
5013When non-nil, for example, alt pressed and released and then space will\n\ 5013When non-nil, for example, alt pressed and released and then space will\n\
5014open the System menu. When nil, Emacs silently swallows alt key events."); 5014open the System menu. When nil, Emacs silently swallows alt key events.");
5015 Vwin32_pass_alt_to_system = Qnil; 5015 Vw32_pass_alt_to_system = Qnil;
5016 5016
5017 DEFVAR_LISP ("win32-alt-is-meta", &Vwin32_alt_is_meta, 5017 DEFVAR_LISP ("w32-alt-is-meta", &Vw32_alt_is_meta,
5018 "Non-nil if the alt key is to be considered the same as the meta key.\n\ 5018 "Non-nil if the alt key is to be considered the same as the meta key.\n\
5019When nil, Emacs will translate the alt key to the Alt modifier, and not Meta."); 5019When nil, Emacs will translate the alt key to the Alt modifier, and not Meta.");
5020 Vwin32_alt_is_meta = Qt; 5020 Vw32_alt_is_meta = Qt;
5021 5021
5022 DEFVAR_LISP ("win32-pass-optional-keys-to-system", 5022 DEFVAR_LISP ("w32-pass-optional-keys-to-system",
5023 &Vwin32_pass_optional_keys_to_system, 5023 &Vw32_pass_optional_keys_to_system,
5024 "Non-nil if the 'optional' keys (left window, right window,\n\ 5024 "Non-nil if the 'optional' keys (left window, right window,\n\
5025and application keys) are passed on to Windows."); 5025and application keys) are passed on to Windows.");
5026 Vwin32_pass_optional_keys_to_system = Qnil; 5026 Vw32_pass_optional_keys_to_system = Qnil;
5027 5027
5028 DEFVAR_LISP ("win32-enable-italics", &Vwin32_enable_italics, 5028 DEFVAR_LISP ("w32-enable-italics", &Vw32_enable_italics,
5029 "Non-nil enables selection of artificially italicized fonts."); 5029 "Non-nil enables selection of artificially italicized fonts.");
5030 Vwin32_enable_italics = Qnil; 5030 Vw32_enable_italics = Qnil;
5031 5031
5032 DEFVAR_LISP ("win32-enable-palette", &Vwin32_enable_palette, 5032 DEFVAR_LISP ("w32-enable-palette", &Vw32_enable_palette,
5033 "Non-nil enables Windows palette management to map colors exactly."); 5033 "Non-nil enables Windows palette management to map colors exactly.");
5034 Vwin32_enable_palette = Qt; 5034 Vw32_enable_palette = Qt;
5035 5035
5036 DEFVAR_INT ("win32-mouse-button-tolerance", 5036 DEFVAR_INT ("w32-mouse-button-tolerance",
5037 &Vwin32_mouse_button_tolerance, 5037 &Vw32_mouse_button_tolerance,
5038 "Analogue of double click interval for faking middle mouse events.\n\ 5038 "Analogue of double click interval for faking middle mouse events.\n\
5039The value is the minimum time in milliseconds that must elapse between\n\ 5039The value is the minimum time in milliseconds that must elapse between\n\
5040left/right button down events before they are considered distinct events.\n\ 5040left/right button down events before they are considered distinct events.\n\
5041If both mouse buttons are depressed within this interval, a middle mouse\n\ 5041If both mouse buttons are depressed within this interval, a middle mouse\n\
5042button down event is generated instead."); 5042button down event is generated instead.");
5043 XSETINT (Vwin32_mouse_button_tolerance, GetDoubleClickTime () / 2); 5043 XSETINT (Vw32_mouse_button_tolerance, GetDoubleClickTime () / 2);
5044 5044
5045 DEFVAR_INT ("win32-mouse-move-interval", 5045 DEFVAR_INT ("w32-mouse-move-interval",
5046 &Vwin32_mouse_move_interval, 5046 &Vw32_mouse_move_interval,
5047 "Minimum interval between mouse move events.\n\ 5047 "Minimum interval between mouse move events.\n\
5048The value is the minimum time in milliseconds that must elapse between\n\ 5048The value is the minimum time in milliseconds that must elapse between\n\
5049successive mouse move (or scroll bar drag) events before they are\n\ 5049successive mouse move (or scroll bar drag) events before they are\n\
5050reported as lisp events."); 5050reported as lisp events.");
5051 XSETINT (Vwin32_mouse_move_interval, 50); 5051 XSETINT (Vw32_mouse_move_interval, 50);
5052 5052
5053 init_x_parm_symbols (); 5053 init_x_parm_symbols ();
5054 5054
5055 DEFVAR_LISP ("x-bitmap-file-path", &Vx_bitmap_file_path, 5055 DEFVAR_LISP ("x-bitmap-file-path", &Vx_bitmap_file_path,
5056 "List of directories to search for bitmap files for win32."); 5056 "List of directories to search for bitmap files for w32.");
5057 Vx_bitmap_file_path = decode_env_path ((char *) 0, "PATH"); 5057 Vx_bitmap_file_path = decode_env_path ((char *) 0, "PATH");
5058 5058
5059 DEFVAR_LISP ("x-pointer-shape", &Vx_pointer_shape, 5059 DEFVAR_LISP ("x-pointer-shape", &Vx_pointer_shape,
@@ -5122,18 +5122,18 @@ unless you set it to something else.");
5122 defsubr (&Sx_display_list); 5122 defsubr (&Sx_display_list);
5123 defsubr (&Sx_synchronize); 5123 defsubr (&Sx_synchronize);
5124 5124
5125 /* Win32 specific functions */ 5125 /* W32 specific functions */
5126 5126
5127 defsubr (&Swin32_select_font); 5127 defsubr (&Sw32_select_font);
5128 defsubr (&Swin32_define_rgb_color); 5128 defsubr (&Sw32_define_rgb_color);
5129 defsubr (&Swin32_default_color_map); 5129 defsubr (&Sw32_default_color_map);
5130 defsubr (&Swin32_load_color_file); 5130 defsubr (&Sw32_load_color_file);
5131} 5131}
5132 5132
5133#undef abort 5133#undef abort
5134 5134
5135void 5135void
5136win32_abort() 5136w32_abort()
5137{ 5137{
5138 int button; 5138 int button;
5139 button = MessageBox (NULL, 5139 button = MessageBox (NULL,
diff --git a/src/w32heap.c b/src/w32heap.c
index 6847b9345c7..240185501b9 100644
--- a/src/w32heap.c
+++ b/src/w32heap.c
@@ -38,8 +38,8 @@ int edata;
38int etext; 38int etext;
39 39
40/* The major and minor versions of NT. */ 40/* The major and minor versions of NT. */
41int nt_major_version; 41int w32_major_version;
42int nt_minor_version; 42int w32_minor_version;
43 43
44/* Cache information describing the NT system for later use. */ 44/* Cache information describing the NT system for later use. */
45void 45void
@@ -58,8 +58,8 @@ cache_system_info (void)
58 58
59 /* Cache the version of the operating system. */ 59 /* Cache the version of the operating system. */
60 version.data = GetVersion (); 60 version.data = GetVersion ();
61 nt_major_version = version.info.major; 61 w32_major_version = version.info.major;
62 nt_minor_version = version.info.minor; 62 w32_minor_version = version.info.minor;
63 63
64 /* Cache page size, allocation unit, processor type, etc. */ 64 /* Cache page size, allocation unit, processor type, etc. */
65 GetSystemInfo (&sysinfo_cache); 65 GetSystemInfo (&sysinfo_cache);
diff --git a/src/w32heap.h b/src/w32heap.h
index b3c01d3a976..24ed080ff7f 100644
--- a/src/w32heap.h
+++ b/src/w32heap.h
@@ -36,8 +36,8 @@ Boston, MA 02111-1307, USA.
36#define get_page_size() sysinfo_cache.dwPageSize 36#define get_page_size() sysinfo_cache.dwPageSize
37#define get_allocation_unit() sysinfo_cache.dwAllocationGranularity 37#define get_allocation_unit() sysinfo_cache.dwAllocationGranularity
38#define get_processor_type() sysinfo_cache.dwProcessorType 38#define get_processor_type() sysinfo_cache.dwProcessorType
39#define get_nt_major_version() nt_major_version 39#define get_w32_major_version() w32_major_version
40#define get_nt_minor_version() nt_minor_version 40#define get_w32_minor_version() w32_minor_version
41 41
42extern unsigned char *get_data_start(); 42extern unsigned char *get_data_start();
43extern unsigned char *get_data_end(); 43extern unsigned char *get_data_end();
@@ -45,8 +45,8 @@ extern unsigned long data_region_size;
45extern unsigned long reserved_heap_size; 45extern unsigned long reserved_heap_size;
46extern SYSTEM_INFO sysinfo_cache; 46extern SYSTEM_INFO sysinfo_cache;
47extern BOOL need_to_recreate_heap; 47extern BOOL need_to_recreate_heap;
48extern int nt_major_version; 48extern int w32_major_version;
49extern int nt_minor_version; 49extern int w32_minor_version;
50 50
51/* Emulation of Unix sbrk(). */ 51/* Emulation of Unix sbrk(). */
52extern void *sbrk (unsigned long size); 52extern void *sbrk (unsigned long size);
diff --git a/src/w32inevt.c b/src/w32inevt.c
index 2a6553196c5..7e811bfe1df 100644
--- a/src/w32inevt.c
+++ b/src/w32inevt.c
@@ -1,4 +1,4 @@
1/* Input event support for Windows NT port of GNU Emacs. 1/* Input event support for Emacs under Win32 API.
2 Copyright (C) 1992, 1993, 1995 Free Software Foundation, Inc. 2 Copyright (C) 1992, 1993, 1995 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
@@ -48,7 +48,7 @@ extern void reinvoke_input_signal (void);
48extern int change_frame_size (FRAME_PTR, int, int, int, int); 48extern int change_frame_size (FRAME_PTR, int, int, int, int);
49 49
50/* from w32fns.c */ 50/* from w32fns.c */
51extern Lisp_Object Vwin32_alt_is_meta; 51extern Lisp_Object Vw32_alt_is_meta;
52 52
53/* Event queue */ 53/* Event queue */
54#define EVENT_QUEUE_SIZE 50 54#define EVENT_QUEUE_SIZE 50
@@ -96,7 +96,7 @@ get_frame (void)
96/* Translate console modifiers to emacs modifiers. 96/* Translate console modifiers to emacs modifiers.
97 German keyboard support (Kai Morgan Zeise 2/18/95). */ 97 German keyboard support (Kai Morgan Zeise 2/18/95). */
98int 98int
99win32_kbd_mods_to_emacs (DWORD mods) 99w32_kbd_mods_to_emacs (DWORD mods)
100{ 100{
101 int retval = 0; 101 int retval = 0;
102 102
@@ -106,7 +106,7 @@ win32_kbd_mods_to_emacs (DWORD mods)
106 mods &= ~ (RIGHT_ALT_PRESSED | LEFT_CTRL_PRESSED); 106 mods &= ~ (RIGHT_ALT_PRESSED | LEFT_CTRL_PRESSED);
107 107
108 if (mods & (RIGHT_ALT_PRESSED | LEFT_ALT_PRESSED)) 108 if (mods & (RIGHT_ALT_PRESSED | LEFT_ALT_PRESSED))
109 retval = ((NILP (Vwin32_alt_is_meta)) ? alt_modifier : meta_modifier); 109 retval = ((NILP (Vw32_alt_is_meta)) ? alt_modifier : meta_modifier);
110 110
111 if (mods & (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED)) 111 if (mods & (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED))
112 { 112 {
@@ -125,7 +125,7 @@ win32_kbd_mods_to_emacs (DWORD mods)
125 125
126/* The return code indicates key code size. */ 126/* The return code indicates key code size. */
127int 127int
128win32_kbd_patch_key (KEY_EVENT_RECORD *event) 128w32_kbd_patch_key (KEY_EVENT_RECORD *event)
129{ 129{
130 unsigned int key_code = event->wVirtualKeyCode; 130 unsigned int key_code = event->wVirtualKeyCode;
131 unsigned int mods = event->dwControlKeyState; 131 unsigned int mods = event->dwControlKeyState;
@@ -331,7 +331,7 @@ key_event (KEY_EVENT_RECORD *event, struct input_event *emacs_ev)
331 { 331 {
332 /* ASCII */ 332 /* ASCII */
333 emacs_ev->kind = ascii_keystroke; 333 emacs_ev->kind = ascii_keystroke;
334 key_flag = win32_kbd_patch_key (event); /* 95.7.25 by himi */ 334 key_flag = w32_kbd_patch_key (event); /* 95.7.25 by himi */
335 if (key_flag == 0) 335 if (key_flag == 0)
336 return 0; 336 return 0;
337 XSETINT (emacs_ev->code, event->uChar.AsciiChar); 337 XSETINT (emacs_ev->code, event->uChar.AsciiChar);
@@ -375,7 +375,7 @@ key_event (KEY_EVENT_RECORD *event, struct input_event *emacs_ev)
375#else 375#else
376 XSETFRAME (emacs_ev->frame_or_window, get_frame ()); 376 XSETFRAME (emacs_ev->frame_or_window, get_frame ());
377#endif 377#endif
378 emacs_ev->modifiers = win32_kbd_mods_to_emacs (event->dwControlKeyState); 378 emacs_ev->modifiers = w32_kbd_mods_to_emacs (event->dwControlKeyState);
379 emacs_ev->timestamp = GetTickCount (); 379 emacs_ev->timestamp = GetTickCount ();
380 if (key_flag == 2) return -1; /* 95.7.25 by himi */ 380 if (key_flag == 2) return -1; /* 95.7.25 by himi */
381 return 1; 381 return 1;
@@ -383,7 +383,7 @@ key_event (KEY_EVENT_RECORD *event, struct input_event *emacs_ev)
383 383
384/* Mouse position hook. */ 384/* Mouse position hook. */
385void 385void
386win32_mouse_position (FRAME_PTR *f, 386w32_mouse_position (FRAME_PTR *f,
387#ifndef MULE 387#ifndef MULE
388 int insist, 388 int insist,
389#endif 389#endif
@@ -482,7 +482,7 @@ do_mouse_event (MOUSE_EVENT_RECORD *event,
482 482
483 button_state = event->dwButtonState; 483 button_state = event->dwButtonState;
484 emacs_ev->timestamp = GetTickCount (); 484 emacs_ev->timestamp = GetTickCount ();
485 emacs_ev->modifiers = win32_kbd_mods_to_emacs (event->dwControlKeyState) | 485 emacs_ev->modifiers = w32_kbd_mods_to_emacs (event->dwControlKeyState) |
486 ((event->dwButtonState & mask) ? down_modifier : up_modifier); 486 ((event->dwButtonState & mask) ? down_modifier : up_modifier);
487 487
488 XSETFASTINT (emacs_ev->x, event->dwMousePosition.X); 488 XSETFASTINT (emacs_ev->x, event->dwMousePosition.X);
@@ -507,8 +507,8 @@ resize_event (WINDOW_BUFFER_SIZE_RECORD *event)
507} 507}
508 508
509int 509int
510win32_read_socket (int sd, struct input_event *bufp, int numchars, 510w32_console_read_socket (int sd, struct input_event *bufp, int numchars,
511 int waitp, int expected) 511 int waitp, int expected)
512{ 512{
513 BOOL no_events = TRUE; 513 BOOL no_events = TRUE;
514 int nev, ret = 0, add; 514 int nev, ret = 0, add;
diff --git a/src/w32inevt.h b/src/w32inevt.h
index f0732f55653..f0a0a9c5ad9 100644
--- a/src/w32inevt.h
+++ b/src/w32inevt.h
@@ -1,4 +1,4 @@
1/* Win32 input routines. 1/* Input routines for Emacs on Win32 API.
2 Copyright (C) 1995 Free Software Foundation, Inc. 2 Copyright (C) 1995 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
@@ -21,9 +21,9 @@ Boston, MA 02111-1307, USA. */
21#ifndef __NTINEVT_H__ 21#ifndef __NTINEVT_H__
22#define __NTINEVT_H__ 22#define __NTINEVT_H__
23 23
24int win32_read_socket (/* int sd, struct input_event *bufp, int numchars, 24int w32_console_read_socket (/* int sd, struct input_event *bufp, int numchars,
25 int waitp, int expected */); 25 int waitp, int expected */);
26void win32_mouse_position (/* FRAME_PTR *f, 26void w32_mouse_position (/* FRAME_PTR *f,
27 Lisp_Object *bar_window, 27 Lisp_Object *bar_window,
28 enum scroll_bar_part *part, 28 enum scroll_bar_part *part,
29 Lisp_Object *x, 29 Lisp_Object *x,
diff --git a/src/w32menu.c b/src/w32menu.c
index eb6b18fa21d..c3945076537 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -66,8 +66,8 @@ extern Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map;
66 66
67extern Lisp_Object Qmenu_bar_update_hook; 67extern Lisp_Object Qmenu_bar_update_hook;
68 68
69static Lisp_Object win32_dialog_show (); 69static Lisp_Object w32_dialog_show ();
70static Lisp_Object win32menu_show (); 70static Lisp_Object w32menu_show ();
71 71
72static HMENU keymap_panes (); 72static HMENU keymap_panes ();
73static HMENU single_keymap_panes (); 73static HMENU single_keymap_panes ();
@@ -576,7 +576,7 @@ single_keymap_panes (lpmm, keymap, pane_name, prefix, notreal)
576 eltcdr = XCONS (elt)->cdr; 576 eltcdr = XCONS (elt)->cdr;
577 string = XCONS (eltcdr)->car; 577 string = XCONS (eltcdr)->car;
578 /* We no longer discard the @ from the beginning of the string here. 578 /* We no longer discard the @ from the beginning of the string here.
579 Instead, we do this in win32menu_show. */ 579 Instead, we do this in w32menu_show. */
580 { 580 {
581 HMENU new_hmenu = single_keymap_panes (lpmm, 581 HMENU new_hmenu = single_keymap_panes (lpmm,
582 Fcar (elt), 582 Fcar (elt),
@@ -946,7 +946,7 @@ get_single_keymap_event (keymap, lpnum)
946 eltcdr = XCONS (elt)->cdr; 946 eltcdr = XCONS (elt)->cdr;
947 string = XCONS (eltcdr)->car; 947 string = XCONS (eltcdr)->car;
948 /* We no longer discard the @ from the beginning of the string here. 948 /* We no longer discard the @ from the beginning of the string here.
949 Instead, we do this in win32menu_show. */ 949 Instead, we do this in w32menu_show. */
950 { 950 {
951 Lisp_Object event = get_single_keymap_event (Fcar (elt), lpnum); 951 Lisp_Object event = get_single_keymap_event (Fcar (elt), lpnum);
952 952
@@ -1212,8 +1212,8 @@ cached information about equivalent key sequences.")
1212 CHECK_LIVE_WINDOW (window, 0); 1212 CHECK_LIVE_WINDOW (window, 0);
1213 f = XFRAME (WINDOW_FRAME (XWINDOW (window))); 1213 f = XFRAME (WINDOW_FRAME (XWINDOW (window)));
1214 1214
1215 xpos = (FONT_WIDTH (f->output_data.win32->font) * XWINDOW (window)->left); 1215 xpos = (FONT_WIDTH (f->output_data.w32->font) * XWINDOW (window)->left);
1216 ypos = (f->output_data.win32->line_height * XWINDOW (window)->top); 1216 ypos = (f->output_data.w32->line_height * XWINDOW (window)->top);
1217 } 1217 }
1218 else 1218 else
1219 /* ??? Not really clean; should be CHECK_WINDOW_OR_FRAME, 1219 /* ??? Not really clean; should be CHECK_WINDOW_OR_FRAME,
@@ -1240,7 +1240,7 @@ cached information about equivalent key sequences.")
1240 /* Display them in a menu. */ 1240 /* Display them in a menu. */
1241 BLOCK_INPUT; 1241 BLOCK_INPUT;
1242 1242
1243 selection = win32menu_show (f, xpos, ypos, menu, &hmenu, &error_name); 1243 selection = w32menu_show (f, xpos, ypos, menu, &hmenu, &error_name);
1244 1244
1245 UNBLOCK_INPUT; 1245 UNBLOCK_INPUT;
1246 1246
@@ -1337,7 +1337,7 @@ on the left of the dialog box and all following items on the right.\n\
1337 1337
1338 /* Display them in a dialog box. */ 1338 /* Display them in a dialog box. */
1339 BLOCK_INPUT; 1339 BLOCK_INPUT;
1340 selection = win32_dialog_show (f, 0, 0, title, &error_name); 1340 selection = w32_dialog_show (f, 0, 0, title, &error_name);
1341 UNBLOCK_INPUT; 1341 UNBLOCK_INPUT;
1342 1342
1343 discard_menu_items (); 1343 discard_menu_items ();
@@ -1465,8 +1465,8 @@ set_frame_menubar (f, first_time)
1465 1465
1466 BLOCK_INPUT; 1466 BLOCK_INPUT;
1467 { 1467 {
1468 HMENU old = GetMenu (FRAME_WIN32_WINDOW (f)); 1468 HMENU old = GetMenu (FRAME_W32_WINDOW (f));
1469 SetMenu (FRAME_WIN32_WINDOW (f), hmenu); 1469 SetMenu (FRAME_W32_WINDOW (f), hmenu);
1470 DestroyMenu (old); 1470 DestroyMenu (old);
1471 } 1471 }
1472 1472
@@ -1484,14 +1484,14 @@ free_frame_menubar (f)
1484 BLOCK_INPUT; 1484 BLOCK_INPUT;
1485 1485
1486 { 1486 {
1487 HMENU old = GetMenu (FRAME_WIN32_WINDOW (f)); 1487 HMENU old = GetMenu (FRAME_W32_WINDOW (f));
1488 SetMenu (FRAME_WIN32_WINDOW (f), NULL); 1488 SetMenu (FRAME_W32_WINDOW (f), NULL);
1489 DestroyMenu (old); 1489 DestroyMenu (old);
1490 } 1490 }
1491 1491
1492 UNBLOCK_INPUT; 1492 UNBLOCK_INPUT;
1493} 1493}
1494/* Called from Fwin32_create_frame to create the initial menubar of a frame 1494/* Called from Fw32_create_frame to create the initial menubar of a frame
1495 before it is mapped, so that the window is mapped with the menubar already 1495 before it is mapped, so that the window is mapped with the menubar already
1496 there instead of us tacking it on later and thrashing the window after it 1496 there instead of us tacking it on later and thrashing the window after it
1497 is visible. */ 1497 is visible. */
@@ -1647,9 +1647,9 @@ else
1647 1647
1648#endif 1648#endif
1649 1649
1650/* win32menu_show actually displays a menu using the panes and items in 1650/* w32menu_show actually displays a menu using the panes and items in
1651 menu_items and returns the value selected from it. 1651 menu_items and returns the value selected from it.
1652 There are two versions of win32menu_show, one for Xt and one for Xlib. 1652 There are two versions of w32menu_show, one for Xt and one for Xlib.
1653 Both assume input is blocked by the caller. */ 1653 Both assume input is blocked by the caller. */
1654 1654
1655/* F is the frame the menu is for. 1655/* F is the frame the menu is for.
@@ -1665,7 +1665,7 @@ else
1665 1665
1666 1666
1667static Lisp_Object 1667static Lisp_Object
1668win32menu_show (f, x, y, menu, hmenu, error) 1668w32menu_show (f, x, y, menu, hmenu, error)
1669 FRAME_PTR f; 1669 FRAME_PTR f;
1670 int x; 1670 int x;
1671 int y; 1671 int y;
@@ -1688,7 +1688,7 @@ win32menu_show (f, x, y, menu, hmenu, error)
1688 pos.y = y; 1688 pos.y = y;
1689 1689
1690 /* Offset the coordinates to root-relative. */ 1690 /* Offset the coordinates to root-relative. */
1691 ClientToScreen (FRAME_WIN32_WINDOW (f), &pos); 1691 ClientToScreen (FRAME_W32_WINDOW (f), &pos);
1692 1692
1693#if 0 1693#if 0
1694 /* If the mouse moves out of the menu before we show the menu, 1694 /* If the mouse moves out of the menu before we show the menu,
@@ -1705,7 +1705,7 @@ win32menu_show (f, x, y, menu, hmenu, error)
1705 0x10, 1705 0x10,
1706 pos.x, pos.y, 1706 pos.x, pos.y,
1707 0, 1707 0,
1708 FRAME_WIN32_WINDOW (f), 1708 FRAME_W32_WINDOW (f),
1709 NULL); 1709 NULL);
1710 if (menu_selection == -1) 1710 if (menu_selection == -1)
1711 { 1711 {
@@ -1739,7 +1739,7 @@ static char * button_names [] =
1739}; 1739};
1740 1740
1741static Lisp_Object 1741static Lisp_Object
1742win32_dialog_show (f, menubarp, keymaps, title, error) 1742w32_dialog_show (f, menubarp, keymaps, title, error)
1743 FRAME_PTR f; 1743 FRAME_PTR f;
1744 int menubarp; 1744 int menubarp;
1745 int keymaps; 1745 int keymaps;
@@ -1856,7 +1856,7 @@ win32_dialog_show (f, menubarp, keymaps, title, error)
1856 /* Actually create the dialog. */ 1856 /* Actually create the dialog. */
1857 dialog_id = ++popup_id_tick; 1857 dialog_id = ++popup_id_tick;
1858 menu = lw_create_widget (first_wv->name, "dialog", dialog_id, first_wv, 1858 menu = lw_create_widget (first_wv->name, "dialog", dialog_id, first_wv,
1859 f->output_data.win32->widget, 1, 0, 1859 f->output_data.w32->widget, 1, 0,
1860 dialog_selection_callback, 0); 1860 dialog_selection_callback, 0);
1861#if 0 /* This causes crashes, and seems to be redundant -- rms. */ 1861#if 0 /* This causes crashes, and seems to be redundant -- rms. */
1862 lw_modify_all_widgets (dialog_id, first_wv, True); 1862 lw_modify_all_widgets (dialog_id, first_wv, True);
@@ -1903,7 +1903,7 @@ win32_dialog_show (f, menubarp, keymaps, title, error)
1903 That is not necessarily true, but the fiction leads to reasonable 1903 That is not necessarily true, but the fiction leads to reasonable
1904 results, and it is a pain to ask which are actually held now 1904 results, and it is a pain to ask which are actually held now
1905 or track this in the loop above. */ 1905 or track this in the loop above. */
1906 win32_mouse_grabbed = 0; 1906 w32_mouse_grabbed = 0;
1907 1907
1908 /* Unread any events that we got but did not handle. */ 1908 /* Unread any events that we got but did not handle. */
1909 while (queue != NULL) 1909 while (queue != NULL)
@@ -1957,7 +1957,7 @@ win32_dialog_show (f, menubarp, keymaps, title, error)
1957} 1957}
1958#endif 1958#endif
1959 1959
1960syms_of_win32menu () 1960syms_of_w32menu ()
1961{ 1961{
1962 Qdebug_on_next_call = intern ("debug-on-next-call"); 1962 Qdebug_on_next_call = intern ("debug-on-next-call");
1963 staticpro (&Qdebug_on_next_call); 1963 staticpro (&Qdebug_on_next_call);
diff --git a/src/w32proc.c b/src/w32proc.c
index 71aa2b41a31..3b6a78c5978 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -49,21 +49,21 @@ Boston, MA 02111-1307, USA.
49 correct parsing by child process. Because not all uses of spawnve 49 correct parsing by child process. Because not all uses of spawnve
50 are careful about constructing argv arrays, we make this behaviour 50 are careful about constructing argv arrays, we make this behaviour
51 conditional (off by default). */ 51 conditional (off by default). */
52Lisp_Object Vwin32_quote_process_args; 52Lisp_Object Vw32_quote_process_args;
53 53
54/* Control whether create_child causes the process' window to be 54/* Control whether create_child causes the process' window to be
55 hidden. The default is nil. */ 55 hidden. The default is nil. */
56Lisp_Object Vwin32_start_process_show_window; 56Lisp_Object Vw32_start_process_show_window;
57 57
58/* Time to sleep before reading from a subprocess output pipe - this 58/* Time to sleep before reading from a subprocess output pipe - this
59 avoids the inefficiency of frequently reading small amounts of data. 59 avoids the inefficiency of frequently reading small amounts of data.
60 This is primarily necessary for handling DOS processes on Windows 95, 60 This is primarily necessary for handling DOS processes on Windows 95,
61 but is useful for Win32 processes on both Win95 and NT as well. */ 61 but is useful for W32 processes on both Win95 and NT as well. */
62Lisp_Object Vwin32_pipe_read_delay; 62Lisp_Object Vw32_pipe_read_delay;
63 63
64/* Control conversion of upper case file names to lower case. 64/* Control conversion of upper case file names to lower case.
65 nil means no, t means yes. */ 65 nil means no, t means yes. */
66Lisp_Object Vwin32_downcase_file_names; 66Lisp_Object Vw32_downcase_file_names;
67 67
68/* Keep track of whether we have already started a DOS program. */ 68/* Keep track of whether we have already started a DOS program. */
69BOOL dos_process_running; 69BOOL dos_process_running;
@@ -288,7 +288,7 @@ create_child (char *exe, char *cmdline, char *env,
288 start.cb = sizeof (start); 288 start.cb = sizeof (start);
289 289
290#ifdef HAVE_NTGUI 290#ifdef HAVE_NTGUI
291 if (NILP (Vwin32_start_process_show_window)) 291 if (NILP (Vw32_start_process_show_window))
292 start.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW; 292 start.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
293 else 293 else
294 start.dwFlags = STARTF_USESTDHANDLES; 294 start.dwFlags = STARTF_USESTDHANDLES;
@@ -530,7 +530,7 @@ sys_wait (int *status)
530} 530}
531 531
532int 532int
533win32_is_dos_binary (char * filename) 533w32_is_dos_binary (char * filename)
534{ 534{
535 IMAGE_DOS_HEADER dos_header; 535 IMAGE_DOS_HEADER dos_header;
536 DWORD signature; 536 DWORD signature;
@@ -553,7 +553,7 @@ win32_is_dos_binary (char * filename)
553 Therefore, we have to do the same here as well. */ 553 Therefore, we have to do the same here as well. */
554 p = getenv ("COMSPEC"); 554 p = getenv ("COMSPEC");
555 if (p) 555 if (p)
556 is_dos_binary = win32_is_dos_binary (p); 556 is_dos_binary = w32_is_dos_binary (p);
557 } 557 }
558 else 558 else
559 { 559 {
@@ -626,7 +626,7 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp)
626 626
627 /* Check if program is a DOS executable, and if so whether we are 627 /* Check if program is a DOS executable, and if so whether we are
628 allowed to start it. */ 628 allowed to start it. */
629 is_dos_binary = win32_is_dos_binary (cmdname); 629 is_dos_binary = w32_is_dos_binary (cmdname);
630 if (is_dos_binary && dos_process_running) 630 if (is_dos_binary && dos_process_running)
631 { 631 {
632 errno = EAGAIN; 632 errno = EAGAIN;
@@ -641,10 +641,10 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp)
641 Additionally, zero-length args and args containing whitespace need 641 Additionally, zero-length args and args containing whitespace need
642 to be wrapped in double quotes. Args containing embedded double 642 to be wrapped in double quotes. Args containing embedded double
643 quotes (as opposed to enclosing quotes, which we leave alone) are 643 quotes (as opposed to enclosing quotes, which we leave alone) are
644 usually illegal (most Win32 programs do not implement escaping of 644 usually illegal (most W32 programs do not implement escaping of
645 double quotes - sad but true, at least for programs compiled with 645 double quotes - sad but true, at least for programs compiled with
646 MSVC), but we will escape quotes anyway for those programs that can 646 MSVC), but we will escape quotes anyway for those programs that can
647 handle it. The Win32 gcc library from Cygnus doubles quotes to 647 handle it. The W32 gcc library from Cygnus doubles quotes to
648 escape them, so we will use that convention. 648 escape them, so we will use that convention.
649 649
650 Since I have no idea how large argv and envp are likely to be 650 Since I have no idea how large argv and envp are likely to be
@@ -685,7 +685,7 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp)
685 if (*p == 0) 685 if (*p == 0)
686 add_quotes = 1; 686 add_quotes = 1;
687 687
688 if (!NILP (Vwin32_quote_process_args)) 688 if (!NILP (Vw32_quote_process_args))
689 { 689 {
690 /* This is conditional because it sometimes causes more 690 /* This is conditional because it sometimes causes more
691 problems than it solves, since argv arrays are not always 691 problems than it solves, since argv arrays are not always
@@ -1059,7 +1059,7 @@ sys_kill (int pid, int sig)
1059 } 1059 }
1060 else 1060 else
1061 { 1061 {
1062 /* Kill the process. On Win32 this doesn't kill child processes 1062 /* Kill the process. On W32 this doesn't kill child processes
1063 so it doesn't work very well for shells which is why it's not 1063 so it doesn't work very well for shells which is why it's not
1064 used in every case. Also, don't try to terminate DOS processes 1064 used in every case. Also, don't try to terminate DOS processes
1065 (on Win95), because this will hang Emacs. */ 1065 (on Win95), because this will hang Emacs. */
@@ -1183,7 +1183,7 @@ extern BOOL init_winsock (int load_now);
1183 1183
1184extern Lisp_Object Vsystem_name; 1184extern Lisp_Object Vsystem_name;
1185 1185
1186DEFUN ("win32-has-winsock", Fwin32_has_winsock, Swin32_has_winsock, 0, 1, 0, 1186DEFUN ("w32-has-winsock", Fw32_has_winsock, Sw32_has_winsock, 0, 1, 0,
1187 "Test for presence of the Windows socket library `winsock'.\n\ 1187 "Test for presence of the Windows socket library `winsock'.\n\
1188Returns non-nil if winsock support is present, nil otherwise.\n\ 1188Returns non-nil if winsock support is present, nil otherwise.\n\
1189\n\ 1189\n\
@@ -1218,7 +1218,7 @@ returned to indicate winsock support is present.")
1218 return Qnil; 1218 return Qnil;
1219} 1219}
1220 1220
1221DEFUN ("win32-unload-winsock", Fwin32_unload_winsock, Swin32_unload_winsock, 1221DEFUN ("w32-unload-winsock", Fw32_unload_winsock, Sw32_unload_winsock,
1222 0, 0, 0, 1222 0, 0, 0,
1223 "Unload the Windows socket library `winsock' if loaded.\n\ 1223 "Unload the Windows socket library `winsock' if loaded.\n\
1224This is provided to allow dial-up socket connections to be disconnected\n\ 1224This is provided to allow dial-up socket connections to be disconnected\n\
@@ -1235,11 +1235,11 @@ socket connections still exist.")
1235syms_of_ntproc () 1235syms_of_ntproc ()
1236{ 1236{
1237#ifdef HAVE_SOCKETS 1237#ifdef HAVE_SOCKETS
1238 defsubr (&Swin32_has_winsock); 1238 defsubr (&Sw32_has_winsock);
1239 defsubr (&Swin32_unload_winsock); 1239 defsubr (&Sw32_unload_winsock);
1240#endif 1240#endif
1241 1241
1242 DEFVAR_LISP ("win32-quote-process-args", &Vwin32_quote_process_args, 1242 DEFVAR_LISP ("w32-quote-process-args", &Vw32_quote_process_args,
1243 "Non-nil enables quoting of process arguments to ensure correct parsing.\n\ 1243 "Non-nil enables quoting of process arguments to ensure correct parsing.\n\
1244Because Windows does not directly pass argv arrays to child processes,\n\ 1244Because Windows does not directly pass argv arrays to child processes,\n\
1245programs have to reconstruct the argv array by parsing the command\n\ 1245programs have to reconstruct the argv array by parsing the command\n\
@@ -1249,15 +1249,15 @@ in double quotes or it will be parsed as multiple arguments.\n\
1249However, the argument list to call-process is not always correctly\n\ 1249However, the argument list to call-process is not always correctly\n\
1250constructed (or arguments have already been quoted), so enabling this\n\ 1250constructed (or arguments have already been quoted), so enabling this\n\
1251option may cause unexpected behavior."); 1251option may cause unexpected behavior.");
1252 Vwin32_quote_process_args = Qnil; 1252 Vw32_quote_process_args = Qnil;
1253 1253
1254 DEFVAR_LISP ("win32-start-process-show-window", 1254 DEFVAR_LISP ("w32-start-process-show-window",
1255 &Vwin32_start_process_show_window, 1255 &Vw32_start_process_show_window,
1256 "When nil, processes started via start-process hide their windows.\n\ 1256 "When nil, processes started via start-process hide their windows.\n\
1257When non-nil, they show their window in the method of their choice."); 1257When non-nil, they show their window in the method of their choice.");
1258 Vwin32_start_process_show_window = Qnil; 1258 Vw32_start_process_show_window = Qnil;
1259 1259
1260 DEFVAR_INT ("win32-pipe-read-delay", &Vwin32_pipe_read_delay, 1260 DEFVAR_INT ("w32-pipe-read-delay", &Vw32_pipe_read_delay,
1261 "Forced delay before reading subprocess output.\n\ 1261 "Forced delay before reading subprocess output.\n\
1262This is done to improve the buffering of subprocess output, by\n\ 1262This is done to improve the buffering of subprocess output, by\n\
1263avoiding the inefficiency of frequently reading small amounts of data.\n\ 1263avoiding the inefficiency of frequently reading small amounts of data.\n\
@@ -1266,11 +1266,11 @@ If positive, the value is the number of milliseconds to sleep before\n\
1266reading the subprocess output. If negative, the magnitude is the number\n\ 1266reading the subprocess output. If negative, the magnitude is the number\n\
1267of time slices to wait (effectively boosting the priority of the child\n\ 1267of time slices to wait (effectively boosting the priority of the child\n\
1268process temporarily). A value of zero disables waiting entirely."); 1268process temporarily). A value of zero disables waiting entirely.");
1269 Vwin32_pipe_read_delay = 50; 1269 Vw32_pipe_read_delay = 50;
1270 1270
1271 DEFVAR_LISP ("win32-downcase-file-names", &Vwin32_downcase_file_names, 1271 DEFVAR_LISP ("w32-downcase-file-names", &Vw32_downcase_file_names,
1272 "Non-nil means convert all-upper case file names to lower case.\n\ 1272 "Non-nil means convert all-upper case file names to lower case.\n\
1273This applies when performing completions and file name expansion."); 1273This applies when performing completions and file name expansion.");
1274 Vwin32_downcase_file_names = Qnil; 1274 Vw32_downcase_file_names = Qnil;
1275} 1275}
1276/* end of ntproc.c */ 1276/* end of ntproc.c */
diff --git a/src/w32reg.c b/src/w32reg.c
index 0bffe82513d..d32032c76e2 100644
--- a/src/w32reg.c
+++ b/src/w32reg.c
@@ -31,7 +31,7 @@ Boston, MA 02111-1307, USA. */
31#define REG_ROOT "SOFTWARE\\GNU\\Emacs" 31#define REG_ROOT "SOFTWARE\\GNU\\Emacs"
32 32
33LPBYTE 33LPBYTE
34win32_get_string_resource (name, class, dwexptype) 34w32_get_string_resource (name, class, dwexptype)
35 char *name, *class; 35 char *name, *class;
36 DWORD dwexptype; 36 DWORD dwexptype;
37{ 37{
@@ -93,5 +93,5 @@ x_get_string_resource (rdb, name, class)
93 int rdb; 93 int rdb;
94 char *name, *class; 94 char *name, *class;
95{ 95{
96 return (win32_get_string_resource (name, class, REG_SZ)); 96 return (w32_get_string_resource (name, class, REG_SZ));
97} 97}
diff --git a/src/w32select.c b/src/w32select.c
index 6b3b0acf8b0..84d6e2b8dfe 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -1,4 +1,4 @@
1/* Win32 Selection processing for emacs 1/* Selection processing for Emacs using the Win32 API.
2 Copyright (C) 1993, 1994 Free Software Foundation. 2 Copyright (C) 1993, 1994 Free Software Foundation.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
@@ -22,7 +22,7 @@ Boston, MA 02111-1307, USA. */
22 22
23#include <config.h> 23#include <config.h>
24#include "lisp.h" 24#include "lisp.h"
25#include "w32term.h" /* for all of the win32 includes */ 25#include "w32term.h" /* for all of the w32 includes */
26#include "dispextern.h" /* frame.h seems to want this */ 26#include "dispextern.h" /* frame.h seems to want this */
27#include "frame.h" /* Need this to get the X window of selected_frame */ 27#include "frame.h" /* Need this to get the X window of selected_frame */
28#include "blockinput.h" 28#include "blockinput.h"
@@ -30,7 +30,7 @@ Boston, MA 02111-1307, USA. */
30Lisp_Object QCLIPBOARD; 30Lisp_Object QCLIPBOARD;
31 31
32#if 0 32#if 0
33DEFUN ("win32-open-clipboard", Fwin32_open_clipboard, Swin32_open_clipboard, 0, 1, 0, 33DEFUN ("w32-open-clipboard", Fw32_open_clipboard, Sw32_open_clipboard, 0, 1, 0,
34 "This opens the clipboard with the given frame pointer.") 34 "This opens the clipboard with the given frame pointer.")
35 (frame) 35 (frame)
36 Lisp_Object frame; 36 Lisp_Object frame;
@@ -42,14 +42,14 @@ DEFUN ("win32-open-clipboard", Fwin32_open_clipboard, Swin32_open_clipboard, 0,
42 42
43 BLOCK_INPUT; 43 BLOCK_INPUT;
44 44
45 ok = OpenClipboard ((!NILP (frame) && FRAME_WIN32_P (XFRAME (frame))) ? FRAME_WIN32_WINDOW (XFRAME (frame)) : NULL); 45 ok = OpenClipboard ((!NILP (frame) && FRAME_W32_P (XFRAME (frame))) ? FRAME_W32_WINDOW (XFRAME (frame)) : NULL);
46 46
47 UNBLOCK_INPUT; 47 UNBLOCK_INPUT;
48 48
49 return (ok ? frame : Qnil); 49 return (ok ? frame : Qnil);
50} 50}
51 51
52DEFUN ("win32-empty-clipboard", Fwin32_empty_clipboard, Swin32_empty_clipboard, 0, 0, 0, 52DEFUN ("w32-empty-clipboard", Fw32_empty_clipboard, Sw32_empty_clipboard, 0, 0, 0,
53 "This empties the clipboard and assigns ownership to the window which opened the clipboard.") 53 "This empties the clipboard and assigns ownership to the window which opened the clipboard.")
54 () 54 ()
55{ 55{
@@ -64,7 +64,7 @@ DEFUN ("win32-empty-clipboard", Fwin32_empty_clipboard, Swin32_empty_clipboard,
64 return (ok ? Qt : Qnil); 64 return (ok ? Qt : Qnil);
65} 65}
66 66
67DEFUN ("win32-close-clipboard", Fwin32_close_clipboard, Swin32_close_clipboard, 0, 0, 0, 67DEFUN ("w32-close-clipboard", Fw32_close_clipboard, Sw32_close_clipboard, 0, 0, 0,
68 "This closes the clipboard.") 68 "This closes the clipboard.")
69 () 69 ()
70{ 70{
@@ -81,7 +81,7 @@ DEFUN ("win32-close-clipboard", Fwin32_close_clipboard, Swin32_close_clipboard,
81 81
82#endif 82#endif
83 83
84DEFUN ("win32-set-clipboard-data", Fwin32_set_clipboard_data, Swin32_set_clipboard_data, 1, 2, 0, 84DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data, Sw32_set_clipboard_data, 1, 2, 0,
85 "This sets the clipboard data to the given text.") 85 "This sets the clipboard data to the given text.")
86 (string, frame) 86 (string, frame)
87 Lisp_Object string, frame; 87 Lisp_Object string, frame;
@@ -146,7 +146,7 @@ DEFUN ("win32-set-clipboard-data", Fwin32_set_clipboard_data, Swin32_set_clipboa
146 146
147 GlobalUnlock (htext); 147 GlobalUnlock (htext);
148 148
149 if (!OpenClipboard ((!NILP (frame) && FRAME_WIN32_P (XFRAME (frame))) ? FRAME_WIN32_WINDOW (XFRAME (frame)) : NULL)) 149 if (!OpenClipboard ((!NILP (frame) && FRAME_W32_P (XFRAME (frame))) ? FRAME_W32_WINDOW (XFRAME (frame)) : NULL))
150 goto error; 150 goto error;
151 151
152 ok = EmptyClipboard () && SetClipboardData (CF_TEXT, htext); 152 ok = EmptyClipboard () && SetClipboardData (CF_TEXT, htext);
@@ -166,7 +166,7 @@ DEFUN ("win32-set-clipboard-data", Fwin32_set_clipboard_data, Swin32_set_clipboa
166 return (ok ? string : Qnil); 166 return (ok ? string : Qnil);
167} 167}
168 168
169DEFUN ("win32-get-clipboard-data", Fwin32_get_clipboard_data, Swin32_get_clipboard_data, 0, 1, 0, 169DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data, Sw32_get_clipboard_data, 0, 1, 0,
170 "This gets the clipboard data in text format.") 170 "This gets the clipboard data in text format.")
171 (frame) 171 (frame)
172 Lisp_Object frame; 172 Lisp_Object frame;
@@ -179,7 +179,7 @@ DEFUN ("win32-get-clipboard-data", Fwin32_get_clipboard_data, Swin32_get_clipboa
179 179
180 BLOCK_INPUT; 180 BLOCK_INPUT;
181 181
182 if (!OpenClipboard ((!NILP (frame) && FRAME_WIN32_P (XFRAME (frame))) ? FRAME_WIN32_WINDOW (XFRAME (frame)) : NULL)) 182 if (!OpenClipboard ((!NILP (frame) && FRAME_W32_P (XFRAME (frame))) ? FRAME_W32_WINDOW (XFRAME (frame)) : NULL))
183 goto done; 183 goto done;
184 184
185 if ((htext = GetClipboardData (CF_TEXT)) == NULL) 185 if ((htext = GetClipboardData (CF_TEXT)) == NULL)
@@ -284,15 +284,15 @@ and t is the same as `SECONDARY'.")
284} 284}
285 285
286void 286void
287syms_of_win32select () 287syms_of_w32select ()
288{ 288{
289#if 0 289#if 0
290 defsubr (&Swin32_open_clipboard); 290 defsubr (&Sw32_open_clipboard);
291 defsubr (&Swin32_empty_clipboard); 291 defsubr (&Sw32_empty_clipboard);
292 defsubr (&Swin32_close_clipboard); 292 defsubr (&Sw32_close_clipboard);
293#endif 293#endif
294 defsubr (&Swin32_set_clipboard_data); 294 defsubr (&Sw32_set_clipboard_data);
295 defsubr (&Swin32_get_clipboard_data); 295 defsubr (&Sw32_get_clipboard_data);
296 defsubr (&Sx_selection_exists_p); 296 defsubr (&Sx_selection_exists_p);
297 297
298 QCLIPBOARD = intern ("CLIPBOARD"); staticpro (&QCLIPBOARD); 298 QCLIPBOARD = intern ("CLIPBOARD"); staticpro (&QCLIPBOARD);
diff --git a/src/w32term.c b/src/w32term.c
index 6db366cd0d3..4706ac4fa43 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -1,4 +1,4 @@
1/* Implementation of Win32 GUI terminal 1/* Implementation of GUI terminal on the Win32 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
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
@@ -56,19 +56,19 @@ extern Lisp_Object Vwindow_system;
56#define x_top_window_to_frame x_window_to_frame 56#define x_top_window_to_frame x_window_to_frame
57 57
58 58
59/* This is display since win32 does not support multiple ones. */ 59/* This is display since w32 does not support multiple ones. */
60struct win32_display_info one_win32_display_info; 60struct w32_display_info one_w32_display_info;
61 61
62/* This is a list of cons cells, each of the form (NAME . FONT-LIST-CACHE), 62/* This is a list of cons cells, each of the form (NAME . FONT-LIST-CACHE),
63 one for each element of win32_display_list and in the same order. 63 one for each element of w32_display_list and in the same order.
64 NAME is the name of the frame. 64 NAME is the name of the frame.
65 FONT-LIST-CACHE records previous values returned by x-list-fonts. */ 65 FONT-LIST-CACHE records previous values returned by x-list-fonts. */
66Lisp_Object win32_display_name_list; 66Lisp_Object w32_display_name_list;
67 67
68/* Frame being updated by update_frame. This is declared in term.c. 68/* Frame being updated by update_frame. This is declared in term.c.
69 This is set by update_begin and looked at by all the 69 This is set by update_begin and looked at by all the
70 win32 functions. It is zero while not inside an update. 70 w32 functions. It is zero while not inside an update.
71 In that case, the win32 functions assume that `selected_frame' 71 In that case, the w32 functions assume that `selected_frame'
72 is the frame to apply to. */ 72 is the frame to apply to. */
73extern struct frame *updating_frame; 73extern struct frame *updating_frame;
74 74
@@ -100,22 +100,22 @@ HANDLE hMainThread = NULL;
100static FRAME_PTR last_mouse_frame; 100static FRAME_PTR last_mouse_frame;
101static RECT last_mouse_glyph; 101static RECT last_mouse_glyph;
102 102
103Lisp_Object Vwin32_num_mouse_buttons; 103Lisp_Object Vw32_num_mouse_buttons;
104 104
105Lisp_Object Vwin32_swap_mouse_buttons; 105Lisp_Object Vw32_swap_mouse_buttons;
106 106
107/* The scroll bar in which the last motion event occurred. 107/* The scroll bar in which the last motion event occurred.
108 108
109 If the last motion event occurred in a scroll bar, we set this 109 If the last motion event occurred in a scroll bar, we set this
110 so win32_mouse_position can know whether to report a scroll bar motion or 110 so w32_mouse_position can know whether to report a scroll bar motion or
111 an ordinary motion. 111 an ordinary motion.
112 112
113 If the last motion event didn't occur in a scroll bar, we set this 113 If the last motion event didn't occur in a scroll bar, we set this
114 to Qnil, to tell win32_mouse_position to return an ordinary motion event. */ 114 to Qnil, to tell w32_mouse_position to return an ordinary motion event. */
115Lisp_Object last_mouse_scroll_bar; 115Lisp_Object last_mouse_scroll_bar;
116int last_mouse_scroll_bar_pos; 116int last_mouse_scroll_bar_pos;
117 117
118/* This is a hack. We would really prefer that win32_mouse_position would 118/* This is a hack. We would really prefer that w32_mouse_position would
119 return the time associated with the position it returns, but there 119 return the time associated with the position it returns, but there
120 doesn't seem to be any way to wrest the timestamp from the server 120 doesn't seem to be any way to wrest the timestamp from the server
121 along with the position query. So, we just keep track of the time 121 along with the position query. So, we just keep track of the time
@@ -141,11 +141,11 @@ extern int extra_keyboard_modifiers;
141 141
142static Lisp_Object Qvendor_specific_keysyms; 142static Lisp_Object Qvendor_specific_keysyms;
143 143
144void win32_delete_display (); 144void w32_delete_display ();
145 145
146static void redraw_previous_char (); 146static void redraw_previous_char ();
147static void redraw_following_char (); 147static void redraw_following_char ();
148static unsigned int win32_get_modifiers (); 148static unsigned int w32_get_modifiers ();
149 149
150static int fast_find_position (); 150static int fast_find_position ();
151static void note_mouse_highlight (); 151static void note_mouse_highlight ();
@@ -153,8 +153,8 @@ static void clear_mouse_face ();
153static void show_mouse_face (); 153static void show_mouse_face ();
154static void do_line_dance (); 154static void do_line_dance ();
155 155
156static int win32_cursor_to (); 156static int w32_cursor_to ();
157static int win32_clear_end_of_line (); 157static int w32_clear_end_of_line ();
158 158
159#if 0 159#if 0
160/* This is a function useful for recording debugging information 160/* This is a function useful for recording debugging information
@@ -184,16 +184,16 @@ record_event (locus, type)
184 184
185#endif /* 0 */ 185#endif /* 0 */
186 186
187/* Return the struct win32_display_info. */ 187/* Return the struct w32_display_info. */
188 188
189struct win32_display_info * 189struct w32_display_info *
190win32_display_info_for_display () 190w32_display_info_for_display ()
191{ 191{
192 return (&one_win32_display_info); 192 return (&one_w32_display_info);
193} 193}
194 194
195void 195void
196win32_fill_rect (f, _hdc, pix, lprect) 196w32_fill_rect (f, _hdc, pix, lprect)
197 FRAME_PTR f; 197 FRAME_PTR f;
198 HDC _hdc; 198 HDC _hdc;
199 COLORREF pix; 199 COLORREF pix;
@@ -220,13 +220,13 @@ win32_fill_rect (f, _hdc, pix, lprect)
220} 220}
221 221
222void 222void
223win32_clear_window (f) 223w32_clear_window (f)
224 FRAME_PTR f; 224 FRAME_PTR f;
225{ 225{
226 RECT rect; 226 RECT rect;
227 227
228 GetClientRect (FRAME_WIN32_WINDOW (f), &rect); 228 GetClientRect (FRAME_W32_WINDOW (f), &rect);
229 win32_clear_rect (f, NULL, &rect); 229 w32_clear_rect (f, NULL, &rect);
230} 230}
231 231
232 232
@@ -234,13 +234,13 @@ win32_clear_window (f)
234 234
235 These hooks are called by update_frame at the beginning and end 235 These hooks are called by update_frame at the beginning and end
236 of a frame update. We record in `updating_frame' the identity 236 of a frame update. We record in `updating_frame' the identity
237 of the frame being updated, so that the win32_... functions do not 237 of the frame being updated, so that the w32_... functions do not
238 need to take a frame as argument. Most of the win32_... functions 238 need to take a frame as argument. Most of the w32_... functions
239 should never be called except during an update, the only exceptions 239 should never be called except during an update, the only exceptions
240 being win32_cursor_to, win32_write_glyphs and win32_reassert_line_highlight. */ 240 being w32_cursor_to, w32_write_glyphs and w32_reassert_line_highlight. */
241 241
242static 242static
243win32_update_begin (f) 243w32_update_begin (f)
244 struct frame *f; 244 struct frame *f;
245{ 245{
246 if (f == 0) 246 if (f == 0)
@@ -253,26 +253,26 @@ win32_update_begin (f)
253 253
254 /* Regenerate display palette before drawing if list of requested 254 /* Regenerate display palette before drawing if list of requested
255 colors has changed. */ 255 colors has changed. */
256 if (FRAME_WIN32_DISPLAY_INFO (f)->regen_palette) 256 if (FRAME_W32_DISPLAY_INFO (f)->regen_palette)
257 { 257 {
258 win32_regenerate_palette (f); 258 w32_regenerate_palette (f);
259 FRAME_WIN32_DISPLAY_INFO (f)->regen_palette = FALSE; 259 FRAME_W32_DISPLAY_INFO (f)->regen_palette = FALSE;
260 } 260 }
261 261
262 if (f == FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_mouse_frame) 262 if (f == FRAME_W32_DISPLAY_INFO (f)->mouse_face_mouse_frame)
263 { 263 {
264 /* Don't do highlighting for mouse motion during the update. */ 264 /* Don't do highlighting for mouse motion during the update. */
265 FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_defer = 1; 265 FRAME_W32_DISPLAY_INFO (f)->mouse_face_defer = 1;
266 266
267 /* If the frame needs to be redrawn, 267 /* If the frame needs to be redrawn,
268 simply forget about any prior mouse highlighting. */ 268 simply forget about any prior mouse highlighting. */
269 if (FRAME_GARBAGED_P (f)) 269 if (FRAME_GARBAGED_P (f))
270 FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_window = Qnil; 270 FRAME_W32_DISPLAY_INFO (f)->mouse_face_window = Qnil;
271 271
272 if (!NILP (FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_window)) 272 if (!NILP (FRAME_W32_DISPLAY_INFO (f)->mouse_face_window))
273 { 273 {
274 int firstline, lastline, i; 274 int firstline, lastline, i;
275 struct window *w = XWINDOW (FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_window); 275 struct window *w = XWINDOW (FRAME_W32_DISPLAY_INFO (f)->mouse_face_window);
276 276
277 /* Find the first, and the last+1, lines affected by redisplay. */ 277 /* Find the first, and the last+1, lines affected by redisplay. */
278 for (firstline = 0; firstline < f->height; firstline++) 278 for (firstline = 0; firstline < f->height; firstline++)
@@ -295,7 +295,7 @@ win32_update_begin (f)
295 are all wrong, and we will redisplay that line anyway. */ 295 are all wrong, and we will redisplay that line anyway. */
296 if (! (firstline > (XFASTINT (w->top) + window_internal_height (w)) 296 if (! (firstline > (XFASTINT (w->top) + window_internal_height (w))
297 || lastline < XFASTINT (w->top))) 297 || lastline < XFASTINT (w->top)))
298 clear_mouse_face (FRAME_WIN32_DISPLAY_INFO (f)); 298 clear_mouse_face (FRAME_W32_DISPLAY_INFO (f));
299 } 299 }
300 } 300 }
301 301
@@ -303,7 +303,7 @@ win32_update_begin (f)
303} 303}
304 304
305static 305static
306win32_update_end (f) 306w32_update_end (f)
307 struct frame *f; 307 struct frame *f;
308{ 308{
309 BLOCK_INPUT; 309 BLOCK_INPUT;
@@ -311,8 +311,8 @@ win32_update_end (f)
311 do_line_dance (); 311 do_line_dance ();
312 x_display_cursor (f, 1); 312 x_display_cursor (f, 1);
313 313
314 if (f == FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_mouse_frame) 314 if (f == FRAME_W32_DISPLAY_INFO (f)->mouse_face_mouse_frame)
315 FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_defer = 0; 315 FRAME_W32_DISPLAY_INFO (f)->mouse_face_defer = 0;
316 316
317 UNBLOCK_INPUT; 317 UNBLOCK_INPUT;
318} 318}
@@ -320,16 +320,16 @@ win32_update_end (f)
320/* This is called after a redisplay on frame F. */ 320/* This is called after a redisplay on frame F. */
321 321
322static 322static
323win32_frame_up_to_date (f) 323w32_frame_up_to_date (f)
324 FRAME_PTR f; 324 FRAME_PTR f;
325{ 325{
326 if (FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_deferred_gc 326 if (FRAME_W32_DISPLAY_INFO (f)->mouse_face_deferred_gc
327 || f == FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_mouse_frame) 327 || f == FRAME_W32_DISPLAY_INFO (f)->mouse_face_mouse_frame)
328 { 328 {
329 note_mouse_highlight (FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_mouse_frame, 329 note_mouse_highlight (FRAME_W32_DISPLAY_INFO (f)->mouse_face_mouse_frame,
330 FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_mouse_x, 330 FRAME_W32_DISPLAY_INFO (f)->mouse_face_mouse_x,
331 FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_mouse_y); 331 FRAME_W32_DISPLAY_INFO (f)->mouse_face_mouse_y);
332 FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_deferred_gc = 0; 332 FRAME_W32_DISPLAY_INFO (f)->mouse_face_deferred_gc = 0;
333 } 333 }
334} 334}
335 335
@@ -337,7 +337,7 @@ win32_frame_up_to_date (f)
337 Call this when about to modify line at position VPOS 337 Call this when about to modify line at position VPOS
338 and not change whether it is highlighted. */ 338 and not change whether it is highlighted. */
339 339
340win32_reassert_line_highlight (new, vpos) 340w32_reassert_line_highlight (new, vpos)
341 int new, vpos; 341 int new, vpos;
342{ 342{
343 highlight = new; 343 highlight = new;
@@ -347,12 +347,12 @@ win32_reassert_line_highlight (new, vpos)
347 and change whether it is highlighted. */ 347 and change whether it is highlighted. */
348 348
349static 349static
350win32_change_line_highlight (new_highlight, vpos, first_unused_hpos) 350w32_change_line_highlight (new_highlight, vpos, first_unused_hpos)
351 int new_highlight, vpos, first_unused_hpos; 351 int new_highlight, vpos, first_unused_hpos;
352{ 352{
353 highlight = new_highlight; 353 highlight = new_highlight;
354 win32_cursor_to (vpos, 0); 354 w32_cursor_to (vpos, 0);
355 win32_clear_end_of_line (updating_frame->width); 355 w32_clear_end_of_line (updating_frame->width);
356} 356}
357 357
358/* This is used when starting Emacs and when restarting after suspend. 358/* This is used when starting Emacs and when restarting after suspend.
@@ -360,16 +360,16 @@ win32_change_line_highlight (new_highlight, vpos, first_unused_hpos)
360 to Emacs's own window if it is suspended (though that rarely happens). */ 360 to Emacs's own window if it is suspended (though that rarely happens). */
361 361
362static 362static
363win32_set_terminal_modes () 363w32_set_terminal_modes ()
364{ 364{
365} 365}
366 366
367/* This is called when exiting or suspending Emacs. 367/* This is called when exiting or suspending Emacs.
368 Exiting will make the Win32 windows go away, and suspending 368 Exiting will make the W32 windows go away, and suspending
369 requires no action. */ 369 requires no action. */
370 370
371static 371static
372win32_reset_terminal_modes () 372w32_reset_terminal_modes ()
373{ 373{
374} 374}
375 375
@@ -378,7 +378,7 @@ win32_reset_terminal_modes ()
378 This does not affect the place where the cursor-box is displayed. */ 378 This does not affect the place where the cursor-box is displayed. */
379 379
380static int 380static int
381win32_cursor_to (row, col) 381w32_cursor_to (row, col)
382 register int row, col; 382 register int row, col;
383{ 383{
384 int orow = row; 384 int orow = row;
@@ -424,7 +424,7 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground)
424 register char *cp; /* Steps through buf[]. */ 424 register char *cp; /* Steps through buf[]. */
425 register int tlen = GLYPH_TABLE_LENGTH; 425 register int tlen = GLYPH_TABLE_LENGTH;
426 register Lisp_Object *tbase = GLYPH_TABLE_BASE; 426 register Lisp_Object *tbase = GLYPH_TABLE_BASE;
427 Window window = FRAME_WIN32_WINDOW (f); 427 Window window = FRAME_W32_WINDOW (f);
428 int orig_left = left; 428 int orig_left = left;
429 HDC hdc; 429 HDC hdc;
430 430
@@ -468,7 +468,7 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground)
468 468
469 /* HL = 3 means use a mouse face previously chosen. */ 469 /* HL = 3 means use a mouse face previously chosen. */
470 if (hl == 3) 470 if (hl == 3)
471 cf = FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_face_id; 471 cf = FRAME_W32_DISPLAY_INFO (f)->mouse_face_face_id;
472 472
473 /* First look at the face of the text itself. */ 473 /* First look at the face of the text itself. */
474 if (cf != 0) 474 if (cf != 0)
@@ -510,24 +510,24 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground)
510 510
511 if ((!face->font 511 if ((!face->font
512 || face->font == (XFontStruct *) FACE_DEFAULT 512 || face->font == (XFontStruct *) FACE_DEFAULT
513 || face->font == f->output_data.win32->font) 513 || face->font == f->output_data.w32->font)
514 && face->background == f->output_data.win32->background_pixel 514 && face->background == f->output_data.w32->background_pixel
515 && face->foreground == f->output_data.win32->foreground_pixel) 515 && face->foreground == f->output_data.w32->foreground_pixel)
516 { 516 {
517 bg = f->output_data.win32->cursor_pixel; 517 bg = f->output_data.w32->cursor_pixel;
518 fg = face->background; 518 fg = face->background;
519 } 519 }
520 /* Cursor on non-default face: must merge. */ 520 /* Cursor on non-default face: must merge. */
521 else 521 else
522 { 522 {
523 bg = f->output_data.win32->cursor_pixel; 523 bg = f->output_data.w32->cursor_pixel;
524 fg = face->background; 524 fg = face->background;
525 /* If the glyph would be invisible, 525 /* If the glyph would be invisible,
526 try a different foreground. */ 526 try a different foreground. */
527 if (fg == bg) 527 if (fg == bg)
528 fg = face->foreground; 528 fg = face->foreground;
529 if (fg == bg) 529 if (fg == bg)
530 fg = f->output_data.win32->cursor_foreground_pixel; 530 fg = f->output_data.w32->cursor_foreground_pixel;
531 if (fg == bg) 531 if (fg == bg)
532 fg = face->foreground; 532 fg = face->foreground;
533 /* Make sure the cursor is distinct from text in this face. */ 533 /* Make sure the cursor is distinct from text in this face. */
@@ -541,7 +541,7 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground)
541 } 541 }
542 542
543 if (font == (XFontStruct *) FACE_DEFAULT) 543 if (font == (XFontStruct *) FACE_DEFAULT)
544 font = f->output_data.win32->font; 544 font = f->output_data.w32->font;
545 545
546 SetBkMode (hdc, just_foreground ? TRANSPARENT : OPAQUE); 546 SetBkMode (hdc, just_foreground ? TRANSPARENT : OPAQUE);
547 547
@@ -555,12 +555,12 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground)
555 if (!just_foreground) 555 if (!just_foreground)
556 { 556 {
557 /* Clear the rest of the line's height. */ 557 /* Clear the rest of the line's height. */
558 if (f->output_data.win32->line_height != FONT_HEIGHT (font)) 558 if (f->output_data.w32->line_height != FONT_HEIGHT (font))
559 win32_fill_area (f, hdc, bg, 559 w32_fill_area (f, hdc, bg,
560 left, 560 left,
561 top + FONT_HEIGHT (font), 561 top + FONT_HEIGHT (font),
562 FONT_WIDTH (font) * len, 562 FONT_WIDTH (font) * len,
563 f->output_data.win32->line_height - FONT_HEIGHT (font)); 563 f->output_data.w32->line_height - FONT_HEIGHT (font));
564 } 564 }
565 565
566 { 566 {
@@ -570,7 +570,7 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground)
570 underline_position = font->tm.tmDescent - 1; 570 underline_position = font->tm.tmDescent - 1;
571 571
572 if (face->underline) 572 if (face->underline)
573 win32_fill_area (f, hdc, fg, 573 w32_fill_area (f, hdc, fg,
574 left, (top 574 left, (top
575 + FONT_BASE (font) 575 + FONT_BASE (font)
576 + underline_position), 576 + underline_position),
@@ -589,11 +589,11 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground)
589 Advance the cursor over the text. 589 Advance the cursor over the text.
590 Output LEN glyphs at START. 590 Output LEN glyphs at START.
591 591
592 `highlight', set up by win32_reassert_line_highlight or win32_change_line_highlight, 592 `highlight', set up by w32_reassert_line_highlight or w32_change_line_highlight,
593 controls the pixel values used for foreground and background. */ 593 controls the pixel values used for foreground and background. */
594 594
595static 595static
596win32_write_glyphs (start, len) 596w32_write_glyphs (start, len)
597 register GLYPH *start; 597 register GLYPH *start;
598 int len; 598 int len;
599{ 599{
@@ -642,7 +642,7 @@ win32_write_glyphs (start, len)
642 from FIRST_UNUSED onward is already erased. */ 642 from FIRST_UNUSED onward is already erased. */
643 643
644static 644static
645win32_clear_end_of_line (first_unused) 645w32_clear_end_of_line (first_unused)
646 register int first_unused; 646 register int first_unused;
647{ 647{
648 struct frame *f = updating_frame; 648 struct frame *f = updating_frame;
@@ -668,17 +668,17 @@ win32_clear_end_of_line (first_unused)
668 && f->phys_cursor_x < first_unused) 668 && f->phys_cursor_x < first_unused)
669 f->phys_cursor_x = -1; 669 f->phys_cursor_x = -1;
670 670
671 win32_clear_area (f, NULL, 671 w32_clear_area (f, NULL,
672 CHAR_TO_PIXEL_COL (f, curs_x), 672 CHAR_TO_PIXEL_COL (f, curs_x),
673 CHAR_TO_PIXEL_ROW (f, curs_y), 673 CHAR_TO_PIXEL_ROW (f, curs_y),
674 FONT_WIDTH (f->output_data.win32->font) * (first_unused - curs_x), 674 FONT_WIDTH (f->output_data.w32->font) * (first_unused - curs_x),
675 f->output_data.win32->line_height); 675 f->output_data.w32->line_height);
676 676
677 UNBLOCK_INPUT; 677 UNBLOCK_INPUT;
678} 678}
679 679
680static 680static
681win32_clear_frame () 681w32_clear_frame ()
682{ 682{
683 struct frame *f = updating_frame; 683 struct frame *f = updating_frame;
684 684
@@ -691,7 +691,7 @@ win32_clear_frame ()
691 691
692 BLOCK_INPUT; 692 BLOCK_INPUT;
693 693
694 win32_clear_window (f); 694 w32_clear_window (f);
695 695
696 /* We have to clear the scroll bars, too. If we have changed 696 /* We have to clear the scroll bars, too. If we have changed
697 colors or something like that, then they should be notified. */ 697 colors or something like that, then they should be notified. */
@@ -702,14 +702,14 @@ win32_clear_frame ()
702 702
703/* Make audible bell. */ 703/* Make audible bell. */
704 704
705win32_ring_bell () 705w32_ring_bell ()
706{ 706{
707 BLOCK_INPUT; 707 BLOCK_INPUT;
708 708
709 if (visible_bell) 709 if (visible_bell)
710 FlashWindow (FRAME_WIN32_WINDOW (selected_frame), FALSE); 710 FlashWindow (FRAME_W32_WINDOW (selected_frame), FALSE);
711 else 711 else
712 nt_ring_bell (); 712 w32_sys_ring_bell ();
713 713
714 UNBLOCK_INPUT; 714 UNBLOCK_INPUT;
715 715
@@ -721,7 +721,7 @@ win32_ring_bell ()
721 off the feature of using them. */ 721 off the feature of using them. */
722 722
723static 723static
724win32_insert_glyphs (start, len) 724w32_insert_glyphs (start, len)
725 register char *start; 725 register char *start;
726 register int len; 726 register int len;
727{ 727{
@@ -729,7 +729,7 @@ win32_insert_glyphs (start, len)
729} 729}
730 730
731static 731static
732win32_delete_glyphs (n) 732w32_delete_glyphs (n)
733 register int n; 733 register int n;
734{ 734{
735 abort (); 735 abort ();
@@ -738,10 +738,10 @@ win32_delete_glyphs (n)
738/* Specify how many text lines, from the top of the window, 738/* Specify how many text lines, from the top of the window,
739 should be affected by insert-lines and delete-lines operations. 739 should be affected by insert-lines and delete-lines operations.
740 This, and those operations, are used only within an update 740 This, and those operations, are used only within an update
741 that is bounded by calls to win32_update_begin and win32_update_end. */ 741 that is bounded by calls to w32_update_begin and w32_update_end. */
742 742
743static 743static
744win32_set_terminal_window (n) 744w32_set_terminal_window (n)
745 register int n; 745 register int n;
746{ 746{
747 if (updating_frame == 0) 747 if (updating_frame == 0)
@@ -771,7 +771,7 @@ static int line_dance_in_progress;
771 771
772/* Perform an insert-lines or delete-lines operation, 772/* Perform an insert-lines or delete-lines operation,
773 inserting N lines or deleting -N lines at vertical position VPOS. */ 773 inserting N lines or deleting -N lines at vertical position VPOS. */
774win32_ins_del_lines (vpos, n) 774w32_ins_del_lines (vpos, n)
775 int vpos, n; 775 int vpos, n;
776{ 776{
777 register int fence, i; 777 register int fence, i;
@@ -834,7 +834,7 @@ do_line_dance ()
834 abort (); 834 abort ();
835 835
836 ht = f->height; 836 ht = f->height;
837 intborder = f->output_data.win32->internal_border_width; 837 intborder = f->output_data.w32->internal_border_width;
838 838
839 x_display_cursor (updating_frame, 0); 839 x_display_cursor (updating_frame, 0);
840 840
@@ -848,8 +848,8 @@ do_line_dance ()
848 /* Copy [i,j) upward from [i+distance, j+distance) */ 848 /* Copy [i,j) upward from [i+distance, j+distance) */
849 BitBlt (hdc, 849 BitBlt (hdc,
850 intborder, CHAR_TO_PIXEL_ROW (f, i+distance), 850 intborder, CHAR_TO_PIXEL_ROW (f, i+distance),
851 f->width * FONT_WIDTH (f->output_data.win32->font), 851 f->width * FONT_WIDTH (f->output_data.w32->font),
852 (j-i) * f->output_data.win32->line_height, 852 (j-i) * f->output_data.w32->line_height,
853 hdc, 853 hdc,
854 intborder, CHAR_TO_PIXEL_ROW (f, i), 854 intborder, CHAR_TO_PIXEL_ROW (f, i),
855 SRCCOPY); 855 SRCCOPY);
@@ -864,8 +864,8 @@ do_line_dance ()
864 /* Copy (j, i] downward from (j+distance, i+distance] */ 864 /* Copy (j, i] downward from (j+distance, i+distance] */
865 BitBlt (hdc, 865 BitBlt (hdc,
866 intborder, CHAR_TO_PIXEL_ROW (f, j+1+distance), 866 intborder, CHAR_TO_PIXEL_ROW (f, j+1+distance),
867 f->width * FONT_WIDTH (f->output_data.win32->font), 867 f->width * FONT_WIDTH (f->output_data.w32->font),
868 (i-j) * f->output_data.win32->line_height, 868 (i-j) * f->output_data.w32->line_height,
869 hdc, 869 hdc,
870 intborder, CHAR_TO_PIXEL_ROW (f, j+1), 870 intborder, CHAR_TO_PIXEL_ROW (f, j+1),
871 SRCCOPY); 871 SRCCOPY);
@@ -879,11 +879,11 @@ do_line_dance ()
879 { 879 {
880 for (j = i; j < ht && line_dance[j] == -1; ++j); 880 for (j = i; j < ht && line_dance[j] == -1; ++j);
881 /* Clear [i,j) */ 881 /* Clear [i,j) */
882 win32_clear_area (f, NULL, 882 w32_clear_area (f, NULL,
883 intborder, 883 intborder,
884 CHAR_TO_PIXEL_ROW (f, i), 884 CHAR_TO_PIXEL_ROW (f, i),
885 f->width * FONT_WIDTH (f->output_data.win32->font), 885 f->width * FONT_WIDTH (f->output_data.w32->font),
886 (j-i) * f->output_data.win32->line_height); 886 (j-i) * f->output_data.w32->line_height);
887 i = j-1; 887 i = j-1;
888 } 888 }
889 line_dance_in_progress = 0; 889 line_dance_in_progress = 0;
@@ -919,8 +919,8 @@ dumprectangle (f, left, top, cols, rows)
919 Round down for left and top, up for right and bottom. */ 919 Round down for left and top, up for right and bottom. */
920 top = PIXEL_TO_CHAR_ROW (f, top); 920 top = PIXEL_TO_CHAR_ROW (f, top);
921 left = PIXEL_TO_CHAR_COL (f, left); 921 left = PIXEL_TO_CHAR_COL (f, left);
922 bottom += (f->output_data.win32->line_height - 1); 922 bottom += (f->output_data.w32->line_height - 1);
923 right += (FONT_WIDTH (f->output_data.win32->font) - 1); 923 right += (FONT_WIDTH (f->output_data.w32->font) - 1);
924 bottom = PIXEL_TO_CHAR_ROW (f, bottom); 924 bottom = PIXEL_TO_CHAR_ROW (f, bottom);
925 right = PIXEL_TO_CHAR_COL (f, right); 925 right = PIXEL_TO_CHAR_COL (f, right);
926 926
@@ -987,7 +987,7 @@ frame_unhighlight (f)
987 x_display_cursor (f, 1); 987 x_display_cursor (f, 1);
988} 988}
989 989
990static void win32_frame_rehighlight (); 990static void w32_frame_rehighlight ();
991static void x_frame_rehighlight (); 991static void x_frame_rehighlight ();
992 992
993/* The focus has changed. Update the frames as necessary to reflect 993/* The focus has changed. Update the frames as necessary to reflect
@@ -998,23 +998,23 @@ static void x_frame_rehighlight ();
998 998
999void 999void
1000x_new_focus_frame (dpyinfo, frame) 1000x_new_focus_frame (dpyinfo, frame)
1001 struct win32_display_info *dpyinfo; 1001 struct w32_display_info *dpyinfo;
1002 struct frame *frame; 1002 struct frame *frame;
1003{ 1003{
1004 struct frame *old_focus = dpyinfo->win32_focus_frame; 1004 struct frame *old_focus = dpyinfo->w32_focus_frame;
1005 int events_enqueued = 0; 1005 int events_enqueued = 0;
1006 1006
1007 if (frame != dpyinfo->win32_focus_frame) 1007 if (frame != dpyinfo->w32_focus_frame)
1008 { 1008 {
1009 /* Set this before calling other routines, so that they see 1009 /* Set this before calling other routines, so that they see
1010 the correct value of win32_focus_frame. */ 1010 the correct value of w32_focus_frame. */
1011 dpyinfo->win32_focus_frame = frame; 1011 dpyinfo->w32_focus_frame = frame;
1012 1012
1013 if (old_focus && old_focus->auto_lower) 1013 if (old_focus && old_focus->auto_lower)
1014 x_lower_frame (old_focus); 1014 x_lower_frame (old_focus);
1015 1015
1016 if (dpyinfo->win32_focus_frame && dpyinfo->win32_focus_frame->auto_raise) 1016 if (dpyinfo->w32_focus_frame && dpyinfo->w32_focus_frame->auto_raise)
1017 pending_autoraise_frame = dpyinfo->win32_focus_frame; 1017 pending_autoraise_frame = dpyinfo->w32_focus_frame;
1018 else 1018 else
1019 pending_autoraise_frame = 0; 1019 pending_autoraise_frame = 0;
1020 } 1020 }
@@ -1026,9 +1026,9 @@ x_new_focus_frame (dpyinfo, frame)
1026 1026
1027void 1027void
1028x_mouse_leave (dpyinfo) 1028x_mouse_leave (dpyinfo)
1029 struct win32_display_info *dpyinfo; 1029 struct w32_display_info *dpyinfo;
1030{ 1030{
1031 x_new_focus_frame (dpyinfo, dpyinfo->win32_focus_event_frame); 1031 x_new_focus_frame (dpyinfo, dpyinfo->w32_focus_event_frame);
1032} 1032}
1033 1033
1034/* The focus has changed, or we have redirected a frame's focus to 1034/* The focus has changed, or we have redirected a frame's focus to
@@ -1039,39 +1039,39 @@ x_mouse_leave (dpyinfo)
1039 frame is being highlighted or unhighlighted; we only use it to find 1039 frame is being highlighted or unhighlighted; we only use it to find
1040 the appropriate display info. */ 1040 the appropriate display info. */
1041static void 1041static void
1042win32_frame_rehighlight (frame) 1042w32_frame_rehighlight (frame)
1043 struct frame *frame; 1043 struct frame *frame;
1044{ 1044{
1045 x_frame_rehighlight (FRAME_WIN32_DISPLAY_INFO (frame)); 1045 x_frame_rehighlight (FRAME_W32_DISPLAY_INFO (frame));
1046} 1046}
1047 1047
1048static void 1048static void
1049x_frame_rehighlight (dpyinfo) 1049x_frame_rehighlight (dpyinfo)
1050 struct win32_display_info *dpyinfo; 1050 struct w32_display_info *dpyinfo;
1051{ 1051{
1052 struct frame *old_highlight = dpyinfo->win32_highlight_frame; 1052 struct frame *old_highlight = dpyinfo->w32_highlight_frame;
1053 1053
1054 if (dpyinfo->win32_focus_frame) 1054 if (dpyinfo->w32_focus_frame)
1055 { 1055 {
1056 dpyinfo->win32_highlight_frame 1056 dpyinfo->w32_highlight_frame
1057 = ((GC_FRAMEP (FRAME_FOCUS_FRAME (dpyinfo->win32_focus_frame))) 1057 = ((GC_FRAMEP (FRAME_FOCUS_FRAME (dpyinfo->w32_focus_frame)))
1058 ? XFRAME (FRAME_FOCUS_FRAME (dpyinfo->win32_focus_frame)) 1058 ? XFRAME (FRAME_FOCUS_FRAME (dpyinfo->w32_focus_frame))
1059 : dpyinfo->win32_focus_frame); 1059 : dpyinfo->w32_focus_frame);
1060 if (! FRAME_LIVE_P (dpyinfo->win32_highlight_frame)) 1060 if (! FRAME_LIVE_P (dpyinfo->w32_highlight_frame))
1061 { 1061 {
1062 FRAME_FOCUS_FRAME (dpyinfo->win32_focus_frame) = Qnil; 1062 FRAME_FOCUS_FRAME (dpyinfo->w32_focus_frame) = Qnil;
1063 dpyinfo->win32_highlight_frame = dpyinfo->win32_focus_frame; 1063 dpyinfo->w32_highlight_frame = dpyinfo->w32_focus_frame;
1064 } 1064 }
1065 } 1065 }
1066 else 1066 else
1067 dpyinfo->win32_highlight_frame = 0; 1067 dpyinfo->w32_highlight_frame = 0;
1068 1068
1069 if (dpyinfo->win32_highlight_frame != old_highlight) 1069 if (dpyinfo->w32_highlight_frame != old_highlight)
1070 { 1070 {
1071 if (old_highlight) 1071 if (old_highlight)
1072 frame_unhighlight (old_highlight); 1072 frame_unhighlight (old_highlight);
1073 if (dpyinfo->win32_highlight_frame) 1073 if (dpyinfo->w32_highlight_frame)
1074 frame_highlight (dpyinfo->win32_highlight_frame); 1074 frame_highlight (dpyinfo->w32_highlight_frame);
1075 } 1075 }
1076} 1076}
1077 1077
@@ -1119,9 +1119,9 @@ pixel_to_glyph_coords (f, pix_x, pix_y, x, y, bounds, noclip)
1119 /* Arrange for the division in PIXEL_TO_CHAR_COL etc. to round down 1119 /* Arrange for the division in PIXEL_TO_CHAR_COL etc. to round down
1120 even for negative values. */ 1120 even for negative values. */
1121 if (pix_x < 0) 1121 if (pix_x < 0)
1122 pix_x -= FONT_WIDTH ((f)->output_data.win32->font) - 1; 1122 pix_x -= FONT_WIDTH ((f)->output_data.w32->font) - 1;
1123 if (pix_y < 0) 1123 if (pix_y < 0)
1124 pix_y -= (f)->output_data.win32->line_height - 1; 1124 pix_y -= (f)->output_data.w32->line_height - 1;
1125 1125
1126 pix_x = PIXEL_TO_CHAR_COL (f, pix_x); 1126 pix_x = PIXEL_TO_CHAR_COL (f, pix_x);
1127 pix_y = PIXEL_TO_CHAR_ROW (f, pix_y); 1127 pix_y = PIXEL_TO_CHAR_ROW (f, pix_y);
@@ -1130,8 +1130,8 @@ pixel_to_glyph_coords (f, pix_x, pix_y, x, y, bounds, noclip)
1130 { 1130 {
1131 bounds->left = CHAR_TO_PIXEL_COL (f, pix_x); 1131 bounds->left = CHAR_TO_PIXEL_COL (f, pix_x);
1132 bounds->top = CHAR_TO_PIXEL_ROW (f, pix_y); 1132 bounds->top = CHAR_TO_PIXEL_ROW (f, pix_y);
1133 bounds->right = bounds->left + FONT_WIDTH (f->output_data.win32->font) - 1; 1133 bounds->right = bounds->left + FONT_WIDTH (f->output_data.w32->font) - 1;
1134 bounds->bottom = bounds->top + f->output_data.win32->line_height - 1; 1134 bounds->bottom = bounds->top + f->output_data.w32->line_height - 1;
1135 } 1135 }
1136 1136
1137 if (!noclip) 1137 if (!noclip)
@@ -1189,28 +1189,28 @@ parse_button (message, pbutton, pup)
1189 up = 1; 1189 up = 1;
1190 break; 1190 break;
1191 case WM_MBUTTONDOWN: 1191 case WM_MBUTTONDOWN:
1192 if (NILP (Vwin32_swap_mouse_buttons)) 1192 if (NILP (Vw32_swap_mouse_buttons))
1193 button = 1; 1193 button = 1;
1194 else 1194 else
1195 button = 2; 1195 button = 2;
1196 up = 0; 1196 up = 0;
1197 break; 1197 break;
1198 case WM_MBUTTONUP: 1198 case WM_MBUTTONUP:
1199 if (NILP (Vwin32_swap_mouse_buttons)) 1199 if (NILP (Vw32_swap_mouse_buttons))
1200 button = 1; 1200 button = 1;
1201 else 1201 else
1202 button = 2; 1202 button = 2;
1203 up = 1; 1203 up = 1;
1204 break; 1204 break;
1205 case WM_RBUTTONDOWN: 1205 case WM_RBUTTONDOWN:
1206 if (NILP (Vwin32_swap_mouse_buttons)) 1206 if (NILP (Vw32_swap_mouse_buttons))
1207 button = 2; 1207 button = 2;
1208 else 1208 else
1209 button = 1; 1209 button = 1;
1210 up = 0; 1210 up = 0;
1211 break; 1211 break;
1212 case WM_RBUTTONUP: 1212 case WM_RBUTTONUP:
1213 if (NILP (Vwin32_swap_mouse_buttons)) 1213 if (NILP (Vw32_swap_mouse_buttons))
1214 button = 2; 1214 button = 2;
1215 else 1215 else
1216 button = 1; 1216 button = 1;
@@ -1235,7 +1235,7 @@ parse_button (message, pbutton, pup)
1235static void 1235static void
1236construct_mouse_click (result, msg, f) 1236construct_mouse_click (result, msg, f)
1237 struct input_event *result; 1237 struct input_event *result;
1238 Win32Msg *msg; 1238 W32Msg *msg;
1239 struct frame *f; 1239 struct frame *f;
1240{ 1240{
1241 int button; 1241 int button;
@@ -1278,7 +1278,7 @@ note_mouse_movement (frame, msg)
1278{ 1278{
1279 last_mouse_movement_time = msg->time; 1279 last_mouse_movement_time = msg->time;
1280 1280
1281 if (msg->hwnd != FRAME_WIN32_WINDOW (frame)) 1281 if (msg->hwnd != FRAME_W32_WINDOW (frame))
1282 { 1282 {
1283 frame->mouse_moved = 1; 1283 frame->mouse_moved = 1;
1284 last_mouse_scroll_bar = Qnil; 1284 last_mouse_scroll_bar = Qnil;
@@ -1320,30 +1320,30 @@ note_mouse_highlight (f, x, y)
1320 if (disable_mouse_highlight) 1320 if (disable_mouse_highlight)
1321 return; 1321 return;
1322 1322
1323 FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_mouse_x = x; 1323 FRAME_W32_DISPLAY_INFO (f)->mouse_face_mouse_x = x;
1324 FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_mouse_y = y; 1324 FRAME_W32_DISPLAY_INFO (f)->mouse_face_mouse_y = y;
1325 FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_mouse_frame = f; 1325 FRAME_W32_DISPLAY_INFO (f)->mouse_face_mouse_frame = f;
1326 1326
1327 if (FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_defer) 1327 if (FRAME_W32_DISPLAY_INFO (f)->mouse_face_defer)
1328 return; 1328 return;
1329 1329
1330 if (gc_in_progress) 1330 if (gc_in_progress)
1331 { 1331 {
1332 FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_deferred_gc = 1; 1332 FRAME_W32_DISPLAY_INFO (f)->mouse_face_deferred_gc = 1;
1333 return; 1333 return;
1334 } 1334 }
1335 1335
1336 /* Find out which glyph the mouse is on. */ 1336 /* Find out which glyph the mouse is on. */
1337 pixel_to_glyph_coords (f, x, y, &column, &row, 1337 pixel_to_glyph_coords (f, x, y, &column, &row,
1338 &new_glyph, FRAME_WIN32_DISPLAY_INFO (f)->grabbed); 1338 &new_glyph, FRAME_W32_DISPLAY_INFO (f)->grabbed);
1339 1339
1340 /* Which window is that in? */ 1340 /* Which window is that in? */
1341 window = window_from_coordinates (f, column, row, &portion); 1341 window = window_from_coordinates (f, column, row, &portion);
1342 w = XWINDOW (window); 1342 w = XWINDOW (window);
1343 1343
1344 /* If we were displaying active text in another window, clear that. */ 1344 /* If we were displaying active text in another window, clear that. */
1345 if (! EQ (window, FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_window)) 1345 if (! EQ (window, FRAME_W32_DISPLAY_INFO (f)->mouse_face_window))
1346 clear_mouse_face (FRAME_WIN32_DISPLAY_INFO (f)); 1346 clear_mouse_face (FRAME_W32_DISPLAY_INFO (f));
1347 1347
1348 /* Are we in a window whose display is up to date? 1348 /* Are we in a window whose display is up to date?
1349 And verify the buffer's text has not changed. */ 1349 And verify the buffer's text has not changed. */
@@ -1363,15 +1363,15 @@ note_mouse_highlight (f, x, y)
1363 pos = ptr[i]; 1363 pos = ptr[i];
1364 /* Is it outside the displayed active region (if any)? */ 1364 /* Is it outside the displayed active region (if any)? */
1365 if (pos <= 0) 1365 if (pos <= 0)
1366 clear_mouse_face (FRAME_WIN32_DISPLAY_INFO (f)); 1366 clear_mouse_face (FRAME_W32_DISPLAY_INFO (f));
1367 else if (! (EQ (window, FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_window) 1367 else if (! (EQ (window, FRAME_W32_DISPLAY_INFO (f)->mouse_face_window)
1368 && row >= FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_beg_row 1368 && row >= FRAME_W32_DISPLAY_INFO (f)->mouse_face_beg_row
1369 && row <= FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_end_row 1369 && row <= FRAME_W32_DISPLAY_INFO (f)->mouse_face_end_row
1370 && (row > FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_beg_row 1370 && (row > FRAME_W32_DISPLAY_INFO (f)->mouse_face_beg_row
1371 || column >= FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_beg_col) 1371 || column >= FRAME_W32_DISPLAY_INFO (f)->mouse_face_beg_col)
1372 && (row < FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_end_row 1372 && (row < FRAME_W32_DISPLAY_INFO (f)->mouse_face_end_row
1373 || column < FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_end_col 1373 || column < FRAME_W32_DISPLAY_INFO (f)->mouse_face_end_col
1374 || FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_past_end))) 1374 || FRAME_W32_DISPLAY_INFO (f)->mouse_face_past_end)))
1375 { 1375 {
1376 Lisp_Object mouse_face, overlay, position; 1376 Lisp_Object mouse_face, overlay, position;
1377 Lisp_Object *overlay_vec; 1377 Lisp_Object *overlay_vec;
@@ -1393,7 +1393,7 @@ note_mouse_highlight (f, x, y)
1393 ZV = Z; 1393 ZV = Z;
1394 1394
1395 /* Yes. Clear the display of the old active region, if any. */ 1395 /* Yes. Clear the display of the old active region, if any. */
1396 clear_mouse_face (FRAME_WIN32_DISPLAY_INFO (f)); 1396 clear_mouse_face (FRAME_W32_DISPLAY_INFO (f));
1397 1397
1398 /* Is this char mouse-active? */ 1398 /* Is this char mouse-active? */
1399 XSETINT (position, pos); 1399 XSETINT (position, pos);
@@ -1435,19 +1435,19 @@ note_mouse_highlight (f, x, y)
1435 after = Foverlay_end (overlay); 1435 after = Foverlay_end (overlay);
1436 /* Record this as the current active region. */ 1436 /* Record this as the current active region. */
1437 fast_find_position (window, before, 1437 fast_find_position (window, before,
1438 &FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_beg_col, 1438 &FRAME_W32_DISPLAY_INFO (f)->mouse_face_beg_col,
1439 &FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_beg_row); 1439 &FRAME_W32_DISPLAY_INFO (f)->mouse_face_beg_row);
1440 FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_past_end 1440 FRAME_W32_DISPLAY_INFO (f)->mouse_face_past_end
1441 = !fast_find_position (window, after, 1441 = !fast_find_position (window, after,
1442 &FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_end_col, 1442 &FRAME_W32_DISPLAY_INFO (f)->mouse_face_end_col,
1443 &FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_end_row); 1443 &FRAME_W32_DISPLAY_INFO (f)->mouse_face_end_row);
1444 FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_window = window; 1444 FRAME_W32_DISPLAY_INFO (f)->mouse_face_window = window;
1445 FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_face_id 1445 FRAME_W32_DISPLAY_INFO (f)->mouse_face_face_id
1446 = compute_char_face (f, w, pos, 0, 0, 1446 = compute_char_face (f, w, pos, 0, 0,
1447 &ignore, pos + 1, 1); 1447 &ignore, pos + 1, 1);
1448 1448
1449 /* Display it as active. */ 1449 /* Display it as active. */
1450 show_mouse_face (FRAME_WIN32_DISPLAY_INFO (f), 1); 1450 show_mouse_face (FRAME_W32_DISPLAY_INFO (f), 1);
1451 } 1451 }
1452 /* Handle the text property case. */ 1452 /* Handle the text property case. */
1453 else if (! NILP (mouse_face)) 1453 else if (! NILP (mouse_face))
@@ -1469,19 +1469,19 @@ note_mouse_highlight (f, x, y)
1469 w->buffer, end); 1469 w->buffer, end);
1470 /* Record this as the current active region. */ 1470 /* Record this as the current active region. */
1471 fast_find_position (window, before, 1471 fast_find_position (window, before,
1472 &FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_beg_col, 1472 &FRAME_W32_DISPLAY_INFO (f)->mouse_face_beg_col,
1473 &FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_beg_row); 1473 &FRAME_W32_DISPLAY_INFO (f)->mouse_face_beg_row);
1474 FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_past_end 1474 FRAME_W32_DISPLAY_INFO (f)->mouse_face_past_end
1475 = !fast_find_position (window, after, 1475 = !fast_find_position (window, after,
1476 &FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_end_col, 1476 &FRAME_W32_DISPLAY_INFO (f)->mouse_face_end_col,
1477 &FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_end_row); 1477 &FRAME_W32_DISPLAY_INFO (f)->mouse_face_end_row);
1478 FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_window = window; 1478 FRAME_W32_DISPLAY_INFO (f)->mouse_face_window = window;
1479 FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_face_id 1479 FRAME_W32_DISPLAY_INFO (f)->mouse_face_face_id
1480 = compute_char_face (f, w, pos, 0, 0, 1480 = compute_char_face (f, w, pos, 0, 0,
1481 &ignore, pos + 1, 1); 1481 &ignore, pos + 1, 1);
1482 1482
1483 /* Display it as active. */ 1483 /* Display it as active. */
1484 show_mouse_face (FRAME_WIN32_DISPLAY_INFO (f), 1); 1484 show_mouse_face (FRAME_W32_DISPLAY_INFO (f), 1);
1485 } 1485 }
1486 BEGV = obegv; 1486 BEGV = obegv;
1487 ZV = ozv; 1487 ZV = ozv;
@@ -1572,7 +1572,7 @@ fast_find_position (window, pos, columnp, rowp)
1572 1572
1573static void 1573static void
1574show_mouse_face (dpyinfo, hl) 1574show_mouse_face (dpyinfo, hl)
1575 struct win32_display_info *dpyinfo; 1575 struct w32_display_info *dpyinfo;
1576 int hl; 1576 int hl;
1577{ 1577{
1578 struct window *w = XWINDOW (dpyinfo->mouse_face_window); 1578 struct window *w = XWINDOW (dpyinfo->mouse_face_window);
@@ -1589,22 +1589,22 @@ show_mouse_face (dpyinfo, hl)
1589 curs_x = f->phys_cursor_x; 1589 curs_x = f->phys_cursor_x;
1590 curs_y = f->phys_cursor_y; 1590 curs_y = f->phys_cursor_y;
1591 1591
1592 for (i = FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_beg_row; 1592 for (i = FRAME_W32_DISPLAY_INFO (f)->mouse_face_beg_row;
1593 i <= FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_end_row; i++) 1593 i <= FRAME_W32_DISPLAY_INFO (f)->mouse_face_end_row; i++)
1594 { 1594 {
1595 int column = (i == FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_beg_row 1595 int column = (i == FRAME_W32_DISPLAY_INFO (f)->mouse_face_beg_row
1596 ? FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_beg_col 1596 ? FRAME_W32_DISPLAY_INFO (f)->mouse_face_beg_col
1597 : WINDOW_LEFT_MARGIN (w)); 1597 : WINDOW_LEFT_MARGIN (w));
1598 int endcolumn = (i == FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_end_row 1598 int endcolumn = (i == FRAME_W32_DISPLAY_INFO (f)->mouse_face_end_row
1599 ? FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_end_col 1599 ? FRAME_W32_DISPLAY_INFO (f)->mouse_face_end_col
1600 : WINDOW_LEFT_MARGIN (w) + width); 1600 : WINDOW_LEFT_MARGIN (w) + width);
1601 endcolumn = min (endcolumn, FRAME_CURRENT_GLYPHS (f)->used[i]); 1601 endcolumn = min (endcolumn, FRAME_CURRENT_GLYPHS (f)->used[i]);
1602 1602
1603 /* If the cursor's in the text we are about to rewrite, 1603 /* If the cursor's in the text we are about to rewrite,
1604 turn the cursor off. */ 1604 turn the cursor off. */
1605 if (i == curs_y 1605 if (i == curs_y
1606 && curs_x >= FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_beg_col - 1 1606 && curs_x >= FRAME_W32_DISPLAY_INFO (f)->mouse_face_beg_col - 1
1607 && curs_x <= FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_end_col) 1607 && curs_x <= FRAME_W32_DISPLAY_INFO (f)->mouse_face_end_col)
1608 { 1608 {
1609 x_display_cursor (f, 0); 1609 x_display_cursor (f, 0);
1610 cursor_off = 1; 1610 cursor_off = 1;
@@ -1628,9 +1628,9 @@ show_mouse_face (dpyinfo, hl)
1628 1628
1629 /* Change the mouse cursor according to the value of HL. */ 1629 /* Change the mouse cursor according to the value of HL. */
1630 if (hl > 0) 1630 if (hl > 0)
1631 SetCursor (f->output_data.win32->cross_cursor); 1631 SetCursor (f->output_data.w32->cross_cursor);
1632 else 1632 else
1633 SetCursor (f->output_data.win32->text_cursor); 1633 SetCursor (f->output_data.w32->text_cursor);
1634} 1634}
1635 1635
1636/* Clear out the mouse-highlighted active region. 1636/* Clear out the mouse-highlighted active region.
@@ -1638,7 +1638,7 @@ show_mouse_face (dpyinfo, hl)
1638 1638
1639static void 1639static void
1640clear_mouse_face (dpyinfo) 1640clear_mouse_face (dpyinfo)
1641 struct win32_display_info *dpyinfo; 1641 struct w32_display_info *dpyinfo;
1642{ 1642{
1643 if (! NILP (dpyinfo->mouse_face_window)) 1643 if (! NILP (dpyinfo->mouse_face_window))
1644 show_mouse_face (dpyinfo, 0); 1644 show_mouse_face (dpyinfo, 0);
@@ -1674,7 +1674,7 @@ static void x_scroll_bar_report_motion ();
1674 again. */ 1674 again. */
1675 1675
1676static void 1676static void
1677win32_mouse_position (fp, insist, bar_window, part, x, y, time) 1677w32_mouse_position (fp, insist, bar_window, part, x, y, time)
1678 FRAME_PTR *fp; 1678 FRAME_PTR *fp;
1679 int insist; 1679 int insist;
1680 Lisp_Object *bar_window; 1680 Lisp_Object *bar_window;
@@ -1705,7 +1705,7 @@ win32_mouse_position (fp, insist, bar_window, part, x, y, time)
1705 /* Now we have a position on the root; find the innermost window 1705 /* Now we have a position on the root; find the innermost window
1706 containing the pointer. */ 1706 containing the pointer. */
1707 { 1707 {
1708 if (FRAME_WIN32_DISPLAY_INFO (*fp)->grabbed && last_mouse_frame 1708 if (FRAME_W32_DISPLAY_INFO (*fp)->grabbed && last_mouse_frame
1709 && FRAME_LIVE_P (last_mouse_frame)) 1709 && FRAME_LIVE_P (last_mouse_frame))
1710 { 1710 {
1711 f1 = last_mouse_frame; 1711 f1 = last_mouse_frame;
@@ -1713,7 +1713,7 @@ win32_mouse_position (fp, insist, bar_window, part, x, y, time)
1713 else 1713 else
1714 { 1714 {
1715 /* Is win one of our frames? */ 1715 /* Is win one of our frames? */
1716 f1 = x_window_to_frame (FRAME_WIN32_DISPLAY_INFO (*fp), WindowFromPoint(pt)); 1716 f1 = x_window_to_frame (FRAME_W32_DISPLAY_INFO (*fp), WindowFromPoint(pt));
1717 } 1717 }
1718 1718
1719 /* If not, is it one of our scroll bars? */ 1719 /* If not, is it one of our scroll bars? */
@@ -1734,13 +1734,13 @@ win32_mouse_position (fp, insist, bar_window, part, x, y, time)
1734 { 1734 {
1735 int ignore1, ignore2; 1735 int ignore1, ignore2;
1736 1736
1737 ScreenToClient (FRAME_WIN32_WINDOW (f1), &pt); 1737 ScreenToClient (FRAME_W32_WINDOW (f1), &pt);
1738 1738
1739 /* Ok, we found a frame. Store all the values. */ 1739 /* Ok, we found a frame. Store all the values. */
1740 1740
1741 pixel_to_glyph_coords (f1, pt.x, pt.y, &ignore1, &ignore2, 1741 pixel_to_glyph_coords (f1, pt.x, pt.y, &ignore1, &ignore2,
1742 &last_mouse_glyph, 1742 &last_mouse_glyph,
1743 FRAME_WIN32_DISPLAY_INFO (f1)->grabbed 1743 FRAME_W32_DISPLAY_INFO (f1)->grabbed
1744 || insist); 1744 || insist);
1745 1745
1746 *bar_window = Qnil; 1746 *bar_window = Qnil;
@@ -1788,7 +1788,7 @@ x_window_to_scroll_bar (window_id)
1788 condemned = Qnil, 1788 condemned = Qnil,
1789 ! GC_NILP (bar)); 1789 ! GC_NILP (bar));
1790 bar = XSCROLL_BAR (bar)->next) 1790 bar = XSCROLL_BAR (bar)->next)
1791 if (SCROLL_BAR_WIN32_WINDOW (XSCROLL_BAR (bar)) == window_id) 1791 if (SCROLL_BAR_W32_WINDOW (XSCROLL_BAR (bar)) == window_id)
1792 return XSCROLL_BAR (bar); 1792 return XSCROLL_BAR (bar);
1793 } 1793 }
1794 1794
@@ -1826,7 +1826,7 @@ my_set_window_pos (HWND hwnd, HWND hwndAfter,
1826 int x, int y, int cx, int cy, int flags) 1826 int x, int y, int cx, int cy, int flags)
1827{ 1827{
1828#ifndef ATTACH_THREADS 1828#ifndef ATTACH_THREADS
1829 Win32WindowPos pos; 1829 W32WindowPos pos;
1830 pos.hwndAfter = hwndAfter; 1830 pos.hwndAfter = hwndAfter;
1831 pos.x = x; 1831 pos.x = x;
1832 pos.y = y; 1832 pos.y = y;
@@ -1844,7 +1844,7 @@ my_destroy_window (f, hwnd)
1844 struct frame * f; 1844 struct frame * f;
1845 HWND hwnd; 1845 HWND hwnd;
1846{ 1846{
1847 SendMessage (FRAME_WIN32_WINDOW (f), WM_EMACS_DESTROYWINDOW, 1847 SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_DESTROYWINDOW,
1848 (WPARAM) hwnd, 0); 1848 (WPARAM) hwnd, 0);
1849} 1849}
1850 1850
@@ -1878,7 +1878,7 @@ x_scroll_bar_create (window, top, left, width, height)
1878 SetScrollRange (hwnd, SB_CTL, 0, height, FALSE); 1878 SetScrollRange (hwnd, SB_CTL, 0, height, FALSE);
1879 SetScrollPos (hwnd, SB_CTL, 0, TRUE); 1879 SetScrollPos (hwnd, SB_CTL, 0, TRUE);
1880 1880
1881 SET_SCROLL_BAR_WIN32_WINDOW (bar, hwnd); 1881 SET_SCROLL_BAR_W32_WINDOW (bar, hwnd);
1882 1882
1883 /* Add bar to its frame's list of scroll bars. */ 1883 /* Add bar to its frame's list of scroll bars. */
1884 bar->next = FRAME_SCROLL_BARS (f); 1884 bar->next = FRAME_SCROLL_BARS (f);
@@ -1910,7 +1910,7 @@ x_scroll_bar_set_handle (bar, start, end, rebuild)
1910 int rebuild; 1910 int rebuild;
1911{ 1911{
1912 int dragging = ! NILP (bar->dragging); 1912 int dragging = ! NILP (bar->dragging);
1913 Window w = SCROLL_BAR_WIN32_WINDOW (bar); 1913 Window w = SCROLL_BAR_W32_WINDOW (bar);
1914 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); 1914 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
1915 1915
1916 /* If the display is already accurate, do nothing. */ 1916 /* If the display is already accurate, do nothing. */
@@ -1937,7 +1937,7 @@ x_scroll_bar_move (bar, top, left, width, height)
1937 struct scroll_bar *bar; 1937 struct scroll_bar *bar;
1938 int top, left, width, height; 1938 int top, left, width, height;
1939{ 1939{
1940 Window w = SCROLL_BAR_WIN32_WINDOW (bar); 1940 Window w = SCROLL_BAR_W32_WINDOW (bar);
1941 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); 1941 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
1942 1942
1943 BLOCK_INPUT; 1943 BLOCK_INPUT;
@@ -1966,7 +1966,7 @@ x_scroll_bar_remove (bar)
1966 BLOCK_INPUT; 1966 BLOCK_INPUT;
1967 1967
1968 /* Destroy the window. */ 1968 /* Destroy the window. */
1969 my_destroy_window (f, SCROLL_BAR_WIN32_WINDOW (bar)); 1969 my_destroy_window (f, SCROLL_BAR_W32_WINDOW (bar));
1970 1970
1971 /* Disassociate this scroll bar from its window. */ 1971 /* Disassociate this scroll bar from its window. */
1972 XWINDOW (bar->window)->vertical_scroll_bar = Qnil; 1972 XWINDOW (bar->window)->vertical_scroll_bar = Qnil;
@@ -1979,7 +1979,7 @@ x_scroll_bar_remove (bar)
1979 characters, starting at POSITION. If WINDOW has no scroll bar, 1979 characters, starting at POSITION. If WINDOW has no scroll bar,
1980 create one. */ 1980 create one. */
1981static void 1981static void
1982win32_set_vertical_scroll_bar (window, portion, whole, position) 1982w32_set_vertical_scroll_bar (window, portion, whole, position)
1983 struct window *window; 1983 struct window *window;
1984 int portion, whole, position; 1984 int portion, whole, position;
1985{ 1985{
@@ -1994,7 +1994,7 @@ win32_set_vertical_scroll_bar (window, portion, whole, position)
1994 int pixel_width 1994 int pixel_width
1995 = (FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0 1995 = (FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0
1996 ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f) 1996 ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f)
1997 : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.win32->font))); 1997 : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.w32->font)));
1998 int pixel_height = VERTICAL_SCROLL_BAR_PIXEL_HEIGHT (f, height); 1998 int pixel_height = VERTICAL_SCROLL_BAR_PIXEL_HEIGHT (f, height);
1999 1999
2000 struct scroll_bar *bar; 2000 struct scroll_bar *bar;
@@ -2044,7 +2044,7 @@ win32_set_vertical_scroll_bar (window, portion, whole, position)
2044 to `*judge_scroll_bars_hook'. A scroll bar may be spared if 2044 to `*judge_scroll_bars_hook'. A scroll bar may be spared if
2045 `*redeem_scroll_bar_hook' is applied to its window before the judgement. */ 2045 `*redeem_scroll_bar_hook' is applied to its window before the judgement. */
2046static void 2046static void
2047win32_condemn_scroll_bars (frame) 2047w32_condemn_scroll_bars (frame)
2048 FRAME_PTR frame; 2048 FRAME_PTR frame;
2049{ 2049{
2050 /* The condemned list should be empty at this point; if it's not, 2050 /* The condemned list should be empty at this point; if it's not,
@@ -2061,7 +2061,7 @@ win32_condemn_scroll_bars (frame)
2061/* Unmark WINDOW's scroll bar for deletion in this judgement cycle. 2061/* Unmark WINDOW's scroll bar for deletion in this judgement cycle.
2062 Note that WINDOW isn't necessarily condemned at all. */ 2062 Note that WINDOW isn't necessarily condemned at all. */
2063static void 2063static void
2064win32_redeem_scroll_bar (window) 2064w32_redeem_scroll_bar (window)
2065 struct window *window; 2065 struct window *window;
2066{ 2066{
2067 struct scroll_bar *bar; 2067 struct scroll_bar *bar;
@@ -2108,7 +2108,7 @@ win32_redeem_scroll_bar (window)
2108/* Remove all scroll bars on FRAME that haven't been saved since the 2108/* Remove all scroll bars on FRAME that haven't been saved since the
2109 last call to `*condemn_scroll_bars_hook'. */ 2109 last call to `*condemn_scroll_bars_hook'. */
2110static void 2110static void
2111win32_judge_scroll_bars (f) 2111w32_judge_scroll_bars (f)
2112 FRAME_PTR f; 2112 FRAME_PTR f;
2113{ 2113{
2114 Lisp_Object bar, next; 2114 Lisp_Object bar, next;
@@ -2142,13 +2142,13 @@ win32_judge_scroll_bars (f)
2142static int 2142static int
2143x_scroll_bar_handle_click (bar, msg, emacs_event) 2143x_scroll_bar_handle_click (bar, msg, emacs_event)
2144 struct scroll_bar *bar; 2144 struct scroll_bar *bar;
2145 Win32Msg *msg; 2145 W32Msg *msg;
2146 struct input_event *emacs_event; 2146 struct input_event *emacs_event;
2147{ 2147{
2148 if (! GC_WINDOWP (bar->window)) 2148 if (! GC_WINDOWP (bar->window))
2149 abort (); 2149 abort ();
2150 2150
2151 emacs_event->kind = win32_scroll_bar_click; 2151 emacs_event->kind = w32_scroll_bar_click;
2152 emacs_event->code = 0; 2152 emacs_event->code = 0;
2153 /* not really meaningful to distinguish up/down */ 2153 /* not really meaningful to distinguish up/down */
2154 emacs_event->modifiers = msg->dwModifiers; 2154 emacs_event->modifiers = msg->dwModifiers;
@@ -2194,7 +2194,7 @@ x_scroll_bar_handle_click (bar, msg, emacs_event)
2194 break; 2194 break;
2195 case SB_ENDSCROLL: 2195 case SB_ENDSCROLL:
2196 default: 2196 default:
2197 SetScrollPos (SCROLL_BAR_WIN32_WINDOW (bar), SB_CTL, y, TRUE); 2197 SetScrollPos (SCROLL_BAR_W32_WINDOW (bar), SB_CTL, y, TRUE);
2198 return FALSE; 2198 return FALSE;
2199 } 2199 }
2200 2200
@@ -2216,7 +2216,7 @@ x_scroll_bar_report_motion (fp, bar_window, part, x, y, time)
2216 unsigned long *time; 2216 unsigned long *time;
2217{ 2217{
2218 struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); 2218 struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar);
2219 Window w = SCROLL_BAR_WIN32_WINDOW (bar); 2219 Window w = SCROLL_BAR_W32_WINDOW (bar);
2220 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); 2220 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
2221 int pos; 2221 int pos;
2222 2222
@@ -2268,14 +2268,14 @@ x_scroll_bar_clear (f)
2268 for (bar = FRAME_SCROLL_BARS (f); VECTORP (bar); 2268 for (bar = FRAME_SCROLL_BARS (f); VECTORP (bar);
2269 bar = XSCROLL_BAR (bar)->next) 2269 bar = XSCROLL_BAR (bar)->next)
2270 { 2270 {
2271 HWND window = SCROLL_BAR_WIN32_WINDOW (XSCROLL_BAR (bar)); 2271 HWND window = SCROLL_BAR_W32_WINDOW (XSCROLL_BAR (bar));
2272 HDC hdc = GetDC (window); 2272 HDC hdc = GetDC (window);
2273 RECT rect; 2273 RECT rect;
2274 2274
2275 my_show_window (window, SW_HIDE); 2275 my_show_window (window, SW_HIDE);
2276 GetClientRect (window, &rect); 2276 GetClientRect (window, &rect);
2277 select_palette (f, hdc); 2277 select_palette (f, hdc);
2278 win32_clear_rect (f, hdc, &rect); 2278 w32_clear_rect (f, hdc, &rect);
2279 deselect_palette (f, hdc); 2279 deselect_palette (f, hdc);
2280 } 2280 }
2281} 2281}
@@ -2289,13 +2289,13 @@ show_scroll_bars (f, how)
2289 for (bar = FRAME_SCROLL_BARS (f); VECTORP (bar); 2289 for (bar = FRAME_SCROLL_BARS (f); VECTORP (bar);
2290 bar = XSCROLL_BAR (bar)->next) 2290 bar = XSCROLL_BAR (bar)->next)
2291 { 2291 {
2292 HWND window = SCROLL_BAR_WIN32_WINDOW (XSCROLL_BAR (bar)); 2292 HWND window = SCROLL_BAR_W32_WINDOW (XSCROLL_BAR (bar));
2293 my_show_window (window, how); 2293 my_show_window (window, how);
2294 } 2294 }
2295} 2295}
2296 2296
2297 2297
2298/* The main Win32 event-reading loop - w32_read_socket. */ 2298/* The main W32 event-reading loop - w32_read_socket. */
2299 2299
2300/* Timestamp of enter window event. This is only used by w32_read_socket, 2300/* Timestamp of enter window event. This is only used by w32_read_socket,
2301 but we have to put it out here, since static variables within functions 2301 but we have to put it out here, since static variables within functions
@@ -2309,12 +2309,12 @@ short temp_buffer[100];
2309 2309
2310extern int key_event (KEY_EVENT_RECORD *, struct input_event *); 2310extern int key_event (KEY_EVENT_RECORD *, struct input_event *);
2311 2311
2312/* Map a Win32 WM_CHAR message into a KEY_EVENT_RECORD so that 2312/* Map a W32 WM_CHAR message into a KEY_EVENT_RECORD so that
2313 we can use the same routines to handle input in both console 2313 we can use the same routines to handle input in both console
2314 and window modes. */ 2314 and window modes. */
2315 2315
2316static void 2316static void
2317convert_to_key_event (Win32Msg *msgp, KEY_EVENT_RECORD *eventp) 2317convert_to_key_event (W32Msg *msgp, KEY_EVENT_RECORD *eventp)
2318{ 2318{
2319 eventp->bKeyDown = TRUE; 2319 eventp->bKeyDown = TRUE;
2320 eventp->wRepeatCount = 1; 2320 eventp->wRepeatCount = 1;
@@ -2338,7 +2338,7 @@ is_dead_key (int wparam)
2338 return 0; 2338 return 0;
2339} 2339}
2340 2340
2341/* Read events coming from the Win32 shell. 2341/* Read events coming from the W32 shell.
2342 This routine is called by the SIGIO handler. 2342 This routine is called by the SIGIO handler.
2343 We return as soon as there are no more events to be read. 2343 We return as soon as there are no more events to be read.
2344 2344
@@ -2368,12 +2368,12 @@ w32_read_socket (sd, bufp, numchars, expected)
2368 int count = 0; 2368 int count = 0;
2369 int nbytes = 0; 2369 int nbytes = 0;
2370 int items_pending; /* How many items are in the X queue. */ 2370 int items_pending; /* How many items are in the X queue. */
2371 Win32Msg msg; 2371 W32Msg msg;
2372 struct frame *f; 2372 struct frame *f;
2373 int event_found = 0; 2373 int event_found = 0;
2374 int prefix; 2374 int prefix;
2375 Lisp_Object part; 2375 Lisp_Object part;
2376 struct win32_display_info *dpyinfo = &one_win32_display_info; 2376 struct w32_display_info *dpyinfo = &one_w32_display_info;
2377 2377
2378 if (interrupt_input_blocked) 2378 if (interrupt_input_blocked)
2379 { 2379 {
@@ -2409,7 +2409,7 @@ w32_read_socket (sd, bufp, numchars, expected)
2409 else 2409 else
2410 { 2410 {
2411 /* Erase background again for safety. */ 2411 /* Erase background again for safety. */
2412 win32_clear_rect (f, NULL, &msg.rect); 2412 w32_clear_rect (f, NULL, &msg.rect);
2413 dumprectangle (f, 2413 dumprectangle (f,
2414 msg.rect.left, 2414 msg.rect.left,
2415 msg.rect.top, 2415 msg.rect.top,
@@ -2430,7 +2430,7 @@ w32_read_socket (sd, bufp, numchars, expected)
2430 temp_buffer[temp_index++] = msg.msg.wParam; 2430 temp_buffer[temp_index++] = msg.msg.wParam;
2431 bufp->kind = non_ascii_keystroke; 2431 bufp->kind = non_ascii_keystroke;
2432 bufp->code = msg.msg.wParam; 2432 bufp->code = msg.msg.wParam;
2433 bufp->modifiers = win32_kbd_mods_to_emacs (msg.dwModifiers); 2433 bufp->modifiers = w32_kbd_mods_to_emacs (msg.dwModifiers);
2434 XSETFRAME (bufp->frame_or_window, f); 2434 XSETFRAME (bufp->frame_or_window, f);
2435 bufp->timestamp = msg.msg.time; 2435 bufp->timestamp = msg.msg.time;
2436 bufp++; 2436 bufp++;
@@ -2495,7 +2495,7 @@ w32_read_socket (sd, bufp, numchars, expected)
2495 if (f) 2495 if (f)
2496 note_mouse_movement (f, &msg.msg); 2496 note_mouse_movement (f, &msg.msg);
2497 else 2497 else
2498 clear_mouse_face (FRAME_WIN32_DISPLAY_INFO (f)); 2498 clear_mouse_face (FRAME_W32_DISPLAY_INFO (f));
2499 2499
2500 break; 2500 break;
2501 case WM_LBUTTONDOWN: 2501 case WM_LBUTTONDOWN:
@@ -2516,7 +2516,7 @@ w32_read_socket (sd, bufp, numchars, expected)
2516 2516
2517 if (f) 2517 if (f)
2518 { 2518 {
2519 if ((!dpyinfo->win32_focus_frame || f == dpyinfo->win32_focus_frame) 2519 if ((!dpyinfo->w32_focus_frame || f == dpyinfo->w32_focus_frame)
2520 && (numchars >= 1)) 2520 && (numchars >= 1))
2521 { 2521 {
2522 construct_mouse_click (bufp, &msg, f); 2522 construct_mouse_click (bufp, &msg, f);
@@ -2561,8 +2561,8 @@ w32_read_socket (sd, bufp, numchars, expected)
2561 2561
2562 if (f && !f->async_iconified) 2562 if (f && !f->async_iconified)
2563 { 2563 {
2564 f->output_data.win32->left_pos = LOWORD (msg.msg.lParam); 2564 f->output_data.w32->left_pos = LOWORD (msg.msg.lParam);
2565 f->output_data.win32->top_pos = HIWORD (msg.msg.lParam); 2565 f->output_data.w32->top_pos = HIWORD (msg.msg.lParam);
2566 } 2566 }
2567 2567
2568 break; 2568 break;
@@ -2591,17 +2591,17 @@ w32_read_socket (sd, bufp, numchars, expected)
2591 2591
2592 if (columns != f->width 2592 if (columns != f->width
2593 || rows != f->height 2593 || rows != f->height
2594 || width != f->output_data.win32->pixel_width 2594 || width != f->output_data.w32->pixel_width
2595 || height != f->output_data.win32->pixel_height) 2595 || height != f->output_data.w32->pixel_height)
2596 { 2596 {
2597 /* I had set this to 0, 0 - I am not sure why?? */ 2597 /* I had set this to 0, 0 - I am not sure why?? */
2598 2598
2599 change_frame_size (f, rows, columns, 0, 1); 2599 change_frame_size (f, rows, columns, 0, 1);
2600 SET_FRAME_GARBAGED (f); 2600 SET_FRAME_GARBAGED (f);
2601 2601
2602 f->output_data.win32->pixel_width = width; 2602 f->output_data.w32->pixel_width = width;
2603 f->output_data.win32->pixel_height = height; 2603 f->output_data.w32->pixel_height = height;
2604 f->output_data.win32->win_gravity = NorthWestGravity; 2604 f->output_data.w32->win_gravity = NorthWestGravity;
2605 } 2605 }
2606 } 2606 }
2607 2607
@@ -2614,7 +2614,7 @@ w32_read_socket (sd, bufp, numchars, expected)
2614 { 2614 {
2615 x_new_focus_frame (dpyinfo, f); 2615 x_new_focus_frame (dpyinfo, f);
2616 } 2616 }
2617 else if (f == dpyinfo->win32_focus_frame) 2617 else if (f == dpyinfo->w32_focus_frame)
2618 x_new_focus_frame (dpyinfo, 0); 2618 x_new_focus_frame (dpyinfo, 0);
2619 2619
2620 break; 2620 break;
@@ -2772,12 +2772,12 @@ x_draw_box (f)
2772 2772
2773 hdc = get_frame_dc (f); 2773 hdc = get_frame_dc (f);
2774 2774
2775 hb = CreateSolidBrush (f->output_data.win32->cursor_pixel); 2775 hb = CreateSolidBrush (f->output_data.w32->cursor_pixel);
2776 2776
2777 rect.left = CHAR_TO_PIXEL_COL (f, curs_x); 2777 rect.left = CHAR_TO_PIXEL_COL (f, curs_x);
2778 rect.top = CHAR_TO_PIXEL_ROW (f, curs_y); 2778 rect.top = CHAR_TO_PIXEL_ROW (f, curs_y);
2779 rect.right = rect.left + FONT_WIDTH (f->output_data.win32->font); 2779 rect.right = rect.left + FONT_WIDTH (f->output_data.w32->font);
2780 rect.bottom = rect.top + f->output_data.win32->line_height; 2780 rect.bottom = rect.top + f->output_data.w32->line_height;
2781 2781
2782 FrameRect (hdc, &rect, hb); 2782 FrameRect (hdc, &rect, hb);
2783 DeleteObject (hb); 2783 DeleteObject (hb);
@@ -2848,7 +2848,7 @@ x_display_bar_cursor (f, on)
2848 && (!on 2848 && (!on
2849 || f->phys_cursor_x != curs_x 2849 || f->phys_cursor_x != curs_x
2850 || f->phys_cursor_y != curs_y 2850 || f->phys_cursor_y != curs_y
2851 || f->output_data.win32->current_cursor != bar_cursor)) 2851 || f->output_data.w32->current_cursor != bar_cursor))
2852 { 2852 {
2853 /* Erase the cursor by redrawing the character underneath it. */ 2853 /* Erase the cursor by redrawing the character underneath it. */
2854 x_draw_single_glyph (f, f->phys_cursor_y, f->phys_cursor_x, 2854 x_draw_single_glyph (f, f->phys_cursor_y, f->phys_cursor_x,
@@ -2860,23 +2860,23 @@ x_display_bar_cursor (f, on)
2860 /* If we now need a cursor in the new place or in the new form, do it so. */ 2860 /* If we now need a cursor in the new place or in the new form, do it so. */
2861 if (on 2861 if (on
2862 && (f->phys_cursor_x < 0 2862 && (f->phys_cursor_x < 0
2863 || (f->output_data.win32->current_cursor != bar_cursor))) 2863 || (f->output_data.w32->current_cursor != bar_cursor)))
2864 { 2864 {
2865 f->phys_cursor_glyph 2865 f->phys_cursor_glyph
2866 = ((current_glyphs->enable[curs_y] 2866 = ((current_glyphs->enable[curs_y]
2867 && curs_x < current_glyphs->used[curs_y]) 2867 && curs_x < current_glyphs->used[curs_y])
2868 ? current_glyphs->glyphs[curs_y][curs_x] 2868 ? current_glyphs->glyphs[curs_y][curs_x]
2869 : SPACEGLYPH); 2869 : SPACEGLYPH);
2870 win32_fill_area (f, NULL, f->output_data.win32->cursor_pixel, 2870 w32_fill_area (f, NULL, f->output_data.w32->cursor_pixel,
2871 CHAR_TO_PIXEL_COL (f, curs_x), 2871 CHAR_TO_PIXEL_COL (f, curs_x),
2872 CHAR_TO_PIXEL_ROW (f, curs_y), 2872 CHAR_TO_PIXEL_ROW (f, curs_y),
2873 max (f->output_data.win32->cursor_width, 1), 2873 max (f->output_data.w32->cursor_width, 1),
2874 f->output_data.win32->line_height); 2874 f->output_data.w32->line_height);
2875 2875
2876 f->phys_cursor_x = curs_x; 2876 f->phys_cursor_x = curs_x;
2877 f->phys_cursor_y = curs_y; 2877 f->phys_cursor_y = curs_y;
2878 2878
2879 f->output_data.win32->current_cursor = bar_cursor; 2879 f->output_data.w32->current_cursor = bar_cursor;
2880 } 2880 }
2881} 2881}
2882 2882
@@ -2918,23 +2918,23 @@ x_display_box_cursor (f, on)
2918 && (!on 2918 && (!on
2919 || f->phys_cursor_x != curs_x 2919 || f->phys_cursor_x != curs_x
2920 || f->phys_cursor_y != curs_y 2920 || f->phys_cursor_y != curs_y
2921 || (f->output_data.win32->current_cursor != hollow_box_cursor 2921 || (f->output_data.w32->current_cursor != hollow_box_cursor
2922 && (f != FRAME_WIN32_DISPLAY_INFO (f)->win32_highlight_frame)))) 2922 && (f != FRAME_W32_DISPLAY_INFO (f)->w32_highlight_frame))))
2923 { 2923 {
2924 int mouse_face_here = 0; 2924 int mouse_face_here = 0;
2925 struct frame_glyphs *active_glyphs = FRAME_CURRENT_GLYPHS (f); 2925 struct frame_glyphs *active_glyphs = FRAME_CURRENT_GLYPHS (f);
2926 2926
2927 /* If the cursor is in the mouse face area, redisplay that when 2927 /* If the cursor is in the mouse face area, redisplay that when
2928 we clear the cursor. */ 2928 we clear the cursor. */
2929 if (f == FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_mouse_frame 2929 if (f == FRAME_W32_DISPLAY_INFO (f)->mouse_face_mouse_frame
2930 && 2930 &&
2931 (f->phys_cursor_y > FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_beg_row 2931 (f->phys_cursor_y > FRAME_W32_DISPLAY_INFO (f)->mouse_face_beg_row
2932 || (f->phys_cursor_y == FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_beg_row 2932 || (f->phys_cursor_y == FRAME_W32_DISPLAY_INFO (f)->mouse_face_beg_row
2933 && f->phys_cursor_x >= FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_beg_col)) 2933 && f->phys_cursor_x >= FRAME_W32_DISPLAY_INFO (f)->mouse_face_beg_col))
2934 && 2934 &&
2935 (f->phys_cursor_y < FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_end_row 2935 (f->phys_cursor_y < FRAME_W32_DISPLAY_INFO (f)->mouse_face_end_row
2936 || (f->phys_cursor_y == FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_end_row 2936 || (f->phys_cursor_y == FRAME_W32_DISPLAY_INFO (f)->mouse_face_end_row
2937 && f->phys_cursor_x < FRAME_WIN32_DISPLAY_INFO (f)->mouse_face_end_col)) 2937 && f->phys_cursor_x < FRAME_W32_DISPLAY_INFO (f)->mouse_face_end_col))
2938 /* Don't redraw the cursor's spot in mouse face 2938 /* Don't redraw the cursor's spot in mouse face
2939 if it is at the end of a line (on a newline). 2939 if it is at the end of a line (on a newline).
2940 The cursor appears there, but mouse highlighting does not. */ 2940 The cursor appears there, but mouse highlighting does not. */
@@ -2943,12 +2943,12 @@ x_display_box_cursor (f, on)
2943 2943
2944 /* If the font is not as tall as a whole line, 2944 /* If the font is not as tall as a whole line,
2945 we must explicitly clear the line's whole height. */ 2945 we must explicitly clear the line's whole height. */
2946 if (FONT_HEIGHT (f->output_data.win32->font) != f->output_data.win32->line_height) 2946 if (FONT_HEIGHT (f->output_data.w32->font) != f->output_data.w32->line_height)
2947 win32_clear_area (f, NULL, 2947 w32_clear_area (f, NULL,
2948 CHAR_TO_PIXEL_COL (f, f->phys_cursor_x), 2948 CHAR_TO_PIXEL_COL (f, f->phys_cursor_x),
2949 CHAR_TO_PIXEL_ROW (f, f->phys_cursor_y), 2949 CHAR_TO_PIXEL_ROW (f, f->phys_cursor_y),
2950 FONT_WIDTH (f->output_data.win32->font), 2950 FONT_WIDTH (f->output_data.w32->font),
2951 f->output_data.win32->line_height); 2951 f->output_data.w32->line_height);
2952 /* Erase the cursor by redrawing the character underneath it. */ 2952 /* Erase the cursor by redrawing the character underneath it. */
2953 x_draw_single_glyph (f, f->phys_cursor_y, f->phys_cursor_x, 2953 x_draw_single_glyph (f, f->phys_cursor_y, f->phys_cursor_x,
2954 f->phys_cursor_glyph, 2954 f->phys_cursor_glyph,
@@ -2963,24 +2963,24 @@ x_display_box_cursor (f, on)
2963 write it in the right place. */ 2963 write it in the right place. */
2964 if (on 2964 if (on
2965 && (f->phys_cursor_x < 0 2965 && (f->phys_cursor_x < 0
2966 || (f->output_data.win32->current_cursor != filled_box_cursor 2966 || (f->output_data.w32->current_cursor != filled_box_cursor
2967 && f == FRAME_WIN32_DISPLAY_INFO (f)->win32_highlight_frame))) 2967 && f == FRAME_W32_DISPLAY_INFO (f)->w32_highlight_frame)))
2968 { 2968 {
2969 f->phys_cursor_glyph 2969 f->phys_cursor_glyph
2970 = ((current_glyphs->enable[curs_y] 2970 = ((current_glyphs->enable[curs_y]
2971 && curs_x < current_glyphs->used[curs_y]) 2971 && curs_x < current_glyphs->used[curs_y])
2972 ? current_glyphs->glyphs[curs_y][curs_x] 2972 ? current_glyphs->glyphs[curs_y][curs_x]
2973 : SPACEGLYPH); 2973 : SPACEGLYPH);
2974 if (f != FRAME_WIN32_DISPLAY_INFO (f)->win32_highlight_frame) 2974 if (f != FRAME_W32_DISPLAY_INFO (f)->w32_highlight_frame)
2975 { 2975 {
2976 x_draw_box (f); 2976 x_draw_box (f);
2977 f->output_data.win32->current_cursor = hollow_box_cursor; 2977 f->output_data.w32->current_cursor = hollow_box_cursor;
2978 } 2978 }
2979 else 2979 else
2980 { 2980 {
2981 x_draw_single_glyph (f, curs_y, curs_x, 2981 x_draw_single_glyph (f, curs_y, curs_x,
2982 f->phys_cursor_glyph, 2); 2982 f->phys_cursor_glyph, 2);
2983 f->output_data.win32->current_cursor = filled_box_cursor; 2983 f->output_data.w32->current_cursor = filled_box_cursor;
2984 } 2984 }
2985 2985
2986 f->phys_cursor_x = curs_x; 2986 f->phys_cursor_x = curs_x;
@@ -3026,8 +3026,8 @@ x_new_font (f, fontname)
3026 { 3026 {
3027 LOGFONT lf; 3027 LOGFONT lf;
3028 3028
3029 if (!x_to_win32_font(fontname, &lf) 3029 if (!x_to_w32_font(fontname, &lf)
3030 || !win32_to_x_font(&lf, new_font_name, 100)) 3030 || !w32_to_x_font(&lf, new_font_name, 100))
3031 { 3031 {
3032 return Qnil; 3032 return Qnil;
3033 } 3033 }
@@ -3039,25 +3039,25 @@ x_new_font (f, fontname)
3039 { 3039 {
3040 int i; 3040 int i;
3041 3041
3042 for (i = 0; i < FRAME_WIN32_DISPLAY_INFO (f)->n_fonts; i++) 3042 for (i = 0; i < FRAME_W32_DISPLAY_INFO (f)->n_fonts; i++)
3043 if (!strcmp (FRAME_WIN32_DISPLAY_INFO (f)->font_table[i].name, new_font_name)) 3043 if (!strcmp (FRAME_W32_DISPLAY_INFO (f)->font_table[i].name, new_font_name))
3044 { 3044 {
3045 already_loaded = i; 3045 already_loaded = i;
3046 fontname = FRAME_WIN32_DISPLAY_INFO (f)->font_table[i].name; 3046 fontname = FRAME_W32_DISPLAY_INFO (f)->font_table[i].name;
3047 break; 3047 break;
3048 } 3048 }
3049 } 3049 }
3050 3050
3051 /* If we have, just return it from the table. */ 3051 /* If we have, just return it from the table. */
3052 if (already_loaded >= 0) 3052 if (already_loaded >= 0)
3053 f->output_data.win32->font = FRAME_WIN32_DISPLAY_INFO (f)->font_table[already_loaded].font; 3053 f->output_data.w32->font = FRAME_W32_DISPLAY_INFO (f)->font_table[already_loaded].font;
3054 /* Otherwise, load the font and add it to the table. */ 3054 /* Otherwise, load the font and add it to the table. */
3055 else 3055 else
3056 { 3056 {
3057 XFontStruct *font; 3057 XFontStruct *font;
3058 int n_fonts; 3058 int n_fonts;
3059 3059
3060 font = win32_load_font(FRAME_WIN32_DISPLAY_INFO (f), fontname); 3060 font = w32_load_font(FRAME_W32_DISPLAY_INFO (f), fontname);
3061 3061
3062 if (! font) 3062 if (! font)
3063 { 3063 {
@@ -3065,42 +3065,42 @@ x_new_font (f, fontname)
3065 } 3065 }
3066 3066
3067 /* Do we need to create the table? */ 3067 /* Do we need to create the table? */
3068 if (FRAME_WIN32_DISPLAY_INFO (f)->font_table_size == 0) 3068 if (FRAME_W32_DISPLAY_INFO (f)->font_table_size == 0)
3069 { 3069 {
3070 FRAME_WIN32_DISPLAY_INFO (f)->font_table_size = 16; 3070 FRAME_W32_DISPLAY_INFO (f)->font_table_size = 16;
3071 FRAME_WIN32_DISPLAY_INFO (f)->font_table 3071 FRAME_W32_DISPLAY_INFO (f)->font_table
3072 = (struct font_info *) xmalloc (FRAME_WIN32_DISPLAY_INFO (f)->font_table_size 3072 = (struct font_info *) xmalloc (FRAME_W32_DISPLAY_INFO (f)->font_table_size
3073 * sizeof (struct font_info)); 3073 * sizeof (struct font_info));
3074 } 3074 }
3075 /* Do we need to grow the table? */ 3075 /* Do we need to grow the table? */
3076 else if (FRAME_WIN32_DISPLAY_INFO (f)->n_fonts 3076 else if (FRAME_W32_DISPLAY_INFO (f)->n_fonts
3077 >= FRAME_WIN32_DISPLAY_INFO (f)->font_table_size) 3077 >= FRAME_W32_DISPLAY_INFO (f)->font_table_size)
3078 { 3078 {
3079 FRAME_WIN32_DISPLAY_INFO (f)->font_table_size *= 2; 3079 FRAME_W32_DISPLAY_INFO (f)->font_table_size *= 2;
3080 FRAME_WIN32_DISPLAY_INFO (f)->font_table 3080 FRAME_W32_DISPLAY_INFO (f)->font_table
3081 = (struct font_info *) xrealloc (FRAME_WIN32_DISPLAY_INFO (f)->font_table, 3081 = (struct font_info *) xrealloc (FRAME_W32_DISPLAY_INFO (f)->font_table,
3082 (FRAME_WIN32_DISPLAY_INFO (f)->font_table_size 3082 (FRAME_W32_DISPLAY_INFO (f)->font_table_size
3083 * sizeof (struct font_info))); 3083 * sizeof (struct font_info)));
3084 } 3084 }
3085 3085
3086 n_fonts = FRAME_WIN32_DISPLAY_INFO (f)->n_fonts; 3086 n_fonts = FRAME_W32_DISPLAY_INFO (f)->n_fonts;
3087 FRAME_WIN32_DISPLAY_INFO (f)->font_table[n_fonts].name = (char *) xmalloc (strlen (fontname) + 1); 3087 FRAME_W32_DISPLAY_INFO (f)->font_table[n_fonts].name = (char *) xmalloc (strlen (fontname) + 1);
3088 bcopy (fontname, FRAME_WIN32_DISPLAY_INFO (f)->font_table[n_fonts].name, strlen (fontname) + 1); 3088 bcopy (fontname, FRAME_W32_DISPLAY_INFO (f)->font_table[n_fonts].name, strlen (fontname) + 1);
3089 f->output_data.win32->font = FRAME_WIN32_DISPLAY_INFO (f)->font_table[n_fonts].font = font; 3089 f->output_data.w32->font = FRAME_W32_DISPLAY_INFO (f)->font_table[n_fonts].font = font;
3090 FRAME_WIN32_DISPLAY_INFO (f)->n_fonts++; 3090 FRAME_W32_DISPLAY_INFO (f)->n_fonts++;
3091 } 3091 }
3092 3092
3093 /* Compute the scroll bar width in character columns. */ 3093 /* Compute the scroll bar width in character columns. */
3094 if (f->scroll_bar_pixel_width > 0) 3094 if (f->scroll_bar_pixel_width > 0)
3095 { 3095 {
3096 int wid = FONT_WIDTH (f->output_data.win32->font); 3096 int wid = FONT_WIDTH (f->output_data.w32->font);
3097 f->scroll_bar_cols = (f->scroll_bar_pixel_width + wid-1) / wid; 3097 f->scroll_bar_cols = (f->scroll_bar_pixel_width + wid-1) / wid;
3098 } 3098 }
3099 else 3099 else
3100 f->scroll_bar_cols = 2; 3100 f->scroll_bar_cols = 2;
3101 3101
3102 /* Now make the frame display the given font. */ 3102 /* Now make the frame display the given font. */
3103 if (FRAME_WIN32_WINDOW (f) != 0) 3103 if (FRAME_W32_WINDOW (f) != 0)
3104 { 3104 {
3105 frame_update_line_height (f); 3105 frame_update_line_height (f);
3106 x_set_window_size (f, 0, f->width, f->height); 3106 x_set_window_size (f, 0, f->width, f->height);
@@ -3108,7 +3108,7 @@ x_new_font (f, fontname)
3108 else 3108 else
3109 /* If we are setting a new frame's font for the first time, 3109 /* If we are setting a new frame's font for the first time,
3110 there are no faces yet, so this font's height is the line height. */ 3110 there are no faces yet, so this font's height is the line height. */
3111 f->output_data.win32->line_height = FONT_HEIGHT (f->output_data.win32->font); 3111 f->output_data.w32->line_height = FONT_HEIGHT (f->output_data.w32->font);
3112 3112
3113 { 3113 {
3114 Lisp_Object lispy_name; 3114 Lisp_Object lispy_name;
@@ -3124,17 +3124,17 @@ x_calc_absolute_position (f)
3124{ 3124{
3125 Window win, child; 3125 Window win, child;
3126 POINT pt; 3126 POINT pt;
3127 int flags = f->output_data.win32->size_hint_flags; 3127 int flags = f->output_data.w32->size_hint_flags;
3128 3128
3129 pt.x = pt.y = 0; 3129 pt.x = pt.y = 0;
3130 3130
3131 /* Find the position of the outside upper-left corner of 3131 /* Find the position of the outside upper-left corner of
3132 the inner window, with respect to the outer window. */ 3132 the inner window, with respect to the outer window. */
3133 if (f->output_data.win32->parent_desc != FRAME_WIN32_DISPLAY_INFO (f)->root_window) 3133 if (f->output_data.w32->parent_desc != FRAME_W32_DISPLAY_INFO (f)->root_window)
3134 { 3134 {
3135 BLOCK_INPUT; 3135 BLOCK_INPUT;
3136 MapWindowPoints (FRAME_WIN32_WINDOW (f), 3136 MapWindowPoints (FRAME_W32_WINDOW (f),
3137 f->output_data.win32->parent_desc, 3137 f->output_data.w32->parent_desc,
3138 &pt, 1); 3138 &pt, 1);
3139 UNBLOCK_INPUT; 3139 UNBLOCK_INPUT;
3140 } 3140 }
@@ -3144,7 +3144,7 @@ x_calc_absolute_position (f)
3144 rt.left = rt.right = rt.top = rt.bottom = 0; 3144 rt.left = rt.right = rt.top = rt.bottom = 0;
3145 3145
3146 BLOCK_INPUT; 3146 BLOCK_INPUT;
3147 AdjustWindowRect(&rt, f->output_data.win32->dwStyle, 3147 AdjustWindowRect(&rt, f->output_data.w32->dwStyle,
3148 FRAME_EXTERNAL_MENU_BAR (f)); 3148 FRAME_EXTERNAL_MENU_BAR (f));
3149 UNBLOCK_INPUT; 3149 UNBLOCK_INPUT;
3150 3150
@@ -3155,20 +3155,20 @@ x_calc_absolute_position (f)
3155 /* Treat negative positions as relative to the leftmost bottommost 3155 /* Treat negative positions as relative to the leftmost bottommost
3156 position that fits on the screen. */ 3156 position that fits on the screen. */
3157 if (flags & XNegative) 3157 if (flags & XNegative)
3158 f->output_data.win32->left_pos = (FRAME_WIN32_DISPLAY_INFO (f)->width 3158 f->output_data.w32->left_pos = (FRAME_W32_DISPLAY_INFO (f)->width
3159 - 2 * f->output_data.win32->border_width - pt.x 3159 - 2 * f->output_data.w32->border_width - pt.x
3160 - PIXEL_WIDTH (f) 3160 - PIXEL_WIDTH (f)
3161 + f->output_data.win32->left_pos); 3161 + f->output_data.w32->left_pos);
3162 3162
3163 if (flags & YNegative) 3163 if (flags & YNegative)
3164 f->output_data.win32->top_pos = (FRAME_WIN32_DISPLAY_INFO (f)->height 3164 f->output_data.w32->top_pos = (FRAME_W32_DISPLAY_INFO (f)->height
3165 - 2 * f->output_data.win32->border_width - pt.y 3165 - 2 * f->output_data.w32->border_width - pt.y
3166 - PIXEL_HEIGHT (f) 3166 - PIXEL_HEIGHT (f)
3167 + f->output_data.win32->top_pos); 3167 + f->output_data.w32->top_pos);
3168 /* The left_pos and top_pos 3168 /* The left_pos and top_pos
3169 are now relative to the top and left screen edges, 3169 are now relative to the top and left screen edges,
3170 so the flags should correspond. */ 3170 so the flags should correspond. */
3171 f->output_data.win32->size_hint_flags &= ~ (XNegative | YNegative); 3171 f->output_data.w32->size_hint_flags &= ~ (XNegative | YNegative);
3172} 3172}
3173 3173
3174/* CHANGE_GRAVITY is 1 when calling from Fset_frame_position, 3174/* CHANGE_GRAVITY is 1 when calling from Fset_frame_position,
@@ -3186,14 +3186,14 @@ x_set_offset (f, xoff, yoff, change_gravity)
3186 3186
3187 if (change_gravity > 0) 3187 if (change_gravity > 0)
3188 { 3188 {
3189 f->output_data.win32->top_pos = yoff; 3189 f->output_data.w32->top_pos = yoff;
3190 f->output_data.win32->left_pos = xoff; 3190 f->output_data.w32->left_pos = xoff;
3191 f->output_data.win32->size_hint_flags &= ~ (XNegative | YNegative); 3191 f->output_data.w32->size_hint_flags &= ~ (XNegative | YNegative);
3192 if (xoff < 0) 3192 if (xoff < 0)
3193 f->output_data.win32->size_hint_flags |= XNegative; 3193 f->output_data.w32->size_hint_flags |= XNegative;
3194 if (yoff < 0) 3194 if (yoff < 0)
3195 f->output_data.win32->size_hint_flags |= YNegative; 3195 f->output_data.w32->size_hint_flags |= YNegative;
3196 f->output_data.win32->win_gravity = NorthWestGravity; 3196 f->output_data.w32->win_gravity = NorthWestGravity;
3197 } 3197 }
3198 x_calc_absolute_position (f); 3198 x_calc_absolute_position (f);
3199 3199
@@ -3202,15 +3202,15 @@ x_set_offset (f, xoff, yoff, change_gravity)
3202 3202
3203 /* It is a mystery why we need to add the border_width here 3203 /* It is a mystery why we need to add the border_width here
3204 when the frame is already visible, but experiment says we do. */ 3204 when the frame is already visible, but experiment says we do. */
3205 modified_left = f->output_data.win32->left_pos; 3205 modified_left = f->output_data.w32->left_pos;
3206 modified_top = f->output_data.win32->top_pos; 3206 modified_top = f->output_data.w32->top_pos;
3207 if (change_gravity != 0) 3207 if (change_gravity != 0)
3208 { 3208 {
3209 modified_left += f->output_data.win32->border_width; 3209 modified_left += f->output_data.w32->border_width;
3210 modified_top += f->output_data.win32->border_width; 3210 modified_top += f->output_data.w32->border_width;
3211 } 3211 }
3212 3212
3213 my_set_window_pos (FRAME_WIN32_WINDOW (f), 3213 my_set_window_pos (FRAME_W32_WINDOW (f),
3214 NULL, 3214 NULL,
3215 modified_left, modified_top, 3215 modified_left, modified_top,
3216 0,0, 3216 0,0,
@@ -3233,16 +3233,16 @@ x_set_window_size (f, change_gravity, cols, rows)
3233 BLOCK_INPUT; 3233 BLOCK_INPUT;
3234 3234
3235 check_frame_size (f, &rows, &cols); 3235 check_frame_size (f, &rows, &cols);
3236 f->output_data.win32->vertical_scroll_bar_extra 3236 f->output_data.w32->vertical_scroll_bar_extra
3237 = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f) 3237 = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f)
3238 ? 0 3238 ? 0
3239 : FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0 3239 : FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0
3240 ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f) 3240 ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f)
3241 : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.win32->font))); 3241 : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.w32->font)));
3242 pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols); 3242 pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols);
3243 pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows); 3243 pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows);
3244 3244
3245 f->output_data.win32->win_gravity = NorthWestGravity; 3245 f->output_data.w32->win_gravity = NorthWestGravity;
3246 x_wm_set_size_hint (f, (long) 0, 0); 3246 x_wm_set_size_hint (f, (long) 0, 0);
3247 3247
3248 { 3248 {
@@ -3252,12 +3252,12 @@ x_set_window_size (f, change_gravity, cols, rows)
3252 rect.right = pixelwidth; 3252 rect.right = pixelwidth;
3253 rect.bottom = pixelheight; 3253 rect.bottom = pixelheight;
3254 3254
3255 AdjustWindowRect(&rect, f->output_data.win32->dwStyle, 3255 AdjustWindowRect(&rect, f->output_data.w32->dwStyle,
3256 FRAME_EXTERNAL_MENU_BAR (f)); 3256 FRAME_EXTERNAL_MENU_BAR (f));
3257 3257
3258 /* All windows have an extra pixel */ 3258 /* All windows have an extra pixel */
3259 3259
3260 my_set_window_pos (FRAME_WIN32_WINDOW (f), 3260 my_set_window_pos (FRAME_W32_WINDOW (f),
3261 NULL, 3261 NULL,
3262 0, 0, 3262 0, 0,
3263 rect.right - rect.left + 1, 3263 rect.right - rect.left + 1,
@@ -3305,8 +3305,8 @@ x_set_mouse_pixel_position (f, pix_x, pix_y)
3305{ 3305{
3306 BLOCK_INPUT; 3306 BLOCK_INPUT;
3307 3307
3308 pix_x += f->output_data.win32->left_pos; 3308 pix_x += f->output_data.w32->left_pos;
3309 pix_y += f->output_data.win32->top_pos; 3309 pix_y += f->output_data.w32->top_pos;
3310 3310
3311 SetCursorPos (pix_x, pix_y); 3311 SetCursorPos (pix_x, pix_y);
3312 3312
@@ -3320,8 +3320,8 @@ x_set_mouse_position (f, x, y)
3320{ 3320{
3321 int pix_x, pix_y; 3321 int pix_x, pix_y;
3322 3322
3323 pix_x = CHAR_TO_PIXEL_COL (f, x) + FONT_WIDTH (f->output_data.win32->font) / 2; 3323 pix_x = CHAR_TO_PIXEL_COL (f, x) + FONT_WIDTH (f->output_data.w32->font) / 2;
3324 pix_y = CHAR_TO_PIXEL_ROW (f, y) + f->output_data.win32->line_height / 2; 3324 pix_y = CHAR_TO_PIXEL_ROW (f, y) + f->output_data.w32->line_height / 2;
3325 3325
3326 if (pix_x < 0) pix_x = 0; 3326 if (pix_x < 0) pix_x = 0;
3327 if (pix_x > PIXEL_WIDTH (f)) pix_x = PIXEL_WIDTH (f); 3327 if (pix_x > PIXEL_WIDTH (f)) pix_x = PIXEL_WIDTH (f);
@@ -3352,7 +3352,7 @@ x_raise_frame (f)
3352// if (f->async_visible) 3352// if (f->async_visible)
3353 { 3353 {
3354 BLOCK_INPUT; 3354 BLOCK_INPUT;
3355 my_set_window_pos (FRAME_WIN32_WINDOW (f), 3355 my_set_window_pos (FRAME_W32_WINDOW (f),
3356 HWND_TOP, 3356 HWND_TOP,
3357 0, 0, 0, 0, 3357 0, 0, 0, 0,
3358 SWP_NOSIZE | SWP_NOMOVE); 3358 SWP_NOSIZE | SWP_NOMOVE);
@@ -3368,7 +3368,7 @@ x_lower_frame (f)
3368// if (f->async_visible) 3368// if (f->async_visible)
3369 { 3369 {
3370 BLOCK_INPUT; 3370 BLOCK_INPUT;
3371 my_set_window_pos (FRAME_WIN32_WINDOW (f), 3371 my_set_window_pos (FRAME_W32_WINDOW (f),
3372 HWND_BOTTOM, 3372 HWND_BOTTOM,
3373 0, 0, 0, 0, 3373 0, 0, 0, 0,
3374 SWP_NOSIZE | SWP_NOMOVE); 3374 SWP_NOSIZE | SWP_NOMOVE);
@@ -3377,7 +3377,7 @@ x_lower_frame (f)
3377} 3377}
3378 3378
3379static void 3379static void
3380win32_frame_raise_lower (f, raise) 3380w32_frame_raise_lower (f, raise)
3381 FRAME_PTR f; 3381 FRAME_PTR f;
3382 int raise; 3382 int raise;
3383{ 3383{
@@ -3408,15 +3408,15 @@ x_make_frame_visible (f)
3408 if we get to x_make_frame_visible a second time 3408 if we get to x_make_frame_visible a second time
3409 before the window gets really visible. */ 3409 before the window gets really visible. */
3410 if (! FRAME_ICONIFIED_P (f) 3410 if (! FRAME_ICONIFIED_P (f)
3411 && ! f->output_data.win32->asked_for_visible) 3411 && ! f->output_data.w32->asked_for_visible)
3412 { 3412 {
3413 x_set_offset (f, f->output_data.win32->left_pos, f->output_data.win32->top_pos, 0); 3413 x_set_offset (f, f->output_data.w32->left_pos, f->output_data.w32->top_pos, 0);
3414// SetForegroundWindow (FRAME_WIN32_WINDOW (f)); 3414// SetForegroundWindow (FRAME_W32_WINDOW (f));
3415 } 3415 }
3416 3416
3417 f->output_data.win32->asked_for_visible = 1; 3417 f->output_data.w32->asked_for_visible = 1;
3418 3418
3419 my_show_window (FRAME_WIN32_WINDOW (f), SW_SHOWNORMAL); 3419 my_show_window (FRAME_W32_WINDOW (f), SW_SHOWNORMAL);
3420 } 3420 }
3421 3421
3422 /* Synchronize to ensure Emacs knows the frame is visible 3422 /* Synchronize to ensure Emacs knows the frame is visible
@@ -3474,12 +3474,12 @@ x_make_frame_invisible (f)
3474 Window window; 3474 Window window;
3475 3475
3476 /* Don't keep the highlight on an invisible frame. */ 3476 /* Don't keep the highlight on an invisible frame. */
3477 if (FRAME_WIN32_DISPLAY_INFO (f)->win32_highlight_frame == f) 3477 if (FRAME_W32_DISPLAY_INFO (f)->w32_highlight_frame == f)
3478 FRAME_WIN32_DISPLAY_INFO (f)->win32_highlight_frame = 0; 3478 FRAME_W32_DISPLAY_INFO (f)->w32_highlight_frame = 0;
3479 3479
3480 BLOCK_INPUT; 3480 BLOCK_INPUT;
3481 3481
3482 my_show_window (FRAME_WIN32_WINDOW (f), SW_HIDE); 3482 my_show_window (FRAME_W32_WINDOW (f), SW_HIDE);
3483 3483
3484 /* We can't distinguish this from iconification 3484 /* We can't distinguish this from iconification
3485 just by the event that we get from the server. 3485 just by the event that we get from the server.
@@ -3503,15 +3503,15 @@ x_iconify_frame (f)
3503 int result; 3503 int result;
3504 3504
3505 /* Don't keep the highlight on an invisible frame. */ 3505 /* Don't keep the highlight on an invisible frame. */
3506 if (FRAME_WIN32_DISPLAY_INFO (f)->win32_highlight_frame == f) 3506 if (FRAME_W32_DISPLAY_INFO (f)->w32_highlight_frame == f)
3507 FRAME_WIN32_DISPLAY_INFO (f)->win32_highlight_frame = 0; 3507 FRAME_W32_DISPLAY_INFO (f)->w32_highlight_frame = 0;
3508 3508
3509 if (f->async_iconified) 3509 if (f->async_iconified)
3510 return; 3510 return;
3511 3511
3512 BLOCK_INPUT; 3512 BLOCK_INPUT;
3513 3513
3514 my_show_window (FRAME_WIN32_WINDOW (f), SW_SHOWMINIMIZED); 3514 my_show_window (FRAME_W32_WINDOW (f), SW_SHOWMINIMIZED);
3515 /* The frame doesn't seem to be lowered automatically. */ 3515 /* The frame doesn't seem to be lowered automatically. */
3516 x_lower_frame (f); 3516 x_lower_frame (f);
3517 3517
@@ -3525,22 +3525,22 @@ x_iconify_frame (f)
3525x_destroy_window (f) 3525x_destroy_window (f)
3526 struct frame *f; 3526 struct frame *f;
3527{ 3527{
3528 struct win32_display_info *dpyinfo = FRAME_WIN32_DISPLAY_INFO (f); 3528 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
3529 3529
3530 BLOCK_INPUT; 3530 BLOCK_INPUT;
3531 3531
3532 my_destroy_window (f, FRAME_WIN32_WINDOW (f)); 3532 my_destroy_window (f, FRAME_W32_WINDOW (f));
3533 free_frame_menubar (f); 3533 free_frame_menubar (f);
3534 free_frame_faces (f); 3534 free_frame_faces (f);
3535 3535
3536 xfree (f->output_data.win32); 3536 xfree (f->output_data.w32);
3537 f->output_data.win32 = 0; 3537 f->output_data.w32 = 0;
3538 if (f == dpyinfo->win32_focus_frame) 3538 if (f == dpyinfo->w32_focus_frame)
3539 dpyinfo->win32_focus_frame = 0; 3539 dpyinfo->w32_focus_frame = 0;
3540 if (f == dpyinfo->win32_focus_event_frame) 3540 if (f == dpyinfo->w32_focus_event_frame)
3541 dpyinfo->win32_focus_event_frame = 0; 3541 dpyinfo->w32_focus_event_frame = 0;
3542 if (f == dpyinfo->win32_highlight_frame) 3542 if (f == dpyinfo->w32_highlight_frame)
3543 dpyinfo->win32_highlight_frame = 0; 3543 dpyinfo->w32_highlight_frame = 0;
3544 3544
3545 dpyinfo->reference_count--; 3545 dpyinfo->reference_count--;
3546 3546
@@ -3569,14 +3569,14 @@ x_wm_set_size_hint (f, flags, user_position)
3569 long flags; 3569 long flags;
3570 int user_position; 3570 int user_position;
3571{ 3571{
3572 Window window = FRAME_WIN32_WINDOW (f); 3572 Window window = FRAME_W32_WINDOW (f);
3573 3573
3574 flexlines = f->height; 3574 flexlines = f->height;
3575 3575
3576 enter_crit (); 3576 enter_crit ();
3577 3577
3578 SetWindowLong (window, WND_X_UNITS_INDEX, FONT_WIDTH (f->output_data.win32->font)); 3578 SetWindowLong (window, WND_X_UNITS_INDEX, FONT_WIDTH (f->output_data.w32->font));
3579 SetWindowLong (window, WND_Y_UNITS_INDEX, f->output_data.win32->line_height); 3579 SetWindowLong (window, WND_Y_UNITS_INDEX, f->output_data.w32->line_height);
3580 3580
3581 leave_crit (); 3581 leave_crit ();
3582} 3582}
@@ -3587,7 +3587,7 @@ x_wm_set_icon_position (f, icon_x, icon_y)
3587 int icon_x, icon_y; 3587 int icon_x, icon_y;
3588{ 3588{
3589#if 0 3589#if 0
3590 Window window = FRAME_WIN32_WINDOW (f); 3590 Window window = FRAME_W32_WINDOW (f);
3591 3591
3592 f->display.x->wm_hints.flags |= IconPositionHint; 3592 f->display.x->wm_hints.flags |= IconPositionHint;
3593 f->display.x->wm_hints.icon_x = icon_x; 3593 f->display.x->wm_hints.icon_x = icon_x;
@@ -3619,25 +3619,25 @@ static XrmOptionDescRec emacs_options[] = {
3619}; 3619};
3620#endif /* USE_X_TOOLKIT */ 3620#endif /* USE_X_TOOLKIT */
3621 3621
3622static int win32_initialized = 0; 3622static int w32_initialized = 0;
3623 3623
3624struct win32_display_info * 3624struct w32_display_info *
3625win32_term_init (display_name, xrm_option, resource_name) 3625w32_term_init (display_name, xrm_option, resource_name)
3626 Lisp_Object display_name; 3626 Lisp_Object display_name;
3627 char *xrm_option; 3627 char *xrm_option;
3628 char *resource_name; 3628 char *resource_name;
3629{ 3629{
3630 Lisp_Object frame; 3630 Lisp_Object frame;
3631 char *defaultvalue; 3631 char *defaultvalue;
3632 struct win32_display_info *dpyinfo; 3632 struct w32_display_info *dpyinfo;
3633 HDC hdc; 3633 HDC hdc;
3634 3634
3635 BLOCK_INPUT; 3635 BLOCK_INPUT;
3636 3636
3637 if (!win32_initialized) 3637 if (!w32_initialized)
3638 { 3638 {
3639 win32_initialize (); 3639 w32_initialize ();
3640 win32_initialized = 1; 3640 w32_initialized = 1;
3641 } 3641 }
3642 3642
3643 { 3643 {
@@ -3653,21 +3653,21 @@ win32_term_init (display_name, xrm_option, resource_name)
3653 } 3653 }
3654 } 3654 }
3655 3655
3656 dpyinfo = &one_win32_display_info; 3656 dpyinfo = &one_w32_display_info;
3657 3657
3658 /* Put this display on the chain. */ 3658 /* Put this display on the chain. */
3659 dpyinfo->next = NULL; 3659 dpyinfo->next = NULL;
3660 3660
3661 /* Put it on win32_display_name_list as well, to keep them parallel. */ 3661 /* Put it on w32_display_name_list as well, to keep them parallel. */
3662 win32_display_name_list = Fcons (Fcons (display_name, Qnil), 3662 w32_display_name_list = Fcons (Fcons (display_name, Qnil),
3663 win32_display_name_list); 3663 w32_display_name_list);
3664 dpyinfo->name_list_element = XCONS (win32_display_name_list)->car; 3664 dpyinfo->name_list_element = XCONS (w32_display_name_list)->car;
3665 3665
3666 dpyinfo->win32_id_name 3666 dpyinfo->w32_id_name
3667 = (char *) xmalloc (XSTRING (Vinvocation_name)->size 3667 = (char *) xmalloc (XSTRING (Vinvocation_name)->size
3668 + XSTRING (Vsystem_name)->size 3668 + XSTRING (Vsystem_name)->size
3669 + 2); 3669 + 2);
3670 sprintf (dpyinfo->win32_id_name, "%s@%s", 3670 sprintf (dpyinfo->w32_id_name, "%s@%s",
3671 XSTRING (Vinvocation_name)->data, XSTRING (Vsystem_name)->data); 3671 XSTRING (Vinvocation_name)->data, XSTRING (Vsystem_name)->data);
3672 3672
3673#if 0 3673#if 0
@@ -3703,16 +3703,16 @@ win32_term_init (display_name, xrm_option, resource_name)
3703 dpyinfo->mouse_face_window = Qnil; 3703 dpyinfo->mouse_face_window = Qnil;
3704 dpyinfo->mouse_face_mouse_x = dpyinfo->mouse_face_mouse_y = 0; 3704 dpyinfo->mouse_face_mouse_x = dpyinfo->mouse_face_mouse_y = 0;
3705 dpyinfo->mouse_face_defer = 0; 3705 dpyinfo->mouse_face_defer = 0;
3706 dpyinfo->win32_focus_frame = 0; 3706 dpyinfo->w32_focus_frame = 0;
3707 dpyinfo->win32_focus_event_frame = 0; 3707 dpyinfo->w32_focus_event_frame = 0;
3708 dpyinfo->win32_highlight_frame = 0; 3708 dpyinfo->w32_highlight_frame = 0;
3709 3709
3710 ReleaseDC (GetDesktopWindow (), hdc); 3710 ReleaseDC (GetDesktopWindow (), hdc);
3711 3711
3712 /* Determine if there is a middle mouse button, to allow parse_button 3712 /* Determine if there is a middle mouse button, to allow parse_button
3713 to decide whether right mouse events should be mouse-2 or 3713 to decide whether right mouse events should be mouse-2 or
3714 mouse-3. */ 3714 mouse-3. */
3715 XSETINT (Vwin32_num_mouse_buttons, GetSystemMetrics (SM_CMOUSEBUTTONS)); 3715 XSETINT (Vw32_num_mouse_buttons, GetSystemMetrics (SM_CMOUSEBUTTONS));
3716 3716
3717 /* initialise palette with white and black */ 3717 /* initialise palette with white and black */
3718 { 3718 {
@@ -3746,18 +3746,18 @@ win32_term_init (display_name, xrm_option, resource_name)
3746 3746
3747void 3747void
3748x_delete_display (dpyinfo) 3748x_delete_display (dpyinfo)
3749 struct win32_display_info *dpyinfo; 3749 struct w32_display_info *dpyinfo;
3750{ 3750{
3751 /* Discard this display from win32_display_name_list and win32_display_list. 3751 /* Discard this display from w32_display_name_list and w32_display_list.
3752 We can't use Fdelq because that can quit. */ 3752 We can't use Fdelq because that can quit. */
3753 if (! NILP (win32_display_name_list) 3753 if (! NILP (w32_display_name_list)
3754 && EQ (XCONS (win32_display_name_list)->car, dpyinfo->name_list_element)) 3754 && EQ (XCONS (w32_display_name_list)->car, dpyinfo->name_list_element))
3755 win32_display_name_list = XCONS (win32_display_name_list)->cdr; 3755 w32_display_name_list = XCONS (w32_display_name_list)->cdr;
3756 else 3756 else
3757 { 3757 {
3758 Lisp_Object tail; 3758 Lisp_Object tail;
3759 3759
3760 tail = win32_display_name_list; 3760 tail = w32_display_name_list;
3761 while (CONSP (tail) && CONSP (XCONS (tail)->cdr)) 3761 while (CONSP (tail) && CONSP (XCONS (tail)->cdr))
3762 { 3762 {
3763 if (EQ (XCONS (XCONS (tail)->cdr)->car, 3763 if (EQ (XCONS (XCONS (tail)->cdr)->car,
@@ -3772,12 +3772,12 @@ x_delete_display (dpyinfo)
3772 3772
3773 /* free palette table */ 3773 /* free palette table */
3774 { 3774 {
3775 struct win32_palette_entry * plist; 3775 struct w32_palette_entry * plist;
3776 3776
3777 plist = dpyinfo->color_list; 3777 plist = dpyinfo->color_list;
3778 while (plist) 3778 while (plist)
3779 { 3779 {
3780 struct win32_palette_entry * pentry = plist; 3780 struct w32_palette_entry * pentry = plist;
3781 plist = plist->next; 3781 plist = plist->next;
3782 xfree(pentry); 3782 xfree(pentry);
3783 } 3783 }
@@ -3786,39 +3786,39 @@ x_delete_display (dpyinfo)
3786 DeleteObject(dpyinfo->palette); 3786 DeleteObject(dpyinfo->palette);
3787 } 3787 }
3788 xfree (dpyinfo->font_table); 3788 xfree (dpyinfo->font_table);
3789 xfree (dpyinfo->win32_id_name); 3789 xfree (dpyinfo->w32_id_name);
3790} 3790}
3791 3791
3792/* Set up use of Win32. */ 3792/* Set up use of W32. */
3793 3793
3794DWORD win_msg_worker (); 3794DWORD win_msg_worker ();
3795 3795
3796win32_initialize () 3796w32_initialize ()
3797{ 3797{
3798 clear_frame_hook = win32_clear_frame; 3798 clear_frame_hook = w32_clear_frame;
3799 clear_end_of_line_hook = win32_clear_end_of_line; 3799 clear_end_of_line_hook = w32_clear_end_of_line;
3800 ins_del_lines_hook = win32_ins_del_lines; 3800 ins_del_lines_hook = w32_ins_del_lines;
3801 change_line_highlight_hook = win32_change_line_highlight; 3801 change_line_highlight_hook = w32_change_line_highlight;
3802 insert_glyphs_hook = win32_insert_glyphs; 3802 insert_glyphs_hook = w32_insert_glyphs;
3803 write_glyphs_hook = win32_write_glyphs; 3803 write_glyphs_hook = w32_write_glyphs;
3804 delete_glyphs_hook = win32_delete_glyphs; 3804 delete_glyphs_hook = w32_delete_glyphs;
3805 ring_bell_hook = win32_ring_bell; 3805 ring_bell_hook = w32_ring_bell;
3806 reset_terminal_modes_hook = win32_reset_terminal_modes; 3806 reset_terminal_modes_hook = w32_reset_terminal_modes;
3807 set_terminal_modes_hook = win32_set_terminal_modes; 3807 set_terminal_modes_hook = w32_set_terminal_modes;
3808 update_begin_hook = win32_update_begin; 3808 update_begin_hook = w32_update_begin;
3809 update_end_hook = win32_update_end; 3809 update_end_hook = w32_update_end;
3810 set_terminal_window_hook = win32_set_terminal_window; 3810 set_terminal_window_hook = w32_set_terminal_window;
3811 read_socket_hook = w32_read_socket; 3811 read_socket_hook = w32_read_socket;
3812 frame_up_to_date_hook = win32_frame_up_to_date; 3812 frame_up_to_date_hook = w32_frame_up_to_date;
3813 cursor_to_hook = win32_cursor_to; 3813 cursor_to_hook = w32_cursor_to;
3814 reassert_line_highlight_hook = win32_reassert_line_highlight; 3814 reassert_line_highlight_hook = w32_reassert_line_highlight;
3815 mouse_position_hook = win32_mouse_position; 3815 mouse_position_hook = w32_mouse_position;
3816 frame_rehighlight_hook = win32_frame_rehighlight; 3816 frame_rehighlight_hook = w32_frame_rehighlight;
3817 frame_raise_lower_hook = win32_frame_raise_lower; 3817 frame_raise_lower_hook = w32_frame_raise_lower;
3818 set_vertical_scroll_bar_hook = win32_set_vertical_scroll_bar; 3818 set_vertical_scroll_bar_hook = w32_set_vertical_scroll_bar;
3819 condemn_scroll_bars_hook = win32_condemn_scroll_bars; 3819 condemn_scroll_bars_hook = w32_condemn_scroll_bars;
3820 redeem_scroll_bar_hook = win32_redeem_scroll_bar; 3820 redeem_scroll_bar_hook = w32_redeem_scroll_bar;
3821 judge_scroll_bars_hook = win32_judge_scroll_bars; 3821 judge_scroll_bars_hook = w32_judge_scroll_bars;
3822 3822
3823 scroll_region_ok = 1; /* we'll scroll partial frames */ 3823 scroll_region_ok = 1; /* we'll scroll partial frames */
3824 char_ins_del_ok = 0; /* just as fast to write the line */ 3824 char_ins_del_ok = 0; /* just as fast to write the line */
@@ -3867,10 +3867,10 @@ win32_initialize ()
3867} 3867}
3868 3868
3869void 3869void
3870syms_of_win32term () 3870syms_of_w32term ()
3871{ 3871{
3872 staticpro (&win32_display_name_list); 3872 staticpro (&w32_display_name_list);
3873 win32_display_name_list = Qnil; 3873 w32_display_name_list = Qnil;
3874 3874
3875 staticpro (&last_mouse_scroll_bar); 3875 staticpro (&last_mouse_scroll_bar);
3876 last_mouse_scroll_bar = Qnil; 3876 last_mouse_scroll_bar = Qnil;
@@ -3878,14 +3878,14 @@ syms_of_win32term ()
3878 staticpro (&Qvendor_specific_keysyms); 3878 staticpro (&Qvendor_specific_keysyms);
3879 Qvendor_specific_keysyms = intern ("vendor-specific-keysyms"); 3879 Qvendor_specific_keysyms = intern ("vendor-specific-keysyms");
3880 3880
3881 DEFVAR_INT ("win32-num-mouse-buttons", 3881 DEFVAR_INT ("w32-num-mouse-buttons",
3882 &Vwin32_num_mouse_buttons, 3882 &Vw32_num_mouse_buttons,
3883 "Number of physical mouse buttons."); 3883 "Number of physical mouse buttons.");
3884 Vwin32_num_mouse_buttons = Qnil; 3884 Vw32_num_mouse_buttons = Qnil;
3885 3885
3886 DEFVAR_LISP ("win32-swap-mouse-buttons", 3886 DEFVAR_LISP ("w32-swap-mouse-buttons",
3887 &Vwin32_swap_mouse_buttons, 3887 &Vw32_swap_mouse_buttons,
3888 "Swap the mapping of middle and right mouse buttons.\n\ 3888 "Swap the mapping of middle and right mouse buttons.\n\
3889When nil, middle button is mouse-2 and right button is mouse-3."); 3889When nil, middle button is mouse-2 and right button is mouse-3.");
3890 Vwin32_swap_mouse_buttons = Qnil; 3890 Vw32_swap_mouse_buttons = Qnil;
3891} 3891}
diff --git a/src/w32term.h b/src/w32term.h
index 9dd326ded95..c872730397d 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -1,4 +1,4 @@
1/* Definitions and headers for communication with Win32 GUI. 1/* Definitions and headers for communication under the Win32 API.
2 Copyright (C) 1995 Free Software Foundation, Inc. 2 Copyright (C) 1995 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
@@ -32,7 +32,7 @@ Boston, MA 02111-1307, USA. */
32#define FONT_HEIGHT(f) ((f)->tm.tmHeight) 32#define FONT_HEIGHT(f) ((f)->tm.tmHeight)
33#define FONT_BASE(f) ((f)->tm.tmAscent) 33#define FONT_BASE(f) ((f)->tm.tmAscent)
34 34
35#define CHECK_WIN32_FRAME(f, frame) \ 35#define CHECK_W32_FRAME(f, frame) \
36 if (NILP (frame)) \ 36 if (NILP (frame)) \
37 f = selected_frame; \ 37 f = selected_frame; \
38 else \ 38 else \
@@ -40,7 +40,7 @@ Boston, MA 02111-1307, USA. */
40 CHECK_LIVE_FRAME (frame, 0); \ 40 CHECK_LIVE_FRAME (frame, 0); \
41 f = XFRAME (frame); \ 41 f = XFRAME (frame); \
42 } \ 42 } \
43 if (! FRAME_WIN32_P (f)) 43 if (! FRAME_W32_P (f))
44 44
45/* Indicates whether we are in the readsocket call and the message we 45/* Indicates whether we are in the readsocket call and the message we
46 are processing in the current loop */ 46 are processing in the current loop */
@@ -55,7 +55,7 @@ enum text_cursor_kinds {
55}; 55};
56 56
57/* This data type is used for the font_table field 57/* This data type is used for the font_table field
58 of struct win32_display_info. */ 58 of struct w32_display_info. */
59 59
60struct font_info 60struct font_info
61{ 61{
@@ -66,7 +66,7 @@ struct font_info
66/* Structure recording bitmaps and reference count. 66/* Structure recording bitmaps and reference count.
67 If REFCOUNT is 0 then this record is free to be reused. */ 67 If REFCOUNT is 0 then this record is free to be reused. */
68 68
69struct win32_bitmap_record 69struct w32_bitmap_record
70{ 70{
71 Pixmap pixmap; 71 Pixmap pixmap;
72 char *file; 72 char *file;
@@ -80,26 +80,26 @@ struct win32_bitmap_record
80 system palette. Keep a ref-counted list of requested colors and 80 system palette. Keep a ref-counted list of requested colors and
81 regenerate the app palette whenever the requested list changes. */ 81 regenerate the app palette whenever the requested list changes. */
82 82
83extern Lisp_Object Vwin32_enable_palette; 83extern Lisp_Object Vw32_enable_palette;
84 84
85struct win32_palette_entry { 85struct w32_palette_entry {
86 struct win32_palette_entry * next; 86 struct w32_palette_entry * next;
87 PALETTEENTRY entry; 87 PALETTEENTRY entry;
88#if 0 88#if 0
89 unsigned refcount; 89 unsigned refcount;
90#endif 90#endif
91}; 91};
92 92
93extern void win32_regenerate_palette(struct frame *f); 93extern void w32_regenerate_palette(struct frame *f);
94 94
95 95
96/* For each display (currently only one on win32), we have a structure that 96/* For each display (currently only one on w32), we have a structure that
97 records information about it. */ 97 records information about it. */
98 98
99struct win32_display_info 99struct w32_display_info
100{ 100{
101 /* Chain of all win32_display_info structures. */ 101 /* Chain of all w32_display_info structures. */
102 struct win32_display_info *next; 102 struct w32_display_info *next;
103 /* This is a cons cell of the form (NAME . FONT-LIST-CACHE). 103 /* This is a cons cell of the form (NAME . FONT-LIST-CACHE).
104 The same cons cell also appears in x_display_name_list. */ 104 The same cons cell also appears in x_display_name_list. */
105 Lisp_Object name_list_element; 105 Lisp_Object name_list_element;
@@ -121,7 +121,7 @@ struct win32_display_info
121 121
122 /* color palette information */ 122 /* color palette information */
123 int has_palette; 123 int has_palette;
124 struct win32_palette_entry * color_list; 124 struct w32_palette_entry * color_list;
125 unsigned num_colors; 125 unsigned num_colors;
126 HPALETTE palette; 126 HPALETTE palette;
127 127
@@ -156,15 +156,15 @@ struct win32_display_info
156 /* Nonzero means defer mouse-motion highlighting. */ 156 /* Nonzero means defer mouse-motion highlighting. */
157 int mouse_face_defer; 157 int mouse_face_defer;
158 158
159 char *win32_id_name; 159 char *w32_id_name;
160 160
161 /* The number of fonts actually stored in win32_font_table. 161 /* The number of fonts actually stored in w32_font_table.
162 font_table[n] is used and valid iff 0 <= n < n_fonts. 162 font_table[n] is used and valid iff 0 <= n < n_fonts.
163 0 <= n_fonts <= font_table_size. */ 163 0 <= n_fonts <= font_table_size. */
164 int n_fonts; 164 int n_fonts;
165 165
166 /* Pointer to bitmap records. */ 166 /* Pointer to bitmap records. */
167 struct win32_bitmap_record *bitmaps; 167 struct w32_bitmap_record *bitmaps;
168 168
169 /* Allocated size of bitmaps field. */ 169 /* Allocated size of bitmaps field. */
170 int bitmaps_size; 170 int bitmaps_size;
@@ -176,54 +176,54 @@ struct win32_display_info
176 Zero if none. This is examined by Ffocus_frame in w32fns.c. Note 176 Zero if none. This is examined by Ffocus_frame in w32fns.c. Note
177 that a mere EnterNotify event can set this; if you need to know the 177 that a mere EnterNotify event can set this; if you need to know the
178 last frame specified in a FocusIn or FocusOut event, use 178 last frame specified in a FocusIn or FocusOut event, use
179 win32_focus_event_frame. */ 179 w32_focus_event_frame. */
180 struct frame *win32_focus_frame; 180 struct frame *w32_focus_frame;
181 181
182 /* The last frame mentioned in a FocusIn or FocusOut event. This is 182 /* The last frame mentioned in a FocusIn or FocusOut event. This is
183 separate from win32_focus_frame, because whether or not LeaveNotify 183 separate from w32_focus_frame, because whether or not LeaveNotify
184 events cause us to lose focus depends on whether or not we have 184 events cause us to lose focus depends on whether or not we have
185 received a FocusIn event for it. */ 185 received a FocusIn event for it. */
186 struct frame *win32_focus_event_frame; 186 struct frame *w32_focus_event_frame;
187 187
188 /* The frame which currently has the visual highlight, and should get 188 /* The frame which currently has the visual highlight, and should get
189 keyboard input (other sorts of input have the frame encoded in the 189 keyboard input (other sorts of input have the frame encoded in the
190 event). It points to the focus frame's selected window's 190 event). It points to the focus frame's selected window's
191 frame. It differs from win32_focus_frame when we're using a global 191 frame. It differs from w32_focus_frame when we're using a global
192 minibuffer. */ 192 minibuffer. */
193 struct frame *win32_highlight_frame; 193 struct frame *w32_highlight_frame;
194}; 194};
195 195
196/* This is a chain of structures for all the displays currently in use. */ 196/* This is a chain of structures for all the displays currently in use. */
197extern struct win32_display_info one_win32_display_info; 197extern struct w32_display_info one_w32_display_info;
198 198
199/* This is a list of cons cells, each of the form (NAME . FONT-LIST-CACHE), 199/* This is a list of cons cells, each of the form (NAME . FONT-LIST-CACHE),
200 one for each element of win32_display_list and in the same order. 200 one for each element of w32_display_list and in the same order.
201 NAME is the name of the frame. 201 NAME is the name of the frame.
202 FONT-LIST-CACHE records previous values returned by x-list-fonts. */ 202 FONT-LIST-CACHE records previous values returned by x-list-fonts. */
203extern Lisp_Object win32_display_name_list; 203extern Lisp_Object w32_display_name_list;
204 204
205extern struct win32_display_info *x_display_info_for_display (); 205extern struct w32_display_info *x_display_info_for_display ();
206extern struct win32_display_info *x_display_info_for_name (); 206extern struct w32_display_info *x_display_info_for_name ();
207 207
208extern struct win32_display_info *win32_term_init (); 208extern struct w32_display_info *w32_term_init ();
209 209
210/* Each Win32 frame object points to its own struct win32_display object 210/* Each W32 frame object points to its own struct w32_display object
211 in the output_data.win32 field. The win32_display structure contains all 211 in the output_data.w32 field. The w32_display structure contains all
212 the information that is specific to Win32 windows. */ 212 the information that is specific to W32 windows. */
213 213
214struct win32_output 214struct w32_output
215{ 215{
216 /* Original palette (used to deselect real palette after drawing) */ 216 /* Original palette (used to deselect real palette after drawing) */
217 HPALETTE old_palette; 217 HPALETTE old_palette;
218 218
219 /* Position of the Win32 window (x and y offsets in root window). */ 219 /* Position of the W32 window (x and y offsets in root window). */
220 int left_pos; 220 int left_pos;
221 int top_pos; 221 int top_pos;
222 222
223 /* Border width of the Win32 window as known by the window system. */ 223 /* Border width of the W32 window as known by the window system. */
224 int border_width; 224 int border_width;
225 225
226 /* Size of the Win32 window in pixels. */ 226 /* Size of the W32 window in pixels. */
227 int pixel_height, pixel_width; 227 int pixel_height, pixel_width;
228 228
229 /* Height of a line, in pixels. */ 229 /* Height of a line, in pixels. */
@@ -304,7 +304,7 @@ struct win32_output
304 int size_hint_flags; 304 int size_hint_flags;
305 305
306 /* This is the Emacs structure for the display this frame is on. */ 306 /* This is the Emacs structure for the display this frame is on. */
307 /* struct win32_display_info *display_info; */ 307 /* struct w32_display_info *display_info; */
308 308
309 /* Nonzero means our parent is another application's window 309 /* Nonzero means our parent is another application's window
310 and was explicitly specified. */ 310 and was explicitly specified. */
@@ -315,37 +315,37 @@ struct win32_output
315}; 315};
316 316
317/* Get at the computed faces of an X window frame. */ 317/* Get at the computed faces of an X window frame. */
318#define FRAME_PARAM_FACES(f) ((f)->output_data.win32->param_faces) 318#define FRAME_PARAM_FACES(f) ((f)->output_data.w32->param_faces)
319#define FRAME_N_PARAM_FACES(f) ((f)->output_data.win32->n_param_faces) 319#define FRAME_N_PARAM_FACES(f) ((f)->output_data.w32->n_param_faces)
320#define FRAME_DEFAULT_PARAM_FACE(f) (FRAME_PARAM_FACES (f)[0]) 320#define FRAME_DEFAULT_PARAM_FACE(f) (FRAME_PARAM_FACES (f)[0])
321#define FRAME_MODE_LINE_PARAM_FACE(f) (FRAME_PARAM_FACES (f)[1]) 321#define FRAME_MODE_LINE_PARAM_FACE(f) (FRAME_PARAM_FACES (f)[1])
322 322
323#define FRAME_COMPUTED_FACES(f) ((f)->output_data.win32->computed_faces) 323#define FRAME_COMPUTED_FACES(f) ((f)->output_data.w32->computed_faces)
324#define FRAME_N_COMPUTED_FACES(f) ((f)->output_data.win32->n_computed_faces) 324#define FRAME_N_COMPUTED_FACES(f) ((f)->output_data.w32->n_computed_faces)
325#define FRAME_SIZE_COMPUTED_FACES(f) ((f)->output_data.win32->size_computed_faces) 325#define FRAME_SIZE_COMPUTED_FACES(f) ((f)->output_data.w32->size_computed_faces)
326#define FRAME_DEFAULT_FACE(f) ((f)->output_data.win32->computed_faces[0]) 326#define FRAME_DEFAULT_FACE(f) ((f)->output_data.w32->computed_faces[0])
327#define FRAME_MODE_LINE_FACE(f) ((f)->output_data.win32->computed_faces[1]) 327#define FRAME_MODE_LINE_FACE(f) ((f)->output_data.w32->computed_faces[1])
328 328
329/* Return the window associated with the frame F. */ 329/* Return the window associated with the frame F. */
330#define FRAME_WIN32_WINDOW(f) ((f)->output_data.win32->window_desc) 330#define FRAME_W32_WINDOW(f) ((f)->output_data.w32->window_desc)
331 331
332#define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.win32->foreground_pixel) 332#define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.w32->foreground_pixel)
333#define FRAME_BACKGROUND_PIXEL(f) ((f)->output_data.win32->background_pixel) 333#define FRAME_BACKGROUND_PIXEL(f) ((f)->output_data.w32->background_pixel)
334#define FRAME_FONT(f) ((f)->output_data.win32->font) 334#define FRAME_FONT(f) ((f)->output_data.w32->font)
335#define FRAME_INTERNAL_BORDER_WIDTH(f) ((f)->output_data.win32->internal_border_width) 335#define FRAME_INTERNAL_BORDER_WIDTH(f) ((f)->output_data.w32->internal_border_width)
336 336
337/* This gives the win32_display_info structure for the display F is on. */ 337/* This gives the w32_display_info structure for the display F is on. */
338#define FRAME_WIN32_DISPLAY_INFO(f) (&one_win32_display_info) 338#define FRAME_W32_DISPLAY_INFO(f) (&one_w32_display_info)
339 339
340/* These two really ought to be called FRAME_PIXEL_{WIDTH,HEIGHT}. */ 340/* These two really ought to be called FRAME_PIXEL_{WIDTH,HEIGHT}. */
341#define PIXEL_WIDTH(f) ((f)->output_data.win32->pixel_width) 341#define PIXEL_WIDTH(f) ((f)->output_data.w32->pixel_width)
342#define PIXEL_HEIGHT(f) ((f)->output_data.win32->pixel_height) 342#define PIXEL_HEIGHT(f) ((f)->output_data.w32->pixel_height)
343#define FRAME_LINE_HEIGHT(f) ((f)->output_data.win32->line_height) 343#define FRAME_LINE_HEIGHT(f) ((f)->output_data.w32->line_height)
344 344
345#define FRAME_DESIRED_CURSOR(f) ((f)->output_data.win32->desired_cursor) 345#define FRAME_DESIRED_CURSOR(f) ((f)->output_data.w32->desired_cursor)
346 346
347 347
348/* Win32-specific scroll bar stuff. */ 348/* W32-specific scroll bar stuff. */
349 349
350/* We represent scroll bars as lisp vectors. This allows us to place 350/* We represent scroll bars as lisp vectors. This allows us to place
351 references to them in windows without worrying about whether we'll 351 references to them in windows without worrying about whether we'll
@@ -369,7 +369,7 @@ struct scroll_bar {
369 369
370 /* The window representing this scroll bar. Since this is a full 370 /* The window representing this scroll bar. Since this is a full
371 32-bit quantity, we store it split into two 32-bit values. */ 371 32-bit quantity, we store it split into two 32-bit values. */
372 Lisp_Object win32_window_low, win32_window_high; 372 Lisp_Object w32_window_low, w32_window_high;
373 373
374 /* The position and size of the scroll bar in pixels, relative to the 374 /* The position and size of the scroll bar in pixels, relative to the
375 frame. */ 375 frame. */
@@ -415,18 +415,18 @@ struct scroll_bar {
415 415
416 416
417/* Extract the window id of the scroll bar from a struct scroll_bar. */ 417/* Extract the window id of the scroll bar from a struct scroll_bar. */
418#define SCROLL_BAR_WIN32_WINDOW(ptr) \ 418#define SCROLL_BAR_W32_WINDOW(ptr) \
419 ((Window) SCROLL_BAR_PACK ((ptr)->win32_window_low, (ptr)->win32_window_high)) 419 ((Window) SCROLL_BAR_PACK ((ptr)->w32_window_low, (ptr)->w32_window_high))
420 420
421/* Store a window id in a struct scroll_bar. */ 421/* Store a window id in a struct scroll_bar. */
422#define SET_SCROLL_BAR_WIN32_WINDOW(ptr, id) \ 422#define SET_SCROLL_BAR_W32_WINDOW(ptr, id) \
423 (SCROLL_BAR_UNPACK ((ptr)->win32_window_low, (ptr)->win32_window_high, (int) id)) 423 (SCROLL_BAR_UNPACK ((ptr)->w32_window_low, (ptr)->w32_window_high, (int) id))
424 424
425 425
426/* Return the outside pixel height for a vertical scroll bar HEIGHT 426/* Return the outside pixel height for a vertical scroll bar HEIGHT
427 rows high on frame F. */ 427 rows high on frame F. */
428#define VERTICAL_SCROLL_BAR_PIXEL_HEIGHT(f, height) \ 428#define VERTICAL_SCROLL_BAR_PIXEL_HEIGHT(f, height) \
429 ((height) * (f)->output_data.win32->line_height) 429 ((height) * (f)->output_data.w32->line_height)
430 430
431/* Return the inside width of a vertical scroll bar, given the outside 431/* Return the inside width of a vertical scroll bar, given the outside
432 width. */ 432 width. */
@@ -476,41 +476,41 @@ struct scroll_bar {
476 Return the upper/left pixel position of the character cell on frame F 476 Return the upper/left pixel position of the character cell on frame F
477 at ROW/COL. */ 477 at ROW/COL. */
478#define CHAR_TO_PIXEL_ROW(f, row) \ 478#define CHAR_TO_PIXEL_ROW(f, row) \
479 ((f)->output_data.win32->internal_border_width \ 479 ((f)->output_data.w32->internal_border_width \
480 + (row) * (f)->output_data.win32->line_height) 480 + (row) * (f)->output_data.w32->line_height)
481#define CHAR_TO_PIXEL_COL(f, col) \ 481#define CHAR_TO_PIXEL_COL(f, col) \
482 ((f)->output_data.win32->internal_border_width \ 482 ((f)->output_data.w32->internal_border_width \
483 + (col) * FONT_WIDTH ((f)->output_data.win32->font)) 483 + (col) * FONT_WIDTH ((f)->output_data.w32->font))
484 484
485/* Return the pixel width/height of frame F if it has 485/* Return the pixel width/height of frame F if it has
486 WIDTH columns/HEIGHT rows. */ 486 WIDTH columns/HEIGHT rows. */
487#define CHAR_TO_PIXEL_WIDTH(f, width) \ 487#define CHAR_TO_PIXEL_WIDTH(f, width) \
488 (CHAR_TO_PIXEL_COL (f, width) \ 488 (CHAR_TO_PIXEL_COL (f, width) \
489 + (f)->output_data.win32->vertical_scroll_bar_extra \ 489 + (f)->output_data.w32->vertical_scroll_bar_extra \
490 + (f)->output_data.win32->internal_border_width) 490 + (f)->output_data.w32->internal_border_width)
491#define CHAR_TO_PIXEL_HEIGHT(f, height) \ 491#define CHAR_TO_PIXEL_HEIGHT(f, height) \
492 (CHAR_TO_PIXEL_ROW (f, height) \ 492 (CHAR_TO_PIXEL_ROW (f, height) \
493 + (f)->output_data.win32->internal_border_width) 493 + (f)->output_data.w32->internal_border_width)
494 494
495 495
496/* Return the row/column (zero-based) of the character cell containing 496/* Return the row/column (zero-based) of the character cell containing
497 the pixel on FRAME at ROW/COL. */ 497 the pixel on FRAME at ROW/COL. */
498#define PIXEL_TO_CHAR_ROW(f, row) \ 498#define PIXEL_TO_CHAR_ROW(f, row) \
499 (((row) - (f)->output_data.win32->internal_border_width) \ 499 (((row) - (f)->output_data.w32->internal_border_width) \
500 / (f)->output_data.win32->line_height) 500 / (f)->output_data.w32->line_height)
501#define PIXEL_TO_CHAR_COL(f, col) \ 501#define PIXEL_TO_CHAR_COL(f, col) \
502 (((col) - (f)->output_data.win32->internal_border_width) \ 502 (((col) - (f)->output_data.w32->internal_border_width) \
503 / FONT_WIDTH ((f)->output_data.win32->font)) 503 / FONT_WIDTH ((f)->output_data.w32->font))
504 504
505/* How many columns/rows of text can we fit in WIDTH/HEIGHT pixels on 505/* How many columns/rows of text can we fit in WIDTH/HEIGHT pixels on
506 frame F? */ 506 frame F? */
507#define PIXEL_TO_CHAR_WIDTH(f, width) \ 507#define PIXEL_TO_CHAR_WIDTH(f, width) \
508 (PIXEL_TO_CHAR_COL (f, ((width) \ 508 (PIXEL_TO_CHAR_COL (f, ((width) \
509 - (f)->output_data.win32->internal_border_width \ 509 - (f)->output_data.w32->internal_border_width \
510 - (f)->output_data.win32->vertical_scroll_bar_extra))) 510 - (f)->output_data.w32->vertical_scroll_bar_extra)))
511#define PIXEL_TO_CHAR_HEIGHT(f, height) \ 511#define PIXEL_TO_CHAR_HEIGHT(f, height) \
512 (PIXEL_TO_CHAR_ROW (f, ((height) \ 512 (PIXEL_TO_CHAR_ROW (f, ((height) \
513 - (f)->output_data.win32->internal_border_width))) 513 - (f)->output_data.w32->internal_border_width)))
514 514
515/* Interface to the face code functions. */ 515/* Interface to the face code functions. */
516 516
@@ -555,27 +555,27 @@ extern int compute_char_face (/* FRAME_PTR frame,
555 be BASIC_FACE. F is the frame. */ 555 be BASIC_FACE. F is the frame. */
556extern int compute_glyph_face (/* FRAME_PTR, int */); 556extern int compute_glyph_face (/* FRAME_PTR, int */);
557 557
558extern void win32_fill_rect (); 558extern void w32_fill_rect ();
559extern void win32_clear_window (); 559extern void w32_clear_window ();
560 560
561#define win32_fill_area(f,hdc,pix,x,y,nx,ny) \ 561#define w32_fill_area(f,hdc,pix,x,y,nx,ny) \
562{ \ 562{ \
563 RECT rect; \ 563 RECT rect; \
564 rect.left = x; \ 564 rect.left = x; \
565 rect.top = y; \ 565 rect.top = y; \
566 rect.right = x + nx; \ 566 rect.right = x + nx; \
567 rect.bottom = y + ny; \ 567 rect.bottom = y + ny; \
568 win32_fill_rect (f,hdc,pix,&rect); \ 568 w32_fill_rect (f,hdc,pix,&rect); \
569} 569}
570 570
571#define win32_clear_rect(f,hdc,lprect) \ 571#define w32_clear_rect(f,hdc,lprect) \
572win32_fill_rect (f,hdc,f->output_data.win32->background_pixel,lprect) 572w32_fill_rect (f,hdc,f->output_data.w32->background_pixel,lprect)
573 573
574#define win32_clear_area(f,hdc,x,y,nx,ny) \ 574#define w32_clear_area(f,hdc,x,y,nx,ny) \
575win32_fill_area (f,hdc,f->output_data.win32->background_pixel,x,y,nx,ny) 575w32_fill_area (f,hdc,f->output_data.w32->background_pixel,x,y,nx,ny)
576 576
577extern XFontStruct *win32_load_font (); 577extern XFontStruct *w32_load_font ();
578extern void win32_unload_font (); 578extern void w32_unload_font ();
579 579
580#define WM_EMACS_START (WM_USER + 1) 580#define WM_EMACS_START (WM_USER + 1)
581#define WM_EMACS_KILL (WM_EMACS_START + 0x00) 581#define WM_EMACS_KILL (WM_EMACS_START + 0x00)
@@ -594,7 +594,7 @@ typedef struct {
594 int cx; 594 int cx;
595 int cy; 595 int cy;
596 int flags; 596 int flags;
597} Win32WindowPos; 597} W32WindowPos;
598 598
599#define WND_X_UNITS_INDEX (0) 599#define WND_X_UNITS_INDEX (0)
600#define WND_Y_UNITS_INDEX (4) 600#define WND_Y_UNITS_INDEX (4)
@@ -608,11 +608,11 @@ extern HANDLE hWinThread;
608extern DWORD dwMainThreadId; 608extern DWORD dwMainThreadId;
609extern HANDLE hMainThread; 609extern HANDLE hMainThread;
610 610
611typedef struct Win32Msg { 611typedef struct W32Msg {
612 MSG msg; 612 MSG msg;
613 DWORD dwModifiers; 613 DWORD dwModifiers;
614 RECT rect; 614 RECT rect;
615} Win32Msg; 615} W32Msg;
616 616
617extern CRITICAL_SECTION critsect; 617extern CRITICAL_SECTION critsect;
618 618
@@ -633,7 +633,7 @@ extern void wait_for_sync ();
633 633
634extern BOOL parse_button (); 634extern BOOL parse_button ();
635 635
636/* Keypad command key support. Win32 doesn't have virtual keys defined 636/* Keypad command key support. W32 doesn't have virtual keys defined
637 for the function keys on the keypad (they are mapped to the standard 637 for the function keys on the keypad (they are mapped to the standard
638 fuction keys), so we define our own. */ 638 fuction keys), so we define our own. */
639#define VK_NUMPAD_BEGIN 0x92 639#define VK_NUMPAD_BEGIN 0x92
diff --git a/src/w32xfns.c b/src/w32xfns.c
index 24bbf6c7df4..e2aa3b6abc3 100644
--- a/src/w32xfns.c
+++ b/src/w32xfns.c
@@ -1,4 +1,4 @@
1/* Functions taken directly from X sources 1/* Functions taken directly from X sources for use with the Win32 API.
2 Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation. 2 Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
@@ -59,11 +59,11 @@ delete_crit ()
59void 59void
60select_palette (FRAME_PTR f, HDC hdc) 60select_palette (FRAME_PTR f, HDC hdc)
61{ 61{
62 if (!NILP (Vwin32_enable_palette)) 62 if (!NILP (Vw32_enable_palette))
63 f->output_data.win32->old_palette = 63 f->output_data.w32->old_palette =
64 SelectPalette (hdc, one_win32_display_info.palette, FALSE); 64 SelectPalette (hdc, one_w32_display_info.palette, FALSE);
65 else 65 else
66 f->output_data.win32->old_palette = NULL; 66 f->output_data.w32->old_palette = NULL;
67 67
68 if (RealizePalette (hdc)) 68 if (RealizePalette (hdc))
69 { 69 {
@@ -78,8 +78,8 @@ select_palette (FRAME_PTR f, HDC hdc)
78void 78void
79deselect_palette (FRAME_PTR f, HDC hdc) 79deselect_palette (FRAME_PTR f, HDC hdc)
80{ 80{
81 if (f->output_data.win32->old_palette) 81 if (f->output_data.w32->old_palette)
82 SelectPalette (hdc, f->output_data.win32->old_palette, FALSE); 82 SelectPalette (hdc, f->output_data.w32->old_palette, FALSE);
83} 83}
84 84
85/* Get a DC for frame and select palette for drawing; force an update of 85/* Get a DC for frame and select palette for drawing; force an update of
@@ -91,7 +91,7 @@ get_frame_dc (FRAME_PTR f)
91 91
92 enter_crit (); 92 enter_crit ();
93 93
94 hdc = GetDC (f->output_data.win32->window_desc); 94 hdc = GetDC (f->output_data.w32->window_desc);
95 select_palette (f, hdc); 95 select_palette (f, hdc);
96 96
97 return hdc; 97 return hdc;
@@ -103,7 +103,7 @@ release_frame_dc (FRAME_PTR f, HDC hdc)
103 int ret; 103 int ret;
104 104
105 deselect_palette (f, hdc); 105 deselect_palette (f, hdc);
106 ret = ReleaseDC (f->output_data.win32->window_desc, hdc); 106 ret = ReleaseDC (f->output_data.w32->window_desc, hdc);
107 107
108 leave_crit (); 108 leave_crit ();
109 109
@@ -112,7 +112,7 @@ release_frame_dc (FRAME_PTR f, HDC hdc)
112 112
113typedef struct int_msg 113typedef struct int_msg
114{ 114{
115 Win32Msg w32msg; 115 W32Msg w32msg;
116 struct int_msg *lpNext; 116 struct int_msg *lpNext;
117} int_msg; 117} int_msg;
118 118
@@ -122,7 +122,7 @@ int nQueue = 0;
122 122
123BOOL 123BOOL
124get_next_msg (lpmsg, bWait) 124get_next_msg (lpmsg, bWait)
125 Win32Msg * lpmsg; 125 W32Msg * lpmsg;
126 BOOL bWait; 126 BOOL bWait;
127{ 127{
128 BOOL bRet = FALSE; 128 BOOL bRet = FALSE;
@@ -140,7 +140,7 @@ get_next_msg (lpmsg, bWait)
140 140
141 if (nQueue) 141 if (nQueue)
142 { 142 {
143 bcopy (&(lpHead->w32msg), lpmsg, sizeof (Win32Msg)); 143 bcopy (&(lpHead->w32msg), lpmsg, sizeof (W32Msg));
144 144
145 { 145 {
146 int_msg * lpCur = lpHead; 146 int_msg * lpCur = lpHead;
@@ -165,14 +165,14 @@ get_next_msg (lpmsg, bWait)
165 165
166BOOL 166BOOL
167post_msg (lpmsg) 167post_msg (lpmsg)
168 Win32Msg * lpmsg; 168 W32Msg * lpmsg;
169{ 169{
170 int_msg * lpNew = (int_msg *) myalloc (sizeof (int_msg)); 170 int_msg * lpNew = (int_msg *) myalloc (sizeof (int_msg));
171 171
172 if (!lpNew) 172 if (!lpNew)
173 return (FALSE); 173 return (FALSE);
174 174
175 bcopy (lpmsg, &(lpNew->w32msg), sizeof (Win32Msg)); 175 bcopy (lpmsg, &(lpNew->w32msg), sizeof (W32Msg));
176 lpNew->lpNext = NULL; 176 lpNew->lpNext = NULL;
177 177
178 enter_crit (); 178 enter_crit ();
@@ -195,14 +195,14 @@ post_msg (lpmsg)
195} 195}
196 196
197BOOL 197BOOL
198prepend_msg (Win32Msg *lpmsg) 198prepend_msg (W32Msg *lpmsg)
199{ 199{
200 int_msg * lpNew = (int_msg *) myalloc (sizeof (int_msg)); 200 int_msg * lpNew = (int_msg *) myalloc (sizeof (int_msg));
201 201
202 if (!lpNew) 202 if (!lpNew)
203 return (FALSE); 203 return (FALSE);
204 204
205 bcopy (lpmsg, &(lpNew->w32msg), sizeof (Win32Msg)); 205 bcopy (lpmsg, &(lpNew->w32msg), sizeof (W32Msg));
206 206
207 enter_crit (); 207 enter_crit ();
208 208
@@ -357,7 +357,7 @@ have_menus_p (void)
357 return 1; 357 return 1;
358} 358}
359 359
360/* x_sync is a no-op on Win32. */ 360/* x_sync is a no-op on W32. */
361void 361void
362x_sync (f) 362x_sync (f)
363 void *f; 363 void *f;