aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJuanma Barranquero2010-07-06 16:22:29 +0200
committerJuanma Barranquero2010-07-06 16:22:29 +0200
commitb56ceb92bf4d470af2e9172d1fcd4d85232c40a6 (patch)
tree50ab60b4715be45ed671c386c5b9336b45443539 /src
parent7af07b967171736a35e0af8b6ecf6feb072184dc (diff)
downloademacs-b56ceb92bf4d470af2e9172d1fcd4d85232c40a6.tar.gz
emacs-b56ceb92bf4d470af2e9172d1fcd4d85232c40a6.zip
src/w32*.c: Convert function definitions to standard C.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/w32.c77
-rw-r--r--src/w32console.c47
-rw-r--r--src/w32fns.c265
-rw-r--r--src/w32font.c181
-rw-r--r--src/w32heap.c2
-rw-r--r--src/w32inevt.c2
-rw-r--r--src/w32menu.c53
-rw-r--r--src/w32proc.c23
-rw-r--r--src/w32reg.c12
-rw-r--r--src/w32select.c34
-rw-r--r--src/w32term.c484
-rw-r--r--src/w32uniscribe.c49
-rw-r--r--src/w32xfns.c29
14 files changed, 442 insertions, 822 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index bd2aba266cc..c0c94ebea89 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12010-07-06 Juanma Barranquero <lekktu@gmail.com>
2
3 * w32.c, w32console.c, w32fns.c, w32font.c, w32heap.c, w32inevt.c
4 * w32menu.c, w32proc.c, w32reg.c, w32select.c, w32term.c
5 * w32uniscribe.c, w32xfns.c: Convert function definitions to standard C.
6
12010-07-06 Andreas Schwab <schwab@linux-m68k.org> 72010-07-06 Andreas Schwab <schwab@linux-m68k.org>
2 8
3 * xterm.c (x_get_keysym_name): Change type of parameter to int. 9 * xterm.c (x_get_keysym_name): Change type of parameter to int.
diff --git a/src/w32.c b/src/w32.c
index 0560ce4a6b8..e407959a2e6 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -148,7 +148,7 @@ extern Lisp_Object QCflowcontrol, Qhw, Qsw, QCsummary;
148typedef HRESULT (WINAPI * ShGetFolderPath_fn) 148typedef HRESULT (WINAPI * ShGetFolderPath_fn)
149 (IN HWND, IN int, IN HANDLE, IN DWORD, OUT char *); 149 (IN HWND, IN int, IN HANDLE, IN DWORD, OUT char *);
150 150
151void globals_of_w32 (); 151void globals_of_w32 (void);
152static DWORD get_rid (PSID); 152static DWORD get_rid (PSID);
153 153
154extern Lisp_Object Vw32_downcase_file_names; 154extern Lisp_Object Vw32_downcase_file_names;
@@ -308,7 +308,7 @@ typedef BOOL (WINAPI * GetSystemTimes_Proc) (
308 308
309 /* ** A utility function ** */ 309 /* ** A utility function ** */
310static BOOL 310static BOOL
311is_windows_9x () 311is_windows_9x (void)
312{ 312{
313 static BOOL s_b_ret=0; 313 static BOOL s_b_ret=0;
314 OSVERSIONINFO os_ver; 314 OSVERSIONINFO os_ver;
@@ -329,7 +329,7 @@ is_windows_9x ()
329 Returns a list of three integers if the times are provided by the OS 329 Returns a list of three integers if the times are provided by the OS
330 (NT derivatives), otherwise it returns the result of current-time. */ 330 (NT derivatives), otherwise it returns the result of current-time. */
331Lisp_Object 331Lisp_Object
332w32_get_internal_run_time () 332w32_get_internal_run_time (void)
333{ 333{
334 if (get_process_times_fn) 334 if (get_process_times_fn)
335 { 335 {
@@ -1035,13 +1035,13 @@ static struct group dflt_group =
1035}; 1035};
1036 1036
1037unsigned 1037unsigned
1038getuid () 1038getuid (void)
1039{ 1039{
1040 return dflt_passwd.pw_uid; 1040 return dflt_passwd.pw_uid;
1041} 1041}
1042 1042
1043unsigned 1043unsigned
1044geteuid () 1044geteuid (void)
1045{ 1045{
1046 /* I could imagine arguing for checking to see whether the user is 1046 /* I could imagine arguing for checking to see whether the user is
1047 in the Administrators group and returning a UID of 0 for that 1047 in the Administrators group and returning a UID of 0 for that
@@ -1050,13 +1050,13 @@ geteuid ()
1050} 1050}
1051 1051
1052unsigned 1052unsigned
1053getgid () 1053getgid (void)
1054{ 1054{
1055 return dflt_passwd.pw_gid; 1055 return dflt_passwd.pw_gid;
1056} 1056}
1057 1057
1058unsigned 1058unsigned
1059getegid () 1059getegid (void)
1060{ 1060{
1061 return getgid (); 1061 return getgid ();
1062} 1062}
@@ -1091,7 +1091,7 @@ getpwnam (char *name)
1091} 1091}
1092 1092
1093void 1093void
1094init_user_info () 1094init_user_info (void)
1095{ 1095{
1096 /* Find the user's real name by opening the process token and 1096 /* Find the user's real name by opening the process token and
1097 looking up the name associated with the user-sid in that token. 1097 looking up the name associated with the user-sid in that token.
@@ -1207,7 +1207,7 @@ init_user_info ()
1207} 1207}
1208 1208
1209int 1209int
1210random () 1210random (void)
1211{ 1211{
1212 /* rand () on NT gives us 15 random bits...hack together 30 bits. */ 1212 /* rand () on NT gives us 15 random bits...hack together 30 bits. */
1213 return ((rand () << 15) | rand ()); 1213 return ((rand () << 15) | rand ());
@@ -1225,9 +1225,7 @@ srandom (int seed)
1225 case path name components to lower case. */ 1225 case path name components to lower case. */
1226 1226
1227static void 1227static void
1228normalize_filename (fp, path_sep) 1228normalize_filename (register char *fp, char path_sep)
1229 register char *fp;
1230 char path_sep;
1231{ 1229{
1232 char sep; 1230 char sep;
1233 char *elem; 1231 char *elem;
@@ -1283,16 +1281,14 @@ normalize_filename (fp, path_sep)
1283 1281
1284/* Destructively turn backslashes into slashes. */ 1282/* Destructively turn backslashes into slashes. */
1285void 1283void
1286dostounix_filename (p) 1284dostounix_filename (register char *p)
1287 register char *p;
1288{ 1285{
1289 normalize_filename (p, '/'); 1286 normalize_filename (p, '/');
1290} 1287}
1291 1288
1292/* Destructively turn slashes into backslashes. */ 1289/* Destructively turn slashes into backslashes. */
1293void 1290void
1294unixtodos_filename (p) 1291unixtodos_filename (register char *p)
1295 register char *p;
1296{ 1292{
1297 normalize_filename (p, '\\'); 1293 normalize_filename (p, '\\');
1298} 1294}
@@ -1301,9 +1297,7 @@ unixtodos_filename (p)
1301 (From msdos.c...probably should figure out a way to share it, 1297 (From msdos.c...probably should figure out a way to share it,
1302 although this code isn't going to ever change.) */ 1298 although this code isn't going to ever change.) */
1303int 1299int
1304crlf_to_lf (n, buf) 1300crlf_to_lf (register int n, register unsigned char *buf)
1305 register int n;
1306 register unsigned char *buf;
1307{ 1301{
1308 unsigned char *np = buf; 1302 unsigned char *np = buf;
1309 unsigned char *startp = buf; 1303 unsigned char *startp = buf;
@@ -1520,9 +1514,7 @@ alarm (int seconds)
1520#define REG_ROOT "SOFTWARE\\GNU\\Emacs" 1514#define REG_ROOT "SOFTWARE\\GNU\\Emacs"
1521 1515
1522LPBYTE 1516LPBYTE
1523w32_get_resource (key, lpdwtype) 1517w32_get_resource (char *key, LPDWORD lpdwtype)
1524 char *key;
1525 LPDWORD lpdwtype;
1526{ 1518{
1527 LPBYTE lpvalue; 1519 LPBYTE lpvalue;
1528 HKEY hrootkey = NULL; 1520 HKEY hrootkey = NULL;
@@ -2691,7 +2683,7 @@ sys_creat (const char * path, int mode)
2691} 2683}
2692 2684
2693FILE * 2685FILE *
2694sys_fopen(const char * path, const char * mode) 2686sys_fopen (const char * path, const char * mode)
2695{ 2687{
2696 int fd; 2688 int fd;
2697 int oflag; 2689 int oflag;
@@ -2980,7 +2972,7 @@ static int init = 0;
2980 } while (0) 2972 } while (0)
2981 2973
2982static void 2974static void
2983initialize_utc_base () 2975initialize_utc_base (void)
2984{ 2976{
2985 /* Determine the delta between 1-Jan-1601 and 1-Jan-1970. */ 2977 /* Determine the delta between 1-Jan-1601 and 1-Jan-1970. */
2986 SYSTEMTIME st; 2978 SYSTEMTIME st;
@@ -3904,7 +3896,7 @@ BOOL WINAPI global_memory_status_ex (
3904} 3896}
3905 3897
3906Lisp_Object 3898Lisp_Object
3907list_system_processes () 3899list_system_processes (void)
3908{ 3900{
3909 struct gcpro gcpro1; 3901 struct gcpro gcpro1;
3910 Lisp_Object proclist = Qnil; 3902 Lisp_Object proclist = Qnil;
@@ -3995,8 +3987,7 @@ restore_privilege (TOKEN_PRIVILEGES *priv)
3995} 3987}
3996 3988
3997static Lisp_Object 3989static Lisp_Object
3998ltime (time_sec, time_usec) 3990ltime (long time_sec, long time_usec)
3999 long time_sec, time_usec;
4000{ 3991{
4001 return list3 (make_number ((time_sec >> 16) & 0xffff), 3992 return list3 (make_number ((time_sec >> 16) & 0xffff),
4002 make_number (time_sec & 0xffff), 3993 make_number (time_sec & 0xffff),
@@ -4006,10 +3997,9 @@ ltime (time_sec, time_usec)
4006#define U64_TO_LISP_TIME(time) ltime ((time) / 1000000L, (time) % 1000000L) 3997#define U64_TO_LISP_TIME(time) ltime ((time) / 1000000L, (time) % 1000000L)
4007 3998
4008static int 3999static int
4009process_times (h_proc, ctime, etime, stime, utime, ttime, pcpu) 4000process_times (HANDLE h_proc, Lisp_Object *ctime, Lisp_Object *etime,
4010 HANDLE h_proc; 4001 Lisp_Object *stime, Lisp_Object *utime, Lisp_Object *ttime,
4011 Lisp_Object *ctime, *etime, *stime, *utime, *ttime; 4002 double *pcpu)
4012 double *pcpu;
4013{ 4003{
4014 FILETIME ft_creation, ft_exit, ft_kernel, ft_user, ft_current; 4004 FILETIME ft_creation, ft_exit, ft_kernel, ft_user, ft_current;
4015 ULONGLONG tem1, tem2, tem3, tem; 4005 ULONGLONG tem1, tem2, tem3, tem;
@@ -4059,8 +4049,7 @@ process_times (h_proc, ctime, etime, stime, utime, ttime, pcpu)
4059} 4049}
4060 4050
4061Lisp_Object 4051Lisp_Object
4062system_process_attributes (pid) 4052system_process_attributes (Lisp_Object pid)
4063 Lisp_Object pid;
4064{ 4053{
4065 struct gcpro gcpro1, gcpro2, gcpro3; 4054 struct gcpro gcpro1, gcpro2, gcpro3;
4066 Lisp_Object attrs = Qnil; 4055 Lisp_Object attrs = Qnil;
@@ -4526,7 +4515,7 @@ int h_errno = 0;
4526 normal system codes where they overlap (non-overlapping definitions 4515 normal system codes where they overlap (non-overlapping definitions
4527 are already in <sys/socket.h> */ 4516 are already in <sys/socket.h> */
4528static void 4517static void
4529set_errno () 4518set_errno (void)
4530{ 4519{
4531 if (winsock_lib == NULL) 4520 if (winsock_lib == NULL)
4532 h_errno = EINVAL; 4521 h_errno = EINVAL;
@@ -4548,7 +4537,7 @@ set_errno ()
4548} 4537}
4549 4538
4550static void 4539static void
4551check_errno () 4540check_errno (void)
4552{ 4541{
4553 if (h_errno == 0 && winsock_lib != NULL) 4542 if (h_errno == 0 && winsock_lib != NULL)
4554 pfn_WSASetLastError (0); 4543 pfn_WSASetLastError (0);
@@ -5038,7 +5027,7 @@ sys_accept (int s, struct sockaddr * addr, int * addrlen)
5038 5027
5039int 5028int
5040sys_recvfrom (int s, char * buf, int len, int flags, 5029sys_recvfrom (int s, char * buf, int len, int flags,
5041 struct sockaddr * from, int * fromlen) 5030 struct sockaddr * from, int * fromlen)
5042{ 5031{
5043 if (winsock_lib == NULL) 5032 if (winsock_lib == NULL)
5044 { 5033 {
@@ -5733,7 +5722,7 @@ sys_write (int fd, const void * buffer, unsigned int count)
5733} 5722}
5734 5723
5735static void 5724static void
5736check_windows_init_file () 5725check_windows_init_file (void)
5737{ 5726{
5738 extern int noninteractive, inhibit_window_system; 5727 extern int noninteractive, inhibit_window_system;
5739 5728
@@ -5789,7 +5778,7 @@ check_windows_init_file ()
5789} 5778}
5790 5779
5791void 5780void
5792term_ntproc () 5781term_ntproc (void)
5793{ 5782{
5794#ifdef HAVE_SOCKETS 5783#ifdef HAVE_SOCKETS
5795 /* shutdown the socket interface if necessary */ 5784 /* shutdown the socket interface if necessary */
@@ -5800,7 +5789,7 @@ term_ntproc ()
5800} 5789}
5801 5790
5802void 5791void
5803init_ntproc () 5792init_ntproc (void)
5804{ 5793{
5805#ifdef HAVE_SOCKETS 5794#ifdef HAVE_SOCKETS
5806 /* Initialise the socket interface now if available and requested by 5795 /* Initialise the socket interface now if available and requested by
@@ -5908,7 +5897,8 @@ init_ntproc ()
5908 shutdown_handler ensures that buffers' autosave files are 5897 shutdown_handler ensures that buffers' autosave files are
5909 up to date when the user logs off, or the system shuts down. 5898 up to date when the user logs off, or the system shuts down.
5910*/ 5899*/
5911BOOL WINAPI shutdown_handler(DWORD type) 5900BOOL WINAPI
5901shutdown_handler(DWORD type)
5912{ 5902{
5913 /* Ctrl-C and Ctrl-Break are already suppressed, so don't handle them. */ 5903 /* Ctrl-C and Ctrl-Break are already suppressed, so don't handle them. */
5914 if (type == CTRL_CLOSE_EVENT /* User closes console window. */ 5904 if (type == CTRL_CLOSE_EVENT /* User closes console window. */
@@ -5929,7 +5919,7 @@ BOOL WINAPI shutdown_handler(DWORD type)
5929 initialized is non zero (see the function main in emacs.c). 5919 initialized is non zero (see the function main in emacs.c).
5930*/ 5920*/
5931void 5921void
5932globals_of_w32 () 5922globals_of_w32 (void)
5933{ 5923{
5934 HMODULE kernel32 = GetModuleHandle ("kernel32.dll"); 5924 HMODULE kernel32 = GetModuleHandle ("kernel32.dll");
5935 5925
@@ -5974,7 +5964,8 @@ globals_of_w32 ()
5974} 5964}
5975 5965
5976/* For make-serial-process */ 5966/* For make-serial-process */
5977int serial_open (char *port) 5967int
5968serial_open (char *port)
5978{ 5969{
5979 HANDLE hnd; 5970 HANDLE hnd;
5980 child_process *cp; 5971 child_process *cp;
@@ -6014,7 +6005,7 @@ int serial_open (char *port)
6014/* For serial-process-configure */ 6005/* For serial-process-configure */
6015void 6006void
6016serial_configure (struct Lisp_Process *p, 6007serial_configure (struct Lisp_Process *p,
6017 Lisp_Object contact) 6008 Lisp_Object contact)
6018{ 6009{
6019 Lisp_Object childp2 = Qnil; 6010 Lisp_Object childp2 = Qnil;
6020 Lisp_Object tem = Qnil; 6011 Lisp_Object tem = Qnil;
diff --git a/src/w32console.c b/src/w32console.c
index 83c7430f6dc..c2fe6e7db5c 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -42,13 +42,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
42#include "w32inevt.h" 42#include "w32inevt.h"
43 43
44/* from window.c */ 44/* from window.c */
45extern Lisp_Object Frecenter (); 45extern Lisp_Object Frecenter (Lisp_Object);
46 46
47/* from keyboard.c */ 47/* from keyboard.c */
48extern int detect_input_pending (); 48extern int detect_input_pending (void);
49 49
50/* from sysdep.c */ 50/* from sysdep.c */
51extern int read_input_pending (); 51extern int read_input_pending (void);
52 52
53static void w32con_move_cursor (struct frame *f, int row, int col); 53static void w32con_move_cursor (struct frame *f, int row, int col);
54static void w32con_clear_to_end (struct frame *f); 54static void w32con_clear_to_end (struct frame *f);
@@ -68,7 +68,7 @@ static WORD w32_face_attributes (struct frame *f, int face_id);
68static COORD cursor_coords; 68static COORD cursor_coords;
69static HANDLE prev_screen, cur_screen; 69static HANDLE prev_screen, cur_screen;
70static WORD char_attr_normal; 70static WORD char_attr_normal;
71static DWORD prev_console_mode; 71static DWORD prev_console_mode;
72 72
73#ifndef USE_SEPARATE_SCREEN 73#ifndef USE_SEPARATE_SCREEN
74static CONSOLE_CURSOR_INFO prev_console_cursor; 74static CONSOLE_CURSOR_INFO prev_console_cursor;
@@ -268,7 +268,8 @@ scroll_line (struct frame *f, int dist, int direction)
268 268
269/* If start is zero insert blanks instead of a string at start ?. */ 269/* If start is zero insert blanks instead of a string at start ?. */
270static void 270static void
271w32con_insert_glyphs (struct frame *f, register struct glyph *start, register int len) 271w32con_insert_glyphs (struct frame *f, register struct glyph *start,
272 register int len)
272{ 273{
273 scroll_line (f, len, RIGHT); 274 scroll_line (f, len, RIGHT);
274 275
@@ -286,7 +287,7 @@ w32con_insert_glyphs (struct frame *f, register struct glyph *start, register in
286 } 287 }
287} 288}
288 289
289extern unsigned char *encode_terminal_code (struct glyph *, int, 290extern unsigned char *encode_terminal_code (struct glyph *, int,
290 struct coding_system *); 291 struct coding_system *);
291 292
292static void 293static void
@@ -438,7 +439,7 @@ w32con_reset_terminal_modes (struct terminal *t)
438 FillConsoleOutputCharacter (cur_screen, ' ', n, dest, &r); 439 FillConsoleOutputCharacter (cur_screen, ' ', n, dest, &r);
439 /* Now that the screen is clear, put the cursor at the top. */ 440 /* Now that the screen is clear, put the cursor at the top. */
440 SetConsoleCursorPosition (cur_screen, dest); 441 SetConsoleCursorPosition (cur_screen, dest);
441 442
442#ifdef USE_SEPARATE_SCREEN 443#ifdef USE_SEPARATE_SCREEN
443 SetConsoleActiveScreenBuffer (prev_screen); 444 SetConsoleActiveScreenBuffer (prev_screen);
444#else 445#else
@@ -511,13 +512,13 @@ struct tty_display_info *current_tty = NULL;
511int cost = 0; 512int cost = 0;
512 513
513int 514int
514evalcost (char c) 515evalcost (int c)
515{ 516{
516 return c; 517 return c;
517} 518}
518 519
519int 520int
520cmputc (char c) 521cmputc (int c)
521{ 522{
522 return c; 523 return c;
523} 524}
@@ -551,9 +552,7 @@ Wcm_clear (struct tty_display_info *tty)
551/* Turn appearances of face FACE_ID on tty frame F on. */ 552/* Turn appearances of face FACE_ID on tty frame F on. */
552 553
553static WORD 554static WORD
554w32_face_attributes (f, face_id) 555w32_face_attributes (struct frame *f, int face_id)
555 struct frame *f;
556 int face_id;
557{ 556{
558 WORD char_attr; 557 WORD char_attr;
559 struct face *face = FACE_FROM_ID (f, face_id); 558 struct face *face = FACE_FROM_ID (f, face_id);
@@ -609,8 +608,6 @@ vga_stdcolor_name (int idx)
609 return Qunspecified; /* meaning the default */ 608 return Qunspecified; /* meaning the default */
610} 609}
611 610
612typedef int (*term_hook) ();
613
614void 611void
615initialize_w32_display (struct terminal *term) 612initialize_w32_display (struct terminal *term)
616{ 613{
@@ -618,19 +615,19 @@ initialize_w32_display (struct terminal *term)
618 615
619 term->rif = 0; /* No window based redisplay on the console. */ 616 term->rif = 0; /* No window based redisplay on the console. */
620 term->cursor_to_hook = w32con_move_cursor; 617 term->cursor_to_hook = w32con_move_cursor;
621 term->raw_cursor_to_hook = w32con_move_cursor; 618 term->raw_cursor_to_hook = w32con_move_cursor;
622 term->clear_to_end_hook = w32con_clear_to_end; 619 term->clear_to_end_hook = w32con_clear_to_end;
623 term->clear_frame_hook = w32con_clear_frame; 620 term->clear_frame_hook = w32con_clear_frame;
624 term->clear_end_of_line_hook = w32con_clear_end_of_line; 621 term->clear_end_of_line_hook = w32con_clear_end_of_line;
625 term->ins_del_lines_hook = w32con_ins_del_lines; 622 term->ins_del_lines_hook = w32con_ins_del_lines;
626 term->insert_glyphs_hook = w32con_insert_glyphs; 623 term->insert_glyphs_hook = w32con_insert_glyphs;
627 term->write_glyphs_hook = w32con_write_glyphs; 624 term->write_glyphs_hook = w32con_write_glyphs;
628 term->delete_glyphs_hook = w32con_delete_glyphs; 625 term->delete_glyphs_hook = w32con_delete_glyphs;
629 term->ring_bell_hook = w32_sys_ring_bell; 626 term->ring_bell_hook = w32_sys_ring_bell;
630 term->reset_terminal_modes_hook = w32con_reset_terminal_modes; 627 term->reset_terminal_modes_hook = w32con_reset_terminal_modes;
631 term->set_terminal_modes_hook = w32con_set_terminal_modes; 628 term->set_terminal_modes_hook = w32con_set_terminal_modes;
632 term->set_terminal_window_hook = w32con_set_terminal_window; 629 term->set_terminal_window_hook = w32con_set_terminal_window;
633 term->update_begin_hook = w32con_update_begin; 630 term->update_begin_hook = w32con_update_begin;
634 term->update_end_hook = w32con_update_end; 631 term->update_end_hook = w32con_update_end;
635 632
636 term->read_socket_hook = w32_console_read_socket; 633 term->read_socket_hook = w32_console_read_socket;
@@ -775,7 +772,7 @@ DEFUN ("set-cursor-size", Fset_cursor_size, Sset_cursor_size, 1, 1, 0,
775} 772}
776 773
777void 774void
778syms_of_ntterm () 775syms_of_ntterm (void)
779{ 776{
780 DEFVAR_BOOL ("w32-use-full-screen-buffer", 777 DEFVAR_BOOL ("w32-use-full-screen-buffer",
781 &w32_use_full_screen_buffer, 778 &w32_use_full_screen_buffer,
diff --git a/src/w32fns.c b/src/w32fns.c
index f371bd36fa5..ddb8e76d7fc 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -69,11 +69,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
69#define FOF_NO_CONNECTED_ELEMENTS 0x2000 69#define FOF_NO_CONNECTED_ELEMENTS 0x2000
70#endif 70#endif
71 71
72void syms_of_w32fns (); 72void syms_of_w32fns (void);
73void globals_of_w32fns (); 73void globals_of_w32fns (void);
74 74
75extern void free_frame_menubar (); 75extern void free_frame_menubar (struct frame *);
76extern double atof (); 76extern double atof (const char *);
77extern int w32_console_toggle_lock_key (int, Lisp_Object); 77extern int w32_console_toggle_lock_key (int, Lisp_Object);
78extern void w32_menu_display_help (HWND, HMENU, UINT, UINT); 78extern void w32_menu_display_help (HWND, HMENU, UINT, UINT);
79extern void w32_free_menu_strings (HWND); 79extern void w32_free_menu_strings (HWND);
@@ -316,7 +316,7 @@ extern HMENU current_popup_menu;
316static int menubar_in_use = 0; 316static int menubar_in_use = 0;
317 317
318/* From w32uniscribe.c */ 318/* From w32uniscribe.c */
319extern void syms_of_w32uniscribe (); 319extern void syms_of_w32uniscribe (void);
320extern int uniscribe_available; 320extern int uniscribe_available;
321 321
322/* Function prototypes for hourglass support. */ 322/* Function prototypes for hourglass support. */
@@ -327,7 +327,7 @@ static void w32_hide_hourglass (void);
327 327
328/* Error if we are not connected to MS-Windows. */ 328/* Error if we are not connected to MS-Windows. */
329void 329void
330check_w32 () 330check_w32 (void)
331{ 331{
332 if (! w32_in_use) 332 if (! w32_in_use)
333 error ("MS-Windows not in use or not initialized"); 333 error ("MS-Windows not in use or not initialized");
@@ -337,7 +337,7 @@ check_w32 ()
337 You should not call this unless HAVE_MENUS is defined. */ 337 You should not call this unless HAVE_MENUS is defined. */
338 338
339int 339int
340have_menus_p () 340have_menus_p (void)
341{ 341{
342 return w32_in_use; 342 return w32_in_use;
343} 343}
@@ -346,8 +346,7 @@ have_menus_p ()
346 and checking validity for W32. */ 346 and checking validity for W32. */
347 347
348FRAME_PTR 348FRAME_PTR
349check_x_frame (frame) 349check_x_frame (Lisp_Object frame)
350 Lisp_Object frame;
351{ 350{
352 FRAME_PTR f; 351 FRAME_PTR f;
353 352
@@ -365,8 +364,7 @@ check_x_frame (frame)
365 the first display on the list. */ 364 the first display on the list. */
366 365
367struct w32_display_info * 366struct w32_display_info *
368check_x_display_info (frame) 367check_x_display_info (Lisp_Object frame)
369 Lisp_Object frame;
370{ 368{
371 if (NILP (frame)) 369 if (NILP (frame))
372 { 370 {
@@ -397,9 +395,7 @@ check_x_display_info (frame)
397/* This function can be called during GC, so use GC_xxx type test macros. */ 395/* This function can be called during GC, so use GC_xxx type test macros. */
398 396
399struct frame * 397struct frame *
400x_window_to_frame (dpyinfo, wdesc) 398x_window_to_frame (struct w32_display_info *dpyinfo, HWND wdesc)
401 struct w32_display_info *dpyinfo;
402 HWND wdesc;
403{ 399{
404 Lisp_Object tail, frame; 400 Lisp_Object tail, frame;
405 struct frame *f; 401 struct frame *f;
@@ -449,9 +445,7 @@ static void x_edge_detection (struct frame *, struct image *, Lisp_Object,
449 not Emacs's own window. */ 445 not Emacs's own window. */
450 446
451void 447void
452x_real_positions (f, xptr, yptr) 448x_real_positions (FRAME_PTR f, int *xptr, int *yptr)
453 FRAME_PTR f;
454 int *xptr, *yptr;
455{ 449{
456 POINT pt; 450 POINT pt;
457 RECT rect; 451 RECT rect;
@@ -790,8 +784,7 @@ DEFUN ("w32-default-color-map", Fw32_default_color_map, Sw32_default_color_map,
790} 784}
791 785
792static Lisp_Object 786static Lisp_Object
793w32_to_x_color (rgb) 787w32_to_x_color (Lisp_Object rgb)
794 Lisp_Object rgb;
795{ 788{
796 Lisp_Object color; 789 Lisp_Object color;
797 790
@@ -810,8 +803,7 @@ w32_to_x_color (rgb)
810} 803}
811 804
812static Lisp_Object 805static Lisp_Object
813w32_color_map_lookup (colorname) 806w32_color_map_lookup (char *colorname)
814 char *colorname;
815{ 807{
816 Lisp_Object tail, ret = Qnil; 808 Lisp_Object tail, ret = Qnil;
817 809
@@ -843,8 +835,7 @@ w32_color_map_lookup (colorname)
843 835
844 836
845static void 837static void
846add_system_logical_colors_to_map (system_colors) 838add_system_logical_colors_to_map (Lisp_Object *system_colors)
847 Lisp_Object *system_colors;
848{ 839{
849 HKEY colors_key; 840 HKEY colors_key;
850 841
@@ -892,8 +883,7 @@ add_system_logical_colors_to_map (system_colors)
892 883
893 884
894static Lisp_Object 885static Lisp_Object
895x_to_w32_color (colorname) 886x_to_w32_color (char * colorname)
896 char * colorname;
897{ 887{
898 register Lisp_Object ret = Qnil; 888 register Lisp_Object ret = Qnil;
899 889
@@ -1204,9 +1194,7 @@ w32_unmap_color (FRAME_PTR f, COLORREF color)
1204/* Gamma-correct COLOR on frame F. */ 1194/* Gamma-correct COLOR on frame F. */
1205 1195
1206void 1196void
1207gamma_correct (f, color) 1197gamma_correct (struct frame *f, COLORREF *color)
1208 struct frame *f;
1209 COLORREF *color;
1210{ 1198{
1211 if (f->gamma) 1199 if (f->gamma)
1212 { 1200 {
@@ -1223,11 +1211,7 @@ gamma_correct (f, color)
1223 If ALLOC is nonzero, allocate a new colormap cell. */ 1211 If ALLOC is nonzero, allocate a new colormap cell. */
1224 1212
1225int 1213int
1226w32_defined_color (f, color, color_def, alloc) 1214w32_defined_color (FRAME_PTR f, char *color, XColor *color_def, int alloc)
1227 FRAME_PTR f;
1228 char *color;
1229 XColor *color_def;
1230 int alloc;
1231{ 1215{
1232 register Lisp_Object tem; 1216 register Lisp_Object tem;
1233 COLORREF w32_color_ref; 1217 COLORREF w32_color_ref;
@@ -1299,10 +1283,7 @@ w32_defined_color (f, color, color_def, alloc)
1299 ARG says. */ 1283 ARG says. */
1300 1284
1301int 1285int
1302x_decode_color (f, arg, def) 1286x_decode_color (FRAME_PTR f, Lisp_Object arg, int def)
1303 FRAME_PTR f;
1304 Lisp_Object arg;
1305 int def;
1306{ 1287{
1307 XColor cdef; 1288 XColor cdef;
1308 1289
@@ -1336,9 +1317,7 @@ x_decode_color (f, arg, def)
1336 in the standard place; do not attempt to change the window. */ 1317 in the standard place; do not attempt to change the window. */
1337 1318
1338void 1319void
1339x_set_foreground_color (f, arg, oldval) 1320x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
1340 struct frame *f;
1341 Lisp_Object arg, oldval;
1342{ 1321{
1343 struct w32_output *x = f->output_data.w32; 1322 struct w32_output *x = f->output_data.w32;
1344 PIX_TYPE fg, old_fg; 1323 PIX_TYPE fg, old_fg;
@@ -1359,9 +1338,7 @@ x_set_foreground_color (f, arg, oldval)
1359} 1338}
1360 1339
1361void 1340void
1362x_set_background_color (f, arg, oldval) 1341x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
1363 struct frame *f;
1364 Lisp_Object arg, oldval;
1365{ 1342{
1366 FRAME_BACKGROUND_PIXEL (f) 1343 FRAME_BACKGROUND_PIXEL (f)
1367 = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f)); 1344 = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f));
@@ -1379,9 +1356,7 @@ x_set_background_color (f, arg, oldval)
1379} 1356}
1380 1357
1381void 1358void
1382x_set_mouse_color (f, arg, oldval) 1359x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
1383 struct frame *f;
1384 Lisp_Object arg, oldval;
1385{ 1360{
1386 Cursor cursor, nontext_cursor, mode_cursor, hand_cursor; 1361 Cursor cursor, nontext_cursor, mode_cursor, hand_cursor;
1387 int count; 1362 int count;
@@ -1528,9 +1503,7 @@ x_set_mouse_color (f, arg, oldval)
1528} 1503}
1529 1504
1530void 1505void
1531x_set_cursor_color (f, arg, oldval) 1506x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
1532 struct frame *f;
1533 Lisp_Object arg, oldval;
1534{ 1507{
1535 unsigned long fore_pixel, pixel; 1508 unsigned long fore_pixel, pixel;
1536 1509
@@ -1577,9 +1550,7 @@ x_set_cursor_color (f, arg, oldval)
1577 F has a window. */ 1550 F has a window. */
1578 1551
1579void 1552void
1580x_set_border_pixel (f, pix) 1553x_set_border_pixel (struct frame *f, int pix)
1581 struct frame *f;
1582 int pix;
1583{ 1554{
1584 1555
1585 f->output_data.w32->border_pixel = pix; 1556 f->output_data.w32->border_pixel = pix;
@@ -1598,9 +1569,7 @@ x_set_border_pixel (f, pix)
1598 F has a window; it must be redone when the window is created. */ 1569 F has a window; it must be redone when the window is created. */
1599 1570
1600void 1571void
1601x_set_border_color (f, arg, oldval) 1572x_set_border_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
1602 struct frame *f;
1603 Lisp_Object arg, oldval;
1604{ 1573{
1605 int pix; 1574 int pix;
1606 1575
@@ -1612,9 +1581,7 @@ x_set_border_color (f, arg, oldval)
1612 1581
1613 1582
1614void 1583void
1615x_set_cursor_type (f, arg, oldval) 1584x_set_cursor_type (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
1616 FRAME_PTR f;
1617 Lisp_Object arg, oldval;
1618{ 1585{
1619 set_frame_cursor_types (f, arg); 1586 set_frame_cursor_types (f, arg);
1620 1587
@@ -1623,9 +1590,7 @@ x_set_cursor_type (f, arg, oldval)
1623} 1590}
1624 1591
1625void 1592void
1626x_set_icon_type (f, arg, oldval) 1593x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
1627 struct frame *f;
1628 Lisp_Object arg, oldval;
1629{ 1594{
1630 int result; 1595 int result;
1631 1596
@@ -1652,9 +1617,7 @@ x_set_icon_type (f, arg, oldval)
1652} 1617}
1653 1618
1654void 1619void
1655x_set_icon_name (f, arg, oldval) 1620x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
1656 struct frame *f;
1657 Lisp_Object arg, oldval;
1658{ 1621{
1659 if (STRINGP (arg)) 1622 if (STRINGP (arg))
1660 { 1623 {
@@ -1702,9 +1665,7 @@ x_set_icon_name (f, arg, oldval)
1702 1665
1703 1666
1704void 1667void
1705x_set_menu_bar_lines (f, value, oldval) 1668x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
1706 struct frame *f;
1707 Lisp_Object value, oldval;
1708{ 1669{
1709 int nlines; 1670 int nlines;
1710 int olines = FRAME_MENU_BAR_LINES (f); 1671 int olines = FRAME_MENU_BAR_LINES (f);
@@ -1747,9 +1708,7 @@ x_set_menu_bar_lines (f, value, oldval)
1747 The frame's height doesn't change. */ 1708 The frame's height doesn't change. */
1748 1709
1749void 1710void
1750x_set_tool_bar_lines (f, value, oldval) 1711x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
1751 struct frame *f;
1752 Lisp_Object value, oldval;
1753{ 1712{
1754 int delta, nlines, root_height; 1713 int delta, nlines, root_height;
1755 Lisp_Object root_window; 1714 Lisp_Object root_window;
@@ -1829,10 +1788,7 @@ x_set_tool_bar_lines (f, value, oldval)
1829 F->explicit_name is set, ignore the new name; otherwise, set it. */ 1788 F->explicit_name is set, ignore the new name; otherwise, set it. */
1830 1789
1831void 1790void
1832x_set_name (f, name, explicit) 1791x_set_name (struct frame *f, Lisp_Object name, int explicit)
1833 struct frame *f;
1834 Lisp_Object name;
1835 int explicit;
1836{ 1792{
1837 /* Make sure that requests from lisp code override requests from 1793 /* Make sure that requests from lisp code override requests from
1838 Emacs redisplay code. */ 1794 Emacs redisplay code. */
@@ -1887,9 +1843,7 @@ x_set_name (f, name, explicit)
1887 specified a name for the frame; the name will override any set by the 1843 specified a name for the frame; the name will override any set by the
1888 redisplay code. */ 1844 redisplay code. */
1889void 1845void
1890x_explicitly_set_name (f, arg, oldval) 1846x_explicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
1891 FRAME_PTR f;
1892 Lisp_Object arg, oldval;
1893{ 1847{
1894 x_set_name (f, arg, 1); 1848 x_set_name (f, arg, 1);
1895} 1849}
@@ -1898,9 +1852,7 @@ x_explicitly_set_name (f, arg, oldval)
1898 name; names set this way will never override names set by the user's 1852 name; names set this way will never override names set by the user's
1899 lisp code. */ 1853 lisp code. */
1900void 1854void
1901x_implicitly_set_name (f, arg, oldval) 1855x_implicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
1902 FRAME_PTR f;
1903 Lisp_Object arg, oldval;
1904{ 1856{
1905 x_set_name (f, arg, 0); 1857 x_set_name (f, arg, 0);
1906} 1858}
@@ -1909,9 +1861,7 @@ x_implicitly_set_name (f, arg, oldval)
1909 If NAME is nil, use the frame name as the title. */ 1861 If NAME is nil, use the frame name as the title. */
1910 1862
1911void 1863void
1912x_set_title (f, name, old_name) 1864x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name)
1913 struct frame *f;
1914 Lisp_Object name, old_name;
1915{ 1865{
1916 /* Don't change the title if it's already NAME. */ 1866 /* Don't change the title if it's already NAME. */
1917 if (EQ (name, f->title)) 1867 if (EQ (name, f->title))
@@ -1936,8 +1886,8 @@ x_set_title (f, name, old_name)
1936} 1886}
1937 1887
1938 1888
1939void x_set_scroll_bar_default_width (f) 1889void
1940 struct frame *f; 1890x_set_scroll_bar_default_width (struct frame *f)
1941{ 1891{
1942 int wid = FRAME_COLUMN_WIDTH (f); 1892 int wid = FRAME_COLUMN_WIDTH (f);
1943 1893
@@ -1965,11 +1915,10 @@ w32_load_cursor (LPCTSTR name)
1965 return cursor; 1915 return cursor;
1966} 1916}
1967 1917
1968extern LRESULT CALLBACK w32_wnd_proc (); 1918extern LRESULT CALLBACK w32_wnd_proc (HWND, UINT, WPARAM, LPARAM);
1969 1919
1970static BOOL 1920static BOOL
1971w32_init_class (hinst) 1921w32_init_class (HINSTANCE hinst)
1972 HINSTANCE hinst;
1973{ 1922{
1974 WNDCLASS wc; 1923 WNDCLASS wc;
1975 1924
@@ -1988,9 +1937,7 @@ w32_init_class (hinst)
1988} 1937}
1989 1938
1990static HWND 1939static HWND
1991w32_createscrollbar (f, bar) 1940w32_createscrollbar (struct frame *f, struct scroll_bar * bar)
1992 struct frame *f;
1993 struct scroll_bar * bar;
1994{ 1941{
1995 return (CreateWindow ("SCROLLBAR", "", SBS_VERT | WS_CHILD | WS_VISIBLE, 1942 return (CreateWindow ("SCROLLBAR", "", SBS_VERT | WS_CHILD | WS_VISIBLE,
1996 /* Position and size of scroll bar. */ 1943 /* Position and size of scroll bar. */
@@ -2005,8 +1952,7 @@ w32_createscrollbar (f, bar)
2005} 1952}
2006 1953
2007static void 1954static void
2008w32_createwindow (f) 1955w32_createwindow (struct frame *f)
2009 struct frame *f;
2010{ 1956{
2011 HWND hwnd; 1957 HWND hwnd;
2012 RECT rect; 1958 RECT rect;
@@ -2076,12 +2022,7 @@ w32_createwindow (f)
2076} 2022}
2077 2023
2078static void 2024static void
2079my_post_msg (wmsg, hwnd, msg, wParam, lParam) 2025my_post_msg (W32Msg * wmsg, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
2080 W32Msg * wmsg;
2081 HWND hwnd;
2082 UINT msg;
2083 WPARAM wParam;
2084 LPARAM lParam;
2085{ 2026{
2086 wmsg->msg.hwnd = hwnd; 2027 wmsg->msg.hwnd = hwnd;
2087 wmsg->msg.message = msg; 2028 wmsg->msg.message = msg;
@@ -2175,7 +2116,7 @@ record_keyup (unsigned int wparam, unsigned int lparam)
2175 it regains focus, be conservative and clear all modifiers since 2116 it regains focus, be conservative and clear all modifiers since
2176 we cannot reconstruct the left and right modifier state. */ 2117 we cannot reconstruct the left and right modifier state. */
2177static void 2118static void
2178reset_modifiers () 2119reset_modifiers (void)
2179{ 2120{
2180 SHORT ctrl, alt; 2121 SHORT ctrl, alt;
2181 2122
@@ -2222,7 +2163,7 @@ reset_modifiers ()
2222 modifier keys, we know that, if no modifiers are set, then neither 2163 modifier keys, we know that, if no modifiers are set, then neither
2223 the left or right modifier should be set. */ 2164 the left or right modifier should be set. */
2224static void 2165static void
2225sync_modifiers () 2166sync_modifiers (void)
2226{ 2167{
2227 if (!modifiers_recorded) 2168 if (!modifiers_recorded)
2228 return; 2169 return;
@@ -2308,7 +2249,7 @@ w32_key_to_modifier (int key)
2308} 2249}
2309 2250
2310static unsigned int 2251static unsigned int
2311w32_get_modifiers () 2252w32_get_modifiers (void)
2312{ 2253{
2313 return ((modifier_set (VK_SHIFT) ? shift_modifier : 0) | 2254 return ((modifier_set (VK_SHIFT) ? shift_modifier : 0) |
2314 (modifier_set (VK_CONTROL) ? ctrl_modifier : 0) | 2255 (modifier_set (VK_CONTROL) ? ctrl_modifier : 0) |
@@ -2325,7 +2266,7 @@ w32_get_modifiers ()
2325 and window input. */ 2266 and window input. */
2326 2267
2327static int 2268static int
2328construct_console_modifiers () 2269construct_console_modifiers (void)
2329{ 2270{
2330 int mods; 2271 int mods;
2331 2272
@@ -2397,8 +2338,7 @@ static Lisp_Object w32_grabbed_keys;
2397 combinations like Alt-Tab which are used by the system. */ 2338 combinations like Alt-Tab which are used by the system. */
2398 2339
2399static void 2340static void
2400register_hot_keys (hwnd) 2341register_hot_keys (HWND hwnd)
2401 HWND hwnd;
2402{ 2342{
2403 Lisp_Object keylist; 2343 Lisp_Object keylist;
2404 2344
@@ -2417,8 +2357,7 @@ register_hot_keys (hwnd)
2417} 2357}
2418 2358
2419static void 2359static void
2420unregister_hot_keys (hwnd) 2360unregister_hot_keys (HWND hwnd)
2421 HWND hwnd;
2422{ 2361{
2423 Lisp_Object keylist; 2362 Lisp_Object keylist;
2424 2363
@@ -2624,7 +2563,7 @@ complete_deferred_msg (HWND hwnd, UINT msg, LRESULT result)
2624} 2563}
2625 2564
2626static void 2565static void
2627cancel_all_deferred_msgs () 2566cancel_all_deferred_msgs (void)
2628{ 2567{
2629 deferred_msg * item; 2568 deferred_msg * item;
2630 2569
@@ -2669,7 +2608,7 @@ w32_msg_worker (void *arg)
2669} 2608}
2670 2609
2671static void 2610static void
2672signal_user_input () 2611signal_user_input (void)
2673{ 2612{
2674 /* Interrupt any lisp that wants to be interrupted by input. */ 2613 /* Interrupt any lisp that wants to be interrupted by input. */
2675 if (!NILP (Vthrow_on_input)) 2614 if (!NILP (Vthrow_on_input))
@@ -2687,13 +2626,9 @@ signal_user_input ()
2687 2626
2688 2627
2689static void 2628static void
2690post_character_message (hwnd, msg, wParam, lParam, modifiers) 2629post_character_message (HWND hwnd, UINT msg,
2691 HWND hwnd; 2630 WPARAM wParam, LPARAM lParam,
2692 UINT msg; 2631 DWORD modifiers)
2693 WPARAM wParam;
2694 LPARAM lParam;
2695 DWORD modifiers;
2696
2697{ 2632{
2698 W32Msg wmsg; 2633 W32Msg wmsg;
2699 2634
@@ -2753,11 +2688,7 @@ post_character_message (hwnd, msg, wParam, lParam, modifiers)
2753/* Main window procedure */ 2688/* Main window procedure */
2754 2689
2755LRESULT CALLBACK 2690LRESULT CALLBACK
2756w32_wnd_proc (hwnd, msg, wParam, lParam) 2691w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
2757 HWND hwnd;
2758 UINT msg;
2759 WPARAM wParam;
2760 LPARAM lParam;
2761{ 2692{
2762 struct frame *f; 2693 struct frame *f;
2763 struct w32_display_info *dpyinfo = &one_w32_display_info; 2694 struct w32_display_info *dpyinfo = &one_w32_display_info;
@@ -4007,8 +3938,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
4007} 3938}
4008 3939
4009static void 3940static void
4010my_create_window (f) 3941my_create_window (struct frame * f)
4011 struct frame * f;
4012{ 3942{
4013 MSG msg; 3943 MSG msg;
4014 3944
@@ -4023,8 +3953,7 @@ my_create_window (f)
4023 messages for the tooltip. Creating tooltips indirectly also creates 3953 messages for the tooltip. Creating tooltips indirectly also creates
4024 deadlocks when tooltips are created for menu items. */ 3954 deadlocks when tooltips are created for menu items. */
4025static void 3955static void
4026my_create_tip_window (f) 3956my_create_tip_window (struct frame *f)
4027 struct frame *f;
4028{ 3957{
4029 RECT rect; 3958 RECT rect;
4030 3959
@@ -4067,10 +3996,7 @@ my_create_tip_window (f)
4067/* Create and set up the w32 window for frame F. */ 3996/* Create and set up the w32 window for frame F. */
4068 3997
4069static void 3998static void
4070w32_window (f, window_prompting, minibuffer_only) 3999w32_window (struct frame *f, long window_prompting, int minibuffer_only)
4071 struct frame *f;
4072 long window_prompting;
4073 int minibuffer_only;
4074{ 4000{
4075 BLOCK_INPUT; 4001 BLOCK_INPUT;
4076 4002
@@ -4118,9 +4044,7 @@ w32_window (f, window_prompting, minibuffer_only)
4118 well. */ 4044 well. */
4119 4045
4120static void 4046static void
4121x_icon (f, parms) 4047x_icon (struct frame *f, Lisp_Object parms)
4122 struct frame *f;
4123 Lisp_Object parms;
4124{ 4048{
4125 Lisp_Object icon_x, icon_y; 4049 Lisp_Object icon_x, icon_y;
4126 struct w32_display_info *dpyinfo = &one_w32_display_info; 4050 struct w32_display_info *dpyinfo = &one_w32_display_info;
@@ -4159,8 +4083,7 @@ x_icon (f, parms)
4159 4083
4160 4084
4161static void 4085static void
4162x_make_gc (f) 4086x_make_gc (struct frame *f)
4163 struct frame *f;
4164{ 4087{
4165 XGCValues gc_values; 4088 XGCValues gc_values;
4166 4089
@@ -4193,8 +4116,7 @@ x_make_gc (f)
4193 constructed. */ 4116 constructed. */
4194 4117
4195static Lisp_Object 4118static Lisp_Object
4196unwind_create_frame (frame) 4119unwind_create_frame (Lisp_Object frame)
4197 Lisp_Object frame;
4198{ 4120{
4199 struct frame *f = XFRAME (frame); 4121 struct frame *f = XFRAME (frame);
4200 4122
@@ -4219,9 +4141,7 @@ unwind_create_frame (frame)
4219} 4141}
4220 4142
4221static void 4143static void
4222x_default_font_parameter (f, parms) 4144x_default_font_parameter (struct frame *f, Lisp_Object parms)
4223 struct frame *f;
4224 Lisp_Object parms;
4225{ 4145{
4226 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); 4146 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
4227 Lisp_Object font_param = x_get_arg (dpyinfo, parms, Qfont, NULL, NULL, 4147 Lisp_Object font_param = x_get_arg (dpyinfo, parms, Qfont, NULL, NULL,
@@ -4587,8 +4507,7 @@ This function is an internal primitive--use `make-frame' instead. */)
4587 display info directly because we're called from frame.c, which doesn't 4507 display info directly because we're called from frame.c, which doesn't
4588 know about that structure. */ 4508 know about that structure. */
4589Lisp_Object 4509Lisp_Object
4590x_get_focus_frame (frame) 4510x_get_focus_frame (struct frame *frame)
4591 struct frame *frame;
4592{ 4511{
4593 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (frame); 4512 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (frame);
4594 Lisp_Object xfocus; 4513 Lisp_Object xfocus;
@@ -4899,36 +4818,31 @@ If omitted or nil, that stands for the selected frame's display. */)
4899} 4818}
4900 4819
4901int 4820int
4902x_pixel_width (f) 4821x_pixel_width (register struct frame *f)
4903 register struct frame *f;
4904{ 4822{
4905 return FRAME_PIXEL_WIDTH (f); 4823 return FRAME_PIXEL_WIDTH (f);
4906} 4824}
4907 4825
4908int 4826int
4909x_pixel_height (f) 4827x_pixel_height (register struct frame *f)
4910 register struct frame *f;
4911{ 4828{
4912 return FRAME_PIXEL_HEIGHT (f); 4829 return FRAME_PIXEL_HEIGHT (f);
4913} 4830}
4914 4831
4915int 4832int
4916x_char_width (f) 4833x_char_width (register struct frame *f)
4917 register struct frame *f;
4918{ 4834{
4919 return FRAME_COLUMN_WIDTH (f); 4835 return FRAME_COLUMN_WIDTH (f);
4920} 4836}
4921 4837
4922int 4838int
4923x_char_height (f) 4839x_char_height (register struct frame *f)
4924 register struct frame *f;
4925{ 4840{
4926 return FRAME_LINE_HEIGHT (f); 4841 return FRAME_LINE_HEIGHT (f);
4927} 4842}
4928 4843
4929int 4844int
4930x_screen_planes (f) 4845x_screen_planes (register struct frame *f)
4931 register struct frame *f;
4932{ 4846{
4933 return FRAME_W32_DISPLAY_INFO (f)->n_planes; 4847 return FRAME_W32_DISPLAY_INFO (f)->n_planes;
4934} 4848}
@@ -4937,8 +4851,7 @@ x_screen_planes (f)
4937 Open a new connection if necessary. */ 4851 Open a new connection if necessary. */
4938 4852
4939struct w32_display_info * 4853struct w32_display_info *
4940x_display_info_for_name (name) 4854x_display_info_for_name (Lisp_Object name)
4941 Lisp_Object name;
4942{ 4855{
4943 Lisp_Object names; 4856 Lisp_Object names;
4944 struct w32_display_info *dpyinfo; 4857 struct w32_display_info *dpyinfo;
@@ -5253,7 +5166,7 @@ extern Lisp_Object Vhourglass_delay;
5253 xdisp.c could be used. */ 5166 xdisp.c could be used. */
5254 5167
5255int 5168int
5256hourglass_started () 5169hourglass_started (void)
5257{ 5170{
5258 return hourglass_shown_p || hourglass_timer; 5171 return hourglass_shown_p || hourglass_timer;
5259} 5172}
@@ -5261,7 +5174,7 @@ hourglass_started ()
5261/* Cancel a currently active hourglass timer, and start a new one. */ 5174/* Cancel a currently active hourglass timer, and start a new one. */
5262 5175
5263void 5176void
5264start_hourglass () 5177start_hourglass (void)
5265{ 5178{
5266 DWORD delay; 5179 DWORD delay;
5267 int secs, msecs = 0; 5180 int secs, msecs = 0;
@@ -5297,7 +5210,7 @@ start_hourglass ()
5297 cursor if shown. */ 5210 cursor if shown. */
5298 5211
5299void 5212void
5300cancel_hourglass () 5213cancel_hourglass (void)
5301{ 5214{
5302 if (hourglass_timer) 5215 if (hourglass_timer)
5303 { 5216 {
@@ -5316,8 +5229,7 @@ cancel_hourglass ()
5316 to indicate that an hourglass cursor is shown. */ 5229 to indicate that an hourglass cursor is shown. */
5317 5230
5318static void 5231static void
5319w32_show_hourglass (f) 5232w32_show_hourglass (struct frame *f)
5320 struct frame *f;
5321{ 5233{
5322 if (!hourglass_shown_p) 5234 if (!hourglass_shown_p)
5323 { 5235 {
@@ -5332,7 +5244,7 @@ w32_show_hourglass (f)
5332/* Hide the hourglass cursor on all frames, if it is currently shown. */ 5244/* Hide the hourglass cursor on all frames, if it is currently shown. */
5333 5245
5334static void 5246static void
5335w32_hide_hourglass () 5247w32_hide_hourglass (void)
5336{ 5248{
5337 if (hourglass_shown_p) 5249 if (hourglass_shown_p)
5338 { 5250 {
@@ -5386,8 +5298,7 @@ Lisp_Object Vx_max_tooltip_size;
5386 5298
5387 5299
5388static Lisp_Object 5300static Lisp_Object
5389unwind_create_tip_frame (frame) 5301unwind_create_tip_frame (Lisp_Object frame)
5390 Lisp_Object frame;
5391{ 5302{
5392 Lisp_Object deleted; 5303 Lisp_Object deleted;
5393 5304
@@ -5412,9 +5323,8 @@ unwind_create_tip_frame (frame)
5412 when this happens. */ 5323 when this happens. */
5413 5324
5414static Lisp_Object 5325static Lisp_Object
5415x_create_tip_frame (dpyinfo, parms, text) 5326x_create_tip_frame (struct w32_display_info *dpyinfo,
5416 struct w32_display_info *dpyinfo; 5327 Lisp_Object parms, Lisp_Object text)
5417 Lisp_Object parms, text;
5418{ 5328{
5419 struct frame *f; 5329 struct frame *f;
5420 Lisp_Object frame, tem; 5330 Lisp_Object frame, tem;
@@ -5654,11 +5564,9 @@ x_create_tip_frame (dpyinfo, parms, text)
5654 the display in *ROOT_X, and *ROOT_Y. */ 5564 the display in *ROOT_X, and *ROOT_Y. */
5655 5565
5656static void 5566static void
5657compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) 5567compute_tip_xy (struct frame *f,
5658 struct frame *f; 5568 Lisp_Object parms, Lisp_Object dx, Lisp_Object dy,
5659 Lisp_Object parms, dx, dy; 5569 int width, int height, int *root_x, int *root_y)
5660 int width, height;
5661 int *root_x, *root_y;
5662{ 5570{
5663 Lisp_Object left, top; 5571 Lisp_Object left, top;
5664 int min_x, min_y, max_x, max_y; 5572 int min_x, min_y, max_x, max_y;
@@ -6037,11 +5945,7 @@ extern Lisp_Object Qfile_name_history;
6037 allows us to work around the fact that the standard Open File 5945 allows us to work around the fact that the standard Open File
6038 dialog does not support directories. */ 5946 dialog does not support directories. */
6039UINT CALLBACK 5947UINT CALLBACK
6040file_dialog_callback (hwnd, msg, wParam, lParam) 5948file_dialog_callback (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
6041 HWND hwnd;
6042 UINT msg;
6043 WPARAM wParam;
6044 LPARAM lParam;
6045{ 5949{
6046 if (msg == WM_NOTIFY) 5950 if (msg == WM_NOTIFY)
6047 { 5951 {
@@ -6395,8 +6299,7 @@ lookup_vk_code (char *key)
6395/* Convert a one-element vector style key sequence to a hot key 6299/* Convert a one-element vector style key sequence to a hot key
6396 definition. */ 6300 definition. */
6397static Lisp_Object 6301static Lisp_Object
6398w32_parse_hot_key (key) 6302w32_parse_hot_key (Lisp_Object key)
6399 Lisp_Object key;
6400{ 6303{
6401 /* Copied from Fdefine_key and store_in_keymap. */ 6304 /* Copied from Fdefine_key and store_in_keymap. */
6402 register Lisp_Object c; 6305 register Lisp_Object c;
@@ -6625,7 +6528,7 @@ DEFUN ("w32-window-exists-p", Fw32_window_exists_p, Sw32_window_exists_p,
6625 6528
6626This is a direct interface to the Windows API FindWindow function. */) 6529This is a direct interface to the Windows API FindWindow function. */)
6627 (class, name) 6530 (class, name)
6628Lisp_Object class, name; 6531 Lisp_Object class, name;
6629{ 6532{
6630 HWND hnd; 6533 HWND hnd;
6631 6534
@@ -6963,7 +6866,7 @@ frame_parm_handler w32_frame_parm_handlers[] =
6963}; 6866};
6964 6867
6965void 6868void
6966syms_of_w32fns () 6869syms_of_w32fns (void)
6967{ 6870{
6968 globals_of_w32fns (); 6871 globals_of_w32fns ();
6969 /* This is zero if not using MS-Windows. */ 6872 /* This is zero if not using MS-Windows. */
@@ -7320,7 +7223,7 @@ only be necessary if the default setting causes problems. */);
7320 is non zero. 7223 is non zero.
7321 */ 7224 */
7322void 7225void
7323globals_of_w32fns () 7226globals_of_w32fns (void)
7324{ 7227{
7325 HMODULE user32_lib = GetModuleHandle ("user32.dll"); 7228 HMODULE user32_lib = GetModuleHandle ("user32.dll");
7326 /* 7229 /*
@@ -7363,7 +7266,7 @@ globals_of_w32fns ()
7363#undef abort 7266#undef abort
7364 7267
7365void 7268void
7366w32_abort () 7269w32_abort (void)
7367{ 7270{
7368 int button; 7271 int button;
7369 button = MessageBox (NULL, 7272 button = MessageBox (NULL,
@@ -7391,7 +7294,7 @@ w32_abort ()
7391 7294
7392/* For convenience when debugging. */ 7295/* For convenience when debugging. */
7393int 7296int
7394w32_last_error () 7297w32_last_error (void)
7395{ 7298{
7396 return GetLastError (); 7299 return GetLastError ();
7397} 7300}
diff --git a/src/w32font.c b/src/w32font.c
index ab56eb9e4d2..d86fb3b792c 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -153,8 +153,7 @@ static void list_all_matching_fonts (struct font_callback_data *);
153 153
154 154
155static int 155static int
156memq_no_quit (elt, list) 156memq_no_quit (Lisp_Object elt, Lisp_Object list)
157 Lisp_Object elt, list;
158{ 157{
159 while (CONSP (list) && ! EQ (XCAR (list), elt)) 158 while (CONSP (list) && ! EQ (XCAR (list), elt))
160 list = XCDR (list); 159 list = XCDR (list);
@@ -162,8 +161,7 @@ memq_no_quit (elt, list)
162} 161}
163 162
164Lisp_Object 163Lisp_Object
165intern_font_name (string) 164intern_font_name (char * string)
166 char * string;
167{ 165{
168 Lisp_Object obarray, tem, str; 166 Lisp_Object obarray, tem, str;
169 int len; 167 int len;
@@ -185,8 +183,7 @@ intern_font_name (string)
185 Return a cache of font-entities on FRAME. The cache must be a 183 Return a cache of font-entities on FRAME. The cache must be a
186 cons whose cdr part is the actual cache area. */ 184 cons whose cdr part is the actual cache area. */
187Lisp_Object 185Lisp_Object
188w32font_get_cache (f) 186w32font_get_cache (FRAME_PTR f)
189 FRAME_PTR f;
190{ 187{
191 struct w32_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 188 struct w32_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
192 189
@@ -198,8 +195,7 @@ w32font_get_cache (f)
198 is a vector of font-entities. This is the sole API that 195 is a vector of font-entities. This is the sole API that
199 allocates font-entities. */ 196 allocates font-entities. */
200static Lisp_Object 197static Lisp_Object
201w32font_list (frame, font_spec) 198w32font_list (Lisp_Object frame, Lisp_Object font_spec)
202 Lisp_Object frame, font_spec;
203{ 199{
204 Lisp_Object fonts = w32font_list_internal (frame, font_spec, 0); 200 Lisp_Object fonts = w32font_list_internal (frame, font_spec, 0);
205 FONT_ADD_LOG ("w32font-list", font_spec, fonts); 201 FONT_ADD_LOG ("w32font-list", font_spec, fonts);
@@ -211,8 +207,7 @@ w32font_list (frame, font_spec)
211 FRAME. The closeness is detemined by the font backend, thus 207 FRAME. The closeness is detemined by the font backend, thus
212 `face-font-selection-order' is ignored here. */ 208 `face-font-selection-order' is ignored here. */
213static Lisp_Object 209static Lisp_Object
214w32font_match (frame, font_spec) 210w32font_match (Lisp_Object frame, Lisp_Object font_spec)
215 Lisp_Object frame, font_spec;
216{ 211{
217 Lisp_Object entity = w32font_match_internal (frame, font_spec, 0); 212 Lisp_Object entity = w32font_match_internal (frame, font_spec, 0);
218 FONT_ADD_LOG ("w32font-match", font_spec, entity); 213 FONT_ADD_LOG ("w32font-match", font_spec, entity);
@@ -223,8 +218,7 @@ w32font_match (frame, font_spec)
223 List available families. The value is a list of family names 218 List available families. The value is a list of family names
224 (symbols). */ 219 (symbols). */
225static Lisp_Object 220static Lisp_Object
226w32font_list_family (frame) 221w32font_list_family (Lisp_Object frame)
227 Lisp_Object frame;
228{ 222{
229 Lisp_Object list = Qnil; 223 Lisp_Object list = Qnil;
230 LOGFONT font_match_pattern; 224 LOGFONT font_match_pattern;
@@ -248,10 +242,7 @@ w32font_list_family (frame)
248 Open a font specified by FONT_ENTITY on frame F. 242 Open a font specified by FONT_ENTITY on frame F.
249 If the font is scalable, open it with PIXEL_SIZE. */ 243 If the font is scalable, open it with PIXEL_SIZE. */
250static Lisp_Object 244static Lisp_Object
251w32font_open (f, font_entity, pixel_size) 245w32font_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size)
252 FRAME_PTR f;
253 Lisp_Object font_entity;
254 int pixel_size;
255{ 246{
256 Lisp_Object font_object 247 Lisp_Object font_object
257 = font_make_object (VECSIZE (struct w32font_info), 248 = font_make_object (VECSIZE (struct w32font_info),
@@ -275,9 +266,7 @@ w32font_open (f, font_entity, pixel_size)
275/* w32 implementation of close for font_backend. 266/* w32 implementation of close for font_backend.
276 Close FONT on frame F. */ 267 Close FONT on frame F. */
277void 268void
278w32font_close (f, font) 269w32font_close (FRAME_PTR f, struct font *font)
279 FRAME_PTR f;
280 struct font *font;
281{ 270{
282 int i; 271 int i;
283 struct w32font_info *w32_font = (struct w32font_info *) font; 272 struct w32font_info *w32_font = (struct w32font_info *) font;
@@ -303,9 +292,7 @@ w32font_close (f, font)
303 return 1. If not, return 0. If a font must be opened to check 292 return 1. If not, return 0. If a font must be opened to check
304 it, return -1. */ 293 it, return -1. */
305int 294int
306w32font_has_char (entity, c) 295w32font_has_char (Lisp_Object entity, int c)
307 Lisp_Object entity;
308 int c;
309{ 296{
310 /* We can't be certain about which characters a font will support until 297 /* We can't be certain about which characters a font will support until
311 we open it. Checking the scripts that the font supports turns out 298 we open it. Checking the scripts that the font supports turns out
@@ -354,9 +341,7 @@ w32font_has_char (entity, c)
354 which characters are not supported by the font. 341 which characters are not supported by the font.
355 */ 342 */
356static unsigned 343static unsigned
357w32font_encode_char (font, c) 344w32font_encode_char (struct font *font, int c)
358 struct font *font;
359 int c;
360{ 345{
361 struct w32font_info * w32_font = (struct w32font_info *)font; 346 struct w32font_info * w32_font = (struct w32font_info *)font;
362 347
@@ -373,11 +358,8 @@ w32font_encode_char (font, c)
373 CODE (length NGLYPHS). Apparently metrics can be NULL, in this 358 CODE (length NGLYPHS). Apparently metrics can be NULL, in this
374 case just return the overall width. */ 359 case just return the overall width. */
375int 360int
376w32font_text_extents (font, code, nglyphs, metrics) 361w32font_text_extents (struct font *font, unsigned *code,
377 struct font *font; 362 int nglyphs, struct font_metrics *metrics)
378 unsigned *code;
379 int nglyphs;
380 struct font_metrics *metrics;
381{ 363{
382 int i; 364 int i;
383 HFONT old_font = NULL; 365 HFONT old_font = NULL;
@@ -552,9 +534,8 @@ w32font_text_extents (font, code, nglyphs, metrics)
552*/ 534*/
553 535
554int 536int
555w32font_draw (s, from, to, x, y, with_background) 537w32font_draw (struct glyph_string *s, int from, int to,
556 struct glyph_string *s; 538 int x, int y, int with_background)
557 int from, to, x, y, with_background;
558{ 539{
559 UINT options; 540 UINT options;
560 HRGN orig_clip = NULL; 541 HRGN orig_clip = NULL;
@@ -715,9 +696,7 @@ w32font_otf_drive (struct font *font, Lisp_Object features,
715 Additional parameter opentype_only restricts the returned fonts to 696 Additional parameter opentype_only restricts the returned fonts to
716 opentype fonts, which can be used with the Uniscribe backend. */ 697 opentype fonts, which can be used with the Uniscribe backend. */
717Lisp_Object 698Lisp_Object
718w32font_list_internal (frame, font_spec, opentype_only) 699w32font_list_internal (Lisp_Object frame, Lisp_Object font_spec, int opentype_only)
719 Lisp_Object frame, font_spec;
720 int opentype_only;
721{ 700{
722 struct font_callback_data match_data; 701 struct font_callback_data match_data;
723 HDC dc; 702 HDC dc;
@@ -770,9 +749,7 @@ w32font_list_internal (frame, font_spec, opentype_only)
770 Additional parameter opentype_only restricts the returned fonts to 749 Additional parameter opentype_only restricts the returned fonts to
771 opentype fonts, which can be used with the Uniscribe backend. */ 750 opentype fonts, which can be used with the Uniscribe backend. */
772Lisp_Object 751Lisp_Object
773w32font_match_internal (frame, font_spec, opentype_only) 752w32font_match_internal (Lisp_Object frame, Lisp_Object font_spec, int opentype_only)
774 Lisp_Object frame, font_spec;
775 int opentype_only;
776{ 753{
777 struct font_callback_data match_data; 754 struct font_callback_data match_data;
778 HDC dc; 755 HDC dc;
@@ -800,11 +777,8 @@ w32font_match_internal (frame, font_spec, opentype_only)
800} 777}
801 778
802int 779int
803w32font_open_internal (f, font_entity, pixel_size, font_object) 780w32font_open_internal (FRAME_PTR f, Lisp_Object font_entity,
804 FRAME_PTR f; 781 int pixel_size, Lisp_Object font_object)
805 Lisp_Object font_entity;
806 int pixel_size;
807 Lisp_Object font_object;
808{ 782{
809 int len, size, i; 783 int len, size, i;
810 LOGFONT logfont; 784 LOGFONT logfont;
@@ -951,11 +925,9 @@ w32font_open_internal (f, font_entity, pixel_size, font_object)
951/* Callback function for EnumFontFamiliesEx. 925/* Callback function for EnumFontFamiliesEx.
952 * Adds the name of a font to a Lisp list (passed in as the lParam arg). */ 926 * Adds the name of a font to a Lisp list (passed in as the lParam arg). */
953static int CALLBACK 927static int CALLBACK
954add_font_name_to_list (logical_font, physical_font, font_type, list_object) 928add_font_name_to_list (ENUMLOGFONTEX *logical_font,
955 ENUMLOGFONTEX *logical_font; 929 NEWTEXTMETRICEX *physical_font,
956 NEWTEXTMETRICEX *physical_font; 930 DWORD font_type, LPARAM list_object)
957 DWORD font_type;
958 LPARAM list_object;
959{ 931{
960 Lisp_Object* list = (Lisp_Object *) list_object; 932 Lisp_Object* list = (Lisp_Object *) list_object;
961 Lisp_Object family; 933 Lisp_Object family;
@@ -976,14 +948,12 @@ static int w32_encode_weight (int);
976 948
977/* Convert an enumerated Windows font to an Emacs font entity. */ 949/* Convert an enumerated Windows font to an Emacs font entity. */
978static Lisp_Object 950static Lisp_Object
979w32_enumfont_pattern_entity (frame, logical_font, physical_font, 951w32_enumfont_pattern_entity (Lisp_Object frame,
980 font_type, requested_font, backend) 952 ENUMLOGFONTEX *logical_font,
981 Lisp_Object frame; 953 NEWTEXTMETRICEX *physical_font,
982 ENUMLOGFONTEX *logical_font; 954 DWORD font_type,
983 NEWTEXTMETRICEX *physical_font; 955 LOGFONT *requested_font,
984 DWORD font_type; 956 Lisp_Object backend)
985 LOGFONT *requested_font;
986 Lisp_Object backend;
987{ 957{
988 Lisp_Object entity, tem; 958 Lisp_Object entity, tem;
989 LOGFONT *lf = (LOGFONT*) logical_font; 959 LOGFONT *lf = (LOGFONT*) logical_font;
@@ -1107,8 +1077,7 @@ w32_generic_family (Lisp_Object name)
1107} 1077}
1108 1078
1109static int 1079static int
1110logfonts_match (font, pattern) 1080logfonts_match (LOGFONT *font, LOGFONT *pattern)
1111 LOGFONT *font, *pattern;
1112{ 1081{
1113 /* Only check height for raster fonts. */ 1082 /* Only check height for raster fonts. */
1114 if (pattern->lfHeight && font->lfOutPrecision == OUT_STRING_PRECIS 1083 if (pattern->lfHeight && font->lfOutPrecision == OUT_STRING_PRECIS
@@ -1132,12 +1101,9 @@ logfonts_match (font, pattern)
1132#define CSB_CHINESE ((1 << 18) | (1 << 20)) 1101#define CSB_CHINESE ((1 << 18) | (1 << 20))
1133 1102
1134static int 1103static int
1135font_matches_spec (type, font, spec, backend, logfont) 1104font_matches_spec (DWORD type, NEWTEXTMETRICEX *font,
1136 DWORD type; 1105 Lisp_Object spec, Lisp_Object backend,
1137 NEWTEXTMETRICEX *font; 1106 LOGFONT *logfont)
1138 Lisp_Object spec;
1139 Lisp_Object backend;
1140 LOGFONT *logfont;
1141{ 1107{
1142 Lisp_Object extra, val; 1108 Lisp_Object extra, val;
1143 1109
@@ -1322,9 +1288,7 @@ font_matches_spec (type, font, spec, backend, logfont)
1322} 1288}
1323 1289
1324static int 1290static int
1325w32font_coverage_ok (coverage, charset) 1291w32font_coverage_ok (FONTSIGNATURE * coverage, BYTE charset)
1326 FONTSIGNATURE * coverage;
1327 BYTE charset;
1328{ 1292{
1329 DWORD subrange1 = coverage->fsUsb[1]; 1293 DWORD subrange1 = coverage->fsUsb[1];
1330 1294
@@ -1350,9 +1314,7 @@ w32font_coverage_ok (coverage, charset)
1350 1314
1351 1315
1352static int 1316static int
1353check_face_name (font, full_name) 1317check_face_name (LOGFONT *font, char *full_name)
1354 LOGFONT *font;
1355 char *full_name;
1356{ 1318{
1357 char full_iname[LF_FULLFACESIZE+1]; 1319 char full_iname[LF_FULLFACESIZE+1];
1358 1320
@@ -1397,11 +1359,9 @@ check_face_name (font, full_name)
1397 * and the list to which the fonts are added are passed in via the 1359 * and the list to which the fonts are added are passed in via the
1398 * lparam argument, in the form of a font_callback_data struct. */ 1360 * lparam argument, in the form of a font_callback_data struct. */
1399static int CALLBACK 1361static int CALLBACK
1400add_font_entity_to_list (logical_font, physical_font, font_type, lParam) 1362add_font_entity_to_list (ENUMLOGFONTEX *logical_font,
1401 ENUMLOGFONTEX *logical_font; 1363 NEWTEXTMETRICEX *physical_font,
1402 NEWTEXTMETRICEX *physical_font; 1364 DWORD font_type, LPARAM lParam)
1403 DWORD font_type;
1404 LPARAM lParam;
1405{ 1365{
1406 struct font_callback_data *match_data 1366 struct font_callback_data *match_data
1407 = (struct font_callback_data *) lParam; 1367 = (struct font_callback_data *) lParam;
@@ -1510,11 +1470,9 @@ add_font_entity_to_list (logical_font, physical_font, font_type, lParam)
1510/* Callback function for EnumFontFamiliesEx. 1470/* Callback function for EnumFontFamiliesEx.
1511 * Terminates the search once we have a match. */ 1471 * Terminates the search once we have a match. */
1512static int CALLBACK 1472static int CALLBACK
1513add_one_font_entity_to_list (logical_font, physical_font, font_type, lParam) 1473add_one_font_entity_to_list (ENUMLOGFONTEX *logical_font,
1514 ENUMLOGFONTEX *logical_font; 1474 NEWTEXTMETRICEX *physical_font,
1515 NEWTEXTMETRICEX *physical_font; 1475 DWORD font_type, LPARAM lParam)
1516 DWORD font_type;
1517 LPARAM lParam;
1518{ 1476{
1519 struct font_callback_data *match_data 1477 struct font_callback_data *match_data
1520 = (struct font_callback_data *) lParam; 1478 = (struct font_callback_data *) lParam;
@@ -1526,8 +1484,7 @@ add_one_font_entity_to_list (logical_font, physical_font, font_type, lParam)
1526 1484
1527/* Old function to convert from x to w32 charset, from w32fns.c. */ 1485/* Old function to convert from x to w32 charset, from w32fns.c. */
1528static LONG 1486static LONG
1529x_to_w32_charset (lpcs) 1487x_to_w32_charset (char * lpcs)
1530 char * lpcs;
1531{ 1488{
1532 Lisp_Object this_entry, w32_charset; 1489 Lisp_Object this_entry, w32_charset;
1533 char *charset; 1490 char *charset;
@@ -1609,8 +1566,7 @@ x_to_w32_charset (lpcs)
1609 1566
1610/* Convert a Lisp font registry (symbol) to a windows charset. */ 1567/* Convert a Lisp font registry (symbol) to a windows charset. */
1611static LONG 1568static LONG
1612registry_to_w32_charset (charset) 1569registry_to_w32_charset (Lisp_Object charset)
1613 Lisp_Object charset;
1614{ 1570{
1615 if (EQ (charset, Qiso10646_1) || EQ (charset, Qunicode_bmp) 1571 if (EQ (charset, Qiso10646_1) || EQ (charset, Qunicode_bmp)
1616 || EQ (charset, Qunicode_sip)) 1572 || EQ (charset, Qunicode_sip))
@@ -1625,9 +1581,7 @@ registry_to_w32_charset (charset)
1625 1581
1626/* Old function to convert from w32 to x charset, from w32fns.c. */ 1582/* Old function to convert from w32 to x charset, from w32fns.c. */
1627static char * 1583static char *
1628w32_to_x_charset (fncharset, matching) 1584w32_to_x_charset (int fncharset, char *matching)
1629 int fncharset;
1630 char *matching;
1631{ 1585{
1632 static char buf[32]; 1586 static char buf[32];
1633 Lisp_Object charset_type; 1587 Lisp_Object charset_type;
@@ -1821,9 +1775,7 @@ w32_to_x_charset (fncharset, matching)
1821} 1775}
1822 1776
1823static Lisp_Object 1777static Lisp_Object
1824w32_registry (w32_charset, font_type) 1778w32_registry (LONG w32_charset, DWORD font_type)
1825 LONG w32_charset;
1826 DWORD font_type;
1827{ 1779{
1828 char *charset; 1780 char *charset;
1829 1781
@@ -1837,8 +1789,7 @@ w32_registry (w32_charset, font_type)
1837} 1789}
1838 1790
1839static int 1791static int
1840w32_decode_weight (fnweight) 1792w32_decode_weight (int fnweight)
1841 int fnweight;
1842{ 1793{
1843 if (fnweight >= FW_HEAVY) return 210; 1794 if (fnweight >= FW_HEAVY) return 210;
1844 if (fnweight >= FW_EXTRABOLD) return 205; 1795 if (fnweight >= FW_EXTRABOLD) return 205;
@@ -1852,8 +1803,7 @@ w32_decode_weight (fnweight)
1852} 1803}
1853 1804
1854static int 1805static int
1855w32_encode_weight (n) 1806w32_encode_weight (int n)
1856 int n;
1857{ 1807{
1858 if (n >= 210) return FW_HEAVY; 1808 if (n >= 210) return FW_HEAVY;
1859 if (n >= 205) return FW_EXTRABOLD; 1809 if (n >= 205) return FW_EXTRABOLD;
@@ -1869,8 +1819,7 @@ w32_encode_weight (n)
1869/* Convert a Windows font weight into one of the weights supported 1819/* Convert a Windows font weight into one of the weights supported
1870 by fontconfig (see font.c:font_parse_fcname). */ 1820 by fontconfig (see font.c:font_parse_fcname). */
1871static Lisp_Object 1821static Lisp_Object
1872w32_to_fc_weight (n) 1822w32_to_fc_weight (int n)
1873 int n;
1874{ 1823{
1875 if (n >= FW_EXTRABOLD) return intern ("black"); 1824 if (n >= FW_EXTRABOLD) return intern ("black");
1876 if (n >= FW_BOLD) return intern ("bold"); 1825 if (n >= FW_BOLD) return intern ("bold");
@@ -1881,10 +1830,7 @@ w32_to_fc_weight (n)
1881 1830
1882/* Fill in all the available details of LOGFONT from FONT_SPEC. */ 1831/* Fill in all the available details of LOGFONT from FONT_SPEC. */
1883static void 1832static void
1884fill_in_logfont (f, logfont, font_spec) 1833fill_in_logfont (FRAME_PTR f, LOGFONT *logfont, Lisp_Object font_spec)
1885 FRAME_PTR f;
1886 LOGFONT *logfont;
1887 Lisp_Object font_spec;
1888{ 1834{
1889 Lisp_Object tmp, extra; 1835 Lisp_Object tmp, extra;
1890 int dpi = FRAME_W32_DISPLAY_INFO (f)->resy; 1836 int dpi = FRAME_W32_DISPLAY_INFO (f)->resy;
@@ -2029,8 +1975,7 @@ fill_in_logfont (f, logfont, font_spec)
2029} 1975}
2030 1976
2031static void 1977static void
2032list_all_matching_fonts (match_data) 1978list_all_matching_fonts (struct font_callback_data *match_data)
2033 struct font_callback_data *match_data;
2034{ 1979{
2035 HDC dc; 1980 HDC dc;
2036 Lisp_Object families = w32font_list_family (match_data->frame); 1981 Lisp_Object families = w32font_list_family (match_data->frame);
@@ -2066,8 +2011,7 @@ list_all_matching_fonts (match_data)
2066} 2011}
2067 2012
2068static Lisp_Object 2013static Lisp_Object
2069lispy_antialias_type (type) 2014lispy_antialias_type (BYTE type)
2070 BYTE type;
2071{ 2015{
2072 Lisp_Object lispy; 2016 Lisp_Object lispy;
2073 2017
@@ -2094,8 +2038,7 @@ lispy_antialias_type (type)
2094 2038
2095/* Convert antialiasing symbols to lfQuality */ 2039/* Convert antialiasing symbols to lfQuality */
2096static BYTE 2040static BYTE
2097w32_antialias_type (type) 2041w32_antialias_type (Lisp_Object type)
2098 Lisp_Object type;
2099{ 2042{
2100 if (EQ (type, Qnone)) 2043 if (EQ (type, Qnone))
2101 return NONANTIALIASED_QUALITY; 2044 return NONANTIALIASED_QUALITY;
@@ -2241,12 +2184,8 @@ font_supported_scripts (FONTSIGNATURE * sig)
2241 The full name is in fcname format, with weight, slant and antialiasing 2184 The full name is in fcname format, with weight, slant and antialiasing
2242 specified if they are not "normal". */ 2185 specified if they are not "normal". */
2243static int 2186static int
2244w32font_full_name (font, font_obj, pixel_size, name, nbytes) 2187w32font_full_name (LOGFONT * font, Lisp_Object font_obj,
2245 LOGFONT * font; 2188 int pixel_size, char *name, int nbytes)
2246 Lisp_Object font_obj;
2247 int pixel_size;
2248 char *name;
2249 int nbytes;
2250{ 2189{
2251 int len, height, outline; 2190 int len, height, outline;
2252 char *p; 2191 char *p;
@@ -2317,11 +2256,8 @@ w32font_full_name (font, font_obj, pixel_size, name, nbytes)
2317 is written. If the buffer is not large enough to contain the name, 2256 is written. If the buffer is not large enough to contain the name,
2318 the function returns -1, otherwise it returns the number of bytes 2257 the function returns -1, otherwise it returns the number of bytes
2319 written to FCNAME. */ 2258 written to FCNAME. */
2320static int logfont_to_fcname(font, pointsize, fcname, size) 2259static int
2321 LOGFONT* font; 2260logfont_to_fcname (LOGFONT* font, int pointsize, char *fcname, int size)
2322 int pointsize;
2323 char *fcname;
2324 int size;
2325{ 2261{
2326 int len, height; 2262 int len, height;
2327 char *p = fcname; 2263 char *p = fcname;
@@ -2360,11 +2296,8 @@ static int logfont_to_fcname(font, pointsize, fcname, size)
2360} 2296}
2361 2297
2362static void 2298static void
2363compute_metrics (dc, w32_font, code, metrics) 2299compute_metrics (HDC dc, struct w32font_info *w32_font, unsigned int code,
2364 HDC dc; 2300 struct w32_metric_cache *metrics)
2365 struct w32font_info *w32_font;
2366 unsigned int code;
2367 struct w32_metric_cache *metrics;
2368{ 2301{
2369 GLYPHMETRICS gm; 2302 GLYPHMETRICS gm;
2370 MAT2 transform; 2303 MAT2 transform;
@@ -2482,7 +2415,7 @@ struct font_driver w32font_driver =
2482/* Initialize state that does not change between invocations. This is only 2415/* Initialize state that does not change between invocations. This is only
2483 called when Emacs is dumped. */ 2416 called when Emacs is dumped. */
2484void 2417void
2485syms_of_w32font () 2418syms_of_w32font (void)
2486{ 2419{
2487 DEFSYM (Qgdi, "gdi"); 2420 DEFSYM (Qgdi, "gdi");
2488 DEFSYM (Quniscribe, "uniscribe"); 2421 DEFSYM (Quniscribe, "uniscribe");
diff --git a/src/w32heap.c b/src/w32heap.c
index 440388c6eab..e307694a563 100644
--- a/src/w32heap.c
+++ b/src/w32heap.c
@@ -222,7 +222,7 @@ sbrk (unsigned long increment)
222 was allocated by something else; GNU malloc detects when there is a 222 was allocated by something else; GNU malloc detects when there is a
223 jump in the sbrk values, and starts a new heap block. */ 223 jump in the sbrk values, and starts a new heap block. */
224void 224void
225init_heap () 225init_heap (void)
226{ 226{
227 PIMAGE_DOS_HEADER dos_header; 227 PIMAGE_DOS_HEADER dos_header;
228 PIMAGE_NT_HEADERS nt_header; 228 PIMAGE_NT_HEADERS nt_header;
diff --git a/src/w32inevt.c b/src/w32inevt.c
index 864b3b3f0bb..aa9fe09d857 100644
--- a/src/w32inevt.c
+++ b/src/w32inevt.c
@@ -684,7 +684,7 @@ resize_event (WINDOW_BUFFER_SIZE_RECORD *event)
684} 684}
685 685
686static void 686static void
687maybe_generate_resize_event () 687maybe_generate_resize_event (void)
688{ 688{
689 CONSOLE_SCREEN_BUFFER_INFO info; 689 CONSOLE_SCREEN_BUFFER_INFO info;
690 FRAME_PTR f = get_frame (); 690 FRAME_PTR f = get_frame ();
diff --git a/src/w32menu.c b/src/w32menu.c
index 2c8a5308d3b..37be0bd028d 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -59,8 +59,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
59 59
60HMENU current_popup_menu; 60HMENU current_popup_menu;
61 61
62void syms_of_w32menu (); 62void syms_of_w32menu (void);
63void globals_of_w32menu (); 63void globals_of_w32menu (void);
64 64
65typedef BOOL (WINAPI * GetMenuItemInfoA_Proc) ( 65typedef BOOL (WINAPI * GetMenuItemInfoA_Proc) (
66 IN HMENU, 66 IN HMENU,
@@ -116,8 +116,7 @@ int pending_menu_activation;
116 ID, or 0 if none. */ 116 ID, or 0 if none. */
117 117
118static struct frame * 118static struct frame *
119menubar_id_to_frame (id) 119menubar_id_to_frame (HMENU id)
120 HMENU id;
121{ 120{
122 Lisp_Object tail, frame; 121 Lisp_Object tail, frame;
123 FRAME_PTR f; 122 FRAME_PTR f;
@@ -276,8 +275,7 @@ otherwise it is "Question". */)
276 This way we can safely execute Lisp code. */ 275 This way we can safely execute Lisp code. */
277 276
278void 277void
279x_activate_menubar (f) 278x_activate_menubar (FRAME_PTR f)
280 FRAME_PTR f;
281{ 279{
282 set_frame_menubar (f, 0, 1); 280 set_frame_menubar (f, 0, 1);
283 281
@@ -386,10 +384,7 @@ menubar_selection_callback (FRAME_PTR f, void * client_data)
386 it is set the first time this is called, from initialize_frame_menubar. */ 384 it is set the first time this is called, from initialize_frame_menubar. */
387 385
388void 386void
389set_frame_menubar (f, first_time, deep_p) 387set_frame_menubar (FRAME_PTR f, int first_time, int deep_p)
390 FRAME_PTR f;
391 int first_time;
392 int deep_p;
393{ 388{
394 HMENU menubar_widget = f->output_data.w32->menubar_widget; 389 HMENU menubar_widget = f->output_data.w32->menubar_widget;
395 Lisp_Object items; 390 Lisp_Object items;
@@ -648,8 +643,7 @@ set_frame_menubar (f, first_time, deep_p)
648 is visible. */ 643 is visible. */
649 644
650void 645void
651initialize_frame_menubar (f) 646initialize_frame_menubar (FRAME_PTR f)
652 FRAME_PTR f;
653{ 647{
654 /* This function is called before the first chance to redisplay 648 /* This function is called before the first chance to redisplay
655 the frame. It has to be, so the frame will have the right size. */ 649 the frame. It has to be, so the frame will have the right size. */
@@ -661,8 +655,7 @@ initialize_frame_menubar (f)
661 This is used when deleting a frame, and when turning off the menu bar. */ 655 This is used when deleting a frame, and when turning off the menu bar. */
662 656
663void 657void
664free_frame_menubar (f) 658free_frame_menubar (FRAME_PTR f)
665 FRAME_PTR f;
666{ 659{
667 BLOCK_INPUT; 660 BLOCK_INPUT;
668 661
@@ -1020,11 +1013,9 @@ static char * button_names [] = {
1020 "button6", "button7", "button8", "button9", "button10" }; 1013 "button6", "button7", "button8", "button9", "button10" };
1021 1014
1022static Lisp_Object 1015static Lisp_Object
1023w32_dialog_show (f, keymaps, title, header, error) 1016w32_dialog_show (FRAME_PTR f, int keymaps,
1024 FRAME_PTR f; 1017 Lisp_Object title, Lisp_Object header,
1025 int keymaps; 1018 char **error)
1026 Lisp_Object title, header;
1027 char **error;
1028{ 1019{
1029 int i, nb_buttons=0; 1020 int i, nb_buttons=0;
1030 char dialog_name[6]; 1021 char dialog_name[6];
@@ -1213,8 +1204,8 @@ w32_dialog_show (f, keymaps, title, header, error)
1213 anywhere in Emacs that uses the other specific dialog choices that 1204 anywhere in Emacs that uses the other specific dialog choices that
1214 MessageBox provides. */ 1205 MessageBox provides. */
1215 1206
1216static int is_simple_dialog (contents) 1207static int
1217 Lisp_Object contents; 1208is_simple_dialog (Lisp_Object contents)
1218{ 1209{
1219 Lisp_Object options = XCDR (contents); 1210 Lisp_Object options = XCDR (contents);
1220 Lisp_Object name, yes, no, other; 1211 Lisp_Object name, yes, no, other;
@@ -1249,9 +1240,8 @@ static int is_simple_dialog (contents)
1249 return !(CONSP (options)); 1240 return !(CONSP (options));
1250} 1241}
1251 1242
1252static Lisp_Object simple_dialog_show (f, contents, header) 1243static Lisp_Object
1253 FRAME_PTR f; 1244simple_dialog_show (FRAME_PTR f, Lisp_Object contents, Lisp_Object header)
1254 Lisp_Object contents, header;
1255{ 1245{
1256 int answer; 1246 int answer;
1257 UINT type; 1247 UINT type;
@@ -1315,8 +1305,7 @@ static Lisp_Object simple_dialog_show (f, contents, header)
1315 1305
1316/* Is this item a separator? */ 1306/* Is this item a separator? */
1317static int 1307static int
1318name_is_separator (name) 1308name_is_separator (char *name)
1319 char *name;
1320{ 1309{
1321 char *start = name; 1310 char *start = name;
1322 1311
@@ -1647,8 +1636,7 @@ w32_menu_display_help (HWND owner, HMENU menu, UINT item, UINT flags)
1647 1636
1648/* Free memory used by owner-drawn strings. */ 1637/* Free memory used by owner-drawn strings. */
1649static void 1638static void
1650w32_free_submenu_strings (menu) 1639w32_free_submenu_strings (HMENU menu)
1651 HMENU menu;
1652{ 1640{
1653 int i, num = GetMenuItemCount (menu); 1641 int i, num = GetMenuItemCount (menu);
1654 for (i = 0; i < num; i++) 1642 for (i = 0; i < num; i++)
@@ -1676,8 +1664,7 @@ w32_free_submenu_strings (menu)
1676} 1664}
1677 1665
1678void 1666void
1679w32_free_menu_strings (hwnd) 1667w32_free_menu_strings (HWND hwnd)
1680 HWND hwnd;
1681{ 1668{
1682 HMENU menu = current_popup_menu; 1669 HMENU menu = current_popup_menu;
1683 1670
@@ -1712,7 +1699,8 @@ DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_
1712#endif /* HAVE_MENUS */ 1699#endif /* HAVE_MENUS */
1713} 1700}
1714 1701
1715void syms_of_w32menu () 1702void
1703syms_of_w32menu (void)
1716{ 1704{
1717 globals_of_w32menu (); 1705 globals_of_w32menu ();
1718 1706
@@ -1734,7 +1722,8 @@ void syms_of_w32menu ()
1734 variable initialized is 0 and directly from main when initialized 1722 variable initialized is 0 and directly from main when initialized
1735 is non zero. 1723 is non zero.
1736 */ 1724 */
1737void globals_of_w32menu () 1725void
1726globals_of_w32menu (void)
1738{ 1727{
1739 /* See if Get/SetMenuItemInfo functions are available. */ 1728 /* See if Get/SetMenuItemInfo functions are available. */
1740 HMODULE user32 = GetModuleHandle ("user32.dll"); 1729 HMODULE user32 = GetModuleHandle ("user32.dll");
diff --git a/src/w32proc.c b/src/w32proc.c
index b8443e5a75b..9eef228292f 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -117,7 +117,8 @@ extern Lisp_Object Qlocal;
117Lisp_Object Qhigh, Qlow; 117Lisp_Object Qhigh, Qlow;
118 118
119#ifdef EMACSDEBUG 119#ifdef EMACSDEBUG
120void _DebPrint (const char *fmt, ...) 120void
121_DebPrint (const char *fmt, ...)
121{ 122{
122 char buf[1024]; 123 char buf[1024];
123 va_list args; 124 va_list args;
@@ -608,7 +609,10 @@ get_result:
608#endif 609#endif
609 610
610void 611void
611w32_executable_type (char * filename, int * is_dos_app, int * is_cygnus_app, int * is_gui_app) 612w32_executable_type (char * filename,
613 int * is_dos_app,
614 int * is_cygnus_app,
615 int * is_gui_app)
612{ 616{
613 file_data executable; 617 file_data executable;
614 char * p; 618 char * p;
@@ -1875,7 +1879,8 @@ If successful, the return value is t, otherwise nil. */)
1875 1879
1876#ifdef HAVE_LANGINFO_CODESET 1880#ifdef HAVE_LANGINFO_CODESET
1877/* Emulation of nl_langinfo. Used in fns.c:Flocale_info. */ 1881/* Emulation of nl_langinfo. Used in fns.c:Flocale_info. */
1878char *nl_langinfo (nl_item item) 1882char *
1883nl_langinfo (nl_item item)
1879{ 1884{
1880 /* Conversion of Posix item numbers to their Windows equivalents. */ 1885 /* Conversion of Posix item numbers to their Windows equivalents. */
1881 static const LCTYPE w32item[] = { 1886 static const LCTYPE w32item[] = {
@@ -2003,7 +2008,8 @@ human-readable form. */)
2003 return make_number (GetThreadLocale ()); 2008 return make_number (GetThreadLocale ());
2004} 2009}
2005 2010
2006DWORD int_from_hex (char * s) 2011DWORD
2012int_from_hex (char * s)
2007{ 2013{
2008 DWORD val = 0; 2014 DWORD val = 0;
2009 static char hex[] = "0123456789abcdefABCDEF"; 2015 static char hex[] = "0123456789abcdefABCDEF";
@@ -2024,7 +2030,8 @@ DWORD int_from_hex (char * s)
2024 function isn't given a context pointer. */ 2030 function isn't given a context pointer. */
2025Lisp_Object Vw32_valid_locale_ids; 2031Lisp_Object Vw32_valid_locale_ids;
2026 2032
2027BOOL CALLBACK enum_locale_fn (LPTSTR localeNum) 2033BOOL CALLBACK
2034enum_locale_fn (LPTSTR localeNum)
2028{ 2035{
2029 DWORD id = int_from_hex (localeNum); 2036 DWORD id = int_from_hex (localeNum);
2030 Vw32_valid_locale_ids = Fcons (make_number (id), Vw32_valid_locale_ids); 2037 Vw32_valid_locale_ids = Fcons (make_number (id), Vw32_valid_locale_ids);
@@ -2089,7 +2096,8 @@ If successful, the new locale id is returned, otherwise nil. */)
2089 function isn't given a context pointer. */ 2096 function isn't given a context pointer. */
2090Lisp_Object Vw32_valid_codepages; 2097Lisp_Object Vw32_valid_codepages;
2091 2098
2092BOOL CALLBACK enum_codepage_fn (LPTSTR codepageNum) 2099BOOL CALLBACK
2100enum_codepage_fn (LPTSTR codepageNum)
2093{ 2101{
2094 DWORD id = atoi (codepageNum); 2102 DWORD id = atoi (codepageNum);
2095 Vw32_valid_codepages = Fcons (make_number (id), Vw32_valid_codepages); 2103 Vw32_valid_codepages = Fcons (make_number (id), Vw32_valid_codepages);
@@ -2265,7 +2273,8 @@ If successful, the new layout id is returned, otherwise nil. */)
2265} 2273}
2266 2274
2267 2275
2268syms_of_ntproc () 2276void
2277syms_of_ntproc (void)
2269{ 2278{
2270 DEFSYM (Qhigh, "high"); 2279 DEFSYM (Qhigh, "high");
2271 DEFSYM (Qlow, "low"); 2280 DEFSYM (Qlow, "low");
diff --git a/src/w32reg.c b/src/w32reg.c
index f9687d1effe..77667eb7dc9 100644
--- a/src/w32reg.c
+++ b/src/w32reg.c
@@ -58,9 +58,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
58*/ 58*/
59 59
60static char * 60static char *
61w32_get_rdb_resource (rdb, resource) 61w32_get_rdb_resource (char *rdb, char *resource)
62 char *rdb;
63 char *resource;
64{ 62{
65 char *value = rdb; 63 char *value = rdb;
66 int len = strlen (resource); 64 int len = strlen (resource);
@@ -78,9 +76,7 @@ w32_get_rdb_resource (rdb, resource)
78} 76}
79 77
80static LPBYTE 78static LPBYTE
81w32_get_string_resource (name, class, dwexptype) 79w32_get_string_resource (char *name, char *class, DWORD dwexptype)
82 char *name, *class;
83 DWORD dwexptype;
84{ 80{
85 LPBYTE lpvalue = NULL; 81 LPBYTE lpvalue = NULL;
86 HKEY hrootkey = NULL; 82 HKEY hrootkey = NULL;
@@ -147,9 +143,7 @@ w32_get_string_resource (name, class, dwexptype)
147 database RDB. */ 143 database RDB. */
148 144
149char * 145char *
150x_get_string_resource (rdb, name, class) 146x_get_string_resource (XrmDatabase rdb, char *name, char *class)
151 XrmDatabase rdb;
152 char *name, *class;
153{ 147{
154 if (rdb) 148 if (rdb)
155 { 149 {
diff --git a/src/w32select.c b/src/w32select.c
index 2da4b333c2a..4ecd926ed79 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -30,7 +30,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
30 * (CF_UNICODETEXT), when a well-known console codepage is given, they 30 * (CF_UNICODETEXT), when a well-known console codepage is given, they
31 * apply to the console version of the clipboard data (CF_OEMTEXT), 31 * apply to the console version of the clipboard data (CF_OEMTEXT),
32 * else they apply to the normal 8-bit text clipboard (CF_TEXT). 32 * else they apply to the normal 8-bit text clipboard (CF_TEXT).
33 * 33 *
34 * When pasting (getting data from the OS), the clipboard format that 34 * When pasting (getting data from the OS), the clipboard format that
35 * matches the {next-}selection-coding-system is retrieved. If 35 * matches the {next-}selection-coding-system is retrieved. If
36 * Unicode is requested, but not available, 8-bit text (CF_TEXT) is 36 * Unicode is requested, but not available, 8-bit text (CF_TEXT) is
@@ -45,13 +45,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
45 * 45 *
46 * Scenarios to use the facilities for customizing the selection 46 * Scenarios to use the facilities for customizing the selection
47 * coding system are: 47 * coding system are:
48 * 48 *
49 * ;; Generally use KOI8-R instead of the russian MS codepage for 49 * ;; Generally use KOI8-R instead of the russian MS codepage for
50 * ;; the 8-bit clipboard. 50 * ;; the 8-bit clipboard.
51 * (set-selection-coding-system 'koi8-r-dos) 51 * (set-selection-coding-system 'koi8-r-dos)
52 * 52 *
53 * Or 53 * Or
54 * 54 *
55 * ;; Create a special clipboard copy function that uses codepage 55 * ;; Create a special clipboard copy function that uses codepage
56 * ;; 1253 (Greek) to copy Greek text to a specific non-Unicode 56 * ;; 1253 (Greek) to copy Greek text to a specific non-Unicode
57 * ;; application. 57 * ;; application.
@@ -71,7 +71,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
71 * types should be supported is also moved to Lisp, functionality 71 * types should be supported is also moved to Lisp, functionality
72 * could be expanded to CF_HTML, CF_RTF and maybe other types. 72 * could be expanded to CF_HTML, CF_RTF and maybe other types.
73 */ 73 */
74 74
75#include <config.h> 75#include <config.h>
76#include <setjmp.h> 76#include <setjmp.h>
77#include "lisp.h" 77#include "lisp.h"
@@ -89,8 +89,8 @@ static HGLOBAL convert_to_handle_as_ascii (void);
89static HGLOBAL convert_to_handle_as_coded (Lisp_Object coding_system); 89static HGLOBAL convert_to_handle_as_coded (Lisp_Object coding_system);
90static Lisp_Object render (Lisp_Object oformat); 90static Lisp_Object render (Lisp_Object oformat);
91static Lisp_Object render_locale (void); 91static Lisp_Object render_locale (void);
92static Lisp_Object render_all (void); 92static Lisp_Object render_all (Lisp_Object ignore);
93static void run_protected (Lisp_Object (*code) (), Lisp_Object arg); 93static void run_protected (Lisp_Object (*code) (Lisp_Object), Lisp_Object arg);
94static Lisp_Object lisp_error_handler (Lisp_Object error); 94static Lisp_Object lisp_error_handler (Lisp_Object error);
95static LRESULT CALLBACK owner_callback (HWND win, UINT msg, 95static LRESULT CALLBACK owner_callback (HWND win, UINT msg,
96 WPARAM wp, LPARAM lp); 96 WPARAM wp, LPARAM lp);
@@ -220,7 +220,7 @@ convert_to_handle_as_coded (Lisp_Object coding_system)
220 unsigned char *dst = NULL; 220 unsigned char *dst = NULL;
221 struct coding_system coding; 221 struct coding_system coding;
222 222
223 ONTRACE (fprintf (stderr, "convert_to_handle_as_coded: %s\n", 223 ONTRACE (fprintf (stderr, "convert_to_handle_as_coded: %s\n",
224 SDATA (SYMBOL_NAME (coding_system)))); 224 SDATA (SYMBOL_NAME (coding_system))));
225 225
226 setup_windows_coding_system (coding_system, &coding); 226 setup_windows_coding_system (coding_system, &coding);
@@ -334,7 +334,7 @@ render_locale (void)
334 data survives us. This code will do that. */ 334 data survives us. This code will do that. */
335 335
336static Lisp_Object 336static Lisp_Object
337render_all (void) 337render_all (Lisp_Object ignore)
338{ 338{
339 ONTRACE (fprintf (stderr, "render_all\n")); 339 ONTRACE (fprintf (stderr, "render_all\n"));
340 340
@@ -392,7 +392,7 @@ render_all (void)
392} 392}
393 393
394static void 394static void
395run_protected (Lisp_Object (*code) (), Lisp_Object arg) 395run_protected (Lisp_Object (*code) (Lisp_Object), Lisp_Object arg)
396{ 396{
397 /* FIXME: This works but it doesn't feel right. Too much fiddling 397 /* FIXME: This works but it doesn't feel right. Too much fiddling
398 with global variables and calling strange looking functions. Is 398 with global variables and calling strange looking functions. Is
@@ -514,7 +514,7 @@ setup_config (void)
514 && EQ (cfg_coding_system, dos_coding_system)) 514 && EQ (cfg_coding_system, dos_coding_system))
515 return; 515 return;
516 cfg_coding_system = dos_coding_system; 516 cfg_coding_system = dos_coding_system;
517 517
518 /* Set some sensible fallbacks */ 518 /* Set some sensible fallbacks */
519 cfg_codepage = ANSICP; 519 cfg_codepage = ANSICP;
520 cfg_lcid = LOCALE_NEUTRAL; 520 cfg_lcid = LOCALE_NEUTRAL;
@@ -583,7 +583,7 @@ enum_locale_callback (/*const*/ char* loc_string)
583 cfg_clipboard_type = CF_TEXT; 583 cfg_clipboard_type = CF_TEXT;
584 return FALSE; /* Stop enumeration */ 584 return FALSE; /* Stop enumeration */
585 } 585 }
586 586
587 /* Is the wanted codepage the OEM codepage for this locale? */ 587 /* Is the wanted codepage the OEM codepage for this locale? */
588 codepage = cp_from_locale (lcid, CF_OEMTEXT); 588 codepage = cp_from_locale (lcid, CF_OEMTEXT);
589 if (codepage == cfg_codepage) 589 if (codepage == cfg_codepage)
@@ -704,7 +704,7 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data,
704 current_lcid = cfg_lcid; 704 current_lcid = cfg_lcid;
705 current_num_nls = 0; 705 current_num_nls = 0;
706 current_requires_encoding = 0; 706 current_requires_encoding = 0;
707 707
708 BLOCK_INPUT; 708 BLOCK_INPUT;
709 709
710 /* Check for non-ASCII characters. While we are at it, count the 710 /* Check for non-ASCII characters. While we are at it, count the
@@ -884,7 +884,7 @@ DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data,
884 struct coding_system coding; 884 struct coding_system coding;
885 Lisp_Object coding_system = Qnil; 885 Lisp_Object coding_system = Qnil;
886 Lisp_Object dos_coding_system; 886 Lisp_Object dos_coding_system;
887 887
888 /* `next-selection-coding-system' should override everything, 888 /* `next-selection-coding-system' should override everything,
889 even when the locale passed by the system disagrees. The 889 even when the locale passed by the system disagrees. The
890 only exception is when `next-selection-coding-system' 890 only exception is when `next-selection-coding-system'
@@ -1065,7 +1065,7 @@ and t is the same as `SECONDARY'. */)
1065 dumped version. */ 1065 dumped version. */
1066 1066
1067void 1067void
1068syms_of_w32select () 1068syms_of_w32select (void)
1069{ 1069{
1070 defsubr (&Sw32_set_clipboard_data); 1070 defsubr (&Sw32_set_clipboard_data);
1071 defsubr (&Sw32_get_clipboard_data); 1071 defsubr (&Sw32_get_clipboard_data);
@@ -1076,7 +1076,7 @@ syms_of_w32select ()
1076When sending or receiving text via cut_buffer, selection, and 1076When sending or receiving text via cut_buffer, selection, and
1077clipboard, the text is encoded or decoded by this coding system. 1077clipboard, the text is encoded or decoded by this coding system.
1078The default value is the current system default encoding on 9x/Me and 1078The default value is the current system default encoding on 9x/Me and
1079`utf-16le-dos' (Unicode) on NT/W2K/XP. */); 1079`utf-16le-dos' (Unicode) on NT/W2K/XP. */);
1080 /* The actual value is set dynamically in the dumped Emacs, see 1080 /* The actual value is set dynamically in the dumped Emacs, see
1081 below. */ 1081 below. */
1082 Vselection_coding_system = Qnil; 1082 Vselection_coding_system = Qnil;
@@ -1104,7 +1104,7 @@ set to nil. */);
1104 un-dumped version. */ 1104 un-dumped version. */
1105 1105
1106void 1106void
1107globals_of_w32select () 1107globals_of_w32select (void)
1108{ 1108{
1109 DEFAULT_LCID = GetUserDefaultLCID (); 1109 DEFAULT_LCID = GetUserDefaultLCID ();
1110 /* Drop the sort order from the LCID, so we can compare this with 1110 /* Drop the sort order from the LCID, so we can compare this with
diff --git a/src/w32term.c b/src/w32term.c
index 1acb77e7b16..5dfe6a363d3 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -96,7 +96,7 @@ int x_underline_at_descent_line;
96 96
97extern unsigned int msh_mousewheel; 97extern unsigned int msh_mousewheel;
98 98
99extern void free_frame_menubar (); 99extern void free_frame_menubar (struct frame *);
100 100
101extern int w32_codepage_for_font (char *fontname); 101extern int w32_codepage_for_font (char *fontname);
102extern Cursor w32_load_cursor (LPCTSTR name); 102extern Cursor w32_load_cursor (LPCTSTR name);
@@ -294,9 +294,7 @@ struct record event_record[100];
294 294
295int event_record_index; 295int event_record_index;
296 296
297record_event (locus, type) 297record_event (char *locus, int type)
298 char *locus;
299 int type;
300{ 298{
301 if (event_record_index == sizeof (event_record) / sizeof (struct record)) 299 if (event_record_index == sizeof (event_record) / sizeof (struct record))
302 event_record_index = 0; 300 event_record_index = 0;
@@ -310,7 +308,7 @@ record_event (locus, type)
310 308
311 309
312void 310void
313XChangeGC (void * ignore, XGCValues* gc, unsigned long mask, 311XChangeGC (void *ignore, XGCValues *gc, unsigned long mask,
314 XGCValues *xgcv) 312 XGCValues *xgcv)
315{ 313{
316 if (mask & GCForeground) 314 if (mask & GCForeground)
@@ -321,8 +319,8 @@ XChangeGC (void * ignore, XGCValues* gc, unsigned long mask,
321 gc->font = xgcv->font; 319 gc->font = xgcv->font;
322} 320}
323 321
324XGCValues *XCreateGC (void * ignore, Window window, unsigned long mask, 322XGCValues *
325 XGCValues *xgcv) 323XCreateGC (void *ignore, Window window, unsigned long mask, XGCValues *xgcv)
326{ 324{
327 XGCValues *gc = (XGCValues *) xmalloc (sizeof (XGCValues)); 325 XGCValues *gc = (XGCValues *) xmalloc (sizeof (XGCValues));
328 bzero (gc, sizeof (XGCValues)); 326 bzero (gc, sizeof (XGCValues));
@@ -333,8 +331,8 @@ XGCValues *XCreateGC (void * ignore, Window window, unsigned long mask,
333} 331}
334 332
335void 333void
336XGetGCValues (void* ignore, XGCValues *gc, 334XGetGCValues (void *ignore, XGCValues *gc,
337 unsigned long mask, XGCValues *xgcv) 335 unsigned long mask, XGCValues *xgcv)
338{ 336{
339 XChangeGC (ignore, xgcv, mask, gc); 337 XChangeGC (ignore, xgcv, mask, gc);
340} 338}
@@ -376,11 +374,7 @@ w32_draw_rectangle (HDC hdc, XGCValues *gc, int x, int y,
376 374
377/* Draw a filled rectangle at the specified position. */ 375/* Draw a filled rectangle at the specified position. */
378void 376void
379w32_fill_rect (f, hdc, pix, lprect) 377w32_fill_rect (FRAME_PTR f, HDC hdc, COLORREF pix, RECT *lprect)
380 FRAME_PTR f;
381 HDC hdc;
382 COLORREF pix;
383 RECT * lprect;
384{ 378{
385 HBRUSH hb; 379 HBRUSH hb;
386 380
@@ -390,8 +384,7 @@ w32_fill_rect (f, hdc, pix, lprect)
390} 384}
391 385
392void 386void
393w32_clear_window (f) 387w32_clear_window (FRAME_PTR f)
394 FRAME_PTR f;
395{ 388{
396 RECT rect; 389 RECT rect;
397 HDC hdc = get_frame_dc (f); 390 HDC hdc = get_frame_dc (f);
@@ -411,8 +404,7 @@ w32_clear_window (f)
411#define OPAQUE_FRAME 255 404#define OPAQUE_FRAME 255
412 405
413void 406void
414x_set_frame_alpha (f) 407x_set_frame_alpha (struct frame *f)
415 struct frame *f;
416{ 408{
417 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); 409 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
418 double alpha = 1.0; 410 double alpha = 1.0;
@@ -458,8 +450,7 @@ x_set_frame_alpha (f)
458} 450}
459 451
460int 452int
461x_display_pixel_height (dpyinfo) 453x_display_pixel_height (struct w32_display_info *dpyinfo)
462 struct w32_display_info *dpyinfo;
463{ 454{
464 HDC dc = GetDC (NULL); 455 HDC dc = GetDC (NULL);
465 int pixels = GetDeviceCaps (dc, VERTRES); 456 int pixels = GetDeviceCaps (dc, VERTRES);
@@ -468,8 +459,7 @@ x_display_pixel_height (dpyinfo)
468} 459}
469 460
470int 461int
471x_display_pixel_width (dpyinfo) 462x_display_pixel_width (struct w32_display_info *dpyinfo)
472 struct w32_display_info *dpyinfo;
473{ 463{
474 HDC dc = GetDC (NULL); 464 HDC dc = GetDC (NULL);
475 int pixels = GetDeviceCaps (dc, HORZRES); 465 int pixels = GetDeviceCaps (dc, HORZRES);
@@ -488,8 +478,7 @@ x_display_pixel_width (dpyinfo)
488 each window being updated. */ 478 each window being updated. */
489 479
490static void 480static void
491x_update_begin (f) 481x_update_begin (struct frame *f)
492 struct frame *f;
493{ 482{
494 struct w32_display_info *display_info = FRAME_W32_DISPLAY_INFO (f); 483 struct w32_display_info *display_info = FRAME_W32_DISPLAY_INFO (f);
495 484
@@ -511,8 +500,7 @@ x_update_begin (f)
511 position of W. */ 500 position of W. */
512 501
513static void 502static void
514x_update_window_begin (w) 503x_update_window_begin (struct window *w)
515 struct window *w;
516{ 504{
517 struct frame *f = XFRAME (WINDOW_FRAME (w)); 505 struct frame *f = XFRAME (WINDOW_FRAME (w));
518 struct w32_display_info *display_info = FRAME_W32_DISPLAY_INFO (f); 506 struct w32_display_info *display_info = FRAME_W32_DISPLAY_INFO (f);
@@ -571,9 +559,7 @@ x_update_window_begin (w)
571/* Draw a vertical window border from (x,y0) to (x,y1) */ 559/* Draw a vertical window border from (x,y0) to (x,y1) */
572 560
573static void 561static void
574w32_draw_vertical_window_border (w, x, y0, y1) 562w32_draw_vertical_window_border (struct window *w, int x, int y0, int y1)
575 struct window *w;
576 int x, y0, y1;
577{ 563{
578 struct frame *f = XFRAME (WINDOW_FRAME (w)); 564 struct frame *f = XFRAME (WINDOW_FRAME (w));
579 RECT r; 565 RECT r;
@@ -610,9 +596,8 @@ w32_draw_vertical_window_border (w, x, y0, y1)
610 here. */ 596 here. */
611 597
612static void 598static void
613x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p) 599x_update_window_end (struct window *w, int cursor_on_p,
614 struct window *w; 600 int mouse_face_overwritten_p)
615 int cursor_on_p, mouse_face_overwritten_p;
616{ 601{
617 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (XFRAME (w->frame)); 602 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (XFRAME (w->frame));
618 603
@@ -656,8 +641,7 @@ x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p)
656 update_end. */ 641 update_end. */
657 642
658static void 643static void
659x_update_end (f) 644x_update_end (struct frame *f)
660 struct frame *f;
661{ 645{
662 if (! FRAME_W32_P (f)) 646 if (! FRAME_W32_P (f))
663 return; 647 return;
@@ -672,8 +656,7 @@ x_update_end (f)
672 updated_window is not available here. */ 656 updated_window is not available here. */
673 657
674static void 658static void
675w32_frame_up_to_date (f) 659w32_frame_up_to_date (struct frame *f)
676 struct frame *f;
677{ 660{
678 if (FRAME_W32_P (f)) 661 if (FRAME_W32_P (f))
679 { 662 {
@@ -702,8 +685,7 @@ w32_frame_up_to_date (f)
702 between bitmaps to be drawn between current row and DESIRED_ROW. */ 685 between bitmaps to be drawn between current row and DESIRED_ROW. */
703 686
704static void 687static void
705x_after_update_window_line (desired_row) 688x_after_update_window_line (struct glyph_row *desired_row)
706 struct glyph_row *desired_row;
707{ 689{
708 struct window *w = updated_window; 690 struct window *w = updated_window;
709 struct frame *f; 691 struct frame *f;
@@ -749,10 +731,8 @@ x_after_update_window_line (desired_row)
749 drawn. */ 731 drawn. */
750 732
751static void 733static void
752w32_draw_fringe_bitmap (w, row, p) 734w32_draw_fringe_bitmap (struct window *w, struct glyph_row *row,
753 struct window *w; 735 struct draw_fringe_bitmap_params *p)
754 struct glyph_row *row;
755 struct draw_fringe_bitmap_params *p;
756{ 736{
757 struct frame *f = XFRAME (WINDOW_FRAME (w)); 737 struct frame *f = XFRAME (WINDOW_FRAME (w));
758 HDC hdc; 738 HDC hdc;
@@ -890,10 +870,7 @@ w32_draw_fringe_bitmap (w, row, p)
890} 870}
891 871
892static void 872static void
893w32_define_fringe_bitmap (which, bits, h, wd) 873w32_define_fringe_bitmap (int which, unsigned short *bits, int h, int wd)
894 int which;
895 unsigned short *bits;
896 int h, wd;
897{ 874{
898 if (which >= max_fringe_bmp) 875 if (which >= max_fringe_bmp)
899 { 876 {
@@ -908,8 +885,7 @@ w32_define_fringe_bitmap (which, bits, h, wd)
908} 885}
909 886
910static void 887static void
911w32_destroy_fringe_bitmap (which) 888w32_destroy_fringe_bitmap (int which)
912 int which;
913{ 889{
914 if (which >= max_fringe_bmp) 890 if (which >= max_fringe_bmp)
915 return; 891 return;
@@ -979,8 +955,7 @@ static void w32_draw_box_rect (struct glyph_string *, int, int, int, int,
979 face. */ 955 face. */
980 956
981static void 957static void
982x_set_cursor_gc (s) 958x_set_cursor_gc (struct glyph_string *s)
983 struct glyph_string *s;
984{ 959{
985 if (s->font == FRAME_FONT (s->f) 960 if (s->font == FRAME_FONT (s->f)
986 && s->face->background == FRAME_BACKGROUND_PIXEL (s->f) 961 && s->face->background == FRAME_BACKGROUND_PIXEL (s->f)
@@ -1031,8 +1006,7 @@ x_set_cursor_gc (s)
1031/* Set up S->gc of glyph string S for drawing text in mouse face. */ 1006/* Set up S->gc of glyph string S for drawing text in mouse face. */
1032 1007
1033static void 1008static void
1034x_set_mouse_face_gc (s) 1009x_set_mouse_face_gc (struct glyph_string *s)
1035 struct glyph_string *s;
1036{ 1010{
1037 int face_id; 1011 int face_id;
1038 struct face *face; 1012 struct face *face;
@@ -1085,8 +1059,7 @@ x_set_mouse_face_gc (s)
1085 matrix was built, so there isn't much to do, here. */ 1059 matrix was built, so there isn't much to do, here. */
1086 1060
1087static INLINE void 1061static INLINE void
1088x_set_mode_line_face_gc (s) 1062x_set_mode_line_face_gc (struct glyph_string *s)
1089 struct glyph_string *s;
1090{ 1063{
1091 s->gc = s->face->gc; 1064 s->gc = s->face->gc;
1092} 1065}
@@ -1097,8 +1070,7 @@ x_set_mode_line_face_gc (s)
1097 pattern. */ 1070 pattern. */
1098 1071
1099static INLINE void 1072static INLINE void
1100x_set_glyph_string_gc (s) 1073x_set_glyph_string_gc (struct glyph_string *s)
1101 struct glyph_string *s;
1102{ 1074{
1103 PREPARE_FACE_FOR_DISPLAY (s->f, s->face); 1075 PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
1104 1076
@@ -1143,8 +1115,7 @@ x_set_glyph_string_gc (s)
1143 line or menu if we don't have X toolkit support. */ 1115 line or menu if we don't have X toolkit support. */
1144 1116
1145static INLINE void 1117static INLINE void
1146x_set_glyph_string_clipping (s) 1118x_set_glyph_string_clipping (struct glyph_string *s)
1147 struct glyph_string *s;
1148{ 1119{
1149 RECT *r = s->clip; 1120 RECT *r = s->clip;
1150 int n = get_glyph_string_clip_rects (s, r, 2); 1121 int n = get_glyph_string_clip_rects (s, r, 2);
@@ -1172,8 +1143,8 @@ x_set_glyph_string_clipping (s)
1172 the area of SRC. */ 1143 the area of SRC. */
1173 1144
1174static void 1145static void
1175x_set_glyph_string_clipping_exactly (src, dst) 1146x_set_glyph_string_clipping_exactly (struct glyph_string *src,
1176 struct glyph_string *src, *dst; 1147 struct glyph_string *dst)
1177{ 1148{
1178 RECT r; 1149 RECT r;
1179 1150
@@ -1190,8 +1161,7 @@ x_set_glyph_string_clipping_exactly (src, dst)
1190 Compute left and right overhang of glyph string S. */ 1161 Compute left and right overhang of glyph string S. */
1191 1162
1192static void 1163static void
1193w32_compute_glyph_string_overhangs (s) 1164w32_compute_glyph_string_overhangs (struct glyph_string *s)
1194 struct glyph_string *s;
1195{ 1165{
1196 if (s->cmp == NULL 1166 if (s->cmp == NULL
1197 && s->first_glyph->type == CHAR_GLYPH 1167 && s->first_glyph->type == CHAR_GLYPH
@@ -1219,9 +1189,8 @@ w32_compute_glyph_string_overhangs (s)
1219/* Fill rectangle X, Y, W, H with background color of glyph string S. */ 1189/* Fill rectangle X, Y, W, H with background color of glyph string S. */
1220 1190
1221static INLINE void 1191static INLINE void
1222x_clear_glyph_string_rect (s, x, y, w, h) 1192x_clear_glyph_string_rect (struct glyph_string *s,
1223 struct glyph_string *s; 1193 int x, int y, int w, int h)
1224 int x, y, w, h;
1225{ 1194{
1226 int real_x = x; 1195 int real_x = x;
1227 int real_y = y; 1196 int real_y = y;
@@ -1251,9 +1220,7 @@ x_clear_glyph_string_rect (s, x, y, w, h)
1251 contains the first component of a composition. */ 1220 contains the first component of a composition. */
1252 1221
1253static void 1222static void
1254x_draw_glyph_string_background (s, force_p) 1223x_draw_glyph_string_background (struct glyph_string *s, int force_p)
1255 struct glyph_string *s;
1256 int force_p;
1257{ 1224{
1258 /* Nothing to do if background has already been drawn or if it 1225 /* Nothing to do if background has already been drawn or if it
1259 shouldn't be drawn in the first place. */ 1226 shouldn't be drawn in the first place. */
@@ -1292,8 +1259,7 @@ x_draw_glyph_string_background (s, force_p)
1292/* Draw the foreground of glyph string S. */ 1259/* Draw the foreground of glyph string S. */
1293 1260
1294static void 1261static void
1295x_draw_glyph_string_foreground (s) 1262x_draw_glyph_string_foreground (struct glyph_string *s)
1296 struct glyph_string *s;
1297{ 1263{
1298 int i, x; 1264 int i, x;
1299 1265
@@ -1350,8 +1316,7 @@ x_draw_glyph_string_foreground (s)
1350/* Draw the foreground of composite glyph string S. */ 1316/* Draw the foreground of composite glyph string S. */
1351 1317
1352static void 1318static void
1353x_draw_composite_glyph_string_foreground (s) 1319x_draw_composite_glyph_string_foreground (struct glyph_string *s)
1354 struct glyph_string *s;
1355{ 1320{
1356 int i, j, x; 1321 int i, j, x;
1357 struct font *font = s->font; 1322 struct font *font = s->font;
@@ -1464,11 +1429,8 @@ x_draw_composite_glyph_string_foreground (s)
1464 Value is non-zero if successful. */ 1429 Value is non-zero if successful. */
1465 1430
1466static int 1431static int
1467w32_alloc_lighter_color (f, color, factor, delta) 1432w32_alloc_lighter_color (struct frame *f, COLORREF *color,
1468 struct frame *f; 1433 double factor, int delta)
1469 COLORREF *color;
1470 double factor;
1471 int delta;
1472{ 1434{
1473 COLORREF new; 1435 COLORREF new;
1474 long bright; 1436 long bright;
@@ -1527,10 +1489,7 @@ w32_alloc_lighter_color (f, color, factor, delta)
1527 colors in COLORS. On W32, we no longer try to map colors to 1489 colors in COLORS. On W32, we no longer try to map colors to
1528 a palette. */ 1490 a palette. */
1529void 1491void
1530x_query_colors (f, colors, ncolors) 1492x_query_colors (struct frame *f, XColor *colors, int ncolors)
1531 struct frame *f;
1532 XColor *colors;
1533 int ncolors;
1534{ 1493{
1535 int i; 1494 int i;
1536 1495
@@ -1545,9 +1504,7 @@ x_query_colors (f, colors, ncolors)
1545} 1504}
1546 1505
1547void 1506void
1548x_query_color (f, color) 1507x_query_color (struct frame *f, XColor *color)
1549 struct frame *f;
1550 XColor *color;
1551{ 1508{
1552 x_query_colors (f, color, 1); 1509 x_query_colors (f, color, 1);
1553} 1510}
@@ -1561,12 +1518,8 @@ x_query_color (f, color)
1561 be allocated, use DEFAULT_PIXEL, instead. */ 1518 be allocated, use DEFAULT_PIXEL, instead. */
1562 1519
1563static void 1520static void
1564w32_setup_relief_color (f, relief, factor, delta, default_pixel) 1521w32_setup_relief_color (struct frame *f, struct relief *relief, double factor,
1565 struct frame *f; 1522 int delta, COLORREF default_pixel)
1566 struct relief *relief;
1567 double factor;
1568 int delta;
1569 COLORREF default_pixel;
1570{ 1523{
1571 XGCValues xgcv; 1524 XGCValues xgcv;
1572 struct w32_output *di = f->output_data.w32; 1525 struct w32_output *di = f->output_data.w32;
@@ -1602,8 +1555,7 @@ w32_setup_relief_color (f, relief, factor, delta, default_pixel)
1602/* Set up colors for the relief lines around glyph string S. */ 1555/* Set up colors for the relief lines around glyph string S. */
1603 1556
1604static void 1557static void
1605x_setup_relief_colors (s) 1558x_setup_relief_colors (struct glyph_string *s)
1606 struct glyph_string *s;
1607{ 1559{
1608 struct w32_output *di = s->f->output_data.w32; 1560 struct w32_output *di = s->f->output_data.w32;
1609 COLORREF color; 1561 COLORREF color;
@@ -1638,12 +1590,10 @@ x_setup_relief_colors (s)
1638 when drawing. */ 1590 when drawing. */
1639 1591
1640static void 1592static void
1641w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, 1593w32_draw_relief_rect (struct frame *f,
1642 raised_p, top_p, bot_p, left_p, right_p, clip_rect) 1594 int left_x, int top_y, int right_x, int bottom_y, int width,
1643 struct frame *f; 1595 int raised_p, int top_p, int bot_p, int left_p, int right_p,
1644 int left_x, top_y, right_x, bottom_y, width; 1596 RECT *clip_rect)
1645 int top_p, bot_p, left_p, right_p, raised_p;
1646 RECT *clip_rect;
1647{ 1597{
1648 int i; 1598 int i;
1649 XGCValues gc; 1599 XGCValues gc;
@@ -1703,11 +1653,9 @@ w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
1703 rectangle to use when drawing. */ 1653 rectangle to use when drawing. */
1704 1654
1705static void 1655static void
1706w32_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width, 1656w32_draw_box_rect (struct glyph_string *s,
1707 left_p, right_p, clip_rect) 1657 int left_x, int top_y, int right_x, int bottom_y, int width,
1708 struct glyph_string *s; 1658 int left_p, int right_p, RECT *clip_rect)
1709 int left_x, top_y, right_x, bottom_y, width, left_p, right_p;
1710 RECT *clip_rect;
1711{ 1659{
1712 w32_set_clip_rectangle (s->hdc, clip_rect); 1660 w32_set_clip_rectangle (s->hdc, clip_rect);
1713 1661
@@ -1740,8 +1688,7 @@ w32_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width,
1740/* Draw a box around glyph string S. */ 1688/* Draw a box around glyph string S. */
1741 1689
1742static void 1690static void
1743x_draw_glyph_string_box (s) 1691x_draw_glyph_string_box (struct glyph_string *s)
1744 struct glyph_string *s;
1745{ 1692{
1746 int width, left_x, right_x, top_y, bottom_y, last_x, raised_p; 1693 int width, left_x, right_x, top_y, bottom_y, last_x, raised_p;
1747 int left_p, right_p; 1694 int left_p, right_p;
@@ -1792,8 +1739,7 @@ x_draw_glyph_string_box (s)
1792/* Draw foreground of image glyph string S. */ 1739/* Draw foreground of image glyph string S. */
1793 1740
1794static void 1741static void
1795x_draw_image_foreground (s) 1742x_draw_image_foreground (struct glyph_string *s)
1796 struct glyph_string *s;
1797{ 1743{
1798 int x = s->x; 1744 int x = s->x;
1799 int y = s->ybase - image_ascent (s->img, s->face, &s->slice); 1745 int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
@@ -1883,8 +1829,7 @@ x_draw_image_foreground (s)
1883/* Draw a relief around the image glyph string S. */ 1829/* Draw a relief around the image glyph string S. */
1884 1830
1885static void 1831static void
1886x_draw_image_relief (s) 1832x_draw_image_relief (struct glyph_string *s)
1887 struct glyph_string *s;
1888{ 1833{
1889 int x0, y0, x1, y1, thick, raised_p; 1834 int x0, y0, x1, y1, thick, raised_p;
1890 RECT r; 1835 RECT r;
@@ -1936,9 +1881,7 @@ x_draw_image_relief (s)
1936/* Draw the foreground of image glyph string S to PIXMAP. */ 1881/* Draw the foreground of image glyph string S to PIXMAP. */
1937 1882
1938static void 1883static void
1939w32_draw_image_foreground_1 (s, pixmap) 1884w32_draw_image_foreground_1 (struct glyph_string *s, HBITMAP pixmap)
1940 struct glyph_string *s;
1941 HBITMAP pixmap;
1942{ 1885{
1943 HDC hdc = CreateCompatibleDC (s->hdc); 1886 HDC hdc = CreateCompatibleDC (s->hdc);
1944 HGDIOBJ orig_hdc_obj = SelectObject (hdc, pixmap); 1887 HGDIOBJ orig_hdc_obj = SelectObject (hdc, pixmap);
@@ -2025,9 +1968,7 @@ w32_draw_image_foreground_1 (s, pixmap)
2025 give the rectangle to draw. */ 1968 give the rectangle to draw. */
2026 1969
2027static void 1970static void
2028x_draw_glyph_string_bg_rect (s, x, y, w, h) 1971x_draw_glyph_string_bg_rect (struct glyph_string *s, int x, int y, int w, int h)
2029 struct glyph_string *s;
2030 int x, y, w, h;
2031{ 1972{
2032#if 0 /* TODO: stipple */ 1973#if 0 /* TODO: stipple */
2033 if (s->stippled_p) 1974 if (s->stippled_p)
@@ -2058,8 +1999,7 @@ x_draw_glyph_string_bg_rect (s, x, y, w, h)
2058 */ 1999 */
2059 2000
2060static void 2001static void
2061x_draw_image_glyph_string (s) 2002x_draw_image_glyph_string (struct glyph_string *s)
2062 struct glyph_string *s;
2063{ 2003{
2064 int x, y; 2004 int x, y;
2065 int box_line_hwidth = eabs (s->face->box_line_width); 2005 int box_line_hwidth = eabs (s->face->box_line_width);
@@ -2172,8 +2112,7 @@ x_draw_image_glyph_string (s)
2172/* Draw stretch glyph string S. */ 2112/* Draw stretch glyph string S. */
2173 2113
2174static void 2114static void
2175x_draw_stretch_glyph_string (s) 2115x_draw_stretch_glyph_string (struct glyph_string *s)
2176 struct glyph_string *s;
2177{ 2116{
2178 xassert (s->first_glyph->type == STRETCH_GLYPH); 2117 xassert (s->first_glyph->type == STRETCH_GLYPH);
2179 2118
@@ -2255,8 +2194,7 @@ x_draw_stretch_glyph_string (s)
2255/* Draw glyph string S. */ 2194/* Draw glyph string S. */
2256 2195
2257static void 2196static void
2258x_draw_glyph_string (s) 2197x_draw_glyph_string (struct glyph_string *s)
2259 struct glyph_string *s;
2260{ 2198{
2261 int relief_drawn_p = 0; 2199 int relief_drawn_p = 0;
2262 2200
@@ -2502,9 +2440,8 @@ x_draw_glyph_string (s)
2502/* Shift display to make room for inserted glyphs. */ 2440/* Shift display to make room for inserted glyphs. */
2503 2441
2504void 2442void
2505w32_shift_glyphs_for_insert (f, x, y, width, height, shift_by) 2443w32_shift_glyphs_for_insert (struct frame *f, int x, int y,
2506 struct frame *f; 2444 int width, int height, int shift_by)
2507 int x, y, width, height, shift_by;
2508{ 2445{
2509 HDC hdc; 2446 HDC hdc;
2510 2447
@@ -2520,9 +2457,7 @@ w32_shift_glyphs_for_insert (f, x, y, width, height, shift_by)
2520 for X frames. */ 2457 for X frames. */
2521 2458
2522static void 2459static void
2523x_delete_glyphs (f, n) 2460x_delete_glyphs (struct frame *f, register int n)
2524 struct frame *f;
2525 register int n;
2526{ 2461{
2527 if (! FRAME_W32_P (f)) 2462 if (! FRAME_W32_P (f))
2528 return; 2463 return;
@@ -2592,8 +2527,7 @@ w32_ring_bell (struct frame *f)
2592 that is bounded by calls to x_update_begin and x_update_end. */ 2527 that is bounded by calls to x_update_begin and x_update_end. */
2593 2528
2594static void 2529static void
2595w32_set_terminal_window (n) 2530w32_set_terminal_window (struct frame *f, int n)
2596 register int n;
2597{ 2531{
2598 /* This function intentionally left blank. */ 2532 /* This function intentionally left blank. */
2599} 2533}
@@ -2607,9 +2541,7 @@ w32_set_terminal_window (n)
2607 lines or deleting -N lines at vertical position VPOS. */ 2541 lines or deleting -N lines at vertical position VPOS. */
2608 2542
2609static void 2543static void
2610x_ins_del_lines (f, vpos, n) 2544x_ins_del_lines (struct frame *f, int vpos, int n)
2611 struct frame *f;
2612 int vpos, n;
2613{ 2545{
2614 if (! FRAME_W32_P (f)) 2546 if (! FRAME_W32_P (f))
2615 return; 2547 return;
@@ -2621,9 +2553,7 @@ x_ins_del_lines (f, vpos, n)
2621/* Scroll part of the display as described by RUN. */ 2553/* Scroll part of the display as described by RUN. */
2622 2554
2623static void 2555static void
2624x_scroll_run (w, run) 2556x_scroll_run (struct window *w, struct run *run)
2625 struct window *w;
2626 struct run *run;
2627{ 2557{
2628 struct frame *f = XFRAME (w->frame); 2558 struct frame *f = XFRAME (w->frame);
2629 int x, y, width, height, from_y, to_y, bottom_y; 2559 int x, y, width, height, from_y, to_y, bottom_y;
@@ -2705,16 +2635,14 @@ x_scroll_run (w, run)
2705 ***********************************************************************/ 2635 ***********************************************************************/
2706 2636
2707static void 2637static void
2708frame_highlight (f) 2638frame_highlight (struct frame *f)
2709 struct frame *f;
2710{ 2639{
2711 x_update_cursor (f, 1); 2640 x_update_cursor (f, 1);
2712 x_set_frame_alpha (f); 2641 x_set_frame_alpha (f);
2713} 2642}
2714 2643
2715static void 2644static void
2716frame_unhighlight (f) 2645frame_unhighlight (struct frame *f)
2717 struct frame *f;
2718{ 2646{
2719 x_update_cursor (f, 1); 2647 x_update_cursor (f, 1);
2720 x_set_frame_alpha (f); 2648 x_set_frame_alpha (f);
@@ -2727,9 +2655,7 @@ frame_unhighlight (f)
2727 Lisp code can tell when the switch took place by examining the events. */ 2655 Lisp code can tell when the switch took place by examining the events. */
2728 2656
2729static void 2657static void
2730x_new_focus_frame (dpyinfo, frame) 2658x_new_focus_frame (struct w32_display_info *dpyinfo, struct frame *frame)
2731 struct w32_display_info *dpyinfo;
2732 struct frame *frame;
2733{ 2659{
2734 struct frame *old_focus = dpyinfo->w32_focus_frame; 2660 struct frame *old_focus = dpyinfo->w32_focus_frame;
2735 2661
@@ -2757,12 +2683,8 @@ x_new_focus_frame (dpyinfo, frame)
2757 a FOCUS_IN_EVENT into *BUFP. */ 2683 a FOCUS_IN_EVENT into *BUFP. */
2758 2684
2759static void 2685static void
2760x_focus_changed (type, state, dpyinfo, frame, bufp) 2686x_focus_changed (int type, int state, struct w32_display_info *dpyinfo,
2761 int type; 2687 struct frame *frame, struct input_event *bufp)
2762 int state;
2763 struct w32_display_info *dpyinfo;
2764 struct frame *frame;
2765 struct input_event *bufp;
2766{ 2688{
2767 if (type == WM_SETFOCUS) 2689 if (type == WM_SETFOCUS)
2768 { 2690 {
@@ -2807,10 +2729,8 @@ x_focus_changed (type, state, dpyinfo, frame, bufp)
2807 Returns FOCUS_IN_EVENT event in *BUFP. */ 2729 Returns FOCUS_IN_EVENT event in *BUFP. */
2808 2730
2809static void 2731static void
2810w32_detect_focus_change (dpyinfo, event, bufp) 2732w32_detect_focus_change (struct w32_display_info *dpyinfo, W32Msg *event,
2811 struct w32_display_info *dpyinfo; 2733 struct input_event *bufp)
2812 W32Msg *event;
2813 struct input_event *bufp;
2814{ 2734{
2815 struct frame *frame; 2735 struct frame *frame;
2816 2736
@@ -2829,8 +2749,7 @@ w32_detect_focus_change (dpyinfo, event, bufp)
2829/* Handle an event saying the mouse has moved out of an Emacs frame. */ 2749/* Handle an event saying the mouse has moved out of an Emacs frame. */
2830 2750
2831void 2751void
2832x_mouse_leave (dpyinfo) 2752x_mouse_leave (struct w32_display_info *dpyinfo)
2833 struct w32_display_info *dpyinfo;
2834{ 2753{
2835 x_new_focus_frame (dpyinfo, dpyinfo->w32_focus_event_frame); 2754 x_new_focus_frame (dpyinfo, dpyinfo->w32_focus_event_frame);
2836} 2755}
@@ -2844,8 +2763,7 @@ x_mouse_leave (dpyinfo)
2844 the appropriate X display info. */ 2763 the appropriate X display info. */
2845 2764
2846static void 2765static void
2847w32_frame_rehighlight (frame) 2766w32_frame_rehighlight (struct frame *frame)
2848 struct frame *frame;
2849{ 2767{
2850 if (! FRAME_W32_P (frame)) 2768 if (! FRAME_W32_P (frame))
2851 return; 2769 return;
@@ -2853,8 +2771,7 @@ w32_frame_rehighlight (frame)
2853} 2771}
2854 2772
2855static void 2773static void
2856x_frame_rehighlight (dpyinfo) 2774x_frame_rehighlight (struct w32_display_info *dpyinfo)
2857 struct w32_display_info *dpyinfo;
2858{ 2775{
2859 struct frame *old_highlight = dpyinfo->x_highlight_frame; 2776 struct frame *old_highlight = dpyinfo->x_highlight_frame;
2860 2777
@@ -2887,8 +2804,7 @@ x_frame_rehighlight (dpyinfo)
2887/* Convert a keysym to its name. */ 2804/* Convert a keysym to its name. */
2888 2805
2889char * 2806char *
2890x_get_keysym_name (keysym) 2807x_get_keysym_name (int keysym)
2891 int keysym;
2892{ 2808{
2893 /* Make static so we can always return it */ 2809 /* Make static so we can always return it */
2894 static char value[100]; 2810 static char value[100];
@@ -2900,7 +2816,8 @@ x_get_keysym_name (keysym)
2900 return value; 2816 return value;
2901} 2817}
2902 2818
2903static int codepage_for_locale(LCID locale) 2819static int
2820codepage_for_locale (LCID locale)
2904{ 2821{
2905 char cp[20]; 2822 char cp[20];
2906 2823
@@ -2917,11 +2834,7 @@ static int codepage_for_locale(LCID locale)
2917 the state in PUP. XBUTTON provides extra information for extended mouse 2834 the state in PUP. XBUTTON provides extra information for extended mouse
2918 button messages. Returns FALSE if unable to parse the message. */ 2835 button messages. Returns FALSE if unable to parse the message. */
2919BOOL 2836BOOL
2920parse_button (message, xbutton, pbutton, pup) 2837parse_button (int message, int xbutton, int * pbutton, int * pup)
2921 int message;
2922 int xbutton;
2923 int * pbutton;
2924 int * pup;
2925{ 2838{
2926 int button = 0; 2839 int button = 0;
2927 int up = 0; 2840 int up = 0;
@@ -2989,10 +2902,7 @@ parse_button (message, xbutton, pbutton, pup)
2989 the mouse. */ 2902 the mouse. */
2990 2903
2991static Lisp_Object 2904static Lisp_Object
2992construct_mouse_click (result, msg, f) 2905construct_mouse_click (struct input_event *result, W32Msg *msg, struct frame *f)
2993 struct input_event *result;
2994 W32Msg *msg;
2995 struct frame *f;
2996{ 2906{
2997 int button; 2907 int button;
2998 int up; 2908 int up;
@@ -3018,10 +2928,7 @@ construct_mouse_click (result, msg, f)
3018} 2928}
3019 2929
3020static Lisp_Object 2930static Lisp_Object
3021construct_mouse_wheel (result, msg, f) 2931construct_mouse_wheel (struct input_event *result, W32Msg *msg, struct frame *f)
3022 struct input_event *result;
3023 W32Msg *msg;
3024 struct frame *f;
3025{ 2932{
3026 POINT p; 2933 POINT p;
3027 int delta; 2934 int delta;
@@ -3054,10 +2961,7 @@ construct_mouse_wheel (result, msg, f)
3054} 2961}
3055 2962
3056static Lisp_Object 2963static Lisp_Object
3057construct_drag_n_drop (result, msg, f) 2964construct_drag_n_drop (struct input_event *result, W32Msg *msg, struct frame *f)
3058 struct input_event *result;
3059 W32Msg *msg;
3060 struct frame *f;
3061{ 2965{
3062 Lisp_Object files; 2966 Lisp_Object files;
3063 Lisp_Object frame; 2967 Lisp_Object frame;
@@ -3118,9 +3022,7 @@ static MSG last_mouse_motion_event;
3118static Lisp_Object last_mouse_motion_frame; 3022static Lisp_Object last_mouse_motion_frame;
3119 3023
3120static int 3024static int
3121note_mouse_movement (frame, msg) 3025note_mouse_movement (FRAME_PTR frame, MSG *msg)
3122 FRAME_PTR frame;
3123 MSG *msg;
3124{ 3026{
3125 int mouse_x = LOWORD (msg->lParam); 3027 int mouse_x = LOWORD (msg->lParam);
3126 int mouse_y = HIWORD (msg->lParam); 3028 int mouse_y = HIWORD (msg->lParam);
@@ -3168,12 +3070,15 @@ note_mouse_movement (frame, msg)
3168 Mouse Face 3070 Mouse Face
3169 ************************************************************************/ 3071 ************************************************************************/
3170 3072
3171static struct scroll_bar *x_window_to_scroll_bar (); 3073static struct scroll_bar *x_window_to_scroll_bar (Window);
3172static void x_scroll_bar_report_motion (); 3074static void x_scroll_bar_report_motion (FRAME_PTR *, Lisp_Object *,
3075 enum scroll_bar_part *,
3076 Lisp_Object *, Lisp_Object *,
3077 unsigned long *);
3173static void x_check_fullscreen (struct frame *); 3078static void x_check_fullscreen (struct frame *);
3174 3079
3175static void 3080static void
3176redo_mouse_highlight () 3081redo_mouse_highlight (void)
3177{ 3082{
3178 if (!NILP (last_mouse_motion_frame) 3083 if (!NILP (last_mouse_motion_frame)
3179 && FRAME_LIVE_P (XFRAME (last_mouse_motion_frame))) 3084 && FRAME_LIVE_P (XFRAME (last_mouse_motion_frame)))
@@ -3183,9 +3088,7 @@ redo_mouse_highlight ()
3183} 3088}
3184 3089
3185static void 3090static void
3186w32_define_cursor (window, cursor) 3091w32_define_cursor (Window window, Cursor cursor)
3187 Window window;
3188 Cursor cursor;
3189{ 3092{
3190 PostMessage (window, WM_EMACS_SETCURSOR, (WPARAM) cursor, 0); 3093 PostMessage (window, WM_EMACS_SETCURSOR, (WPARAM) cursor, 0);
3191} 3094}
@@ -3210,13 +3113,9 @@ w32_define_cursor (window, cursor)
3210 movement. */ 3113 movement. */
3211 3114
3212static void 3115static void
3213w32_mouse_position (fp, insist, bar_window, part, x, y, time) 3116w32_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window,
3214 FRAME_PTR *fp; 3117 enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y,
3215 int insist; 3118 unsigned long *time)
3216 Lisp_Object *bar_window;
3217 enum scroll_bar_part *part;
3218 Lisp_Object *x, *y;
3219 unsigned long *time;
3220{ 3119{
3221 FRAME_PTR f1; 3120 FRAME_PTR f1;
3222 3121
@@ -3307,9 +3206,7 @@ w32_mouse_position (fp, insist, bar_window, part, x, y, time)
3307 or ButtonRelase. */ 3206 or ButtonRelase. */
3308 3207
3309static void 3208static void
3310w32_handle_tool_bar_click (f, button_event) 3209w32_handle_tool_bar_click (struct frame *f, struct input_event *button_event)
3311 struct frame *f;
3312 struct input_event *button_event;
3313{ 3210{
3314 int x = XFASTINT (button_event->x); 3211 int x = XFASTINT (button_event->x);
3315 int y = XFASTINT (button_event->y); 3212 int y = XFASTINT (button_event->y);
@@ -3334,8 +3231,7 @@ w32_handle_tool_bar_click (f, button_event)
3334 bits. */ 3231 bits. */
3335 3232
3336static struct scroll_bar * 3233static struct scroll_bar *
3337x_window_to_scroll_bar (window_id) 3234x_window_to_scroll_bar (Window window_id)
3338 Window window_id;
3339{ 3235{
3340 Lisp_Object tail; 3236 Lisp_Object tail;
3341 3237
@@ -3371,9 +3267,8 @@ x_window_to_scroll_bar (window_id)
3371 displaying PORTION out of a whole WHOLE, and our position POSITION. */ 3267 displaying PORTION out of a whole WHOLE, and our position POSITION. */
3372 3268
3373static void 3269static void
3374w32_set_scroll_bar_thumb (bar, portion, position, whole) 3270w32_set_scroll_bar_thumb (struct scroll_bar *bar,
3375 struct scroll_bar *bar; 3271 int portion, int position, int whole)
3376 int portion, position, whole;
3377{ 3272{
3378 Window w = SCROLL_BAR_W32_WINDOW (bar); 3273 Window w = SCROLL_BAR_W32_WINDOW (bar);
3379 /* We use the whole scroll-bar height in the calculations below, to 3274 /* We use the whole scroll-bar height in the calculations below, to
@@ -3448,9 +3343,7 @@ w32_set_scroll_bar_thumb (bar, portion, position, whole)
3448 ************************************************************************/ 3343 ************************************************************************/
3449 3344
3450static HWND 3345static HWND
3451my_create_scrollbar (f, bar) 3346my_create_scrollbar (struct frame * f, struct scroll_bar * bar)
3452 struct frame * f;
3453 struct scroll_bar * bar;
3454{ 3347{
3455 return (HWND) SendMessage (FRAME_W32_WINDOW (f), 3348 return (HWND) SendMessage (FRAME_W32_WINDOW (f),
3456 WM_EMACS_CREATESCROLLBAR, (WPARAM) f, 3349 WM_EMACS_CREATESCROLLBAR, (WPARAM) f,
@@ -3489,26 +3382,21 @@ my_set_window_pos (HWND hwnd, HWND hwndAfter,
3489} 3382}
3490 3383
3491static void 3384static void
3492my_set_focus (f, hwnd) 3385my_set_focus (struct frame * f, HWND hwnd)
3493 struct frame * f;
3494 HWND hwnd;
3495{ 3386{
3496 SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_SETFOCUS, 3387 SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_SETFOCUS,
3497 (WPARAM) hwnd, 0); 3388 (WPARAM) hwnd, 0);
3498} 3389}
3499 3390
3500static void 3391static void
3501my_set_foreground_window (hwnd) 3392my_set_foreground_window (HWND hwnd)
3502 HWND hwnd;
3503{ 3393{
3504 SendMessage (hwnd, WM_EMACS_SETFOREGROUND, (WPARAM) hwnd, 0); 3394 SendMessage (hwnd, WM_EMACS_SETFOREGROUND, (WPARAM) hwnd, 0);
3505} 3395}
3506 3396
3507 3397
3508static void 3398static void
3509my_destroy_window (f, hwnd) 3399my_destroy_window (struct frame * f, HWND hwnd)
3510 struct frame * f;
3511 HWND hwnd;
3512{ 3400{
3513 SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_DESTROYWINDOW, 3401 SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_DESTROYWINDOW,
3514 (WPARAM) hwnd, 0); 3402 (WPARAM) hwnd, 0);
@@ -3520,9 +3408,7 @@ my_destroy_window (f, hwnd)
3520 scroll bar. */ 3408 scroll bar. */
3521 3409
3522static struct scroll_bar * 3410static struct scroll_bar *
3523x_scroll_bar_create (w, top, left, width, height) 3411x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
3524 struct window *w;
3525 int top, left, width, height;
3526{ 3412{
3527 struct frame *f = XFRAME (WINDOW_FRAME (w)); 3413 struct frame *f = XFRAME (WINDOW_FRAME (w));
3528 HWND hwnd; 3414 HWND hwnd;
@@ -3575,8 +3461,7 @@ x_scroll_bar_create (w, top, left, width, height)
3575 nil. */ 3461 nil. */
3576 3462
3577static void 3463static void
3578x_scroll_bar_remove (bar) 3464x_scroll_bar_remove (struct scroll_bar *bar)
3579 struct scroll_bar *bar;
3580{ 3465{
3581 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); 3466 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
3582 3467
@@ -3596,9 +3481,8 @@ x_scroll_bar_remove (bar)
3596 characters, starting at POSITION. If WINDOW has no scroll bar, 3481 characters, starting at POSITION. If WINDOW has no scroll bar,
3597 create one. */ 3482 create one. */
3598static void 3483static void
3599w32_set_vertical_scroll_bar (w, portion, whole, position) 3484w32_set_vertical_scroll_bar (struct window *w,
3600 struct window *w; 3485 int portion, int whole, int position)
3601 int portion, whole, position;
3602{ 3486{
3603 struct frame *f = XFRAME (w->frame); 3487 struct frame *f = XFRAME (w->frame);
3604 struct scroll_bar *bar; 3488 struct scroll_bar *bar;
@@ -3741,8 +3625,7 @@ w32_set_vertical_scroll_bar (w, portion, whole, position)
3741 `*redeem_scroll_bar_hook' is applied to its window before the judgment. */ 3625 `*redeem_scroll_bar_hook' is applied to its window before the judgment. */
3742 3626
3743static void 3627static void
3744w32_condemn_scroll_bars (frame) 3628w32_condemn_scroll_bars (FRAME_PTR frame)
3745 FRAME_PTR frame;
3746{ 3629{
3747 /* Transfer all the scroll bars to FRAME_CONDEMNED_SCROLL_BARS. */ 3630 /* Transfer all the scroll bars to FRAME_CONDEMNED_SCROLL_BARS. */
3748 while (! NILP (FRAME_SCROLL_BARS (frame))) 3631 while (! NILP (FRAME_SCROLL_BARS (frame)))
@@ -3763,8 +3646,7 @@ w32_condemn_scroll_bars (frame)
3763 Note that WINDOW isn't necessarily condemned at all. */ 3646 Note that WINDOW isn't necessarily condemned at all. */
3764 3647
3765static void 3648static void
3766w32_redeem_scroll_bar (window) 3649w32_redeem_scroll_bar (struct window *window)
3767 struct window *window;
3768{ 3650{
3769 struct scroll_bar *bar; 3651 struct scroll_bar *bar;
3770 struct frame *f; 3652 struct frame *f;
@@ -3809,8 +3691,7 @@ w32_redeem_scroll_bar (window)
3809 last call to `*condemn_scroll_bars_hook'. */ 3691 last call to `*condemn_scroll_bars_hook'. */
3810 3692
3811static void 3693static void
3812w32_judge_scroll_bars (f) 3694w32_judge_scroll_bars (FRAME_PTR f)
3813 FRAME_PTR f;
3814{ 3695{
3815 Lisp_Object bar, next; 3696 Lisp_Object bar, next;
3816 3697
@@ -3841,10 +3722,8 @@ w32_judge_scroll_bars (f)
3841 mark bits. */ 3722 mark bits. */
3842 3723
3843static int 3724static int
3844w32_scroll_bar_handle_click (bar, msg, emacs_event) 3725w32_scroll_bar_handle_click (struct scroll_bar *bar, W32Msg *msg,
3845 struct scroll_bar *bar; 3726 struct input_event *emacs_event)
3846 W32Msg *msg;
3847 struct input_event *emacs_event;
3848{ 3727{
3849 if (! WINDOWP (bar->window)) 3728 if (! WINDOWP (bar->window))
3850 abort (); 3729 abort ();
@@ -3950,12 +3829,10 @@ w32_scroll_bar_handle_click (bar, msg, emacs_event)
3950 on the scroll bar. */ 3829 on the scroll bar. */
3951 3830
3952static void 3831static void
3953x_scroll_bar_report_motion (fp, bar_window, part, x, y, time) 3832x_scroll_bar_report_motion (FRAME_PTR *fp, Lisp_Object *bar_window,
3954 FRAME_PTR *fp; 3833 enum scroll_bar_part *part,
3955 Lisp_Object *bar_window; 3834 Lisp_Object *x, Lisp_Object *y,
3956 enum scroll_bar_part *part; 3835 unsigned long *time)
3957 Lisp_Object *x, *y;
3958 unsigned long *time;
3959{ 3836{
3960 struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); 3837 struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar);
3961 Window w = SCROLL_BAR_W32_WINDOW (bar); 3838 Window w = SCROLL_BAR_W32_WINDOW (bar);
@@ -4011,8 +3888,7 @@ x_scroll_bar_report_motion (fp, bar_window, part, x, y, time)
4011 redraw them. */ 3888 redraw them. */
4012 3889
4013void 3890void
4014x_scroll_bar_clear (f) 3891x_scroll_bar_clear (FRAME_PTR f)
4015 FRAME_PTR f;
4016{ 3892{
4017 Lisp_Object bar; 3893 Lisp_Object bar;
4018 3894
@@ -4071,10 +3947,8 @@ static char dbcs_lead = 0;
4071*/ 3947*/
4072 3948
4073int 3949int
4074w32_read_socket (sd, expected, hold_quit) 3950w32_read_socket (struct terminal *terminal, int expected,
4075 register int sd; 3951 struct input_event *hold_quit)
4076 int expected;
4077 struct input_event *hold_quit;
4078{ 3952{
4079 int count = 0; 3953 int count = 0;
4080 int check_visibility = 0; 3954 int check_visibility = 0;
@@ -4903,11 +4777,7 @@ w32_read_socket (sd, expected, hold_quit)
4903 mode lines must be clipped to the whole window. */ 4777 mode lines must be clipped to the whole window. */
4904 4778
4905static void 4779static void
4906w32_clip_to_row (w, row, area, hdc) 4780w32_clip_to_row (struct window *w, struct glyph_row *row, int area, HDC hdc)
4907 struct window *w;
4908 struct glyph_row *row;
4909 int area;
4910 HDC hdc;
4911{ 4781{
4912 struct frame *f = XFRAME (WINDOW_FRAME (w)); 4782 struct frame *f = XFRAME (WINDOW_FRAME (w));
4913 RECT clip_rect; 4783 RECT clip_rect;
@@ -4928,9 +4798,7 @@ w32_clip_to_row (w, row, area, hdc)
4928/* Draw a hollow box cursor on window W in glyph row ROW. */ 4798/* Draw a hollow box cursor on window W in glyph row ROW. */
4929 4799
4930static void 4800static void
4931x_draw_hollow_cursor (w, row) 4801x_draw_hollow_cursor (struct window *w, struct glyph_row *row)
4932 struct window *w;
4933 struct glyph_row *row;
4934{ 4802{
4935 struct frame *f = XFRAME (WINDOW_FRAME (w)); 4803 struct frame *f = XFRAME (WINDOW_FRAME (w));
4936 HDC hdc; 4804 HDC hdc;
@@ -4970,11 +4838,8 @@ x_draw_hollow_cursor (w, row)
4970 --gerd. */ 4838 --gerd. */
4971 4839
4972static void 4840static void
4973x_draw_bar_cursor (w, row, width, kind) 4841x_draw_bar_cursor (struct window *w, struct glyph_row *row,
4974 struct window *w; 4842 int width, enum text_cursor_kinds kind)
4975 struct glyph_row *row;
4976 int width;
4977 enum text_cursor_kinds kind;
4978{ 4843{
4979 struct frame *f = XFRAME (w->frame); 4844 struct frame *f = XFRAME (w->frame);
4980 struct glyph *cursor_glyph; 4845 struct glyph *cursor_glyph;
@@ -5053,9 +4918,7 @@ x_draw_bar_cursor (w, row, width, kind)
5053/* RIF: Define cursor CURSOR on frame F. */ 4918/* RIF: Define cursor CURSOR on frame F. */
5054 4919
5055static void 4920static void
5056w32_define_frame_cursor (f, cursor) 4921w32_define_frame_cursor (struct frame *f, Cursor cursor)
5057 struct frame *f;
5058 Cursor cursor;
5059{ 4922{
5060 w32_define_cursor (FRAME_W32_WINDOW (f), cursor); 4923 w32_define_cursor (FRAME_W32_WINDOW (f), cursor);
5061} 4924}
@@ -5064,9 +4927,7 @@ w32_define_frame_cursor (f, cursor)
5064/* RIF: Clear area on frame F. */ 4927/* RIF: Clear area on frame F. */
5065 4928
5066static void 4929static void
5067w32_clear_frame_area (f, x, y, width, height) 4930w32_clear_frame_area (struct frame *f, int x, int y, int width, int height)
5068 struct frame *f;
5069 int x, y, width, height;
5070{ 4931{
5071 HDC hdc; 4932 HDC hdc;
5072 4933
@@ -5078,12 +4939,9 @@ w32_clear_frame_area (f, x, y, width, height)
5078/* RIF: Draw or clear cursor on window W. */ 4939/* RIF: Draw or clear cursor on window W. */
5079 4940
5080static void 4941static void
5081w32_draw_window_cursor (w, glyph_row, x, y, cursor_type, cursor_width, on_p, active_p) 4942w32_draw_window_cursor (struct window *w, struct glyph_row *glyph_row,
5082 struct window *w; 4943 int x, int y, int cursor_type, int cursor_width,
5083 struct glyph_row *glyph_row; 4944 int on_p, int active_p)
5084 int x, y;
5085 int cursor_type, cursor_width;
5086 int on_p, active_p;
5087{ 4945{
5088 if (on_p) 4946 if (on_p)
5089 { 4947 {
@@ -5178,9 +5036,7 @@ w32_draw_window_cursor (w, glyph_row, x, y, cursor_type, cursor_width, on_p, act
5178/* Icons. */ 5036/* Icons. */
5179 5037
5180int 5038int
5181x_bitmap_icon (f, icon) 5039x_bitmap_icon (struct frame *f, Lisp_Object icon)
5182 struct frame *f;
5183 Lisp_Object icon;
5184{ 5040{
5185 HANDLE main_icon; 5041 HANDLE main_icon;
5186 HANDLE small_icon = NULL; 5042 HANDLE small_icon = NULL;
@@ -5269,10 +5125,7 @@ x_io_error_quitter (display)
5269/* Changing the font of the frame. */ 5125/* Changing the font of the frame. */
5270 5126
5271Lisp_Object 5127Lisp_Object
5272x_new_font (f, font_object, fontset) 5128x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
5273 struct frame *f;
5274 Lisp_Object font_object;
5275 int fontset;
5276{ 5129{
5277 struct font *font = XFONT_OBJECT (font_object); 5130 struct font *font = XFONT_OBJECT (font_object);
5278 5131
@@ -5340,8 +5193,7 @@ xim_close_dpy (dpyinfo)
5340 from its current recorded position values and gravity. */ 5193 from its current recorded position values and gravity. */
5341 5194
5342void 5195void
5343x_calc_absolute_position (f) 5196x_calc_absolute_position (struct frame *f)
5344 struct frame *f;
5345{ 5197{
5346 int flags = f->size_hint_flags; 5198 int flags = f->size_hint_flags;
5347 5199
@@ -5401,10 +5253,8 @@ x_calc_absolute_position (f)
5401 which means, do adjust for borders but don't change the gravity. */ 5253 which means, do adjust for borders but don't change the gravity. */
5402 5254
5403void 5255void
5404x_set_offset (f, xoff, yoff, change_gravity) 5256x_set_offset (struct frame *f, register int xoff, register int yoff,
5405 struct frame *f; 5257 int change_gravity)
5406 register int xoff, yoff;
5407 int change_gravity;
5408{ 5258{
5409 int modified_top, modified_left; 5259 int modified_top, modified_left;
5410 5260
@@ -5439,8 +5289,7 @@ x_set_offset (f, xoff, yoff, change_gravity)
5439/* Check if we need to resize the frame due to a fullscreen request. 5289/* Check if we need to resize the frame due to a fullscreen request.
5440 If so needed, resize the frame. */ 5290 If so needed, resize the frame. */
5441static void 5291static void
5442x_check_fullscreen (f) 5292x_check_fullscreen (struct frame *f)
5443 struct frame *f;
5444{ 5293{
5445 if (f->want_fullscreen & FULLSCREEN_BOTH) 5294 if (f->want_fullscreen & FULLSCREEN_BOTH)
5446 { 5295 {
@@ -5470,10 +5319,7 @@ x_check_fullscreen (f)
5470 Otherwise we leave the window gravity unchanged. */ 5319 Otherwise we leave the window gravity unchanged. */
5471 5320
5472void 5321void
5473x_set_window_size (f, change_gravity, cols, rows) 5322x_set_window_size (struct frame *f, int change_gravity, int cols, int rows)
5474 struct frame *f;
5475 int change_gravity;
5476 int cols, rows;
5477{ 5323{
5478 int pixelwidth, pixelheight; 5324 int pixelwidth, pixelheight;
5479 5325
@@ -5565,9 +5411,7 @@ x_set_window_size (f, change_gravity, cols, rows)
5565void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y); 5411void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y);
5566 5412
5567void 5413void
5568x_set_mouse_position (f, x, y) 5414x_set_mouse_position (struct frame *f, int x, int y)
5569 struct frame *f;
5570 int x, y;
5571{ 5415{
5572 int pix_x, pix_y; 5416 int pix_x, pix_y;
5573 5417
@@ -5584,9 +5428,7 @@ x_set_mouse_position (f, x, y)
5584} 5428}
5585 5429
5586void 5430void
5587x_set_mouse_pixel_position (f, pix_x, pix_y) 5431x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
5588 struct frame *f;
5589 int pix_x, pix_y;
5590{ 5432{
5591 RECT rect; 5433 RECT rect;
5592 POINT pt; 5434 POINT pt;
@@ -5607,8 +5449,7 @@ x_set_mouse_pixel_position (f, pix_x, pix_y)
5607/* focus shifting, raising and lowering. */ 5449/* focus shifting, raising and lowering. */
5608 5450
5609void 5451void
5610x_focus_on_frame (f) 5452x_focus_on_frame (struct frame *f)
5611 struct frame *f;
5612{ 5453{
5613 struct w32_display_info *dpyinfo = &one_w32_display_info; 5454 struct w32_display_info *dpyinfo = &one_w32_display_info;
5614 5455
@@ -5625,15 +5466,13 @@ x_focus_on_frame (f)
5625} 5466}
5626 5467
5627void 5468void
5628x_unfocus_frame (f) 5469x_unfocus_frame (struct frame *f)
5629 struct frame *f;
5630{ 5470{
5631} 5471}
5632 5472
5633/* Raise frame F. */ 5473/* Raise frame F. */
5634void 5474void
5635x_raise_frame (f) 5475x_raise_frame (struct frame *f)
5636 struct frame *f;
5637{ 5476{
5638 BLOCK_INPUT; 5477 BLOCK_INPUT;
5639 5478
@@ -5692,8 +5531,7 @@ x_raise_frame (f)
5692 5531
5693/* Lower frame F. */ 5532/* Lower frame F. */
5694void 5533void
5695x_lower_frame (f) 5534x_lower_frame (struct frame *f)
5696 struct frame *f;
5697{ 5535{
5698 BLOCK_INPUT; 5536 BLOCK_INPUT;
5699 my_set_window_pos (FRAME_W32_WINDOW (f), 5537 my_set_window_pos (FRAME_W32_WINDOW (f),
@@ -5704,9 +5542,7 @@ x_lower_frame (f)
5704} 5542}
5705 5543
5706static void 5544static void
5707w32_frame_raise_lower (f, raise_flag) 5545w32_frame_raise_lower (FRAME_PTR f, int raise_flag)
5708 FRAME_PTR f;
5709 int raise_flag;
5710{ 5546{
5711 if (! FRAME_W32_P (f)) 5547 if (! FRAME_W32_P (f))
5712 return; 5548 return;
@@ -5727,8 +5563,7 @@ w32_frame_raise_lower (f, raise_flag)
5727 finishes with it. */ 5563 finishes with it. */
5728 5564
5729void 5565void
5730x_make_frame_visible (f) 5566x_make_frame_visible (struct frame *f)
5731 struct frame *f;
5732{ 5567{
5733 Lisp_Object type; 5568 Lisp_Object type;
5734 5569
@@ -5820,8 +5655,8 @@ x_make_frame_visible (f)
5820 5655
5821/* Make the frame visible (mapped and not iconified). */ 5656/* Make the frame visible (mapped and not iconified). */
5822 5657
5823x_make_frame_invisible (f) 5658void
5824 struct frame *f; 5659x_make_frame_invisible (struct frame *f)
5825{ 5660{
5826 /* Don't keep the highlight on an invisible frame. */ 5661 /* Don't keep the highlight on an invisible frame. */
5827 if (FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame == f) 5662 if (FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame == f)
@@ -5847,8 +5682,7 @@ x_make_frame_invisible (f)
5847/* Change window state from mapped to iconified. */ 5682/* Change window state from mapped to iconified. */
5848 5683
5849void 5684void
5850x_iconify_frame (f) 5685x_iconify_frame (struct frame *f)
5851 struct frame *f;
5852{ 5686{
5853 Lisp_Object type; 5687 Lisp_Object type;
5854 5688
@@ -5934,8 +5768,7 @@ x_free_frame_resources (f)
5934 5768
5935/* Destroy the window of frame F. */ 5769/* Destroy the window of frame F. */
5936void 5770void
5937x_destroy_window (f) 5771x_destroy_window (struct frame *f)
5938 struct frame *f;
5939{ 5772{
5940 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); 5773 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
5941 5774
@@ -5952,10 +5785,7 @@ x_destroy_window (f)
5952 If USER_POSITION is nonzero, we set the USPosition 5785 If USER_POSITION is nonzero, we set the USPosition
5953 flag (this is useful when FLAGS is 0). */ 5786 flag (this is useful when FLAGS is 0). */
5954void 5787void
5955x_wm_set_size_hint (f, flags, user_position) 5788x_wm_set_size_hint (struct frame *f, long flags, int user_position)
5956 struct frame *f;
5957 long flags;
5958 int user_position;
5959{ 5789{
5960 Window window = FRAME_W32_WINDOW (f); 5790 Window window = FRAME_W32_WINDOW (f);
5961 5791
@@ -5971,9 +5801,7 @@ x_wm_set_size_hint (f, flags, user_position)
5971 5801
5972/* Window manager things */ 5802/* Window manager things */
5973void 5803void
5974x_wm_set_icon_position (f, icon_x, icon_y) 5804x_wm_set_icon_position (struct frame *f, int icon_x, int icon_y)
5975 struct frame *f;
5976 int icon_x, icon_y;
5977{ 5805{
5978#if 0 5806#if 0
5979 Window window = FRAME_W32_WINDOW (f); 5807 Window window = FRAME_W32_WINDOW (f);
@@ -5994,8 +5822,7 @@ x_wm_set_icon_position (f, icon_x, icon_y)
5994static int w32_initialized = 0; 5822static int w32_initialized = 0;
5995 5823
5996void 5824void
5997w32_initialize_display_info (display_name) 5825w32_initialize_display_info (Lisp_Object display_name)
5998 Lisp_Object display_name;
5999{ 5826{
6000 struct w32_display_info *dpyinfo = &one_w32_display_info; 5827 struct w32_display_info *dpyinfo = &one_w32_display_info;
6001 5828
@@ -6048,8 +5875,7 @@ w32_initialize_display_info (display_name)
6048 but any whitespace following value is not removed. */ 5875 but any whitespace following value is not removed. */
6049 5876
6050static char * 5877static char *
6051w32_make_rdb (xrm_option) 5878w32_make_rdb (char *xrm_option)
6052 char *xrm_option;
6053{ 5879{
6054 char *buffer = xmalloc (strlen (xrm_option) + 2); 5880 char *buffer = xmalloc (strlen (xrm_option) + 2);
6055 char *current = buffer; 5881 char *current = buffer;
@@ -6208,10 +6034,7 @@ x_delete_terminal (struct terminal *terminal)
6208} 6034}
6209 6035
6210struct w32_display_info * 6036struct w32_display_info *
6211w32_term_init (display_name, xrm_option, resource_name) 6037w32_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
6212 Lisp_Object display_name;
6213 char *xrm_option;
6214 char *resource_name;
6215{ 6038{
6216 struct w32_display_info *dpyinfo; 6039 struct w32_display_info *dpyinfo;
6217 struct terminal *terminal; 6040 struct terminal *terminal;
@@ -6286,8 +6109,7 @@ w32_term_init (display_name, xrm_option, resource_name)
6286 6109
6287/* Get rid of display DPYINFO, assuming all frames are already gone. */ 6110/* Get rid of display DPYINFO, assuming all frames are already gone. */
6288void 6111void
6289x_delete_display (dpyinfo) 6112x_delete_display (struct w32_display_info *dpyinfo)
6290 struct w32_display_info *dpyinfo;
6291{ 6113{
6292 /* Discard this display from w32_display_name_list and w32_display_list. 6114 /* Discard this display from w32_display_name_list and w32_display_list.
6293 We can't use Fdelq because that can quit. */ 6115 We can't use Fdelq because that can quit. */
@@ -6335,7 +6157,7 @@ x_delete_display (dpyinfo)
6335DWORD WINAPI w32_msg_worker (void * arg); 6157DWORD WINAPI w32_msg_worker (void * arg);
6336 6158
6337static void 6159static void
6338w32_initialize () 6160w32_initialize (void)
6339{ 6161{
6340 HANDLE shell; 6162 HANDLE shell;
6341 HRESULT (WINAPI * set_user_model) (wchar_t * id); 6163 HRESULT (WINAPI * set_user_model) (wchar_t * id);
@@ -6438,7 +6260,7 @@ w32_initialize ()
6438} 6260}
6439 6261
6440void 6262void
6441syms_of_w32term () 6263syms_of_w32term (void)
6442{ 6264{
6443 staticpro (&w32_display_name_list); 6265 staticpro (&w32_display_name_list);
6444 w32_display_name_list = Qnil; 6266 w32_display_name_list = Qnil;
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c
index 9b5bd141d77..d7aeb7046c8 100644
--- a/src/w32uniscribe.c
+++ b/src/w32uniscribe.c
@@ -64,8 +64,7 @@ static int CALLBACK add_opentype_font_name_to_list (ENUMLOGFONTEX *,
64static Lisp_Object otf_features (HDC context, char *table); 64static Lisp_Object otf_features (HDC context, char *table);
65 65
66static int 66static int
67memq_no_quit (elt, list) 67memq_no_quit (Lisp_Object elt, Lisp_Object list)
68 Lisp_Object elt, list;
69{ 68{
70 while (CONSP (list) && ! EQ (XCAR (list), elt)) 69 while (CONSP (list) && ! EQ (XCAR (list), elt))
71 list = XCDR (list); 70 list = XCDR (list);
@@ -75,8 +74,7 @@ memq_no_quit (elt, list)
75 74
76/* Font backend interface implementation. */ 75/* Font backend interface implementation. */
77static Lisp_Object 76static Lisp_Object
78uniscribe_list (frame, font_spec) 77uniscribe_list (Lisp_Object frame, Lisp_Object font_spec)
79 Lisp_Object frame, font_spec;
80{ 78{
81 Lisp_Object fonts = w32font_list_internal (frame, font_spec, 1); 79 Lisp_Object fonts = w32font_list_internal (frame, font_spec, 1);
82 FONT_ADD_LOG ("uniscribe-list", font_spec, fonts); 80 FONT_ADD_LOG ("uniscribe-list", font_spec, fonts);
@@ -84,8 +82,7 @@ uniscribe_list (frame, font_spec)
84} 82}
85 83
86static Lisp_Object 84static Lisp_Object
87uniscribe_match (frame, font_spec) 85uniscribe_match (Lisp_Object frame, Lisp_Object font_spec)
88 Lisp_Object frame, font_spec;
89{ 86{
90 Lisp_Object entity = w32font_match_internal (frame, font_spec, 1); 87 Lisp_Object entity = w32font_match_internal (frame, font_spec, 1);
91 FONT_ADD_LOG ("uniscribe-match", font_spec, entity); 88 FONT_ADD_LOG ("uniscribe-match", font_spec, entity);
@@ -93,8 +90,7 @@ uniscribe_match (frame, font_spec)
93} 90}
94 91
95static Lisp_Object 92static Lisp_Object
96uniscribe_list_family (frame) 93uniscribe_list_family (Lisp_Object frame)
97 Lisp_Object frame;
98{ 94{
99 Lisp_Object list = Qnil; 95 Lisp_Object list = Qnil;
100 LOGFONT font_match_pattern; 96 LOGFONT font_match_pattern;
@@ -116,10 +112,7 @@ uniscribe_list_family (frame)
116} 112}
117 113
118static Lisp_Object 114static Lisp_Object
119uniscribe_open (f, font_entity, pixel_size) 115uniscribe_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size)
120 FRAME_PTR f;
121 Lisp_Object font_entity;
122 int pixel_size;
123{ 116{
124 Lisp_Object font_object 117 Lisp_Object font_object
125 = font_make_object (VECSIZE (struct uniscribe_font_info), 118 = font_make_object (VECSIZE (struct uniscribe_font_info),
@@ -148,9 +141,7 @@ uniscribe_open (f, font_entity, pixel_size)
148} 141}
149 142
150static void 143static void
151uniscribe_close (f, font) 144uniscribe_close (FRAME_PTR f, struct font *font)
152 FRAME_PTR f;
153 struct font *font;
154{ 145{
155 struct uniscribe_font_info *uniscribe_font 146 struct uniscribe_font_info *uniscribe_font
156 = (struct uniscribe_font_info *) font; 147 = (struct uniscribe_font_info *) font;
@@ -164,8 +155,7 @@ uniscribe_close (f, font)
164/* Return a list describing which scripts/languages FONT supports by 155/* Return a list describing which scripts/languages FONT supports by
165 which GSUB/GPOS features of OpenType tables. */ 156 which GSUB/GPOS features of OpenType tables. */
166static Lisp_Object 157static Lisp_Object
167uniscribe_otf_capability (font) 158uniscribe_otf_capability (struct font *font)
168 struct font *font;
169{ 159{
170 HDC context; 160 HDC context;
171 HFONT old_font; 161 HFONT old_font;
@@ -202,8 +192,7 @@ uniscribe_otf_capability (font)
202 than the length of LGSTRING, nil should be return. In that case, 192 than the length of LGSTRING, nil should be return. In that case,
203 this function is called again with the larger LGSTRING. */ 193 this function is called again with the larger LGSTRING. */
204static Lisp_Object 194static Lisp_Object
205uniscribe_shape (lgstring) 195uniscribe_shape (Lisp_Object lgstring)
206 Lisp_Object lgstring;
207{ 196{
208 struct font * font; 197 struct font * font;
209 struct uniscribe_font_info * uniscribe_font; 198 struct uniscribe_font_info * uniscribe_font;
@@ -451,9 +440,7 @@ uniscribe_shape (lgstring)
451 Return a glyph code of FONT for characer C (Unicode code point). 440 Return a glyph code of FONT for characer C (Unicode code point).
452 If FONT doesn't have such a glyph, return FONT_INVALID_CODE. */ 441 If FONT doesn't have such a glyph, return FONT_INVALID_CODE. */
453static unsigned 442static unsigned
454uniscribe_encode_char (font, c) 443uniscribe_encode_char (struct font *font, int c)
455 struct font *font;
456 int c;
457{ 444{
458 HDC context = NULL; 445 HDC context = NULL;
459 struct frame *f = NULL; 446 struct frame *f = NULL;
@@ -574,12 +561,9 @@ uniscribe_encode_char (font, c)
574 Adds the name of opentype fonts to a Lisp list (passed in as the 561 Adds the name of opentype fonts to a Lisp list (passed in as the
575 lParam arg). */ 562 lParam arg). */
576static int CALLBACK 563static int CALLBACK
577add_opentype_font_name_to_list (logical_font, physical_font, font_type, 564add_opentype_font_name_to_list (ENUMLOGFONTEX *logical_font,
578 list_object) 565 NEWTEXTMETRICEX *physical_font,
579 ENUMLOGFONTEX *logical_font; 566 DWORD font_type, LPARAM list_object)
580 NEWTEXTMETRICEX *physical_font;
581 DWORD font_type;
582 LPARAM list_object;
583{ 567{
584 Lisp_Object* list = (Lisp_Object *) list_object; 568 Lisp_Object* list = (Lisp_Object *) list_object;
585 Lisp_Object family; 569 Lisp_Object family;
@@ -650,9 +634,8 @@ static char* NOTHING = " ";
650/* Check if font supports the otf script/language/features specified. 634/* Check if font supports the otf script/language/features specified.
651 OTF_SPEC is in the format 635 OTF_SPEC is in the format
652 (script lang [(gsub_feature ...)|nil] [(gpos_feature ...)]?) */ 636 (script lang [(gsub_feature ...)|nil] [(gpos_feature ...)]?) */
653int uniscribe_check_otf (font, otf_spec) 637int
654 LOGFONT *font; 638uniscribe_check_otf (LOGFONT *font, Lisp_Object otf_spec)
655 Lisp_Object otf_spec;
656{ 639{
657 Lisp_Object script, lang, rest; 640 Lisp_Object script, lang, rest;
658 Lisp_Object features[2]; 641 Lisp_Object features[2];
@@ -947,7 +930,7 @@ struct font_driver uniscribe_font_driver =
947 NULL, /* get_outline */ 930 NULL, /* get_outline */
948 NULL, /* free_outline */ 931 NULL, /* free_outline */
949 NULL, /* anchor_point */ 932 NULL, /* anchor_point */
950 uniscribe_otf_capability, /* Defined so (font-get FONTOBJ :otf) works. */ 933 uniscribe_otf_capability, /* Defined so (font-get FONTOBJ :otf) works. */
951 NULL, /* otf_drive - use shape instead. */ 934 NULL, /* otf_drive - use shape instead. */
952 NULL, /* start_for_frame */ 935 NULL, /* start_for_frame */
953 NULL, /* end_for_frame */ 936 NULL, /* end_for_frame */
@@ -957,7 +940,7 @@ struct font_driver uniscribe_font_driver =
957/* Note that this should be called at every startup, not just when dumping, 940/* Note that this should be called at every startup, not just when dumping,
958 as it needs to test for the existence of the Uniscribe library. */ 941 as it needs to test for the existence of the Uniscribe library. */
959void 942void
960syms_of_w32uniscribe () 943syms_of_w32uniscribe (void)
961{ 944{
962 HMODULE uniscribe; 945 HMODULE uniscribe;
963 946
diff --git a/src/w32xfns.c b/src/w32xfns.c
index d77eb6b68ea..a929e45cf6d 100644
--- a/src/w32xfns.c
+++ b/src/w32xfns.c
@@ -39,7 +39,7 @@ HANDLE input_available = NULL;
39HANDLE interrupt_handle = NULL; 39HANDLE interrupt_handle = NULL;
40 40
41void 41void
42init_crit () 42init_crit (void)
43{ 43{
44 InitializeCriticalSection (&critsect); 44 InitializeCriticalSection (&critsect);
45 45
@@ -57,7 +57,7 @@ init_crit ()
57} 57}
58 58
59void 59void
60delete_crit () 60delete_crit (void)
61{ 61{
62 DeleteCriticalSection (&critsect); 62 DeleteCriticalSection (&critsect);
63 63
@@ -74,7 +74,7 @@ delete_crit ()
74} 74}
75 75
76void 76void
77signal_quit () 77signal_quit (void)
78{ 78{
79 /* Make sure this event never remains signaled; if the main thread 79 /* Make sure this event never remains signaled; if the main thread
80 isn't in a blocking call, then this should do nothing. */ 80 isn't in a blocking call, then this should do nothing. */
@@ -161,9 +161,7 @@ int_msg *lpTail = NULL;
161int nQueue = 0; 161int nQueue = 0;
162 162
163BOOL 163BOOL
164get_next_msg (lpmsg, bWait) 164get_next_msg (W32Msg * lpmsg, BOOL bWait)
165 W32Msg * lpmsg;
166 BOOL bWait;
167{ 165{
168 BOOL bRet = FALSE; 166 BOOL bRet = FALSE;
169 167
@@ -245,8 +243,7 @@ get_next_msg (lpmsg, bWait)
245} 243}
246 244
247BOOL 245BOOL
248post_msg (lpmsg) 246post_msg (W32Msg * lpmsg)
249 W32Msg * lpmsg;
250{ 247{
251 int_msg * lpNew = (int_msg *) myalloc (sizeof (int_msg)); 248 int_msg * lpNew = (int_msg *) myalloc (sizeof (int_msg));
252 249
@@ -298,7 +295,7 @@ prepend_msg (W32Msg *lpmsg)
298 295
299/* Process all messages in the current thread's queue. */ 296/* Process all messages in the current thread's queue. */
300void 297void
301drain_message_queue () 298drain_message_queue (void)
302{ 299{
303 MSG msg; 300 MSG msg;
304 while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) 301 while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
@@ -322,9 +319,7 @@ drain_message_queue ()
322 */ 319 */
323 320
324static int 321static int
325read_integer (string, NextString) 322read_integer (register char *string, char **NextString)
326 register char *string;
327 char **NextString;
328{ 323{
329 register int Result = 0; 324 register int Result = 0;
330 int Sign = 1; 325 int Sign = 1;
@@ -348,10 +343,9 @@ read_integer (string, NextString)
348} 343}
349 344
350int 345int
351XParseGeometry (string, x, y, width, height) 346XParseGeometry (char *string,
352 char *string; 347 int *x, int *y,
353 int *x, *y; 348 unsigned int *width, unsigned int *height)
354 unsigned int *width, *height; /* RETURN */
355{ 349{
356 int mask = NoValue; 350 int mask = NoValue;
357 register char *strind; 351 register char *strind;
@@ -446,8 +440,7 @@ XParseGeometry (string, x, y, width, height)
446 440
447/* x_sync is a no-op on W32. */ 441/* x_sync is a no-op on W32. */
448void 442void
449x_sync (f) 443x_sync (void *f)
450 void *f;
451{ 444{
452} 445}
453 446